Skip to content

Conversation

@ToMESSKa
Copy link
Contributor

@ToMESSKa ToMESSKa commented Nov 12, 2025

INSTUI-4838

ISSUE:

  • this the V12 rework of the Metric component

TEST PLAN:

@ToMESSKa ToMESSKa self-assigned this Nov 12, 2025
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://instructure.design/pr-preview/pr-2240/

Built to branch gh-pages at 2025-11-19 10:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@ToMESSKa ToMESSKa requested review from HerrTopi and matyasf November 13, 2025 08:04
Comment on lines +5 to +9
### Upgrade Guide for V12

> - theme variable `padding` is now removed, left-right padding can be set now with the `paddingHorizontal` theme variable
> - theme variable `fontFamily` is now removed, font can be set independently on the value and label elements using the `valueFontFamily` and `labelFontFamily` variables respectively
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put the upgrade guides in the README.md as suggested by Topi, but I can copy these in the Upgrade Guide for Version 12 file started by Matyi

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 these should all the in the same place, the upgrade guide. We dont want to instruct users to open 50+ Readme files.

@ToMESSKa ToMESSKa force-pushed the INSTUI-4838-metric-rework branch from fffc950 to 4ef79e6 Compare November 19, 2025 10:45
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.

see comments

Comment on lines +5 to +9
### Upgrade Guide for V12

> - theme variable `padding` is now removed, left-right padding can be set now with the `paddingHorizontal` theme variable
> - theme variable `fontFamily` is now removed, font can be set independently on the value and label elements using the `valueFontFamily` and `labelFontFamily` variables respectively
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 these should all the in the same place, the upgrade guide. We dont want to instruct users to open 50+ Readme files.

ref: Element | null = null
const styles = useStyle({
generateStyle,
generateComponentTheme,
Copy link
Collaborator

Choose a reason for hiding this comment

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

generateComponentTheme is no longer used, you can delete it from here and the file too.

Comment on lines +30 to +31
isGroupChild: MetricProps['isGroupChild']
themeOverride?: MetricProps['themeOverride']
Copy link
Collaborator

Choose a reason for hiding this comment

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

You dont need to supply these 2, they are not used.

handleRef = (el: Element | null) => {
this.ref = el
}
useImperativeHandle(ref, () => elementRef.current as HTMLDivElement)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed for ref? Wont this value returned by default?

generateComponentTheme,
componentId: 'MetricGroup',
displayName: 'MetricGroup'
})
Copy link
Collaborator

@matyasf matyasf Nov 19, 2025

Choose a reason for hiding this comment

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

hmm this is not nice, we have to improve useStyle so it can nicely handle style.ts files which have no theme (in a different PR). Can you please put a TODO comment to useStyle that it should be improved to handle generateStyle functions, that dont use params or dont have a theme?

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.

3 participants