gravity-ui / uikit

https://gravity-ui.com
MIT License
520 stars 84 forks source link

feat(Text, Flex, Box): typed html attributes #1583

Closed IsaevAlexandr closed 1 month ago

IsaevAlexandr commented 1 month ago

related to https://github.com/gravity-ui/uikit/issues/1581

gravity-ui-bot commented 1 month ago

Preview is ready.

gravity-ui-bot commented 1 month ago

Playwright Test Component is ready.

chelentos commented 1 month ago

I doubt the correctness of using of Box for Text and Flex. Semantically, these components are needed for different tasks. For example, does the Text component need props for its width/height and spacing?

IsaevAlexandr commented 1 month ago

I doubt the correctness of using of Box for Text. Semantically, these components are needed for different tasks. For example, does the Text component need props for its width/height and spacing?

these are reasonable remarks. The use of the Box component in this example is necessary in order to work correctly with basic props such as qa, styles, className and ref and other. Like base logic fore thouse examples. Out of the box you get the ability to use Text component something like this:

<>
  <Text spacing={{mr: 2}}>Some text 1</Text>
  <Text>Some text 1</Text>
<>
chelentos commented 1 month ago

Out of the box you get the ability to use Text component something like this:

<>
  <Text spacing={{mr: 2}}>Some text 1</Text>
  <Text>Some text 1</Text>
<>

I think the question then might be why are we adding this behavior for Text only?

IsaevAlexandr commented 1 month ago

Out of the box you get the ability to use Text component something like this:

<>
  <Text spacing={{mr: 2}}>Some text 1</Text>
  <Text>Some text 1</Text>
<>

I think the question then might be why are we adding this behavior for Text only?

Text is one more in a row. Flex, Card and, i hope, it will be more components soon what extends from Box