Repository navigation
feat: Support labelTag for inline Token #5090
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
Open
NathanZlion
wants to merge
11
commits into
main
Choose a base branch
from
dev-v3-natidere-token-additions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ad6372d
feat: Add prefix and secondaryText to Token
NathanZlion fddf7e8
chore: Add prefix and secondary text to popover token demo
NathanZlion 14746ba
test: Update documenter snapshot for token prefix and secondaryText
NathanZlion 9c5cc9e
feat: Support labelTag for inline token, drop secondaryText
NathanZlion 9770107
fix: Add ariaLabel to popover tokens on additions page
NathanZlion 53106e9
chore: Use text-inline popover trigger for inline tokens
NathanZlion 9a55414
refactor: Drop Token prefix slot, use icon for color dots
NathanZlion 85ceb73
chore: Render token color dot as a custom svg Icon
NathanZlion 45ea6c5
chore: Replace token additions page with inline labelTag permutations
NathanZlion 6ea5117
docs: Simplify inline variant description
NathanZlion e49eb51
fix: Keep label tag on one line in inline tokens with long labels
NathanZlion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,43 @@ | ||
| // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| import React from 'react'; | ||
|
|
||
| import Icon from '~components/icon'; | ||
| import Popover from '~components/popover'; | ||
| import Token from '~components/token'; | ||
|
|
||
| import { SimplePage } from '../app/templates'; | ||
|
|
||
| const dot = ( | ||
| <Icon | ||
| svg={ | ||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" focusable="false"> | ||
| <circle cx="8" cy="8" r="4" fill="#d13212" className="no-stroke" /> | ||
| </svg> | ||
| } | ||
| /> | ||
| ); | ||
|
|
||
| const longLabel = 'popover trigger will be very very long and keep going until it has to truncate'; | ||
|
|
||
| export default function InlineLongPopoverPage() { | ||
| return ( | ||
| <SimplePage title="Inline token with long popover trigger and label tag"> | ||
| <div style={{ maxInlineSize: 300 }}> | ||
| <Token | ||
| variant="inline" | ||
| icon={dot} | ||
| label={ | ||
| <Popover triggerType="text-inline" header={longLabel} content="Popover content" wrapTriggerText={false}> | ||
| {longLabel} | ||
| </Popover> | ||
| } | ||
| ariaLabel={longLabel} | ||
| labelTag="label tag here" | ||
| onDismiss={() => {}} | ||
| dismissLabel="Remove token" | ||
| /> | ||
| </div> | ||
| </SimplePage> | ||
| ); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -124,6 +124,7 @@ function InternalToken({ | |
| return { | ||
| ...labelObject, | ||
| disabled, | ||
| labelTag, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| __customIcon: icon && <span className={clsx(styles.icon, styles['icon-inline'])}>{sizedIcon(icon)}</span>, | ||
| }; | ||
| } else { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.