-
Notifications
You must be signed in to change notification settings - Fork 71
[LG-3416] feat: Icon - added title element #3245
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
Changes from 17 commits
73166b7
68567bf
ff32594
ecec58a
790e9e8
a6f80bf
d3ff021
e7e64a4
fbfbc36
42cff8f
52026f5
e34fd92
2a12642
a182e4c
ce2531b
5a4c807
8c02719
421bbe6
4528409
5d9bf5c
2bbf919
2ef518f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@leafygreen-ui/icon': minor | ||
| '@leafygreen-ui/select': minor | ||
| '@leafygreen-ui/text-input': minor | ||
| --- | ||
|
|
||
| Updated Icon to include <title> element when title is added. Deprecated the `createGlyphComponent`, and the design system is instead using glyphs from the `generated` folder | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const VERSION = '5.0.3'; | ||
| export const VERSION = '5.0.4'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| import React from 'react'; | ||
|
|
||
| import { css, cx } from '@leafygreen-ui/emotion'; | ||
| import { useIdAllocator } from '@leafygreen-ui/hooks'; | ||
|
|
||
| import { generateAccessibleProps, Size, sizeMap } from './glyphCommon'; | ||
| import { LGGlyph, SVGR } from './types'; | ||
|
|
||
| /** | ||
| * @deprecated - No longer needed for icon generation. Keeping it for backwards compatibility. | ||
shaneeza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Returns a single glyph component. | ||
| * Process custom glyphs to ensure consistent behavior between custom and built-in icons | ||
| * @param glyphName: string - the display name of the icon | ||
|
|
@@ -26,6 +28,7 @@ export function createGlyphComponent( | |
| role = 'img', | ||
| ...rest | ||
| }: LGGlyph.ComponentProps) => { | ||
| const titleId = useIdAllocator({ prefix: 'icon-title' }); | ||
| const fillStyle = css` | ||
| color: ${fill}; | ||
| `; | ||
|
|
@@ -51,6 +54,7 @@ export function createGlyphComponent( | |
| role={role} | ||
| {...generateAccessibleProps(role, glyphName, { | ||
| title, | ||
| titleId, | ||
| ['aria-label']: ariaLabel, | ||
| ['aria-labelledby']: ariaLabelledby, | ||
| })} | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.