-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1073 from dev-launchers/development/components
* feat(alicefate): change OpenResponse, FormField * inital commit for progressBar * change it back to css in FormField.tsx * feat(Hredhya) Add Progress Bar Component * fix(ci): chromatic webhook readability * fix json error * test * fix(alicefate): fix: Text content did not match. * set min and max percentage value and set min width as 5% for inner bar * Set a min width of 5% when percentage is less than 5 and make it invisible at 0 percentage * Roman/discord-webhook: Creating a new file for the webhook and adjusting chromatic.yml * fix:unsubmited required input & textfield turn red * Webhook changes * Changing branch name output. * Fixing error * trying out a different branch name approach * One more approach to branch name * One more attempt at branch name output. * fixing mistake * Extract head branch name from GITHUB_REF step * fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final test for branch name * test for commit message * (fix/hredhya) Use progress tag instead of nested div * fix(alicefate): fix: Text content did not match. * fix:unsubmited required input & textfield turn red * components/discord-webhook: testing discord hook. * triggering the webhook. * triggering another hook. * one more try * once again. * fix(ci): chromatic webhook readability * fix json error * test * Roman/discord-webhook: Creating a new file for the webhook and adjusting chromatic.yml * Webhook changes * Changing branch name output. * Fixing error * trying out a different branch name approach * One more approach to branch name * One more attempt at branch name output. * fixing mistake * Extract head branch name from GITHUB_REF step * fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final test for branch name * test for commit message * inital commit for progressBar * feat(Hredhya) Add Progress Bar Component * set min and max percentage value and set min width as 5% for inner bar * Set a min width of 5% when percentage is less than 5 and make it invisible at 0 percentage * change it back to css in FormField.tsx * fix(alicefate): fix: Text content did not match. * fix:unsubmited required input & textfield turn red * components/discord-webhook: testing discord hook. * triggering the webhook. * triggering another hook. * one more try * once again. * fix(ci): chromatic webhook readability * fix json error * test * Roman/discord-webhook: Creating a new file for the webhook and adjusting chromatic.yml * Webhook changes * Changing branch name output. * Fixing error * trying out a different branch name approach * One more approach to branch name * One more attempt at branch name output. * fixing mistake * Extract head branch name from GITHUB_REF step * fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final fix extract head branch name from GITHUB_REF * final test for branch name * test for commit message * inital commit for progressBar * feat(Hredhya) Add Progress Bar Component * set min and max percentage value and set min width as 5% for inner bar * Set a min width of 5% when percentage is less than 5 and make it invisible at 0 percentage * change it back to css in FormField.tsx * triggering another hook. * one more try * once again. * test * Changing branch name output. * Fixing error * Extract head branch name from GITHUB_REF step * feat(alicefate): change OpenResponse, FormField * change it back to css in FormField.tsx * remove dynamic picture to reduce snapshot usage * fix percentage text going off bounds * Roman/export-types: Exporting all components. (#1051) * Roman/export-types: Exporting various compnents. * Roman/export-types: removing the header export. * exporting common components in the index file. * Trying something else to fix the import issue with framer motion. * Roman/export-types: Downgrading framer-motion. --------- Co-authored-by: Enjoy2Live <iMohammedMaqbol@gmail.com> * created a staging area for user-profile app (#1137) --------- Co-authored-by: Iris <2300018151@qq.com> Co-authored-by: Hredhya <hredhya3107@gmail.com> Co-authored-by: mfvil <rarefyev@gmail.com> Co-authored-by: AF <33647003+alicefate@users.noreply.github.com>
- Loading branch information
Showing
16 changed files
with
242 additions
and
47 deletions.
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
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,35 @@ | ||
name: Discord Webhook | ||
on: | ||
pull_request: | ||
paths: | ||
- 'packages/UI/.storybook/**' | ||
- 'packages/UI/src/**' | ||
jobs: | ||
discord: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
url: ${{ steps.chromatic.outputs.url }} | ||
buildUrl: ${{ steps.chromatic.outputs.buildUrl }} | ||
storybookUrl: ${{ steps.chromatic.outputs.storybookUrl }} | ||
branch: ${{ steps.extract_branch.outputs.branch }} | ||
pr_number: ${{ steps.extract_pr_number.outputs.pr_number }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=$(echo "${{ github.event.pull_request.head.ref }}" | tr / -)" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
- name: Extract PR number | ||
shell: bash | ||
run: echo "pr_number=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_OUTPUT | ||
id: extract_pr_number | ||
- name: Discord Channel Notification | ||
env: | ||
BRANCH: ${{ steps.extract_branch.outputs.branch }} | ||
URL: ${{ steps.deploy.outputs.url }} | ||
DISCORD_WEBHOOK: ${{ secrets.UI_BUILDS_WEBHOOK }} | ||
DISCORD_EMBEDS: '[{"title": "Chromatic","description": "View the Chromatic review.","url": "https://www.chromatic.com/pullrequest?appId=632ca21aeea1618b7fa0bf48&number=${{ steps.extract_pr_number.outputs.pr_number }}"}, {"title": "Storybook","description": "View the storybook for this change.","url": "https://${{ steps.extract_branch.outputs.branch }}--632ca21aeea1618b7fa0bf48.chromatic.com/"}]' | ||
uses: Ilshidur/action-discord@master | ||
with: | ||
args: 'New build for ${{ steps.extract_branch.outputs.branch }} has finished. ${{ github.event.head_commit.author.name }} has made changes with the following commit message: ${{ github.event.pull_request.head_commit.message }}' |
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
21 changes: 21 additions & 0 deletions
21
packages/UI/src/components/molecules/ProgressBar/ProgressBar.stories.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
|
||
import ProgressBar from './ProgressBar'; | ||
export default { | ||
title: 'Molecules/ProgressBar', | ||
component: ProgressBar, | ||
} as ComponentMeta<typeof ProgressBar>; | ||
|
||
const TemplateProgressBar: ComponentStory<typeof ProgressBar> = (args) => ( | ||
<ProgressBar {...args}></ProgressBar> | ||
); | ||
|
||
export const InProgress = TemplateProgressBar.bind({}); | ||
InProgress.args = { | ||
value: 50, | ||
}; | ||
|
||
export const Finished = TemplateProgressBar.bind({}); | ||
Finished.args = { | ||
value: 100, | ||
}; |
27 changes: 27 additions & 0 deletions
27
packages/UI/src/components/molecules/ProgressBar/ProgressBar.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
import Icon from '../../../assets/icons/rawSvg/check-circle.svg'; | ||
import { | ||
ProgressBarWrapper, | ||
CheckIcon, | ||
PercentageWrapper, | ||
Percentage, | ||
} from './StyledProgressBar'; | ||
import type { ProgressBarProps } from '.'; | ||
|
||
const ProgressBar: React.FC<ProgressBarProps> = ({ value }) => { | ||
let progressValue = value; | ||
if (value >= 1 && value < 3) { | ||
progressValue = 3; | ||
} | ||
const max = 100; | ||
return ( | ||
<ProgressBarWrapper value={value}> | ||
<progress value={progressValue} max={max} /> | ||
<PercentageWrapper> | ||
<Percentage value={value}>{value}%</Percentage> | ||
{value >= 100 && <CheckIcon src={Icon} />} | ||
</PercentageWrapper> | ||
</ProgressBarWrapper> | ||
); | ||
}; | ||
export default ProgressBar; |
59 changes: 59 additions & 0 deletions
59
packages/UI/src/components/molecules/ProgressBar/StyledProgressBar.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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import type { DefaultTheme } from 'styled-components'; | ||
import styled from 'styled-components'; | ||
import { radiusStyles } from '../../atoms/Radius'; | ||
import type { ProgressBarProps } from '.'; | ||
|
||
const getColor = (percentage: number, theme: DefaultTheme) => { | ||
return percentage >= 100 ? theme.colors.SUCCESS : theme.colors.NOTIFICATION; | ||
}; | ||
|
||
export const ProgressBarWrapper = styled.div<ProgressBarProps>` | ||
box-sizing: border-box; | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-start; | ||
position: relative; | ||
width: 320px; | ||
progress[value] { | ||
// to reset default styles | ||
-webkit-appearance: none; | ||
appearance: none; | ||
border: none; | ||
width: 320px; | ||
height: 26px; | ||
top: 36px; | ||
// styling the progress element container and value element | ||
::-webkit-progress-bar { | ||
background-color: ${({ theme }) => theme.colors.GREYSCALE_OFF_WHITE}; | ||
${radiusStyles['radius300']}; | ||
border: 2px solid ${({ value, theme }) => getColor(value, theme)}; | ||
} | ||
::-webkit-progress-value { | ||
background-color: ${({ value, theme }) => getColor(value, theme)}; | ||
${radiusStyles['radius300']}; | ||
} | ||
} | ||
`; | ||
export const PercentageWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
position: absolute; | ||
bottom: 88%; | ||
width: 100%; | ||
gap: 12px; | ||
`; | ||
export const Percentage = styled.span<ProgressBarProps>` | ||
font-family: 'Nunito Sans'; | ||
font-style: normal; | ||
font-weight: 400; | ||
font-size: 16px; | ||
line-height: 24px; | ||
color: ${({ value, theme }) => getColor(value, theme)}; | ||
width: 35px; | ||
height: 24px; | ||
`; | ||
export const CheckIcon = styled.img` | ||
width: 20px; | ||
height: 20px; | ||
`; |
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,4 @@ | ||
export interface ProgressBarProps { | ||
value: number; | ||
} | ||
export { default } from './ProgressBar'; |
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
2 changes: 1 addition & 1 deletion
2
packages/UI/src/components/organisms/cards/StyledCommonComponents.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
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.