Skip to content
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed

- Replaced `clsx` and `tailwind-merge` with the `cn` package

## [1.0.19] - 2026-08-20

### Fixed
Expand Down
5 changes: 2 additions & 3 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,15 @@
"@headlessui/react": "2.2.0",
"@shikijs/transformers": "3.21.0",
"@sindresorhus/slugify": "2.2.1",
"clsx": "2.1.1",
"cn": "^0.2.4",
"color": "4.2.3",
"comlink": "4.4.2",
"hast": "1.0.0",
"lodash": "4.18.1",
"lucide-react": "0.453.0",
"mermaid": "11.16.1",
"react-use-rect": "2.0.6",
"shiki": "3.21.0",
"tailwind-merge": "2.6.0"
"shiki": "3.21.0"
},
"devDependencies": {
"@shikijs/types": "3.21.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { cn } from "cn";
import type { ReactNode } from "react";

import { Icon } from "@/components/icon";
import { cn } from "@/utils/cn";

type AccordionCoverProps = {
id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { cn } from "cn";
import type { ReactNode } from "react";

import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";

type AccordionGroupProps = {
children: ReactNode;
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/accordion/accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import slugify from "@sindresorhus/slugify";
import { cn } from "cn";
import {
createContext,
type ReactNode,
Expand All @@ -9,9 +10,7 @@ import {
useState,
} from "react";
import { Icon as ComponentIcon } from "@/components/icon";

import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import type { IconType } from "@/utils/icon-utils";

import { AccordionCover } from "./accordion-cover";
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/badge/badge.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cn } from "cn";
import type React from "react";
import { Icon } from "@/components/icon";
import { cn } from "@/utils/cn";
import type { IconLibrary, IconType } from "@/utils/icon-utils";

const BADGE_COLORS = [
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/callout/callout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cn } from "cn";
import Color from "color";
import type { ReactNode } from "react";
import { Icon as ComponentIcon } from "@/components/icon";
Expand All @@ -10,7 +11,6 @@ import {
TipIcon,
WarningIcon,
} from "@/icons";
import { cn } from "@/utils/cn";
import type { IconLibrary, IconType } from "@/utils/icon-utils";

type CalloutVariant =
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/components/card/card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** biome-ignore-all lint/complexity/noExcessiveCognitiveComplexity: TODO */

import { cn } from "cn";
import { ArrowUpRight } from "lucide-react";
import type React from "react";
import type {
Expand All @@ -11,7 +13,6 @@ import type {
import { Icon as ComponentIcon } from "@/components/icon";
import { Classes } from "@/constants/selectors";
import { ArrowRightIcon } from "@/icons";
import { cn } from "@/utils/cn";
import type { IconLibrary, IconType } from "@/utils/icon-utils";
import { isRemoteUrl } from "@/utils/is-remote-url";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { cn } from "cn";
import type React from "react";

import {
DEFAULT_EXPANDABLE_CODE_BLOCK_HEIGHT,
SMALL_EXPANDABLE_CODE_BLOCK_HEIGHT,
SMALL_EXPANDABLE_NUMBER_OF_LINES,
useExpandable,
} from "@/hooks/use-expandable";
import { useGetShikiHighlightedHtml } from "@/hooks/use-get-shiki-highlighted-html";
import { cn } from "@/utils/cn";
import { getShikiBackgroundColors } from "@/utils/shiki/get-shiki-background-colors";
import { getCodeString, useCalculateCodeLines } from "@/utils/shiki/lib";

Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/code-block/code-block.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { cn } from "cn";
import type { ReactNode, RefObject } from "react";

import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import type { CodeBlockTheme, CodeStyling } from "@/utils/shiki/code-styling";
import { getCodeString } from "@/utils/shiki/lib";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { cn } from "cn";
import type { ReactNode } from "react";

import { Icon as ComponentIcon } from "@/components/icon";
import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import type { CodeBlockTheme } from "@/utils/shiki/code-styling";

type CodeHeaderProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cn } from "cn";
import { type ComponentPropsWithoutRef, useEffect, useState } from "react";
import { ActiveCopyButtonIcon, CopyButtonIcon } from "@/icons";
import { cn } from "@/utils/cn";
import {
type CopyToClipboardResult,
copyToClipboard,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "cn";
import { type ReactNode, useEffect, useMemo, useState } from "react";
import { cn } from "@/utils/cn";
import type { CodeBlockTheme, CodeStyling } from "@/utils/shiki/code-styling";
import { BaseCodeBlock } from "../code-block/base-code-block";
import {
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/code-group/code-group.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Tabs } from "@base-ui/react/tabs";
import { cn } from "cn";
import React, {
forwardRef,
type ReactElement,
Expand All @@ -8,7 +9,6 @@ import React, {
useRef,
useState,
} from "react";

import { BaseCodeBlock } from "@/components/code-block/base-code-block";
import type { CodeBlockProps } from "@/components/code-block/code-block";
import {
Expand All @@ -17,7 +17,6 @@ import {
} from "@/components/code-block/copy-button";
import { Icon as ComponentIcon } from "@/components/icon";
import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import type { CodeBlockTheme, CodeStyling } from "@/utils/shiki/code-styling";
import { getCodeString } from "@/utils/shiki/lib";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { cn } from "cn";
import { ChevronDownIcon } from "lucide-react";

import { cn } from "@/utils/cn";

import {
DropdownMenu,
DropdownMenuContent,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/code-group/dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Menu } from "@base-ui/react/menu";
import { cn } from "cn";
import { CheckIcon } from "lucide-react";
import type { ComponentPropsWithoutRef, ReactNode } from "react";
import { cn } from "@/utils/cn";

type DropdownMenuProps = {
children: ReactNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { cn } from "cn";
import { ChevronsUpDownIcon } from "lucide-react";
import { useState } from "react";

import { cn } from "@/utils/cn";
import type { CodeBlockTheme } from "@/utils/shiki/code-styling";
import { getDisplayName } from "@/utils/shiki/snippet-presets";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from "@/utils/cn";
import { cn } from "cn";
import { getLanguageIconUrl } from "@/utils/icon-utils";

type LanguageIconProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/color/color.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { cn } from "cn";
import type React from "react";
import { createContext, useContext, useEffect, useRef, useState } from "react";
import { Classes } from "@/constants/selectors";
import { useIsDarkTheme } from "@/hooks/use-is-dark-theme";
import { CheckIcon } from "@/icons";
import { cn } from "@/utils/cn";
import { copyToClipboard } from "@/utils/copy-to-clipboard";
import { Tooltip } from "../tooltip";
import type { ColorVariant } from "./constants";
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/columns/columns.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cn } from "cn";
import type React from "react";
import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import type { ColCount } from "./constants";
import { DEFAULT_COLS } from "./constants";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cn } from "cn";
import {
type ReactNode,
type RefObject,
Expand All @@ -9,7 +10,6 @@ import {
import { Icon } from "@/components/icon";
import { Classes } from "@/constants/selectors";
import { useExpandableMemory } from "@/hooks/use-expandable-memory";
import { cn } from "@/utils/cn";

const EXPANDABLE_CONTENT_CLASS = "expandable-content";
const DEFAULT_OPENED_TEXT = "Hide";
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/frame/frame.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { cn } from "cn";
import type { CSSProperties, ReactNode } from "react";

import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import { enhanceVideoProps } from "@/utils/enhance-video-props";

type FrameProps = {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/** biome-ignore-all lint/complexity/noExcessiveCognitiveComplexity: TODO */
import type { CSSProperties } from "react";

import { cn } from "cn";
import type { CSSProperties } from "react";
import { MINTLIFY_ICONS_CDN_URL } from "@/constants";
import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import {
getIconUrl,
ICON_TYPES,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/mermaid/mermaid.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { cn } from "cn";
import mermaid, { type MermaidConfig } from "mermaid";
import { useEffect, useId, useRef, useState } from "react";
import { Classes } from "@/constants/selectors";
import { useIsDarkTheme } from "@/hooks/use-is-dark-theme";
import { cn } from "@/utils/cn";
import { makeMarkerIdsUnique } from "@/utils/make-marker-ids-unique";
import { usePanZoom } from "./use-pan-zoom";
import { ZoomControls } from "./zoom-controls";
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/components/mermaid/zoom-controls.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cn } from "cn";
import {
ChevronDownIcon,
ChevronLeftIcon,
Expand All @@ -8,8 +9,6 @@ import {
ZoomOutIcon,
} from "lucide-react";
import type { ComponentProps } from "react";

import { cn } from "@/utils/cn";
import type { MermaidPlacement } from "./mermaid";

const Button = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/panel/panel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "cn";
import type { ComponentProps } from "react";
import { cn } from "@/utils/cn";

type PanelProps = ComponentProps<"div">;

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/property/param-head.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import slugify from "@sindresorhus/slugify";
import { cn } from "cn";
import { useCallback, useEffect, useRef, useState } from "react";
import { LinkIcon } from "@/icons";
import { cn } from "@/utils/cn";
import { copyToClipboard } from "@/utils/copy-to-clipboard";
import { DeprecatedPill, InfoPill, RequiredPill } from "./pills";
import type { PropertyProps } from "./property";
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/property/pills.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "cn";
import type React from "react";
import { cn } from "@/utils/cn";

type InfoPillProps = {
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/property/property.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cn } from "cn";
import { type ReactNode, useMemo } from "react";
import { MAX_DEFAULT_VALUE_LENGTH } from "@/constants";
import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import { ParamHead } from "./param-head";

type PropertyProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/search/button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cn } from "cn";
import { SearchIcon } from "lucide-react";
import { type ButtonHTMLAttributes, forwardRef } from "react";
import { cn } from "../../utils/cn";
import { useSearch } from "./provider";

type SearchButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/search/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Transition,
TransitionChild,
} from "@headlessui/react";
import { cn } from "cn";
import {
ChevronRightIcon,
Loader2Icon,
Expand All @@ -25,7 +26,6 @@ import {
useRef,
useState,
} from "react";
import { cn } from "../../utils/cn";

type SearchResult = {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/steps/steps.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { cn } from "cn";
import type React from "react";
import { type ReactNode, useCallback, useEffect, useState } from "react";
import { type Rect, useRect } from "react-use-rect";
import { Icon } from "@/components/icon";
import { Classes } from "@/constants/selectors";
import { LinkIcon } from "@/icons";
import { cn } from "@/utils/cn";
import { copyToClipboard } from "@/utils/copy-to-clipboard";
import type { IconLibrary, IconType } from "@/utils/icon-utils";
import { STEP_TITLE_SIZES, type StepTitleSize } from "./constants";
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/tabs/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cn } from "cn";
import {
Children,
isValidElement,
Expand All @@ -18,7 +19,6 @@ import {
CHILD_TAB_IDS_ATTRIBUTE,
} from "@/constants";
import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import type { IconLibrary, IconType } from "@/utils/icon-utils";
import { slugify } from "@/utils/slugify";

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/tile/tile.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "cn";
import { Classes } from "@/constants/selectors";
import { cn } from "@/utils/cn";
import { isRemoteUrl } from "@/utils/is-remote-url";

const SIZE = 24;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { TooltipPositionerProps } from "@base-ui/react/tooltip";
import { Tooltip as TooltipBaseUI } from "@base-ui/react/tooltip";
import { cn } from "cn";
import { ChevronRightIcon } from "lucide-react";
import { isValidElement, type ReactNode, useMemo, useState } from "react";
import { Classes } from "@/constants/selectors";
import { useHasHover } from "@/hooks/use-has-hover";
import { cn } from "@/utils/cn";
import { isRemoteUrl } from "@/utils/is-remote-url";
import { renderAsChild } from "@/utils/render-as-child";

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/tree/file.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cn } from "cn";
import type { CSSProperties } from "react";
import { Classes } from "@/constants/selectors";
import { FileIcon } from "@/icons";
import { cn } from "@/utils/cn";

import { useTreeLevel } from "./use-tree-level";
import { calculatePaddingLeft } from "./utils";
Expand Down
Loading
Loading