chore: sync changes (#8343)

This commit is contained in:
Aaryan Khandelwal 2025-12-17 14:07:01 +05:30 committed by GitHub
parent d8930c5188
commit 7c6a6a3432
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 69 additions and 49 deletions

View file

@ -49,7 +49,7 @@ export const IssueKanbanLayoutRoot = observer(function IssueKanbanLayoutRoot(pro
return ( return (
<IssueLayoutHOC getGroupIssueCount={getGroupIssueCount} getIssueLoader={getIssueLoader}> <IssueLayoutHOC getGroupIssueCount={getGroupIssueCount} getIssueLoader={getIssueLoader}>
<div <div
className="horizontal-scrollbar scrollbar-lg relative flex size-ful overflow-x-auto overflow-y-hidden" className="horizontal-scrollbar scrollbar-lg relative flex size-full overflow-x-auto overflow-y-hidden"
ref={scrollableContainerRef} ref={scrollableContainerRef}
> >
<div className="relative h-full w-max min-w-full"> <div className="relative h-full w-max min-w-full">

View file

@ -50,7 +50,7 @@ const KanbanIssueDetailsBlock = observer(function KanbanIssueDetailsBlock(props:
</div> </div>
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>
<div className="w-full line-clamp-1 text-13 text-14 text-primary mb-1.5"> <div className="w-full line-clamp-1 text-13 text-primary mb-1.5">
<Tooltip tooltipContent={issue.name}> <Tooltip tooltipContent={issue.name}>
<span>{issue.name}</span> <span>{issue.name}</span>
</Tooltip> </Tooltip>

View file

@ -58,7 +58,9 @@ export function Layout({ children }: { children: ReactNode }) {
<div id="context-menu-portal" /> <div id="context-menu-portal" />
<div id="editor-portal" /> <div id="editor-portal" />
<AppProvider> <AppProvider>
<div className={cn("h-screen w-full overflow-hidden bg-canvas relative flex flex-col", "app-container")}> <div
className={cn("h-screen w-full overflow-hidden bg-canvas relative flex flex-col", "desktop-app-container")}
>
<main className="w-full h-full overflow-hidden relative">{children}</main> <main className="w-full h-full overflow-hidden relative">{children}</main>
</div> </div>
</AppProvider> </AppProvider>

View file

@ -41,7 +41,7 @@ export const CommentBlock = observer(function CommentBlock(props: TCommentBlock)
ref={commentBlockRef} ref={commentBlockRef}
> >
<div <div
className="absolute left-[13px] top-0 bottom-0 w-0.5 transition-border duration-1000 bg-layer-1" className="absolute left-[13px] top-0 bottom-0 w-px transition-border duration-1000 bg-layer-1"
aria-hidden aria-hidden
/> />
<div <div

View file

@ -1,6 +1,7 @@
import React from "react"; import React from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
// assets // assets
import { cn } from "@plane/utils";
import ProjectNotAuthorizedImg from "@/app/assets/auth/project-not-authorized.svg?url"; import ProjectNotAuthorizedImg from "@/app/assets/auth/project-not-authorized.svg?url";
import Unauthorized from "@/app/assets/auth/unauthorized.svg?url"; import Unauthorized from "@/app/assets/auth/unauthorized.svg?url";
import WorkspaceNotAuthorizedImg from "@/app/assets/auth/workspace-not-authorized.svg?url"; import WorkspaceNotAuthorizedImg from "@/app/assets/auth/workspace-not-authorized.svg?url";
@ -22,8 +23,8 @@ export const NotAuthorizedView = observer(function NotAuthorizedView(props: Prop
const asset = section === "settings" ? settingAsset : Unauthorized; const asset = section === "settings" ? settingAsset : Unauthorized;
return ( return (
<DefaultLayout className={className}> <DefaultLayout className={cn("bg-surface-1", className)}>
<div className="flex h-full w-full flex-col items-center justify-center gap-y-5 bg-surface-1 text-center"> <div className="flex h-full w-full flex-col items-center justify-center gap-y-5 text-center">
<div className="h-44 w-72"> <div className="h-44 w-72">
<img src={asset} className="h-[176px] w-[288px] object-contain" alt="ProjectSettingImg" /> <img src={asset} className="h-[176px] w-[288px] object-contain" alt="ProjectSettingImg" />
</div> </div>

View file

@ -33,12 +33,12 @@ export const BaseListGroup = observer(function BaseListGroup<T extends IBaseLayo
return ( return (
<div <div
ref={groupRef} ref={groupRef}
className={cn("relative flex flex-shrink-0 flex-col border-[1px] border-transparent", { className={cn("relative flex flex-shrink-0 flex-col", {
"bg-layer-1": isDraggingOver, "bg-layer-1": isDraggingOver,
})} })}
> >
{/* Group Header */} {/* Group Header */}
<Row className="sticky top-0 z-[2] w-full flex-shrink-0 border-b border-subtle bg-surface-2 py-1"> <div className="sticky top-0 w-full shrink-0 border-b border-subtle bg-layer-1 py-1 px-6 cursor-pointer z-10">
{renderGroupHeader ? ( {renderGroupHeader ? (
renderGroupHeader({ group, itemCount: itemIds.length, isCollapsed, onToggleGroup }) renderGroupHeader({ group, itemCount: itemIds.length, isCollapsed, onToggleGroup })
) : ( ) : (
@ -49,7 +49,7 @@ export const BaseListGroup = observer(function BaseListGroup<T extends IBaseLayo
onToggleGroup={onToggleGroup} onToggleGroup={onToggleGroup}
/> />
)} )}
</Row> </div>
{/* Group Items */} {/* Group Items */}
{!isCollapsed && ( {!isCollapsed && (

View file

@ -257,13 +257,13 @@ export const DateRangeDropdown = observer(function DateRangeDropdown(props: Prop
const comboOptions = ( const comboOptions = (
<Combobox.Options data-prevent-outside-click static> <Combobox.Options data-prevent-outside-click static>
<div <div
className="my-1 bg-surface-1 shadow-custom-shadow-rg border-[0.5px] border-strong rounded-md overflow-hidden z-30" className="my-1 bg-surface-1 border-[0.5px] border-subtle-1 rounded-md overflow-hidden z-30"
ref={setPopperElement} ref={setPopperElement}
style={styles.popper} style={styles.popper}
{...attributes.popper} {...attributes.popper}
> >
<Calendar <Calendar
className="rounded-md border border-subtle p-3" className="rounded-md border border-subtle p-3 text-12"
captionLayout="dropdown" captionLayout="dropdown"
selected={dateRange} selected={dateRange}
onSelect={(val: DateRange | undefined) => { onSelect={(val: DateRange | undefined) => {

View file

@ -9,7 +9,7 @@ import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast"; import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IUser, IImporterService } from "@plane/types"; import type { IUser, IImporterService } from "@plane/types";
// ui // ui
import { CustomSearchSelect } from "@plane/ui"; import { Checkbox, CustomSearchSelect } from "@plane/ui";
// hooks // hooks
import { useProject } from "@/hooks/store/use-project"; import { useProject } from "@/hooks/store/use-project";
import { useUser } from "@/hooks/store/user"; import { useUser } from "@/hooks/store/user";
@ -168,7 +168,7 @@ export const Exporter = observer(function Exporter(props: Props) {
onClick={() => setMultiple(!multiple)} onClick={() => setMultiple(!multiple)}
className="flex max-w-min cursor-pointer items-center gap-2" className="flex max-w-min cursor-pointer items-center gap-2"
> >
<input type="checkbox" checked={multiple} onChange={() => setMultiple(!multiple)} /> <Checkbox checked={multiple} onChange={() => setMultiple(!multiple)} />
<div className="whitespace-nowrap text-13"> <div className="whitespace-nowrap text-13">
{t("workspace_settings.settings.exports.export_separate_files")} {t("workspace_settings.settings.exports.export_separate_files")}
</div> </div>

View file

@ -36,7 +36,7 @@ export const GanttChartHeader = observer(function GanttChartHeader(props: Props)
style={{ height: `${GANTT_BREADCRUMBS_HEIGHT}px` }} style={{ height: `${GANTT_BREADCRUMBS_HEIGHT}px` }}
> >
<div className="ml-auto"> <div className="ml-auto">
<div className="ml-auto text-11 font-medium text-secondary"> <div className="ml-auto text-11 font-medium text-tertiary">
{blockIds ? `${blockIds.length} ${loaderTitle}` : t("common.loading")} {blockIds ? `${blockIds.length} ${loaderTitle}` : t("common.loading")}
</div> </div>
</div> </div>

View file

@ -33,7 +33,7 @@ export function InstanceNotReady() {
<div className="w-auto max-w-2xl relative space-y-8 py-10"> <div className="w-auto max-w-2xl relative space-y-8 py-10">
<div className="relative flex flex-col justify-center items-center space-y-4"> <div className="relative flex flex-col justify-center items-center space-y-4">
<h1 className="text-24 font-bold pb-3">Welcome aboard Plane!</h1> <h1 className="text-24 font-bold pb-3">Welcome aboard Plane!</h1>
<img src={PlaneTakeOffImage} className="object-contain" alt="Plane Logo" /> <img src={PlaneTakeOffImage} className="w-full h-full object-cover" alt="Plane Logo" />
<p className="font-medium text-14 text-placeholder"> <p className="font-medium text-14 text-placeholder">
Get started by setting up your instance and workspace Get started by setting up your instance and workspace
</p> </p>

View file

@ -111,13 +111,13 @@ export const SingleIntegrationCard = observer(function SingleIntegrationCard({ i
/> />
</div> </div>
<div> <div>
<h3 className="flex items-center gap-2 text-13 font-medium"> <h3 className="flex items-center gap-2 text-body-xs-medium">
{integration.title} {integration.title}
{workspaceIntegrations {workspaceIntegrations
? isInstalled && <CheckCircle className="h-3.5 w-3.5 fill-transparent text-green-500" /> ? isInstalled && <CheckCircle className="h-3.5 w-3.5 fill-transparent text-green-500" />
: null} : null}
</h3> </h3>
<p className="text-13 tracking-tight text-secondary"> <p className="text-body-xs-regular text-secondary">
{workspaceIntegrations {workspaceIntegrations
? isInstalled ? isInstalled
? integrationDetails[integration.provider].installed ? integrationDetails[integration.provider].installed

View file

@ -102,7 +102,7 @@ export const IssueActivity = observer(function IssueActivity(props: TIssueActivi
<div className="space-y-4"> <div className="space-y-4">
{/* header */} {/* header */}
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<div className="text-16 text-primary">{t("common.activity")}</div> <div className="text-h5-medium text-primary">{t("common.activity")}</div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
{isWorklogButtonEnabled && ( {isWorklogButtonEnabled && (
<IssueActivityWorklogCreateButton <IssueActivityWorklogCreateButton

View file

@ -284,7 +284,7 @@ export const IssueBlock = observer(function IssueBlock(props: IssueBlockProps) {
displayPropertyKey="sub_issue_count" displayPropertyKey="sub_issue_count"
shouldRenderProperty={(properties) => !!properties.sub_issue_count} shouldRenderProperty={(properties) => !!properties.sub_issue_count}
> >
<IssueStats issueId={issue.id} className="ml-2 font-medium text-tertiary" /> <IssueStats issueId={issue.id} className="ml-2 text-body-xs-medium text-tertiary" />
</WithDisplayPropertiesHOC> </WithDisplayPropertiesHOC>
)} )}
</div> </div>

View file

@ -14,7 +14,7 @@ export const SpreadsheetUpdatedOnColumn = observer(function SpreadsheetUpdatedOn
const { issue } = props; const { issue } = props;
return ( return (
<Row className="flex h-11 w-full items-center border-b-[0.5px] border-subtle text-11 hover:bg-layer-1 group-[.selected-issue-row]:bg-accent-primary/5 group-[.selected-issue-row]:hover:bg-accent-primary/10"> <Row className="flex h-11 w-full items-center border-b-[0.5px] border-subtle-1 text-11 hover:bg-layer-1 group-[.selected-issue-row]:bg-accent-primary/5 group-[.selected-issue-row]:hover:bg-accent-primary/10">
{renderFormattedDate(issue.updated_at)} {renderFormattedDate(issue.updated_at)}
</Row> </Row>
); );

View file

@ -265,7 +265,7 @@ const IssueRowDetails = observer(function IssueRowDetails(props: IssueRowDetails
> >
<Row <Row
className={cn( className={cn(
"group clickable cursor-pointer h-11 w-full flex items-center text-13 after:absolute border-r-[0.5px] z-10 border-subtle bg-transparent group-[.selected-issue-row]:bg-accent-primary/5 group-[.selected-issue-row]:hover:bg-accent-primary/10", "group clickable cursor-pointer h-11 w-full flex items-center text-13 after:absolute border-r-[0.5px] z-10 border-subtle-1 bg-transparent group-[.selected-issue-row]:bg-accent-primary/5 group-[.selected-issue-row]:hover:bg-accent-primary/10",
{ {
"border-b-[0.5px]": !getIsIssuePeeked(issueDetail.id), "border-b-[0.5px]": !getIsIssuePeeked(issueDetail.id),
"border border-accent-strong hover:border-accent-strong": "border border-accent-strong hover:border-accent-strong":

View file

@ -430,7 +430,7 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
ref={ref} ref={ref}
hasError={Boolean(errors.password)} hasError={Boolean(errors.password)}
placeholder="New password..." placeholder="New password..."
className="w-full border-[0.5px] border-strong pr-12 placeholder:text-placeholder" className="w-full border-[0.5px] border-subtle pr-12 placeholder:text-placeholder"
onFocus={() => setIsPasswordInputFocused(true)} onFocus={() => setIsPasswordInputFocused(true)}
onBlur={() => setIsPasswordInputFocused(false)} onBlur={() => setIsPasswordInputFocused(false)}
autoComplete="on" autoComplete="on"
@ -473,7 +473,7 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
ref={ref} ref={ref}
hasError={Boolean(errors.confirm_password)} hasError={Boolean(errors.confirm_password)}
placeholder={t("auth.common.password.confirm_password.placeholder")} placeholder={t("auth.common.password.confirm_password.placeholder")}
className="w-full border-strong pr-12 placeholder:text-placeholder" className="w-full border-subtle pr-12 placeholder:text-placeholder"
/> />
{showPassword.retypePassword ? ( {showPassword.retypePassword ? (
<EyeOff <EyeOff

View file

@ -42,7 +42,7 @@ export const ReadonlyEstimate = observer(function ReadonlyEstimate(props: TReado
}, [projectId, workspaceSlug]); }, [projectId, workspaceSlug]);
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{!hideIcon && <EstimatePropertyIcon className="size-4 flex-shrink-0" />} {!hideIcon && <EstimatePropertyIcon className="size-4 flex-shrink-0" />}
<span className="flex-grow truncate">{displayValue ?? placeholder ?? t("common.none")}</span> <span className="flex-grow truncate">{displayValue ?? placeholder ?? t("common.none")}</span>
</div> </div>

View file

@ -32,7 +32,7 @@ export const ReadonlyLabels = observer(function ReadonlyLabels(props: TReadonlyL
}, [projectId, workspaceSlug]); }, [projectId, workspaceSlug]);
return ( return (
<div className={cn("flex items-center gap-2 text-13", className)}> <div className={cn("flex items-center gap-2 text-body-xs-regular", className)}>
{labels && ( {labels && (
<> <>
<Tooltip <Tooltip
@ -42,7 +42,7 @@ export const ReadonlyLabels = observer(function ReadonlyLabels(props: TReadonlyL
isMobile={isMobile} isMobile={isMobile}
disabled={labels.length === 0} disabled={labels.length === 0}
> >
<div className="h-full flex items-center gap-1 rounded-sm py-1 text-13"> <div className="h-full flex items-center gap-1 rounded-sm py-1 text-body-xs-bold">
<span className="h-2 w-2 flex-shrink-0 rounded-full bg-accent-primary" /> <span className="h-2 w-2 flex-shrink-0 rounded-full bg-accent-primary" />
<span>{value.length}</span> <span>{value.length}</span>
<span>Labels</span> <span>Labels</span>

View file

@ -28,7 +28,7 @@ export const ReadonlyMember = observer(function ReadonlyMember(props: TReadonlyM
if (members.length === 0) { if (members.length === 0) {
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{<ButtonAvatars showTooltip={false} userIds={value} icon={Icon} />} {<ButtonAvatars showTooltip={false} userIds={value} icon={Icon} />}
<span className="flex-grow truncate">{placeholder ?? t("common.none")}</span> <span className="flex-grow truncate">{placeholder ?? t("common.none")}</span>
</div> </div>
@ -37,7 +37,7 @@ export const ReadonlyMember = observer(function ReadonlyMember(props: TReadonlyM
if (multiple) { if (multiple) {
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{!hideIcon && Icon && <Icon className="h-3 w-3 flex-shrink-0" />} {!hideIcon && Icon && <Icon className="h-3 w-3 flex-shrink-0" />}
<ButtonAvatars showTooltip={false} userIds={memberIds} /> <ButtonAvatars showTooltip={false} userIds={memberIds} />
</div> </div>
@ -47,7 +47,7 @@ export const ReadonlyMember = observer(function ReadonlyMember(props: TReadonlyM
const member = members[0]; const member = members[0];
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{!hideIcon && Icon && <Icon className="size-4 flex-shrink-0" />} {!hideIcon && Icon && <Icon className="size-4 flex-shrink-0" />}
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<div className="size-4 rounded-full bg-layer-1 flex items-center justify-center"> <div className="size-4 rounded-full bg-layer-1 flex items-center justify-center">

View file

@ -44,7 +44,7 @@ export const ReadonlyModule = observer(function ReadonlyModule(props: TReadonlyM
if (modules.length === 0) { if (modules.length === 0) {
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{!hideIcon && <Layers className="size-4 flex-shrink-0" />} {!hideIcon && <Layers className="size-4 flex-shrink-0" />}
<span className="flex-grow truncate">{placeholder ?? t("common.none")}</span> <span className="flex-grow truncate">{placeholder ?? t("common.none")}</span>
</div> </div>
@ -56,7 +56,7 @@ export const ReadonlyModule = observer(function ReadonlyModule(props: TReadonlyM
showCount && modules.length > 1 ? `${modules[0]?.name} +${modules.length - 1}` : modules[0]?.name; showCount && modules.length > 1 ? `${modules[0]?.name} +${modules.length - 1}` : modules[0]?.name;
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{!hideIcon && <Layers className="size-4 flex-shrink-0" />} {!hideIcon && <Layers className="size-4 flex-shrink-0" />}
<span className="flex-grow truncate">{displayText}</span> <span className="flex-grow truncate">{displayText}</span>
</div> </div>
@ -65,7 +65,7 @@ export const ReadonlyModule = observer(function ReadonlyModule(props: TReadonlyM
const moduleItem = modules[0]; const moduleItem = modules[0];
return ( return (
<div className={cn("flex items-center gap-2 text-13", className)}> <div className={cn("flex items-center gap-2 text-body-xs-regular", className)}>
{!hideIcon && <Layers className="size-4 flex-shrink-0" />} {!hideIcon && <Layers className="size-4 flex-shrink-0" />}
<span className="flex-grow truncate">{moduleItem?.name}</span> <span className="flex-grow truncate">{moduleItem?.name}</span>
</div> </div>

View file

@ -20,7 +20,7 @@ export const ReadonlyPriority = observer(function ReadonlyPriority(props: TReado
const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === value); const priorityDetails = ISSUE_PRIORITIES.find((p) => p.key === value);
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{!hideIcon && <PriorityIcon priority={value ?? "none"} size={12} className="flex-shrink-0" withContainer />} {!hideIcon && <PriorityIcon priority={value ?? "none"} size={12} className="flex-shrink-0" withContainer />}
<span className="flex-grow truncate">{priorityDetails?.title ?? placeholder ?? t("common.none")}</span> <span className="flex-grow truncate">{priorityDetails?.title ?? placeholder ?? t("common.none")}</span>
</div> </div>

View file

@ -46,7 +46,7 @@ export const ReadonlyState = observer(function ReadonlyState(props: TReadonlySta
if (stateLoader) { if (stateLoader) {
return ( return (
<Loader className={cn("flex items-center gap-1 text-13", className)}> <Loader className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
<Loader.Item height="16px" width="16px" className="rounded-full" /> <Loader.Item height="16px" width="16px" className="rounded-full" />
<Loader.Item height="16px" width="50px" /> <Loader.Item height="16px" width="50px" />
</Loader> </Loader>
@ -54,7 +54,7 @@ export const ReadonlyState = observer(function ReadonlyState(props: TReadonlySta
} }
return ( return (
<div className={cn("flex items-center gap-1 text-13", className)}> <div className={cn("flex items-center gap-1 text-body-xs-regular", className)}>
{!hideIcon && ( {!hideIcon && (
<StateGroupIcon <StateGroupIcon
stateGroup={state?.group ?? "backlog"} stateGroup={state?.group ?? "backlog"}

View file

@ -36,7 +36,7 @@ export function SettingsHeading({
</div> </div>
{showButton && customButton} {showButton && customButton}
{button && showButton && ( {button && showButton && (
<Button variant="primary" onClick={button.onClick} className="w-fit"> <Button variant="primary" size="lg" onClick={button.onClick} className="w-fit">
{button.label} {button.label}
</Button> </Button>
)} )}

View file

@ -1,6 +1,7 @@
import type { Control } from "react-hook-form"; import type { Control } from "react-hook-form";
import { Controller } from "react-hook-form"; import { Controller } from "react-hook-form";
import type { IWebhook } from "@plane/types"; import type { IWebhook } from "@plane/types";
import { Checkbox } from "@plane/ui";
export const INDIVIDUAL_WEBHOOK_OPTIONS: { export const INDIVIDUAL_WEBHOOK_OPTIONS: {
key: keyof IWebhook; key: keyof IWebhook;
@ -49,13 +50,7 @@ export function WebhookIndividualEventOptions({ control }: Props) {
render={({ field: { onChange, value } }) => ( render={({ field: { onChange, value } }) => (
<div> <div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<input <Checkbox id={option.key} onChange={() => onChange(!value)} checked={value === true} />
id={option.key}
onChange={() => onChange(!value)}
type="checkbox"
name="selectIndividualEvents"
checked={value === true}
/>
<label className="text-13" htmlFor={option.key}> <label className="text-13" htmlFor={option.key}>
{option.label} {option.label}
</label> </label>

View file

@ -17,7 +17,7 @@ export const WorkspaceLogo = observer(function WorkspaceLogo(props: Props) {
<div <div
className={cn( className={cn(
`relative grid h-6 w-6 flex-shrink-0 place-items-center uppercase ${ `relative grid h-6 w-6 flex-shrink-0 place-items-center uppercase ${
!props.logo && "rounded-md bg-[#026292] text-on-color" !props.logo && "rounded-md bg-accent-primary text-on-color"
} ${props.classNames ? props.classNames : ""}` } ${props.classNames ? props.classNames : ""}`
)} )}
> >

View file

@ -17,6 +17,13 @@ export enum EPillSize {
XS = "xs", XS = "xs",
} }
export enum ERadius {
SQUARE = "square",
CIRCLE = "circle",
}
export type TRadius = ERadius.SQUARE | ERadius.CIRCLE;
export type TPillVariant = export type TPillVariant =
| EPillVariant.DEFAULT | EPillVariant.DEFAULT
| EPillVariant.PRIMARY | EPillVariant.PRIMARY
@ -31,10 +38,11 @@ export interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {
size?: TPillSize; size?: TPillSize;
className?: string; className?: string;
children: React.ReactNode; children: React.ReactNode;
radius?: TRadius;
} }
const pillVariants = { const pillVariants = {
[EPillVariant.DEFAULT]: "bg-surface-2 text-secondary border border-subtle", [EPillVariant.DEFAULT]: "bg-surface-2 text-secondary border border-subtle-1",
[EPillVariant.PRIMARY]: "bg-accent-primary/10 text-accent-primary border border-accent-strong/20", [EPillVariant.PRIMARY]: "bg-accent-primary/10 text-accent-primary border border-accent-strong/20",
[EPillVariant.SUCCESS]: "bg-green-50 text-green-700 border border-green-200", [EPillVariant.SUCCESS]: "bg-green-50 text-green-700 border border-green-200",
[EPillVariant.WARNING]: "bg-amber-50 text-amber-700 border border-amber-200", [EPillVariant.WARNING]: "bg-amber-50 text-amber-700 border border-amber-200",
@ -49,8 +57,20 @@ const pillSizes = {
[EPillSize.LG]: "px-3 py-1.5 text-14", [EPillSize.LG]: "px-3 py-1.5 text-14",
}; };
const pillRadius = {
[ERadius.SQUARE]: "rounded",
[ERadius.CIRCLE]: "rounded-full",
};
const Pill = React.forwardRef(function Pill( const Pill = React.forwardRef(function Pill(
{ variant = EPillVariant.DEFAULT, size = EPillSize.MD, className, children, ...props }: PillProps, {
variant = EPillVariant.DEFAULT,
size = EPillSize.MD,
radius = ERadius.CIRCLE,
className,
children,
...props
}: PillProps,
ref: React.ForwardedRef<HTMLSpanElement> ref: React.ForwardedRef<HTMLSpanElement>
) { ) {
return ( return (
@ -63,6 +83,8 @@ const Pill = React.forwardRef(function Pill(
pillVariants[variant], pillVariants[variant],
// Size styles // Size styles
pillSizes[size], pillSizes[size],
// Radius styles
pillRadius[radius],
className className
)} )}
{...props} {...props}

View file

@ -11,7 +11,7 @@ interface SeparatorProps extends React.ComponentProps<typeof SeparatorPrimitive>
} }
const Separator = React.forwardRef(function Separator( const Separator = React.forwardRef(function Separator(
{ orientation = "horizontal", ...props }: SeparatorProps, { orientation = "horizontal", className, ...props }: SeparatorProps,
ref: React.ForwardedRef<React.ElementRef<typeof SeparatorPrimitive>> ref: React.ForwardedRef<React.ElementRef<typeof SeparatorPrimitive>>
) { ) {
return ( return (
@ -21,7 +21,7 @@ const Separator = React.forwardRef(function Separator(
data-slot="separator" data-slot="separator"
data-orientation={orientation} data-orientation={orientation}
{...props} {...props}
className={cn("bg-subtle-1", "shrink-0", orientation === "horizontal" ? "h-px w-full" : "h-full w-px")} className={cn("bg-subtle-1", "shrink-0", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className)}
/> />
); );
}); });

View file

@ -20,7 +20,7 @@ function ToggleSwitch(props: IToggleSwitchProps) {
disabled={disabled} disabled={disabled}
onChange={onChange} onChange={onChange}
className={cn( className={cn(
"relative inline-flex flex-shrink-0 h-6 w-10 cursor-pointer rounded-full border-0 transition-colors duration-200 ease-in-out focus:outline-none", "relative inline-flex flex-shrink-0 h-6 w-10 cursor-pointer rounded-full border border-subtle transition-colors duration-200 ease-in-out focus:outline-none bg-layer-1",
{ {
"h-4 w-7": size === "sm", "h-4 w-7": size === "sm",
"h-5 w-9": size === "md", "h-5 w-9": size === "md",