Export Cloudscape themed components in another component library #2456
-
Hello! I'm Iván, a frontend developer at DXC, working on our design system, Halstack. We are currently utilizing and enhancing your Bar Chart component with additional functionalities for our users, integrating our components, and simplifying the API for ease of use. Additionally, we are applying our custom data visualization color palette, adhering to your theming guidelines. However, we've encountered a significant issue. As a component library, we export our components for use by other DXC teams. While building the Bar Chart works as expected, exporting a themed Bar Chart presents a challenge. The theming strategies provided seem designed for application-level use, not for a component library. Perhaps I'm missing something, but is there a way to export a Cloudscape component with default theming? Or is applying our custom color palette only possible at the application level? Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
To give more feedback about what we have tried until now:
|
Beta Was this translation helpful? Give feedback.
-
Hello again! I tried your solution of building a separate library and encountered a few roadblocks. I do not know if it is a problem from my side but the build generated with When I try to import the package inside my component library (another package, we have a monorepo structure) it throws this error and the build of the library never finishes:
This is the output of our build process of the Halstack component library. The code is here if you want to check it out: https://github.com/dxc-technology/halstack-react/tree/gomezivann/bar-chart-fix. Any suggestions? Thanks for the feedback! |
Beta Was this translation helpful? Give feedback.
Hello Iván, thank you for reaching out to us! Happy to hear you're using our components.
If I understand correctly, the core of the issue lies in treating the themed components as if they're the
@cloudscape-design/components
package. I would recommend to follow a slightly different approach:@dxc-technology/halstack-react-themed-cloudscape-components
@dxc-technology/halstack-react-themed-cloudscape-components
instead of@cloudsca…