Skip to content

Commit 6cbd989

Browse files
committed
fix: format
1 parent ebe40cd commit 6cbd989

File tree

14 files changed

+35
-27
lines changed

14 files changed

+35
-27
lines changed

www/src/app/(app)/themes/[themeName]/theme-editor/components.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Section = ({
106106
}) => {
107107
return (
108108
<div className="rounded-sm border">
109-
<div className="bg-bg-muted/50 flex items-center justify-between gap-2 border-b pl-4 p-2">
109+
<div className="bg-bg-muted/50 flex items-center justify-between gap-2 border-b p-2 pl-4">
110110
<div>
111111
<h3 className="text-base font-medium">{title}</h3>
112112
{description && (
@@ -119,7 +119,12 @@ const Section = ({
119119
className="flex w-auto flex-row items-center"
120120
>
121121
<Label>style:</Label>
122-
<Button variant="outline" suffix={<ChevronDownIcon />} size="sm" className="bg-bg-inverse/5">
122+
<Button
123+
variant="outline"
124+
suffix={<ChevronDownIcon />}
125+
size="sm"
126+
className="bg-bg-inverse/5"
127+
>
123128
<SelectValue />
124129
</Button>
125130
<Popover>

www/src/app/(app)/themes/[themeName]/theme-editor/index.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ import { useUserThemes } from "@/modules/themes/atoms/themes-atom";
2323
import { CreateThemeDialog } from "@/modules/themes/components/create-theme-dialog";
2424
import { Theme } from "@/modules/themes/types";
2525
import { PreviewContent } from "../../preview";
26-
import { ModeSwitch } from "./mode-switch";
2726
import { ThemeColors } from "./colors";
27+
import { ThemeComponents } from "./components";
2828
import { ThemeEditorContext } from "./context";
2929
import { ThemeIconography } from "./iconography";
30+
import { ModeSwitch } from "./mode-switch";
3031
import { ThemeTypography } from "./typography";
31-
import { ThemeComponents } from "./components";
3232

3333
export function ThemeEditor({
3434
theme: themeProp,
@@ -75,7 +75,8 @@ export function ThemeEditor({
7575
</CreateThemeDialog>
7676
}
7777
>
78-
To adjust colors, fonts, radius, components and more, you need to clone the theme.
78+
To adjust colors, fonts, radius, components and more, you need to
79+
clone the theme.
7980
</Alert>
8081
)}
8182
<Section
@@ -102,7 +103,7 @@ export function ThemeEditor({
102103
<Section title="Iconography" description="Theme iconography">
103104
<ThemeIconography />
104105
</Section>
105-
<Section title="Components" description="Theme components">
106+
<Section title="Components" description="Theme components">
106107
<ThemeComponents />
107108
</Section>
108109
</ThemeEditorBody>

www/src/app/(app)/themes/preview.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import {
1212
} from "lucide-react";
1313
import { motion } from "motion/react";
1414
import { cn } from "@/lib/utils";
15+
import { useDebounce } from "@/hooks/use-debounce";
1516
import { useMounted } from "@/hooks/use-mounted";
1617
import { Button } from "@/components/core/button";
18+
import { Skeleton } from "@/components/core/skeleton";
1719
import { useSidebarContext } from "@/components/sidebar";
1820
import { useCurrentTheme } from "@/modules/themes/atoms/themes-atom";
19-
import { Skeleton } from "@/components/core/skeleton";
20-
import { useDebounce } from "@/hooks/use-debounce";
2121

2222
const PreviewContext = React.createContext<{
2323
isOpen: boolean;
@@ -128,8 +128,8 @@ export function PreviewContent({
128128
const iframeRef = React.useRef<HTMLIFrameElement>(null);
129129
const [isLoading, setLoading] = React.useState(false);
130130
const [currentPathname, setCurrentPathname] = React.useState("");
131-
const isMounted = useMounted()
132-
const debouncedIsMounted = useDebounce(isMounted, 1500)
131+
const isMounted = useMounted();
132+
const debouncedIsMounted = useDebounce(isMounted, 1500);
133133

134134
const reload = () => {
135135
if (iframeRef.current) {
@@ -247,9 +247,12 @@ export function PreviewContent({
247247
)}
248248
</div>
249249
</div>
250-
<Skeleton show={!debouncedIsMounted} className="size-full rounded-[inherit]">
250+
<Skeleton
251+
show={!debouncedIsMounted}
252+
className="size-full rounded-[inherit]"
253+
>
251254
<iframe
252-
ref={iframeRef}
255+
ref={iframeRef}
253256
src={`/preview/${themeName}`}
254257
className="rounded-{inherit] size-full"
255258
onLoad={() => {

www/src/app/internal/page.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@ export default function Demo() {
3030
onAnimationComplete={() => {
3131
setAnimating(false);
3232
}}
33-
3433
style={{ overflow: show ? "visible" : "hidden" }}
3534
>
3635
<div className="size-10 bg-red-500" />
3736
</motion.div>
3837
)}
3938
</AnimatePresence>
4039
</div>
41-
<p>
42-
{isAnimating ? "animating" : "not animating"}
43-
</p>
40+
<p>{isAnimating ? "animating" : "not animating"}</p>
4441
</div>
4542
);
4643
}

www/src/components/dynamic-core/alert.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import React from "react";
4-
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
54
import {
65
Alert as _Alert,
76
AlertRoot as _AlertRoot,
@@ -14,6 +13,7 @@ import type {
1413
AlertTitleProps,
1514
AlertContentProps,
1615
} from "@/registry/core/alert_basic";
16+
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
1717

1818
export const Alert = createDynamicComponent<AlertProps>(
1919
"alert",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "@/registry/core/breadcrumbs_basic"
1+
export * from "@/registry/core/breadcrumbs_basic";

www/src/components/dynamic-core/calendar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import React from "react";
44
import { type DateValue } from "react-aria-components";
5-
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
65
import {
76
Calendar as _Calendar,
87
CalendarRoot as _CalendarRoot,
@@ -27,6 +26,7 @@ import type {
2726
CalendarGridBodyProps,
2827
CalendarCellProps,
2928
} from "@/registry/core/calendar_basic";
29+
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
3030

3131
export const Calendar = createDynamicComponent<CalendarProps<DateValue>>(
3232
"calendar",
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "@/registry/core/drawer_basic";
1+
export * from "@/registry/core/drawer_basic";

www/src/components/dynamic-core/loader.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use client";
22

33
import React from "react";
4-
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
54
import { LoaderProps } from "@/registry/core/loader_ring";
65
import { Loader as _Loader } from "@/registry/core/loader_ring";
6+
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
77

88
export const Loader = createDynamicComponent<LoaderProps>(
99
"loader",
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "@/registry/core/modal_basic";
1+
export * from "@/registry/core/modal_basic";
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "@/registry/core/popover_basic"
1+
export * from "@/registry/core/popover_basic";

www/src/components/dynamic-core/tabs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import React from "react";
4-
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
54
import {
65
Tabs as _Tabs,
76
TabList as _TabList,
@@ -14,6 +13,7 @@ import type {
1413
TabProps,
1514
TabPanelProps,
1615
} from "@/registry/core/tabs_basic";
16+
import { createDynamicComponent } from "@/modules/themes/lib/create-dynamic-component";
1717

1818
export const Tabs = createDynamicComponent<TabsProps>("tabs", "Tabs", _Tabs, {
1919
motion: React.lazy(() =>

www/src/components/logo.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export const Logo = ({
5454
<div className="font-josefin group-data-collapsed/sidebar:opacity-0 mt-1.5 text-base font-bold leading-normal tracking-tighter transition-colors">
5555
{siteConfig.global.name}
5656
</div>
57-
<Badge className="border mt-0.5 px-2 group-data-collapsed/sidebar:opacity-0">beta</Badge>
57+
<Badge className="group-data-collapsed/sidebar:opacity-0 mt-0.5 border px-2">
58+
beta
59+
</Badge>
5860
</>
5961
)}
6062
</Link>

www/src/lib/colors.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { contrast, type ColorTuple } from "@adobe/leonardo-contrast-colors";
22
import { parseColor } from "react-aria-components";
33

44
export const getContrastTextColor = (color: string): "white" | "black" => {
5-
const colorValue = parseColor(color).toFormat("rgb")
5+
const colorValue = parseColor(color).toFormat("rgb");
66

77
const colorTuple: ColorTuple = [
88
colorValue.getChannelValue("red"),
@@ -15,6 +15,6 @@ export const getContrastTextColor = (color: string): "white" | "black" => {
1515

1616
const contrastText =
1717
contrastWithBlack > contrastWithWhite ? "black" : "white";
18-
18+
1919
return contrastText;
2020
};

0 commit comments

Comments
 (0)