siemens / ix

Siemens Industrial Experience is a design system for designers and developers, to consistently create the perfect digital experience for industrial software products.
https://ix.siemens.io/
MIT License
208 stars 67 forks source link

Export of component props types #1524

Open miloscript opened 1 month ago

miloscript commented 1 month ago

Prerequisites

Suggestion / feature request

Hi everybody.

I'm currently trying to write a wrapper around one of the IX components like this:

import { IxModalHeader } from '@siemens/ix-react';

interface ModalHeaderProps
    extends React.HTMLAttributes<HTMLIxModalHeaderElement> {
    children: React.ReactNode;
}

export const ModalHeader = ({ children }: ModalHeaderProps) => {
    return (
        <IxModalHeader>
            <h2>{children}</h2>
        </IxModalHeader>
    );
};

The issue with this approach is that when I use my wrapped component, I'm not being able to pass props from the IXModaHeader like hideClose or icon.

Although I can write these out manually, I was wondering can it be done by importing the props directly, something like this:

interface ModalHeaderProps
    extends IXModalHeaderProps {
    children: React.ReactNode;
}

Is this a functionality you guys find useful? Maybe I am missing something and this is actually possible?