-
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.
- Loading branch information
1 parent
540058e
commit 8f3f27a
Showing
14 changed files
with
227 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,7 @@ | ||
import type { FC } from "react"; | ||
import { type IconBaseProps } from "react-icons"; | ||
import { HiAdjustments } from "react-icons/hi"; | ||
|
||
export const TraineeDefineIcon: FC<IconBaseProps> = (props) => ( | ||
<HiAdjustments {...props} /> | ||
); |
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,16 +1,14 @@ | ||
import type { FC } from "react"; | ||
import { IconBase, type IconBaseProps } from "react-icons"; | ||
|
||
export const TraineeTrainIcon: FC<IconBaseProps> = function (props) { | ||
return ( | ||
<IconBase fill="none" viewBox="0 0 20 18" {...props}> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="M11.484 6.166 13 4h6m0 0-3-3m3 3-3 3M1 14h5l1.577-2.253M1 4h5l7 10h6m0 0-3 3m3-3-3-3" | ||
/> | ||
</IconBase> | ||
); | ||
}; | ||
export const TraineeTrainIcon: FC<IconBaseProps> = (props) => ( | ||
<IconBase fill="none" viewBox="0 0 20 18" {...props}> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="M11.484 6.166 13 4h6m0 0-3-3m3 3-3 3M1 14h5l1.577-2.253M1 4h5l7 10h6m0 0-3 3m3-3-3-3" | ||
/> | ||
</IconBase> | ||
); |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from "./MapDependentFeatureAttributesIcon"; | ||
export * from "./TraineeDefineIcon"; | ||
export * from "./TraineeLoadIcon"; | ||
export * from "./TraineeTrainIcon"; |
31 changes: 31 additions & 0 deletions
31
src/components/Trainee/TraineeCreationStepper/TraineeCreationStepper.i18n.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,31 @@ | ||
import { Languages } from "@/constants"; | ||
import { | ||
getStringsForI18nBundleFromResource, | ||
type I18nBundle, | ||
} from "@howso/ui-internationalization-utils"; | ||
|
||
const namespace = "TraineeCreationStepper"; | ||
|
||
const en = { | ||
load: { | ||
title: "Load", | ||
description: "Load and review source data", | ||
}, | ||
define: { | ||
title: "Define", | ||
description: "Infer and describe features", | ||
}, | ||
train: { | ||
title: "Train", | ||
description: "Tain and analyze data", | ||
}, | ||
}; | ||
|
||
type Resource = typeof en; | ||
|
||
export const TraineeCreationStepperI18nBundle: I18nBundle<Languages, Resource> = | ||
{ | ||
namespace, | ||
resources: { en }, | ||
strings: getStringsForI18nBundleFromResource<Resource>(en), | ||
}; |
33 changes: 33 additions & 0 deletions
33
src/components/Trainee/TraineeCreationStepper/TraineeCreationStepper.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,33 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { TraineeCreationStepper } from "."; | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export | ||
const meta: Meta<typeof TraineeCreationStepper> = { | ||
component: TraineeCreationStepper, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/7.0/react/writing-docs/docs-page | ||
tags: ["autodocs"], | ||
parameters: { | ||
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: "centered", | ||
}, | ||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes | ||
argTypes: {}, | ||
args: { | ||
vertical: false, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof TraineeCreationStepper>; | ||
|
||
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args | ||
export const Default: Story = { | ||
// More on args: https://storybook.js.org/docs/react/writing-stories/args | ||
args: {}, | ||
}; | ||
|
||
export const Vertical: Story = { | ||
args: { | ||
vertical: true, | ||
}, | ||
}; |
102 changes: 102 additions & 0 deletions
102
src/components/Trainee/TraineeCreationStepper/TraineeCreationStepper.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,102 @@ | ||
import { TraineeDefineIcon, TraineeTrainIcon } from "@/components"; | ||
import { | ||
DatabaseIcon, | ||
Stepper, | ||
type StepperProps, | ||
} from "@howso/react-tailwind-flowbite-components"; | ||
import type { FC } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { TraineeCreationStepperI18nBundle as i18n } from "./TraineeCreationStepper.i18n"; | ||
|
||
export type TraineeCreationStepperProps = Pick< | ||
StepperProps, | ||
"vertical" | "step" | "marginBottom" | ||
> & {}; | ||
const TraineeCreationStepperComponent: FC<TraineeCreationStepperProps> = ({ | ||
...props | ||
}) => { | ||
const { t } = useTranslation(i18n.namespace); | ||
|
||
return ( | ||
<Stepper steps={3} {...props}> | ||
<Stepper.Item | ||
className={TraineeCreationStepper.classes.item} | ||
position={0} | ||
> | ||
<Stepper.Icon> | ||
<DatabaseIcon className={TraineeCreationStepper.classes.icon} /> | ||
</Stepper.Icon> | ||
<Stepper.Content> | ||
<Stepper.Content.Heading | ||
className={TraineeCreationStepper.classes.heading} | ||
> | ||
{t(i18n.strings.load.title)} | ||
</Stepper.Content.Heading> | ||
<Stepper.Content.Description | ||
className={TraineeCreationStepper.classes.description} | ||
> | ||
{t(i18n.strings.load.description)} | ||
</Stepper.Content.Description> | ||
</Stepper.Content> | ||
</Stepper.Item> | ||
|
||
<Stepper.Spacer /> | ||
|
||
<Stepper.Item | ||
className={TraineeCreationStepper.classes.item} | ||
position={1} | ||
> | ||
<Stepper.Icon> | ||
<TraineeDefineIcon className={TraineeCreationStepper.classes.icon} /> | ||
</Stepper.Icon> | ||
<Stepper.Content> | ||
<Stepper.Content.Heading | ||
className={TraineeCreationStepper.classes.heading} | ||
> | ||
{t(i18n.strings.define.title)} | ||
</Stepper.Content.Heading> | ||
<Stepper.Content.Description | ||
className={TraineeCreationStepper.classes.description} | ||
> | ||
{t(i18n.strings.define.description)} | ||
</Stepper.Content.Description> | ||
</Stepper.Content> | ||
</Stepper.Item> | ||
|
||
<Stepper.Spacer /> | ||
|
||
<Stepper.Item | ||
className={TraineeCreationStepper.classes.item} | ||
position={2} | ||
> | ||
<Stepper.Icon> | ||
<TraineeTrainIcon className={TraineeCreationStepper.classes.icon} /> | ||
</Stepper.Icon> | ||
<Stepper.Content> | ||
<Stepper.Content.Heading | ||
className={TraineeCreationStepper.classes.heading} | ||
> | ||
{t(i18n.strings.train.title)} | ||
</Stepper.Content.Heading> | ||
<Stepper.Content.Description | ||
className={TraineeCreationStepper.classes.description} | ||
> | ||
{t(i18n.strings.train.description)} | ||
</Stepper.Content.Description> | ||
</Stepper.Content> | ||
</Stepper.Item> | ||
</Stepper> | ||
); | ||
}; | ||
|
||
export const TraineeCreationStepper = Object.assign( | ||
TraineeCreationStepperComponent, | ||
{ | ||
classes: { | ||
item: "basis-1/3 sm:basis-auto", | ||
icon: "", | ||
heading: "", | ||
description: "hidden md:block", | ||
}, | ||
}, | ||
); |
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,2 @@ | ||
export * from "./TraineeCreationStepper"; | ||
export * from "./TraineeCreationStepper.i18n"; |
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,9 @@ | ||
import { type Languages } from "@/constants"; | ||
import { type I18nBundle } from "@howso/ui-internationalization-utils"; | ||
import { TraineeCreationStepperI18nBundle } from "./TraineeCreationStepper"; | ||
|
||
export * from "./TraineeCreationStepper"; | ||
|
||
export const TraineeI18nBundles: I18nBundle<Languages, any>[] = [ | ||
TraineeCreationStepperI18nBundle, | ||
]; |
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,2 +1,3 @@ | ||
export * from "./FeatureAttributes"; | ||
export * from "./Icons"; | ||
export * from "./Trainee"; |
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,12 +1,14 @@ | ||
import { I18nBundle } from "@howso/ui-internationalization-utils"; | ||
import { Languages } from "./constants"; | ||
import { TraineeI18nBundles } from "./components"; | ||
import { FeatureAttributesI18nBundles } from "./components/FeatureAttributes"; | ||
import { Languages } from "./constants"; | ||
|
||
export * from "./constants"; | ||
export * from "./components"; | ||
export * from "./constants"; | ||
export * from "./hooks"; | ||
export * from "./utils"; | ||
|
||
export const I18nBundles: I18nBundle<Languages, any>[] = [ | ||
...FeatureAttributesI18nBundles, | ||
...TraineeI18nBundles, | ||
]; |