style: cycle ui revamp, and chore: code refactor (#2558)
* chore: cycle custom svg icon added and code refactor * chore: module code refactor * style: cycle ui revamp and code refactor * chore: cycle card view layout fix * chore: layout fix * style: module and cycle title tooltip position
This commit is contained in:
parent
7edaa49c21
commit
8eaac60aa5
23 changed files with 986 additions and 1107 deletions
20
packages/ui/src/icons/cycle/circle-dot-full-icon.tsx
Normal file
20
packages/ui/src/icons/cycle/circle-dot-full-icon.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import * as React from "react";
|
||||
|
||||
import { ISvgIcons } from "../type";
|
||||
|
||||
export const CircleDotFullIcon: React.FC<ISvgIcons> = ({
|
||||
className = "text-current",
|
||||
...rest
|
||||
}) => (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
className={`${className} stroke-2`}
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
{...rest}
|
||||
>
|
||||
<circle cx="8.33333" cy="8.33333" r="5.33333" stroke-linecap="round" />
|
||||
<circle cx="8.33333" cy="8.33333" r="4.33333" fill="currentColor" />
|
||||
</svg>
|
||||
);
|
||||
29
packages/ui/src/icons/cycle/contrast-icon.tsx
Normal file
29
packages/ui/src/icons/cycle/contrast-icon.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import * as React from "react";
|
||||
|
||||
import { ISvgIcons } from "../type";
|
||||
|
||||
export const ContrastIcon: React.FC<ISvgIcons> = ({
|
||||
className = "text-current",
|
||||
...rest
|
||||
}) => (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
className={`${className} stroke-2`}
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
{...rest}
|
||||
>
|
||||
<path
|
||||
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M12 18C13.5913 18 15.1174 17.3679 16.2426 16.2426C17.3679 15.1174 18 13.5913 18 12C18 10.4087 17.3679 8.88258 16.2426 7.75736C15.1174 6.63214 13.5913 6 12 6V18Z"
|
||||
fill="currentColor"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
33
packages/ui/src/icons/cycle/cycle-group-icon.tsx
Normal file
33
packages/ui/src/icons/cycle/cycle-group-icon.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import * as React from "react";
|
||||
|
||||
import { ContrastIcon } from "./contrast-icon";
|
||||
import { CircleDotFullIcon } from "./circle-dot-full-icon";
|
||||
import { CircleDotDashed, Circle } from "lucide-react";
|
||||
|
||||
import { CYCLE_GROUP_COLORS, ICycleGroupIcon } from "./helper";
|
||||
|
||||
const iconComponents = {
|
||||
current: ContrastIcon,
|
||||
upcoming: CircleDotDashed,
|
||||
completed: CircleDotFullIcon,
|
||||
draft: Circle,
|
||||
};
|
||||
|
||||
export const CycleGroupIcon: React.FC<ICycleGroupIcon> = ({
|
||||
className = "",
|
||||
color,
|
||||
cycleGroup,
|
||||
height = "12px",
|
||||
width = "12px",
|
||||
}) => {
|
||||
const CycleIconComponent = iconComponents[cycleGroup] || ContrastIcon;
|
||||
|
||||
return (
|
||||
<CycleIconComponent
|
||||
height={height}
|
||||
width={width}
|
||||
color={color ?? CYCLE_GROUP_COLORS[cycleGroup]}
|
||||
className={`flex-shrink-0 ${className}`}
|
||||
/>
|
||||
);
|
||||
};
|
||||
20
packages/ui/src/icons/cycle/double-circle-icon.tsx
Normal file
20
packages/ui/src/icons/cycle/double-circle-icon.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import * as React from "react";
|
||||
|
||||
import { ISvgIcons } from "../type";
|
||||
|
||||
export const DoubleCircleIcon: React.FC<ISvgIcons> = ({
|
||||
className = "text-current",
|
||||
...rest
|
||||
}) => (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
className={`${className} stroke-2`}
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
{...rest}
|
||||
>
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
<circle cx="12" cy="12" r="5.625" />
|
||||
</svg>
|
||||
);
|
||||
18
packages/ui/src/icons/cycle/helper.tsx
Normal file
18
packages/ui/src/icons/cycle/helper.tsx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
export interface ICycleGroupIcon {
|
||||
className?: string;
|
||||
color?: string;
|
||||
cycleGroup: TCycleGroups;
|
||||
height?: string;
|
||||
width?: string;
|
||||
}
|
||||
|
||||
export type TCycleGroups = "current" | "upcoming" | "completed" | "draft";
|
||||
|
||||
export const CYCLE_GROUP_COLORS: {
|
||||
[key in TCycleGroups]: string;
|
||||
} = {
|
||||
current: "#F59E0B",
|
||||
upcoming: "#3F76FF",
|
||||
completed: "#16A34A",
|
||||
draft: "#525252",
|
||||
};
|
||||
5
packages/ui/src/icons/cycle/index.ts
Normal file
5
packages/ui/src/icons/cycle/index.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export * from "./double-circle-icon";
|
||||
export * from "./circle-dot-full-icon";
|
||||
export * from "./contrast-icon";
|
||||
export * from "./circle-dot-full-icon";
|
||||
export * from "./cycle-group-icon";
|
||||
Loading…
Add table
Add a link
Reference in a new issue