deephaven / deephaven-plugins

Deephaven Plugins
11 stars 15 forks source link

Typing for `label` prop on many components is incorrect #988

Open mofojed opened 2 weeks ago

mofojed commented 2 weeks ago

Description

There are a number of components that define label prop as Element | None. That does not allow a str or other primitive types. In Spectrum though, they accept a ReactNode which does accept a string, number, boolean, etc.

Some components with incorrect typing:

I'm pretty sure all of these can accept text and other primitives. Should be verified.

Steps to reproduce

  1. Enter the following snippet in a code editor:
    
    from deephaven import ui

p = ui.picker("Hello", "World", label="Picker label")



**Expected results**
1. There should be no type hint errors

**Actual results**
1. There is a type error reported (though running the code does work okay):
![image](https://github.com/user-attachments/assets/97973433-59a3-44d6-bf89-a818f9198504)

**Versions**
Engine Version: 0.36.1
Web UI Version: 0.97.0
Java Version: 11.0.24
Barrage Version: 0.6.0
Browser Name: Firefox 131
OS Name: Linux
matplotlib: 0.0.0
plotly-express: 0.0.0
auth-keycloak: 0.0.0
ui: 0.0.0
example-theme: 0.0.0