-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: As a Developer, I would like to import types from @carbon/react
#16436
Comments
Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team. |
Yes this isn't exported from the root, but it's exported from the root source file and so you can import them like this: import { TYPES } from '@carbon/react/es/components/Tag/Tag'; I'm not opposed to adding these to the root exports, but we won't be able to do that until everything is converted to .ts, #12513, #16360 For now I'll add this as a subitem of #16154 |
@carbon/react
I think we have to have all the export types to be named |
Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team. |
If we upgrade to TS v5 we'd be able to just use
in here
|
The problem
Users are often using reusable components to render Tags with different colors (type) based on some status.
To achieve this, a TagType enum needs to be defined because we can not import it from carbon/react.
For instance:
The solution
Could be nice to define and export a
TagType
containing all supported types and then import it so that we can use it in our interfaces, couple of examples below.Examples
Example of an interface for Props, with tagType
Application/PAL
No response
Business priority
Low Priority = release date is not dependent on fix or not upcoming
Available extra resources
I'm happy to contribute if this change can be useful.
Code of Conduct
The text was updated successfully, but these errors were encountered: