Skip to content

Commit c8806fc

Browse files
committed
Renamed cn utility class to cls.
Still in the code with a deprecation warning.
1 parent 8fb738b commit c8806fc

File tree

139 files changed

+380
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+380
-779
lines changed

examples/example_cloud/src/custom_entity_view/ProductDetailPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
AddIcon,
33
Button,
44
CenteredView,
5-
cn,
5+
cls,
66
defaultBorderMixin,
77
Label,
88
RadioGroup,
@@ -45,7 +45,7 @@ export function ProductDetailPreview({
4545
{product.images?.map((image, index) => (
4646
<button
4747
onClick={() => setSelectedImage(image)}
48-
className={cn("border hover:border-gray-900 rounded-lg overflow-hidden transition-colors dark:hover:border-gray-50", defaultBorderMixin)}>
48+
className={cls("border hover:border-gray-900 rounded-lg overflow-hidden transition-colors dark:hover:border-gray-50", defaultBorderMixin)}>
4949
<StorageImage storagePath={image}
5050
className="aspect-[5/6] object-contain bg-white"
5151
style={{

examples/example_cloud/src/custom_entity_view/components/StorageImage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useStorageSource } from "@firecms/core";
2-
import { cn } from "@firecms/cloud";
2+
import { cls } from "@firecms/cloud";
33
import { useEffect, useState } from "react";
44

55
export function StorageImage({ storagePath, style, className, alt }: {
@@ -23,7 +23,7 @@ export function StorageImage({ storagePath, style, className, alt }: {
2323

2424
return (<img
2525
alt={alt ?? "Generic"}
26-
className={cn("object-contain", className)}
26+
className={cls("object-contain", className)}
2727
style={{
2828
...style
2929
}} src={url}/>);

examples/example_pro/src/FirestoreApp/BoardView/QuoteItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { CSSProperties, FC } from "react";
22
import { DraggableProvided } from "@hello-pangea/dnd";
33
import type { ItemViewProps } from "./components/types";
44
import { Quote } from "./data";
5-
import { cn, defaultBorderMixin } from "@firecms/ui";
5+
import { cls, defaultBorderMixin } from "@firecms/ui";
66

77
const getBackgroundColor = (
88
isDragging: boolean,
@@ -47,7 +47,7 @@ const QuoteItemView: FC<ItemViewProps<Quote>> = ({
4747
data-index={index}
4848
aria-label={`${item.content.author}`}
4949
>
50-
<div className={cn(
50+
<div className={cls(
5151
"p-2 items-start flex border rounded-lg",
5252
defaultBorderMixin,
5353
getBorderColor(isDragging),

examples/example_pro/src/FirestoreApp/BoardView/components/Board.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { DragDropContext, Droppable } from "@hello-pangea/dnd";
44
import Column from "./Column";
55
import reorder, { reorderItemMap } from "./reorder";
66
import { Item, ItemMap, ItemViewProps } from "./types";
7-
import { cn } from "@firecms/ui";
7+
import { cls } from "@firecms/ui";
88

99
export interface BoardProps<T extends object, COLUMN extends string> {
1010
data: Item<T>[];
@@ -105,7 +105,7 @@ export const Board = <T extends object, COLUMN extends string>({
105105
{(provided: DroppableProvided) => (
106106
<div ref={provided.innerRef}
107107
{...provided.droppableProps}
108-
className={cn("md:p-4 h-full min-w-full inline-flex", className)}>
108+
className={cls("md:p-4 h-full min-w-full inline-flex", className)}>
109109
{ordered.map((key: string, index: number) => (
110110
<Column key={key}
111111
index={index}

examples/example_pro/src/FirestoreApp/BoardView/components/Column.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Draggable } from "@hello-pangea/dnd";
44
import SortableList from "./SortableList";
55
import { ColumnTitle } from "./ColumnTitle";
66
import type { Item } from "./types";
7-
import { cn, defaultBorderMixin } from "@firecms/ui";
7+
import { cls, defaultBorderMixin } from "@firecms/ui";
88

99
interface ColumnProps {
1010
title: string;
@@ -30,7 +30,7 @@ export default class Column extends Component<ColumnProps> {
3030
{(provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (
3131
<div ref={provided.innerRef}
3232
{...provided.draggableProps}
33-
className={cn("border h-full w-80 m-2 flex flex-col",
33+
className={cls("border h-full w-80 m-2 flex flex-col",
3434
"rounded-md",
3535
defaultBorderMixin,
3636
snapshot.isDragging ? "ring-2 ring-primary" : "",)}>

examples/example_pro/src/FirestoreApp/BoardView/components/ColumnTitle.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cn } from "@firecms/ui";
1+
import { cls } from "@firecms/ui";
22
import React from "react";
33

44
export const ColumnTitle = ({
@@ -9,7 +9,7 @@ export const ColumnTitle = ({
99
return (
1010
<h4
1111
className={
12-
cn("py-2 px-4 transition-colors duration-200 flex-grow select-none relative outline-none focus:outline focus:outline-2 focus:outline-offset-2",
12+
cls("py-2 px-4 transition-colors duration-200 flex-grow select-none relative outline-none focus:outline focus:outline-2 focus:outline-offset-2",
1313
"text-sm font-semibold text-gray-800 dark:text-gray-200",
1414
className)
1515
}

examples/example_pro/src/FirestoreApp/BoardView/components/SortableList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
DroppableStateSnapshot
77
} from "@hello-pangea/dnd";
88
import { Draggable, Droppable } from "@hello-pangea/dnd";
9-
import { cn } from "@firecms/ui";
9+
import { cls } from "@firecms/ui";
1010
import { ColumnTitle } from "./ColumnTitle";
1111
import type { Item, ItemViewProps } from "./types";
1212

@@ -80,7 +80,7 @@ function InnerList<T extends object>(props: InnerListProps<T>) {
8080
{title}
8181

8282
<div ref={dropProvided.innerRef}
83-
className={cn("min-h-full pb-4",)}>
83+
className={cls("min-h-full pb-4",)}>
8484
<InnerItemListMemo items={items}
8585
ItemComponent={ItemComponent}
8686
/>
@@ -133,7 +133,7 @@ export default function SortableList(props: SortableListProps): ReactElement {
133133
style={style}
134134
// isDropDisabled={Boolean(isDropDisabled)}
135135
{...dropProvided.droppableProps}
136-
className={cn("flex flex-col p-4 transition-opacity duration-100 transition-bg ease-linear w-64",
136+
className={cls("flex flex-col p-4 transition-opacity duration-100 transition-bg ease-linear w-64",
137137
"h-full w-full overflow-y-auto flex-1",
138138
"rounded-md",
139139
isDropDisabled ? "opacity-50" : "opacity-100",

examples/example_pro/src/FirestoreApp/custom_entity_view/ProductDetailPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
AddIcon,
33
Button,
44
CenteredView,
5-
cn,
5+
cls,
66
defaultBorderMixin,
77
Label,
88
RadioGroup,
@@ -46,7 +46,7 @@ export function ProductDetailPreview({
4646
<button
4747
key={`image_${index}`}
4848
onClick={() => setSelectedImage(image)}
49-
className={cn("border hover:border-gray-900 rounded-lg overflow-hidden transition-colors dark:hover:border-gray-50", defaultBorderMixin)}>
49+
className={cls("border hover:border-gray-900 rounded-lg overflow-hidden transition-colors dark:hover:border-gray-50", defaultBorderMixin)}>
5050
<StorageImage storagePath={image}
5151
className="aspect-[5/6] object-contain bg-white"
5252
style={{

examples/example_pro/src/FirestoreApp/custom_entity_view/components/StorageImage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState } from "react";
22
import { useStorageSource } from "@firecms/core";
3-
import { cn } from "@firecms/ui";
3+
import { cls } from "@firecms/ui";
44

55
export function StorageImage({ storagePath, style, className, alt }: {
66
alt?: string,
@@ -23,7 +23,7 @@ export function StorageImage({ storagePath, style, className, alt }: {
2323

2424
return (<img
2525
alt={alt ?? "Generic"}
26-
className={cn("object-contain", className)}
26+
className={cls("object-contain", className)}
2727
style={{
2828
...style
2929
}} src={url}/>);

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@
7070
"node_modules",
7171
"template/node_modules"
7272
],
73-
"gitHead": "54c0d79d2648c937d055bacab2d7d92fbd294c7b"
73+
"gitHead": "8fb738b6abf384c0cba679f293b049a0ac56a7c2"
7474
}

0 commit comments

Comments
 (0)