React feather refactor (#6090)
Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
1 parent
c4bd2167e1
commit
205f73c4bc
15 files changed
+35
-40
No files matched your search
@@ -1,9 +1,9 @@
|
||||
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
||||
import * as Tooltip from "@radix-ui/react-tooltip";
|
||||
import { Check } from "react-feather";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { defaultAvatarSrc } from "@calcom/lib/defaultAvatarImage";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
import { Maybe } from "@trpc/server";
|
||||
|
||||
@@ -47,7 +47,7 @@ export function Avatar(props: AvatarProps) {
|
||||
size === "lg" ? "h-5 w-5" : "h-2 w-2"
|
||||
)}>
|
||||
<div className="flex h-full items-center justify-center p-[2px]">
|
||||
{size === "lg" && <Check className="" />}
|
||||
{size === "lg" && <Icon.FiCheck className="" />}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Icon } from "react-feather";
|
||||
import { GoPrimitiveDot } from "react-icons/go";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { SVGComponent } from "@calcom/types/SVGComponent";
|
||||
|
||||
const badgeClassNameByVariant = {
|
||||
default: "bg-orange-100 text-orange-800",
|
||||
@@ -23,7 +23,7 @@ const classNameBySize = {
|
||||
export type BadgeProps = {
|
||||
variant: keyof typeof badgeClassNameByVariant;
|
||||
size?: keyof typeof classNameBySize;
|
||||
StartIcon?: Icon;
|
||||
StartIcon?: SVGComponent;
|
||||
bold?: boolean;
|
||||
withDot?: boolean;
|
||||
rounded?: boolean;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { cva, VariantProps } from "class-variance-authority";
|
||||
import Link, { LinkProps } from "next/link";
|
||||
import React, { forwardRef } from "react";
|
||||
import { Icon } from "react-feather";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { applyStyleToMultipleVariants } from "@calcom/lib/cva";
|
||||
import { SVGComponent } from "@calcom/types/SVGComponent";
|
||||
import { Tooltip } from "@calcom/ui";
|
||||
|
||||
type InferredVariantProps = VariantProps<typeof buttonClasses>;
|
||||
@@ -13,9 +13,9 @@ export type ButtonBaseProps = {
|
||||
/** Action that happens when the button is clicked */
|
||||
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
/**Left aligned icon*/
|
||||
StartIcon?: Icon | React.ElementType;
|
||||
StartIcon?: SVGComponent | React.ElementType;
|
||||
/**Right aligned icon */
|
||||
EndIcon?: Icon;
|
||||
EndIcon?: SVGComponent;
|
||||
shallow?: boolean;
|
||||
/**Tool tip used when icon size is set to small */
|
||||
tooltip?: string;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { X, Circle, Check } from "react-feather";
|
||||
import { FieldValues, useFormContext } from "react-hook-form";
|
||||
|
||||
// TODO: Refactor import once V1 migration has happened
|
||||
@@ -50,12 +49,12 @@ export function HintsOrErrors<T extends FieldValues = FieldValues>(props: {
|
||||
className={error !== undefined ? (submitted ? "text-red-700" : "") : "text-green-600"}>
|
||||
{error !== undefined ? (
|
||||
submitted ? (
|
||||
<X size="12" strokeWidth="3" className="mr-2 -ml-1 inline-block" />
|
||||
<Icon.FiX size="12" strokeWidth="3" className="mr-2 -ml-1 inline-block" />
|
||||
) : (
|
||||
<Circle fill="currentColor" size="5" className="mr-2 inline-block" />
|
||||
<Icon.FiCircle fill="currentColor" size="5" className="mr-2 inline-block" />
|
||||
)
|
||||
) : (
|
||||
<Check size="12" strokeWidth="3" className="mr-2 -ml-1 inline-block" />
|
||||
<Icon.FiCheck size="12" strokeWidth="3" className="mr-2 -ml-1 inline-block" />
|
||||
)}
|
||||
{t(`${fieldName}_hint_${key}`)}
|
||||
</li>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React, { forwardRef, ReactElement, ReactNode, Ref, useCallback, useId, useState } from "react";
|
||||
import { Eye, EyeOff } from "react-feather";
|
||||
import { FieldValues, FormProvider, SubmitHandler, useFormContext, UseFormReturn } from "react-hook-form";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
@@ -211,9 +210,9 @@ export const PasswordField = forwardRef<HTMLInputElement, InputFieldProps>(funct
|
||||
type="button"
|
||||
onClick={() => toggleIsPasswordVisible()}>
|
||||
{isPasswordVisible ? (
|
||||
<EyeOff className="h-4 stroke-[2.5px]" />
|
||||
<Icon.FiEyeOff className="h-4 stroke-[2.5px]" />
|
||||
) : (
|
||||
<Eye className="h-4 stroke-[2.5px]" />
|
||||
<Icon.FiEye className="h-4 stroke-[2.5px]" />
|
||||
)}
|
||||
<span className="sr-only">{textLabel}</span>
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user