Skip to content

Conversation

@ToMESSKa
Copy link
Contributor

@ToMESSKa ToMESSKa commented Nov 28, 2025

INSTUI-4812

ISSUE:

this PR:

  • updates the texArea tokens
  • collapses 'newError' and 'error' type in FormField and both types have functionality of 'newError'
  • migrates the asterisk logic from components using FormField into FormFieldLayout
  • updates FormField tokens
  • disables 'success' and 'success' messages when the component using FormField is 'disabled' or 'readOnly'

TEST PLAN:

const messages = showError
    ? [{type: 'error', text: showLongError ? 'Long error....
  • on Form Errors page the asterisk should appear when the isRequired is true
  • open the FormField and FormFieldGroup pages, and test the examples, the layout should be the same as on the latest version (except the success state having an icon and the new error style should be applied instead of the old one)
  • check TextInput, NumberInput, RadioInputGroup and TextArea, 'error' and 'success' messages should not appear when the component is 'disabled' or 'readOnly', but 'hint' type should
  • check TextArea, the border's color should not be green/red, when it is in a success/error state and 'disabled' or 'readOnly' at the same time. In case of readOnly, the focus outline should not be green/red either

@ToMESSKa ToMESSKa self-assigned this Nov 28, 2025
@ToMESSKa ToMESSKa force-pushed the INSTUI-4812-text-area-rework branch 2 times, most recently from 6a10c93 to 1049f95 Compare November 28, 2025 12:10
@github-actions
Copy link

github-actions bot commented Nov 28, 2025

PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2025-12-03 13:29 UTC

@ToMESSKa ToMESSKa closed this Nov 28, 2025
@ToMESSKa ToMESSKa force-pushed the INSTUI-4812-text-area-rework branch from 1049f95 to e010ea4 Compare November 28, 2025 13:05
@ToMESSKa ToMESSKa reopened this Nov 28, 2025
@ToMESSKa ToMESSKa force-pushed the INSTUI-4812-text-area-rework branch from 0d24a0d to 03b756d Compare November 28, 2025 13:50
Comment on lines +150 to +168
css={invalid ? styles?.requiredAsterisk : {}}
aria-hidden={true}
>
{' '}
*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic rendering the asterisk has been moved to FormFieldLayout for the other components to here.

Comment on lines +80 to +86
{shouldShowIcon && (
<span css={styles?.icon}>
{isErrorVariant ? (
<AlertCircleInstUIIcon size="sm" color="errorColor" />
) : (
<CheckCircle2InstUIIcon size="sm" color="successColor" />
)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

now in the case of success and error (and newError), an icon is rendered

Comment on lines -36 to -41
const generateStyle = (componentTheme: RadioInputGroupTheme): RadioInputGroupStyle => {
const { invalidAsteriskColor } = componentTheme

return {
invalidAsterisk: {
color: invalidAsteriskColor
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as the only theme variable invalidAsteriskColor has been removed, I removed the styles.ts too

Comment on lines -393 to -400
<span
css={this.props.styles?.textAreaOutline}
aria-hidden="true"
ref={(e) => {
this._highlightRef = e
}}
/>
) : null}
Copy link
Contributor Author

@ToMESSKa ToMESSKa Nov 28, 2025

Choose a reason for hiding this comment

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

As applying the focus outline was delegated to calcFocusOutlineStyles even when the TextArea is resized, this span was no loner needed was removed

Comment on lines -110 to -131
componentDidMount() {
this.myObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
if (this._highlightRef) {
const entryStyle = window.getComputedStyle(entry.target)
this._highlightRef.style.transition = 'none'
this._highlightRef.style.width = `calc(${entryStyle.width} + 0.5rem)`
this._highlightRef.style.height = `calc(${entryStyle.height} + 0.5rem)`
clearTimeout(this.resizeTimeout)

this.resizeTimeout = setTimeout(() => {
if (this._highlightRef) {
this._highlightRef.style.transition = 'all 0.2s'
}
}, 500)
}
}
})
}, [])

this.autoGrow()
this.props.makeStyles?.()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this logic was deleted as calcFocusOutlineStyles is used for focus outline even when the TextArea is getting resized

Comment on lines -107 to -122
textAreaOutline: {
label: 'textArea__outline',
pointerEvents: 'none',
position: 'absolute',
display: 'block',
boxSizing: 'border-box',
top: '-0.25rem',
bottom: '-0.25rem',
left: '-0.25rem',
right: '-0.25rem',
border: `${componentTheme.focusOutlineWidth} ${componentTheme.focusOutlineStyle} ${componentTheme.focusOutlineColor}`,
borderRadius: `calc(${componentTheme.borderRadius} * 1.5)`,
transition: 'all 0.2s',
// properties to transition on :focus
opacity: 0,
transform: 'scale(0.95)'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is also not needed anymore as calcFocusOutlineStyles is used

@ToMESSKa ToMESSKa requested a review from matyasf November 28, 2025 15:46
@ToMESSKa ToMESSKa marked this pull request as ready for review November 28, 2025 15:46
@ToMESSKa ToMESSKa requested a review from balzss November 28, 2025 15:47
@matyasf matyasf requested review from joyenjoyer and removed request for balzss December 1, 2025 09:44
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

FYI: The focus ring does not animate because of a bug in the focus outline calculation, its fixed in the NumberInput PR.

Very nice work, see my comments for changes

@ToMESSKa ToMESSKa force-pushed the INSTUI-4812-text-area-rework branch from 03b756d to 87a2aa6 Compare December 2, 2025 15:08
@ToMESSKa ToMESSKa requested a review from matyasf December 2, 2025 15:32
**/
@withDeterministicId()
@withStyle(generateStyle, generateComponentTheme)
class RadioInputGroup extends Component<
Copy link
Contributor

Choose a reason for hiding this comment

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

Why didn't you change this to functional component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joyenjoyer I only changed those components to functional which needed their tokens rewired as a part of this PR and needed the useStyle hook to make it work. But as we agreed, the conversion to functional components is not a priority anymore.

) : (
rawLabel
)
const label = callRenderProp(renderLabel)
Copy link
Contributor

@joyenjoyer joyenjoyer Dec 3, 2025

Choose a reason for hiding this comment

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

You may consider using React.createElement here instead of callRenderProp. We would like to deprecate it soon.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm we should check that this is not a breaking change, e.g. make 100% sure that React.createElement can handle everything that callRenderProp can (e.g. just a string, a JSX, a React class component,...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joyenjoyer I talked to @matyasf about this and he suggested to leave it as it is for now.

) : (
rawLabel
)
const label = callRenderProp(renderLabel)
Copy link
Contributor

Choose a reason for hiding this comment

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

You may consider React.createElement here instead of callRenderProp. We would like to deprecate it soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joyenjoyer see above

Copy link
Contributor

@joyenjoyer joyenjoyer left a comment

Choose a reason for hiding this comment

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

I checked the design and went through the code. Very nice job! Left some minor comments/questions. I see that you changed some components to functional but not all of them. Why?

@ToMESSKa ToMESSKa requested a review from joyenjoyer December 3, 2025 10:15
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

nice work, I just found 1 issue

@ToMESSKa ToMESSKa requested a review from matyasf December 3, 2025 11:07
@ToMESSKa ToMESSKa merged commit 167222f into v12 Dec 3, 2025
8 of 9 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4812-text-area-rework branch December 3, 2025 13:29
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.

4 participants