-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix/style fixes #916
Merged
Merged
Fix/style fixes #916
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9a1acef
fix for the following: site sidebar, site header, ui badge, ui storyb…
HZ991 34fcc85
add: update to progress indicator component
HZ991 024462b
fix: add unique id to progress indicator paths
23dad1b
fix: add unique id to progress indicator paths
b67f066
Merge branch 'fix/style-fixes' of https://github.com/WestpacGEL/GEL-n…
HZ991 7bc4dfe
Merge branch 'fix/style-fixes' of https://github.com/WestpacGEL/GEL-n…
HZ991 64d4ff8
Merge branch 'fix/style-fixes' of https://github.com/WestpacGEL/GEL-n…
HZ991 252b1d2
Merge branch 'fix/style-fixes' of https://github.com/WestpacGEL/GEL-n…
HZ991 1c5b2df
Merge branch 'fix/style-fixes' of https://github.com/WestpacGEL/GEL-n…
HZ991 5ef2790
Merge branch 'fix/style-fixes' of https://github.com/WestpacGEL/GEL-n…
HZ991 6da8266
Merge branch 'develop' into fix/style-fixes
HZ991 4963f21
Fix: omitted types from progress-indictator
HZ991 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 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 @@ | ||
--- | ||
'@westpac/ui': minor | ||
--- | ||
|
||
Updated the appearance and svg of progress indicator component; updated visual bugs in header and badge; |
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
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
6 changes: 3 additions & 3 deletions
6
...te/src/content/design-system/components/badge/design/where-is-this-available/content.mdoc
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{% shortCode name="where-is-this-available" /%} | ||
|
||
{% availabilityContent | ||
availableGel="available" | ||
availableMesh="in-progress" | ||
availableLegacyWdp="older-version-available" /%} | ||
availableGel="available" | ||
availableMesh="in-progress" | ||
availableLegacyWdp="older-version-available" /%} |
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
67 changes: 60 additions & 7 deletions
67
packages/ui/src/components/progress-indicator/progress-indicator.component.tsx
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 |
---|---|---|
@@ -1,21 +1,74 @@ | ||
import React from 'react'; | ||
import React, { useId } from 'react'; | ||
|
||
import { Icon } from '../icon/icon.component.js'; | ||
import { Label } from '../label/label.component.js'; | ||
|
||
import { styles } from './progress-indicator.styles.js'; | ||
import { styles as ProgressIndicatorStyles } from './progress-indicator.styles.js'; | ||
import { ProgressIndicatorProps } from './progress-indicator.types.js'; | ||
|
||
export function ProgressIndicator({ | ||
className, | ||
children, | ||
color = 'hero', | ||
inverted = false, | ||
label, | ||
HZ991 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
size = 'medium', | ||
icon: EmbedIcon, | ||
className, | ||
'aria-label': ariaLabel = 'Loading', | ||
...props | ||
}: ProgressIndicatorProps) { | ||
const styles = ProgressIndicatorStyles({ | ||
size, | ||
inverted, | ||
}); | ||
|
||
const id = useId(); | ||
|
||
const sizeMap: Record<string, { strokeWidth: number }> = { | ||
xlarge: { strokeWidth: 4 }, | ||
large: { strokeWidth: 4 }, | ||
medium: { strokeWidth: 15 }, | ||
small: { strokeWidth: 20 }, | ||
xsmall: { strokeWidth: 30 }, | ||
}; | ||
|
||
const strokeHalfWidth = sizeMap[size.toString()].strokeWidth / 2; | ||
|
||
return ( | ||
<Icon className={styles({ className })} size={size} color={color} aria-label={ariaLabel} {...props}> | ||
{children} | ||
</Icon> | ||
<div aria-label={ariaLabel} className={styles.container()}> | ||
<div className="relative"> | ||
<Icon | ||
viewBox="0 0 180 180" | ||
fill="none" | ||
color={inverted ? 'white' : 'hero'} | ||
className={styles.base({ className })} | ||
HZ991 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{...props} | ||
> | ||
<defs> | ||
<linearGradient id={`${id}-1`}> | ||
<stop offset="0%" stopOpacity="0" stopColor="currentColor" /> | ||
<stop offset="100%" stopColor="currentColor" /> | ||
</linearGradient> | ||
<linearGradient id={`${id}-2`}> | ||
<stop offset="0%" stopColor="currentColor" /> | ||
<stop offset="50%" stopColor="currentColor" /> | ||
</linearGradient> | ||
</defs> | ||
<g strokeWidth={strokeHalfWidth * 2}> | ||
<> | ||
<path | ||
stroke={`url(#${id}-1)`} | ||
d={`M ${strokeHalfWidth} 90 A ${90 - strokeHalfWidth} ${90 - strokeHalfWidth} 0 0 1 ${180 - strokeHalfWidth} 90`} | ||
></path> | ||
<path | ||
stroke={`url(#${id}-2)`} | ||
d={`M ${180 - strokeHalfWidth} 90 A ${90 - strokeHalfWidth} ${90 - strokeHalfWidth} 0 0 1 ${strokeHalfWidth} 90`} | ||
></path> | ||
</> | ||
</g> | ||
</Icon> | ||
{EmbedIcon && size === 'large' && <EmbedIcon size="large" className={styles.icon()} />} | ||
</div> | ||
HZ991 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{label && size === 'large' && <Label className={styles.label()}>{label}</Label>} | ||
</div> | ||
); | ||
} |
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
23 changes: 22 additions & 1 deletion
23
packages/ui/src/components/progress-indicator/progress-indicator.types.ts
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 |
---|---|---|
@@ -1,3 +1,24 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
import { IconProps } from '../icon/icon.types.js'; | ||
|
||
export type ProgressIndicatorProps = IconProps; | ||
export type ProgressIndicatorProps = IconProps & { | ||
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. Minor: Update to |
||
/** | ||
* children prop | ||
* @default false | ||
*/ | ||
children?: ReactNode; | ||
/** | ||
* Icon embedded in progress indicator | ||
*/ | ||
icon?: (props: IconProps) => JSX.Element; | ||
/** | ||
* Progress indicator color | ||
* @default false | ||
*/ | ||
inverted?: boolean; | ||
HZ991 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** | ||
* Label placed below progress indicator | ||
*/ | ||
label?: string; | ||
}; |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed revert back to color prop to be aligned with icon props