diff --git a/.oxlintrc.json b/.oxlintrc.json index 552578be5d..fa0ad7ef66 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -2,13 +2,6 @@ "$schema": "./node_modules/oxlint/configuration_schema.json", "extends": ["./node_modules/@hitachivantara/uikit-config/oxlint/strict.json"], "rules": { - "react/function-component-definition": [ - "error", - { - "namedComponents": ["arrow-function", "function-declaration"], - "unnamedComponents": "arrow-function" - } - ], "no-restricted-imports": [ "error", { diff --git a/.storybook/blocks/DocsContainer.tsx b/.storybook/blocks/DocsContainer.tsx index d5f128cdb7..56d98ff49f 100644 --- a/.storybook/blocks/DocsContainer.tsx +++ b/.storybook/blocks/DocsContainer.tsx @@ -2,13 +2,13 @@ import { useEffect, useState } from "react"; import { MDXProvider } from "@mdx-js/react"; import { DocsContainer, - DocsContainerProps, + type DocsContainerProps, } from "@storybook/addon-docs/blocks"; import { addons } from "storybook/preview-api"; import { HvProvider, - HvThemeColorMode, HvTypography, + type HvThemeColorMode, } from "@hitachivantara/uikit-react-core"; import { getInitialMode } from "../decorators/utils"; diff --git a/.storybook/decorators/utils.ts b/.storybook/decorators/utils.ts index f469f7b372..ea914f2168 100644 --- a/.storybook/decorators/utils.ts +++ b/.storybook/decorators/utils.ts @@ -1,5 +1,5 @@ import { useEffect, useRef } from "react"; -import { +import type { HvThemeColorMode, HvThemeStructure, } from "@hitachivantara/uikit-styles"; diff --git a/.storybook/theme.ts b/.storybook/theme.ts index dc0911c9b0..f717139ebf 100644 --- a/.storybook/theme.ts +++ b/.storybook/theme.ts @@ -1,4 +1,4 @@ -import { create, ThemeVarsPartial } from "storybook/theming"; +import { create, type ThemeVarsPartial } from "storybook/theming"; import { pentaho } from "@hitachivantara/uikit-styles"; const { colors } = pentaho; diff --git a/.storybook/types.ts b/.storybook/types.ts index 2469c77026..a7503e65db 100644 --- a/.storybook/types.ts +++ b/.storybook/types.ts @@ -21,9 +21,7 @@ interface DocsParameters extends Record { // https://github.com/storybookjs/storybook/issues/22860 declare module "@storybook/react-vite" { interface Parameters - extends StorybookParameters, - A11yParameters, - Record { + extends StorybookParameters, A11yParameters, Record { docs?: DocsParameters; chromatic?: ChromaticParameters; } diff --git a/apps/app/src/components/Container.tsx b/apps/app/src/components/Container.tsx index 589168d041..a895d14b89 100644 --- a/apps/app/src/components/Container.tsx +++ b/apps/app/src/components/Container.tsx @@ -1,12 +1,12 @@ import { Suspense } from "react"; import { HvContainer, - HvContainerProps, theme, + type HvContainerProps, } from "@hitachivantara/uikit-react-core"; import { useNavigationContext } from "../context/navigation"; -import { Loading, LoadingProps } from "./common/Loading"; +import { Loading, type LoadingProps } from "./common/Loading"; const useHeaderSpacing = () => { const { activePath, navigation } = useNavigationContext(); diff --git a/apps/app/src/pages/Components.tsx b/apps/app/src/pages/Components.tsx index a431a0725a..e7fe2cc8b6 100644 --- a/apps/app/src/pages/Components.tsx +++ b/apps/app/src/pages/Components.tsx @@ -2,7 +2,6 @@ import { useState } from "react"; import { HvAccordion, HvActionBar, - HvActionGeneric, HvAvatar, HvBannerContent, HvBreadCrumb, @@ -53,11 +52,12 @@ import { useHvRowSelection, useHvTable, useHvTableSticky, + type HvActionGeneric, } from "@hitachivantara/uikit-react-core"; // eslint-disable-next-line no-restricted-imports import { - AssetEvent, makeData, + type AssetEvent, } from "@hitachivantara/uikit-react-core/src/Table/stories/storiesUtils"; import { Backwards, diff --git a/apps/app/src/pages/Flow/DashboardPreview/DashboardPreview.tsx b/apps/app/src/pages/Flow/DashboardPreview/DashboardPreview.tsx index 58a7245c0c..0ec1cbbca3 100644 --- a/apps/app/src/pages/Flow/DashboardPreview/DashboardPreview.tsx +++ b/apps/app/src/pages/Flow/DashboardPreview/DashboardPreview.tsx @@ -5,15 +5,18 @@ import { HvGlobalActions, HvLoading, } from "@hitachivantara/uikit-react-core"; -import { HvDashboard, HvDashboardProps } from "@hitachivantara/uikit-react-lab"; +import { + HvDashboard, + type HvDashboardProps, +} from "@hitachivantara/uikit-react-lab"; import { HvVizProvider } from "@hitachivantara/uikit-react-viz"; import { DASHBOARDS_STORAGE_KEY, - DashboardSpecs, - DashboardsStorage, + type DashboardSpecs, + type DashboardsStorage, } from "../types"; -import { Renderer, RendererProps } from "./Renderers"; +import { Renderer, type RendererProps } from "./Renderers"; interface DashboardConfig extends Pick { items?: RendererProps[] & Record; diff --git a/apps/app/src/pages/Flow/DashboardPreview/Renderers/Renderer.tsx b/apps/app/src/pages/Flow/DashboardPreview/Renderers/Renderer.tsx index 7ea1745198..04d485d1f1 100644 --- a/apps/app/src/pages/Flow/DashboardPreview/Renderers/Renderer.tsx +++ b/apps/app/src/pages/Flow/DashboardPreview/Renderers/Renderer.tsx @@ -6,7 +6,7 @@ import { HvLineChart, } from "@hitachivantara/uikit-react-viz"; -import { NodeData } from "../../types"; +import type { NodeData } from "../../types"; import { datasets } from "../../utils"; import { ChartContainer } from "./ChartContainer"; import { Kpi } from "./Kpi"; diff --git a/apps/app/src/pages/Flow/DashboardPreview/Renderers/Table.tsx b/apps/app/src/pages/Flow/DashboardPreview/Renderers/Table.tsx index 1911346414..58ae39339a 100644 --- a/apps/app/src/pages/Flow/DashboardPreview/Renderers/Table.tsx +++ b/apps/app/src/pages/Flow/DashboardPreview/Renderers/Table.tsx @@ -8,7 +8,6 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, @@ -18,6 +17,7 @@ import { useHvFilters, useHvPagination, useHvSortBy, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { Ban } from "@hitachivantara/uikit-react-icons"; diff --git a/apps/app/src/pages/Flow/Flow.tsx b/apps/app/src/pages/Flow/Flow.tsx index dc031eb774..30f0ededc9 100644 --- a/apps/app/src/pages/Flow/Flow.tsx +++ b/apps/app/src/pages/Flow/Flow.tsx @@ -8,21 +8,21 @@ import { } from "@hitachivantara/uikit-react-core"; import { Add, Fail } from "@hitachivantara/uikit-react-icons"; import { - HvDashboardProps, HvFlow, HvFlowControls, HvFlowEmpty, - HvFlowInstance, - HvFlowProps, HvFlowSidebar, + type HvDashboardProps, + type HvFlowInstance, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; import { edges, nodes, nodeTypes, useNodeGroups } from "./config"; import { DASHBOARDS_STORAGE_KEY, - DashboardSpecs, - DashboardsStorage, LAYOUT_COLS, + type DashboardSpecs, + type DashboardsStorage, } from "./types"; import { buildLayout } from "./utils"; diff --git a/apps/app/src/pages/Flow/Nodes/BarChart.tsx b/apps/app/src/pages/Flow/Nodes/BarChart.tsx index a39c69aae0..06ccfca4d0 100644 --- a/apps/app/src/pages/Flow/Nodes/BarChart.tsx +++ b/apps/app/src/pages/Flow/Nodes/BarChart.tsx @@ -1,12 +1,12 @@ import { useMemo } from "react"; import { HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, useFlowInputNodes, + type HvFlowNodeFC, + type HvFlowNodeProps, } from "@hitachivantara/uikit-react-lab"; -import { NodeData } from "../types"; +import type { NodeData } from "../types"; export const BarChart: HvFlowNodeFC = (props) => { const inputNodes = useFlowInputNodes(); diff --git a/apps/app/src/pages/Flow/Nodes/Dashboard.tsx b/apps/app/src/pages/Flow/Nodes/Dashboard.tsx index 61263b1213..6d003fbeb3 100644 --- a/apps/app/src/pages/Flow/Nodes/Dashboard.tsx +++ b/apps/app/src/pages/Flow/Nodes/Dashboard.tsx @@ -13,15 +13,15 @@ import { Info } from "@hitachivantara/uikit-react-icons"; import { HvDashboard, HvFlowNode, - HvFlowNodeFC, - HvFlowNodeInput, + type HvFlowNodeFC, + type HvFlowNodeInput, } from "@hitachivantara/uikit-react-lab"; import { DASHBOARDS_STORAGE_KEY, - DashboardSpecs, - DashboardsStorage, - NodeData, + type DashboardSpecs, + type DashboardsStorage, + type NodeData, } from "../types"; import { toTitleCase } from "../utils"; diff --git a/apps/app/src/pages/Flow/Nodes/Dataset.tsx b/apps/app/src/pages/Flow/Nodes/Dataset.tsx index a689f671bf..edf68f04f4 100644 --- a/apps/app/src/pages/Flow/Nodes/Dataset.tsx +++ b/apps/app/src/pages/Flow/Nodes/Dataset.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const Dataset: HvFlowNodeFC = (props) => { return ( diff --git a/apps/app/src/pages/Flow/Nodes/DonutChart.tsx b/apps/app/src/pages/Flow/Nodes/DonutChart.tsx index 64fef1565a..ae3201686d 100644 --- a/apps/app/src/pages/Flow/Nodes/DonutChart.tsx +++ b/apps/app/src/pages/Flow/Nodes/DonutChart.tsx @@ -1,12 +1,12 @@ import { useMemo } from "react"; import { HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, useFlowInputNodes, + type HvFlowNodeFC, + type HvFlowNodeProps, } from "@hitachivantara/uikit-react-lab"; -import { NodeData } from "../types"; +import type { NodeData } from "../types"; export const DonutChart: HvFlowNodeFC = (props) => { const inputNodes = useFlowInputNodes(); diff --git a/apps/app/src/pages/Flow/Nodes/Kpi.tsx b/apps/app/src/pages/Flow/Nodes/Kpi.tsx index 0061eb115e..00d74d767d 100644 --- a/apps/app/src/pages/Flow/Nodes/Kpi.tsx +++ b/apps/app/src/pages/Flow/Nodes/Kpi.tsx @@ -1,12 +1,12 @@ import { useMemo } from "react"; import { HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, useFlowInputNodes, + type HvFlowNodeFC, + type HvFlowNodeProps, } from "@hitachivantara/uikit-react-lab"; -import { NodeData } from "../types"; +import type { NodeData } from "../types"; export const Kpi: HvFlowNodeFC = (props) => { const inputNodes = useFlowInputNodes(); diff --git a/apps/app/src/pages/Flow/Nodes/LineChart.tsx b/apps/app/src/pages/Flow/Nodes/LineChart.tsx index a40a06cb35..b6c8ece415 100644 --- a/apps/app/src/pages/Flow/Nodes/LineChart.tsx +++ b/apps/app/src/pages/Flow/Nodes/LineChart.tsx @@ -1,12 +1,12 @@ import { useMemo } from "react"; import { HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, useFlowInputNodes, + type HvFlowNodeFC, + type HvFlowNodeProps, } from "@hitachivantara/uikit-react-lab"; -import { NodeData } from "../types"; +import type { NodeData } from "../types"; export const LineChart: HvFlowNodeFC = (props) => { const inputNodes = useFlowInputNodes(); diff --git a/apps/app/src/pages/Flow/Nodes/Table.tsx b/apps/app/src/pages/Flow/Nodes/Table.tsx index 62a8063b9d..41a655f0e9 100644 --- a/apps/app/src/pages/Flow/Nodes/Table.tsx +++ b/apps/app/src/pages/Flow/Nodes/Table.tsx @@ -1,8 +1,8 @@ import { useMemo } from "react"; import { HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, + type HvFlowNodeFC, + type HvFlowNodeProps, } from "@hitachivantara/uikit-react-lab"; export const Table: HvFlowNodeFC = (props) => { diff --git a/apps/app/src/pages/Flow/config.tsx b/apps/app/src/pages/Flow/config.tsx index bb4818731a..1e8ee4c086 100644 --- a/apps/app/src/pages/Flow/config.tsx +++ b/apps/app/src/pages/Flow/config.tsx @@ -4,7 +4,10 @@ import { LineChartAlt, Storage, } from "@hitachivantara/uikit-react-icons"; -import { HvFlowNodeGroups, HvFlowProps } from "@hitachivantara/uikit-react-lab"; +import type { + HvFlowNodeGroups, + HvFlowProps, +} from "@hitachivantara/uikit-react-lab"; import { BarChart } from "./Nodes/BarChart"; import { Dashboard } from "./Nodes/Dashboard"; @@ -13,7 +16,7 @@ import { DonutChart } from "./Nodes/DonutChart"; import { Kpi } from "./Nodes/Kpi"; import { LineChart } from "./Nodes/LineChart"; import { Table } from "./Nodes/Table"; -import { NodeGroup } from "./types"; +import type { NodeGroup } from "./types"; import { useDatasets } from "./utils"; /** Node groups */ diff --git a/apps/app/src/pages/Flow/types.ts b/apps/app/src/pages/Flow/types.ts index e67b37c1f1..572404fee2 100644 --- a/apps/app/src/pages/Flow/types.ts +++ b/apps/app/src/pages/Flow/types.ts @@ -1,4 +1,4 @@ -import { +import type { HvDashboardProps, HvFlowInstance, } from "@hitachivantara/uikit-react-lab"; @@ -12,8 +12,10 @@ export const LAYOUT_COLS = 12; type Node = NonNullable["getNode"]>>; -export interface DashboardSpecs - extends Pick { +export interface DashboardSpecs extends Pick< + HvDashboardProps, + "layout" | "cols" +> { items: Node[]; } diff --git a/apps/app/src/pages/Flow/utils.tsx b/apps/app/src/pages/Flow/utils.tsx index f1fa27bf5b..6aeb06565b 100644 --- a/apps/app/src/pages/Flow/utils.tsx +++ b/apps/app/src/pages/Flow/utils.tsx @@ -1,7 +1,7 @@ import { loadArrow } from "arquero"; import useSWR from "swr"; -import { DashboardSpecs, LAYOUT_COLS } from "./types"; +import { LAYOUT_COLS, type DashboardSpecs } from "./types"; export const datasets = [ { diff --git a/apps/default-app/src/pages/Notifications/Notifications.tsx b/apps/default-app/src/pages/Notifications/Notifications.tsx index eae119a4cc..bcf7260ac1 100644 --- a/apps/default-app/src/pages/Notifications/Notifications.tsx +++ b/apps/default-app/src/pages/Notifications/Notifications.tsx @@ -1,18 +1,18 @@ import { useState } from "react"; import { - HvAppShellEventNotification, HvAppShellEventNotificationTrigger, - HvAppShellEventNotificationType, + type HvAppShellEventNotification, + type HvAppShellEventNotificationType, } from "@hitachivantara/app-shell-events"; import { - HvBannerVariant, HvButton, HvCheckBox, HvGlobalActions, HvGrid, HvInput, - HvSnackbarVariant, HvTypography, + type HvBannerVariant, + type HvSnackbarVariant, } from "@hitachivantara/uikit-react-core"; const Notifications = () => { diff --git a/apps/default-app/src/pages/ServicesDemo/ServicesDemo.tsx b/apps/default-app/src/pages/ServicesDemo/ServicesDemo.tsx index f398cf6793..64e2ddcd39 100644 --- a/apps/default-app/src/pages/ServicesDemo/ServicesDemo.tsx +++ b/apps/default-app/src/pages/ServicesDemo/ServicesDemo.tsx @@ -1,4 +1,4 @@ -import { FC, useMemo, useState } from "react"; +import { useMemo, useState, type FC } from "react"; import { useService, useServices } from "@hitachivantara/app-shell-services"; import { DynamicHooksEvaluator } from "@hitachivantara/app-shell-shared"; import { @@ -12,7 +12,7 @@ import { import { MainContainer } from "../../components/MainContainer"; import { ServiceDefinitions } from "../../services/serviceDefinition"; -import { +import type { MessageService, NotificationComponentProps, SimpleDataService, diff --git a/apps/default-app/src/pages/ShouldBeVisible/ShouldBeVisible.tsx b/apps/default-app/src/pages/ShouldBeVisible/ShouldBeVisible.tsx index 775d72bac2..071d825b4d 100644 --- a/apps/default-app/src/pages/ShouldBeVisible/ShouldBeVisible.tsx +++ b/apps/default-app/src/pages/ShouldBeVisible/ShouldBeVisible.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { HvContainer, HvTypography } from "@hitachivantara/uikit-react-core"; const ShouldBeVisible: FC = () => { diff --git a/apps/default-app/src/pages/ShouldNotBeVisible/ShouldNotBeVisible.tsx b/apps/default-app/src/pages/ShouldNotBeVisible/ShouldNotBeVisible.tsx index bee812315a..55013c5705 100644 --- a/apps/default-app/src/pages/ShouldNotBeVisible/ShouldNotBeVisible.tsx +++ b/apps/default-app/src/pages/ShouldNotBeVisible/ShouldNotBeVisible.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { HvContainer, HvTypography } from "@hitachivantara/uikit-react-core"; const ShouldNotBeVisible: FC = () => { diff --git a/apps/default-app/src/pages/Theming/Theming.tsx b/apps/default-app/src/pages/Theming/Theming.tsx index 9469037dd0..08aabe71c3 100644 --- a/apps/default-app/src/pages/Theming/Theming.tsx +++ b/apps/default-app/src/pages/Theming/Theming.tsx @@ -1,14 +1,14 @@ import { - HvAppShellEventTheme, HvAppShellEventThemeTrigger, + type HvAppShellEventTheme, } from "@hitachivantara/app-shell-events"; import { HvButton, HvGlobalActions, HvGrid, - HvThemeColorMode, HvTypography, useTheme, + type HvThemeColorMode, } from "@hitachivantara/uikit-react-core"; function Button({ colorMode }: { colorMode: HvThemeColorMode }) { diff --git a/apps/default-app/src/providers/AsyncProvider.tsx b/apps/default-app/src/providers/AsyncProvider.tsx index 3a12c50c7e..97c3d58e49 100644 --- a/apps/default-app/src/providers/AsyncProvider.tsx +++ b/apps/default-app/src/providers/AsyncProvider.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren, useMemo } from "react"; +import { useMemo, type PropsWithChildren } from "react"; import { AsyncContext } from "./shared/asyncContext"; diff --git a/apps/default-app/src/providers/DefaultAppProvider.tsx b/apps/default-app/src/providers/DefaultAppProvider.tsx index 45b8cf0c5a..ccf80aabd7 100644 --- a/apps/default-app/src/providers/DefaultAppProvider.tsx +++ b/apps/default-app/src/providers/DefaultAppProvider.tsx @@ -1,4 +1,9 @@ -import { createContext, PropsWithChildren, useMemo, useState } from "react"; +import { + createContext, + useMemo, + useState, + type PropsWithChildren, +} from "react"; import { useHvAppShellConfig } from "@hitachivantara/app-shell-shared"; type DefaultAppContextValue = { diff --git a/apps/default-app/src/providers/DynamicProvider.tsx b/apps/default-app/src/providers/DynamicProvider.tsx index eb97024dba..75f7faa78b 100644 --- a/apps/default-app/src/providers/DynamicProvider.tsx +++ b/apps/default-app/src/providers/DynamicProvider.tsx @@ -1,12 +1,8 @@ -import { ReactNode, useMemo } from "react"; +import { useMemo } from "react"; import { DynamicContext } from "./shared/dynamicContext"; -type DynamicProviderProps = { - children: ReactNode; -}; - -const DynamicProvider = ({ children }: DynamicProviderProps) => { +const DynamicProvider = ({ children }: React.PropsWithChildren) => { const value = useMemo( () => ({ message: "Dynamic Provider is active and visible after 10s delay", diff --git a/apps/default-app/src/providers/HiddenProvider.tsx b/apps/default-app/src/providers/HiddenProvider.tsx index edbf059a83..aa5b867d64 100644 --- a/apps/default-app/src/providers/HiddenProvider.tsx +++ b/apps/default-app/src/providers/HiddenProvider.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren, useMemo } from "react"; +import { useMemo, type PropsWithChildren } from "react"; import { HiddenContext } from "./shared/hiddenContext"; diff --git a/apps/default-app/src/services/components/NotificationComponent.tsx b/apps/default-app/src/services/components/NotificationComponent.tsx index 305563695f..3d348ac18d 100644 --- a/apps/default-app/src/services/components/NotificationComponent.tsx +++ b/apps/default-app/src/services/components/NotificationComponent.tsx @@ -1,7 +1,7 @@ import { RocketLaunchIcon } from "@phosphor-icons/react/RocketLaunch"; import { HvTypography } from "@hitachivantara/uikit-react-core"; -import { BasicNotification } from "../types"; +import type { BasicNotification } from "../types"; const NotificationComponent: BasicNotification = ({ message, variant }) => { return ( diff --git a/apps/default-app/src/services/create/useCreateNewDashboardAction.ts b/apps/default-app/src/services/create/useCreateNewDashboardAction.ts index 1079cb8966..6bab74b40e 100644 --- a/apps/default-app/src/services/create/useCreateNewDashboardAction.ts +++ b/apps/default-app/src/services/create/useCreateNewDashboardAction.ts @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { UseCreateNewContentAction } from "../types"; +import type { UseCreateNewContentAction } from "../types"; const useCreateNewDashboardAction: UseCreateNewContentAction = () => { const { t } = useTranslation(); diff --git a/apps/default-app/src/services/create/useCreateNewReportAction.ts b/apps/default-app/src/services/create/useCreateNewReportAction.ts index aa5d58874c..db300b15b8 100644 --- a/apps/default-app/src/services/create/useCreateNewReportAction.ts +++ b/apps/default-app/src/services/create/useCreateNewReportAction.ts @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { UseCreateNewContentAction } from "../types"; +import type { UseCreateNewContentAction } from "../types"; const useCreateNewReportAction: UseCreateNewContentAction = () => { const { t } = useTranslation(); diff --git a/apps/default-app/src/services/factories/createMessageService.ts b/apps/default-app/src/services/factories/createMessageService.ts index b477b099c6..8246ef9180 100644 --- a/apps/default-app/src/services/factories/createMessageService.ts +++ b/apps/default-app/src/services/factories/createMessageService.ts @@ -1,4 +1,4 @@ -import { MessageService, MessageServiceConfig } from "../types"; +import type { MessageService, MessageServiceConfig } from "../types"; // Simple factory function that creates a message service export default function createMessageService( diff --git a/apps/default-app/src/services/headerActions/CreateNewContentDropDownMenu.tsx b/apps/default-app/src/services/headerActions/CreateNewContentDropDownMenu.tsx index 7df6bd7a06..55fda1a227 100644 --- a/apps/default-app/src/services/headerActions/CreateNewContentDropDownMenu.tsx +++ b/apps/default-app/src/services/headerActions/CreateNewContentDropDownMenu.tsx @@ -1,16 +1,19 @@ -import { FC, useCallback, useMemo, useState } from "react"; +import { useCallback, useMemo, useState, type FC } from "react"; import { PlusCircleIcon } from "@phosphor-icons/react/PlusCircle"; import { useServices } from "@hitachivantara/app-shell-services"; import { DynamicHooksEvaluator } from "@hitachivantara/app-shell-shared"; import { HvDropDownMenu, - HvDropDownMenuProps, HvIconContainer, - HvListValue, + type HvDropDownMenuProps, + type HvListValue, } from "@hitachivantara/uikit-react-core"; import { ServiceDefinitions } from "../serviceDefinition"; -import { CreateNewContentAction, UseCreateNewContentAction } from "../types"; +import type { + CreateNewContentAction, + UseCreateNewContentAction, +} from "../types"; type OnDropDownMenuClickCallback = NonNullable; diff --git a/apps/default-app/src/services/types/BasicNotification.ts b/apps/default-app/src/services/types/BasicNotification.ts index e6887559e7..d847a05576 100644 --- a/apps/default-app/src/services/types/BasicNotification.ts +++ b/apps/default-app/src/services/types/BasicNotification.ts @@ -1,5 +1,5 @@ -import { FC } from "react"; -import { HvTypographyVariants } from "@hitachivantara/uikit-react-core"; +import type { FC } from "react"; +import type { HvTypographyVariants } from "@hitachivantara/uikit-react-core"; export interface NotificationComponentProps { message: string; diff --git a/apps/default-app/src/services/types/UseCreateNewContentAction.ts b/apps/default-app/src/services/types/UseCreateNewContentAction.ts index d3ced207f3..0a22714268 100644 --- a/apps/default-app/src/services/types/UseCreateNewContentAction.ts +++ b/apps/default-app/src/services/types/UseCreateNewContentAction.ts @@ -1,10 +1,8 @@ -import { ReactNode } from "react"; - export type CreateNewContentAction = { id: string; ordinal?: number; label: string; - icon?: ReactNode; + icon?: React.ReactNode; onAction: () => void; }; diff --git a/apps/docs/src/app/examples/dnd/DndKitMultiple.tsx b/apps/docs/src/app/examples/dnd/DndKitMultiple.tsx index 3b28fb3b1f..d0b8ca1cd1 100644 --- a/apps/docs/src/app/examples/dnd/DndKitMultiple.tsx +++ b/apps/docs/src/app/examples/dnd/DndKitMultiple.tsx @@ -1,14 +1,14 @@ -import { HTMLAttributes, useMemo, useState } from "react"; +import { useMemo, useState, type HTMLAttributes } from "react"; import { DndContext, - DragEndEvent, - DragOverEvent, DragOverlay, - DragStartEvent, KeyboardSensor, PointerSensor, useSensor, useSensors, + type DragEndEvent, + type DragOverEvent, + type DragStartEvent, } from "@dnd-kit/core"; import { arrayMove, SortableContext, useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; @@ -153,7 +153,9 @@ export const ColumnContainer = ({ column, items }: ColumnContainerProps) => { - {items?.map((item) => )} + {items?.map((item) => ( + + ))} diff --git a/apps/docs/src/app/examples/dnd/DndKitSingle.tsx b/apps/docs/src/app/examples/dnd/DndKitSingle.tsx index 06ec1783ce..4a7018e571 100644 --- a/apps/docs/src/app/examples/dnd/DndKitSingle.tsx +++ b/apps/docs/src/app/examples/dnd/DndKitSingle.tsx @@ -1,13 +1,13 @@ -import { HTMLAttributes, useMemo, useState } from "react"; +import { useMemo, useState, type HTMLAttributes } from "react"; import { DndContext, - DragOverEvent, DragOverlay, - DragStartEvent, KeyboardSensor, PointerSensor, useSensor, useSensors, + type DragOverEvent, + type DragStartEvent, } from "@dnd-kit/core"; import { arrayMove, @@ -161,7 +161,9 @@ export default function Demo() { > - {items?.map((item) => )} + {items?.map((item) => ( + + ))} diff --git a/apps/docs/src/app/examples/dnd/DndNative.tsx b/apps/docs/src/app/examples/dnd/DndNative.tsx index 6da57a920b..607124285c 100644 --- a/apps/docs/src/app/examples/dnd/DndNative.tsx +++ b/apps/docs/src/app/examples/dnd/DndNative.tsx @@ -3,8 +3,8 @@ import { clsx } from "clsx"; import { HvListContainer, HvListItem, - HvListItemProps, HvTypography, + type HvListItemProps, } from "@hitachivantara/uikit-react-core"; import { Battery, diff --git a/apps/docs/src/app/examples/dnd/kanban/Components.tsx b/apps/docs/src/app/examples/dnd/kanban/Components.tsx index 0578985c52..65bfadd582 100644 --- a/apps/docs/src/app/examples/dnd/kanban/Components.tsx +++ b/apps/docs/src/app/examples/dnd/kanban/Components.tsx @@ -24,7 +24,7 @@ import { Level5, } from "@hitachivantara/uikit-react-icons"; -import { Column, Task } from "./types"; +import type { Column, Task } from "./types"; interface TaskProps { task: Task; diff --git a/apps/docs/src/app/examples/dnd/kanban/Kanban.tsx b/apps/docs/src/app/examples/dnd/kanban/Kanban.tsx index b4dcb86ec7..d51db4b133 100644 --- a/apps/docs/src/app/examples/dnd/kanban/Kanban.tsx +++ b/apps/docs/src/app/examples/dnd/kanban/Kanban.tsx @@ -1,19 +1,19 @@ import { useMemo, useState } from "react"; import { DndContext, - DragEndEvent, - DragOverEvent, DragOverlay, - DragStartEvent, PointerSensor, useSensor, useSensors, + type DragEndEvent, + type DragOverEvent, + type DragStartEvent, } from "@dnd-kit/core"; import { arrayMove, SortableContext } from "@dnd-kit/sortable"; import { ColumnContainer, TaskCard } from "./Components"; import { defaultColumns, defaultTasks } from "./data"; -import { Column, Task } from "./types"; +import type { Column, Task } from "./types"; export default function Demo() { const sensors = useSensors( diff --git a/apps/docs/src/app/examples/dnd/kanban/data.tsx b/apps/docs/src/app/examples/dnd/kanban/data.tsx index 1c710cd15a..e1ae50823d 100644 --- a/apps/docs/src/app/examples/dnd/kanban/data.tsx +++ b/apps/docs/src/app/examples/dnd/kanban/data.tsx @@ -1,4 +1,4 @@ -import { Column, Task } from "./types"; +import type { Column, Task } from "./types"; export const defaultColumns: Column[] = [ { id: "col1", title: "To Do", color: "info" }, diff --git a/apps/docs/src/app/examples/dnd/kanban/types.ts b/apps/docs/src/app/examples/dnd/kanban/types.ts index d44e7ab4b0..fd8266d208 100644 --- a/apps/docs/src/app/examples/dnd/kanban/types.ts +++ b/apps/docs/src/app/examples/dnd/kanban/types.ts @@ -1,4 +1,4 @@ -import { HvColor } from "@hitachivantara/uikit-react-core"; +import type { HvColor } from "@hitachivantara/uikit-react-core"; export type Column = { id: string; diff --git a/apps/docs/src/app/examples/inputs/DropdownTreeview.tsx b/apps/docs/src/app/examples/inputs/DropdownTreeview.tsx index b97d64937e..2ac8ab753e 100644 --- a/apps/docs/src/app/examples/inputs/DropdownTreeview.tsx +++ b/apps/docs/src/app/examples/inputs/DropdownTreeview.tsx @@ -5,8 +5,8 @@ import { HvLabel, HvPanel, HvTreeItem, - HvTreeItemProps, HvTreeView, + type HvTreeItemProps, } from "@hitachivantara/uikit-react-core"; export default function Demo() { diff --git a/apps/docs/src/app/examples/kpis/Selectable.tsx b/apps/docs/src/app/examples/kpis/Selectable.tsx index 1b8af55510..7898dcf9ca 100644 --- a/apps/docs/src/app/examples/kpis/Selectable.tsx +++ b/apps/docs/src/app/examples/kpis/Selectable.tsx @@ -2,10 +2,10 @@ import { useId, useState } from "react"; import { HvCard, HvCardContent, - HvColor, HvRadio, HvStatusIcon, HvTypography, + type HvColor, } from "@hitachivantara/uikit-react-core"; const colors = ["positive", "warning", "negative", "info"] satisfies HvColor[]; diff --git a/apps/docs/src/app/examples/kpis/Semantic.tsx b/apps/docs/src/app/examples/kpis/Semantic.tsx index a9fb883d02..5d165c318d 100644 --- a/apps/docs/src/app/examples/kpis/Semantic.tsx +++ b/apps/docs/src/app/examples/kpis/Semantic.tsx @@ -1,9 +1,9 @@ import { HvCard, HvCardContent, - HvColor, HvStatusIcon, HvTypography, + type HvColor, } from "@hitachivantara/uikit-react-core"; const colors = ["positive", "warning", "negative", "info"] satisfies HvColor[]; diff --git a/apps/docs/src/app/examples/kpis/StatusIcon.tsx b/apps/docs/src/app/examples/kpis/StatusIcon.tsx index 67e688ba11..3d07665063 100644 --- a/apps/docs/src/app/examples/kpis/StatusIcon.tsx +++ b/apps/docs/src/app/examples/kpis/StatusIcon.tsx @@ -1,9 +1,9 @@ import { HvCard, HvCardContent, - HvColor, HvStatusIcon, HvTypography, + type HvColor, } from "@hitachivantara/uikit-react-core"; const colors = ["positive", "warning", "negative", "info"] satisfies HvColor[]; diff --git a/apps/docs/src/app/examples/menus/CheckboxDropdownMenu.tsx b/apps/docs/src/app/examples/menus/CheckboxDropdownMenu.tsx index 38da8a88b9..0f94c1d997 100644 --- a/apps/docs/src/app/examples/menus/CheckboxDropdownMenu.tsx +++ b/apps/docs/src/app/examples/menus/CheckboxDropdownMenu.tsx @@ -42,7 +42,9 @@ export default function Demo() { }} placeholder={
- {selected?.map((item) => )} + {selected?.map((item) => ( + + ))}
} onContainerCreation={() => searchRef.current?.focus()} diff --git a/apps/docs/src/app/examples/tables/CustomCellsTable.tsx b/apps/docs/src/app/examples/tables/CustomCellsTable.tsx index ddcfdb9fea..44eba2a1c3 100644 --- a/apps/docs/src/app/examples/tables/CustomCellsTable.tsx +++ b/apps/docs/src/app/examples/tables/CustomCellsTable.tsx @@ -1,11 +1,11 @@ import { useMemo, useState } from "react"; import { - HvCellProps, HvIconButton, HvStatusIcon, - HvTableColumnConfig, HvTag, HvTypography, + type HvCellProps, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { Delete } from "@hitachivantara/uikit-react-icons"; diff --git a/apps/docs/src/app/examples/tables/DefaultTable.tsx b/apps/docs/src/app/examples/tables/DefaultTable.tsx index 25720ab72c..3801eb854f 100644 --- a/apps/docs/src/app/examples/tables/DefaultTable.tsx +++ b/apps/docs/src/app/examples/tables/DefaultTable.tsx @@ -1,12 +1,12 @@ import { useCallback, useMemo, useRef, useState } from "react"; import { HvIconButton, - HvRowInstance, HvSearchInput, HvTab, - HvTableColumnConfig, - HvTableInstance, HvTabs, + type HvRowInstance, + type HvTableColumnConfig, + type HvTableInstance, } from "@hitachivantara/uikit-react-core"; import { Delete, Duplicate, Preview } from "@hitachivantara/uikit-react-icons"; diff --git a/apps/docs/src/app/examples/tables/GroupingTable.tsx b/apps/docs/src/app/examples/tables/GroupingTable.tsx index f6dc69b3fe..aca446105a 100644 --- a/apps/docs/src/app/examples/tables/GroupingTable.tsx +++ b/apps/docs/src/app/examples/tables/GroupingTable.tsx @@ -1,22 +1,22 @@ import { useState } from "react"; import { useGroupBy } from "react-table"; import { - HvCellInstance, - HvRowInstance, HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, HvTableSection, - HvTableState, theme, useHvHeaderGroups, useHvRowExpand, useHvTable, + type HvCellInstance, + type HvRowInstance, + type HvTableColumnConfig, + type HvTableState, } from "@hitachivantara/uikit-react-core"; import { makeData, type AssetEvent } from "./makeData"; diff --git a/apps/docs/src/app/examples/tables/SimpleTable.tsx b/apps/docs/src/app/examples/tables/SimpleTable.tsx index 01f72367f9..0d83d49d66 100644 --- a/apps/docs/src/app/examples/tables/SimpleTable.tsx +++ b/apps/docs/src/app/examples/tables/SimpleTable.tsx @@ -1,7 +1,7 @@ import { useMemo, useState } from "react"; import { HvIconButton, - HvTableColumnConfig, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { Delete } from "@hitachivantara/uikit-react-icons"; diff --git a/apps/docs/src/components/Header.tsx b/apps/docs/src/components/Header.tsx index 5c63ead1c5..7455b9a5a1 100644 --- a/apps/docs/src/components/Header.tsx +++ b/apps/docs/src/components/Header.tsx @@ -1,7 +1,7 @@ import { Suspense } from "react"; -import { ComponentDataParams, getComponentData } from "../utils/component"; -import { PlaygroundProps } from "./code/Playground"; +import { getComponentData, type ComponentDataParams } from "../utils/component"; +import type { PlaygroundProps } from "./code/Playground"; import { Description } from "./usage/Description"; import { Tabs } from "./usage/Tabs"; diff --git a/apps/docs/src/components/code/Playground.tsx b/apps/docs/src/components/code/Playground.tsx index 4c6b35dd88..6777011f2a 100644 --- a/apps/docs/src/components/code/Playground.tsx +++ b/apps/docs/src/components/code/Playground.tsx @@ -4,7 +4,7 @@ import { Children, isValidElement, useCallback, useState } from "react"; import { CodeEditor } from "react-live-runner"; -import { ComponentMeta } from "../../utils/component"; +import type { ComponentMeta } from "../../utils/component"; import { Controls, type Control } from "./Controls"; import { DocsProvider } from "./DocsProvider"; diff --git a/apps/docs/src/components/color/utils.ts b/apps/docs/src/components/color/utils.ts index 76d5200a76..4ae8ee360e 100644 --- a/apps/docs/src/components/color/utils.ts +++ b/apps/docs/src/components/color/utils.ts @@ -1,4 +1,7 @@ -import { HvColorTokens, HvThemeColors } from "@hitachivantara/uikit-styles"; +import type { + HvColorTokens, + HvThemeColors, +} from "@hitachivantara/uikit-styles"; /** Compatibility object between UI Kit tokens and NEXT tokens */ export const compatMap: Partial> = { diff --git a/apps/docs/src/components/tokens/BreakpointTokens.tsx b/apps/docs/src/components/tokens/BreakpointTokens.tsx index f9532f0e6b..bfd2efbdea 100644 --- a/apps/docs/src/components/tokens/BreakpointTokens.tsx +++ b/apps/docs/src/components/tokens/BreakpointTokens.tsx @@ -1,7 +1,7 @@ "use client"; import { HvTypography, useTheme } from "@hitachivantara/uikit-react-core"; -import { HvBreakpoints } from "@hitachivantara/uikit-styles"; +import type { HvBreakpoints } from "@hitachivantara/uikit-styles"; import { DocsProvider } from "../code/DocsProvider"; diff --git a/apps/docs/src/components/usage/Classes.tsx b/apps/docs/src/components/usage/Classes.tsx index c4a8e77129..6fe595b197 100644 --- a/apps/docs/src/components/usage/Classes.tsx +++ b/apps/docs/src/components/usage/Classes.tsx @@ -10,7 +10,7 @@ import { } from "@hitachivantara/uikit-react-core"; import type { HvTableColumnConfig } from "@hitachivantara/uikit-react-core"; -import { ComponentMeta } from "../../utils/component"; +import type { ComponentMeta } from "../../utils/component"; type ClassItem = { name: string; diff --git a/apps/docs/src/components/usage/Props.tsx b/apps/docs/src/components/usage/Props.tsx index e184ad258d..2af0330b72 100644 --- a/apps/docs/src/components/usage/Props.tsx +++ b/apps/docs/src/components/usage/Props.tsx @@ -17,7 +17,7 @@ import { } from "@hitachivantara/uikit-react-core"; import { Ban } from "@hitachivantara/uikit-react-icons"; -import { ComponentMeta } from "../../utils/component"; +import type { ComponentMeta } from "../../utils/component"; type PropsTableProps = { title: string; diff --git a/apps/docs/src/components/usage/Tabs.tsx b/apps/docs/src/components/usage/Tabs.tsx index 8a034517ca..c33566ac1f 100644 --- a/apps/docs/src/components/usage/Tabs.tsx +++ b/apps/docs/src/components/usage/Tabs.tsx @@ -3,8 +3,8 @@ import { usePathname, useRouter, useSearchParams } from "next/navigation"; import { HvTab, HvTabs } from "@hitachivantara/uikit-react-core"; -import { ComponentMeta } from "../../utils/component"; -import { Playground, PlaygroundProps } from "../code/Playground"; +import type { ComponentMeta } from "../../utils/component"; +import { Playground, type PlaygroundProps } from "../code/Playground"; import { Classes } from "./Classes"; import { Props } from "./Props"; diff --git a/apps/docs/src/content/_meta.ts b/apps/docs/src/content/_meta.ts index 826d8b78ef..6ccb76f02f 100644 --- a/apps/docs/src/content/_meta.ts +++ b/apps/docs/src/content/_meta.ts @@ -1,4 +1,4 @@ -import { MetaRecord } from "nextra"; +import type { MetaRecord } from "nextra"; export default { index: { diff --git a/apps/docs/src/examples/forms/ReactForm.tsx b/apps/docs/src/examples/forms/ReactForm.tsx index c43a0db4e1..d1210762e8 100644 --- a/apps/docs/src/examples/forms/ReactForm.tsx +++ b/apps/docs/src/examples/forms/ReactForm.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { typeToFlattenedError, z } from "zod"; +import { z, type typeToFlattenedError } from "zod"; import { HvButton, HvCheckBox, diff --git a/apps/docs/src/examples/forms/ReactHookForm.tsx b/apps/docs/src/examples/forms/ReactHookForm.tsx index 8eccfa9659..b14e76e944 100644 --- a/apps/docs/src/examples/forms/ReactHookForm.tsx +++ b/apps/docs/src/examples/forms/ReactHookForm.tsx @@ -1,9 +1,9 @@ import { Controller, - ControllerProps, - FieldError, useController, useForm, + type ControllerProps, + type FieldError, } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; @@ -11,14 +11,14 @@ import { HvButton, HvCheckBox, HvDatePicker, - HvFormElementProps, HvGrid, HvInput, - HvInputProps, HvRadio, HvRadioGroup, HvTextArea, HvTimePicker, + type HvFormElementProps, + type HvInputProps, } from "@hitachivantara/uikit-react-core"; import { Map } from "@hitachivantara/uikit-react-icons"; @@ -85,7 +85,8 @@ const getStatusProps = (error?: FieldError) => { }; interface InputControlProps - extends Pick, "name" | "control">, + extends + Pick, "name" | "control">, Omit, Record { component?: any; diff --git a/apps/docs/src/mdx-components.tsx b/apps/docs/src/mdx-components.tsx index 96016b651f..42f99ae153 100644 --- a/apps/docs/src/mdx-components.tsx +++ b/apps/docs/src/mdx-components.tsx @@ -1,5 +1,5 @@ import { useMDXComponents as getThemeComponents } from "nextra-theme-docs"; -import { MDXComponents } from "nextra/mdx-components"; +import type { MDXComponents } from "nextra/mdx-components"; import { Pre } from "./components/code/Pre"; diff --git a/examples/uikit-vite-ts/src/Container.tsx b/examples/uikit-vite-ts/src/Container.tsx index 7e0b15943b..1edd0fad3e 100644 --- a/examples/uikit-vite-ts/src/Container.tsx +++ b/examples/uikit-vite-ts/src/Container.tsx @@ -1,6 +1,5 @@ -import { ReactNode } from "react"; import { css } from "@emotion/css"; -import { Global, GlobalProps } from "@emotion/react"; +import { Global, type GlobalProps } from "@emotion/react"; import { HvContainer, HvHeader, @@ -15,7 +14,7 @@ const globalStyles: GlobalProps["styles"] = { "code::before, code::after": { content: '"`"' }, }; -export const Container = ({ children }: { children: ReactNode }) => { +export const Container = ({ children }: React.PropsWithChildren) => { const { selectedMode, changeMode } = useTheme(); const handleChangeTheme = () => { diff --git a/package-lock.json b/package-lock.json index 49f5f1ded7..c4f56474e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,8 +60,8 @@ "license-compliance": "^3.0.0", "lint-staged": "^16.1.0", "npm-run-all2": "^8.0.4", - "oxlint": "^1.56.0", - "prettier": "^3.1.0", + "oxlint": "^1.59.0", + "prettier": "^3.8.3", "pretty-quick": "^4.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -5088,9 +5088,9 @@ } }, "node_modules/@oxlint/binding-android-arm-eabi": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.56.0.tgz", - "integrity": "sha512-IyfYPthZyiSKwAv/dLjeO18SaK8MxLI9Yss2JrRDyweQAkuL3LhEy7pwIwI7uA3KQc1Vdn20kdmj3q0oUIQL6A==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.59.0.tgz", + "integrity": "sha512-etYDw/UaEv936AQUd/CRMBVd+e+XuuU6wC+VzOv1STvsTyZenLChepLWqLtnyTTp4YMlM22ypzogDDwqYxv5cg==", "cpu": [ "arm" ], @@ -5105,9 +5105,9 @@ } }, "node_modules/@oxlint/binding-android-arm64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.56.0.tgz", - "integrity": "sha512-Ga5zYrzH6vc/VFxhn6MmyUnYEfy9vRpwTIks99mY3j6Nz30yYpIkWryI0QKPCgvGUtDSXVLEaMum5nA+WrNOSg==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.59.0.tgz", + "integrity": "sha512-TgLc7XVLKH2a4h8j3vn1MDjfK33i9MY60f/bKhRGWyVzbk5LCZ4X01VZG7iHrMmi5vYbAp8//Ponigx03CLsdw==", "cpu": [ "arm64" ], @@ -5122,9 +5122,9 @@ } }, "node_modules/@oxlint/binding-darwin-arm64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.56.0.tgz", - "integrity": "sha512-ogmbdJysnw/D4bDcpf1sPLpFThZ48lYp4aKYm10Z/6Nh1SON6NtnNhTNOlhEY296tDFItsZUz+2tgcSYqh8Eyw==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.59.0.tgz", + "integrity": "sha512-DXyFPf5ZKldMLloRHx/B9fsxsiTQomaw7cmEW3YIJko2HgCh+GUhp9gGYwHrqlLJPsEe3dYj9JebjX92D3j3AA==", "cpu": [ "arm64" ], @@ -5139,9 +5139,9 @@ } }, "node_modules/@oxlint/binding-darwin-x64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.56.0.tgz", - "integrity": "sha512-x8QE1h+RAtQ2g+3KPsP6Fk/tdz6zJQUv5c7fTrJxXV3GHOo+Ry5p/PsogU4U+iUZg0rj6hS+E4xi+mnwwlDCWQ==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.59.0.tgz", + "integrity": "sha512-LgvrsdgVLX1qWqIEmNsSmMXJhpAWdtUQ0M+oR0CySwi+9IHWyOGuIL8w8+u/kbZNMyZr4WUyYB5i0+D+AKgkLg==", "cpu": [ "x64" ], @@ -5156,9 +5156,9 @@ } }, "node_modules/@oxlint/binding-freebsd-x64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.56.0.tgz", - "integrity": "sha512-6G+WMZvwJpMvY7my+/SHEjb7BTk/PFbePqLpmVmUJRIsJMy/UlyYqjpuh0RCgYYkPLcnXm1rUM04kbTk8yS1Yg==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.59.0.tgz", + "integrity": "sha512-bOJhqX/ny4hrFuTPlyk8foSRx/vLRpxJh0jOOKN2NWW6FScXHPAA5rQbrwdQPcgGB5V8Ua51RS03fke8ssBcug==", "cpu": [ "x64" ], @@ -5173,9 +5173,9 @@ } }, "node_modules/@oxlint/binding-linux-arm-gnueabihf": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.56.0.tgz", - "integrity": "sha512-YYHBsk/sl7fYwQOok+6W5lBPeUEvisznV/HZD2IfZmF3Bns6cPC3Z0vCtSEOaAWTjYWN3jVsdu55jMxKlsdlhg==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.59.0.tgz", + "integrity": "sha512-vVUXxYMF9trXCsz4m9H6U0IjehosVHxBzVgJUxly1uz4W1PdDyicaBnpC0KRXsHYretLVe+uS9pJy8iM57Kujw==", "cpu": [ "arm" ], @@ -5190,9 +5190,9 @@ } }, "node_modules/@oxlint/binding-linux-arm-musleabihf": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.56.0.tgz", - "integrity": "sha512-+AZK8rOUr78y8WT6XkDb04IbMRqauNV+vgT6f8ZLOH8wnpQ9i7Nol0XLxAu+Cq7Sb+J9wC0j6Km5hG8rj47/yQ==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.59.0.tgz", + "integrity": "sha512-TULQW8YBPGRWg5yZpFPL54HLOnJ3/HiX6VenDPi6YfxB/jlItwSMFh3/hCeSNbh+DAMaE1Py0j5MOaivHkI/9Q==", "cpu": [ "arm" ], @@ -5207,9 +5207,9 @@ } }, "node_modules/@oxlint/binding-linux-arm64-gnu": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.56.0.tgz", - "integrity": "sha512-urse2SnugwJRojUkGSSeH2LPMaje5Q50yQtvtL9HFckiyeqXzoFwOAZqD5TR29R2lq7UHidfFDM9EGcchcbb8A==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.59.0.tgz", + "integrity": "sha512-Gt54Y4eqSgYJ90xipm24xeyaPV854706o/kiT8oZvUt3VDY7qqxdqyGqchMaujd87ib+/MXvnl9WkK8Cc1BExg==", "cpu": [ "arm64" ], @@ -5224,9 +5224,9 @@ } }, "node_modules/@oxlint/binding-linux-arm64-musl": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.56.0.tgz", - "integrity": "sha512-rkTZkBfJ4TYLjansjSzL6mgZOdN5IvUnSq3oNJSLwBcNvy3dlgQtpHPrRxrCEbbcp7oQ6If0tkNaqfOsphYZ9g==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.59.0.tgz", + "integrity": "sha512-3CtsKp7NFB3OfqQzbuAecrY7GIZeiv7AD+xutU4tefVQzlfmTI7/ygWLrvkzsDEjTlMq41rYHxgsn6Yh8tybmA==", "cpu": [ "arm64" ], @@ -5241,9 +5241,9 @@ } }, "node_modules/@oxlint/binding-linux-ppc64-gnu": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.56.0.tgz", - "integrity": "sha512-uqL1kMH3u69/e1CH2EJhP3CP28jw2ExLsku4o8RVAZ7fySo9zOyI2fy9pVlTAp4voBLVgzndXi3SgtdyCTa2aA==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.59.0.tgz", + "integrity": "sha512-K0diOpT3ncDmOfl9I1HuvpEsAuTxkts0VYwIv/w6Xiy9CdwyPBVX88Ga9l8VlGgMrwBMnSY4xIvVlVY/fkQk7Q==", "cpu": [ "ppc64" ], @@ -5258,9 +5258,9 @@ } }, "node_modules/@oxlint/binding-linux-riscv64-gnu": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.56.0.tgz", - "integrity": "sha512-j0CcMBOgV6KsRaBdsebIeiy7hCjEvq2KdEsiULf2LZqAq0v1M1lWjelhCV57LxsqaIGChXFuFJ0RiFrSRHPhSg==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.59.0.tgz", + "integrity": "sha512-xAU7+QDU6kTJJ7mJLOGgo7oOjtAtkKyFZ0Yjdb5cEo3DiCCPFLvyr08rWiQh6evZ7RiUTf+o65NY/bqttzJiQQ==", "cpu": [ "riscv64" ], @@ -5275,9 +5275,9 @@ } }, "node_modules/@oxlint/binding-linux-riscv64-musl": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.56.0.tgz", - "integrity": "sha512-7VDOiL8cDG3DQ/CY3yKjbV1c4YPvc4vH8qW09Vv+5ukq3l/Kcyr6XGCd5NvxUmxqDb2vjMpM+eW/4JrEEsUetA==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.59.0.tgz", + "integrity": "sha512-KUmZmKlTTyauOnvUNVxK7G40sSSx0+w5l1UhaGsC6KPpOYHenx2oqJTnabmpLJicok7IC+3Y6fXAUOMyexaeJQ==", "cpu": [ "riscv64" ], @@ -5292,9 +5292,9 @@ } }, "node_modules/@oxlint/binding-linux-s390x-gnu": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.56.0.tgz", - "integrity": "sha512-JGRpX0M+ikD3WpwJ7vKcHKV6Kg0dT52BW2Eu2BupXotYeqGXBrbY+QPkAyKO6MNgKozyTNaRh3r7g+VWgyAQYQ==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.59.0.tgz", + "integrity": "sha512-4usRxC8gS0PGdkHnRmwJt/4zrQNZyk6vL0trCxwZSsAKM+OxhB8nKiR+mhjdBbl8lbMh2gc3bZpNN/ik8c4c2A==", "cpu": [ "s390x" ], @@ -5309,9 +5309,9 @@ } }, "node_modules/@oxlint/binding-linux-x64-gnu": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.56.0.tgz", - "integrity": "sha512-dNaICPvtmuxFP/VbqdofrLqdS3bM/AKJN3LMJD52si44ea7Be1cBk6NpfIahaysG9Uo+L98QKddU9CD5L8UHnQ==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.59.0.tgz", + "integrity": "sha512-s/rNE2gDmbwAOOP493xk2X7M8LZfI1LJFSSW1+yanz3vuQCFPiHkx4GY+O1HuLUDtkzGlhtMrIcxxzyYLv308w==", "cpu": [ "x64" ], @@ -5326,9 +5326,9 @@ } }, "node_modules/@oxlint/binding-linux-x64-musl": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.56.0.tgz", - "integrity": "sha512-pF1vOtM+GuXmbklM1hV8WMsn6tCNPvkUzklj/Ej98JhlanbmA2RB1BILgOpwSuCTRTIYx2MXssmEyQQ90QF5aA==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.59.0.tgz", + "integrity": "sha512-+yYj1udJa2UvvIUmEm0IcKgc0UlPMgz0nsSTvkPL2y6n0uU5LgIHSwVu4AHhrve6j9BpVSoRksnz8c9QcvITJA==", "cpu": [ "x64" ], @@ -5343,9 +5343,9 @@ } }, "node_modules/@oxlint/binding-openharmony-arm64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.56.0.tgz", - "integrity": "sha512-bp8NQ4RE6fDIFLa4bdBiOA+TAvkNkg+rslR+AvvjlLTYXLy9/uKAYLQudaQouWihLD/hgkrXIKKzXi5IXOewwg==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.59.0.tgz", + "integrity": "sha512-bUplUb48LYsB3hHlQXP2ZMOenpieWoOyppLAnnAhuPag3MGPnt+7caxE3w/Vl9wpQsTA3gzLntQi9rxWrs7Xqg==", "cpu": [ "arm64" ], @@ -5360,9 +5360,9 @@ } }, "node_modules/@oxlint/binding-win32-arm64-msvc": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.56.0.tgz", - "integrity": "sha512-PxT4OJDfMOQBzo3OlzFb9gkoSD+n8qSBxyVq2wQSZIHFQYGEqIRTo9M0ZStvZm5fdhMqaVYpOnJvH2hUMEDk/g==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.59.0.tgz", + "integrity": "sha512-/HLsLuz42rWl7h7ePdmMTpHm2HIDmPtcEMYgm5BBEHiEiuNOrzMaUpd2z7UnNni5LGN9obJy2YoAYBLXQwazrA==", "cpu": [ "arm64" ], @@ -5377,9 +5377,9 @@ } }, "node_modules/@oxlint/binding-win32-ia32-msvc": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.56.0.tgz", - "integrity": "sha512-PTRy6sIEPqy2x8PTP1baBNReN/BNEFmde0L+mYeHmjXE1Vlcc9+I5nsqENsB2yAm5wLkzPoTNCMY/7AnabT4/A==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.59.0.tgz", + "integrity": "sha512-rUPy+JnanpPwV/aJCPnxAD1fW50+XPI0VkWr7f0vEbqcdsS8NpB24Rw6RsS7SdpFv8Dw+8ugCwao5nCFbqOUSg==", "cpu": [ "ia32" ], @@ -5394,9 +5394,9 @@ } }, "node_modules/@oxlint/binding-win32-x64-msvc": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.56.0.tgz", - "integrity": "sha512-ZHa0clocjLmIDr+1LwoWtxRcoYniAvERotvwKUYKhH41NVfl0Y4LNbyQkwMZzwDvKklKGvGZ5+DAG58/Ik47tQ==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.59.0.tgz", + "integrity": "sha512-xkE7puteDS/vUyRngLXW0t8WgdWoS/tfxXjhP/P7SMqPDx+hs44SpssO3h3qmTqECYEuXBUPzcAw5257Ka+ofA==", "cpu": [ "x64" ], @@ -20217,9 +20217,9 @@ } }, "node_modules/oxlint": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.56.0.tgz", - "integrity": "sha512-Q+5Mj5PVaH/R6/fhMMFzw4dT+KPB+kQW4kaL8FOIq7tfhlnEVp6+3lcWqFruuTNlUo9srZUW3qH7Id4pskeR6g==", + "version": "1.59.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.59.0.tgz", + "integrity": "sha512-0xBLeGGjP4vD9pygRo8iuOkOzEU1MqOnfiOl7KYezL/QvWL8NUg6n03zXc7ZVqltiOpUxBk2zgHI3PnRIEdAvw==", "dev": true, "license": "MIT", "bin": { @@ -20232,28 +20232,28 @@ "url": "https://github.com/sponsors/Boshen" }, "optionalDependencies": { - "@oxlint/binding-android-arm-eabi": "1.56.0", - "@oxlint/binding-android-arm64": "1.56.0", - "@oxlint/binding-darwin-arm64": "1.56.0", - "@oxlint/binding-darwin-x64": "1.56.0", - "@oxlint/binding-freebsd-x64": "1.56.0", - "@oxlint/binding-linux-arm-gnueabihf": "1.56.0", - "@oxlint/binding-linux-arm-musleabihf": "1.56.0", - "@oxlint/binding-linux-arm64-gnu": "1.56.0", - "@oxlint/binding-linux-arm64-musl": "1.56.0", - "@oxlint/binding-linux-ppc64-gnu": "1.56.0", - "@oxlint/binding-linux-riscv64-gnu": "1.56.0", - "@oxlint/binding-linux-riscv64-musl": "1.56.0", - "@oxlint/binding-linux-s390x-gnu": "1.56.0", - "@oxlint/binding-linux-x64-gnu": "1.56.0", - "@oxlint/binding-linux-x64-musl": "1.56.0", - "@oxlint/binding-openharmony-arm64": "1.56.0", - "@oxlint/binding-win32-arm64-msvc": "1.56.0", - "@oxlint/binding-win32-ia32-msvc": "1.56.0", - "@oxlint/binding-win32-x64-msvc": "1.56.0" + "@oxlint/binding-android-arm-eabi": "1.59.0", + "@oxlint/binding-android-arm64": "1.59.0", + "@oxlint/binding-darwin-arm64": "1.59.0", + "@oxlint/binding-darwin-x64": "1.59.0", + "@oxlint/binding-freebsd-x64": "1.59.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.59.0", + "@oxlint/binding-linux-arm-musleabihf": "1.59.0", + "@oxlint/binding-linux-arm64-gnu": "1.59.0", + "@oxlint/binding-linux-arm64-musl": "1.59.0", + "@oxlint/binding-linux-ppc64-gnu": "1.59.0", + "@oxlint/binding-linux-riscv64-gnu": "1.59.0", + "@oxlint/binding-linux-riscv64-musl": "1.59.0", + "@oxlint/binding-linux-s390x-gnu": "1.59.0", + "@oxlint/binding-linux-x64-gnu": "1.59.0", + "@oxlint/binding-linux-x64-musl": "1.59.0", + "@oxlint/binding-openharmony-arm64": "1.59.0", + "@oxlint/binding-win32-arm64-msvc": "1.59.0", + "@oxlint/binding-win32-ia32-msvc": "1.59.0", + "@oxlint/binding-win32-x64-msvc": "1.59.0" }, "peerDependencies": { - "oxlint-tsgolint": ">=0.15.0" + "oxlint-tsgolint": ">=0.18.0" }, "peerDependenciesMeta": { "oxlint-tsgolint": { @@ -21227,9 +21227,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", + "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index 97421e20b3..5809ddd42f 100644 --- a/package.json +++ b/package.json @@ -84,8 +84,8 @@ "license-compliance": "^3.0.0", "lint-staged": "^16.1.0", "npm-run-all2": "^8.0.4", - "oxlint": "^1.56.0", - "prettier": "^3.1.0", + "oxlint": "^1.59.0", + "prettier": "^3.8.3", "pretty-quick": "^4.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/app-shell-events/src/types/notifications.ts b/packages/app-shell-events/src/types/notifications.ts index 01c1e8a667..d6b3ef977f 100644 --- a/packages/app-shell-events/src/types/notifications.ts +++ b/packages/app-shell-events/src/types/notifications.ts @@ -5,8 +5,10 @@ export const HvAppShellEventNotificationTrigger = export type HvAppShellEventNotificationType = "snackbar" | "banner"; -export interface HvAppShellEventNotification - extends Pick { +export interface HvAppShellEventNotification extends Pick< + HvBannerProps, + "actions" | "variant" | "message" | "onAction" +> { type: HvAppShellEventNotificationType; message?: string; } diff --git a/packages/app-shell-events/src/types/theming.ts b/packages/app-shell-events/src/types/theming.ts index 3ece8bc7d1..9b2f25dbf3 100644 --- a/packages/app-shell-events/src/types/theming.ts +++ b/packages/app-shell-events/src/types/theming.ts @@ -2,5 +2,7 @@ import type { HvProviderProps } from "@hitachivantara/uikit-react-core"; export const HvAppShellEventThemeTrigger = "@hv/app-shell:theme:trigger"; -export interface HvAppShellEventTheme - extends Pick {} +export interface HvAppShellEventTheme extends Pick< + HvProviderProps, + "theme" | "colorMode" +> {} diff --git a/packages/app-shell-navigation/src/hooks/useLocation.ts b/packages/app-shell-navigation/src/hooks/useLocation.ts index 92e65eb26a..cc75543075 100644 --- a/packages/app-shell-navigation/src/hooks/useLocation.ts +++ b/packages/app-shell-navigation/src/hooks/useLocation.ts @@ -1,12 +1,12 @@ import { useMemo } from "react"; import { - Location, matchRoutes, useLocation as useLocationReactRouter, + type Location, } from "react-router-dom"; import { - HvAppShellViewsModel, useHvAppShellModel, + type HvAppShellViewsModel, } from "@hitachivantara/app-shell-shared"; interface IndexedView { diff --git a/packages/app-shell-navigation/src/hooks/useNavigation.ts b/packages/app-shell-navigation/src/hooks/useNavigation.ts index a04edd6265..7cfa38556d 100644 --- a/packages/app-shell-navigation/src/hooks/useNavigation.ts +++ b/packages/app-shell-navigation/src/hooks/useNavigation.ts @@ -1,12 +1,16 @@ import { useCallback, useContext, useMemo, useRef } from "react"; -import { Path, useNavigate } from "react-router-dom"; +import { useNavigate, type Path } from "react-router-dom"; import { HvAppShellViewContext, - HvAppShellViewsModel, useHvAppShellModel, + type HvAppShellViewsModel, } from "@hitachivantara/app-shell-shared"; -import { NavigationOptions, To, ViewDestination } from "../types/navigation"; +import type { + NavigationOptions, + To, + ViewDestination, +} from "../types/navigation"; import compileHref from "../utils/navigationUtil"; import { useHvLocation } from "./useLocation"; diff --git a/packages/app-shell-services/src/hooks/Hooks.tsx b/packages/app-shell-services/src/hooks/Hooks.tsx index abe767f45f..afe6b1325b 100644 --- a/packages/app-shell-services/src/hooks/Hooks.tsx +++ b/packages/app-shell-services/src/hooks/Hooks.tsx @@ -1,7 +1,7 @@ import { useCallback, useRef } from "react"; -import { ServiceId } from "../types/config"; -import { +import type { ServiceId } from "../types/config"; +import type { ServiceReference, UseServiceOptions, UseServiceReferenceOptions, diff --git a/packages/app-shell-services/src/hooks/useAsync.ts b/packages/app-shell-services/src/hooks/useAsync.ts index a24876fdb5..df699f476d 100644 --- a/packages/app-shell-services/src/hooks/useAsync.ts +++ b/packages/app-shell-services/src/hooks/useAsync.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { +import type { AsyncErrorResult, AsyncPendingResult, AsyncResult, diff --git a/packages/app-shell-services/src/providers/ServiceManagerProvider.tsx b/packages/app-shell-services/src/providers/ServiceManagerProvider.tsx index 3e5f834b25..b8c56823a9 100644 --- a/packages/app-shell-services/src/providers/ServiceManagerProvider.tsx +++ b/packages/app-shell-services/src/providers/ServiceManagerProvider.tsx @@ -1,13 +1,13 @@ import { createContext, createElement, - FC, - PropsWithChildren, useMemo, + type FC, + type PropsWithChildren, } from "react"; -import { ServiceId, ServicesConfig } from "../types/config"; -import { +import type { ServiceId, ServicesConfig } from "../types/config"; +import type { GetServiceBaseOptions, GetServiceOptions, GetServiceReferenceOptions, diff --git a/packages/app-shell-services/src/types/config.ts b/packages/app-shell-services/src/types/config.ts index f0e4e1f814..62e0e2e875 100644 --- a/packages/app-shell-services/src/types/config.ts +++ b/packages/app-shell-services/src/types/config.ts @@ -1,5 +1,7 @@ -export interface ServicesConfig - extends Record {} +export interface ServicesConfig extends Record< + ServiceId, + ServiceProviderConfig[] +> {} export type ServiceId = string; //NOSONAR diff --git a/packages/app-shell-services/src/types/service.ts b/packages/app-shell-services/src/types/service.ts index 699185d9d8..e73d6583d4 100644 --- a/packages/app-shell-services/src/types/service.ts +++ b/packages/app-shell-services/src/types/service.ts @@ -1,5 +1,5 @@ -import { AsyncResult } from "./async"; -import { ServiceId } from "./config"; +import type { AsyncResult } from "./async"; +import type { ServiceId } from "./config"; /** * Reference to a service, including metadata and a loader function. diff --git a/packages/app-shell-services/src/utils/serviceReference.tsx b/packages/app-shell-services/src/utils/serviceReference.tsx index 470f171861..459cb0ce45 100644 --- a/packages/app-shell-services/src/utils/serviceReference.tsx +++ b/packages/app-shell-services/src/utils/serviceReference.tsx @@ -1,6 +1,6 @@ -import { createElement, FC, PropsWithChildren } from "react"; +import { createElement, type FC, type PropsWithChildren } from "react"; -import { +import type { BundleConfig, ComponentServiceProviderConfig, FactoryServiceFunction, @@ -10,7 +10,7 @@ import { ServiceId, ServiceProviderConfig, } from "../types/config"; -import { ServiceLoader, ServiceReference } from "../types/service"; +import type { ServiceLoader, ServiceReference } from "../types/service"; function createServiceReferenceBase( serviceId: ServiceId, diff --git a/packages/app-shell-shared/src/AppShellCombinedProvidersContext.tsx b/packages/app-shell-shared/src/AppShellCombinedProvidersContext.tsx index ea1b2dd468..0b54a14562 100644 --- a/packages/app-shell-shared/src/AppShellCombinedProvidersContext.tsx +++ b/packages/app-shell-shared/src/AppShellCombinedProvidersContext.tsx @@ -5,7 +5,7 @@ import { type PropsWithChildren, } from "react"; -import { HvAppShellProvidersModel } from "./types/Model"; +import type { HvAppShellProvidersModel } from "./types/Model"; export type HvAppShellProvidersComponent = Omit< HvAppShellProvidersModel, diff --git a/packages/app-shell-shared/src/types/Config.ts b/packages/app-shell-shared/src/types/Config.ts index ef916fdf28..b5ed85e13e 100644 --- a/packages/app-shell-shared/src/types/Config.ts +++ b/packages/app-shell-shared/src/types/Config.ts @@ -8,8 +8,10 @@ import type { HvThemeColorMode, } from "@hitachivantara/uikit-react-core"; -export interface ViewHvContainerProps - extends Omit { +export interface ViewHvContainerProps extends Omit< + HvContainerProps, + "children" +> { disableContainer?: boolean; } @@ -27,8 +29,10 @@ export type HvAppShellServiceProviderConfig = ServiceProviderConfig & HvAppShellConditionalConfig; // App Shell's version of ServicesConfig with condition support -export interface HvAppShellServicesConfig - extends Record {} +export interface HvAppShellServicesConfig extends Record< + ServiceId, + HvAppShellServiceProviderConfig[] +> {} export interface HvAppShellLogo { name?: "LUMADA" | "HITACHI" | "PENTAHO+" | "PENTAHO"; @@ -57,8 +61,7 @@ export interface HvAppShellViewsConfig extends HvAppShellConditionalConfig { } export interface HvAppShellTopViewConfig - extends HvAppShellViewsConfig, - ViewHvContainerProps {} + extends HvAppShellViewsConfig, ViewHvContainerProps {} export interface HvAppShellHelp { url: string; @@ -74,12 +77,10 @@ export interface HvAppShellProvidersBaseConfig { config?: Record; } -export interface HvAppShellSystemProvidersConfig - extends HvAppShellProvidersBaseConfig {} +export interface HvAppShellSystemProvidersConfig extends HvAppShellProvidersBaseConfig {} export interface HvAppShellProvidersConfig - extends HvAppShellProvidersBaseConfig, - HvAppShellConditionalConfig {} + extends HvAppShellProvidersBaseConfig, HvAppShellConditionalConfig {} export interface HvAppShellConfig { baseUrl?: string; diff --git a/packages/app-shell-shared/src/types/Model.ts b/packages/app-shell-shared/src/types/Model.ts index 4544518ad7..405c726acc 100644 --- a/packages/app-shell-shared/src/types/Model.ts +++ b/packages/app-shell-shared/src/types/Model.ts @@ -3,7 +3,7 @@ import type { ServiceProviderConfig, } from "@hitachivantara/app-shell-services"; -import { +import type { HvAppShellConditionConfig, HvAppShellConfig, HvAppShellHeader, @@ -29,23 +29,25 @@ export interface HvAppShellConditionalModel { } export interface HvAppShellMenuModel - extends HvAppShellConditionalModel, + extends + HvAppShellConditionalModel, Omit { submenus?: HvAppShellMenuModel[]; } export interface HvAppShellViewsModel - extends HvAppShellConditionalModel, + extends + HvAppShellConditionalModel, Omit { views: HvAppShellViewsModel[]; } export interface HvAppShellTopViewModel - extends HvAppShellViewsModel, - Omit {} + extends HvAppShellViewsModel, Omit {} export interface HvAppShellHeaderActionModel - extends HvAppShellConditionalModel, + extends + HvAppShellConditionalModel, Omit {} export type HvAppShellSystemProvidersModel = HvAppShellSystemProvidersConfig & { @@ -53,7 +55,8 @@ export type HvAppShellSystemProvidersModel = HvAppShellSystemProvidersConfig & { }; export interface HvAppShellProvidersModel - extends HvAppShellConditionalModel, + extends + HvAppShellConditionalModel, Omit {} export type HvAppShellServiceProviderModel = HvAppShellConditionalModel & @@ -64,26 +67,24 @@ export type HvAppShellServicesModel = Record< HvAppShellServiceProviderModel[] >; -export interface HvAppShellMainPanelModel - extends Omit { +export interface HvAppShellMainPanelModel extends Omit< + HvAppShellMainPanelConfig, + "views" +> { views?: HvAppShellTopViewModel[]; } -export interface HvAppShellHeaderModel - extends Omit { +export interface HvAppShellHeaderModel extends Omit< + HvAppShellHeader, + "actions" +> { actions: HvAppShellHeaderActionModel[]; } -export interface HvAppShellModel - extends Omit< - HvAppShellConfig, - | "menu" - | "mainPanel" - | "header" - | "systemProviders" - | "providers" - | "services" - > { +export interface HvAppShellModel extends Omit< + HvAppShellConfig, + "menu" | "mainPanel" | "header" | "systemProviders" | "providers" | "services" +> { menu?: HvAppShellMenuModel[]; mainPanel?: HvAppShellMainPanelModel; header?: HvAppShellHeaderModel; diff --git a/packages/app-shell-shared/src/types/condition.ts b/packages/app-shell-shared/src/types/condition.ts index 994f312b81..b61464cf71 100644 --- a/packages/app-shell-shared/src/types/condition.ts +++ b/packages/app-shell-shared/src/types/condition.ts @@ -1,4 +1,4 @@ -import { AsyncResult } from "@hitachivantara/app-shell-services"; +import type { AsyncResult } from "@hitachivantara/app-shell-services"; export type UseConditionResult = AsyncResult; diff --git a/packages/app-shell-shared/src/utils/navigationUtils.test.ts b/packages/app-shell-shared/src/utils/navigationUtils.test.ts index 38240797ac..b8286dc009 100644 --- a/packages/app-shell-shared/src/utils/navigationUtils.test.ts +++ b/packages/app-shell-shared/src/utils/navigationUtils.test.ts @@ -1,4 +1,4 @@ -import { HvAppShellMenuConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellMenuConfig } from "@hitachivantara/app-shell-shared"; import type { MenuItem } from "../types/menu"; import { diff --git a/packages/app-shell-ui/src/components/AppShell/AppShellContainer.tsx b/packages/app-shell-ui/src/components/AppShell/AppShellContainer.tsx index 69311b460f..cf3d1ae4fb 100644 --- a/packages/app-shell-ui/src/components/AppShell/AppShellContainer.tsx +++ b/packages/app-shell-ui/src/components/AppShell/AppShellContainer.tsx @@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { HelmetProvider } from "react-helmet-async"; import { I18nextProvider } from "react-i18next"; -import { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; import { HvProvider } from "@hitachivantara/uikit-react-core"; import { createI18Next } from "../../i18n"; @@ -16,8 +16,7 @@ import type { HvAppShellProps } from "./AppShell"; const i18n = createI18Next(); export interface HvAppShellContainerProps - extends React.PropsWithChildren, - HvAppShellProps {} + extends React.PropsWithChildren, HvAppShellProps {} export function HvAppShellContainer({ config: configProp, diff --git a/packages/app-shell-ui/src/components/AppShell/AppShellRouter.tsx b/packages/app-shell-ui/src/components/AppShell/AppShellRouter.tsx index e780b07ed1..087a01ccee 100644 --- a/packages/app-shell-ui/src/components/AppShell/AppShellRouter.tsx +++ b/packages/app-shell-ui/src/components/AppShell/AppShellRouter.tsx @@ -4,8 +4,8 @@ import { createBrowserRouter, matchRoutes, Outlet, - RouteObject, RouterProvider, + type RouteObject, } from "react-router-dom"; import { useHvAppShellModel, diff --git a/packages/app-shell-ui/src/components/AppShellProvider/AppShellProvider.tsx b/packages/app-shell-ui/src/components/AppShellProvider/AppShellProvider.tsx index e094de0f2c..68ec3736e6 100644 --- a/packages/app-shell-ui/src/components/AppShellProvider/AppShellProvider.tsx +++ b/packages/app-shell-ui/src/components/AppShellProvider/AppShellProvider.tsx @@ -5,16 +5,16 @@ import { HvAppShellCombinedProvidersContext, HvAppShellContext, HvAppShellModelContext, - HvAppShellProvidersComponent, HvAppShellRuntimeContext, type HvAppShellConfig, type HvAppShellModel, + type HvAppShellProvidersComponent, } from "@hitachivantara/app-shell-shared"; import { themes as baseThemes, HvProvider, } from "@hitachivantara/uikit-react-core"; -import { +import type { HvThemeColorMode, HvThemeStructure, } from "@hitachivantara/uikit-styles"; diff --git a/packages/app-shell-ui/src/components/AppShellViewProvider/AppShellViewProvider.tsx b/packages/app-shell-ui/src/components/AppShellViewProvider/AppShellViewProvider.tsx index 0a54bdad67..44c0de88b6 100644 --- a/packages/app-shell-ui/src/components/AppShellViewProvider/AppShellViewProvider.tsx +++ b/packages/app-shell-ui/src/components/AppShellViewProvider/AppShellViewProvider.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; import { HvAppShellViewContext, - HvAppShellViewContextValue, + type HvAppShellViewContextValue, } from "@hitachivantara/app-shell-shared"; export type AppShellViewProviderProps = { diff --git a/packages/app-shell-ui/src/components/IconUiKit/IconUiKit.tsx b/packages/app-shell-ui/src/components/IconUiKit/IconUiKit.tsx index a3f9f25942..3783a3031a 100644 --- a/packages/app-shell-ui/src/components/IconUiKit/IconUiKit.tsx +++ b/packages/app-shell-ui/src/components/IconUiKit/IconUiKit.tsx @@ -3,8 +3,10 @@ import { type HvIconSpriteProps, } from "@hitachivantara/uikit-react-icons"; -export interface IconUiKitProps - extends Omit { +export interface IconUiKitProps extends Omit< + HvIconSpriteProps, + "iconName" | "spriteUrl" +> { name: string; } diff --git a/packages/app-shell-ui/src/components/SnackbarProvider/SnackbarProvider.tsx b/packages/app-shell-ui/src/components/SnackbarProvider/SnackbarProvider.tsx index f402614421..e3247e27bb 100644 --- a/packages/app-shell-ui/src/components/SnackbarProvider/SnackbarProvider.tsx +++ b/packages/app-shell-ui/src/components/SnackbarProvider/SnackbarProvider.tsx @@ -1,9 +1,9 @@ import { css } from "@emotion/css"; import { - HvSnackbarProps, HvSnackbarProvider, theme, useTheme, + type HvSnackbarProps, } from "@hitachivantara/uikit-react-core"; const snackbarClasses = { diff --git a/packages/app-shell-ui/src/components/layout/AppShellLayout.stories.tsx b/packages/app-shell-ui/src/components/layout/AppShellLayout.stories.tsx index fefcca94d5..97e5188776 100644 --- a/packages/app-shell-ui/src/components/layout/AppShellLayout.stories.tsx +++ b/packages/app-shell-ui/src/components/layout/AppShellLayout.stories.tsx @@ -3,7 +3,7 @@ import { HelmetProvider } from "react-helmet-async"; import { I18nextProvider } from "react-i18next"; import { MemoryRouter } from "react-router-dom"; import type { Decorator, Meta, StoryObj } from "@storybook/react-vite"; -import { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; import { setupChromatic } from "@hitachivantara/internal"; import { HvButton } from "@hitachivantara/uikit-react-core"; diff --git a/packages/app-shell-ui/src/components/layout/BrandLogo/BrandLogo.tsx b/packages/app-shell-ui/src/components/layout/BrandLogo/BrandLogo.tsx index 0b2a8462ff..e4b4b96405 100644 --- a/packages/app-shell-ui/src/components/layout/BrandLogo/BrandLogo.tsx +++ b/packages/app-shell-ui/src/components/layout/BrandLogo/BrandLogo.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; import styled from "@emotion/styled"; import { CONFIG_TRANSLATIONS_NAMESPACE, - HvAppShellConfig, + type HvAppShellConfig, } from "@hitachivantara/app-shell-shared"; import { Hitachi, Lumada, Pentaho } from "./logos"; diff --git a/packages/app-shell-ui/src/components/layout/Header/Header.tsx b/packages/app-shell-ui/src/components/layout/Header/Header.tsx index 734c39f502..e53c90abc4 100644 --- a/packages/app-shell-ui/src/components/layout/Header/Header.tsx +++ b/packages/app-shell-ui/src/components/layout/Header/Header.tsx @@ -10,8 +10,8 @@ import { HvHeader, HvHeaderBrand, HvHeaderNavigation, - HvHeaderNavigationProps, useTheme, + type HvHeaderNavigationProps, } from "@hitachivantara/uikit-react-core"; import { useNavigationContext } from "../../../providers/NavigationProvider"; diff --git a/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.test.tsx b/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.test.tsx index 28965cc46e..dc2bae85f8 100644 --- a/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.test.tsx +++ b/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.test.tsx @@ -1,5 +1,5 @@ import { act, screen } from "@testing-library/react"; -import { HvAppShellAppSwitcherItemConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellAppSwitcherItemConfig } from "@hitachivantara/app-shell-shared"; import renderTestProvider from "../../../../tests/testUtils"; import AppSwitcherToggle from "./AppSwitcherToggle"; diff --git a/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.tsx b/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.tsx index 98bb44e429..1b55e967f0 100644 --- a/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.tsx +++ b/packages/app-shell-ui/src/components/layout/HeaderActions/AppSwitcherToggle/AppSwitcherToggle.tsx @@ -4,16 +4,16 @@ import { useTranslation } from "react-i18next"; import ClickAwayListener from "@mui/material/ClickAwayListener"; import { CONFIG_TRANSLATIONS_NAMESPACE, - HvAppShellAppSwitcherConfig, - HvAppShellAppSwitcherItemConfig, useHvAppShellModel, + type HvAppShellAppSwitcherConfig, + type HvAppShellAppSwitcherItemConfig, } from "@hitachivantara/app-shell-shared"; import { HvAppSwitcher, - HvAppSwitcherActionApplication, HvIconButton, HvTypography, theme, + type HvAppSwitcherActionApplication, } from "@hitachivantara/uikit-react-core"; import createAppContainerElement from "../../../../utils/documentUtil"; diff --git a/packages/app-shell-ui/src/components/layout/HeaderActions/ColorModeSwitcher.tsx b/packages/app-shell-ui/src/components/layout/HeaderActions/ColorModeSwitcher.tsx index b8f6cd798d..3828150fbc 100644 --- a/packages/app-shell-ui/src/components/layout/HeaderActions/ColorModeSwitcher.tsx +++ b/packages/app-shell-ui/src/components/layout/HeaderActions/ColorModeSwitcher.tsx @@ -1,7 +1,7 @@ import { useTranslation } from "react-i18next"; import { - HvAppShellEventTheme, HvAppShellEventThemeTrigger, + type HvAppShellEventTheme, } from "@hitachivantara/app-shell-events"; import { HvIconButton, useTheme } from "@hitachivantara/uikit-react-core"; diff --git a/packages/app-shell-ui/src/components/layout/HeaderActions/HeaderActions.test.tsx b/packages/app-shell-ui/src/components/layout/HeaderActions/HeaderActions.test.tsx index 80f9d54c03..bb101db4ef 100644 --- a/packages/app-shell-ui/src/components/layout/HeaderActions/HeaderActions.test.tsx +++ b/packages/app-shell-ui/src/components/layout/HeaderActions/HeaderActions.test.tsx @@ -1,6 +1,6 @@ import { screen } from "@testing-library/dom"; import { vi } from "vitest"; -import { HvAppShellAppSwitcherConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellAppSwitcherConfig } from "@hitachivantara/app-shell-shared"; import { HvButton } from "@hitachivantara/uikit-react-core"; import renderTestProvider from "../../../tests/testUtils"; diff --git a/packages/app-shell-ui/src/components/layout/HeaderActions/HelpButton/HelpButton.tsx b/packages/app-shell-ui/src/components/layout/HeaderActions/HelpButton/HelpButton.tsx index 8c5cf19a9c..4c60137b2d 100644 --- a/packages/app-shell-ui/src/components/layout/HeaderActions/HelpButton/HelpButton.tsx +++ b/packages/app-shell-ui/src/components/layout/HeaderActions/HelpButton/HelpButton.tsx @@ -1,7 +1,7 @@ import { useTranslation } from "react-i18next"; import { CONFIG_TRANSLATIONS_NAMESPACE, - HvAppShellHelp, + type HvAppShellHelp, } from "@hitachivantara/app-shell-shared"; import { HvIconButton } from "@hitachivantara/uikit-react-core"; diff --git a/packages/app-shell-ui/src/components/layout/HeaderActions/InternalAction/InternalAction.tsx b/packages/app-shell-ui/src/components/layout/HeaderActions/InternalAction/InternalAction.tsx index fed0bbb8c3..d14ed6bd73 100644 --- a/packages/app-shell-ui/src/components/layout/HeaderActions/InternalAction/InternalAction.tsx +++ b/packages/app-shell-ui/src/components/layout/HeaderActions/InternalAction/InternalAction.tsx @@ -1,5 +1,5 @@ import { lazy, memo, Suspense } from "react"; -import { +import type { HvAppShellAppSwitcherConfig, HvAppShellHelp, } from "@hitachivantara/app-shell-shared"; diff --git a/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.test.tsx b/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.test.tsx index 76afb07705..cc051b7380 100644 --- a/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.test.tsx +++ b/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.test.tsx @@ -1,7 +1,7 @@ import { screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { vi } from "vitest"; -import { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; import { LOCAL_STORAGE_KEYS } from "../../../hooks/useLocalStorage"; import * as NavigationProvider from "../../../providers/NavigationProvider"; diff --git a/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.tsx b/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.tsx index 78384f180e..10e1321f04 100644 --- a/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.tsx +++ b/packages/app-shell-ui/src/components/layout/VerticalNavigation/VerticalNavigation.tsx @@ -16,7 +16,7 @@ import { import { useResizeObserver } from "../../../hooks/useResizeObserver"; import { useLayoutContext } from "../../../providers/LayoutProvider"; import { useNavigationContext } from "../../../providers/NavigationProvider"; -import { NavigationMenuItem } from "../../../types"; +import type { NavigationMenuItem } from "../../../types"; import { NavigationCollapse } from "./NavigationCollapse"; import { NavigationHeader } from "./NavigationHeader"; diff --git a/packages/app-shell-ui/src/hooks/useFilteredModel.ts b/packages/app-shell-ui/src/hooks/useFilteredModel.ts index bf04feef33..9c0b86a45e 100644 --- a/packages/app-shell-ui/src/hooks/useFilteredModel.ts +++ b/packages/app-shell-ui/src/hooks/useFilteredModel.ts @@ -3,7 +3,7 @@ import type { HvAppShellModel } from "@hitachivantara/app-shell-shared"; import filterModel from "../utils/filterModel"; import { useConditionsEvaluator } from "./useConditionsEvaluator"; -import { ModelResult } from "./useModelFromConfig"; +import type { ModelResult } from "./useModelFromConfig"; /** * Hook to evaluate conditions and filter configuration diff --git a/packages/app-shell-ui/src/hooks/useNavigationMenuItems.tsx b/packages/app-shell-ui/src/hooks/useNavigationMenuItems.tsx index 3d0edb0920..77aa8f7db1 100644 --- a/packages/app-shell-ui/src/hooks/useNavigationMenuItems.tsx +++ b/packages/app-shell-ui/src/hooks/useNavigationMenuItems.tsx @@ -8,7 +8,7 @@ import { useHvMenuItems, } from "@hitachivantara/app-shell-shared"; -import { MenuItemsContext } from "../types"; +import type { MenuItemsContext } from "../types"; import { createNavigationMenuItems } from "../utils/navigationUtil"; const MAX_TOP_MENU_DEPTH = 2; diff --git a/packages/app-shell-ui/src/hooks/useNotificationsEventListener.ts b/packages/app-shell-ui/src/hooks/useNotificationsEventListener.ts index 0ce3dc48d7..7461b70369 100644 --- a/packages/app-shell-ui/src/hooks/useNotificationsEventListener.ts +++ b/packages/app-shell-ui/src/hooks/useNotificationsEventListener.ts @@ -1,4 +1,4 @@ -import { HvAppShellEventNotification } from "@hitachivantara/app-shell-events"; +import type { HvAppShellEventNotification } from "@hitachivantara/app-shell-events"; import { useHvSnackbar } from "@hitachivantara/uikit-react-core"; import { useBannerContext } from "../providers/BannerProvider"; diff --git a/packages/app-shell-ui/src/hooks/useThemeEventListener.test.tsx b/packages/app-shell-ui/src/hooks/useThemeEventListener.test.tsx index aa1d8afd3d..c1a4b77649 100644 --- a/packages/app-shell-ui/src/hooks/useThemeEventListener.test.tsx +++ b/packages/app-shell-ui/src/hooks/useThemeEventListener.test.tsx @@ -1,8 +1,8 @@ import { renderHook } from "@testing-library/react"; import { vi } from "vitest"; import { - HvAppShellEventTheme, HvAppShellEventThemeTrigger, + type HvAppShellEventTheme, } from "@hitachivantara/app-shell-events"; import { LOCAL_STORAGE_KEYS } from "./useLocalStorage"; diff --git a/packages/app-shell-ui/src/hooks/useThemeEventListener.ts b/packages/app-shell-ui/src/hooks/useThemeEventListener.ts index 854d3a87f8..837105f05d 100644 --- a/packages/app-shell-ui/src/hooks/useThemeEventListener.ts +++ b/packages/app-shell-ui/src/hooks/useThemeEventListener.ts @@ -1,4 +1,4 @@ -import { HvAppShellEventTheme } from "@hitachivantara/app-shell-events"; +import type { HvAppShellEventTheme } from "@hitachivantara/app-shell-events"; import { useTheme } from "@hitachivantara/uikit-react-core"; import useLocalStorage from "./useLocalStorage"; diff --git a/packages/app-shell-ui/src/providers/BannerProvider.tsx b/packages/app-shell-ui/src/providers/BannerProvider.tsx index 769dd78db8..e2c2203528 100644 --- a/packages/app-shell-ui/src/providers/BannerProvider.tsx +++ b/packages/app-shell-ui/src/providers/BannerProvider.tsx @@ -2,7 +2,7 @@ import { createContext, useContext, useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { css } from "@emotion/css"; import { uid } from "uid"; -import { HvAppShellEventNotification } from "@hitachivantara/app-shell-events"; +import type { HvAppShellEventNotification } from "@hitachivantara/app-shell-events"; import { HvBanner, theme, useTheme } from "@hitachivantara/uikit-react-core"; import { useLayoutContext } from "./LayoutProvider"; diff --git a/packages/app-shell-ui/src/providers/NavigationProvider.test.tsx b/packages/app-shell-ui/src/providers/NavigationProvider.test.tsx index 31c224f732..f0866fa8a5 100644 --- a/packages/app-shell-ui/src/providers/NavigationProvider.test.tsx +++ b/packages/app-shell-ui/src/providers/NavigationProvider.test.tsx @@ -2,7 +2,7 @@ import { useContext } from "react"; import useMediaQuery from "@mui/material/useMediaQuery"; import { screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { Mock, vi } from "vitest"; +import { vi, type Mock } from "vitest"; import { LOCAL_STORAGE_KEYS } from "../hooks/useLocalStorage"; import renderTestProvider from "../tests/testUtils"; diff --git a/packages/app-shell-ui/src/providers/NavigationProvider.tsx b/packages/app-shell-ui/src/providers/NavigationProvider.tsx index 79bbdd357c..a86ea8ff58 100644 --- a/packages/app-shell-ui/src/providers/NavigationProvider.tsx +++ b/packages/app-shell-ui/src/providers/NavigationProvider.tsx @@ -1,6 +1,5 @@ import { createContext, - ReactNode, useCallback, useContext, useEffect, @@ -13,14 +12,14 @@ import { useHvAppShellConfig } from "@hitachivantara/app-shell-shared"; import useLocalStorage from "../hooks/useLocalStorage"; import useNavigationMenuItems from "../hooks/useNavigationMenuItems"; -import { NavigationMenuItem } from "../types"; +import type { NavigationMenuItem } from "../types"; import { findItemById, removeHrefFromMenuItemsWithChildren, } from "../utils/navigationUtil"; export type NavigationProviderProps = { - children: ReactNode; + children: React.ReactNode; }; export type VerticalNavigationMode = "EXPANDED" | "COLLAPSED" | "CLOSED"; diff --git a/packages/app-shell-ui/src/tests/TestProvider.tsx b/packages/app-shell-ui/src/tests/TestProvider.tsx index 3380e2297e..0554ddee41 100644 --- a/packages/app-shell-ui/src/tests/TestProvider.tsx +++ b/packages/app-shell-ui/src/tests/TestProvider.tsx @@ -1,10 +1,10 @@ -import { PropsWithChildren, ReactNode } from "react"; +import type { PropsWithChildren, ReactNode } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { I18nextProvider } from "react-i18next"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; import { CONFIG_TRANSLATIONS_NAMESPACE, - HvAppShellConfig, + type HvAppShellConfig, } from "@hitachivantara/app-shell-shared"; import { HvProvider } from "@hitachivantara/uikit-react-core"; diff --git a/packages/app-shell-ui/src/tests/defaultMocks.ts b/packages/app-shell-ui/src/tests/defaultMocks.ts index 0275d64359..5cef80346c 100644 --- a/packages/app-shell-ui/src/tests/defaultMocks.ts +++ b/packages/app-shell-ui/src/tests/defaultMocks.ts @@ -1,7 +1,7 @@ // eslint-disable-next-line import/no-extraneous-dependencies import { vi } from "vitest"; -import { NavigationContextValue } from "../providers/NavigationProvider"; +import type { NavigationContextValue } from "../providers/NavigationProvider"; const useNavigationContextDefaultMock: NavigationContextValue = { selectedMenuItemId: undefined, diff --git a/packages/app-shell-ui/src/tests/testUtils.tsx b/packages/app-shell-ui/src/tests/testUtils.tsx index 8d7ab95ceb..53c6ef1dbb 100644 --- a/packages/app-shell-ui/src/tests/testUtils.tsx +++ b/packages/app-shell-ui/src/tests/testUtils.tsx @@ -1,5 +1,5 @@ import { render } from "@testing-library/react"; -import { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; import TestProvider from "./TestProvider"; diff --git a/packages/app-shell-ui/src/types/menu.ts b/packages/app-shell-ui/src/types/menu.ts index e1f8d8649a..101721727a 100644 --- a/packages/app-shell-ui/src/types/menu.ts +++ b/packages/app-shell-ui/src/types/menu.ts @@ -1,4 +1,4 @@ -import { MenuItem } from "@hitachivantara/app-shell-shared"; +import type { MenuItem } from "@hitachivantara/app-shell-shared"; export interface NavigationMenuItem extends Omit { icon?: React.ReactNode; diff --git a/packages/app-shell-ui/src/utils/CombinedProviders.test.tsx b/packages/app-shell-ui/src/utils/CombinedProviders.test.tsx index 61157a9d8e..1bf0e60c45 100644 --- a/packages/app-shell-ui/src/utils/CombinedProviders.test.tsx +++ b/packages/app-shell-ui/src/utils/CombinedProviders.test.tsx @@ -1,4 +1,4 @@ -import { ComponentType, PropsWithChildren } from "react"; +import type { ComponentType, PropsWithChildren } from "react"; import { render, waitFor } from "@testing-library/react"; import CombinedProviders from "./CombinedProviders"; diff --git a/packages/app-shell-ui/src/utils/CombinedProviders.tsx b/packages/app-shell-ui/src/utils/CombinedProviders.tsx index 93bda74e9d..e0b1b40bf0 100644 --- a/packages/app-shell-ui/src/utils/CombinedProviders.tsx +++ b/packages/app-shell-ui/src/utils/CombinedProviders.tsx @@ -1,5 +1,5 @@ import { useMemo } from "react"; -import { HvAppShellProvidersComponent } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellProvidersComponent } from "@hitachivantara/app-shell-shared"; interface CombinedProvidersProps extends React.PropsWithChildren { providers?: HvAppShellProvidersComponent[]; diff --git a/packages/app-shell-ui/src/utils/filterModel.ts b/packages/app-shell-ui/src/utils/filterModel.ts index fc4d727cce..be93f634a5 100644 --- a/packages/app-shell-ui/src/utils/filterModel.ts +++ b/packages/app-shell-ui/src/utils/filterModel.ts @@ -1,4 +1,4 @@ -import { +import type { HvAppShellConditionModel, HvAppShellHeaderActionModel, HvAppShellMenuModel, diff --git a/packages/app-shell-ui/src/utils/lazyImport.ts b/packages/app-shell-ui/src/utils/lazyImport.ts index d39e5a70b7..dee3559697 100644 --- a/packages/app-shell-ui/src/utils/lazyImport.ts +++ b/packages/app-shell-ui/src/utils/lazyImport.ts @@ -1,6 +1,6 @@ -import { +import type { AsyncResult, - type PreloadedBundles, + PreloadedBundles, } from "@hitachivantara/app-shell-shared"; export type LazyImportResult = AsyncResult; diff --git a/packages/app-shell-ui/src/utils/navigationUtil.tsx b/packages/app-shell-ui/src/utils/navigationUtil.tsx index dff0febe6c..d340fbb36e 100644 --- a/packages/app-shell-ui/src/utils/navigationUtil.tsx +++ b/packages/app-shell-ui/src/utils/navigationUtil.tsx @@ -1,7 +1,7 @@ -import { MenuItem } from "@hitachivantara/app-shell-shared"; +import type { MenuItem } from "@hitachivantara/app-shell-shared"; import IconUiKit from "../components/IconUiKit"; -import { NavigationMenuItem } from "../types"; +import type { NavigationMenuItem } from "../types"; /** * Creates a navigation data structure ({@link MenuItem}) from the provided menu configuration ({@link NavigationMenuItem}). diff --git a/packages/app-shell-ui/src/utils/processConfig.ts b/packages/app-shell-ui/src/utils/processConfig.ts index 41bdc5e4e4..e95b5c88e9 100644 --- a/packages/app-shell-ui/src/utils/processConfig.ts +++ b/packages/app-shell-ui/src/utils/processConfig.ts @@ -1,4 +1,4 @@ -import { +import type { HvAppShellConditionalConfig, HvAppShellConditionalModel, HvAppShellConditionModel, diff --git a/packages/app-shell-vite-plugin/src/tests/automatic-utils.test.ts b/packages/app-shell-vite-plugin/src/tests/automatic-utils.test.ts index 7658b8af77..19416e34b8 100644 --- a/packages/app-shell-vite-plugin/src/tests/automatic-utils.test.ts +++ b/packages/app-shell-vite-plugin/src/tests/automatic-utils.test.ts @@ -1,7 +1,7 @@ // @ts-expect-error no types import mock from "mock-fs"; import { expect } from "vitest"; -import { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; import { applyAutomaticMenu, diff --git a/packages/app-shell-vite-plugin/src/tests/config-utils.test.ts b/packages/app-shell-vite-plugin/src/tests/config-utils.test.ts index 5d74c34050..056dcec008 100644 --- a/packages/app-shell-vite-plugin/src/tests/config-utils.test.ts +++ b/packages/app-shell-vite-plugin/src/tests/config-utils.test.ts @@ -1,6 +1,6 @@ import fs from "node:fs"; import { vi } from "vitest"; -import { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; import { findAppShellConfigFile, diff --git a/packages/app-shell-vite-plugin/src/tests/vite-generate-base-plugin.test.ts b/packages/app-shell-vite-plugin/src/tests/vite-generate-base-plugin.test.ts index e25a9dc726..79813e1b2a 100644 --- a/packages/app-shell-vite-plugin/src/tests/vite-generate-base-plugin.test.ts +++ b/packages/app-shell-vite-plugin/src/tests/vite-generate-base-plugin.test.ts @@ -1,4 +1,4 @@ -import { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; +import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; import { getAppTitle } from "../vite-generate-base-plugin"; diff --git a/packages/app-shell-vite-plugin/src/vite-crossorigin-fix-plugin.ts b/packages/app-shell-vite-plugin/src/vite-crossorigin-fix-plugin.ts index db6f042ba1..f754be2459 100644 --- a/packages/app-shell-vite-plugin/src/vite-crossorigin-fix-plugin.ts +++ b/packages/app-shell-vite-plugin/src/vite-crossorigin-fix-plugin.ts @@ -1,5 +1,5 @@ -import { OutputBundle } from "rollup"; -import { PluginOption } from "vite"; +import type { OutputBundle } from "rollup"; +import type { PluginOption } from "vite"; const replacer = (match: string) => match.replace( diff --git a/packages/app-shell-vite-plugin/src/vite-plugin.ts b/packages/app-shell-vite-plugin/src/vite-plugin.ts index aac41f0906..68ba121b75 100644 --- a/packages/app-shell-vite-plugin/src/vite-plugin.ts +++ b/packages/app-shell-vite-plugin/src/vite-plugin.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import path from "node:path"; import virtual from "@rollup/plugin-virtual"; -import { loadEnv, PluginOption } from "vite"; +import { loadEnv, type PluginOption } from "vite"; import { viteStaticCopy } from "vite-plugin-static-copy"; import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared"; @@ -10,10 +10,10 @@ import { applyAutomaticViewsAndRoutes, } from "./automatic-utils.js"; import { - ConfigReplacement, findAppShellConfigFile, getFinalModuleName, loadConfigFile, + type ConfigReplacement, } from "./config-utils.js"; import { resolveModule } from "./nodeModule.js"; import SHARED_DEPENDENCIES from "./shared-dependencies.js"; diff --git a/packages/cli/.oxlintrc.json b/packages/cli/.oxlintrc.json index d5ba8f9d9c..c1c280d192 100644 --- a/packages/cli/.oxlintrc.json +++ b/packages/cli/.oxlintrc.json @@ -1,4 +1,5 @@ { + "extends": ["../../.oxlintrc.json"], "rules": { "no-console": "off" } diff --git a/packages/cli/src/baselines/app-shell/vite/src/lib/data/config.ts b/packages/cli/src/baselines/app-shell/vite/src/lib/data/config.ts deleted file mode 100644 index 49e2d67a28..0000000000 --- a/packages/cli/src/baselines/app-shell/vite/src/lib/data/config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import baseUseSWR, { Key, SWRConfiguration } from "swr"; - -const fetcher = (url: RequestInfo | URL) => - fetch(url).then((res) => res.json()); - -// overload the useSWR function to set the fetcher and add suspense by default -export default function useSWR( - key: Key, - options?: SWRConfiguration, -) { - return baseUseSWR(key, fetcher, { - suspense: true, - ...options, - }); -} diff --git a/packages/cli/src/baselines/app-shell/vite/src/tests/providers.tsx b/packages/cli/src/baselines/app-shell/vite/src/tests/providers.tsx index db3becff12..e9148026fb 100644 --- a/packages/cli/src/baselines/app-shell/vite/src/tests/providers.tsx +++ b/packages/cli/src/baselines/app-shell/vite/src/tests/providers.tsx @@ -1,10 +1,10 @@ -import { FC, ReactNode, Suspense } from "react"; +import { Suspense } from "react"; import { HvProvider } from "@hitachivantara/uikit-react-core"; import { SUSPENSE_LABEL } from "./mocks"; /** Base Test Provider */ -export const TestProvider: FC<{ children: ReactNode }> = ({ children }) => { +export const TestProvider = ({ children }: React.PropsWithChildren) => { return ( {children} diff --git a/packages/cli/src/baselines/vite/src/App.tsx b/packages/cli/src/baselines/vite/src/App.tsx index e06ab5ef07..8ab013d74d 100644 --- a/packages/cli/src/baselines/vite/src/App.tsx +++ b/packages/cli/src/baselines/vite/src/App.tsx @@ -3,8 +3,8 @@ import "virtual:uno.css"; import { createBrowserRouter, - RouteObject, RouterProvider, + type RouteObject, } from "react-router-dom"; import { HvProvider } from "@hitachivantara/uikit-react-core"; diff --git a/packages/cli/src/baselines/vite/src/pages/layout/navigation.tsx b/packages/cli/src/baselines/vite/src/pages/layout/navigation.tsx index 8f9e85f91d..668c72fd7a 100644 --- a/packages/cli/src/baselines/vite/src/pages/layout/navigation.tsx +++ b/packages/cli/src/baselines/vite/src/pages/layout/navigation.tsx @@ -5,11 +5,11 @@ import useMediaQuery from "@mui/material/useMediaQuery"; import { HvButton, HvContainer, - HvContainerProps, HvHeader, HvHeaderBrand, HvHeaderNavigation, theme, + type HvContainerProps, } from "@hitachivantara/uikit-react-core"; import { Menu } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/cli/src/package.js b/packages/cli/src/package.js index 310e4e01b0..197697f0b1 100644 --- a/packages/cli/src/package.js +++ b/packages/cli/src/package.js @@ -3,7 +3,7 @@ import fs from "fs-extra"; // utility function to order alphabetically an object's keys const sortObjectKeys = (obj) => { return Object.keys(obj) - .sort() + .toSorted() .reduce((result, key) => { result[key] = obj[key]; return result; diff --git a/packages/code-editor/src/CodeEditor/CodeEditor.stories.tsx b/packages/code-editor/src/CodeEditor/CodeEditor.stories.tsx index 40d1a759f3..50485ad09b 100644 --- a/packages/code-editor/src/CodeEditor/CodeEditor.stories.tsx +++ b/packages/code-editor/src/CodeEditor/CodeEditor.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { setupChromatic } from "@hitachivantara/internal"; import { HvCodeEditor, - HvCodeEditorProps, + type HvCodeEditorProps, } from "@hitachivantara/uikit-react-code-editor"; import { MainStory } from "./stories/Main"; diff --git a/packages/code-editor/src/CodeEditor/CodeEditor.tsx b/packages/code-editor/src/CodeEditor/CodeEditor.tsx index e9d2d09c2d..d42542a8b1 100644 --- a/packages/code-editor/src/CodeEditor/CodeEditor.tsx +++ b/packages/code-editor/src/CodeEditor/CodeEditor.tsx @@ -5,7 +5,7 @@ import { useTheme, type ExtractNames } from "@hitachivantara/uikit-react-utils"; import { staticClasses, useClasses } from "./CodeEditor.styles"; import { configureMonaco } from "./monaco-config"; import { hvLanguagePlugins } from "./plugins"; -import { Formatter, LanguagePlugin } from "./types"; +import type { Formatter, LanguagePlugin } from "./types"; export { staticClasses as codeEditorClasses }; diff --git a/packages/code-editor/src/CodeEditor/languages/sql.ts b/packages/code-editor/src/CodeEditor/languages/sql.ts index 9cd1622693..b6153784b4 100644 --- a/packages/code-editor/src/CodeEditor/languages/sql.ts +++ b/packages/code-editor/src/CodeEditor/languages/sql.ts @@ -1,7 +1,7 @@ import type { Monaco } from "@monaco-editor/react"; -import { format, FormatOptionsWithLanguage } from "sql-formatter"; +import { format, type FormatOptionsWithLanguage } from "sql-formatter"; -import { LanguagePlugin } from "../types"; +import type { LanguagePlugin } from "../types"; import { sqlKeywords } from "./sqlKeywords"; // Helpful notes diff --git a/packages/code-editor/src/CodeEditor/languages/xml.ts b/packages/code-editor/src/CodeEditor/languages/xml.ts index 9562920ee6..5c08fda5c4 100644 --- a/packages/code-editor/src/CodeEditor/languages/xml.ts +++ b/packages/code-editor/src/CodeEditor/languages/xml.ts @@ -1,8 +1,8 @@ import type { Monaco } from "@monaco-editor/react"; -import formatter, { XMLFormatterOptions } from "xml-formatter"; +import formatter, { type XMLFormatterOptions } from "xml-formatter"; import { validateXML } from "xmllint-wasm"; -import { LanguagePlugin } from "../types"; +import type { LanguagePlugin } from "../types"; // Helpful notes // model - editor content diff --git a/packages/code-editor/src/CodeEditor/monaco-config.ts b/packages/code-editor/src/CodeEditor/monaco-config.ts index eb59c680cc..736bcd864a 100644 --- a/packages/code-editor/src/CodeEditor/monaco-config.ts +++ b/packages/code-editor/src/CodeEditor/monaco-config.ts @@ -1,10 +1,5 @@ import { loader, type Monaco } from "@monaco-editor/react"; - -declare global { - interface Window { - MonacoEnvironment?: import("monaco-editor").Environment; - } -} +import type { Environment } from "monaco-editor"; // Singleton state let monacoInstance: Monaco | null = null; @@ -73,7 +68,7 @@ export const configureMonaco = async (): Promise => { const worker = workerMap[label as WorkerLabel] ?? workerMap.default; return new worker.default(); }, - }; + } satisfies Environment; monacoInstance = monaco; return monaco; diff --git a/packages/code-editor/src/CodeEditor/plugins.ts b/packages/code-editor/src/CodeEditor/plugins.ts index de14b2c27f..dd71222bd6 100644 --- a/packages/code-editor/src/CodeEditor/plugins.ts +++ b/packages/code-editor/src/CodeEditor/plugins.ts @@ -1,6 +1,6 @@ import { sqlLanguagePlugin } from "./languages/sql"; import { xmlLanguagePlugin } from "./languages/xml"; -import { LanguagePlugin } from "./types"; +import type { LanguagePlugin } from "./types"; /** * Language plugins supported by the `CodeEditor` diff --git a/packages/core/src/Accordion/Accordion.stories.tsx b/packages/core/src/Accordion/Accordion.stories.tsx index f75e38daf6..ba237f4996 100644 --- a/packages/core/src/Accordion/Accordion.stories.tsx +++ b/packages/core/src/Accordion/Accordion.stories.tsx @@ -1,9 +1,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvAccordion, - HvAccordionProps, HvListContainer, HvListItem, + type HvAccordionProps, } from "@hitachivantara/uikit-react-core"; const classes = { diff --git a/packages/core/src/Accordion/Accordion.tsx b/packages/core/src/Accordion/Accordion.tsx index d48f1ca922..358f70fefc 100644 --- a/packages/core/src/Accordion/Accordion.tsx +++ b/packages/core/src/Accordion/Accordion.tsx @@ -8,16 +8,18 @@ import { import { HvButtonBase } from "../ButtonBase"; import { useExpandable } from "../hooks/useExpandable"; import { HvIcon } from "../icons"; -import { HvBaseProps } from "../types/generic"; -import { HvTypography, HvTypographyVariants } from "../Typography"; +import type { HvBaseProps } from "../types/generic"; +import { HvTypography, type HvTypographyVariants } from "../Typography"; import { staticClasses, useClasses } from "./Accordion.styles"; export { staticClasses as accordionClasses }; export type HvAccordionClasses = ExtractNames; -export interface HvAccordionProps - extends HvBaseProps { +export interface HvAccordionProps extends HvBaseProps< + HTMLDivElement, + "onChange" | "children" +> { /** Content to be rendered. */ children: React.ReactNode; /** The accordion label button. */ diff --git a/packages/core/src/ActionBar/ActionBar.stories.tsx b/packages/core/src/ActionBar/ActionBar.stories.tsx index 4f1deb26a7..25b8e7fc1b 100644 --- a/packages/core/src/ActionBar/ActionBar.stories.tsx +++ b/packages/core/src/ActionBar/ActionBar.stories.tsx @@ -1,9 +1,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvActionBar, - HvActionBarProps, HvButton, theme, + type HvActionBarProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/ActionBar/ActionBar.tsx b/packages/core/src/ActionBar/ActionBar.tsx index 3f463f14e4..47fbe6f768 100644 --- a/packages/core/src/ActionBar/ActionBar.tsx +++ b/packages/core/src/ActionBar/ActionBar.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./ActionBar.styles"; export { staticClasses as actionBarClasses }; diff --git a/packages/core/src/ActionsGeneric/ActionsGeneric.test.tsx b/packages/core/src/ActionsGeneric/ActionsGeneric.test.tsx index b477206229..b00a3b4f0d 100644 --- a/packages/core/src/ActionsGeneric/ActionsGeneric.test.tsx +++ b/packages/core/src/ActionsGeneric/ActionsGeneric.test.tsx @@ -2,7 +2,7 @@ import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvActionsGeneric, HvActionsGenericProps } from "./ActionsGeneric"; +import { HvActionsGeneric, type HvActionsGenericProps } from "./ActionsGeneric"; const actions: HvActionsGenericProps["actions"] = [ { id: "post", label: "Add", icon:
, disabled: true }, diff --git a/packages/core/src/ActionsGeneric/ActionsGeneric.tsx b/packages/core/src/ActionsGeneric/ActionsGeneric.tsx index e6df1fd4dd..cd2c6ed676 100644 --- a/packages/core/src/ActionsGeneric/ActionsGeneric.tsx +++ b/packages/core/src/ActionsGeneric/ActionsGeneric.tsx @@ -4,11 +4,11 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps, HvButtonVariant } from "../Button"; -import { HvDropDownMenu, HvDropDownMenuProps } from "../DropDownMenu"; +import { HvButton, type HvButtonProps, type HvButtonVariant } from "../Button"; +import { HvDropDownMenu, type HvDropDownMenuProps } from "../DropDownMenu"; import { HvIconButton } from "../IconButton"; import { HvIcon } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { setId } from "../utils/setId"; import { staticClasses, useClasses } from "./ActionsGeneric.styles"; diff --git a/packages/core/src/AppSwitcher/Action/Action.tsx b/packages/core/src/AppSwitcher/Action/Action.tsx index 4cbf092656..aedebd7c52 100644 --- a/packages/core/src/AppSwitcher/Action/Action.tsx +++ b/packages/core/src/AppSwitcher/Action/Action.tsx @@ -1,6 +1,6 @@ import { useCallback } from "react"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny } from "@hitachivantara/uikit-styles"; +import { getColor, type HvColorAny } from "@hitachivantara/uikit-styles"; import { HvAvatar } from "../../Avatar"; import { useUniqueId } from "../../hooks/useUniqueId"; @@ -8,7 +8,7 @@ import { HvIcon } from "../../icons"; import { HvListItem } from "../../ListContainer"; import { HvOverflowTooltip } from "../../OverflowTooltip"; import { HvTooltip } from "../../Tooltip"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { HvTypography } from "../../Typography"; import { staticClasses, useClasses } from "./Action.styles"; diff --git a/packages/core/src/AppSwitcher/AppSwitcher.stories.tsx b/packages/core/src/AppSwitcher/AppSwitcher.stories.tsx index 65d3803239..58d5cabd9b 100644 --- a/packages/core/src/AppSwitcher/AppSwitcher.stories.tsx +++ b/packages/core/src/AppSwitcher/AppSwitcher.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvAppSwitcher, - HvAppSwitcherActionApplication, - HvAppSwitcherProps, + type HvAppSwitcherActionApplication, + type HvAppSwitcherProps, } from "@hitachivantara/uikit-react-core"; import { Code, LeftAlign } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/AppSwitcher/AppSwitcher.test.tsx b/packages/core/src/AppSwitcher/AppSwitcher.test.tsx index 9963446ad7..65734cb1fb 100644 --- a/packages/core/src/AppSwitcher/AppSwitcher.test.tsx +++ b/packages/core/src/AppSwitcher/AppSwitcher.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; -import { HvAppSwitcher, HvAppSwitcherProps } from "./AppSwitcher"; +import { HvAppSwitcher, type HvAppSwitcherProps } from "./AppSwitcher"; describe(" with minimum configuration", () => { const mockAppSwitcherProps: HvAppSwitcherProps = { diff --git a/packages/core/src/AppSwitcher/AppSwitcher.tsx b/packages/core/src/AppSwitcher/AppSwitcher.tsx index a54b76bdc0..dea0ac7f30 100644 --- a/packages/core/src/AppSwitcher/AppSwitcher.tsx +++ b/packages/core/src/AppSwitcher/AppSwitcher.tsx @@ -7,9 +7,12 @@ import { import { HvListContainer } from "../ListContainer"; import { HvOverflowTooltip } from "../OverflowTooltip"; import { HvPanel } from "../Panel"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvTypography } from "../Typography"; -import { HvAppSwitcherAction, HvAppSwitcherActionApplication } from "./Action"; +import { + HvAppSwitcherAction, + type HvAppSwitcherActionApplication, +} from "./Action"; import { staticClasses, useClasses } from "./AppSwitcher.styles"; export { staticClasses as appSwitcherClasses }; diff --git a/packages/core/src/Avatar/Avatar.stories.tsx b/packages/core/src/Avatar/Avatar.stories.tsx index 62c07bbcea..aa185f0b6f 100644 --- a/packages/core/src/Avatar/Avatar.stories.tsx +++ b/packages/core/src/Avatar/Avatar.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvAvatar, - HvAvatarProps, HvButtonBase, + type HvAvatarProps, } from "@hitachivantara/uikit-react-core"; import { Bookmark, Link as LinkIcon } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Avatar/Avatar.tsx b/packages/core/src/Avatar/Avatar.tsx index 6a31414f36..9c8f923233 100644 --- a/packages/core/src/Avatar/Avatar.tsx +++ b/packages/core/src/Avatar/Avatar.tsx @@ -1,16 +1,22 @@ import { forwardRef } from "react"; -import MuiAvatar, { AvatarProps as MuiAvatarProps } from "@mui/material/Avatar"; +import MuiAvatar, { + type AvatarProps as MuiAvatarProps, +} from "@mui/material/Avatar"; import { mergeStyles, useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny, HvSize } from "@hitachivantara/uikit-styles"; +import { + getColor, + type HvColorAny, + type HvSize, +} from "@hitachivantara/uikit-styles"; import { useAvatarGroupContext } from "../AvatarGroup/AvatarGroupContext"; import { useImageLoaded } from "../hooks/useImageLoaded"; import { HvIcon } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Avatar.styles"; const decreaseSizeMap = { diff --git a/packages/core/src/AvatarGroup/AvatarGroup.stories.tsx b/packages/core/src/AvatarGroup/AvatarGroup.stories.tsx index d9a32773ad..321d137346 100644 --- a/packages/core/src/AvatarGroup/AvatarGroup.stories.tsx +++ b/packages/core/src/AvatarGroup/AvatarGroup.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvAvatar, HvAvatarGroup, - HvAvatarGroupProps, + type HvAvatarGroupProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/AvatarGroup/AvatarGroup.tsx b/packages/core/src/AvatarGroup/AvatarGroup.tsx index f267e09410..f2c2dd6df7 100644 --- a/packages/core/src/AvatarGroup/AvatarGroup.tsx +++ b/packages/core/src/AvatarGroup/AvatarGroup.tsx @@ -7,7 +7,7 @@ import { import type { HvSize } from "@hitachivantara/uikit-styles"; import { HvAvatar } from "../Avatar/Avatar"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./AvatarGroup.styles"; import { HvAvatarGroupProvider } from "./AvatarGroupContext"; diff --git a/packages/core/src/AvatarGroup/AvatarGroupContext.tsx b/packages/core/src/AvatarGroup/AvatarGroupContext.tsx index fa1d4a1a93..90845a7d67 100644 --- a/packages/core/src/AvatarGroup/AvatarGroupContext.tsx +++ b/packages/core/src/AvatarGroup/AvatarGroupContext.tsx @@ -1,5 +1,5 @@ import { createContext, useContext, useMemo } from "react"; -import { HvSize } from "@hitachivantara/uikit-styles"; +import type { HvSize } from "@hitachivantara/uikit-styles"; type HvAvatarGroupContextProviderProps = { size: HvSize; diff --git a/packages/core/src/Badge/Badge.stories.tsx b/packages/core/src/Badge/Badge.stories.tsx index e8fb9bde80..92579c9889 100644 --- a/packages/core/src/Badge/Badge.stories.tsx +++ b/packages/core/src/Badge/Badge.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvBadge, - HvBadgeProps, HvTypography, + type HvBadgeProps, } from "@hitachivantara/uikit-react-core"; import { Alert } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Badge/Badge.tsx b/packages/core/src/Badge/Badge.tsx index 3aa44bb198..ec9a4e026d 100644 --- a/packages/core/src/Badge/Badge.tsx +++ b/packages/core/src/Badge/Badge.tsx @@ -4,9 +4,9 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny } from "@hitachivantara/uikit-styles"; +import { getColor, type HvColorAny } from "@hitachivantara/uikit-styles"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Badge.styles"; export { staticClasses as badgeClasses }; diff --git a/packages/core/src/Banner/Banner.stories.tsx b/packages/core/src/Banner/Banner.stories.tsx index 35bff9377f..ea9d29fcff 100644 --- a/packages/core/src/Banner/Banner.stories.tsx +++ b/packages/core/src/Banner/Banner.stories.tsx @@ -4,8 +4,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvBanner, HvBannerContent, - HvBannerProps, HvButton, + type HvBannerProps, } from "@hitachivantara/uikit-react-core"; import { Deploy } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Banner/Banner.test.tsx b/packages/core/src/Banner/Banner.test.tsx index 2764d08aee..4df940596f 100644 --- a/packages/core/src/Banner/Banner.test.tsx +++ b/packages/core/src/Banner/Banner.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvBanner, HvBannerProps } from "./Banner"; +import { HvBanner, type HvBannerProps } from "./Banner"; const bannerLabel = "This is a banner."; diff --git a/packages/core/src/Banner/Banner.tsx b/packages/core/src/Banner/Banner.tsx index 318fe0a3b7..cf0db1ec99 100644 --- a/packages/core/src/Banner/Banner.tsx +++ b/packages/core/src/Banner/Banner.tsx @@ -1,29 +1,31 @@ import { forwardRef, useCallback } from "react"; -import Slide, { SlideProps } from "@mui/material/Slide"; +import Slide, { type SlideProps } from "@mui/material/Slide"; import Snackbar, { - SnackbarProps as MuiSnackbarProps, - SnackbarOrigin, + type SnackbarProps as MuiSnackbarProps, + type SnackbarOrigin, } from "@mui/material/Snackbar"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvActionsGenericProps } from "../ActionsGeneric"; +import type { HvActionsGenericProps } from "../ActionsGeneric"; import { staticClasses, useClasses } from "./Banner.styles"; import { - HvBannerActionPosition, HvBannerContent, - HvBannerContentProps, - HvBannerVariant, + type HvBannerActionPosition, + type HvBannerContentProps, + type HvBannerVariant, } from "./BannerContent/BannerContent"; export { staticClasses as bannerClasses }; export type HvBannerClasses = ExtractNames; -export interface HvBannerProps - extends Omit { +export interface HvBannerProps extends Omit< + MuiSnackbarProps, + "anchorOrigin" | "classes" | "onClose" +> { /** If true, the snackbar is open. */ open: boolean; /** diff --git a/packages/core/src/Banner/BannerContent/BannerContent.tsx b/packages/core/src/Banner/BannerContent/BannerContent.tsx index a98ddc559e..a6fb0dbf80 100644 --- a/packages/core/src/Banner/BannerContent/BannerContent.tsx +++ b/packages/core/src/Banner/BannerContent/BannerContent.tsx @@ -1,16 +1,16 @@ import { forwardRef } from "react"; -import { SnackbarContentProps as MuiSnackbarContentProps } from "@mui/material/SnackbarContent"; +import type { SnackbarContentProps as MuiSnackbarContentProps } from "@mui/material/SnackbarContent"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvActionsGenericProps } from "../../ActionsGeneric"; -import { HvButtonProps } from "../../Button"; +import type { HvActionsGenericProps } from "../../ActionsGeneric"; +import type { HvButtonProps } from "../../Button"; import { HvCallout, - HvCalloutProps, - HvCalloutVariant, + type HvCalloutProps, + type HvCalloutVariant, } from "../../utils/Callout"; import { staticClasses, useClasses } from "./BannerContent.styles"; @@ -22,8 +22,10 @@ export type HvBannerActionPosition = "auto" | "inline" | "bottom-right"; export type HvBannerContentClasses = ExtractNames; -export interface HvBannerContentProps - extends Omit { +export interface HvBannerContentProps extends Omit< + MuiSnackbarContentProps, + "variant" | "classes" | "onClose" +> { /** The message to display. @deprecated use `children` instead */ content?: string; /** The message to display. */ diff --git a/packages/core/src/BaseCheckBox/BaseCheckBox.tsx b/packages/core/src/BaseCheckBox/BaseCheckBox.tsx index 55fd490336..c8bffa712e 100644 --- a/packages/core/src/BaseCheckBox/BaseCheckBox.tsx +++ b/packages/core/src/BaseCheckBox/BaseCheckBox.tsx @@ -1,12 +1,12 @@ import { forwardRef, useCallback, useState } from "react"; import MuiCheckbox, { - CheckboxProps as MuiCheckboxProps, + type CheckboxProps as MuiCheckboxProps, } from "@mui/material/Checkbox"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; import { staticClasses, useClasses } from "./BaseCheckBox.styles"; import { HvCheckBoxIcon } from "./CheckBoxIcon"; @@ -15,8 +15,10 @@ export { staticClasses as baseCheckBoxClasses }; export type HvBaseCheckBoxClasses = ExtractNames; -export interface HvBaseCheckBoxProps - extends Omit { +export interface HvBaseCheckBoxProps extends Omit< + MuiCheckboxProps, + "onChange" | "classes" | "color" +> { /** * The input name. */ diff --git a/packages/core/src/BaseCheckBox/CheckBoxIcon.tsx b/packages/core/src/BaseCheckBox/CheckBoxIcon.tsx index 1ee82a6c12..efdf0b48d4 100644 --- a/packages/core/src/BaseCheckBox/CheckBoxIcon.tsx +++ b/packages/core/src/BaseCheckBox/CheckBoxIcon.tsx @@ -1,11 +1,11 @@ import { useMemo } from "react"; import { createClasses, - ExtractNames, mergeStyles, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny, theme } from "@hitachivantara/uikit-styles"; +import { getColor, theme, type HvColorAny } from "@hitachivantara/uikit-styles"; import { SvgBase } from "../icons"; import type { HvBaseCheckBoxProps } from "./BaseCheckBox"; @@ -44,8 +44,10 @@ const { useClasses } = createClasses("HvCheckBoxIcon", { export type HvCheckBoxIconClasses = ExtractNames; -export interface HvCheckBoxIconProps - extends Pick { +export interface HvCheckBoxIconProps extends Pick< + HvBaseCheckBoxProps, + "className" | "disabled" | "semantic" +> { variant?: "default" | "checked" | "indeterminate"; color?: HvColorAny; classes?: HvCheckBoxIconClasses; diff --git a/packages/core/src/BaseDropdown/BaseDropdown.tsx b/packages/core/src/BaseDropdown/BaseDropdown.tsx index c3736e5c2b..0d4b76b690 100644 --- a/packages/core/src/BaseDropdown/BaseDropdown.tsx +++ b/packages/core/src/BaseDropdown/BaseDropdown.tsx @@ -19,7 +19,7 @@ import { import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; import { HvIcon } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvTypography } from "../Typography"; import { isKey, isOneOfKeys } from "../utils/keyboardUtils"; import { staticClasses, useClasses } from "./BaseDropdown.styles"; @@ -29,8 +29,10 @@ export { staticClasses as baseDropdownClasses }; export type HvBaseDropdownClasses = ExtractNames; -export interface HvBaseDropdownProps - extends HvBaseProps { +export interface HvBaseDropdownProps extends HvBaseProps< + HTMLDivElement, + "onToggle" +> { /** * The role of the element that triggers the popup. * diff --git a/packages/core/src/BaseDropdown/BaseDropdownPanel.tsx b/packages/core/src/BaseDropdown/BaseDropdownPanel.tsx index b87f9badc3..17697203ab 100644 --- a/packages/core/src/BaseDropdown/BaseDropdownPanel.tsx +++ b/packages/core/src/BaseDropdown/BaseDropdownPanel.tsx @@ -32,7 +32,8 @@ const { useClasses } = createClasses(name, { }); export interface HvDropdownPanelProps - extends Omit, + extends + Omit, Pick { variableWidth?: boolean; classes?: ExtractNames; diff --git a/packages/core/src/BaseInput/BaseInput.tsx b/packages/core/src/BaseInput/BaseInput.tsx index 2057972e41..d2ab107a3c 100644 --- a/packages/core/src/BaseInput/BaseInput.tsx +++ b/packages/core/src/BaseInput/BaseInput.tsx @@ -18,11 +18,10 @@ export { staticClasses as baseInputClasses }; export type HvBaseInputClasses = ExtractNames; -export interface HvBaseInputProps - extends Omit< - InputBaseProps, - "onChange" | "classes" | "ref" | "color" | "size" | "inputProps" - > { +export interface HvBaseInputProps extends Omit< + InputBaseProps, + "onChange" | "classes" | "ref" | "color" | "size" | "inputProps" +> { /** The input name. */ name?: string; /** The value of the input, when controlled. */ diff --git a/packages/core/src/BaseRadio/BaseRadio.tsx b/packages/core/src/BaseRadio/BaseRadio.tsx index 406da8b828..922b2e0a6f 100644 --- a/packages/core/src/BaseRadio/BaseRadio.tsx +++ b/packages/core/src/BaseRadio/BaseRadio.tsx @@ -1,10 +1,12 @@ import { forwardRef, useCallback, useState } from "react"; -import MuiRadio, { RadioProps as MuiRadioProps } from "@mui/material/Radio"; +import MuiRadio, { + type RadioProps as MuiRadioProps, +} from "@mui/material/Radio"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; import { staticClasses, useClasses } from "./BaseRadio.styles"; import { HvRadioIcon } from "./RadioIcon"; @@ -13,8 +15,10 @@ export { staticClasses as baseRadioClasses }; export type HvBaseRadioClasses = ExtractNames; -export interface HvBaseRadioProps - extends Omit { +export interface HvBaseRadioProps extends Omit< + MuiRadioProps, + "onChange" | "classes" | "color" +> { /** * Class names to be applied. */ diff --git a/packages/core/src/BaseRadio/RadioIcon.tsx b/packages/core/src/BaseRadio/RadioIcon.tsx index 6f8f33fb47..4fda814ef6 100644 --- a/packages/core/src/BaseRadio/RadioIcon.tsx +++ b/packages/core/src/BaseRadio/RadioIcon.tsx @@ -1,10 +1,10 @@ import { createClasses, - ExtractNames, mergeStyles, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny, theme } from "@hitachivantara/uikit-styles"; +import { getColor, theme, type HvColorAny } from "@hitachivantara/uikit-styles"; import { SvgBase } from "../icons"; import type { HvBaseRadioProps } from "./BaseRadio"; @@ -33,8 +33,10 @@ const { useClasses } = createClasses("HvRadioIcon", { export type HvRadioIconClasses = ExtractNames; -export interface HvRadioIconProps - extends Pick { +export interface HvRadioIconProps extends Pick< + HvBaseRadioProps, + "checked" | "disabled" | "className" +> { color?: HvColorAny; classes?: HvRadioIconClasses; } diff --git a/packages/core/src/BaseSwitch/BaseSwitch.tsx b/packages/core/src/BaseSwitch/BaseSwitch.tsx index f364465151..a144012bc3 100644 --- a/packages/core/src/BaseSwitch/BaseSwitch.tsx +++ b/packages/core/src/BaseSwitch/BaseSwitch.tsx @@ -1,10 +1,12 @@ import { forwardRef, useCallback, useState } from "react"; -import MuiSwitch, { SwitchProps as MuiSwitchProps } from "@mui/material/Switch"; +import MuiSwitch, { + type SwitchProps as MuiSwitchProps, +} from "@mui/material/Switch"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny } from "@hitachivantara/uikit-styles"; +import { getColor, type HvColorAny } from "@hitachivantara/uikit-styles"; import { staticClasses, useClasses } from "./BaseSwitch.styles"; @@ -12,8 +14,10 @@ export { staticClasses as baseSwitchClasses }; export type HvBaseSwitchClasses = ExtractNames; -export interface HvBaseSwitchProps - extends Omit { +export interface HvBaseSwitchProps extends Omit< + MuiSwitchProps, + "onChange" | "classes" | "color" +> { /** * Class names to be applied. */ diff --git a/packages/core/src/BreadCrumb/BreadCrumb.stories.tsx b/packages/core/src/BreadCrumb/BreadCrumb.stories.tsx index 6b56f76635..33cc793a8d 100644 --- a/packages/core/src/BreadCrumb/BreadCrumb.stories.tsx +++ b/packages/core/src/BreadCrumb/BreadCrumb.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { expect, within } from "storybook/test"; import { HvBreadCrumb, - HvBreadCrumbProps, + type HvBreadCrumbProps, } from "@hitachivantara/uikit-react-core"; const data = [ diff --git a/packages/core/src/BreadCrumb/BreadCrumb.tsx b/packages/core/src/BreadCrumb/BreadCrumb.tsx index 10b0e38e9d..be089d0b03 100644 --- a/packages/core/src/BreadCrumb/BreadCrumb.tsx +++ b/packages/core/src/BreadCrumb/BreadCrumb.tsx @@ -4,23 +4,25 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvDropDownMenuProps } from "../DropDownMenu"; +import type { HvDropDownMenuProps } from "../DropDownMenu"; import { HvIconButton } from "../IconButton"; import { SvgBase } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvTypography } from "../Typography"; import { staticClasses, useClasses } from "./BreadCrumb.styles"; import { HvBreadCrumbPage } from "./Page"; import { HvPathElement } from "./PathElement"; -import { HvBreadCrumbPathElement } from "./types"; +import type { HvBreadCrumbPathElement } from "./types"; import { pathWithSubMenu, removeExtension } from "./utils"; export { staticClasses as breadCrumbClasses }; export type HvBreadCrumbClasses = ExtractNames; -export interface HvBreadCrumbProps - extends HvBaseProps { +export interface HvBreadCrumbProps extends HvBaseProps< + HTMLDivElement, + "onClick" +> { /** List of breadcrumb. */ listRoute?: HvBreadCrumbPathElement[]; /** Home breadcrumb element. If passed, it will be displayed as the first breadcrumb item as a Home icon */ diff --git a/packages/core/src/BreadCrumb/Page/Page.tsx b/packages/core/src/BreadCrumb/Page/Page.tsx index 6b5348ad26..62437136fd 100644 --- a/packages/core/src/BreadCrumb/Page/Page.tsx +++ b/packages/core/src/BreadCrumb/Page/Page.tsx @@ -5,7 +5,7 @@ import { import { HvOverflowTooltip } from "../../OverflowTooltip"; import { HvTypography } from "../../Typography"; -import { HvBreadCrumbPathElement } from "../types"; +import type { HvBreadCrumbPathElement } from "../types"; import { staticClasses, useClasses } from "./Page.styles"; export { staticClasses as breadCrumbPageClasses }; diff --git a/packages/core/src/BreadCrumb/utils.tsx b/packages/core/src/BreadCrumb/utils.tsx index 92fa3d2526..c550749769 100644 --- a/packages/core/src/BreadCrumb/utils.tsx +++ b/packages/core/src/BreadCrumb/utils.tsx @@ -1,4 +1,4 @@ -import { HvDropDownMenu, HvDropDownMenuProps } from "../DropDownMenu"; +import { HvDropDownMenu, type HvDropDownMenuProps } from "../DropDownMenu"; import { HvIcon } from "../icons"; export const removeExtension = (label: string) => diff --git a/packages/core/src/BulkActions/BulkActions.stories.tsx b/packages/core/src/BulkActions/BulkActions.stories.tsx index aa9580695e..3a84c1c423 100644 --- a/packages/core/src/BulkActions/BulkActions.stories.tsx +++ b/packages/core/src/BulkActions/BulkActions.stories.tsx @@ -1,10 +1,10 @@ import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { - HvActionGeneric, HvBulkActions, - HvBulkActionsProps, HvCheckBox, + type HvActionGeneric, + type HvBulkActionsProps, } from "@hitachivantara/uikit-react-core"; import { Add, Delete, Preview } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/BulkActions/BulkActions.test.tsx b/packages/core/src/BulkActions/BulkActions.test.tsx index ef8249a351..c6abcf236f 100644 --- a/packages/core/src/BulkActions/BulkActions.test.tsx +++ b/packages/core/src/BulkActions/BulkActions.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvBulkActions, HvBulkActionsProps } from "./BulkActions"; +import { HvBulkActions, type HvBulkActionsProps } from "./BulkActions"; const Sample = (props: Partial) => { const [numSelected, setNumSelected] = useState(0); diff --git a/packages/core/src/BulkActions/BulkActions.tsx b/packages/core/src/BulkActions/BulkActions.tsx index cd7b35079b..0634316a91 100644 --- a/packages/core/src/BulkActions/BulkActions.tsx +++ b/packages/core/src/BulkActions/BulkActions.tsx @@ -4,10 +4,13 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvActionsGeneric, HvActionsGenericProps } from "../ActionsGeneric"; -import { HvButton, HvButtonProps } from "../Button"; -import { HvCheckBox, HvCheckBoxProps } from "../CheckBox"; -import { HvBaseProps } from "../types/generic"; +import { + HvActionsGeneric, + type HvActionsGenericProps, +} from "../ActionsGeneric"; +import { HvButton, type HvButtonProps } from "../Button"; +import { HvCheckBox, type HvCheckBoxProps } from "../CheckBox"; +import type { HvBaseProps } from "../types/generic"; import { CounterLabel } from "../utils/CounterLabel"; import { staticClasses, useClasses } from "./BulkActions.styles"; diff --git a/packages/core/src/Button/Button.stories.tsx b/packages/core/src/Button/Button.stories.tsx index 9cd341c16e..f6daccd681 100644 --- a/packages/core/src/Button/Button.stories.tsx +++ b/packages/core/src/Button/Button.stories.tsx @@ -1,7 +1,7 @@ import { faAdd } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { StoryObj } from "@storybook/react-vite"; -import { HvButton, HvButtonProps } from "@hitachivantara/uikit-react-core"; +import type { StoryObj } from "@storybook/react-vite"; +import { HvButton, type HvButtonProps } from "@hitachivantara/uikit-react-core"; import { Delete, Favorite, diff --git a/packages/core/src/Button/Button.tsx b/packages/core/src/Button/Button.tsx index 9030553956..180a7317f0 100644 --- a/packages/core/src/Button/Button.tsx +++ b/packages/core/src/Button/Button.tsx @@ -6,16 +6,16 @@ import { } from "@hitachivantara/uikit-react-utils"; import { getColor, - HvColorAny, - HvRadius, - HvSize, theme, + type HvColorAny, + type HvRadius, + type HvSize, } from "@hitachivantara/uikit-styles"; import { fixedForwardRef, - PolymorphicComponentRef, - PolymorphicRef, + type PolymorphicComponentRef, + type PolymorphicRef, } from "../types/generic"; import { getIconSizeStyles, diff --git a/packages/core/src/ButtonBase/ButtonBase.tsx b/packages/core/src/ButtonBase/ButtonBase.tsx index cc953d8b12..c4a63d3a86 100644 --- a/packages/core/src/ButtonBase/ButtonBase.tsx +++ b/packages/core/src/ButtonBase/ButtonBase.tsx @@ -5,8 +5,8 @@ import { import { fixedForwardRef, - PolymorphicComponentRef, - PolymorphicRef, + type PolymorphicComponentRef, + type PolymorphicRef, } from "../types/generic"; import { staticClasses, useClasses } from "./ButtonBase.styles"; diff --git a/packages/core/src/Calendar/Calendar.tsx b/packages/core/src/Calendar/Calendar.tsx index f5b72384e9..b6bd4435ba 100644 --- a/packages/core/src/Calendar/Calendar.tsx +++ b/packages/core/src/Calendar/Calendar.tsx @@ -7,15 +7,17 @@ import { import { HvFormElementValueContext } from "../FormElement"; import { staticClasses, useClasses } from "./Calendar.styles"; import { HvSingleCalendar } from "./SingleCalendar"; -import { DateRangeProp, VisibilitySelectorActions } from "./types"; +import type { DateRangeProp, VisibilitySelectorActions } from "./types"; import { DEFAULT_LOCALE, isRange } from "./utils"; export { staticClasses as calendarClasses }; export type HvCalendarClasses = ExtractNames; -export interface HvCalendarProps - extends Omit, "onChange"> { +export interface HvCalendarProps extends Omit< + React.HTMLAttributes, + "onChange" +> { /** * Styles applied from the theme. */ diff --git a/packages/core/src/Calendar/CalendarHeader/CalendarHeader.tsx b/packages/core/src/Calendar/CalendarHeader/CalendarHeader.tsx index c43b6147ee..934f31a655 100644 --- a/packages/core/src/Calendar/CalendarHeader/CalendarHeader.tsx +++ b/packages/core/src/Calendar/CalendarHeader/CalendarHeader.tsx @@ -5,7 +5,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvFormElementDescriptorsContext } from "../../FormElement"; -import { HvInput, HvInputProps } from "../../Input"; +import { HvInput, type HvInputProps } from "../../Input"; import { HvTypography } from "../../Typography"; import { isKey } from "../../utils/keyboardUtils"; import type { HvSingleCalendarProps } from "../SingleCalendar"; @@ -165,17 +165,16 @@ export const HvCalendarHeader = (props: HvCalendarHeaderProps) => { // TODO: refactor this out HvCalendarHeader.formElementType = "HvCalendarHeader"; -export interface HvCalendarHeaderProps - extends Pick< - HvSingleCalendarProps, - | "id" - | "value" - | "locale" - | "onChange" - | "showEndDate" - | "showDayOfWeek" - | "invalidDateLabel" - > { +export interface HvCalendarHeaderProps extends Pick< + HvSingleCalendarProps, + | "id" + | "value" + | "locale" + | "onChange" + | "showEndDate" + | "showDayOfWeek" + | "invalidDateLabel" +> { /** * A Jss Object used to override or extend the component styles. */ diff --git a/packages/core/src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.tsx b/packages/core/src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.tsx index 2c4e23d94b..58b5d7232d 100644 --- a/packages/core/src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.tsx +++ b/packages/core/src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.tsx @@ -1,7 +1,7 @@ import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { ViewMode } from "../../enums"; -import { VisibilitySelectorActions } from "../../types"; +import type { ViewMode } from "../../enums"; +import type { VisibilitySelectorActions } from "../../types"; import { getMonthNamesList } from "../../utils"; import { Navigation } from "../Navigation"; import { staticClasses, useClasses } from "./ComposedNavigation.styles"; diff --git a/packages/core/src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.tsx b/packages/core/src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.tsx index 043fd7d2f5..f87e645f4c 100644 --- a/packages/core/src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.tsx +++ b/packages/core/src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.tsx @@ -1,8 +1,8 @@ import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; import { HvButtonBase } from "../../../ButtonBase"; -import { ViewMode } from "../../enums"; -import { DateRangeProp, VisibilitySelectorActions } from "../../types"; +import type { ViewMode } from "../../enums"; +import type { DateRangeProp, VisibilitySelectorActions } from "../../types"; import { getMonthNamesList } from "../../utils"; import { staticClasses, useClasses } from "./MonthSelector.styles"; diff --git a/packages/core/src/Calendar/CalendarNavigation/Navigation/Navigation.tsx b/packages/core/src/Calendar/CalendarNavigation/Navigation/Navigation.tsx index 4511ed02d3..7edd63619a 100644 --- a/packages/core/src/Calendar/CalendarNavigation/Navigation/Navigation.tsx +++ b/packages/core/src/Calendar/CalendarNavigation/Navigation/Navigation.tsx @@ -2,7 +2,7 @@ import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; import { HvButton } from "../../../Button"; import { HvIcon } from "../../../icons"; -import { HvBaseProps } from "../../../types/generic"; +import type { HvBaseProps } from "../../../types/generic"; import { staticClasses, useClasses } from "./Navigation.styles"; export { staticClasses as navigationClasses }; diff --git a/packages/core/src/Calendar/SingleCalendar/CalendarCell.tsx b/packages/core/src/Calendar/SingleCalendar/CalendarCell.tsx index fe5475204f..7a7dfa9b76 100644 --- a/packages/core/src/Calendar/SingleCalendar/CalendarCell.tsx +++ b/packages/core/src/Calendar/SingleCalendar/CalendarCell.tsx @@ -4,10 +4,10 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButtonBase, HvButtonBaseProps } from "../../ButtonBase"; +import { HvButtonBase, type HvButtonBaseProps } from "../../ButtonBase"; import { HvTypography } from "../../Typography"; -import CalendarModel from "../model"; -import { DateRangeProp } from "../types"; +import type CalendarModel from "../model"; +import type { DateRangeProp } from "../types"; import { checkIfDateIsDisabled, dateInProvidedValueRange, @@ -112,8 +112,10 @@ export const HvCalendarCell = (props: HvCalendarCellProps) => { ); }; -export interface HvCalendarCellProps - extends Omit { +export interface HvCalendarCellProps extends Omit< + HvButtonBaseProps, + "value" | "classes" | "onChange" +> { /** * A Jss Object used to override or extend the component styles. */ diff --git a/packages/core/src/Calendar/SingleCalendar/SingleCalendar.tsx b/packages/core/src/Calendar/SingleCalendar/SingleCalendar.tsx index 5510000a00..f7c5b1dd83 100644 --- a/packages/core/src/Calendar/SingleCalendar/SingleCalendar.tsx +++ b/packages/core/src/Calendar/SingleCalendar/SingleCalendar.tsx @@ -10,7 +10,7 @@ import { isKey } from "../../utils/keyboardUtils"; import type { HvCalendarProps } from "../Calendar"; import { HvCalendarHeader } from "../CalendarHeader/CalendarHeader"; import { HvComposedNavigation, HvMonthSelector } from "../CalendarNavigation"; -import { ViewMode } from "../enums"; +import type { ViewMode } from "../enums"; import { generateCalendarModel } from "../model"; import type { DateRangeProp } from "../types"; import { DEFAULT_LOCALE, getWeekdayNamesList, isDate, isRange } from "../utils"; @@ -185,8 +185,10 @@ export const HvSingleCalendar = (props: HvSingleCalendarProps) => { ); }; -export interface HvSingleCalendarProps - extends Omit { +export interface HvSingleCalendarProps extends Omit< + HvCalendarProps, + "classes" +> { /** * Styles applied from the theme. */ diff --git a/packages/core/src/Card/Card.stories.tsx b/packages/core/src/Card/Card.stories.tsx index 414662fdd5..7ad9d2fc5a 100644 --- a/packages/core/src/Card/Card.stories.tsx +++ b/packages/core/src/Card/Card.stories.tsx @@ -4,7 +4,7 @@ import { HvCardContent, HvCardHeader, HvCardMedia, - HvCardProps, + type HvCardProps, } from "@hitachivantara/uikit-react-core"; import { Expandable as ExpandableStory } from "./stories/Expandable"; diff --git a/packages/core/src/Card/Card.tsx b/packages/core/src/Card/Card.tsx index 53724cdcab..ff749d9dca 100644 --- a/packages/core/src/Card/Card.tsx +++ b/packages/core/src/Card/Card.tsx @@ -4,9 +4,9 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny } from "@hitachivantara/uikit-styles"; +import { getColor, type HvColorAny } from "@hitachivantara/uikit-styles"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Card.styles"; export { staticClasses as cardClasses }; diff --git a/packages/core/src/Card/Content/Content.tsx b/packages/core/src/Card/Content/Content.tsx index ceab47fa9e..0ae5f6de0c 100644 --- a/packages/core/src/Card/Content/Content.tsx +++ b/packages/core/src/Card/Content/Content.tsx @@ -1,5 +1,5 @@ import MuiCardContent, { - CardContentProps as MuiCardContentProps, + type CardContentProps as MuiCardContentProps, } from "@mui/material/CardContent"; import { useDefaultProps, @@ -12,8 +12,10 @@ export { staticClasses as cardContentClasses }; export type HvCardContentClasses = ExtractNames; -export interface HvCardContentProps - extends Omit { +export interface HvCardContentProps extends Omit< + MuiCardContentProps, + "classes" +> { /** The function that will be executed when this section is clicked. */ onClick?: (event: React.SyntheticEvent) => void; /** A Jss Object used to override or extend the styles applied to the component. */ diff --git a/packages/core/src/Card/Header/Header.tsx b/packages/core/src/Card/Header/Header.tsx index c55a6ffb12..1ec2094eb1 100644 --- a/packages/core/src/Card/Header/Header.tsx +++ b/packages/core/src/Card/Header/Header.tsx @@ -1,5 +1,5 @@ import MuiCardHeader, { - CardHeaderProps as MuiCardHeaderProps, + type CardHeaderProps as MuiCardHeaderProps, } from "@mui/material/CardHeader"; import { useDefaultProps, diff --git a/packages/core/src/Card/Media/Media.tsx b/packages/core/src/Card/Media/Media.tsx index ef104a404d..dacddd86ef 100644 --- a/packages/core/src/Card/Media/Media.tsx +++ b/packages/core/src/Card/Media/Media.tsx @@ -1,5 +1,5 @@ import MuiCardMedia, { - CardMediaProps as MuiCardMediaProps, + type CardMediaProps as MuiCardMediaProps, } from "@mui/material/CardMedia"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; @@ -10,7 +10,8 @@ export { staticClasses as cardMediaClasses }; export type HvCardMediaClasses = ExtractNames; export interface HvCardMediaProps - extends Omit, + extends + Omit, React.ImgHTMLAttributes { /** The title of the media. */ title?: string; diff --git a/packages/core/src/Card/stories/Main.tsx b/packages/core/src/Card/stories/Main.tsx index db13ff10e1..04381a03f5 100644 --- a/packages/core/src/Card/stories/Main.tsx +++ b/packages/core/src/Card/stories/Main.tsx @@ -3,8 +3,8 @@ import { HvCardContent, HvCardHeader, HvCardMedia, - HvCardProps, HvTypography, + type HvCardProps, } from "@hitachivantara/uikit-react-core"; import { Level2Average } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Carousel/Carousel.stories.tsx b/packages/core/src/Carousel/Carousel.stories.tsx index d4c5bb7793..95c5298b5b 100644 --- a/packages/core/src/Carousel/Carousel.stories.tsx +++ b/packages/core/src/Carousel/Carousel.stories.tsx @@ -6,11 +6,11 @@ import { HvCardHeader, HvCardMedia, HvCarousel, - HvCarouselProps, HvCarouselSlide, HvDropDownMenu, HvTypography, theme, + type HvCarouselProps, } from "@hitachivantara/uikit-react-core"; export default { diff --git a/packages/core/src/Carousel/Carousel.test.tsx b/packages/core/src/Carousel/Carousel.test.tsx index d1a9527cfd..7916fe27db 100644 --- a/packages/core/src/Carousel/Carousel.test.tsx +++ b/packages/core/src/Carousel/Carousel.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { vi } from "vitest"; -import { HvCarousel, HvCarouselProps, HvCarouselSlide } from "."; +import { HvCarousel, HvCarouselSlide, type HvCarouselProps } from "."; const setup = ({ title = "TITLE", diff --git a/packages/core/src/Carousel/Carousel.tsx b/packages/core/src/Carousel/Carousel.tsx index 0ebcd30ef6..85d01f3318 100644 --- a/packages/core/src/Carousel/Carousel.tsx +++ b/packages/core/src/Carousel/Carousel.tsx @@ -16,9 +16,9 @@ import { import { HvButton } from "../Button"; import { HvContainer } from "../Container"; import { useLabels } from "../hooks/useLabels"; -import { HvIconButton, HvIconButtonProps } from "../IconButton"; +import { HvIconButton, type HvIconButtonProps } from "../IconButton"; import { HvIcon } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvTypography } from "../Typography"; import { staticClasses, useClasses } from "./Carousel.styles"; import { HvCarouselControls } from "./CarouselControls"; @@ -35,8 +35,10 @@ const DEFAULT_LABELS = { forwards: "Forwards", }; -export interface HvCarouselProps - extends HvBaseProps { +export interface HvCarouselProps extends HvBaseProps< + HTMLDivElement, + "title" | "onChange" +> { /** A Jss Object used to override or extend the styles applied. */ classes?: HvCarouselClasses; /** Height of the Slider container. If `undefined`, images will keep a 16/9 aspect-ratio */ diff --git a/packages/core/src/Carousel/CarouselControls.tsx b/packages/core/src/Carousel/CarouselControls.tsx index 71d36ae681..f54bc384ad 100644 --- a/packages/core/src/Carousel/CarouselControls.tsx +++ b/packages/core/src/Carousel/CarouselControls.tsx @@ -6,8 +6,8 @@ import { import { HvButton } from "../Button"; import { useLabels } from "../hooks/useLabels"; import { HvIcon } from "../icons"; -import { HvPaginationProps } from "../Pagination"; -import { HvBaseProps } from "../types/generic"; +import type { HvPaginationProps } from "../Pagination"; +import type { HvBaseProps } from "../types/generic"; import { useClasses } from "./Carousel.styles"; const DEFAULT_LABELS = { @@ -16,7 +16,8 @@ const DEFAULT_LABELS = { }; interface HvCarouselControlsProps - extends HvBaseProps, + extends + HvBaseProps, Pick { showDots?: boolean; classes?: ExtractNames; diff --git a/packages/core/src/Carousel/CarouselSlide/CarouselSlide.tsx b/packages/core/src/Carousel/CarouselSlide/CarouselSlide.tsx index 399fa2576e..1d2e1879bb 100644 --- a/packages/core/src/Carousel/CarouselSlide/CarouselSlide.tsx +++ b/packages/core/src/Carousel/CarouselSlide/CarouselSlide.tsx @@ -4,8 +4,7 @@ import { useClasses } from "./CarouselSlide.styles"; export type HvCarouselSlideClasses = ExtractNames; -export interface HvCarouselSlideProps - extends React.ImgHTMLAttributes { +export interface HvCarouselSlideProps extends React.ImgHTMLAttributes { /** A Jss Object used to override or extend the styles applied. */ classes?: HvCarouselSlideClasses; /** The width of the Slide. Defaults to `100%` */ diff --git a/packages/core/src/Carousel/CarouselThumbnails.tsx b/packages/core/src/Carousel/CarouselThumbnails.tsx index c99d42499e..a73614f398 100644 --- a/packages/core/src/Carousel/CarouselThumbnails.tsx +++ b/packages/core/src/Carousel/CarouselThumbnails.tsx @@ -1,14 +1,15 @@ import { forwardRef } from "react"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../Button"; -import { HvPaginationProps } from "../Pagination"; +import { HvButton, type HvButtonProps } from "../Button"; +import type { HvPaginationProps } from "../Pagination"; import { HvStack } from "../Stack"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { useClasses } from "./Carousel.styles"; interface HvCarouselThumbnailsProps - extends HvBaseProps, + extends + HvBaseProps, Pick { width?: React.CSSProperties["width"]; classes?: ExtractNames; diff --git a/packages/core/src/CheckBox/CheckBox.stories.tsx b/packages/core/src/CheckBox/CheckBox.stories.tsx index 10b0e1d504..c11dc0b0e1 100644 --- a/packages/core/src/CheckBox/CheckBox.stories.tsx +++ b/packages/core/src/CheckBox/CheckBox.stories.tsx @@ -3,7 +3,7 @@ import { expect } from "storybook/test"; import { HvBaseCheckBox, HvCheckBox, - HvCheckBoxProps, + type HvCheckBoxProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/CheckBox/CheckBox.tsx b/packages/core/src/CheckBox/CheckBox.tsx index 0df46c8dd6..dc925c0bed 100644 --- a/packages/core/src/CheckBox/CheckBox.tsx +++ b/packages/core/src/CheckBox/CheckBox.tsx @@ -4,14 +4,14 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseCheckBox, HvBaseCheckBoxProps } from "../BaseCheckBox"; +import { HvBaseCheckBox, type HvBaseCheckBoxProps } from "../BaseCheckBox"; import { HvFormElement, - HvFormStatus, HvLabel, - HvLabelProps, HvWarningText, isInvalid, + type HvFormStatus, + type HvLabelProps, } from "../FormElement"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; diff --git a/packages/core/src/CheckBoxGroup/CheckBoxGroup.stories.tsx b/packages/core/src/CheckBoxGroup/CheckBoxGroup.stories.tsx index 473c07a2dc..31f1adf6f7 100644 --- a/packages/core/src/CheckBoxGroup/CheckBoxGroup.stories.tsx +++ b/packages/core/src/CheckBoxGroup/CheckBoxGroup.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvCheckBox, HvCheckBoxGroup, - HvCheckBoxGroupProps, + type HvCheckBoxGroupProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx b/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx index 3914eb2c59..2dce9c0059 100644 --- a/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx +++ b/packages/core/src/CheckBoxGroup/CheckBoxGroup.tsx @@ -12,11 +12,15 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvCheckBox } from "../CheckBox"; -import { HvFormElement, HvFormStatus, HvWarningText } from "../FormElement"; +import { + HvFormElement, + HvWarningText, + type HvFormStatus, +} from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { CounterLabel } from "../utils/CounterLabel"; import { multiSelectionEventHandler } from "../utils/multiSelectionEventHandler"; import { setId } from "../utils/setId"; @@ -53,8 +57,10 @@ export { staticClasses as checkBoxGroupClasses }; export type HvCheckBoxGroupClasses = ExtractNames; -export interface HvCheckBoxGroupProps - extends HvBaseProps { +export interface HvCheckBoxGroupProps extends HvBaseProps< + HTMLDivElement, + "onChange" +> { /** * The form element name. * diff --git a/packages/core/src/ColorPicker/ColorPicker.stories.tsx b/packages/core/src/ColorPicker/ColorPicker.stories.tsx index 4dfe548858..426477a08b 100644 --- a/packages/core/src/ColorPicker/ColorPicker.stories.tsx +++ b/packages/core/src/ColorPicker/ColorPicker.stories.tsx @@ -2,8 +2,8 @@ import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvColorPicker, - HvColorPickerProps, HvTypography, + type HvColorPickerProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/ColorPicker/ColorPicker.tsx b/packages/core/src/ColorPicker/ColorPicker.tsx index b825d8f261..cc2d50fedc 100644 --- a/packages/core/src/ColorPicker/ColorPicker.tsx +++ b/packages/core/src/ColorPicker/ColorPicker.tsx @@ -3,10 +3,10 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; import { HvBaseDropdown } from "../BaseDropdown"; -import { HvDropdownProps } from "../Dropdown"; +import type { HvDropdownProps } from "../Dropdown"; import { HvFormElement } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; diff --git a/packages/core/src/ColorPicker/PresetColors/PresetColors.tsx b/packages/core/src/ColorPicker/PresetColors/PresetColors.tsx index 14da94aaa2..1d619c70ba 100644 --- a/packages/core/src/ColorPicker/PresetColors/PresetColors.tsx +++ b/packages/core/src/ColorPicker/PresetColors/PresetColors.tsx @@ -2,7 +2,7 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny } from "@hitachivantara/uikit-styles"; +import { getColor, type HvColorAny } from "@hitachivantara/uikit-styles"; import { HvTypography } from "../../Typography"; import { Swatch } from "../Swatch"; diff --git a/packages/core/src/ColorPicker/Swatch.tsx b/packages/core/src/ColorPicker/Swatch.tsx index dd02acdbac..b7d50d84da 100644 --- a/packages/core/src/ColorPicker/Swatch.tsx +++ b/packages/core/src/ColorPicker/Swatch.tsx @@ -1,12 +1,12 @@ import { createClasses, - ExtractNames, mergeStyles, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-utils"; import { theme } from "@hitachivantara/uikit-styles"; -import { HvButtonBase, HvButtonBaseProps } from "../ButtonBase"; +import { HvButtonBase, type HvButtonBaseProps } from "../ButtonBase"; const { useClasses } = createClasses("HvColorPickerSwatch", { root: { diff --git a/packages/core/src/Container/Container.stories.tsx b/packages/core/src/Container/Container.stories.tsx index 72d106a2d3..69e58bc7cf 100644 --- a/packages/core/src/Container/Container.stories.tsx +++ b/packages/core/src/Container/Container.stories.tsx @@ -2,10 +2,10 @@ import { css } from "@emotion/css"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvContainer, - HvContainerProps, HvTypography, theme, useWidth, + type HvContainerProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Container/Container.tsx b/packages/core/src/Container/Container.tsx index 6d922ac48e..187256116d 100644 --- a/packages/core/src/Container/Container.tsx +++ b/packages/core/src/Container/Container.tsx @@ -1,6 +1,6 @@ import { forwardRef } from "react"; import MuiContainer, { - ContainerProps as MuiContainerProps, + type ContainerProps as MuiContainerProps, } from "@mui/material/Container"; import { useTheme } from "@mui/material/styles"; import useMediaQuery from "@mui/material/useMediaQuery"; diff --git a/packages/core/src/Controls/Controls.tsx b/packages/core/src/Controls/Controls.tsx index 61ab0ab0f6..aac0c8fc9c 100644 --- a/packages/core/src/Controls/Controls.tsx +++ b/packages/core/src/Controls/Controls.tsx @@ -8,7 +8,7 @@ import { HvButton } from "../Button"; import { useControlled } from "../hooks/useControlled"; import { HvMultiButton } from "../MultiButton"; import type { HvTableInstance } from "../Table/hooks/useHvTable"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvControlsContextProvider } from "./context/ControlsContext"; import { staticClasses, useClasses } from "./Controls.styles"; diff --git a/packages/core/src/Controls/LeftControl/LeftControl.tsx b/packages/core/src/Controls/LeftControl/LeftControl.tsx index eb6c759056..dfece13c35 100644 --- a/packages/core/src/Controls/LeftControl/LeftControl.tsx +++ b/packages/core/src/Controls/LeftControl/LeftControl.tsx @@ -1,8 +1,8 @@ import { useContext } from "react"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvInput, HvInputProps } from "../../Input"; -import { HvBaseProps } from "../../types/generic"; +import { HvInput, type HvInputProps } from "../../Input"; +import type { HvBaseProps } from "../../types/generic"; import { HvControlsContext } from "../context/ControlsContext"; import { staticClasses, useClasses } from "./LeftControl.styles"; diff --git a/packages/core/src/Controls/RightControl/RightControl.tsx b/packages/core/src/Controls/RightControl/RightControl.tsx index 88a00c41dc..47d323bd8e 100644 --- a/packages/core/src/Controls/RightControl/RightControl.tsx +++ b/packages/core/src/Controls/RightControl/RightControl.tsx @@ -1,9 +1,9 @@ import { useContext, useState } from "react"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvDropdown, HvDropdownProps } from "../../Dropdown"; -import { HvListValue } from "../../List"; -import { HvBaseProps } from "../../types/generic"; +import { HvDropdown, type HvDropdownProps } from "../../Dropdown"; +import type { HvListValue } from "../../List"; +import type { HvBaseProps } from "../../types/generic"; import { HvControlsContext } from "../context/ControlsContext"; import { staticClasses, useClasses } from "./RightControl.styles"; diff --git a/packages/core/src/Controls/stories/Controls.tsx b/packages/core/src/Controls/stories/Controls.tsx index 34eeb31254..828e5ff333 100644 --- a/packages/core/src/Controls/stories/Controls.tsx +++ b/packages/core/src/Controls/stories/Controls.tsx @@ -4,18 +4,18 @@ import { HvCardContent, HvCardHeader, HvControls, - HvControlsViewConfiguration, HvLeftControl, HvListContainer, HvListItem, HvPanel, HvRightControl, - HvRightListControls, HvSimpleGrid, - HvTableColumnConfig, useHvGlobalFilter, useHvSortBy, useHvTable, + type HvControlsViewConfiguration, + type HvRightListControls, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { Cards, List } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/DatePicker/DatePicker.stories.tsx b/packages/core/src/DatePicker/DatePicker.stories.tsx index d86ea58c68..bbfde9ea7b 100644 --- a/packages/core/src/DatePicker/DatePicker.stories.tsx +++ b/packages/core/src/DatePicker/DatePicker.stories.tsx @@ -1,16 +1,16 @@ import { useState } from "react"; -import { Decorator, Meta, StoryObj } from "@storybook/react-vite"; +import type { Decorator, Meta, StoryObj } from "@storybook/react-vite"; import { expect } from "storybook/test"; import { setupChromatic } from "@hitachivantara/internal"; import { HvCalendar, HvDatePicker, - HvDatePickerProps, HvListContainer, HvListItem, HvPanel, HvRadio, HvRadioGroup, + type HvDatePickerProps, } from "@hitachivantara/uikit-react-core"; const containerDecorator: Decorator = (Story) => ( diff --git a/packages/core/src/DatePicker/DatePicker.tsx b/packages/core/src/DatePicker/DatePicker.tsx index 334b5363f6..0bf054849f 100644 --- a/packages/core/src/DatePicker/DatePicker.tsx +++ b/packages/core/src/DatePicker/DatePicker.tsx @@ -6,16 +6,16 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvActionBar } from "../ActionBar"; -import { HvBaseDropdown, HvBaseDropdownProps } from "../BaseDropdown"; +import { HvBaseDropdown, type HvBaseDropdownProps } from "../BaseDropdown"; import { HvButton } from "../Button"; -import { HvCalendar, HvCalendarProps } from "../Calendar"; +import { HvCalendar, type HvCalendarProps } from "../Calendar"; import { DEFAULT_LOCALE, isDate } from "../Calendar/utils"; import { HvFormElement, - HvFormElementProps, - HvFormStatus, HvWarningText, isInvalid, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; @@ -44,7 +44,8 @@ const DEFAULT_LABELS = { }; export interface HvDatePickerProps - extends Omit, + extends + Omit, Pick< HvBaseDropdownProps, | "disablePortal" diff --git a/packages/core/src/DatePicker/useVisibleDate.tsx b/packages/core/src/DatePicker/useVisibleDate.tsx index 313af5840e..c32dd848ae 100644 --- a/packages/core/src/DatePicker/useVisibleDate.tsx +++ b/packages/core/src/DatePicker/useVisibleDate.tsx @@ -1,6 +1,6 @@ -import { Reducer, useReducer } from "react"; +import { useReducer, type Reducer } from "react"; -import { VisibilitySelectorActions } from "../Calendar"; +import type { VisibilitySelectorActions } from "../Calendar"; import { validateDate } from "./utils"; function stateToLeftRight({ diff --git a/packages/core/src/Dialog/Actions/Actions.tsx b/packages/core/src/Dialog/Actions/Actions.tsx index a861f989bb..99b0aec2cd 100644 --- a/packages/core/src/Dialog/Actions/Actions.tsx +++ b/packages/core/src/Dialog/Actions/Actions.tsx @@ -1,5 +1,5 @@ import MuiDialogActions, { - DialogActionsProps as MuiDialogActionsProps, + type DialogActionsProps as MuiDialogActionsProps, } from "@mui/material/DialogActions"; import { useDefaultProps, @@ -13,8 +13,10 @@ export { staticClasses as dialogActionClasses }; export type HvDialogActionClasses = ExtractNames; -export interface HvDialogActionsProps - extends Omit { +export interface HvDialogActionsProps extends Omit< + MuiDialogActionsProps, + "classes" +> { /** A Jss Object used to override or extend the styles applied to the component. */ classes?: HvDialogActionClasses; } diff --git a/packages/core/src/Dialog/Content/Content.tsx b/packages/core/src/Dialog/Content/Content.tsx index 4cbe46b5c2..3e4b680670 100644 --- a/packages/core/src/Dialog/Content/Content.tsx +++ b/packages/core/src/Dialog/Content/Content.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { useResizeDetector } from "react-resize-detector"; import MuiDialogContent, { - DialogContentProps as MuiDialogContentProps, + type DialogContentProps as MuiDialogContentProps, } from "@mui/material/DialogContent"; import { useDefaultProps, @@ -15,8 +15,10 @@ export { staticClasses as dialogContentClasses }; export type HvDialogContentClasses = ExtractNames; -export interface HvDialogContentProps - extends Omit { +export interface HvDialogContentProps extends Omit< + MuiDialogContentProps, + "classes" +> { /** Content should be indented in relationship to the Dialog title. */ indentContent?: boolean; /** A Jss Object used to override or extend the styles applied to the component. */ diff --git a/packages/core/src/Dialog/Dialog.stories.tsx b/packages/core/src/Dialog/Dialog.stories.tsx index 92cb4785b5..c5786dd9b3 100644 --- a/packages/core/src/Dialog/Dialog.stories.tsx +++ b/packages/core/src/Dialog/Dialog.stories.tsx @@ -6,8 +6,8 @@ import { HvDialog, HvDialogActions, HvDialogContent, - HvDialogProps, HvDialogTitle, + type HvDialogProps, } from "@hitachivantara/uikit-react-core"; import { FormStory } from "./stories/FormStory"; diff --git a/packages/core/src/Dialog/Dialog.tsx b/packages/core/src/Dialog/Dialog.tsx index 0f72c33388..2a6445f1cb 100644 --- a/packages/core/src/Dialog/Dialog.tsx +++ b/packages/core/src/Dialog/Dialog.tsx @@ -1,5 +1,7 @@ import { forwardRef, useMemo } from "react"; -import MuiDialog, { DialogProps as MuiDialogProps } from "@mui/material/Dialog"; +import MuiDialog, { + type DialogProps as MuiDialogProps, +} from "@mui/material/Dialog"; import { useDefaultProps, useTheme, @@ -16,8 +18,10 @@ export { staticClasses as dialogClasses }; export type HvDialogClasses = ExtractNames; -export interface HvDialogProps - extends Omit { +export interface HvDialogProps extends Omit< + MuiDialogProps, + "classes" | "open" +> { /** Current state of the Dialog. */ open?: boolean; /** Callback fired when the component requests to be closed. */ diff --git a/packages/core/src/Dialog/Title/Title.tsx b/packages/core/src/Dialog/Title/Title.tsx index 8feb3ea464..2e8b0e4bec 100644 --- a/packages/core/src/Dialog/Title/Title.tsx +++ b/packages/core/src/Dialog/Title/Title.tsx @@ -1,5 +1,5 @@ import MuiDialogTitle, { - DialogTitleProps as MuiDialogTitleProps, + type DialogTitleProps as MuiDialogTitleProps, } from "@mui/material/DialogTitle"; import { useDefaultProps, @@ -22,8 +22,10 @@ export type HvDialogTitleVariant = | "info" | "default"; -export interface HvDialogTitleProps - extends Omit { +export interface HvDialogTitleProps extends Omit< + MuiDialogTitleProps, + "variant" | "classes" +> { /** Variant of the dialog title. */ variant?: HvDialogTitleVariant; /** Controls if the associated icon to the variant should be shown. */ diff --git a/packages/core/src/Dialog/stories/MainStory.tsx b/packages/core/src/Dialog/stories/MainStory.tsx index 2e8c8e4cb5..3f7102cbc0 100644 --- a/packages/core/src/Dialog/stories/MainStory.tsx +++ b/packages/core/src/Dialog/stories/MainStory.tsx @@ -4,8 +4,8 @@ import { HvDialog, HvDialogActions, HvDialogContent, - HvDialogProps, HvDialogTitle, + type HvDialogProps, } from "@hitachivantara/uikit-react-core"; export const MainStory = (props: HvDialogProps) => { diff --git a/packages/core/src/Dialog/stories/SemanticVariantsStory.tsx b/packages/core/src/Dialog/stories/SemanticVariantsStory.tsx index a7673bca5f..24b20a541a 100644 --- a/packages/core/src/Dialog/stories/SemanticVariantsStory.tsx +++ b/packages/core/src/Dialog/stories/SemanticVariantsStory.tsx @@ -1,13 +1,13 @@ import { useState } from "react"; import { HvButton, - HvButtonVariant, HvDialog, HvDialogActions, HvDialogContent, - HvDialogProps, HvDialogTitle, HvStatusIcon, + type HvButtonVariant, + type HvDialogProps, } from "@hitachivantara/uikit-react-core"; type SimpleDialogProps = Pick & { diff --git a/packages/core/src/DotPagination/DotPagination.stories.tsx b/packages/core/src/DotPagination/DotPagination.stories.tsx index 1101be4c29..978f6385e9 100644 --- a/packages/core/src/DotPagination/DotPagination.stories.tsx +++ b/packages/core/src/DotPagination/DotPagination.stories.tsx @@ -2,8 +2,8 @@ import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvDotPagination, - HvDotPaginationProps, HvTypography, + type HvDotPaginationProps, } from "@hitachivantara/uikit-react-core"; import { CurrentStep, diff --git a/packages/core/src/DotPagination/DotPagination.tsx b/packages/core/src/DotPagination/DotPagination.tsx index f4606b2886..f83db172f4 100644 --- a/packages/core/src/DotPagination/DotPagination.tsx +++ b/packages/core/src/DotPagination/DotPagination.tsx @@ -5,7 +5,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvBaseRadio } from "../BaseRadio"; -import { HvRadioGroup, HvRadioGroupProps } from "../RadioGroup"; +import { HvRadioGroup, type HvRadioGroupProps } from "../RadioGroup"; import { range } from "../utils/helpers"; import { staticClasses, useClasses } from "./DotPagination.styles"; @@ -25,8 +25,10 @@ export { staticClasses as dotPaginationClasses }; export type HvDotPaginationClasses = ExtractNames; -export interface HvDotPaginationProps - extends Omit { +export interface HvDotPaginationProps extends Omit< + HvRadioGroupProps, + "classes" +> { /** * Icon to override the default one used for the unselected state. * diff --git a/packages/core/src/Drawer/Drawer.stories.tsx b/packages/core/src/Drawer/Drawer.stories.tsx index e3e55b8062..860d4814fb 100644 --- a/packages/core/src/Drawer/Drawer.stories.tsx +++ b/packages/core/src/Drawer/Drawer.stories.tsx @@ -9,9 +9,9 @@ import { HvDialogContent, HvDialogTitle, HvDrawer, - HvDrawerProps, HvGlobalActions, HvTypography, + type HvDrawerProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Drawer/Drawer.tsx b/packages/core/src/Drawer/Drawer.tsx index 976a96e342..0d8a86f917 100644 --- a/packages/core/src/Drawer/Drawer.tsx +++ b/packages/core/src/Drawer/Drawer.tsx @@ -1,5 +1,7 @@ import { forwardRef } from "react"; -import MuiDrawer, { DrawerProps as MuiDrawerProps } from "@mui/material/Drawer"; +import MuiDrawer, { + type DrawerProps as MuiDrawerProps, +} from "@mui/material/Drawer"; import { useDefaultProps, type ExtractNames, diff --git a/packages/core/src/DropDownMenu/DropDownMenu.stories.tsx b/packages/core/src/DropDownMenu/DropDownMenu.stories.tsx index 768e2fa75b..de706c3ba2 100644 --- a/packages/core/src/DropDownMenu/DropDownMenu.stories.tsx +++ b/packages/core/src/DropDownMenu/DropDownMenu.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvDropDownMenu, - HvDropDownMenuProps, + type HvDropDownMenuProps, } from "@hitachivantara/uikit-react-core"; export default { diff --git a/packages/core/src/DropDownMenu/DropDownMenu.test.tsx b/packages/core/src/DropDownMenu/DropDownMenu.test.tsx index 59e502bfd9..35f3199500 100644 --- a/packages/core/src/DropDownMenu/DropDownMenu.test.tsx +++ b/packages/core/src/DropDownMenu/DropDownMenu.test.tsx @@ -3,7 +3,7 @@ import userEvent from "@testing-library/user-event"; import { describe, expect, it } from "vitest"; import { HvDropDownMenu } from "."; -import { HvListValue } from "../List"; +import type { HvListValue } from "../List"; const dataList: HvListValue[] = [ { id: "item1", label: "item1" }, diff --git a/packages/core/src/DropDownMenu/DropDownMenu.tsx b/packages/core/src/DropDownMenu/DropDownMenu.tsx index 8df340191d..db6d63dfe2 100644 --- a/packages/core/src/DropDownMenu/DropDownMenu.tsx +++ b/packages/core/src/DropDownMenu/DropDownMenu.tsx @@ -4,17 +4,20 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvSize } from "@hitachivantara/uikit-styles"; +import type { HvSize } from "@hitachivantara/uikit-styles"; import { HvBaseDropdown } from "../BaseDropdown"; -import { HvButtonVariant } from "../Button"; -import { HvDropdownButton, HvDropdownButtonProps } from "../DropdownButton"; +import type { HvButtonVariant } from "../Button"; +import { + HvDropdownButton, + type HvDropdownButtonProps, +} from "../DropdownButton"; import { useControlled } from "../hooks/useControlled"; import { useLabels } from "../hooks/useLabels"; import { useUniqueId } from "../hooks/useUniqueId"; import { HvIcon } from "../icons"; -import { HvList, HvListProps, HvListValue } from "../List"; -import { HvBaseProps } from "../types/generic"; +import { HvList, type HvListProps, type HvListValue } from "../List"; +import type { HvBaseProps } from "../types/generic"; import { getPrevNextFocus } from "../utils/focusableElementFinder"; import { isKey } from "../utils/keyboardUtils"; import { staticClasses, useClasses } from "./DropDownMenu.styles"; @@ -27,8 +30,10 @@ const DEFAULT_LABELS = { dropdownMenu: "Dropdown menu", }; -export interface HvDropDownMenuProps - extends HvBaseProps { +export interface HvDropDownMenuProps extends HvBaseProps< + HTMLDivElement, + "onClick" | "onToggle" +> { /** Icon. */ icon?: React.ReactElement; /** diff --git a/packages/core/src/Dropdown/Dropdown.stories.tsx b/packages/core/src/Dropdown/Dropdown.stories.tsx index dc37b7dc2c..79c06c4f8d 100644 --- a/packages/core/src/Dropdown/Dropdown.stories.tsx +++ b/packages/core/src/Dropdown/Dropdown.stories.tsx @@ -3,7 +3,7 @@ import { expect, within } from "storybook/test"; import { HvBaseDropdown, HvDropdown, - HvDropdownProps, + type HvDropdownProps, } from "@hitachivantara/uikit-react-core"; export default { diff --git a/packages/core/src/Dropdown/Dropdown.tsx b/packages/core/src/Dropdown/Dropdown.tsx index 7b4cc963cd..93e3a9ebff 100644 --- a/packages/core/src/Dropdown/Dropdown.tsx +++ b/packages/core/src/Dropdown/Dropdown.tsx @@ -5,25 +5,25 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseDropdown, HvBaseDropdownProps } from "../BaseDropdown"; +import { HvBaseDropdown, type HvBaseDropdownProps } from "../BaseDropdown"; import { HvFormElement, - HvFormElementProps, - HvFormStatus, HvWarningText, isInvalid, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; import { useLabels } from "../hooks/useLabels"; import { useUniqueId } from "../hooks/useUniqueId"; -import { HvListValue } from "../List"; +import type { HvListValue } from "../List"; import { fixedForwardRef } from "../types/generic"; import { HvTypography } from "../Typography"; import { CounterLabel } from "../utils/CounterLabel"; import { setId } from "../utils/setId"; import { staticClasses, useClasses } from "./Dropdown.styles"; -import { HvDropdownList, HvDropdownListProps } from "./List"; +import { HvDropdownList, type HvDropdownListProps } from "./List"; import { getSelected, getSelectionLabel } from "./utils"; export { staticClasses as dropdownClasses }; @@ -36,7 +36,9 @@ export interface HvDropdownProps< // TODO: make default `false` in v6 Multiple extends boolean = boolean, OptionValue extends HvListValue = HvListValue, -> extends Omit, +> + extends + Omit, Pick< HvBaseDropdownProps, | "placement" diff --git a/packages/core/src/Dropdown/List/List.tsx b/packages/core/src/Dropdown/List/List.tsx index 3056d42272..d02636fd34 100644 --- a/packages/core/src/Dropdown/List/List.tsx +++ b/packages/core/src/Dropdown/List/List.tsx @@ -10,7 +10,7 @@ import { HvActionBar } from "../../ActionBar"; import { HvButton } from "../../Button"; import { HvCheckBox } from "../../CheckBox"; import { HvInput } from "../../Input"; -import { HvList, HvListProps, HvListValue } from "../../List"; +import { HvList, type HvListProps, type HvListValue } from "../../List"; import { CounterLabel } from "../../utils/CounterLabel"; import type { HvDropdownLabels } from "../Dropdown"; import { getSelected } from "../utils"; diff --git a/packages/core/src/Dropdown/utils.tsx b/packages/core/src/Dropdown/utils.tsx index 77b3e185e0..08c0ee170d 100644 --- a/packages/core/src/Dropdown/utils.tsx +++ b/packages/core/src/Dropdown/utils.tsx @@ -1,4 +1,4 @@ -import { HvListValue } from "../List"; +import type { HvListValue } from "../List"; import type { HvDropdownLabels } from "./Dropdown"; /** Filter selected elements. */ diff --git a/packages/core/src/DropdownButton/DropdownButton.tsx b/packages/core/src/DropdownButton/DropdownButton.tsx index ae47d8a055..b1a8dd6286 100644 --- a/packages/core/src/DropdownButton/DropdownButton.tsx +++ b/packages/core/src/DropdownButton/DropdownButton.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../Button"; +import { HvButton, type HvButtonProps } from "../Button"; import { HvIcon } from "../icons"; import { staticClasses, useClasses } from "./DropdownButton.styles"; @@ -12,8 +12,10 @@ export { staticClasses as dropdownButtonClasses }; export type HvDropdownButtonClasses = ExtractNames; -export interface HvDropdownButtonProps - extends Omit { +export interface HvDropdownButtonProps extends Omit< + HvButtonProps, + "startAdornment" | "endAdornment" | "classes" +> { /** Whether the button is in read only mode when used as a form element. */ readOnly?: boolean; /** Whether the content triggered by the button is opened or not. */ diff --git a/packages/core/src/EmptyState/EmptyState.stories.tsx b/packages/core/src/EmptyState/EmptyState.stories.tsx index 95fc05af76..519a0619a4 100644 --- a/packages/core/src/EmptyState/EmptyState.stories.tsx +++ b/packages/core/src/EmptyState/EmptyState.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvEmptyState, - HvEmptyStateProps, HvTypography, + type HvEmptyStateProps, } from "@hitachivantara/uikit-react-core"; import { BarChart, Info } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/EmptyState/EmptyState.tsx b/packages/core/src/EmptyState/EmptyState.tsx index 6f95c195b5..bbd660a566 100644 --- a/packages/core/src/EmptyState/EmptyState.tsx +++ b/packages/core/src/EmptyState/EmptyState.tsx @@ -7,16 +7,18 @@ import { } from "@hitachivantara/uikit-react-utils"; import { theme } from "@hitachivantara/uikit-styles"; -import { HvBaseProps } from "../types/generic"; -import { HvTypography, HvTypographyProps } from "../Typography"; +import type { HvBaseProps } from "../types/generic"; +import { HvTypography, type HvTypographyProps } from "../Typography"; import { staticClasses, useClasses } from "./EmptyState.styles"; export { staticClasses as emptyStateClasses }; export type HvEmptyStateClasses = ExtractNames; -export interface HvEmptyStateProps - extends HvBaseProps { +export interface HvEmptyStateProps extends HvBaseProps< + HTMLDivElement, + "title" +> { /** Icon to be presented. */ icon: React.ReactNode; /** The title to be shown. */ diff --git a/packages/core/src/FileUploader/DropZone/DropZone.tsx b/packages/core/src/FileUploader/DropZone/DropZone.tsx index 70ecaf6047..d65ea99952 100644 --- a/packages/core/src/FileUploader/DropZone/DropZone.tsx +++ b/packages/core/src/FileUploader/DropZone/DropZone.tsx @@ -4,14 +4,17 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvFormElementContext, HvFormElementProps } from "../../FormElement"; +import { + HvFormElementContext, + type HvFormElementProps, +} from "../../FormElement"; import { HvLabelContainer } from "../../FormElement/LabelContainer"; import { useLabels } from "../../hooks/useLabels"; import { useUniqueId } from "../../hooks/useUniqueId"; import { HvIcon } from "../../icons"; import { uniqueId } from "../../utils/helpers"; import { setId } from "../../utils/setId"; -import { HvFileData, HvFilesAddedEvent } from "../File"; +import type { HvFileData, HvFilesAddedEvent } from "../File"; import { convertUnits } from "../utils"; import { staticClasses, useClasses } from "./DropZone.styles"; @@ -40,8 +43,10 @@ const DEFAULT_LABELS = { export type HvDropZoneLabels = Partial; -export interface HvDropZoneProps - extends Pick { +export interface HvDropZoneProps extends Pick< + HvFormElementProps, + "id" | "disabled" | "label" +> { /** * Labels to present in FileUploader. */ diff --git a/packages/core/src/FileUploader/File/File.test.tsx b/packages/core/src/FileUploader/File/File.test.tsx index 7b66866fe7..9f0a432370 100644 --- a/packages/core/src/FileUploader/File/File.test.tsx +++ b/packages/core/src/FileUploader/File/File.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvFile, HvFileData, HvFileProps } from "./File"; +import { HvFile, type HvFileData, type HvFileProps } from "./File"; const dataFail: HvFileData = { name: "somefile.png", diff --git a/packages/core/src/FileUploader/FileList/FileList.test.tsx b/packages/core/src/FileUploader/FileList/FileList.test.tsx index 32ba6ae97f..438102b52a 100644 --- a/packages/core/src/FileUploader/FileList/FileList.test.tsx +++ b/packages/core/src/FileUploader/FileList/FileList.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; -import { HvFileData } from "../File"; +import type { HvFileData } from "../File"; import { HvFileList } from "./FileList"; const Main = () => ( diff --git a/packages/core/src/FileUploader/FileList/FileList.tsx b/packages/core/src/FileUploader/FileList/FileList.tsx index d53dae7f50..a635f9516c 100644 --- a/packages/core/src/FileUploader/FileList/FileList.tsx +++ b/packages/core/src/FileUploader/FileList/FileList.tsx @@ -3,7 +3,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvFile, HvFileData, HvFileRemovedEvent } from "../File"; +import { HvFile, type HvFileData, type HvFileRemovedEvent } from "../File"; import { staticClasses, useClasses } from "./FileList.styles"; export { staticClasses as fileListClasses }; diff --git a/packages/core/src/FileUploader/FileUploader.stories.tsx b/packages/core/src/FileUploader/FileUploader.stories.tsx index 178691e3d8..7a8fb73d4a 100644 --- a/packages/core/src/FileUploader/FileUploader.stories.tsx +++ b/packages/core/src/FileUploader/FileUploader.stories.tsx @@ -4,10 +4,10 @@ import { HvDialog, HvDialogContent, HvDialogTitle, - HvFileData, HvFileUploader, HvFileUploaderPreview, - HvFileUploaderProps, + type HvFileData, + type HvFileUploaderProps, } from "@hitachivantara/uikit-react-core"; import { Code, DocWord } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/FileUploader/FileUploader.test.tsx b/packages/core/src/FileUploader/FileUploader.test.tsx index d4db69c25e..f6691181aa 100644 --- a/packages/core/src/FileUploader/FileUploader.test.tsx +++ b/packages/core/src/FileUploader/FileUploader.test.tsx @@ -3,8 +3,8 @@ import { fireEvent, render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvFileData } from "./File"; -import { HvFileUploader, HvFileUploaderProps } from "./FileUploader"; +import type { HvFileData } from "./File"; +import { HvFileUploader, type HvFileUploaderProps } from "./FileUploader"; const fileList = [ { id: "1", name: "Screenshot1.png", size: 14100000, type: "image/png" }, diff --git a/packages/core/src/FileUploader/FileUploader.tsx b/packages/core/src/FileUploader/FileUploader.tsx index 7ab3fd3f75..91e0571a09 100644 --- a/packages/core/src/FileUploader/FileUploader.tsx +++ b/packages/core/src/FileUploader/FileUploader.tsx @@ -1,12 +1,16 @@ import { - ExtractNames, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvFormElement, HvFormElementProps } from "../FormElement"; +import { HvFormElement, type HvFormElementProps } from "../FormElement"; import { useLabels } from "../hooks/useLabels"; -import { HvDropZone, HvDropZoneLabels, HvDropZoneProps } from "./DropZone"; -import { HvFileData, HvFileRemovedEvent, HvFilesAddedEvent } from "./File"; +import { + HvDropZone, + type HvDropZoneLabels, + type HvDropZoneProps, +} from "./DropZone"; +import type { HvFileData, HvFileRemovedEvent, HvFilesAddedEvent } from "./File"; import { HvFileList } from "./FileList"; import { staticClasses, useClasses } from "./FileUploader.styles"; diff --git a/packages/core/src/FileUploader/Preview/Preview.tsx b/packages/core/src/FileUploader/Preview/Preview.tsx index 0ea7f5a08a..4b1d3aa803 100644 --- a/packages/core/src/FileUploader/Preview/Preview.tsx +++ b/packages/core/src/FileUploader/Preview/Preview.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../../Button"; +import { HvButton, type HvButtonProps } from "../../Button"; import { EyeIcon } from "../../Input/icons"; import { staticClasses, useClasses } from "./Preview.styles"; @@ -12,8 +12,10 @@ export { staticClasses as fileUploaderPreviewClasses }; export type HvFileUploaderPreviewClasses = ExtractNames; -export interface HvFileUploaderPreviewProps - extends Omit { +export interface HvFileUploaderPreviewProps extends Omit< + HvButtonProps, + "children" | "classes" +> { /** * Content that represents the preview of an uploaded file. */ diff --git a/packages/core/src/FileUploader/stories/simulators.ts b/packages/core/src/FileUploader/stories/simulators.ts index 8c75bcfbde..eb0addbeeb 100644 --- a/packages/core/src/FileUploader/stories/simulators.ts +++ b/packages/core/src/FileUploader/stories/simulators.ts @@ -1,4 +1,4 @@ -import { HvFileData } from "../File"; +import type { HvFileData } from "../File"; const uploadHandlers = new Map(); diff --git a/packages/core/src/FilterGroup/Counter/Counter.tsx b/packages/core/src/FilterGroup/Counter/Counter.tsx index 4048740fb6..26d062188d 100644 --- a/packages/core/src/FilterGroup/Counter/Counter.tsx +++ b/packages/core/src/FilterGroup/Counter/Counter.tsx @@ -5,7 +5,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvFilterGroupContext } from "../FilterGroupContext"; -import { HvFilterGroupFilters, HvFilterGroupValue } from "../types"; +import type { HvFilterGroupFilters, HvFilterGroupValue } from "../types"; import { staticClasses, useClasses } from "./Counter.styles"; export { staticClasses as filterGroupCounterClasses }; diff --git a/packages/core/src/FilterGroup/FilterContent/FilterContent.tsx b/packages/core/src/FilterGroup/FilterContent/FilterContent.tsx index 23919dfc8d..c961c9526c 100644 --- a/packages/core/src/FilterGroup/FilterContent/FilterContent.tsx +++ b/packages/core/src/FilterGroup/FilterContent/FilterContent.tsx @@ -6,9 +6,9 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvActionBar } from "../../ActionBar"; -import { HvBaseDropdown, HvBaseDropdownProps } from "../../BaseDropdown"; +import { HvBaseDropdown, type HvBaseDropdownProps } from "../../BaseDropdown"; import { HvButton } from "../../Button"; -import { HvFormStatus } from "../../FormElement"; +import type { HvFormStatus } from "../../FormElement"; import { HvIcon } from "../../icons"; import { HvTypography } from "../../Typography"; import { setId } from "../../utils/setId"; @@ -17,7 +17,10 @@ import type { HvFilterGroupLabels } from "../FilterGroup"; import { HvFilterGroupContext } from "../FilterGroupContext"; import { HvFilterGroupLeftPanel } from "../LeftPanel"; import { HvFilterGroupRightPanel } from "../RightPanel"; -import { HvFilterGroupHorizontalPlacement, HvFilterGroupValue } from "../types"; +import type { + HvFilterGroupHorizontalPlacement, + HvFilterGroupValue, +} from "../types"; import { staticClasses, useClasses } from "./FilterContent.styles"; import { HvHeaderButton } from "./HeaderButton"; @@ -25,8 +28,10 @@ export { staticClasses as filterGroupContentClasses }; export type HvFilterGroupContentClasses = ExtractNames; -export interface HvFilterGroupContentProps - extends Omit { +export interface HvFilterGroupContentProps extends Omit< + HvBaseDropdownProps, + "onChange" +> { description?: React.ReactNode; status?: HvFormStatus; onChange?: ( diff --git a/packages/core/src/FilterGroup/FilterContent/HeaderButton.tsx b/packages/core/src/FilterGroup/FilterContent/HeaderButton.tsx index 0ec4c4386f..1f60006828 100644 --- a/packages/core/src/FilterGroup/FilterContent/HeaderButton.tsx +++ b/packages/core/src/FilterGroup/FilterContent/HeaderButton.tsx @@ -1,13 +1,13 @@ import { forwardRef } from "react"; import { createClasses, - ExtractNames, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-utils"; import { theme } from "@hitachivantara/uikit-styles"; import { HvBadge } from "../../Badge"; -import { HvButton, HvButtonProps } from "../../Button"; +import { HvButton, type HvButtonProps } from "../../Button"; import { HvIconButton } from "../../IconButton"; import { HvIcon } from "../../icons"; import { HvTypography } from "../../Typography"; diff --git a/packages/core/src/FilterGroup/FilterGroup.stories.tsx b/packages/core/src/FilterGroup/FilterGroup.stories.tsx index b9a1752a5d..7d099d6ef6 100644 --- a/packages/core/src/FilterGroup/FilterGroup.stories.tsx +++ b/packages/core/src/FilterGroup/FilterGroup.stories.tsx @@ -1,11 +1,11 @@ import { useState } from "react"; -import { Decorator, Meta, StoryObj } from "@storybook/react-vite"; +import type { Decorator, Meta, StoryObj } from "@storybook/react-vite"; import { expect } from "storybook/test"; import { setupChromatic } from "@hitachivantara/internal"; import { HvFilterGroup, - HvFilterGroupProps, - HvFilterGroupValue, + type HvFilterGroupProps, + type HvFilterGroupValue, } from "@hitachivantara/uikit-react-core"; import { EmptyFilters as EmptyFiltersStory } from "./stories/EmptyFilters"; diff --git a/packages/core/src/FilterGroup/FilterGroup.test.tsx b/packages/core/src/FilterGroup/FilterGroup.test.tsx index f84a3306f2..acaf1623a6 100644 --- a/packages/core/src/FilterGroup/FilterGroup.test.tsx +++ b/packages/core/src/FilterGroup/FilterGroup.test.tsx @@ -3,8 +3,8 @@ import { render, screen, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it } from "vitest"; -import { HvFilterGroup, HvFilterGroupProps } from "./FilterGroup"; -import { HvFilterGroupValue } from "./types"; +import { HvFilterGroup, type HvFilterGroupProps } from "./FilterGroup"; +import type { HvFilterGroupValue } from "./types"; const filters: HvFilterGroupProps["filters"] = [ { diff --git a/packages/core/src/FilterGroup/FilterGroup.tsx b/packages/core/src/FilterGroup/FilterGroup.tsx index d68fab5768..8bd2267209 100644 --- a/packages/core/src/FilterGroup/FilterGroup.tsx +++ b/packages/core/src/FilterGroup/FilterGroup.tsx @@ -6,9 +6,9 @@ import { import { HvFormElement, - HvFormElementProps, - HvFormStatus, HvWarningText, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; @@ -17,11 +17,11 @@ import { useUniqueId } from "../hooks/useUniqueId"; import { setId } from "../utils/setId"; import { HvFilterGroupContent, - HvFilterGroupContentProps, + type HvFilterGroupContentProps, } from "./FilterContent"; import { staticClasses, useClasses } from "./FilterGroup.styles"; import { HvFilterGroupProvider } from "./FilterGroupContext"; -import { +import type { HvFilterGroupFilters, HvFilterGroupHorizontalPlacement, HvFilterGroupValue, @@ -31,11 +31,10 @@ export { staticClasses as filterGroupClasses }; export type HvFilterGroupClasses = ExtractNames; -export interface HvFilterGroupProps - extends Omit< - HvFormElementProps, - "classes" | "onChange" | "defaultValue" | "statusMessage" - > { +export interface HvFilterGroupProps extends Omit< + HvFormElementProps, + "classes" | "onChange" | "defaultValue" | "statusMessage" +> { /** The initial value of the input when in single calendar mode. */ filters: HvFilterGroupFilters; /** The form element name. */ diff --git a/packages/core/src/FilterGroup/FilterGroupContext.tsx b/packages/core/src/FilterGroup/FilterGroupContext.tsx index 93789b5810..bef624c981 100644 --- a/packages/core/src/FilterGroup/FilterGroupContext.tsx +++ b/packages/core/src/FilterGroup/FilterGroupContext.tsx @@ -1,17 +1,17 @@ import { createContext, - Dispatch, - SetStateAction, useCallback, useEffect, useMemo, useState, + type Dispatch, + type SetStateAction, } from "react"; import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; import { isEqual } from "../utils/helpers"; import { useSavedState } from "../utils/useSavedState"; -import { HvFilterGroupFilters, HvFilterGroupValue } from "./types"; +import type { HvFilterGroupFilters, HvFilterGroupValue } from "./types"; interface HvFilterGroupContextValue { activeGroup: number; diff --git a/packages/core/src/FilterGroup/RightPanel/RightPanel.tsx b/packages/core/src/FilterGroup/RightPanel/RightPanel.tsx index 544d433b6a..187260dd4b 100644 --- a/packages/core/src/FilterGroup/RightPanel/RightPanel.tsx +++ b/packages/core/src/FilterGroup/RightPanel/RightPanel.tsx @@ -3,7 +3,7 @@ import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; import { HvCheckBox } from "../../CheckBox"; import { HvInput } from "../../Input"; -import { HvList, HvListProps } from "../../List"; +import { HvList, type HvListProps } from "../../List"; import { HvPanel } from "../../Panel"; import { CounterLabel } from "../../utils/CounterLabel"; import { HvFilterGroupContext } from "../FilterGroupContext"; diff --git a/packages/core/src/FilterGroup/stories/EmptyFilters.tsx b/packages/core/src/FilterGroup/stories/EmptyFilters.tsx index c5440c018e..5148f38cd8 100644 --- a/packages/core/src/FilterGroup/stories/EmptyFilters.tsx +++ b/packages/core/src/FilterGroup/stories/EmptyFilters.tsx @@ -2,10 +2,10 @@ import { useState } from "react"; import { HvEmptyState, HvFilterGroup, - HvFilterGroupProps, HvLoading, HvSwitch, HvTypography, + type HvFilterGroupProps, } from "@hitachivantara/uikit-react-core"; import { Info } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Focus/Focus.tsx b/packages/core/src/Focus/Focus.tsx index bf5057d10a..c7e860cf1c 100644 --- a/packages/core/src/Focus/Focus.tsx +++ b/packages/core/src/Focus/Focus.tsx @@ -1,7 +1,7 @@ import { cloneElement, useRef, useState } from "react"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { isKey, isOneOfKeys } from "../utils/keyboardUtils"; import { staticClasses, useClasses } from "./Focus.styles"; import { getFocusableChildren, isBrowser, setFocusTo } from "./utils"; diff --git a/packages/core/src/Footer/Footer.stories.tsx b/packages/core/src/Footer/Footer.stories.tsx index 4c67b44170..73fb3ee828 100644 --- a/packages/core/src/Footer/Footer.stories.tsx +++ b/packages/core/src/Footer/Footer.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvFooter, - HvFooterProps, HvTypography, + type HvFooterProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Footer/Footer.tsx b/packages/core/src/Footer/Footer.tsx index 3d6a5d19bc..c2349e9e42 100644 --- a/packages/core/src/Footer/Footer.tsx +++ b/packages/core/src/Footer/Footer.tsx @@ -6,7 +6,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvTypography } from "../Typography"; import { staticClasses, useClasses } from "./Footer.styles"; diff --git a/packages/core/src/FormElement/Adornment/Adornment.stories.tsx b/packages/core/src/FormElement/Adornment/Adornment.stories.tsx index c68017f431..8e7cbadc43 100644 --- a/packages/core/src/FormElement/Adornment/Adornment.stories.tsx +++ b/packages/core/src/FormElement/Adornment/Adornment.stories.tsx @@ -3,12 +3,12 @@ import { css } from "@emotion/css"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvAdornment, - HvAdornmentProps, HvBaseInput, HvButton, HvFormElement, - HvFormStatus, HvLabel, + type HvAdornmentProps, + type HvFormStatus, } from "@hitachivantara/uikit-react-core"; import { Fail, diff --git a/packages/core/src/FormElement/Adornment/Adornment.tsx b/packages/core/src/FormElement/Adornment/Adornment.tsx index 32db8556bf..e1c6a6a5df 100644 --- a/packages/core/src/FormElement/Adornment/Adornment.tsx +++ b/packages/core/src/FormElement/Adornment/Adornment.tsx @@ -5,23 +5,22 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvButtonBase } from "../../ButtonBase"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { HvFormElementContext, HvFormElementDescriptorsContext, } from "../context"; -import { HvFormStatus } from "../FormElement"; +import type { HvFormStatus } from "../FormElement"; import { staticClasses, useClasses } from "./Adornment.styles"; export { staticClasses as adornmentClasses }; export type HvAdornmentClasses = ExtractNames; -export interface HvAdornmentProps - extends HvBaseProps< - HTMLDivElement | HTMLButtonElement, - "onMouseDown" | "onKeyDown" - > { +export interface HvAdornmentProps extends HvBaseProps< + HTMLDivElement | HTMLButtonElement, + "onMouseDown" | "onKeyDown" +> { /** The icon to be added into the input. */ icon: React.ReactNode; /** Controls the visibility of the adornment based on the form element's status. `isVisible` overrides this behavior. */ diff --git a/packages/core/src/FormElement/CharCounter/CharCounter.stories.tsx b/packages/core/src/FormElement/CharCounter/CharCounter.stories.tsx index 95e6b5528a..f6f9551633 100644 --- a/packages/core/src/FormElement/CharCounter/CharCounter.stories.tsx +++ b/packages/core/src/FormElement/CharCounter/CharCounter.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvCharCounter, - HvCharCounterProps, + type HvCharCounterProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/FormElement/CharCounter/CharCounter.tsx b/packages/core/src/FormElement/CharCounter/CharCounter.tsx index 4998321bed..32ebbedcd9 100644 --- a/packages/core/src/FormElement/CharCounter/CharCounter.tsx +++ b/packages/core/src/FormElement/CharCounter/CharCounter.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { HvTypography } from "../../Typography"; import { setId } from "../../utils/setId"; import { HvFormElementContext } from "../context"; diff --git a/packages/core/src/FormElement/FormElement.stories.tsx b/packages/core/src/FormElement/FormElement.stories.tsx index 2dbb2d1c11..54623eb596 100644 --- a/packages/core/src/FormElement/FormElement.stories.tsx +++ b/packages/core/src/FormElement/FormElement.stories.tsx @@ -3,13 +3,13 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvAdornment, HvBaseInput, - HvBaseInputProps, HvFormElement, - HvFormElementProps, - HvFormStatus, HvInfoMessage, HvLabel, HvWarningText, + type HvBaseInputProps, + type HvFormElementProps, + type HvFormStatus, } from "@hitachivantara/uikit-react-core"; import { CloseXS, Success } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/FormElement/FormElement.tsx b/packages/core/src/FormElement/FormElement.tsx index 61108e5385..026b733f26 100644 --- a/packages/core/src/FormElement/FormElement.tsx +++ b/packages/core/src/FormElement/FormElement.tsx @@ -5,7 +5,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { useUniqueId } from "../hooks/useUniqueId"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvFormElementContext, HvFormElementDescriptorsContext, @@ -22,7 +22,8 @@ export type HvFormElementClasses = ExtractNames; export type HvFormStatus = "standBy" | "valid" | "invalid" | "empty"; export interface HvFormElementProps - extends HvFormElementContextValue, + extends + HvFormElementContextValue, HvBaseProps { /** * Current value of the form element. diff --git a/packages/core/src/FormElement/InfoMessage/InfoMessage.stories.tsx b/packages/core/src/FormElement/InfoMessage/InfoMessage.stories.tsx index 5ead19f692..dc9d4c995a 100644 --- a/packages/core/src/FormElement/InfoMessage/InfoMessage.stories.tsx +++ b/packages/core/src/FormElement/InfoMessage/InfoMessage.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvInfoMessage, - HvInfoMessageProps, + type HvInfoMessageProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/FormElement/InfoMessage/InfoMessage.tsx b/packages/core/src/FormElement/InfoMessage/InfoMessage.tsx index c561f12ec8..f009dd0c52 100644 --- a/packages/core/src/FormElement/InfoMessage/InfoMessage.tsx +++ b/packages/core/src/FormElement/InfoMessage/InfoMessage.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvTypography, HvTypographyProps } from "../../Typography"; +import { HvTypography, type HvTypographyProps } from "../../Typography"; import { setId } from "../../utils/setId"; import { HvFormElementContext } from "../context"; import { staticClasses, useClasses } from "./InfoMessage.styles"; diff --git a/packages/core/src/FormElement/Label/Label.stories.tsx b/packages/core/src/FormElement/Label/Label.stories.tsx index 92ef805144..de402a1b63 100644 --- a/packages/core/src/FormElement/Label/Label.stories.tsx +++ b/packages/core/src/FormElement/Label/Label.stories.tsx @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvLabel, HvLabelProps } from "@hitachivantara/uikit-react-core"; +import { HvLabel, type HvLabelProps } from "@hitachivantara/uikit-react-core"; const meta: Meta = { title: "Components/Form Element Blocks/Label", diff --git a/packages/core/src/FormElement/Label/Label.tsx b/packages/core/src/FormElement/Label/Label.tsx index 893ea37006..bf44ff8def 100644 --- a/packages/core/src/FormElement/Label/Label.tsx +++ b/packages/core/src/FormElement/Label/Label.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvTypography, HvTypographyProps } from "../../Typography"; +import { HvTypography, type HvTypographyProps } from "../../Typography"; import { setId } from "../../utils/setId"; import { HvFormElementContext } from "../context"; import { findDescriptors } from "../utils"; diff --git a/packages/core/src/FormElement/LabelContainer.tsx b/packages/core/src/FormElement/LabelContainer.tsx index 33d994aaa9..7b413b7a6b 100644 --- a/packages/core/src/FormElement/LabelContainer.tsx +++ b/packages/core/src/FormElement/LabelContainer.tsx @@ -1,7 +1,7 @@ import { createClasses, - ExtractNames, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-utils"; import { theme } from "@hitachivantara/uikit-styles"; @@ -20,8 +20,7 @@ const { useClasses } = createClasses("HvLabelContainer", { description: {}, }); -export interface HvLabelContainerProps - extends React.HTMLAttributes { +export interface HvLabelContainerProps extends React.HTMLAttributes { classes?: ExtractNames; label?: React.ReactNode; description?: React.ReactNode; diff --git a/packages/core/src/FormElement/Suggestions/Suggestions.stories.tsx b/packages/core/src/FormElement/Suggestions/Suggestions.stories.tsx index 912759571d..837034e862 100644 --- a/packages/core/src/FormElement/Suggestions/Suggestions.stories.tsx +++ b/packages/core/src/FormElement/Suggestions/Suggestions.stories.tsx @@ -2,11 +2,11 @@ import { useMemo, useRef, useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvBaseInput, - HvBaseInputProps, HvFormElement, HvLabel, HvSuggestions, - HvSuggestionsProps, + type HvBaseInputProps, + type HvSuggestionsProps, } from "@hitachivantara/uikit-react-core"; import { DropDownXS } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/FormElement/Suggestions/Suggestions.tsx b/packages/core/src/FormElement/Suggestions/Suggestions.tsx index f8691e101f..de7d88c35e 100644 --- a/packages/core/src/FormElement/Suggestions/Suggestions.tsx +++ b/packages/core/src/FormElement/Suggestions/Suggestions.tsx @@ -1,8 +1,8 @@ import { forwardRef, useContext, useRef } from "react"; import ClickAwayListener, { - ClickAwayListenerProps, + type ClickAwayListenerProps, } from "@mui/material/ClickAwayListener"; -import Popper, { PopperProps } from "@mui/material/Popper"; +import Popper, { type PopperProps } from "@mui/material/Popper"; import { useForkRef } from "@mui/material/utils"; import { useDefaultProps, @@ -12,7 +12,7 @@ import { import { HvListItem } from "../../ListContainer"; import { HvSelectionList } from "../../SelectionList"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { getContainerElement } from "../../utils/document"; import { setId } from "../../utils/setId"; import { HvFormElementContext } from "../context"; diff --git a/packages/core/src/FormElement/WarningText/WarningText.stories.tsx b/packages/core/src/FormElement/WarningText/WarningText.stories.tsx index a50c3fb53e..008e5ba2a2 100644 --- a/packages/core/src/FormElement/WarningText/WarningText.stories.tsx +++ b/packages/core/src/FormElement/WarningText/WarningText.stories.tsx @@ -3,9 +3,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvButton, HvFormElement, - HvFormStatus, HvWarningText, - HvWarningTextProps, + type HvFormStatus, + type HvWarningTextProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/FormElement/WarningText/WarningText.test.tsx b/packages/core/src/FormElement/WarningText/WarningText.test.tsx index 3a392284d2..3faab8b44e 100644 --- a/packages/core/src/FormElement/WarningText/WarningText.test.tsx +++ b/packages/core/src/FormElement/WarningText/WarningText.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; -import { HvWarningText, HvWarningTextProps } from "."; +import { HvWarningText, type HvWarningTextProps } from "."; const TEXT = "text-content"; diff --git a/packages/core/src/FormElement/WarningText/WarningText.tsx b/packages/core/src/FormElement/WarningText/WarningText.tsx index 3e494c430e..fe7bdb8d5e 100644 --- a/packages/core/src/FormElement/WarningText/WarningText.tsx +++ b/packages/core/src/FormElement/WarningText/WarningText.tsx @@ -5,7 +5,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvIcon } from "../../icons"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { setId } from "../../utils/setId"; import { HvFormElementContext } from "../context"; import { staticClasses, useClasses } from "./WarningText.styles"; diff --git a/packages/core/src/GlobalActions/GlobalActions.stories.tsx b/packages/core/src/GlobalActions/GlobalActions.stories.tsx index 42e7ec1dc5..70a4ed68c5 100644 --- a/packages/core/src/GlobalActions/GlobalActions.stories.tsx +++ b/packages/core/src/GlobalActions/GlobalActions.stories.tsx @@ -7,11 +7,11 @@ import { HvContainer, HvDropDownMenu, HvGlobalActions, - HvGlobalActionsProps, HvTab, HvTabs, HvTypography, theme, + type HvGlobalActionsProps, } from "@hitachivantara/uikit-react-core"; import { Backwards, Home } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/GlobalActions/GlobalActions.tsx b/packages/core/src/GlobalActions/GlobalActions.tsx index c3e0ab1d3d..6337a73c15 100644 --- a/packages/core/src/GlobalActions/GlobalActions.tsx +++ b/packages/core/src/GlobalActions/GlobalActions.tsx @@ -6,7 +6,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvTypography } from "../Typography"; import { getBreakpointStyles, @@ -21,8 +21,10 @@ export type HvGlobalActionsVariant = "global" | "section"; export type HvGlobalActionsPosition = "sticky" | "fixed" | "relative"; export type HvGlobalActionsHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6; -export interface HvGlobalActionsProps - extends HvBaseProps { +export interface HvGlobalActionsProps extends HvBaseProps< + HTMLDivElement, + "title" +> { /** Text to display in the component. */ title?: React.ReactNode; /** Denotes if this is a global or section component. */ diff --git a/packages/core/src/Grid/Grid.stories.tsx b/packages/core/src/Grid/Grid.stories.tsx index 7b9c2fd88a..d464d06726 100644 --- a/packages/core/src/Grid/Grid.stories.tsx +++ b/packages/core/src/Grid/Grid.stories.tsx @@ -2,10 +2,10 @@ import styled from "@emotion/styled"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvGrid, - HvGridProps, HvTypography, theme, useWidth, + type HvGridProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Grid/Grid.tsx b/packages/core/src/Grid/Grid.tsx index 04d74ee733..cfc280f9d1 100644 --- a/packages/core/src/Grid/Grid.tsx +++ b/packages/core/src/Grid/Grid.tsx @@ -1,6 +1,6 @@ import { forwardRef } from "react"; import MuiGrid, { - GridLegacyProps as MuiGridProps, + type GridLegacyProps as MuiGridProps, } from "@mui/material/GridLegacy"; import { useDefaultProps, diff --git a/packages/core/src/Header/Actions/Actions.tsx b/packages/core/src/Header/Actions/Actions.tsx index edd6d94c9e..ffe46bb178 100644 --- a/packages/core/src/Header/Actions/Actions.tsx +++ b/packages/core/src/Header/Actions/Actions.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { staticClasses, useClasses } from "./Actions.styles"; export { staticClasses as headerActionsClasses }; diff --git a/packages/core/src/Header/Brand/Brand.tsx b/packages/core/src/Header/Brand/Brand.tsx index 030db2fad1..9a881a84b6 100644 --- a/packages/core/src/Header/Brand/Brand.tsx +++ b/packages/core/src/Header/Brand/Brand.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { HvTypography } from "../../Typography"; import { staticClasses, useClasses } from "./Brand.styles"; diff --git a/packages/core/src/Header/Header.stories.tsx b/packages/core/src/Header/Header.stories.tsx index 013387ea1a..cea29e74fc 100644 --- a/packages/core/src/Header/Header.stories.tsx +++ b/packages/core/src/Header/Header.stories.tsx @@ -9,7 +9,7 @@ import { HvHeaderActions, HvHeaderBrand, HvHeaderNavigation, - HvHeaderProps, + type HvHeaderProps, } from "@hitachivantara/uikit-react-core"; import { Alert, Menu, User } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Header/Header.tsx b/packages/core/src/Header/Header.tsx index bd2c07bdf7..e88254d8c4 100644 --- a/packages/core/src/Header/Header.tsx +++ b/packages/core/src/Header/Header.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Header.styles"; export { staticClasses as headerClasses }; diff --git a/packages/core/src/Header/Navigation/MenuBar/Bar.tsx b/packages/core/src/Header/Navigation/MenuBar/Bar.tsx index 05de298499..ee28df5b18 100644 --- a/packages/core/src/Header/Navigation/MenuBar/Bar.tsx +++ b/packages/core/src/Header/Navigation/MenuBar/Bar.tsx @@ -4,8 +4,8 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../../types/generic"; -import { HvHeaderNavigationItemProp } from "../useSelectionPath"; +import type { HvBaseProps } from "../../../types/generic"; +import type { HvHeaderNavigationItemProp } from "../useSelectionPath"; import { SelectionContext } from "../utils/SelectionContext"; import { staticClasses, useClasses } from "./Bar.styles"; diff --git a/packages/core/src/Header/Navigation/MenuBar/MenuBar.tsx b/packages/core/src/Header/Navigation/MenuBar/MenuBar.tsx index f780498467..b90ed1d983 100644 --- a/packages/core/src/Header/Navigation/MenuBar/MenuBar.tsx +++ b/packages/core/src/Header/Navigation/MenuBar/MenuBar.tsx @@ -1,12 +1,14 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../../types/generic"; +import type { HvBaseProps } from "../../../types/generic"; import { HvHeaderMenuItem } from "../MenuItem"; -import { HvHeaderNavigationItemProp } from "../useSelectionPath"; -import { Bar, BarProps, HvHeaderMenuBarClasses } from "./Bar"; +import type { HvHeaderNavigationItemProp } from "../useSelectionPath"; +import { Bar, type BarProps, type HvHeaderMenuBarClasses } from "./Bar"; -export interface HvHeaderMenuBarProps - extends HvBaseProps { +export interface HvHeaderMenuBarProps extends HvBaseProps< + HTMLDivElement, + "onClick" +> { data: HvHeaderNavigationItemProp[]; type?: BarProps["type"]; onClick?: ( diff --git a/packages/core/src/Header/Navigation/MenuItem/MenuItem.tsx b/packages/core/src/Header/Navigation/MenuItem/MenuItem.tsx index 4bb1926721..b922b5b473 100644 --- a/packages/core/src/Header/Navigation/MenuItem/MenuItem.tsx +++ b/packages/core/src/Header/Navigation/MenuItem/MenuItem.tsx @@ -4,11 +4,11 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../../types/generic"; +import type { HvBaseProps } from "../../../types/generic"; import { HvTypography } from "../../../Typography"; import { isKey } from "../../../utils/keyboardUtils"; import { Bar } from "../MenuBar/Bar"; -import { HvHeaderNavigationItemProp } from "../useSelectionPath"; +import type { HvHeaderNavigationItemProp } from "../useSelectionPath"; import { FocusContext } from "../utils/FocusContext"; import { SelectionContext } from "../utils/SelectionContext"; import { staticClasses, useClasses } from "./MenuItem.styles"; @@ -17,8 +17,10 @@ export { staticClasses as headerMenuItemClasses }; export type HvHeaderMenuItemClasses = ExtractNames; -export interface HvHeaderMenuItemProps - extends HvBaseProps { +export interface HvHeaderMenuItemProps extends HvBaseProps< + HTMLDivElement, + "onClick" +> { item: HvHeaderNavigationItemProp; type?: string; onClick?: ( diff --git a/packages/core/src/Header/Navigation/Navigation.tsx b/packages/core/src/Header/Navigation/Navigation.tsx index ed5cde9be8..2a88c5c8d4 100644 --- a/packages/core/src/Header/Navigation/Navigation.tsx +++ b/packages/core/src/Header/Navigation/Navigation.tsx @@ -4,12 +4,12 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; -import { HvHeaderMenuBar, HvHeaderMenuBarProps } from "./MenuBar"; +import type { HvBaseProps } from "../../types/generic"; +import { HvHeaderMenuBar, type HvHeaderMenuBarProps } from "./MenuBar"; import { staticClasses, useClasses } from "./Navigation.styles"; import { - HvHeaderNavigationItemProp, useSelectionPath, + type HvHeaderNavigationItemProp, } from "./useSelectionPath"; import { FocusProvider } from "./utils/FocusContext"; import { SelectionContext } from "./utils/SelectionContext"; @@ -18,8 +18,10 @@ export { staticClasses as headerNavigationClasses }; export type HvHeaderNavigationClasses = ExtractNames; -export interface HvHeaderNavigationProps - extends HvBaseProps { +export interface HvHeaderNavigationProps extends HvBaseProps< + HTMLDivElement, + "onClick" +> { data: HvHeaderNavigationItemProp[]; selected?: string; onClick?: ( diff --git a/packages/core/src/IconButton/IconButton.stories.tsx b/packages/core/src/IconButton/IconButton.stories.tsx index 730f4469f4..00f56e0761 100644 --- a/packages/core/src/IconButton/IconButton.stories.tsx +++ b/packages/core/src/IconButton/IconButton.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvIconButton, - HvIconButtonProps, theme, + type HvIconButtonProps, } from "@hitachivantara/uikit-react-core"; import { Add, diff --git a/packages/core/src/IconButton/IconButton.test.tsx b/packages/core/src/IconButton/IconButton.test.tsx index 3e31620823..8242cc2ee8 100644 --- a/packages/core/src/IconButton/IconButton.test.tsx +++ b/packages/core/src/IconButton/IconButton.test.tsx @@ -2,7 +2,7 @@ import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { vi } from "vitest"; -import { HvIconButton, HvIconButtonProps } from "./IconButton"; +import { HvIconButton, type HvIconButtonProps } from "./IconButton"; const title = "My tooltip button"; diff --git a/packages/core/src/IconButton/IconButton.tsx b/packages/core/src/IconButton/IconButton.tsx index 6fac4756db..47500799f3 100644 --- a/packages/core/src/IconButton/IconButton.tsx +++ b/packages/core/src/IconButton/IconButton.tsx @@ -1,11 +1,11 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../Button"; -import { HvTooltip, HvTooltipProps } from "../Tooltip"; +import { HvButton, type HvButtonProps } from "../Button"; +import { HvTooltip, type HvTooltipProps } from "../Tooltip"; import { fixedForwardRef, - PolymorphicComponentRef, - PolymorphicRef, + type PolymorphicComponentRef, + type PolymorphicRef, } from "../types/generic"; export type HvIconButtonProps = diff --git a/packages/core/src/IconContainer/IconContainer.tsx b/packages/core/src/IconContainer/IconContainer.tsx index 8919d1fa17..c189f34fa2 100644 --- a/packages/core/src/IconContainer/IconContainer.tsx +++ b/packages/core/src/IconContainer/IconContainer.tsx @@ -1,11 +1,15 @@ import { forwardRef } from "react"; import { createClasses, - ExtractNames, mergeStyles, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny, HvSize } from "@hitachivantara/uikit-styles"; +import { + getColor, + type HvColorAny, + type HvSize, +} from "@hitachivantara/uikit-styles"; type HvIconSize = "XS" | "S" | "M" | "L"; @@ -43,8 +47,7 @@ export { staticClasses as iconContainerClasses }; export type HvIconContainerClasses = ExtractNames; -export interface HvIconContainerProps - extends React.HTMLAttributes { +export interface HvIconContainerProps extends React.HTMLAttributes { classes?: HvIconContainerClasses; /** * A color to override the default icon colors. diff --git a/packages/core/src/InlineEditor/InlineEditor.stories.tsx b/packages/core/src/InlineEditor/InlineEditor.stories.tsx index e4d553019d..b1852dfe3e 100644 --- a/packages/core/src/InlineEditor/InlineEditor.stories.tsx +++ b/packages/core/src/InlineEditor/InlineEditor.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvInlineEditor, - HvInlineEditorProps, - HvTypographyVariants, + type HvInlineEditorProps, + type HvTypographyVariants, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/InlineEditor/InlineEditor.test.tsx b/packages/core/src/InlineEditor/InlineEditor.test.tsx index ef03747068..086d0db7c0 100644 --- a/packages/core/src/InlineEditor/InlineEditor.test.tsx +++ b/packages/core/src/InlineEditor/InlineEditor.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvInlineEditor, HvInlineEditorProps } from "./InlineEditor"; +import { HvInlineEditor, type HvInlineEditorProps } from "./InlineEditor"; const controlledValue = "My value"; const controlledLabel = "Label"; diff --git a/packages/core/src/InlineEditor/InlineEditor.tsx b/packages/core/src/InlineEditor/InlineEditor.tsx index a0cc0d19d1..756b2a1956 100644 --- a/packages/core/src/InlineEditor/InlineEditor.tsx +++ b/packages/core/src/InlineEditor/InlineEditor.tsx @@ -5,21 +5,21 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../Button"; +import { HvButton, type HvButtonProps } from "../Button"; import { useControlled } from "../hooks/useControlled"; import { useEnhancedEffect } from "../hooks/useEnhancedEffect"; import { HvIcon } from "../icons"; -import { HvInput, HvInputProps } from "../Input"; +import { HvInput, type HvInputProps } from "../Input"; import { HvTooltip } from "../Tooltip"; import { fixedForwardRef, - PolymorphicComponentRef, - PolymorphicRef, + type PolymorphicComponentRef, + type PolymorphicRef, } from "../types/generic"; import { HvTypography, - HvTypographyProps, - HvTypographyVariants, + type HvTypographyProps, + type HvTypographyVariants, } from "../Typography"; import { isKey } from "../utils/keyboardUtils"; import { staticClasses, useClasses } from "./InlineEditor.styles"; diff --git a/packages/core/src/Input/Input.stories.tsx b/packages/core/src/Input/Input.stories.tsx index e648f3673f..a8035696ce 100644 --- a/packages/core/src/Input/Input.stories.tsx +++ b/packages/core/src/Input/Input.stories.tsx @@ -3,12 +3,12 @@ import { css } from "@emotion/css"; import type { Decorator, Meta, StoryObj } from "@storybook/react-vite"; import { HvBaseInput, - HvFormStatus, HvInput, - HvInputProps, - HvInputSuggestion, - HvValidationMessages, theme, + type HvFormStatus, + type HvInputProps, + type HvInputSuggestion, + type HvValidationMessages, } from "@hitachivantara/uikit-react-core"; import { Calendar, Map, Time } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Input/Input.test.tsx b/packages/core/src/Input/Input.test.tsx index 0ac55fe847..1f652fccba 100644 --- a/packages/core/src/Input/Input.test.tsx +++ b/packages/core/src/Input/Input.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { vi } from "vitest"; -import { HvInput, HvInputProps } from "."; +import { HvInput, type HvInputProps } from "."; import { HvAdornment } from "../FormElement"; const Suggestions = ({ ...others }: Partial) => { diff --git a/packages/core/src/Input/Input.tsx b/packages/core/src/Input/Input.tsx index 4c021254b9..66fbe5e443 100644 --- a/packages/core/src/Input/Input.tsx +++ b/packages/core/src/Input/Input.tsx @@ -6,32 +6,32 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseInput, HvBaseInputProps } from "../BaseInput"; +import { HvBaseInput, type HvBaseInputProps } from "../BaseInput"; import { computeValidationMessage, computeValidationState, DEFAULT_ERROR_MESSAGES, hasBuiltInValidations, - HvInputValidity, - HvValidationMessages, validateInput, + type HvInputValidity, + type HvValidationMessages, } from "../BaseInput/validations"; import type { HvButtonBaseProps } from "../ButtonBase"; import { HvAdornment, HvFormElement, - HvFormElementProps, - HvFormStatus, HvInfoMessage, HvWarningText, isInvalid, isValid, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { - HvSuggestion, HvSuggestions, - HvSuggestionsProps, + type HvSuggestion, + type HvSuggestionsProps, } from "../FormElement/Suggestions/Suggestions"; import { useControlled } from "../hooks/useControlled"; import { useIsMounted } from "../hooks/useIsMounted"; @@ -61,9 +61,9 @@ export interface HvInputSuggestion { export interface HvInputProps< InputElement extends HTMLElement = HTMLInputElement | HTMLTextAreaElement, > extends Omit< - HvBaseInputProps, - "onChange" | "onBlur" | "onFocus" | "onKeyDown" - > { + HvBaseInputProps, + "onChange" | "onBlur" | "onFocus" | "onKeyDown" +> { /** @inheritdoc */ name?: string; /** @inheritdoc */ diff --git a/packages/core/src/List/List.tsx b/packages/core/src/List/List.tsx index 4418114d87..66ad24519b 100644 --- a/packages/core/src/List/List.tsx +++ b/packages/core/src/List/List.tsx @@ -1,10 +1,10 @@ import { - AriaRole, forwardRef, isValidElement, useEffect, useMemo, useRef, + type AriaRole, } from "react"; import { FixedSizeList } from "react-window"; import { @@ -16,16 +16,16 @@ import { HvCheckBox } from "../CheckBox"; import { HvIcon } from "../icons"; import { HvListContainer, - HvListContainerProps, HvListItem, + type HvListContainerProps, } from "../ListContainer"; import { HvOverflowTooltip } from "../OverflowTooltip"; import { HvRadio } from "../Radio"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { HvTypography } from "../Typography"; import { CounterLabel } from "../utils/CounterLabel"; import { staticClasses, useClasses } from "./List.styles"; -import { HvListValue } from "./types"; +import type { HvListValue } from "./types"; import { useSelectableList } from "./useSelectableList"; import { parseList } from "./utils"; @@ -33,8 +33,10 @@ export { staticClasses as listClasses }; export type HvListClasses = ExtractNames; -export interface HvListProps - extends HvBaseProps { +export interface HvListProps extends HvBaseProps< + HTMLUListElement, + "onChange" | "onClick" +> { /** * A list containing the elements to be rendered. * diff --git a/packages/core/src/List/useSelectableList.ts b/packages/core/src/List/useSelectableList.ts index acfeac5e16..700c63f2a3 100644 --- a/packages/core/src/List/useSelectableList.ts +++ b/packages/core/src/List/useSelectableList.ts @@ -1,6 +1,6 @@ import { useMemo, useState } from "react"; -import { HvListValue } from "./types"; +import type { HvListValue } from "./types"; export const useSelectableList = (defaultList: HvListValue[] = []) => { const [list, setList] = useState(defaultList); diff --git a/packages/core/src/List/utils.ts b/packages/core/src/List/utils.ts index e06abaa6b6..4a5bcd037c 100644 --- a/packages/core/src/List/utils.ts +++ b/packages/core/src/List/utils.ts @@ -1,4 +1,4 @@ -import { HvListValue } from "./types"; +import type { HvListValue } from "./types"; const isItemSelected = (item: HvListValue, newItem: HvListValue) => { const selectionKey = item?.id ? "id" : "label"; diff --git a/packages/core/src/ListContainer/ListContainer.stories.tsx b/packages/core/src/ListContainer/ListContainer.stories.tsx index c881c2b908..41396a26f6 100644 --- a/packages/core/src/ListContainer/ListContainer.stories.tsx +++ b/packages/core/src/ListContainer/ListContainer.stories.tsx @@ -2,10 +2,10 @@ import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvListContainer, - HvListContainerProps, HvListItem, HvPanel, HvTypography, + type HvListContainerProps, } from "@hitachivantara/uikit-react-core"; import { Calendar, diff --git a/packages/core/src/ListContainer/ListContainer.tsx b/packages/core/src/ListContainer/ListContainer.tsx index 3de49499a8..92fc57c689 100644 --- a/packages/core/src/ListContainer/ListContainer.tsx +++ b/packages/core/src/ListContainer/ListContainer.tsx @@ -13,7 +13,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { useForkRef } from "../hooks/useForkRef"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./ListContainer.styles"; import HvListContext from "./ListContext"; diff --git a/packages/core/src/ListContainer/ListItem/ListItem.tsx b/packages/core/src/ListContainer/ListItem/ListItem.tsx index 68752607db..5dc5d98710 100644 --- a/packages/core/src/ListContainer/ListItem/ListItem.tsx +++ b/packages/core/src/ListContainer/ListItem/ListItem.tsx @@ -2,10 +2,10 @@ import { cloneElement, forwardRef, isValidElement, - ReactElement, useCallback, useContext, useMemo, + type ReactElement, } from "react"; import { useDefaultProps, @@ -13,7 +13,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvFocus } from "../../Focus"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import HvListContext from "../ListContext"; import { staticClasses, useClasses } from "./ListItem.styles"; diff --git a/packages/core/src/Loading/Loading.stories.tsx b/packages/core/src/Loading/Loading.stories.tsx index 108be34216..8f27d8fcaa 100644 --- a/packages/core/src/Loading/Loading.stories.tsx +++ b/packages/core/src/Loading/Loading.stories.tsx @@ -2,9 +2,9 @@ import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvButton, - HvButtonProps, HvLoading, - HvLoadingProps, + type HvButtonProps, + type HvLoadingProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Loading/Loading.tsx b/packages/core/src/Loading/Loading.tsx index 87e4810e96..420091024e 100644 --- a/packages/core/src/Loading/Loading.tsx +++ b/packages/core/src/Loading/Loading.tsx @@ -4,9 +4,9 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny } from "@hitachivantara/uikit-styles"; +import { getColor, type HvColorAny } from "@hitachivantara/uikit-styles"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { range } from "../utils/helpers"; import { staticClasses, useClasses } from "./Loading.styles"; diff --git a/packages/core/src/LoadingContainer/LoadingContainer.stories.tsx b/packages/core/src/LoadingContainer/LoadingContainer.stories.tsx index db7e8cfb0a..938f2da25b 100644 --- a/packages/core/src/LoadingContainer/LoadingContainer.stories.tsx +++ b/packages/core/src/LoadingContainer/LoadingContainer.stories.tsx @@ -4,8 +4,8 @@ import { HvListContainer, HvListItem, HvLoadingContainer, - HvLoadingContainerProps, HvPanel, + type HvLoadingContainerProps, } from "@hitachivantara/uikit-react-core"; export default { diff --git a/packages/core/src/LoadingContainer/LoadingContainer.tsx b/packages/core/src/LoadingContainer/LoadingContainer.tsx index 503e873e56..443d940f22 100644 --- a/packages/core/src/LoadingContainer/LoadingContainer.tsx +++ b/packages/core/src/LoadingContainer/LoadingContainer.tsx @@ -5,8 +5,8 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvLoading, HvLoadingProps } from "../Loading"; -import { HvBaseProps } from "../types/generic"; +import { HvLoading, type HvLoadingProps } from "../Loading"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./LoadingContainer.styles"; export { staticClasses as loadingContainerClasses }; @@ -14,7 +14,8 @@ export { staticClasses as loadingContainerClasses }; export type HvLoadingContainerClasses = ExtractNames; export interface HvLoadingContainerProps - extends HvBaseProps, + extends + HvBaseProps, Pick { opacity?: number; classes?: HvLoadingContainerClasses; diff --git a/packages/core/src/Login/Login.stories.tsx b/packages/core/src/Login/Login.stories.tsx index 1ac9de3ae8..f41eea5893 100644 --- a/packages/core/src/Login/Login.stories.tsx +++ b/packages/core/src/Login/Login.stories.tsx @@ -4,8 +4,8 @@ import { HvButton, HvInput, HvLogin, - HvLoginProps, HvTypography, + type HvLoginProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Login/Login.tsx b/packages/core/src/Login/Login.tsx index 6ab1a34446..f6a76b2dbd 100644 --- a/packages/core/src/Login/Login.tsx +++ b/packages/core/src/Login/Login.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Login.styles"; export { staticClasses as loginClasses }; diff --git a/packages/core/src/MultiButton/MultiButton.stories.tsx b/packages/core/src/MultiButton/MultiButton.stories.tsx index 41b5c5a476..8c748a5969 100644 --- a/packages/core/src/MultiButton/MultiButton.stories.tsx +++ b/packages/core/src/MultiButton/MultiButton.stories.tsx @@ -3,8 +3,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvButton, HvMultiButton, - HvMultiButtonProps, HvSimpleGrid, + type HvMultiButtonProps, } from "@hitachivantara/uikit-react-core"; import { Abacus, LocationPin, Map } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/MultiButton/MultiButton.tsx b/packages/core/src/MultiButton/MultiButton.tsx index 7ece3d6e5b..5636fb46e2 100644 --- a/packages/core/src/MultiButton/MultiButton.tsx +++ b/packages/core/src/MultiButton/MultiButton.tsx @@ -3,10 +3,10 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvSize } from "@hitachivantara/uikit-styles"; +import type { HvSize } from "@hitachivantara/uikit-styles"; -import { HvButtonVariant } from "../Button"; -import { HvBaseProps } from "../types/generic"; +import type { HvButtonVariant } from "../Button"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./MultiButton.styles"; export { staticClasses as multiButtonClasses }; diff --git a/packages/core/src/MultiButton/stories/SplitButton.tsx b/packages/core/src/MultiButton/stories/SplitButton.tsx index 004c017db1..e73c928e1e 100644 --- a/packages/core/src/MultiButton/stories/SplitButton.tsx +++ b/packages/core/src/MultiButton/stories/SplitButton.tsx @@ -3,7 +3,7 @@ import { HvButton, HvDropDownMenu, HvMultiButton, - HvMultiButtonProps, + type HvMultiButtonProps, } from "@hitachivantara/uikit-react-core"; import { DropDownXS } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/NumberInput/NumberInput.stories.tsx b/packages/core/src/NumberInput/NumberInput.stories.tsx index e7bd3f8de7..1eda540e48 100644 --- a/packages/core/src/NumberInput/NumberInput.stories.tsx +++ b/packages/core/src/NumberInput/NumberInput.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvNumberInput, - HvNumberInputProps, + type HvNumberInputProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/NumberInput/NumberInput.tsx b/packages/core/src/NumberInput/NumberInput.tsx index 55e33226c5..6061b5c36b 100644 --- a/packages/core/src/NumberInput/NumberInput.tsx +++ b/packages/core/src/NumberInput/NumberInput.tsx @@ -4,7 +4,7 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; import { HvAdornment } from "../FormElement"; import { HvIcon } from "../icons"; -import { HvInput, HvInputProps } from "../Input"; +import { HvInput, type HvInputProps } from "../Input"; import { changeInputValue } from "../Input/utils"; import { useClasses } from "./NumberInput.styles"; diff --git a/packages/core/src/OverflowTooltip/OverflowTooltip.stories.tsx b/packages/core/src/OverflowTooltip/OverflowTooltip.stories.tsx index fc9c7d2dcc..52e5fa3e32 100644 --- a/packages/core/src/OverflowTooltip/OverflowTooltip.stories.tsx +++ b/packages/core/src/OverflowTooltip/OverflowTooltip.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvOverflowTooltip, - HvOverflowTooltipProps, + type HvOverflowTooltipProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/OverflowTooltip/OverflowTooltip.tsx b/packages/core/src/OverflowTooltip/OverflowTooltip.tsx index 0525eb8348..4d6b58f8c3 100644 --- a/packages/core/src/OverflowTooltip/OverflowTooltip.tsx +++ b/packages/core/src/OverflowTooltip/OverflowTooltip.tsx @@ -5,14 +5,16 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvTooltip, HvTooltipProps } from "../Tooltip"; +import { HvTooltip, type HvTooltipProps } from "../Tooltip"; import { staticClasses, useClasses } from "./OverflowTooltip.styles"; export { staticClasses as overflowTooltipClasses }; export type HvOverflowTooltipClasses = ExtractNames; -export interface HvOverflowTooltipProps - extends Omit, "classes" | "children"> { +export interface HvOverflowTooltipProps extends Omit< + Partial, + "classes" | "children" +> { /** The node that will be rendered inside the tooltip. */ data: React.ReactNode; /** If `true`, the overflow tooltip will always use the paragraph overflow style. */ diff --git a/packages/core/src/Pagination/Pagination.stories.tsx b/packages/core/src/Pagination/Pagination.stories.tsx index a9ca02b9fa..0272bd7cb7 100644 --- a/packages/core/src/Pagination/Pagination.stories.tsx +++ b/packages/core/src/Pagination/Pagination.stories.tsx @@ -3,8 +3,8 @@ import { css } from "@emotion/css"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvPagination, - HvPaginationProps, theme, + type HvPaginationProps, } from "@hitachivantara/uikit-react-core"; const classes = { diff --git a/packages/core/src/Pagination/Pagination.tsx b/packages/core/src/Pagination/Pagination.tsx index e0eacb19c2..0e2f7d6006 100644 --- a/packages/core/src/Pagination/Pagination.tsx +++ b/packages/core/src/Pagination/Pagination.tsx @@ -7,11 +7,11 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseInput, HvBaseInputProps } from "../BaseInput"; +import { HvBaseInput, type HvBaseInputProps } from "../BaseInput"; import { useLabels } from "../hooks/useLabels"; import { HvIconButton } from "../IconButton"; import { HvIcon } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Pagination.styles"; import HvSelect, { Option } from "./Select"; diff --git a/packages/core/src/Pagination/Select.tsx b/packages/core/src/Pagination/Select.tsx index d1333b3e86..4696e76517 100644 --- a/packages/core/src/Pagination/Select.tsx +++ b/packages/core/src/Pagination/Select.tsx @@ -1,18 +1,20 @@ import { useState } from "react"; import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; -import { HvBaseDropdown, HvBaseDropdownProps } from "../BaseDropdown"; -import { HvListItem, HvListItemProps } from "../ListContainer"; +import { HvBaseDropdown, type HvBaseDropdownProps } from "../BaseDropdown"; +import { HvListItem, type HvListItemProps } from "../ListContainer"; import { HvPanel } from "../Panel"; -import { HvSelectionList, HvSelectionListProps } from "../SelectionList"; +import { HvSelectionList, type HvSelectionListProps } from "../SelectionList"; import { useClasses } from "./Select.styles"; export const Option = ({ ...props }: Partial) => ( ); -export interface HvPaginationSelectProps - extends Omit { +export interface HvPaginationSelectProps extends Omit< + HvBaseDropdownProps, + "onChange" +> { onChange: (event: React.SyntheticEvent, val: number) => void; value: number; } diff --git a/packages/core/src/Panel/Panel.stories.tsx b/packages/core/src/Panel/Panel.stories.tsx index 23ed8a90d3..4413183d0c 100644 --- a/packages/core/src/Panel/Panel.stories.tsx +++ b/packages/core/src/Panel/Panel.stories.tsx @@ -2,9 +2,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvIconButton, HvPanel, - HvPanelProps, HvTypography, theme, + type HvPanelProps, } from "@hitachivantara/uikit-react-core"; import { Close } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Panel/Panel.tsx b/packages/core/src/Panel/Panel.tsx index 5e5c42bbb8..492ffd01f7 100644 --- a/packages/core/src/Panel/Panel.tsx +++ b/packages/core/src/Panel/Panel.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Panel.styles"; export { staticClasses as panelClasses }; diff --git a/packages/core/src/ProgressBar/ProgressBar.stories.tsx b/packages/core/src/ProgressBar/ProgressBar.stories.tsx index c50818980a..ddca2036ee 100644 --- a/packages/core/src/ProgressBar/ProgressBar.stories.tsx +++ b/packages/core/src/ProgressBar/ProgressBar.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvProgressBar, - HvProgressBarProps, HvTypography, + type HvProgressBarProps, } from "@hitachivantara/uikit-react-core"; import { ProgressBarSimulator } from "./ProgressBarSimulator"; diff --git a/packages/core/src/ProgressBar/ProgressBar.tsx b/packages/core/src/ProgressBar/ProgressBar.tsx index 5c90621fe5..a07e91ca96 100644 --- a/packages/core/src/ProgressBar/ProgressBar.tsx +++ b/packages/core/src/ProgressBar/ProgressBar.tsx @@ -4,8 +4,8 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; -import { HvTypography, HvTypographyProps } from "../Typography"; +import type { HvBaseProps } from "../types/generic"; +import { HvTypography, type HvTypographyProps } from "../Typography"; import { staticClasses, useClasses } from "./ProgressBar.styles"; export { staticClasses as progressBarClasses }; diff --git a/packages/core/src/ProgressBar/ProgressBarSimulator.tsx b/packages/core/src/ProgressBar/ProgressBarSimulator.tsx index ed27c362c1..dc3a52b251 100644 --- a/packages/core/src/ProgressBar/ProgressBarSimulator.tsx +++ b/packages/core/src/ProgressBar/ProgressBarSimulator.tsx @@ -1,7 +1,7 @@ -import { AriaAttributes, useEffect, useState } from "react"; +import { useEffect, useState, type AriaAttributes } from "react"; import { HvButton } from "../Button"; -import { HvProgressBar, HvProgressBarStatus } from "./ProgressBar"; +import { HvProgressBar, type HvProgressBarStatus } from "./ProgressBar"; export const ProgressBarSimulator = ({ inc, diff --git a/packages/core/src/QueryBuilder/ConfirmationDialog.tsx b/packages/core/src/QueryBuilder/ConfirmationDialog.tsx index 27436edeaa..ab6c0e9693 100644 --- a/packages/core/src/QueryBuilder/ConfirmationDialog.tsx +++ b/packages/core/src/QueryBuilder/ConfirmationDialog.tsx @@ -1,10 +1,10 @@ -import { HvButton, HvButtonProps } from "../Button"; +import { HvButton, type HvButtonProps } from "../Button"; import { HvDialog, HvDialogActions, HvDialogContent, - HvDialogProps, HvDialogTitle, + type HvDialogProps, } from "../Dialog"; export interface ConfirmationDialogProps extends HvDialogProps { diff --git a/packages/core/src/QueryBuilder/Context.tsx b/packages/core/src/QueryBuilder/Context.tsx index 071394720f..2d3086121a 100644 --- a/packages/core/src/QueryBuilder/Context.tsx +++ b/packages/core/src/QueryBuilder/Context.tsx @@ -1,6 +1,6 @@ import { createContext, useContext } from "react"; -import { +import type { AskAction, HvQueryBuilderAttribute, HvQueryBuilderLabels, diff --git a/packages/core/src/QueryBuilder/QueryBuilder.stories.tsx b/packages/core/src/QueryBuilder/QueryBuilder.stories.tsx index 5b6c2f26bb..d1e4fdf3c1 100644 --- a/packages/core/src/QueryBuilder/QueryBuilder.stories.tsx +++ b/packages/core/src/QueryBuilder/QueryBuilder.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { setupChromatic } from "@hitachivantara/internal"; import { HvQueryBuilder, - HvQueryBuilderProps, + type HvQueryBuilderProps, } from "@hitachivantara/uikit-react-core"; import { CustomRenderers as CustomRenderersStory } from "./stories/CustomRenderers"; diff --git a/packages/core/src/QueryBuilder/QueryBuilder.test.tsx b/packages/core/src/QueryBuilder/QueryBuilder.test.tsx index 411d0c3c2a..6fc644a8d0 100644 --- a/packages/core/src/QueryBuilder/QueryBuilder.test.tsx +++ b/packages/core/src/QueryBuilder/QueryBuilder.test.tsx @@ -6,7 +6,7 @@ import { vi } from "vitest"; import { HvQueryBuilder, hvQueryBuilderDefaultOperators, - HvQueryBuilderProps, + type HvQueryBuilderProps, } from "."; import { HvButton } from "../Button"; diff --git a/packages/core/src/QueryBuilder/QueryBuilder.tsx b/packages/core/src/QueryBuilder/QueryBuilder.tsx index 8eb0c1466f..e532f4d6ee 100644 --- a/packages/core/src/QueryBuilder/QueryBuilder.tsx +++ b/packages/core/src/QueryBuilder/QueryBuilder.tsx @@ -6,7 +6,7 @@ import { import { useControlled } from "../hooks/useControlled"; import { useLabels } from "../hooks/useLabels"; -import { DeepPartial } from "../types/generic"; +import type { DeepPartial } from "../types/generic"; import { isEqual } from "../utils/helpers"; import { ConfirmationDialog } from "./ConfirmationDialog"; import { @@ -18,14 +18,14 @@ import { import { staticClasses, useClasses } from "./QueryBuilder.styles"; import { RuleGroup } from "./RuleGroup"; import { - AskAction, defaultRendererKey, - HvQueryBuilderAttribute, - HvQueryBuilderLabels, - HvQueryBuilderQuery, - HvQueryBuilderQueryCombinator, - HvQueryBuilderQueryOperator, - HvQueryBuilderRenderers, + type AskAction, + type HvQueryBuilderAttribute, + type HvQueryBuilderLabels, + type HvQueryBuilderQuery, + type HvQueryBuilderQueryCombinator, + type HvQueryBuilderQueryOperator, + type HvQueryBuilderRenderers, } from "./types"; import { clearNodeIds, emptyGroup, setNodeIds } from "./utils"; import reducer from "./utils/reducer"; diff --git a/packages/core/src/QueryBuilder/RuleGroup.tsx b/packages/core/src/QueryBuilder/RuleGroup.tsx index 94c82c16cb..7d3a4cbc49 100644 --- a/packages/core/src/QueryBuilder/RuleGroup.tsx +++ b/packages/core/src/QueryBuilder/RuleGroup.tsx @@ -10,7 +10,7 @@ import { HvTypography } from "../Typography"; import { useQueryBuilderContext } from "./Context"; import { useClasses } from "./QueryBuilder.styles"; import { Rule } from "./Rule/Rule"; -import { HvQueryBuilderQueryCombinator, Query } from "./types"; +import type { HvQueryBuilderQueryCombinator, Query } from "./types"; export interface RuleGroupProps { id: React.Key; diff --git a/packages/core/src/QueryBuilder/Value/DateTimeValue.tsx b/packages/core/src/QueryBuilder/Value/DateTimeValue.tsx index 35687a234f..fc36438c39 100644 --- a/packages/core/src/QueryBuilder/Value/DateTimeValue.tsx +++ b/packages/core/src/QueryBuilder/Value/DateTimeValue.tsx @@ -6,7 +6,7 @@ import { theme } from "@hitachivantara/uikit-styles"; import { HvDatePicker } from "../../DatePicker"; import { HvWarningText } from "../../FormElement"; -import { HvTimePicker, HvTimePickerValue } from "../../TimePicker"; +import { HvTimePicker, type HvTimePickerValue } from "../../TimePicker"; import { uniqueId } from "../../utils/helpers"; import { useQueryBuilderContext } from "../Context"; diff --git a/packages/core/src/QueryBuilder/Value/NumericValue.tsx b/packages/core/src/QueryBuilder/Value/NumericValue.tsx index a95c37661b..d56eec39f6 100644 --- a/packages/core/src/QueryBuilder/Value/NumericValue.tsx +++ b/packages/core/src/QueryBuilder/Value/NumericValue.tsx @@ -7,7 +7,7 @@ import { theme } from "@hitachivantara/uikit-styles"; import { HvInput } from "../../Input"; import { uniqueId } from "../../utils/helpers"; import { useQueryBuilderContext } from "../Context"; -import { HvQueryBuilderNumericRange } from "../types"; +import type { HvQueryBuilderNumericRange } from "../types"; const { useClasses } = createClasses("HvQueryBuilderNumericValue", { root: {}, diff --git a/packages/core/src/QueryBuilder/Value/TextValue.tsx b/packages/core/src/QueryBuilder/Value/TextValue.tsx index a2fd55dfb3..b46d761365 100644 --- a/packages/core/src/QueryBuilder/Value/TextValue.tsx +++ b/packages/core/src/QueryBuilder/Value/TextValue.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { createClasses } from "@hitachivantara/uikit-react-utils"; -import { HvFormStatus } from "../../FormElement"; +import type { HvFormStatus } from "../../FormElement"; import { HvInput } from "../../Input"; import { useQueryBuilderContext } from "../Context"; diff --git a/packages/core/src/QueryBuilder/Value/Value.tsx b/packages/core/src/QueryBuilder/Value/Value.tsx index dc185325e6..4add0beb99 100644 --- a/packages/core/src/QueryBuilder/Value/Value.tsx +++ b/packages/core/src/QueryBuilder/Value/Value.tsx @@ -1,8 +1,8 @@ import { useQueryBuilderContext } from "../Context"; import { defaultRendererKey, - HvQueryBuilderRendererProps, - ValueRenderer, + type HvQueryBuilderRendererProps, + type ValueRenderer, } from "../types"; import { BooleanValue } from "./BooleanValue"; import { DateTimeValue } from "./DateTimeValue"; diff --git a/packages/core/src/QueryBuilder/stories/CustomRenderers.tsx b/packages/core/src/QueryBuilder/stories/CustomRenderers.tsx index f71785c03e..c4784fcb7f 100644 --- a/packages/core/src/QueryBuilder/stories/CustomRenderers.tsx +++ b/packages/core/src/QueryBuilder/stories/CustomRenderers.tsx @@ -4,13 +4,13 @@ import { HvDropdown, HvQueryBuilder, hvQueryBuilderDefaultOperators, - HvQueryBuilderProps, - HvQueryBuilderRendererProps, HvSlider, HvTagsInput, - HvTagsInputProps, theme, useQueryBuilderContext, + type HvQueryBuilderProps, + type HvQueryBuilderRendererProps, + type HvTagsInputProps, } from "@hitachivantara/uikit-react-core"; const attributes: HvQueryBuilderProps["attributes"] = { diff --git a/packages/core/src/QueryBuilder/stories/Main.tsx b/packages/core/src/QueryBuilder/stories/Main.tsx index 3f862cd8bc..5d0eae868a 100644 --- a/packages/core/src/QueryBuilder/stories/Main.tsx +++ b/packages/core/src/QueryBuilder/stories/Main.tsx @@ -1,6 +1,6 @@ import { HvQueryBuilder, - HvQueryBuilderProps, + type HvQueryBuilderProps, } from "@hitachivantara/uikit-react-core"; const attributes = { diff --git a/packages/core/src/QueryBuilder/types.ts b/packages/core/src/QueryBuilder/types.ts index 79cc92e5e0..a7dd740648 100644 --- a/packages/core/src/QueryBuilder/types.ts +++ b/packages/core/src/QueryBuilder/types.ts @@ -1,4 +1,4 @@ -import { HvOptional } from "../types/generic"; +import type { HvOptional } from "../types/generic"; export const defaultRendererKey = "DEFAULT"; @@ -40,8 +40,10 @@ export type HvQueryBuilderQueryRuleValue = export type HvQueryBuilderQueryRule = HvOptional; -export interface HvQueryBuilderQueryGroup - extends Omit, "rules"> { +export interface HvQueryBuilderQueryGroup extends Omit< + HvOptional, + "rules" +> { rules: Array; } diff --git a/packages/core/src/QueryBuilder/utils/index.tsx b/packages/core/src/QueryBuilder/utils/index.tsx index 602c439af9..363be9cdc7 100644 --- a/packages/core/src/QueryBuilder/utils/index.tsx +++ b/packages/core/src/QueryBuilder/utils/index.tsx @@ -1,5 +1,5 @@ import { isEqual, uniqueId } from "../../utils/helpers"; -import { +import type { HvQueryBuilderQueryGroup, HvQueryBuilderQueryRule, Query, diff --git a/packages/core/src/QueryBuilder/utils/reducer.tsx b/packages/core/src/QueryBuilder/utils/reducer.tsx index cd55f36c7e..0ed94e1154 100644 --- a/packages/core/src/QueryBuilder/utils/reducer.tsx +++ b/packages/core/src/QueryBuilder/utils/reducer.tsx @@ -1,6 +1,6 @@ -import { Reducer } from "react"; +import type { Reducer } from "react"; -import { HvQueryBuilderQueryRule, Query, QueryAction } from "../types"; +import type { HvQueryBuilderQueryRule, Query, QueryAction } from "../types"; import { emptyGroup, emptyRule, findNodeById, findParentById } from "./index"; const reducer: Reducer = (state, action) => { diff --git a/packages/core/src/Radio/Radio.stories.tsx b/packages/core/src/Radio/Radio.stories.tsx index 233eae2527..5136fef87d 100644 --- a/packages/core/src/Radio/Radio.stories.tsx +++ b/packages/core/src/Radio/Radio.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvBaseRadio, HvRadio, - HvRadioProps, + type HvRadioProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Radio/Radio.test.tsx b/packages/core/src/Radio/Radio.test.tsx index 605244812e..20b2580c1b 100644 --- a/packages/core/src/Radio/Radio.test.tsx +++ b/packages/core/src/Radio/Radio.test.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { fireEvent, render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { HvRadio, HvRadioProps } from "./Radio"; +import { HvRadio, type HvRadioProps } from "./Radio"; const RadioSample = () => { const [checkedValue, setCheckedValue] = useState(null); diff --git a/packages/core/src/Radio/Radio.tsx b/packages/core/src/Radio/Radio.tsx index 2393469dd0..dba230a3f6 100644 --- a/packages/core/src/Radio/Radio.tsx +++ b/packages/core/src/Radio/Radio.tsx @@ -1,5 +1,5 @@ import { forwardRef, useCallback, useState } from "react"; -import { RadioProps as MuiRadioProps } from "@mui/material/Radio"; +import type { RadioProps as MuiRadioProps } from "@mui/material/Radio"; import { useDefaultProps, type ExtractNames, @@ -9,9 +9,9 @@ import { HvBaseRadio } from "../BaseRadio"; import { HvFormElement, HvLabel, - HvLabelProps, HvWarningText, isInvalid, + type HvLabelProps, } from "../FormElement"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; @@ -24,8 +24,10 @@ export type HvRadioClasses = ExtractNames; export type HvRadioStatus = "standBy" | "valid" | "invalid"; -export interface HvRadioProps - extends Omit { +export interface HvRadioProps extends Omit< + MuiRadioProps, + "onChange" | "classes" +> { /** * A Jss Object used to override or extend the styles applied to the radio button. */ diff --git a/packages/core/src/RadioGroup/RadioGroup.stories.tsx b/packages/core/src/RadioGroup/RadioGroup.stories.tsx index dbf86e29be..35d3c6d911 100644 --- a/packages/core/src/RadioGroup/RadioGroup.stories.tsx +++ b/packages/core/src/RadioGroup/RadioGroup.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvRadio, HvRadioGroup, - HvRadioGroupProps, + type HvRadioGroupProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/RadioGroup/RadioGroup.test.tsx b/packages/core/src/RadioGroup/RadioGroup.test.tsx index a1a51be2a7..a16940d95b 100644 --- a/packages/core/src/RadioGroup/RadioGroup.test.tsx +++ b/packages/core/src/RadioGroup/RadioGroup.test.tsx @@ -3,7 +3,7 @@ import { render } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvFormStatus } from "../FormElement"; +import type { HvFormStatus } from "../FormElement"; import { HvRadio } from "../Radio"; import { HvRadioGroup } from "./RadioGroup"; diff --git a/packages/core/src/RadioGroup/RadioGroup.tsx b/packages/core/src/RadioGroup/RadioGroup.tsx index e50d6751b5..32acf8b013 100644 --- a/packages/core/src/RadioGroup/RadioGroup.tsx +++ b/packages/core/src/RadioGroup/RadioGroup.tsx @@ -10,11 +10,15 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvFormElement, HvFormStatus, HvWarningText } from "../FormElement"; +import { + HvFormElement, + HvWarningText, + type HvFormStatus, +} from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { setId } from "../utils/setId"; import { staticClasses, useClasses } from "./RadioGroup.styles"; @@ -22,8 +26,10 @@ export { staticClasses as radioGroupClasses }; export type HvRadioGroupClasses = ExtractNames; -export interface HvRadioGroupProps - extends HvBaseProps { +export interface HvRadioGroupProps extends HvBaseProps< + HTMLDivElement, + "onChange" +> { /** * The form element name. * diff --git a/packages/core/src/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.tsx b/packages/core/src/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.tsx index b08bbe2af5..1bae6fbee3 100644 --- a/packages/core/src/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.tsx +++ b/packages/core/src/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.tsx @@ -5,17 +5,18 @@ import { import { HvOverflowTooltip, - HvOverflowTooltipProps, + type HvOverflowTooltipProps, } from "../../OverflowTooltip"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { staticClasses, useClasses } from "./HorizontalScrollListItem.styles"; export { staticClasses as horizontalScrollListItemClasses }; export type HvHorizontalScrollListItemClasses = ExtractNames; -export interface HvHorizontalScrollListItemProps - extends HvBaseProps { +export interface HvHorizontalScrollListItemProps extends HvBaseProps< + HTMLDivElement | HTMLAnchorElement +> { /** The text to render. */ label?: React.ReactNode; /** Whether the element is selected. */ diff --git a/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.stories.tsx b/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.stories.tsx index f102fc7726..892990d12f 100644 --- a/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.stories.tsx +++ b/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.stories.tsx @@ -3,8 +3,8 @@ import { HvContainer, HvPanel, HvScrollToHorizontal, - HvScrollToHorizontalProps, HvTypography, + type HvScrollToHorizontalProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.tsx b/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.tsx index bb53abd8cc..cc52e8b138 100644 --- a/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.tsx +++ b/packages/core/src/ScrollToHorizontal/ScrollToHorizontal.tsx @@ -7,7 +7,7 @@ import { import { theme } from "@hitachivantara/uikit-styles"; import { useScrollTo, type HvScrollToOption } from "../hooks/useScrollTo"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { isKey } from "../utils/keyboardUtils"; import { HvHorizontalScrollListItem } from "./HorizontalScrollListItem"; import { staticClasses, useClasses } from "./ScrollToHorizontal.styles"; @@ -16,8 +16,10 @@ export { staticClasses as scrollToHorizontalClasses }; export type HvScrollToHorizontalClasses = ExtractNames; -export interface HvScrollToHorizontalProps - extends HvBaseProps { +export interface HvScrollToHorizontalProps extends HvBaseProps< + HTMLOListElement, + "onChange" | "onClick" +> { /** An Array of Objects with Label and Value. Label is the displayed Element and Value is the local navigation location applied */ options: HvScrollToOption[]; /** diff --git a/packages/core/src/ScrollToVertical/ScrollToVertical.stories.tsx b/packages/core/src/ScrollToVertical/ScrollToVertical.stories.tsx index 95c5037bc1..d5699bde3b 100644 --- a/packages/core/src/ScrollToVertical/ScrollToVertical.stories.tsx +++ b/packages/core/src/ScrollToVertical/ScrollToVertical.stories.tsx @@ -3,8 +3,8 @@ import { HvContainer, HvPanel, HvScrollToVertical, - HvScrollToVerticalProps, HvTypography, + type HvScrollToVerticalProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/ScrollToVertical/ScrollToVertical.tsx b/packages/core/src/ScrollToVertical/ScrollToVertical.tsx index 50e960ce98..37fcef89c2 100644 --- a/packages/core/src/ScrollToVertical/ScrollToVertical.tsx +++ b/packages/core/src/ScrollToVertical/ScrollToVertical.tsx @@ -4,7 +4,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { useScrollTo, type HvScrollToOption } from "../hooks/useScrollTo"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { isKey } from "../utils/keyboardUtils"; import { calculateOffset, @@ -17,8 +17,10 @@ export { staticClasses as scrollToVerticalClasses }; export type HvScrollToVerticalClasses = ExtractNames; -export interface HvScrollToVerticalProps - extends HvBaseProps { +export interface HvScrollToVerticalProps extends HvBaseProps< + HTMLOListElement, + "onChange" | "onClick" +> { /** An Array of Objects with Label and Value. Label is the displayed Element and Value is the local navigation location applied */ options: HvScrollToOption[]; /** diff --git a/packages/core/src/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.tsx b/packages/core/src/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.tsx index bd428b1fe8..18d3f30901 100644 --- a/packages/core/src/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.tsx +++ b/packages/core/src/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.tsx @@ -3,16 +3,17 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvTooltip, HvTooltipProps } from "../../Tooltip"; -import { HvBaseProps } from "../../types/generic"; +import { HvTooltip, type HvTooltipProps } from "../../Tooltip"; +import type { HvBaseProps } from "../../types/generic"; import { staticClasses, useClasses } from "./VerticalScrollListItem.styles"; export { staticClasses as verticalScrollListItemClasses }; export type HvVerticalScrollListItemClasses = ExtractNames; -export interface HvVerticalScrollListItemProps - extends HvBaseProps { +export interface HvVerticalScrollListItemProps extends HvBaseProps< + HTMLDivElement | HTMLAnchorElement +> { /** A Jss Object used to override or extend the styles applied. */ classes?: HvVerticalScrollListItemClasses; /** Whether the element is selected. */ diff --git a/packages/core/src/SearchInput/SearchInput.stories.tsx b/packages/core/src/SearchInput/SearchInput.stories.tsx index f05912a427..20314d3b8a 100644 --- a/packages/core/src/SearchInput/SearchInput.stories.tsx +++ b/packages/core/src/SearchInput/SearchInput.stories.tsx @@ -1,5 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvInputProps, HvSearchInput } from "@hitachivantara/uikit-react-core"; +import { + HvSearchInput, + type HvInputProps, +} from "@hitachivantara/uikit-react-core"; const meta: Meta = { title: "Components/Search Input", diff --git a/packages/core/src/SearchInput/SearchInput.tsx b/packages/core/src/SearchInput/SearchInput.tsx index c474074b3d..f430b13573 100644 --- a/packages/core/src/SearchInput/SearchInput.tsx +++ b/packages/core/src/SearchInput/SearchInput.tsx @@ -3,7 +3,7 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; import { HvAdornment } from "../FormElement"; import { HvIcon } from "../icons"; -import { HvInput, HvInputProps } from "../Input"; +import { HvInput, type HvInputProps } from "../Input"; import { useClasses } from "./SearchInput.styles"; export interface HvSearchInputProps extends HvInputProps {} diff --git a/packages/core/src/Section/Section.stories.tsx b/packages/core/src/Section/Section.stories.tsx index f280cb8e91..d097d37128 100644 --- a/packages/core/src/Section/Section.stories.tsx +++ b/packages/core/src/Section/Section.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvTypography } from "@hitachivantara/uikit-react-core"; import { HvButton } from "../Button"; -import { HvSection, HvSectionProps } from "./Section"; +import { HvSection, type HvSectionProps } from "./Section"; const meta: Meta = { title: "Components/Section", diff --git a/packages/core/src/Section/Section.tsx b/packages/core/src/Section/Section.tsx index f239b9e96c..acfb61917a 100644 --- a/packages/core/src/Section/Section.tsx +++ b/packages/core/src/Section/Section.tsx @@ -4,18 +4,20 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../Button"; +import { HvButton, type HvButtonProps } from "../Button"; import { useExpandable } from "../hooks/useExpandable"; import { HvIcon } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Section.styles"; export { staticClasses as sectionClasses }; export type HvSectionClasses = ExtractNames; -export interface HvSectionProps - extends Omit, "title" | "onToggle"> { +export interface HvSectionProps extends Omit< + HvBaseProps, + "title" | "onToggle" +> { /** The title of the section */ title?: React.ReactNode; /** Whether or not the section is expandable. */ diff --git a/packages/core/src/Select/Option.tsx b/packages/core/src/Select/Option.tsx index e7463e4fc8..3d00dc2814 100644 --- a/packages/core/src/Select/Option.tsx +++ b/packages/core/src/Select/Option.tsx @@ -1,5 +1,5 @@ import { useRef } from "react"; -import { OptionOwnProps, useOption } from "@mui/base"; +import { useOption, type OptionOwnProps } from "@mui/base"; import { useForkRef } from "@mui/material/utils"; import { createClasses, @@ -7,7 +7,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvListItem, HvListItemProps } from "../ListContainer"; +import { HvListItem, type HvListItemProps } from "../ListContainer"; import { fixedForwardRef } from "../types/generic"; import { outlineStyles } from "../utils/focusUtils"; @@ -23,7 +23,8 @@ export { staticClasses as optionClasses }; export type HvOptionClasses = ExtractNames; export interface HvOptionProps - extends Omit, + extends + Omit, Pick, "disabled" | "label" | "value"> { classes?: HvOptionClasses; } diff --git a/packages/core/src/Select/OptionGroup.tsx b/packages/core/src/Select/OptionGroup.tsx index 112e5a5d84..a5cc27ac17 100644 --- a/packages/core/src/Select/OptionGroup.tsx +++ b/packages/core/src/Select/OptionGroup.tsx @@ -1,5 +1,5 @@ import { forwardRef } from "react"; -import { OptionGroup, OptionGroupProps } from "@mui/base"; +import { OptionGroup, type OptionGroupProps } from "@mui/base"; import { createClasses, useDefaultProps, diff --git a/packages/core/src/Select/Select.stories.tsx b/packages/core/src/Select/Select.stories.tsx index 540cd0e8c2..8a7d3860e9 100644 --- a/packages/core/src/Select/Select.stories.tsx +++ b/packages/core/src/Select/Select.stories.tsx @@ -4,7 +4,7 @@ import { HvOption, HvOptionGroup, HvSelect, - HvSelectProps, + type HvSelectProps, } from "@hitachivantara/uikit-react-core"; export default { diff --git a/packages/core/src/Select/Select.test.tsx b/packages/core/src/Select/Select.test.tsx index 9662c224e2..66a1db2951 100644 --- a/packages/core/src/Select/Select.test.tsx +++ b/packages/core/src/Select/Select.test.tsx @@ -4,7 +4,7 @@ import { describe, expect, it, vi } from "vitest"; import { HvOption } from "./Option"; import { HvOptionGroup } from "./OptionGroup"; -import { HvSelect, HvSelectProps } from "./Select"; +import { HvSelect, type HvSelectProps } from "./Select"; const name = "MySelect"; diff --git a/packages/core/src/Select/Select.tsx b/packages/core/src/Select/Select.tsx index 2a8bad85ef..d8c942a2b7 100644 --- a/packages/core/src/Select/Select.tsx +++ b/packages/core/src/Select/Select.tsx @@ -15,13 +15,13 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvDropdownPanel } from "../BaseDropdown"; -import { HvButtonProps } from "../Button"; +import type { HvButtonProps } from "../Button"; import { HvDropdownButton } from "../DropdownButton"; import { HvFormElement, - HvFormElementProps, - HvFormStatus, HvWarningText, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useUniqueId } from "../hooks/useUniqueId"; @@ -60,7 +60,9 @@ export type HvSelectClasses = ExtractNames; export interface HvSelectProps< OptionValue extends {}, Multiple extends boolean = false, -> extends Omit, +> + extends + Omit, Pick< UseSelectParameters, | "name" diff --git a/packages/core/src/SelectionList/SelectionList.stories.tsx b/packages/core/src/SelectionList/SelectionList.stories.tsx index 587c86dc76..0032af1b35 100644 --- a/packages/core/src/SelectionList/SelectionList.stories.tsx +++ b/packages/core/src/SelectionList/SelectionList.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvListItem, HvSelectionList, - HvSelectionListProps, + type HvSelectionListProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/SelectionList/SelectionList.tsx b/packages/core/src/SelectionList/SelectionList.tsx index bdc3f07e8f..91511041ed 100644 --- a/packages/core/src/SelectionList/SelectionList.tsx +++ b/packages/core/src/SelectionList/SelectionList.tsx @@ -15,15 +15,15 @@ import { import { HvFormElement, - HvFormStatus, HvInfoMessage, HvLabel, HvWarningText, + type HvFormStatus, } from "../FormElement"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; import { HvListContainer } from "../ListContainer"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { isKey } from "../utils/keyboardUtils"; import { multiSelectionEventHandler } from "../utils/multiSelectionEventHandler"; import { setId } from "../utils/setId"; @@ -33,8 +33,10 @@ export { staticClasses as selectionListClasses }; export type HvSelectionListClasses = ExtractNames; -export interface HvSelectionListProps - extends HvBaseProps { +export interface HvSelectionListProps extends HvBaseProps< + HTMLUListElement, + "onChange" +> { /** The form element name. */ name?: string; /** diff --git a/packages/core/src/SimpleGrid/SimpleGrid.stories.tsx b/packages/core/src/SimpleGrid/SimpleGrid.stories.tsx index 73a4a0d7f2..d59b78e482 100644 --- a/packages/core/src/SimpleGrid/SimpleGrid.stories.tsx +++ b/packages/core/src/SimpleGrid/SimpleGrid.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvSimpleGrid, - HvSimpleGridProps, + type HvSimpleGridProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/SimpleGrid/SimpleGrid.styles.tsx b/packages/core/src/SimpleGrid/SimpleGrid.styles.tsx index b8fc3a322f..9ecf52ce16 100644 --- a/packages/core/src/SimpleGrid/SimpleGrid.styles.tsx +++ b/packages/core/src/SimpleGrid/SimpleGrid.styles.tsx @@ -1,5 +1,5 @@ import { createClasses } from "@hitachivantara/uikit-react-utils"; -import { HvBreakpoints, theme } from "@hitachivantara/uikit-styles"; +import { theme, type HvBreakpoints } from "@hitachivantara/uikit-styles"; import type { HvGridBreakpoint } from "./SimpleGrid"; diff --git a/packages/core/src/SimpleGrid/SimpleGrid.tsx b/packages/core/src/SimpleGrid/SimpleGrid.tsx index 86ddceb912..fde54f0f9a 100644 --- a/packages/core/src/SimpleGrid/SimpleGrid.tsx +++ b/packages/core/src/SimpleGrid/SimpleGrid.tsx @@ -2,9 +2,9 @@ import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBreakpoints } from "@hitachivantara/uikit-styles"; +import type { HvBreakpoints } from "@hitachivantara/uikit-styles"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { getContainerStyle, staticClasses, diff --git a/packages/core/src/Skeleton/Skeleton.stories.tsx b/packages/core/src/Skeleton/Skeleton.stories.tsx index b0b215b7c9..19d7098970 100644 --- a/packages/core/src/Skeleton/Skeleton.stories.tsx +++ b/packages/core/src/Skeleton/Skeleton.stories.tsx @@ -12,9 +12,9 @@ import { HvRadio, HvRadioGroup, HvSkeleton, - HvSkeletonProps, HvSwitch, HvTypography, + type HvSkeletonProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/Skeleton/Skeleton.tsx b/packages/core/src/Skeleton/Skeleton.tsx index 8a3c2b633f..f8b30894a2 100644 --- a/packages/core/src/Skeleton/Skeleton.tsx +++ b/packages/core/src/Skeleton/Skeleton.tsx @@ -3,7 +3,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Skeleton.styles"; export { staticClasses as skeletonClasses }; diff --git a/packages/core/src/Slider/Slider.stories.tsx b/packages/core/src/Slider/Slider.stories.tsx index c8385962dd..a984d34f4e 100644 --- a/packages/core/src/Slider/Slider.stories.tsx +++ b/packages/core/src/Slider/Slider.stories.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvSlider, HvSliderProps } from "@hitachivantara/uikit-react-core"; +import { HvSlider, type HvSliderProps } from "@hitachivantara/uikit-react-core"; const meta: Meta = { title: "Components/Slider", diff --git a/packages/core/src/Slider/Slider.tsx b/packages/core/src/Slider/Slider.tsx index c48a6db637..2530fb5888 100644 --- a/packages/core/src/Slider/Slider.tsx +++ b/packages/core/src/Slider/Slider.tsx @@ -6,24 +6,28 @@ import { useRef, useState, } from "react"; -import Slider, { SliderProps, SliderRef } from "rc-slider"; +import Slider, { type SliderProps, type SliderRef } from "rc-slider"; import Tooltip from "rc-tooltip"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvFormElement, HvFormStatus, HvWarningText } from "../FormElement"; +import { + HvFormElement, + HvWarningText, + type HvFormStatus, +} from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; -import { HvInputProps } from "../Input"; -import { HvBaseProps } from "../types/generic"; +import type { HvInputProps } from "../Input"; +import type { HvBaseProps } from "../types/generic"; import { getElementById } from "../utils/document"; import { setId } from "../utils/setId"; import { sliderStyles, staticClasses, useClasses } from "./Slider.styles"; import { HvSliderInput } from "./SliderInput/SliderInput"; -import { HvKnobProperty, HvMarkProperty } from "./types"; +import type { HvKnobProperty, HvMarkProperty } from "./types"; import { calculateStepValue, convertStatusToArray, @@ -44,8 +48,10 @@ export { staticClasses as sliderClasses }; export type HvSliderClasses = ExtractNames; -export interface HvSliderProps - extends HvBaseProps { +export interface HvSliderProps extends HvBaseProps< + HTMLDivElement, + "onChange" | "onBlur" +> { /** The slider name. */ name?: string; /** The label of the slider. If not provided, an aria-label or aria-labelledby must be inputted via sliderProps. */ diff --git a/packages/core/src/Slider/SliderInput/SliderInput.tsx b/packages/core/src/Slider/SliderInput/SliderInput.tsx index f2be661ef8..b4f4e292a4 100644 --- a/packages/core/src/Slider/SliderInput/SliderInput.tsx +++ b/packages/core/src/Slider/SliderInput/SliderInput.tsx @@ -1,9 +1,9 @@ import { Fragment, useEffect, useState } from "react"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvFormStatus } from "../../FormElement"; -import { HvInput, HvInputProps } from "../../Input"; -import { HvBaseProps } from "../../types/generic"; +import type { HvFormStatus } from "../../FormElement"; +import { HvInput, type HvInputProps } from "../../Input"; +import type { HvBaseProps } from "../../types/generic"; import { setId } from "../../utils/setId"; import { knobsValuesToString, stringValuesToKnobs } from "../utils"; import { staticClasses, useClasses } from "./SliderInput.styles"; @@ -12,8 +12,10 @@ export { staticClasses as sliderInputClasses }; export type HvSliderInputClasses = ExtractNames; -export interface HvSliderInputProps - extends HvBaseProps { +export interface HvSliderInputProps extends HvBaseProps< + HTMLDivElement, + "onChange" +> { /** * Used to generate the aria-label for the inputs. */ diff --git a/packages/core/src/Slider/utils.ts b/packages/core/src/Slider/utils.ts index fd291ba39d..64095523d3 100644 --- a/packages/core/src/Slider/utils.ts +++ b/packages/core/src/Slider/utils.ts @@ -2,7 +2,7 @@ import { theme } from "@hitachivantara/uikit-styles"; import type { HvFormStatus } from "../FormElement"; import { sliderStyles as styles } from "./Slider.styles"; -import { HvKnobProperty, HvMarkProperty } from "./types"; +import type { HvKnobProperty, HvMarkProperty } from "./types"; /** * Transform the scaled values into knobs positions. diff --git a/packages/core/src/Snackbar/Snackbar.stories.tsx b/packages/core/src/Snackbar/Snackbar.stories.tsx index 4a2dffae9d..38a06caef2 100644 --- a/packages/core/src/Snackbar/Snackbar.stories.tsx +++ b/packages/core/src/Snackbar/Snackbar.stories.tsx @@ -3,7 +3,7 @@ import { HvOverflowTooltip, HvSnackbar, HvSnackbarContent, - HvSnackbarProps, + type HvSnackbarProps, } from "@hitachivantara/uikit-react-core"; import { Deploy, Info } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Snackbar/Snackbar.test.tsx b/packages/core/src/Snackbar/Snackbar.test.tsx index a30135700a..6e2b469714 100644 --- a/packages/core/src/Snackbar/Snackbar.test.tsx +++ b/packages/core/src/Snackbar/Snackbar.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; -import { HvSnackbar, HvSnackbarProps } from "./Snackbar"; +import { HvSnackbar, type HvSnackbarProps } from "./Snackbar"; const snackbarLabel = "My snackbar"; diff --git a/packages/core/src/Snackbar/Snackbar.tsx b/packages/core/src/Snackbar/Snackbar.tsx index 7acaea8261..ae2c8823a6 100644 --- a/packages/core/src/Snackbar/Snackbar.tsx +++ b/packages/core/src/Snackbar/Snackbar.tsx @@ -1,31 +1,33 @@ import { forwardRef, useCallback } from "react"; -import Slide, { SlideProps } from "@mui/material/Slide"; +import Slide, { type SlideProps } from "@mui/material/Slide"; import MuiSnackbar, { - SnackbarProps as MuiSnackbarProps, - SnackbarCloseReason, - SnackbarOrigin, + type SnackbarProps as MuiSnackbarProps, + type SnackbarCloseReason, + type SnackbarOrigin, } from "@mui/material/Snackbar"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvActionGeneric, HvActionsGenericProps } from "../ActionsGeneric"; -import { HvCalloutProps } from "../utils/Callout"; +import type { HvActionGeneric, HvActionsGenericProps } from "../ActionsGeneric"; +import type { HvCalloutProps } from "../utils/Callout"; import { capitalize } from "../utils/helpers"; import { staticClasses, useClasses } from "./Snackbar.styles"; import { HvSnackbarContent, - HvSnackbarContentProps, - HvSnackbarVariant, + type HvSnackbarContentProps, + type HvSnackbarVariant, } from "./SnackbarContent"; export { staticClasses as snackbarClasses }; export type HvSnackbarClasses = ExtractNames; -export interface HvSnackbarProps - extends Omit { +export interface HvSnackbarProps extends Omit< + MuiSnackbarProps, + "action" | "classes" | "children" +> { /** If true, Snackbar is open. */ open?: boolean; /** diff --git a/packages/core/src/Snackbar/SnackbarContent/SnackbarContent.tsx b/packages/core/src/Snackbar/SnackbarContent/SnackbarContent.tsx index 1af5b71898..00a556adc4 100644 --- a/packages/core/src/Snackbar/SnackbarContent/SnackbarContent.tsx +++ b/packages/core/src/Snackbar/SnackbarContent/SnackbarContent.tsx @@ -6,11 +6,14 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvActionGeneric, HvActionsGenericProps } from "../../ActionsGeneric"; +import type { + HvActionGeneric, + HvActionsGenericProps, +} from "../../ActionsGeneric"; import { HvCallout, - HvCalloutProps, - HvCalloutVariant, + type HvCalloutProps, + type HvCalloutVariant, } from "../../utils/Callout"; import { staticClasses, useClasses } from "./SnackbarContent.styles"; @@ -23,8 +26,10 @@ export type HvSnackbarVariant = HvCalloutVariant; const isActionGeneric = (action: any): action is HvActionGeneric => action && typeof action === "object" && "id" in action && "label" in action; -export interface HvSnackbarContentProps - extends Omit { +export interface HvSnackbarContentProps extends Omit< + MuiSnackbarContentProps, + "variant" | "action" | "classes" +> { /** The message to display. */ label?: React.ReactNode; /** Variant of the snackbar. */ diff --git a/packages/core/src/SnackbarProvider/SnackbarProvider.stories.tsx b/packages/core/src/SnackbarProvider/SnackbarProvider.stories.tsx index 97c8107913..be4ef11262 100644 --- a/packages/core/src/SnackbarProvider/SnackbarProvider.stories.tsx +++ b/packages/core/src/SnackbarProvider/SnackbarProvider.stories.tsx @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvSnackbarProvider } from "@hitachivantara/uikit-react-core"; +import type { HvSnackbarProvider } from "@hitachivantara/uikit-react-core"; import { SnackbarProviderButtons } from "./stories/SnackbarProviderButtons"; diff --git a/packages/core/src/SnackbarProvider/SnackbarProvider.tsx b/packages/core/src/SnackbarProvider/SnackbarProvider.tsx index 5d89dd05da..79a37facb1 100644 --- a/packages/core/src/SnackbarProvider/SnackbarProvider.tsx +++ b/packages/core/src/SnackbarProvider/SnackbarProvider.tsx @@ -1,11 +1,11 @@ import { forwardRef, useCallback, useMemo } from "react"; -import { SnackbarOrigin } from "@mui/material/Snackbar"; +import type { SnackbarOrigin } from "@mui/material/Snackbar"; import { - OptionsObject, SnackbarContent, SnackbarProvider, - SnackbarProviderProps, useSnackbar, + type OptionsObject, + type SnackbarProviderProps, } from "notistack"; import { useDefaultProps, @@ -14,8 +14,8 @@ import { import { HvSnackbarContent, - HvSnackbarContentProps, - HvSnackbarVariant, + type HvSnackbarContentProps, + type HvSnackbarVariant, } from "../Snackbar/SnackbarContent"; import { staticClasses, useClasses } from "./SnackbarProvider.styles"; @@ -42,8 +42,10 @@ export interface HvSnackbarProviderProps { container?: SnackbarProviderProps["domRoot"]; } -export interface HvNotistackSnackMessageProps - extends Omit { +export interface HvNotistackSnackMessageProps extends Omit< + OptionsObject, + "variant" +> { /** Id to be applied to the root node. */ id?: string; /** class name to apply on the root node */ diff --git a/packages/core/src/Stack/Stack.stories.tsx b/packages/core/src/Stack/Stack.stories.tsx index 12ce8adfd4..4a5b788317 100644 --- a/packages/core/src/Stack/Stack.stories.tsx +++ b/packages/core/src/Stack/Stack.stories.tsx @@ -8,11 +8,11 @@ import { HvCardHeader, HvPanel, HvStack, - HvStackProps, HvToggleButton, HvTypography, theme, useWidth, + type HvStackProps, } from "@hitachivantara/uikit-react-core"; import { Favorite, diff --git a/packages/core/src/Stack/Stack.tsx b/packages/core/src/Stack/Stack.tsx index 4352b0556b..b4d6614e31 100644 --- a/packages/core/src/Stack/Stack.tsx +++ b/packages/core/src/Stack/Stack.tsx @@ -1,17 +1,17 @@ import { Children, useCallback, useMemo, useRef } from "react"; import MuiDivider, { - DividerProps as MuiDividerProps, + type DividerProps as MuiDividerProps, } from "@mui/material/Divider"; import { useTheme } from "@mui/material/styles"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBreakpoints } from "@hitachivantara/uikit-styles"; +import type { HvBreakpoints } from "@hitachivantara/uikit-styles"; import { HvFocus } from "../Focus"; import { useWidth } from "../hooks/useWidth"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { staticClasses, useClasses } from "./Stack.styles"; export { staticClasses as stackClasses }; diff --git a/packages/core/src/StatusIcon/StatusIcon.stories.tsx b/packages/core/src/StatusIcon/StatusIcon.stories.tsx index 1d392a31a6..a1b196237a 100644 --- a/packages/core/src/StatusIcon/StatusIcon.stories.tsx +++ b/packages/core/src/StatusIcon/StatusIcon.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvStatusIcon, - HvStatusIconProps, + type HvStatusIconProps, } from "@hitachivantara/uikit-react-core"; const meta: Meta = { diff --git a/packages/core/src/StatusIcon/StatusIcon.tsx b/packages/core/src/StatusIcon/StatusIcon.tsx index 92af418599..850fdb26dc 100644 --- a/packages/core/src/StatusIcon/StatusIcon.tsx +++ b/packages/core/src/StatusIcon/StatusIcon.tsx @@ -4,11 +4,11 @@ import { useTheme, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvSize } from "@hitachivantara/uikit-styles"; +import type { HvSize } from "@hitachivantara/uikit-styles"; import { HvIconContainer } from "../IconContainer"; import { HvIcon, SvgBase } from "../icons"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import type { HvCalloutVariant } from "../utils/Callout"; import { staticClasses, useClasses } from "./StatusIcon.styles"; diff --git a/packages/core/src/Switch/Switch.stories.tsx b/packages/core/src/Switch/Switch.stories.tsx index 1ec19a7f89..6cce5faeb1 100644 --- a/packages/core/src/Switch/Switch.stories.tsx +++ b/packages/core/src/Switch/Switch.stories.tsx @@ -1,12 +1,12 @@ import { useRef, useState } from "react"; import { css } from "@emotion/css"; -import { Decorator, Meta, StoryObj } from "@storybook/react-vite"; +import type { Decorator, Meta, StoryObj } from "@storybook/react-vite"; import { HvBaseSwitch, HvInfoMessage, HvLabel, HvSwitch, - HvSwitchProps, + type HvSwitchProps, } from "@hitachivantara/uikit-react-core"; const decorator: Decorator = (Story) => ( diff --git a/packages/core/src/Switch/Switch.tsx b/packages/core/src/Switch/Switch.tsx index 046ef4b56f..ff7277c8dd 100644 --- a/packages/core/src/Switch/Switch.tsx +++ b/packages/core/src/Switch/Switch.tsx @@ -1,19 +1,19 @@ import { forwardRef, useCallback } from "react"; -import { SwitchProps as MuiSwitchProps } from "@mui/material/Switch"; +import type { SwitchProps as MuiSwitchProps } from "@mui/material/Switch"; import { useDefaultProps, type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; -import { HvBaseSwitch, HvBaseSwitchProps } from "../BaseSwitch"; +import { HvBaseSwitch, type HvBaseSwitchProps } from "../BaseSwitch"; import { HvFormElement, - HvFormStatus, HvLabel, - HvLabelProps, HvWarningText, isInvalid, + type HvFormStatus, + type HvLabelProps, } from "../FormElement"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; @@ -24,8 +24,10 @@ export { staticClasses as switchClasses }; export type HvSwitchClasses = ExtractNames; -export interface HvSwitchProps - extends Omit { +export interface HvSwitchProps extends Omit< + MuiSwitchProps, + "color" | "onChange" | "classes" | "size" +> { /** * A Jss Object used to override or extend the styles applied to the switch. */ diff --git a/packages/core/src/Table/Table.tsx b/packages/core/src/Table/Table.tsx index 50e29c0bb1..41cd74ebcb 100644 --- a/packages/core/src/Table/Table.tsx +++ b/packages/core/src/Table/Table.tsx @@ -26,8 +26,7 @@ export type HvTableCellVariant = | "default" | "none"; -export interface HvTableProps - extends React.TableHTMLAttributes { +export interface HvTableProps extends React.TableHTMLAttributes { /** * The component used for the root node. Either a string to use a HTML element or a component. * Defaults to `table`. diff --git a/packages/core/src/Table/TableBody/TableBody.tsx b/packages/core/src/Table/TableBody/TableBody.tsx index 1f74b58f33..b9e0d3287d 100644 --- a/packages/core/src/Table/TableBody/TableBody.tsx +++ b/packages/core/src/Table/TableBody/TableBody.tsx @@ -12,11 +12,11 @@ import { import { HvFocus } from "../../Focus"; import { useForkRef } from "../../hooks/useForkRef"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import TableContext from "../TableContext"; import { TableSectionContext, - TableSectionContextValue, + type TableSectionContextValue, } from "../TableSectionContext"; import { staticClasses, useClasses } from "./TableBody.styles"; @@ -24,8 +24,10 @@ export { staticClasses as tableBodyClasses }; export type HvTableBodyClasses = ExtractNames; -export interface HvTableBodyProps - extends HvBaseProps { +export interface HvTableBodyProps extends HvBaseProps< + HTMLTableSectionElement, + "children" +> { /** * Content to be rendered */ diff --git a/packages/core/src/Table/TableCell/TableCell.tsx b/packages/core/src/Table/TableCell/TableCell.tsx index ad5bf569dc..7f24670b4d 100644 --- a/packages/core/src/Table/TableCell/TableCell.tsx +++ b/packages/core/src/Table/TableCell/TableCell.tsx @@ -5,7 +5,7 @@ import { } from "@hitachivantara/uikit-react-utils"; import { capitalize } from "../../utils/helpers"; -import { +import type { HvTableCellAlign, HvTableCellType, HvTableCellVariant, @@ -18,8 +18,10 @@ export { staticClasses as tableCellClasses }; export type HvTableCellClasses = ExtractNames; -export interface HvTableCellProps - extends Omit, "align"> { +export interface HvTableCellProps extends Omit< + React.TdHTMLAttributes, + "align" +> { /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to td. */ component?: React.ElementType; /** Content to be rendered */ diff --git a/packages/core/src/Table/TableContainer/TableContainer.tsx b/packages/core/src/Table/TableContainer/TableContainer.tsx index 8a0fce72ba..d0f96b9a33 100644 --- a/packages/core/src/Table/TableContainer/TableContainer.tsx +++ b/packages/core/src/Table/TableContainer/TableContainer.tsx @@ -4,15 +4,17 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { staticClasses, useClasses } from "./TableContainer.styles"; export { staticClasses as tableContainerClasses }; export type HvTableContainerClasses = ExtractNames; -export interface HvTableContainerProps - extends HvBaseProps { +export interface HvTableContainerProps extends HvBaseProps< + HTMLDivElement, + "children" +> { /** * Content to be rendered */ diff --git a/packages/core/src/Table/TableHead/TableHead.tsx b/packages/core/src/Table/TableHead/TableHead.tsx index 104c47dc33..a8dbddc652 100644 --- a/packages/core/src/Table/TableHead/TableHead.tsx +++ b/packages/core/src/Table/TableHead/TableHead.tsx @@ -4,11 +4,11 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import TableContext from "../TableContext"; import { TableSectionContext, - TableSectionContextValue, + type TableSectionContextValue, } from "../TableSectionContext"; import { staticClasses, useClasses } from "./TableHead.styles"; @@ -16,8 +16,10 @@ export { staticClasses as tableHeadClasses }; export type HvTableHeadClasses = ExtractNames; -export interface HvTableHeadProps - extends HvBaseProps { +export interface HvTableHeadProps extends HvBaseProps< + HTMLTableSectionElement, + "children" +> { /** * Content to be rendered */ diff --git a/packages/core/src/Table/TableHeader/TableHeader.tsx b/packages/core/src/Table/TableHeader/TableHeader.tsx index 6b505fe108..b6e459d098 100644 --- a/packages/core/src/Table/TableHeader/TableHeader.tsx +++ b/packages/core/src/Table/TableHeader/TableHeader.tsx @@ -4,11 +4,11 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButtonBase, HvButtonBaseProps } from "../../ButtonBase"; +import { HvButtonBase, type HvButtonBaseProps } from "../../ButtonBase"; import { HvIcon } from "../../icons"; -import { HvTypography, HvTypographyProps } from "../../Typography"; +import { HvTypography, type HvTypographyProps } from "../../Typography"; import { capitalize } from "../../utils/helpers"; -import { +import type { HvTableCellAlign, HvTableCellType, HvTableCellVariant, @@ -22,8 +22,10 @@ export { staticClasses as tableHeaderClasses }; export type HvTableHeaderClasses = ExtractNames; -export interface HvTableHeaderProps - extends Omit, "align"> { +export interface HvTableHeaderProps extends Omit< + React.ThHTMLAttributes, + "align" +> { /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to th. */ component?: React.ElementType; /** Content to be rendered */ diff --git a/packages/core/src/Table/TableRow/TableRow.tsx b/packages/core/src/Table/TableRow/TableRow.tsx index ca2587217d..01fa2750bd 100644 --- a/packages/core/src/Table/TableRow/TableRow.tsx +++ b/packages/core/src/Table/TableRow/TableRow.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import TableContext from "../TableContext"; import { TableSectionContext } from "../TableSectionContext"; import { staticClasses, useClasses } from "./TableRow.styles"; @@ -13,8 +13,10 @@ export { staticClasses as tableRowClasses }; export type HvTableRowClasses = ExtractNames; -export interface HvTableRowProps - extends HvBaseProps { +export interface HvTableRowProps extends HvBaseProps< + HTMLTableRowElement, + "children" +> { /** Content to be rendered */ children: React.ReactNode; /** The component used for the root node. Either a string to use a HTML element or a component. Defaults to tbody. */ diff --git a/packages/core/src/Table/TableSection/TableSection.tsx b/packages/core/src/Table/TableSection/TableSection.tsx index 15e2512874..6b05015c1b 100644 --- a/packages/core/src/Table/TableSection/TableSection.tsx +++ b/packages/core/src/Table/TableSection/TableSection.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvSection, HvSectionProps } from "../../Section"; +import { HvSection, type HvSectionProps } from "../../Section"; import { staticClasses, useClasses } from "./TableSection.styles"; export { staticClasses as tableSectionClasses }; diff --git a/packages/core/src/Table/hooks/useHvBulkActions.ts b/packages/core/src/Table/hooks/useHvBulkActions.ts index b2246bfe2c..8ec2c8748a 100644 --- a/packages/core/src/Table/hooks/useHvBulkActions.ts +++ b/packages/core/src/Table/hooks/useHvBulkActions.ts @@ -1,11 +1,11 @@ import { useCallback } from "react"; import { ensurePluginOrder, - Hooks, makePropGetter, - PropGetter, - TableCommonProps, useGetLatest, + type Hooks, + type PropGetter, + type TableCommonProps, } from "react-table"; // #region ##### TYPES ##### diff --git a/packages/core/src/Table/hooks/useHvFilters.ts b/packages/core/src/Table/hooks/useHvFilters.ts index 19378302cb..9ecffddbca 100644 --- a/packages/core/src/Table/hooks/useHvFilters.ts +++ b/packages/core/src/Table/hooks/useHvFilters.ts @@ -1,4 +1,4 @@ -import { Hooks, useFilters } from "react-table"; +import { useFilters, type Hooks } from "react-table"; export type UseFiltersProps = (>( hooks: Hooks, diff --git a/packages/core/src/Table/hooks/useHvGlobalFilter.ts b/packages/core/src/Table/hooks/useHvGlobalFilter.ts index c936ba97a4..e2eb5ba9b3 100644 --- a/packages/core/src/Table/hooks/useHvGlobalFilter.ts +++ b/packages/core/src/Table/hooks/useHvGlobalFilter.ts @@ -1,4 +1,4 @@ -import { Hooks, useGlobalFilter } from "react-table"; +import { useGlobalFilter, type Hooks } from "react-table"; export type UseGlobalFilterProps = (< D extends object = Record, diff --git a/packages/core/src/Table/hooks/useHvHeaderGroups.ts b/packages/core/src/Table/hooks/useHvHeaderGroups.ts index b597be956e..d6d917d8e3 100644 --- a/packages/core/src/Table/hooks/useHvHeaderGroups.ts +++ b/packages/core/src/Table/hooks/useHvHeaderGroups.ts @@ -1,4 +1,4 @@ -import { Hooks } from "react-table"; +import type { Hooks } from "react-table"; // #region ##### TYPES ##### diff --git a/packages/core/src/Table/hooks/useHvPagination.ts b/packages/core/src/Table/hooks/useHvPagination.ts index e5214f6880..93e637ad10 100644 --- a/packages/core/src/Table/hooks/useHvPagination.ts +++ b/packages/core/src/Table/hooks/useHvPagination.ts @@ -1,10 +1,10 @@ import { ensurePluginOrder, - Hooks, makePropGetter, - PropGetter, - TableCommonProps, useGetLatest, + type Hooks, + type PropGetter, + type TableCommonProps, } from "react-table"; // #region ##### TYPES ##### diff --git a/packages/core/src/Table/hooks/useHvResizeColumns.ts b/packages/core/src/Table/hooks/useHvResizeColumns.ts index 005ee2bf07..a33de7ed56 100644 --- a/packages/core/src/Table/hooks/useHvResizeColumns.ts +++ b/packages/core/src/Table/hooks/useHvResizeColumns.ts @@ -1,4 +1,4 @@ -import { ensurePluginOrder, Hooks } from "react-table"; +import { ensurePluginOrder, type Hooks } from "react-table"; // #region ##### TYPES ##### diff --git a/packages/core/src/Table/hooks/useHvRowSelection.tsx b/packages/core/src/Table/hooks/useHvRowSelection.tsx index f5d86001ba..9331d042a5 100644 --- a/packages/core/src/Table/hooks/useHvRowSelection.tsx +++ b/packages/core/src/Table/hooks/useHvRowSelection.tsx @@ -2,13 +2,13 @@ import { useCallback, useMemo } from "react"; import { actions, ensurePluginOrder, - Hooks, - IdType, makePropGetter, - PropGetter, - Row, useGetLatest, useMountedLayoutEffect, + type Hooks, + type IdType, + type PropGetter, + type Row, } from "react-table"; import { HvCheckBox } from "../../CheckBox"; @@ -209,7 +209,7 @@ const defaultGetToggleAllRowsSelectedProps = ( checked: instance.isAllRowsSelected, indeterminate: Boolean( !instance.isAllRowsSelected && - Object.keys(instance.state.selectedRowIds).length, + Object.keys(instance.state.selectedRowIds).length, ), }, ]; @@ -226,7 +226,7 @@ const defaultGetToggleAllPageRowsSelectedProps = ( checked: instance.isAllPageRowsSelected, indeterminate: Boolean( !instance.isAllPageRowsSelected && - instance.page.some(({ id }: any) => instance.state.selectedRowIds[id]), + instance.page.some(({ id }: any) => instance.state.selectedRowIds[id]), ), }, ]; diff --git a/packages/core/src/Table/hooks/useHvRowState.ts b/packages/core/src/Table/hooks/useHvRowState.ts index 5582a35318..780799b3a1 100644 --- a/packages/core/src/Table/hooks/useHvRowState.ts +++ b/packages/core/src/Table/hooks/useHvRowState.ts @@ -1,4 +1,4 @@ -import { Hooks, useRowState } from "react-table"; +import { useRowState, type Hooks } from "react-table"; // #region ##### TYPES ##### diff --git a/packages/core/src/Table/hooks/useHvSortBy.ts b/packages/core/src/Table/hooks/useHvSortBy.ts index 74a0e381a0..2deda21794 100644 --- a/packages/core/src/Table/hooks/useHvSortBy.ts +++ b/packages/core/src/Table/hooks/useHvSortBy.ts @@ -1,4 +1,4 @@ -import { ensurePluginOrder, Hooks } from "react-table"; +import { ensurePluginOrder, type Hooks } from "react-table"; // #region ##### TYPES ##### diff --git a/packages/core/src/Table/hooks/useHvSticky.ts b/packages/core/src/Table/hooks/useHvSticky.ts index 6cfb69c9cf..649ea72b51 100644 --- a/packages/core/src/Table/hooks/useHvSticky.ts +++ b/packages/core/src/Table/hooks/useHvSticky.ts @@ -1,9 +1,9 @@ import { - Hooks, makePropGetter, - PropGetter, - TableCommonProps, useGetLatest, + type Hooks, + type PropGetter, + type TableCommonProps, } from "react-table"; import { theme } from "@hitachivantara/uikit-styles"; diff --git a/packages/core/src/Table/hooks/useHvTable.ts b/packages/core/src/Table/hooks/useHvTable.ts index 1a5aa99987..456caf651a 100644 --- a/packages/core/src/Table/hooks/useHvTable.ts +++ b/packages/core/src/Table/hooks/useHvTable.ts @@ -179,8 +179,8 @@ type HvFooterProps> = interface HvHeaderGroup< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, -> extends HvColumnInstance, - Omit, "headers"> { +> + extends HvColumnInstance, Omit, "headers"> { headers: Array>; } @@ -287,7 +287,9 @@ export type HvTableColumnConfig< export interface HvHooks< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, -> extends Omit, "useOptions">, +> + extends + Omit, "useOptions">, Partial>, Partial>, Partial>, @@ -349,7 +351,8 @@ export interface HvHooks< // #region STATE export interface HvTableState> - extends TableState, + extends + TableState, Partial>, Partial>, Partial>, @@ -368,7 +371,9 @@ export interface HvTableState> export interface HvTableOptions< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, -> extends Omit< +> + extends + Omit< TableOptions, | "columns" | "data" @@ -415,7 +420,9 @@ export interface HvTableOptions< export interface HvTableColumnOptions< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, -> extends Omit, "Header" | "Footer">, +> + extends + Omit, "Header" | "Footer">, Partial>, Partial>, Partial>, @@ -432,7 +439,9 @@ export interface HvTableColumnOptions< export interface HvTableInstance< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, -> extends Omit< +> + extends + Omit< TableInstance, | "pageCount" | "data" @@ -495,7 +504,9 @@ export interface HvTableInstance< export interface HvColumnInstance< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, -> extends Omit< +> + extends + Omit< ColumnInstance, | "Cell" | "columns" @@ -527,7 +538,9 @@ export interface HvColumnInstance< export interface HvRowInstance< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, -> extends Omit, "cells" | "allCells" | "subRows" | "getRowProps">, +> + extends + Omit, "cells" | "allCells" | "subRows" | "getRowProps">, Partial, "subRows" | "values">>, Partial>, Partial, "subRows">>, @@ -545,7 +558,9 @@ export interface HvCellInstance< D extends object = Record, H extends HvTableHeaderRenderer | undefined = HvTableHeaderRenderer, V = any, -> extends Omit, "column" | "row" | "getCellProps">, +> + extends + Omit, "column" | "row" | "getCellProps">, Partial> { column: HvColumnInstance; row: HvRowInstance; @@ -555,12 +570,11 @@ export interface HvCellInstance< // #region PROPS export interface HvUseTableProps - extends Omit, - UseHvTableStickyTableProps, - HvTableProps {} + extends Omit, UseHvTableStickyTableProps, HvTableProps {} export interface HvUseTableHeaderProps - extends Omit, + extends + Omit, Omit, UseHvTableStickyColumnProps, UseHvHeaderGroupsColumnProps, @@ -569,18 +583,19 @@ export interface HvUseTableHeaderProps HvTableHeaderProps {} export interface HvUseTableFooterProps - extends TableFooterProps, - UseHvTableStylesTableCellProps {} + extends TableFooterProps, UseHvTableStylesTableCellProps {} export interface HvUseTableRowProps - extends Omit, + extends + Omit, UseHvTableStylesTableRowProps, UseHvRowSelectionTableRowProps, UseHvRowExpandTableRowProps, HvTableRowProps {} export interface HvUseTableCellProps - extends Omit, + extends + Omit, Omit, UseHvTableStickyCellProps, UseHvHeaderGroupsCellProps, diff --git a/packages/core/src/Table/hooks/useHvTableStyles.ts b/packages/core/src/Table/hooks/useHvTableStyles.ts index 2a5ceba542..b1902e78f2 100644 --- a/packages/core/src/Table/hooks/useHvTableStyles.ts +++ b/packages/core/src/Table/hooks/useHvTableStyles.ts @@ -1,4 +1,4 @@ -import { Hooks } from "react-table"; +import type { Hooks } from "react-table"; import { clsx } from "clsx"; // #region ##### TYPES ##### diff --git a/packages/core/src/Table/renderers/DropdownColumnCell.tsx b/packages/core/src/Table/renderers/DropdownColumnCell.tsx index e599751946..37bec417c2 100644 --- a/packages/core/src/Table/renderers/DropdownColumnCell.tsx +++ b/packages/core/src/Table/renderers/DropdownColumnCell.tsx @@ -1,4 +1,4 @@ -import { HvDropdown, HvDropdownProps } from "../../Dropdown"; +import { HvDropdown, type HvDropdownProps } from "../../Dropdown"; export interface HvDropdownColumnCellProp extends HvDropdownProps {} diff --git a/packages/core/src/Table/renderers/SwitchColumnCell.tsx b/packages/core/src/Table/renderers/SwitchColumnCell.tsx index cb4b2130b6..e56e004cf0 100644 --- a/packages/core/src/Table/renderers/SwitchColumnCell.tsx +++ b/packages/core/src/Table/renderers/SwitchColumnCell.tsx @@ -1,6 +1,6 @@ import { createClasses } from "@hitachivantara/uikit-react-utils"; -import { HvBaseSwitch, HvBaseSwitchProps } from "../../BaseSwitch"; +import { HvBaseSwitch, type HvBaseSwitchProps } from "../../BaseSwitch"; import { HvTypography } from "../../Typography"; const switchStyle = { diff --git a/packages/core/src/Table/renderers/renderers.tsx b/packages/core/src/Table/renderers/renderers.tsx index de891dc0f2..16391684b3 100644 --- a/packages/core/src/Table/renderers/renderers.tsx +++ b/packages/core/src/Table/renderers/renderers.tsx @@ -1,15 +1,15 @@ import { ClassNames } from "@emotion/react"; -import { HvBaseSwitchProps } from "../../BaseSwitch"; +import type { HvBaseSwitchProps } from "../../BaseSwitch"; import { HvButton } from "../../Button"; -import { HvDropdownProps } from "../../Dropdown"; +import type { HvDropdownProps } from "../../Dropdown"; import { HvIcon } from "../../icons"; -import { HvListValue } from "../../List"; +import type { HvListValue } from "../../List"; import { HvOverflowTooltip, - HvOverflowTooltipProps, + type HvOverflowTooltipProps, } from "../../OverflowTooltip"; -import { HvTag, HvTagProps } from "../../Tag"; +import { HvTag, type HvTagProps } from "../../Tag"; import { setId } from "../../utils/setId"; import type { HvCellProps, diff --git a/packages/core/src/Table/stories/AllColumnRenderers.tsx b/packages/core/src/Table/stories/AllColumnRenderers.tsx index 384f34cade..7f439bfb41 100644 --- a/packages/core/src/Table/stories/AllColumnRenderers.tsx +++ b/packages/core/src/Table/stories/AllColumnRenderers.tsx @@ -7,7 +7,6 @@ import { hvNumberColumn, HvPagination, hvProgressColumn, - HvRowInstance, hvSwitchColumn, HvTable, HvTableBody, @@ -24,6 +23,7 @@ import { useHvPagination, useHvRowExpand, useHvTable, + type HvRowInstance, } from "@hitachivantara/uikit-react-core"; import { Ban } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Table/stories/Table.stories.tsx b/packages/core/src/Table/stories/Table.stories.tsx index baf80afc45..9fc1c757a6 100644 --- a/packages/core/src/Table/stories/Table.stories.tsx +++ b/packages/core/src/Table/stories/Table.stories.tsx @@ -1,4 +1,4 @@ -import { StoryObj } from "@storybook/react-vite"; +import type { StoryObj } from "@storybook/react-vite"; import { setupChromatic } from "@hitachivantara/internal"; import { HvTable, @@ -7,8 +7,8 @@ import { HvTableContainer, HvTableHead, HvTableHeader, - HvTableProps, HvTableRow, + type HvTableProps, } from "@hitachivantara/uikit-react-core"; import { AllColumnRenderers } from "./AllColumnRenderers"; diff --git a/packages/core/src/Table/stories/TableHooks/ColumnResize.tsx b/packages/core/src/Table/stories/TableHooks/ColumnResize.tsx index 0b05620c39..f9836d4f3e 100644 --- a/packages/core/src/Table/stories/TableHooks/ColumnResize.tsx +++ b/packages/core/src/Table/stories/TableHooks/ColumnResize.tsx @@ -4,16 +4,16 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, useHvResizeColumns, useHvTable, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, makeData } from "../storiesUtils"; +import { makeData, type AssetEvent } from "../storiesUtils"; export const ColumnResize = () => { const columns = useMemo[]>( diff --git a/packages/core/src/Table/stories/TableHooks/TableHooks.stories.tsx b/packages/core/src/Table/stories/TableHooks/TableHooks.stories.tsx index 9e8091967b..6199685c84 100644 --- a/packages/core/src/Table/stories/TableHooks/TableHooks.stories.tsx +++ b/packages/core/src/Table/stories/TableHooks/TableHooks.stories.tsx @@ -1,11 +1,10 @@ import { useMemo } from "react"; -import { StoryObj } from "@storybook/react-vite"; +import type { StoryObj } from "@storybook/react-vite"; import { expect } from "storybook/test"; import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, @@ -14,6 +13,7 @@ import { useHvHeaderGroups, useHvTable, useHvTableSticky, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { ColumnResize } from "./ColumnResize"; diff --git a/packages/core/src/Table/stories/TableHooks/UseHvBulkActions.tsx b/packages/core/src/Table/stories/TableHooks/UseHvBulkActions.tsx index 7e57a8b6f4..9fed915945 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvBulkActions.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvBulkActions.tsx @@ -1,6 +1,5 @@ import { useMemo, useState } from "react"; import { - HvActionGeneric, HvBulkActions, HvEmptyState, HvPagination, @@ -16,6 +15,7 @@ import { useHvPagination, useHvRowSelection, useHvTable, + type HvActionGeneric, } from "@hitachivantara/uikit-react-core"; import { Ban, @@ -25,7 +25,7 @@ import { Preview, } from "@hitachivantara/uikit-react-icons"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; export const UseHvBulkActions = () => { const columns = useMemo(() => getColumns(), []); diff --git a/packages/core/src/Table/stories/TableHooks/UseHvFilters.tsx b/packages/core/src/Table/stories/TableHooks/UseHvFilters.tsx index 7650737be5..fba652736f 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvFilters.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvFilters.tsx @@ -18,7 +18,7 @@ import { } from "@hitachivantara/uikit-react-core"; import { Ban } from "@hitachivantara/uikit-react-icons"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; const NoDataRow = ({ message, diff --git a/packages/core/src/Table/stories/TableHooks/UseHvGroupBy.tsx b/packages/core/src/Table/stories/TableHooks/UseHvGroupBy.tsx index a8de104fe0..fdde25785e 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvGroupBy.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvGroupBy.tsx @@ -4,7 +4,6 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, @@ -12,9 +11,10 @@ import { theme, useHvRowExpand, useHvTable, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, makeData } from "../storiesUtils"; +import { makeData, type AssetEvent } from "../storiesUtils"; const getGroupedRowsColumns = (): HvTableColumnConfig[] => [ { Header: "Title", accessor: "name", style: { minWidth: 120 } }, diff --git a/packages/core/src/Table/stories/TableHooks/UseHvHeaderGroups.tsx b/packages/core/src/Table/stories/TableHooks/UseHvHeaderGroups.tsx index 8490bc4f2d..f8011bc699 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvHeaderGroups.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvHeaderGroups.tsx @@ -3,16 +3,16 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, useHvHeaderGroups, useHvTable, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, makeData } from "../storiesUtils"; +import { makeData, type AssetEvent } from "../storiesUtils"; const getGroupedColumns = (): HvTableColumnConfig[] => [ { Header: "Title", accessor: "name", style: { minWidth: 120 } }, diff --git a/packages/core/src/Table/stories/TableHooks/UseHvHooks.tsx b/packages/core/src/Table/stories/TableHooks/UseHvHooks.tsx index 653ba50e03..c610561ef6 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvHooks.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvHooks.tsx @@ -10,7 +10,7 @@ import { useHvTable, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, makeData } from "../storiesUtils"; +import { makeData, type AssetEvent } from "../storiesUtils"; export const UseHvHooks = () => { const data = useMemo(() => makeData(6), []); diff --git a/packages/core/src/Table/stories/TableHooks/UseHvPagination.tsx b/packages/core/src/Table/stories/TableHooks/UseHvPagination.tsx index 7f401120b5..071e3e58e0 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvPagination.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvPagination.tsx @@ -13,7 +13,7 @@ import { useHvTable, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; const EmptyRow = () => ( diff --git a/packages/core/src/Table/stories/TableHooks/UseHvRowExpand.tsx b/packages/core/src/Table/stories/TableHooks/UseHvRowExpand.tsx index f5e036e749..dd62f88068 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvRowExpand.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvRowExpand.tsx @@ -12,7 +12,7 @@ import { useHvTable, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; export const UseHvRowExpand = () => { const columns = useMemo(() => getColumns(), []); diff --git a/packages/core/src/Table/stories/TableHooks/UseHvRowSelection.tsx b/packages/core/src/Table/stories/TableHooks/UseHvRowSelection.tsx index a22c3e7a7c..0a0c636b42 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvRowSelection.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvRowSelection.tsx @@ -11,7 +11,7 @@ import { useHvTable, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; export const UseHvSelection = () => { const columns = useMemo(() => getColumns(), []); diff --git a/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionControlled.tsx b/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionControlled.tsx index b1c0df91f9..2b2ce4d2a7 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionControlled.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionControlled.tsx @@ -10,7 +10,7 @@ import { useHvTable, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; const columns = getColumns(); const data = makeData(6).map((d, i) => ({ ...d, selected: i < 3 })); diff --git a/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionLocked.tsx b/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionLocked.tsx index 0c93b61eeb..0dd01dec95 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionLocked.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvRowSelectionLocked.tsx @@ -5,7 +5,6 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, @@ -16,10 +15,11 @@ import { useHvPagination, useHvRowSelection, useHvTable, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { Lock, Unlock } from "@hitachivantara/uikit-react-icons"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; export const LockedSelection = () => { const data = useMemo(() => makeData(64), []); diff --git a/packages/core/src/Table/stories/TableHooks/UseHvRowState.tsx b/packages/core/src/Table/stories/TableHooks/UseHvRowState.tsx index 72ee0d0d37..f62bcf9847 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvRowState.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvRowState.tsx @@ -1,22 +1,22 @@ import { useMemo } from "react"; import { - HvCellProps, HvIconButton, HvInput, HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, useHvRowState, useHvTable, + type HvCellProps, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { Close, Edit } from "@hitachivantara/uikit-react-icons"; -import { AssetEvent, makeData } from "../storiesUtils"; +import { makeData, type AssetEvent } from "../storiesUtils"; const EditableCell = ({ value, row }: HvCellProps) => row.state?.isEditing ? : value; diff --git a/packages/core/src/Table/stories/TableHooks/UseHvSortBy.tsx b/packages/core/src/Table/stories/TableHooks/UseHvSortBy.tsx index fc38ab6ece..a9233d1b70 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvSortBy.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvSortBy.tsx @@ -3,16 +3,16 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, useHvSortBy, useHvTable, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; const makeSortType = (items: string[]): HvTableColumnConfig["sortType"] => diff --git a/packages/core/src/Table/stories/TableHooks/UseHvTableSticky.tsx b/packages/core/src/Table/stories/TableHooks/UseHvTableSticky.tsx index 500fc1f328..f55d0a1fbe 100644 --- a/packages/core/src/Table/stories/TableHooks/UseHvTableSticky.tsx +++ b/packages/core/src/Table/stories/TableHooks/UseHvTableSticky.tsx @@ -3,16 +3,16 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, useHvTable, useHvTableSticky, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, makeData } from "../storiesUtils"; +import { makeData, type AssetEvent } from "../storiesUtils"; export const UseHvTableSticky = () => { const columns = useMemo[]>( diff --git a/packages/core/src/Table/stories/TableSamples/CompleteTableSection.tsx b/packages/core/src/Table/stories/TableSamples/CompleteTableSection.tsx index d1c165c340..ed405bd621 100644 --- a/packages/core/src/Table/stories/TableSamples/CompleteTableSection.tsx +++ b/packages/core/src/Table/stories/TableSamples/CompleteTableSection.tsx @@ -26,7 +26,7 @@ import { Preview, } from "@hitachivantara/uikit-react-icons"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; const EmptyRow = () => ( diff --git a/packages/core/src/Table/stories/TableSamples/GroupedRows.tsx b/packages/core/src/Table/stories/TableSamples/GroupedRows.tsx index 3575118ebc..acc86b1aeb 100644 --- a/packages/core/src/Table/stories/TableSamples/GroupedRows.tsx +++ b/packages/core/src/Table/stories/TableSamples/GroupedRows.tsx @@ -2,15 +2,15 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, theme, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, makeData } from "../storiesUtils"; +import { makeData, type AssetEvent } from "../storiesUtils"; const style = { borderRight: `1px solid ${theme.colors.border}`, diff --git a/packages/core/src/Table/stories/TableSamples/ListRow.tsx b/packages/core/src/Table/stories/TableSamples/ListRow.tsx index 9613a22507..00c01a8297 100644 --- a/packages/core/src/Table/stories/TableSamples/ListRow.tsx +++ b/packages/core/src/Table/stories/TableSamples/ListRow.tsx @@ -6,14 +6,14 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; export const ListRow = () => { const [checkedIdx, setCheckedIdx] = useState(0); diff --git a/packages/core/src/Table/stories/TableSamples/Main.tsx b/packages/core/src/Table/stories/TableSamples/Main.tsx index e1479a6294..2e76191efa 100644 --- a/packages/core/src/Table/stories/TableSamples/Main.tsx +++ b/packages/core/src/Table/stories/TableSamples/Main.tsx @@ -5,8 +5,8 @@ import { HvTableContainer, HvTableHead, HvTableHeader, - HvTableProps, HvTableRow, + type HvTableProps, } from "@hitachivantara/uikit-react-core"; import { getColumns, makeData } from "../storiesUtils"; diff --git a/packages/core/src/Table/stories/TableSamples/SimpleTable.tsx b/packages/core/src/Table/stories/TableSamples/SimpleTable.tsx index a2583b1e6c..3aa897768c 100644 --- a/packages/core/src/Table/stories/TableSamples/SimpleTable.tsx +++ b/packages/core/src/Table/stories/TableSamples/SimpleTable.tsx @@ -5,15 +5,15 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, HvTypography, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; -import { AssetEvent, getColumns, makeData } from "../storiesUtils"; +import { getColumns, makeData, type AssetEvent } from "../storiesUtils"; export const SimpleTable = () => { const [checkedIdx, setCheckedIdx] = useState(0); diff --git a/packages/core/src/Table/stories/TableSamples/TableEditable.tsx b/packages/core/src/Table/stories/TableSamples/TableEditable.tsx index 0be08f8f25..997f0573b1 100644 --- a/packages/core/src/Table/stories/TableSamples/TableEditable.tsx +++ b/packages/core/src/Table/stories/TableSamples/TableEditable.tsx @@ -1,28 +1,30 @@ -import { FormEvent, Fragment, useCallback, useMemo, useState } from "react"; +import { + Fragment, + useCallback, + useMemo, + useState, + type FormEvent, +} from "react"; import { css, keyframes } from "@emotion/css"; import { HvButton, - HvCellProps, HvInput, HvLabel, HvLoadingContainer, HvOption, HvOverflowTooltip, HvPagination, - HvRowInstance, HvSelect, HvSnackbarProvider, HvSwitch, HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, HvTableRow, HvTableSection, - HvTableState, HvTypography, snackbarContentClasses, theme, @@ -31,10 +33,14 @@ import { useHvRowState, useHvSnackbar, useHvTable, + type HvCellProps, + type HvRowInstance, + type HvTableColumnConfig, + type HvTableState, } from "@hitachivantara/uikit-react-core"; import { Add, Delete, Edit } from "@hitachivantara/uikit-react-icons"; -import { AssetEvent, useServerData } from "../serverUtils"; +import { useServerData, type AssetEvent } from "../serverUtils"; const slide = keyframes({ "0%": { maxHeight: 0 }, diff --git a/packages/core/src/Tabs/Tab/Tab.tsx b/packages/core/src/Tabs/Tab/Tab.tsx index 9ea0ab8d31..258871470c 100644 --- a/packages/core/src/Tabs/Tab/Tab.tsx +++ b/packages/core/src/Tabs/Tab/Tab.tsx @@ -1,5 +1,5 @@ import { forwardRef } from "react"; -import Tab, { TabProps as MuiTabProps } from "@mui/material/Tab"; +import Tab, { type TabProps as MuiTabProps } from "@mui/material/Tab"; import { useDefaultProps, type ExtractNames, diff --git a/packages/core/src/Tabs/Tabs.stories.tsx b/packages/core/src/Tabs/Tabs.stories.tsx index fd418135e6..1adf35f76a 100644 --- a/packages/core/src/Tabs/Tabs.stories.tsx +++ b/packages/core/src/Tabs/Tabs.stories.tsx @@ -5,9 +5,9 @@ import { HvBadge, HvSimpleGrid, HvTab, - HvTabProps, HvTabs, - HvTabsProps, + type HvTabProps, + type HvTabsProps, } from "@hitachivantara/uikit-react-core"; import { Alert, diff --git a/packages/core/src/Tabs/Tabs.tsx b/packages/core/src/Tabs/Tabs.tsx index 3af6395316..7edfbb27a3 100644 --- a/packages/core/src/Tabs/Tabs.tsx +++ b/packages/core/src/Tabs/Tabs.tsx @@ -1,5 +1,5 @@ import { forwardRef } from "react"; -import Tabs, { TabsProps as MuiTabsProps } from "@mui/material/Tabs"; +import Tabs, { type TabsProps as MuiTabsProps } from "@mui/material/Tabs"; import { useDefaultProps, type ExtractNames, diff --git a/packages/core/src/Tag/Tag.stories.tsx b/packages/core/src/Tag/Tag.stories.tsx index 620a95ed80..ce16c90a50 100644 --- a/packages/core/src/Tag/Tag.stories.tsx +++ b/packages/core/src/Tag/Tag.stories.tsx @@ -1,6 +1,10 @@ import { css } from "@emotion/css"; import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvTag, HvTagProps, theme } from "@hitachivantara/uikit-react-core"; +import { + HvTag, + theme, + type HvTagProps, +} from "@hitachivantara/uikit-react-core"; import { Abacus } from "@hitachivantara/uikit-react-icons"; const meta: Meta = { diff --git a/packages/core/src/Tag/Tag.tsx b/packages/core/src/Tag/Tag.tsx index 8a8f392056..0ee36cb9e1 100644 --- a/packages/core/src/Tag/Tag.tsx +++ b/packages/core/src/Tag/Tag.tsx @@ -14,7 +14,7 @@ import { } from "@hitachivantara/uikit-styles"; import { HvCheckBoxIcon } from "../BaseCheckBox/CheckBoxIcon"; -import { HvButtonBase, HvButtonBaseProps } from "../ButtonBase"; +import { HvButtonBase, type HvButtonBaseProps } from "../ButtonBase"; import { useControlled } from "../hooks/useControlled"; import { HvIcon } from "../icons"; import { HvTypography } from "../Typography"; @@ -32,11 +32,10 @@ const colorMap: Partial> = { neutral_20: "info", }; -export interface HvTagProps - extends Omit< - HvButtonBaseProps, - "type" | "color" | "classes" | "onClick" | "onToggle" - > { +export interface HvTagProps extends Omit< + HvButtonBaseProps, + "type" | "color" | "classes" | "onClick" | "onToggle" +> { /** The label of the tag element. */ label?: React.ReactNode; /** Indicates that the form element is disabled. */ diff --git a/packages/core/src/TagsInput/TagsInput.stories.tsx b/packages/core/src/TagsInput/TagsInput.stories.tsx index 3c13467342..0b47173bdc 100644 --- a/packages/core/src/TagsInput/TagsInput.stories.tsx +++ b/packages/core/src/TagsInput/TagsInput.stories.tsx @@ -1,11 +1,11 @@ import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { - HvFormStatus, - HvTagProps, HvTagsInput, - HvTagsInputProps, HvTypography, + type HvFormStatus, + type HvTagProps, + type HvTagsInputProps, } from "@hitachivantara/uikit-react-core"; import countryNamesArray from "./countries"; diff --git a/packages/core/src/TagsInput/TagsInput.tsx b/packages/core/src/TagsInput/TagsInput.tsx index bced2530fb..db900d3e02 100644 --- a/packages/core/src/TagsInput/TagsInput.tsx +++ b/packages/core/src/TagsInput/TagsInput.tsx @@ -14,27 +14,27 @@ import { import { DEFAULT_ERROR_MESSAGES, - HvValidationMessages, + type HvValidationMessages, } from "../BaseInput/validations"; import { HvCharCounter, - HvCharCounterProps, HvFormElement, - HvFormElementProps, - HvFormStatus, HvWarningText, + type HvCharCounterProps, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { HvSuggestions, - HvSuggestionsProps, + type HvSuggestionsProps, } from "../FormElement/Suggestions/Suggestions"; import { useControlled } from "../hooks/useControlled"; import { useFocus } from "../hooks/useFocus"; import { useIsMounted } from "../hooks/useIsMounted"; import { useUniqueId } from "../hooks/useUniqueId"; import type { HvInputProps, HvInputSuggestion } from "../Input"; -import { HvTag, HvTagProps } from "../Tag"; +import { HvTag, type HvTagProps } from "../Tag"; import { isKey } from "../utils/keyboardUtils"; import { setId } from "../utils/setId"; import { staticClasses, useClasses } from "./TagsInput.styles"; @@ -45,11 +45,10 @@ export interface HvTagSuggestion extends HvInputSuggestion {} export type HvTagsInputClasses = ExtractNames; -export interface HvTagsInputProps - extends Omit< - HvInputProps, - "onChange" | "onBlur" | "onFocus" | "onKeyDown" | "value" | "defaultValue" - > { +export interface HvTagsInputProps extends Omit< + HvInputProps, + "onChange" | "onBlur" | "onFocus" | "onKeyDown" | "value" | "defaultValue" +> { /** The value of the form element. */ value?: string[] | HvTagProps[]; /** When uncontrolled, defines the initial input value. */ diff --git a/packages/core/src/TagsInput/stories/ControlledTagArray.tsx b/packages/core/src/TagsInput/stories/ControlledTagArray.tsx index ac96eebc47..462848ad2e 100644 --- a/packages/core/src/TagsInput/stories/ControlledTagArray.tsx +++ b/packages/core/src/TagsInput/stories/ControlledTagArray.tsx @@ -1,9 +1,9 @@ import { useState } from "react"; import { HvButton, - HvTagProps, HvTagsInput, HvTypography, + type HvTagProps, } from "@hitachivantara/uikit-react-core"; export const ControlledTagArray = () => { diff --git a/packages/core/src/TextArea/TextArea.stories.tsx b/packages/core/src/TextArea/TextArea.stories.tsx index f699e2ada0..345de1095d 100644 --- a/packages/core/src/TextArea/TextArea.stories.tsx +++ b/packages/core/src/TextArea/TextArea.stories.tsx @@ -1,5 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvTextArea, HvTextAreaProps } from "@hitachivantara/uikit-react-core"; +import { + HvTextArea, + type HvTextAreaProps, +} from "@hitachivantara/uikit-react-core"; const meta: Meta = { title: "Components/Text Area", diff --git a/packages/core/src/TextArea/TextArea.tsx b/packages/core/src/TextArea/TextArea.tsx index 7a470e8ec8..301b8bb4a2 100644 --- a/packages/core/src/TextArea/TextArea.tsx +++ b/packages/core/src/TextArea/TextArea.tsx @@ -13,25 +13,25 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseInput, HvBaseInputProps } from "../BaseInput"; +import { HvBaseInput, type HvBaseInputProps } from "../BaseInput"; import { computeValidationMessage, computeValidationState, DEFAULT_ERROR_MESSAGES, hasBuiltInValidations, - HvInputValidity, - HvValidationMessages, validateInput, + type HvInputValidity, + type HvValidationMessages, } from "../BaseInput/validations"; import { HvCharCounter, - HvCharCounterProps, HvFormElement, - HvFormElementProps, - HvFormStatus, HvInfoMessage, HvWarningText, isInvalid, + type HvCharCounterProps, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; @@ -43,11 +43,10 @@ export { staticClasses as textAreaClasses }; export type HvTextAreaClasses = ExtractNames; -export interface HvTextAreaProps - extends Omit< - HvBaseInputProps, - "onChange" | "onBlur" | "rows" | "classes" | "onFocus" | "placeholder" - > { +export interface HvTextAreaProps extends Omit< + HvBaseInputProps, + "onChange" | "onBlur" | "rows" | "classes" | "onFocus" | "placeholder" +> { /** The placeholder value of the text area. */ placeholder?: string; /** diff --git a/packages/core/src/TimeAgo/TimeAgo.stories.tsx b/packages/core/src/TimeAgo/TimeAgo.stories.tsx index 632c9293e0..3b6ec18452 100644 --- a/packages/core/src/TimeAgo/TimeAgo.stories.tsx +++ b/packages/core/src/TimeAgo/TimeAgo.stories.tsx @@ -5,8 +5,8 @@ import { HvRadio, HvRadioGroup, HvTimeAgo, - HvTimeAgoProps, theme, + type HvTimeAgoProps, } from "@hitachivantara/uikit-react-core"; const styles = { diff --git a/packages/core/src/TimeAgo/TimeAgo.tsx b/packages/core/src/TimeAgo/TimeAgo.tsx index 22345718b9..39508846e2 100644 --- a/packages/core/src/TimeAgo/TimeAgo.tsx +++ b/packages/core/src/TimeAgo/TimeAgo.tsx @@ -6,8 +6,8 @@ import { import { DEFAULT_LOCALE } from "../Calendar/utils"; import { fixedForwardRef, - PolymorphicComponentRef, - PolymorphicRef, + type PolymorphicComponentRef, + type PolymorphicRef, } from "../types/generic"; import { HvTypography } from "../Typography"; import { staticClasses, useClasses } from "./TimeAgo.styles"; diff --git a/packages/core/src/TimePicker/Placeholder.tsx b/packages/core/src/TimePicker/Placeholder.tsx index fd10301734..0502b020a1 100644 --- a/packages/core/src/TimePicker/Placeholder.tsx +++ b/packages/core/src/TimePicker/Placeholder.tsx @@ -1,12 +1,12 @@ import { forwardRef, useRef } from "react"; import { useDateSegment } from "@react-aria/datepicker"; -import { +import type { DateFieldState, DateSegment, SegmentType, } from "@react-stately/datepicker"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; /** Convert `Date` into `hh:mm:ss` format */ const getDateValue = (date: any) => { diff --git a/packages/core/src/TimePicker/TimePicker.stories.tsx b/packages/core/src/TimePicker/TimePicker.stories.tsx index 02070b0d4d..27f07c5102 100644 --- a/packages/core/src/TimePicker/TimePicker.stories.tsx +++ b/packages/core/src/TimePicker/TimePicker.stories.tsx @@ -4,8 +4,8 @@ import { setupChromatic } from "@hitachivantara/internal"; import { HvButton, HvTimePicker, - HvTimePickerProps, - HvTimePickerValue, + type HvTimePickerProps, + type HvTimePickerValue, } from "@hitachivantara/uikit-react-core"; export default { diff --git a/packages/core/src/TimePicker/TimePicker.test.tsx b/packages/core/src/TimePicker/TimePicker.test.tsx index 89710e5b44..c79ea47c5d 100644 --- a/packages/core/src/TimePicker/TimePicker.test.tsx +++ b/packages/core/src/TimePicker/TimePicker.test.tsx @@ -1,7 +1,11 @@ import { fireEvent, render, screen } from "@testing-library/react"; import { vi } from "vitest"; -import { HvTimePicker, HvTimePickerProps, HvTimePickerValue } from "."; +import { + HvTimePicker, + type HvTimePickerProps, + type HvTimePickerValue, +} from "."; const defaultProps = { label: "TimePicker", diff --git a/packages/core/src/TimePicker/TimePicker.tsx b/packages/core/src/TimePicker/TimePicker.tsx index 7e6352537a..318126d2de 100644 --- a/packages/core/src/TimePicker/TimePicker.tsx +++ b/packages/core/src/TimePicker/TimePicker.tsx @@ -11,20 +11,20 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseDropdown, HvBaseDropdownProps } from "../BaseDropdown"; +import { HvBaseDropdown, type HvBaseDropdownProps } from "../BaseDropdown"; import { DEFAULT_LOCALE } from "../Calendar/utils"; import { HvFormElement, - HvFormElementProps, - HvFormStatus, HvWarningText, + type HvFormElementProps, + type HvFormStatus, } from "../FormElement"; import { HvLabelContainer } from "../FormElement/LabelContainer"; import { useControlled } from "../hooks/useControlled"; import { useUniqueId } from "../hooks/useUniqueId"; import { HvIcon } from "../icons"; import { setId } from "../utils/setId"; -import { Placeholder, PlaceholderProps } from "./Placeholder"; +import { Placeholder, type PlaceholderProps } from "./Placeholder"; import { staticClasses, useClasses } from "./TimePicker.styles"; import { Unit } from "./Unit"; @@ -64,11 +64,10 @@ export type HvTimePickerValue = { seconds: number; }; -export interface HvTimePickerProps - extends Omit< - HvFormElementProps, - "classes" | "value" | "defaultValue" | "onChange" - > { +export interface HvTimePickerProps extends Omit< + HvFormElementProps, + "classes" | "value" | "defaultValue" | "onChange" +> { /** A Jss Object used to override or extend the styles applied to the component. */ classes?: HvTimePickerClasses; /** Current value of the element when _controlled_. Follows the 24-hour format. */ diff --git a/packages/core/src/TimePicker/Unit/Unit.tsx b/packages/core/src/TimePicker/Unit/Unit.tsx index f81712d429..9b56b14573 100644 --- a/packages/core/src/TimePicker/Unit/Unit.tsx +++ b/packages/core/src/TimePicker/Unit/Unit.tsx @@ -1,7 +1,7 @@ -import { DateFieldState, DateSegment } from "@react-stately/datepicker"; +import type { DateFieldState, DateSegment } from "@react-stately/datepicker"; import { theme } from "@hitachivantara/uikit-styles"; -import { HvBaseInput, HvBaseInputProps } from "../../BaseInput"; +import { HvBaseInput, type HvBaseInputProps } from "../../BaseInput"; import { HvButton } from "../../Button"; import { HvIcon } from "../../icons"; import { useClasses } from "./Unit.styles"; diff --git a/packages/core/src/ToggleButton/ToggleButton.stories.tsx b/packages/core/src/ToggleButton/ToggleButton.stories.tsx index ee180ce255..72d0495bd5 100644 --- a/packages/core/src/ToggleButton/ToggleButton.stories.tsx +++ b/packages/core/src/ToggleButton/ToggleButton.stories.tsx @@ -3,7 +3,7 @@ import { css } from "@emotion/css"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvToggleButton, - HvToggleButtonProps, + type HvToggleButtonProps, } from "@hitachivantara/uikit-react-core"; import { BackwardsEmpty, diff --git a/packages/core/src/ToggleButton/ToggleButton.tsx b/packages/core/src/ToggleButton/ToggleButton.tsx index 672c4759bd..72b38c626f 100644 --- a/packages/core/src/ToggleButton/ToggleButton.tsx +++ b/packages/core/src/ToggleButton/ToggleButton.tsx @@ -3,10 +3,12 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; import { HvButton } from "../Button"; import { useControlled } from "../hooks/useControlled"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; -export interface HvToggleButtonProps - extends HvBaseProps { +export interface HvToggleButtonProps extends HvBaseProps< + HTMLButtonElement, + "onClick" +> { /** When uncontrolled, defines the initial selected state. */ defaultSelected?: boolean; /** Defines if the button is selected. When defined the button state becomes controlled. */ diff --git a/packages/core/src/Tooltip/Tooltip.stories.tsx b/packages/core/src/Tooltip/Tooltip.stories.tsx index 8982706773..d8b0ea3c6a 100644 --- a/packages/core/src/Tooltip/Tooltip.stories.tsx +++ b/packages/core/src/Tooltip/Tooltip.stories.tsx @@ -5,8 +5,8 @@ import { HvAvatar, HvButton, HvTooltip, - HvTooltipProps, HvTypography, + type HvTooltipProps, } from "@hitachivantara/uikit-react-core"; import { Play } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Tooltip/Tooltip.tsx b/packages/core/src/Tooltip/Tooltip.tsx index 9a3b4b62fb..d1f39e9c10 100644 --- a/packages/core/src/Tooltip/Tooltip.tsx +++ b/packages/core/src/Tooltip/Tooltip.tsx @@ -1,7 +1,7 @@ import { forwardRef, useEffect, useState } from "react"; import Fade from "@mui/material/Fade"; import Tooltip, { - TooltipProps as MuiTooltipProps, + type TooltipProps as MuiTooltipProps, } from "@mui/material/Tooltip"; import { useDefaultProps, diff --git a/packages/core/src/TreeView/TreeItem/TreeItem.tsx b/packages/core/src/TreeView/TreeItem/TreeItem.tsx index 8614e92dc2..ece6914e9e 100644 --- a/packages/core/src/TreeView/TreeItem/TreeItem.tsx +++ b/packages/core/src/TreeView/TreeItem/TreeItem.tsx @@ -1,6 +1,6 @@ import { forwardRef, useEffect, useMemo, useRef, useState } from "react"; import Collapse from "@mui/material/Collapse"; -import { TransitionProps } from "@mui/material/transitions"; +import type { TransitionProps } from "@mui/material/transitions"; import { useDefaultProps, type ExtractNames, @@ -9,12 +9,12 @@ import { import { useForkRef } from "../../hooks/useForkRef"; import { DescendantProvider, - TreeItemDescendant, useDescendant, + type TreeItemDescendant, } from "../internals/DescendantProvider"; -import { DefaultTreeViewPlugins } from "../internals/hooks/plugins"; +import type { DefaultTreeViewPlugins } from "../internals/hooks/plugins"; import { useTreeViewContext } from "../internals/TreeViewProvider"; -import { DefaultContent, HvTreeContentClasses } from "./DefaultContent"; +import { DefaultContent, type HvTreeContentClasses } from "./DefaultContent"; import { staticClasses, useClasses } from "./TreeItem.styles"; export { staticClasses as treeItemClasses }; diff --git a/packages/core/src/TreeView/TreeItem/useHvTreeItem.ts b/packages/core/src/TreeView/TreeItem/useHvTreeItem.ts index 4d0268a26b..aa18708541 100644 --- a/packages/core/src/TreeView/TreeItem/useHvTreeItem.ts +++ b/packages/core/src/TreeView/TreeItem/useHvTreeItem.ts @@ -1,7 +1,7 @@ import { useContext } from "react"; import { DescendantContext } from "../internals/DescendantProvider"; -import { DefaultTreeViewPlugins } from "../internals/hooks/plugins"; +import type { DefaultTreeViewPlugins } from "../internals/hooks/plugins"; import { useTreeViewContext } from "../internals/TreeViewProvider"; export function useHvTreeItem(nodeId: string) { diff --git a/packages/core/src/TreeView/TreeView.stories.tsx b/packages/core/src/TreeView/TreeView.stories.tsx index 1855717428..dc4b255060 100644 --- a/packages/core/src/TreeView/TreeView.stories.tsx +++ b/packages/core/src/TreeView/TreeView.stories.tsx @@ -5,7 +5,7 @@ import { HvPanel, HvTreeItem, HvTreeView, - HvTreeViewProps, + type HvTreeViewProps, } from "@hitachivantara/uikit-react-core"; import { DataObject as DataObjectStory } from "./stories/DataObject"; diff --git a/packages/core/src/TreeView/TreeView.tsx b/packages/core/src/TreeView/TreeView.tsx index 5701bf9d17..f2d428c605 100644 --- a/packages/core/src/TreeView/TreeView.tsx +++ b/packages/core/src/TreeView/TreeView.tsx @@ -5,10 +5,10 @@ import { } from "@hitachivantara/uikit-react-utils"; import { HvIcon } from "../icons"; -import { fixedForwardRef, HvBaseProps } from "../types/generic"; +import { fixedForwardRef, type HvBaseProps } from "../types/generic"; import { DEFAULT_TREE_VIEW_PLUGINS, - DefaultTreeViewPluginParameters, + type DefaultTreeViewPluginParameters, } from "./internals/hooks/plugins"; import { useTreeView } from "./internals/hooks/useTreeView"; import { TreeViewProvider } from "./internals/TreeViewProvider"; @@ -19,7 +19,8 @@ export { staticClasses as treeView2Classes }; // TODO: remove old `treeViewClass export type HvTreeViewClasses = ExtractNames; export interface HvTreeViewProps - extends HvBaseProps, + extends + HvBaseProps, DefaultTreeViewPluginParameters { /** A Jss Object used to override or extend the styles applied. */ classes?: HvTreeViewClasses; diff --git a/packages/core/src/TreeView/internals/TreeViewProvider.tsx b/packages/core/src/TreeView/internals/TreeViewProvider.tsx index f9dbd58fac..b0b8e5a40c 100644 --- a/packages/core/src/TreeView/internals/TreeViewProvider.tsx +++ b/packages/core/src/TreeView/internals/TreeViewProvider.tsx @@ -1,7 +1,7 @@ import { createContext, useContext } from "react"; import { DescendantProvider } from "./DescendantProvider"; -import { TreeViewAnyPluginSignature, TreeViewInstance } from "./types"; +import type { TreeViewAnyPluginSignature, TreeViewInstance } from "./types"; export interface TreeViewContextValue< TPlugins extends readonly TreeViewAnyPluginSignature[], diff --git a/packages/core/src/TreeView/internals/corePlugins.ts b/packages/core/src/TreeView/internals/corePlugins.ts index 09deba473b..ee38f9dc37 100644 --- a/packages/core/src/TreeView/internals/corePlugins.ts +++ b/packages/core/src/TreeView/internals/corePlugins.ts @@ -1,5 +1,5 @@ import { useTreeViewInstanceEvents } from "./hooks/useTreeViewInstanceEvents"; -import { ConvertPluginsIntoSignatures, MergePlugins } from "./types"; +import type { ConvertPluginsIntoSignatures, MergePlugins } from "./types"; /** * Internal plugins that creates the tools used by the other plugins. diff --git a/packages/core/src/TreeView/internals/hooks/plugins/defaultPlugins.ts b/packages/core/src/TreeView/internals/hooks/plugins/defaultPlugins.ts index 9e0fb54cf5..46d2716a1b 100644 --- a/packages/core/src/TreeView/internals/hooks/plugins/defaultPlugins.ts +++ b/packages/core/src/TreeView/internals/hooks/plugins/defaultPlugins.ts @@ -1,24 +1,24 @@ -import { ConvertPluginsIntoSignatures } from "../../types"; +import type { ConvertPluginsIntoSignatures } from "../../types"; import { useTreeViewContextValueBuilder, - UseTreeViewContextValueBuilderParameters, + type UseTreeViewContextValueBuilderParameters, } from "./useTreeViewContextValueBuilder"; import { useTreeViewExpansion, - UseTreeViewExpansionParameters, + type UseTreeViewExpansionParameters, } from "./useTreeViewExpansion"; import { useTreeViewFocus, - UseTreeViewFocusParameters, + type UseTreeViewFocusParameters, } from "./useTreeViewFocus"; import { useTreeViewKeyboardNavigation } from "./useTreeViewKeyboardNavigation"; import { useTreeViewNodes, - UseTreeViewNodesParameters, + type UseTreeViewNodesParameters, } from "./useTreeViewNodes"; import { useTreeViewSelection, - UseTreeViewSelectionParameters, + type UseTreeViewSelectionParameters, } from "./useTreeViewSelection"; export const DEFAULT_TREE_VIEW_PLUGINS = [ @@ -37,7 +37,9 @@ export type DefaultTreeViewPlugins = ConvertPluginsIntoSignatures< // We can't infer this type from the plugin, otherwise we would lose the generics. export interface DefaultTreeViewPluginParameters< Multiple extends boolean | undefined, -> extends UseTreeViewNodesParameters, +> + extends + UseTreeViewNodesParameters, UseTreeViewExpansionParameters, UseTreeViewFocusParameters, UseTreeViewSelectionParameters, diff --git a/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewExpansion.ts b/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewExpansion.ts index 2451d1036e..c59c03b8be 100644 --- a/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewExpansion.ts +++ b/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewExpansion.ts @@ -1,7 +1,7 @@ import * as React from "react"; import { useEventCallback } from "@mui/material/utils"; -import { +import type { DefaultizedProps, TreeViewPlugin, TreeViewPluginSignature, diff --git a/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.ts b/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.ts index aece1c4123..79f3eaa82d 100644 --- a/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.ts +++ b/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.ts @@ -3,7 +3,7 @@ import { useTheme } from "@mui/material/styles"; import { useEventCallback } from "@mui/material/utils"; import type { EventHandlers } from "@mui/utils/types"; -import { TreeViewPlugin, TreeViewPluginSignature } from "../../types"; +import type { TreeViewPlugin, TreeViewPluginSignature } from "../../types"; import { getFirstNode, getLastNode, @@ -57,7 +57,7 @@ export const useTreeViewKeyboardNavigation: TreeViewPlugin< > = ({ instance, params, state }) => { const theme = useTheme(); const isRtl = theme.direction === "rtl"; - const firstCharMap = React.useRef<{ [nodeId: string]: string }>({}); + const firstCharMap = React.useRef>({}); const mapFirstChar = useEventCallback((nodeId: string, firstChar: string) => { firstCharMap.current[nodeId] = firstChar; diff --git a/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewNodes.ts b/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewNodes.ts index 0fb70a08c7..e486c92c19 100644 --- a/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewNodes.ts +++ b/packages/core/src/TreeView/internals/hooks/plugins/useTreeViewNodes.ts @@ -1,7 +1,7 @@ import * as React from "react"; import { useEventCallback } from "@mui/material/utils"; -import { +import type { DefaultizedProps, TreeViewNode, TreeViewPlugin, @@ -52,7 +52,7 @@ export const useTreeViewNodes: TreeViewPlugin = ({ instance, params, }) => { - const nodeMap = React.useRef<{ [nodeId: string]: TreeViewNode }>({}); + const nodeMap = React.useRef>({}); const getNode = React.useCallback( (nodeId: string) => nodeMap.current[nodeId], @@ -105,7 +105,7 @@ export const useTreeViewNodes: TreeViewPlugin = ({ const getChildrenIds = useEventCallback((nodeId: string | null) => Object.values(nodeMap.current) .filter((node) => node.parentId === nodeId) - .sort((a, b) => a.index - b.index) + .toSorted((a, b) => a.index - b.index) .map((child) => child.id), ); diff --git a/packages/core/src/TreeView/internals/hooks/useInstanceEventHandler.ts b/packages/core/src/TreeView/internals/hooks/useInstanceEventHandler.ts index ce71edb81e..0ff1d0ab26 100644 --- a/packages/core/src/TreeView/internals/hooks/useInstanceEventHandler.ts +++ b/packages/core/src/TreeView/internals/hooks/useInstanceEventHandler.ts @@ -1,11 +1,14 @@ import * as React from "react"; -import { TreeViewAnyPluginSignature, TreeViewUsedEvents } from "../types"; -import { TreeViewEventListener } from "../types/events"; -import { CleanupTracking, UnregisterToken } from "../utils/CleanupTracking"; +import type { TreeViewAnyPluginSignature, TreeViewUsedEvents } from "../types"; +import type { TreeViewEventListener } from "../types/events"; +import type { + CleanupTracking, + UnregisterToken, +} from "../utils/CleanupTracking"; import { FinalizationRegistryBasedCleanupTracking } from "../utils/FinalizationRegistryBasedCleanupTracking"; import { TimerBasedCleanupTracking } from "../utils/TimerBasedCleanupTracking"; -import { UseTreeViewInstanceEventsInstance } from "./useTreeViewInstanceEvents.types"; +import type { UseTreeViewInstanceEventsInstance } from "./useTreeViewInstanceEvents.types"; interface RegistryContainer { registry: CleanupTracking | null; diff --git a/packages/core/src/TreeView/internals/hooks/useTreeView.ts b/packages/core/src/TreeView/internals/hooks/useTreeView.ts index ef2f25d236..75b7cd1f87 100644 --- a/packages/core/src/TreeView/internals/hooks/useTreeView.ts +++ b/packages/core/src/TreeView/internals/hooks/useTreeView.ts @@ -5,9 +5,9 @@ import useForkRef from "@mui/utils/useForkRef"; import { TREE_VIEW_CORE_PLUGINS } from "../corePlugins"; import { DEFAULT_TREE_VIEW_CONTEXT_VALUE, - TreeViewContextValue, + type TreeViewContextValue, } from "../TreeViewProvider"; -import { +import type { ConvertPluginsIntoSignatures, MergePluginsProperty, TreeViewAnyPluginSignature, @@ -33,18 +33,17 @@ export type UseTreeViewDefaultizedParameters< "defaultizedParams" >; -export interface UseTreeViewRootSlotProps - extends Pick< - React.HTMLAttributes, - | "onFocus" - | "onBlur" - | "onKeyDown" - | "id" - | "aria-activedescendant" - | "aria-multiselectable" - | "role" - | "tabIndex" - > { +export interface UseTreeViewRootSlotProps extends Pick< + React.HTMLAttributes, + | "onFocus" + | "onBlur" + | "onKeyDown" + | "id" + | "aria-activedescendant" + | "aria-multiselectable" + | "role" + | "tabIndex" +> { ref: React.Ref; } diff --git a/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.ts b/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.ts index d12b83e033..e1d8a57c63 100644 --- a/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.ts +++ b/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.ts @@ -3,7 +3,7 @@ import * as React from "react"; import type { TreeViewPlugin } from "../types"; import type { TreeViewEventListener } from "../types/events"; import { EventManager } from "../utils/EventManager"; -import { UseTreeViewInstanceEventsSignature } from "./useTreeViewInstanceEvents.types"; +import type { UseTreeViewInstanceEventsSignature } from "./useTreeViewInstanceEvents.types"; import { populateInstance } from "./utils"; const isSyntheticEvent = (event: any): event is React.SyntheticEvent => { diff --git a/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.types.ts b/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.types.ts index 57fe1098c6..53281a193e 100644 --- a/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.types.ts +++ b/packages/core/src/TreeView/internals/hooks/useTreeViewInstanceEvents.types.ts @@ -1,5 +1,5 @@ -import { TreeViewPluginSignature } from "../types"; -import { TreeViewEventListener } from "../types/events"; +import type { TreeViewPluginSignature } from "../types"; +import type { TreeViewEventListener } from "../types/events"; export interface UseTreeViewInstanceEventsInstance { /** diff --git a/packages/core/src/TreeView/internals/hooks/useTreeViewModels.ts b/packages/core/src/TreeView/internals/hooks/useTreeViewModels.ts index 887c96a5dd..1666a4da7b 100644 --- a/packages/core/src/TreeView/internals/hooks/useTreeViewModels.ts +++ b/packages/core/src/TreeView/internals/hooks/useTreeViewModels.ts @@ -1,6 +1,6 @@ import * as React from "react"; -import { +import type { ConvertPluginsIntoSignatures, MergePluginsProperty, TreeViewAnyPluginSignature, @@ -20,36 +20,39 @@ export const useTreeViewModels = < "defaultizedParams" >, ) => { - const modelsRef = React.useRef<{ - [modelName: string]: { - controlledProp: keyof typeof props; - defaultProp: keyof typeof props; - isControlled: boolean; - }; - }>({}); + const modelsRef = React.useRef< + Record< + string, + { + controlledProp: keyof typeof props; + defaultProp: keyof typeof props; + isControlled: boolean; + } + > + >({}); - const [modelsState, setModelsState] = React.useState<{ - [modelName: string]: any; - }>(() => { - const initialState: { [modelName: string]: any } = {}; + const [modelsState, setModelsState] = React.useState>( + () => { + const initialState: Record = {}; - plugins.forEach((plugin) => { - if (plugin.models) { - Object.entries(plugin.models).forEach(([modelName, model]) => { - modelsRef.current[modelName] = { - controlledProp: model.controlledProp as keyof typeof props, - defaultProp: model.defaultProp as keyof typeof props, - isControlled: - props[model.controlledProp as keyof typeof props] !== undefined, - }; - initialState[modelName] = - props[model.defaultProp as keyof typeof props]; - }); - } - }); + plugins.forEach((plugin) => { + if (plugin.models) { + Object.entries(plugin.models).forEach(([modelName, model]) => { + modelsRef.current[modelName] = { + controlledProp: model.controlledProp as keyof typeof props, + defaultProp: model.defaultProp as keyof typeof props, + isControlled: + props[model.controlledProp as keyof typeof props] !== undefined, + }; + initialState[modelName] = + props[model.defaultProp as keyof typeof props]; + }); + } + }); - return initialState; - }); + return initialState; + }, + ); const models = Object.fromEntries( Object.entries(modelsRef.current).map(([modelName, model]) => { diff --git a/packages/core/src/TreeView/internals/hooks/utils.ts b/packages/core/src/TreeView/internals/hooks/utils.ts index 5208db7d44..0bd5ff968c 100644 --- a/packages/core/src/TreeView/internals/hooks/utils.ts +++ b/packages/core/src/TreeView/internals/hooks/utils.ts @@ -1,4 +1,4 @@ -import { +import type { TreeViewAnyPluginSignature, TreeViewInstance, TreeViewUsedInstance, diff --git a/packages/core/src/TreeView/internals/utils/EventManager.ts b/packages/core/src/TreeView/internals/utils/EventManager.ts index 9467a72c33..26b465f160 100644 --- a/packages/core/src/TreeView/internals/utils/EventManager.ts +++ b/packages/core/src/TreeView/internals/utils/EventManager.ts @@ -25,7 +25,7 @@ export class EventManager { warnOnce = false; - events: { [eventName: string]: EventListenerCollection } = {}; + events: Record = {}; on( eventName: string, diff --git a/packages/core/src/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.ts b/packages/core/src/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.ts index ca7b1647e2..68512a95fc 100644 --- a/packages/core/src/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.ts +++ b/packages/core/src/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.ts @@ -1,12 +1,10 @@ -import { +import type { CleanupTracking, UnregisterToken, UnsubscribeFn, } from "./CleanupTracking"; -export class FinalizationRegistryBasedCleanupTracking - implements CleanupTracking -{ +export class FinalizationRegistryBasedCleanupTracking implements CleanupTracking { registry = new FinalizationRegistry((unsubscribe) => { if (typeof unsubscribe === "function") { unsubscribe(); diff --git a/packages/core/src/TreeView/internals/utils/TimerBasedCleanupTracking.ts b/packages/core/src/TreeView/internals/utils/TimerBasedCleanupTracking.ts index 109f1fc053..77e3677a71 100644 --- a/packages/core/src/TreeView/internals/utils/TimerBasedCleanupTracking.ts +++ b/packages/core/src/TreeView/internals/utils/TimerBasedCleanupTracking.ts @@ -1,4 +1,4 @@ -import { +import type { CleanupTracking, UnregisterToken, UnsubscribeFn, diff --git a/packages/core/src/TreeView/stories/DataObject.tsx b/packages/core/src/TreeView/stories/DataObject.tsx index 4a3bf6cff3..5faa4694b1 100644 --- a/packages/core/src/TreeView/stories/DataObject.tsx +++ b/packages/core/src/TreeView/stories/DataObject.tsx @@ -3,8 +3,8 @@ import { css } from "@emotion/css"; import { HvPanel, HvTreeItem, - HvTreeItemProps, HvTreeView, + type HvTreeItemProps, } from "@hitachivantara/uikit-react-core"; import { Doc, Folders } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/Typography/Typography.stories.tsx b/packages/core/src/Typography/Typography.stories.tsx index 382b4b3c85..caf5fe1989 100644 --- a/packages/core/src/Typography/Typography.stories.tsx +++ b/packages/core/src/Typography/Typography.stories.tsx @@ -1,6 +1,6 @@ import type { StoryObj } from "@storybook/react-vite"; -import { HvTypography, HvTypographyProps } from "./Typography"; +import { HvTypography, type HvTypographyProps } from "./Typography"; const typographyVariants = [ "display", diff --git a/packages/core/src/Typography/Typography.test.tsx b/packages/core/src/Typography/Typography.test.tsx index d0238a926e..f2f38ff829 100644 --- a/packages/core/src/Typography/Typography.test.tsx +++ b/packages/core/src/Typography/Typography.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; -import { HvTypography, HvTypographyProps } from "./Typography"; +import { HvTypography, type HvTypographyProps } from "./Typography"; interface CustomLinkProps extends HvTypographyProps<"a"> { to: string; diff --git a/packages/core/src/Typography/Typography.tsx b/packages/core/src/Typography/Typography.tsx index c0f50b9ba7..850599f070 100644 --- a/packages/core/src/Typography/Typography.tsx +++ b/packages/core/src/Typography/Typography.tsx @@ -6,8 +6,8 @@ import { import { fixedForwardRef, - PolymorphicComponentRef, - PolymorphicRef, + type PolymorphicComponentRef, + type PolymorphicRef, } from "../types/generic"; import { staticClasses, useClasses } from "./Typography.styles"; diff --git a/packages/core/src/VerticalNavigation/Actions/Action.tsx b/packages/core/src/VerticalNavigation/Actions/Action.tsx index 4711f34a9e..fb148521df 100644 --- a/packages/core/src/VerticalNavigation/Actions/Action.tsx +++ b/packages/core/src/VerticalNavigation/Actions/Action.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../../Button"; +import { HvButton, type HvButtonProps } from "../../Button"; import { VerticalNavigationContext } from "../VerticalNavigationContext"; import { staticClasses, useClasses } from "./Action.styles"; @@ -12,8 +12,10 @@ export { staticClasses as actionClasses }; export type HvVerticalNavigationActionClasses = ExtractNames; -export interface HvVerticalNavigationActionProps - extends Omit { +export interface HvVerticalNavigationActionProps extends Omit< + HvButtonProps, + "classes" | "icon" +> { /** A Jss Object used to override or extend the styles applied to the component. */ classes?: HvVerticalNavigationActionClasses; /** Visual label. */ diff --git a/packages/core/src/VerticalNavigation/Actions/Actions.tsx b/packages/core/src/VerticalNavigation/Actions/Actions.tsx index 08de1d6ae1..ed20cf5ca9 100644 --- a/packages/core/src/VerticalNavigation/Actions/Actions.tsx +++ b/packages/core/src/VerticalNavigation/Actions/Actions.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { VerticalNavigationContext } from "../VerticalNavigationContext"; import { staticClasses, useClasses } from "./Actions.styles"; diff --git a/packages/core/src/VerticalNavigation/Header/Header.tsx b/packages/core/src/VerticalNavigation/Header/Header.tsx index 9009413c20..1706339fc9 100644 --- a/packages/core/src/VerticalNavigation/Header/Header.tsx +++ b/packages/core/src/VerticalNavigation/Header/Header.tsx @@ -4,9 +4,9 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvButton, HvButtonProps } from "../../Button"; +import { HvButton, type HvButtonProps } from "../../Button"; import { HvIcon } from "../../icons"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { HvTypography } from "../../Typography"; import { VerticalNavigationContext } from "../VerticalNavigationContext"; import { staticClasses, useClasses } from "./Header.styles"; diff --git a/packages/core/src/VerticalNavigation/Navigation/Navigation.tsx b/packages/core/src/VerticalNavigation/Navigation/Navigation.tsx index 52d2395bea..f503cf4abc 100644 --- a/packages/core/src/VerticalNavigation/Navigation/Navigation.tsx +++ b/packages/core/src/VerticalNavigation/Navigation/Navigation.tsx @@ -5,22 +5,22 @@ import { } from "@hitachivantara/uikit-react-utils"; import { useControlled } from "../../hooks/useControlled"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { uniqueId } from "../../utils/helpers"; import { NavigationPopupContainer } from "../NavigationPopup/NavigationPopupContainer"; import { HvVerticalNavigationSlider, - HvVerticalNavigationSliderProps, + type HvVerticalNavigationSliderProps, } from "../NavigationSlider"; import { getParentItemById } from "../NavigationSlider/utils"; import { HvVerticalNavigationTreeView, HvVerticalNavigationTreeViewItem, - NavigationMode, + type NavigationMode, } from "../TreeView"; import { - NavigationData, VerticalNavigationContext, + type NavigationData, } from "../VerticalNavigationContext"; import { staticClasses, useClasses } from "./Navigation.styles"; @@ -28,8 +28,10 @@ export { staticClasses as verticalNavigationTreeClasses }; export type HvVerticalNavigationTreeClasses = ExtractNames; -export interface HvVerticalNavigationTreeProps - extends HvBaseProps { +export interface HvVerticalNavigationTreeProps extends HvBaseProps< + HTMLDivElement, + "onChange" | "onToggle" +> { /** A Jss Object used to override or extend the styles applied. */ classes?: HvVerticalNavigationTreeClasses; /** Modus operandi (role) of the widget instance. */ diff --git a/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopup.tsx b/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopup.tsx index 9683e8cd48..8935850bce 100644 --- a/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopup.tsx +++ b/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopup.tsx @@ -1,19 +1,18 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { HvVerticalNavigationTree, - HvVerticalNavigationTreeProps, + type HvVerticalNavigationTreeProps, } from "../Navigation"; -import { NavigationData } from "../VerticalNavigationContext"; +import type { NavigationData } from "../VerticalNavigationContext"; import { useClasses } from "./NavigationPopup.styles"; import { - HvVerticalNavigationPopupClasses, NavigationPopupContainer, + type HvVerticalNavigationPopupClasses, } from "./NavigationPopupContainer"; -export interface HvVerticalNavigationPopupProps - extends HvBaseProps { +export interface HvVerticalNavigationPopupProps extends HvBaseProps { id?: string; anchorEl?: HTMLElement | null; fixedMode?: boolean; diff --git a/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopupContainer.tsx b/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopupContainer.tsx index 08a95f3e70..44bd6b1360 100644 --- a/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopupContainer.tsx +++ b/packages/core/src/VerticalNavigation/NavigationPopup/NavigationPopupContainer.tsx @@ -2,7 +2,7 @@ import ClickAwayListener from "@mui/material/ClickAwayListener"; import Popper from "@mui/material/Popper"; import { useTheme, type ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { getContainerElement } from "../../utils/document"; import { HvVerticalNavigation } from "../VerticalNavigation"; import { staticClasses, useClasses } from "./NavigationPopup.styles"; diff --git a/packages/core/src/VerticalNavigation/NavigationSlider/NavigationSlider.tsx b/packages/core/src/VerticalNavigation/NavigationSlider/NavigationSlider.tsx index 125d64f743..405b6dac67 100644 --- a/packages/core/src/VerticalNavigation/NavigationSlider/NavigationSlider.tsx +++ b/packages/core/src/VerticalNavigation/NavigationSlider/NavigationSlider.tsx @@ -7,19 +7,21 @@ import { HvButton } from "../../Button"; import { HvIcon } from "../../icons"; import { HvListContainer, - HvListContainerProps, HvListItem, + type HvListContainerProps, } from "../../ListContainer"; import { HvOverflowTooltip } from "../../OverflowTooltip"; -import { NavigationData } from "../VerticalNavigationContext"; +import type { NavigationData } from "../VerticalNavigationContext"; import { staticClasses, useClasses } from "./NavigationSlider.styles"; export { staticClasses as verticalNavigationSliderClasses }; export type HvVerticalNavigationSliderClasses = ExtractNames; -export interface HvVerticalNavigationSliderProps - extends Omit { +export interface HvVerticalNavigationSliderProps extends Omit< + HvListContainerProps, + "classes" +> { /** A Jss Object used to override or extend the styles applied. */ classes?: HvVerticalNavigationSliderClasses; /** diff --git a/packages/core/src/VerticalNavigation/TreeView/TreeView.test.tsx b/packages/core/src/VerticalNavigation/TreeView/TreeView.test.tsx index e824ad34a7..0a7f55c7ea 100644 --- a/packages/core/src/VerticalNavigation/TreeView/TreeView.test.tsx +++ b/packages/core/src/VerticalNavigation/TreeView/TreeView.test.tsx @@ -4,7 +4,7 @@ import { describe, expect, it } from "vitest"; import { HvVerticalNavigationTreeView, HvVerticalNavigationTreeViewItem, - HvVerticalNavigationTreeViewProps, + type HvVerticalNavigationTreeViewProps, } from "."; const Sample = (props: HvVerticalNavigationTreeViewProps) => ( diff --git a/packages/core/src/VerticalNavigation/TreeView/TreeView.tsx b/packages/core/src/VerticalNavigation/TreeView/TreeView.tsx index 3645c61e33..09eb10ad6e 100644 --- a/packages/core/src/VerticalNavigation/TreeView/TreeView.tsx +++ b/packages/core/src/VerticalNavigation/TreeView/TreeView.tsx @@ -8,12 +8,12 @@ import { useControlled } from "../../hooks/useControlled"; import { useForkRef } from "../../hooks/useForkRef"; import { useUniqueId } from "../../hooks/useUniqueId"; import { DescendantProvider } from "../../TreeView/internals/DescendantProvider"; -import { HvBaseProps } from "../../types/generic"; +import type { HvBaseProps } from "../../types/generic"; import { staticClasses, useClasses } from "./TreeView.styles"; import { - NavigationMode, TreeViewControlContext, TreeViewStateContext, + type NavigationMode, } from "./TreeViewContext"; export { staticClasses as treeViewClasses }; @@ -22,8 +22,10 @@ export type HvVerticalNavigationTreeViewClasses = ExtractNames< typeof useClasses >; -export interface HvVerticalNavigationTreeViewProps - extends HvBaseProps { +export interface HvVerticalNavigationTreeViewProps extends HvBaseProps< + HTMLUListElement, + "onChange" | "onToggle" +> { /** A Jss Object used to override or extend the styles applied to the component. */ classes?: HvVerticalNavigationTreeViewClasses; /** Modus operandi (role) of the widget instance. */ diff --git a/packages/core/src/VerticalNavigation/VerticalNavigation.stories.tsx b/packages/core/src/VerticalNavigation/VerticalNavigation.stories.tsx index efac56d42b..4c02d22a6f 100644 --- a/packages/core/src/VerticalNavigation/VerticalNavigation.stories.tsx +++ b/packages/core/src/VerticalNavigation/VerticalNavigation.stories.tsx @@ -6,11 +6,11 @@ import { HvVerticalNavigationAction, HvVerticalNavigationActions, HvVerticalNavigationHeader, - HvVerticalNavigationProps, HvVerticalNavigationSlider, HvVerticalNavigationTree, HvVerticalNavigationTreeView, HvVerticalNavigationTreeViewItem, + type HvVerticalNavigationProps, } from "@hitachivantara/uikit-react-core"; import { CollapsibleIcons as CollapsibleIconsStory } from "./stories/CollapsibleIcons"; diff --git a/packages/core/src/VerticalNavigation/VerticalNavigation.test.tsx b/packages/core/src/VerticalNavigation/VerticalNavigation.test.tsx index 539f378c67..fcf4d5bf29 100644 --- a/packages/core/src/VerticalNavigation/VerticalNavigation.test.tsx +++ b/packages/core/src/VerticalNavigation/VerticalNavigation.test.tsx @@ -9,7 +9,7 @@ import { HvVerticalNavigationActions, HvVerticalNavigationHeader, HvVerticalNavigationTree, - NavigationData, + type NavigationData, } from "."; const Sample = ({ diff --git a/packages/core/src/VerticalNavigation/VerticalNavigation.tsx b/packages/core/src/VerticalNavigation/VerticalNavigation.tsx index bb70a74d28..eade71456d 100644 --- a/packages/core/src/VerticalNavigation/VerticalNavigation.tsx +++ b/packages/core/src/VerticalNavigation/VerticalNavigation.tsx @@ -4,7 +4,7 @@ import { type ExtractNames, } from "@hitachivantara/uikit-react-utils"; -import { HvBaseProps } from "../types/generic"; +import type { HvBaseProps } from "../types/generic"; import { fillDataWithParentId, getNavigationItemById, @@ -12,8 +12,8 @@ import { } from "./NavigationSlider/utils"; import { staticClasses, useClasses } from "./VerticalNavigation.styles"; import { - NavigationData, VerticalNavigationContext, + type NavigationData, } from "./VerticalNavigationContext"; export { staticClasses as verticalNavigationClasses }; diff --git a/packages/core/src/VerticalNavigation/stories/Main.tsx b/packages/core/src/VerticalNavigation/stories/Main.tsx index fd3f22e67d..cd4c8ead72 100644 --- a/packages/core/src/VerticalNavigation/stories/Main.tsx +++ b/packages/core/src/VerticalNavigation/stories/Main.tsx @@ -3,8 +3,8 @@ import { HvVerticalNavigation, HvVerticalNavigationAction, HvVerticalNavigationActions, - HvVerticalNavigationProps, HvVerticalNavigationTree, + type HvVerticalNavigationProps, } from "@hitachivantara/uikit-react-core"; import { LogOut, User } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/VerticalNavigation/stories/Test.tsx b/packages/core/src/VerticalNavigation/stories/Test.tsx index 37ac80cff7..4616aa8fa7 100644 --- a/packages/core/src/VerticalNavigation/stories/Test.tsx +++ b/packages/core/src/VerticalNavigation/stories/Test.tsx @@ -4,7 +4,7 @@ import { HvVerticalNavigationAction, HvVerticalNavigationActions, HvVerticalNavigationTree, - HvVerticalNavigationTreeProps, + type HvVerticalNavigationTreeProps, } from "@hitachivantara/uikit-react-core"; import { LogOut, User } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/core/src/hooks/useExpandable.ts b/packages/core/src/hooks/useExpandable.ts index 205d2a8983..0fc260c183 100644 --- a/packages/core/src/hooks/useExpandable.ts +++ b/packages/core/src/hooks/useExpandable.ts @@ -3,8 +3,10 @@ import { useCallback, useId } from "react"; import type { HvAccordionProps } from "../Accordion"; import { useControlled } from "./useControlled"; -export interface UseExpandableParams - extends Pick {} +export interface UseExpandableParams extends Pick< + HvAccordionProps, + "disabled" | "expanded" | "defaultExpanded" +> {} /** expandable hook that handles a11y & open state for accordions, etc. */ export function useExpandable({ diff --git a/packages/core/src/hooks/useLabels.ts b/packages/core/src/hooks/useLabels.ts index adbce67323..6e462495fc 100644 --- a/packages/core/src/hooks/useLabels.ts +++ b/packages/core/src/hooks/useLabels.ts @@ -1,6 +1,6 @@ import { useMemo } from "react"; -import { DeepPartial } from "../types/generic"; +import type { DeepPartial } from "../types/generic"; import { deepMerge } from "../utils/deepMerge"; export function useLabels(defaultLabels: T, labels?: DeepPartial): T { diff --git a/packages/core/src/hooks/useWidth.ts b/packages/core/src/hooks/useWidth.ts index 6e46a55669..7c41e3e333 100644 --- a/packages/core/src/hooks/useWidth.ts +++ b/packages/core/src/hooks/useWidth.ts @@ -1,5 +1,5 @@ /* eslint-disable react-hooks/rules-of-hooks */ -import { Breakpoint, useTheme } from "@mui/material/styles"; +import { useTheme, type Breakpoint } from "@mui/material/styles"; import useMediaQuery from "@mui/material/useMediaQuery"; import { theme } from "@hitachivantara/uikit-styles"; diff --git a/packages/core/src/icons.tsx b/packages/core/src/icons.tsx index 86bb090ff2..0a51fc6a5b 100644 --- a/packages/core/src/icons.tsx +++ b/packages/core/src/icons.tsx @@ -1,7 +1,11 @@ import { forwardRef, memo, useMemo } from "react"; import styled from "@emotion/styled"; import { useTheme } from "@hitachivantara/uikit-react-utils"; -import { getColor, HvColorAny, HvSize } from "@hitachivantara/uikit-styles"; +import { + getColor, + type HvColorAny, + type HvSize, +} from "@hitachivantara/uikit-styles"; /** sizes for the icon */ const svgSizeMap = { diff --git a/packages/core/src/providers/Provider.tsx b/packages/core/src/providers/Provider.tsx index 38bfaa7bfb..5f811c3c6a 100644 --- a/packages/core/src/providers/Provider.tsx +++ b/packages/core/src/providers/Provider.tsx @@ -1,5 +1,5 @@ import { useId, useMemo } from "react"; -import createCache, { EmotionCache } from "@emotion/cache"; +import createCache, { type EmotionCache } from "@emotion/cache"; import { CacheProvider, ClassNames, @@ -11,8 +11,8 @@ import { CssBaseline, CssScopedBaseline, getThemeVars, - HvThemeColorMode, - HvThemeStructure, + type HvThemeColorMode, + type HvThemeStructure, } from "@hitachivantara/uikit-styles"; import { pentaho } from "../themes"; diff --git a/packages/core/src/providers/ThemeProvider.tsx b/packages/core/src/providers/ThemeProvider.tsx index bb803f7b06..90bfab5653 100644 --- a/packages/core/src/providers/ThemeProvider.tsx +++ b/packages/core/src/providers/ThemeProvider.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo, useState } from "react"; -import { EmotionCache } from "@emotion/cache"; +import type { EmotionCache } from "@emotion/cache"; import { ThemeProvider as MuiThemeProvider, useColorScheme, @@ -12,7 +12,7 @@ import { type HvTheme, type HvThemeContextValue, } from "@hitachivantara/uikit-react-shared"; -import { +import type { HvThemeColorMode, HvThemeStructure, } from "@hitachivantara/uikit-styles"; diff --git a/packages/core/src/providers/utils.ts b/packages/core/src/providers/utils.ts index a278d66a89..b44d9666c0 100644 --- a/packages/core/src/providers/utils.ts +++ b/packages/core/src/providers/utils.ts @@ -1,4 +1,4 @@ -import { createTheme, PaletteOptions } from "@mui/material/styles"; +import { createTheme, type PaletteOptions } from "@mui/material/styles"; import type { HvTheme } from "@hitachivantara/uikit-react-shared"; import type { HvThemeColorsAny, diff --git a/packages/core/src/stories/Icons.test.stories.tsx b/packages/core/src/stories/Icons.test.stories.tsx index 1811942144..6a5946cca0 100644 --- a/packages/core/src/stories/Icons.test.stories.tsx +++ b/packages/core/src/stories/Icons.test.stories.tsx @@ -3,8 +3,8 @@ import { setupChromatic } from "@hitachivantara/internal"; import { CheckboxCheck, HvIconSprite, - HvIconSpriteProps, icons, + type HvIconSpriteProps, } from "@hitachivantara/uikit-react-icons"; export default { diff --git a/packages/core/src/themes/next.ts b/packages/core/src/themes/next.ts index 536a465594..c84074d963 100644 --- a/packages/core/src/themes/next.ts +++ b/packages/core/src/themes/next.ts @@ -10,7 +10,7 @@ import type { HvBaseDropdownProps, HvDropdownPanelProps, } from "../BaseDropdown"; -import { HvRadioIconProps } from "../BaseRadio/RadioIcon"; +import type { HvRadioIconProps } from "../BaseRadio/RadioIcon"; import type { HvBreadCrumbProps } from "../BreadCrumb"; import type { HvButtonProps } from "../Button"; import type { HvCalendarProps } from "../Calendar"; diff --git a/packages/core/src/utils/Callout.tsx b/packages/core/src/utils/Callout.tsx index 61fdcf83cc..b6a177b4da 100644 --- a/packages/core/src/utils/Callout.tsx +++ b/packages/core/src/utils/Callout.tsx @@ -11,8 +11,11 @@ import { } from "@hitachivantara/uikit-react-utils"; import { theme } from "@hitachivantara/uikit-styles"; -import { HvActionsGeneric, HvActionsGenericProps } from "../ActionsGeneric"; -import { HvButton, HvButtonProps } from "../Button"; +import { + HvActionsGeneric, + type HvActionsGenericProps, +} from "../ActionsGeneric"; +import { HvButton, type HvButtonProps } from "../Button"; import { HvIcon } from "../icons"; import { HvStatusIcon } from "../StatusIcon"; import { iconVariant } from "./iconVariant"; @@ -101,11 +104,10 @@ export type HvCalloutActionPosition = "auto" | "inline" | "bottom-right"; export type HvCalloutClasses = ExtractNames; -export interface HvCalloutProps - extends Omit< - MuiSnackbarContentProps, - "title" | "variant" | "classes" | "onClose" - > { +export interface HvCalloutProps extends Omit< + MuiSnackbarContentProps, + "title" | "variant" | "classes" | "onClose" +> { /** The title to display. */ title?: React.ReactNode; /** The message to display. */ diff --git a/packages/core/src/utils/deepMerge.ts b/packages/core/src/utils/deepMerge.ts index 7779968e3e..fbfea6ebd6 100644 --- a/packages/core/src/utils/deepMerge.ts +++ b/packages/core/src/utils/deepMerge.ts @@ -1,4 +1,4 @@ -import { DeepPartial } from "../types/generic"; +import type { DeepPartial } from "../types/generic"; const isObject = (val: any): val is object => val && typeof val === "object" && !Array.isArray(val); diff --git a/packages/core/src/utils/iconVariant.tsx b/packages/core/src/utils/iconVariant.tsx index b8a6390228..ba1e0ac32f 100644 --- a/packages/core/src/utils/iconVariant.tsx +++ b/packages/core/src/utils/iconVariant.tsx @@ -1,4 +1,4 @@ -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; import { HvIcon } from "../icons"; import type { HvCalloutVariant } from "./Callout"; diff --git a/packages/core/src/utils/theme.ts b/packages/core/src/utils/theme.ts index 4083dc2d1a..65070a3297 100644 --- a/packages/core/src/utils/theme.ts +++ b/packages/core/src/utils/theme.ts @@ -1,4 +1,4 @@ -import { HvThemeColorMode } from "@hitachivantara/uikit-styles"; +import type { HvThemeColorMode } from "@hitachivantara/uikit-styles"; /** * Sets the element attributes and style for a theme and color mode. diff --git a/packages/icons/scripts/generateComponent.ts b/packages/icons/scripts/generateComponent.ts index ac888c44c4..bc90533236 100644 --- a/packages/icons/scripts/generateComponent.ts +++ b/packages/icons/scripts/generateComponent.ts @@ -1,4 +1,4 @@ -import { HvColor } from "@hitachivantara/uikit-styles"; +import type { HvColor } from "@hitachivantara/uikit-styles"; const hexColorMap: Record = { "#414141": "text", // secondary diff --git a/packages/icons/src/IconBase.tsx b/packages/icons/src/IconBase.tsx index f69c9aabb1..490f7e7bf7 100644 --- a/packages/icons/src/IconBase.tsx +++ b/packages/icons/src/IconBase.tsx @@ -1,8 +1,12 @@ import { forwardRef, memo } from "react"; import styled from "@emotion/styled"; -import { getColor, HvColorAny, HvSize } from "@hitachivantara/uikit-styles"; +import { + getColor, + type HvColorAny, + type HvSize, +} from "@hitachivantara/uikit-styles"; -import { HvIconContainer, HvIconContainerProps } from "./IconContainer"; +import { HvIconContainer, type HvIconContainerProps } from "./IconContainer"; import { getSizeStyles } from "./utils"; const getColorVars = (colorArray: string[]) => { diff --git a/packages/icons/src/IconContainer.tsx b/packages/icons/src/IconContainer.tsx index b8140150e8..57939cae3d 100644 --- a/packages/icons/src/IconContainer.tsx +++ b/packages/icons/src/IconContainer.tsx @@ -1,6 +1,10 @@ import { forwardRef } from "react"; import styled from "@emotion/styled"; -import { getColor, HvColorAny, HvSize } from "@hitachivantara/uikit-styles"; +import { + getColor, + type HvColorAny, + type HvSize, +} from "@hitachivantara/uikit-styles"; import type { IconSize } from "./IconBase"; import { getSizeStyles } from "./utils"; @@ -31,8 +35,7 @@ const StyledIconContainer = styled("div")({ alignItems: "center", }); -export interface HvIconContainerProps - extends React.HTMLAttributes { +export interface HvIconContainerProps extends React.HTMLAttributes { /** * A color to override the default icon colors. * Accepts any valid CSS color or color from the UI Kit palette. diff --git a/packages/icons/src/IconSprite.tsx b/packages/icons/src/IconSprite.tsx index a785a77f90..8035dbb683 100644 --- a/packages/icons/src/IconSprite.tsx +++ b/packages/icons/src/IconSprite.tsx @@ -1,6 +1,6 @@ import type { HvColor } from "@hitachivantara/uikit-styles"; -import { IconBase, IconBaseProps } from "./IconBase"; +import { IconBase, type IconBaseProps } from "./IconBase"; import { isSelector, isSort } from "./utils"; const getSecondaryColor = (iconName: string): HvColor => { @@ -10,8 +10,10 @@ const getSecondaryColor = (iconName: string): HvColor => { return "bgPage"; // atmo2 }; -export interface HvIconSpriteProps - extends Omit { +export interface HvIconSpriteProps extends Omit< + IconBaseProps, + "viewbox" | "inverted" | "semantic" +> { /** * The URL to the SVG icon sprite, served statically by the application. * @example "/public/icons.svg" diff --git a/packages/lab/src/Blade/Blade.stories.tsx b/packages/lab/src/Blade/Blade.stories.tsx index 35692d87b2..3aa498f725 100644 --- a/packages/lab/src/Blade/Blade.stories.tsx +++ b/packages/lab/src/Blade/Blade.stories.tsx @@ -6,7 +6,7 @@ import { HvTypography, theme, } from "@hitachivantara/uikit-react-core"; -import { HvBlade, HvBladeProps } from "@hitachivantara/uikit-react-lab"; +import { HvBlade, type HvBladeProps } from "@hitachivantara/uikit-react-lab"; const meta: Meta = { title: "Lab/Blades/Blade", diff --git a/packages/lab/src/Blade/Blade.tsx b/packages/lab/src/Blade/Blade.tsx index 6c4d890a8c..4aaf3297dc 100644 --- a/packages/lab/src/Blade/Blade.tsx +++ b/packages/lab/src/Blade/Blade.tsx @@ -1,21 +1,21 @@ import { - HTMLAttributes, - SyntheticEvent, useCallback, useEffect, useMemo, useRef, useState, + type HTMLAttributes, + type SyntheticEvent, } from "react"; import { - ExtractNames, - HvBaseProps, HvTypography, - HvTypographyVariants, setId, useControlled, useDefaultProps, useUniqueId, + type ExtractNames, + type HvBaseProps, + type HvTypographyVariants, } from "@hitachivantara/uikit-react-core"; import { staticClasses, useClasses } from "./Blade.styles"; @@ -24,8 +24,10 @@ export { staticClasses as bladeClasses }; export type HvBladeClasses = ExtractNames; -export interface HvBladeProps - extends HvBaseProps { +export interface HvBladeProps extends HvBaseProps< + HTMLDivElement, + "onChange" | "children" +> { /** * The content that will be rendered within the blade. */ diff --git a/packages/lab/src/Blades/Blades.stories.tsx b/packages/lab/src/Blades/Blades.stories.tsx index f1eceb5b37..dbf04b5e07 100644 --- a/packages/lab/src/Blades/Blades.stories.tsx +++ b/packages/lab/src/Blades/Blades.stories.tsx @@ -18,7 +18,7 @@ import { import { HvBlade, HvBlades, - HvBladesProps, + type HvBladesProps, } from "@hitachivantara/uikit-react-lab"; const meta: Meta = { diff --git a/packages/lab/src/Blades/Blades.tsx b/packages/lab/src/Blades/Blades.tsx index 449cf19856..b8441840cb 100644 --- a/packages/lab/src/Blades/Blades.tsx +++ b/packages/lab/src/Blades/Blades.tsx @@ -1,15 +1,15 @@ import { Children, cloneElement, - SyntheticEvent, useCallback, useMemo, + type SyntheticEvent, } from "react"; import { - ExtractNames, - HvBaseProps, useControlled, useDefaultProps, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { staticClasses, useClasses } from "./Blades.styles"; @@ -18,8 +18,10 @@ export { staticClasses as bladesClasses }; export type HvBladesClasses = ExtractNames; -export interface HvBladesProps - extends HvBaseProps { +export interface HvBladesProps extends HvBaseProps< + HTMLDivElement, + "onChange" | "children" +> { /** * Array of indices representing the expanded state of each blade. * diff --git a/packages/lab/src/Dashboard/Dashboard.stories.tsx b/packages/lab/src/Dashboard/Dashboard.stories.tsx index 9a631b4417..ea640cd3cd 100644 --- a/packages/lab/src/Dashboard/Dashboard.stories.tsx +++ b/packages/lab/src/Dashboard/Dashboard.stories.tsx @@ -1,6 +1,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvSection, HvTypography } from "@hitachivantara/uikit-react-core"; -import { HvDashboard, HvDashboardProps } from "@hitachivantara/uikit-react-lab"; +import { + HvDashboard, + type HvDashboardProps, +} from "@hitachivantara/uikit-react-lab"; const meta: Meta = { title: "Lab/Dashboard", diff --git a/packages/lab/src/Dashboard/Dashboard.tsx b/packages/lab/src/Dashboard/Dashboard.tsx index 4256274368..814aea6e3c 100644 --- a/packages/lab/src/Dashboard/Dashboard.tsx +++ b/packages/lab/src/Dashboard/Dashboard.tsx @@ -1,16 +1,16 @@ import { useMemo } from "react"; import { - Layouts, - ReactGridLayoutProps, Responsive as ResponsiveGrid, - ResponsiveProps, WidthProvider, + type Layouts, + type ReactGridLayoutProps, + type ResponsiveProps, } from "react-grid-layout"; import { Global } from "@emotion/react"; import { - ExtractNames, useDefaultProps, useTheme, + type ExtractNames, } from "@hitachivantara/uikit-react-core"; import { gridStyles, staticClasses, useClasses } from "./Dashboard.styles"; diff --git a/packages/lab/src/Flow/Background/Background.tsx b/packages/lab/src/Flow/Background/Background.tsx index 81362a41e8..2044f47c21 100644 --- a/packages/lab/src/Flow/Background/Background.tsx +++ b/packages/lab/src/Flow/Background/Background.tsx @@ -1,5 +1,5 @@ -import { Background, BackgroundProps } from "reactflow"; -import { getColor, HvColorAny, theme } from "@hitachivantara/uikit-styles"; +import { Background, type BackgroundProps } from "reactflow"; +import { getColor, theme, type HvColorAny } from "@hitachivantara/uikit-styles"; export interface HvFlowBackgroundProps extends Omit { /** Color for the background dots. Defaults to `text`. */ diff --git a/packages/lab/src/Flow/Controls/Controls.tsx b/packages/lab/src/Flow/Controls/Controls.tsx index c9123119a5..144e5c966a 100644 --- a/packages/lab/src/Flow/Controls/Controls.tsx +++ b/packages/lab/src/Flow/Controls/Controls.tsx @@ -1,10 +1,10 @@ import { - ControlProps, Panel, - PanelPosition, - ReactFlowState, useStore, useStoreApi, + type ControlProps, + type PanelPosition, + type ReactFlowState, } from "reactflow"; import { shallow } from "zustand/shallow"; import { @@ -24,11 +24,10 @@ import { useFlowInstance } from "../hooks"; export type HvFlowControlsPosition = PanelPosition; -export interface HvFlowControlsProps - extends Omit< - ControlProps, - "position" | "showFitView" | "showInteractive" | "showZoom" - > { +export interface HvFlowControlsProps extends Omit< + ControlProps, + "position" | "showFitView" | "showInteractive" | "showZoom" +> { /** Controls position. Defaults to `bottom-center`. */ position?: HvFlowControlsPosition; /** Controls orientation. Defaults to `horizontal`. */ diff --git a/packages/lab/src/Flow/DroppableFlow.tsx b/packages/lab/src/Flow/DroppableFlow.tsx index 398303b4dc..e2ce2b02a3 100644 --- a/packages/lab/src/Flow/DroppableFlow.tsx +++ b/packages/lab/src/Flow/DroppableFlow.tsx @@ -1,27 +1,30 @@ import { useCallback, useRef, useState } from "react"; -import { DragEndEvent, useDndMonitor, useDroppable } from "@dnd-kit/core"; +import { useDndMonitor, useDroppable, type DragEndEvent } from "@dnd-kit/core"; import { Global } from "@emotion/react"; import { addEdge, applyEdgeChanges, applyNodeChanges, - Connection, - Edge, - EdgeChange, MarkerType, - Node, - NodeChange, ReactFlow, - ReactFlowProps, + type Connection, + type Edge, + type EdgeChange, + type Node, + type NodeChange, + type ReactFlowProps, } from "reactflow"; import { uid } from "uid"; -import { ExtractNames, useUniqueId } from "@hitachivantara/uikit-react-core"; +import { + useUniqueId, + type ExtractNames, +} from "@hitachivantara/uikit-react-core"; import { flowStyles } from "./base"; import { staticClasses, useClasses } from "./Flow.styles"; import { useNodeMetaRegistry } from "./FlowContext/NodeMetaContext"; import { useFlowInstance } from "./hooks"; -import { +import type { HvFlowNodeInputGroup, HvFlowNodeMetaRegistry, HvFlowNodeOutputGroup, diff --git a/packages/lab/src/Flow/Empty/Empty.tsx b/packages/lab/src/Flow/Empty/Empty.tsx index a145b72f29..5f4a7510cc 100644 --- a/packages/lab/src/Flow/Empty/Empty.tsx +++ b/packages/lab/src/Flow/Empty/Empty.tsx @@ -1,7 +1,7 @@ import { useNodes } from "reactflow"; import { HvEmptyState, - HvEmptyStateProps, + type HvEmptyStateProps, } from "@hitachivantara/uikit-react-core"; import { useClasses } from "./Empty.styles"; diff --git a/packages/lab/src/Flow/Flow.test.tsx b/packages/lab/src/Flow/Flow.test.tsx index 9d757cf4c0..4b5038b84f 100644 --- a/packages/lab/src/Flow/Flow.test.tsx +++ b/packages/lab/src/Flow/Flow.test.tsx @@ -7,12 +7,12 @@ import { HvFlow, HvFlowBackground, HvFlowBaseNode, - HvFlowBaseNodeProps, HvFlowControls, - HvFlowControlsProps, HvFlowMinimap, - HvFlowNodeGroups, HvFlowSidebar, + type HvFlowBaseNodeProps, + type HvFlowControlsProps, + type HvFlowNodeGroups, } from "."; const nodeGroups: HvFlowNodeGroups = { diff --git a/packages/lab/src/Flow/Flow.tsx b/packages/lab/src/Flow/Flow.tsx index 0e8a24fbfb..a9331b168f 100644 --- a/packages/lab/src/Flow/Flow.tsx +++ b/packages/lab/src/Flow/Flow.tsx @@ -1,17 +1,17 @@ import { DndContext, - DndContextProps, KeyboardSensor, PointerSensor, useSensor, useSensors, + type DndContextProps, } from "@dnd-kit/core"; import { restrictToWindowEdges } from "@dnd-kit/modifiers"; import { ReactFlowProvider } from "reactflow"; -import { HvDroppableFlow, HvDroppableFlowProps } from "./DroppableFlow"; +import { HvDroppableFlow, type HvDroppableFlowProps } from "./DroppableFlow"; import { HvFlowProvider } from "./FlowContext"; -import { HvFlowNodeAction, HvFlowNodeGroups } from "./types"; +import type { HvFlowNodeAction, HvFlowNodeGroups } from "./types"; export interface HvFlowProps< NodeGroups extends keyof any = string, diff --git a/packages/lab/src/Flow/FlowContext/FlowContext.tsx b/packages/lab/src/Flow/FlowContext/FlowContext.tsx index 139ab5a012..dd288106bf 100644 --- a/packages/lab/src/Flow/FlowContext/FlowContext.tsx +++ b/packages/lab/src/Flow/FlowContext/FlowContext.tsx @@ -1,12 +1,12 @@ import { createContext, - Dispatch, - SetStateAction, useMemo, useState, + type Dispatch, + type SetStateAction, } from "react"; -import { HvFlowNodeAction, HvFlowNodeGroups } from "../types"; +import type { HvFlowNodeAction, HvFlowNodeGroups } from "../types"; import { HvFlowNodeMetaProvider } from "./NodeMetaContext"; export interface HvFlowContextValue { diff --git a/packages/lab/src/Flow/FlowContext/NodeMetaContext.tsx b/packages/lab/src/Flow/FlowContext/NodeMetaContext.tsx index b214312f66..bd086eea1e 100644 --- a/packages/lab/src/Flow/FlowContext/NodeMetaContext.tsx +++ b/packages/lab/src/Flow/FlowContext/NodeMetaContext.tsx @@ -1,6 +1,6 @@ import { createContext, useCallback, useContext, useMemo, useRef } from "react"; -import { HvFlowNodeMeta } from "../types"; +import type { HvFlowNodeMeta } from "../types"; interface HvFlowNodeMetaContextType { registerNode: (id: string, nodeInfo: HvFlowNodeMeta) => void; diff --git a/packages/lab/src/Flow/Minimap/Minimap.tsx b/packages/lab/src/Flow/Minimap/Minimap.tsx index c89948d42e..540bffae5b 100644 --- a/packages/lab/src/Flow/Minimap/Minimap.tsx +++ b/packages/lab/src/Flow/Minimap/Minimap.tsx @@ -1,6 +1,10 @@ -import { GetMiniMapNodeAttribute, MiniMap, MiniMapProps } from "reactflow"; -import { ExtractNames } from "@hitachivantara/uikit-react-core"; -import { getColor, HvColorAny } from "@hitachivantara/uikit-styles"; +import { + MiniMap, + type GetMiniMapNodeAttribute, + type MiniMapProps, +} from "reactflow"; +import type { ExtractNames } from "@hitachivantara/uikit-react-core"; +import { getColor, type HvColorAny } from "@hitachivantara/uikit-styles"; import { staticClasses, useClasses } from "./Minimap.styles"; @@ -8,11 +12,10 @@ export { staticClasses as flowMinimapClasses }; export type HvFlowMinimapClasses = ExtractNames; -export interface HvFlowMinimapProps - extends Omit< - MiniMapProps, - "nodeColor" | "nodeStrokeColor" | "maskColor" | "maskStrokeColor" - > { +export interface HvFlowMinimapProps extends Omit< + MiniMapProps, + "nodeColor" | "nodeStrokeColor" | "maskColor" | "maskStrokeColor" +> { /** Node color. */ nodeColor?: HvColorAny | GetMiniMapNodeAttribute; /** Node stroke color. */ diff --git a/packages/lab/src/Flow/Node/BaseNode.tsx b/packages/lab/src/Flow/Node/BaseNode.tsx index a35e89b257..c398f4efcb 100644 --- a/packages/lab/src/Flow/Node/BaseNode.tsx +++ b/packages/lab/src/Flow/Node/BaseNode.tsx @@ -1,15 +1,15 @@ -import { Handle, NodeProps, NodeToolbar, Position } from "reactflow"; +import { Handle, NodeToolbar, Position, type NodeProps } from "reactflow"; import { - ExtractNames, - HvBaseProps, HvIconButton, HvTypography, useLabels, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { mergeStyles } from "@hitachivantara/uikit-react-utils"; -import { HvUseNodeParams, useHvNode } from "../hooks"; -import { +import { useHvNode, type HvUseNodeParams } from "../hooks"; +import type { HvFlowNodeInput, HvFlowNodeInputGroup, HvFlowNodeOutput, @@ -35,7 +35,8 @@ export const DEFAULT_LABELS = { }; export interface HvFlowBaseNodeProps - extends Omit, + extends + Omit, Omit, NodeProps { /** Header items */ diff --git a/packages/lab/src/Flow/Node/Node.tsx b/packages/lab/src/Flow/Node/Node.tsx index f8e7a18918..aaeea54abe 100644 --- a/packages/lab/src/Flow/Node/Node.tsx +++ b/packages/lab/src/Flow/Node/Node.tsx @@ -1,21 +1,21 @@ import { useState } from "react"; import { - ExtractNames, HvActionsGeneric, - HvActionsGenericProps, HvButton, - HvButtonProps, HvInlineEditor, HvTooltip, HvTypography, theme, useLabels, + type ExtractNames, + type HvActionsGenericProps, + type HvButtonProps, } from "@hitachivantara/uikit-react-core"; import { DropDownXS, Info } from "@hitachivantara/uikit-react-icons"; import { useFlowContext, useFlowNode, useFlowNodeUtils } from "../hooks"; -import { HvFlowNodeParam } from "../types"; -import { HvFlowBaseNode, HvFlowBaseNodeProps } from "./BaseNode"; +import type { HvFlowNodeParam } from "../types"; +import { HvFlowBaseNode, type HvFlowBaseNodeProps } from "./BaseNode"; import { staticClasses, useClasses } from "./Node.styles"; import { ParamRenderer } from "./Parameters"; diff --git a/packages/lab/src/Flow/Node/Parameters/ParamRenderer.tsx b/packages/lab/src/Flow/Node/Parameters/ParamRenderer.tsx index 57f6990b2d..e78357ab97 100644 --- a/packages/lab/src/Flow/Node/Parameters/ParamRenderer.tsx +++ b/packages/lab/src/Flow/Node/Parameters/ParamRenderer.tsx @@ -1,4 +1,4 @@ -import { HvFlowNodeParam } from "../../types"; +import type { HvFlowNodeParam } from "../../types"; import Select from "./Select"; import Slider from "./Slider"; import Text from "./Text"; diff --git a/packages/lab/src/Flow/Node/Parameters/Select.tsx b/packages/lab/src/Flow/Node/Parameters/Select.tsx index 4c89489bd9..85b48aab42 100644 --- a/packages/lab/src/Flow/Node/Parameters/Select.tsx +++ b/packages/lab/src/Flow/Node/Parameters/Select.tsx @@ -1,8 +1,11 @@ import { useState } from "react"; -import { HvDropdown, HvDropdownProps } from "@hitachivantara/uikit-react-core"; +import { + HvDropdown, + type HvDropdownProps, +} from "@hitachivantara/uikit-react-core"; import { useFlowNodeUtils } from "../../hooks"; -import { HvFlowNodeSelectParam } from "../../types"; +import type { HvFlowNodeSelectParam } from "../../types"; interface SelectProps { param: Omit; diff --git a/packages/lab/src/Flow/Node/Parameters/Slider.tsx b/packages/lab/src/Flow/Node/Parameters/Slider.tsx index e55ef8fff7..75d87e648b 100644 --- a/packages/lab/src/Flow/Node/Parameters/Slider.tsx +++ b/packages/lab/src/Flow/Node/Parameters/Slider.tsx @@ -2,7 +2,7 @@ import { css } from "@emotion/css"; import { HvSlider } from "@hitachivantara/uikit-react-core"; import { useFlowNodeUtils } from "../../hooks"; -import { HvFlowNodeSliderParam } from "../../types"; +import type { HvFlowNodeSliderParam } from "../../types"; interface SliderProps { param: Omit; diff --git a/packages/lab/src/Flow/Node/Parameters/Text.tsx b/packages/lab/src/Flow/Node/Parameters/Text.tsx index 4f6672879d..83a5063316 100644 --- a/packages/lab/src/Flow/Node/Parameters/Text.tsx +++ b/packages/lab/src/Flow/Node/Parameters/Text.tsx @@ -1,7 +1,7 @@ import { HvInput } from "@hitachivantara/uikit-react-core"; import { useFlowNodeUtils } from "../../hooks"; -import { HvFlowNodeTextParam } from "../../types"; +import type { HvFlowNodeTextParam } from "../../types"; interface TextProps { param: Omit; diff --git a/packages/lab/src/Flow/Node/utils.ts b/packages/lab/src/Flow/Node/utils.ts index 920859d428..ffc18b8e2a 100644 --- a/packages/lab/src/Flow/Node/utils.ts +++ b/packages/lab/src/Flow/Node/utils.ts @@ -1,8 +1,8 @@ import { isValidElement } from "react"; -import { Edge } from "reactflow"; -import { HvActionGeneric } from "@hitachivantara/uikit-react-core"; +import type { Edge } from "reactflow"; +import type { HvActionGeneric } from "@hitachivantara/uikit-react-core"; -import { +import type { HvFlowNodeInput, HvFlowNodeInputGroup, HvFlowNodeOutput, diff --git a/packages/lab/src/Flow/Sidebar/Sidebar.tsx b/packages/lab/src/Flow/Sidebar/Sidebar.tsx index 9dd633a5b8..003e23350d 100644 --- a/packages/lab/src/Flow/Sidebar/Sidebar.tsx +++ b/packages/lab/src/Flow/Sidebar/Sidebar.tsx @@ -1,25 +1,25 @@ import { useEffect, useMemo, useState } from "react"; import { - DndContextProps, DragOverlay, - DragOverlayProps, useDndMonitor, useDroppable, + type DndContextProps, + type DragOverlayProps, } from "@dnd-kit/core"; import { restrictToWindowEdges } from "@dnd-kit/modifiers"; import { - ExtractNames, HvDrawer, - HvDrawerProps, HvInput, HvTypography, useLabels, useUniqueId, + type ExtractNames, + type HvDrawerProps, } from "@hitachivantara/uikit-react-core"; import { Add } from "@hitachivantara/uikit-react-icons"; import { useFlowContext } from "../hooks"; -import { HvFlowNodeGroups } from "../types"; +import type { HvFlowNodeGroups } from "../types"; import { staticClasses, useClasses } from "./Sidebar.styles"; import { HvFlowSidebarGroup } from "./SidebarGroup"; import { @@ -31,8 +31,10 @@ export { staticClasses as flowSidebarClasses }; export type HvFlowSidebarClasses = ExtractNames; -export interface HvFlowSidebarProps - extends Omit { +export interface HvFlowSidebarProps extends Omit< + HvDrawerProps, + "classes" | "title" +> { /** Sidebar title. */ title?: string; /** Sidebar description. */ diff --git a/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroup.tsx b/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroup.tsx index 051546b63e..e318fef2df 100644 --- a/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroup.tsx +++ b/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroup.tsx @@ -1,19 +1,19 @@ import { useCallback, useMemo } from "react"; import { - ExtractNames, HvButton, - HvButtonProps, HvTypography, + type ExtractNames, + type HvButtonProps, } from "@hitachivantara/uikit-react-core"; import { DropDownXS } from "@hitachivantara/uikit-react-icons"; import { getColor } from "@hitachivantara/uikit-styles"; import { useFlowContext } from "../../hooks"; -import { HvFlowNodeGroup } from "../../types"; +import type { HvFlowNodeGroup } from "../../types"; import { staticClasses, useClasses } from "./SidebarGroup.styles"; import { HvFlowDraggableSidebarGroupItem, - HvFlowDraggableSidebarGroupItemProps, + type HvFlowDraggableSidebarGroupItemProps, } from "./SidebarGroupItem"; export { staticClasses as flowSidebarGroupClasses }; diff --git a/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.tsx b/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.tsx index e363670abd..97f51d2c2b 100644 --- a/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.tsx +++ b/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.tsx @@ -3,15 +3,14 @@ import { useDraggable } from "@dnd-kit/core"; import { useForkRef } from "@mui/material/utils"; import { useUniqueId } from "@hitachivantara/uikit-react-core"; -import { HvFlowGroupItem } from "../../../types"; +import type { HvFlowGroupItem } from "../../../types"; import { HvFlowSidebarGroupItem, - HvFlowSidebarGroupItemProps, + type HvFlowSidebarGroupItemProps, } from "./SidebarGroupItem"; export interface HvFlowDraggableSidebarGroupItemProps - extends HvFlowSidebarGroupItemProps, - HvFlowGroupItem {} + extends HvFlowSidebarGroupItemProps, HvFlowGroupItem {} export const HvFlowDraggableSidebarGroupItem = ({ id: idProp, diff --git a/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx b/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx index 7ff484e2c8..47e392b952 100644 --- a/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx +++ b/packages/lab/src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx @@ -1,8 +1,8 @@ import { forwardRef } from "react"; import { - ExtractNames, - HvBaseProps, HvTypography, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { Drag } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/lab/src/Flow/hooks/useFlowInstance.ts b/packages/lab/src/Flow/hooks/useFlowInstance.ts index 2eb01d882f..bb27583843 100644 --- a/packages/lab/src/Flow/hooks/useFlowInstance.ts +++ b/packages/lab/src/Flow/hooks/useFlowInstance.ts @@ -1,6 +1,6 @@ import { useReactFlow } from "reactflow"; -import { HvFlowInstance } from "../types"; +import type { HvFlowInstance } from "../types"; /** Retrieves the React Flow instance */ export function useFlowInstance< diff --git a/packages/lab/src/Flow/hooks/useFlowNode.ts b/packages/lab/src/Flow/hooks/useFlowNode.ts index 75ded13adb..2466286eab 100644 --- a/packages/lab/src/Flow/hooks/useFlowNode.ts +++ b/packages/lab/src/Flow/hooks/useFlowNode.ts @@ -1,13 +1,13 @@ import { useCallback, useMemo } from "react"; import { - CoordinateExtent, - Edge, - Node, - ReactFlowState, useEdges, useNodes, useStore, - XYPosition, + type CoordinateExtent, + type Edge, + type Node, + type ReactFlowState, + type XYPosition, } from "reactflow"; import { shallow } from "zustand/shallow"; diff --git a/packages/lab/src/Flow/hooks/useNode.tsx b/packages/lab/src/Flow/hooks/useNode.tsx index d10217a072..8cc4570ca8 100644 --- a/packages/lab/src/Flow/hooks/useNode.tsx +++ b/packages/lab/src/Flow/hooks/useNode.tsx @@ -5,15 +5,15 @@ import { useMemo, useState, } from "react"; -import { NodeToolbarProps } from "reactflow"; +import type { NodeToolbarProps } from "reactflow"; import { uid } from "uid"; import { useLabels } from "@hitachivantara/uikit-react-core"; import { Delete, Duplicate } from "@hitachivantara/uikit-react-icons"; -import { getColor, HvColorAny, theme } from "@hitachivantara/uikit-styles"; +import { getColor, theme, type HvColorAny } from "@hitachivantara/uikit-styles"; import { useNodeMetaRegistry } from "../FlowContext/NodeMetaContext"; import { identifyHandles } from "../Node/utils"; -import { +import type { HvFlowNodeAction, HvFlowNodeInput, HvFlowNodeInputGroup, diff --git a/packages/lab/src/Flow/nodes/DashboardNode.tsx b/packages/lab/src/Flow/nodes/DashboardNode.tsx index 96f2b29360..074c82db03 100644 --- a/packages/lab/src/Flow/nodes/DashboardNode.tsx +++ b/packages/lab/src/Flow/nodes/DashboardNode.tsx @@ -1,18 +1,18 @@ import { - ExtractNames, HvButton, HvDialog, HvDialogActions, HvDialogContent, - HvDialogProps, HvDialogTitle, HvEmptyState, useLabels, + type ExtractNames, + type HvDialogProps, } from "@hitachivantara/uikit-react-core"; import { Info } from "@hitachivantara/uikit-react-icons"; -import { HvDashboard, HvDashboardProps } from "../../Dashboard"; -import { HvFlowNode, HvFlowNodeProps } from "../Node"; +import { HvDashboard, type HvDashboardProps } from "../../Dashboard"; +import { HvFlowNode, type HvFlowNodeProps } from "../Node"; import { staticClasses, useClasses } from "./DashboardNode.styles"; export { staticClasses as hvDashboardNodeClasses }; @@ -28,7 +28,8 @@ const DEFAULT_LABELS = { export type HvDashboardNodeClasses = ExtractNames; export interface HvDashboardNodeProps - extends HvFlowNodeProps, + extends + HvFlowNodeProps, Pick, Pick { classes?: HvDashboardNodeClasses; diff --git a/packages/lab/src/Flow/nodes/StickyNode.tsx b/packages/lab/src/Flow/nodes/StickyNode.tsx index 9156096b35..e5d78e90a1 100644 --- a/packages/lab/src/Flow/nodes/StickyNode.tsx +++ b/packages/lab/src/Flow/nodes/StickyNode.tsx @@ -2,16 +2,15 @@ import { useCallback, useMemo, useRef, useState } from "react"; import { css, cx } from "@emotion/css"; import Popover from "@mui/material/Popover"; import { - NodeProps, NodeResizer, NodeToolbar, Position, useReactFlow, + type NodeProps, } from "reactflow"; import { HvButton, HvCheckBox, - HvColorAny, HvColorPicker, HvDialogContent, HvDialogTitle, @@ -20,6 +19,7 @@ import { HvMultiButton, HvSelectionList, theme, + type HvColorAny, } from "@hitachivantara/uikit-react-core"; import { ActualSize, diff --git a/packages/lab/src/Flow/stories/Base/Asset.tsx b/packages/lab/src/Flow/stories/Base/Asset.tsx index 88c5ad5edb..3c22279695 100644 --- a/packages/lab/src/Flow/stories/Base/Asset.tsx +++ b/packages/lab/src/Flow/stories/Base/Asset.tsx @@ -14,11 +14,11 @@ import { Search, } from "@hitachivantara/uikit-react-icons"; import { - HvFlowInstance, HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, useFlowNode, + type HvFlowInstance, + type HvFlowNodeFC, + type HvFlowNodeProps, } from "@hitachivantara/uikit-react-lab"; type Node = ReturnType; diff --git a/packages/lab/src/Flow/stories/Base/Dashboard.tsx b/packages/lab/src/Flow/stories/Base/Dashboard.tsx index 0e9b9bca26..731b85b159 100644 --- a/packages/lab/src/Flow/stories/Base/Dashboard.tsx +++ b/packages/lab/src/Flow/stories/Base/Dashboard.tsx @@ -15,13 +15,13 @@ import { Info } from "@hitachivantara/uikit-react-icons"; import { HvDashboard, HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, useFlowInstance, useFlowNodeInputEdges, + type HvFlowNodeFC, + type HvFlowNodeProps, } from "@hitachivantara/uikit-react-lab"; -import { LayoutConfig, useLayoutsContext } from "./LayoutsContext"; +import { useLayoutsContext, type LayoutConfig } from "./LayoutsContext"; import { buildLayout } from "./utils"; interface DashboardData { diff --git a/packages/lab/src/Flow/stories/Base/KPI.tsx b/packages/lab/src/Flow/stories/Base/KPI.tsx index b116f54ef0..3c9d49d4b5 100644 --- a/packages/lab/src/Flow/stories/Base/KPI.tsx +++ b/packages/lab/src/Flow/stories/Base/KPI.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const KPI: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/Base/LayoutsContext.tsx b/packages/lab/src/Flow/stories/Base/LayoutsContext.tsx index 2e6c13159d..fe851b9527 100644 --- a/packages/lab/src/Flow/stories/Base/LayoutsContext.tsx +++ b/packages/lab/src/Flow/stories/Base/LayoutsContext.tsx @@ -1,15 +1,17 @@ import { createContext, - Dispatch, - SetStateAction, useContext, useMemo, useState, + type Dispatch, + type SetStateAction, } from "react"; -import { HvDashboardProps } from "@hitachivantara/uikit-react-lab"; +import type { HvDashboardProps } from "@hitachivantara/uikit-react-lab"; -export interface LayoutConfig - extends Pick { +export interface LayoutConfig extends Pick< + HvDashboardProps, + "layout" | "cols" +> { items?: { id: string; type: string; diff --git a/packages/lab/src/Flow/stories/Base/LineChart.tsx b/packages/lab/src/Flow/stories/Base/LineChart.tsx index 54924f51f7..752e3018f8 100644 --- a/packages/lab/src/Flow/stories/Base/LineChart.tsx +++ b/packages/lab/src/Flow/stories/Base/LineChart.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const LineChart: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/Base/MLModel.tsx b/packages/lab/src/Flow/stories/Base/MLModel.tsx index f4854dd8c0..4abde5e382 100644 --- a/packages/lab/src/Flow/stories/Base/MLModel.tsx +++ b/packages/lab/src/Flow/stories/Base/MLModel.tsx @@ -1,4 +1,4 @@ -import { HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import type { HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; // The code for these components are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base import { MLModelDetection } from "./MLModelDetection"; diff --git a/packages/lab/src/Flow/stories/Base/MLModelDetection.tsx b/packages/lab/src/Flow/stories/Base/MLModelDetection.tsx index a8a03a06dd..5b65c5e46f 100644 --- a/packages/lab/src/Flow/stories/Base/MLModelDetection.tsx +++ b/packages/lab/src/Flow/stories/Base/MLModelDetection.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const MLModelDetection: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/Base/MLModelPrediction.tsx b/packages/lab/src/Flow/stories/Base/MLModelPrediction.tsx index b974f35a17..f320646cce 100644 --- a/packages/lab/src/Flow/stories/Base/MLModelPrediction.tsx +++ b/packages/lab/src/Flow/stories/Base/MLModelPrediction.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const MLModelPrediction: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/Base/Table.tsx b/packages/lab/src/Flow/stories/Base/Table.tsx index 61e7a5c7fc..9e3b40788c 100644 --- a/packages/lab/src/Flow/stories/Base/Table.tsx +++ b/packages/lab/src/Flow/stories/Base/Table.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const Table: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/Base/index.tsx b/packages/lab/src/Flow/stories/Base/index.tsx index 14c4cf7eec..70019d2ce5 100644 --- a/packages/lab/src/Flow/stories/Base/index.tsx +++ b/packages/lab/src/Flow/stories/Base/index.tsx @@ -1,11 +1,11 @@ -import { Modifier } from "@dnd-kit/core"; +import type { Modifier } from "@dnd-kit/core"; import { Cards, Cluster, LineChartAlt, MachineLearning, } from "@hitachivantara/uikit-react-icons"; -import { HvFlowProps } from "@hitachivantara/uikit-react-lab"; +import type { HvFlowProps } from "@hitachivantara/uikit-react-lab"; import { Asset } from "./Asset"; // The code for these components are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base diff --git a/packages/lab/src/Flow/stories/Base/utils.ts b/packages/lab/src/Flow/stories/Base/utils.ts index d52a8658a7..908611940e 100644 --- a/packages/lab/src/Flow/stories/Base/utils.ts +++ b/packages/lab/src/Flow/stories/Base/utils.ts @@ -1,4 +1,4 @@ -import { LayoutConfig } from "./LayoutsContext"; +import type { LayoutConfig } from "./LayoutsContext"; export const buildLayout = ( items?: LayoutConfig["items"], diff --git a/packages/lab/src/Flow/stories/BaseHook/IconEdge.tsx b/packages/lab/src/Flow/stories/BaseHook/IconEdge.tsx index 642f62f7d6..867671fc4d 100644 --- a/packages/lab/src/Flow/stories/BaseHook/IconEdge.tsx +++ b/packages/lab/src/Flow/stories/BaseHook/IconEdge.tsx @@ -1,8 +1,8 @@ import { BaseEdge, EdgeLabelRenderer, - EdgeProps, getBezierPath, + type EdgeProps, } from "reactflow"; import { Level0Good } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/lab/src/Flow/stories/BaseHook/Node.tsx b/packages/lab/src/Flow/stories/BaseHook/Node.tsx index c1f25fc8c6..d275e8ad35 100644 --- a/packages/lab/src/Flow/stories/BaseHook/Node.tsx +++ b/packages/lab/src/Flow/stories/BaseHook/Node.tsx @@ -3,15 +3,15 @@ import { Handle, NodeToolbar, Position, - NodeProps as ReactFlowNodeProps, + type NodeProps as ReactFlowNodeProps, } from "reactflow"; import { HvIconButton, HvTypography } from "@hitachivantara/uikit-react-core"; import { Level0Good } from "@hitachivantara/uikit-react-icons"; import { - HvFlowNodeInput, - HvFlowNodeOutput, useFlowNodeEdges, useHvNode, + type HvFlowNodeInput, + type HvFlowNodeOutput, } from "@hitachivantara/uikit-react-lab"; import { mergeStyles } from "@hitachivantara/uikit-react-utils"; import { theme } from "@hitachivantara/uikit-styles"; diff --git a/packages/lab/src/Flow/stories/BaseHook/index.tsx b/packages/lab/src/Flow/stories/BaseHook/index.tsx index 030c5a167f..8c66158a88 100644 --- a/packages/lab/src/Flow/stories/BaseHook/index.tsx +++ b/packages/lab/src/Flow/stories/BaseHook/index.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { restrictToWindowEdges } from "@dnd-kit/modifiers"; import { css } from "@emotion/css"; -import { NodeProps } from "reactflow"; +import type { NodeProps } from "reactflow"; import { HvButton, HvGlobalActions, @@ -23,8 +23,8 @@ import { HvFlowBackground, HvFlowControls, HvFlowEmpty, - HvFlowProps, HvFlowSidebar, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; import { restrictToSample } from "../Base"; diff --git a/packages/lab/src/Flow/stories/CustomDrop/BarChart.tsx b/packages/lab/src/Flow/stories/CustomDrop/BarChart.tsx index 40320bb9dc..b450594792 100644 --- a/packages/lab/src/Flow/stories/CustomDrop/BarChart.tsx +++ b/packages/lab/src/Flow/stories/CustomDrop/BarChart.tsx @@ -1,12 +1,12 @@ import { css } from "@emotion/css"; import { HvFlowNode, - HvFlowNodeFC, useFlowInputNodes, + type HvFlowNodeFC, } from "@hitachivantara/uikit-react-lab"; import { HvBarChart } from "@hitachivantara/uikit-react-viz"; -import { data, NodeData } from "./data"; +import { data, type NodeData } from "./data"; export const BarChart: HvFlowNodeFC = (props) => { const inputNodes = useFlowInputNodes(); diff --git a/packages/lab/src/Flow/stories/CustomDrop/LineChart.tsx b/packages/lab/src/Flow/stories/CustomDrop/LineChart.tsx index 23967dee31..8dda5b3518 100644 --- a/packages/lab/src/Flow/stories/CustomDrop/LineChart.tsx +++ b/packages/lab/src/Flow/stories/CustomDrop/LineChart.tsx @@ -1,12 +1,12 @@ import { css } from "@emotion/css"; import { HvFlowNode, - HvFlowNodeFC, useFlowInputNodes, + type HvFlowNodeFC, } from "@hitachivantara/uikit-react-lab"; import { HvLineChart } from "@hitachivantara/uikit-react-viz"; -import { data, NodeData } from "./data"; +import { data, type NodeData } from "./data"; export const LineChart: HvFlowNodeFC = (props) => { const inputNodes = useFlowInputNodes(); diff --git a/packages/lab/src/Flow/stories/CustomDrop/Precipitation.tsx b/packages/lab/src/Flow/stories/CustomDrop/Precipitation.tsx index 292297c936..c9eda62fee 100644 --- a/packages/lab/src/Flow/stories/CustomDrop/Precipitation.tsx +++ b/packages/lab/src/Flow/stories/CustomDrop/Precipitation.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; import { data } from "./data"; diff --git a/packages/lab/src/Flow/stories/CustomDrop/index.tsx b/packages/lab/src/Flow/stories/CustomDrop/index.tsx index fcf5e17f88..8530184be5 100644 --- a/packages/lab/src/Flow/stories/CustomDrop/index.tsx +++ b/packages/lab/src/Flow/stories/CustomDrop/index.tsx @@ -21,9 +21,9 @@ import { import { HvFlow, HvFlowControls, - HvFlowInstance, - HvFlowProps, HvFlowSidebar, + type HvFlowInstance, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; // The code for these utils are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base diff --git a/packages/lab/src/Flow/stories/Dynamic/index.tsx b/packages/lab/src/Flow/stories/Dynamic/index.tsx index 4e039fe836..1564fe9732 100644 --- a/packages/lab/src/Flow/stories/Dynamic/index.tsx +++ b/packages/lab/src/Flow/stories/Dynamic/index.tsx @@ -11,12 +11,12 @@ import { Add, Backwards, DataSource } from "@hitachivantara/uikit-react-icons"; import { HvFlow, HvFlowControls, - HvFlowGroupItem, HvFlowNode, - HvFlowNodeFC, - HvFlowNodeProps, - HvFlowProps, HvFlowSidebar, + type HvFlowGroupItem, + type HvFlowNodeFC, + type HvFlowNodeProps, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; import { restrictToSample } from "../Base"; diff --git a/packages/lab/src/Flow/stories/DynamicHandles/Asset.tsx b/packages/lab/src/Flow/stories/DynamicHandles/Asset.tsx index a2a57780f8..d38f1db145 100644 --- a/packages/lab/src/Flow/stories/DynamicHandles/Asset.tsx +++ b/packages/lab/src/Flow/stories/DynamicHandles/Asset.tsx @@ -1,11 +1,11 @@ import { useEffect, useMemo, useRef } from "react"; import { HvFlowNode, - HvFlowNodeFC, - HvFlowNodeInput, - HvFlowNodeOutput, useFlowInstance, useFlowNodeUtils, + type HvFlowNodeFC, + type HvFlowNodeInput, + type HvFlowNodeOutput, } from "@hitachivantara/uikit-react-lab"; // Inputs and outputs info diff --git a/packages/lab/src/Flow/stories/DynamicHandles/index.tsx b/packages/lab/src/Flow/stories/DynamicHandles/index.tsx index 25129c39d4..ec8436f824 100644 --- a/packages/lab/src/Flow/stories/DynamicHandles/index.tsx +++ b/packages/lab/src/Flow/stories/DynamicHandles/index.tsx @@ -16,15 +16,15 @@ import { Add, DataSource } from "@hitachivantara/uikit-react-icons"; import { HvFlow, HvFlowControls, - HvFlowInstance, - HvFlowProps, HvFlowSidebar, + type HvFlowInstance, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; // The code for these utils are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base import { restrictToSample } from "../Base"; // The code for these utils are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/CustomNode -import { Asset, NodeData, types } from "./Asset"; +import { Asset, types, type NodeData } from "./Asset"; // Classes const classes = { diff --git a/packages/lab/src/Flow/stories/Flow.stories.tsx b/packages/lab/src/Flow/stories/Flow.stories.tsx index 1b034c40da..dbb96e1c97 100644 --- a/packages/lab/src/Flow/stories/Flow.stories.tsx +++ b/packages/lab/src/Flow/stories/Flow.stories.tsx @@ -6,8 +6,8 @@ import { HvFlowBackground, HvFlowControls, HvFlowMinimap, - HvFlowProps, HvFlowSidebar, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; import { HvVizProvider } from "@hitachivantara/uikit-react-viz"; diff --git a/packages/lab/src/Flow/stories/InitialState/index.tsx b/packages/lab/src/Flow/stories/InitialState/index.tsx index 2e517c6083..c63414baac 100644 --- a/packages/lab/src/Flow/stories/InitialState/index.tsx +++ b/packages/lab/src/Flow/stories/InitialState/index.tsx @@ -16,17 +16,17 @@ import { Add, Backwards } from "@hitachivantara/uikit-react-icons"; import { HvFlow, HvFlowControls, - HvFlowInstance, - HvFlowProps, HvFlowSidebar, + type HvFlowInstance, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; // The code for these values are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base/index.tsx import { nodeGroups, nodeTypes, restrictToSample } from "../Base"; import { - Layouts, LayoutsProvider, useLayoutsContext, + type Layouts, } from "../Base/LayoutsContext"; // Initial state diff --git a/packages/lab/src/Flow/stories/Main/index.tsx b/packages/lab/src/Flow/stories/Main/index.tsx index 4e04cf55a2..b1325ad589 100644 --- a/packages/lab/src/Flow/stories/Main/index.tsx +++ b/packages/lab/src/Flow/stories/Main/index.tsx @@ -14,12 +14,17 @@ import { HvFlow, HvFlowControls, HvFlowEmpty, - HvFlowProps, HvFlowSidebar, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; // The code for these values are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base/index.tsx -import { nodeGroups, NodeType, nodeTypes, restrictToSample } from "../Base"; +import { + nodeGroups, + nodeTypes, + restrictToSample, + type NodeType, +} from "../Base"; import { LayoutsProvider } from "../Base/LayoutsContext"; // Flow diff --git a/packages/lab/src/Flow/stories/NoGroups/Asset.tsx b/packages/lab/src/Flow/stories/NoGroups/Asset.tsx index 00c885fafc..f0e0b92a23 100644 --- a/packages/lab/src/Flow/stories/NoGroups/Asset.tsx +++ b/packages/lab/src/Flow/stories/NoGroups/Asset.tsx @@ -1,5 +1,5 @@ import { Cluster } from "@hitachivantara/uikit-react-icons"; -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const Asset: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/NoGroups/LineChart.tsx b/packages/lab/src/Flow/stories/NoGroups/LineChart.tsx index 65339e3518..ce9238f03d 100644 --- a/packages/lab/src/Flow/stories/NoGroups/LineChart.tsx +++ b/packages/lab/src/Flow/stories/NoGroups/LineChart.tsx @@ -1,5 +1,5 @@ import { LineChartAlt } from "@hitachivantara/uikit-react-icons"; -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const LineChart: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/NoGroups/MLModel.tsx b/packages/lab/src/Flow/stories/NoGroups/MLModel.tsx index c3c91f62d2..0b2bf09279 100644 --- a/packages/lab/src/Flow/stories/NoGroups/MLModel.tsx +++ b/packages/lab/src/Flow/stories/NoGroups/MLModel.tsx @@ -1,4 +1,4 @@ -import { HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import type { HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; // The code for these components are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/NoGroups import { MLModelDetection } from "./MLModelDetection"; diff --git a/packages/lab/src/Flow/stories/NoGroups/MLModelDetection.tsx b/packages/lab/src/Flow/stories/NoGroups/MLModelDetection.tsx index d78c29d5c4..5d11364ec9 100644 --- a/packages/lab/src/Flow/stories/NoGroups/MLModelDetection.tsx +++ b/packages/lab/src/Flow/stories/NoGroups/MLModelDetection.tsx @@ -1,5 +1,5 @@ import { MachineLearning } from "@hitachivantara/uikit-react-icons"; -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const MLModelDetection: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/NoGroups/MLModelPrediction.tsx b/packages/lab/src/Flow/stories/NoGroups/MLModelPrediction.tsx index bbbcc1ba2f..9392b0c3c9 100644 --- a/packages/lab/src/Flow/stories/NoGroups/MLModelPrediction.tsx +++ b/packages/lab/src/Flow/stories/NoGroups/MLModelPrediction.tsx @@ -1,5 +1,5 @@ import { MachineLearning } from "@hitachivantara/uikit-react-icons"; -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const MLModelPrediction: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/NoGroups/index.tsx b/packages/lab/src/Flow/stories/NoGroups/index.tsx index 1a2befe3e8..5a2231fb4f 100644 --- a/packages/lab/src/Flow/stories/NoGroups/index.tsx +++ b/packages/lab/src/Flow/stories/NoGroups/index.tsx @@ -12,8 +12,8 @@ import { Add, Backwards } from "@hitachivantara/uikit-react-icons"; import { HvFlow, HvFlowControls, - HvFlowProps, HvFlowSidebar, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; // The code for these utils are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base diff --git a/packages/lab/src/Flow/stories/SubFlow/Level.tsx b/packages/lab/src/Flow/stories/SubFlow/Level.tsx index 4e374299eb..ae87091ec4 100644 --- a/packages/lab/src/Flow/stories/SubFlow/Level.tsx +++ b/packages/lab/src/Flow/stories/SubFlow/Level.tsx @@ -3,11 +3,11 @@ import { css, cx } from "@emotion/css"; import { HvButton, HvDropDownMenu, - HvListValue, HvOverflowTooltip, HvTypography, theme, useUniqueId, + type HvListValue, } from "@hitachivantara/uikit-react-core"; import { DropDownXS, DropUpXS } from "@hitachivantara/uikit-react-icons"; diff --git a/packages/lab/src/Flow/stories/SubFlow/Node.tsx b/packages/lab/src/Flow/stories/SubFlow/Node.tsx index 481b19266a..6fdc502552 100644 --- a/packages/lab/src/Flow/stories/SubFlow/Node.tsx +++ b/packages/lab/src/Flow/stories/SubFlow/Node.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from "react"; import { css, cx } from "@emotion/css"; -import { NodeProps as ReactFlowNodeProps } from "reactflow"; +import type { NodeProps as ReactFlowNodeProps } from "reactflow"; import { theme } from "@hitachivantara/uikit-react-core"; import { useFlowNodeIntersections, @@ -8,7 +8,7 @@ import { } from "@hitachivantara/uikit-react-lab"; import { FactTable } from "./FactTable"; -import { HierarchyData, Level } from "./Level"; +import { Level, type HierarchyData } from "./Level"; const classes = { root: css({ diff --git a/packages/lab/src/Flow/stories/SubFlow/NodeGroup.tsx b/packages/lab/src/Flow/stories/SubFlow/NodeGroup.tsx index 83af5344f2..2d63c5713b 100644 --- a/packages/lab/src/Flow/stories/SubFlow/NodeGroup.tsx +++ b/packages/lab/src/Flow/stories/SubFlow/NodeGroup.tsx @@ -3,13 +3,13 @@ import { css, cx } from "@emotion/css"; import { NodeResizeControl, NodeResizer, - NodeProps as ReactFlowNodeProps, + type NodeProps as ReactFlowNodeProps, } from "reactflow"; import { HvDropDownMenu, - HvListValue, HvTypography, theme, + type HvListValue, } from "@hitachivantara/uikit-react-core"; import { Fullscreen } from "@hitachivantara/uikit-react-icons"; import { useHvNode } from "@hitachivantara/uikit-react-lab"; diff --git a/packages/lab/src/Flow/stories/SubFlow/index.tsx b/packages/lab/src/Flow/stories/SubFlow/index.tsx index 9258e9b19c..f0d3f665f6 100644 --- a/packages/lab/src/Flow/stories/SubFlow/index.tsx +++ b/packages/lab/src/Flow/stories/SubFlow/index.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { restrictToWindowEdges } from "@dnd-kit/modifiers"; import { css } from "@emotion/css"; -import { NodeProps } from "reactflow"; +import type { NodeProps } from "reactflow"; import { HvButton, HvGlobalActions, @@ -25,12 +25,12 @@ import { HvFlowBackground, HvFlowControls, HvFlowEmpty, - HvFlowProps, HvFlowSidebar, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; import { restrictToSample } from "../Base"; -import { HierarchyData } from "./Level"; +import type { HierarchyData } from "./Level"; import { Node } from "./Node"; import { NodeGroup } from "./NodeGroup"; diff --git a/packages/lab/src/Flow/stories/Visualizations/BarChart.tsx b/packages/lab/src/Flow/stories/Visualizations/BarChart.tsx index 830f1cd97a..4500bf3070 100644 --- a/packages/lab/src/Flow/stories/Visualizations/BarChart.tsx +++ b/packages/lab/src/Flow/stories/Visualizations/BarChart.tsx @@ -1,8 +1,8 @@ import { css } from "@emotion/css"; import { HvFlowNode, - HvFlowNodeFC, useFlowInputNodes, + type HvFlowNodeFC, } from "@hitachivantara/uikit-react-lab"; import { HvBarChart } from "@hitachivantara/uikit-react-viz"; diff --git a/packages/lab/src/Flow/stories/Visualizations/Filter.tsx b/packages/lab/src/Flow/stories/Visualizations/Filter.tsx index 996fa152f0..a6d2bf86ba 100644 --- a/packages/lab/src/Flow/stories/Visualizations/Filter.tsx +++ b/packages/lab/src/Flow/stories/Visualizations/Filter.tsx @@ -2,17 +2,17 @@ import { useMemo } from "react"; import { HvCheckBox, HvCheckBoxGroup, - HvCheckBoxGroupProps, theme, + type HvCheckBoxGroupProps, } from "@hitachivantara/uikit-react-core"; import { HvFlowNode, - HvFlowNodeFC, useFlowInputNodes, useFlowNodeUtils, + type HvFlowNodeFC, } from "@hitachivantara/uikit-react-lab"; -import { NodeData } from "./data"; +import type { NodeData } from "./data"; function filterDataByCountries( data: NodeData["jsonData"], diff --git a/packages/lab/src/Flow/stories/Visualizations/JsonInput.tsx b/packages/lab/src/Flow/stories/Visualizations/JsonInput.tsx index f444f8056d..8a80dca137 100644 --- a/packages/lab/src/Flow/stories/Visualizations/JsonInput.tsx +++ b/packages/lab/src/Flow/stories/Visualizations/JsonInput.tsx @@ -1,4 +1,4 @@ -import { HvFlowNode, HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; +import { HvFlowNode, type HvFlowNodeFC } from "@hitachivantara/uikit-react-lab"; export const JsonInput: HvFlowNodeFC = (props) => { return ( diff --git a/packages/lab/src/Flow/stories/Visualizations/LineChart.tsx b/packages/lab/src/Flow/stories/Visualizations/LineChart.tsx index f9665082be..3bb2b3cffd 100644 --- a/packages/lab/src/Flow/stories/Visualizations/LineChart.tsx +++ b/packages/lab/src/Flow/stories/Visualizations/LineChart.tsx @@ -1,12 +1,12 @@ import { css } from "@emotion/css"; import { HvFlowNode, - HvFlowNodeFC, useFlowInputNodes, + type HvFlowNodeFC, } from "@hitachivantara/uikit-react-lab"; import { HvLineChart } from "@hitachivantara/uikit-react-viz"; -import { NodeData } from "./data"; +import type { NodeData } from "./data"; export const LineChart: HvFlowNodeFC = (props) => { const inputNodes = useFlowInputNodes(); diff --git a/packages/lab/src/Flow/stories/Visualizations/index.tsx b/packages/lab/src/Flow/stories/Visualizations/index.tsx index 25182abcff..07c7676bff 100644 --- a/packages/lab/src/Flow/stories/Visualizations/index.tsx +++ b/packages/lab/src/Flow/stories/Visualizations/index.tsx @@ -18,8 +18,8 @@ import { import { HvFlow, HvFlowControls, - HvFlowProps, HvFlowSidebar, + type HvFlowProps, } from "@hitachivantara/uikit-react-lab"; // The code for these values are available here: https://github.com/pentaho/hv-uikit-react/tree/master/packages/lab/src/components/Flow/stories/Base/index.tsx diff --git a/packages/lab/src/Flow/types.ts b/packages/lab/src/Flow/types.ts index 0d71230773..bcd227d987 100644 --- a/packages/lab/src/Flow/types.ts +++ b/packages/lab/src/Flow/types.ts @@ -1,25 +1,28 @@ -import { Node, NodeProps, ReactFlowInstance } from "reactflow"; -import { +import type { Node, NodeProps, ReactFlowInstance } from "reactflow"; +import type { HvActionGeneric, HvSliderProps, } from "@hitachivantara/uikit-react-core"; -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; import type { HvFlowNodeProps } from "./Node"; // Node types /** HvFlowNode component type. @extends React.FC */ -export interface HvFlowNodeFC - extends React.FC> {} +export interface HvFlowNodeFC extends React.FC< + NodeProps +> {} export type HvFlowNodeTypes = Record< string, HvFlowNodeFC >; -export interface HvFlowGroupItem - extends Pick { +export interface HvFlowGroupItem extends Pick< + HvFlowNodeProps, + "params" | "subtitle" +> { /** The node identifier registered in `nodeTypes` */ nodeType: string; label: string; @@ -87,7 +90,8 @@ export interface HvFlowNodeSelectParam extends HvFlowNodeSharedParam { } export interface HvFlowNodeSliderParam - extends HvFlowNodeSharedParam, + extends + HvFlowNodeSharedParam, Omit { type: "slider"; } diff --git a/packages/lab/src/StepNavigation/DefaultNavigation/DefaultNavigation.tsx b/packages/lab/src/StepNavigation/DefaultNavigation/DefaultNavigation.tsx index dcd2238f8c..ea65f61c0e 100644 --- a/packages/lab/src/StepNavigation/DefaultNavigation/DefaultNavigation.tsx +++ b/packages/lab/src/StepNavigation/DefaultNavigation/DefaultNavigation.tsx @@ -1,11 +1,10 @@ -import { ReactNode } from "react"; -import { +import type { HvBaseProps, HvTheme, HvTypographyVariants, } from "@hitachivantara/uikit-react-core"; -import { HvStep, HvStepProps } from "./Step"; +import { HvStep, type HvStepProps } from "./Step"; import { getColor, stepSizes } from "./utils"; export type ComponentChildProps = { @@ -24,8 +23,10 @@ export type ComponentChildProps = { }; }; -export interface HvDefaultNavigationProps - extends Omit { +export interface HvDefaultNavigationProps extends Omit< + HvBaseProps, + "children" +> { /** Number of steps to show on the component. */ numSteps: number; /** Sets one of the standard sizes of the steps. */ @@ -42,7 +43,7 @@ export interface HvDefaultNavigationProps titleWidth?: number; titleDisabled?: boolean; }, - ) => ReactNode; + ) => React.ReactNode; /** Returns dynamic width values of the component (width, titleWidth, separatorWidth). */ getDynamicValues: (stepsWidth: number) => { width: number; diff --git a/packages/lab/src/StepNavigation/DefaultNavigation/Step/Step.tsx b/packages/lab/src/StepNavigation/DefaultNavigation/Step/Step.tsx index b46c278a6b..09c13a1636 100644 --- a/packages/lab/src/StepNavigation/DefaultNavigation/Step/Step.tsx +++ b/packages/lab/src/StepNavigation/DefaultNavigation/Step/Step.tsx @@ -1,16 +1,16 @@ import { - ExtractNames, HvAvatar, - HvBaseProps, HvButtonBase, - HvButtonBaseProps, - HvSize, + type ExtractNames, + type HvBaseProps, + type HvButtonBaseProps, + type HvSize, } from "@hitachivantara/uikit-react-core"; import { HourGlass, - IconType, Level0Good, Level3Bad, + type IconType, } from "@hitachivantara/uikit-react-icons"; import { getSemantic } from "../utils"; @@ -19,8 +19,7 @@ import { useClasses } from "./Step.styles"; type HvStepClasses = ExtractNames; export interface HvStepProps - extends Pick, - Omit { + extends Pick, Omit { /** A Jss Object used to override or extend the styles applied to the empty state StepNavigation. */ classes?: HvStepClasses; /** State of the step. Values = {"Pending", "Failed", "Completed", "Current", "Disabled", "Enabled"} */ diff --git a/packages/lab/src/StepNavigation/SimpleNavigation/Dot/Dot.tsx b/packages/lab/src/StepNavigation/SimpleNavigation/Dot/Dot.tsx index cc39e150b7..9495f53eec 100644 --- a/packages/lab/src/StepNavigation/SimpleNavigation/Dot/Dot.tsx +++ b/packages/lab/src/StepNavigation/SimpleNavigation/Dot/Dot.tsx @@ -1,11 +1,11 @@ import { - ExtractNames, - HvBaseProps, HvButton, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { mergeStyles } from "@hitachivantara/uikit-react-utils"; -import { HvStepProps } from "../../DefaultNavigation"; +import type { HvStepProps } from "../../DefaultNavigation"; import { dotSizes, getColor } from "../utils"; import { staticClasses, useClasses } from "./Dot.styles"; @@ -14,10 +14,8 @@ export { staticClasses as dotClasses }; export type HvDotClasses = ExtractNames; export interface HvDotProps - extends Pick< - HvStepProps, - "size" | "title" | "state" | "onClick" | "disabled" - >, + extends + Pick, Omit { /** A Jss Object used to override or extend the styles applied to the empty state StepNavigation. */ classes?: HvDotClasses; diff --git a/packages/lab/src/StepNavigation/SimpleNavigation/SimpleNavigation.tsx b/packages/lab/src/StepNavigation/SimpleNavigation/SimpleNavigation.tsx index 68adb27b0c..1f95952d88 100644 --- a/packages/lab/src/StepNavigation/SimpleNavigation/SimpleNavigation.tsx +++ b/packages/lab/src/StepNavigation/SimpleNavigation/SimpleNavigation.tsx @@ -1,11 +1,10 @@ -import { ReactNode } from "react"; -import { +import type { HvBaseProps, HvTheme, HvTypographyVariants, } from "@hitachivantara/uikit-react-core"; -import { HvDot, HvDotProps } from "./Dot"; +import { HvDot, type HvDotProps } from "./Dot"; import { dotSizes, getColor } from "./utils"; export type ComponentChildProps = { @@ -41,7 +40,7 @@ export interface HvSimpleNavigationProps extends Omit { titleWidth?: number; titleDisabled?: boolean; }, - ) => ReactNode; + ) => React.ReactNode; /** Returns dynamic width values of the component (width, titleWidth, separatorWidth). */ getDynamicValues: (stepsWidth: number) => { width: number; diff --git a/packages/lab/src/StepNavigation/SimpleNavigation/utils.ts b/packages/lab/src/StepNavigation/SimpleNavigation/utils.ts index d2d12e1f63..0b57e04830 100644 --- a/packages/lab/src/StepNavigation/SimpleNavigation/utils.ts +++ b/packages/lab/src/StepNavigation/SimpleNavigation/utils.ts @@ -1,6 +1,6 @@ import { theme } from "@hitachivantara/uikit-styles"; -import { HvStepProps } from "../DefaultNavigation"; +import type { HvStepProps } from "../DefaultNavigation"; export const dotSizes = { xs: 8, diff --git a/packages/lab/src/StepNavigation/StepNavigation.stories.tsx b/packages/lab/src/StepNavigation/StepNavigation.stories.tsx index 47987ba117..4558724be6 100644 --- a/packages/lab/src/StepNavigation/StepNavigation.stories.tsx +++ b/packages/lab/src/StepNavigation/StepNavigation.stories.tsx @@ -1,10 +1,14 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvStepNavigation, - HvStepNavigationProps, + type HvStepNavigationProps, } from "@hitachivantara/uikit-react-lab"; -import { HvDefaultNavigation, HvStep, HvStepProps } from "./DefaultNavigation"; +import { + HvDefaultNavigation, + HvStep, + type HvStepProps, +} from "./DefaultNavigation"; import { HvDot, HvSimpleNavigation } from "./SimpleNavigation"; type StepType = Pick< diff --git a/packages/lab/src/StepNavigation/StepNavigation.test.tsx b/packages/lab/src/StepNavigation/StepNavigation.test.tsx index f2fd5be6e8..a3a05a4600 100644 --- a/packages/lab/src/StepNavigation/StepNavigation.test.tsx +++ b/packages/lab/src/StepNavigation/StepNavigation.test.tsx @@ -2,7 +2,7 @@ import { act, render, waitForElementToBeRemoved } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it } from "vitest"; -import { HvStepProps } from "./DefaultNavigation"; +import type { HvStepProps } from "./DefaultNavigation"; import { HvStepNavigation } from "./StepNavigation"; type StepType = Pick< diff --git a/packages/lab/src/StepNavigation/StepNavigation.tsx b/packages/lab/src/StepNavigation/StepNavigation.tsx index 6e912f8ad3..8fc5c4e59a 100644 --- a/packages/lab/src/StepNavigation/StepNavigation.tsx +++ b/packages/lab/src/StepNavigation/StepNavigation.tsx @@ -1,23 +1,23 @@ import styled from "@emotion/styled"; import { - ExtractNames, - HvBaseProps, - HvBreakpoints, HvTooltip, HvTypography, useTheme, useWidth, + type ExtractNames, + type HvBaseProps, + type HvBreakpoints, } from "@hitachivantara/uikit-react-core"; import { theme } from "@hitachivantara/uikit-styles"; import { HvDefaultNavigation, - HvDefaultNavigationProps, - HvStepProps, + type HvDefaultNavigationProps, + type HvStepProps, } from "./DefaultNavigation"; import { HvSimpleNavigation, - HvSimpleNavigationProps, + type HvSimpleNavigationProps, } from "./SimpleNavigation"; import { staticClasses, useClasses } from "./StepNavigation.styles"; import { SEPARATOR_WIDTH, TITLE_MARGIN, TITLE_WIDTH } from "./utils"; diff --git a/packages/lab/src/Wizard/Wizard.stories.tsx b/packages/lab/src/Wizard/Wizard.stories.tsx index 81dd8e2e91..358e8ac057 100644 --- a/packages/lab/src/Wizard/Wizard.stories.tsx +++ b/packages/lab/src/Wizard/Wizard.stories.tsx @@ -16,7 +16,7 @@ import { import { HvWizard, HvWizardContext, - HvWizardProps, + type HvWizardProps, } from "@hitachivantara/uikit-react-lab"; import mockText from "./mockData"; diff --git a/packages/lab/src/Wizard/Wizard.tsx b/packages/lab/src/Wizard/Wizard.tsx index 1f0e3b3468..326306922f 100644 --- a/packages/lab/src/Wizard/Wizard.tsx +++ b/packages/lab/src/Wizard/Wizard.tsx @@ -1,25 +1,24 @@ import { useCallback, useEffect, useMemo, useState } from "react"; -import { +import type { ExtractNames, HvBaseProps, HvDialogProps, } from "@hitachivantara/uikit-react-core"; -import { HvStepNavigationProps } from "../StepNavigation"; +import type { HvStepNavigationProps } from "../StepNavigation"; import { staticClasses, useClasses } from "./Wizard.styles"; -import { HvWizardActions, HvWizardActionsProps } from "./WizardActions"; +import { HvWizardActions, type HvWizardActionsProps } from "./WizardActions"; import { HvWizardContainer } from "./WizardContainer"; import { HvWizardContent } from "./WizardContent"; -import { HvWizardContext, HvWizardTabs } from "./WizardContext"; -import { HvWizardTitle, HvWizardTitleProps } from "./WizardTitle"; +import { HvWizardContext, type HvWizardTabs } from "./WizardContext"; +import { HvWizardTitle, type HvWizardTitleProps } from "./WizardTitle"; export { staticClasses as wizardClasses }; export type HvWizardClasses = ExtractNames; export interface HvWizardProps - extends HvBaseProps, - Pick { + extends HvBaseProps, Pick { /** Current state of the Wizard. */ open: boolean; /** Function executed on close. */ diff --git a/packages/lab/src/Wizard/WizardActions/WizardActions.tsx b/packages/lab/src/Wizard/WizardActions/WizardActions.tsx index 1bc41cd896..fe237f8e29 100644 --- a/packages/lab/src/Wizard/WizardActions/WizardActions.tsx +++ b/packages/lab/src/Wizard/WizardActions/WizardActions.tsx @@ -1,13 +1,13 @@ import { useCallback, useContext, useEffect, useMemo, useState } from "react"; import { - ExtractNames, - HvBaseProps, HvButton, HvDialogActions, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { Backwards, Forwards } from "@hitachivantara/uikit-react-icons"; -import { HvWizardContext, HvWizardTabs } from "../WizardContext"; +import { HvWizardContext, type HvWizardTabs } from "../WizardContext"; import { staticClasses, useClasses } from "./WizardActions.styles"; export { staticClasses as wizardActionsClasses }; diff --git a/packages/lab/src/Wizard/WizardContainer/WizardContainer.tsx b/packages/lab/src/Wizard/WizardContainer/WizardContainer.tsx index 367da3b25a..52302c6449 100644 --- a/packages/lab/src/Wizard/WizardContainer/WizardContainer.tsx +++ b/packages/lab/src/Wizard/WizardContainer/WizardContainer.tsx @@ -1,9 +1,9 @@ import { - ExtractNames, - HvBaseProps, HvDialog, - HvDialogProps, useDefaultProps, + type ExtractNames, + type HvBaseProps, + type HvDialogProps, } from "@hitachivantara/uikit-react-core"; import { staticClasses, useClasses } from "./WizardContainer.styles"; @@ -13,7 +13,8 @@ export { staticClasses as wizardContainerClasses }; export type HvWizardContainerClasses = ExtractNames; export interface HvWizardContainerProps - extends Omit, + extends + Omit, Pick { /** Current state of the Wizard. */ open: boolean; diff --git a/packages/lab/src/Wizard/WizardContent/WizardContent.tsx b/packages/lab/src/Wizard/WizardContent/WizardContent.tsx index 8ec5768054..80bd2452c9 100644 --- a/packages/lab/src/Wizard/WizardContent/WizardContent.tsx +++ b/packages/lab/src/Wizard/WizardContent/WizardContent.tsx @@ -9,13 +9,13 @@ import { } from "react"; import { useElementSize } from "usehooks-ts"; import { - ExtractNames, - HvBaseProps, HvDialogContent, HvLoadingContainer, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; -import { HvWizardContext, HvWizardTabs } from "../WizardContext"; +import { HvWizardContext, type HvWizardTabs } from "../WizardContext"; import { staticClasses, useClasses } from "./WizardContent.styles"; export { staticClasses as wizardContentClasses }; diff --git a/packages/lab/src/Wizard/WizardContext/WizardContext.tsx b/packages/lab/src/Wizard/WizardContext/WizardContext.tsx index bf2dfbcc1a..7797b50db7 100644 --- a/packages/lab/src/Wizard/WizardContext/WizardContext.tsx +++ b/packages/lab/src/Wizard/WizardContext/WizardContext.tsx @@ -1,4 +1,4 @@ -import { createContext, Dispatch, SetStateAction } from "react"; +import { createContext, type Dispatch, type SetStateAction } from "react"; export type HvWizardTab = { name?: string; diff --git a/packages/lab/src/Wizard/WizardTitle/WizardTitle.tsx b/packages/lab/src/Wizard/WizardTitle/WizardTitle.tsx index 24d8a3d35e..4c5f47b423 100644 --- a/packages/lab/src/Wizard/WizardTitle/WizardTitle.tsx +++ b/packages/lab/src/Wizard/WizardTitle/WizardTitle.tsx @@ -1,16 +1,19 @@ import { useContext, useEffect, useState } from "react"; import { - ExtractNames, - HvBaseProps, HvButton, HvDialogTitle, HvTypography, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { Report } from "@hitachivantara/uikit-react-icons"; -import { HvStepNavigation, HvStepNavigationProps } from "../../StepNavigation"; -import { HvStepProps } from "../../StepNavigation/DefaultNavigation"; -import { HvWizardContext, HvWizardTab } from "../WizardContext"; +import { + HvStepNavigation, + type HvStepNavigationProps, +} from "../../StepNavigation"; +import type { HvStepProps } from "../../StepNavigation/DefaultNavigation"; +import { HvWizardContext, type HvWizardTab } from "../WizardContext"; import { staticClasses, useClasses } from "./WizardTitle.styles"; export { staticClasses as wizardTitleClasses }; diff --git a/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.stories.tsx b/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.stories.tsx index aa5ebf0124..d68ebc7543 100644 --- a/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.stories.tsx +++ b/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.stories.tsx @@ -5,7 +5,7 @@ import { HvButton } from "@hitachivantara/uikit-react-core"; import { Favorite, Heart } from "@hitachivantara/uikit-react-icons"; import { HvCanvasBottomPanel, - HvCanvasBottomPanelProps, + type HvCanvasBottomPanelProps, } from "@hitachivantara/uikit-react-pentaho"; const meta: Meta = { diff --git a/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.test.tsx b/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.test.tsx index 553061e49b..f7d5644b5a 100644 --- a/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.test.tsx +++ b/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.test.tsx @@ -2,7 +2,10 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, it, vi } from "vitest"; -import { HvCanvasBottomPanel, HvCanvasBottomPanelProps } from "./BottomPanel"; +import { + HvCanvasBottomPanel, + type HvCanvasBottomPanelProps, +} from "./BottomPanel"; const panelTabs = [ { id: 0, title: "Tab 1" }, diff --git a/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.tsx b/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.tsx index 8f5cdc7417..b5cf6763a9 100644 --- a/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.tsx +++ b/packages/pentaho/src/Canvas/BottomPanel/BottomPanel.tsx @@ -1,22 +1,22 @@ import { forwardRef, useRef, useState } from "react"; import { useResizeDetector } from "react-resize-detector"; import { - ExtractNames, - HvActionGeneric, HvActionsGeneric, - HvActionsGenericProps, - HvBaseProps, HvPanel, theme, useControlled, useDefaultProps, useUniqueId, + type ExtractNames, + type HvActionGeneric, + type HvActionsGenericProps, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { mergeStyles } from "@hitachivantara/uikit-react-utils"; import { useCanvasContext } from "../CanvasContext"; import { HvCanvasPanelTab } from "../PanelTab"; -import { HvCanvasPanelTabs, HvCanvasPanelTabsProps } from "../PanelTabs"; +import { HvCanvasPanelTabs, type HvCanvasPanelTabsProps } from "../PanelTabs"; import { staticClasses, useClasses } from "./BottomPanel.styles"; const PANEL_RADIUS = 16; diff --git a/packages/pentaho/src/Canvas/PanelTab/PanelTab.tsx b/packages/pentaho/src/Canvas/PanelTab/PanelTab.tsx index ef1db834db..1086a4e80e 100644 --- a/packages/pentaho/src/Canvas/PanelTab/PanelTab.tsx +++ b/packages/pentaho/src/Canvas/PanelTab/PanelTab.tsx @@ -1,8 +1,8 @@ import { forwardRef, useRef } from "react"; -import { Tab, TabProps } from "@mui/base"; +import { Tab, type TabProps } from "@mui/base"; import { - ExtractNames, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-core"; import { staticClasses, useClasses } from "./PanelTab.styles"; diff --git a/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.test.tsx b/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.test.tsx index 2087f216e0..922a7dc835 100644 --- a/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.test.tsx +++ b/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.test.tsx @@ -4,7 +4,7 @@ import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; import { HvCanvasPanelTab } from "../PanelTab/PanelTab"; -import { HvCanvasPanelTabs, HvCanvasPanelTabsProps } from "./PanelTabs"; +import { HvCanvasPanelTabs, type HvCanvasPanelTabsProps } from "./PanelTabs"; const Controlled = ({ onChange, diff --git a/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.tsx b/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.tsx index 7a5cf1218b..ddcf867377 100644 --- a/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.tsx +++ b/packages/pentaho/src/Canvas/PanelTabs/PanelTabs.tsx @@ -1,8 +1,8 @@ import { forwardRef } from "react"; import { Tabs, TabsList, type TabsProps } from "@mui/base"; import { - ExtractNames, useDefaultProps, + type ExtractNames, } from "@hitachivantara/uikit-react-core"; import { staticClasses, useClasses } from "./PanelTabs.styles"; diff --git a/packages/pentaho/src/Canvas/SidePanel/SidePanel.stories.tsx b/packages/pentaho/src/Canvas/SidePanel/SidePanel.stories.tsx index 9ba7c4dd90..c7f576bdc0 100644 --- a/packages/pentaho/src/Canvas/SidePanel/SidePanel.stories.tsx +++ b/packages/pentaho/src/Canvas/SidePanel/SidePanel.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvCanvasSidePanel, - HvCanvasSidePanelProps, + type HvCanvasSidePanelProps, } from "@hitachivantara/uikit-react-pentaho"; const meta: Meta = { @@ -23,6 +23,7 @@ export const Main: StoryObj = { render: (args) => (
+ {/* oxlint-disable jsx-a11y/no-noninteractive-tabindex */}
Some content

Main content

diff --git a/packages/pentaho/src/Canvas/SidePanel/SidePanel.test.tsx b/packages/pentaho/src/Canvas/SidePanel/SidePanel.test.tsx index b12fa08332..05b725efc8 100644 --- a/packages/pentaho/src/Canvas/SidePanel/SidePanel.test.tsx +++ b/packages/pentaho/src/Canvas/SidePanel/SidePanel.test.tsx @@ -5,7 +5,7 @@ import { describe, expect, it, vi } from "vitest"; import { HvButton } from "@hitachivantara/uikit-react-core"; import { HvCanvasProvider } from "../CanvasContext"; -import { HvCanvasSidePanel, HvCanvasSidePanelProps } from "./SidePanel"; +import { HvCanvasSidePanel, type HvCanvasSidePanelProps } from "./SidePanel"; const label = "Test"; diff --git a/packages/pentaho/src/Canvas/SidePanel/SidePanel.tsx b/packages/pentaho/src/Canvas/SidePanel/SidePanel.tsx index 2280f0d9a2..df1125e215 100644 --- a/packages/pentaho/src/Canvas/SidePanel/SidePanel.tsx +++ b/packages/pentaho/src/Canvas/SidePanel/SidePanel.tsx @@ -1,19 +1,19 @@ import { forwardRef, useEffect, useId } from "react"; import { - ExtractNames, - HvBaseProps, HvButton, HvPanel, useControlled, useDefaultProps, useLabels, useUniqueId, + type ExtractNames, + type HvBaseProps, } from "@hitachivantara/uikit-react-core"; import { End } from "@hitachivantara/uikit-react-icons"; import { useCanvasContext } from "../CanvasContext"; import { HvCanvasPanelTab } from "../PanelTab"; -import { HvCanvasPanelTabs, HvCanvasPanelTabsProps } from "../PanelTabs"; +import { HvCanvasPanelTabs, type HvCanvasPanelTabsProps } from "../PanelTabs"; import { staticClasses, useClasses } from "./SidePanel.styles"; import { useResizable } from "./useResizable"; @@ -26,8 +26,10 @@ const DEFAULT_LABELS = { close: "Close", }; -export interface HvCanvasSidePanelProps - extends HvBaseProps { +export interface HvCanvasSidePanelProps extends HvBaseProps< + HTMLDivElement, + "onToggle" +> { /** When controlled, defines id the panel is open or not. */ open?: boolean; /** When uncontrolled, defines the initial state of the panel. */ diff --git a/packages/pentaho/src/Canvas/Toolbar/Toolbar.stories.tsx b/packages/pentaho/src/Canvas/Toolbar/Toolbar.stories.tsx index 3d433e116a..b4a9ce2e36 100644 --- a/packages/pentaho/src/Canvas/Toolbar/Toolbar.stories.tsx +++ b/packages/pentaho/src/Canvas/Toolbar/Toolbar.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvButton } from "@hitachivantara/uikit-react-core"; import { HvCanvasToolbar, - HvCanvasToolbarProps, + type HvCanvasToolbarProps, } from "@hitachivantara/uikit-react-pentaho"; const meta: Meta = { diff --git a/packages/pentaho/src/Canvas/Toolbar/Toolbar.tsx b/packages/pentaho/src/Canvas/Toolbar/Toolbar.tsx index 43dcf85965..55769b0464 100644 --- a/packages/pentaho/src/Canvas/Toolbar/Toolbar.tsx +++ b/packages/pentaho/src/Canvas/Toolbar/Toolbar.tsx @@ -1,12 +1,12 @@ import { forwardRef } from "react"; import { - ExtractNames, - HvBaseProps, HvIconButton, - HvIconButtonProps, HvTypography, useDefaultProps, useLabels, + type ExtractNames, + type HvBaseProps, + type HvIconButtonProps, } from "@hitachivantara/uikit-react-core"; import { Previous } from "@hitachivantara/uikit-react-icons"; import { mergeStyles } from "@hitachivantara/uikit-react-utils"; @@ -22,8 +22,10 @@ const DEFAULT_LABELS = { back: "Back", }; -export interface HvCanvasToolbarProps - extends HvBaseProps { +export interface HvCanvasToolbarProps extends HvBaseProps< + HTMLDivElement, + "title" +> { /** Text to display in the component. */ title: React.ReactNode; /** Fully customized button or false for when the back button should not be rendered. */ diff --git a/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabEditor.tsx b/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabEditor.tsx index 875391ce4f..de20f5f0b8 100644 --- a/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabEditor.tsx +++ b/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabEditor.tsx @@ -1,13 +1,13 @@ import { useRef, useState } from "react"; import { createClasses, - ExtractNames, HvTypography, - HvTypographyProps, isKey, theme, useControlled, useEnhancedEffect, + type ExtractNames, + type HvTypographyProps, } from "@hitachivantara/uikit-react-core"; import { Edit } from "@hitachivantara/uikit-react-icons"; @@ -67,8 +67,10 @@ export { staticClasses as toolbarTabEditorClasses }; type ToolbarTabEditorClasses = ExtractNames; -interface ToolbarTabEditorProps - extends Omit { +interface ToolbarTabEditorProps extends Omit< + HvTypographyProps, + "classes" | "onBlur" | "onChange" +> { /** The value of the component. When used, the component has to be controlled. */ value?: string; /** The default value of the component. */ diff --git a/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.stories.tsx b/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.stories.tsx index a1cacd05ce..3d01b895d3 100644 --- a/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.stories.tsx +++ b/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.stories.tsx @@ -3,7 +3,7 @@ import { expect } from "storybook/test"; import { Leaf } from "@hitachivantara/uikit-react-icons"; import { HvCanvasToolbarTabs, - HvCanvasToolbarTabsProps, + type HvCanvasToolbarTabsProps, } from "@hitachivantara/uikit-react-pentaho"; import { ControlledStory } from "./stories/Controlled"; diff --git a/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.test.tsx b/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.test.tsx index 228376eb1d..ff16e05669 100644 --- a/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.test.tsx +++ b/packages/pentaho/src/Canvas/ToolbarTabs/ToolbarTabs.test.tsx @@ -2,7 +2,10 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, it, vi } from "vitest"; -import { HvCanvasToolbarTabs, HvCanvasToolbarTabsProps } from "./ToolbarTabs"; +import { + HvCanvasToolbarTabs, + type HvCanvasToolbarTabsProps, +} from "./ToolbarTabs"; const Sample = (props: Partial) => ( { +export interface HvCanvasToolbarTabsProps extends HvBaseProps< + HTMLDivElement, + "onChange" +> { /** When controlled, defines the tabs. */ tabs?: ToolbarTabsTab[]; /** When uncontrolled, defines the initial tabs. */ diff --git a/packages/pentaho/src/Canvas/ToolbarTabs/stories/Controlled.tsx b/packages/pentaho/src/Canvas/ToolbarTabs/stories/Controlled.tsx index a88cae7399..f848c02c0d 100644 --- a/packages/pentaho/src/Canvas/ToolbarTabs/stories/Controlled.tsx +++ b/packages/pentaho/src/Canvas/ToolbarTabs/stories/Controlled.tsx @@ -11,7 +11,7 @@ import { Info } from "@hitachivantara/uikit-react-icons"; import { HvCanvasToolbar, HvCanvasToolbarTabs, - HvCanvasToolbarTabsProps, + type HvCanvasToolbarTabsProps, } from "@hitachivantara/uikit-react-pentaho"; const classes = { diff --git a/packages/shared/src/context/EmotionContext.ts b/packages/shared/src/context/EmotionContext.ts index 81b06e7986..2e6d4232f8 100644 --- a/packages/shared/src/context/EmotionContext.ts +++ b/packages/shared/src/context/EmotionContext.ts @@ -1,5 +1,5 @@ import { createContext } from "react"; -import createCache, { EmotionCache } from "@emotion/cache"; +import createCache, { type EmotionCache } from "@emotion/cache"; export const defaultCacheKey = "hv"; diff --git a/packages/shared/src/context/ThemeContext.ts b/packages/shared/src/context/ThemeContext.ts index ae0a26be16..abdb8e864e 100644 --- a/packages/shared/src/context/ThemeContext.ts +++ b/packages/shared/src/context/ThemeContext.ts @@ -1,7 +1,7 @@ import { createContext } from "react"; -import { HvThemeColorMode } from "@hitachivantara/uikit-styles"; +import type { HvThemeColorMode } from "@hitachivantara/uikit-styles"; -import { HvTheme } from "../types/theme"; +import type { HvTheme } from "../types/theme"; export interface HvThemeContextValue { colorModes: HvThemeColorMode[]; diff --git a/packages/shared/src/types/theme.ts b/packages/shared/src/types/theme.ts index 9cbe61a3d6..0a71a7a146 100644 --- a/packages/shared/src/types/theme.ts +++ b/packages/shared/src/types/theme.ts @@ -1,4 +1,4 @@ -import { HvThemeStructure } from "@hitachivantara/uikit-styles"; +import type { HvThemeStructure } from "@hitachivantara/uikit-styles"; /** This type allows to pass undetermined extra props to components recursively */ type HvExtraDeepProps = { diff --git a/packages/styles/src/makeTheme.ts b/packages/styles/src/makeTheme.ts index c1ec3a3e8f..a9f42edea3 100644 --- a/packages/styles/src/makeTheme.ts +++ b/packages/styles/src/makeTheme.ts @@ -1,4 +1,4 @@ -import { HvTheme, theme } from "./theme"; +import { theme, type HvTheme } from "./theme"; import { baseTheme } from "./tokens"; import { colors, diff --git a/packages/styles/src/theme.ts b/packages/styles/src/theme.ts index 81594e53c8..92ed4e01ee 100644 --- a/packages/styles/src/theme.ts +++ b/packages/styles/src/theme.ts @@ -1,7 +1,7 @@ import { palette } from "./palette"; import { baseTheme as tokens } from "./tokens"; import { colors, type HvColor, type HvColorAny } from "./tokens/colors"; -import { +import type { DeepString, HvThemeComponents, HvThemeTypography, diff --git a/packages/styles/src/tokens/colors.ts b/packages/styles/src/tokens/colors.ts index ae7eae5297..47dce7b5a3 100644 --- a/packages/styles/src/tokens/colors.ts +++ b/packages/styles/src/tokens/colors.ts @@ -22,8 +22,7 @@ type SemanticKeys = type VizKeys = `cat${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}`; export interface HvColorTokens - extends Record, string>, - Record { + extends Record, string>, Record { // #region semantic // 🔎: border tokens don't exist for "primary" accentBorder: string; diff --git a/packages/styles/src/types.ts b/packages/styles/src/types.ts index d1fce1adaa..6c5af25add 100644 --- a/packages/styles/src/types.ts +++ b/packages/styles/src/types.ts @@ -3,20 +3,22 @@ import type { StandardProperties } from "csstype"; import type { HvThemeBreakpoints } from "./tokens/breakpoints"; import type { HvThemeColors } from "./tokens/colors"; import type { HvThemeRadii } from "./tokens/radii"; -import { HvThemeSpace, space } from "./tokens/space"; -import { +import type { HvThemeSpace, space } from "./tokens/space"; +import type { fontFamily, fontSizes, fontWeights, lineHeights, } from "./tokens/typography"; -import { zIndices } from "./tokens/zIndices"; +import type { zIndices } from "./tokens/zIndices"; interface CSSProperties extends StandardProperties {} /** @experimental extendable theme spacing units */ -export interface HvThemeZIndices - extends Record {} +export interface HvThemeZIndices extends Record< + keyof typeof zIndices, + number +> {} /** UI Kit static theme tokens */ export interface HvThemeTokens { @@ -80,16 +82,15 @@ export interface HvThemeComponents { // Theme typography // TODO: remove in favor of `CSSProperties` when supported -export interface HvThemeTypographyProps - extends Pick< - CSSProperties, - | "color" - | "fontSize" - | "letterSpacing" - | "lineHeight" - | "fontWeight" - | "textDecoration" - > {} +export interface HvThemeTypographyProps extends Pick< + CSSProperties, + | "color" + | "fontSize" + | "letterSpacing" + | "lineHeight" + | "fontWeight" + | "textDecoration" +> {} type TypographyVariants = | "display" @@ -120,12 +121,12 @@ export type HvThemeColorMode = "light" | "dark"; /** extendable `HvThemeColors` type */ export interface HvThemeColorsAny - extends HvThemeColors, - Record {} + extends HvThemeColors, Record {} /** Complete theme structure and values */ export interface HvThemeStructure - extends HvThemeComponents, + extends + HvThemeComponents, HvThemeComponentsProps, HvThemeTypography, Omit { @@ -141,8 +142,9 @@ export interface HvThemeStructure } // Custom theme -export interface HvCustomTheme - extends DeepPartial> {} +export interface HvCustomTheme extends DeepPartial< + Omit +> {} // Deep string: set all props to strings export type DeepString = { @@ -155,6 +157,7 @@ type DeepPartial = T extends {} // Theme CSS vars export interface HvThemeVars - extends DeepString, + extends + DeepString, DeepString, DeepString {} diff --git a/packages/uno-preset/src/index.ts b/packages/uno-preset/src/index.ts index ccd25e1214..675992710a 100644 --- a/packages/uno-preset/src/index.ts +++ b/packages/uno-preset/src/index.ts @@ -1,6 +1,10 @@ -import { definePreset, mergeConfigs, UserConfig } from "@unocss/core"; +import { definePreset, mergeConfigs, type UserConfig } from "@unocss/core"; import { presetRemToPx } from "@unocss/preset-rem-to-px"; -import { presetWind3, PresetWind3Options, Theme } from "@unocss/preset-wind3"; +import { + presetWind3, + type PresetWind3Options, + type Theme, +} from "@unocss/preset-wind3"; import { rules } from "./rules"; import { extendTheme } from "./theme"; diff --git a/packages/viz/src/BarChart/BarChart.tsx b/packages/viz/src/BarChart/BarChart.tsx index 24ebaf9645..0cad2113a0 100644 --- a/packages/viz/src/BarChart/BarChart.tsx +++ b/packages/viz/src/BarChart/BarChart.tsx @@ -14,7 +14,6 @@ import * as echarts from "echarts/core"; import { HvBaseChart } from "../BaseChart"; import { - HvChartTooltipClasses, useData, useDataset, useDataZoom, @@ -25,9 +24,10 @@ import { useTooltip, useXAxis, useYAxis, + type HvChartTooltipClasses, } from "../hooks"; -import { HvBarChartMeasure } from "../types"; -import { +import type { HvBarChartMeasure } from "../types"; +import type { Arrayable, HvAxisChartCommonProps, HvChartCommonProps, @@ -48,8 +48,7 @@ echarts.use([ export interface HvBarChartClasses extends HvChartTooltipClasses {} export interface HvBarChartProps - extends HvAxisChartCommonProps, - HvChartCommonProps { + extends HvAxisChartCommonProps, HvChartCommonProps { /** Columns to measure on the chart. */ measures: Arrayable; /** Whether the bar chart should be horizontal. Defaults to `false`. */ diff --git a/packages/viz/src/BarChart/stories/BarChart.stories.tsx b/packages/viz/src/BarChart/stories/BarChart.stories.tsx index b3108bf0bb..2e380fc06c 100644 --- a/packages/viz/src/BarChart/stories/BarChart.stories.tsx +++ b/packages/viz/src/BarChart/stories/BarChart.stories.tsx @@ -1,5 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvBarChart, HvBarChartProps } from "@hitachivantara/uikit-react-viz"; +import { + HvBarChart, + type HvBarChartProps, +} from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../../BaseChart/stories/utils"; diff --git a/packages/viz/src/BaseChart/BaseChart.tsx b/packages/viz/src/BaseChart/BaseChart.tsx index 6b8c8ddfb1..7ea68588b5 100644 --- a/packages/viz/src/BaseChart/BaseChart.tsx +++ b/packages/viz/src/BaseChart/BaseChart.tsx @@ -6,7 +6,7 @@ import * as echarts from "echarts/core"; import { CanvasRenderer } from "echarts/renderers"; import { useVizTheme } from "../providers/Provider"; -import { HvChartCommonProps, HvEChartsOption } from "../types/common"; +import type { HvChartCommonProps, HvEChartsOption } from "../types/common"; // Register chart components echarts.use([CanvasRenderer, AriaComponent]); diff --git a/packages/viz/src/BaseChart/stories/utils.tsx b/packages/viz/src/BaseChart/stories/utils.tsx index d9feba0da2..1c61de6728 100644 --- a/packages/viz/src/BaseChart/stories/utils.tsx +++ b/packages/viz/src/BaseChart/stories/utils.tsx @@ -1,4 +1,4 @@ -import { Decorator } from "@storybook/react-vite"; +import type { Decorator } from "@storybook/react-vite"; import { HvPanel } from "@hitachivantara/uikit-react-core"; import { HvVizProvider } from "@hitachivantara/uikit-react-viz"; diff --git a/packages/viz/src/Boxplot/Boxplot.tsx b/packages/viz/src/Boxplot/Boxplot.tsx index f17e40077e..34600ffd65 100644 --- a/packages/viz/src/Boxplot/Boxplot.tsx +++ b/packages/viz/src/Boxplot/Boxplot.tsx @@ -14,8 +14,8 @@ import { useXAxis, useYAxis, } from "../hooks"; -import { HvBoxplotMeasure, HvChartTooltip } from "../types"; -import { +import type { HvBoxplotMeasure, HvChartTooltip } from "../types"; +import type { Arrayable, HvAxisChartCommonProps, HvChartCommonProps, @@ -29,7 +29,8 @@ echarts.use([BoxplotChart, TooltipComponent, VisualMapComponent]); export type HvBoxplotClasses = ExtractNames; export interface HvBoxplotProps - extends Omit< + extends + Omit< HvAxisChartCommonProps, "splitBy" | "horizontalRangeSlider" | "seriesNameFormatter" | "stack" >, diff --git a/packages/viz/src/Boxplot/stories/Boxplot.stories.tsx b/packages/viz/src/Boxplot/stories/Boxplot.stories.tsx index 620499d4b4..6587cdf203 100644 --- a/packages/viz/src/Boxplot/stories/Boxplot.stories.tsx +++ b/packages/viz/src/Boxplot/stories/Boxplot.stories.tsx @@ -1,6 +1,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { loadArrow } from "arquero"; -import { HvBoxplot, HvBoxplotProps } from "@hitachivantara/uikit-react-viz"; +import { + HvBoxplot, + type HvBoxplotProps, +} from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../../BaseChart/stories/utils"; diff --git a/packages/viz/src/Boxplot/useBoxplot.tsx b/packages/viz/src/Boxplot/useBoxplot.tsx index f87c3b18fe..f4e323306f 100644 --- a/packages/viz/src/Boxplot/useBoxplot.tsx +++ b/packages/viz/src/Boxplot/useBoxplot.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; -import { HvBoxplotMeasure, HvChartData, HvChartFilter } from "../types"; -import { Arrayable } from "../types/common"; +import type { HvBoxplotMeasure, HvChartData, HvChartFilter } from "../types"; +import type { Arrayable } from "../types/common"; import { useBoxplotData } from "./useBoxplotData"; interface HvDataHookProps { diff --git a/packages/viz/src/Boxplot/useBoxplotData.tsx b/packages/viz/src/Boxplot/useBoxplotData.tsx index 2c2ef93905..3bfe61ecd4 100644 --- a/packages/viz/src/Boxplot/useBoxplotData.tsx +++ b/packages/viz/src/Boxplot/useBoxplotData.tsx @@ -1,8 +1,8 @@ import { useMemo } from "react"; import { escape } from "arquero"; -import { HvChartData, HvChartFilter } from "../types"; -import { Arrayable } from "../types/common"; +import type { HvChartData, HvChartFilter } from "../types"; +import type { Arrayable } from "../types/common"; import { getHvArqueroCombinedFilters, normalizeColumnName, diff --git a/packages/viz/src/ConfusionMatrix/ConfusionMatrix.stories.tsx b/packages/viz/src/ConfusionMatrix/ConfusionMatrix.stories.tsx index 981f026848..553dfdbf06 100644 --- a/packages/viz/src/ConfusionMatrix/ConfusionMatrix.stories.tsx +++ b/packages/viz/src/ConfusionMatrix/ConfusionMatrix.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvConfusionMatrix, - HvConfusionMatrixProps, + type HvConfusionMatrixProps, } from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../BaseChart/stories/utils"; diff --git a/packages/viz/src/ConfusionMatrix/ConfusionMatrix.tsx b/packages/viz/src/ConfusionMatrix/ConfusionMatrix.tsx index 8b72d54398..7a6e2b3624 100644 --- a/packages/viz/src/ConfusionMatrix/ConfusionMatrix.tsx +++ b/packages/viz/src/ConfusionMatrix/ConfusionMatrix.tsx @@ -8,11 +8,10 @@ import { } from "echarts/components"; import * as echarts from "echarts/core"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; import { HvBaseChart } from "../BaseChart"; import { - HvVisualMapHookProps, useData, useGrid, useOption, @@ -20,18 +19,19 @@ import { useVisualMap, useXAxis, useYAxis, + type HvVisualMapHookProps, } from "../hooks"; -import { +import type { Arrayable, HvChartCommonProps, HvChartXAxis, HvChartYAxis, } from "../types/common"; -import { HvConfusionMatrixMeasure } from "../types/measures"; -import { HvChartTooltip } from "../types/tooltip"; +import type { HvConfusionMatrixMeasure } from "../types/measures"; +import type { HvChartTooltip } from "../types/tooltip"; import { getGroupKey } from "../utils"; import { useClasses } from "./ConfusionMatrix.styles"; -import { +import type { HvConfusionMatrixColorScale, HvConfusionMatrixFormat, HvConfusionMatrixValuesProps, @@ -48,8 +48,10 @@ echarts.use([ export type HvConfusionMatrixClasses = ExtractNames; -export interface HvConfusionMatrixProps - extends Omit { +export interface HvConfusionMatrixProps extends Omit< + HvChartCommonProps, + "tooltip" +> { /** Column to measure. */ measure: HvConfusionMatrixMeasure; /** Columns to use to split the measure. */ diff --git a/packages/viz/src/ConfusionMatrix/utils.ts b/packages/viz/src/ConfusionMatrix/utils.ts index 79889996c2..6a6cd2e02f 100644 --- a/packages/viz/src/ConfusionMatrix/utils.ts +++ b/packages/viz/src/ConfusionMatrix/utils.ts @@ -2,8 +2,8 @@ import { useCallback, useMemo } from "react"; import type ColumnTable from "arquero/dist/types/table/column-table"; import { useTheme } from "@hitachivantara/uikit-react-utils"; -import { HvChartXAxis } from "../types/common"; -import { +import type { HvChartXAxis } from "../types/common"; +import type { HvConfusionMatrixColorScale, HvConfusionMatrixFormat, HvConfusionMatrixValuesProps, diff --git a/packages/viz/src/DonutChart/DonutChart.stories.tsx b/packages/viz/src/DonutChart/DonutChart.stories.tsx index 5cc9ef76ba..1685cd8a2f 100644 --- a/packages/viz/src/DonutChart/DonutChart.stories.tsx +++ b/packages/viz/src/DonutChart/DonutChart.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvDonutChart, - HvDonutChartProps, + type HvDonutChartProps, } from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../BaseChart/stories/utils"; diff --git a/packages/viz/src/DonutChart/DonutChart.tsx b/packages/viz/src/DonutChart/DonutChart.tsx index 98133564c0..cf369a8cae 100644 --- a/packages/viz/src/DonutChart/DonutChart.tsx +++ b/packages/viz/src/DonutChart/DonutChart.tsx @@ -11,7 +11,6 @@ import * as echarts from "echarts/core"; import { HvBaseChart } from "../BaseChart"; import { - HvChartTooltipClasses, useData, useDataset, useGrid, @@ -19,9 +18,10 @@ import { useOption, useSeries, useTooltip, + type HvChartTooltipClasses, } from "../hooks"; -import { HvDonutChartMeasure } from "../types"; -import { HvChartCommonProps } from "../types/common"; +import type { HvDonutChartMeasure } from "../types"; +import type { HvChartCommonProps } from "../types/common"; // Register chart components echarts.use([ diff --git a/packages/viz/src/Heatmap/Heatmap.tsx b/packages/viz/src/Heatmap/Heatmap.tsx index 3b95d520bd..9c61b4de46 100644 --- a/packages/viz/src/Heatmap/Heatmap.tsx +++ b/packages/viz/src/Heatmap/Heatmap.tsx @@ -4,7 +4,7 @@ import { HeatmapChart } from "echarts/charts"; import { TooltipComponent, VisualMapComponent } from "echarts/components"; import * as echarts from "echarts/core"; import { useTheme, type ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvColorAny } from "@hitachivantara/uikit-styles"; +import type { HvColorAny } from "@hitachivantara/uikit-styles"; import { HvBaseChart } from "../BaseChart"; import { @@ -14,8 +14,8 @@ import { useXAxis, useYAxis, } from "../hooks"; -import { HvChartTooltip } from "../types"; -import { HvChartCommonProps, XAxis, YAxis } from "../types/common"; +import type { HvChartTooltip } from "../types"; +import type { HvChartCommonProps, XAxis, YAxis } from "../types/common"; import { useClasses } from "./Heatmap.styles"; // Register chart components @@ -27,11 +27,10 @@ export type HvHeatmapItem = Array; export type HvHeatmapData = Array; -export interface HvHeatmapProps - extends Omit< - HvChartCommonProps, - "data" | "groupBy" | "sortBy" | "grid" | "legend" | "tooltip" | "filters" - > { +export interface HvHeatmapProps extends Omit< + HvChartCommonProps, + "data" | "groupBy" | "sortBy" | "grid" | "legend" | "tooltip" | "filters" +> { /** The name of the heatmap */ name?: string; /** The data to use on the heatmap */ diff --git a/packages/viz/src/Heatmap/stories/Heatmap.stories.tsx b/packages/viz/src/Heatmap/stories/Heatmap.stories.tsx index 612f723b9a..e85db09c60 100644 --- a/packages/viz/src/Heatmap/stories/Heatmap.stories.tsx +++ b/packages/viz/src/Heatmap/stories/Heatmap.stories.tsx @@ -1,5 +1,8 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; -import { HvHeatmap, HvHeatmapProps } from "@hitachivantara/uikit-react-viz"; +import { + HvHeatmap, + type HvHeatmapProps, +} from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../../BaseChart/stories/utils"; import { data as customData, days, hours } from "./data"; diff --git a/packages/viz/src/Heatmap/stories/data.ts b/packages/viz/src/Heatmap/stories/data.ts index e7e1dcb1f9..d175cf639d 100644 --- a/packages/viz/src/Heatmap/stories/data.ts +++ b/packages/viz/src/Heatmap/stories/data.ts @@ -1,4 +1,4 @@ -import { HvHeatmapData } from "../Heatmap"; +import type { HvHeatmapData } from "../Heatmap"; export const hours = [ "12a", diff --git a/packages/viz/src/LineChart/LineChart.stories.tsx b/packages/viz/src/LineChart/LineChart.stories.tsx index 4118c9b83b..d978248692 100644 --- a/packages/viz/src/LineChart/LineChart.stories.tsx +++ b/packages/viz/src/LineChart/LineChart.stories.tsx @@ -4,7 +4,10 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { expect } from "storybook/test"; import { setupChromatic } from "@hitachivantara/internal"; import { HvButton } from "@hitachivantara/uikit-react-core"; -import { HvLineChart, HvLineChartProps } from "@hitachivantara/uikit-react-viz"; +import { + HvLineChart, + type HvLineChartProps, +} from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../BaseChart/stories/utils"; import { emptyCellMode } from "../types/generic"; diff --git a/packages/viz/src/LineChart/LineChart.tsx b/packages/viz/src/LineChart/LineChart.tsx index 08a905ec49..c030b84b5b 100644 --- a/packages/viz/src/LineChart/LineChart.tsx +++ b/packages/viz/src/LineChart/LineChart.tsx @@ -14,7 +14,6 @@ import * as echarts from "echarts/core"; import { HvBaseChart } from "../BaseChart"; import { - HvChartTooltipClasses, useData, useDataset, useDataZoom, @@ -25,9 +24,10 @@ import { useTooltip, useXAxis, useYAxis, + type HvChartTooltipClasses, } from "../hooks"; -import { HvChartEmptyCellMode, HvLineChartMeasure } from "../types"; -import { +import type { HvChartEmptyCellMode, HvLineChartMeasure } from "../types"; +import type { Arrayable, HvAxisChartCommonProps, HvChartCommonProps, @@ -48,8 +48,7 @@ echarts.use([ export interface HvLineChartClasses extends HvChartTooltipClasses {} export interface HvLineChartProps - extends HvAxisChartCommonProps, - HvChartCommonProps { + extends HvAxisChartCommonProps, HvChartCommonProps { /** Columns to measure on the chart. */ measures: Arrayable; /** Strategy to use when there are empty cells. Defaults to `void`. */ diff --git a/packages/viz/src/ScatterPlot/ScatterPlot.tsx b/packages/viz/src/ScatterPlot/ScatterPlot.tsx index cc39f70bb9..8550a2130f 100644 --- a/packages/viz/src/ScatterPlot/ScatterPlot.tsx +++ b/packages/viz/src/ScatterPlot/ScatterPlot.tsx @@ -14,7 +14,6 @@ import * as echarts from "echarts/core"; import { HvBaseChart } from "../BaseChart"; import { - HvChartTooltipClasses, useData, useDataset, useDataZoom, @@ -25,13 +24,14 @@ import { useTooltip, useXAxis, useYAxis, + type HvChartTooltipClasses, } from "../hooks"; -import { +import type { Arrayable, HvAxisChartCommonProps, HvChartCommonProps, } from "../types/common"; -import { HvScatterPlotMeasure } from "../types/measures"; +import type { HvScatterPlotMeasure } from "../types/measures"; // Register chart components echarts.use([ @@ -48,8 +48,7 @@ echarts.use([ export interface HvScatterPlotClasses extends HvChartTooltipClasses {} export interface HvScatterPlotProps - extends HvChartCommonProps, - Omit { + extends HvChartCommonProps, Omit { /** Columns to measure on the plot. */ measures: Arrayable; /** A Jss Object used to override or extend the styles applied to the component. */ diff --git a/packages/viz/src/ScatterPlot/stories/ScatterPlot.stories.tsx b/packages/viz/src/ScatterPlot/stories/ScatterPlot.stories.tsx index b29b352b02..804a80f41e 100644 --- a/packages/viz/src/ScatterPlot/stories/ScatterPlot.stories.tsx +++ b/packages/viz/src/ScatterPlot/stories/ScatterPlot.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvScatterPlot, - HvScatterPlotProps, + type HvScatterPlotProps, } from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../../BaseChart/stories/utils"; diff --git a/packages/viz/src/Treemap/Treemap.tsx b/packages/viz/src/Treemap/Treemap.tsx index 48c846a3ff..f85076f0fe 100644 --- a/packages/viz/src/Treemap/Treemap.tsx +++ b/packages/viz/src/Treemap/Treemap.tsx @@ -5,9 +5,9 @@ import { TooltipComponent } from "echarts/components"; import * as echarts from "echarts/core"; import { HvBaseChart } from "../BaseChart"; -import { HvChartTooltipClasses, useOption, useTooltip } from "../hooks"; -import { HvChartTooltip } from "../types"; -import { HvChartCommonProps } from "../types/common"; +import { useOption, useTooltip, type HvChartTooltipClasses } from "../hooks"; +import type { HvChartTooltip } from "../types"; +import type { HvChartCommonProps } from "../types/common"; // Register chart components echarts.use([TreemapChart, TooltipComponent]); @@ -27,11 +27,10 @@ export type HvTreemapData = { export interface HvTreemapChartClasses extends HvChartTooltipClasses {} -export interface HvTreemapChartProps - extends Omit< - HvChartCommonProps, - "data" | "groupBy" | "sortBy" | "grid" | "legend" | "tooltip" | "filters" - > { +export interface HvTreemapChartProps extends Omit< + HvChartCommonProps, + "data" | "groupBy" | "sortBy" | "grid" | "legend" | "tooltip" | "filters" +> { /** The name of the treemap */ name?: string; /** The data to use on the treemap */ diff --git a/packages/viz/src/Treemap/stories/Treemap.stories.tsx b/packages/viz/src/Treemap/stories/Treemap.stories.tsx index c1760ee3c4..857cb60c30 100644 --- a/packages/viz/src/Treemap/stories/Treemap.stories.tsx +++ b/packages/viz/src/Treemap/stories/Treemap.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { HvTreemapChart, - HvTreemapChartProps, + type HvTreemapChartProps, } from "@hitachivantara/uikit-react-viz"; import { vizDecorator } from "../../BaseChart/stories/utils"; diff --git a/packages/viz/src/Treemap/stories/data.ts b/packages/viz/src/Treemap/stories/data.ts index de8e9b9597..fc87086fa2 100644 --- a/packages/viz/src/Treemap/stories/data.ts +++ b/packages/viz/src/Treemap/stories/data.ts @@ -1,4 +1,4 @@ -import { HvTreemapData } from "../Treemap"; +import type { HvTreemapData } from "../Treemap"; export const data: HvTreemapData[] = [ { diff --git a/packages/viz/src/hooks/tooltip/useTooltip.tsx b/packages/viz/src/hooks/tooltip/useTooltip.tsx index 72eff635e3..e2287e56ee 100644 --- a/packages/viz/src/hooks/tooltip/useTooltip.tsx +++ b/packages/viz/src/hooks/tooltip/useTooltip.tsx @@ -1,9 +1,9 @@ import { useCallback, useMemo } from "react"; import type { ExtractNames } from "@hitachivantara/uikit-react-utils"; -import { HvChartTooltip, HvChartTooltipParams } from "../../types"; -import { HvEChartsOption } from "../../types/common"; -import { getMeasure, SingleMeasure } from "../../utils"; +import type { HvChartTooltip, HvChartTooltipParams } from "../../types"; +import type { HvEChartsOption } from "../../types/common"; +import { getMeasure, type SingleMeasure } from "../../utils"; import { useClasses } from "./styles"; export type HvChartTooltipClasses = ExtractNames; diff --git a/packages/viz/src/hooks/useData.tsx b/packages/viz/src/hooks/useData.tsx index bb0ee7532c..a84fee27d3 100644 --- a/packages/viz/src/hooks/useData.tsx +++ b/packages/viz/src/hooks/useData.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; import { desc, escape, not } from "arquero"; -import { +import type { HvBarChartMeasure, HvChartAggregation, HvChartData, @@ -11,7 +11,7 @@ import { HvLineChartMeasure, HvScatterPlotMeasure, } from "../types"; -import { +import type { Arrayable, HvAxisChartCommonProps, HvChartCommonProps, @@ -21,7 +21,7 @@ import { getHvArqueroCombinedFilters, normalizeColumnName, processTableData, - SingleMeasure, + type SingleMeasure, } from "../utils"; const getAgFunc = (func: HvChartAggregation, field: string) => diff --git a/packages/viz/src/hooks/useDataZoom.tsx b/packages/viz/src/hooks/useDataZoom.tsx index b739257b43..7b37ccda37 100644 --- a/packages/viz/src/hooks/useDataZoom.tsx +++ b/packages/viz/src/hooks/useDataZoom.tsx @@ -1,6 +1,6 @@ import { useMemo } from "react"; -import { HvEChartsOption } from "../types/common"; +import type { HvEChartsOption } from "../types/common"; interface HvDataZoomHookProps { showHorizontal?: boolean; diff --git a/packages/viz/src/hooks/useDataset.tsx b/packages/viz/src/hooks/useDataset.tsx index 620ab6d783..00c7922b3f 100644 --- a/packages/viz/src/hooks/useDataset.tsx +++ b/packages/viz/src/hooks/useDataset.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; -import { internal } from "arquero"; +import type { internal } from "arquero"; -import { HvEChartsOption } from "../types/common"; +import type { HvEChartsOption } from "../types/common"; export const useDataset = (data: internal.ColumnTable) => { return useMemo>(() => { diff --git a/packages/viz/src/hooks/useGrid.tsx b/packages/viz/src/hooks/useGrid.tsx index 5dd2dcb15f..2ca46901ad 100644 --- a/packages/viz/src/hooks/useGrid.tsx +++ b/packages/viz/src/hooks/useGrid.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; -import { HvChartGrid } from "../types"; -import { HvEChartsOption } from "../types/common"; +import type { HvChartGrid } from "../types"; +import type { HvEChartsOption } from "../types/common"; interface HvGridHookProps { top?: HvChartGrid["top"]; diff --git a/packages/viz/src/hooks/useLegend.tsx b/packages/viz/src/hooks/useLegend.tsx index 5c11589b96..31c3874633 100644 --- a/packages/viz/src/hooks/useLegend.tsx +++ b/packages/viz/src/hooks/useLegend.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; -import { HvEChartsOption } from "../types/common"; -import { HvChartLegend, HvChartLegendIcon } from "../types/legend"; +import type { HvEChartsOption } from "../types/common"; +import type { HvChartLegend, HvChartLegendIcon } from "../types/legend"; import { getLegendIcon } from "../utils"; interface HvLegendHookProps { diff --git a/packages/viz/src/hooks/useOption.ts b/packages/viz/src/hooks/useOption.ts index 08f647ac92..7245c1db26 100644 --- a/packages/viz/src/hooks/useOption.ts +++ b/packages/viz/src/hooks/useOption.ts @@ -1,6 +1,6 @@ import { useMemo } from "react"; -import { HvChartCommonProps, HvEChartsOption } from "../types/common"; +import type { HvChartCommonProps, HvEChartsOption } from "../types/common"; interface HvOptionHookProps { option: HvEChartsOption; diff --git a/packages/viz/src/hooks/useSeries.tsx b/packages/viz/src/hooks/useSeries.tsx index 7d88d99c0e..336006528e 100644 --- a/packages/viz/src/hooks/useSeries.tsx +++ b/packages/viz/src/hooks/useSeries.tsx @@ -1,24 +1,24 @@ import { useMemo } from "react"; -import { internal } from "arquero"; -import { +import type { internal } from "arquero"; +import type { BarSeriesOption, LineSeriesOption, PieSeriesOption, ScatterSeriesOption, } from "echarts/charts"; -import { HvChartEmptyCellMode } from "../types"; -import { +import type { HvChartEmptyCellMode } from "../types"; +import type { HvAxisChartCommonProps, HvChartCommonProps, HvEChartsOption, } from "../types/common"; -import { +import type { BarFullMeasure, LineFullMeasure, ScatterPlotMeasure, } from "../types/measures"; -import { getGroupKey, getMeasure, SingleMeasure } from "../utils"; +import { getGroupKey, getMeasure, type SingleMeasure } from "../utils"; interface HvSeriesHookProps { type: "line" | "bar" | "pie" | "scatter" | "treemap"; diff --git a/packages/viz/src/hooks/useVisualMap.tsx b/packages/viz/src/hooks/useVisualMap.tsx index 7c6a635027..edd166861d 100644 --- a/packages/viz/src/hooks/useVisualMap.tsx +++ b/packages/viz/src/hooks/useVisualMap.tsx @@ -1,8 +1,8 @@ import { useMemo } from "react"; -import { VisualMapComponentOption } from "echarts"; +import type { VisualMapComponentOption } from "echarts"; -import { HvChartLegend } from "../types"; -import { HvEChartsOption } from "../types/common"; +import type { HvChartLegend } from "../types"; +import type { HvEChartsOption } from "../types/common"; import { getLegendIcon } from "../utils"; export type HvVisualMapHookProps = VisualMapComponentOption & { diff --git a/packages/viz/src/hooks/useXAxis.tsx b/packages/viz/src/hooks/useXAxis.tsx index 2cab5a628d..511242c0dc 100644 --- a/packages/viz/src/hooks/useXAxis.tsx +++ b/packages/viz/src/hooks/useXAxis.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; import { useTheme } from "@hitachivantara/uikit-react-utils"; -import { HvChartXAxis, HvEChartsOption } from "../types/common"; +import type { HvChartXAxis, HvEChartsOption } from "../types/common"; import { getAxisType } from "../utils"; interface HvXAxisHookProps extends HvChartXAxis { diff --git a/packages/viz/src/hooks/useYAxis.tsx b/packages/viz/src/hooks/useYAxis.tsx index 9dd1d63084..11ba74d8d7 100644 --- a/packages/viz/src/hooks/useYAxis.tsx +++ b/packages/viz/src/hooks/useYAxis.tsx @@ -1,8 +1,8 @@ import { useCallback, useMemo } from "react"; import { useTheme } from "@hitachivantara/uikit-react-utils"; -import { HvChartAxisType } from "../types"; -import { HvEChartsOption, YAxis } from "../types/common"; +import type { HvChartAxisType } from "../types"; +import type { HvEChartsOption, YAxis } from "../types/common"; import { getAxisType } from "../utils"; interface HvYAxisHookProps { diff --git a/packages/viz/src/types/common.ts b/packages/viz/src/types/common.ts index fe934c7680..f59fa680d8 100644 --- a/packages/viz/src/types/common.ts +++ b/packages/viz/src/types/common.ts @@ -1,13 +1,13 @@ import type { EChartsType } from "echarts"; -import { HvChartAxis } from "./axis"; -import { HvChartFilter } from "./filter"; -import { HvChartData } from "./generic"; -import { HvChartGrid } from "./grid"; -import { HvChartLegend } from "./legend"; -import { HvChartHorizontalRangeSlider } from "./slider"; -import { HvChartSortBy } from "./sort"; -import { HvChartTooltip } from "./tooltip"; +import type { HvChartAxis } from "./axis"; +import type { HvChartFilter } from "./filter"; +import type { HvChartData } from "./generic"; +import type { HvChartGrid } from "./grid"; +import type { HvChartLegend } from "./legend"; +import type { HvChartHorizontalRangeSlider } from "./slider"; +import type { HvChartSortBy } from "./sort"; +import type { HvChartTooltip } from "./tooltip"; // Note: These types should not be exported at the moment since they can change over time. diff --git a/packages/viz/src/types/measures.ts b/packages/viz/src/types/measures.ts index 731f08370d..3ec18e43bf 100644 --- a/packages/viz/src/types/measures.ts +++ b/packages/viz/src/types/measures.ts @@ -1,4 +1,4 @@ -import { HvChartEmptyCellMode } from "./generic"; +import type { HvChartEmptyCellMode } from "./generic"; /** Sampling functions */ export type HvChartSampling = @@ -62,12 +62,12 @@ export interface DonutFullMeasure extends BaseMeasure {} export interface ConfusionMatrixMeasure extends BaseMeasure {} export interface BoxplotMeasure - extends Omit, + extends + Omit, Omit {} export interface ScatterPlotMeasure - extends BaseMeasure, - Pick {} + extends BaseMeasure, Pick {} export type HvLineChartMeasure = string | LineFullMeasure; diff --git a/packages/viz/src/utils/getHvArqueroCombinedFilters.test.ts b/packages/viz/src/utils/getHvArqueroCombinedFilters.test.ts index 077c724bae..7422c5fe0b 100644 --- a/packages/viz/src/utils/getHvArqueroCombinedFilters.test.ts +++ b/packages/viz/src/utils/getHvArqueroCombinedFilters.test.ts @@ -1,7 +1,7 @@ import { escape, table } from "arquero"; import { getHvArqueroCombinedFilters } from "."; -import { HvChartFilter } from "../types"; +import type { HvChartFilter } from "../types"; const data = { Country: ["Portugal", "USA", "India", "China", "France", "UK", "Japan"], diff --git a/packages/viz/src/utils/index.ts b/packages/viz/src/utils/index.ts index 6d307a76e5..9c205fbdb1 100644 --- a/packages/viz/src/utils/index.ts +++ b/packages/viz/src/utils/index.ts @@ -11,9 +11,9 @@ import type { HvDonutChartMeasure, HvLineChartMeasure, } from "../types"; -import { HvChartCommonProps } from "../types/common"; -import { HvChartLegendIcon } from "../types/legend"; -import { HvScatterPlotMeasure } from "../types/measures"; +import type { HvChartCommonProps } from "../types/common"; +import type { HvChartLegendIcon } from "../types/legend"; +import type { HvScatterPlotMeasure } from "../types/measures"; export const getAxisType = (type?: HvChartAxisType) => { switch (type) { diff --git a/templates/AssetInventory/CardView.tsx b/templates/AssetInventory/CardView.tsx index c07b1ced99..bf8432d890 100644 --- a/templates/AssetInventory/CardView.tsx +++ b/templates/AssetInventory/CardView.tsx @@ -8,11 +8,11 @@ import { HvCheckBox, HvSimpleGrid, HvSkeleton, - HvTableInstance, HvTypography, + type HvTableInstance, } from "@hitachivantara/uikit-react-core"; -import { AssetInventoryEntry, getStatusIcon } from "./data"; +import { getStatusIcon, type AssetInventoryEntry } from "./data"; interface CardViewProps { id?: string; diff --git a/templates/AssetInventory/ListView.tsx b/templates/AssetInventory/ListView.tsx index dc761f46a4..09dc166421 100644 --- a/templates/AssetInventory/ListView.tsx +++ b/templates/AssetInventory/ListView.tsx @@ -2,15 +2,15 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, - HvTableInstance, HvTableRow, + type HvTableColumnConfig, + type HvTableInstance, } from "@hitachivantara/uikit-react-core"; -import { AssetInventoryEntry } from "./data"; +import type { AssetInventoryEntry } from "./data"; interface ListViewProps { id?: string; diff --git a/templates/AssetInventory/data.tsx b/templates/AssetInventory/data.tsx index 787a24ebdd..199687ddfc 100644 --- a/templates/AssetInventory/data.tsx +++ b/templates/AssetInventory/data.tsx @@ -1,11 +1,11 @@ import { - HvBulkActionsProps, - HvColor, - HvControlsProps, - HvRightControlProps, HvSkeleton, - HvTableColumnConfig, HvTooltip, + type HvBulkActionsProps, + type HvColor, + type HvControlsProps, + type HvRightControlProps, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { Add, @@ -20,9 +20,9 @@ import { } from "@hitachivantara/uikit-react-icons"; import { - DataObject, - ServerPaginationProps, useServerPagination, + type DataObject, + type ServerPaginationProps, } from "./usePaginationData"; // --- Table data utils --- @@ -247,8 +247,10 @@ export const createEntry = (i: number): AssetInventoryEntry => { // --- Data & Endpoint --- const db = [...Array(50).keys()].map(createEntry); -export interface PaginationDataProps - extends Omit, "endpoint" | "db"> {} +export interface PaginationDataProps extends Omit< + ServerPaginationProps, + "endpoint" | "db" +> {} export const usePaginationData = (props: PaginationDataProps) => { return useServerPagination({ endpoint: "/events", db, ...props }); diff --git a/templates/AssetInventory/index.tsx b/templates/AssetInventory/index.tsx index 35b47562ad..6db98f8020 100644 --- a/templates/AssetInventory/index.tsx +++ b/templates/AssetInventory/index.tsx @@ -1,11 +1,9 @@ import { useEffect, useId, useMemo, useState } from "react"; import { css } from "@emotion/css"; import { - HvActionsGenericProps, HvBulkActions, HvControls, HvLeftControl, - HvLeftControlProps, HvPagination, HvRightControl, theme, @@ -15,17 +13,19 @@ import { useHvPagination, useHvRowSelection, useHvSortBy, + type HvActionsGenericProps, + type HvLeftControlProps, } from "@hitachivantara/uikit-react-core"; import { CardView } from "./CardView"; import { actions, - AssetInventoryEntry, getColumns, - PaginationDataProps, rightControlValues, usePaginationData, views, + type AssetInventoryEntry, + type PaginationDataProps, } from "./data"; import { ListView } from "./ListView"; diff --git a/templates/Canvas/Context.tsx b/templates/Canvas/Context.tsx index 44026cc703..6f1d58c069 100644 --- a/templates/Canvas/Context.tsx +++ b/templates/Canvas/Context.tsx @@ -1,10 +1,10 @@ import { createContext, - Dispatch, - SetStateAction, useContext, useMemo, useState, + type Dispatch, + type SetStateAction, } from "react"; interface SelectedTable { diff --git a/templates/Canvas/ListView.tsx b/templates/Canvas/ListView.tsx index d26860c30d..f0023d3a83 100644 --- a/templates/Canvas/ListView.tsx +++ b/templates/Canvas/ListView.tsx @@ -3,18 +3,18 @@ import { useDraggable } from "@dnd-kit/core"; import { css, cx } from "@emotion/css"; import { HvInput, - HvInputProps, HvListContainer, HvListItem, - HvListItemProps, HvTypography, outlineStyles, theme, useForkRef, + type HvInputProps, + type HvListItemProps, } from "@hitachivantara/uikit-react-core"; import { Drag } from "@hitachivantara/uikit-react-icons"; -import { NodeData } from "./Node"; +import type { NodeData } from "./Node"; import { iconsMapping, iconsMappingKeys } from "./utils"; const classes = { @@ -61,8 +61,7 @@ interface ItemProps { } interface ItemCardProps - extends Omit, - Omit { + extends Omit, Omit { isDragging?: boolean; } diff --git a/templates/Canvas/Node.tsx b/templates/Canvas/Node.tsx index a7fd2a3aa7..deff3569de 100644 --- a/templates/Canvas/Node.tsx +++ b/templates/Canvas/Node.tsx @@ -1,22 +1,22 @@ import { isValidElement } from "react"; import { css, cx } from "@emotion/css"; -import { Handle, NodeProps, NodeToolbar, Position } from "reactflow"; +import { Handle, NodeToolbar, Position, type NodeProps } from "reactflow"; import { HvButton, - HvColorAny, HvIconButton, HvTooltip, HvTypography, theme, + type HvColorAny, } from "@hitachivantara/uikit-react-core"; import { - HvFlowNodeInput, - HvFlowNodeOutput, useHvNode, + type HvFlowNodeInput, + type HvFlowNodeOutput, } from "@hitachivantara/uikit-react-lab"; import { useCanvasContext } from "./Context"; -import { FlowStatus, flowStatusesSpecs, iconsMapping } from "./utils"; +import { flowStatusesSpecs, iconsMapping, type FlowStatus } from "./utils"; const classes = { root: css({ diff --git a/templates/Canvas/Sidebar.tsx b/templates/Canvas/Sidebar.tsx index 3175cf7dcc..9e5a96ffcf 100644 --- a/templates/Canvas/Sidebar.tsx +++ b/templates/Canvas/Sidebar.tsx @@ -1,13 +1,13 @@ import { useId, useState } from "react"; import { - DndContextProps, DragOverlay, useDndMonitor, useDroppable, + type DndContextProps, } from "@dnd-kit/core"; import { HvCanvasSidePanel, - HvCanvasSidePanelProps, + type HvCanvasSidePanelProps, } from "@hitachivantara/uikit-react-pentaho"; export const CanvasSidebar = (props: HvCanvasSidePanelProps) => { diff --git a/templates/Canvas/StatusEdge.tsx b/templates/Canvas/StatusEdge.tsx index 52f6d70a11..555352bd6c 100644 --- a/templates/Canvas/StatusEdge.tsx +++ b/templates/Canvas/StatusEdge.tsx @@ -1,16 +1,16 @@ import { BaseEdge, EdgeLabelRenderer, - EdgeProps, getBezierPath, + type EdgeProps, } from "reactflow"; import { HvDropDownMenu, - HvDropDownMenuProps, + type HvDropDownMenuProps, } from "@hitachivantara/uikit-react-core"; import { useFlowInstance } from "@hitachivantara/uikit-react-lab"; -import { FlowStatus, flowStatusesSpecs } from "./utils"; +import { flowStatusesSpecs, type FlowStatus } from "./utils"; export type StatusEdgeData = | undefined diff --git a/templates/Canvas/Table.tsx b/templates/Canvas/Table.tsx index 082ec72660..96d5adebb9 100644 --- a/templates/Canvas/Table.tsx +++ b/templates/Canvas/Table.tsx @@ -6,7 +6,6 @@ import { HvTable, HvTableBody, HvTableCell, - HvTableColumnConfig, HvTableContainer, HvTableHead, HvTableHeader, @@ -16,6 +15,7 @@ import { useHvData, useHvPagination, useHvSortBy, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { delay } from "./utils"; diff --git a/templates/Canvas/TreeView.tsx b/templates/Canvas/TreeView.tsx index e0566b450f..c2ed6d1550 100644 --- a/templates/Canvas/TreeView.tsx +++ b/templates/Canvas/TreeView.tsx @@ -4,15 +4,15 @@ import { css, cx } from "@emotion/css"; import { HvOverflowTooltip, HvTreeItem, - HvTreeItemProps, HvTreeView, theme, useForkRef, useHvTreeItem, + type HvTreeItemProps, } from "@hitachivantara/uikit-react-core"; import { DataSource, Drag, Table } from "@hitachivantara/uikit-react-icons"; -import { NodeData } from "./Node"; +import type { NodeData } from "./Node"; const classes = { dragging: css({ diff --git a/templates/Canvas/index.tsx b/templates/Canvas/index.tsx index dffa14c05f..bf43f95ef0 100644 --- a/templates/Canvas/index.tsx +++ b/templates/Canvas/index.tsx @@ -1,5 +1,5 @@ import { useCallback, useMemo, useState } from "react"; -import { applyNodeChanges, ReactFlowInstance } from "reactflow"; +import { applyNodeChanges, type ReactFlowInstance } from "reactflow"; import { HvButton, HvDialog, @@ -24,20 +24,20 @@ import { HvFlowBackground, HvFlowControls, HvFlowEmpty, - HvFlowProps, StickyNode, - StickyNodeData, + type HvFlowProps, + type StickyNodeData, } from "@hitachivantara/uikit-react-lab"; import { HvCanvasBottomPanel, - HvCanvasBottomPanelProps, HvCanvasProvider, HvCanvasToolbar, + type HvCanvasBottomPanelProps, } from "@hitachivantara/uikit-react-pentaho"; import { CanvasProvider, useCanvasContext } from "./Context"; import { ListView } from "./ListView"; -import { Node, NodeData } from "./Node"; +import { Node, type NodeData } from "./Node"; import { CanvasSidebar } from "./Sidebar"; import { StatusEdge } from "./StatusEdge"; import { classes } from "./styles"; diff --git a/templates/Dashboard/GridPanel.tsx b/templates/Dashboard/GridPanel.tsx index ebfa77b453..f04a4335c0 100644 --- a/templates/Dashboard/GridPanel.tsx +++ b/templates/Dashboard/GridPanel.tsx @@ -1,10 +1,10 @@ import { css } from "@emotion/css"; import { HvGrid, - HvGridProps, HvLoadingContainer, HvPanel, theme, + type HvGridProps, } from "@hitachivantara/uikit-react-core"; /** A `HvGrid` item + styled `HvPanel` container with a loading `Suspense` boundary */ diff --git a/templates/Dashboard/Kpi.tsx b/templates/Dashboard/Kpi.tsx index 9f2b673312..2a6d69b15b 100644 --- a/templates/Dashboard/Kpi.tsx +++ b/templates/Dashboard/Kpi.tsx @@ -2,9 +2,9 @@ import { css } from "@emotion/css"; import { HvCard, HvCardContent, - HvCardProps, HvTypography, theme, + type HvCardProps, } from "@hitachivantara/uikit-react-core"; import { Level0Good } from "@hitachivantara/uikit-react-icons"; diff --git a/templates/Dashboard/Map.tsx b/templates/Dashboard/Map.tsx index 31b5fc04df..b251c3a3cf 100644 --- a/templates/Dashboard/Map.tsx +++ b/templates/Dashboard/Map.tsx @@ -1,12 +1,11 @@ -import { ReactNode } from "react"; import { MapContainer, - MapContainerProps, Marker, - MarkerProps, Popup, - PopupProps, TileLayer, + type MapContainerProps, + type MarkerProps, + type PopupProps, } from "react-leaflet"; import { css, cx } from "@emotion/css"; import { Global } from "@emotion/react"; @@ -33,7 +32,7 @@ const LevelIcons = [ }); interface MapProps extends MapContainerProps { - children?: ReactNode; + children?: React.ReactNode; markers?: { position: MarkerProps["position"]; label: PopupProps["children"]; diff --git a/templates/Dashboard/index.tsx b/templates/Dashboard/index.tsx index 926fe3911a..a165e384c9 100644 --- a/templates/Dashboard/index.tsx +++ b/templates/Dashboard/index.tsx @@ -6,9 +6,9 @@ import { HvGrid, HvLoading, HvMultiButton, - HvMultiButtonProps, HvTypography, theme, + type HvMultiButtonProps, } from "@hitachivantara/uikit-react-core"; import { Add, User } from "@hitachivantara/uikit-react-icons"; import { diff --git a/templates/DetailsView/MetadataItem.tsx b/templates/DetailsView/MetadataItem.tsx index c1ecb2eae0..83e32e4f9f 100644 --- a/templates/DetailsView/MetadataItem.tsx +++ b/templates/DetailsView/MetadataItem.tsx @@ -1,15 +1,14 @@ -import { ReactNode } from "react"; import { css } from "@emotion/css"; import { HvGrid, - HvGridProps, HvTypography, theme, + type HvGridProps, } from "@hitachivantara/uikit-react-core"; export interface MetadataItemProps extends Omit { - title?: ReactNode; - children?: ReactNode; + title?: React.ReactNode; + children?: React.ReactNode; } export const MetadataItem = ({ diff --git a/templates/DetailsView/Properties.tsx b/templates/DetailsView/Properties.tsx index f047360ba9..4636926629 100644 --- a/templates/DetailsView/Properties.tsx +++ b/templates/DetailsView/Properties.tsx @@ -1,18 +1,18 @@ -import { ComponentType } from "react"; +import type { ComponentType } from "react"; import { css } from "@emotion/css"; import { - HvColor, HvDropdown, - HvGridProps, HvProgressBar, HvTag, HvTagsInput, HvTextArea, theme, + type HvColor, + type HvGridProps, } from "@hitachivantara/uikit-react-core"; import { Caution, Level4Alt } from "@hitachivantara/uikit-react-icons"; -import { ModelDetails, useModelData } from "./data"; +import { useModelData, type ModelDetails } from "./data"; import { MetadataItem } from "./MetadataItem"; const ProgressBar = ({ diff --git a/templates/DetailsView/Table.tsx b/templates/DetailsView/Table.tsx index 6aa110bb40..59a07c693d 100644 --- a/templates/DetailsView/Table.tsx +++ b/templates/DetailsView/Table.tsx @@ -14,8 +14,8 @@ import { useHvPagination, } from "@hitachivantara/uikit-react-core"; -import { PaginationDataProps, usePaginationData } from "./data"; -import { DetailsViewEntry, getColumns } from "./utils"; +import { usePaginationData, type PaginationDataProps } from "./data"; +import { getColumns, type DetailsViewEntry } from "./utils"; const PAGE_OPTIONS = [8, 16, 32]; diff --git a/templates/DetailsView/data.ts b/templates/DetailsView/data.ts index 439aa6b458..7251df0b69 100644 --- a/templates/DetailsView/data.ts +++ b/templates/DetailsView/data.ts @@ -2,10 +2,10 @@ import useSWR from "swr"; import { delay, - ServerPaginationProps, useServerPagination, + type ServerPaginationProps, } from "./usePaginationData"; -import { createEntry, DetailsViewEntry } from "./utils"; +import { createEntry, type DetailsViewEntry } from "./utils"; // --- Data --- @@ -42,8 +42,10 @@ const model = { export type ModelDetails = typeof model; // #region Endpoints -export interface PaginationDataProps - extends Omit, "endpoint" | "db"> { +export interface PaginationDataProps extends Omit< + ServerPaginationProps, + "endpoint" | "db" +> { id: string; } diff --git a/templates/DetailsView/index.tsx b/templates/DetailsView/index.tsx index 0c10cb75f8..0a247f2f41 100644 --- a/templates/DetailsView/index.tsx +++ b/templates/DetailsView/index.tsx @@ -1,13 +1,13 @@ -import { ElementType, ReactNode, Suspense, useState } from "react"; +import { Suspense, useState } from "react"; import { css } from "@emotion/css"; import { HvButton, HvGlobalActions, - HvGlobalActionsProps, HvGrid, - HvGridProps, HvLoading, theme, + type HvGlobalActionsProps, + type HvGridProps, } from "@hitachivantara/uikit-react-core"; import { KPIs } from "./KPIs"; @@ -18,8 +18,8 @@ const MODEL_ID = "123"; interface SectionProps extends HvGridProps { variant?: HvGlobalActionsProps["variant"]; - actions?: ReactNode; - component?: ElementType; + actions?: React.ReactNode; + component?: React.ElementType; } const Section = ({ diff --git a/templates/DetailsView/utils.ts b/templates/DetailsView/utils.ts index 3b70220707..e1f6ba4a9c 100644 --- a/templates/DetailsView/utils.ts +++ b/templates/DetailsView/utils.ts @@ -1,4 +1,4 @@ -import { HvTableColumnConfig } from "@hitachivantara/uikit-react-core"; +import type { HvTableColumnConfig } from "@hitachivantara/uikit-react-core"; // --- Table data utils --- diff --git a/templates/KanbanBoard/ColumnContainer.tsx b/templates/KanbanBoard/ColumnContainer.tsx index b01eae344a..8b18739879 100644 --- a/templates/KanbanBoard/ColumnContainer.tsx +++ b/templates/KanbanBoard/ColumnContainer.tsx @@ -10,7 +10,7 @@ import { Add } from "@hitachivantara/uikit-react-icons"; import classes from "./styles"; import { TaskCard } from "./TaskCard"; -import { Column, Task } from "./types"; +import type { Column, Task } from "./types"; interface ColumnProps { column: Column; diff --git a/templates/KanbanBoard/TaskCard.tsx b/templates/KanbanBoard/TaskCard.tsx index 51a0175280..244ce3f574 100644 --- a/templates/KanbanBoard/TaskCard.tsx +++ b/templates/KanbanBoard/TaskCard.tsx @@ -21,7 +21,7 @@ import { } from "@hitachivantara/uikit-react-icons"; import classes from "./styles"; -import { Column, Task } from "./types"; +import type { Column, Task } from "./types"; interface TaskProps { task: Task; diff --git a/templates/KanbanBoard/data.tsx b/templates/KanbanBoard/data.tsx index 7ee56bd607..bc3436a21d 100644 --- a/templates/KanbanBoard/data.tsx +++ b/templates/KanbanBoard/data.tsx @@ -5,7 +5,7 @@ import { Success, } from "@hitachivantara/uikit-react-icons"; -import { Column, Task } from "./types"; +import type { Column, Task } from "./types"; export const columns: Column[] = [ { diff --git a/templates/KanbanBoard/index.tsx b/templates/KanbanBoard/index.tsx index cc874e3d8e..dc9ee4aee0 100644 --- a/templates/KanbanBoard/index.tsx +++ b/templates/KanbanBoard/index.tsx @@ -1,13 +1,13 @@ import { useMemo, useState } from "react"; import { DndContext, - DragEndEvent, - DragOverEvent, DragOverlay, - DragStartEvent, PointerSensor, useSensor, useSensors, + type DragEndEvent, + type DragOverEvent, + type DragStartEvent, } from "@dnd-kit/core"; import { arrayMove, SortableContext } from "@dnd-kit/sortable"; @@ -15,7 +15,7 @@ import { ColumnContainer } from "./ColumnContainer"; import { columns as defaultColumns, tasks as defaultTasks } from "./data"; import classes from "./styles"; import { TaskCard } from "./TaskCard"; -import { Column, Task } from "./types"; +import type { Column, Task } from "./types"; const KanbanBoard = () => { const sensors = useSensors( diff --git a/templates/KanbanBoard/types.ts b/templates/KanbanBoard/types.ts index d44e7ab4b0..fd8266d208 100644 --- a/templates/KanbanBoard/types.ts +++ b/templates/KanbanBoard/types.ts @@ -1,4 +1,4 @@ -import { HvColor } from "@hitachivantara/uikit-react-core"; +import type { HvColor } from "@hitachivantara/uikit-react-core"; export type Column = { id: string; diff --git a/templates/ListView/Indicator.tsx b/templates/ListView/Indicator.tsx index ee94d15daf..a4eda5b735 100644 --- a/templates/ListView/Indicator.tsx +++ b/templates/ListView/Indicator.tsx @@ -1,6 +1,6 @@ import ReactChart from "react-google-charts"; -import { TrendData } from "./data"; +import type { TrendData } from "./data"; interface IndicatorProps { data?: TrendData; diff --git a/templates/ListView/Kpi.tsx b/templates/ListView/Kpi.tsx index 3772b06f3e..6d611b723b 100644 --- a/templates/ListView/Kpi.tsx +++ b/templates/ListView/Kpi.tsx @@ -1,15 +1,15 @@ import { css, cx } from "@emotion/css"; import { HvCard, - HvCardProps, HvLoading, - HvTableInstance, HvTypography, theme, + type HvCardProps, + type HvTableInstance, } from "@hitachivantara/uikit-react-core"; import { BottomXS, TopXS } from "@hitachivantara/uikit-react-icons"; -import { getStatusIcon, ListViewEntry, TrendData } from "./data"; +import { getStatusIcon, type ListViewEntry, type TrendData } from "./data"; import { Indicator } from "./Indicator"; const classes = { diff --git a/templates/ListView/Table.tsx b/templates/ListView/Table.tsx index 484afaf20b..607e0b89ae 100644 --- a/templates/ListView/Table.tsx +++ b/templates/ListView/Table.tsx @@ -6,11 +6,11 @@ import { HvTableContainer, HvTableHead, HvTableHeader, - HvTableInstance, HvTableRow, + type HvTableInstance, } from "@hitachivantara/uikit-react-core"; -import { getColumns, ListViewEntry } from "./data"; +import { getColumns, type ListViewEntry } from "./data"; interface TableProps { instance: HvTableInstance; diff --git a/templates/ListView/data.tsx b/templates/ListView/data.tsx index 072fdd8a19..d1cd95c851 100644 --- a/templates/ListView/data.tsx +++ b/templates/ListView/data.tsx @@ -1,24 +1,24 @@ import useSWR from "swr"; import { - HvBulkActionsProps, - HvColor, - HvTableColumnConfig, HvTooltip, + type HvBulkActionsProps, + type HvColor, + type HvTableColumnConfig, } from "@hitachivantara/uikit-react-core"; import { - IconType, Level0Good, Level1, Level2Average, Level3Bad, Refresh, + type IconType, } from "@hitachivantara/uikit-react-icons"; import { - DataObject, delay, - ServerPaginationProps, useServerPagination, + type DataObject, + type ServerPaginationProps, } from "./usePaginationData"; // --- Table data utils --- @@ -162,8 +162,10 @@ const requestsSummary = { }, }; -export interface PaginationDataProps - extends Omit, "endpoint" | "db"> {} +export interface PaginationDataProps extends Omit< + ServerPaginationProps, + "endpoint" | "db" +> {} export const usePaginationData = (props: PaginationDataProps) => { return useServerPagination({ endpoint: "/requests", db, ...props }); diff --git a/templates/ListView/index.tsx b/templates/ListView/index.tsx index b02c42885a..541ed9d705 100644 --- a/templates/ListView/index.tsx +++ b/templates/ListView/index.tsx @@ -1,15 +1,12 @@ import { useEffect, useId, useMemo, useState } from "react"; import { css } from "@emotion/css"; import { - HvActionsGenericProps, HvBulkActions, HvButton, HvControls, HvGlobalActions, HvGrid, - HvGridProps, HvLeftControl, - HvLeftControlProps, HvLoadingContainer, HvPagination, HvRightControl, @@ -21,15 +18,18 @@ import { useHvPagination, useHvRowSelection, useHvSortBy, + type HvActionsGenericProps, + type HvGridProps, + type HvLeftControlProps, } from "@hitachivantara/uikit-react-core"; import { actions, getColumns, - ListViewEntry, - PaginationDataProps, usePaginationData, useSummaryData, + type ListViewEntry, + type PaginationDataProps, } from "./data"; import { Kpi } from "./Kpi"; import { Table } from "./Table"; diff --git a/tsconfig.build.json b/tsconfig.build.json index fc2e4f9c89..d96d4bb895 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -8,6 +8,8 @@ "declaration": true, "declarationMap": true, + "verbatimModuleSyntax": true, + /* Others */ "types": ["@testing-library/jest-dom", "vite/client", "vitest/globals"] },