diff --git a/invokeai/frontend/web/.eslintrc.js b/invokeai/frontend/web/.eslintrc.js index 955d37ef09..4ad387951f 100644 --- a/invokeai/frontend/web/.eslintrc.js +++ b/invokeai/frontend/web/.eslintrc.js @@ -93,6 +93,27 @@ module.exports = { '@typescript-eslint/no-import-type-side-effects': 'error', 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', + // Prefer @invoke-ai/ui components over chakra + 'no-restricted-imports': 'off', + '@typescript-eslint/no-restricted-imports': [ + 'warn', + { + paths: [ + { + name: '@chakra-ui/react', + message: "Please import from '@invoke-ai/ui' instead.", + }, + { + name: '@chakra-ui/layout', + message: "Please import from '@invoke-ai/ui' instead.", + }, + { + name: '@chakra-ui/portal', + message: "Please import from '@invoke-ai/ui' instead.", + }, + ], + }, + ], }, overrides: [ { diff --git a/invokeai/frontend/web/package.json b/invokeai/frontend/web/package.json index d30332a0f3..0def97ea68 100644 --- a/invokeai/frontend/web/package.json +++ b/invokeai/frontend/web/package.json @@ -32,8 +32,8 @@ "fix": "eslint --fix . && prettier --log-level warn --write .", "preinstall": "npx only-allow pnpm", "postinstall": "pnpm run theme", - "theme": "chakra-cli tokens src/theme/theme.ts", - "theme:watch": "chakra-cli tokens src/theme/theme.ts --watch", + "theme": "chakra-cli tokens --strict-component-types --strict-token-types node_modules/@invoke-ai/ui", + "theme:watch": "chakra-cli tokens --strict-component-types --strict-token-types node_modules/@invoke-ai/ui --watch", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "unimported": "npx unimported" @@ -66,7 +66,7 @@ "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", "@fontsource-variable/inter": "^5.0.16", - "@invoke-ai/ui": "^0.0.3", + "@invoke-ai/ui": "file:/home/bat/Documents/Code/ui", "@mantine/form": "6.0.21", "@nanostores/react": "^0.7.1", "@reduxjs/toolkit": "2.0.1", diff --git a/invokeai/frontend/web/pnpm-lock.yaml b/invokeai/frontend/web/pnpm-lock.yaml index 543d816f84..bb18789305 100644 --- a/invokeai/frontend/web/pnpm-lock.yaml +++ b/invokeai/frontend/web/pnpm-lock.yaml @@ -53,8 +53,8 @@ dependencies: specifier: ^5.0.16 version: 5.0.16 '@invoke-ai/ui': - specifier: ^0.0.3 - version: 0.0.3(@chakra-ui/anatomy@2.2.2)(@chakra-ui/icons@2.1.1)(@chakra-ui/layout@2.3.1)(@chakra-ui/portal@2.1.0)(@chakra-ui/react-use-size@2.1.0)(@chakra-ui/react@2.8.2)(@chakra-ui/styled-system@2.9.2)(@chakra-ui/theme-tools@2.1.2)(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@fontsource-variable/inter@5.0.16)(@nanostores/react@0.7.1)(framer-motion@10.18.0)(lodash-es@4.17.21)(nanostores@0.9.5)(react-dom@18.2.0)(react-i18next@14.0.0)(react@18.2.0) + specifier: file:/home/bat/Documents/Code/ui + version: file:../../../../ui(@chakra-ui/anatomy@2.2.2)(@chakra-ui/icons@2.1.1)(@chakra-ui/layout@2.3.1)(@chakra-ui/portal@2.1.0)(@chakra-ui/react@2.8.2)(@chakra-ui/styled-system@2.9.2)(@chakra-ui/theme-tools@2.1.2)(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@fontsource-variable/inter@5.0.16)(@nanostores/react@0.7.1)(chakra-react-select@4.7.6)(framer-motion@10.18.0)(lodash-es@4.17.21)(nanostores@0.9.5)(overlayscrollbars-react@0.5.3)(overlayscrollbars@2.4.6)(react-dom@18.2.0)(react-i18next@14.0.0)(react-select@5.8.0)(react@18.2.0) '@mantine/form': specifier: 6.0.21 version: 6.0.21(react@18.2.0) @@ -3688,48 +3688,6 @@ packages: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} dev: true - /@invoke-ai/ui@0.0.3(@chakra-ui/anatomy@2.2.2)(@chakra-ui/icons@2.1.1)(@chakra-ui/layout@2.3.1)(@chakra-ui/portal@2.1.0)(@chakra-ui/react-use-size@2.1.0)(@chakra-ui/react@2.8.2)(@chakra-ui/styled-system@2.9.2)(@chakra-ui/theme-tools@2.1.2)(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@fontsource-variable/inter@5.0.16)(@nanostores/react@0.7.1)(framer-motion@10.18.0)(lodash-es@4.17.21)(nanostores@0.9.5)(react-dom@18.2.0)(react-i18next@14.0.0)(react@18.2.0): - resolution: {integrity: sha512-EFh30NPTIWXJKNTgUghrbeB7hB59fD+cm6DIoOYMlMQOQGfHTu+6aOOx6hBoj7fse2UWWhL/dEhannz6homoCw==} - peerDependencies: - '@chakra-ui/anatomy': ^2.2.2 - '@chakra-ui/icons': ^2.1.1 - '@chakra-ui/layout': ^2.3.1 - '@chakra-ui/portal': ^2.1.0 - '@chakra-ui/react': ^2.8.2 - '@chakra-ui/react-use-size': ^2.1.0 - '@chakra-ui/styled-system': ^2.9.2 - '@chakra-ui/theme-tools': ^2.1.2 - '@emotion/react': ^11.11.3 - '@emotion/styled': ^11.11.0 - '@fontsource-variable/inter': ^5.0.16 - '@nanostores/react': ^0.7.1 - framer-motion: ^10.18.0 - lodash-es: ^4.17.21 - nanostores: ^0.9.5 - react: ^18.2.0 - react-dom: ^18.2.0 - react-i18next: ^14.0.0 - dependencies: - '@chakra-ui/anatomy': 2.2.2 - '@chakra-ui/icons': 2.1.1(@chakra-ui/system@2.6.2)(react@18.2.0) - '@chakra-ui/layout': 2.3.1(@chakra-ui/system@2.6.2)(react@18.2.0) - '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/react': 2.8.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(framer-motion@10.18.0)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/react-use-size': 2.1.0(react@18.2.0) - '@chakra-ui/styled-system': 2.9.2 - '@chakra-ui/theme-tools': 2.1.2(@chakra-ui/styled-system@2.9.2) - '@emotion/react': 11.11.3(@types/react@18.2.48)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.48)(react@18.2.0) - '@fontsource-variable/inter': 5.0.16 - '@nanostores/react': 0.7.1(nanostores@0.9.5)(react@18.2.0) - framer-motion: 10.18.0(react-dom@18.2.0)(react@18.2.0) - lodash-es: 4.17.21 - nanostores: 0.9.5 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-i18next: 14.0.0(i18next@23.7.16)(react-dom@18.2.0)(react@18.2.0) - dev: false - /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -13787,3 +13745,53 @@ packages: react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) dev: false + + file:../../../../ui(@chakra-ui/anatomy@2.2.2)(@chakra-ui/icons@2.1.1)(@chakra-ui/layout@2.3.1)(@chakra-ui/portal@2.1.0)(@chakra-ui/react@2.8.2)(@chakra-ui/styled-system@2.9.2)(@chakra-ui/theme-tools@2.1.2)(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@fontsource-variable/inter@5.0.16)(@nanostores/react@0.7.1)(chakra-react-select@4.7.6)(framer-motion@10.18.0)(lodash-es@4.17.21)(nanostores@0.9.5)(overlayscrollbars-react@0.5.3)(overlayscrollbars@2.4.6)(react-dom@18.2.0)(react-i18next@14.0.0)(react-select@5.8.0)(react@18.2.0): + resolution: {directory: ../../../../ui, type: directory} + id: file:../../../../ui + name: '@invoke-ai/ui' + peerDependencies: + '@chakra-ui/anatomy': ^2.2.2 + '@chakra-ui/icons': ^2.1.1 + '@chakra-ui/layout': ^2.3.1 + '@chakra-ui/portal': ^2.1.0 + '@chakra-ui/react': ^2.8.2 + '@chakra-ui/styled-system': ^2.9.2 + '@chakra-ui/theme-tools': ^2.1.2 + '@emotion/react': ^11.11.3 + '@emotion/styled': ^11.11.0 + '@fontsource-variable/inter': ^5.0.16 + '@nanostores/react': ^0.7.1 + chakra-react-select: ^4.7.6 + framer-motion: ^10.18.0 + lodash-es: ^4.17.21 + nanostores: ^0.9.5 + overlayscrollbars: ^2.4.6 + overlayscrollbars-react: ^0.5.3 + react: ^18.2.0 + react-dom: ^18.2.0 + react-i18next: ^14.0.0 + react-select: ^5.8.0 + dependencies: + '@chakra-ui/anatomy': 2.2.2 + '@chakra-ui/icons': 2.1.1(@chakra-ui/system@2.6.2)(react@18.2.0) + '@chakra-ui/layout': 2.3.1(@chakra-ui/system@2.6.2)(react@18.2.0) + '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) + '@chakra-ui/react': 2.8.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(framer-motion@10.18.0)(react-dom@18.2.0)(react@18.2.0) + '@chakra-ui/styled-system': 2.9.2 + '@chakra-ui/theme-tools': 2.1.2(@chakra-ui/styled-system@2.9.2) + '@emotion/react': 11.11.3(@types/react@18.2.48)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.48)(react@18.2.0) + '@fontsource-variable/inter': 5.0.16 + '@nanostores/react': 0.7.1(nanostores@0.9.5)(react@18.2.0) + chakra-react-select: 4.7.6(@chakra-ui/form-control@2.2.0)(@chakra-ui/icon@3.2.0)(@chakra-ui/layout@2.3.1)(@chakra-ui/media-query@3.3.0)(@chakra-ui/menu@2.2.1)(@chakra-ui/spinner@2.1.0)(@chakra-ui/system@2.6.2)(@emotion/react@11.11.3)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + framer-motion: 10.18.0(react-dom@18.2.0)(react@18.2.0) + lodash-es: 4.17.21 + nanostores: 0.9.5 + overlayscrollbars: 2.4.6 + overlayscrollbars-react: 0.5.3(overlayscrollbars@2.4.6)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-i18next: 14.0.0(i18next@23.7.16)(react-dom@18.2.0)(react@18.2.0) + react-select: 5.8.0(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + dev: false diff --git a/invokeai/frontend/web/src/app/components/App.tsx b/invokeai/frontend/web/src/app/components/App.tsx index a5294211ba..6be1741cfa 100644 --- a/invokeai/frontend/web/src/app/components/App.tsx +++ b/invokeai/frontend/web/src/app/components/App.tsx @@ -1,4 +1,4 @@ -import { Box } from '@chakra-ui/react'; +import { Box } from '@invoke-ai/ui'; import { useSocketIO } from 'app/hooks/useSocketIO'; import { useLogger } from 'app/logging/useLogger'; import { appStarted } from 'app/store/middleware/listenerMiddleware/listeners/appStarted'; diff --git a/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx b/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx index 3a2ec0a8c7..8ee59e6648 100644 --- a/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx +++ b/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx @@ -1,6 +1,4 @@ -import { Flex, Heading, Link, useToast } from '@chakra-ui/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Button, Flex, Heading, Link, Text, useToast } from '@invoke-ai/ui'; import newGithubIssueUrl from 'new-github-issue-url'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -65,24 +63,24 @@ const AppErrorBoundaryFallback = ({ error, resetErrorBoundary }: Props) => { justifyContent="space-between" alignItems="center" > - + {error.name}: {error.message} - + - } onClick={resetErrorBoundary} > {t('accessibility.resetUI')} - - } onClick={handleCopy}> + + } onClick={handleCopy}> {t('common.copyError')} - + - }> + }> {t('accessibility.createIssue')} - + diff --git a/invokeai/frontend/web/src/app/components/ThemeLocaleProvider.tsx b/invokeai/frontend/web/src/app/components/ThemeLocaleProvider.tsx index 1b4630e5db..15b4cf28fc 100644 --- a/invokeai/frontend/web/src/app/components/ThemeLocaleProvider.tsx +++ b/invokeai/frontend/web/src/app/components/ThemeLocaleProvider.tsx @@ -1,12 +1,16 @@ import '@fontsource-variable/inter'; import 'overlayscrollbars/overlayscrollbars.css'; -import 'common/components/OverlayScrollbars/overlayscrollbars.css'; -import { ChakraProvider, DarkMode, extendTheme } from '@chakra-ui/react'; +import { + ChakraProvider, + DarkMode, + extendTheme, + theme as _theme, + TOAST_OPTIONS, +} from '@invoke-ai/ui'; import type { ReactNode } from 'react'; import { memo, useEffect, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import { theme as invokeAITheme, TOAST_OPTIONS } from 'theme/theme'; type ThemeLocaleProviderProps = { children: ReactNode; @@ -19,7 +23,7 @@ function ThemeLocaleProvider({ children }: ThemeLocaleProviderProps) { const theme = useMemo(() => { return extendTheme({ - ...invokeAITheme, + ..._theme, direction, }); }, [direction]); diff --git a/invokeai/frontend/web/src/app/components/Toaster.ts b/invokeai/frontend/web/src/app/components/Toaster.ts index ad10f58a5e..6bb2592ba4 100644 --- a/invokeai/frontend/web/src/app/components/Toaster.ts +++ b/invokeai/frontend/web/src/app/components/Toaster.ts @@ -1,4 +1,4 @@ -import { useToast } from '@chakra-ui/react'; +import { useToast } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { addToast, clearToastQueue } from 'features/system/store/systemSlice'; import type { MakeToastArg } from 'features/system/util/makeToast'; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts index 1e8608d884..d848434df9 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/batchEnqueued.ts @@ -1,11 +1,10 @@ -import { createStandaloneToast } from '@chakra-ui/react'; +import { createStandaloneToast, theme, TOAST_OPTIONS } from '@invoke-ai/ui'; import { logger } from 'app/logging/logger'; import { parseify } from 'common/util/serialize'; import { zPydanticValidationError } from 'features/system/store/zodSchemas'; import { t } from 'i18next'; import { truncate, upperFirst } from 'lodash-es'; import { queueApi } from 'services/api/endpoints/queue'; -import { theme, TOAST_OPTIONS } from 'theme/theme'; import { startAppListening } from '..'; diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts index c7141c51c5..fdcfc7b360 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts @@ -1,4 +1,4 @@ -import type { UseToastOptions } from '@chakra-ui/react'; +import type { UseToastOptions } from '@invoke-ai/ui'; import { logger } from 'app/logging/logger'; import { setInitialCanvasImage } from 'features/canvas/store/canvasSlice'; import { diff --git a/invokeai/frontend/web/src/app/store/nanostores/customStarUI.ts b/invokeai/frontend/web/src/app/store/nanostores/customStarUI.ts index bb815164e5..71a8fc4017 100644 --- a/invokeai/frontend/web/src/app/store/nanostores/customStarUI.ts +++ b/invokeai/frontend/web/src/app/store/nanostores/customStarUI.ts @@ -1,4 +1,4 @@ -import type { MenuItemProps } from '@chakra-ui/react'; +import type { MenuItemProps } from '@invoke-ai/ui'; import { atom } from 'nanostores'; export type CustomStarUi = { diff --git a/invokeai/frontend/web/src/common/components/IAIColorPicker.tsx b/invokeai/frontend/web/src/common/components/IAIColorPicker.tsx index 5072b3442a..abba88ac12 100644 --- a/invokeai/frontend/web/src/common/components/IAIColorPicker.tsx +++ b/invokeai/frontend/web/src/common/components/IAIColorPicker.tsx @@ -1,5 +1,10 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import { Flex } from '@chakra-ui/react'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { + CompositeNumberInput, + Flex, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import type { CSSProperties } from 'react'; import { memo, useCallback } from 'react'; import { RgbaColorPicker } from 'react-colorful'; @@ -8,9 +13,6 @@ import type { RgbaColor, } from 'react-colorful/dist/types'; -import { InvControl } from './InvControl/InvControl'; -import { InvNumberInput } from './InvNumberInput/InvNumberInput'; - type IAIColorPickerProps = ColorPickerBaseProps & { withNumberInput?: boolean; }; @@ -61,8 +63,9 @@ const IAIColorPicker = (props: IAIColorPickerProps) => { /> {withNumberInput && ( - - + Red + { w={numberInputWidth} defaultValue={90} /> - - - + + Green + { w={numberInputWidth} defaultValue={90} /> - - - + + Blue + { w={numberInputWidth} defaultValue={255} /> - - - + + Alpha + { w={numberInputWidth} defaultValue={1} /> - + )} diff --git a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx index e554306442..500ccdfb7b 100644 --- a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx +++ b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx @@ -1,9 +1,5 @@ -import type { - ChakraProps, - FlexProps, - SystemStyleObject, -} from '@chakra-ui/react'; -import { Flex, Icon, Image } from '@chakra-ui/react'; +import type { ChakraProps, FlexProps, SystemStyleObject } from '@invoke-ai/ui'; +import { Flex, Icon, Image } from '@invoke-ai/ui'; import { IAILoadingImageFallback, IAINoContentFallback, diff --git a/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx b/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx index ce0fecb20c..1df0cb527a 100644 --- a/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx +++ b/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx @@ -1,9 +1,8 @@ -import type { SystemStyleObject } from '@chakra-ui/react'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { IconButton } from '@invoke-ai/ui'; import type { MouseEvent, ReactElement } from 'react'; import { memo, useMemo } from 'react'; -import { InvIconButton } from './InvIconButton/InvIconButton'; - type Props = { onClick: (event: MouseEvent) => void; tooltip: string; @@ -26,7 +25,7 @@ const IAIDndImageIcon = (props: Props) => { transitionDuration: 'normal', fill: 'base.100', _hover: { fill: 'base.50' }, - filter: 'drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))', + filter: 'drop-shadow(0px 0px 0.1rem var(--invoke-colors-base-800))', }, ...styleOverrides, }), @@ -34,7 +33,7 @@ const IAIDndImageIcon = (props: Props) => { ); return ( - { @@ -39,7 +37,7 @@ IAILoadingImageFallback.displayName = 'IAILoadingImageFallback'; type IAINoImageFallbackProps = FlexProps & { label?: string; icon?: As | null; - boxSize?: StyleProps['boxSize']; + boxSize?: ChakraProps['boxSize']; }; export const IAINoContentFallback = memo((props: IAINoImageFallbackProps) => { @@ -66,9 +64,9 @@ export const IAINoContentFallback = memo((props: IAINoImageFallbackProps) => { {icon && } {props.label && ( - + {props.label} - + )} ); @@ -102,7 +100,7 @@ export const IAINoContentFallbackWithSpinner = memo( return ( - {props.label && {props.label}} + {props.label && {props.label}} ); } diff --git a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx index 6b280efe7b..8248324a26 100644 --- a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx +++ b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx @@ -1,15 +1,18 @@ -import { Divider, Flex, Image, Portal } from '@chakra-ui/react'; -import { useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvHeading } from 'common/components/InvHeading/wrapper'; import { - InvPopover, - InvPopoverBody, - InvPopoverCloseButton, - InvPopoverContent, - InvPopoverTrigger, -} from 'common/components/InvPopover/wrapper'; -import { InvText } from 'common/components/InvText/wrapper'; + Button, + Divider, + Flex, + Heading, + Image, + Popover, + PopoverBody, + PopoverCloseButton, + PopoverContent, + PopoverTrigger, + Portal, + Text, +} from '@invoke-ai/ui'; +import { useAppSelector } from 'app/store/storeHooks'; import { merge, omit } from 'lodash-es'; import type { ReactElement } from 'react'; import { memo, useCallback, useMemo } from 'react'; @@ -47,7 +50,7 @@ const IAIInformationalPopover = ({ } return ( - - {children} + {children} {inPortal ? ( - + ) : ( - + )} - + ); }; export default memo(IAIInformationalPopover); -type PopoverContentProps = { +type ContentProps = { data?: PopoverData; feature: Feature; }; -const PopoverContent = ({ data, feature }: PopoverContentProps) => { +const Content = ({ data, feature }: ContentProps) => { const { t } = useTranslation(); const heading = useMemo( @@ -100,13 +103,13 @@ const PopoverContent = ({ data, feature }: PopoverContentProps) => { }, [data?.href]); return ( - - - + + + {heading && ( <> - {heading} + {heading} > )} @@ -124,12 +127,12 @@ const PopoverContent = ({ data, feature }: PopoverContentProps) => { > )} {paragraphs.map((p) => ( - {p} + {p} ))} {data?.href && ( <> - } @@ -137,11 +140,11 @@ const PopoverContent = ({ data, feature }: PopoverContentProps) => { variant="link" > {t('common.learnMore') ?? heading} - + > )} - - + + ); }; diff --git a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts index c48df92794..09d4e9c132 100644 --- a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts +++ b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/constants.ts @@ -1,4 +1,4 @@ -import type { PopoverProps } from '@chakra-ui/react'; +import type { PopoverProps } from '@invoke-ai/ui'; export type Feature = | 'clipSkip' diff --git a/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx b/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx index 08226d6d48..003ace0d1c 100644 --- a/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx @@ -1,4 +1,4 @@ -import { Badge, Flex } from '@chakra-ui/react'; +import { Badge, Flex } from '@invoke-ai/ui'; import { memo } from 'react'; import type { ImageDTO } from 'services/api/types'; diff --git a/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx b/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx index 0812889c15..dd0b250110 100644 --- a/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx @@ -1,4 +1,4 @@ -import { Box, Flex, Heading } from '@chakra-ui/react'; +import { Box, Flex, Heading } from '@invoke-ai/ui'; import type { AnimationProps } from 'framer-motion'; import { motion } from 'framer-motion'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/common/components/InvAccordion/InvAccordion.stories.tsx b/invokeai/frontend/web/src/common/components/InvAccordion/InvAccordion.stories.tsx deleted file mode 100644 index ba06d1a5dc..0000000000 --- a/invokeai/frontend/web/src/common/components/InvAccordion/InvAccordion.stories.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvText } from 'common/components/InvText/wrapper'; - -import { InvAccordionButton } from './InvAccordionButton'; -import type { InvAccordionProps } from './types'; -import { InvAccordion, InvAccordionItem, InvAccordionPanel } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvAccordion', - tags: ['autodocs'], - component: InvAccordion, - args: { - colorScheme: 'base', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvAccordionProps) => { - return ( - - - - Section 1 title - - - - 25 years and my life is still Tryin' to get up that great big - hill of hope For a destination I realized quickly when I knew I - should That the world was made up of this brotherhood of man For - whatever that means - - - - - - - Section 1 title - - - - And so I cry sometimes when I'm lying in bed Just to get it all - out what's in my head And I, I am feeling a little peculiar And - so I wake in the morning and I step outside And I take a deep breath - and I get real high And I scream from the top of my lungs - "What's going on?" - - - - - - - Section 2 title - - - - And I say, hey-ey-ey Hey-ey-ey I said "Hey, a-what's going - on?" And I say, hey-ey-ey Hey-ey-ey I said "Hey, - a-what's going on?" - - - - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvAccordion/InvAccordionButton.tsx b/invokeai/frontend/web/src/common/components/InvAccordion/InvAccordionButton.tsx deleted file mode 100644 index 667a6de460..0000000000 --- a/invokeai/frontend/web/src/common/components/InvAccordion/InvAccordionButton.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { - AccordionButton as ChakraAccordionButton, - Spacer, -} from '@chakra-ui/react'; -import { InvBadge } from 'common/components/InvBadge/wrapper'; -import { truncate } from 'lodash-es'; -import { useMemo } from 'react'; - -import type { InvAccordionButtonProps } from './types'; -import { InvAccordionIcon } from './wrapper'; - -export const InvAccordionButton = (props: InvAccordionButtonProps) => { - const { children, badges: _badges, ...rest } = props; - const badges = useMemo( - () => - _badges?.map((b) => truncate(String(b), { length: 24, omission: '...' })), - [_badges] - ); - return ( - - {children} - - {badges?.map((b, i) => ( - - {b} - - ))} - - - ); -}; diff --git a/invokeai/frontend/web/src/common/components/InvAccordion/theme.ts b/invokeai/frontend/web/src/common/components/InvAccordion/theme.ts deleted file mode 100644 index a0d5ce3eec..0000000000 --- a/invokeai/frontend/web/src/common/components/InvAccordion/theme.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { accordionAnatomy as parts } from '@chakra-ui/anatomy'; -import { - createMultiStyleConfigHelpers, - defineStyle, -} from '@chakra-ui/styled-system'; - -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys); - -const invokeAIContainer = defineStyle({ - border: 'none', - bg: 'base.850', - borderRadius: 'base', - ':has(&div &button:hover)': { bg: 'base.800' }, - transitionProperty: 'common', - transitionDuration: '0.1s', -}); - -const invokeAIButton = defineStyle((_props) => { - return { - gap: 2, - fontWeight: 'semibold', - fontSize: 'sm', - border: 'none', - borderRadius: 'base', - color: 'base.300', - _hover: {}, - _expanded: { - borderBottomRadius: 'none', - }, - }; -}); - -const invokeAIPanel = defineStyle((props) => { - const { colorScheme: c } = props; - return { - bg: `${c}.800`, - borderRadius: 'base', - p: 0, - transitionProperty: 'common', - transitionDuration: '0.1s', - }; -}); - -const invokeAIIcon = defineStyle({ - ms: 2, -}); - -const invokeAI = definePartsStyle((props) => ({ - container: invokeAIContainer, - button: invokeAIButton(props), - panel: invokeAIPanel(props), - icon: invokeAIIcon, -})); - -const baseStyle = definePartsStyle(() => ({ - root: { - display: 'flex', - flexDirection: 'column', - gap: 4, - }, -})); - -export const accordionTheme = defineMultiStyleConfig({ - baseStyle, - variants: { invokeAI }, - defaultProps: { - variant: 'invokeAI', - colorScheme: 'base', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvAccordion/types.ts b/invokeai/frontend/web/src/common/components/InvAccordion/types.ts deleted file mode 100644 index 94e3264cdb..0000000000 --- a/invokeai/frontend/web/src/common/components/InvAccordion/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { AccordionButtonProps as ChakraAccordionButtonProps } from '@chakra-ui/react'; -export type { - AccordionIconProps as InvAccordionIconProps, - AccordionItemProps as InvAccordionItemProps, - AccordionPanelProps as InvAccordionPanelProps, - AccordionProps as InvAccordionProps, -} from '@chakra-ui/react'; - -export type InvAccordionButtonProps = ChakraAccordionButtonProps & { - badges?: (string | number)[]; -}; diff --git a/invokeai/frontend/web/src/common/components/InvAccordion/wrapper.ts b/invokeai/frontend/web/src/common/components/InvAccordion/wrapper.ts deleted file mode 100644 index 80b9717df6..0000000000 --- a/invokeai/frontend/web/src/common/components/InvAccordion/wrapper.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { - Accordion as InvAccordion, - AccordionIcon as InvAccordionIcon, - AccordionItem as InvAccordionItem, - AccordionPanel as InvAccordionPanel, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvAlertDialog/types.ts b/invokeai/frontend/web/src/common/components/InvAlertDialog/types.ts deleted file mode 100644 index e419b0a92e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvAlertDialog/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * AlertDialog is a chakra Modal internally and uses those props. - */ -export type { AlertDialogProps as InvAlertDialogProps } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvAlertDialog/wrapper.ts b/invokeai/frontend/web/src/common/components/InvAlertDialog/wrapper.ts deleted file mode 100644 index a0308f0bc6..0000000000 --- a/invokeai/frontend/web/src/common/components/InvAlertDialog/wrapper.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { - AlertDialog as InvAlertDialog, - AlertDialogBody as InvAlertDialogBody, - AlertDialogCloseButton as InvAlertDialogCloseButton, - AlertDialogContent as InvAlertDialogContent, - AlertDialogFooter as InvAlertDialogFooter, - AlertDialogHeader as InvAlertDialogHeader, - AlertDialogOverlay as InvAlertDialogOverlay, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/InvAutosizeTextarea.tsx b/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/InvAutosizeTextarea.tsx index 881343bf5c..b4c7e1ef5a 100644 --- a/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/InvAutosizeTextarea.tsx +++ b/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/InvAutosizeTextarea.tsx @@ -1,4 +1,4 @@ -import { Box, forwardRef, Textarea as ChakraTextarea } from '@chakra-ui/react'; +import { Box, forwardRef, Textarea as ChakraTextarea } from '@invoke-ai/ui'; import { useGlobalModifiersSetters } from 'common/hooks/useGlobalModifiers'; import { stopPastePropagation } from 'common/util/stopPastePropagation'; import type { KeyboardEvent } from 'react'; diff --git a/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/types.ts b/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/types.ts index ae1b157cec..350428eaf7 100644 --- a/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/types.ts +++ b/invokeai/frontend/web/src/common/components/InvAutosizeTextarea/types.ts @@ -1,4 +1,4 @@ -import type { TextareaProps as ChakraTextareaProps } from '@chakra-ui/react'; +import type { TextareaProps as ChakraTextareaProps } from '@invoke-ai/ui'; import type { TextareaAutosizeProps } from 'react-textarea-autosize'; export type InvAutosizeTextareaProps = Omit< diff --git a/invokeai/frontend/web/src/common/components/InvBadge/InvBadge.stories.tsx b/invokeai/frontend/web/src/common/components/InvBadge/InvBadge.stories.tsx deleted file mode 100644 index da72c66d4c..0000000000 --- a/invokeai/frontend/web/src/common/components/InvBadge/InvBadge.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvBadgeProps } from './types'; -import { InvBadge } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvBadge', - tags: ['autodocs'], - component: InvBadge, - args: { - colorScheme: 'base', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvBadgeProps) => { - return Invoke; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvBadge/theme.ts b/invokeai/frontend/web/src/common/components/InvBadge/theme.ts deleted file mode 100644 index bca68c3198..0000000000 --- a/invokeai/frontend/web/src/common/components/InvBadge/theme.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { defineStyle, defineStyleConfig } from '@chakra-ui/react'; - -const baseStyle = defineStyle((props) => ({ - fontSize: 9, - px: 2, - py: 1, - minW: 4, - lineHeight: 1, - borderRadius: 'sm', - bg: `${props.colorScheme}.200`, - color: 'base.900', - fontWeight: 'bold', - letterSpacing: 0.6, - wordBreak: 'break-all', - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - overflow: 'hidden', -})); - -export const badgeTheme = defineStyleConfig({ - baseStyle, - defaultProps: { - colorScheme: 'base', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvBadge/types.ts b/invokeai/frontend/web/src/common/components/InvBadge/types.ts deleted file mode 100644 index ed073818c8..0000000000 --- a/invokeai/frontend/web/src/common/components/InvBadge/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BadgeProps as ChakraBadgeProps } from '@chakra-ui/react'; - -export type InvBadgeProps = ChakraBadgeProps; diff --git a/invokeai/frontend/web/src/common/components/InvBadge/wrapper.ts b/invokeai/frontend/web/src/common/components/InvBadge/wrapper.ts deleted file mode 100644 index 50b4c4ad60..0000000000 --- a/invokeai/frontend/web/src/common/components/InvBadge/wrapper.ts +++ /dev/null @@ -1 +0,0 @@ -export { Badge as InvBadge } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvButton/InvButton.stories.tsx b/invokeai/frontend/web/src/common/components/InvButton/InvButton.stories.tsx deleted file mode 100644 index 80db0ab5c3..0000000000 --- a/invokeai/frontend/web/src/common/components/InvButton/InvButton.stories.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import { Flex } from '@chakra-ui/layout'; -import type { Meta, StoryObj } from '@storybook/react'; -import { InvHeading } from 'common/components/InvHeading/wrapper'; -import { IoSparkles } from 'react-icons/io5'; - -import { InvButton } from './InvButton'; -import type { InvButtonProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvButton', - tags: ['autodocs'], - component: InvButton, - parameters: { - controls: { expanded: true }, - }, - argTypes: { - isLoading: { - defaultValue: false, - control: { type: 'boolean' }, - }, - isDisabled: { - defaultValue: false, - control: { type: 'boolean' }, - }, - }, -}; - -export default meta; -type Story = StoryObj; - -const colorSchemes = [ - 'base', - 'invokeYellow', - 'invokeRed', - 'invokeGreen', - 'invokeBlue', -] as const; -const variants = ['solid', 'outline', 'ghost', 'link'] as const; -const sizes = ['xs', 'sm', 'md', 'lg'] as const; - -const Component = (props: InvButtonProps) => { - return ( - - {sizes.map((size) => ( - <> - Size: {size} - - - {colorSchemes.map((colorScheme) => ( - - {variants.map((variant) => ( - <> - - {variant} - - {['solid', 'outline'].includes(variant) && ( - } - {...props} - > - {variant} - - )} - {['solid', 'outline'].includes(variant) && ( - } - {...props} - > - {variant} - - )} - > - ))} - - ))} - - > - ))} - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvButton/InvButton.tsx b/invokeai/frontend/web/src/common/components/InvButton/InvButton.tsx deleted file mode 100644 index 5d2dbc8aa7..0000000000 --- a/invokeai/frontend/web/src/common/components/InvButton/InvButton.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Button, forwardRef } from '@chakra-ui/react'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; -import { memo } from 'react'; - -import type { InvButtonProps } from './types'; - -export const InvButton = memo( - forwardRef( - ({ isChecked, tooltip, children, ...rest }: InvButtonProps, ref) => { - if (tooltip) { - return ( - - - {children} - - - ); - } - - return ( - - {children} - - ); - } - ) -); - -InvButton.displayName = 'InvButton'; diff --git a/invokeai/frontend/web/src/common/components/InvButton/theme.ts b/invokeai/frontend/web/src/common/components/InvButton/theme.ts deleted file mode 100644 index 5b54c36f97..0000000000 --- a/invokeai/frontend/web/src/common/components/InvButton/theme.ts +++ /dev/null @@ -1,228 +0,0 @@ -import type { StyleFunctionProps } from '@chakra-ui/react'; -import { defineStyle, defineStyleConfig } from '@chakra-ui/react'; -import { buttonVariantPromptOverlay } from 'features/parameters/components/Prompts/theme'; - -type Variant = `solid` | `outline` | `ghost` | `link`; - -const getBorders = ( - props: StyleFunctionProps, - variant: Variant -): { borderWidth: string; borderStyle: string } => { - if (variant !== 'outline') { - return { - borderWidth: '0px', - borderStyle: 'none', - }; - } - if (props.size === 'lg') { - return { - borderWidth: '1px', - borderStyle: 'solid', - }; - } - if (props.size === 'md') { - return { - borderWidth: '1px', - borderStyle: 'solid', - }; - } - return { - borderWidth: '1px', - borderStyle: 'solid', - }; -}; - -const getColors = ( - props: StyleFunctionProps, - variant: Variant -): { - bg: string; - bgDisabled: string; - bgHover: string; - fg: string; - fgDisabled: string; - fgHover: string; - borderColor: string; - borderColorDisabled: string; - borderColorHover: string; -} => { - const { colorScheme: c } = props; - - const bgBase = 'base.400'; - const bgColor = c === 'invokeYellow' ? `${c}.500` : `${c}.400`; - const bgBaseHover = 'base.300'; - const bgColorHover = c === 'invokeYellow' ? `${c}.300` : `${c}.300`; - - const notSolidFg = { - fg: c === 'base' ? 'base.300' : bgColor, - fgHover: c === 'base' ? 'base.50' : bgColorHover, - fgDisabled: 'base.600', - }; - const noBg = { bg: 'none', bgHover: 'none', bgDisabled: 'none' }; - const noBorder = { - borderColor: 'none', - borderColorDisabled: 'none', - borderColorHover: 'none', - }; - - if (variant === 'ghost') { - return { - ...notSolidFg, - ...noBg, - ...noBorder, - bgHover: 'baseAlpha.200', - }; - } - - if (variant === 'link') { - return { - ...notSolidFg, - ...noBg, - ...noBorder, - }; - } - if (variant === 'outline') { - return { - ...notSolidFg, - ...noBg, - borderColor: c === 'invokeYellow' ? `${c}Alpha.500` : `${c}Alpha.400`, - borderColorDisabled: 'base.600', - borderColorHover: - c === 'invokeYellow' ? `${c}Alpha.700` : `${c}Alpha.600`, - }; - } - - // solid - return { - bg: c === 'base' ? bgBase : bgColor, - bgHover: c === 'base' ? bgBaseHover : bgColorHover, - bgDisabled: 'base.600', - fg: 'base.900', - fgHover: 'base.900', - fgDisabled: 'base.750', - ...noBorder, - }; -}; - -const getStyles = ( - props: StyleFunctionProps, - variant: 'ghost' | 'solid' | 'outline' | 'link' -) => { - const { borderWidth, borderStyle } = getBorders(props, variant); - const { - bg, - bgDisabled, - bgHover, - fg, - fgDisabled, - fgHover, - borderColor, - borderColorDisabled, - borderColorHover, - } = getColors(props, variant); - - const _disabled = { - bg: bgDisabled, - color: fgDisabled, - opacity: 1, - borderColor: borderColorDisabled, - svg: { - fill: fgDisabled, - }, - _hover: { - bg: bgDisabled, - color: fgDisabled, - borderColor: borderColorDisabled, - svg: { - fill: fgDisabled, - }, - }, - }; - - const _base = { - bg: bg, - color: fg, - borderWidth: borderWidth, - borderStyle: borderStyle, - borderColor: borderColor, - svg: { - fill: fg, - }, - }; - - return { - ..._base, - _hover: { - bg: bgHover, - color: fgHover, - borderColor: borderColorHover, - svg: { - fill: fgHover, - }, - _disabled, - }, - _active: { ..._base }, - _disabled, - } as const; -}; - -export const buttonTheme = defineStyleConfig({ - baseStyle: { - fontWeight: 'semibold', - svg: { - transitionProperty: 'all', - transitionDuration: 'faster', - }, - }, - sizes: { - sm: { - fontSize: 'sm', - px: 3, - py: 2, - }, - md: { - fontSize: 'md', - px: 4, - py: 2, - }, - lg: { - fontSize: 'lg', - px: 4, - py: 2, - h: 12, - }, - }, - variants: { - solid: defineStyle((props) => getStyles(props, 'solid')), - appTab: defineStyle((_props) => { - // Has no disabled, invalid, loading, etc state - return { - bg: 'none', - svg: { - fill: 'base.600', - }, - _hover: { - bg: 'none', - svg: { - fill: 'base.400', - }, - }, - '&[data-selected="true"]': { - bg: 'none', - svg: { - fill: 'base.100', - }, - }, - }; - }), - outline: defineStyle((props) => getStyles(props, 'outline')), - ghost: defineStyle((props) => getStyles(props, 'ghost')), - link: defineStyle((props) => getStyles(props, 'link')), - promptOverlay: buttonVariantPromptOverlay, - }, - defaultProps: { - variant: 'solid', - colorScheme: 'base', - size: 'md', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvButton/types.ts b/invokeai/frontend/web/src/common/components/InvButton/types.ts deleted file mode 100644 index eb25209961..0000000000 --- a/invokeai/frontend/web/src/common/components/InvButton/types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ButtonProps } from '@chakra-ui/react'; -import type { ReactNode } from 'react'; - -export type InvButtonProps = ButtonProps & { - isChecked?: boolean; - tooltip?: ReactNode; -}; diff --git a/invokeai/frontend/web/src/common/components/InvButtonGroup/InvButtonGroup.stories.tsx b/invokeai/frontend/web/src/common/components/InvButtonGroup/InvButtonGroup.stories.tsx deleted file mode 100644 index ffb44d0a6c..0000000000 --- a/invokeai/frontend/web/src/common/components/InvButtonGroup/InvButtonGroup.stories.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { FaImage } from 'react-icons/fa'; - -import { InvButtonGroup } from './InvButtonGroup'; -import type { InvButtonGroupProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvButtonGroup', - tags: ['autodocs'], - component: InvButtonGroup, - args: { - colorScheme: 'base', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvButtonGroupProps) => { - return ( - - Test - Test - Test - - ); -}; - -const ComponentWithIconButtons = (props: InvButtonGroupProps) => { - return ( - - } /> - } /> - } /> - - ); -}; - -export const Default: Story = { - render: Component, -}; - -export const WithIconButtons: Story = { - render: ComponentWithIconButtons, -}; diff --git a/invokeai/frontend/web/src/common/components/InvButtonGroup/InvButtonGroup.tsx b/invokeai/frontend/web/src/common/components/InvButtonGroup/InvButtonGroup.tsx deleted file mode 100644 index 6b31b3e516..0000000000 --- a/invokeai/frontend/web/src/common/components/InvButtonGroup/InvButtonGroup.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { ButtonGroup, forwardRef } from '@chakra-ui/react'; -import { memo } from 'react'; - -import type { InvButtonGroupProps } from './types'; - -export const InvButtonGroup = memo( - forwardRef( - ({ isAttached = true, ...rest }: InvButtonGroupProps, ref) => { - return ; - } - ) -); - -InvButtonGroup.displayName = 'InvButtonGroup'; diff --git a/invokeai/frontend/web/src/common/components/InvButtonGroup/types.ts b/invokeai/frontend/web/src/common/components/InvButtonGroup/types.ts deleted file mode 100644 index 41ecd1649f..0000000000 --- a/invokeai/frontend/web/src/common/components/InvButtonGroup/types.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ButtonGroupProps as InvButtonGroupProps } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvCard/InvCard.stories.tsx b/invokeai/frontend/web/src/common/components/InvCard/InvCard.stories.tsx deleted file mode 100644 index c0440bc266..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCard/InvCard.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvCardProps } from './types'; -import { InvCard } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvCard', - tags: ['autodocs'], - component: InvCard, - args: { - colorScheme: 'base', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvCardProps) => { - return Invoke; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvCard/theme.ts b/invokeai/frontend/web/src/common/components/InvCard/theme.ts deleted file mode 100644 index 51bc4a0700..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCard/theme.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { cardAnatomy } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers } from '@chakra-ui/react'; -import { cardVariantLora } from 'features/lora/components/styles'; - -const { defineMultiStyleConfig } = createMultiStyleConfigHelpers( - cardAnatomy.keys -); - -export const cardTheme = defineMultiStyleConfig({ - variants: { lora: cardVariantLora }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvCard/types.ts b/invokeai/frontend/web/src/common/components/InvCard/types.ts deleted file mode 100644 index cc57d20c54..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCard/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { - CardBodyProps as InvCardBodyProps, - CardFooterProps as InvCardFooterProps, - CardHeaderProps as InvCardHeaderProps, - CardProps as InvCardProps, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvCard/wrapper.ts b/invokeai/frontend/web/src/common/components/InvCard/wrapper.ts deleted file mode 100644 index 894e3bea59..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCard/wrapper.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { - Card as InvCard, - CardBody as InvCardBody, - CardFooter as InvCardFooter, - CardHeader as InvCardHeader, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvCheckbox/InvCheckbox.stories.tsx b/invokeai/frontend/web/src/common/components/InvCheckbox/InvCheckbox.stories.tsx deleted file mode 100644 index 7ad6a93745..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCheckbox/InvCheckbox.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvCheckboxProps } from './types'; -import { InvCheckbox } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvCheckbox', - tags: ['autodocs'], - component: InvCheckbox, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvCheckboxProps) => { - return ; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvCheckbox/theme.ts b/invokeai/frontend/web/src/common/components/InvCheckbox/theme.ts deleted file mode 100644 index 53a1b01beb..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCheckbox/theme.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { checkboxAnatomy as parts } from '@chakra-ui/anatomy'; -import { - createMultiStyleConfigHelpers, - defineStyle, -} from '@chakra-ui/styled-system'; - -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys); - -const invokeAIControl = defineStyle((props) => { - const { colorScheme: c } = props; - - return { - bg: 'base.700', - borderColor: 'base.600', - color: 'base.100', - - _checked: { - bg: `${c}.500`, - borderColor: `${c}.500`, - color: `${c}.100`, - - _hover: { - bg: `${c}.500`, - borderColor: `${c}.500`, - }, - - _disabled: { - borderColor: 'transparent', - bg: 'whiteAlpha.300', - color: 'whiteAlpha.500', - }, - }, - - _indeterminate: { - bg: `${c}.600`, - borderColor: `${c}.600`, - color: `${c}.100`, - }, - - _disabled: { - bg: 'whiteAlpha.100', - borderColor: 'transparent', - }, - - _focusVisible: { - boxShadow: 'none', - outline: 'none', - }, - - _invalid: { - borderColor: 'error.300', - }, - }; -}); - -const invokeAI = definePartsStyle((props) => ({ - control: invokeAIControl(props), -})); - -export const checkboxTheme = defineMultiStyleConfig({ - variants: { - invokeAI: invokeAI, - }, - defaultProps: { - variant: 'invokeAI', - colorScheme: 'blue', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvCheckbox/types.ts b/invokeai/frontend/web/src/common/components/InvCheckbox/types.ts deleted file mode 100644 index 5874d57463..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCheckbox/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CheckboxProps as ChakraCheckboxProps } from '@chakra-ui/react'; - -export interface InvCheckboxProps extends ChakraCheckboxProps {} diff --git a/invokeai/frontend/web/src/common/components/InvCheckbox/wrapper.ts b/invokeai/frontend/web/src/common/components/InvCheckbox/wrapper.ts deleted file mode 100644 index d637fd3af4..0000000000 --- a/invokeai/frontend/web/src/common/components/InvCheckbox/wrapper.ts +++ /dev/null @@ -1 +0,0 @@ -export { Checkbox as InvCheckbox } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog.tsx b/invokeai/frontend/web/src/common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog.tsx deleted file mode 100644 index b3c8ebb8a1..0000000000 --- a/invokeai/frontend/web/src/common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import { - InvAlertDialog, - InvAlertDialogBody, - InvAlertDialogContent, - InvAlertDialogFooter, - InvAlertDialogHeader, - InvAlertDialogOverlay, -} from 'common/components/InvAlertDialog/wrapper'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { memo, useCallback, useRef } from 'react'; -import { useTranslation } from 'react-i18next'; - -import type { InvConfirmationAlertDialogProps } from './types'; - -/** - * This component is a wrapper around InvAlertDialog that provides a confirmation dialog. - * Its state must be managed externally using chakra's `useDisclosure()` hook. - */ -export const InvConfirmationAlertDialog = memo( - (props: InvConfirmationAlertDialogProps) => { - const { t } = useTranslation(); - - const { - acceptCallback, - cancelCallback, - acceptButtonText = t('common.accept'), - cancelButtonText = t('common.cancel'), - children, - title, - isOpen, - onClose, - } = props; - - const cancelRef = useRef(null); - - const handleAccept = useCallback(() => { - acceptCallback(); - onClose(); - }, [acceptCallback, onClose]); - - const handleCancel = useCallback(() => { - cancelCallback && cancelCallback(); - onClose(); - }, [cancelCallback, onClose]); - - return ( - - - - - {title} - - - {children} - - - - {cancelButtonText} - - - {acceptButtonText} - - - - - - ); - } -); - -InvConfirmationAlertDialog.displayName = 'InvConfirmationAlertDialog'; diff --git a/invokeai/frontend/web/src/common/components/InvConfirmationAlertDialog/types.ts b/invokeai/frontend/web/src/common/components/InvConfirmationAlertDialog/types.ts deleted file mode 100644 index 1c346462c2..0000000000 --- a/invokeai/frontend/web/src/common/components/InvConfirmationAlertDialog/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { AlertDialogProps } from '@chakra-ui/react'; -import type { PropsWithChildren } from 'react'; - -export type InvConfirmationAlertDialogProps = Omit< - AlertDialogProps, - 'leastDestructiveRef' | 'isOpen' | 'onClose' -> & - PropsWithChildren<{ - isOpen: boolean; - onClose: () => void; - acceptButtonText?: string; - acceptCallback: () => void; - cancelButtonText?: string; - cancelCallback?: () => void; - title: string; - }>; diff --git a/invokeai/frontend/web/src/common/components/InvContextMenu/InvContextMenu.stories.tsx b/invokeai/frontend/web/src/common/components/InvContextMenu/InvContextMenu.stories.tsx deleted file mode 100644 index f97264bd57..0000000000 --- a/invokeai/frontend/web/src/common/components/InvContextMenu/InvContextMenu.stories.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; -import { InvText } from 'common/components/InvText/wrapper'; -import { useCallback } from 'react'; -import { FaCopy, FaDownload, FaTrash } from 'react-icons/fa6'; - -import { InvContextMenu } from './InvContextMenu'; - -const meta: Meta = { - title: 'Primitives/InvContextMenu', - tags: ['autodocs'], - component: InvContextMenu, -}; - -export default meta; -type Story = StoryObj; - -const Component = () => { - const renderMenuFunc = useCallback( - () => ( - - } command="⌘S"> - Download - - } command="⌘C"> - Create a Copy - - Mark as Draft - } isDestructive> - Delete - - Attend a Workshop - - ), - [] - ); - - return ( - renderMenu={renderMenuFunc}> - {(ref) => ( - - Right-click me - - )} - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvContextMenu/InvContextMenu.tsx b/invokeai/frontend/web/src/common/components/InvContextMenu/InvContextMenu.tsx deleted file mode 100644 index 83dcbc3857..0000000000 --- a/invokeai/frontend/web/src/common/components/InvContextMenu/InvContextMenu.tsx +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Adapted from https://github.com/lukasbach/chakra-ui-contextmenu - */ -import type { - ChakraProps, - MenuButtonProps, - MenuProps, - PortalProps, -} from '@chakra-ui/react'; -import { Portal, useDisclosure, useEventListener } from '@chakra-ui/react'; -import { InvMenu, InvMenuButton } from 'common/components/InvMenu/wrapper'; -import { useGlobalMenuClose } from 'common/hooks/useGlobalMenuClose'; -import { typedMemo } from 'common/util/typedMemo'; -import { useCallback, useEffect, useRef, useState } from 'react'; - -export interface InvContextMenuProps { - renderMenu: () => JSX.Element | null; - children: (ref: React.MutableRefObject) => JSX.Element | null; - menuProps?: Omit & { children?: React.ReactNode }; - portalProps?: Omit & { children?: React.ReactNode }; - menuButtonProps?: MenuButtonProps; -} - -export const InvContextMenu = typedMemo( - (props: InvContextMenuProps) => { - const { isOpen, onOpen, onClose } = useDisclosure(); - const [position, setPosition] = useState([-1, -1]); - const targetRef = useRef(null); - const lastPositionRef = useRef([-1, -1]); - const timeoutRef = useRef(0); - - useGlobalMenuClose(onClose); - - const onContextMenu = useCallback( - (e: MouseEvent) => { - if (e.shiftKey) { - onClose(); - return; - } - if ( - targetRef.current?.contains(e.target as HTMLElement) || - e.target === targetRef.current - ) { - // clear pending delayed open - window.clearTimeout(timeoutRef.current); - e.preventDefault(); - if ( - lastPositionRef.current[0] !== e.pageX || - lastPositionRef.current[1] !== e.pageY - ) { - // if the mouse moved, we need to close, wait for animation and reopen the menu at the new position - onClose(); - timeoutRef.current = window.setTimeout(() => { - onOpen(); - setPosition([e.pageX, e.pageY]); - }, 100); - } else { - // else we can just open the menu at the current position - onOpen(); - setPosition([e.pageX, e.pageY]); - } - } - lastPositionRef.current = [e.pageX, e.pageY]; - }, - [onClose, onOpen] - ); - - useEffect( - () => () => { - window.clearTimeout(timeoutRef.current); - }, - [] - ); - - useEventListener('contextmenu', onContextMenu); - - return ( - <> - {props.children(targetRef)} - - - - {props.renderMenu()} - - - > - ); - } -); - -const _hover: ChakraProps['_hover'] = { bg: 'transparent' }; diff --git a/invokeai/frontend/web/src/common/components/InvControl/InvControl.stories.tsx b/invokeai/frontend/web/src/common/components/InvControl/InvControl.stories.tsx deleted file mode 100644 index cd8353b668..0000000000 --- a/invokeai/frontend/web/src/common/components/InvControl/InvControl.stories.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvNumberInput } from 'common/components/InvNumberInput/InvNumberInput'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOption } from 'common/components/InvSelect/types'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; -import { useState } from 'react'; - -import { InvControl } from './InvControl'; -import type { InvControlProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvControl', - tags: ['autodocs'], - component: InvControl, - args: { - label: 'My Control', - isDisabled: false, - isInvalid: false, - w: 96, - }, -}; - -export default meta; -type Story = StoryObj; - -const InvControlWithSliderComponent = (props: InvControlProps) => { - const [value, setValue] = useState(0); - return ( - - - - ); -}; - -const InvControlWithSliderAndHelperTextComponent = (props: InvControlProps) => { - const [value, setValue] = useState(0); - return ( - - - - ); -}; - -const InvControlWithNumberInputComponent = (props: InvControlProps) => { - const [value, setValue] = useState(0); - return ( - - - - ); -}; - -const options: InvSelectOption[] = [ - { - value: 'chocolate', - label: 'Chocolate', - }, - { - value: 'strawberry', - label: 'Strawberry', - }, - { - value: 'vanilla', - label: 'Vanilla', - }, -]; -const InvControlWithSelectComponent = (props: InvControlProps) => { - return ( - - - - ); -}; - -export const InvControlWithSlider: Story = { - render: InvControlWithSliderComponent, -}; - -export const InvControlWithSliderAndHelperText: Story = { - render: InvControlWithSliderAndHelperTextComponent, -}; - -export const InvControlWithNumberInput: Story = { - render: InvControlWithNumberInputComponent, -}; - -export const InvControlWithSelect: Story = { - render: InvControlWithSelectComponent, -}; diff --git a/invokeai/frontend/web/src/common/components/InvControl/InvControl.tsx b/invokeai/frontend/web/src/common/components/InvControl/InvControl.tsx deleted file mode 100644 index 55d999da16..0000000000 --- a/invokeai/frontend/web/src/common/components/InvControl/InvControl.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { - Flex, - FormControl as ChakraFormControl, - FormErrorMessage as ChakraFormErrorMessage, - FormHelperText as ChakraFormHelperText, - forwardRef, -} from '@chakra-ui/react'; -import { InvControlGroupContext } from 'common/components/InvControl/InvControlGroup'; -import { memo, useContext, useMemo } from 'react'; - -import { InvLabel } from './InvLabel'; -import type { InvControlProps } from './types'; - -export const InvControl = memo( - forwardRef( - (props: InvControlProps, ref) => { - const { - children, - helperText, - feature, - orientation: _orientation, - renderInfoPopoverInPortal = true, - isDisabled: _isDisabled, - labelProps, - label, - error, - ...formControlProps - } = props; - - const ctx = useContext(InvControlGroupContext); - - const orientation = useMemo( - () => _orientation ?? ctx.orientation, - [_orientation, ctx.orientation] - ); - - const isDisabled = useMemo( - () => _isDisabled ?? ctx.isDisabled, - [_isDisabled, ctx.isDisabled] - ); - - return ( - - - {label && ( - - {label} - - )} - {children} - - {helperText && ( - {helperText} - )} - {error && {error}} - - ); - } - ) -); - -InvControl.displayName = 'InvControl'; diff --git a/invokeai/frontend/web/src/common/components/InvControl/InvControlGroup.tsx b/invokeai/frontend/web/src/common/components/InvControl/InvControlGroup.tsx deleted file mode 100644 index 5e23834e23..0000000000 --- a/invokeai/frontend/web/src/common/components/InvControl/InvControlGroup.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { FormControlProps, FormLabelProps } from '@chakra-ui/react'; -import type { PropsWithChildren } from 'react'; -import { createContext, memo } from 'react'; - -export type InvControlGroupProps = { - labelProps?: FormLabelProps; - controlProps?: FormControlProps; - isDisabled?: boolean; - orientation?: 'horizontal' | 'vertical'; -}; - -export const InvControlGroupContext = createContext({}); - -export const InvControlGroup = memo( - ({ children, ...context }: PropsWithChildren) => { - return ( - - {children} - - ); - } -); - -InvControlGroup.displayName = 'InvControlGroup'; diff --git a/invokeai/frontend/web/src/common/components/InvControl/InvLabel.tsx b/invokeai/frontend/web/src/common/components/InvControl/InvLabel.tsx deleted file mode 100644 index e8ec3e72e3..0000000000 --- a/invokeai/frontend/web/src/common/components/InvControl/InvLabel.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Flex, FormLabel, forwardRef } from '@chakra-ui/react'; -import { useAppSelector } from 'app/store/storeHooks'; -import IAIInformationalPopover from 'common/components/IAIInformationalPopover/IAIInformationalPopover'; -import { InvControlGroupContext } from 'common/components/InvControl/InvControlGroup'; -import { memo, useContext } from 'react'; - -import type { InvLabelProps } from './types'; - -export const InvLabel = memo( - forwardRef( - ( - { feature, renderInfoPopoverInPortal, children, ...rest }: InvLabelProps, - ref - ) => { - const shouldEnableInformationalPopovers = useAppSelector( - (s) => s.system.shouldEnableInformationalPopovers - ); - - const ctx = useContext(InvControlGroupContext); - if (feature && shouldEnableInformationalPopovers) { - return ( - - - - {children} - - - - ); - } - return ( - - {children} - - ); - } - ) -); - -InvLabel.displayName = 'InvLabel'; diff --git a/invokeai/frontend/web/src/common/components/InvControl/theme.ts b/invokeai/frontend/web/src/common/components/InvControl/theme.ts deleted file mode 100644 index 457a243969..0000000000 --- a/invokeai/frontend/web/src/common/components/InvControl/theme.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { - formAnatomy as formParts, - formErrorAnatomy as formErrorParts, -} from '@chakra-ui/anatomy'; -import { - createMultiStyleConfigHelpers, - defineStyle, - defineStyleConfig, -} from '@chakra-ui/styled-system'; - -const { - definePartsStyle: defineFormPartsStyle, - defineMultiStyleConfig: defineFormMultiStyleConfig, -} = createMultiStyleConfigHelpers(formParts.keys); - -const formBaseStyle = defineFormPartsStyle((props) => ({ - container: { - flexDirection: 'column', - alignItems: 'flex-start', - gap: 4, - h: 'unset', - '> .invcontrol-label-wrapper': { - display: 'flex', - flexDirection: props.orientation === 'vertical' ? 'column' : 'row', - alignItems: props.orientation === 'vertical' ? 'flex-start' : 'center', - gap: props.orientation === 'vertical' ? 0 : 4, - minH: 8, - w: 'full', - _invalid: { - color: 'error.300', - }, - '> .invcontrol-input-wrapper': { - w: 'full', - display: 'flex', - gap: 4, - justifyContent: 'flex-end', - }, - }, - }, - helperText: { - w: 'full', - fontSize: 'sm', - color: 'base.400', - m: 0, - }, -})); - -export const formTheme = defineFormMultiStyleConfig({ - baseStyle: formBaseStyle, -}); - -const formLabelBaseStyle = defineStyle(() => { - return { - fontSize: 'sm', - marginEnd: 0, - mb: 0, - flexShrink: 0, - flexGrow: 0, - fontWeight: 'semibold', - transitionProperty: 'common', - transitionDuration: 'normal', - whiteSpace: 'nowrap', - userSelect: 'none', - h: 'full', - alignItems: 'center', - _disabled: { - opacity: 0.4, - }, - color: 'base.300', - _invalid: { - color: 'error.300', - }, - }; -}); - -export const formLabelTheme = defineStyleConfig({ - baseStyle: formLabelBaseStyle, -}); - -const { defineMultiStyleConfig: defineFormErrorMultiStyleConfig } = - createMultiStyleConfigHelpers(formErrorParts.keys); - -export const formErrorTheme = defineFormErrorMultiStyleConfig({ - baseStyle: { - text: { - color: 'error.300', - }, - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvControl/types.ts b/invokeai/frontend/web/src/common/components/InvControl/types.ts deleted file mode 100644 index 56cd8e6f1a..0000000000 --- a/invokeai/frontend/web/src/common/components/InvControl/types.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { - FormControlProps as ChakraFormControlProps, - FormLabelProps as ChakraFormLabelProps, -} from '@chakra-ui/react'; -import type { Feature } from 'common/components/IAIInformationalPopover/constants'; - -export type InvControlProps = ChakraFormControlProps & { - label?: string; - helperText?: string; - error?: string; - feature?: Feature; - renderInfoPopoverInPortal?: boolean; - labelProps?: Omit< - InvLabelProps, - 'children' | 'feature' | 'renderInfoPopoverInPortal' - >; -}; - -export type InvLabelProps = ChakraFormLabelProps & { - feature?: Feature; - renderInfoPopoverInPortal?: boolean; -}; diff --git a/invokeai/frontend/web/src/common/components/InvEditable/InvEditable.stories.tsx b/invokeai/frontend/web/src/common/components/InvEditable/InvEditable.stories.tsx deleted file mode 100644 index 54589ab246..0000000000 --- a/invokeai/frontend/web/src/common/components/InvEditable/InvEditable.stories.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvEditableProps } from './types'; -import { InvEditable, InvEditableInput, InvEditablePreview } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvEditable', - tags: ['autodocs'], - component: InvEditable, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvEditableProps) => { - return ( - - - - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvEditable/theme.ts b/invokeai/frontend/web/src/common/components/InvEditable/theme.ts deleted file mode 100644 index 0577766e9e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvEditable/theme.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { editableAnatomy as parts } from '@chakra-ui/anatomy'; -import { - createMultiStyleConfigHelpers, - defineStyle, -} from '@chakra-ui/styled-system'; - -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys); - -const baseStylePreview = defineStyle({ - fontSize: 'sm', - borderRadius: 'md', - py: '1', - transitionProperty: 'common', - transitionDuration: 'normal', - color: 'base.100', - _invalid: { - color: 'error.300', - }, -}); - -const baseStyleInput = defineStyle(() => ({ - color: 'base.100', - fontSize: 'sm', - borderRadius: 'md', - py: '1', - transitionProperty: 'common', - transitionDuration: 'normal', - width: 'full', - _focusVisible: { boxShadow: 'none' }, - _placeholder: { opacity: 0.6 }, - '::selection': { - color: 'blue.900', - bg: 'blue.300', - }, -})); - -const baseStyleTextarea = defineStyle({ - borderRadius: 'md', - py: '1', - transitionProperty: 'common', - transitionDuration: 'normal', - width: 'full', - _focusVisible: { boxShadow: 'outline' }, - _placeholder: { opacity: 0.6 }, -}); - -const invokeAI = definePartsStyle(() => ({ - preview: baseStylePreview, - input: baseStyleInput(), - textarea: baseStyleTextarea, -})); - -export const editableTheme = defineMultiStyleConfig({ - variants: { - invokeAI, - }, - defaultProps: { - size: 'sm', - variant: 'invokeAI', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvEditable/types.ts b/invokeai/frontend/web/src/common/components/InvEditable/types.ts deleted file mode 100644 index 654c998bf9..0000000000 --- a/invokeai/frontend/web/src/common/components/InvEditable/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { - EditableInputProps as InvEditableInputProps, - EditablePreviewProps as InvEditablePreviewProps, - EditableProps as InvEditableProps, - EditableTextareaProps as InvEditableTextareaProps, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvEditable/wrapper.ts b/invokeai/frontend/web/src/common/components/InvEditable/wrapper.ts deleted file mode 100644 index f68210e140..0000000000 --- a/invokeai/frontend/web/src/common/components/InvEditable/wrapper.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { - Editable as InvEditable, - EditableInput as InvEditableInput, - EditablePreview as InvEditablePreview, - EditableTextarea as InvEditableTextarea, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvExpander/InvExpander.stories.tsx b/invokeai/frontend/web/src/common/components/InvExpander/InvExpander.stories.tsx deleted file mode 100644 index 787d46fa28..0000000000 --- a/invokeai/frontend/web/src/common/components/InvExpander/InvExpander.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import { InvExpander } from './InvExpander'; -import type { InvExpanderProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvExpander', - tags: ['autodocs'], - component: InvExpander, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvExpanderProps) => { - return Invoke; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvExpander/InvExpander.tsx b/invokeai/frontend/web/src/common/components/InvExpander/InvExpander.tsx deleted file mode 100644 index 409fc98572..0000000000 --- a/invokeai/frontend/web/src/common/components/InvExpander/InvExpander.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { Divider, Flex } from '@chakra-ui/layout'; -import type { SystemStyleObject } from '@chakra-ui/react'; -import { Collapse, Icon, useDisclosure } from '@chakra-ui/react'; -import { useAppDispatch } from 'app/store/storeHooks'; -import type { InvExpanderProps } from 'common/components/InvExpander/types'; -import { InvText } from 'common/components/InvText/wrapper'; -import { expanderToggled } from 'features/parameters/store/actions'; -import { t } from 'i18next'; -import { useCallback } from 'react'; -import { BiCollapseVertical, BiExpandVertical } from 'react-icons/bi'; - -const buttonStyles: SystemStyleObject = { - color: 'base.400', - borderColor: 'base.400', - transitionDuration: 'normal', - transitionProperty: 'common', - ':hover, :hover *': { - transitionDuration: 'normal', - transitionProperty: 'common', - color: 'base.300', - borderColor: 'base.300', - }, -}; - -export const InvExpander = ({ - children, - label = t('common.advancedOptions'), - defaultIsOpen = false, - id, -}: InvExpanderProps) => { - const { isOpen, onToggle } = useDisclosure({ defaultIsOpen }); - const dispatch = useAppDispatch(); - - const onToggleExpander = useCallback(() => { - if (id) { - dispatch(expanderToggled({ id, isOpen })); - } - - onToggle(); - }, [id, dispatch, onToggle, isOpen]); - - return ( - - - - - - - {label} - - - - - {children} - - - ); -}; diff --git a/invokeai/frontend/web/src/common/components/InvExpander/types.ts b/invokeai/frontend/web/src/common/components/InvExpander/types.ts deleted file mode 100644 index 8017461706..0000000000 --- a/invokeai/frontend/web/src/common/components/InvExpander/types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PropsWithChildren } from 'react'; - -export type InvExpanderProps = PropsWithChildren<{ - label?: string; - defaultIsOpen?: boolean; - id?: string; -}>; diff --git a/invokeai/frontend/web/src/common/components/InvHeading/InvHeading.stories.tsx b/invokeai/frontend/web/src/common/components/InvHeading/InvHeading.stories.tsx deleted file mode 100644 index f8f779522e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvHeading/InvHeading.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvHeadingProps } from './types'; -import { InvHeading } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvHeading', - tags: ['autodocs'], - component: InvHeading, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvHeadingProps) => { - return Banana sushi is delectable!; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvHeading/theme.ts b/invokeai/frontend/web/src/common/components/InvHeading/theme.ts deleted file mode 100644 index 73c0eecdc5..0000000000 --- a/invokeai/frontend/web/src/common/components/InvHeading/theme.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { defineStyle, defineStyleConfig } from '@chakra-ui/react'; - -const invokeBlue = defineStyle(() => ({ - color: 'invokeBlue.300', -})); - -export const headingTheme = defineStyleConfig({ - variants: { - invokeBlue, - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvHeading/types.ts b/invokeai/frontend/web/src/common/components/InvHeading/types.ts deleted file mode 100644 index 5d6549409f..0000000000 --- a/invokeai/frontend/web/src/common/components/InvHeading/types.ts +++ /dev/null @@ -1 +0,0 @@ -export type { HeadingProps as InvHeadingProps } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvHeading/wrapper.ts b/invokeai/frontend/web/src/common/components/InvHeading/wrapper.ts deleted file mode 100644 index d0f7b705ad..0000000000 --- a/invokeai/frontend/web/src/common/components/InvHeading/wrapper.ts +++ /dev/null @@ -1 +0,0 @@ -export { Heading as InvHeading } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvIconButton/InvIconButton.stories.tsx b/invokeai/frontend/web/src/common/components/InvIconButton/InvIconButton.stories.tsx deleted file mode 100644 index 9348f516b3..0000000000 --- a/invokeai/frontend/web/src/common/components/InvIconButton/InvIconButton.stories.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { FaBoltLightning } from 'react-icons/fa6'; - -import { InvIconButton } from './InvIconButton'; -import type { InvIconButtonProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvIconButton', - tags: ['autodocs'], - component: InvIconButton, - args: { - icon: , - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvIconButtonProps) => { - return ; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvIconButton/InvIconButton.tsx b/invokeai/frontend/web/src/common/components/InvIconButton/InvIconButton.tsx deleted file mode 100644 index 6bddb79e2b..0000000000 --- a/invokeai/frontend/web/src/common/components/InvIconButton/InvIconButton.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { forwardRef, IconButton } from '@chakra-ui/react'; -import type { InvIconButtonProps } from 'common/components/InvIconButton/types'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; -import { memo } from 'react'; - -export const InvIconButton = memo( - forwardRef( - ({ isChecked, tooltip, ...rest }: InvIconButtonProps, ref) => { - if (tooltip) { - return ( - - - - ); - } - - return ( - - ); - } - ) -); - -InvIconButton.displayName = 'InvIconButton'; diff --git a/invokeai/frontend/web/src/common/components/InvIconButton/types.ts b/invokeai/frontend/web/src/common/components/InvIconButton/types.ts deleted file mode 100644 index a6d77592f8..0000000000 --- a/invokeai/frontend/web/src/common/components/InvIconButton/types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IconButtonProps as ChakraIconButtonProps } from '@chakra-ui/react'; -import type { ReactNode } from 'react'; - -export type InvIconButtonProps = ChakraIconButtonProps & { - isChecked?: boolean; - tooltip?: ReactNode; -}; diff --git a/invokeai/frontend/web/src/common/components/InvInput/InvInput.stories.tsx b/invokeai/frontend/web/src/common/components/InvInput/InvInput.stories.tsx deleted file mode 100644 index fb202cc012..0000000000 --- a/invokeai/frontend/web/src/common/components/InvInput/InvInput.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import { InvInput } from './InvInput'; -import type { InvInputProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvInput', - tags: ['autodocs'], - component: InvInput, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvInputProps) => { - return ; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvInput/InvInput.tsx b/invokeai/frontend/web/src/common/components/InvInput/InvInput.tsx deleted file mode 100644 index 21018faa0c..0000000000 --- a/invokeai/frontend/web/src/common/components/InvInput/InvInput.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { forwardRef, Input } from '@chakra-ui/react'; -import { useGlobalModifiersSetters } from 'common/hooks/useGlobalModifiers'; -import { stopPastePropagation } from 'common/util/stopPastePropagation'; -import type { KeyboardEvent } from 'react'; -import { memo, useCallback } from 'react'; - -import type { InvInputProps } from './types'; - -export const InvInput = memo( - forwardRef((props: InvInputProps, ref) => { - const { setShift } = useGlobalModifiersSetters(); - const onKeyUpDown = useCallback( - (e: KeyboardEvent) => { - setShift(e.shiftKey); - }, - [setShift] - ); - return ( - - ); - }) -); - -InvInput.displayName = 'InvInput'; diff --git a/invokeai/frontend/web/src/common/components/InvInput/theme.ts b/invokeai/frontend/web/src/common/components/InvInput/theme.ts deleted file mode 100644 index 2352eb6258..0000000000 --- a/invokeai/frontend/web/src/common/components/InvInput/theme.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { inputAnatomy as parts } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system'; -import { getInputFilledStyles } from 'theme/util/getInputFilledStyles'; - -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys); - -export const inputTheme = defineMultiStyleConfig({ - variants: { - filled: definePartsStyle((props) => ({ - field: getInputFilledStyles(props), - })), - darkFilled: definePartsStyle((props) => ({ - field: getInputFilledStyles(props), - })), - }, - defaultProps: { - size: 'sm', - variant: 'filled', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvInput/types.ts b/invokeai/frontend/web/src/common/components/InvInput/types.ts deleted file mode 100644 index 1b032c1b1e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvInput/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { InputProps as ChakraInputProps } from '@chakra-ui/react'; - -export type InvInputProps = ChakraInputProps; diff --git a/invokeai/frontend/web/src/common/components/InvMenu/InvMenu.stories.tsx b/invokeai/frontend/web/src/common/components/InvMenu/InvMenu.stories.tsx deleted file mode 100644 index 787401d190..0000000000 --- a/invokeai/frontend/web/src/common/components/InvMenu/InvMenu.stories.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { ChevronDownIcon } from '@chakra-ui/icons'; -import type { Meta, StoryObj } from '@storybook/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { FaCopy, FaDownload, FaTrash } from 'react-icons/fa6'; - -import { InvMenuItem } from './InvMenuItem'; -import { InvMenuList } from './InvMenuList'; -import type { InvMenuProps } from './types'; -import { InvMenu, InvMenuButton, InvMenuGroup } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvMenu', - tags: ['autodocs'], - component: InvMenu, - args: { - colorScheme: 'base', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvMenuProps) => { - return ( - - }> - Actions - - - - } command="⌘S"> - Download - - } command="⌘C"> - Create a Copy - - Mark as Draft - } isDestructive> - Delete - - Attend a Workshop - - - } command="⌘S"> - Download - - } command="⌘C"> - Create a Copy - - Mark as Draft - } isDestructive> - Delete - - Attend a Workshop - - - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvMenu/InvMenuItem.tsx b/invokeai/frontend/web/src/common/components/InvMenu/InvMenuItem.tsx deleted file mode 100644 index 687730c464..0000000000 --- a/invokeai/frontend/web/src/common/components/InvMenu/InvMenuItem.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { SpinnerIcon } from '@chakra-ui/icons'; -import { forwardRef, MenuItem as ChakraMenuItem } from '@chakra-ui/react'; -import { memo } from 'react'; -import { spinAnimation } from 'theme/animations'; - -import type { InvMenuItemProps } from './types'; - -export const InvMenuItem = memo( - forwardRef( - (props: InvMenuItemProps, ref) => { - const { - isDestructive = false, - isLoading = false, - isDisabled, - icon, - ...rest - } = props; - return ( - : icon} - isDisabled={isLoading || isDisabled} - data-destructive={isDestructive} - {...rest} - /> - ); - } - ) -); - -InvMenuItem.displayName = 'InvMenuItem'; diff --git a/invokeai/frontend/web/src/common/components/InvMenu/InvMenuList.tsx b/invokeai/frontend/web/src/common/components/InvMenu/InvMenuList.tsx deleted file mode 100644 index 61b7461b9d..0000000000 --- a/invokeai/frontend/web/src/common/components/InvMenu/InvMenuList.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { - forwardRef, - MenuList as ChakraMenuList, - Portal, -} from '@chakra-ui/react'; -import { skipMouseEvent } from 'common/util/skipMouseEvent'; -import { memo } from 'react'; - -import { menuListMotionProps } from './constants'; -import type { InvMenuListProps } from './types'; - -export const InvMenuList = memo( - forwardRef( - (props: InvMenuListProps, ref) => { - return ( - - - - ); - } - ) -); - -InvMenuList.displayName = 'InvMenuList'; diff --git a/invokeai/frontend/web/src/common/components/InvMenu/constants.ts b/invokeai/frontend/web/src/common/components/InvMenu/constants.ts deleted file mode 100644 index 8c554ac2f1..0000000000 --- a/invokeai/frontend/web/src/common/components/InvMenu/constants.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { MotionProps } from 'framer-motion'; - -/** - * Props for the animation of the MenuList. - */ -export const menuListMotionProps: MotionProps = { - variants: { - enter: { - visibility: 'visible', - opacity: 1, - scale: 1, - transition: { - duration: 0.07, - ease: [0.4, 0, 0.2, 1], - }, - }, - exit: { - transitionEnd: { - visibility: 'hidden', - }, - opacity: 0, - scale: 0.8, - transition: { - duration: 0.07, - easings: 'easeOut', - }, - }, - }, -}; diff --git a/invokeai/frontend/web/src/common/components/InvMenu/theme.ts b/invokeai/frontend/web/src/common/components/InvMenu/theme.ts deleted file mode 100644 index c8ffa99d26..0000000000 --- a/invokeai/frontend/web/src/common/components/InvMenu/theme.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { menuAnatomy } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers } from '@chakra-ui/react'; - -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(menuAnatomy.keys); - -// define the base component styles -const invokeAI = definePartsStyle(() => ({ - // define the part you're going to style - button: { - // this will style the MenuButton component - bg: 'base.500', - color: 'base.100', - _hover: { - bg: 'base.600', - color: 'base.50', - fontWeight: 'semibold', - }, - }, - list: { - zIndex: 9999, - color: 'base.150', - bg: 'base.800', - shadow: 'dark-lg', - border: 'none', - p: 2, - }, - item: { - // this will style the MenuItem and MenuItemOption components - borderRadius: 'sm', - fontSize: 'sm', - bg: 'base.800', - _hover: { - bg: 'base.700', - svg: { - opacity: 1, - }, - }, - _focus: { - bg: 'base.700', - }, - svg: { - opacity: 0.7, - fontSize: 14, - }, - "&[data-destructive='true']": { - color: 'error.300', - fill: 'error.300', - _hover: { - bg: 'error.600', - color: 'base.50', - fill: 'base.50', - }, - }, - "&[aria-selected='true']": { - fontWeight: 'semibold', - bg: 'blue.300 !important', - color: 'base.800 !important', - _hover: { - color: 'base.900 !important', - bg: 'blue.400 !important', - }, - }, - "&[aria-selected='true'] [data-option-desc='true']": { - color: 'base.800', - }, - }, - divider: { - borderColor: 'base.700', - }, - groupTitle: { - m: 0, - px: 3, - py: 2, - color: 'base.500', - }, -})); - -export const menuTheme = defineMultiStyleConfig({ - variants: { - invokeAI, - }, - defaultProps: { - variant: 'invokeAI', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvMenu/types.ts b/invokeai/frontend/web/src/common/components/InvMenu/types.ts deleted file mode 100644 index 4d2aba2662..0000000000 --- a/invokeai/frontend/web/src/common/components/InvMenu/types.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { - MenuButtonProps as ChakraMenuButtonProps, - MenuDividerProps as ChakraMenuDividerProps, - MenuGroupProps as ChakraMenuGroupProps, - MenuItemOptionProps as ChakraMenuItemOptionProps, - MenuItemProps as ChakraMenuItemProps, - MenuListProps as ChakraMenuListProps, - MenuOptionGroupProps as ChakraMenuOptionGroupProps, - MenuProps as ChakraMenuProps, -} from '@chakra-ui/react'; - -export type InvMenuProps = ChakraMenuProps; -export type InvMenuButtonProps = ChakraMenuButtonProps; -export type InvMenuListProps = ChakraMenuListProps; -export type InvMenuItemProps = ChakraMenuItemProps & { - isDestructive?: boolean; - isLoading?: boolean; -}; -export type InvMenuItemOptionProps = ChakraMenuItemOptionProps; -export type InvMenuGroupProps = ChakraMenuGroupProps; -export type InvMenuOptionGroupProps = ChakraMenuOptionGroupProps; -export type InvMenuDividerProps = ChakraMenuDividerProps; diff --git a/invokeai/frontend/web/src/common/components/InvMenu/wrapper.ts b/invokeai/frontend/web/src/common/components/InvMenu/wrapper.ts deleted file mode 100644 index 5d00069872..0000000000 --- a/invokeai/frontend/web/src/common/components/InvMenu/wrapper.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { - Menu as InvMenu, - MenuButton as InvMenuButton, - MenuDivider as InvMenuDivider, - MenuGroup as InvMenuGroup, - MenuItemOption as InvMenuItemOption, - MenuOptionGroup as InvMenuOptionGroup, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvModal/InvModal.stories.tsx b/invokeai/frontend/web/src/common/components/InvModal/InvModal.stories.tsx deleted file mode 100644 index 731c74bed4..0000000000 --- a/invokeai/frontend/web/src/common/components/InvModal/InvModal.stories.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { useDisclosure } from '@chakra-ui/react'; -import type { Meta, StoryObj } from '@storybook/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; - -import { - InvModal, - InvModalBody, - InvModalCloseButton, - InvModalContent, - InvModalFooter, - InvModalHeader, - InvModalOverlay, -} from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvModal', - tags: ['autodocs'], - component: InvModal, - args: { - colorScheme: 'base', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = () => { - const { isOpen, onOpen, onClose } = useDisclosure(); - return ( - <> - Open Modal - - - - - Modal Title - - - Slices of banana are caramelized with brown sugar and butter, then - rolled in sushi rice and topped with a drizzle of caramel sauce. - This variety offers a sweet and rich flavor, combining the - creaminess of banana with the indulgent taste of caramel. - - - - - Close - - - Secondary Action - - - - - > - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvModal/theme.ts b/invokeai/frontend/web/src/common/components/InvModal/theme.ts deleted file mode 100644 index f68503fcbb..0000000000 --- a/invokeai/frontend/web/src/common/components/InvModal/theme.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { modalAnatomy as parts } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system'; - -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys); - -export const baseStyle = definePartsStyle(() => ({ - overlay: { - bg: 'blackAlpha.700', - }, - dialogContainer: {}, - dialog: { - maxH: '80vh', - bg: 'base.800', - }, - header: { - fontWeight: 'semibold', - fontSize: 'lg', - color: 'base.300', - }, - closeButton: { - opacity: 0.5, - }, - body: { - overflowY: 'scroll', - }, - footer: {}, -})); - -export const modalTheme = defineMultiStyleConfig({ - baseStyle, - defaultProps: { size: 'lg' }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvModal/types.ts b/invokeai/frontend/web/src/common/components/InvModal/types.ts deleted file mode 100644 index 768a491614..0000000000 --- a/invokeai/frontend/web/src/common/components/InvModal/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type { - ModalBody as InvModalBodyProps, - ModalCloseButton as InvModalCloseButtonProps, - ModalContent as InvModalContentProps, - ModalFooter as InvModalFooterProps, - ModalHeader as InvModalHeaderProps, - ModalOverlay as InvModalOverlayProps, - Modal as InvModalProps, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvModal/wrapper.ts b/invokeai/frontend/web/src/common/components/InvModal/wrapper.ts deleted file mode 100644 index 4074de9577..0000000000 --- a/invokeai/frontend/web/src/common/components/InvModal/wrapper.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { - Modal as InvModal, - ModalBody as InvModalBody, - ModalCloseButton as InvModalCloseButton, - ModalContent as InvModalContent, - ModalFooter as InvModalFooter, - ModalHeader as InvModalHeader, - ModalOverlay as InvModalOverlay, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.stories.tsx b/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.stories.tsx deleted file mode 100644 index 25ea3fd227..0000000000 --- a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.stories.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { useState } from 'react'; - -import { InvNumberInput } from './InvNumberInput'; -import type { InvNumberInputProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvNumberInput', - tags: ['autodocs'], - component: InvNumberInput, - args: { - min: -10, - max: 10, - step: 1, - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvNumberInputProps) => { - const [value, setValue] = useState(0); - return ; -}; - -export const Default: Story = { - render: Component, - args: { fineStep: 0.1 }, -}; - -export const Integer: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.tsx b/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.tsx deleted file mode 100644 index 4f98bd6a81..0000000000 --- a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { forwardRef, NumberInput as ChakraNumberInput } from '@chakra-ui/react'; -import { useStore } from '@nanostores/react'; -import { $shift } from 'common/hooks/useGlobalModifiers'; -import { roundToMultiple } from 'common/util/roundDownToMultiple'; -import { stopPastePropagation } from 'common/util/stopPastePropagation'; -import { clamp } from 'lodash-es'; -import type { FocusEventHandler } from 'react'; -import { memo, useCallback, useEffect, useMemo, useState } from 'react'; - -import { InvNumberInputField } from './InvNumberInputField'; -import { InvNumberInputStepper } from './InvNumberInputStepper'; -import type { InvNumberInputProps } from './types'; - -const isValidCharacter = (char: string) => /^[0-9\-.]$/i.test(char); - -export const InvNumberInput = memo( - forwardRef( - (props: InvNumberInputProps, ref) => { - const { - value, - min = 0, - max, - step: _step = 1, - fineStep: _fineStep, - onChange: _onChange, - numberInputFieldProps, - defaultValue, - ...rest - } = props; - - const [valueAsString, setValueAsString] = useState(String(value)); - const [valueAsNumber, setValueAsNumber] = useState(value); - const shift = useStore($shift); - const step = useMemo( - () => (shift ? _fineStep ?? _step : _step), - [shift, _fineStep, _step] - ); - const isInteger = useMemo( - () => Number.isInteger(_step) && Number.isInteger(_fineStep ?? 1), - [_step, _fineStep] - ); - - const inputMode = useMemo( - () => (isInteger ? 'numeric' : 'decimal'), - [isInteger] - ); - - const precision = useMemo(() => (isInteger ? 0 : 3), [isInteger]); - - const onChange = useCallback( - (valueAsString: string, valueAsNumber: number) => { - setValueAsString(valueAsString); - if (isNaN(valueAsNumber)) { - return; - } - setValueAsNumber(valueAsNumber); - _onChange(valueAsNumber); - }, - [_onChange] - ); - - // This appears to be unnecessary? Cannot figure out what it did but leaving it here in case - // it was important. - // const onClickStepper = useCallback( - // () => _onChange(Number(valueAsString)), - // [_onChange, valueAsString] - // ); - - const onBlur: FocusEventHandler = useCallback( - (e) => { - if (!e.target.value) { - // If the input is empty, we set it to the minimum value - onChange(String(defaultValue ?? min), Number(defaultValue) ?? min); - } else { - // Otherwise, we round the value to the nearest multiple if integer, else 3 decimals - const roundedValue = isInteger - ? roundToMultiple(valueAsNumber, _fineStep ?? _step) - : Number(valueAsNumber.toFixed(precision)); - // Clamp to min/max - const clampedValue = clamp(roundedValue, min, max); - onChange(String(clampedValue), clampedValue); - } - }, - [ - _fineStep, - _step, - defaultValue, - isInteger, - max, - min, - onChange, - precision, - valueAsNumber, - ] - ); - - /** - * When `value` changes (e.g. from a diff source than this component), we need - * to update the internal `valueAsString`, but only if the actual value is different - * from the current value. - */ - useEffect(() => { - if (value !== valueAsNumber) { - setValueAsString(String(value)); - setValueAsNumber(value); - } - }, [value, valueAsNumber]); - - return ( - - - - - ); - } - ) -); - -InvNumberInput.displayName = 'InvNumberInput'; diff --git a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInputField.tsx b/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInputField.tsx deleted file mode 100644 index bd453f5d3e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInputField.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { NumberInputField as ChakraNumberInputField } from '@chakra-ui/react'; -import { useGlobalModifiersSetters } from 'common/hooks/useGlobalModifiers'; -import type { KeyboardEventHandler } from 'react'; -import { memo, useCallback } from 'react'; - -import type { InvNumberInputFieldProps } from './types'; - -export const InvNumberInputField = memo((props: InvNumberInputFieldProps) => { - const { onKeyUp, onKeyDown, children, ...rest } = props; - const { setShift } = useGlobalModifiersSetters(); - - const _onKeyUp: KeyboardEventHandler = useCallback( - (e) => { - onKeyUp?.(e); - setShift(e.key === 'Shift'); - }, - [onKeyUp, setShift] - ); - const _onKeyDown: KeyboardEventHandler = useCallback( - (e) => { - onKeyDown?.(e); - setShift(e.key === 'Shift'); - }, - [onKeyDown, setShift] - ); - - return ( - - {children} - - ); -}); - -InvNumberInputField.displayName = 'InvNumberInputField'; diff --git a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInputStepper.tsx b/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInputStepper.tsx deleted file mode 100644 index 247b42f7da..0000000000 --- a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInputStepper.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { ChevronDownIcon, ChevronUpIcon } from '@chakra-ui/icons'; -import { - forwardRef, - NumberDecrementStepper as ChakraNumberDecrementStepper, - NumberIncrementStepper as ChakraNumberIncrementStepper, - NumberInputStepper as ChakraNumberInputStepper, -} from '@chakra-ui/react'; -import { memo } from 'react'; - -import type { InvNumberInputStepperProps } from './types'; - -export const InvNumberInputStepper = memo( - forwardRef( - (props: InvNumberInputStepperProps, ref) => { - return ( - - - - - - - - - ); - } - ) -); - -InvNumberInputStepper.displayName = 'InvNumberInputStepper'; diff --git a/invokeai/frontend/web/src/common/components/InvNumberInput/theme.ts b/invokeai/frontend/web/src/common/components/InvNumberInput/theme.ts deleted file mode 100644 index a35928b77b..0000000000 --- a/invokeai/frontend/web/src/common/components/InvNumberInput/theme.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { numberInputAnatomy as parts } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system'; -import { getInputFilledStyles } from 'theme/util/getInputFilledStyles'; -import { getInputOutlineStyles } from 'theme/util/getInputOutlineStyles'; - -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys); - -const invokeAI = definePartsStyle(() => ({ - root: { - // height: 8, - }, - field: { - border: 'none', - fontWeight: 'semibold', - height: 'auto', - py: 1, - ps: 2, - pe: 6, - ...getInputOutlineStyles(), - }, - stepperGroup: { - display: 'flex', - }, - stepper: { - border: 'none', - svg: { - color: 'base.300', - width: 2.5, - height: 2.5, - _hover: { - color: 'base.100', - }, - }, - }, -})); - -const filled = definePartsStyle((props) => { - return { - root: { h: '28px' }, - field: { ...getInputFilledStyles(props), pe: 6, h: 'full' }, - stepperGroup: { - border: 'none', - w: 6, - }, - stepper: { - color: 'base.200', - _hover: { - bg: 'base.700', - color: 'base.100', - }, - _disabled: { - _hover: { - bg: 'base.800', - color: 'base.200', - }, - }, - _first: { - border: 'none', - margin: 0, - borderTopEndRadius: 'base', - borderBottomStartRadius: 'base', - }, - _last: { - border: 'none', - margin: 0, - borderBottomEndRadius: 'base', - borderTopStartRadius: 'base', - }, - }, - }; -}); - -export const numberInputTheme = defineMultiStyleConfig({ - variants: { - invokeAI, - filled, - darkFilled: filled, - }, - defaultProps: { - size: 'sm', - variant: 'filled', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvNumberInput/types.ts b/invokeai/frontend/web/src/common/components/InvNumberInput/types.ts deleted file mode 100644 index 74f4dccfe3..0000000000 --- a/invokeai/frontend/web/src/common/components/InvNumberInput/types.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { - NumberDecrementStepperProps as ChakraNumberDecrementStepperProps, - NumberIncrementStepperProps as ChakraNumberIncrementStepperProps, - NumberInputFieldProps as ChakraNumberInputFieldProps, - NumberInputProps as ChakraNumberInputProps, - NumberInputStepperProps as ChakraNumberInputStepperProps, -} from '@chakra-ui/react'; - -export type InvNumberInputFieldProps = ChakraNumberInputFieldProps; -export type InvNumberInputStepperProps = ChakraNumberInputStepperProps; -export type InvNumberIncrementStepperProps = ChakraNumberIncrementStepperProps; -export type InvNumberDecrementStepperProps = ChakraNumberDecrementStepperProps; - -export type InvNumberInputProps = Omit< - ChakraNumberInputProps, - 'onChange' | 'min' | 'max' -> & { - /** - * The value - */ - value: number; - /** - * The minimum value - */ - min: number; - /** - * The maximum value - */ - max: number; - /** - * The default step - */ - step?: number; - /** - * The fine step (used when shift is pressed) - */ - fineStep?: number; - /** - * The change handler - */ - onChange: (v: number) => void; - /** - * Override props for the Chakra NumberInputField component - */ - numberInputFieldProps?: InvNumberInputFieldProps; -}; diff --git a/invokeai/frontend/web/src/common/components/InvPopover/InvPopover.stories.tsx b/invokeai/frontend/web/src/common/components/InvPopover/InvPopover.stories.tsx deleted file mode 100644 index 056b179af3..0000000000 --- a/invokeai/frontend/web/src/common/components/InvPopover/InvPopover.stories.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; - -import { - InvPopover, - InvPopoverArrow, - InvPopoverBody, - InvPopoverCloseButton, - InvPopoverContent, - InvPopoverHeader, - InvPopoverTrigger, -} from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvPopover', - tags: ['autodocs'], - component: InvPopover, - args: { - colorScheme: 'base', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = () => { - return ( - - - Trigger - - - - - Confirmation! - - Are you sure you want to have that milkshake? - - - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvPopover/theme.ts b/invokeai/frontend/web/src/common/components/InvPopover/theme.ts deleted file mode 100644 index b32ae753c5..0000000000 --- a/invokeai/frontend/web/src/common/components/InvPopover/theme.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { popoverAnatomy as parts } from '@chakra-ui/anatomy'; -import { - createMultiStyleConfigHelpers, - defineStyle, -} from '@chakra-ui/styled-system'; -import { cssVar } from '@chakra-ui/theme-tools'; - -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys); - -const $popperBg = cssVar('popper-bg'); -const $arrowBg = cssVar('popper-arrow-bg'); -const $arrowShadowColor = cssVar('popper-arrow-shadow-color'); - -const invokeAIContent = defineStyle(() => { - return { - [$arrowBg.variable]: 'colors.base.800', - [$popperBg.variable]: 'colors.base.800', - [$arrowShadowColor.variable]: 'colors.base.600', - minW: 'unset', - width: 'unset', - p: 4, - bg: 'base.800', - border: 'none', - shadow: 'dark-lg', - }; -}); - -const informationalContent = defineStyle(() => { - return { - [$arrowBg.variable]: 'colors.base.700', - [$popperBg.variable]: 'colors.base.700', - [$arrowShadowColor.variable]: 'colors.base.400', - p: 4, - bg: 'base.700', - border: 'none', - shadow: 'dark-lg', - }; -}); - -const invokeAI = definePartsStyle(() => ({ - content: invokeAIContent(), - body: { padding: 0 }, -})); - -const informational = definePartsStyle(() => ({ - content: informationalContent(), - body: { padding: 0 }, -})); - -export const popoverTheme = defineMultiStyleConfig({ - variants: { - invokeAI, - informational, - }, - defaultProps: { - variant: 'invokeAI', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvPopover/types.ts b/invokeai/frontend/web/src/common/components/InvPopover/types.ts deleted file mode 100644 index 62c38e2176..0000000000 --- a/invokeai/frontend/web/src/common/components/InvPopover/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type { - PopoverArrowProps as InvPopoverArrowProps, - PopoverBodyProps as InvPopoverBodyProps, - PopoverCloseButtonProps as InvPopoverCloseButtonProps, - PopoverContentProps as InvPopoverContentProps, - PopoverFooterProps as InvPopoverFooterProps, - PopoverHeaderProps as InvPopoverHeaderProps, - PopoverProps as InvPopoverProps, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvPopover/wrapper.ts b/invokeai/frontend/web/src/common/components/InvPopover/wrapper.ts deleted file mode 100644 index e0c3722fa8..0000000000 --- a/invokeai/frontend/web/src/common/components/InvPopover/wrapper.ts +++ /dev/null @@ -1,11 +0,0 @@ -export { - Popover as InvPopover, - PopoverAnchor as InvPopoverAnchor, - PopoverArrow as InvPopoverArrow, - PopoverBody as InvPopoverBody, - PopoverCloseButton as InvPopoverCloseButton, - PopoverContent as InvPopoverContent, - PopoverFooter as InvPopoverFooter, - PopoverHeader as InvPopoverHeader, - PopoverTrigger as InvPopoverTrigger, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvProgress/InvProgress.stories.tsx b/invokeai/frontend/web/src/common/components/InvProgress/InvProgress.stories.tsx deleted file mode 100644 index 0e669a5c22..0000000000 --- a/invokeai/frontend/web/src/common/components/InvProgress/InvProgress.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvProgressProps } from './types'; -import { InvProgress } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvProgress', - tags: ['autodocs'], - component: InvProgress, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvProgressProps) => { - return Banana sushi is delectable!; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvProgress/theme.ts b/invokeai/frontend/web/src/common/components/InvProgress/theme.ts deleted file mode 100644 index 4ca58154cb..0000000000 --- a/invokeai/frontend/web/src/common/components/InvProgress/theme.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { progressAnatomy as parts } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system'; -import { generateStripe, getColorVar } from '@chakra-ui/theme-tools'; - -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys); - -export const progressTheme = defineMultiStyleConfig({ - baseStyle: definePartsStyle( - ({ theme: t, colorScheme: c, hasStripe, isIndeterminate }) => { - const bgColor = `${c}.300`; - const addStripe = !isIndeterminate && hasStripe; - const gradient = `linear-gradient( - to right, - transparent 0%, - ${getColorVar(t, bgColor)} 50%, - transparent 100% - )`; - return { - track: { - borderRadius: '2px', - bg: 'base.800', - }, - filledTrack: { - borderRadius: '2px', - ...(addStripe && generateStripe()), - ...(isIndeterminate ? { bgImage: gradient } : { bgColor }), - }, - }; - } - ), -}); -// export const progressTheme = defineMultiStyleConfig({ -// baseStyle: definePartsStyle( -// ({ theme: t, colorScheme: c, hasStripe, isIndeterminate }) => { -// const bgColor = `${c}.500`; -// const addStripe = !isIndeterminate && hasStripe; -// const gradient = `linear-gradient( -// to right, -// transparent 0%, -// ${getColorVar(t, bgColor)} 50%, -// transparent 100% -// )`; -// return { -// track: { -// borderRadius: '2px', -// bg: 'base.800', -// }, -// filledTrack: { -// borderRadius: '2px', -// ...(addStripe && generateStripe("xs")), -// ...(isIndeterminate ? { bgImage: gradient } : { bgColor }), -// }, -// }; -// } -// ), -// }); diff --git a/invokeai/frontend/web/src/common/components/InvProgress/types.ts b/invokeai/frontend/web/src/common/components/InvProgress/types.ts deleted file mode 100644 index 63cdba071e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvProgress/types.ts +++ /dev/null @@ -1 +0,0 @@ -export type { ProgressProps as InvProgressProps } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvProgress/wrapper.ts b/invokeai/frontend/web/src/common/components/InvProgress/wrapper.ts deleted file mode 100644 index af331d945e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvProgress/wrapper.ts +++ /dev/null @@ -1 +0,0 @@ -export { Progress as InvProgress } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSlider.stories.tsx b/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSlider.stories.tsx deleted file mode 100644 index 88cc8110d4..0000000000 --- a/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSlider.stories.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import type { InvRangeSliderProps } from 'common/components/InvRangeSlider/types'; -import { useCallback, useState } from 'react'; - -import { InvRangeSlider } from './InvRangeSlider'; - -const meta: Meta = { - title: 'Primitives/InvRangeSlider', - tags: ['autodocs'], - component: InvRangeSlider, - args: { - min: 0, - max: 10, - step: 1, - marks: [0, 5, 10], - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvRangeSliderProps) => { - const [value, setValue] = useState<[number, number]>([2, 8]); - const onReset = useCallback(() => { - setValue([2, 8]); - }, []); - const onChange = useCallback((v: [number, number]) => { - setValue(v); - }, []); - return ( - - - - ); -}; - -export const Default: Story = { - render: Component, - args: { - fineStep: 0.1, - withThumbTooltip: true, - formatValue: (v: number) => `${v} eggs`, - }, -}; diff --git a/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSlider.tsx b/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSlider.tsx deleted file mode 100644 index 5ec2c65637..0000000000 --- a/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSlider.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import { - forwardRef, - RangeSlider as ChakraRangeSlider, - RangeSliderFilledTrack as ChakraRangeSliderFilledTrack, - RangeSliderThumb as ChakraRangeSliderThumb, - RangeSliderTrack as ChakraRangeSliderTrack, - useFormControl, -} from '@chakra-ui/react'; -import { useStore } from '@nanostores/react'; -import type { InvFormattedMark } from 'common/components/InvSlider/types'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; -import { $shift } from 'common/hooks/useGlobalModifiers'; -import { AnimatePresence } from 'framer-motion'; -import { memo, useCallback, useMemo, useState } from 'react'; - -import { InvRangeSliderMark } from './InvRangeSliderMark'; -import type { InvRangeSliderProps } from './types'; - -export const InvRangeSlider = memo( - forwardRef( - (props: InvRangeSliderProps, ref) => { - const { - value, - min, - max, - step: _step = 1, - fineStep: _fineStep, - onChange, - onReset, - formatValue = (v: number) => v.toString(), - marks: _marks, - withThumbTooltip: withTooltip = false, - ...sliderProps - } = props; - const [isMouseOverSlider, setIsMouseOverSlider] = useState(false); - const [isChanging, setIsChanging] = useState(false); - - const shift = useStore($shift); - const step = useMemo( - () => (shift ? _fineStep ?? _step : _step), - [shift, _fineStep, _step] - ); - const controlProps = useFormControl({}); - - const labels = useMemo( - () => value.map(formatValue), - [formatValue, value] - ); - - const onMouseEnter = useCallback(() => setIsMouseOverSlider(true), []); - const onMouseLeave = useCallback(() => setIsMouseOverSlider(false), []); - const onChangeStart = useCallback(() => setIsChanging(true), []); - const onChangeEnd = useCallback(() => setIsChanging(false), []); - - const marks = useMemo(() => { - if (_marks === true) { - return [min, max].map((m) => ({ value: m, label: formatValue(m) })); - } - if (_marks) { - return _marks?.map((m) => ({ value: m, label: formatValue(m) })); - } - return []; - }, [_marks, formatValue, max, min]); - - return ( - - - {marks?.length && - (isMouseOverSlider || isChanging) && - marks.map((m, i) => ( - - ))} - - - - - - - - - - - - - - ); - } - ) -); diff --git a/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSliderMark.tsx b/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSliderMark.tsx deleted file mode 100644 index ddb872ec30..0000000000 --- a/invokeai/frontend/web/src/common/components/InvRangeSlider/InvRangeSliderMark.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { RangeSliderMark as ChakraRangeSliderMark } from '@chakra-ui/react'; -import type { InvRangeSliderMarkProps } from 'common/components/InvRangeSlider/types'; -import { sliderMarkAnimationConstants } from 'common/components/InvSlider/InvSliderMark'; -import { motion } from 'framer-motion'; -import { memo } from 'react'; - -export const InvRangeSliderMark = memo( - ({ value, label, index, total }: InvRangeSliderMarkProps) => { - if (index === 0) { - return ( - - {label} - - ); - } - - if (index === total - 1) { - return ( - - {label} - - ); - } - - return ( - - {label} - - ); - } -); - -InvRangeSliderMark.displayName = 'InvRangeSliderMark'; diff --git a/invokeai/frontend/web/src/common/components/InvRangeSlider/theme.ts b/invokeai/frontend/web/src/common/components/InvRangeSlider/theme.ts deleted file mode 100644 index 720ab7eafa..0000000000 --- a/invokeai/frontend/web/src/common/components/InvRangeSlider/theme.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { sliderAnatomy as parts } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers, defineStyle } from '@chakra-ui/react'; - -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys); - -const container = defineStyle(() => ({})); - -const track = defineStyle(() => { - return { - bg: 'base.600', - h: 2, - }; -}); - -const filledTrack = defineStyle((_props) => { - return { - bg: 'base.400', - h: 2, - }; -}); - -const thumb = defineStyle(() => { - return { - w: 4, - h: 4, - bg: 'base.400', - borderRadius: 'base', - borderColor: 'base.200', - borderWidth: 2, - _hover: { - transform: `translateY(-50%) scale(1.15)`, - transition: 'transform 0.1s', - _active: { - transform: `translateY(-50%) scale(1.22)`, - transition: 'transform 0.05s', - }, - }, - }; -}); - -const mark = defineStyle(() => { - return { - fontSize: '10px', - color: 'base.400', - mt: 2, - }; -}); - -const baseStyle = definePartsStyle((props) => ({ - container: container(), - track: track(), - filledTrack: filledTrack(props), - thumb: thumb(), - mark: mark(), -})); - -export const sliderTheme = defineMultiStyleConfig({ - baseStyle, - defaultProps: { - colorScheme: 'base', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvRangeSlider/types.ts b/invokeai/frontend/web/src/common/components/InvRangeSlider/types.ts deleted file mode 100644 index 85706b9689..0000000000 --- a/invokeai/frontend/web/src/common/components/InvRangeSlider/types.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { RangeSliderProps as ChakraRangeSliderProps } from '@chakra-ui/react'; -import type { InvSliderMarkProps } from 'common/components/InvSlider/types'; - -export type InvRangeSliderProps = Omit & { - /** - * The value - */ - value: [number, number]; - /** - * The minimum value - */ - min: number; - /** - * The maximum value - */ - max: number; - /** - * The default step - */ - step?: number; - /** - * The fine step (when shift is pressed) - */ - fineStep?: number; - /** - * The change handler - */ - onChange: (v: [number, number]) => void; - /** - * The reset handler, called on double-click of the thumb - */ - onReset?: () => void; - /** - * The value formatter - */ - formatValue?: (v: number) => string; - /** - * Whether the slider is disabled - */ - isDisabled?: boolean; - /** - * The marks to render below the slider. If true, will use the min and max values. - */ - marks?: number[] | true; - /** - * Whether to show a tooltip over the slider thumb - */ - withThumbTooltip?: boolean; -}; - -export type InvRangeSliderMarkProps = InvSliderMarkProps; diff --git a/invokeai/frontend/web/src/common/components/InvSelect/CustomMenuList.tsx b/invokeai/frontend/web/src/common/components/InvSelect/CustomMenuList.tsx deleted file mode 100644 index f944447605..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSelect/CustomMenuList.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { Box } from '@chakra-ui/layout'; -import type { GroupBase, MenuListProps } from 'chakra-react-select'; -import { chakraComponents } from 'chakra-react-select'; -import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; -import { cloneDeep, merge } from 'lodash-es'; -import type { UseOverlayScrollbarsParams } from 'overlayscrollbars-react'; -import { useOverlayScrollbars } from 'overlayscrollbars-react'; -import type { PropsWithChildren } from 'react'; -import { memo, useEffect, useRef, useState } from 'react'; - -import type { InvSelectOption } from './types'; - -type CustomMenuListProps = MenuListProps< - InvSelectOption, - false, - GroupBase ->; - -const overlayScrollbarsParamsOverrides: Partial = { - options: { scrollbars: { autoHide: 'never' } }, -}; - -const osParams = merge( - cloneDeep(overlayScrollbarsParams), - overlayScrollbarsParamsOverrides -); - -const Scrollable = memo( - (props: PropsWithChildren<{ viewport: HTMLDivElement | null }>) => { - const { children, viewport } = props; - - const targetRef = useRef(null); - const [initialize, getInstance] = useOverlayScrollbars(osParams); - - useEffect(() => { - if (targetRef.current && viewport) { - initialize({ - target: targetRef.current, - elements: { - viewport, - }, - }); - } - return () => getInstance()?.destroy(); - }, [viewport, initialize, getInstance]); - - return ( - - {children} - - ); - } -); - -Scrollable.displayName = 'Scrollable'; - -export const CustomMenuList = memo( - ({ children, innerRef, ...other }: CustomMenuListProps) => { - const [viewport, setViewport] = useState(null); - - useEffect(() => { - if (!innerRef || !(innerRef instanceof Function)) { - return; - } - innerRef(viewport); - }, [innerRef, viewport]); - - return ( - - - {children} - - - ); - } -); - -CustomMenuList.displayName = 'CustomMenuList'; diff --git a/invokeai/frontend/web/src/common/components/InvSelect/CustomOption.tsx b/invokeai/frontend/web/src/common/components/InvSelect/CustomOption.tsx deleted file mode 100644 index e0372a4763..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSelect/CustomOption.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { Flex } from '@chakra-ui/layout'; -import type { GroupBase, OptionProps } from 'chakra-react-select'; -import { chakraComponents } from 'chakra-react-select'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; -import { memo } from 'react'; - -import type { InvSelectOption } from './types'; - -type CustomOptionProps = OptionProps< - InvSelectOption, - false, - GroupBase ->; - -export const CustomOption = memo( - ({ children, ...props }: CustomOptionProps) => { - // On large lists, perf really takes a hit :/ - // This improves it drastically and doesn't seem to break anything... - delete props.innerProps.onMouseMove; - delete props.innerProps.onMouseOver; - - if (props.data.icon) { - return ( - - - - - {props.data.icon} - - - {children} - {props.data.description && ( - - {props.data.description} - - )} - - - - - ); - } - - return ( - - - - {children} - {props.data.description && ( - - {props.data.description} - - )} - - - - ); - } -); - -CustomOption.displayName = 'CustomOption'; diff --git a/invokeai/frontend/web/src/common/components/InvSelect/InvSelect.stories.tsx b/invokeai/frontend/web/src/common/components/InvSelect/InvSelect.stories.tsx deleted file mode 100644 index 39f2b70f73..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSelect/InvSelect.stories.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { omit } from 'lodash-es'; - -import { InvSelect } from './InvSelect'; -import type { InvSelectOption, InvSelectProps } from './types'; - -const SELECT_STORY_OPTIONS: InvSelectOption[] = [ - { - value: 'chocolate', - label: 'Chocolate', - description: - 'Chocolate is a usually sweet, brown food preparation of roasted and ground cacao seeds. It is made in the form of a liquid, paste, or in a block, or used as a flavoring ingredient in other foods.', - icon: '🍫', - }, - { - value: 'strawberry', - label: 'Strawberry', - description: - 'Strawberries are bright red fruits with a sweet yet slightly tart taste. They are often enjoyed fresh but are also used in a variety of desserts and sauces.', - icon: '🍓', - }, - { - value: 'vanilla', - label: 'Vanilla', - description: - 'Vanilla is a popular flavor derived from orchids of the genus Vanilla. It is used in a variety of desserts and beverages for its sweet and creamy flavor.', - icon: '🍦', - }, -]; - -const meta: Meta = { - title: 'Primitives/InvSelect', - tags: ['autodocs'], - component: InvSelect, - args: { - options: SELECT_STORY_OPTIONS, - }, - argTypes: { - options: { - control: { - type: 'select', - }, - options: ['WithIcon', 'WithDescription', 'OnlyLabel'], - mapping: { - WithIcon: SELECT_STORY_OPTIONS, - WithDescription: SELECT_STORY_OPTIONS.map((o) => omit(o, 'icon')), - OnlyLabel: SELECT_STORY_OPTIONS.map((o) => - omit(o, ['icon', 'description']) - ), - }, - }, - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvSelectProps) => { - return ; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvSelect/InvSelect.tsx b/invokeai/frontend/web/src/common/components/InvSelect/InvSelect.tsx deleted file mode 100644 index 6d44e6bfed..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSelect/InvSelect.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import type { - GroupBase, - SelectComponentsConfig, - StylesConfig, -} from 'chakra-react-select'; -import { Select as ChakraReactSelect } from 'chakra-react-select'; -import { memo, useEffect, useMemo } from 'react'; - -import { CustomMenuList } from './CustomMenuList'; -import { CustomOption } from './CustomOption'; -import type { - CustomChakraStylesConfig, - InvSelectOption, - InvSelectProps, -} from './types'; - -const styles: StylesConfig = { - menuPortal: (provided) => ({ ...provided, zIndex: 9999 }), -}; - -const components: SelectComponentsConfig< - InvSelectOption, - false, - GroupBase -> = { - Option: CustomOption, - MenuList: CustomMenuList, - // Menu: CustomMenu, -}; - -export const InvSelect = memo((props: InvSelectProps) => { - const { sx, selectRef, inputRef, ...rest } = props; - const chakraStyles = useMemo( - () => ({ - container: (provided, _state) => ({ ...provided, w: 'full', ...sx }), - option: (provided, _state) => ({ ...provided, p: 0 }), - indicatorsContainer: (provided, _state) => ({ - ...provided, - w: 8, - alignItems: 'center', - justifyContent: 'center', - '> div': { p: 0, w: 'full', h: 'full', bg: 'unset' }, - }), - dropdownIndicator: (provided, _state) => ({ - ...provided, - display: - _state.hasValue && _state.selectProps.isClearable ? 'none' : 'flex', - }), - crossIcon: (provided, _state) => ({ ...provided, boxSize: 2.5 }), - inputContainer: (provided, _state) => ({ - ...provided, - cursor: 'pointer', - }), - }), - [sx] - ); - - useEffect(() => { - if (!inputRef) { - return; - } - inputRef.current = selectRef?.current?.inputRef ?? null; - }, [inputRef, selectRef]); - - return ( - > - ref={selectRef} - menuPortalTarget={document.body} - colorScheme="base" - selectedOptionColorScheme="base" - components={components} - chakraStyles={chakraStyles} - styles={styles} - variant="filled" - menuPosition="fixed" - {...rest} - /> - ); -}); - -InvSelect.displayName = 'InvSelect'; diff --git a/invokeai/frontend/web/src/common/components/InvSelect/InvSelectFallback.tsx b/invokeai/frontend/web/src/common/components/InvSelect/InvSelectFallback.tsx deleted file mode 100644 index fe95399653..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSelect/InvSelectFallback.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { Flex } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; -import { memo } from 'react'; - -import type { InvSelectFallbackProps } from './types'; - -export const InvSelectFallback = memo((props: InvSelectFallbackProps) => ( - - - {props.label} - - -)); - -InvSelectFallback.displayName = 'InvSelectFallback'; diff --git a/invokeai/frontend/web/src/common/components/InvSelect/theme.ts b/invokeai/frontend/web/src/common/components/InvSelect/theme.ts deleted file mode 100644 index eb3c0b3122..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSelect/theme.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This gets most of its styles from the native Chakra components it composes. - */ - -export default {}; diff --git a/invokeai/frontend/web/src/common/components/InvSelect/types.ts b/invokeai/frontend/web/src/common/components/InvSelect/types.ts deleted file mode 100644 index c52615c3fb..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSelect/types.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import type { - ChakraStylesConfig, - GroupBase, - OptionBase, - Props as ChakraReactSelectProps, - SelectInstance, - SingleValue, -} from 'chakra-react-select'; -import type { ReactNode } from 'react'; -export type {} from 'react-select/base'; - -export interface InvSelectOption extends OptionBase { - label: string; - value: string; - description?: string; - icon?: ReactNode; - tooltip?: string; - tags?: string[]; -} - -export type InvSelectProps = ChakraReactSelectProps< - InvSelectOption, - false, - GroupBase -> & { - sx?: ChakraProps['sx']; - selectRef?: React.RefObject< - SelectInstance> - >; - inputRef?: React.MutableRefObject; -}; -export type CustomChakraStylesConfig = ChakraStylesConfig< - InvSelectOption, - false, - GroupBase ->; - -export type InvSelectFallbackProps = { - label: string; -}; - -export type InvSelectOnChange = ( - v: SingleValue | null -) => void; diff --git a/invokeai/frontend/web/src/common/components/InvSingleAccordion/InvSingleAccordion.stories.tsx b/invokeai/frontend/web/src/common/components/InvSingleAccordion/InvSingleAccordion.stories.tsx deleted file mode 100644 index 0bbd8149da..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSingleAccordion/InvSingleAccordion.stories.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvTab } from 'common/components/InvTabs/InvTab'; -import { - InvTabList, - InvTabPanel, - InvTabPanels, - InvTabs, -} from 'common/components/InvTabs/wrapper'; -import { InvText } from 'common/components/InvText/wrapper'; - -import { InvSingleAccordion } from './InvSingleAccordion'; -import type { InvSingleAccordionProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvSingleAccordion', - tags: ['autodocs'], - component: InvSingleAccordion, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvSingleAccordionProps) => { - return ( - - - - Caramelized - Peanut Butter - Chocolate-Dipped - - - - - - Slices of banana are caramelized with brown sugar and butter, then - rolled in sushi rice and topped with a drizzle of caramel sauce. - This variety offers a sweet and rich flavor, combining the - creaminess of banana with the indulgent taste of caramel. - - - - - A combination of creamy peanut butter and ripe banana slices, - wrapped in sushi rice and seaweed. This sushi delivers a - satisfying balance of nutty and sweet flavors, appealing to those - who enjoy classic peanut butter and banana pairings. - - - - - Banana slices are dipped in melted dark chocolate, then rolled in - sushi rice and sprinkled with toasted sesame seeds. This type - provides a decadent chocolate experience with a hint of nuttiness - and the natural sweetness of banana. - - - - - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvSingleAccordion/InvSingleAccordion.tsx b/invokeai/frontend/web/src/common/components/InvSingleAccordion/InvSingleAccordion.tsx deleted file mode 100644 index 8e2825a6d0..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSingleAccordion/InvSingleAccordion.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { useAppDispatch } from 'app/store/storeHooks'; -import { InvAccordionButton } from 'common/components/InvAccordion/InvAccordionButton'; -import { - InvAccordion, - InvAccordionItem, - InvAccordionPanel, -} from 'common/components/InvAccordion/wrapper'; -import { singleAccordionExpanded } from 'features/parameters/store/actions'; -import { memo, useCallback } from 'react'; - -import type { InvSingleAccordionProps } from './types'; - -export const InvSingleAccordion = memo((props: InvSingleAccordionProps) => { - const dispatch = useAppDispatch(); - const handleAccordionClick = useCallback( - (isOpen: boolean) => { - if (props.id) { - dispatch(singleAccordionExpanded({ id: props.id, isOpen })); - } - }, - [props, dispatch] - ); - - return ( - - - {({ isExpanded }) => ( - <> - - {props.label} - - {props.children} - > - )} - - - ); -}); - -InvSingleAccordion.displayName = 'InvSingleAccordion'; diff --git a/invokeai/frontend/web/src/common/components/InvSingleAccordion/types.ts b/invokeai/frontend/web/src/common/components/InvSingleAccordion/types.ts deleted file mode 100644 index 2e763809e4..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSingleAccordion/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { PropsWithChildren } from 'react'; - -export type InvSingleAccordionProps = PropsWithChildren<{ - label: string; - badges?: (string | number)[]; - defaultIsOpen?: boolean; - id?: string; -}>; diff --git a/invokeai/frontend/web/src/common/components/InvSkeleton/InvSkeleton.stories.tsx b/invokeai/frontend/web/src/common/components/InvSkeleton/InvSkeleton.stories.tsx deleted file mode 100644 index 3866da4b85..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSkeleton/InvSkeleton.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvSkeletonProps } from './types'; -import { InvSkeleton } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvSkeleton', - tags: ['autodocs'], - component: InvSkeleton, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvSkeletonProps) => { - return Banana sushi is delectable!; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvSkeleton/theme.ts b/invokeai/frontend/web/src/common/components/InvSkeleton/theme.ts deleted file mode 100644 index 26313ca882..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSkeleton/theme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { cssVar, defineStyle, defineStyleConfig } from '@chakra-ui/react'; - -const $startColor = cssVar('skeleton-start-color'); -const $endColor = cssVar('skeleton-end-color'); - -const invokeAI = defineStyle({ - borderRadius: 'base', - maxW: 'full', - maxH: 'full', - [$startColor.variable]: 'colors.base.700', - [$endColor.variable]: 'colors.base.500', -}); - -export const skeletonTheme = defineStyleConfig({ - variants: { invokeAI }, - defaultProps: { - variant: 'invokeAI', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvSkeleton/types.ts b/invokeai/frontend/web/src/common/components/InvSkeleton/types.ts deleted file mode 100644 index 85fd635e3e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSkeleton/types.ts +++ /dev/null @@ -1 +0,0 @@ -export type { SkeletonProps as InvSkeletonProps } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvSkeleton/wrapper.ts b/invokeai/frontend/web/src/common/components/InvSkeleton/wrapper.ts deleted file mode 100644 index 4ea2c2c6d8..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSkeleton/wrapper.ts +++ /dev/null @@ -1 +0,0 @@ -export { Skeleton as InvSkeleton } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvSlider/InvSlider.stories.tsx b/invokeai/frontend/web/src/common/components/InvSlider/InvSlider.stories.tsx deleted file mode 100644 index 44c66d7d05..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSlider/InvSlider.stories.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import type { InvSliderProps } from 'common/components/InvSlider/types'; -import { useCallback, useState } from 'react'; - -import { InvSlider } from './InvSlider'; - -const meta: Meta = { - title: 'Primitives/InvSlider', - tags: ['autodocs'], - component: InvSlider, - args: { - min: 0, - max: 10, - step: 1, - marks: [0, 5, 10], - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvSliderProps) => { - const [value, setValue] = useState(0); - const onReset = useCallback(() => { - setValue(0); - }, []); - return ( - - - - ); -}; - -export const Default: Story = { - render: Component, - args: { - fineStep: 0.1, - withThumbTooltip: true, - formatValue: (v: number) => `${v} eggs`, - }, -}; - -export const WithNumberInput: Story = { - render: Component, - args: { - withNumberInput: true, - numberInputWidth: 24, - }, -}; diff --git a/invokeai/frontend/web/src/common/components/InvSlider/InvSlider.tsx b/invokeai/frontend/web/src/common/components/InvSlider/InvSlider.tsx deleted file mode 100644 index e68e26b16c..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSlider/InvSlider.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import { - Slider as ChakraSlider, - SliderFilledTrack as ChakraSliderFilledTrack, - SliderThumb as ChakraSliderThumb, - SliderTrack as ChakraSliderTrack, - useFormControl, -} from '@chakra-ui/react'; -import { useStore } from '@nanostores/react'; -import { InvNumberInput } from 'common/components/InvNumberInput/InvNumberInput'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; -import { $shift } from 'common/hooks/useGlobalModifiers'; -import { AnimatePresence } from 'framer-motion'; -import { isNil } from 'lodash-es'; -import { memo, useCallback, useMemo, useState } from 'react'; - -import { InvSliderMark } from './InvSliderMark'; -import type { InvFormattedMark, InvSliderProps } from './types'; - -export const InvSlider = memo((props: InvSliderProps) => { - const { - value, - min, - max, - step: _step = 1, - fineStep: _fineStep, - onChange, - onReset: _onReset, - defaultValue, - formatValue = (v: number) => v.toString(), - marks: _marks, - withThumbTooltip: withTooltip = false, - withNumberInput = false, - numberInputMin = min, - numberInputMax = max, - numberInputWidth, - ...sliderProps - } = props; - const [isMouseOverSlider, setIsMouseOverSlider] = useState(false); - const [isChanging, setIsChanging] = useState(false); - - const shift = useStore($shift); - const step = useMemo( - () => (shift ? _fineStep ?? _step : _step), - [shift, _fineStep, _step] - ); - const controlProps = useFormControl({}); - - const label = useMemo(() => formatValue(value), [formatValue, value]); - - const onMouseEnter = useCallback(() => setIsMouseOverSlider(true), []); - const onMouseLeave = useCallback(() => setIsMouseOverSlider(false), []); - const onChangeStart = useCallback(() => setIsChanging(true), []); - const onChangeEnd = useCallback(() => setIsChanging(false), []); - - const marks = useMemo(() => { - if (_marks === true) { - return [min, max].map((m) => ({ value: m, label: formatValue(m) })); - } - if (_marks) { - return _marks?.map((m) => ({ value: m, label: formatValue(m) })); - } - return []; - }, [_marks, formatValue, max, min]); - - const onReset = useCallback(() => { - if (!isNil(defaultValue)) { - onChange(defaultValue); - } - if (_onReset) { - _onReset(); - } - }, [defaultValue, onChange, _onReset]); - - return ( - <> - - - {marks?.length && - (isMouseOverSlider || isChanging) && - marks.map((m, i) => ( - - ))} - - - - - - - - - - - {withNumberInput && ( - - )} - > - ); -}); - -InvSlider.displayName = 'InvSlider'; diff --git a/invokeai/frontend/web/src/common/components/InvSlider/InvSliderMark.tsx b/invokeai/frontend/web/src/common/components/InvSlider/InvSliderMark.tsx deleted file mode 100644 index 8222bc2057..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSlider/InvSliderMark.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { SliderMark as ChakraSliderMark } from '@chakra-ui/react'; -import type { SystemStyleObject } from '@chakra-ui/styled-system'; -import type { InvSliderMarkProps } from 'common/components/InvSlider/types'; -import type { MotionProps } from 'framer-motion'; -import { motion } from 'framer-motion'; -import { memo } from 'react'; - -const initialFirstLast: MotionProps['initial'] = { opacity: 0, y: 10 }; -const initialOther = { ...initialFirstLast, x: '-50%' }; - -const animateFirstLast: MotionProps['animate'] = { - opacity: 1, - y: 0, - transition: { duration: 0.2, ease: 'easeOut' }, -}; -const animateOther = { ...animateFirstLast, x: '-50%' }; - -const exitFirstLast: MotionProps['exit'] = { - opacity: 0, - y: 10, - transition: { duration: 0.2, ease: 'anticipate' }, -}; -const exitOther = { ...exitFirstLast, x: '-50%' }; - -const firstMarkStyle: SystemStyleObject = { - insetInlineStart: '0 !important', - insetInlineEnd: 'unset !important', -}; -const lastMarkStyle: SystemStyleObject = { - insetInlineStart: 'unset !important', - insetInlineEnd: '0 !important', -}; - -export const sliderMarkAnimationConstants = { - initialFirstLast, - initialOther, - exitFirstLast, - exitOther, - animateFirstLast, - animateOther, - firstMarkStyle, - lastMarkStyle, -}; - -export const InvSliderMark = memo( - ({ value, label, index, total }: InvSliderMarkProps) => { - if (index === 0) { - return ( - - {label} - - ); - } - - if (index === total - 1) { - return ( - - {label} - - ); - } - - return ( - - {label} - - ); - } -); - -InvSliderMark.displayName = 'InvSliderMark'; diff --git a/invokeai/frontend/web/src/common/components/InvSlider/theme.ts b/invokeai/frontend/web/src/common/components/InvSlider/theme.ts deleted file mode 100644 index ef7340c367..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSlider/theme.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { sliderAnatomy as parts } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers, defineStyle } from '@chakra-ui/react'; - -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys); - -const container = defineStyle(() => ({ - h: '28px', -})); - -const track = defineStyle(() => { - return { - bg: 'base.600', - h: 2, - }; -}); - -const filledTrack = defineStyle((_props) => { - return { - bg: 'base.400', - h: 2, - }; -}); - -const thumb = defineStyle((props) => { - const { orientation } = props; - return { - w: 5, - h: 5, - bg: 'base.400', - borderColor: 'base.200', - borderWidth: 3, - _hover: { - transform: - orientation === 'vertical' - ? 'translateX(-50%) scale(1.15)' - : 'translateY(-50%) scale(1.15)', - transition: 'transform 0.1s', - _active: { - transform: - orientation === 'vertical' - ? 'translateX(-50%) scale(1.22)' - : 'translateY(-50%) scale(1.22)', - transition: 'transform 0.05s', - }, - }, - }; -}); - -const mark = defineStyle(() => { - return { - fontSize: '10px', - color: 'base.400', - mt: 4, - }; -}); - -const baseStyle = definePartsStyle((props) => ({ - container: container(), - track: track(), - filledTrack: filledTrack(props), - thumb: thumb(props), - mark: mark(), -})); - -export const sliderTheme = defineMultiStyleConfig({ - baseStyle, - defaultProps: { - colorScheme: 'base', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvSlider/types.ts b/invokeai/frontend/web/src/common/components/InvSlider/types.ts deleted file mode 100644 index 55e7111633..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSlider/types.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { - ChakraProps, - SliderProps as ChakraSliderProps, -} from '@chakra-ui/react'; - -export type InvSliderProps = Omit & { - /** - * The value - */ - value: number; - /** - * The minimum value - */ - min: number; - /** - * The maximum value - */ - max: number; - /** - * The default step - */ - step?: number; - /** - * The fine step (when shift is pressed) - */ - fineStep?: number; - /** - * The change handler - */ - onChange: (v: number) => void; - /** - * The reset handler, called on double-click of the thumb - */ - onReset?: () => void; - /** - * The value formatter - */ - formatValue?: (v: number) => string; - /** - * Whether the slider is disabled - */ - isDisabled?: boolean; - /** - * The marks to render below the slider. If true, will use the min and max values. - */ - marks?: number[] | true; - /** - * Whether to show a tooltip over the slider thumb - */ - withThumbTooltip?: boolean; - /** - * Whether or not to render a number input - */ - withNumberInput?: boolean; - /** - * The number input min (defaults to the slider min) - */ - numberInputMin?: number; - /** - * The number input max (defaults to the slider max) - */ - numberInputMax?: number; - /** - * The width of the number input - */ - numberInputWidth?: ChakraProps['width']; -}; - -export type InvFormattedMark = { value: number; label: string }; - -export type InvSliderMarkProps = { - value: number; - label: string; - index: number; - total: number; -}; diff --git a/invokeai/frontend/web/src/common/components/InvSwitch/InvSwitch.stories.tsx b/invokeai/frontend/web/src/common/components/InvSwitch/InvSwitch.stories.tsx deleted file mode 100644 index 0e956d53bc..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSwitch/InvSwitch.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvSwitchProps } from './types'; -import { InvSwitch } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvSwitch', - tags: ['autodocs'], - component: InvSwitch, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvSwitchProps) => { - return ; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvSwitch/theme.ts b/invokeai/frontend/web/src/common/components/InvSwitch/theme.ts deleted file mode 100644 index b0332762c6..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSwitch/theme.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { switchAnatomy as parts } from '@chakra-ui/anatomy'; -import { - createMultiStyleConfigHelpers, - defineStyle, -} from '@chakra-ui/styled-system'; - -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys); - -const invokeAITrack = defineStyle((_props) => { - return { - bg: 'base.600', - p: 1, - _focusVisible: { - boxShadow: 'none', - }, - _checked: { - bg: 'blue.500', - }, - }; -}); - -const invokeAIThumb = defineStyle((_props) => { - return { - bg: 'base.50', - }; -}); - -const invokeAI = definePartsStyle((props) => ({ - container: {}, - track: invokeAITrack(props), - thumb: invokeAIThumb(props), -})); - -export const switchTheme = defineMultiStyleConfig({ - variants: { invokeAI }, - defaultProps: { - size: 'md', - variant: 'invokeAI', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvSwitch/types.ts b/invokeai/frontend/web/src/common/components/InvSwitch/types.ts deleted file mode 100644 index 31f00fe53c..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSwitch/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SwitchProps as ChakraSwitchProps } from '@chakra-ui/react'; - -export type InvSwitchProps = ChakraSwitchProps; diff --git a/invokeai/frontend/web/src/common/components/InvSwitch/wrapper.ts b/invokeai/frontend/web/src/common/components/InvSwitch/wrapper.ts deleted file mode 100644 index 3152a7f851..0000000000 --- a/invokeai/frontend/web/src/common/components/InvSwitch/wrapper.ts +++ /dev/null @@ -1 +0,0 @@ -export { Switch as InvSwitch } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvTabs/InvTab.tsx b/invokeai/frontend/web/src/common/components/InvTabs/InvTab.tsx deleted file mode 100644 index 011ef83161..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTabs/InvTab.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Spacer } from '@chakra-ui/layout'; -import { forwardRef, Tab as ChakraTab } from '@chakra-ui/react'; -import { InvBadge } from 'common/components/InvBadge/wrapper'; -import type { InvTabProps } from 'common/components/InvTabs/types'; -import { memo } from 'react'; - -export const InvTab = memo( - forwardRef((props: InvTabProps, ref) => { - const { children, badges, ...rest } = props; - return ( - - {children} - - {badges?.map((b, i) => ( - - {b} - - ))} - - ); - }) -); - -InvTab.displayName = 'InvTab'; diff --git a/invokeai/frontend/web/src/common/components/InvTabs/InvTabs.stories.tsx b/invokeai/frontend/web/src/common/components/InvTabs/InvTabs.stories.tsx deleted file mode 100644 index 4c354d882f..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTabs/InvTabs.stories.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import { InvTab } from './InvTab'; -import type { InvTabsProps } from './types'; -import { InvTabList, InvTabPanel, InvTabPanels, InvTabs } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvTabs', - tags: ['autodocs'], - component: InvTabs, - args: { - colorScheme: 'base', - variant: 'collapse', - }, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvTabsProps) => { - return ( - - - One - Two - Three - - - - - one! - - - two! - - - three! - - - - ); -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvTabs/theme.ts b/invokeai/frontend/web/src/common/components/InvTabs/theme.ts deleted file mode 100644 index 3530d65ca7..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTabs/theme.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { tabsAnatomy as parts } from '@chakra-ui/anatomy'; -import { - createMultiStyleConfigHelpers, - defineStyle, -} from '@chakra-ui/styled-system'; - -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys); - -const appTabsRoot = defineStyle(() => { - return { - display: 'flex', - gap: 4, - }; -}); - -const appTabsTab = defineStyle(() => ({})); - -const appTabsTablist = defineStyle((_props) => { - return { - display: 'flex', - flexDirection: 'column', - gap: 1, - }; -}); - -const appTabsTabpanel = defineStyle(() => ({ - padding: 0, - height: '100%', -})); - -const appTabs = definePartsStyle((props) => ({ - root: appTabsRoot(), - tab: appTabsTab(), - tablist: appTabsTablist(props), - tabpanel: appTabsTabpanel(), -})); - -const line = definePartsStyle(() => ({ - tab: { - borderTopRadius: 'base', - px: 4, - py: 1, - fontSize: 'sm', - color: 'base.200', - _selected: { - color: 'blue.200', - }, - }, - tabpanel: { - p: 0, - pt: 4, - w: 'full', - h: 'full', - }, - tabpanels: { - w: 'full', - h: 'full', - }, -})); - -const TAB_INACTIVE = 'base.750'; -const TAB_ACTIVE = 'base.800'; - -const collapse = definePartsStyle(() => ({ - indicator: {}, - tablist: { - bg: TAB_ACTIVE, - borderRadius: 'base', - display: 'grid', - gridAutoFlow: 'column', - gridAutoColumns: '1fr', - }, - tab: { - gap: 4, - bg: TAB_INACTIVE, - fontSize: 'sm', - fontWeight: 'semibold', - borderInlineEnd: 1, - borderInlineEndColor: TAB_ACTIVE, - borderInlineEndStyle: 'solid', - _first: { - borderTopStartRadius: 'base', - }, - // select the tab next to the selected tab - '&[aria-selected="true"] + button': { borderBottomStartRadius: 'lg' }, - // select the tab prev to the selected tab - ':has(+ [aria-selected="true"])': { borderBottomEndRadius: 'lg' }, - _selected: { - bg: TAB_ACTIVE, - }, - _last: { - borderTopEndRadius: 'base', - alignSelf: 'start', - }, - transitionProperty: 'all', - }, - tabpanels: { bg: TAB_ACTIVE, borderBottomRadius: 'base' }, - tabpanel: { - p: 0, - }, -})); - -export const tabsTheme = defineMultiStyleConfig({ - variants: { - line, - appTabs, - collapse, - }, - defaultProps: { - variant: 'line', - colorScheme: 'blue', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvTabs/types.ts b/invokeai/frontend/web/src/common/components/InvTabs/types.ts deleted file mode 100644 index db8f7af829..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTabs/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { - TabListProps as InvTabListProps, - TabPanelProps as InvTabPanelProps, - TabPanelsProps as InvTabPanelsProps, - TabProps as ChakraTabProps, - TabsProps as InvTabsProps, -} from '@chakra-ui/react'; - -export type { - InvTabListProps, - InvTabPanelProps, - InvTabPanelsProps, - InvTabsProps, -}; - -export type InvTabProps = ChakraTabProps & { - badges?: (string | number)[]; -}; diff --git a/invokeai/frontend/web/src/common/components/InvTabs/wrapper.ts b/invokeai/frontend/web/src/common/components/InvTabs/wrapper.ts deleted file mode 100644 index b8305028a3..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTabs/wrapper.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { - TabList as InvTabList, - TabPanel as InvTabPanel, - TabPanels as InvTabPanels, - Tabs as InvTabs, -} from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvText/InvText.stories.tsx b/invokeai/frontend/web/src/common/components/InvText/InvText.stories.tsx deleted file mode 100644 index 988b876960..0000000000 --- a/invokeai/frontend/web/src/common/components/InvText/InvText.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import type { InvTextProps } from './types'; -import { InvText } from './wrapper'; - -const meta: Meta = { - title: 'Primitives/InvText', - tags: ['autodocs'], - component: InvText, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvTextProps) => { - return Banana sushi is delectable!; -}; - -export const Default: Story = { - render: Component, -}; diff --git a/invokeai/frontend/web/src/common/components/InvText/theme.ts b/invokeai/frontend/web/src/common/components/InvText/theme.ts deleted file mode 100644 index 38b4158fbd..0000000000 --- a/invokeai/frontend/web/src/common/components/InvText/theme.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineStyle, defineStyleConfig } from '@chakra-ui/react'; - -const baseStyle = defineStyle(() => ({ - fontSize: 'sm', -})); - -const error = defineStyle(() => ({ - color: 'error.400', -})); - -const subtext = defineStyle(() => ({ - color: 'base.400', -})); - -export const textTheme = defineStyleConfig({ - baseStyle, - variants: { - subtext, - error, - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvText/types.ts b/invokeai/frontend/web/src/common/components/InvText/types.ts deleted file mode 100644 index cb73b3aef0..0000000000 --- a/invokeai/frontend/web/src/common/components/InvText/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TextProps as ChakraTextProps } from '@chakra-ui/react'; - -export type InvTextProps = ChakraTextProps; diff --git a/invokeai/frontend/web/src/common/components/InvText/wrapper.ts b/invokeai/frontend/web/src/common/components/InvText/wrapper.ts deleted file mode 100644 index cac7135c5e..0000000000 --- a/invokeai/frontend/web/src/common/components/InvText/wrapper.ts +++ /dev/null @@ -1 +0,0 @@ -export { Text as InvText } from '@chakra-ui/react'; diff --git a/invokeai/frontend/web/src/common/components/InvTextarea/InvTextarea.stories.tsx b/invokeai/frontend/web/src/common/components/InvTextarea/InvTextarea.stories.tsx deleted file mode 100644 index c121e5eee8..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTextarea/InvTextarea.stories.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; - -import { InvTextarea } from './InvTextarea'; -import type { InvTextareaProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvTextarea', - tags: ['autodocs'], - component: InvTextarea, -}; - -export default meta; -type Story = StoryObj; - -const Component = (props: InvTextareaProps) => { - return ; -}; - -export const Default: Story = { - render: Component, -}; - -export const Resizeable: Story = { - render: Component, - args: { - resize: 'vertical', - minW: '200px', - minH: '50px', - }, -}; diff --git a/invokeai/frontend/web/src/common/components/InvTextarea/InvTextarea.tsx b/invokeai/frontend/web/src/common/components/InvTextarea/InvTextarea.tsx deleted file mode 100644 index ff42fe9093..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTextarea/InvTextarea.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { forwardRef, Textarea as ChakraTextarea } from '@chakra-ui/react'; -import { useGlobalModifiersSetters } from 'common/hooks/useGlobalModifiers'; -import { stopPastePropagation } from 'common/util/stopPastePropagation'; -import type { KeyboardEvent } from 'react'; -import { memo, useCallback } from 'react'; - -import type { InvTextareaProps } from './types'; - -export const InvTextarea = memo( - forwardRef( - (props: InvTextareaProps, ref) => { - const { ...rest } = props; - const { setShift } = useGlobalModifiersSetters(); - const onKeyUpDown = useCallback( - (e: KeyboardEvent) => { - setShift(e.shiftKey); - }, - [setShift] - ); - return ( - - ); - } - ) -); - -InvTextarea.displayName = 'InvTextarea'; diff --git a/invokeai/frontend/web/src/common/components/InvTextarea/theme.ts b/invokeai/frontend/web/src/common/components/InvTextarea/theme.ts deleted file mode 100644 index 40c58f06be..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTextarea/theme.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineStyle, defineStyleConfig } from '@chakra-ui/react'; -import { getInputFilledStyles } from 'theme/util/getInputFilledStyles'; - -export const textareaTheme = defineStyleConfig({ - variants: { - filled: defineStyle((props) => getInputFilledStyles(props)), - darkFilled: defineStyle((props) => getInputFilledStyles(props)), - }, - defaultProps: { - size: 'md', - variant: 'filled', - }, -}); diff --git a/invokeai/frontend/web/src/common/components/InvTextarea/types.ts b/invokeai/frontend/web/src/common/components/InvTextarea/types.ts deleted file mode 100644 index 1c36ede94f..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTextarea/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TextareaProps as ChakraTextareaProps } from '@chakra-ui/react'; - -export type InvTextareaProps = ChakraTextareaProps; diff --git a/invokeai/frontend/web/src/common/components/InvTooltip/InvTooltip.stories.tsx b/invokeai/frontend/web/src/common/components/InvTooltip/InvTooltip.stories.tsx deleted file mode 100644 index c391c22545..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTooltip/InvTooltip.stories.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; - -import { InvTooltip } from './InvTooltip'; -import type { InvTooltipProps } from './types'; - -const meta: Meta = { - title: 'Primitives/InvTooltip', - component: InvTooltip, - tags: ['autodocs'], - args: { - label: 'My Tooltip', - placement: 'top', - hasArrow: true, - }, -}; - -export default meta; -type Story = StoryObj; - -const render = (props: InvTooltipProps) => ( - - Invoke - -); - -export const Default: Story = { - render, -}; - -export const WithoutArrow: Story = { - render, - args: { - hasArrow: false, - }, -}; diff --git a/invokeai/frontend/web/src/common/components/InvTooltip/InvTooltip.tsx b/invokeai/frontend/web/src/common/components/InvTooltip/InvTooltip.tsx deleted file mode 100644 index 7967d99c95..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTooltip/InvTooltip.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { forwardRef, Tooltip as ChakraTooltip } from '@chakra-ui/react'; -import { memo } from 'react'; - -import type { InvTooltipProps } from './types'; - -const modifiers: InvTooltipProps['modifiers'] = [ - { - name: 'preventOverflow', - options: { - padding: 12, - }, - }, -]; - -export const InvTooltip = memo( - forwardRef( - (props: InvTooltipProps, ref) => { - const { children, hasArrow = true, placement = 'top', ...rest } = props; - return ( - - {children} - - ); - } - ) -); - -InvTooltip.displayName = 'InvTooltip'; diff --git a/invokeai/frontend/web/src/common/components/InvTooltip/theme.ts b/invokeai/frontend/web/src/common/components/InvTooltip/theme.ts deleted file mode 100644 index 2e7f2190aa..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTooltip/theme.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { defineStyle, defineStyleConfig } from '@chakra-ui/react'; -import { cssVar } from '@chakra-ui/theme-tools'; - -const $arrowBg = cssVar('popper-arrow-bg'); - -const baseStyle = defineStyle(() => ({ - borderRadius: 'md', - shadow: 'dark-lg', - bg: 'base.200', - color: 'base.800', - [$arrowBg.variable]: 'colors.base.200', - pt: 1, - px: 2, - pb: 1, -})); - -// export the component theme -export const tooltipTheme = defineStyleConfig({ baseStyle }); diff --git a/invokeai/frontend/web/src/common/components/InvTooltip/types.ts b/invokeai/frontend/web/src/common/components/InvTooltip/types.ts deleted file mode 100644 index ce56cdfd88..0000000000 --- a/invokeai/frontend/web/src/common/components/InvTooltip/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TooltipProps as ChakraTooltipProps } from '@chakra-ui/react'; - -export type InvTooltipProps = ChakraTooltipProps; diff --git a/invokeai/frontend/web/src/common/components/Loading/Loading.tsx b/invokeai/frontend/web/src/common/components/Loading/Loading.tsx index a9b95059b0..024936ebd8 100644 --- a/invokeai/frontend/web/src/common/components/Loading/Loading.tsx +++ b/invokeai/frontend/web/src/common/components/Loading/Loading.tsx @@ -1,4 +1,4 @@ -import { Flex, Image, Spinner } from '@chakra-ui/react'; +import { Flex, Image, Spinner } from '@invoke-ai/ui'; import InvokeLogoWhite from 'public/assets/images/invoke-symbol-wht-lrg.svg'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx b/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx index 58f17a2255..7e31cd74c0 100644 --- a/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx @@ -1,4 +1,4 @@ -import { Box } from '@chakra-ui/react'; +import { Box } from '@invoke-ai/ui'; import { memo, useMemo } from 'react'; type Props = { diff --git a/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx b/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx index 12e83c43c5..2e4b61a0a5 100644 --- a/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx +++ b/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx @@ -1,12 +1,12 @@ -import type { StyleProps } from '@chakra-ui/react'; -import { Box, Flex } from '@chakra-ui/react'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { Box, Flex } from '@invoke-ai/ui'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'; import type { CSSProperties, PropsWithChildren } from 'react'; import { memo } from 'react'; type Props = PropsWithChildren & { - maxHeight?: StyleProps['maxHeight']; + maxHeight?: ChakraProps['maxHeight']; }; const styles: CSSProperties = { height: '100%', width: '100%' }; diff --git a/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx b/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx index 2143b1615c..9eb1af0b99 100644 --- a/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx @@ -1,4 +1,4 @@ -import { Box } from '@chakra-ui/react'; +import { Box } from '@invoke-ai/ui'; import { memo, useMemo } from 'react'; type Props = { diff --git a/invokeai/frontend/web/src/common/hooks/useChakraThemeTokens.ts b/invokeai/frontend/web/src/common/hooks/useChakraThemeTokens.ts index 0afb7e7e5d..06090b3dbd 100644 --- a/invokeai/frontend/web/src/common/hooks/useChakraThemeTokens.ts +++ b/invokeai/frontend/web/src/common/hooks/useChakraThemeTokens.ts @@ -1,4 +1,4 @@ -import { useToken } from '@chakra-ui/react'; +import { useToken } from '@invoke-ai/ui'; export const useChakraThemeTokens = () => { const [ diff --git a/invokeai/frontend/web/src/common/components/InvSelect/useGroupedModelInvSelect.ts b/invokeai/frontend/web/src/common/hooks/useGroupedModelCombobox.ts similarity index 80% rename from invokeai/frontend/web/src/common/components/InvSelect/useGroupedModelInvSelect.ts rename to invokeai/frontend/web/src/common/hooks/useGroupedModelCombobox.ts index 708906f495..d76eab4a53 100644 --- a/invokeai/frontend/web/src/common/components/InvSelect/useGroupedModelInvSelect.ts +++ b/invokeai/frontend/web/src/common/hooks/useGroupedModelCombobox.ts @@ -1,3 +1,4 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; import type { EntityState } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import type { GroupBase } from 'chakra-react-select'; @@ -7,9 +8,7 @@ import { useTranslation } from 'react-i18next'; import type { AnyModelConfigEntity } from 'services/api/endpoints/models'; import { getModelId } from 'services/api/endpoints/models'; -import type { InvSelectOnChange, InvSelectOption } from './types'; - -type UseGroupedModelInvSelectArg = { +type UseGroupedModelComboboxArg = { modelEntities: EntityState | undefined; selectedModel?: Pick | null; onChange: (value: T | null) => void; @@ -17,24 +16,24 @@ type UseGroupedModelInvSelectArg = { isLoading?: boolean; }; -type UseGroupedModelInvSelectReturn = { - value: InvSelectOption | undefined | null; - options: GroupBase[]; - onChange: InvSelectOnChange; +type UseGroupedModelComboboxReturn = { + value: ComboboxOption | undefined | null; + options: GroupBase[]; + onChange: ComboboxOnChange; placeholder: string; noOptionsMessage: () => string; }; -export const useGroupedModelInvSelect = ( - arg: UseGroupedModelInvSelectArg -): UseGroupedModelInvSelectReturn => { +export const useGroupedModelCombobox = ( + arg: UseGroupedModelComboboxArg +): UseGroupedModelComboboxReturn => { const { t } = useTranslation(); const base_model = useAppSelector( (s) => s.generation.model?.base_model ?? 'sdxl' ); const { modelEntities, selectedModel, getIsDisabled, onChange, isLoading } = arg; - const options = useMemo[]>(() => { + const options = useMemo[]>(() => { if (!modelEntities) { return []; } @@ -53,7 +52,7 @@ export const useGroupedModelInvSelect = ( }); return acc; }, - [] as GroupBase[] + [] as GroupBase[] ); _options.sort((a) => (a.label === base_model ? -1 : 1)); return _options; @@ -69,7 +68,7 @@ export const useGroupedModelInvSelect = ( [options, selectedModel] ); - const _onChange = useCallback( + const _onChange = useCallback( (v) => { if (!v) { onChange(null); diff --git a/invokeai/frontend/web/src/common/components/InvSelect/useModelInvSelect.ts b/invokeai/frontend/web/src/common/hooks/useModelCombobox.ts similarity index 80% rename from invokeai/frontend/web/src/common/components/InvSelect/useModelInvSelect.ts rename to invokeai/frontend/web/src/common/hooks/useModelCombobox.ts index 186d754ef6..25908c5f62 100644 --- a/invokeai/frontend/web/src/common/components/InvSelect/useModelInvSelect.ts +++ b/invokeai/frontend/web/src/common/hooks/useModelCombobox.ts @@ -1,3 +1,4 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; import type { EntityState } from '@reduxjs/toolkit'; import { map } from 'lodash-es'; import { useCallback, useMemo } from 'react'; @@ -5,9 +6,7 @@ import { useTranslation } from 'react-i18next'; import type { AnyModelConfigEntity } from 'services/api/endpoints/models'; import { getModelId } from 'services/api/endpoints/models'; -import type { InvSelectOnChange, InvSelectOption } from './types'; - -type UseModelInvSelectArg = { +type UseModelComboboxArg = { modelEntities: EntityState | undefined; selectedModel?: Pick | null; onChange: (value: T | null) => void; @@ -16,17 +15,17 @@ type UseModelInvSelectArg = { isLoading?: boolean; }; -type UseModelInvSelectReturn = { - value: InvSelectOption | undefined | null; - options: InvSelectOption[]; - onChange: InvSelectOnChange; +type UseModelComboboxReturn = { + value: ComboboxOption | undefined | null; + options: ComboboxOption[]; + onChange: ComboboxOnChange; placeholder: string; noOptionsMessage: () => string; }; -export const useModelInvSelect = ( - arg: UseModelInvSelectArg -): UseModelInvSelectReturn => { +export const useModelCombobox = ( + arg: UseModelComboboxArg +): UseModelComboboxReturn => { const { t } = useTranslation(); const { modelEntities, @@ -36,7 +35,7 @@ export const useModelInvSelect = ( isLoading, optionsFilter = () => true, } = arg; - const options = useMemo(() => { + const options = useMemo(() => { if (!modelEntities) { return []; } @@ -57,7 +56,7 @@ export const useModelInvSelect = ( [options, selectedModel] ); - const _onChange = useCallback( + const _onChange = useCallback( (v) => { if (!v) { onChange(null); diff --git a/invokeai/frontend/web/src/common/util/colorTokenToCssVar.ts b/invokeai/frontend/web/src/common/util/colorTokenToCssVar.ts index 87724d9c9b..2a7364aed7 100644 --- a/invokeai/frontend/web/src/common/util/colorTokenToCssVar.ts +++ b/invokeai/frontend/web/src/common/util/colorTokenToCssVar.ts @@ -1,2 +1,2 @@ export const colorTokenToCssVar = (colorToken: string) => - `var(--invokeai-colors-${colorToken.split('.').join('-')})`; + `var(--invoke-colors-${colorToken.split('.').join('-')})`; diff --git a/invokeai/frontend/web/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx b/invokeai/frontend/web/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx index 422ec78640..5d352c08c4 100644 --- a/invokeai/frontend/web/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx @@ -1,7 +1,5 @@ -import { useDisclosure } from '@chakra-ui/react'; +import { Button, ConfirmationAlertDialog, useDisclosure } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { clearCanvasHistory } from 'features/canvas/store/canvasSlice'; import { memo, useCallback } from 'react'; @@ -20,15 +18,15 @@ const ClearCanvasHistoryButtonModal = () => { return ( <> - } isDisabled={isStaging} > {t('unifiedCanvas.clearCanvasHistory')} - - + { {t('unifiedCanvas.clearCanvasHistoryMessage')} {t('unifiedCanvas.clearCanvasHistoryConfirm')} - + > ); }; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx index 73ee63a1bd..fafbccb705 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx @@ -1,4 +1,4 @@ -import { Box, chakra, Flex } from '@chakra-ui/react'; +import { Box, chakra, Flex } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx index 69b1751d9f..a049714037 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasGrid.tsx @@ -1,11 +1,11 @@ // Grid drawing adapted from https://longviewcoder.com/2021/12/08/konva-a-better-grid/ +import { getArbitraryBaseColor } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import { selectCanvasSlice } from 'features/canvas/store/canvasSlice'; import type { ReactElement } from 'react'; import { memo, useCallback, useMemo } from 'react'; import { Group, Line as KonvaLine } from 'react-konva'; -import { getArbitraryBaseColor } from 'theme/colors'; const selector = createMemoizedSelector(selectCanvasSlice, (canvas) => { return { diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasImageErrorFallback.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasImageErrorFallback.tsx index 902f4b7d2c..ef23a55cd2 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasImageErrorFallback.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasImageErrorFallback.tsx @@ -1,4 +1,4 @@ -import { useToken } from '@chakra-ui/react'; +import { useToken } from '@invoke-ai/ui'; import type { CanvasImage } from 'features/canvas/store/canvasTypes'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx index 10ccbc2376..976bc7c49a 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx @@ -1,9 +1,7 @@ -import { Flex } from '@chakra-ui/react'; +import { Button, ButtonGroup, Flex, IconButton } from '@invoke-ai/ui'; import { skipToken } from '@reduxjs/toolkit/query'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; import { stagingAreaImageSaved } from 'features/canvas/store/actions'; import { commitStagingAreaImage, @@ -14,7 +12,6 @@ import { setShouldShowStagingImage, setShouldShowStagingOutline, } from 'features/canvas/store/canvasSlice'; -import { InvIconButton } from 'index'; import { memo, useCallback } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; @@ -136,8 +133,8 @@ const IAICanvasStagingAreaToolbar = () => { onMouseEnter={handleMouseOver} onMouseLeave={handleMouseOut} > - - + } @@ -145,13 +142,13 @@ const IAICanvasStagingAreaToolbar = () => { colorScheme="invokeBlue" isDisabled={!shouldShowStagingImage} /> - {`${currentIndex + 1}/${total}`} - {`${currentIndex + 1}/${total}`} + } @@ -159,16 +156,16 @@ const IAICanvasStagingAreaToolbar = () => { colorScheme="invokeBlue" isDisabled={!shouldShowStagingImage} /> - - - + + } onClick={handleAccept} colorScheme="invokeBlue" /> - { onClick={handleToggleShouldShowStagingImage} colorScheme="invokeBlue" /> - { onClick={handleSaveToGallery} colorScheme="invokeBlue" /> - } @@ -200,7 +197,7 @@ const IAICanvasStagingAreaToolbar = () => { colorScheme="error" fontSize={20} /> - + ); }; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx index ad57301670..8e99ffb65a 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import { selectCanvasSlice } from 'features/canvas/store/canvasSlice'; @@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next'; import IAICanvasStatusTextCursorPos from './IAICanvasStatusText/IAICanvasStatusTextCursorPos'; -const warningColor = 'var(--invokeai-colors-warning-500)'; +const warningColor = 'var(--invoke-colors-warning-500)'; const selector = createMemoizedSelector(selectCanvasSlice, (canvas) => { const { diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx index 110fb4eef5..dd24ea34a1 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx @@ -1,4 +1,4 @@ -import { Box } from '@chakra-ui/react'; +import { Box } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { $cursorPosition } from 'features/canvas/store/canvasNanostore'; import roundToHundreth from 'features/canvas/util/roundToHundreth'; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx index ea17c25b52..23cffc05a2 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx @@ -1,16 +1,18 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { + Box, + Button, + Checkbox, + Flex, + FormControl, + FormLabel, + IconButton, + Popover, + PopoverBody, + PopoverContent, + PopoverTrigger, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import IAIColorPicker from 'common/components/IAIColorPicker'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { - InvPopover, - InvPopoverBody, - InvPopoverContent, - InvPopoverTrigger, -} from 'common/components/InvPopover/wrapper'; import { canvasMaskSavedToGallery } from 'features/canvas/store/actions'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { @@ -109,55 +111,57 @@ const IAICanvasMaskOptions = () => { ); return ( - - - + + } isChecked={layer === 'mask'} isDisabled={isStaging} /> - - - + + + - - + {`${t('unifiedCanvas.enableMask')} (H)`} + - - - + + {t('unifiedCanvas.preserveMaskedArea')} + - + - } onClick={handleSaveMask} > {t('unifiedCanvas.saveMask')} - - + } onClick={handleClearMask} > {t('unifiedCanvas.clearMask')} - + - - - + + + ); }; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx index c08f3344ac..1fdffa0d3e 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx @@ -1,5 +1,5 @@ +import { IconButton } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; import { redo } from 'features/canvas/store/canvasSlice'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; import { memo, useCallback } from 'react'; @@ -31,7 +31,7 @@ const IAICanvasRedoButton = () => { ); return ( - } diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx index 8dbdb8c9b3..6b2f2eddb0 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx @@ -1,12 +1,15 @@ -import { Flex } from '@chakra-ui/react'; -import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; import { - InvPopoverBody, - InvPopoverContent, - InvPopoverTrigger, -} from 'common/components/InvPopover/wrapper'; + Checkbox, + Flex, + FormControl, + FormLabel, + IconButton, + Popover, + PopoverBody, + PopoverContent, + PopoverTrigger, +} from '@invoke-ai/ui'; +import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import ClearCanvasHistoryButtonModal from 'features/canvas/components/ClearCanvasHistoryButtonModal'; import { setShouldAntialias, @@ -19,7 +22,6 @@ import { setShouldShowIntermediates, setShouldSnapToGrid, } from 'features/canvas/store/canvasSlice'; -import { InvIconButton, InvPopover } from 'index'; import type { ChangeEvent } from 'react'; import { memo, useCallback } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; @@ -109,76 +111,85 @@ const IAICanvasSettingsButtonPopover = () => { ); return ( - - - + + } /> - - - + + + - - + {t('unifiedCanvas.showIntermediates')} + - - - + + {t('unifiedCanvas.showGrid')} + - - - + + {t('unifiedCanvas.snapToGrid')} + - - - + + {t('unifiedCanvas.darkenOutsideSelection')} + - - - + + {t('unifiedCanvas.autoSaveToGallery')} + - - - + + {t('unifiedCanvas.saveBoxRegionOnly')} + - - - + + {t('unifiedCanvas.limitStrokesToBox')} + - - - + + {t('unifiedCanvas.showCanvasDebugInfo')} + - - - + + {t('unifiedCanvas.antialiasing')} + - + - - - + + + ); }; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx index 7c3fd56088..59a0ae2619 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx @@ -1,16 +1,20 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { + Box, + ButtonGroup, + CompositeNumberInput, + CompositeSlider, + Flex, + FormControl, + FormLabel, + IconButton, + Popover, + PopoverBody, + PopoverContent, + PopoverTrigger, +} from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import IAIColorPicker from 'common/components/IAIColorPicker'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvNumberInput } from 'common/components/InvNumberInput/InvNumberInput'; -import { - InvPopoverBody, - InvPopoverContent, - InvPopoverTrigger, -} from 'common/components/InvPopover/wrapper'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { $tool, resetToolInteractionState, @@ -22,7 +26,6 @@ import { setBrushColor, setBrushSize, } from 'features/canvas/store/canvasSlice'; -import { InvIconButton, InvPopover } from 'index'; import { clamp } from 'lodash-es'; import { memo, useCallback } from 'react'; import type { RgbaColor } from 'react-colorful'; @@ -199,8 +202,8 @@ const IAICanvasToolChooserOptions = () => { ); return ( - - + } @@ -208,7 +211,7 @@ const IAICanvasToolChooserOptions = () => { onClick={handleSelectBrushTool} isDisabled={isStaging} /> - } @@ -216,21 +219,21 @@ const IAICanvasToolChooserOptions = () => { isDisabled={isStaging} onClick={handleSelectEraserTool} /> - } isDisabled={isStaging} onClick={handleFillRect} /> - } isDisabled={isStaging} onClick={handleEraseBoundingBox} /> - } @@ -238,20 +241,21 @@ const IAICanvasToolChooserOptions = () => { isDisabled={isStaging} onClick={handleSelectColorPickerTool} /> - - - + + } /> - - - + + + - - + {t('unifiedCanvas.brushSize')} + { marks={marks} defaultValue={50} /> - { onChange={handleChangeBrushSize} defaultValue={50} /> - + { /> - - - - + + + + ); }; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx index fda33ae9ae..865e0d5767 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx @@ -1,11 +1,14 @@ -import { Flex } from '@chakra-ui/react'; +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { + ButtonGroup, + Combobox, + Flex, + FormControl, + IconButton, + Tooltip, +} from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { useCopyImageToClipboard } from 'common/hooks/useCopyImageToClipboard'; import { useImageUploadButton } from 'common/hooks/useImageUploadButton'; import { useSingleAndDoubleClick } from 'common/hooks/useSingleAndDoubleClick'; @@ -25,7 +28,6 @@ import { } from 'features/canvas/store/canvasSlice'; import type { CanvasLayer } from 'features/canvas/store/canvasTypes'; import { LAYER_NAMES_DICT } from 'features/canvas/store/canvasTypes'; -import { InvIconButton } from 'index'; import { memo, useCallback, useMemo } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; @@ -188,7 +190,7 @@ const IAICanvasToolbar = () => { dispatch(canvasDownloadedAsImage()); }, [dispatch]); - const handleChangeLayer = useCallback( + const handleChangeLayer = useCallback( (v) => { if (!v) { return; @@ -208,44 +210,44 @@ const IAICanvasToolbar = () => { return ( - - - + + - - + + - - + } isChecked={tool === 'move' || isStaging} onClick={handleSelectMoveTool} /> - } onClick={handleClickResetCanvasView} /> - + - - + } onClick={handleMergeVisible} isDisabled={isStaging} /> - } @@ -253,7 +255,7 @@ const IAICanvasToolbar = () => { isDisabled={isStaging} /> {isClipboardAPIAvailable && ( - } @@ -261,21 +263,21 @@ const IAICanvasToolbar = () => { isDisabled={isStaging} /> )} - } onClick={handleDownloadAsImage} isDisabled={isStaging} /> - - + + - + - - + } @@ -283,7 +285,7 @@ const IAICanvasToolbar = () => { {...getUploadButtonProps()} /> - } @@ -291,10 +293,10 @@ const IAICanvasToolbar = () => { colorScheme="error" isDisabled={isStaging} /> - - + + - + ); }; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx index 8a05e86476..a2b8feac23 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx @@ -1,5 +1,5 @@ +import { IconButton } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; import { undo } from 'features/canvas/store/canvasSlice'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; import { memo, useCallback } from 'react'; @@ -30,7 +30,7 @@ const IAICanvasUndoButton = () => { ); return ( - } diff --git a/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx b/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx index 23f8eabb31..d7e774c87f 100644 --- a/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx +++ b/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx @@ -1,14 +1,13 @@ -import { Flex } from '@chakra-ui/react'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { + Combobox, + ConfirmationAlertDialog, + Flex, + FormControl, + Text, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; -import { InvText } from 'common/components/InvText/wrapper'; import { changeBoardReset, isModalOpenChanged, @@ -37,7 +36,7 @@ const ChangeBoardModal = () => { const [removeImagesFromBoard] = useRemoveImagesFromBoardMutation(); const { t } = useTranslation(); - const options = useMemo(() => { + const options = useMemo(() => { return [{ label: t('boards.uncategorized'), value: 'none' }].concat( (boards ?? []).map((board) => ({ label: board.board_name, @@ -79,7 +78,7 @@ const ChangeBoardModal = () => { selectedBoard, ]); - const onChange = useCallback((v) => { + const onChange = useCallback((v) => { if (!v) { return; } @@ -87,7 +86,7 @@ const ChangeBoardModal = () => { }, []); return ( - { cancelButtonText={t('boards.cancel')} > - + {t('boards.movingImagesToBoard', { count: imagesToChange.length, })} : - - - + + { value={value} options={options} /> - + - + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx index 1031e6bf27..a878c19856 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx @@ -1,10 +1,13 @@ import { ChevronUpIcon } from '@chakra-ui/icons'; -import { Box, Flex } from '@chakra-ui/react'; +import { + Box, + Flex, + FormControl, + FormLabel, + IconButton, + Switch, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import type { InvLabelProps } from 'common/components/InvControl/types'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; import { useControlAdapterIsEnabled } from 'features/controlAdapters/hooks/useControlAdapterIsEnabled'; import { useControlAdapterType } from 'features/controlAdapters/hooks/useControlAdapterType'; import { @@ -30,10 +33,6 @@ import ParamControlAdapterProcessorSelect from './parameters/ParamControlAdapter import ParamControlAdapterResizeMode from './parameters/ParamControlAdapterResizeMode'; import ParamControlAdapterWeight from './parameters/ParamControlAdapterWeight'; -const labelProps: InvLabelProps = { - flexGrow: 1, -}; - const ControlAdapterConfig = (props: { id: string; number: number }) => { const { id, number } = props; const controlAdapterType = useControlAdapterType(id); @@ -78,16 +77,16 @@ const ControlAdapterConfig = (props: { id: string; number: number }) => { bg="base.750" > - - + + {t(`controlnet.${controlAdapterType}`, { number })} + + - + { {activeTabName === 'unifiedCanvas' && ( )} - } /> - { onClick={handleDelete} icon={} /> - { const isEnabled = useControlAdapterIsEnabled(id); const shouldAutoConfig = useControlAdapterShouldAutoConfig(id); @@ -32,16 +26,13 @@ const ControlAdapterShouldAutoConfig = ({ id }: Props) => { } return ( - - + {t('controlnet.autoConfigure')} + - + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx index 09b54c6375..4c94448cf5 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx @@ -1,6 +1,5 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex, IconButton } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; import { canvasImageToControlAdapter, canvasMaskToControlAdapter, @@ -30,14 +29,14 @@ const ControlNetCanvasImageImports = ( return ( - } tooltip={t('controlnet.importImageFromCanvas')} aria-label={t('controlnet.importImageFromCanvas')} onClick={handleImportImageFromCanvas} /> - } tooltip={t('controlnet.importMaskFromCanvas')} diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterBeginEnd.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterBeginEnd.tsx index ab90bbfaa0..891cd1776a 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterBeginEnd.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterBeginEnd.tsx @@ -1,6 +1,5 @@ +import { CompositeRangeSlider, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvRangeSlider } from 'common/components/InvRangeSlider/InvRangeSlider'; import { useControlAdapterBeginEndStepPct } from 'features/controlAdapters/hooks/useControlAdapterBeginEndStepPct'; import { useControlAdapterIsEnabled } from 'features/controlAdapters/hooks/useControlAdapterIsEnabled'; import { @@ -65,13 +64,13 @@ export const ParamControlAdapterBeginEnd = memo(({ id }: Props) => { } return ( - - {t('controlnet.beginEndStepPercent')} + { marks withThumbTooltip /> - + ); }); diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterControlMode.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterControlMode.tsx index 2beed28fb4..9819697990 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterControlMode.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterControlMode.tsx @@ -1,7 +1,6 @@ +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; import { useControlAdapterControlMode } from 'features/controlAdapters/hooks/useControlAdapterControlMode'; import { useControlAdapterIsEnabled } from 'features/controlAdapters/hooks/useControlAdapterIsEnabled'; import { controlAdapterControlModeChanged } from 'features/controlAdapters/store/controlAdaptersSlice'; @@ -29,7 +28,7 @@ const ParamControlAdapterControlMode = ({ id }: Props) => { [t] ); - const handleControlModeChange = useCallback( + const handleControlModeChange = useCallback( (v) => { if (!v) { return; @@ -54,17 +53,14 @@ const ParamControlAdapterControlMode = ({ id }: Props) => { } return ( - - + {t('controlnet.controlMode')} + - + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterModel.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterModel.tsx index 1e27da467a..8323675caf 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterModel.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterModel.tsx @@ -1,9 +1,7 @@ +import { Combobox, FormControl, Tooltip } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { useControlAdapterIsEnabled } from 'features/controlAdapters/hooks/useControlAdapterIsEnabled'; import { useControlAdapterModel } from 'features/controlAdapters/hooks/useControlAdapterModel'; import { useControlAdapterModelEntities } from 'features/controlAdapters/hooks/useControlAdapterModelEntities'; @@ -81,7 +79,7 @@ const ParamControlAdapterModel = ({ id }: ParamControlAdapterModelProps) => { ); const { options, value, onChange, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: models, onChange: _onChange, selectedModel, @@ -89,20 +87,20 @@ const ParamControlAdapterModel = ({ id }: ParamControlAdapterModelProps) => { }); return ( - - + - - - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterProcessorSelect.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterProcessorSelect.tsx index 5dc2a6e7ed..f395dbad32 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterProcessorSelect.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterProcessorSelect.tsx @@ -1,11 +1,7 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { useControlAdapterIsEnabled } from 'features/controlAdapters/hooks/useControlAdapterIsEnabled'; import { useControlAdapterProcessorNode } from 'features/controlAdapters/hooks/useControlAdapterProcessorNode'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; @@ -21,7 +17,7 @@ type Props = { }; const selectOptions = createMemoizedSelector(configSelector, (config) => { - const options: InvSelectOption[] = map(CONTROLNET_PROCESSORS, (p) => ({ + const options: ComboboxOption[] = map(CONTROLNET_PROCESSORS, (p) => ({ value: p.type, label: p.label, })) @@ -50,7 +46,7 @@ const ParamControlAdapterProcessorSelect = ({ id }: Props) => { const options = useAppSelector(selectOptions); const { t } = useTranslation(); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!v) { return; @@ -73,9 +69,10 @@ const ParamControlAdapterProcessorSelect = ({ id }: Props) => { return null; } return ( - - - + + {t('controlnet.processor')} + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterResizeMode.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterResizeMode.tsx index b88a2d2193..4a652604a8 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterResizeMode.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterResizeMode.tsx @@ -1,7 +1,6 @@ +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; import { useControlAdapterIsEnabled } from 'features/controlAdapters/hooks/useControlAdapterIsEnabled'; import { useControlAdapterResizeMode } from 'features/controlAdapters/hooks/useControlAdapterResizeMode'; import { controlAdapterResizeModeChanged } from 'features/controlAdapters/store/controlAdaptersSlice'; @@ -30,7 +29,7 @@ const ParamControlAdapterResizeMode = ({ id }: Props) => { [t] ); - const handleResizeModeChange = useCallback( + const handleResizeModeChange = useCallback( (v) => { if (!isResizeMode(v?.value)) { return; @@ -55,17 +54,15 @@ const ParamControlAdapterResizeMode = ({ id }: Props) => { } return ( - - + {t('controlnet.resizeMode')} + - + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterWeight.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterWeight.tsx index 65a70d78de..95e3a99df5 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterWeight.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/parameters/ParamControlAdapterWeight.tsx @@ -1,8 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import { InvNumberInput } from 'common/components/InvNumberInput/InvNumberInput'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { useControlAdapterIsEnabled } from 'features/controlAdapters/hooks/useControlAdapterIsEnabled'; import { useControlAdapterWeight } from 'features/controlAdapters/hooks/useControlAdapterWeight'; import { controlAdapterWeightChanged } from 'features/controlAdapters/store/controlAdaptersSlice'; @@ -46,35 +48,30 @@ const ParamControlAdapterWeight = ({ id }: ParamControlAdapterWeightProps) => { } return ( - - - - - - + + {t('controlnet.weight')} + + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/CannyProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/CannyProcessor.tsx index 0f0a66ce64..4803188202 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/CannyProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/CannyProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredCannyImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -39,26 +43,40 @@ const CannyProcessor = (props: CannyProcessorProps) => { return ( - - + {t('controlnet.lowThreshold')} + - - - + + + {t('controlnet.highThreshold')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/ColorMapProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/ColorMapProcessor.tsx index 646f3c93aa..efbd4e5ba5 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/ColorMapProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/ColorMapProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredColorMapImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -32,11 +36,9 @@ const ColorMapProcessor = (props: ColorMapProcessorProps) => { return ( - - + {t('controlnet.colorMapTileSize')} + { max={256} step={1} marks - withNumberInput - numberInputMax={4096} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/ContentShuffleProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/ContentShuffleProcessor.tsx index 941697dfb1..cca0aba74c 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/ContentShuffleProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/ContentShuffleProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredContentShuffleImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -60,67 +64,96 @@ const ContentShuffleProcessor = (props: Props) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - - - + + + {t('controlnet.w')} + - - - + + + {t('controlnet.h')} + - - - + + + {t('controlnet.f')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/HedProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/HedProcessor.tsx index 7776d7c5f3..83c406829b 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/HedProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/HedProcessor.tsx @@ -1,6 +1,10 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, + Switch, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredHedImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -51,37 +55,46 @@ const HedPreprocessor = (props: HedProcessorProps) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - - - - + + + + {t('controlnet.scribble')} + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartAnimeProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartAnimeProcessor.tsx index 18ecb4436d..a1651cd428 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartAnimeProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartAnimeProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredLineartAnimeImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -39,34 +43,42 @@ const LineartAnimeProcessor = (props: Props) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartProcessor.tsx index 1407e3a006..3535d15d3c 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/LineartProcessor.tsx @@ -1,6 +1,10 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, + Switch, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredLineartImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -48,37 +52,46 @@ const LineartProcessor = (props: LineartProcessorProps) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - - - - + + + + {t('controlnet.coarse')} + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/MediapipeFaceProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/MediapipeFaceProcessor.tsx index 0d8514f405..e914491000 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/MediapipeFaceProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/MediapipeFaceProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredMediapipeFaceProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -39,19 +43,27 @@ const MediapipeFaceProcessor = (props: Props) => { return ( - - + {t('controlnet.maxFaces')} + - - - + + + {t('controlnet.minConfidence')} + { max={1} step={0.01} marks - withNumberInput /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/MidasDepthProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/MidasDepthProcessor.tsx index ba9867918b..e95c4c8a7f 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/MidasDepthProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/MidasDepthProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredMidasDepthImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -39,8 +43,9 @@ const MidasDepthProcessor = (props: Props) => { return ( - - + {t('controlnet.amult')} + { max={20} step={0.01} marks - withNumberInput /> - - - + + + {t('controlnet.bgth')} + { max={20} step={0.01} marks - withNumberInput /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/MlsdImageProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/MlsdImageProcessor.tsx index f33773908e..34a993b070 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/MlsdImageProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/MlsdImageProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredMlsdImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -53,36 +57,45 @@ const MlsdImageProcessor = (props: Props) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - - - + + + {t('controlnet.w')} + { max={1} step={0.01} marks={marks0to1} - withNumberInput /> - - - + + + {t('controlnet.h')} + { max={1} step={0.01} marks={marks0to1} - withNumberInput /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/NormalBaeProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/NormalBaeProcessor.tsx index 2e526a9a84..24b83ef950 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/NormalBaeProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/NormalBaeProcessor.tsx @@ -1,5 +1,9 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredNormalbaeImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -39,34 +43,42 @@ const NormalBaeProcessor = (props: Props) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/OpenposeProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/OpenposeProcessor.tsx index 950cbc8dea..8385183cbc 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/OpenposeProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/OpenposeProcessor.tsx @@ -1,6 +1,10 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, + Switch, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredOpenposeImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -48,40 +52,46 @@ const OpenposeProcessor = (props: Props) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - - - - + + + {t('controlnet.handAndFace')} + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/PidiProcessor.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/PidiProcessor.tsx index 2cbc5e5a6f..e8dac66e19 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/PidiProcessor.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/PidiProcessor.tsx @@ -1,6 +1,10 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, + Switch, +} from '@invoke-ai/ui'; import { useProcessorNodeChanged } from 'features/controlAdapters/components/hooks/useProcessorNodeChanged'; import { CONTROLNET_PROCESSORS } from 'features/controlAdapters/store/constants'; import type { RequiredPidiImageProcessorInvocation } from 'features/controlAdapters/store/types'; @@ -55,40 +59,50 @@ const PidiProcessor = (props: Props) => { return ( - - + {t('controlnet.detectResolution')} + - - - + + + {t('controlnet.imageResolution')} + - - - - - - - + + + + {t('controlnet.scribble')} + + + + {t('controlnet.safe')} + + ); }; diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx index dbd6f7830f..1eb1b45de1 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx index ca63eb5270..e312553daf 100644 --- a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx +++ b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx @@ -1,11 +1,11 @@ +import type { IconButtonProps } from '@invoke-ai/ui'; +import { IconButton } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import type { InvIconButtonProps } from 'common/components/InvIconButton/types'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { PiTrashSimpleBold } from 'react-icons/pi'; -type DeleteImageButtonProps = Omit & { +type DeleteImageButtonProps = Omit & { onClick: () => void; }; @@ -15,7 +15,7 @@ export const DeleteImageButton = memo((props: DeleteImageButtonProps) => { const isConnected = useAppSelector((s) => s.system.isConnected); return ( - } tooltip={`${t('gallery.deleteImage')} (Del)`} diff --git a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx index 257b5022f7..b59d810bd1 100644 --- a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx +++ b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx @@ -1,10 +1,14 @@ -import { Divider, Flex } from '@chakra-ui/react'; +import { + ConfirmationAlertDialog, + Divider, + Flex, + FormControl, + FormLabel, + Switch, + Text, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; -import { InvText } from 'common/components/InvText/wrapper'; import { selectCanvasSlice } from 'features/canvas/store/canvasSlice'; import { selectControlAdaptersSlice } from 'features/controlAdapters/store/controlAdaptersSlice'; import { imageDeletionConfirmed } from 'features/deleteImageModal/store/actions'; @@ -101,7 +105,7 @@ const DeleteImageModal = () => { }, [dispatch, imagesToDelete, imagesUsage]); return ( - { - + {canRestoreDeletedImagesFromBin ? t('gallery.deleteImageBin') : t('gallery.deleteImagePermanent')} - - {t('common.areYouSure')} - - + {t('common.areYouSure')} + + {t('common.dontAskMeAgain')} + - + - + ); }; diff --git a/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx b/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx index c39a7a97cd..2e5c4efe24 100644 --- a/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx +++ b/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx @@ -1,5 +1,4 @@ -import { ListItem, UnorderedList } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { ListItem, Text, UnorderedList } from '@invoke-ai/ui'; import type { ImageUsage } from 'features/deleteImageModal/store/types'; import { some } from 'lodash-es'; import { memo } from 'react'; @@ -28,7 +27,7 @@ const ImageUsageMessage = (props: Props) => { return ( <> - {topMessage} + {topMessage} {imageUsage.isInitialImage && ( {t('common.img2img')} @@ -43,7 +42,7 @@ const ImageUsageMessage = (props: Props) => { {t('common.nodeEditor')} )} - {bottomMessage} + {bottomMessage} > ); }; diff --git a/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx b/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx index 956ebfb4b6..f52f7945e0 100644 --- a/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx +++ b/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx @@ -1,7 +1,6 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import { Box, Flex, Heading, Image } from '@chakra-ui/react'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { Box, Flex, Heading, Image, Text } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvText } from 'common/components/InvText/wrapper'; import type { TypesafeDraggableData } from 'features/dnd/types'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -54,7 +53,7 @@ const DragPreview = (props: OverlayDragImageProps) => { whiteSpace="nowrap" fontSize="sm" > - {field.label || fieldTemplate.title} + {field.label || fieldTemplate.title} ); } diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/components/DynamicPromptsPreviewModal.tsx b/invokeai/frontend/web/src/features/dynamicPrompts/components/DynamicPromptsPreviewModal.tsx index 68869f0898..8a67e36874 100644 --- a/invokeai/frontend/web/src/features/dynamicPrompts/components/DynamicPromptsPreviewModal.tsx +++ b/invokeai/frontend/web/src/features/dynamicPrompts/components/DynamicPromptsPreviewModal.tsx @@ -1,12 +1,12 @@ -import { Flex } from '@chakra-ui/layout'; import { - InvModal, - InvModalBody, - InvModalCloseButton, - InvModalContent, - InvModalHeader, - InvModalOverlay, -} from 'common/components/InvModal/wrapper'; + Flex, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalHeader, + ModalOverlay, +} from '@invoke-ai/ui'; import { useDynamicPromptsModal } from 'features/dynamicPrompts/hooks/useDynamicPromptsModal'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -20,27 +20,20 @@ export const DynamicPromptsModal = memo(() => { const { isOpen, onClose } = useDynamicPromptsModal(); return ( - - - - {t('dynamicPrompts.dynamicPrompts')} - - + + + + {t('dynamicPrompts.dynamicPrompts')} + + - - - + + + ); }); diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsCombinatorial.tsx b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsCombinatorial.tsx index 7b0df5e602..1a772d8245 100644 --- a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsCombinatorial.tsx +++ b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsCombinatorial.tsx @@ -1,6 +1,5 @@ +import { FormControl, FormLabel, Switch } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; import { combinatorialToggled } from 'features/dynamicPrompts/store/dynamicPromptsSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -15,9 +14,10 @@ const ParamDynamicPromptsCombinatorial = () => { }, [dispatch]); return ( - - - + + {t('dynamicPrompts.combinatorial')} + + ); }; diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsMaxPrompts.tsx b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsMaxPrompts.tsx index c4b69d49e4..e6f5616f13 100644 --- a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsMaxPrompts.tsx +++ b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsMaxPrompts.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { maxPromptsChanged } from 'features/dynamicPrompts/store/dynamicPromptsSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -34,24 +38,28 @@ const ParamDynamicPromptsMaxPrompts = () => { ); return ( - - {t('dynamicPrompts.maxPrompts')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx index b54438c9c3..c6c424d479 100644 --- a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx +++ b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx @@ -1,10 +1,9 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import { Flex, ListItem, OrderedList, Spinner } from '@chakra-ui/react'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { Flex, ListItem, OrderedList, Spinner, Text } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; import IAIInformationalPopover from 'common/components/IAIInformationalPopover/IAIInformationalPopover'; -import { InvText } from 'common/components/InvText/wrapper'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import { selectDynamicPromptsSlice } from 'features/dynamicPrompts/store/dynamicPromptsSlice'; import { memo, useMemo } from 'react'; @@ -57,9 +56,9 @@ const ParamDynamicPromptsPreview = () => { return ( <> - + {label} - + { key={`${prompt}.${i}`} sx={listItemStyles} > - {prompt} + {prompt} ))} diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsSeedBehaviour.tsx b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsSeedBehaviour.tsx index 85ef020dfa..069f41ff3c 100644 --- a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsSeedBehaviour.tsx +++ b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsSeedBehaviour.tsx @@ -1,10 +1,6 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { isSeedBehaviour, seedBehaviourChanged, @@ -17,7 +13,7 @@ const ParamDynamicPromptsSeedBehaviour = () => { const { t } = useTranslation(); const seedBehaviour = useAppSelector((s) => s.dynamicPrompts.seedBehaviour); - const options = useMemo(() => { + const options = useMemo(() => { return [ { value: 'PER_ITERATION', @@ -32,7 +28,7 @@ const ParamDynamicPromptsSeedBehaviour = () => { ]; }, [t]); - const handleChange = useCallback( + const handleChange = useCallback( (v) => { if (!isSeedBehaviour(v?.value)) { return; @@ -48,13 +44,13 @@ const ParamDynamicPromptsSeedBehaviour = () => { ); return ( - - - + {t('dynamicPrompts.seedBehaviour.label')} + + ); }; diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/components/ShowDynamicPromptsPreviewButton.tsx b/invokeai/frontend/web/src/features/dynamicPrompts/components/ShowDynamicPromptsPreviewButton.tsx index a66cc09141..7dceb6acfc 100644 --- a/invokeai/frontend/web/src/features/dynamicPrompts/components/ShowDynamicPromptsPreviewButton.tsx +++ b/invokeai/frontend/web/src/features/dynamicPrompts/components/ShowDynamicPromptsPreviewButton.tsx @@ -1,12 +1,10 @@ -import type { SystemStyleObject } from '@chakra-ui/styled-system'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { IconButton, spinAnimation, Tooltip } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { useDynamicPromptsModal } from 'features/dynamicPrompts/hooks/useDynamicPromptsModal'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { BsBracesAsterisk } from 'react-icons/bs'; -import { spinAnimation } from 'theme/animations'; const loadingStyles: SystemStyleObject = { svg: { animation: spinAnimation }, @@ -17,14 +15,14 @@ export const ShowDynamicPromptsPreviewButton = memo(() => { const isLoading = useAppSelector((s) => s.dynamicPrompts.isLoading); const { isOpen, onOpen } = useDynamicPromptsModal(); return ( - - { onClick={onOpen} sx={isLoading ? loadingStyles : undefined} /> - + ); }); diff --git a/invokeai/frontend/web/src/features/embedding/AddEmbeddingButton.tsx b/invokeai/frontend/web/src/features/embedding/AddEmbeddingButton.tsx index 7990fea0e5..c1207a13b0 100644 --- a/invokeai/frontend/web/src/features/embedding/AddEmbeddingButton.tsx +++ b/invokeai/frontend/web/src/features/embedding/AddEmbeddingButton.tsx @@ -1,5 +1,4 @@ -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { IconButton, Tooltip } from '@invoke-ai/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { PiCodeBold } from 'react-icons/pi'; @@ -13,15 +12,15 @@ export const AddEmbeddingButton = memo((props: Props) => { const { onOpen, isOpen } = props; const { t } = useTranslation(); return ( - - + } onClick={onOpen} /> - + ); }); diff --git a/invokeai/frontend/web/src/features/embedding/EmbeddingPopover.tsx b/invokeai/frontend/web/src/features/embedding/EmbeddingPopover.tsx index 484f484d8a..bd39c1012a 100644 --- a/invokeai/frontend/web/src/features/embedding/EmbeddingPopover.tsx +++ b/invokeai/frontend/web/src/features/embedding/EmbeddingPopover.tsx @@ -1,25 +1,18 @@ import { - InvPopover, - InvPopoverAnchor, - InvPopoverBody, - InvPopoverContent, -} from 'common/components/InvPopover/wrapper'; + Popover, + PopoverAnchor, + PopoverBody, + PopoverContent, +} from '@invoke-ai/ui'; import { EmbeddingSelect } from 'features/embedding/EmbeddingSelect'; import type { EmbeddingPopoverProps } from 'features/embedding/types'; import { memo } from 'react'; -import { PARAMETERS_PANEL_WIDTH } from 'theme/util/constants'; export const EmbeddingPopover = memo((props: EmbeddingPopoverProps) => { - const { - onSelect, - isOpen, - onClose, - width = PARAMETERS_PANEL_WIDTH, - children, - } = props; + const { onSelect, isOpen, onClose, width, children } = props; return ( - { returnFocusOnClose={true} isLazy > - {children} - {children} + { borderWidth="2px" borderStyle="solid" > - + - - - + + + ); }); diff --git a/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx b/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx index 57b36d75eb..2a263894ff 100644 --- a/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx +++ b/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx @@ -1,8 +1,7 @@ -import type { ChakraProps } from '@chakra-ui/react'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { Combobox, FormControl } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import type { EmbeddingSelectProps } from 'features/embedding/types'; import { t } from 'i18next'; import { memo, useCallback } from 'react'; @@ -40,15 +39,15 @@ export const EmbeddingSelect = memo( [onSelect] ); - const { options, onChange } = useGroupedModelInvSelect({ + const { options, onChange } = useGroupedModelCombobox({ modelEntities: data, getIsDisabled, onChange: _onChange, }); return ( - - + - + ); } ); diff --git a/invokeai/frontend/web/src/features/embedding/usePrompt.ts b/invokeai/frontend/web/src/features/embedding/usePrompt.ts index 49716cf4ae..4c5878df6f 100644 --- a/invokeai/frontend/web/src/features/embedding/usePrompt.ts +++ b/invokeai/frontend/web/src/features/embedding/usePrompt.ts @@ -1,4 +1,4 @@ -import { useDisclosure } from '@chakra-ui/react'; +import { useDisclosure } from '@invoke-ai/ui'; import { isNil } from 'lodash-es'; import type { ChangeEventHandler, diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx index 72da8b3cba..edb15344c4 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx @@ -1,4 +1,4 @@ -import { Badge, Flex } from '@chakra-ui/react'; +import { Badge, Flex } from '@invoke-ai/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardAutoAddSelect.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardAutoAddSelect.tsx index 1c675aa412..aab12d0622 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardAutoAddSelect.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardAutoAddSelect.tsx @@ -1,10 +1,6 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { autoAddBoardIdChanged } from 'features/gallery/store/gallerySlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -19,7 +15,7 @@ const BoardAutoAddSelect = () => { ); const { options, hasBoards } = useListAllBoardsQuery(undefined, { selectFromResult: ({ data }) => { - const options: InvSelectOption[] = [ + const options: ComboboxOption[] = [ { label: 'None', value: 'none', @@ -37,7 +33,7 @@ const BoardAutoAddSelect = () => { }, }); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!v) { return; @@ -55,18 +51,16 @@ const BoardAutoAddSelect = () => { const noOptionsMessage = useCallback(() => t('boards.noMatching'), [t]); return ( - - + {t('boards.autoAddBoard')} + - + ); }; export default memo(BoardAutoAddSelect); diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx index 95e70b291f..09c4e94709 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx @@ -1,10 +1,7 @@ +import type { ContextMenuProps } from '@invoke-ai/ui'; +import { ContextMenu, MenuGroup, MenuItem, MenuList } from '@invoke-ai/ui'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import type { InvContextMenuProps } from 'common/components/InvContextMenu/InvContextMenu'; -import { InvContextMenu } from 'common/components/InvContextMenu/InvContextMenu'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; -import { InvMenuGroup } from 'common/components/InvMenu/wrapper'; import { autoAddBoardIdChanged, selectGallerySlice, @@ -24,7 +21,7 @@ import GalleryBoardContextMenuItems from './GalleryBoardContextMenuItems'; type Props = { board?: BoardDTO; board_id: BoardId; - children: InvContextMenuProps['children']; + children: ContextMenuProps['children']; setBoardToDelete?: (board?: BoardDTO) => void; }; @@ -91,22 +88,22 @@ const BoardContextMenu = ({ const renderMenuFunc = useCallback( () => ( - - - + + } isDisabled={isSelectedForAutoAdd || autoAssignBoardOnClick} onClick={handleSetAutoAdd} > {t('boards.menuItemAutoAdd')} - + {isBulkDownloadEnabled && ( - } onClickCapture={handleBulkDownload} > {t('boards.downloadBoard')} - + )} {board && ( )} - - + + ), [ autoAssignBoardOnClick, @@ -130,9 +127,7 @@ const BoardContextMenu = ({ ] ); - return ( - {children} - ); + return {children}; }; export default memo(BoardContextMenu); diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx index 7439d75c7c..5e7a4b0f99 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx @@ -1,4 +1,4 @@ -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import { IconButton } from '@invoke-ai/ui'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { PiPlusBold } from 'react-icons/pi'; @@ -13,7 +13,7 @@ const AddBoardButton = () => { }, [createBoard, DEFAULT_BOARD_NAME]); return ( - } isLoading={isLoading} tooltip={t('boards.addBoard')} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx index 69941ecd0c..4d62e5393c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx @@ -1,4 +1,4 @@ -import { Collapse, Flex, Grid, GridItem } from '@chakra-ui/react'; +import { Collapse, Flex, Grid, GridItem } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import DeleteBoardModal from 'features/gallery/components/Boards/DeleteBoardModal'; diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx index 5727dc79c0..e42ea03295 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx @@ -1,6 +1,10 @@ -import { Input, InputGroup, InputRightElement } from '@chakra-ui/react'; +import { + IconButton, + Input, + InputGroup, + InputRightElement, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; import { boardSearchTextChanged } from 'features/gallery/store/gallerySlice'; import type { ChangeEvent, KeyboardEvent } from 'react'; import { memo, useCallback } from 'react'; @@ -51,7 +55,7 @@ const BoardsSearch = () => { /> {boardSearchText && boardSearchText.length && ( - {(ref) => ( - + {t('unifiedCanvas.move')} + {t('unifiedCanvas.move')} } /> - + )} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx index a3ed79ff61..c8e8e3bb53 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx @@ -1,8 +1,6 @@ -import { Box, Flex, Image } from '@chakra-ui/react'; +import { Box, Flex, Image, Text, Tooltip } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import IAIDroppable from 'common/components/IAIDroppable'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import SelectionOverlay from 'common/components/SelectionOverlay'; import type { RemoveFromBoardDropData } from 'features/dnd/types'; import AutoAddIcon from 'features/gallery/components/Boards/AutoAddIcon'; @@ -81,7 +79,7 @@ const NoBoardBoard = memo(({ isSelected }: Props) => { > {(ref) => ( - + { {t('unifiedCanvas.move')} + {t('unifiedCanvas.move')} } /> - + )} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx index 20340713ed..0f78177371 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx @@ -1,17 +1,18 @@ -import { Flex, Skeleton } from '@chakra-ui/react'; +import { + AlertDialog, + AlertDialogBody, + AlertDialogContent, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogOverlay, + Button, + Flex, + Skeleton, + Text, +} from '@invoke-ai/ui'; import { skipToken } from '@reduxjs/toolkit/query'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; -import { - InvAlertDialog, - InvAlertDialogBody, - InvAlertDialogContent, - InvAlertDialogFooter, - InvAlertDialogHeader, - InvAlertDialogOverlay, -} from 'common/components/InvAlertDialog/wrapper'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvText } from 'common/components/InvText/wrapper'; import { selectCanvasSlice } from 'features/canvas/store/canvasSlice'; import { selectControlAdaptersSlice } from 'features/controlAdapters/store/controlAdaptersSlice'; import ImageUsageMessage from 'features/deleteImageModal/components/ImageUsageMessage'; @@ -117,19 +118,19 @@ const DeleteBoardModal = (props: Props) => { } return ( - - - - + + + {t('controlnet.delete')} {boardToDelete.board_name} - + - + {isFetchingBoardNames ? ( @@ -142,38 +143,38 @@ const DeleteBoardModal = (props: Props) => { bottomMessage={t('boards.bottomMessage')} /> )} - {t('boards.deletedBoardsCannotbeRestored')} - + {t('boards.deletedBoardsCannotbeRestored')} + {canRestoreDeletedImagesFromBin ? t('gallery.deleteImageBin') : t('gallery.deleteImagePermanent')} - + - - + + - + {t('boards.cancel')} - - + {t('boards.deleteBoardOnly')} - - + {t('boards.deleteBoardAndImages')} - + - - - - + + + + ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx index 014e1066bb..70e22a920c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx @@ -1,4 +1,4 @@ -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; +import { MenuItem } from '@invoke-ai/ui'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { PiTrashSimpleBold } from 'react-icons/pi'; @@ -20,13 +20,13 @@ const GalleryBoardContextMenuItems = ({ board, setBoardToDelete }: Props) => { return ( <> - } onClick={handleDelete} > {t('boards.deleteBoard')} - + > ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx index 32915eae8a..1dc4ca2265 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx @@ -1,13 +1,16 @@ -import { Flex } from '@chakra-ui/react'; +import { + ButtonGroup, + Flex, + IconButton, + Menu, + MenuButton, + MenuList, +} from '@invoke-ai/ui'; import { createSelector } from '@reduxjs/toolkit'; import { skipToken } from '@reduxjs/toolkit/query'; import { useAppToaster } from 'app/components/Toaster'; import { upscaleRequested } from 'app/store/middleware/listenerMiddleware/listeners/upscaleRequested'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; -import { InvMenu, InvMenuButton } from 'common/components/InvMenu/wrapper'; import { DeleteImageButton } from 'features/deleteImageModal/components/DeleteImageButton'; import { imagesToDeleteSelected } from 'features/deleteImageModal/store/slice'; import SingleSelectionMenuItems from 'features/gallery/components/ImageContextMenu/SingleSelectionMenuItems'; @@ -204,23 +207,23 @@ const CurrentImageButtons = () => { return ( <> - - - + + } /> - + {imageDTO && } - - - + + + - - + } tooltip={`${t('nodes.loadWorkflow')} (W)`} aria-label={`${t('nodes.loadWorkflow')} (W)`} @@ -228,7 +231,7 @@ const CurrentImageButtons = () => { onClick={handleLoadWorkflow} isLoading={getAndLoadEmbeddedWorkflowResult.isLoading} /> - } tooltip={`${t('parameters.usePrompt')} (P)`} @@ -236,7 +239,7 @@ const CurrentImageButtons = () => { isDisabled={!metadata?.positive_prompt} onClick={handleUsePrompt} /> - } tooltip={`${t('parameters.useSeed')} (S)`} @@ -244,7 +247,7 @@ const CurrentImageButtons = () => { isDisabled={metadata?.seed === null || metadata?.seed === undefined} onClick={handleUseSeed} /> - } tooltip={`${t('parameters.useSize')} (D)`} @@ -257,7 +260,7 @@ const CurrentImageButtons = () => { } onClick={handleUseSize} /> - } tooltip={`${t('parameters.useAll')} (A)`} @@ -265,37 +268,37 @@ const CurrentImageButtons = () => { isDisabled={!metadata} onClick={handleClickUseAllParameters} /> - + {isUpscalingEnabled && ( - + {isUpscalingEnabled && } - + )} - - + } tooltip={`${t('parameters.info')} (I)`} aria-label={`${t('parameters.info')} (I)`} isChecked={shouldShowImageDetails} onClick={handleClickShowImageDetails} /> - + - - + } isChecked={shouldShowProgressInViewer} onClick={handleClickProgressImagesToggle} /> - + - + - + > ); diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageDisplay.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageDisplay.tsx index 3341131a07..5d7a3755c3 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageDisplay.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageDisplay.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import { memo } from 'react'; import CurrentImageButtons from './CurrentImageButtons'; diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx index a609c8a7d8..1496562d5e 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex } from '@invoke-ai/ui'; import { createSelector } from '@reduxjs/toolkit'; import { skipToken } from '@reduxjs/toolkit/query'; import { useAppSelector } from 'app/store/storeHooks'; diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx index 94147e6751..6cb5ee05be 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx @@ -1,5 +1,5 @@ -import type { SystemStyleObject } from '@chakra-ui/react'; -import { Image } from '@chakra-ui/react'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { Image } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { memo, useMemo } from 'react'; diff --git a/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx b/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx index a91b7d557f..97e8f740ef 100644 --- a/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx @@ -1,5 +1,5 @@ import { ChevronUpIcon } from '@chakra-ui/icons'; -import { Button, Flex, Spacer } from '@chakra-ui/react'; +import { Button, Flex, Spacer } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { memo, useMemo } from 'react'; import { useBoardName } from 'services/api/hooks/useBoardName'; diff --git a/invokeai/frontend/web/src/features/gallery/components/GallerySettingsPopover.tsx b/invokeai/frontend/web/src/features/gallery/components/GallerySettingsPopover.tsx index 0554f87f45..8056a34f9c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/GallerySettingsPopover.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/GallerySettingsPopover.tsx @@ -1,16 +1,17 @@ -import { Flex } from '@chakra-ui/react'; -import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; import { - InvPopover, - InvPopoverBody, - InvPopoverContent, - InvPopoverTrigger, -} from 'common/components/InvPopover/wrapper'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; + Checkbox, + CompositeSlider, + Flex, + FormControl, + FormLabel, + IconButton, + Popover, + PopoverBody, + PopoverContent, + PopoverTrigger, + Switch, +} from '@invoke-ai/ui'; +import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { autoAssignBoardOnClickChanged, setGalleryImageMinimumWidth, @@ -55,44 +56,47 @@ const GallerySettingsPopover = () => { ); return ( - - - + + } /> - - - + + + - - + {t('gallery.galleryImageSize')} + - - - + + {t('gallery.autoSwitchNewImages')} + - - - + + {t('gallery.autoAssignBoardOnClick')} + - + - - - + + + ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx index f38fa8aeb2..ada0d7bf61 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx @@ -1,7 +1,6 @@ +import type { ContextMenuProps } from '@invoke-ai/ui'; +import { ContextMenu, MenuList } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import type { InvContextMenuProps } from 'common/components/InvContextMenu/InvContextMenu'; -import { InvContextMenu } from 'common/components/InvContextMenu/InvContextMenu'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; import { memo, useCallback } from 'react'; import type { ImageDTO } from 'services/api/types'; @@ -10,7 +9,7 @@ import SingleSelectionMenuItems from './SingleSelectionMenuItems'; type Props = { imageDTO: ImageDTO | undefined; - children: InvContextMenuProps['children']; + children: ContextMenuProps['children']; }; const ImageContextMenu = ({ imageDTO, children }: Props) => { @@ -23,22 +22,20 @@ const ImageContextMenu = ({ imageDTO, children }: Props) => { if (selectionCount > 1) { return ( - + - + ); } return ( - + - + ); }, [imageDTO, selectionCount]); - return ( - {children} - ); + return {children}; }; export default memo(ImageContextMenu); diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx index 86967af520..bf30bd2565 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx @@ -1,8 +1,7 @@ +import { MenuDivider, MenuItem } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { $customStarUI } from 'app/store/nanostores/customStarUI'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvMenuDivider } from 'common/components/InvMenu/wrapper'; import { imagesToChangeSelected, isModalOpenChanged, @@ -95,40 +94,40 @@ const MultipleSelectionMenuItems = () => { return ( <> {areAllStarred && ( - } onClickCapture={handleUnstarSelection} > {customStarUi ? customStarUi.off.text : `Unstar All`} - + )} {(areAllUnstarred || (!areAllStarred && !areAllUnstarred)) && ( - } onClickCapture={handleStarSelection} > {customStarUi ? customStarUi.on.text : `Star All`} - + )} {isBulkDownloadEnabled && ( - } onClickCapture={handleBulkDownload} > {t('gallery.downloadSelection')} - + )} - } onClickCapture={handleChangeBoard}> + } onClickCapture={handleChangeBoard}> {t('boards.changeBoard')} - - - + + } onClickCapture={handleDeleteSelection} > {t('gallery.deleteSelection')} - + > ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx index 17c37aae1a..acd70e2c64 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx @@ -1,10 +1,8 @@ -import { Flex, Spinner } from '@chakra-ui/react'; +import { Flex, MenuDivider, MenuItem, Spinner } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { useAppToaster } from 'app/components/Toaster'; import { $customStarUI } from 'app/store/nanostores/customStarUI'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvMenuDivider } from 'common/components/InvMenu/wrapper'; import { useCopyImageToClipboard } from 'common/hooks/useCopyImageToClipboard'; import { setInitialCanvasImage } from 'features/canvas/store/canvasSlice'; import { @@ -152,20 +150,20 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => { return ( <> - } > {t('common.openInNewTab')} - + {isClipboardAPIAvailable && ( - } onClickCapture={handleCopyImage}> + } onClickCapture={handleCopyImage}> {t('parameters.copyImage')} - + )} - { w="100%" > {t('parameters.downloadImage')} - - - + + @@ -188,8 +186,8 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => { isDisabled={!imageDTO.has_workflow} > {t('nodes.loadWorkflow')} - - + : } onClickCapture={handleRecallPrompt} isDisabled={ @@ -199,65 +197,65 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => { } > {t('parameters.usePrompt')} - - + : } onClickCapture={handleRecallSeed} isDisabled={isLoadingMetadata || metadata?.seed === undefined} > {t('parameters.useSeed')} - - + : } onClickCapture={handleUseAllParameters} isDisabled={isLoadingMetadata || !metadata} > {t('parameters.useAll')} - - - + + } onClickCapture={handleSendToImageToImage} id="send-to-img2img" > {t('parameters.sendToImg2Img')} - + {isCanvasEnabled && ( - } onClickCapture={handleSendToCanvas} id="send-to-canvas" > {t('parameters.sendToUnifiedCanvas')} - + )} - - } onClickCapture={handleChangeBoard}> + + } onClickCapture={handleChangeBoard}> {t('boards.changeBoard')} - + {imageDTO.starred ? ( - } onClickCapture={handleUnstarImage} > {customStarUi ? customStarUi.off.text : t('gallery.unstarImage')} - + ) : ( - } onClickCapture={handleStarImage} > {customStarUi ? customStarUi.on.text : t('gallery.starImage')} - + )} - - + } onClickCapture={handleDelete} > {t('gallery.deleteImage')} - + > ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx index 458661b3f3..aad3bfeecc 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx @@ -1,17 +1,17 @@ import { Box, + Button, + ButtonGroup, Flex, Tab, TabList, Tabs, useDisclosure, VStack, -} from '@chakra-ui/react'; +} from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { $galleryHeader } from 'app/store/nanostores/galleryHeader'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; import { galleryViewChanged } from 'features/gallery/store/gallerySlice'; import { memo, useCallback, useRef } from 'react'; import { useTranslation } from 'react-i18next'; @@ -77,9 +77,9 @@ const ImageGalleryContent = () => { w="full" > - + { {t('parameters.images')} { > {t('gallery.assets')} - + diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx index dceedaff27..893c419223 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx @@ -1,5 +1,5 @@ -import type { SystemStyleObject } from '@chakra-ui/react'; -import { Box, Flex } from '@chakra-ui/react'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { Box, Flex } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { $customStarUI } from 'app/store/nanostores/customStarUI'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx index fffa3d98e0..06f36784dd 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx @@ -1,8 +1,7 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Button, Flex } from '@invoke-ai/ui'; import type { EntityId } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; -import { InvButton } from 'common/components/InvButton/InvButton'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import { virtuosoGridRefs } from 'features/gallery/components/ImageGrid/types'; import { useGalleryHotkeys } from 'features/gallery/hooks/useGalleryHotkeys'; @@ -120,7 +119,7 @@ const GalleryImageGrid = () => { overscan={10} /> - { flexShrink={0} > {`Load More (${currentData.ids.length} of ${currentViewTotal})`} - + > ); } diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridItemContainer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridItemContainer.tsx index 6d793a767a..26247cc864 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridItemContainer.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridItemContainer.tsx @@ -1,5 +1,5 @@ -import type { FlexProps } from '@chakra-ui/react'; -import { Box, forwardRef } from '@chakra-ui/react'; +import type { FlexProps } from '@invoke-ai/ui'; +import { Box, forwardRef } from '@invoke-ai/ui'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridListContainer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridListContainer.tsx index 678748e8df..58d074712f 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridListContainer.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/ImageGridListContainer.tsx @@ -1,5 +1,5 @@ -import type { FlexProps } from '@chakra-ui/react'; -import { forwardRef, Grid } from '@chakra-ui/react'; +import type { FlexProps } from '@invoke-ai/ui'; +import { forwardRef, Grid } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx index bc814605b6..23c59f3af4 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx @@ -1,6 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { Box, Flex, IconButton, Tooltip } from '@invoke-ai/ui'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import { isString } from 'lodash-es'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'; @@ -69,26 +67,26 @@ const DataViewer = (props: Props) => { {withDownload && ( - - + } variant="ghost" opacity={0.7} onClick={handleDownload} /> - + )} {withCopy && ( - - + } variant="ghost" opacity={0.7} onClick={handleCopy} /> - + )} diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataItem.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataItem.tsx index f61a1ae656..96154e1729 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataItem.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataItem.tsx @@ -1,8 +1,5 @@ import { ExternalLinkIcon } from '@chakra-ui/icons'; -import { Flex, Link } from '@chakra-ui/react'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { Flex, IconButton, Link, Text, Tooltip } from '@invoke-ai/ui'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { IoArrowUndoCircleOutline } from 'react-icons/io5'; @@ -42,8 +39,8 @@ const ImageMetadataItem = ({ return ( {onClick && ( - - + } size="xs" @@ -51,11 +48,11 @@ const ImageMetadataItem = ({ fontSize={20} onClick={onClick} /> - + )} {withCopy && ( - - + } size="xs" @@ -63,20 +60,20 @@ const ImageMetadataItem = ({ fontSize={14} onClick={handleCopy} /> - + )} - + {label}: - + {isLink ? ( {value.toString()} ) : ( - + {value.toString()} - + )} diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx index f6ad443142..52770458f7 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx @@ -7,9 +7,9 @@ import { TabPanel, TabPanels, Tabs, -} from '@chakra-ui/react'; + Text, +} from '@invoke-ai/ui'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; -import { InvText } from 'common/components/InvText/wrapper'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -47,7 +47,7 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => { overflow="hidden" > - {t('common.file')}: + {t('common.file')}: {image.image_name} diff --git a/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx b/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx index 6163e595c9..350ac9be1c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx @@ -1,6 +1,5 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import { Box, Flex, Spinner } from '@chakra-ui/react'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { Box, Flex, IconButton, Spinner } from '@invoke-ai/ui'; import { useGalleryImages } from 'features/gallery/hooks/useGalleryImages'; import { useGalleryNavigation } from 'features/gallery/hooks/useGalleryNavigation'; import { memo } from 'react'; @@ -37,7 +36,7 @@ const NextPrevImageButtons = () => { insetInlineStart={1} > {!isOnFirstImage && ( - } variant="unstyled" @@ -54,7 +53,7 @@ const NextPrevImageButtons = () => { insetInlineEnd={6} > {!isOnLastImage && ( - } variant="unstyled" @@ -64,7 +63,7 @@ const NextPrevImageButtons = () => { /> )} {isOnLastImage && areMoreImagesAvailable && !isFetching && ( - } variant="unstyled" diff --git a/invokeai/frontend/web/src/features/hrf/components/HrfSettings.tsx b/invokeai/frontend/web/src/features/hrf/components/HrfSettings.tsx index b2517dc09c..cca4c49259 100644 --- a/invokeai/frontend/web/src/features/hrf/components/HrfSettings.tsx +++ b/invokeai/frontend/web/src/features/hrf/components/HrfSettings.tsx @@ -1,5 +1,5 @@ +import { FormControlGroup } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { memo } from 'react'; @@ -18,10 +18,10 @@ export const HrfSettings = memo(() => { return ( <> - + - + > ); }); diff --git a/invokeai/frontend/web/src/features/hrf/components/ParamHrfMethod.tsx b/invokeai/frontend/web/src/features/hrf/components/ParamHrfMethod.tsx index 6eafd57a2d..f13c041f79 100644 --- a/invokeai/frontend/web/src/features/hrf/components/ParamHrfMethod.tsx +++ b/invokeai/frontend/web/src/features/hrf/components/ParamHrfMethod.tsx @@ -1,16 +1,12 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { setHrfMethod } from 'features/hrf/store/hrfSlice'; import { isParameterHRFMethod } from 'features/parameters/types/parameterSchemas'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -const options: InvSelectOption[] = [ +const options: ComboboxOption[] = [ { label: 'ESRGAN', value: 'ESRGAN' }, { label: 'bilinear', value: 'bilinear' }, ]; @@ -20,7 +16,7 @@ const ParamHrfMethodSelect = () => { const { t } = useTranslation(); const hrfMethod = useAppSelector((s) => s.hrf.hrfMethod); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParameterHRFMethod(v?.value)) { return; @@ -36,9 +32,10 @@ const ParamHrfMethodSelect = () => { ); return ( - - - + + {t('hrf.upscaleMethod')} + + ); }; diff --git a/invokeai/frontend/web/src/features/hrf/components/ParamHrfStrength.tsx b/invokeai/frontend/web/src/features/hrf/components/ParamHrfStrength.tsx index a41e096148..3033b6f578 100644 --- a/invokeai/frontend/web/src/features/hrf/components/ParamHrfStrength.tsx +++ b/invokeai/frontend/web/src/features/hrf/components/ParamHrfStrength.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setHrfStrength } from 'features/hrf/store/hrfSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -29,8 +33,9 @@ const ParamHrfStrength = () => { ); return ( - - + {t('parameters.denoisingStrength')} + { defaultValue={initial} onChange={onChange} marks - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/hrf/components/ParamHrfToggle.tsx b/invokeai/frontend/web/src/features/hrf/components/ParamHrfToggle.tsx index 3099fb8027..47ce6190fc 100644 --- a/invokeai/frontend/web/src/features/hrf/components/ParamHrfToggle.tsx +++ b/invokeai/frontend/web/src/features/hrf/components/ParamHrfToggle.tsx @@ -1,7 +1,5 @@ +import { FormControl, FormLabel, Switch } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import type { InvLabelProps } from 'common/components/InvControl/types'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; import { setHrfEnabled } from 'features/hrf/store/hrfSlice'; import type { ChangeEvent } from 'react'; import { memo, useCallback } from 'react'; @@ -20,12 +18,11 @@ const ParamHrfToggle = () => { ); return ( - - - + + {t('hrf.enableHrf')} + + ); }; -const labelProps: InvLabelProps = { flexGrow: 1 }; - export default memo(ParamHrfToggle); diff --git a/invokeai/frontend/web/src/features/lora/components/LoRACard.tsx b/invokeai/frontend/web/src/features/lora/components/LoRACard.tsx index 4c9c9e96fb..7f58297cd5 100644 --- a/invokeai/frontend/web/src/features/lora/components/LoRACard.tsx +++ b/invokeai/frontend/web/src/features/lora/components/LoRACard.tsx @@ -1,13 +1,13 @@ -import { useAppDispatch } from 'app/store/storeHooks'; import { - InvCard, - InvCardBody, - InvCardHeader, -} from 'common/components/InvCard/wrapper'; -import { InvLabel } from 'common/components/InvControl/InvLabel'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvNumberInput } from 'common/components/InvNumberInput/InvNumberInput'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; + Card, + CardBody, + CardHeader, + CompositeNumberInput, + CompositeSlider, + FormLabel, + IconButton, +} from '@invoke-ai/ui'; +import { useAppDispatch } from 'app/store/storeHooks'; import type { LoRA } from 'features/lora/store/loraSlice'; import { loraRemoved, loraWeightChanged } from 'features/lora/store/loraSlice'; import { memo, useCallback } from 'react'; @@ -33,21 +33,21 @@ export const LoRACard = memo((props: LoRACardProps) => { }, [dispatch, lora.id]); return ( - - - + + + {lora.model_name} - - + } /> - - - + + { marks={marks} defaultValue={0.75} /> - { flexShrink={0} defaultValue={0.75} /> - - + + ); }); diff --git a/invokeai/frontend/web/src/features/lora/components/LoRAList.tsx b/invokeai/frontend/web/src/features/lora/components/LoRAList.tsx index 6eb889b874..4804cf76c6 100644 --- a/invokeai/frontend/web/src/features/lora/components/LoRAList.tsx +++ b/invokeai/frontend/web/src/features/lora/components/LoRAList.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/layout'; +import { Flex } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import { LoRACard } from 'features/lora/components/LoRACard'; diff --git a/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx b/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx index 0655fed3df..8b51e6876e 100644 --- a/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx +++ b/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx @@ -1,9 +1,8 @@ -import type { ChakraProps } from '@chakra-ui/react'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { loraAdded, selectLoraSlice } from 'features/lora/store/loraSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -41,7 +40,7 @@ const LoRASelect = () => { [dispatch] ); - const { options, onChange } = useGroupedModelInvSelect({ + const { options, onChange } = useGroupedModelCombobox({ modelEntities: data, getIsDisabled, onChange: _onChange, @@ -62,8 +61,9 @@ const LoRASelect = () => { const noOptionsMessage = useCallback(() => t('models.noMatchingLoRAs'), [t]); return ( - - + {t('models.lora')} + { data-testid="add-lora" sx={selectStyles} /> - + ); }; diff --git a/invokeai/frontend/web/src/features/lora/components/styles.ts b/invokeai/frontend/web/src/features/lora/components/styles.ts deleted file mode 100644 index 310ba5db96..0000000000 --- a/invokeai/frontend/web/src/features/lora/components/styles.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { cardAnatomy } from '@chakra-ui/anatomy'; -import { createMultiStyleConfigHelpers } from '@chakra-ui/react'; - -const { definePartsStyle } = createMultiStyleConfigHelpers(cardAnatomy.keys); - -export const cardVariantLora = definePartsStyle({ - container: { - backgroundColor: 'base.750', - p: 4, - gap: 2, - borderRadius: 'base', - minW: 64, - flexBasis: 1, - flexGrow: 1, - }, - header: { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - p: 0, - fontSize: 'md', - fontWeight: 'semibold', - }, - body: { - p: 0, - display: 'flex', - alignItems: 'center', - gap: 4, - }, - footer: { - p: 0, - }, -}); diff --git a/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsButton.tsx b/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsButton.tsx index 06875df44e..0fd2bdb3a6 100644 --- a/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsButton.tsx +++ b/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsButton.tsx @@ -1,5 +1,5 @@ -import { InvButton } from 'common/components/InvButton/InvButton'; -import type { InvButtonProps } from 'common/components/InvButton/types'; +import type { ButtonProps } from '@invoke-ai/ui'; +import { Button } from '@invoke-ai/ui'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -7,28 +7,26 @@ import { PiArrowsClockwiseBold } from 'react-icons/pi'; import { useSyncModels } from './useSyncModels'; -export const SyncModelsButton = memo( - (props: Omit) => { - const { t } = useTranslation(); - const { syncModels, isLoading } = useSyncModels(); - const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled; +export const SyncModelsButton = memo((props: Omit) => { + const { t } = useTranslation(); + const { syncModels, isLoading } = useSyncModels(); + const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled; - if (!isSyncModelEnabled) { - return null; - } - - return ( - } - minW="max-content" - {...props} - > - {t('modelManager.syncModels')} - - ); + if (!isSyncModelEnabled) { + return null; } -); + + return ( + } + minW="max-content" + {...props} + > + {t('modelManager.syncModels')} + + ); +}); SyncModelsButton.displayName = 'SyncModelsButton'; diff --git a/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsIconButton.tsx b/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsIconButton.tsx index 33b0c97c32..0bff475673 100644 --- a/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsIconButton.tsx +++ b/invokeai/frontend/web/src/features/modelManager/components/SyncModels/SyncModelsIconButton.tsx @@ -1,5 +1,5 @@ -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import type { InvIconButtonProps } from 'common/components/InvIconButton/types'; +import type { IconButtonProps } from '@invoke-ai/ui'; +import { IconButton } from '@invoke-ai/ui'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -8,7 +8,7 @@ import { PiArrowsClockwiseBold } from 'react-icons/pi'; import { useSyncModels } from './useSyncModels'; export const SyncModelsIconButton = memo( - (props: Omit) => { + (props: Omit) => { const { t } = useTranslation(); const { syncModels, isLoading } = useSyncModels(); const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled; @@ -18,7 +18,7 @@ export const SyncModelsIconButton = memo( } return ( - } tooltip={t('modelManager.syncModels')} aria-label={t('modelManager.syncModels')} diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx index 7fe19312cc..c3e85a3a5b 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx @@ -1,6 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; +import { Button, ButtonGroup, Flex } from '@invoke-ai/ui'; import { memo, useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -25,22 +23,22 @@ const AddModels = () => { maxHeight={window.innerHeight - 250} gap={4} > - - + {t('common.simple')} - - + {t('common.advanced')} - - + + {addModelMode === 'simple' && } {addModelMode === 'advanced' && } diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx index 26798c7574..1278f31667 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx @@ -1,9 +1,12 @@ -import { Flex } from '@chakra-ui/react'; +import { + Button, + Checkbox, + Flex, + FormControl, + FormLabel, + Input, +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; import { setAdvancedAddScanModel } from 'features/modelManager/store/modelManagerSlice'; import BaseModelSelect from 'features/modelManager/subpanels/shared/BaseModelSelect'; import CheckpointConfigsSelect from 'features/modelManager/subpanels/shared/CheckpointConfigsSelect'; @@ -117,41 +120,43 @@ const AdvancedAddCheckpoint = (props: AdvancedAddCheckpointProps) => { return ( - - {t('modelManager.model')} + value.trim().length > 3 || 'Must be at least 3 characters', })} /> - + control={control} name="base_model" /> - - {t('modelManager.modelLocation')} + value.trim().length > 0 || 'Must provide a path', onBlur, })} /> - - - - - - - + + + {t('modelManager.description')} + + + + {t('modelManager.vaeLocation')} + + control={control} name="variant" @@ -160,19 +165,21 @@ const AdvancedAddCheckpoint = (props: AdvancedAddCheckpointProps) => { {!useCustomConfig ? ( ) : ( - - - + + {t('modelManager.config')} + + )} - - + {t('modelManager.useCustomConfig')} + - - + + {t('modelManager.addModel')} - + diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddDiffusers.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddDiffusers.tsx index 0797a3e9da..2938662150 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddDiffusers.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddDiffusers.tsx @@ -1,8 +1,5 @@ -import { Flex } from '@chakra-ui/react'; +import { Button, Flex, FormControl, FormLabel, Input } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; import { setAdvancedAddScanModel } from 'features/modelManager/store/modelManagerSlice'; import BaseModelSelect from 'features/modelManager/subpanels/shared/BaseModelSelect'; import ModelVariantSelect from 'features/modelManager/subpanels/shared/ModelVariantSelect'; @@ -106,51 +103,54 @@ const AdvancedAddDiffusers = (props: AdvancedAddDiffusersProps) => { return ( - - {t('modelManager.name')} + value.trim().length > 3 || 'Must be at least 3 characters', })} /> - - + + + {t('modelManager.baseModel')} control={control} name="base_model" /> - - + - {t('modelManager.modelLocation')} + value.trim().length > 0 || 'Must provide a path', onBlur, })} /> - - - - - - - + + + {t('modelManager.description')} + + + + {t('modelManager.vaeLocation')} + + control={control} name="variant" /> - + {t('modelManager.addModel')} - + ); diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx index f9a63e498f..7ea4c68370 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx @@ -1,10 +1,5 @@ -import { Flex } from '@chakra-ui/react'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, Flex, FormControl, FormLabel } from '@invoke-ai/ui'; import { memo, useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { z } from 'zod'; @@ -22,14 +17,14 @@ const AdvancedAddModels = () => { useState('diffusers'); const { t } = useTranslation(); - const handleChange: InvSelectOnChange = useCallback((v) => { + const handleChange: ComboboxOnChange = useCallback((v) => { if (!isManualAddMode(v?.value)) { return; } setAdvancedAddMode(v.value); }, []); - const options: InvSelectOption[] = useMemo( + const options: ComboboxOption[] = useMemo( () => [ { label: t('modelManager.diffusersModels'), value: 'diffusers' }, { label: t('modelManager.checkpointOrSafetensors'), value: 'checkpoint' }, @@ -44,9 +39,10 @@ const AdvancedAddModels = () => { return ( - - - + + {t('modelManager.modelType')} + + {advancedAddMode === 'diffusers' && } diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx index 323c2b8039..9f58558d7a 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx @@ -1,9 +1,12 @@ -import { Flex } from '@chakra-ui/react'; +import { + Button, + Flex, + FormControl, + FormLabel, + Input, + Text, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvText } from 'common/components/InvText/wrapper'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import { setAdvancedAddScanModel } from 'features/modelManager/store/modelManagerSlice'; import { addToast } from 'features/system/store/systemSlice'; @@ -115,31 +118,29 @@ const FoundModelsList = () => { bg="base.800" > - - {model.split('\\').slice(-1)[0]} - - + {model.split('\\').slice(-1)[0]} + {model} - + {showActions ? ( - {t('modelManager.quickAdd')} - - + {t('modelManager.advanced')} - + ) : ( - { bg="invokeBlue.600" > {t('common.installed')} - + )} ); @@ -170,23 +171,24 @@ const FoundModelsList = () => { userSelect="none" bg="base.900" > - {t('modelManager.noModels')} + {t('modelManager.noModels')} ); } return ( - - - + + {t('modelManager.search')} + + - + {t('modelManager.modelsFound')}: {foundModels.length} - - + + {t('common.notInstalled')}: {filteredModels.length} - + diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx index 1cf11478c5..933a3c8498 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx @@ -1,13 +1,14 @@ -import { Box, Flex } from '@chakra-ui/react'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { + Box, + Combobox, + Flex, + FormControl, + FormLabel, + IconButton, + Text, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; -import { InvText } from 'common/components/InvText/wrapper'; import { setAdvancedAddScanModel } from 'features/modelManager/store/modelManagerSlice'; import { memo, useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -25,7 +26,7 @@ const ScanAdvancedAddModels = () => { const { t } = useTranslation(); - const options: InvSelectOption[] = useMemo( + const options: ComboboxOption[] = useMemo( () => [ { label: t('modelManager.diffusersModels'), value: 'diffusers' }, { label: t('modelManager.checkpointOrSafetensors'), value: 'checkpoint' }, @@ -54,7 +55,7 @@ const ScanAdvancedAddModels = () => { [dispatch] ); - const handleChangeAddMode = useCallback((v) => { + const handleChangeAddMode = useCallback((v) => { if (!isManualAddMode(v?.value)) { return; } @@ -88,25 +89,26 @@ const ScanAdvancedAddModels = () => { bg="base.800" > - + {isCheckpoint || advancedAddMode === 'checkpoint' ? 'Add Checkpoint Model' : 'Add Diffusers Model'} - - + } aria-label={t('modelManager.closeAdvanced')} onClick={handleClickSetAdvanced} size="sm" /> - - + {t('modelManager.modelType')} + - + {isCheckpoint ? ( - {t('common.folder')} - + {!searchFolder ? ( - {!searchFolder ? ( - } @@ -103,7 +100,7 @@ function SearchFolderForm() { type="submit" /> ) : ( - } @@ -113,7 +110,7 @@ function SearchFolderForm() { /> )} - } diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx index df23d1c4e2..8b7367153e 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SimpleAddModels.tsx @@ -1,11 +1,14 @@ -import { Flex } from '@chakra-ui/react'; +import type { ComboboxOption } from '@invoke-ai/ui'; +import { + Button, + Combobox, + Flex, + FormControl, + FormLabel, + Input, +} from '@invoke-ai/ui'; import { useForm } from '@mantine/form'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOption } from 'common/components/InvSelect/types'; import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; import type { CSSProperties } from 'react'; @@ -13,7 +16,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useImportMainModelsMutation } from 'services/api/endpoints/models'; -const options: InvSelectOption[] = [ +const options: ComboboxOption[] = [ { label: 'None', value: 'none' }, { label: 'v_prediction', value: 'v_prediction' }, { label: 'epsilon', value: 'epsilon' }, @@ -78,23 +81,25 @@ const SimpleAddModels = () => { style={formStyles} > - - + {t('modelManager.modelLocation')} + - - - + + {t('modelManager.predictionType')} + - - + + {t('modelManager.addModel')} - + ); diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx index 51ad6ab566..370af663f3 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ImportModelsPanel.tsx @@ -1,6 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; +import { Button, ButtonGroup, Flex } from '@invoke-ai/ui'; import { memo, useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -18,16 +16,16 @@ const ImportModelsPanel = () => { return ( - - + {t('modelManager.addModel')} - - + { isDisabled > {t('modelManager.scanForModels')} - - + + {addModelTab == 'add' && } {addModelTab == 'scan' && } diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx index 7418f2bc22..94d6574c0e 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx @@ -1,17 +1,20 @@ -import { Flex, Radio, RadioGroup } from '@chakra-ui/react'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { + Button, + Checkbox, + Combobox, + CompositeNumberInput, + CompositeSlider, + Flex, + FormControl, + FormLabel, + Input, + Radio, + RadioGroup, + Text, + Tooltip, +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; import { pickBy } from 'lodash-es'; @@ -25,7 +28,7 @@ import { } from 'services/api/endpoints/models'; import type { BaseModelType, MergeModelConfig } from 'services/api/types'; -const baseModelTypeSelectOptions: InvSelectOption[] = [ +const baseModelTypeSelectOptions: ComboboxOption[] = [ { label: 'Stable Diffusion 1', value: 'sd-1' }, { label: 'Stable Diffusion 2', value: 'sd-2' }, ]; @@ -115,7 +118,7 @@ const MergeModelsPanel = () => { [modelsMap, baseModel, modelOne, modelTwo] ); - const onChangeBaseModel = useCallback((v) => { + const onChangeBaseModel = useCallback((v) => { if (!v) { return; } @@ -127,19 +130,19 @@ const MergeModelsPanel = () => { setModelTwo(null); }, []); - const onChangeModelOne = useCallback((v) => { + const onChangeModelOne = useCallback((v) => { if (!v) { return; } setModelOne(v.value); }, []); - const onChangeModelTwo = useCallback((v) => { + const onChangeModelTwo = useCallback((v) => { if (!v) { return; } setModelTwo(v.value); }, []); - const onChangeModelThree = useCallback((v) => { + const onChangeModelThree = useCallback((v) => { if (!v) { setModelThree(null); setModelMergeInterp('add_difference'); @@ -261,50 +264,52 @@ const MergeModelsPanel = () => { return ( - {t('modelManager.modelMergeHeaderHelp1')} - + {t('modelManager.modelMergeHeaderHelp1')} + {t('modelManager.modelMergeHeaderHelp2')} - + - - + {t('modelManager.modelType')} + - - - + + {t('modelManager.modelOne')} + - - - + + {t('modelManager.modelTwo')} + - - - + + {t('modelManager.modelThree')} + - + - - - + + {t('modelManager.mergedModelName')} + + { gap={4} bg="base.800" > - - + {t('modelManager.alpha')} + - + + - + {t('modelManager.interpolationType')} - + {modelThree === null ? ( <> - - {t('modelManager.weightedSum')} - + {t('modelManager.weightedSum')} - {t('modelManager.sigmoid')} + {t('modelManager.sigmoid')} - - {t('modelManager.inverseSigmoid')} - + {t('modelManager.inverseSigmoid')} > ) : ( - - - {t('modelManager.addDifference')} - - + {t('modelManager.addDifference')} + )} @@ -375,51 +379,53 @@ const MergeModelsPanel = () => { bg="base.900" > - + {t('modelManager.mergedModelSaveLocation')} - + - - {t('modelManager.invokeAIFolder')} - + {t('modelManager.invokeAIFolder')} - {t('modelManager.custom')} + {t('modelManager.custom')} {modelMergeSaveLocType === 'custom' && ( - - + + {t('modelManager.mergedModelCustomSaveLocation')} + + - + )} - - + {t('modelManager.ignoreMismatch')} + - + - {t('modelManager.merge')} - + ); }; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx index 974af0076f..55272a98cc 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx @@ -1,5 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Flex, Text } from '@invoke-ai/ui'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { ALL_BASE_MODELS } from 'services/api/constants'; @@ -78,7 +77,7 @@ const ModelEdit = (props: ModelEditProps) => { maxH={96} userSelect="none" > - {t('modelManager.noModelSelected')} + {t('modelManager.noModelSelected')} ); }; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx index 096a05baab..b807cb0760 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx @@ -1,10 +1,15 @@ -import { Badge, Divider, Flex } from '@chakra-ui/react'; +import { + Badge, + Button, + Checkbox, + Divider, + Flex, + FormControl, + FormLabel, + Input, + Text, +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvText } from 'common/components/InvText/wrapper'; import BaseModelSelect from 'features/modelManager/subpanels/shared/BaseModelSelect'; import CheckpointConfigsSelect from 'features/modelManager/subpanels/shared/CheckpointConfigsSelect'; import ModelVariantSelect from 'features/modelManager/subpanels/shared/ModelVariantSelect'; @@ -110,12 +115,12 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => { - + {model.model_name} - - + + {MODEL_TYPE_MAP[model.base_model]} {t('modelManager.model')} - + {![''].includes(model.base_model) ? ( @@ -134,21 +139,22 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => { > - - {t('modelManager.name')} + value.trim().length > 3 || 'Must be at least 3 characters', })} /> - - - - + + + {t('modelManager.description')} + + control={control} name="base_model" @@ -157,41 +163,44 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => { control={control} name="variant" /> - - {t('modelManager.modelLocation')} + value.trim().length > 0 || 'Must provide a path', })} /> - - - - + + + {t('modelManager.vaeLocation')} + + {!useCustomConfig ? ( ) : ( - - - + + {t('modelManager.config')} + + )} - - + Use Custom Config + - + - + {t('modelManager.updateModel')} - + diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/DiffusersModelEdit.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/DiffusersModelEdit.tsx index aa8032d055..03f7c7ffaf 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/DiffusersModelEdit.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/DiffusersModelEdit.tsx @@ -1,9 +1,13 @@ -import { Divider, Flex } from '@chakra-ui/react'; +import { + Button, + Divider, + Flex, + FormControl, + FormLabel, + Input, + Text, +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvText } from 'common/components/InvText/wrapper'; import BaseModelSelect from 'features/modelManager/subpanels/shared/BaseModelSelect'; import ModelVariantSelect from 'features/modelManager/subpanels/shared/ModelVariantSelect'; import { MODEL_TYPE_MAP } from 'features/parameters/types/constants'; @@ -88,32 +92,33 @@ const DiffusersModelEdit = (props: DiffusersModelEditProps) => { return ( - + {model.model_name} - - + + {MODEL_TYPE_MAP[model.base_model]} {t('modelManager.model')} - + - - {t('modelManager.name')} + value.trim().length > 3 || 'Must be at least 3 characters', })} /> - - - - + + + {t('modelManager.description')} + + control={control} name="base_model" @@ -122,24 +127,25 @@ const DiffusersModelEdit = (props: DiffusersModelEditProps) => { control={control} name="variant" /> - - {t('modelManager.modelLocation')} + value.trim().length > 0 || 'Must provide a path', })} /> - - - - - + + + {t('modelManager.vaeLocation')} + + + {t('modelManager.updateModel')} - + diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/LoRAModelEdit.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/LoRAModelEdit.tsx index b8be206498..3e0b4c91ee 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/LoRAModelEdit.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/LoRAModelEdit.tsx @@ -1,9 +1,13 @@ -import { Divider, Flex } from '@chakra-ui/react'; +import { + Button, + Divider, + Flex, + FormControl, + FormLabel, + Input, + Text, +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvText } from 'common/components/InvText/wrapper'; import BaseModelSelect from 'features/modelManager/subpanels/shared/BaseModelSelect'; import { LORA_MODEL_FORMAT_MAP, @@ -88,53 +92,54 @@ const LoRAModelEdit = (props: LoRAModelEditProps) => { return ( - + {model.model_name} - - + + {MODEL_TYPE_MAP[model.base_model]} {t('modelManager.model')} ⋅{' '} {LORA_MODEL_FORMAT_MAP[model.model_format]} {t('common.format')} - + - - {t('modelManager.name')} + value.trim().length > 3 || 'Must be at least 3 characters', })} /> - - - - + + + {t('modelManager.description')} + + control={control} name="base_model" /> - - {t('modelManager.modelLocation')} + value.trim().length > 0 || 'Must provide a path', })} /> - - + + {t('modelManager.updateModel')} - + diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelConvert.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelConvert.tsx index 1b4c347969..ca272e8eff 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelConvert.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelConvert.tsx @@ -1,18 +1,19 @@ import { + Button, + ConfirmationAlertDialog, Flex, + FormControl, + FormLabel, + Input, ListItem, Radio, RadioGroup, + Text, + Tooltip, UnorderedList, useDisclosure, -} from '@chakra-ui/react'; +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; import type { ChangeEvent } from 'react'; @@ -122,7 +123,7 @@ const ModelConvert = (props: ModelConvertProps) => { return ( <> - { isLoading={isLoading} > 🧨 {t('modelManager.convertToDiffusers')} - - + { onClose={onClose} > - {t('modelManager.convertToDiffusersHelpText1')} + {t('modelManager.convertToDiffusersHelpText1')} {t('modelManager.convertToDiffusersHelpText2')} {t('modelManager.convertToDiffusersHelpText3')} {t('modelManager.convertToDiffusersHelpText4')} {t('modelManager.convertToDiffusersHelpText5')} - {t('modelManager.convertToDiffusersHelpText6')} + {t('modelManager.convertToDiffusersHelpText6')} - + {t('modelManager.convertToDiffusersSaveLocation')} - + - + {t('modelManager.invokeRoot')} - + - + {t('modelManager.custom')} - + {saveLocation === 'Custom' && ( - - + {t('modelManager.customSaveLocation')} + - + )} - + > ); }; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx index 944c714008..547050f80f 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx @@ -1,10 +1,14 @@ -import { Flex, Spinner } from '@chakra-ui/react'; +import { + Button, + ButtonGroup, + Flex, + FormControl, + FormLabel, + Input, + Spinner, + Text, +} from '@invoke-ai/ui'; import type { EntityState } from '@reduxjs/toolkit'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvText } from 'common/components/InvText/wrapper'; import { forEach } from 'lodash-es'; import type { ChangeEvent, PropsWithChildren } from 'react'; import { memo, useCallback, useState } from 'react'; @@ -82,40 +86,41 @@ const ModelList = (props: ModelListProps) => { return ( - - + {t('modelManager.allModels')} - - + {t('modelManager.diffusersModels')} - - + {t('modelManager.checkpointModels')} - - + {t('modelManager.loraModels')} - - + + - - - + + {t('modelManager.search')} + + { return ( - + {title} - + {modelList.map((model) => ( - + {loadingMessage ? loadingMessage : 'Fetching...'} - + ); diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx index e9c0dc670b..48774809d2 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx @@ -1,10 +1,14 @@ -import { Badge, Flex, useDisclosure } from '@chakra-ui/react'; +import { + Badge, + Button, + ConfirmationAlertDialog, + Flex, + IconButton, + Text, + Tooltip, + useDisclosure, +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { MODEL_TYPE_SHORT_MAP } from 'features/parameters/types/constants'; import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; @@ -84,7 +88,7 @@ const ModelListItem = (props: ModelListItemProps) => { return ( { ] } - - {model.model_name} - + + {model.model_name} + - } aria-label={t('modelManager.deleteConfig')} colorScheme="error" /> - { acceptButtonText={t('modelManager.delete')} > - {t('modelManager.deleteMsg1')} - {t('modelManager.deleteMsg2')} + {t('modelManager.deleteMsg1')} + {t('modelManager.deleteMsg2')} - + ); }; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel.tsx index 4fdfa93eba..91a6be5044 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import { memo } from 'react'; import SyncModels from './ModelManagerSettingsPanel/SyncModels'; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx index 608c1a9f70..d851b566ce 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx @@ -1,5 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Flex, Text } from '@invoke-ai/ui'; import { SyncModelsButton } from 'features/modelManager/components/SyncModels/SyncModelsButton'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -18,10 +17,10 @@ const SyncModels = () => { bg="base.800" > - {t('modelManager.syncModels')} - + {t('modelManager.syncModels')} + {t('modelManager.syncModelsDesc')} - + diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/shared/BaseModelSelect.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/shared/BaseModelSelect.tsx index 772d6b9d40..fdae4da7dd 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/shared/BaseModelSelect.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/shared/BaseModelSelect.tsx @@ -1,9 +1,5 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { typedMemo } from 'common/util/typedMemo'; import { MODEL_TYPE_MAP } from 'features/parameters/types/constants'; import { useCallback, useMemo } from 'react'; @@ -12,7 +8,7 @@ import { useController } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import type { AnyModelConfig } from 'services/api/types'; -const options: InvSelectOption[] = [ +const options: ComboboxOption[] = [ { value: 'sd-1', label: MODEL_TYPE_MAP['sd-1'] }, { value: 'sd-2', label: MODEL_TYPE_MAP['sd-2'] }, { value: 'sdxl', label: MODEL_TYPE_MAP['sdxl'] }, @@ -28,16 +24,17 @@ const BaseModelSelect = ( () => options.find((o) => o.value === field.value), [field.value] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { field.onChange(v?.value); }, [field] ); return ( - - - + + {t('modelManager.baseModel')} + + ); }; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/shared/CheckpointConfigsSelect.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/shared/CheckpointConfigsSelect.tsx index 572ab6367e..de6f214211 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/shared/CheckpointConfigsSelect.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/shared/CheckpointConfigsSelect.tsx @@ -1,10 +1,9 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; + ChakraProps, + ComboboxOnChange, + ComboboxOption, +} from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { memo, useCallback, useMemo } from 'react'; import { useController, type UseControllerProps } from 'react-hook-form'; import { useGetCheckpointConfigsQuery } from 'services/api/endpoints/models'; @@ -16,7 +15,7 @@ const CheckpointConfigsSelect = ( props: UseControllerProps ) => { const { data } = useGetCheckpointConfigsQuery(); - const options = useMemo( + const options = useMemo( () => (data ? data.map((i) => ({ label: i, value: i })) : []), [data] ); @@ -25,7 +24,7 @@ const CheckpointConfigsSelect = ( () => options.find((o) => o.value === field.value), [field.value, options] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { field.onChange(v?.value); }, @@ -33,15 +32,16 @@ const CheckpointConfigsSelect = ( ); return ( - - + Config File + - + ); }; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/shared/ModelVariantSelect.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/shared/ModelVariantSelect.tsx index 3e137cf495..4514e18250 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/shared/ModelVariantSelect.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/shared/ModelVariantSelect.tsx @@ -1,9 +1,5 @@ -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { typedMemo } from 'common/util/typedMemo'; import { useCallback, useMemo } from 'react'; import type { UseControllerProps } from 'react-hook-form'; @@ -14,7 +10,7 @@ import type { DiffusersModelConfig, } from 'services/api/types'; -const options: InvSelectOption[] = [ +const options: ComboboxOption[] = [ { value: 'normal', label: 'Normal' }, { value: 'inpaint', label: 'Inpaint' }, { value: 'depth', label: 'Depth' }, @@ -31,16 +27,17 @@ const ModelVariantSelect = < () => options.find((o) => o.value === field.value), [field.value] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { field.onChange(v?.value); }, [field] ); return ( - - - + + {t('modelManager.variant')} + + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx b/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx index 54f525f3e0..65d142a830 100644 --- a/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx @@ -1,6 +1,6 @@ import 'reactflow/dist/style.css'; -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; import TopPanel from 'features/nodes/components/flow/panels/TopPanel/TopPanel'; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx index 85669fb3c6..368f3c4f7e 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodePopover/AddNodePopover.tsx @@ -1,21 +1,18 @@ import 'reactflow/dist/style.css'; -import { Flex } from '@chakra-ui/react'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { + Combobox, + Flex, + Popover, + PopoverAnchor, + PopoverBody, + PopoverContent, +} from '@invoke-ai/ui'; import { useAppToaster } from 'app/components/Toaster'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import type { SelectInstance } from 'chakra-react-select'; -import { - InvPopover, - InvPopoverAnchor, - InvPopoverBody, - InvPopoverContent, -} from 'common/components/InvPopover/wrapper'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { useBuildNode } from 'features/nodes/hooks/useBuildNode'; import { addNodePopoverClosed, @@ -46,7 +43,7 @@ const createRegex = memoize( ); const filterOption = memoize( - (option: FilterOptionOption, inputValue: string) => { + (option: FilterOptionOption, inputValue: string) => { if (!inputValue) { return true; } @@ -64,7 +61,7 @@ const AddNodePopover = () => { const buildInvocation = useBuildNode(); const toaster = useAppToaster(); const { t } = useTranslation(); - const selectRef = useRef | null>(null); + const selectRef = useRef | null>(null); const inputRef = useRef(null); const fieldFilter = useAppSelector((s) => s.nodes.connectionStartFieldType); @@ -92,7 +89,7 @@ const AddNodePopover = () => { }) : map(nodeTemplates.templates); - const options: InvSelectOption[] = map( + const options: ComboboxOption[] = map( filteredNodeTemplates, (template) => { return { @@ -149,7 +146,7 @@ const AddNodePopover = () => { [dispatch, buildInvocation, toaster, t] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!v) { return; @@ -197,7 +194,7 @@ const AddNodePopover = () => { const noOptionsMessage = useCallback(() => t('nodes.noMatchingNodes'), [t]); return ( - { returnFocusOnClose={true} initialFocusRef={inputRef} > - + - - + { borderWidth="2px" borderStyle="solid" > - - + { inputRef={inputRef} closeMenuOnSelect={false} /> - - - + + + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx index 7a56ca845b..7d88aa1f58 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx @@ -1,4 +1,4 @@ -import { useToken } from '@chakra-ui/react'; +import { useToken } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { useGlobalMenuClose } from 'common/hooks/useGlobalMenuClose'; import { useIsValidConnection } from 'features/nodes/hooks/useIsValidConnection'; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx index 5e16d060d8..4c313d8f15 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx @@ -1,4 +1,4 @@ -import { Badge, Flex } from '@chakra-ui/react'; +import { Badge, Flex } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { useChakraThemeTokens } from 'common/hooks/useChakraThemeTokens'; import { memo, useMemo } from 'react'; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx index 6e12957874..038370db9c 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx @@ -1,9 +1,8 @@ -import { Flex, Image } from '@chakra-ui/react'; +import { Flex, Image, Text } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import IAIDndImage from 'common/components/IAIDndImage'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; -import { InvText } from 'common/components/InvText/wrapper'; import NextPrevImageButtons from 'features/gallery/components/NextPrevImageButtons'; import { selectGallerySlice } from 'features/gallery/store/gallerySlice'; import NodeWrapper from 'features/nodes/components/flow/nodes/common/NodeWrapper'; @@ -94,9 +93,9 @@ const Wrapper = (props: PropsWithChildren<{ nodeProps: NodeProps }>) => { justifyContent="center" h={8} > - + {t('nodes.currentImage')} - + { } return ( - } placement="top" shouldWrapChildren @@ -29,7 +28,7 @@ const InvocationNodeClassificationIcon = ({ nodeId }: Props) => { boxSize={4} color="base.400" /> - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx index fee2eb2c67..abe4ca0856 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx @@ -1,6 +1,5 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import { Flex } from '@chakra-ui/react'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { Flex, FormControlGroup } from '@invoke-ai/ui'; import { useHasImageOutput } from 'features/nodes/hooks/useHasImageOutput'; import { DRAG_HANDLE_CLASSNAME } from 'features/nodes/types/constants'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; @@ -30,10 +29,10 @@ const InvocationNodeFooter = ({ nodeId }: Props) => { h={8} justifyContent="space-between" > - + {isCacheEnabled && } {hasImageOutput && } - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx index a576f3e798..99caba2df8 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import NodeCollapseButton from 'features/nodes/components/flow/nodes/common/NodeCollapseButton'; import NodeTitle from 'features/nodes/components/flow/nodes/common/NodeTitle'; import InvocationNodeClassificationIcon from 'features/nodes/components/flow/nodes/Invocation/InvocationNodeClassificationIcon'; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx index 6f4761fb2a..42fd120cd1 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx @@ -1,6 +1,4 @@ -import { Flex, Icon } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { Flex, Icon, Text, Tooltip } from '@invoke-ai/ui'; import { compare } from 'compare-versions'; import { useNodeData } from 'features/nodes/hooks/useNodeData'; import { useNodeNeedsUpdate } from 'features/nodes/hooks/useNodeNeedsUpdate'; @@ -18,7 +16,7 @@ const InvocationNodeInfoIcon = ({ nodeId }: Props) => { const needsUpdate = useNodeNeedsUpdate(nodeId); return ( - } placement="top" shouldWrapChildren @@ -30,7 +28,7 @@ const InvocationNodeInfoIcon = ({ nodeId }: Props) => { w={8} color={needsUpdate ? 'error.400' : 'base.400'} /> - + ); }; @@ -64,62 +62,62 @@ const TooltipContent = memo(({ nodeId }: { nodeId: string }) => { if (!data.version) { return ( - + {t('nodes.versionUnknown')} - + ); } if (!nodeTemplate.version) { return ( - + {t('nodes.version')} {data.version} ({t('nodes.unknownTemplate')}) - + ); } if (compare(data.version, nodeTemplate.version, '<')) { return ( - + {t('nodes.version')} {data.version} ({t('nodes.updateNode')}) - + ); } if (compare(data.version, nodeTemplate.version, '>')) { return ( - + {t('nodes.version')} {data.version} ({t('nodes.updateApp')}) - + ); } return ( - + {t('nodes.version')} {data.version} - + ); }, [data, nodeTemplate, t]); if (!isInvocationNodeData(data)) { - return {t('nodes.unknownNode')}; + return {t('nodes.unknownNode')}; } return ( - + {title} - + {nodeTemplate?.nodePack && ( - + {t('nodes.nodePack')}: {nodeTemplate.nodePack} - + )} - + {nodeTemplate?.description} - + {versionComponent} - {data?.notes && {data.notes}} + {data?.notes && {data.notes}} ); }); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx index 1c45d86baa..b96edf9b2a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx @@ -1,9 +1,15 @@ -import type { SystemStyleObject } from '@chakra-ui/react'; -import { Badge, CircularProgress, Flex, Icon, Image } from '@chakra-ui/react'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { + Badge, + CircularProgress, + Flex, + Icon, + Image, + Text, + Tooltip, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { selectNodesSlice } from 'features/nodes/store/nodesSlice'; import { DRAG_HANDLE_CLASSNAME } from 'features/nodes/types/constants'; import type { NodeExecutionState } from 'features/nodes/types/invocation'; @@ -46,7 +52,7 @@ const InvocationNodeStatusIndicator = ({ nodeId }: Props) => { } return ( - } placement="top" > @@ -59,7 +65,7 @@ const InvocationNodeStatusIndicator = ({ nodeId }: Props) => { > - + ); }; @@ -73,7 +79,7 @@ const TooltipLabel = memo(({ nodeExecutionState }: TooltipLabelProps) => { const { status, progress, progressImage } = nodeExecutionState; const { t } = useTranslation(); if (status === zNodeStatus.enum.PENDING) { - return {t('queue.pending')}; + return {t('queue.pending')}; } if (status === zNodeStatus.enum.IN_PROGRESS) { if (progressImage) { @@ -97,21 +103,21 @@ const TooltipLabel = memo(({ nodeExecutionState }: TooltipLabelProps) => { if (progress !== null) { return ( - + {t('nodes.executionStateInProgress')} ({Math.round(progress * 100)}%) - + ); } - return {t('nodes.executionStateInProgress')}; + return {t('nodes.executionStateInProgress')}; } if (status === zNodeStatus.enum.COMPLETED) { - return {t('nodes.executionStateCompleted')}; + return {t('nodes.executionStateCompleted')}; } if (status === zNodeStatus.enum.FAILED) { - return {t('nodes.executionStateError')}; + return {t('nodes.executionStateError')}; } return null; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx index 7a3bcbac92..a1d1a93b0c 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx @@ -1,5 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Flex, Text } from '@invoke-ai/ui'; import NodeCollapseButton from 'features/nodes/components/flow/nodes/common/NodeCollapseButton'; import NodeWrapper from 'features/nodes/components/flow/nodes/common/NodeWrapper'; import { useNodePack } from 'features/nodes/hooks/useNodePack'; @@ -37,9 +36,9 @@ const InvocationNodeUnknownFallback = ({ fontSize="sm" > - + {label ? `${label} (${type})` : type} - + {isOpen && ( - + {t('nodes.unknownNodeType')}:{' '} - + {type} - - + + {nodePack && ( - + {t('nodes.nodePack')}:{' '} - + {nodePack} - - + + )} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/NotesTextarea.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/NotesTextarea.tsx index 8c08eed3a8..6e092b0448 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/NotesTextarea.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/NotesTextarea.tsx @@ -1,6 +1,5 @@ +import { FormControl, FormLabel, Textarea } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvTextarea } from 'common/components/InvTextarea/InvTextarea'; import { useNodeData } from 'features/nodes/hooks/useNodeData'; import { nodeNotesChanged } from 'features/nodes/store/nodesSlice'; import { isInvocationNodeData } from 'features/nodes/types/invocation'; @@ -22,14 +21,15 @@ const NotesTextarea = ({ nodeId }: { nodeId: string }) => { return null; } return ( - - + {t('nodes.notes')} + - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/SaveToGalleryCheckbox.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/SaveToGalleryCheckbox.tsx index 200e6775de..ca18428d30 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/SaveToGalleryCheckbox.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/SaveToGalleryCheckbox.tsx @@ -1,6 +1,5 @@ +import { Checkbox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; import { useHasImageOutput } from 'features/nodes/hooks/useHasImageOutput'; import { useIsIntermediate } from 'features/nodes/hooks/useIsIntermediate'; import { nodeIsIntermediateChanged } from 'features/nodes/store/nodesSlice'; @@ -30,9 +29,10 @@ const SaveToGalleryCheckbox = ({ nodeId }: { nodeId: string }) => { } return ( - - - + + {t('hotkeys.saveToGallery.title')} + + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx index 24c4ba2192..3385c23940 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/UseCacheCheckbox.tsx @@ -1,6 +1,5 @@ +import { Checkbox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvCheckbox } from 'common/components/InvCheckbox/wrapper'; -import { InvControl } from 'common/components/InvControl/InvControl'; import { useUseCache } from 'features/nodes/hooks/useUseCache'; import { nodeUseCacheChanged } from 'features/nodes/store/nodesSlice'; import type { ChangeEvent } from 'react'; @@ -23,13 +22,14 @@ const UseCacheCheckbox = ({ nodeId }: { nodeId: string }) => { ); const { t } = useTranslation(); return ( - - + {t('invocationCache.useCache')} + - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx index 0a7d421a42..65d41accec 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx @@ -1,14 +1,14 @@ -import type { SystemStyleObject } from '@chakra-ui/react'; +import type { SystemStyleObject } from '@invoke-ai/ui'; import { Editable, EditableInput, EditablePreview, Flex, forwardRef, + Tooltip, useEditableControls, -} from '@chakra-ui/react'; +} from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { useFieldLabel } from 'features/nodes/hooks/useFieldLabel'; import { useFieldTemplateTitle } from 'features/nodes/hooks/useFieldTemplateTitle'; import { fieldLabelChanged } from 'features/nodes/store/nodesSlice'; @@ -65,7 +65,7 @@ const EditableFieldTitle = forwardRef((props: Props, ref) => { }, [label, fieldTemplateTitle, t]); return ( - { - + ); }); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx index b95082d3e8..6c83cf2e9f 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx @@ -1,10 +1,7 @@ +import type { ContextMenuProps } from '@invoke-ai/ui'; +import { ContextMenu, MenuGroup, MenuItem, MenuList } from '@invoke-ai/ui'; import { createSelector } from '@reduxjs/toolkit'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import type { InvContextMenuProps } from 'common/components/InvContextMenu/InvContextMenu'; -import { InvContextMenu } from 'common/components/InvContextMenu/InvContextMenu'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; -import { InvMenuGroup } from 'common/components/InvMenu/wrapper'; import { useFieldInputKind } from 'features/nodes/hooks/useFieldInputKind'; import { useFieldLabel } from 'features/nodes/hooks/useFieldLabel'; import { useFieldTemplateTitle } from 'features/nodes/hooks/useFieldTemplateTitle'; @@ -22,7 +19,7 @@ type Props = { nodeId: string; fieldName: string; kind: 'input' | 'output'; - children: InvContextMenuProps['children']; + children: ContextMenuProps['children']; }; const FieldContextMenu = ({ nodeId, fieldName, kind, children }: Props) => { @@ -63,24 +60,24 @@ const FieldContextMenu = ({ nodeId, fieldName, kind, children }: Props) => { const menuItems: ReactNode[] = []; if (mayExpose && !isExposed) { menuItems.push( - } onClick={handleExposeField} > {t('nodes.addLinearView')} - + ); } if (mayExpose && isExposed) { menuItems.push( - } onClick={handleUnexposeField} > {t('nodes.removeLinearView')} - + ); } return menuItems; @@ -97,20 +94,18 @@ const FieldContextMenu = ({ nodeId, fieldName, kind, children }: Props) => { const renderMenuFunc = useCallback( () => !menuItems.length ? null : ( - - + {menuItems} - - + + ), [fieldTemplateTitle, label, menuItems, t] ); - return ( - {children} - ); + return {children}; }; export default memo(FieldContextMenu); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldHandle.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldHandle.tsx index 7ef3113ba3..1860217a92 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldHandle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldHandle.tsx @@ -1,4 +1,4 @@ -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { Tooltip } from '@invoke-ai/ui'; import { colorTokenToCssVar } from 'common/util/colorTokenToCssVar'; import { getFieldColor } from 'features/nodes/components/flow/edges/util/getEdgeColor'; import { useFieldTypeName } from 'features/nodes/hooks/usePrettyFieldType'; @@ -106,7 +106,7 @@ const FieldHandle = (props: FieldHandleProps) => { }, [connectionError, fieldTypeName, isConnectionInProgress]); return ( - { position={handleType === 'target' ? Position.Left : Position.Right} style={styles} /> - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx index d7ccddcf8b..ead253c06e 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx @@ -1,5 +1,4 @@ -import { Flex, forwardRef } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Flex, forwardRef, Text } from '@invoke-ai/ui'; import { useFieldLabel } from 'features/nodes/hooks/useFieldLabel'; import { useFieldTemplateTitle } from 'features/nodes/hooks/useFieldTemplateTitle'; import { memo } from 'react'; @@ -27,9 +26,9 @@ const FieldTitle = forwardRef((props: Props, ref) => { h="full" w="full" > - + {label || fieldTemplateTitle} - + ); }); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx index 90d870fdd1..5251da442e 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx @@ -1,5 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Flex, Text } from '@invoke-ai/ui'; import { useFieldInstance } from 'features/nodes/hooks/useFieldData'; import { useFieldTemplate } from 'features/nodes/hooks/useFieldTemplate'; import { useFieldTypeName } from 'features/nodes/hooks/usePrettyFieldType'; @@ -44,21 +43,21 @@ const FieldTooltipContent = ({ nodeId, fieldName, kind }: Props) => { return ( - {fieldTitle} + {fieldTitle} {fieldTemplate && ( - + {fieldTemplate.description} - + )} {fieldTypeName && ( - + {t('parameters.type')}: {fieldTypeName} - + )} {isInputTemplate && ( - + {t('common.input')}: {startCase(fieldTemplate.input)} - + )} ); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputField.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputField.tsx index adda415d6d..65ffbccb6f 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputField.tsx @@ -1,6 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvLabel } from 'common/components/InvControl/InvLabel'; +import { Flex, FormControl, FormLabel } from '@invoke-ai/ui'; import { useConnectionState } from 'features/nodes/hooks/useConnectionState'; import { useDoesInputHaveValue } from 'features/nodes/hooks/useDoesInputHaveValue'; import { useFieldInputInstance } from 'features/nodes/hooks/useFieldInputInstance'; @@ -60,7 +58,7 @@ const InputField = ({ nodeId, fieldName }: Props) => { if (!fieldTemplate || !fieldInstance) { return ( - { h="full" w="full" > - { {t('nodes.unknownInput', { name: fieldInstance?.label ?? fieldTemplate?.title ?? fieldName, })} - - + + ); } @@ -88,7 +86,7 @@ const InputField = ({ nodeId, fieldName }: Props) => { if (fieldTemplate.input === 'connection') { return ( - + { isMissingInput={isMissingInput} withTooltip /> - + { {(ref) => ( - { /> - + )} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx index e59ab5b836..161d5b64fd 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx @@ -1,5 +1,4 @@ -import { Box } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Box, Text } from '@invoke-ai/ui'; import { useFieldInstance } from 'features/nodes/hooks/useFieldData'; import { useFieldTemplate } from 'features/nodes/hooks/useFieldTemplate'; import { @@ -292,9 +291,9 @@ const InputFieldRenderer = ({ nodeId, fieldName }: InputFieldProps) => { return ( - + {t('nodes.unknownFieldType', { type: fieldInstance?.type.name })} - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx index f110647721..1c7d749b1e 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx @@ -1,7 +1,5 @@ -import { Flex, Icon, Spacer } from '@chakra-ui/react'; +import { Flex, Icon, IconButton, Spacer, Tooltip } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import NodeSelectionOverlay from 'common/components/NodeSelectionOverlay'; import { useMouseOverNode } from 'features/nodes/hooks/useMouseOverNode'; import { workflowExposedFieldRemoved } from 'features/nodes/store/workflowSlice'; @@ -46,7 +44,7 @@ const LinearViewField = ({ nodeId, fieldName }: Props) => { kind="input" /> - { - - + { if (!fieldTemplate || !fieldInstance) { return ( - - { {t('nodes.unknownOutput', { name: fieldTemplate?.title ?? fieldName, })} - - + + ); } return ( - { placement="top" shouldWrapChildren > - - {fieldTemplate?.title} - - + + {fieldTemplate?.title} + + { - const options: InvSelectOption[] = [ + const options: ComboboxOption[] = [ { label: 'None', value: 'none', @@ -42,7 +38,7 @@ const BoardFieldInputComponent = ( }, }); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!v) { return; @@ -66,15 +62,15 @@ const BoardFieldInputComponent = ( const noOptionsMessage = useCallback(() => t('boards.noMatching'), [t]); return ( - - + - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BooleanFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BooleanFieldInputComponent.tsx index db4cb12e4a..b4eb9b3b01 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BooleanFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BooleanFieldInputComponent.tsx @@ -1,4 +1,4 @@ -import { Switch } from '@chakra-ui/react'; +import { Switch } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; import { fieldBooleanValueChanged } from 'features/nodes/store/nodesSlice'; import type { diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ControlNetModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ControlNetModelFieldInputComponent.tsx index b9cfcbf7f7..8b3c138a2f 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ControlNetModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ControlNetModelFieldInputComponent.tsx @@ -1,8 +1,6 @@ +import { Combobox, FormControl, Tooltip } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { fieldControlNetModelValueChanged } from 'features/nodes/store/nodesSlice'; import type { ControlNetModelFieldInputInstance, @@ -41,7 +39,7 @@ const ControlNetModelFieldInputComponent = (props: Props) => { ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, selectedModel: field.value @@ -51,17 +49,17 @@ const ControlNetModelFieldInputComponent = (props: Props) => { }); return ( - - - + + - - + + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/EnumFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/EnumFieldInputComponent.tsx index 2642f51137..4d123a03b1 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/EnumFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/EnumFieldInputComponent.tsx @@ -1,4 +1,4 @@ -import { Select } from '@chakra-ui/react'; +import { Select } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; import { fieldEnumModelValueChanged } from 'features/nodes/store/nodesSlice'; import type { diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx index 61c8484e63..20867949f5 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx @@ -1,8 +1,6 @@ +import { Combobox, FormControl, Tooltip } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { fieldIPAdapterModelValueChanged } from 'features/nodes/store/nodesSlice'; import type { IPAdapterModelFieldInputInstance, @@ -40,7 +38,7 @@ const IPAdapterModelFieldInputComponent = ( [dispatch, field.name, nodeId] ); - const { options, value, onChange } = useGroupedModelInvSelect({ + const { options, value, onChange } = useGroupedModelCombobox({ modelEntities: ipAdapterModels, onChange: _onChange, selectedModel: field.value @@ -49,16 +47,16 @@ const IPAdapterModelFieldInputComponent = ( }); return ( - - - + + - - + + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx index 738cefbc28..67d4f366ca 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx @@ -1,9 +1,8 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex, Text } from '@invoke-ai/ui'; import { skipToken } from '@reduxjs/toolkit/query'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import IAIDndImage from 'common/components/IAIDndImage'; import IAIDndImageIcon from 'common/components/IAIDndImageIcon'; -import { InvText } from 'common/components/InvText/wrapper'; import type { TypesafeDraggableData, TypesafeDroppableData, @@ -108,9 +107,9 @@ export default memo(ImageFieldInputComponent); const UploadElement = memo(() => { const { t } = useTranslation(); return ( - + {t('gallery.dropOrUpload')} - + ); }); @@ -119,9 +118,9 @@ UploadElement.displayName = 'UploadElement'; const DropLabel = memo(() => { const { t } = useTranslation(); return ( - + {t('gallery.drop')} - + ); }); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/LoRAModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/LoRAModelFieldInputComponent.tsx index c273f5f47f..84dcdae740 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/LoRAModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/LoRAModelFieldInputComponent.tsx @@ -1,7 +1,6 @@ +import { Combobox, FormControl } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { fieldLoRAModelValueChanged } from 'features/nodes/store/nodesSlice'; import type { LoRAModelFieldInputInstance, @@ -39,7 +38,7 @@ const LoRAModelFieldInputComponent = (props: Props) => { ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, selectedModel: field.value @@ -49,19 +48,19 @@ const LoRAModelFieldInputComponent = (props: Props) => { }); return ( - - - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/MainModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/MainModelFieldInputComponent.tsx index 7c6b11c2ee..b7c059a288 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/MainModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/MainModelFieldInputComponent.tsx @@ -1,8 +1,6 @@ -import { Flex } from '@chakra-ui/react'; +import { Combobox, Flex, FormControl } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { SyncModelsIconButton } from 'features/modelManager/components/SyncModels/SyncModelsIconButton'; import { fieldMainModelValueChanged } from 'features/nodes/store/nodesSlice'; import type { @@ -41,7 +39,7 @@ const MainModelFieldInputComponent = (props: Props) => { [dispatch, field.name, nodeId] ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, isLoading, @@ -50,19 +48,19 @@ const MainModelFieldInputComponent = (props: Props) => { return ( - - - + ); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/NumberFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/NumberFieldInputComponent.tsx index 05b7a304ed..08838057af 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/NumberFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/NumberFieldInputComponent.tsx @@ -1,6 +1,6 @@ +import { CompositeNumberInput } from '@invoke-ai/ui'; import { NUMPY_RAND_MAX } from 'app/constants'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvNumberInput } from 'common/components/InvNumberInput/InvNumberInput'; import { fieldNumberValueChanged } from 'features/nodes/store/nodesSlice'; import type { FloatFieldInputInstance, @@ -60,7 +60,7 @@ const NumberFieldInputComponent = ( }, [fieldTemplate.exclusiveMaximum, fieldTemplate.maximum]); return ( - { [dispatch, field.name, nodeId] ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, isLoading, @@ -50,19 +48,19 @@ const RefinerModelFieldInputComponent = (props: Props) => { return ( - - - + ); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SDXLMainModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SDXLMainModelFieldInputComponent.tsx index b402317555..e34243d740 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SDXLMainModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SDXLMainModelFieldInputComponent.tsx @@ -1,8 +1,6 @@ -import { Flex } from '@chakra-ui/react'; +import { Combobox, Flex, FormControl } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { SyncModelsIconButton } from 'features/modelManager/components/SyncModels/SyncModelsIconButton'; import { fieldMainModelValueChanged } from 'features/nodes/store/nodesSlice'; import type { @@ -41,7 +39,7 @@ const SDXLMainModelFieldInputComponent = (props: Props) => { [dispatch, field.name, nodeId] ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, isLoading, @@ -50,19 +48,19 @@ const SDXLMainModelFieldInputComponent = (props: Props) => { return ( - - - + ); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SchedulerFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SchedulerFieldInputComponent.tsx index d16a9160a8..dfa75231a4 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SchedulerFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/SchedulerFieldInputComponent.tsx @@ -1,7 +1,6 @@ +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { Combobox, FormControl } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; import { fieldSchedulerValueChanged } from 'features/nodes/store/nodesSlice'; import type { SchedulerFieldInputInstance, @@ -22,7 +21,7 @@ const SchedulerFieldInputComponent = (props: Props) => { const { nodeId, field } = props; const dispatch = useAppDispatch(); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParameterScheduler(v?.value)) { return; @@ -44,13 +43,9 @@ const SchedulerFieldInputComponent = (props: Props) => { ); return ( - - - + + + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/StringFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/StringFieldInputComponent.tsx index 66c3c289be..e4f83a2c03 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/StringFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/StringFieldInputComponent.tsx @@ -1,6 +1,5 @@ +import { Input, Textarea } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvTextarea } from 'common/components/InvTextarea/InvTextarea'; import { fieldStringValueChanged } from 'features/nodes/store/nodesSlice'; import type { StringFieldInputInstance, @@ -32,7 +31,7 @@ const StringFieldInputComponent = ( if (fieldTemplate.ui_component === 'textarea') { return ( - - - + + - - + + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx index 7bfe59acdc..45e3c3c581 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx @@ -1,8 +1,6 @@ -import { Flex } from '@chakra-ui/layout'; +import { Combobox, Flex, FormControl } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { SyncModelsIconButton } from 'features/modelManager/components/SyncModels/SyncModelsIconButton'; import { fieldVaeModelValueChanged } from 'features/nodes/store/nodesSlice'; import type { @@ -40,7 +38,7 @@ const VAEModelFieldInputComponent = (props: Props) => { [dispatch, field.name, nodeId] ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, selectedModel: field.value ? { ...field.value, model_type: 'vae' } : null, @@ -49,19 +47,19 @@ const VAEModelFieldInputComponent = (props: Props) => { return ( - - - + ); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Notes/NotesNode.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Notes/NotesNode.tsx index ab790197cf..b9673e0474 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Notes/NotesNode.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Notes/NotesNode.tsx @@ -1,6 +1,5 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex, Textarea } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvTextarea } from 'common/components/InvTextarea/InvTextarea'; import NodeCollapseButton from 'features/nodes/components/flow/nodes/common/NodeCollapseButton'; import NodeTitle from 'features/nodes/components/flow/nodes/common/NodeTitle'; import NodeWrapper from 'features/nodes/components/flow/nodes/common/NodeWrapper'; @@ -49,7 +48,7 @@ const NotesNode = (props: NodeProps) => { gap={1} > - { }, [dispatch, isOpen, nodeId, updateNodeInternals]); return ( - { return ( - { }, [shouldShowMinimapPanel, dispatch]); return ( - - + } /> - } /> - } /> - {/* - } /> - */} - */} + { onClick={handleClickedToggleMiniMapPanel} icon={} /> - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx index 344d36570b..45409c0016 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx @@ -1,5 +1,5 @@ -import type { SystemStyleObject } from '@chakra-ui/react'; -import { chakra, Flex } from '@chakra-ui/react'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { chakra, Flex } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { memo } from 'react'; import { MiniMap } from 'reactflow'; @@ -28,8 +28,8 @@ const MinimapPanel = () => { zoomable nodeBorderRadius={15} sx={minimapStyles} - nodeColor="var(--invokeai-colors-base-600)" - maskColor="var(--invokeai-colors-blackAlpha-600)" + nodeColor="var(--invoke-colors-base-600)" + maskColor="var(--invoke-colors-blackAlpha-600)" /> )} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/AddNodeButton.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/AddNodeButton.tsx index 1e99a521db..cf59208749 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/AddNodeButton.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/AddNodeButton.tsx @@ -1,5 +1,5 @@ +import { IconButton } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; import { addNodePopoverOpened } from 'features/nodes/store/nodesSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -13,7 +13,7 @@ const AddNodeButton = () => { }, [dispatch]); return ( - } diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx index 3fcff30958..3f7834b59b 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx @@ -1,4 +1,4 @@ -import { Flex, Spacer } from '@chakra-ui/layout'; +import { Flex, Spacer } from '@invoke-ai/ui'; import AddNodeButton from 'features/nodes/components/flow/panels/TopPanel/AddNodeButton'; import UpdateNodesButton from 'features/nodes/components/flow/panels/TopPanel/UpdateNodesButton'; import WorkflowName from 'features/nodes/components/flow/panels/TopPanel/WorkflowName'; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/UpdateNodesButton.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/UpdateNodesButton.tsx index 966004ce9b..1d64aae5db 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/UpdateNodesButton.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/UpdateNodesButton.tsx @@ -1,5 +1,5 @@ +import { Button } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; import { useGetNodesNeedUpdate } from 'features/nodes/hooks/useGetNodesNeedUpdate'; import { updateAllNodesRequested } from 'features/nodes/store/actions'; import { memo, useCallback } from 'react'; @@ -19,13 +19,13 @@ const UpdateNodesButton = () => { } return ( - } onClick={handleClickUpdateNodes} pointerEvents="auto" > {t('nodes.updateAllNodes')} - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx index b08afa5290..76b81f6e2a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx @@ -1,5 +1,5 @@ +import { Text } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvText } from 'common/components/InvText/wrapper'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -20,7 +20,7 @@ const TopCenterPanel = () => { }, [t, name, isTouched, isWorkflowLibraryEnabled]); return ( - { opacity={0.8} > {displayName} - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/ReloadSchemaButton.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/ReloadSchemaButton.tsx index abdeecbca5..e3e40788aa 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/ReloadSchemaButton.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/ReloadSchemaButton.tsx @@ -1,5 +1,5 @@ +import { Button } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { PiArrowsClockwiseBold } from 'react-icons/pi'; @@ -14,14 +14,14 @@ const ReloadNodeTemplatesButton = () => { }, [dispatch]); return ( - } tooltip={t('nodes.reloadNodeTemplates')} aria-label={t('nodes.reloadNodeTemplates')} onClick={handleReloadSchema} > {t('nodes.reloadNodeTemplates')} - + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx index b446559cf7..48f79573fe 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import WorkflowLibraryButton from 'features/workflowLibrary/components/WorkflowLibraryButton'; import WorkflowLibraryMenu from 'features/workflowLibrary/components/WorkflowLibraryMenu/WorkflowLibraryMenu'; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx index a5bc38af52..ebfa660141 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx @@ -1,16 +1,20 @@ -import { Divider, Flex, Heading, useDisclosure } from '@chakra-ui/react'; +import { + Divider, + Flex, + FormControl, + FormLabel, + Heading, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalHeader, + ModalOverlay, + Switch, + useDisclosure, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { - InvModal, - InvModalBody, - InvModalCloseButton, - InvModalContent, - InvModalHeader, - InvModalOverlay, -} from 'common/components/InvModal/wrapper'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; import ReloadNodeTemplatesButton from 'features/nodes/components/flow/panels/TopRightPanel/ReloadSchemaButton'; import { selectionModeChanged, @@ -98,70 +102,60 @@ const WorkflowEditorSettings = ({ children }: Props) => { <> {children({ onOpen })} - - - - {t('nodes.workflowSettings')} - - + + + + {t('nodes.workflowSettings')} + + {t('parameters.general')} - - + {t('nodes.animatedEdges')} + - + - - + {t('nodes.snapToGrid')} + - + - - + {t('nodes.colorCodeEdges')} + - + - - + {t('nodes.fullyContainNodes')} + - + {t('common.advanced')} - - + {t('nodes.validateConnections')} + - + - - - + + + > ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/NodeEditorPanelGroup.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/NodeEditorPanelGroup.tsx index 20eb422de7..83c06051cc 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/NodeEditorPanelGroup.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/NodeEditorPanelGroup.tsx @@ -1,6 +1,6 @@ import 'reactflow/dist/style.css'; -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import QueueControls from 'features/queue/components/QueueControls'; import ResizeHandle from 'features/ui/components/tabs/ResizeHandle'; import { usePanelStorage } from 'features/ui/hooks/usePanelStorage'; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorDetailsTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorDetailsTab.tsx index 058610d580..a53f52b061 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorDetailsTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorDetailsTab.tsx @@ -1,9 +1,7 @@ -import { Box, Flex, HStack } from '@chakra-ui/react'; +import { Box, Flex, FormControl, FormLabel, HStack, Text } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvText } from 'common/components/InvText/wrapper'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import NotesTextarea from 'features/nodes/components/flow/nodes/Invocation/NotesTextarea'; import { useNodeNeedsUpdate } from 'features/nodes/hooks/useNodeNeedsUpdate'; @@ -85,16 +83,18 @@ const Content = memo((props: ContentProps) => { > - - + + {t('nodes.nodeType')} + {props.templateTitle} - - - - + + + + {t('nodes.nodeVersion')} + {props.nodeVersion} - - + + diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorOutputsTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorOutputsTab.tsx index 0a44c79a0b..5c94bd0dbc 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorOutputsTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorOutputsTab.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx index 49522013bb..583c5435bd 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx @@ -1,11 +1,4 @@ -import { - Flex, - Tab, - TabList, - TabPanel, - TabPanels, - Tabs, -} from '@chakra-ui/react'; +import { Flex, Tab, TabList, TabPanel, TabPanels, Tabs } from '@invoke-ai/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/details/EditableNodeTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/details/EditableNodeTitle.tsx index 8704f290b4..e749424fc8 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/details/EditableNodeTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/details/EditableNodeTitle.tsx @@ -1,9 +1,4 @@ -import { - Editable, - EditableInput, - EditablePreview, - Flex, -} from '@chakra-ui/react'; +import { Editable, EditableInput, EditablePreview, Flex } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; import { useNodeLabel } from 'features/nodes/hooks/useNodeLabel'; import { useNodeTemplateTitle } from 'features/nodes/hooks/useNodeTemplateTitle'; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx index 1da3363375..9fa7363d4a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx @@ -1,10 +1,14 @@ -import { Flex } from '@chakra-ui/react'; +import type { FormControlProps } from '@invoke-ai/ui'; +import { + Flex, + FormControl, + FormControlGroup, + FormLabel, + Input, + Textarea, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvTextarea } from 'common/components/InvTextarea/InvTextarea'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import { selectWorkflowSlice, @@ -88,51 +92,62 @@ const WorkflowGeneralTab = () => { return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + {t('nodes.workflowName')} + + + + {t('nodes.workflowVersion')} + + + + + + {t('nodes.workflowAuthor')} + + + + {t('nodes.workflowContact')} + + + + + {t('nodes.workflowTags')} + + + + {t('nodes.workflowDescription')} + + + + {t('nodes.workflowNotes')} + + + ); }; export default memo(WorkflowGeneralTab); + +const formControlProps: FormControlProps = { + flexShrink: 0, +}; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx index 02fa863f62..0f3a3f5e08 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import DataViewer from 'features/gallery/components/ImageMetadataViewer/DataViewer'; import { $builtWorkflow } from 'features/nodes/hooks/useWorkflowWatcher'; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx index 9cb2c2cf13..30051f2f71 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx index 096059dc83..deb833abc5 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx @@ -1,11 +1,4 @@ -import { - Flex, - Tab, - TabList, - TabPanel, - TabPanels, - Tabs, -} from '@chakra-ui/react'; +import { Flex, Tab, TabList, TabPanel, TabPanels, Tabs } from '@invoke-ai/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamCFGRescaleMultiplier.tsx b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamCFGRescaleMultiplier.tsx index e9d37d6f97..19f9d6f7da 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamCFGRescaleMultiplier.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamCFGRescaleMultiplier.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setCfgRescaleMultiplier } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -40,11 +44,9 @@ const ParamCFGRescaleMultiplier = () => { ); return ( - - + {t('parameters.cfgRescaleMultiplier')} + { step={coarseStep} fineStep={fineStep} onChange={handleChange} - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} - withNumberInput marks /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx index 5ed2470471..939bab747a 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Advanced/ParamClipSkip.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setClipSkip } from 'features/parameters/store/generationSlice'; import { CLIP_SKIP_MAP } from 'features/parameters/types/constants'; import { memo, useCallback, useMemo } from 'react'; @@ -46,8 +50,9 @@ const ParamClipSkip = () => { } return ( - - + {t('parameters.clipSkip')} + { step={coarseStep} fineStep={fineStep} onChange={handleClipSkipChange} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={max} marks={sliderMarks} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx index 0636320092..f6b58972d7 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxHeight.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { useImageSizeContext } from 'features/parameters/components/ImageSize/ImageSizeContext'; import { selectOptimalDimension } from 'features/parameters/store/generationSlice'; @@ -38,8 +42,9 @@ const ParamBoundingBoxHeight = () => { ); return ( - - + {t('parameters.height')} + { defaultValue={optimalDimension} onChange={onChange} marks - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxWidth.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxWidth.tsx index 442b999ae0..def547ada4 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxWidth.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/BoundingBox/ParamBoundingBoxWidth.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { useImageSizeContext } from 'features/parameters/components/ImageSize/ImageSizeContext'; import { selectOptimalDimension } from 'features/parameters/store/generationSlice'; @@ -36,8 +40,9 @@ const ParamBoundingBoxWidth = () => { ); return ( - - + {t('parameters.width')} + { value={ctx.width} defaultValue={optimalDimension} onChange={onChange} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} marks /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx index 1c021e2a28..1c6b538c50 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx @@ -1,10 +1,6 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { setCanvasCoherenceMode } from 'features/parameters/store/generationSlice'; import { isParameterCanvasCoherenceMode } from 'features/parameters/types/parameterSchemas'; import { memo, useCallback, useMemo } from 'react'; @@ -17,7 +13,7 @@ const ParamCanvasCoherenceMode = () => { ); const { t } = useTranslation(); - const options = useMemo( + const options = useMemo( () => [ { label: t('parameters.unmasked'), value: 'unmasked' }, { label: t('unifiedCanvas.mask'), value: 'mask' }, @@ -26,7 +22,7 @@ const ParamCanvasCoherenceMode = () => { [t] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParameterCanvasCoherenceMode(v?.value)) { return; @@ -43,12 +39,10 @@ const ParamCanvasCoherenceMode = () => { ); return ( - - - + + {t('parameters.coherenceMode')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceSteps.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceSteps.tsx index a8b6df44b7..79fe2d171b 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceSteps.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceSteps.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setCanvasCoherenceSteps } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -42,11 +46,9 @@ const ParamCanvasCoherenceSteps = () => { ); return ( - - + {t('parameters.coherenceSteps')} + { value={canvasCoherenceSteps} defaultValue={initial} onChange={handleChange} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} marks /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceStrength.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceStrength.tsx index 9a6b069e62..369bdb1f33 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceStrength.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceStrength.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setCanvasCoherenceStrength } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -20,22 +24,25 @@ const ParamCanvasCoherenceStrength = () => { ); return ( - - + {t('parameters.coherenceStrength')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlur.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlur.tsx index 2c22f5bf46..aa491d39c4 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlur.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlur.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setMaskBlur } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -29,21 +33,28 @@ const ParamMaskBlur = () => { ); return ( - - + {t('parameters.maskBlur')} + + - + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlurMethod.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlurMethod.tsx index 9c864fd758..d00ffa955a 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlurMethod.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlurMethod.tsx @@ -1,16 +1,12 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { setMaskBlurMethod } from 'features/parameters/store/generationSlice'; import { isParameterMaskBlurMethod } from 'features/parameters/types/parameterSchemas'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -const options: InvSelectOption[] = [ +const options: ComboboxOption[] = [ { label: 'Box Blur', value: 'box' }, { label: 'Gaussian Blur', value: 'gaussian' }, ]; @@ -20,7 +16,7 @@ const ParamMaskBlurMethod = () => { const dispatch = useAppDispatch(); const { t } = useTranslation(); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParameterMaskBlurMethod(v?.value)) { return; @@ -36,12 +32,10 @@ const ParamMaskBlurMethod = () => { ); return ( - - - + + {t('parameters.maskBlurMethod')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/GenerationModeStatusText.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/GenerationModeStatusText.tsx index 7d99e66220..97781adb06 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/GenerationModeStatusText.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/GenerationModeStatusText.tsx @@ -1,4 +1,4 @@ -import { Box } from '@chakra-ui/react'; +import { Box } from '@invoke-ai/ui'; import { useCanvasGenerationMode } from 'features/canvas/hooks/useCanvasGenerationMode'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillMethod.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillMethod.tsx index 1789d5b55e..51f4bcff9c 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillMethod.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillMethod.tsx @@ -1,10 +1,6 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { setInfillMethod } from 'features/parameters/store/generationSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -15,7 +11,7 @@ const ParamInfillMethod = () => { const dispatch = useAppDispatch(); const infillMethod = useAppSelector((s) => s.generation.infillMethod); const { data: appConfigData } = useGetAppConfigQuery(); - const options = useMemo( + const options = useMemo( () => appConfigData ? appConfigData.infill_methods.map((method) => ({ @@ -26,7 +22,7 @@ const ParamInfillMethod = () => { [appConfigData] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!v || !options.find((o) => o.value === v.value)) { return; @@ -42,13 +38,10 @@ const ParamInfillMethod = () => { ); return ( - - - + + {t('parameters.infillMethod')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillPatchmatchDownscaleSize.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillPatchmatchDownscaleSize.tsx index 7817d3b1ca..f879635e4d 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillPatchmatchDownscaleSize.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillPatchmatchDownscaleSize.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setInfillPatchmatchDownscaleSize } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -43,11 +47,9 @@ const ParamInfillPatchmatchDownscaleSize = () => { ); return ( - - + {t('parameters.patchmatchDownScaleSize')} + { value={infillPatchmatchDownscaleSize} defaultValue={initial} onChange={handleChange} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} marks /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillTilesize.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillTilesize.tsx index d0da0c99de..4d04e2ed04 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillTilesize.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamInfillTilesize.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setInfillTileSize } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -34,24 +38,28 @@ const ParamInfillTileSize = () => { ); return ( - - + {t('parameters.tileSize')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaleBeforeProcessing.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaleBeforeProcessing.tsx index 9cd978518d..340ec8932c 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaleBeforeProcessing.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaleBeforeProcessing.tsx @@ -1,17 +1,13 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { setBoundingBoxScaleMethod } from 'features/canvas/store/canvasSlice'; import { isBoundingBoxScaleMethod } from 'features/canvas/store/canvasTypes'; import { selectOptimalDimension } from 'features/parameters/store/generationSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -export const OPTIONS: InvSelectOption[] = [ +export const OPTIONS: ComboboxOption[] = [ { label: 'None', value: 'none' }, { label: 'Auto', value: 'auto' }, { label: 'Manual', value: 'manual' }, @@ -25,7 +21,7 @@ const ParamScaleBeforeProcessing = () => { ); const optimalDimension = useAppSelector(selectOptimalDimension); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isBoundingBoxScaleMethod(v?.value)) { return; @@ -41,12 +37,10 @@ const ParamScaleBeforeProcessing = () => { ); return ( - - - + + {t('parameters.scaleBeforeProcessing')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledHeight.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledHeight.tsx index 9a7c0e7c3d..7e1d19e68e 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledHeight.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledHeight.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setScaledBoundingBoxDimensions } from 'features/canvas/store/canvasSlice'; import { selectOptimalDimension } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; @@ -43,8 +47,9 @@ const ParamScaledHeight = () => { ); return ( - - + {t('parameters.scaledHeight')} + { value={height} onChange={onChange} marks - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} defaultValue={optimalDimension} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledWidth.tsx b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledWidth.tsx index 3c0fef3204..4c3fec17a0 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledWidth.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaledWidth.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setScaledBoundingBoxDimensions } from 'features/canvas/store/canvasSlice'; import { selectOptimalDimension } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; @@ -42,21 +46,28 @@ const ParamScaledWidth = () => { ); return ( - - + {t('parameters.scaledWidth')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Core/ParamCFGScale.tsx b/invokeai/frontend/web/src/features/parameters/components/Core/ParamCFGScale.tsx index e4d73d42b8..1b39bf4c88 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Core/ParamCFGScale.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Core/ParamCFGScale.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setCfgScale } from 'features/parameters/store/generationSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -30,8 +34,9 @@ const ParamCFGScale = () => { ); return ( - - + {t('parameters.cfgScale')} + { step={coarseStep} fineStep={fineStep} onChange={onChange} - withNumberInput marks={marks} - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Core/ParamHeight.tsx b/invokeai/frontend/web/src/features/parameters/components/Core/ParamHeight.tsx index 9c4914416d..73e89a3c6f 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Core/ParamHeight.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Core/ParamHeight.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { useImageSizeContext } from 'features/parameters/components/ImageSize/ImageSizeContext'; import { selectOptimalDimension } from 'features/parameters/store/generationSlice'; import { memo, useCallback, useMemo } from 'react'; @@ -34,8 +38,9 @@ export const ParamHeight = memo(() => { ); return ( - - + {t('parameters.height')} + { step={coarseStep} fineStep={fineStep} marks={marks} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }); diff --git a/invokeai/frontend/web/src/features/parameters/components/Core/ParamNegativePrompt.tsx b/invokeai/frontend/web/src/features/parameters/components/Core/ParamNegativePrompt.tsx index 5b768d5ee0..bece1338b1 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Core/ParamNegativePrompt.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Core/ParamNegativePrompt.tsx @@ -1,6 +1,5 @@ -import { Box } from '@chakra-ui/layout'; +import { Box, Textarea } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvTextarea } from 'common/components/InvTextarea/InvTextarea'; import { AddEmbeddingButton } from 'features/embedding/AddEmbeddingButton'; import { EmbeddingPopover } from 'features/embedding/EmbeddingPopover'; import { usePrompt } from 'features/embedding/usePrompt'; @@ -35,7 +34,7 @@ export const ParamNegativePrompt = memo(() => { width={textareaRef.current?.clientWidth} > - { width={textareaRef.current?.clientWidth} > - { const { t } = useTranslation(); const scheduler = useAppSelector((s) => s.generation.scheduler); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParameterScheduler(v?.value)) { return; @@ -29,13 +28,10 @@ const ParamScheduler = () => { ); return ( - - - + + {t('parameters.scheduler')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Core/ParamSteps.tsx b/invokeai/frontend/web/src/features/parameters/components/Core/ParamSteps.tsx index 961d4502d3..689fcd42c1 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Core/ParamSteps.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Core/ParamSteps.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setSteps } from 'features/parameters/store/generationSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -32,8 +36,9 @@ const ParamSteps = () => { ); return ( - - + {t('parameters.steps')} + { step={coarseStep} fineStep={fineStep} onChange={onChange} - withNumberInput marks={marks} - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Core/ParamWidth.tsx b/invokeai/frontend/web/src/features/parameters/components/Core/ParamWidth.tsx index 889f3777df..f0f1596981 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Core/ParamWidth.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Core/ParamWidth.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { useImageSizeContext } from 'features/parameters/components/ImageSize/ImageSizeContext'; import { selectOptimalDimension } from 'features/parameters/store/generationSlice'; import { memo, useCallback, useMemo } from 'react'; @@ -34,8 +38,9 @@ export const ParamWidth = memo(() => { ); return ( - - + {t('parameters.width')} + { step={coarseStep} fineStep={fineStep} marks={marks} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }); diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioPreview.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioPreview.tsx index 8b523e2809..65baa5223a 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioPreview.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioPreview.tsx @@ -1,5 +1,5 @@ -import { Flex, Icon } from '@chakra-ui/react'; import { useSize } from '@chakra-ui/react-use-size'; +import { Flex, Icon } from '@invoke-ai/ui'; import { useImageSizeContext } from 'features/parameters/components/ImageSize/ImageSizeContext'; import { AnimatePresence, motion } from 'framer-motion'; import { useMemo, useRef } from 'react'; diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx index 5e90a12d8c..a5ee9d16c4 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx @@ -1,8 +1,6 @@ -import type { SystemStyleObject } from '@chakra-ui/styled-system'; +import type { ComboboxOption, SystemStyleObject } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import type { SingleValue } from 'chakra-react-select'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOption } from 'common/components/InvSelect/types'; import { ASPECT_RATIO_OPTIONS } from 'features/parameters/components/ImageSize/constants'; import { useImageSizeContext } from 'features/parameters/components/ImageSize/ImageSizeContext'; import { isAspectRatioID } from 'features/parameters/components/ImageSize/types'; @@ -14,7 +12,7 @@ export const AspectRatioSelect = memo(() => { const ctx = useImageSizeContext(); const onChange = useCallback( - (v: SingleValue) => { + (v: SingleValue) => { if (!v || !isAspectRatioID(v.value)) { return; } @@ -32,14 +30,15 @@ export const AspectRatioSelect = memo(() => { ); return ( - - + {t('parameters.aspect')} + - + ); }); diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageSize/ImageSize.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageSize/ImageSize.tsx index 6f288695be..a4dab594cc 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageSize/ImageSize.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageSize/ImageSize.tsx @@ -1,6 +1,5 @@ -import { Flex } from '@chakra-ui/layout'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import type { InvLabelProps } from 'common/components/InvControl/types'; +import type { FormLabelProps } from '@invoke-ai/ui'; +import { Flex, FormControlGroup } from '@invoke-ai/ui'; import { AspectRatioPreview } from 'features/parameters/components/ImageSize/AspectRatioPreview'; import { AspectRatioSelect } from 'features/parameters/components/ImageSize/AspectRatioSelect'; import type { ImageSizeContextInnerValue } from 'features/parameters/components/ImageSize/ImageSizeContext'; @@ -22,7 +21,7 @@ export const ImageSize = memo((props: ImageSizeProps) => { - + @@ -31,7 +30,7 @@ export const ImageSize = memo((props: ImageSizeProps) => { {widthComponent} {heightComponent} - + @@ -43,6 +42,6 @@ export const ImageSize = memo((props: ImageSizeProps) => { ImageSize.displayName = 'ImageSize'; -const labelProps: InvLabelProps = { +const formLabelProps: FormLabelProps = { minW: 14, }; diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageSize/LockAspectRatioButton.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageSize/LockAspectRatioButton.tsx index a52729d7ed..31519f8f14 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageSize/LockAspectRatioButton.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageSize/LockAspectRatioButton.tsx @@ -1,4 +1,4 @@ -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import { IconButton } from '@invoke-ai/ui'; import { useImageSizeContext } from 'features/parameters/components/ImageSize/ImageSizeContext'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -12,7 +12,7 @@ export const LockAspectRatioButton = memo(() => { }, [ctx]); return ( - { }, [isSizeTooLarge, isSizeTooSmall, t]); return ( - { ctx.dimensionsSwapped(); }, [ctx]); return ( - { const dispatch = useAppDispatch(); @@ -27,16 +23,10 @@ const ImageToImageFit = () => { const { t } = useTranslation(); return ( - - - + + {t('parameters.imageFit')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageToImage/ImageToImageStrength.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageToImage/ImageToImageStrength.tsx index b661cc051f..4637ea21ea 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageToImage/ImageToImageStrength.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageToImage/ImageToImageStrength.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setImg2imgStrength } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -35,11 +39,9 @@ const ImageToImageStrength = () => { ); return ( - - + {`${t('parameters.denoisingStrength')}`} + { value={img2imgStrength} defaultValue={initial} marks={marks} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx index 145f056136..dc4c6b0021 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx @@ -1,8 +1,6 @@ -import { Flex, Spacer } from '@chakra-ui/react'; +import { Flex, IconButton, Spacer, Text } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvText } from 'common/components/InvText/wrapper'; import { useImageUploadButton } from 'common/hooks/useImageUploadButton'; import { useRecallParameters } from 'features/parameters/hooks/useRecallParameters'; import { @@ -72,29 +70,24 @@ const InitialImageDisplay = () => { alignItems="center" gap={2} > - + {t('metadata.initImage')} - + - } {...getUploadButtonProps()} /> - } onClick={handleUseSizeInitialImage} isDisabled={!initialImage} /> - } diff --git a/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx index 8d6c1f4cac..db9a3cb646 100644 --- a/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/MainModel/ParamMainModelSelect.tsx @@ -1,8 +1,7 @@ +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { modelSelected } from 'features/parameters/store/actions'; import { selectGenerationSlice } from 'features/parameters/store/generationSlice'; import { pick } from 'lodash-es'; @@ -34,7 +33,7 @@ const ParamMainModelSelect = () => { [dispatch] ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, selectedModel: model, @@ -42,19 +41,16 @@ const ParamMainModelSelect = () => { }); return ( - - + {t('modelManager.model')} + - + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Prompts/PromptOverlayButtonWrapper.tsx b/invokeai/frontend/web/src/features/parameters/components/Prompts/PromptOverlayButtonWrapper.tsx index c8189ec1a1..2ecacf0b19 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Prompts/PromptOverlayButtonWrapper.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Prompts/PromptOverlayButtonWrapper.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/layout'; +import { Flex } from '@invoke-ai/ui'; import { memo, type PropsWithChildren } from 'react'; export const PromptOverlayButtonWrapper = memo((props: PropsWithChildren) => ( diff --git a/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx b/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx index a7df3b7259..c92705cc27 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Prompts/Prompts.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import { ParamNegativePrompt } from 'features/parameters/components/Core/ParamNegativePrompt'; import { ParamPositivePrompt } from 'features/parameters/components/Core/ParamPositivePrompt'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/parameters/components/Prompts/theme.ts b/invokeai/frontend/web/src/features/parameters/components/Prompts/theme.ts deleted file mode 100644 index 289dce5aa0..0000000000 --- a/invokeai/frontend/web/src/features/parameters/components/Prompts/theme.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { defineStyle } from '@chakra-ui/react'; - -export const buttonVariantPromptOverlay = defineStyle(() => { - const _disabled = { - bg: 'none', - color: 'base.500', - svg: { - fill: 'base.500', - }, - opacity: 0.7, - }; - - return { - fontSize: 14, - h: 'min-content', - w: 'min-content', - minW: 'unset', - minH: 'unset', - bg: 'none', - color: 'base.400', - svg: { - fill: 'base.400', - }, - _disabled, - _hover: { - bg: 'none', - color: 'base.100', - svg: { - fill: 'base.100', - }, - _disabled, - }, - '&[data-checked="true"]': { - color: 'blue.300', - svg: { - fill: 'blue.300', - }, - _hover: { - color: 'blue.400', - svg: { - fill: 'blue.400', - }, - }, - }, - }; -}); diff --git a/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessXAxis.tsx b/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessXAxis.tsx index e4d932794d..fd2c823fbc 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessXAxis.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessXAxis.tsx @@ -1,6 +1,5 @@ +import { FormControl, FormLabel, Switch } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; import { setSeamlessXAxis } from 'features/parameters/store/generationSlice'; import type { ChangeEvent } from 'react'; import { memo, useCallback } from 'react'; @@ -20,9 +19,10 @@ const ParamSeamlessXAxis = () => { ); return ( - - - + + {t('parameters.seamlessXAxis')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessYAxis.tsx b/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessYAxis.tsx index 926dcd03fa..679fc546da 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessYAxis.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Seamless/ParamSeamlessYAxis.tsx @@ -1,6 +1,5 @@ +import { FormControl, FormLabel, Switch } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; import { setSeamlessYAxis } from 'features/parameters/store/generationSlice'; import type { ChangeEvent } from 'react'; import { memo, useCallback } from 'react'; @@ -18,9 +17,10 @@ const ParamSeamlessYAxis = () => { ); return ( - - - + + {t('parameters.seamlessYAxis')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx index ff2ff7cd05..ab33b3ac6e 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedNumberInput.tsx @@ -1,7 +1,6 @@ +import { CompositeNumberInput, FormControl, FormLabel } from '@invoke-ai/ui'; import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvNumberInput } from 'common/components/InvNumberInput/InvNumberInput'; import { setSeed } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -22,8 +21,9 @@ export const ParamSeedNumberInput = memo(() => { ); return ( - - + {t('parameters.seed')} + { flexGrow={1} defaultValue={0} /> - + ); }); diff --git a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedRandomize.tsx b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedRandomize.tsx index 07cbe2649c..7416707210 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedRandomize.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedRandomize.tsx @@ -1,6 +1,5 @@ +import { FormControl, FormLabel, Switch } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; import { setShouldRandomizeSeed } from 'features/parameters/store/generationSlice'; import type { ChangeEvent } from 'react'; import { memo, useCallback } from 'react'; @@ -21,12 +20,13 @@ export const ParamSeedRandomize = memo(() => { ); return ( - - + {t('common.random')} + - + ); }); diff --git a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedShuffle.tsx b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedShuffle.tsx index bbbbf8534b..3a3a60fe02 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedShuffle.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Seed/ParamSeedShuffle.tsx @@ -1,6 +1,6 @@ +import { Button } from '@invoke-ai/ui'; import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; import randomInt from 'common/util/randomInt'; import { setSeed } from 'features/parameters/store/generationSlice'; import { memo, useCallback } from 'react'; @@ -20,7 +20,7 @@ export const ParamSeedShuffle = memo(() => { ); return ( - { flexShrink={0} > {t('parameters.shuffle')} - + ); }); diff --git a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamRealESRGANModel.tsx b/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamRealESRGANModel.tsx index c973b20f03..8e5141be82 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamRealESRGANModel.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamRealESRGANModel.tsx @@ -1,11 +1,7 @@ +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import type { GroupBase } from 'chakra-react-select'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import { esrganModelNameChanged, isParamESRGANModelName, @@ -13,7 +9,7 @@ import { import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -const options: GroupBase[] = [ +const options: GroupBase[] = [ { label: 'x2 Upscalers', options: [ @@ -56,7 +52,7 @@ const ParamESRGANModel = () => { const dispatch = useAppDispatch(); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParamESRGANModelName(v?.value)) { return; @@ -75,9 +71,10 @@ const ParamESRGANModel = () => { ); return ( - - - + + {t('models.esrganModel')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx b/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx index d36921e34e..d35d8cab14 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx @@ -1,14 +1,15 @@ -import { Flex, useDisclosure } from '@chakra-ui/react'; +import { + Button, + Flex, + IconButton, + Popover, + PopoverBody, + PopoverContent, + PopoverTrigger, + useDisclosure, +} from '@invoke-ai/ui'; import { upscaleRequested } from 'app/store/middleware/listenerMiddleware/listeners/upscaleRequested'; import { useAppDispatch } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { - InvPopover, - InvPopoverBody, - InvPopoverContent, - InvPopoverTrigger, -} from 'common/components/InvPopover/wrapper'; import { useIsAllowedToUpscale } from 'features/parameters/hooks/useIsAllowedToUpscale'; import { useIsQueueMutationInProgress } from 'features/queue/hooks/useIsQueueMutationInProgress'; import { memo, useCallback } from 'react'; @@ -37,31 +38,31 @@ const ParamUpscalePopover = (props: Props) => { }, [dispatch, imageDTO, isAllowedToUpscale, onClose]); return ( - - - + + } aria-label={t('parameters.upscale')} /> - - - + + + - {t('parameters.upscaleImage')} - + - - - + + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEModelSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEModelSelect.tsx index 27930dc3ab..3188c1ae21 100644 --- a/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEModelSelect.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEModelSelect.tsx @@ -1,8 +1,7 @@ +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useGroupedModelInvSelect } from 'common/components/InvSelect/useGroupedModelInvSelect'; +import { useGroupedModelCombobox } from 'common/hooks/useGroupedModelCombobox'; import { selectGenerationSlice, vaeSelected, @@ -38,7 +37,7 @@ const ParamVAEModelSelect = () => { [dispatch] ); const { options, value, onChange, placeholder, noOptionsMessage } = - useGroupedModelInvSelect({ + useGroupedModelCombobox({ modelEntities: data, onChange: _onChange, selectedModel: vae ? { ...vae, model_type: 'vae' } : null, @@ -47,13 +46,13 @@ const ParamVAEModelSelect = () => { }); return ( - - {t('modelManager.vae')} + { onChange={onChange} noOptionsMessage={noOptionsMessage} /> - + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEPrecision.tsx b/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEPrecision.tsx index d89d0045aa..24cbdb0925 100644 --- a/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEPrecision.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/VAEModel/ParamVAEPrecision.tsx @@ -1,7 +1,6 @@ +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; import { vaePrecisionChanged } from 'features/parameters/store/generationSlice'; import { isParameterPrecision } from 'features/parameters/types/parameterSchemas'; import { memo, useCallback, useMemo } from 'react'; @@ -17,7 +16,7 @@ const ParamVAEModelSelect = () => { const dispatch = useAppDispatch(); const vaePrecision = useAppSelector((s) => s.generation.vaePrecision); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParameterPrecision(v?.value)) { return; @@ -34,14 +33,10 @@ const ParamVAEModelSelect = () => { ); return ( - - - + + {t('modelManager.vaePrecision')} + + ); }; diff --git a/invokeai/frontend/web/src/features/parameters/store/actions.ts b/invokeai/frontend/web/src/features/parameters/store/actions.ts index 94482caf9b..995bf332af 100644 --- a/invokeai/frontend/web/src/features/parameters/store/actions.ts +++ b/invokeai/frontend/web/src/features/parameters/store/actions.ts @@ -8,11 +8,3 @@ export const initialImageSelected = createAction( export const modelSelected = createAction( 'generation/modelSelected' ); - -export const expanderToggled = createAction<{ id: string; isOpen: boolean }>( - 'parameters/expanderToggled' -); -export const singleAccordionExpanded = createAction<{ - id: string; - isOpen: boolean; -}>('parameters/singleAccordionExpanded'); diff --git a/invokeai/frontend/web/src/features/parameters/types/constants.ts b/invokeai/frontend/web/src/features/parameters/types/constants.ts index 408bddef0c..d1cc9fd68a 100644 --- a/invokeai/frontend/web/src/features/parameters/types/constants.ts +++ b/invokeai/frontend/web/src/features/parameters/types/constants.ts @@ -1,4 +1,4 @@ -import type { InvSelectOption } from 'common/components/InvSelect/types'; +import type { ComboboxOption } from '@invoke-ai/ui'; import type { LoRAModelFormat } from 'services/api/types'; /** @@ -62,7 +62,7 @@ export const LORA_MODEL_FORMAT_MAP: { /** * Mapping of schedulers to human readable name */ -export const SCHEDULER_OPTIONS: InvSelectOption[] = [ +export const SCHEDULER_OPTIONS: ComboboxOption[] = [ { value: 'euler', label: 'Euler' }, { value: 'deis', label: 'DEIS' }, { value: 'ddim', label: 'DDIM' }, diff --git a/invokeai/frontend/web/src/features/queue/components/CancelCurrentQueueItemIconButton.tsx b/invokeai/frontend/web/src/features/queue/components/CancelCurrentQueueItemIconButton.tsx index bd7b12feb4..2195e5064d 100644 --- a/invokeai/frontend/web/src/features/queue/components/CancelCurrentQueueItemIconButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/CancelCurrentQueueItemIconButton.tsx @@ -1,5 +1,5 @@ -import type { ChakraProps } from '@chakra-ui/react'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import type { ChakraProps } from '@invoke-ai/ui'; +import { IconButton } from '@invoke-ai/ui'; import { useCancelCurrentQueueItem } from 'features/queue/hooks/useCancelCurrentQueueItem'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -14,7 +14,7 @@ const CancelCurrentQueueItemIconButton = ({ sx }: Props) => { useCancelCurrentQueueItem(); return ( - { useClearInvocationCache(); return ( - {t('invocationCache.clear')} - + ); }; diff --git a/invokeai/frontend/web/src/features/queue/components/ClearQueueButton.tsx b/invokeai/frontend/web/src/features/queue/components/ClearQueueButton.tsx index 9252d861e2..118314d667 100644 --- a/invokeai/frontend/web/src/features/queue/components/ClearQueueButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/ClearQueueButton.tsx @@ -1,13 +1,12 @@ -import { useDisclosure } from '@chakra-ui/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import type { InvButtonProps } from 'common/components/InvButton/types'; +import type { ButtonProps } from '@invoke-ai/ui'; +import { Button, useDisclosure } from '@invoke-ai/ui'; import ClearQueueConfirmationAlertDialog from 'features/queue/components/ClearQueueConfirmationAlertDialog'; import { useClearQueue } from 'features/queue/hooks/useClearQueue'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { PiTrashSimpleFill } from 'react-icons/pi'; -type Props = InvButtonProps; +type Props = ButtonProps; const ClearQueueButton = (props: Props) => { const { t } = useTranslation(); @@ -16,7 +15,7 @@ const ClearQueueButton = (props: Props) => { return ( <> - { {...props} > {t('queue.clear')} - + > ); diff --git a/invokeai/frontend/web/src/features/queue/components/ClearQueueConfirmationAlertDialog.tsx b/invokeai/frontend/web/src/features/queue/components/ClearQueueConfirmationAlertDialog.tsx index 539ca14297..98d94c643b 100644 --- a/invokeai/frontend/web/src/features/queue/components/ClearQueueConfirmationAlertDialog.tsx +++ b/invokeai/frontend/web/src/features/queue/components/ClearQueueConfirmationAlertDialog.tsx @@ -1,6 +1,5 @@ -import type { UseDisclosureReturn } from '@chakra-ui/react'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; -import { InvText } from 'common/components/InvText/wrapper'; +import type { UseDisclosureReturn } from '@invoke-ai/ui'; +import { ConfirmationAlertDialog, Text } from '@invoke-ai/ui'; import { useClearQueue } from 'features/queue/hooks/useClearQueue'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -14,17 +13,17 @@ const ClearQueueButton = ({ disclosure }: Props) => { const { clearQueue } = useClearQueue(); return ( - - {t('queue.clearQueueAlertDialog')} + {t('queue.clearQueueAlertDialog')} - {t('queue.clearQueueAlertDialog2')} - + {t('queue.clearQueueAlertDialog2')} + ); }; diff --git a/invokeai/frontend/web/src/features/queue/components/ClearQueueIconButton.tsx b/invokeai/frontend/web/src/features/queue/components/ClearQueueIconButton.tsx index e42daedcb5..e5b9cccdb7 100644 --- a/invokeai/frontend/web/src/features/queue/components/ClearQueueIconButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/ClearQueueIconButton.tsx @@ -1,7 +1,6 @@ -import { useDisclosure } from '@chakra-ui/react'; +import type { IconButtonProps } from '@invoke-ai/ui'; +import { IconButton, useDisclosure } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import type { InvIconButtonProps } from 'common/components/InvIconButton/types'; import { $shift } from 'common/hooks/useGlobalModifiers'; import ClearQueueConfirmationAlertDialog from 'features/queue/components/ClearQueueConfirmationAlertDialog'; import { useCancelCurrentQueueItem } from 'features/queue/hooks/useCancelCurrentQueueItem'; @@ -9,7 +8,7 @@ import { useClearQueue } from 'features/queue/hooks/useClearQueue'; import { useTranslation } from 'react-i18next'; import { PiTrashSimpleBold, PiXBold } from 'react-icons/pi'; -type ClearQueueButtonProps = Omit; +type ClearQueueButtonProps = Omit; type ClearQueueIconButtonProps = ClearQueueButtonProps & { onOpen: () => void; @@ -23,7 +22,7 @@ const ClearAllQueueIconButton = ({ const { isLoading, isDisabled } = useClearQueue(); return ( - { useCancelCurrentQueueItem(); return ( - { label={t('invocationCache.maxCacheSize')} value={cacheStatus?.max_size ?? 0} /> - + - + ); }; diff --git a/invokeai/frontend/web/src/features/queue/components/InvokeQueueBackButton.tsx b/invokeai/frontend/web/src/features/queue/components/InvokeQueueBackButton.tsx index 2467623255..13ed3086d2 100644 --- a/invokeai/frontend/web/src/features/queue/components/InvokeQueueBackButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/InvokeQueueBackButton.tsx @@ -1,6 +1,5 @@ -import { Flex, Spacer } from '@chakra-ui/layout'; +import { Button, Flex, Spacer } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; import { QueueIterationsNumberInput } from 'features/queue/components/QueueIterationsNumberInput'; import { useQueueBack } from 'features/queue/hooks/useQueueBack'; import { memo } from 'react'; @@ -19,7 +18,7 @@ export const InvokeQueueBackButton = memo(() => { return ( - { > {invoke} - + ); }); diff --git a/invokeai/frontend/web/src/features/queue/components/QueueActionsMenuButton.tsx b/invokeai/frontend/web/src/features/queue/components/QueueActionsMenuButton.tsx index 70120ed519..2c1f808095 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueActionsMenuButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueActionsMenuButton.tsx @@ -1,15 +1,15 @@ -import { Box } from '@chakra-ui/layout'; -import { useDisclosure } from '@chakra-ui/react'; -import { useAppDispatch } from 'app/store/storeHooks'; -import { InvBadge } from 'common/components/InvBadge/wrapper'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; import { - InvMenu, - InvMenuButton, - InvMenuDivider, -} from 'common/components/InvMenu/wrapper'; + Badge, + Box, + IconButton, + Menu, + MenuButton, + MenuDivider, + MenuItem, + MenuList, + useDisclosure, +} from '@invoke-ai/ui'; +import { useAppDispatch } from 'app/store/storeHooks'; import ClearQueueConfirmationAlertDialog from 'features/queue/components/ClearQueueConfirmationAlertDialog'; import { useClearQueue } from 'features/queue/hooks/useClearQueue'; import { usePauseProcessor } from 'features/queue/hooks/usePauseProcessor'; @@ -56,19 +56,19 @@ export const QueueActionsMenuButton = memo(() => { - - } /> - - + } onClick={clearQueueDisclosure.onOpen} @@ -76,35 +76,35 @@ export const QueueActionsMenuButton = memo(() => { isDisabled={isDisabledClearQueue} > {t('queue.clearTooltip')} - + {isResumeEnabled && ( - } onClick={resumeProcessor} isLoading={isLoadingResumeProcessor} isDisabled={isDisabledResumeProcessor} > {t('queue.resumeTooltip')} - + )} {isPauseEnabled && ( - } onClick={pauseProcessor} isLoading={isLoadingPauseProcessor} isDisabled={isDisabledPauseProcessor} > {t('queue.pauseTooltip')} - + )} - - } onClick={openQueue}> + + } onClick={openQueue}> {t('queue.openQueue')} - - - + + + {queueSize > 0 && ( - { zIndex="docked" > {queueSize} - + )} ); diff --git a/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx b/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx index c7068795ec..6370e6ae6a 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueButtonTooltip.tsx @@ -1,7 +1,6 @@ -import { Divider, Flex, ListItem, UnorderedList } from '@chakra-ui/react'; +import { Divider, Flex, ListItem, Text, UnorderedList } from '@invoke-ai/ui'; import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvText } from 'common/components/InvText/wrapper'; import { useIsReadyToEnqueue } from 'common/hooks/useIsReadyToEnqueue'; import { selectDynamicPromptsSlice } from 'features/dynamicPrompts/store/dynamicPromptsSlice'; import { getShouldProcessPrompt } from 'features/dynamicPrompts/util/getShouldProcessPrompt'; @@ -56,33 +55,33 @@ export const QueueButtonTooltip = memo(({ prepend = false }: Props) => { return ( - {label} - + {label} + {t('queue.queueCountPrediction', { promptsCount, iterations, count: Math.min(promptsCount * iterations, 10000), })} - + {reasons.length > 0 && ( <> {reasons.map((reason, i) => ( - {reason} + {reason} ))} > )} - + {t('parameters.invoke.addingImagesTo')}{' '} - + {autoAddBoardName || t('boards.uncategorized')} - - + + ); }); diff --git a/invokeai/frontend/web/src/features/queue/components/QueueControls.tsx b/invokeai/frontend/web/src/features/queue/components/QueueControls.tsx index 0aec8716e3..15b7191717 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueControls.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueControls.tsx @@ -1,5 +1,4 @@ -import { Flex, Spacer } from '@chakra-ui/react'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; +import { ButtonGroup, Flex, Spacer } from '@invoke-ai/ui'; import ClearQueueIconButton from 'features/queue/components/ClearQueueIconButton'; import QueueFrontButton from 'features/queue/components/QueueFrontButton'; import ProgressBar from 'features/system/components/ProgressBar'; @@ -20,7 +19,7 @@ const QueueControls = () => { pt={2} flexDir="column" > - + {isPrependEnabled && } @@ -29,7 +28,7 @@ const QueueControls = () => { {isResumeEnabled && } {isPauseEnabled && } */} - + ); diff --git a/invokeai/frontend/web/src/features/queue/components/QueueFrontButton.tsx b/invokeai/frontend/web/src/features/queue/components/QueueFrontButton.tsx index 0313ae8179..ac091dbd0d 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueFrontButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueFrontButton.tsx @@ -1,4 +1,4 @@ -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import { IconButton } from '@invoke-ai/ui'; import { useQueueFront } from 'features/queue/hooks/useQueueFront'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,7 +10,7 @@ const QueueFrontButton = () => { const { t } = useTranslation(); const { queueFront, isLoading, isDisabled } = useQueueFront(); return ( - { const iterations = useAppSelector((s) => s.generation.iterations); const coarseStep = useAppSelector((s) => s.config.sd.iterations.coarseStep); @@ -28,7 +18,7 @@ export const QueueIterationsNumberInput = memo(() => { return ( - { onChange={handleChange} value={iterations} defaultValue={1} - numberInputFieldProps={numberInputFieldProps} pos="absolute" insetInlineEnd={0} h="full" ps={0} w="72px" flexShrink={0} - variant="darkFilled" + variant="iterations" /> ); diff --git a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemComponent.tsx b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemComponent.tsx index 9847753e5a..9419c696f3 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemComponent.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemComponent.tsx @@ -1,8 +1,5 @@ -import type { ChakraProps, CollapseProps } from '@chakra-ui/react'; -import { Collapse, Flex } from '@chakra-ui/react'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvText } from 'common/components/InvText/wrapper'; +import type { ChakraProps, CollapseProps } from '@invoke-ai/ui'; +import { ButtonGroup, Collapse, Flex, IconButton, Text } from '@invoke-ai/ui'; import QueueStatusBadge from 'features/queue/components/common/QueueStatusBadge'; import { useCancelQueueItem } from 'features/queue/hooks/useCancelQueueItem'; import { getSecondsFromTimestamps } from 'features/queue/util/getSecondsFromTimestamps'; @@ -88,7 +85,7 @@ const QueueItemComponent = ({ index, item, context }: InnerItemProps) => { alignItems="center" flexShrink={0} > - {index + 1} + {index + 1} @@ -97,14 +94,14 @@ const QueueItemComponent = ({ index, item, context }: InnerItemProps) => { {executionTime || '-'} - {item.batch_id} - + {item.field_values && ( @@ -118,29 +115,29 @@ const QueueItemComponent = ({ index, item, context }: InnerItemProps) => { {item.field_values .filter((v) => v.node_path !== 'metadata_accumulator') .map(({ node_path, field_name, value }) => ( - - + {node_path}.{field_name} - + : {value} - + ))} )} - - + - + diff --git a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemDetail.tsx b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemDetail.tsx index f973de2641..0af1948c55 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemDetail.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueItemDetail.tsx @@ -1,7 +1,11 @@ -import { Flex, Heading, Spinner } from '@chakra-ui/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvText } from 'common/components/InvText/wrapper'; +import { + Button, + ButtonGroup, + Flex, + Heading, + Spinner, + Text, +} from '@invoke-ai/ui'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import DataViewer from 'features/gallery/components/ImageMetadataViewer/DataViewer'; import { useCancelBatch } from 'features/queue/hooks/useCancelBatch'; @@ -71,8 +75,8 @@ const QueueItemComponent = ({ queueItemDTO }: Props) => { - - + { colorScheme="error" > {t('queue.cancelItem')} - - + { colorScheme="error" > {t('queue.cancelBatch')} - - + + {queueItem?.error && ( { > {label} - + {data} - + ); }; diff --git a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueList.tsx b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueList.tsx index 90ee7cd42d..3e2316478c 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueList.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueList.tsx @@ -1,4 +1,4 @@ -import { Flex, Heading } from '@chakra-ui/react'; +import { Flex, Heading } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { IAINoContentFallbackWithSpinner } from 'common/components/IAIImageFallback'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; diff --git a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListComponent.tsx b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListComponent.tsx index 5465b01fb1..a2ad566838 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListComponent.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListComponent.tsx @@ -1,4 +1,4 @@ -import { Flex, forwardRef } from '@chakra-ui/react'; +import { Flex, forwardRef } from '@invoke-ai/ui'; import { memo } from 'react'; import type { Components } from 'react-virtuoso'; import type { SessionQueueItemDTO } from 'services/api/types'; diff --git a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListHeader.tsx b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListHeader.tsx index 185fb15846..0287bbba4e 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListHeader.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueList/QueueListHeader.tsx @@ -1,5 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Flex, Text } from '@invoke-ai/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -22,19 +21,19 @@ const QueueListHeader = () => { justifyContent="flex-end" alignItems="center" > - # + # - {t('queue.status')} + {t('queue.status')} - {t('queue.time')} + {t('queue.time')} - {t('queue.batch')} + {t('queue.batch')} - {t('queue.batchFieldValues')} + {t('queue.batchFieldValues')} ); diff --git a/invokeai/frontend/web/src/features/queue/components/QueueTabContent.tsx b/invokeai/frontend/web/src/features/queue/components/QueueTabContent.tsx index 2857eef213..f0f4f6fd81 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueTabContent.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueTabContent.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex } from '@invoke-ai/ui'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/queue/components/QueueTabQueueControls.tsx b/invokeai/frontend/web/src/features/queue/components/QueueTabQueueControls.tsx index 9805671ac5..64e539682d 100644 --- a/invokeai/frontend/web/src/features/queue/components/QueueTabQueueControls.tsx +++ b/invokeai/frontend/web/src/features/queue/components/QueueTabQueueControls.tsx @@ -1,5 +1,4 @@ -import { Flex } from '@chakra-ui/react'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; +import { ButtonGroup, Flex } from '@invoke-ai/ui'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { memo } from 'react'; @@ -14,17 +13,17 @@ const QueueTabQueueControls = () => { return ( {isPauseEnabled || isResumeEnabled ? ( - + {isResumeEnabled ? : <>>} {isPauseEnabled ? : <>>} - + ) : ( <>> )} - + - + ); }; diff --git a/invokeai/frontend/web/src/features/queue/components/ToggleInvocationCacheButton.tsx b/invokeai/frontend/web/src/features/queue/components/ToggleInvocationCacheButton.tsx index 6d5f2dc202..6174ad96fd 100644 --- a/invokeai/frontend/web/src/features/queue/components/ToggleInvocationCacheButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/ToggleInvocationCacheButton.tsx @@ -1,4 +1,4 @@ -import { InvButton } from 'common/components/InvButton/InvButton'; +import { Button } from '@invoke-ai/ui'; import { useDisableInvocationCache } from 'features/queue/hooks/useDisableInvocationCache'; import { useEnableInvocationCache } from 'features/queue/hooks/useEnableInvocationCache'; import { memo } from 'react'; @@ -23,24 +23,24 @@ const ToggleInvocationCacheButton = () => { if (cacheStatus?.enabled) { return ( - {t('invocationCache.disable')} - + ); } return ( - {t('invocationCache.enable')} - + ); }; diff --git a/invokeai/frontend/web/src/features/queue/components/common/QueueButton.tsx b/invokeai/frontend/web/src/features/queue/components/common/QueueButton.tsx index 2d42d6b855..72307589d5 100644 --- a/invokeai/frontend/web/src/features/queue/components/common/QueueButton.tsx +++ b/invokeai/frontend/web/src/features/queue/components/common/QueueButton.tsx @@ -1,6 +1,5 @@ -import type { ChakraProps, ThemeTypings } from '@chakra-ui/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import type { ChakraProps, ThemeTypings } from '@invoke-ai/ui'; +import { Button, IconButton } from '@invoke-ai/ui'; import type { ReactElement, ReactNode } from 'react'; import { memo } from 'react'; @@ -31,7 +30,7 @@ const QueueButton = ({ }: Props) => { if (asIconButton) { return ( - {label} - + ); }; diff --git a/invokeai/frontend/web/src/features/queue/components/common/QueueStatusBadge.tsx b/invokeai/frontend/web/src/features/queue/components/common/QueueStatusBadge.tsx index 606285974a..ed15edb424 100644 --- a/invokeai/frontend/web/src/features/queue/components/common/QueueStatusBadge.tsx +++ b/invokeai/frontend/web/src/features/queue/components/common/QueueStatusBadge.tsx @@ -1,4 +1,4 @@ -import { Badge } from '@chakra-ui/react'; +import { Badge } from '@invoke-ai/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import type { SessionQueueItemStatus } from 'services/api/endpoints/queue'; diff --git a/invokeai/frontend/web/src/features/queue/components/common/StatusStatGroup.tsx b/invokeai/frontend/web/src/features/queue/components/common/StatusStatGroup.tsx index ded38a12f9..13a9565b49 100644 --- a/invokeai/frontend/web/src/features/queue/components/common/StatusStatGroup.tsx +++ b/invokeai/frontend/web/src/features/queue/components/common/StatusStatGroup.tsx @@ -1,5 +1,5 @@ -import type { StatGroupProps } from '@chakra-ui/react'; -import { StatGroup } from '@chakra-ui/react'; +import type { StatGroupProps } from '@invoke-ai/ui'; +import { StatGroup } from '@invoke-ai/ui'; import { memo } from 'react'; const StatusStatGroup = ({ children, ...rest }: StatGroupProps) => ( diff --git a/invokeai/frontend/web/src/features/queue/components/common/StatusStatItem.tsx b/invokeai/frontend/web/src/features/queue/components/common/StatusStatItem.tsx index 5a3ca2b267..c5f7e3d8fa 100644 --- a/invokeai/frontend/web/src/features/queue/components/common/StatusStatItem.tsx +++ b/invokeai/frontend/web/src/features/queue/components/common/StatusStatItem.tsx @@ -1,5 +1,5 @@ -import type { ChakraProps, StatProps } from '@chakra-ui/react'; -import { Stat, StatLabel, StatNumber } from '@chakra-ui/react'; +import type { ChakraProps, StatProps } from '@invoke-ai/ui'; +import { Stat, StatLabel, StatNumber } from '@invoke-ai/ui'; import { memo } from 'react'; const sx: ChakraProps['sx'] = { diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/ParamSDXLNegativeStylePrompt.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/ParamSDXLNegativeStylePrompt.tsx index 240dfb926c..87570f77fa 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/ParamSDXLNegativeStylePrompt.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/ParamSDXLNegativeStylePrompt.tsx @@ -1,6 +1,5 @@ -import { Box } from '@chakra-ui/layout'; +import { Box, Textarea } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvTextarea } from 'common/components/InvTextarea/InvTextarea'; import { AddEmbeddingButton } from 'features/embedding/AddEmbeddingButton'; import { EmbeddingPopover } from 'features/embedding/EmbeddingPopover'; import { usePrompt } from 'features/embedding/usePrompt'; @@ -45,7 +44,7 @@ export const ParamSDXLNegativeStylePrompt = memo(() => { width={textareaRef.current?.clientWidth} > - { width={textareaRef.current?.clientWidth} > - { ); return ( - - + { fontSize={12} px={0.5} /> - + ); }); diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/SDXLPrompts.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/SDXLPrompts.tsx index 63c6d604ab..a2257366b9 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/SDXLPrompts.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLPrompts/SDXLPrompts.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { ParamNegativePrompt } from 'features/parameters/components/Core/ParamNegativePrompt'; import { ParamPositivePrompt } from 'features/parameters/components/Core/ParamPositivePrompt'; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerCFGScale.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerCFGScale.tsx index c60d77458c..db64c4ccd2 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerCFGScale.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerCFGScale.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setRefinerCFGScale } from 'features/sdxl/store/sdxlSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -31,8 +35,9 @@ const ParamSDXLRefinerCFGScale = () => { ); return ( - - + {t('sdxl.cfgScale')} + { step={coarseStep} fineStep={fineStep} onChange={onChange} - withNumberInput - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} marks={marks} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx index c0d2d9402c..9b423676df 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect.tsx @@ -1,8 +1,7 @@ +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import { useModelInvSelect } from 'common/components/InvSelect/useModelInvSelect'; +import { useModelCombobox } from 'common/hooks/useModelCombobox'; import { refinerModelChanged, selectSdxlSlice, @@ -43,7 +42,7 @@ const ParamSDXLRefinerModelSelect = () => { [dispatch] ); const { options, value, onChange, placeholder, noOptionsMessage } = - useModelInvSelect({ + useModelCombobox({ modelEntities: data, onChange: _onChange, selectedModel: model, @@ -51,12 +50,9 @@ const ParamSDXLRefinerModelSelect = () => { optionsFilter, }); return ( - - + {t('sdxl.refinermodel')} + { noOptionsMessage={noOptionsMessage} isClearable /> - + ); }; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerNegativeAestheticScore.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerNegativeAestheticScore.tsx index f6325149dc..104ad3bec3 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerNegativeAestheticScore.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerNegativeAestheticScore.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setRefinerNegativeAestheticScore } from 'features/sdxl/store/sdxlSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -19,8 +23,9 @@ const ParamSDXLRefinerNegativeAestheticScore = () => { ); return ( - - + {t('sdxl.negAestheticScore')} + { onChange={handleChange} value={refinerNegativeAestheticScore} defaultValue={2.5} - withNumberInput marks /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerPositiveAestheticScore.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerPositiveAestheticScore.tsx index 6a4c8006df..12477064b1 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerPositiveAestheticScore.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerPositiveAestheticScore.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setRefinerPositiveAestheticScore } from 'features/sdxl/store/sdxlSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -18,8 +22,9 @@ const ParamSDXLRefinerPositiveAestheticScore = () => { ); return ( - - + {t('sdxl.posAestheticScore')} + { onChange={handleChange} value={refinerPositiveAestheticScore} defaultValue={6} - withNumberInput marks /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerScheduler.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerScheduler.tsx index 5064dabfc6..b0faabaf6a 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerScheduler.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerScheduler.tsx @@ -1,7 +1,6 @@ +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; import { SCHEDULER_OPTIONS } from 'features/parameters/types/constants'; import { isParameterScheduler } from 'features/parameters/types/parameterSchemas'; import { setRefinerScheduler } from 'features/sdxl/store/sdxlSlice'; @@ -13,7 +12,7 @@ const ParamSDXLRefinerScheduler = () => { const { t } = useTranslation(); const refinerScheduler = useAppSelector((s) => s.sdxl.refinerScheduler); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isParameterScheduler(v?.value)) { return; @@ -29,13 +28,10 @@ const ParamSDXLRefinerScheduler = () => { ); return ( - - - + + {t('sdxl.scheduler')} + + ); }; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx index 8957fbecf9..e21c129860 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setRefinerStart } from 'features/sdxl/store/sdxlSlice'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -15,18 +19,26 @@ const ParamSDXLRefinerStart = () => { const { t } = useTranslation(); return ( - - + {t('sdxl.refinerStart')} + - + + ); }; diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerSteps.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerSteps.tsx index a787d7e328..cec24f41a8 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerSteps.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerSteps.tsx @@ -1,6 +1,10 @@ +import { + CompositeNumberInput, + CompositeSlider, + FormControl, + FormLabel, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSlider } from 'common/components/InvSlider/InvSlider'; import { setRefinerSteps } from 'features/sdxl/store/sdxlSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -34,8 +38,9 @@ const ParamSDXLRefinerSteps = () => { ); return ( - - + {t('sdxl.steps')} + { step={coarseStep} fineStep={fineStep} onChange={onChange} - withNumberInput marks={marks} - numberInputMin={numberInputMin} - numberInputMax={numberInputMax} /> - + + ); }; diff --git a/invokeai/frontend/web/src/features/settingsAccordions/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx index 93c1ae1333..311b3907a6 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/AdvancedSettingsAccordion/AdvancedSettingsAccordion.tsx @@ -1,9 +1,7 @@ -import { Flex } from '@chakra-ui/layout'; +import type { FormLabelProps } from '@invoke-ai/ui'; +import { Flex, FormControlGroup, StandaloneAccordion } from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import type { InvLabelProps } from 'common/components/InvControl/types'; -import { InvSingleAccordion } from 'common/components/InvSingleAccordion/InvSingleAccordion'; import ParamCFGRescaleMultiplier from 'features/parameters/components/Advanced/ParamCFGRescaleMultiplier'; import ParamClipSkip from 'features/parameters/components/Advanced/ParamClipSkip'; import ParamSeamlessXAxis from 'features/parameters/components/Seamless/ParamSeamlessXAxis'; @@ -11,14 +9,15 @@ import ParamSeamlessYAxis from 'features/parameters/components/Seamless/ParamSea import ParamVAEModelSelect from 'features/parameters/components/VAEModel/ParamVAEModelSelect'; import ParamVAEPrecision from 'features/parameters/components/VAEModel/ParamVAEPrecision'; import { selectGenerationSlice } from 'features/parameters/store/generationSlice'; +import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -const labelProps: InvLabelProps = { +const formLabelProps: FormLabelProps = { minW: '9.2rem', }; -const labelProps2: InvLabelProps = { +const formLabelProps2: FormLabelProps = { flexGrow: 1, }; @@ -51,30 +50,35 @@ const selectBadges = createMemoizedSelector( export const AdvancedSettingsAccordion = memo(() => { const badges = useAppSelector(selectBadges); const { t } = useTranslation(); + const { isOpen, onToggle } = useStandaloneAccordionToggle({ + id: 'advanced-settings', + defaultIsOpen: false, + }); return ( - - + - + - + - + - + ); }); diff --git a/invokeai/frontend/web/src/features/settingsAccordions/CompositingSettingsAccordion/CompositingSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/CompositingSettingsAccordion/CompositingSettingsAccordion.tsx index 0cf59716b5..bbd569bfde 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/CompositingSettingsAccordion/CompositingSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/CompositingSettingsAccordion/CompositingSettingsAccordion.tsx @@ -1,14 +1,14 @@ -import { Flex } from '@chakra-ui/layout'; -import type { FormLabelProps } from '@chakra-ui/react'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import { InvSingleAccordion } from 'common/components/InvSingleAccordion/InvSingleAccordion'; -import { InvTab } from 'common/components/InvTabs/InvTab'; +import type { FormLabelProps } from '@invoke-ai/ui'; import { - InvTabList, - InvTabPanel, - InvTabPanels, - InvTabs, -} from 'common/components/InvTabs/wrapper'; + Flex, + FormControlGroup, + StandaloneAccordion, + Tab, + TabList, + TabPanel, + TabPanels, + Tabs, +} from '@invoke-ai/ui'; import ParamCanvasCoherenceMode from 'features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode'; import ParamCanvasCoherenceSteps from 'features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceSteps'; import ParamCanvasCoherenceStrength from 'features/parameters/components/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceStrength'; @@ -16,6 +16,7 @@ import ParamMaskBlur from 'features/parameters/components/Canvas/Compositing/Mas import ParamMaskBlurMethod from 'features/parameters/components/Canvas/Compositing/MaskAdjustment/ParamMaskBlurMethod'; import ParamInfillMethod from 'features/parameters/components/Canvas/InfillAndScaling/ParamInfillMethod'; import ParamInfillOptions from 'features/parameters/components/Canvas/InfillAndScaling/ParamInfillOptions'; +import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -25,37 +26,45 @@ const coherenceLabelProps: FormLabelProps = { export const CompositingSettingsAccordion = memo(() => { const { t } = useTranslation(); + const { isOpen, onToggle } = useStandaloneAccordionToggle({ + id: 'compositing-settings', + defaultIsOpen: false, + }); return ( - - - - {t('accordions.compositing.coherenceTab')} - {t('accordions.compositing.infillTab')} - - - + + + + {t('accordions.compositing.coherenceTab')} + {t('accordions.compositing.infillTab')} + + + - + - + - - + + - + - + - - - - + + + + ); }); diff --git a/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx index 00d67cd894..38c01ff2b2 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx @@ -1,10 +1,12 @@ -import { Flex } from '@chakra-ui/layout'; -import { Divider } from '@chakra-ui/react'; +import { + Button, + ButtonGroup, + Divider, + Flex, + StandaloneAccordion, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvSingleAccordion } from 'common/components/InvSingleAccordion/InvSingleAccordion'; import ControlAdapterConfig from 'features/controlAdapters/components/ControlAdapterConfig'; import { useAddControlAdapter } from 'features/controlAdapters/hooks/useAddControlAdapter'; import { @@ -17,6 +19,7 @@ import { selectValidIPAdapters, selectValidT2IAdapters, } from 'features/controlAdapters/store/controlAdaptersSlice'; +import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { Fragment, memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -75,7 +78,10 @@ export const ControlSettingsAccordion: React.FC = memo(() => { const { t } = useTranslation(); const { controlAdapterIds, badges } = useAppSelector(selector); const isControlNetDisabled = useFeatureStatus('controlNet').isFeatureDisabled; - + const { isOpen, onToggle } = useStandaloneAccordionToggle({ + id: 'control-settings', + defaultIsOpen: true, + }); const [addControlNet, isAddControlNetDisabled] = useAddControlAdapter('controlnet'); const [addIPAdapter, isAddIPAdapterDisabled] = @@ -88,20 +94,21 @@ export const ControlSettingsAccordion: React.FC = memo(() => { } return ( - - - } onClick={addControlNet} @@ -110,8 +117,8 @@ export const ControlSettingsAccordion: React.FC = memo(() => { isDisabled={isAddControlNetDisabled} > {t('common.controlNet')} - - + } onClick={addIPAdapter} @@ -120,8 +127,8 @@ export const ControlSettingsAccordion: React.FC = memo(() => { isDisabled={isAddIPAdapterDisabled} > {t('common.ipAdapter')} - - + } onClick={addT2IAdapter} @@ -130,8 +137,8 @@ export const ControlSettingsAccordion: React.FC = memo(() => { isDisabled={isAddT2IAdapterDisabled} > {t('common.t2iAdapter')} - - + + {controlAdapterIds.map((id, i) => ( @@ -139,7 +146,7 @@ export const ControlSettingsAccordion: React.FC = memo(() => { ))} - + ); }); diff --git a/invokeai/frontend/web/src/features/settingsAccordions/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx index 46ddf56a87..936601cf25 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/GenerationSettingsAccordion/GenerationSettingsAccordion.tsx @@ -1,17 +1,17 @@ -import { Flex } from '@chakra-ui/layout'; +import type { FormLabelProps } from '@invoke-ai/ui'; +import { + Expander, + Flex, + FormControlGroup, + StandaloneAccordion, + Tab, + TabList, + TabPanel, + TabPanels, + Tabs, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import type { InvLabelProps } from 'common/components/InvControl/types'; -import { InvExpander } from 'common/components/InvExpander/InvExpander'; -import { InvSingleAccordion } from 'common/components/InvSingleAccordion/InvSingleAccordion'; -import { InvTab } from 'common/components/InvTabs/InvTab'; -import { - InvTabList, - InvTabPanel, - InvTabPanels, - InvTabs, -} from 'common/components/InvTabs/wrapper'; import { LoRAList } from 'features/lora/components/LoRAList'; import LoRASelect from 'features/lora/components/LoRASelect'; import { selectLoraSlice } from 'features/lora/store/loraSlice'; @@ -21,11 +21,13 @@ import ParamScheduler from 'features/parameters/components/Core/ParamScheduler'; import ParamSteps from 'features/parameters/components/Core/ParamSteps'; import ParamMainModelSelect from 'features/parameters/components/MainModel/ParamMainModelSelect'; import { selectGenerationSlice } from 'features/parameters/store/generationSlice'; +import { useExpanderToggle } from 'features/settingsAccordions/hooks/useExpanderToggle'; +import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle'; import { size } from 'lodash-es'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -const labelProps: InvLabelProps = { +const formLabelProps: FormLabelProps = { minW: '4rem', }; @@ -47,45 +49,56 @@ const badgesSelector = createMemoizedSelector( export const GenerationSettingsAccordion = memo(() => { const { t } = useTranslation(); const { loraTabBadges, accordionBadges } = useAppSelector(badgesSelector); + const { isOpen: isOpenExpander, onToggle: onToggleExpander } = + useExpanderToggle({ + id: 'generation-settings-advanced', + defaultIsOpen: false, + }); + const { isOpen: isOpenAccordion, onToggle: onToggleAccordion } = + useStandaloneAccordionToggle({ + id: 'generation-settings', + defaultIsOpen: false, + }); return ( - - - - {t('accordions.generation.modelTab')} - + + + {t('accordions.generation.modelTab')} + {t('accordions.generation.conceptsTab')} - - - - + + + + - + - + - + - - - + + + - - - - + + + + ); }); diff --git a/invokeai/frontend/web/src/features/settingsAccordions/ImageSettingsAccordion/ImageSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/ImageSettingsAccordion/ImageSettingsAccordion.tsx index 4a7a10e4c1..36b97ecd72 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/ImageSettingsAccordion/ImageSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/ImageSettingsAccordion/ImageSettingsAccordion.tsx @@ -1,10 +1,12 @@ -import { Flex } from '@chakra-ui/react'; +import type { FormLabelProps } from '@invoke-ai/ui'; +import { + Expander, + Flex, + FormControlGroup, + StandaloneAccordion, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import type { InvLabelProps } from 'common/components/InvControl/types'; -import { InvExpander } from 'common/components/InvExpander/InvExpander'; -import { InvSingleAccordion } from 'common/components/InvSingleAccordion/InvSingleAccordion'; import { selectCanvasSlice } from 'features/canvas/store/canvasSlice'; import { HrfSettings } from 'features/hrf/components/HrfSettings'; import { selectHrfSlice } from 'features/hrf/store/hrfSlice'; @@ -17,6 +19,8 @@ import { ParamSeedNumberInput } from 'features/parameters/components/Seed/ParamS import { ParamSeedRandomize } from 'features/parameters/components/Seed/ParamSeedRandomize'; import { ParamSeedShuffle } from 'features/parameters/components/Seed/ParamSeedShuffle'; import { selectGenerationSlice } from 'features/parameters/store/generationSlice'; +import { useExpanderToggle } from 'features/settingsAccordions/hooks/useExpanderToggle'; +import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle'; import { activeTabNameSelector } from 'features/ui/store/uiSelectors'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -66,19 +70,24 @@ const selector = createMemoizedSelector( } ); -const scalingLabelProps: InvLabelProps = { +const scalingLabelProps: FormLabelProps = { minW: '4.5rem', }; export const ImageSettingsAccordion = memo(() => { const { t } = useTranslation(); const { badges, activeTabName } = useAppSelector(selector); + const { isOpen: isOpenAccordion, onToggle: onToggleAccordion } = + useStandaloneAccordionToggle({ id: 'image-settings', defaultIsOpen: true }); + const { isOpen: isOpenExpander, onToggle: onToggleExpander } = + useExpanderToggle({ id: 'image-settings-advanced', defaultIsOpen: false }); return ( - {activeTabName === 'unifiedCanvas' ? ( @@ -86,7 +95,7 @@ export const ImageSettingsAccordion = memo(() => { ) : ( )} - + @@ -100,16 +109,16 @@ export const ImageSettingsAccordion = memo(() => { {activeTabName === 'unifiedCanvas' && ( <> - + - + > )} - + - + ); }); diff --git a/invokeai/frontend/web/src/features/settingsAccordions/RefinerSettingsAccordion/RefinerSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/RefinerSettingsAccordion/RefinerSettingsAccordion.tsx index d417a5b799..ea50350a63 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/RefinerSettingsAccordion/RefinerSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/RefinerSettingsAccordion/RefinerSettingsAccordion.tsx @@ -1,10 +1,12 @@ -import { Flex } from '@chakra-ui/react'; +import type { FormLabelProps } from '@invoke-ai/ui'; +import { + Flex, + FormControlGroup, + StandaloneAccordion, + Text, +} from '@invoke-ai/ui'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvControlGroup } from 'common/components/InvControl/InvControlGroup'; -import type { InvLabelProps } from 'common/components/InvControl/types'; -import { InvSingleAccordion } from 'common/components/InvSingleAccordion/InvSingleAccordion'; -import { InvText } from 'common/components/InvText/wrapper'; import ParamSDXLRefinerCFGScale from 'features/sdxl/components/SDXLRefiner/ParamSDXLRefinerCFGScale'; import ParamSDXLRefinerModelSelect from 'features/sdxl/components/SDXLRefiner/ParamSDXLRefinerModelSelect'; import ParamSDXLRefinerNegativeAestheticScore from 'features/sdxl/components/SDXLRefiner/ParamSDXLRefinerNegativeAestheticScore'; @@ -13,16 +15,17 @@ import ParamSDXLRefinerScheduler from 'features/sdxl/components/SDXLRefiner/Para import ParamSDXLRefinerStart from 'features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart'; import ParamSDXLRefinerSteps from 'features/sdxl/components/SDXLRefiner/ParamSDXLRefinerSteps'; import { selectSdxlSlice } from 'features/sdxl/store/sdxlSlice'; +import { useStandaloneAccordionToggle } from 'features/settingsAccordions/hooks/useStandaloneAccordionToggle'; import { isNil } from 'lodash-es'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useIsRefinerAvailable } from 'services/api/hooks/useIsRefinerAvailable'; -const aestheticLabelProps: InvLabelProps = { +const aestheticLabelProps: FormLabelProps = { minW: '9.2rem', }; -const stepsScaleLabelProps: InvLabelProps = { +const stepsScaleLabelProps: FormLabelProps = { minW: '5rem', }; @@ -34,19 +37,24 @@ export const RefinerSettingsAccordion: React.FC = memo(() => { const { t } = useTranslation(); const isRefinerAvailable = useIsRefinerAvailable(); const badges = useAppSelector(selectBadges); - - if (!isRefinerAvailable) { - return ( - - - - ); - } + const { isOpen, onToggle } = useStandaloneAccordionToggle({ + id: 'refiner-settings', + defaultIsOpen: false, + }); return ( - - - + + {isRefinerAvailable ? ( + + ) : ( + + )} + ); }); @@ -56,9 +64,9 @@ const RefinerSettingsAccordionNoRefiner: React.FC = memo(() => { const { t } = useTranslation(); return ( - + {t('models.noRefinerModelsInstalled')} - + ); }); @@ -72,27 +80,27 @@ const RefinerSettingsAccordionContent: React.FC = memo(() => { ); return ( - + - - - + - + - + ); }); diff --git a/invokeai/frontend/web/src/features/settingsAccordions/hooks/useExpanderToggle.ts b/invokeai/frontend/web/src/features/settingsAccordions/hooks/useExpanderToggle.ts new file mode 100644 index 0000000000..19aad55220 --- /dev/null +++ b/invokeai/frontend/web/src/features/settingsAccordions/hooks/useExpanderToggle.ts @@ -0,0 +1,23 @@ +import { useDisclosure } from '@invoke-ai/ui'; +import { useAppDispatch } from 'app/store/storeHooks'; +import { expanderToggled } from 'features/settingsAccordions/store/actions'; +import { useCallback } from 'react'; + +type UseExpanderToggleArg = { + defaultIsOpen: boolean; + id?: string; +}; + +export const useExpanderToggle = (arg: UseExpanderToggleArg) => { + const dispatch = useAppDispatch(); + const { isOpen, onToggle: _onToggle } = useDisclosure({ + defaultIsOpen: arg.defaultIsOpen, + }); + const onToggle = useCallback(() => { + if (arg.id) { + dispatch(expanderToggled({ id: arg.id, isOpen })); + } + _onToggle(); + }, [_onToggle, dispatch, arg.id, isOpen]); + return { isOpen, onToggle }; +}; diff --git a/invokeai/frontend/web/src/features/settingsAccordions/hooks/useStandaloneAccordionToggle.ts b/invokeai/frontend/web/src/features/settingsAccordions/hooks/useStandaloneAccordionToggle.ts new file mode 100644 index 0000000000..94a4aaefe3 --- /dev/null +++ b/invokeai/frontend/web/src/features/settingsAccordions/hooks/useStandaloneAccordionToggle.ts @@ -0,0 +1,25 @@ +import { useDisclosure } from '@invoke-ai/ui'; +import { useAppDispatch } from 'app/store/storeHooks'; +import { standaloneAccordionToggled } from 'features/settingsAccordions/store/actions'; +import { useCallback } from 'react'; + +type UseStandaloneAccordionToggleArg = { + defaultIsOpen: boolean; + id?: string; +}; + +export const useStandaloneAccordionToggle = ( + arg: UseStandaloneAccordionToggleArg +) => { + const dispatch = useAppDispatch(); + const { isOpen, onToggle: _onToggle } = useDisclosure({ + defaultIsOpen: arg.defaultIsOpen, + }); + const onToggle = useCallback(() => { + if (arg.id) { + dispatch(standaloneAccordionToggled({ id: arg.id, isOpen })); + } + _onToggle(); + }, [_onToggle, arg.id, dispatch, isOpen]); + return { isOpen, onToggle }; +}; diff --git a/invokeai/frontend/web/src/features/settingsAccordions/store/actions.ts b/invokeai/frontend/web/src/features/settingsAccordions/store/actions.ts new file mode 100644 index 0000000000..8ce987168d --- /dev/null +++ b/invokeai/frontend/web/src/features/settingsAccordions/store/actions.ts @@ -0,0 +1,10 @@ +import { createAction } from '@reduxjs/toolkit'; + +export const expanderToggled = createAction<{ id: string; isOpen: boolean }>( + 'parameters/expanderToggled' +); + +export const standaloneAccordionToggled = createAction<{ + id: string; + isOpen: boolean; +}>('parameters/standaloneAccordionToggled'); diff --git a/invokeai/frontend/web/src/features/system/components/AboutModal/AboutModal.tsx b/invokeai/frontend/web/src/features/system/components/AboutModal/AboutModal.tsx index 3dc8790c00..9f7f295ed2 100644 --- a/invokeai/frontend/web/src/features/system/components/AboutModal/AboutModal.tsx +++ b/invokeai/frontend/web/src/features/system/components/AboutModal/AboutModal.tsx @@ -3,21 +3,19 @@ import { Flex, Grid, GridItem, + Heading, Image, Link, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, + Text, useDisclosure, -} from '@chakra-ui/react'; -import { InvHeading } from 'common/components/InvHeading/wrapper'; -import { - InvModal, - InvModalBody, - InvModalCloseButton, - InvModalContent, - InvModalFooter, - InvModalHeader, - InvModalOverlay, -} from 'common/components/InvModal/wrapper'; -import { InvText } from 'common/components/InvText/wrapper'; +} from '@invoke-ai/ui'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import { discordLink, @@ -54,12 +52,12 @@ const AboutModal = ({ children }: AboutModalProps) => { {cloneElement(children, { onClick: onOpen, })} - - - - {t('accessibility.about')} - - + + + + {t('accessibility.about')} + + { h="full" > - { p="1" > {t('common.localSystem')} - + {deps.map(({ name, version }, i) => ( { w="full" templateColumns="repeat(2, 1fr)" > - {name} - + {name} + {version ? version : t('common.notInstalled')} - + ))} @@ -102,7 +100,7 @@ const AboutModal = ({ children }: AboutModalProps) => { h="full" > - {appVersion && {`v${appVersion?.version}`}} + {appVersion && {`v${appVersion?.version}`}} @@ -117,20 +115,18 @@ const AboutModal = ({ children }: AboutModalProps) => { - - {t('common.aboutHeading')} - - {t('common.aboutDesc')} + {t('common.aboutHeading')} + {t('common.aboutDesc')} {websiteLink} - - - - + + + + > ); }; diff --git a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeyListItem.tsx b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeyListItem.tsx index 08a8a228e0..c23b86a0e4 100644 --- a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeyListItem.tsx +++ b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeyListItem.tsx @@ -1,5 +1,4 @@ -import { Flex, Kbd, Spacer } from '@chakra-ui/react'; -import { InvText } from 'common/components/InvText/wrapper'; +import { Flex, Kbd, Spacer, Text } from '@invoke-ai/ui'; import { Fragment, memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -15,7 +14,7 @@ const HotkeyListItem = (props: HotkeysModalProps) => { return ( - {title} + {title} {hotkeys.map((hotkey, index) => { return ( @@ -29,27 +28,22 @@ const HotkeyListItem = (props: HotkeysModalProps) => { {key} {index !== hotkey.length - 1 && ( - + + - + )} > ))} {index !== hotkeys.length - 1 && ( - + {t('common.or')} - + )} ); })} - {description} + {description} ); }; diff --git a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx index ec810bb54a..9b54784101 100644 --- a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx +++ b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModal.tsx @@ -2,22 +2,20 @@ import { CloseIcon } from '@chakra-ui/icons'; import { Divider, Flex, + IconButton, + Input, InputGroup, InputRightElement, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, useDisclosure, -} from '@chakra-ui/react'; +} from '@invoke-ai/ui'; import { IAINoContentFallback } from 'common/components/IAIImageFallback'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { - InvModal, - InvModalBody, - InvModalCloseButton, - InvModalContent, - InvModalFooter, - InvModalHeader, - InvModalOverlay, -} from 'common/components/InvModal/wrapper'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import type { HotkeyGroup } from 'features/system/components/HotkeysModal/useHotkeyData'; import { useHotkeyData } from 'features/system/components/HotkeysModal/useHotkeyData'; @@ -86,21 +84,21 @@ const HotkeysModal = ({ children }: HotkeysModalProps) => { {cloneElement(children, { onClick: onOpen, })} - - - - {t('hotkeys.keyboardShortcuts')} - - + + + + {t('hotkeys.keyboardShortcuts')} + + - {hotkeyFilter.length && ( - { )} - - - - + + + + > ); }; diff --git a/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx b/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx index 50ebd4d702..ba02ca1a1c 100644 --- a/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx +++ b/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx @@ -1,9 +1,7 @@ /* eslint-disable i18next/no-literal-string */ -import { Image } from '@chakra-ui/react'; +import { Image, Text, Tooltip } from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { $logo } from 'app/store/nanostores/logo'; -import { InvText } from 'common/components/InvText/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import InvokeLogoYellow from 'public/assets/images/invoke-symbol-ylw-lrg.svg'; import { memo, useMemo, useRef } from 'react'; import { useGetAppVersionQuery } from 'services/api/endpoints/appInfo'; @@ -14,7 +12,7 @@ const InvokeAILogoComponent = () => { const logoOverride = useStore($logo); const tooltip = useMemo(() => { if (appVersion) { - return v{appVersion.version}; + return v{appVersion.version}; } return null; }, [appVersion]); @@ -24,7 +22,7 @@ const InvokeAILogoComponent = () => { } return ( - + { minH="24px" userSelect="none" /> - + ); }; diff --git a/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx b/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx index 165bf0496b..600535fb66 100644 --- a/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx +++ b/invokeai/frontend/web/src/features/system/components/ProgressBar.tsx @@ -1,4 +1,4 @@ -import { Progress } from '@chakra-ui/react'; +import { Progress } from '@invoke-ai/ui'; import { createSelector } from '@reduxjs/toolkit'; import { useAppSelector } from 'app/store/storeHooks'; import { selectSystemSlice } from 'features/system/store/systemSlice'; diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLanguageSelect.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLanguageSelect.tsx index 491c605f41..5a71161010 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLanguageSelect.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLanguageSelect.tsx @@ -1,7 +1,6 @@ +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { languageChanged } from 'features/system/store/systemSlice'; import { isLanguage } from 'features/system/store/types'; @@ -44,7 +43,7 @@ export const SettingsLanguageSelect = memo(() => { [language, options] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isLanguage(v?.value)) { return; @@ -54,12 +53,10 @@ export const SettingsLanguageSelect = memo(() => { [dispatch] ); return ( - - - + + {t('common.languagePickerLabel')} + + ); }); diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLogLevelSelect.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLogLevelSelect.tsx index d5a7fd2e3d..a83a6403bd 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLogLevelSelect.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsLogLevelSelect.tsx @@ -1,8 +1,7 @@ +import type { ComboboxOnChange } from '@invoke-ai/ui'; +import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { isLogLevel, zLogLevel } from 'app/logging/logger'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { InvSelectOnChange } from 'common/components/InvSelect/types'; import { consoleLogLevelChanged } from 'features/system/store/systemSlice'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -22,7 +21,7 @@ export const SettingsLogLevelSelect = memo(() => { [consoleLogLevel, options] ); - const onChange = useCallback( + const onChange = useCallback( (v) => { if (!isLogLevel(v?.value)) { return; @@ -32,12 +31,10 @@ export const SettingsLogLevelSelect = memo(() => { [dispatch] ); return ( - - - + + {t('common.languagePickerLabel')} + + ); }); diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx index f630e2fe59..d744ac2892 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx @@ -1,12 +1,12 @@ -import { useDisclosure } from '@chakra-ui/react'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; import { - InvMenu, - InvMenuButton, - InvMenuGroup, -} from 'common/components/InvMenu/wrapper'; + IconButton, + Menu, + MenuButton, + MenuGroup, + MenuItem, + MenuList, + useDisclosure, +} from '@invoke-ai/ui'; import { useGlobalMenuClose } from 'common/hooks/useGlobalMenuClose'; import AboutModal from 'features/system/components/AboutModal/AboutModal'; import HotkeysModal from 'features/system/components/HotkeysModal/HotkeysModal'; @@ -33,69 +33,69 @@ const SettingsMenu = () => { const isGithubLinkEnabled = useFeatureStatus('githubLink').isFeatureEnabled; return ( - - + } boxSize={8} /> - - + + {isGithubLinkEnabled && ( - } > {t('common.githubLabel')} - + )} {isBugLinkEnabled && ( - } > {t('common.reportBugLabel')} - + )} {isDiscordLinkEnabled && ( - } > {t('common.discordLabel')} - + )} - - + + - }> + }> {t('common.hotkeysLabel')} - + - }> + }> {t('common.settingsLabel')} - + - - + + - }> + }> {t('accessibility.about')} - + - - - + + + ); }; diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx index 4449e2883b..59dd6677e0 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx @@ -1,18 +1,20 @@ -import { Flex, useDisclosure } from '@chakra-ui/react'; -import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvControl } from 'common/components/InvControl/InvControl'; import { - InvModal, - InvModalBody, - InvModalCloseButton, - InvModalContent, - InvModalFooter, - InvModalHeader, - InvModalOverlay, -} from 'common/components/InvModal/wrapper'; -import { InvSwitch } from 'common/components/InvSwitch/wrapper'; -import { InvText } from 'common/components/InvText/wrapper'; + Button, + Flex, + FormControl, + FormLabel, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, + Switch, + Text, + useDisclosure, +} from '@invoke-ai/ui'; +import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import { useClearStorage } from 'common/hooks/useClearStorage'; import { shouldUseCpuNoiseChanged } from 'features/parameters/store/generationSlice'; @@ -200,101 +202,109 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => { onClick: onSettingsModalOpen, })} - - - - {t('common.settingsLabel')} - - + + + {t('common.settingsLabel')} + + - - + {t('settings.confirmOnDelete')} + - + - - + {t('settings.enableNSFWChecker')} + - - - + + + {t('settings.enableInvisibleWatermark')} + + - + - - + {t('settings.showProgressInViewer')} + - - - + + + {t('settings.antialiasProgressImages')} + + - - - + + {t('parameters.useCpuNoise')} + - + {shouldShowLocalizationToggle && } - - + + {t('settings.enableInformationalPopovers')} + + - + {shouldShowDeveloperSettings && ( - - + {t('settings.shouldLogToConsole')} + - + - - + + {t('settings.enableImageDebugging')} + + - + )} {shouldShowClearIntermediates && ( - { {t('settings.clearIntermediatesWithCount', { count: intermediatesCount ?? 0, })} - - + + {t('settings.clearIntermediatesDesc1')} - - + + {t('settings.clearIntermediatesDesc2')} - - + + {t('settings.clearIntermediatesDesc3')} - + )} - + {t('settings.resetWebUI')} - + {shouldShowResetWebUiText && ( <> - + {t('settings.resetWebUIDesc1')} - - + + {t('settings.resetWebUIDesc2')} - + > )} - + - - - + + + - - - - - + + + + - - + + {t('settings.resetComplete')} {t('settings.reloadingIn')}{' '} {countdown}... - - + + - - - - + + + + > ); }; diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx index fa622d94d0..479bd5321b 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx b/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx index 486ca9a115..52968ece2a 100644 --- a/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx +++ b/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx @@ -1,6 +1,5 @@ -import { Icon } from '@chakra-ui/react'; +import { Icon, Tooltip } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { PiWarningBold } from 'react-icons/pi'; @@ -11,14 +10,14 @@ const StatusIndicator = () => { if (!isConnected) { return ( - - + ); } diff --git a/invokeai/frontend/web/src/features/system/components/StickyScrollable.tsx b/invokeai/frontend/web/src/features/system/components/StickyScrollable.tsx index 87c81f7e8a..c705d90a80 100644 --- a/invokeai/frontend/web/src/features/system/components/StickyScrollable.tsx +++ b/invokeai/frontend/web/src/features/system/components/StickyScrollable.tsx @@ -1,5 +1,4 @@ -import { Flex } from '@chakra-ui/layout'; -import { InvHeading } from 'common/components/InvHeading/wrapper'; +import { Flex, Heading } from '@invoke-ai/ui'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; @@ -11,7 +10,7 @@ export const StickyScrollableHeading = memo( (props: StickyScrollableHeadingProps) => { return ( - {props.title} + {props.title} ); } diff --git a/invokeai/frontend/web/src/features/system/store/systemSlice.ts b/invokeai/frontend/web/src/features/system/store/systemSlice.ts index 1307bb00aa..aee77b7d52 100644 --- a/invokeai/frontend/web/src/features/system/store/systemSlice.ts +++ b/invokeai/frontend/web/src/features/system/store/systemSlice.ts @@ -1,4 +1,4 @@ -import type { UseToastOptions } from '@chakra-ui/react'; +import type { UseToastOptions } from '@invoke-ai/ui'; import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice, isAnyOf } from '@reduxjs/toolkit'; import type { RootState } from 'app/store/store'; diff --git a/invokeai/frontend/web/src/features/system/store/types.ts b/invokeai/frontend/web/src/features/system/store/types.ts index e8e394b950..7df3f72c40 100644 --- a/invokeai/frontend/web/src/features/system/store/types.ts +++ b/invokeai/frontend/web/src/features/system/store/types.ts @@ -1,4 +1,4 @@ -import type { UseToastOptions } from '@chakra-ui/react'; +import type { UseToastOptions } from '@invoke-ai/ui'; import type { LogLevel } from 'app/logging/logger'; import type { ProgressImage } from 'services/events/types'; import { z } from 'zod'; diff --git a/invokeai/frontend/web/src/features/system/util/makeToast.ts b/invokeai/frontend/web/src/features/system/util/makeToast.ts index 159a3bbaaa..7afadd7ca8 100644 --- a/invokeai/frontend/web/src/features/system/util/makeToast.ts +++ b/invokeai/frontend/web/src/features/system/util/makeToast.ts @@ -1,4 +1,4 @@ -import type { UseToastOptions } from '@chakra-ui/react'; +import type { UseToastOptions } from '@invoke-ai/ui'; export type MakeToastArg = string | UseToastOptions; diff --git a/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx b/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx index 4734d1f797..fd448758a8 100644 --- a/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx +++ b/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx @@ -1,7 +1,4 @@ -import { Flex } from '@chakra-ui/layout'; -import { Portal } from '@chakra-ui/portal'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; +import { Flex, IconButton, Portal, Tooltip } from '@invoke-ai/ui'; import type { UsePanelReturn } from 'features/ui/hooks/usePanel'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -27,11 +24,8 @@ const FloatingGalleryButton = (props: Props) => { top="50%" insetInlineEnd="21px" > - - + } @@ -39,7 +33,7 @@ const FloatingGalleryButton = (props: Props) => { h={48} borderEndRadius={0} /> - + ); diff --git a/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx b/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx index 466da87d85..3faaa683ee 100644 --- a/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx +++ b/invokeai/frontend/web/src/features/ui/components/FloatingParametersPanelButtons.tsx @@ -1,8 +1,12 @@ import { SpinnerIcon } from '@chakra-ui/icons'; -import type { SystemStyleObject } from '@chakra-ui/react'; -import { Flex, Portal } from '@chakra-ui/react'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { + ButtonGroup, + Flex, + IconButton, + Portal, + spinAnimation, +} from '@invoke-ai/ui'; import CancelCurrentQueueItemIconButton from 'features/queue/components/CancelCurrentQueueItemIconButton'; import ClearQueueIconButton from 'features/queue/components/ClearQueueIconButton'; import { QueueButtonTooltip } from 'features/queue/components/QueueButtonTooltip'; @@ -13,7 +17,6 @@ import { useTranslation } from 'react-i18next'; import { PiSlidersHorizontalBold } from 'react-icons/pi'; import { RiSparklingFill } from 'react-icons/ri'; import { useGetQueueStatusQuery } from 'services/api/endpoints/queue'; -import { spinAnimationSlow } from 'theme/animations'; const floatingButtonStyles: SystemStyleObject = { borderStartRadius: 0, @@ -32,7 +35,7 @@ const FloatingSidePanelButtons = (props: Props) => { const queueButtonIcon = useMemo( () => !isDisabled && queueStatus?.processor.is_processing ? ( - + ) : ( ), @@ -55,15 +58,15 @@ const FloatingSidePanelButtons = (props: Props) => { gap={2} h={48} > - - + } /> - { sx={floatingButtonStyles} /> - + diff --git a/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx b/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx index 5b1da3bd08..d79ea1e741 100644 --- a/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx +++ b/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx @@ -1,17 +1,18 @@ -import { Flex, Spacer } from '@chakra-ui/react'; +import { + Flex, + IconButton, + Spacer, + Tab, + TabList, + TabPanel, + TabPanels, + Tabs, + Tooltip, +} from '@invoke-ai/ui'; import { useStore } from '@nanostores/react'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { $customNavComponent } from 'app/store/nanostores/customNavComponent'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvTab } from 'common/components/InvTabs/InvTab'; -import { - InvTabList, - InvTabPanel, - InvTabPanels, - InvTabs, -} from 'common/components/InvTabs/wrapper'; -import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import ImageGalleryContent from 'features/gallery/components/ImageGalleryContent'; import NodeEditorPanelGroup from 'features/nodes/components/sidePanel/NodeEditorPanelGroup'; import InvokeAILogoComponent from 'features/system/components/InvokeAILogoComponent'; @@ -139,9 +140,9 @@ const InvokeTabs = () => { const tabs = useMemo( () => enabledTabs.map((tab) => ( - - + { aria-label={t(tab.translationKey)} data-testid={t(tab.translationKey)} /> - + )), [enabledTabs, t, handleClickTab, activeTabName] ); const tabPanels = useMemo( () => - enabledTabs.map((tab) => ( - {tab.content} - )), + enabledTabs.map((tab) => {tab.content}), [enabledTabs] ); @@ -236,7 +235,7 @@ const InvokeTabs = () => { ); return ( - { > - + {tabs} - + {customNavComponent ? customNavComponent : } @@ -291,9 +290,9 @@ const InvokeTabs = () => { > )} - + {tabPanels} - + {shouldShowGalleryPanel && ( <> @@ -323,7 +322,7 @@ const InvokeTabs = () => { {shouldShowGalleryPanel && ( )} - + ); }; diff --git a/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx b/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx index 465e89d5f0..591f1bc79f 100644 --- a/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx +++ b/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex } from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import { Prompts } from 'features/parameters/components/Prompts/Prompts'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx index a475b1277b..b2b2a8e103 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx @@ -1,4 +1,4 @@ -import { Box } from '@chakra-ui/react'; +import { Box } from '@invoke-ai/ui'; import InitialImageDisplay from 'features/parameters/components/ImageToImage/InitialImageDisplay'; import ResizeHandle from 'features/ui/components/tabs/ResizeHandle'; import TextToImageTabMain from 'features/ui/components/tabs/TextToImageTab'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManagerTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManagerTab.tsx index d98b69b612..d57177af9e 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManagerTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManagerTab.tsx @@ -1,4 +1,4 @@ -import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@chakra-ui/react'; +import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@invoke-ai/ui'; import ImportModelsPanel from 'features/modelManager/subpanels/ImportModelsPanel'; import MergeModelsPanel from 'features/modelManager/subpanels/MergeModelsPanel'; import ModelManagerPanel from 'features/modelManager/subpanels/ModelManagerPanel'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx index 083d0790f3..af144c71ef 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx @@ -1,4 +1,5 @@ -import { Box, defineStyleConfig, Flex, useStyleConfig } from '@chakra-ui/react'; +import type { SystemStyleObject } from '@invoke-ai/ui'; +import { Box, chakra, Flex } from '@invoke-ai/ui'; import { memo } from 'react'; import type { PanelResizeHandleProps } from 'react-resizable-panels'; import { PanelResizeHandle } from 'react-resizable-panels'; @@ -7,78 +8,76 @@ type ResizeHandleProps = PanelResizeHandleProps & { orientation: 'horizontal' | 'vertical'; }; +const ChakraPanelResizeHandle = chakra(PanelResizeHandle); + const ResizeHandle = (props: ResizeHandleProps) => { const { orientation, ...rest } = props; - const styles = useStyleConfig('ResizeHandle', { orientation }); return ( - - + + - + ); }; export default memo(ResizeHandle); -export const resizeHandleTheme = defineStyleConfig({ - // The styles all Cards have in common - baseStyle: () => ({ - display: 'flex', - pos: 'relative', +const sx: SystemStyleObject = { + display: 'flex', + pos: 'relative', + '&[data-orientation="horizontal"]': { + w: 'full', + h: 5, + }, + '&[data-orientation="vertical"]': { w: 5, h: 'full' }, + alignItems: 'center', + justifyContent: 'center', + div: { + bg: 'base.800', + }, + _hover: { + div: { bg: 'base.700' }, + }, + _active: { + div: { bg: 'base.600' }, + }, + transitionProperty: 'common', + transitionDuration: 'normal', + '.resize-handle-inner': { '&[data-orientation="horizontal"]': { - w: 'full', - h: 5, + w: 'calc(100% - 1rem)', + h: '2px', }, - '&[data-orientation="vertical"]': { w: 5, h: 'full' }, - alignItems: 'center', - justifyContent: 'center', - div: { - bg: 'base.800', + '&[data-orientation="vertical"]': { + w: '2px', + h: 'calc(100% - 1rem)', }, - _hover: { - div: { bg: 'base.700' }, + borderRadius: 'base', + transitionProperty: 'inherit', + transitionDuration: 'inherit', + }, + '.resize-handle-drag-handle': { + pos: 'absolute', + borderRadius: '1px', + transitionProperty: 'inherit', + transitionDuration: 'inherit', + '&[data-orientation="horizontal"]': { + w: '30px', + h: '6px', + insetInlineStart: '50%', + transform: 'translate(-50%, 0)', }, - _active: { - div: { bg: 'base.600' }, + '&[data-orientation="vertical"]': { + w: '6px', + h: '30px', + insetBlockStart: '50%', + transform: 'translate(0, -50%)', }, - transitionProperty: 'common', - transitionDuration: 'normal', - '.resize-handle-inner': { - '&[data-orientation="horizontal"]': { - w: 'calc(100% - 1rem)', - h: '2px', - }, - '&[data-orientation="vertical"]': { - w: '2px', - h: 'calc(100% - 1rem)', - }, - borderRadius: 'base', - transitionProperty: 'inherit', - transitionDuration: 'inherit', - }, - '.resize-handle-drag-handle': { - pos: 'absolute', - borderRadius: '1px', - transitionProperty: 'inherit', - transitionDuration: 'inherit', - '&[data-orientation="horizontal"]': { - w: '30px', - h: '6px', - insetInlineStart: '50%', - transform: 'translate(-50%, 0)', - }, - '&[data-orientation="vertical"]': { - w: '6px', - h: '30px', - insetBlockStart: '50%', - transform: 'translate(0, -50%)', - }, - }, - }), -}); + }, +}; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx index 51f1b1f2d5..4dc7dd3aeb 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from '@chakra-ui/react'; +import { Box, Flex } from '@invoke-ai/ui'; import CurrentImageDisplay from 'features/gallery/components/CurrentImage/CurrentImageDisplay'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx index 6e3b7d3756..b47717b8bd 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import IAIDropOverlay from 'common/components/IAIDropOverlay'; import IAICanvas from 'features/canvas/components/IAICanvas'; import IAICanvasToolbar from 'features/canvas/components/IAICanvasToolbar/IAICanvasToolbar'; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryButton.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryButton.tsx index 4bbd21c6e1..8b1f0a2283 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryButton.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryButton.tsx @@ -1,5 +1,4 @@ -import { useDisclosure } from '@chakra-ui/react'; -import { InvButton } from 'common/components/InvButton/InvButton'; +import { Button, useDisclosure } from '@invoke-ai/ui'; import { WorkflowLibraryModalContext } from 'features/workflowLibrary/context/WorkflowLibraryModalContext'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -13,13 +12,13 @@ const WorkflowLibraryButton = () => { return ( - } onClick={disclosure.onOpen} pointerEvents="auto" > {t('workflows.workflowLibrary')} - + ); diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryList.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryList.tsx index 2dd442813b..2c5b6fa1e7 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryList.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryList.tsx @@ -1,25 +1,23 @@ import { CloseIcon } from '@chakra-ui/icons'; +import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui'; import { + Button, + ButtonGroup, + Combobox, Divider, Flex, + FormControl, + FormLabel, + IconButton, + Input, InputGroup, InputRightElement, Spacer, -} from '@chakra-ui/react'; +} from '@invoke-ai/ui'; import { IAINoContentFallback, IAINoContentFallbackWithSpinner, } from 'common/components/IAIImageFallback'; -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvSelect } from 'common/components/InvSelect/InvSelect'; -import type { - InvSelectOnChange, - InvSelectOption, -} from 'common/components/InvSelect/types'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; import type { WorkflowCategory } from 'features/nodes/types/workflow'; import WorkflowLibraryListItem from 'features/workflowLibrary/components/WorkflowLibraryListItem'; @@ -40,7 +38,7 @@ const PER_PAGE = 10; const zOrderBy = z.enum(['opened_at', 'created_at', 'updated_at', 'name']); type OrderBy = z.infer; const isOrderBy = (v: unknown): v is OrderBy => zOrderBy.safeParse(v).success; -const ORDER_BY_OPTIONS: InvSelectOption[] = [ +const ORDER_BY_OPTIONS: ComboboxOption[] = [ { value: 'opened_at', label: 'Opened' }, { value: 'created_at', label: 'Created' }, { value: 'updated_at', label: 'Updated' }, @@ -51,7 +49,7 @@ const zDirection = z.enum(['ASC', 'DESC']); type Direction = z.infer; const isDirection = (v: unknown): v is Direction => zDirection.safeParse(v).success; -const DIRECTION_OPTIONS: InvSelectOption[] = [ +const DIRECTION_OPTIONS: ComboboxOption[] = [ { value: 'ASC', label: 'Ascending' }, { value: 'DESC', label: 'Descending' }, ]; @@ -89,7 +87,7 @@ const WorkflowLibraryList = () => { const { data, isLoading, isError, isFetching } = useListWorkflowsQuery(queryArg); - const onChangeOrderBy = useCallback( + const onChangeOrderBy = useCallback( (v) => { if (!isOrderBy(v?.value) || v.value === order_by) { return; @@ -104,7 +102,7 @@ const WorkflowLibraryList = () => { [order_by] ); - const onChangeDirection = useCallback( + const onChangeDirection = useCallback( (v) => { if (!isDirection(v?.value) || v.value === direction) { return; @@ -157,53 +155,45 @@ const WorkflowLibraryList = () => { return ( <> - - + {t('workflows.userWorkflows')} - - + {t('workflows.defaultWorkflows')} - - + + {category === 'user' && ( <> - - + {t('common.orderBy')} + - - - + + {t('common.direction')} + - + > )} - { /> {query.trim().length && ( - { {workflowDTO.category === 'user' && ( - { {t('common.updated')}:{' '} {dateFormat(workflowDTO.updated_at, masks.shortDate)}{' '} {dateFormat(workflowDTO.updated_at, masks.shortTime)} - + )} {workflowDTO.description ? ( - + {workflowDTO.description} - + ) : ( - {t('workflows.noDescription')} - + )} {workflowDTO.category === 'user' && ( - { {t('common.created')}:{' '} {dateFormat(workflowDTO.created_at, masks.shortDate)}{' '} {dateFormat(workflowDTO.created_at, masks.shortTime)} - + )} - { aria-label={t('workflows.openWorkflow')} > {t('common.load')} - + {workflowDTO.category === 'user' && ( - { aria-label={t('workflows.deleteWorkflow')} > {t('common.delete')} - + )} diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryListWrapper.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryListWrapper.tsx index e6c34429d6..3dd726b03f 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryListWrapper.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryListWrapper.tsx @@ -1,4 +1,4 @@ -import { Flex } from '@chakra-ui/react'; +import { Flex } from '@invoke-ai/ui'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/DownloadWorkflowMenuItem.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/DownloadWorkflowMenuItem.tsx index 3e510a1e83..62988147fe 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/DownloadWorkflowMenuItem.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/DownloadWorkflowMenuItem.tsx @@ -1,4 +1,4 @@ -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; +import { MenuItem } from '@invoke-ai/ui'; import { useDownloadWorkflow } from 'features/workflowLibrary/hooks/useDownloadWorkflow'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -9,13 +9,13 @@ const DownloadWorkflowMenuItem = () => { const downloadWorkflow = useDownloadWorkflow(); return ( - } onClick={downloadWorkflow} > {t('workflows.downloadWorkflow')} - + ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/NewWorkflowMenuItem.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/NewWorkflowMenuItem.tsx index 2ac22abfa1..82acfa860d 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/NewWorkflowMenuItem.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/NewWorkflowMenuItem.tsx @@ -1,8 +1,11 @@ -import { Flex, useDisclosure } from '@chakra-ui/react'; +import { + ConfirmationAlertDialog, + Flex, + MenuItem, + Text, + useDisclosure, +} from '@invoke-ai/ui'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; -import { InvText } from 'common/components/InvText/wrapper'; import { nodeEditorReset } from 'features/nodes/store/nodesSlice'; import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; @@ -41,21 +44,21 @@ const NewWorkflowMenuItem = () => { return ( <> - } onClick={onClick}> + } onClick={onClick}> {t('nodes.newWorkflow')} - + - - {t('nodes.newWorkflowDesc')} - {t('nodes.newWorkflowDesc2')} + {t('nodes.newWorkflowDesc')} + {t('nodes.newWorkflowDesc2')} - + > ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowAsMenuItem.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowAsMenuItem.tsx index 5a28b279f0..6510cac329 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowAsMenuItem.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowAsMenuItem.tsx @@ -1,9 +1,12 @@ -import { useDisclosure } from '@chakra-ui/react'; +import { + ConfirmationAlertDialog, + FormControl, + FormLabel, + Input, + MenuItem, + useDisclosure, +} from '@invoke-ai/ui'; import { useAppSelector } from 'app/store/storeHooks'; -import { InvConfirmationAlertDialog } from 'common/components/InvConfirmationAlertDialog/InvConfirmationAlertDialog'; -import { InvControl } from 'common/components/InvControl/InvControl'; -import { InvInput } from 'common/components/InvInput/InvInput'; -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; import { useSaveWorkflowAs } from 'features/workflowLibrary/hooks/useSaveWorkflowAs'; import { getWorkflowCopyName } from 'features/workflowLibrary/util/getWorkflowCopyName'; import type { ChangeEvent } from 'react'; @@ -35,25 +38,26 @@ const SaveWorkflowAsButton = () => { return ( <> - } onClick={onOpenCallback}> + } onClick={onOpenCallback}> {t('workflows.saveWorkflowAs')} - + - - - + {t('workflows.workflowName')} + - - + + > ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowMenuItem.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowMenuItem.tsx index da479b83d3..a047444bbc 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowMenuItem.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SaveWorkflowMenuItem.tsx @@ -1,4 +1,4 @@ -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; +import { MenuItem } from '@invoke-ai/ui'; import { useSaveLibraryWorkflow } from 'features/workflowLibrary/hooks/useSaveWorkflow'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -8,9 +8,9 @@ const SaveLibraryWorkflowMenuItem = () => { const { t } = useTranslation(); const { saveWorkflow } = useSaveLibraryWorkflow(); return ( - } onClick={saveWorkflow}> + } onClick={saveWorkflow}> {t('workflows.saveWorkflow')} - + ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SettingsMenuItem.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SettingsMenuItem.tsx index 19b3501b70..c0aa94264e 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SettingsMenuItem.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/SettingsMenuItem.tsx @@ -1,4 +1,4 @@ -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; +import { MenuItem } from '@invoke-ai/ui'; import WorkflowEditorSettings from 'features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,9 +10,9 @@ const DownloadWorkflowMenuItem = () => { return ( {({ onOpen }) => ( - } onClick={onOpen}> + } onClick={onOpen}> {t('nodes.workflowSettings')} - + )} ); diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/UploadWorkflowMenuItem.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/UploadWorkflowMenuItem.tsx index 3e5faa1a0c..d6c497cadb 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/UploadWorkflowMenuItem.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/UploadWorkflowMenuItem.tsx @@ -1,4 +1,4 @@ -import { InvMenuItem } from 'common/components/InvMenu/InvMenuItem'; +import { MenuItem } from '@invoke-ai/ui'; import { useLoadWorkflowFromFile } from 'features/workflowLibrary/hooks/useLoadWorkflowFromFile'; import { memo, useCallback, useRef } from 'react'; import { useDropzone } from 'react-dropzone'; @@ -27,10 +27,10 @@ const UploadWorkflowMenuItem = () => { multiple: false, }); return ( - } {...getRootProps()}> + } {...getRootProps()}> {t('workflows.uploadWorkflow')} - + ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/WorkflowLibraryMenu.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/WorkflowLibraryMenu.tsx index 340984d92b..2ab728ae1f 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/WorkflowLibraryMenu.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryMenu/WorkflowLibraryMenu.tsx @@ -1,11 +1,11 @@ -import { useDisclosure } from '@chakra-ui/react'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; -import { InvMenuList } from 'common/components/InvMenu/InvMenuList'; import { - InvMenu, - InvMenuButton, - InvMenuDivider, -} from 'common/components/InvMenu/wrapper'; + IconButton, + Menu, + MenuButton, + MenuDivider, + MenuList, + useDisclosure, +} from '@invoke-ai/ui'; import { useGlobalMenuClose } from 'common/hooks/useGlobalMenuClose'; import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import DownloadWorkflowMenuItem from 'features/workflowLibrary/components/WorkflowLibraryMenu/DownloadWorkflowMenuItem'; @@ -27,23 +27,23 @@ const WorkflowLibraryMenu = () => { useFeatureStatus('workflowLibrary').isFeatureEnabled; return ( - - + } pointerEvents="auto" /> - + {isWorkflowLibraryEnabled && } {isWorkflowLibraryEnabled && } - + - - + + ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryModal.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryModal.tsx index e3515e71db..e3367dfe28 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryModal.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryModal.tsx @@ -1,12 +1,12 @@ import { - InvModal, - InvModalBody, - InvModalCloseButton, - InvModalContent, - InvModalFooter, - InvModalHeader, - InvModalOverlay, -} from 'common/components/InvModal/wrapper'; + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, +} from '@invoke-ai/ui'; import WorkflowLibraryContent from 'features/workflowLibrary/components/WorkflowLibraryContent'; import { useWorkflowLibraryModalContext } from 'features/workflowLibrary/context/useWorkflowLibraryModalContext'; import { memo } from 'react'; @@ -16,9 +16,9 @@ const WorkflowLibraryModal = () => { const { t } = useTranslation(); const { isOpen, onClose } = useWorkflowLibraryModalContext(); return ( - - - + + { maxW="1200px" maxH="664px" > - {t('workflows.workflowLibrary')} - - + {t('workflows.workflowLibrary')} + + - - - - + + + + ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryPagination.tsx b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryPagination.tsx index 026dcf2e3d..997e170942 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryPagination.tsx +++ b/invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryPagination.tsx @@ -1,6 +1,4 @@ -import { InvButton } from 'common/components/InvButton/InvButton'; -import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup'; -import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; +import { Button, ButtonGroup, IconButton } from '@invoke-ai/ui'; import type { Dispatch, SetStateAction } from 'react'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -54,8 +52,8 @@ const WorkflowLibraryPagination = ({ page, setPage, data }: Props) => { }, [data.pages, page, setPage]); return ( - - + { icon={} /> {pages.map((p) => ( - { transitionDuration="0s" // the delay in animation looks jank > {p.page + 1} - + ))} - } /> - + ); }; diff --git a/invokeai/frontend/web/src/features/workflowLibrary/context/WorkflowLibraryModalContext.ts b/invokeai/frontend/web/src/features/workflowLibrary/context/WorkflowLibraryModalContext.ts index 4220021601..20e5640a33 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/context/WorkflowLibraryModalContext.ts +++ b/invokeai/frontend/web/src/features/workflowLibrary/context/WorkflowLibraryModalContext.ts @@ -1,4 +1,4 @@ -import type { UseDisclosureReturn } from '@chakra-ui/react'; +import type { UseDisclosureReturn } from '@invoke-ai/ui'; import { createContext } from 'react'; export const WorkflowLibraryModalContext = diff --git a/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflow.ts b/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflow.ts index 17293d954c..6417084312 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflow.ts +++ b/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflow.ts @@ -1,5 +1,5 @@ -import type { ToastId } from '@chakra-ui/react'; -import { useToast } from '@chakra-ui/react'; +import type { ToastId } from '@invoke-ai/ui'; +import { useToast } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; import { $builtWorkflow } from 'features/nodes/hooks/useWorkflowWatcher'; import { diff --git a/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflowAs.ts b/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflowAs.ts index 5081c2010c..bd0b091346 100644 --- a/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflowAs.ts +++ b/invokeai/frontend/web/src/features/workflowLibrary/hooks/useSaveWorkflowAs.ts @@ -1,5 +1,5 @@ -import type { ToastId } from '@chakra-ui/react'; -import { useToast } from '@chakra-ui/react'; +import type { ToastId } from '@invoke-ai/ui'; +import { useToast } from '@invoke-ai/ui'; import { useAppDispatch } from 'app/store/storeHooks'; import { $builtWorkflow } from 'features/nodes/hooks/useWorkflowWatcher'; import { diff --git a/invokeai/frontend/web/src/index.ts b/invokeai/frontend/web/src/index.ts index 8f399cdeeb..e00559206b 100644 --- a/invokeai/frontend/web/src/index.ts +++ b/invokeai/frontend/web/src/index.ts @@ -1,9 +1,7 @@ export { default as InvokeAIUI } from './app/components/InvokeAIUI'; export type { PartialAppConfig } from './app/types/invokeai'; -export { InvIconButton } from './common/components/InvIconButton/InvIconButton'; -export { InvPopover } from './common/components/InvPopover/wrapper'; export { default as ParamMainModelSelect } from './features/parameters/components/MainModel/ParamMainModelSelect'; export { default as InvokeAiLogoComponent } from './features/system/components/InvokeAILogoComponent'; export { default as SettingsModal } from './features/system/components/SettingsModal/SettingsModal'; export { default as StatusIndicator } from './features/system/components/StatusIndicator'; -export { theme as theme } from './theme/theme'; +// export { theme as theme } from './theme/theme'; diff --git a/invokeai/frontend/web/src/services/api/endpoints/images.ts b/invokeai/frontend/web/src/services/api/endpoints/images.ts index 8c4bfddec9..dbada82aa1 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/images.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/images.ts @@ -1428,8 +1428,9 @@ export const imagesApi = api.injectEndpoints({ const tags: ApiTagDescription[] = []; result?.removed_image_names.forEach((image_name) => { - const board_id = imageDTOs.find((i) => i.image_name === image_name) - ?.board_id; + const board_id = imageDTOs.find( + (i) => i.image_name === image_name + )?.board_id; if (!board_id || touchedBoardIds.includes(board_id)) { return; diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts index 1d5d3a22c8..03d9153361 100644 --- a/invokeai/frontend/web/src/services/api/types.ts +++ b/invokeai/frontend/web/src/services/api/types.ts @@ -1,4 +1,4 @@ -import type { UseToastOptions } from '@chakra-ui/react'; +import type { UseToastOptions } from '@invoke-ai/ui'; import type { EntityState } from '@reduxjs/toolkit'; import type { components, paths } from 'services/api/schema'; import type { O } from 'ts-toolbelt'; @@ -235,8 +235,5 @@ type TypeGuard = { }; // eslint-disable-next-line @typescript-eslint/no-explicit-any -export type TypeGuardFor> = T extends TypeGuard< - infer U -> - ? U - : never; +export type TypeGuardFor> = + T extends TypeGuard ? U : never; diff --git a/invokeai/frontend/web/src/theme/animations.ts b/invokeai/frontend/web/src/theme/animations.ts deleted file mode 100644 index c92c88e115..0000000000 --- a/invokeai/frontend/web/src/theme/animations.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { keyframes } from '@emotion/react'; - -export const spinKeyframes = keyframes` - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -`; - -export const spinAnimation = `${spinKeyframes} 0.45s linear infinite`; - -export const spinAnimationSlow = `${spinKeyframes} 1s linear infinite`; diff --git a/invokeai/frontend/web/src/theme/colors.ts b/invokeai/frontend/web/src/theme/colors.ts deleted file mode 100644 index e35af79a61..0000000000 --- a/invokeai/frontend/web/src/theme/colors.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { InvokeAIThemeColors } from 'theme/types'; -import { generateColorPalette } from 'theme/util/generateColorPalette'; - -const BASE = { H: 220, S: 12 }; -// const BASE = { H: 220, S: 16 }; -const WORKING = { H: 47, S: 42 }; -const GOLD = { H: 40, S: 70 }; -const WARNING = { H: 28, S: 42 }; -const OK = { H: 113, S: 42 }; -const ERROR = { H: 0, S: 42 }; -const INVOKE_YELLOW = { H: 66, S: 92 }; -const INVOKE_BLUE = { H: 200, S: 76 }; -const INVOKE_GREEN = { H: 110, S: 69 }; -const INVOKE_RED = { H: 16, S: 92 }; - -export const getArbitraryBaseColor = (lightness: number) => - `hsl(${BASE.H} ${BASE.S}% ${lightness}%)`; - -export const InvokeAIColors: InvokeAIThemeColors = { - base: generateColorPalette(BASE.H, BASE.S), - baseAlpha: generateColorPalette(BASE.H, BASE.S, true), - working: generateColorPalette(WORKING.H, WORKING.S), - workingAlpha: generateColorPalette(WORKING.H, WORKING.S, true), - gold: generateColorPalette(GOLD.H, GOLD.S), - goldAlpha: generateColorPalette(GOLD.H, GOLD.S, true), - warning: generateColorPalette(WARNING.H, WARNING.S), - warningAlpha: generateColorPalette(WARNING.H, WARNING.S, true), - ok: generateColorPalette(OK.H, OK.S), - okAlpha: generateColorPalette(OK.H, OK.S, true), - error: generateColorPalette(ERROR.H, ERROR.S), - errorAlpha: generateColorPalette(ERROR.H, ERROR.S, true), - invokeYellow: generateColorPalette(INVOKE_YELLOW.H, INVOKE_YELLOW.S), - invokeYellowAlpha: generateColorPalette( - INVOKE_YELLOW.H, - INVOKE_YELLOW.S, - true - ), - invokeBlue: generateColorPalette(INVOKE_BLUE.H, INVOKE_BLUE.S), - invokeBlueAlpha: generateColorPalette(INVOKE_BLUE.H, INVOKE_BLUE.S, true), - invokeGreen: generateColorPalette(INVOKE_GREEN.H, INVOKE_GREEN.S), - invokeGreenAlpha: generateColorPalette(INVOKE_GREEN.H, INVOKE_GREEN.S, true), - invokeRed: generateColorPalette(INVOKE_RED.H, INVOKE_RED.S), - invokeRedAlpha: generateColorPalette(INVOKE_RED.H, INVOKE_RED.S, true), -}; - -export const layerStyleBody = { - bg: 'base.900', - color: 'base.50', -} as const; -export const layerStyleFirst = { - bg: 'base.850', - color: 'base.50', -} as const; -export const layerStyleSecond = { - bg: 'base.800', - color: 'base.50', -} as const; -export const layerStyleThird = { - bg: 'base.700', - color: 'base.50', -} as const; -export const layerStyleNodeBody = { - bg: 'base.800', - color: 'base.100', -} as const; -export const layerStyleNodeHeader = { - bg: 'base.900', - color: 'base.100', -} as const; -export const layerStyleNodeFooter = { - bg: 'base.900', - color: 'base.100', -} as const; -export const layerStyleDanger = { - color: 'error.500 !important', -} as const; diff --git a/invokeai/frontend/web/src/theme/reactflow.ts b/invokeai/frontend/web/src/theme/reactflow.ts deleted file mode 100644 index 125d7c2cf9..0000000000 --- a/invokeai/frontend/web/src/theme/reactflow.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { SystemStyleObject } from '@chakra-ui/styled-system'; - -const selectionStyles: SystemStyleObject = { - backgroundColor: 'blueAlpha.150 !important', - borderColor: 'blue.400 !important', - borderRadius: 'base !important', - borderStyle: 'dashed !important', -}; - -export const reactflowStyles: SystemStyleObject = { - '.react-flow__nodesselection-rect': { - ...selectionStyles, - padding: '1rem !important', - boxSizing: 'content-box !important', - transform: 'translate(-1rem, -1rem) !important', - }, - '.react-flow__selection': selectionStyles, -}; diff --git a/invokeai/frontend/web/src/theme/scrollbar.ts b/invokeai/frontend/web/src/theme/scrollbar.ts deleted file mode 100644 index f199cb23a7..0000000000 --- a/invokeai/frontend/web/src/theme/scrollbar.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { ChakraProps } from '@chakra-ui/react'; - -export const no_scrollbar: ChakraProps['sx'] = { - '::-webkit-scrollbar': { - display: 'none', - }, - scrollbarWidth: 'none', -}; - -export const scrollbar: ChakraProps['sx'] = { - scrollbarColor: 'blue.600 transparent', - scrollbarWidth: 'thick', - '::-webkit-scrollbar': { - width: '6px', // Vertical Scrollbar Width - height: '6px', // Horizontal Scrollbar Height - }, - '::-webkit-scrollbar-track': { - background: 'transparent', - }, - '::-webkit-scrollbar-thumb': { - background: 'blue.600', - borderRadius: '8px', - borderWidth: '4px', - borderColor: 'blue.600', - }, - '::-webkit-scrollbar-thumb:hover': { - background: 'blue.500', - borderColor: 'blue.500', - }, - '::-webkit-scrollbar-button': { - background: 'transparent', - }, -}; diff --git a/invokeai/frontend/web/src/theme/space.ts b/invokeai/frontend/web/src/theme/space.ts deleted file mode 100644 index 670eac8748..0000000000 --- a/invokeai/frontend/web/src/theme/space.ts +++ /dev/null @@ -1,18 +0,0 @@ -const getSpaceValues = (fractionOfDefault = 0.75) => { - const spaceKeys = [ - 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 20, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, 64, 72, 80, 96, - ]; - - const spaceObject = spaceKeys.reduce( - (acc, val) => { - acc[val] = `${val * (0.25 * fractionOfDefault)}rem`; - return acc; - }, - { px: '1px' } as Record - ); - - return spaceObject; -}; - -export const space = getSpaceValues(0.75); diff --git a/invokeai/frontend/web/src/theme/theme.ts b/invokeai/frontend/web/src/theme/theme.ts deleted file mode 100644 index b0f895ef8a..0000000000 --- a/invokeai/frontend/web/src/theme/theme.ts +++ /dev/null @@ -1,159 +0,0 @@ -import type { ThemeOverride, ToastProviderProps } from '@chakra-ui/react'; -import { accordionTheme } from 'common/components/InvAccordion/theme'; -import { badgeTheme } from 'common/components/InvBadge/theme'; -import { buttonTheme } from 'common/components/InvButton/theme'; -import { cardTheme } from 'common/components/InvCard/theme'; -import { checkboxTheme } from 'common/components/InvCheckbox/theme'; -import { - formErrorTheme, - formLabelTheme, - formTheme, -} from 'common/components/InvControl/theme'; -import { editableTheme } from 'common/components/InvEditable/theme'; -import { headingTheme } from 'common/components/InvHeading/theme'; -import { inputTheme } from 'common/components/InvInput/theme'; -import { menuTheme } from 'common/components/InvMenu/theme'; -import { modalTheme } from 'common/components/InvModal/theme'; -import { numberInputTheme } from 'common/components/InvNumberInput/theme'; -import { popoverTheme } from 'common/components/InvPopover/theme'; -import { progressTheme } from 'common/components/InvProgress/theme'; -import { skeletonTheme } from 'common/components/InvSkeleton/theme'; -import { sliderTheme } from 'common/components/InvSlider/theme'; -import { switchTheme } from 'common/components/InvSwitch/theme'; -import { tabsTheme } from 'common/components/InvTabs/theme'; -import { textTheme } from 'common/components/InvText/theme'; -import { textareaTheme } from 'common/components/InvTextarea/theme'; -import { tooltipTheme } from 'common/components/InvTooltip/theme'; -import { resizeHandleTheme } from 'features/ui/components/tabs/ResizeHandle'; - -import { - InvokeAIColors, - layerStyleBody, - layerStyleDanger, - layerStyleFirst, - layerStyleNodeBody, - layerStyleNodeFooter, - layerStyleNodeHeader, - layerStyleSecond, - layerStyleThird, -} from './colors'; -import { reactflowStyles } from './reactflow'; -import { no_scrollbar } from './scrollbar'; -import { space } from './space'; - -export const theme: ThemeOverride = { - config: { - cssVarPrefix: 'invokeai', - initialColorMode: 'dark', - useSystemColorMode: false, - }, - layerStyles: { - body: layerStyleBody, - first: layerStyleFirst, - second: layerStyleSecond, - third: layerStyleThird, - nodeBody: layerStyleNodeBody, - nodeHeader: layerStyleNodeHeader, - nodeFooter: layerStyleNodeFooter, - danger: layerStyleDanger, - }, - styles: { - global: () => ({ - body: { bg: 'base.900', color: 'base.50' }, - '*': { ...no_scrollbar }, - ...reactflowStyles, - }), - }, - radii: { - base: '4px', - lg: '8px', - md: '4px', - sm: '2px', - }, - direction: 'ltr', - fonts: { - body: "'Inter Variable', sans-serif", - heading: "'Inter Variable', sans-serif", - }, - shadows: { - blue: '0 0 10px 0 var(--invokeai-colors-blue-600)', - blueHover: '0 0 10px 0 var(--invokeai-colors-blue-500)', - ok: '0 0 7px var(--invokeai-colors-ok-400)', - working: '0 0 7px var(--invokeai-colors-working-400)', - error: '0 0 7px var(--invokeai-colors-error-400)', - selected: - '0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-blue-500)', - hoverSelected: - '0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-blue-400)', - hoverUnselected: - '0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 3px var(--invokeai-colors-blue-400)', - nodeSelected: '0 0 0 3px var(--invokeai-colors-blue-500)', - nodeHovered: '0 0 0 2px var(--invokeai-colors-blue-400)', - nodeHoveredSelected: '0 0 0 3px var(--invokeai-colors-blue-400)', - nodeInProgress: - '0 0 0 2px var(--invokeai-colors-yellow-400), 0 0 20px 2px var(--invokeai-colors-orange-700)', - }, - colors: InvokeAIColors, - components: { - Accordion: accordionTheme, - Badge: badgeTheme, - Button: buttonTheme, - Card: cardTheme, - Checkbox: checkboxTheme, - Editable: editableTheme, - Form: formTheme, - FormLabel: formLabelTheme, - Heading: headingTheme, - Input: inputTheme, - Menu: menuTheme, - Modal: modalTheme, - NumberInput: numberInputTheme, - Popover: popoverTheme, - Progress: progressTheme, - Skeleton: skeletonTheme, - Slider: sliderTheme, - Switch: switchTheme, - Tabs: tabsTheme, // WIP - Text: textTheme, - Textarea: textareaTheme, - Tooltip: tooltipTheme, - FormError: formErrorTheme, - ResizeHandle: resizeHandleTheme, - }, - space: space, - sizes: space, - fontSizes: { - xs: '0.65rem', - sm: '0.75rem', - md: '0.9rem', - lg: '1.025rem', - xl: '1.15rem', - '2xl': '1.3rem', - '3xl': '1.575rem', - '4xl': '1.925rem', - '5xl': '2.5rem', - '6xl': '3.25rem', - '7xl': '4rem', - '8xl': '6rem', - '9xl': '8rem', - }, - // fontSizes: { - // xs: '0.5rem', - // sm: '0.75rem', - // md: '0.875rem', - // lg: '1rem', - // xl: '1.125rem', - // '2xl': '1.25rem', - // '3xl': '1.5rem', - // '4xl': '1.875rem', - // '5xl': '2.25rem', - // '6xl': '3rem', - // '7xl': '3.75rem', - // '8xl': '4.5rem', - // '9xl': '6rem', - // }, -}; - -export const TOAST_OPTIONS: ToastProviderProps = { - defaultOptions: { isClosable: true, position: 'bottom-right' }, -}; diff --git a/invokeai/frontend/web/src/theme/types.ts b/invokeai/frontend/web/src/theme/types.ts deleted file mode 100644 index 87527812df..0000000000 --- a/invokeai/frontend/web/src/theme/types.ts +++ /dev/null @@ -1,46 +0,0 @@ -export type InvokeAIThemeColors = { - base: Partial; - baseAlpha: Partial; - gold: Partial; - goldAlpha: Partial; - working: Partial; - workingAlpha: Partial; - warning: Partial; - warningAlpha: Partial; - ok: Partial; - okAlpha: Partial; - error: Partial; - errorAlpha: Partial; - invokeYellow: Partial; - invokeYellowAlpha: Partial; - invokeRed: Partial; - invokeRedAlpha: Partial; - invokeGreen: Partial; - invokeGreenAlpha: Partial; - invokeBlue: Partial; - invokeBlueAlpha: Partial; -}; - -export type InvokeAIPaletteSteps = { - 0: string; - 50: string; - 100: string; - 150: string; - 200: string; - 250: string; - 300: string; - 350: string; - 400: string; - 450: string; - 500: string; - 550: string; - 600: string; - 650: string; - 700: string; - 750: string; - 800: string; - 850: string; - 900: string; - 950: string; - 1000: string; -}; diff --git a/invokeai/frontend/web/src/theme/util/constants.ts b/invokeai/frontend/web/src/theme/util/constants.ts deleted file mode 100644 index 722b899407..0000000000 --- a/invokeai/frontend/web/src/theme/util/constants.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Calc Values -export const APP_CUTOFF = '0px'; -export const APP_CONTENT_HEIGHT_CUTOFF = 'calc(70px + 1rem)'; // default: 7rem -export const PROGRESS_BAR_THICKNESS = 1.5; -export const APP_WIDTH = `calc(100vw - ${APP_CUTOFF})`; -export const APP_HEIGHT = `calc(100vh - ${PROGRESS_BAR_THICKNESS * 4}px)`; -export const APP_CONTENT_HEIGHT = `calc(100vh - ${APP_CONTENT_HEIGHT_CUTOFF})`; -export const APP_GALLERY_HEIGHT_PINNED = `calc(100vh - (${APP_CONTENT_HEIGHT_CUTOFF} + 6rem))`; -export const APP_GALLERY_HEIGHT = 'calc(100vw - 0.3rem + 5rem)'; -export const APP_GALLERY_POPOVER_HEIGHT = `calc(100vh - (${APP_CONTENT_HEIGHT_CUTOFF} + 6rem))`; -export const APP_METADATA_HEIGHT = `calc(100vh - (${APP_CONTENT_HEIGHT_CUTOFF} + 4.4rem))`; - -// this is in pixels -// export const PARAMETERS_PANEL_WIDTH = 384; - -// do not touch ffs -export const APP_TEXT_TO_IMAGE_HEIGHT = - 'calc(100vh - 9.4375rem - 1.925rem - 1.15rem)'; - -// option bar -export const OPTIONS_BAR_MAX_WIDTH = '22.5rem'; - -export const PARAMETERS_PANEL_WIDTH = '28rem'; diff --git a/invokeai/frontend/web/src/theme/util/generateColorPalette.ts b/invokeai/frontend/web/src/theme/util/generateColorPalette.ts deleted file mode 100644 index 1915f4fafe..0000000000 --- a/invokeai/frontend/web/src/theme/util/generateColorPalette.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { InvokeAIPaletteSteps } from 'theme/types'; - -/** - * Add two numbers together - * @param {String | Number} H Hue of the color (0-360) - Reds 0, Greens 120, Blues 240 - * @param {String | Number} L Saturation of the color (0-100) - * @param {Boolean} alpha Whether or not to generate this palette as a transparency palette - */ -export function generateColorPalette( - H: string | number, - S: string | number, - alpha = false -) { - H = String(H); - S = String(S); - - const colorSteps = Array.from({ length: 21 }, (_, i) => i * 50); - - const lightnessSteps = [ - 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 59, 64, 68, 73, 77, 82, 86, - 95, 100, - ]; - - const p = colorSteps.reduce((palette, step, index) => { - const A = alpha ? (lightnessSteps[index] as number) / 100 : 1; - - // Lightness should be 50% for alpha colors - const L = alpha ? 50 : lightnessSteps[colorSteps.length - 1 - index]; - - palette[step as keyof typeof palette] = `hsl(${H} ${S}% ${L}% / ${A})`; - - return palette; - }, {} as InvokeAIPaletteSteps); - - return p; -} diff --git a/invokeai/frontend/web/src/theme/util/getInputFilledStyles.ts b/invokeai/frontend/web/src/theme/util/getInputFilledStyles.ts deleted file mode 100644 index b6fa4badfc..0000000000 --- a/invokeai/frontend/web/src/theme/util/getInputFilledStyles.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { - StyleFunctionProps, - SystemStyleObject, -} from '@chakra-ui/styled-system'; - -export const getInputFilledStyles = ( - props: StyleFunctionProps -): SystemStyleObject => { - const { variant } = props; - - const bg = variant === 'darkFilled' ? 'base.800' : 'base.700'; - const bgHover = variant === 'darkFilled' ? 'base.750' : 'base.650'; - const error = 'error.600'; - const errorHover = 'error.500'; - const fg = 'base.100'; - - const baseColors = { - color: fg, - bg: bg, - borderColor: bg, - }; - const _invalid = { - borderColor: error, - _hover: { - borderColor: errorHover, - }, - }; - const _hover = { - bg: bgHover, - borderColor: bgHover, - }; - const _focusVisible = { - ..._hover, - _invalid, - }; - const _disabled = { - opacity: 0.35, - _hover: baseColors, - }; - return { - ...baseColors, - minH: '28px', - borderWidth: 1, - borderRadius: 'base', - outline: 'none', - boxShadow: 'none', - _hover, - _focusVisible, - _invalid, - _disabled, - }; -}; diff --git a/invokeai/frontend/web/src/theme/util/getInputOutlineStyles.ts b/invokeai/frontend/web/src/theme/util/getInputOutlineStyles.ts deleted file mode 100644 index bce675446e..0000000000 --- a/invokeai/frontend/web/src/theme/util/getInputOutlineStyles.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { SystemStyleObject } from '@chakra-ui/styled-system'; - -export const getInputOutlineStyles = (): SystemStyleObject => ({ - outline: 'none', - borderWidth: 2, - borderStyle: 'solid', - borderColor: 'base.800', - bg: 'base.900', - borderRadius: 'md', - color: 'base.100', - boxShadow: 'none', - _hover: { - borderColor: 'base.600', - }, - _focus: { - borderColor: 'blue.600', - boxShadow: 'none', - _hover: { - borderColor: 'blue.500', - }, - }, - _invalid: { - borderColor: 'error.600', - boxShadow: 'none', - _hover: { - borderColor: 'error.500', - }, - }, - _disabled: { - borderColor: 'base.700', - bg: 'base.700', - color: 'base.400', - _hover: { - borderColor: 'base.700', - }, - }, - _placeholder: { - color: 'base.400', - }, - '::selection': { - bg: 'blue.400', - }, -}); diff --git a/invokeai/frontend/web/tsconfig.json b/invokeai/frontend/web/tsconfig.json index 91906c9abe..fc1111ffd0 100644 --- a/invokeai/frontend/web/tsconfig.json +++ b/invokeai/frontend/web/tsconfig.json @@ -20,16 +20,16 @@ "jsx": "react-jsx", "baseUrl": "./", "paths": { - "*": ["./src/*"] - } + "*": ["./src/*"], + }, }, "include": ["src/**/*.ts", "src/**/*.tsx", "*.d.ts", ".storybook/**/*"], "exclude": ["src/services/fixtures/*", "node_modules", "dist"], "references": [{ "path": "./tsconfig.node.json" }], "ts-node": { "compilerOptions": { - "jsx": "preserve" + "jsx": "preserve", }, - "esm": true - } + "esm": true, + }, }
one!
two!
three!
{t('unifiedCanvas.clearCanvasHistoryMessage')}
{t('unifiedCanvas.clearCanvasHistoryConfirm')}