Skip to content
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

Expose constants (types & enums) #14

Open
SanderVanHullebusch opened this issue Nov 22, 2023 · 4 comments
Open

Expose constants (types & enums) #14

SanderVanHullebusch opened this issue Nov 22, 2023 · 4 comments

Comments

@SanderVanHullebusch
Copy link

There are lots of enums and constants that will be very helpfull to be used in our projects where @a-ui is being used.

I tried to import enums/constants/.. from the following folder but this isn't found since it isn't exposed.
https://github.com/a-ui/core_components_react/blob/development/packages/antwerp-ui/react-components/src/constants/layout.settings.ts

Is it possible to expose these so that we can use them? Currently we have to create the same enums just to reference them the same way.

For example; Warning icons need to be name 'alert-triangle'. We can use THEME_ICON_MAP[Theme.DANGER], but since these aren't available we have to duplicate this in our own project.

@TriangleJuice
Copy link
Member

Hi @SanderVanHullebusch could you provide us with a wireframe (or use case) where you would use these icons in a separate way? We are trying to identify your specific need here.

@SanderVanHullebusch
Copy link
Author

SanderVanHullebusch commented Nov 22, 2023

We have multiple custom components that need icons. Currently we use a prop to set a status (warning, error, neutral, success,..). There are the same as the ones used in @a-ui.
We set the icon as a fixed string depending on the status. These are defined in the constant folder from this package. So instead of setting this icon with a fixed string I want to use the ones declared in the package to keep it consistent.

I want to have a single source of truth. When @a-ui changes I want these changes to be directly in our project as well.

@TriangleJuice
Copy link
Member

Thanks for the reply! Can you also provide a screenshot of such component (just to verify)? I already made an internal JIRA ticket and added you as the reporter.

@SanderVanHullebusch
Copy link
Author

SanderVanHullebusch commented Nov 22, 2023

We have a variation on the Alert component since this didn't completely suit the design/implementation needed (called InfoMessage).
This is almost the same as the Alert, but more different is a Toast component where we also want to add a status with corresponding icon. I saw that these are included in the package but not exposed so we can't use them directly.

Edit: screenshot of what we want to become:
Screenshot 2023-11-23 at 10 09 16

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

No branches or pull requests

2 participants