dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

New `Tabs` component implementation #2061

Closed Mil4n0r closed 2 weeks ago

Mil4n0r commented 2 months ago

Checklist (Check off all the items before submitting)

Description Current DxcTabs API is confusing, as it is expected to work in a similar way as DxcNavTabs, but it does not provide Compound Components, so we have no access to onClick/onHover events separately for each Tab.

For consistency purposes and easier implementation of the wrappers required in Halstack Studio and UXPin, it is convenient to redo it.

For now, we are maintaining the old API available to prevent adding breaking changes, however, those props will be marked as LEGACY/DEPRECATED to not encourage using them in the future (and eventually, removing them).

Mil4n0r commented 2 weeks ago

Good job @Jialecl. Changes look legit. The only thing to improve I can think of would be to improve the typings so that only legacy behavior or new behavior are allowed, not both at once. However, I am not sure if that is worth it taking into account that the legacy behavior will eventually be removed.

Let me know what you guys think @Jialecl @GomezIvann.