Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ListItemExandIcon): added new list component for expanded icon view #1762

Merged

Conversation

IsaevAlexandr
Copy link
Contributor

  • fixed expanded icon position
  • expanded list icon separated by own component to reuse
  • added examples in storys and docs

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Visual Tests Report is ready.

@IsaevAlexandr IsaevAlexandr force-pushed the fix/use-list-controlled-state branch 2 times, most recently from d3d8264 to d59a42c Compare August 22, 2024 12:48
@IsaevAlexandr
Copy link
Contributor Author

/ping

| Name | Description | Type | Default |
| :---------------- | :---------------------------------------------- | :--------------------------------------------------: | :-----: |
| expanded | icon state | `boolean` | |
| disableTransition | disable animation while `expanded` state change | `boolean` | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need to disable the animatiom?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it depends on the business logic of the application

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's our design decision to have transitions on such arrows. Look at the ArrowToggle, we don't have it. Allowing to disable it here would feels like something is broken...

@@ -57,7 +58,17 @@ export const ListItemViewContent = ({
expanded,
selected,
title,
expandIconPosition = 'start',
renderExpandIcon: RenderExpandIcon = ListItemExpandIcon,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the case for custom render?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you wont custom icon view

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop called render* but it's not a function. Also it takes props of ListItemExpandIcon, so when I want custom, I should rely on this props?. Feels a bit overwhelming and hard to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is exactly a render function with props. Here fased link to a ListItemExpandIcon withot calling. In most cases you don't need to use this prop - it's optional

@IsaevAlexandr IsaevAlexandr force-pushed the fix/use-list-controlled-state branch 2 times, most recently from 73be8b9 to 775dbce Compare September 3, 2024 16:24
@IsaevAlexandr
Copy link
Contributor Author

/fixed

export const ListItemExpandIcon = ({
expanded,
disableTransition,
kind = 'action',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I find even better name for this prop, behavior

@@ -57,7 +58,17 @@ export const ListItemViewContent = ({
expanded,
selected,
title,
expandIconPosition = 'start',
renderExpandIcon: RenderExpandIcon = ListItemExpandIcon,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop called render* but it's not a function. Also it takes props of ListItemExpandIcon, so when I want custom, I should rely on this props?. Feels a bit overwhelming and hard to understand.

@IsaevAlexandr IsaevAlexandr force-pushed the fix/use-list-controlled-state branch from 775dbce to 62c29ac Compare September 6, 2024 14:29
@IsaevAlexandr
Copy link
Contributor Author

/fixed

@IsaevAlexandr
Copy link
Contributor Author

/ping

1 similar comment
@IsaevAlexandr
Copy link
Contributor Author

/ping

@IsaevAlexandr IsaevAlexandr merged commit b6516f4 into gravity-ui:main Oct 23, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants