-
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.
Merge remote-tracking branch 'origin/next' into task/OV-423-generate-…
…preview-with-bg
- Loading branch information
Showing
54 changed files
with
1,216 additions
and
240 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
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 @@ | ||
export { sanitizeJsonString } from './sanitize-json-string.js'; |
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,6 @@ | ||
const sanitizeJsonString = (input: string): string => { | ||
const match = input.match(/\[.*]/s); | ||
return match ? match[0].trim() : input.trim(); | ||
}; | ||
|
||
export { sanitizeJsonString }; |
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
1 change: 1 addition & 0 deletions
1
frontend/src/bundles/common/components/stepper/components/components.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 @@ | ||
export { StepStatus } from './step-status/step-status.js'; |
41 changes: 41 additions & 0 deletions
41
frontend/src/bundles/common/components/stepper/components/step-status/step-status.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,41 @@ | ||
import { type ValueOf } from 'shared'; | ||
|
||
import { Box, Icon } from '~/bundles/common/components/components.js'; | ||
import { StepStatus as StepStatusEnum } from '~/bundles/common/components/stepper/enums/enums.js'; | ||
import { IconName } from '~/bundles/common/icons/icons.js'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
type Properties = { | ||
step: ValueOf<typeof StepStatusEnum>; | ||
}; | ||
|
||
const StepStatus: React.FC<Properties> = ({ step }) => { | ||
switch (step) { | ||
case StepStatusEnum.COMPLETE: { | ||
return ( | ||
<Box className={styles['complete']}> | ||
<Icon as={IconName.CHECK_CIRCLE} boxSize={3} /> | ||
</Box> | ||
); | ||
} | ||
|
||
case StepStatusEnum.ACTIVE: { | ||
return ( | ||
<Box className={styles['active']}> | ||
<Icon as={IconName.CIRCLE} boxSize={3} /> | ||
</Box> | ||
); | ||
} | ||
|
||
case StepStatusEnum.INCOMPLETE: { | ||
return ( | ||
<Box className={styles['incomplete']}> | ||
<Icon as={IconName.CIRCLE} boxSize={3} /> | ||
</Box> | ||
); | ||
} | ||
} | ||
}; | ||
|
||
export { StepStatus }; |
21 changes: 21 additions & 0 deletions
21
frontend/src/bundles/common/components/stepper/components/step-status/styles.module.css
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 @@ | ||
.complete { | ||
background-color: var(--chakra-colors-background-900); | ||
display: inline-flex; | ||
} | ||
|
||
.active { | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 4px; | ||
color: white; | ||
border: 2px solid; | ||
border-color: var(--chakra-colors-background-600); | ||
border-radius: 50%; | ||
background-color: var(--chakra-colors-background-900); | ||
} | ||
|
||
.incomplete { | ||
color: var(--chakra-colors-background-600); | ||
display: inline-flex; | ||
} |
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 @@ | ||
export { StepStatus } from './step-status.enum.js'; |
7 changes: 7 additions & 0 deletions
7
frontend/src/bundles/common/components/stepper/enums/step-status.enum.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,7 @@ | ||
const StepStatus = { | ||
COMPLETE: 'complete', | ||
ACTIVE: 'active', | ||
INCOMPLETE: 'incomplete', | ||
} as const; | ||
|
||
export { StepStatus }; |
91 changes: 91 additions & 0 deletions
91
frontend/src/bundles/common/components/stepper/stepper.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,91 @@ | ||
import { | ||
Box, | ||
Header, | ||
Icon, | ||
IconButton, | ||
LibraryStepper, | ||
Progress, | ||
Step, | ||
StepIndicator, | ||
StepStatus, | ||
Text, | ||
} from '~/bundles/common/components/components.js'; | ||
import { IconName } from '~/bundles/common/icons/icons.js'; | ||
|
||
import { StepStatus as StepIcon } from './components/components.js'; | ||
import { StepStatus as StepStatusEnum } from './enums/enums.js'; | ||
import styles from './styles.module.css'; | ||
|
||
type Properties = { | ||
steps: string[]; | ||
currentStep: string; | ||
}; | ||
|
||
const Stepper: React.FC<Properties> = ({ steps, currentStep }) => { | ||
const activeStepIndex = steps.indexOf(currentStep); | ||
const progressPercent = (activeStepIndex / (steps.length - 1)) * 100; | ||
|
||
const backButton = ( | ||
<IconButton | ||
variant="ghostIcon" | ||
aria-label="back" | ||
icon={<Icon as={IconName.ARROW_BACK} boxSize={4} />} | ||
/> | ||
); | ||
|
||
const stepProgressBar = ( | ||
<Box className={styles['stepperWrapper']}> | ||
<Box className={styles['innerStepper']}> | ||
<LibraryStepper size="sm" index={activeStepIndex} gap="0"> | ||
{steps.map((step, index) => ( | ||
<Step key={index}> | ||
<StepIndicator | ||
bg="white" | ||
height="12px" | ||
width="12px" | ||
> | ||
<StepStatus | ||
complete={ | ||
<StepIcon | ||
step={StepStatusEnum.COMPLETE} | ||
/> | ||
} | ||
active={ | ||
<StepIcon | ||
step={StepStatusEnum.ACTIVE} | ||
/> | ||
} | ||
incomplete={ | ||
<StepIcon | ||
step={StepStatusEnum.INCOMPLETE} | ||
/> | ||
} | ||
/> | ||
<Text | ||
variant="body1" | ||
color={ | ||
index <= activeStepIndex | ||
? 'white' | ||
: 'background.600' | ||
} | ||
position="absolute" | ||
top="20px" | ||
> | ||
{step} | ||
</Text> | ||
</StepIndicator> | ||
</Step> | ||
))} | ||
</LibraryStepper> | ||
<Progress | ||
variant="stepper" | ||
value={progressPercent} | ||
className={styles['progressBar']} | ||
/> | ||
</Box> | ||
</Box> | ||
); | ||
return <Header left={backButton} center={stepProgressBar} />; | ||
}; | ||
|
||
export { Stepper }; |
Oops, something went wrong.