zakodium-oss / react-science

React components and tools to build scientific applications.
https://react-science.pages.dev
MIT License
3 stars 6 forks source link

Toolbar icons do not align correctly #590

Closed lpatiny closed 10 months ago

lpatiny commented 11 months ago

The icons take now the full width:

https://react-science.pages.dev/stories/?path=/story/components-toolbar--horizontal-toolbar

image

And vertical icons appear on 2 columns

image

https://react-science.pages.dev/stories/?path=/story/components-toolbar--vertical-toolbar

stropitek commented 11 months ago

@wadjih-bencheikh18 can you look into this in priority?

hamed-musallam commented 11 months ago

The issue, as I can see from the Button component, is that it uses flex:1, which forces the buttons to expand equally in the area.

Screenshot 2023-12-08 at 08 54 54

https://github.com/zakodium-oss/react-science/blob/main/src/components/button/Button.tsx#L26C6-L26C13

it seems the source of this CSS comes from the Tooltip component

hamed-musallam commented 11 months ago

Could we also have the option to set the background and icon color for both cases (active and deactivate), the same is true for the tooltip?

stropitek commented 11 months ago

Could we also have the option to set the background and icon color for both cases (active and deactivate), the same is true for the tooltip?

This might be possible with custom styles (would have to check) but I'm not sure we want this. Limiting customisation is key to having consistent user interfaces.

Using the intent prop is not enough? See https://react-science.pages.dev/stories/?path=/story/components-toolbar--control&args=intent:primary. What is the use case?

hamed-musallam commented 11 months ago

I think it is enough but the issue with the intent it is been applied to the whole toolbar