Skip to content
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

22233: Added TraineeIcon, MINOR #31

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/components/Icons/TraineeIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { FC } from "react";
import { type IconBaseProps } from "react-icons";
import { HiOutlineCubeTransparent } from "react-icons/hi2";

/**
* A generic Trainee icon.
* Where possible, an Identicon should be used.
* An appropriate usage contexts would include:
* - Create a trainee actions
**/
export const TraineeIcon: FC<IconBaseProps> = (props) => (
<HiOutlineCubeTransparent {...props} />
);
53 changes: 37 additions & 16 deletions src/components/Icons/icons.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IconBaseProps } from "react-icons";
import {
MapDependentFeatureAttributesIcon,
TraineeDefineIcon,
TraineeIcon,
TraineeLoadIcon,
TraineeTrainIcon,
} from ".";
Expand All @@ -22,22 +23,27 @@ const meta: Meta<IconBaseProps> = {
args: {},
render: (args) => (
<div className="flex gap-4">
<IconWithLabel
label={"MapDependentFeatureAttributesIcon"}
Icon={<MapDependentFeatureAttributesIcon {...args} />}
/>
<IconWithLabel
label={"TraineeLoadIcon"}
Icon={<TraineeLoadIcon {...args} />}
/>
<IconWithLabel
label={"TraineeDefineIcon"}
Icon={<TraineeDefineIcon {...args} />}
/>
<IconWithLabel
label={"TraineeTrainIcon"}
Icon={<TraineeTrainIcon {...args} />}
/>
<Section title="Action">
<IconWithLabel
label={"MapDependentFeatureAttributesIcon"}
Icon={<MapDependentFeatureAttributesIcon {...args} />}
/>
<IconWithLabel
label={"TraineeLoadIcon"}
Icon={<TraineeLoadIcon {...args} />}
/>
<IconWithLabel
label={"TraineeDefineIcon"}
Icon={<TraineeDefineIcon {...args} />}
/>
<IconWithLabel
label={"TraineeTrainIcon"}
Icon={<TraineeTrainIcon {...args} />}
/>
</Section>
<Section title="Concepts">
<IconWithLabel label={"TraineeIcon"} Icon={<TraineeIcon {...args} />} />
</Section>
</div>
),
};
Expand All @@ -51,6 +57,21 @@ export const Default: Story = {
args: {},
};

type SectionProps = {
title: ReactNode;
children: ReactNode;
};
const Section: FC<SectionProps> = ({ title, children }) => {
return (
<section className="my-3">
<header>
<h2 className="text-lg font-semibold">{title}</h2>
</header>
<div className="flex flex-wrap items-start gap-4">{children}</div>
</section>
);
};

type IconWithLabelProps = { label: string; Icon: ReactNode };
const IconWithLabel: FC<IconWithLabelProps> = ({ label, Icon }) => (
<div className="flex flex-col items-center justify-center">
Expand Down
1 change: 1 addition & 0 deletions src/components/Icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./MapDependentFeatureAttributesIcon";
export * from "./TraineeDefineIcon";
export * from "./TraineeIcon";
export * from "./TraineeLoadIcon";
export * from "./TraineeTrainIcon";