diff --git a/apps/nextjs/src/components/board/items/item-select-modal.spec.tsx b/apps/nextjs/src/components/board/items/item-select-modal.spec.tsx index df5c421d7..802a08123 100644 --- a/apps/nextjs/src/components/board/items/item-select-modal.spec.tsx +++ b/apps/nextjs/src/components/board/items/item-select-modal.spec.tsx @@ -161,7 +161,7 @@ describe("Advanced Add App - Modal Subcomponents", () => { await act(async () => root.render( - + , ), ); @@ -192,7 +192,13 @@ describe("Advanced Add App - Modal Subcomponents", () => { await act(async () => root.render( - + , ), ); diff --git a/apps/nextjs/src/components/board/items/item-select-modal.tsx b/apps/nextjs/src/components/board/items/item-select-modal.tsx index 8a08889ad..bb39de4ea 100644 --- a/apps/nextjs/src/components/board/items/item-select-modal.tsx +++ b/apps/nextjs/src/components/board/items/item-select-modal.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState } from "react"; +import { useMemo, useRef, useState } from "react"; import { Avatar, Badge, @@ -66,7 +66,7 @@ interface ItemSelectModalContentProps { initialSearch?: string; } -interface WidgetItemData { +export interface WidgetItemData { kind: WidgetKind; supportedIntegrations: IntegrationKind[]; icon: TablerIcon; @@ -556,7 +556,7 @@ export const WidgetItem = ({ ); }; -const ConnectionStatusBadge = ({ status }: { status: WidgetConnectionStatus }) => { +export const ConnectionStatusBadge = ({ status }: { status: WidgetConnectionStatus }) => { if (status === "noConnectionRequired") return null; const t = useI18n(); const color = status === "ready" ? "green" : status === "needsSetup" ? "yellow" : "gray"; @@ -568,7 +568,7 @@ const ConnectionStatusBadge = ({ status }: { status: WidgetConnectionStatus }) = ); }; -const SupportedIntegrations = ({ integrations }: { integrations: IntegrationKind[] }) => { +export const SupportedIntegrations = ({ integrations }: { integrations: IntegrationKind[] }) => { if (integrations.length === 0) { return ( diff --git a/packages/ui/src/components/selectable-card/selectable-card.module.d.css.ts b/packages/ui/src/components/selectable-card/selectable-card.module.d.css.ts new file mode 100644 index 000000000..3aa25b940 --- /dev/null +++ b/packages/ui/src/components/selectable-card/selectable-card.module.d.css.ts @@ -0,0 +1,7 @@ +declare const classes: { + readonly root: string; + readonly header: string; + readonly body: string; + readonly footer: string; +}; +export default classes; diff --git a/packages/ui/src/components/selectable-card/selectable-card.spec.tsx b/packages/ui/src/components/selectable-card/selectable-card.spec.tsx index d5d764298..f8c6ed373 100644 --- a/packages/ui/src/components/selectable-card/selectable-card.spec.tsx +++ b/packages/ui/src/components/selectable-card/selectable-card.spec.tsx @@ -3,7 +3,7 @@ import { act, createRef } from "react"; import { createRoot } from "react-dom/client"; import type { Root } from "react-dom/client"; -import { Badge, MantineProvider, Text } from "@mantine/core"; +import { Badge, MantineProvider } from "@mantine/core"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { SelectableCard } from "./selectable-card"; diff --git a/packages/ui/src/components/selectable-card/selectable-card.tsx b/packages/ui/src/components/selectable-card/selectable-card.tsx index 7bcc96053..93d133694 100644 --- a/packages/ui/src/components/selectable-card/selectable-card.tsx +++ b/packages/ui/src/components/selectable-card/selectable-card.tsx @@ -7,7 +7,6 @@ import { factory, Group, LoadingOverlay, - Stack, Text, Tooltip, useProps, @@ -54,124 +53,126 @@ const varsResolver = createVarsResolver((_theme, { radius }, })); -export const SelectableCard = factory((_props, ref) => { - const props = useProps("SelectableCard", defaultProps, _props); - const { - classNames, - className, - style, - styles, - unstyled, - vars, - attributes, - icon, - title, - topRight, - description, - footerLeft, - footerRight, - selected, - loading = false, - disabled = false, - children, - type = "button", - ...others - } = props; +export const SelectableCard = factory( + (_props: SelectableCardProps, ref: React.ForwardedRef) => { + const props = useProps("SelectableCard", defaultProps, _props); + const { + classNames, + className, + style, + styles, + unstyled, + vars, + attributes, + icon, + title, + topRight, + description, + footerLeft, + footerRight, + selected, + loading = false, + disabled = false, + children, + type = "button", + ...others + } = props; - const getStyles = useStyles({ - name: "SelectableCard", - classes, - props, - className, - style, - classNames, - styles, - unstyled, - vars, - attributes, - varsResolver, - }); + const getStyles = useStyles({ + name: "SelectableCard", + classes, + props, + className, + style, + classNames, + styles, + unstyled, + vars, + attributes, + varsResolver, + }); - return ( - - + return ( + + - {/* Header Section: Inset background with Title that never elides before the category */} - {(icon || title || topRight) && ( - - - - {icon} - {typeof title === "string" ? ( - + + + {icon} + {typeof title === "string" ? ( + + {title} + + ) : ( + title + )} + + {topRight && ( + - {title} - - ) : ( - title + {topRight} + )} - {topRight && ( - - {topRight} - - )} - - - )} + + )} - {/* Body: Custom Children or Default Description */} - {children ? ( - {children} - ) : description !== undefined ? ( - - - - {description || "No description provided"} - - - - ) : null} + {/* Body: Custom Children or Default Description */} + {children ? ( + {children} + ) : description !== undefined ? ( + + + + {description || "No description provided"} + + + + ) : null} - {/* Footer Section: Inset Dashed Bottom Meta */} - {(footerLeft || footerRight) && ( - - - {footerLeft} - {footerRight} - - - )} - - ); -}); + {/* Footer Section: Inset Dashed Bottom Meta */} + {(footerLeft || footerRight) && ( + + + {footerLeft} + {footerRight} + + + )} + + ); + }, +); SelectableCard.displayName = "@homarr/ui/SelectableCard"; SelectableCard.classes = classes; diff --git a/packages/ui/src/integration-select-grid/integration-select-grid.tsx b/packages/ui/src/integration-select-grid/integration-select-grid.tsx index 909fb7d75..914b1c463 100644 --- a/packages/ui/src/integration-select-grid/integration-select-grid.tsx +++ b/packages/ui/src/integration-select-grid/integration-select-grid.tsx @@ -13,7 +13,6 @@ import { IconBuildingBank, IconBusStop, IconCalendar, - IconCalendarWeek, IconChartBar, IconClock, IconClockPlay, diff --git a/packages/widgets/src/catalog.ts b/packages/widgets/src/catalog.ts index 4452ea62e..3287a15d5 100644 --- a/packages/widgets/src/catalog.ts +++ b/packages/widgets/src/catalog.ts @@ -15,7 +15,6 @@ import { IconBuildingBank, IconBusStop, IconCalendar, - IconCalendarWeek, IconChartAreaLine, IconChartBar, IconClock,