deephaven / deephaven-plugins

Deephaven Plugins
5 stars 12 forks source link

pydocs for icon #535

Open mofojed opened 3 weeks ago

mofojed commented 3 weeks ago

Shouldn't have an icon_wrapper component, only need ui.icon, and that needs pydocs.

Props are defined here: https://react-spectrum.adobe.com/react-spectrum/custom-icons.html#props

We need to wire up these props correctly, passing them into Icon instead of FontAwesomeIcon, while still taking the icon from the name correctly and passing into FontAwesomeIcon: https://github.com/deephaven/deephaven-plugins/blob/e4b7137d0bb25d2d34c79658b6a565e46194d8d9/plugins/ui/src/js/src/elements/IconElementView.tsx#L21

E.g.:

    // eslint-disable-next-line react/jsx-props-no-spreading
    <Icon {...props}>
      <FontAwesomeIcon icon={icon} />
    </Icon>
mofojed commented 2 days ago

Take a look at the build output for all the icons available: https://github.com/deephaven/web-client-ui/tree/main/packages/icons We should make a script to automate pulling that definition over and translating it to a Python literal.