forked from linode/manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: [M3-7540] - Improve tags experience (linode#10122)
* Trying some stuff... * Introduce new MutationObserver hook * Use new MutationObserver hook to listen for parent becoming visible * Clean up * Improve TagCell styles for small displays * Added changeset: Tag overflow detection * Improve tags experience and replace deprecated Select with Autocomplete component * Update changeset * Remove workaround and update changeset * Fix test failure * Fix race condition with new useAtomic hook * Delete TagsPanel in favor of TagCell * Add test for useAtomic * Fix inconsistent TagCell margin bottom * Feedback @abailly-akamai * Add debouncing to useAtomic * Remove useAtomic * Fix errors due to forwarded prop * Add loading state to AddTag * Add storybook entry for TagCell * Feedback @abailly-akamai
- Loading branch information
1 parent
fa7d1bb
commit 0016832
Showing
21 changed files
with
304 additions
and
724 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10122-changed-1706567057589.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Changed | ||
--- | ||
|
||
Improve tags experience ([#10122](https://github.com/linode/manager/pull/10122)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { useArgs } from '@storybook/preview-api'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import { Box } from 'src/components/Box'; | ||
|
||
import { TagCell, TagCellProps } from './TagCell/TagCell'; | ||
|
||
const _tags: string[] = ['tag1', 'tag2', 'tag3', 'tag4', 'tag5']; | ||
|
||
export const Default: StoryObj<TagCellProps> = { | ||
render: (args) => { | ||
const TagsInputWrapper = () => { | ||
const [{ tags }, updateArgs] = useArgs(); | ||
const handleUpdateTags = (selected: string[]) => { | ||
return Promise.resolve(updateArgs({ tags: selected })); | ||
}; | ||
|
||
return ( | ||
<Box sx={{ height: 300 }}> | ||
<TagCell {...args} tags={tags} updateTags={handleUpdateTags} /> | ||
</Box> | ||
); | ||
}; | ||
|
||
return TagsInputWrapper(); | ||
}, | ||
}; | ||
|
||
export const InlineView: StoryObj<TagCellProps> = { | ||
render: (args) => { | ||
const TagsInputWrapper = () => { | ||
const [{ tags }, updateArgs] = useArgs(); | ||
const handleUpdateTags = (selected: string[]) => { | ||
return Promise.resolve(updateArgs({ tags: selected })); | ||
}; | ||
|
||
return ( | ||
<Box sx={{ height: 300 }}> | ||
<TagCell | ||
{...args} | ||
listAllTags={() => undefined} | ||
tags={tags} | ||
updateTags={handleUpdateTags} | ||
/> | ||
</Box> | ||
); | ||
}; | ||
|
||
return TagsInputWrapper(); | ||
}, | ||
}; | ||
|
||
const meta: Meta<TagCellProps> = { | ||
args: { | ||
disabled: false, | ||
tags: _tags, | ||
}, | ||
component: TagCell, | ||
title: 'Components/Tags/Tag Cell', | ||
}; | ||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.