deephaven / deephaven-plugins

Deephaven Plugins
5 stars 12 forks source link

Default to `size="XXL"` and `marginBottom="size-10"` when `Icon` is a child of `IllustratedMessage` #558

Closed mofojed closed 2 days ago

mofojed commented 2 weeks ago

When using an Icon in an IllustratedMessage, we should automatically set the default size to XXL and marginBottom to size-10 if the user has not specified those. Should be able to create a wrapper IllustratedMessage component that checks the Icon children and adds the appropriate props before rendering the children. Alternatively we may be able to simply set the slot prop so that it's an illustration in the Icon, and that may make everything work correctly: https://github.com/adobe/react-spectrum/blob/4a8b24028308831a06a2450e6975b8816406315f/packages/%40react-spectrum/icon/src/Illustration.tsx#L44 https://github.com/adobe/react-spectrum/blob/4a8b24028308831a06a2450e6975b8816406315f/packages/%40react-spectrum/illustratedmessage/src/IllustratedMessage.tsx#L22