From 3586c8fe24e04fc007f1b780c6fdeb0d420eda3c Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sat, 7 Mar 2026 08:00:14 -0800 Subject: [PATCH] Move Icon and LoadingIcon to shared package --- .../components/CommandPaletteDialog.tsx | 3 +-- apps/yaak-client/components/CookieDropdown.tsx | 2 +- .../components/EnvironmentActionsDropdown.tsx | 2 +- .../components/EnvironmentEditDialog.tsx | 2 +- apps/yaak-client/components/FolderLayout.tsx | 3 +-- .../components/FolderSettingsDialog.tsx | 2 +- .../components/GrpcProtoSelectionDialog.tsx | 2 +- apps/yaak-client/components/GrpcRequestPane.tsx | 2 +- apps/yaak-client/components/GrpcResponsePane.tsx | 3 +-- .../components/HttpAuthenticationEditor.tsx | 2 +- apps/yaak-client/components/HttpResponsePane.tsx | 3 +-- .../components/HttpResponseTimeline.tsx | 2 +- apps/yaak-client/components/ImportCurlButton.tsx | 2 +- apps/yaak-client/components/LicenseBadge.tsx | 2 +- .../components/RecentGrpcConnectionsDropdown.tsx | 2 +- .../components/RecentHttpResponsesDropdown.tsx | 2 +- .../RecentWebsocketConnectionsDropdown.tsx | 2 +- .../yaak-client/components/RequestBodyViewer.tsx | 2 +- .../components/RequestMethodDropdown.tsx | 2 +- .../yaak-client/components/Settings/Settings.tsx | 3 +-- .../components/Settings/SettingsHotkeys.tsx | 2 +- .../components/Settings/SettingsInterface.tsx | 2 +- .../components/Settings/SettingsLicense.tsx | 2 +- .../components/Settings/SettingsPlugins.tsx | 4 +--- .../components/Settings/SettingsTheme.tsx | 3 +-- apps/yaak-client/components/SettingsDropdown.tsx | 2 +- apps/yaak-client/components/Sidebar.tsx | 3 +-- .../components/SwitchWorkspaceDialog.tsx | 2 +- .../components/TemplateFunctionDialog.tsx | 2 +- apps/yaak-client/components/UrlBar.tsx | 2 +- .../components/WebsocketResponsePane.tsx | 3 +-- .../components/WorkspaceActionsDropdown.tsx | 2 +- apps/yaak-client/components/WorkspaceHeader.tsx | 2 +- apps/yaak-client/components/core/Button.tsx | 3 +-- apps/yaak-client/components/core/Checkbox.tsx | 2 +- apps/yaak-client/components/core/ColorPicker.tsx | 2 +- apps/yaak-client/components/core/Dropdown.tsx | 3 +-- apps/yaak-client/components/core/IconButton.tsx | 4 +--- apps/yaak-client/components/core/IconTooltip.tsx | 3 +-- apps/yaak-client/components/core/Input.tsx | 3 +-- .../components/core/JsonAttributeTree.tsx | 2 +- apps/yaak-client/components/core/Link.tsx | 2 +- apps/yaak-client/components/core/PairEditor.tsx | 2 +- .../components/core/RadioDropdown.tsx | 2 +- .../components/core/SegmentedControl.tsx | 2 +- apps/yaak-client/components/core/Tabs/Tabs.tsx | 2 +- apps/yaak-client/components/core/Toast.tsx | 3 +-- .../components/core/tree/TreeItem.tsx | 2 +- .../components/git/GitCommitDialog.tsx | 2 +- apps/yaak-client/components/git/GitDropdown.tsx | 2 +- .../components/graphql/GraphQLDocsExplorer.tsx | 3 +-- .../components/graphql/GraphQLEditor.tsx | 2 +- .../components/responseViewers/BinaryViewer.tsx | 2 +- .../responseViewers/EventStreamViewer.tsx | 2 +- .../responseViewers/MultipartViewer.tsx | 3 +-- apps/yaak-client/hooks/useAuthTab.tsx | 2 +- .../yaak-client/hooks/useCreateDropdownItems.tsx | 2 +- apps/yaak-client/lib/initGlobalListeners.tsx | 2 +- packages/ui/src/components/Button.tsx | 16 +++------------- .../core => packages/ui/src/components}/Icon.tsx | 0 .../ui/src/components}/LoadingIcon.tsx | 0 packages/ui/src/index.ts | 3 +++ 62 files changed, 64 insertions(+), 90 deletions(-) rename {apps/yaak-client/components/core => packages/ui/src/components}/Icon.tsx (100%) rename {apps/yaak-client/components/core => packages/ui/src/components}/LoadingIcon.tsx (100%) diff --git a/apps/yaak-client/components/CommandPaletteDialog.tsx b/apps/yaak-client/components/CommandPaletteDialog.tsx index 70aa5d75..d8b2239f 100644 --- a/apps/yaak-client/components/CommandPaletteDialog.tsx +++ b/apps/yaak-client/components/CommandPaletteDialog.tsx @@ -21,7 +21,7 @@ import { useActiveRequest } from '../hooks/useActiveRequest'; import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace'; import { useAllRequests } from '../hooks/useAllRequests'; import { useCreateWorkspace } from '../hooks/useCreateWorkspace'; -import { useDebouncedState } from '@yaakapp-internal/ui'; +import { Icon, useDebouncedState } from '@yaakapp-internal/ui'; import { useEnvironmentsBreakdown } from '../hooks/useEnvironmentsBreakdown'; import { useGrpcRequestActions } from '../hooks/useGrpcRequestActions'; import type { HotkeyAction } from '../hooks/useHotKey'; @@ -50,7 +50,6 @@ import { Button } from './core/Button'; import { Heading } from './core/Heading'; import { Hotkey } from './core/Hotkey'; import { HttpMethodTag } from './core/HttpMethodTag'; -import { Icon } from './core/Icon'; import { PlainInput } from './core/PlainInput'; interface CommandPaletteGroup { diff --git a/apps/yaak-client/components/CookieDropdown.tsx b/apps/yaak-client/components/CookieDropdown.tsx index 1f6708b6..79aa5be5 100644 --- a/apps/yaak-client/components/CookieDropdown.tsx +++ b/apps/yaak-client/components/CookieDropdown.tsx @@ -9,7 +9,7 @@ import { showPrompt } from '../lib/prompt'; import { setWorkspaceSearchParams } from '../lib/setWorkspaceSearchParams'; import { CookieDialog } from './CookieDialog'; import { Dropdown, type DropdownItem } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { InlineCode } from './core/InlineCode'; diff --git a/apps/yaak-client/components/EnvironmentActionsDropdown.tsx b/apps/yaak-client/components/EnvironmentActionsDropdown.tsx index bb215d28..53e2aafa 100644 --- a/apps/yaak-client/components/EnvironmentActionsDropdown.tsx +++ b/apps/yaak-client/components/EnvironmentActionsDropdown.tsx @@ -8,7 +8,7 @@ import type { ButtonProps } from './core/Button'; import { Button } from './core/Button'; import type { DropdownItem } from './core/Dropdown'; import { Dropdown } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { EnvironmentColorIndicator } from './EnvironmentColorIndicator'; type Props = { diff --git a/apps/yaak-client/components/EnvironmentEditDialog.tsx b/apps/yaak-client/components/EnvironmentEditDialog.tsx index ffaca646..f7faf6f8 100644 --- a/apps/yaak-client/components/EnvironmentEditDialog.tsx +++ b/apps/yaak-client/components/EnvironmentEditDialog.tsx @@ -15,7 +15,7 @@ import { resolvedModelName } from '../lib/resolvedModelName'; import { showColorPicker } from '../lib/showColorPicker'; import { Banner } from './core/Banner'; import type { ContextMenuProps, DropdownItem } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { IconTooltip } from './core/IconTooltip'; import { InlineCode } from './core/InlineCode'; diff --git a/apps/yaak-client/components/FolderLayout.tsx b/apps/yaak-client/components/FolderLayout.tsx index e3bf3947..505f5181 100644 --- a/apps/yaak-client/components/FolderLayout.tsx +++ b/apps/yaak-client/components/FolderLayout.tsx @@ -15,9 +15,8 @@ import { Button } from './core/Button'; import { Heading } from './core/Heading'; import { HttpResponseDurationTag } from './core/HttpResponseDurationTag'; import { HttpStatusTag } from './core/HttpStatusTag'; -import { Icon } from './core/Icon'; +import { Icon, LoadingIcon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; -import { LoadingIcon } from './core/LoadingIcon'; import { Separator } from './core/Separator'; import { SizeTag } from './core/SizeTag'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/FolderSettingsDialog.tsx b/apps/yaak-client/components/FolderSettingsDialog.tsx index 8b2c0bc7..bb299ac6 100644 --- a/apps/yaak-client/components/FolderSettingsDialog.tsx +++ b/apps/yaak-client/components/FolderSettingsDialog.tsx @@ -15,7 +15,7 @@ import { hideDialog } from '../lib/dialog'; import { CopyIconButton } from './CopyIconButton'; import { Button } from './core/Button'; import { CountBadge } from './core/CountBadge'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { InlineCode } from './core/InlineCode'; import { Input } from './core/Input'; import { Link } from './core/Link'; diff --git a/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx b/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx index 2ce297ff..fb107000 100644 --- a/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx +++ b/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx @@ -6,7 +6,7 @@ import { useGrpcProtoFiles } from '../hooks/useGrpcProtoFiles'; import { pluralizeCount } from '../lib/pluralize'; import { Banner } from './core/Banner'; import { Button } from './core/Button'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { InlineCode } from './core/InlineCode'; import { Link } from './core/Link'; diff --git a/apps/yaak-client/components/GrpcRequestPane.tsx b/apps/yaak-client/components/GrpcRequestPane.tsx index 3db03ecf..bc74463b 100644 --- a/apps/yaak-client/components/GrpcRequestPane.tsx +++ b/apps/yaak-client/components/GrpcRequestPane.tsx @@ -11,7 +11,7 @@ import { useRequestUpdateKey } from '../hooks/useRequestUpdateKey'; import { resolvedModelName } from '../lib/resolvedModelName'; import { Button } from './core/Button'; import { CountBadge } from './core/CountBadge'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { PlainInput } from './core/PlainInput'; import { RadioDropdown } from './core/RadioDropdown'; diff --git a/apps/yaak-client/components/GrpcResponsePane.tsx b/apps/yaak-client/components/GrpcResponsePane.tsx index 29f8f4e0..6ed1f77a 100644 --- a/apps/yaak-client/components/GrpcResponsePane.tsx +++ b/apps/yaak-client/components/GrpcResponsePane.tsx @@ -14,9 +14,8 @@ import { Editor } from './core/Editor/LazyEditor'; import { EventDetailHeader, EventViewer } from './core/EventViewer'; import { EventViewerRow } from './core/EventViewerRow'; import { HotkeyList } from './core/HotkeyList'; -import { Icon, type IconProps } from './core/Icon'; +import { Icon, LoadingIcon, type IconProps } from '@yaakapp-internal/ui'; import { KeyValueRow, KeyValueRows } from './core/KeyValueRow'; -import { LoadingIcon } from './core/LoadingIcon'; import { HStack, VStack } from './core/Stacks'; import { EmptyStateText } from './EmptyStateText'; import { ErrorBoundary } from './ErrorBoundary'; diff --git a/apps/yaak-client/components/HttpAuthenticationEditor.tsx b/apps/yaak-client/components/HttpAuthenticationEditor.tsx index 56e11068..450637d8 100644 --- a/apps/yaak-client/components/HttpAuthenticationEditor.tsx +++ b/apps/yaak-client/components/HttpAuthenticationEditor.tsx @@ -14,7 +14,7 @@ import { useInheritedAuthentication } from '../hooks/useInheritedAuthentication' import { useRenderTemplate } from '../hooks/useRenderTemplate'; import { resolvedModelName } from '../lib/resolvedModelName'; import { Dropdown, type DropdownItem } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { InlineCode } from './core/InlineCode'; import { Input, type InputProps } from './core/Input'; diff --git a/apps/yaak-client/components/HttpResponsePane.tsx b/apps/yaak-client/components/HttpResponsePane.tsx index 6f1059e7..b90bee28 100644 --- a/apps/yaak-client/components/HttpResponsePane.tsx +++ b/apps/yaak-client/components/HttpResponsePane.tsx @@ -18,8 +18,7 @@ import { CountBadge } from './core/CountBadge'; import { HotkeyList } from './core/HotkeyList'; import { HttpResponseDurationTag } from './core/HttpResponseDurationTag'; import { HttpStatusTag } from './core/HttpStatusTag'; -import { Icon } from './core/Icon'; -import { LoadingIcon } from './core/LoadingIcon'; +import { Icon, LoadingIcon } from '@yaakapp-internal/ui'; import { PillButton } from './core/PillButton'; import { SizeTag } from './core/SizeTag'; import { HStack, VStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/HttpResponseTimeline.tsx b/apps/yaak-client/components/HttpResponseTimeline.tsx index 22840853..68e41698 100644 --- a/apps/yaak-client/components/HttpResponseTimeline.tsx +++ b/apps/yaak-client/components/HttpResponseTimeline.tsx @@ -9,7 +9,7 @@ import { Editor } from './core/Editor/LazyEditor'; import { type EventDetailAction, EventDetailHeader, EventViewer } from './core/EventViewer'; import { EventViewerRow } from './core/EventViewerRow'; import { HttpStatusTagRaw } from './core/HttpStatusTag'; -import { Icon, type IconProps } from './core/Icon'; +import { Icon, type IconProps } from '@yaakapp-internal/ui'; import { KeyValueRow, KeyValueRows } from './core/KeyValueRow'; import type { TimelineViewMode } from './HttpResponsePane'; diff --git a/apps/yaak-client/components/ImportCurlButton.tsx b/apps/yaak-client/components/ImportCurlButton.tsx index 5d40fc3f..a86d0d0d 100644 --- a/apps/yaak-client/components/ImportCurlButton.tsx +++ b/apps/yaak-client/components/ImportCurlButton.tsx @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'; import { useImportCurl } from '../hooks/useImportCurl'; import { useWindowFocus } from '../hooks/useWindowFocus'; import { Button } from './core/Button'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; export function ImportCurlButton() { const focused = useWindowFocus(); diff --git a/apps/yaak-client/components/LicenseBadge.tsx b/apps/yaak-client/components/LicenseBadge.tsx index 78cfe33e..d1d9d47a 100644 --- a/apps/yaak-client/components/LicenseBadge.tsx +++ b/apps/yaak-client/components/LicenseBadge.tsx @@ -12,7 +12,7 @@ import { jotaiStore } from '../lib/jotai'; import { CargoFeature } from './CargoFeature'; import type { ButtonProps } from './core/Button'; import { Dropdown, type DropdownItem } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { PillButton } from './core/PillButton'; const dismissedAtom = atomWithKVStorage('dismissed_license_expired', null); diff --git a/apps/yaak-client/components/RecentGrpcConnectionsDropdown.tsx b/apps/yaak-client/components/RecentGrpcConnectionsDropdown.tsx index 606d7177..27a256b6 100644 --- a/apps/yaak-client/components/RecentGrpcConnectionsDropdown.tsx +++ b/apps/yaak-client/components/RecentGrpcConnectionsDropdown.tsx @@ -4,7 +4,7 @@ import { formatDistanceToNowStrict } from 'date-fns'; import { useDeleteGrpcConnections } from '../hooks/useDeleteGrpcConnections'; import { pluralizeCount } from '../lib/pluralize'; import { Dropdown } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/RecentHttpResponsesDropdown.tsx b/apps/yaak-client/components/RecentHttpResponsesDropdown.tsx index cc1c7c43..fe5f9c09 100644 --- a/apps/yaak-client/components/RecentHttpResponsesDropdown.tsx +++ b/apps/yaak-client/components/RecentHttpResponsesDropdown.tsx @@ -6,7 +6,7 @@ import { useSaveResponse } from '../hooks/useSaveResponse'; import { pluralize } from '../lib/pluralize'; import { Dropdown } from './core/Dropdown'; import { HttpStatusTag } from './core/HttpStatusTag'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/RecentWebsocketConnectionsDropdown.tsx b/apps/yaak-client/components/RecentWebsocketConnectionsDropdown.tsx index db79c125..42f5e27c 100644 --- a/apps/yaak-client/components/RecentWebsocketConnectionsDropdown.tsx +++ b/apps/yaak-client/components/RecentWebsocketConnectionsDropdown.tsx @@ -4,7 +4,7 @@ import { formatDistanceToNowStrict } from 'date-fns'; import { deleteWebsocketConnections } from '../commands/deleteWebsocketConnections'; import { pluralizeCount } from '../lib/pluralize'; import { Dropdown } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/RequestBodyViewer.tsx b/apps/yaak-client/components/RequestBodyViewer.tsx index 5c108d84..ef17f802 100644 --- a/apps/yaak-client/components/RequestBodyViewer.tsx +++ b/apps/yaak-client/components/RequestBodyViewer.tsx @@ -2,7 +2,7 @@ import type { HttpResponse } from '@yaakapp-internal/models'; import { lazy, Suspense } from 'react'; import { useHttpRequestBody } from '../hooks/useHttpRequestBody'; import { getMimeTypeFromContentType, languageFromContentType } from '../lib/contentType'; -import { LoadingIcon } from './core/LoadingIcon'; +import { LoadingIcon } from '@yaakapp-internal/ui'; import { EmptyStateText } from './EmptyStateText'; import { AudioViewer } from './responseViewers/AudioViewer'; import { CsvViewer } from './responseViewers/CsvViewer'; diff --git a/apps/yaak-client/components/RequestMethodDropdown.tsx b/apps/yaak-client/components/RequestMethodDropdown.tsx index 4bfaf534..48af35e6 100644 --- a/apps/yaak-client/components/RequestMethodDropdown.tsx +++ b/apps/yaak-client/components/RequestMethodDropdown.tsx @@ -6,7 +6,7 @@ import { showPrompt } from '../lib/prompt'; import { Button } from './core/Button'; import type { DropdownItem } from './core/Dropdown'; import { HttpMethodTag, HttpMethodTagRaw } from './core/HttpMethodTag'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import type { RadioDropdownItem } from './core/RadioDropdown'; import { RadioDropdown } from './core/RadioDropdown'; diff --git a/apps/yaak-client/components/Settings/Settings.tsx b/apps/yaak-client/components/Settings/Settings.tsx index d370a125..da962d45 100644 --- a/apps/yaak-client/components/Settings/Settings.tsx +++ b/apps/yaak-client/components/Settings/Settings.tsx @@ -9,10 +9,9 @@ import { useKeyPressEvent } from 'react-use'; import { appInfo } from '../../lib/appInfo'; import { capitalize } from '../../lib/capitalize'; import { CountBadge } from '../core/CountBadge'; -import { Icon } from '../core/Icon'; import { HStack } from '../core/Stacks'; import { TabContent, type TabItem, Tabs } from '../core/Tabs/Tabs'; -import { HeaderSize } from '@yaakapp-internal/ui'; +import { HeaderSize, Icon } from '@yaakapp-internal/ui'; import { SettingsCertificates } from './SettingsCertificates'; import { SettingsGeneral } from './SettingsGeneral'; import { SettingsHotkeys } from './SettingsHotkeys'; diff --git a/apps/yaak-client/components/Settings/SettingsHotkeys.tsx b/apps/yaak-client/components/Settings/SettingsHotkeys.tsx index f5fc1280..2600c16e 100644 --- a/apps/yaak-client/components/Settings/SettingsHotkeys.tsx +++ b/apps/yaak-client/components/Settings/SettingsHotkeys.tsx @@ -18,7 +18,7 @@ import { Button } from '../core/Button'; import { Dropdown, type DropdownItem } from '../core/Dropdown'; import { Heading } from '../core/Heading'; import { HotkeyRaw } from '../core/Hotkey'; -import { Icon } from '../core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from '../core/IconButton'; import { PlainInput } from '../core/PlainInput'; import { HStack, VStack } from '../core/Stacks'; diff --git a/apps/yaak-client/components/Settings/SettingsInterface.tsx b/apps/yaak-client/components/Settings/SettingsInterface.tsx index 5d954125..164ed5fc 100644 --- a/apps/yaak-client/components/Settings/SettingsInterface.tsx +++ b/apps/yaak-client/components/Settings/SettingsInterface.tsx @@ -14,7 +14,7 @@ import { CargoFeature } from '../CargoFeature'; import { Button } from '../core/Button'; import { Checkbox } from '../core/Checkbox'; import { Heading } from '../core/Heading'; -import { Icon } from '../core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { Link } from '../core/Link'; import { Select } from '../core/Select'; import { HStack, VStack } from '../core/Stacks'; diff --git a/apps/yaak-client/components/Settings/SettingsLicense.tsx b/apps/yaak-client/components/Settings/SettingsLicense.tsx index b398cdf3..dd060384 100644 --- a/apps/yaak-client/components/Settings/SettingsLicense.tsx +++ b/apps/yaak-client/components/Settings/SettingsLicense.tsx @@ -8,7 +8,7 @@ import { pluralizeCount } from '../../lib/pluralize'; import { CargoFeature } from '../CargoFeature'; import { Banner } from '../core/Banner'; import { Button } from '../core/Button'; -import { Icon } from '../core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { Link } from '../core/Link'; import { PlainInput } from '../core/PlainInput'; import { Separator } from '../core/Separator'; diff --git a/apps/yaak-client/components/Settings/SettingsPlugins.tsx b/apps/yaak-client/components/Settings/SettingsPlugins.tsx index cbba80e1..335cc997 100644 --- a/apps/yaak-client/components/Settings/SettingsPlugins.tsx +++ b/apps/yaak-client/components/Settings/SettingsPlugins.tsx @@ -12,7 +12,7 @@ import { import classNames from 'classnames'; import { useAtomValue } from 'jotai'; import { useState } from 'react'; -import { useDebouncedValue } from '@yaakapp-internal/ui'; +import { Icon, LoadingIcon, useDebouncedValue } from '@yaakapp-internal/ui'; import { useInstallPlugin } from '../../hooks/useInstallPlugin'; import { usePluginInfo } from '../../hooks/usePluginInfo'; import { usePluginsKey, useRefreshPlugins } from '../../hooks/usePlugins'; @@ -21,11 +21,9 @@ import { minPromiseMillis } from '../../lib/minPromiseMillis'; import { Button } from '../core/Button'; import { Checkbox } from '../core/Checkbox'; import { CountBadge } from '../core/CountBadge'; -import { Icon } from '../core/Icon'; import { IconButton } from '../core/IconButton'; import { InlineCode } from '../core/InlineCode'; import { Link } from '../core/Link'; -import { LoadingIcon } from '../core/LoadingIcon'; import { PlainInput } from '../core/PlainInput'; import { HStack } from '../core/Stacks'; import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow } from '../core/Table'; diff --git a/apps/yaak-client/components/Settings/SettingsTheme.tsx b/apps/yaak-client/components/Settings/SettingsTheme.tsx index 9c71608a..59e47c2d 100644 --- a/apps/yaak-client/components/Settings/SettingsTheme.tsx +++ b/apps/yaak-client/components/Settings/SettingsTheme.tsx @@ -6,8 +6,7 @@ import { useResolvedAppearance } from '../../hooks/useResolvedAppearance'; import { useResolvedTheme } from '../../hooks/useResolvedTheme'; import type { ButtonProps } from '../core/Button'; import { Heading } from '../core/Heading'; -import type { IconProps } from '../core/Icon'; -import { Icon } from '../core/Icon'; +import { Icon, type IconProps } from '@yaakapp-internal/ui'; import { IconButton } from '../core/IconButton'; import { Link } from '../core/Link'; import type { SelectProps } from '../core/Select'; diff --git a/apps/yaak-client/components/SettingsDropdown.tsx b/apps/yaak-client/components/SettingsDropdown.tsx index 45d5951a..d77dcfed 100644 --- a/apps/yaak-client/components/SettingsDropdown.tsx +++ b/apps/yaak-client/components/SettingsDropdown.tsx @@ -9,7 +9,7 @@ import { showDialog } from '../lib/dialog'; import { importData } from '../lib/importData'; import type { DropdownRef } from './core/Dropdown'; import { Dropdown } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { KeyboardShortcutsDialog } from './KeyboardShortcutsDialog'; diff --git a/apps/yaak-client/components/Sidebar.tsx b/apps/yaak-client/components/Sidebar.tsx index c7b8aec3..53abdf9b 100644 --- a/apps/yaak-client/components/Sidebar.tsx +++ b/apps/yaak-client/components/Sidebar.tsx @@ -54,12 +54,11 @@ import { filter } from './core/Editor/filter/extension'; import { evaluate, parseQuery } from './core/Editor/filter/query'; import { HttpMethodTag } from './core/HttpMethodTag'; import { HttpStatusTag } from './core/HttpStatusTag'; -import { Icon } from './core/Icon'; +import { Icon, LoadingIcon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { InlineCode } from './core/InlineCode'; import type { InputHandle } from './core/Input'; import { Input } from './core/Input'; -import { LoadingIcon } from './core/LoadingIcon'; import { collapsedFamily, isSelectedFamily, selectedIdsFamily } from './core/tree/atoms'; import type { TreeNode } from './core/tree/common'; import type { TreeHandle, TreeProps } from './core/tree/Tree'; diff --git a/apps/yaak-client/components/SwitchWorkspaceDialog.tsx b/apps/yaak-client/components/SwitchWorkspaceDialog.tsx index ef1849b6..1c7298d8 100644 --- a/apps/yaak-client/components/SwitchWorkspaceDialog.tsx +++ b/apps/yaak-client/components/SwitchWorkspaceDialog.tsx @@ -5,7 +5,7 @@ import { useState } from 'react'; import { switchWorkspace } from '../commands/switchWorkspace'; import { Button } from './core/Button'; import { Checkbox } from './core/Checkbox'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { InlineCode } from './core/InlineCode'; import { HStack, VStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/TemplateFunctionDialog.tsx b/apps/yaak-client/components/TemplateFunctionDialog.tsx index f5726ca4..0d970b89 100644 --- a/apps/yaak-client/components/TemplateFunctionDialog.tsx +++ b/apps/yaak-client/components/TemplateFunctionDialog.tsx @@ -28,7 +28,7 @@ import { Button } from './core/Button'; import { collectArgumentValues } from './core/Editor/twig/util'; import { IconButton } from './core/IconButton'; import { InlineCode } from './core/InlineCode'; -import { LoadingIcon } from './core/LoadingIcon'; +import { LoadingIcon } from '@yaakapp-internal/ui'; import { PlainInput } from './core/PlainInput'; import { HStack } from './core/Stacks'; import { DYNAMIC_FORM_NULL_ARG, DynamicForm } from './DynamicForm'; diff --git a/apps/yaak-client/components/UrlBar.tsx b/apps/yaak-client/components/UrlBar.tsx index c9fafbe2..8739f339 100644 --- a/apps/yaak-client/components/UrlBar.tsx +++ b/apps/yaak-client/components/UrlBar.tsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import type { FormEvent, ReactNode } from 'react'; import { memo, useCallback, useRef, useState } from 'react'; import { useHotKey } from '../hooks/useHotKey'; -import type { IconProps } from './core/Icon'; +import type { IconProps } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import type { InputHandle, InputProps } from './core/Input'; import { Input } from './core/Input'; diff --git a/apps/yaak-client/components/WebsocketResponsePane.tsx b/apps/yaak-client/components/WebsocketResponsePane.tsx index 043ab841..dcbd517d 100644 --- a/apps/yaak-client/components/WebsocketResponsePane.tsx +++ b/apps/yaak-client/components/WebsocketResponsePane.tsx @@ -16,8 +16,7 @@ import { Editor } from './core/Editor/LazyEditor'; import { type EventDetailAction, EventDetailHeader, EventViewer } from './core/EventViewer'; import { EventViewerRow } from './core/EventViewerRow'; import { HotkeyList } from './core/HotkeyList'; -import { Icon } from './core/Icon'; -import { LoadingIcon } from './core/LoadingIcon'; +import { Icon, LoadingIcon } from '@yaakapp-internal/ui'; import { HStack, VStack } from './core/Stacks'; import { WebsocketStatusTag } from './core/WebsocketStatusTag'; import { EmptyStateText } from './EmptyStateText'; diff --git a/apps/yaak-client/components/WorkspaceActionsDropdown.tsx b/apps/yaak-client/components/WorkspaceActionsDropdown.tsx index ef613dfc..d92b2cb3 100644 --- a/apps/yaak-client/components/WorkspaceActionsDropdown.tsx +++ b/apps/yaak-client/components/WorkspaceActionsDropdown.tsx @@ -22,7 +22,7 @@ import { CloneGitRepositoryDialog } from './CloneGitRepositoryDialog'; import type { ButtonProps } from './core/Button'; import { Button } from './core/Button'; import type { DropdownItem } from './core/Dropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import type { RadioDropdownItem } from './core/RadioDropdown'; import { RadioDropdown } from './core/RadioDropdown'; import { SwitchWorkspaceDialog } from './SwitchWorkspaceDialog'; diff --git a/apps/yaak-client/components/WorkspaceHeader.tsx b/apps/yaak-client/components/WorkspaceHeader.tsx index f67980a0..79d98d72 100644 --- a/apps/yaak-client/components/WorkspaceHeader.tsx +++ b/apps/yaak-client/components/WorkspaceHeader.tsx @@ -6,7 +6,7 @@ import { useToggleCommandPalette } from '../hooks/useToggleCommandPalette'; import { workspaceLayoutAtom } from '../lib/atoms'; import { setupOrConfigureEncryption } from '../lib/setupOrConfigureEncryption'; import { CookieDropdown } from './CookieDropdown'; -import { Icon } from './core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; import { PillButton } from './core/PillButton'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/core/Button.tsx b/apps/yaak-client/components/core/Button.tsx index 3d08249a..e4e20929 100644 --- a/apps/yaak-client/components/core/Button.tsx +++ b/apps/yaak-client/components/core/Button.tsx @@ -4,8 +4,7 @@ import type { HTMLAttributes, ReactNode } from 'react'; import { forwardRef, useImperativeHandle, useRef } from 'react'; import type { HotkeyAction } from '../../hooks/useHotKey'; import { useFormattedHotkey, useHotKey } from '../../hooks/useHotKey'; -import { Icon } from './Icon'; -import { LoadingIcon } from './LoadingIcon'; +import { Icon, LoadingIcon } from '@yaakapp-internal/ui'; export type ButtonProps = Omit, 'color' | 'onChange'> & { innerClassName?: string; diff --git a/apps/yaak-client/components/core/Checkbox.tsx b/apps/yaak-client/components/core/Checkbox.tsx index e15c0ba9..34d541c1 100644 --- a/apps/yaak-client/components/core/Checkbox.tsx +++ b/apps/yaak-client/components/core/Checkbox.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import type { ReactNode } from 'react'; -import { Icon } from './Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconTooltip } from './IconTooltip'; import { HStack } from './Stacks'; diff --git a/apps/yaak-client/components/core/ColorPicker.tsx b/apps/yaak-client/components/core/ColorPicker.tsx index 960640d3..51c50b11 100644 --- a/apps/yaak-client/components/core/ColorPicker.tsx +++ b/apps/yaak-client/components/core/ColorPicker.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { useState } from 'react'; import { HexColorPicker } from 'react-colorful'; import { useRandomKey } from '../../hooks/useRandomKey'; -import { Icon } from './Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { PlainInput } from './PlainInput'; interface Props { diff --git a/apps/yaak-client/components/core/Dropdown.tsx b/apps/yaak-client/components/core/Dropdown.tsx index 22b9f074..1c289492 100644 --- a/apps/yaak-client/components/core/Dropdown.tsx +++ b/apps/yaak-client/components/core/Dropdown.tsx @@ -35,8 +35,7 @@ import { ErrorBoundary } from '../ErrorBoundary'; import { Overlay } from '../Overlay'; import { Button } from './Button'; import { Hotkey } from './Hotkey'; -import { Icon, type IconProps } from './Icon'; -import { LoadingIcon } from './LoadingIcon'; +import { Icon, LoadingIcon, type IconProps } from '@yaakapp-internal/ui'; import { Separator } from './Separator'; import { HStack, VStack } from './Stacks'; diff --git a/apps/yaak-client/components/core/IconButton.tsx b/apps/yaak-client/components/core/IconButton.tsx index 9b051862..4b3b2df6 100644 --- a/apps/yaak-client/components/core/IconButton.tsx +++ b/apps/yaak-client/components/core/IconButton.tsx @@ -4,9 +4,7 @@ import { forwardRef, useCallback } from 'react'; import { useTimedBoolean } from '../../hooks/useTimedBoolean'; import type { ButtonProps } from './Button'; import { Button } from './Button'; -import type { IconProps } from './Icon'; -import { Icon } from './Icon'; -import { LoadingIcon } from './LoadingIcon'; +import { Icon, LoadingIcon, type IconProps } from '@yaakapp-internal/ui'; export type IconButtonProps = IconProps & ButtonProps & { diff --git a/apps/yaak-client/components/core/IconTooltip.tsx b/apps/yaak-client/components/core/IconTooltip.tsx index 1a30b95c..0b442317 100644 --- a/apps/yaak-client/components/core/IconTooltip.tsx +++ b/apps/yaak-client/components/core/IconTooltip.tsx @@ -1,5 +1,4 @@ -import type { IconProps } from './Icon'; -import { Icon } from './Icon'; +import { Icon, type IconProps } from '@yaakapp-internal/ui'; import type { TooltipProps } from './Tooltip'; import { Tooltip } from './Tooltip'; diff --git a/apps/yaak-client/components/core/Input.tsx b/apps/yaak-client/components/core/Input.tsx index e8efbd40..f36353e9 100644 --- a/apps/yaak-client/components/core/Input.tsx +++ b/apps/yaak-client/components/core/Input.tsx @@ -22,8 +22,7 @@ import type { DropdownItem } from './Dropdown'; import { Dropdown } from './Dropdown'; import type { EditorProps } from './Editor/Editor'; import { Editor } from './Editor/LazyEditor'; -import type { IconProps } from './Icon'; -import { Icon } from './Icon'; +import { Icon, type IconProps } from '@yaakapp-internal/ui'; import { IconButton } from './IconButton'; import { IconTooltip } from './IconTooltip'; import { Label } from './Label'; diff --git a/apps/yaak-client/components/core/JsonAttributeTree.tsx b/apps/yaak-client/components/core/JsonAttributeTree.tsx index 1a692746..ab229ae0 100644 --- a/apps/yaak-client/components/core/JsonAttributeTree.tsx +++ b/apps/yaak-client/components/core/JsonAttributeTree.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import type { ReactNode } from 'react'; import { useMemo, useState } from 'react'; -import { Icon } from './Icon'; +import { Icon } from '@yaakapp-internal/ui'; interface Props { depth?: number; diff --git a/apps/yaak-client/components/core/Link.tsx b/apps/yaak-client/components/core/Link.tsx index 00dc7250..4e83a175 100644 --- a/apps/yaak-client/components/core/Link.tsx +++ b/apps/yaak-client/components/core/Link.tsx @@ -2,7 +2,7 @@ import { Link as RouterLink } from '@tanstack/react-router'; import classNames from 'classnames'; import type { HTMLAttributes } from 'react'; import { appInfo } from '../../lib/appInfo'; -import { Icon } from './Icon'; +import { Icon } from '@yaakapp-internal/ui'; interface Props extends HTMLAttributes { href: string; diff --git a/apps/yaak-client/components/core/PairEditor.tsx b/apps/yaak-client/components/core/PairEditor.tsx index 64ebd749..b6601932 100644 --- a/apps/yaak-client/components/core/PairEditor.tsx +++ b/apps/yaak-client/components/core/PairEditor.tsx @@ -28,7 +28,7 @@ import { Dropdown } from './Dropdown'; import type { EditorProps } from './Editor/Editor'; import type { GenericCompletionConfig } from './Editor/genericCompletion'; import { Editor } from './Editor/LazyEditor'; -import { Icon } from './Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconButton } from './IconButton'; import type { InputHandle, InputProps } from './Input'; import { Input } from './Input'; diff --git a/apps/yaak-client/components/core/RadioDropdown.tsx b/apps/yaak-client/components/core/RadioDropdown.tsx index 2e4e442e..db0854e2 100644 --- a/apps/yaak-client/components/core/RadioDropdown.tsx +++ b/apps/yaak-client/components/core/RadioDropdown.tsx @@ -2,7 +2,7 @@ import type { ReactNode } from 'react'; import { useMemo } from 'react'; import type { DropdownItem, DropdownItemSeparator, DropdownProps } from './Dropdown'; import { Dropdown } from './Dropdown'; -import { Icon } from './Icon'; +import { Icon } from '@yaakapp-internal/ui'; export type RadioDropdownItem = | { diff --git a/apps/yaak-client/components/core/SegmentedControl.tsx b/apps/yaak-client/components/core/SegmentedControl.tsx index b75060f3..114d7384 100644 --- a/apps/yaak-client/components/core/SegmentedControl.tsx +++ b/apps/yaak-client/components/core/SegmentedControl.tsx @@ -3,7 +3,7 @@ import { type ReactNode, useRef } from 'react'; import { useStateWithDeps } from '../../hooks/useStateWithDeps'; import { generateId } from '../../lib/generateId'; import { Button } from './Button'; -import type { IconProps } from './Icon'; +import type { IconProps } from '@yaakapp-internal/ui'; import { IconButton, type IconButtonProps } from './IconButton'; import { Label } from './Label'; import { HStack } from './Stacks'; diff --git a/apps/yaak-client/components/core/Tabs/Tabs.tsx b/apps/yaak-client/components/core/Tabs/Tabs.tsx index dbbdd92a..4a616d80 100644 --- a/apps/yaak-client/components/core/Tabs/Tabs.tsx +++ b/apps/yaak-client/components/core/Tabs/Tabs.tsx @@ -27,7 +27,7 @@ import { DropMarker } from '../../DropMarker'; import { ErrorBoundary } from '../../ErrorBoundary'; import type { ButtonProps } from '../Button'; import { Button } from '../Button'; -import { Icon } from '../Icon'; +import { Icon } from '@yaakapp-internal/ui'; import type { RadioDropdownProps } from '../RadioDropdown'; import { RadioDropdown } from '../RadioDropdown'; diff --git a/apps/yaak-client/components/core/Toast.tsx b/apps/yaak-client/components/core/Toast.tsx index acd750ab..9451f69e 100644 --- a/apps/yaak-client/components/core/Toast.tsx +++ b/apps/yaak-client/components/core/Toast.tsx @@ -4,8 +4,7 @@ import * as m from 'motion/react-m'; import type { ReactNode } from 'react'; import { useKey } from 'react-use'; -import type { IconProps } from './Icon'; -import { Icon } from './Icon'; +import { Icon, type IconProps } from '@yaakapp-internal/ui'; import { IconButton } from './IconButton'; import { VStack } from './Stacks'; diff --git a/apps/yaak-client/components/core/tree/TreeItem.tsx b/apps/yaak-client/components/core/tree/TreeItem.tsx index c6d55849..aab0338b 100644 --- a/apps/yaak-client/components/core/tree/TreeItem.tsx +++ b/apps/yaak-client/components/core/tree/TreeItem.tsx @@ -14,7 +14,7 @@ import { computeSideForDragMove } from '../../../lib/dnd'; import { jotaiStore } from '../../../lib/jotai'; import type { ContextMenuProps, DropdownItem } from '../Dropdown'; import { ContextMenu } from '../Dropdown'; -import { Icon } from '../Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { collapsedFamily, isCollapsedFamily, isLastFocusedFamily, isSelectedFamily } from './atoms'; import type { TreeNode } from './common'; import { getNodeKey } from './common'; diff --git a/apps/yaak-client/components/git/GitCommitDialog.tsx b/apps/yaak-client/components/git/GitCommitDialog.tsx index 7de28a23..de932537 100644 --- a/apps/yaak-client/components/git/GitCommitDialog.tsx +++ b/apps/yaak-client/components/git/GitCommitDialog.tsx @@ -20,7 +20,7 @@ import { Button } from '../core/Button'; import type { CheckboxProps } from '../core/Checkbox'; import { Checkbox } from '../core/Checkbox'; import { DiffViewer } from '../core/Editor/DiffViewer'; -import { Icon } from '../core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { InlineCode } from '../core/InlineCode'; import { Input } from '../core/Input'; import { Separator } from '../core/Separator'; diff --git a/apps/yaak-client/components/git/GitDropdown.tsx b/apps/yaak-client/components/git/GitDropdown.tsx index e80ba731..d11e3b66 100644 --- a/apps/yaak-client/components/git/GitDropdown.tsx +++ b/apps/yaak-client/components/git/GitDropdown.tsx @@ -16,7 +16,7 @@ import { showErrorToast, showToast } from '../../lib/toast'; import { Banner } from '../core/Banner'; import type { DropdownItem } from '../core/Dropdown'; import { Dropdown } from '../core/Dropdown'; -import { Icon } from '../core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { InlineCode } from '../core/InlineCode'; import { gitCallbacks } from './callbacks'; import { GitCommitDialog } from './GitCommitDialog'; diff --git a/apps/yaak-client/components/graphql/GraphQLDocsExplorer.tsx b/apps/yaak-client/components/graphql/GraphQLDocsExplorer.tsx index ce7e421b..d2f01029 100644 --- a/apps/yaak-client/components/graphql/GraphQLDocsExplorer.tsx +++ b/apps/yaak-client/components/graphql/GraphQLDocsExplorer.tsx @@ -25,12 +25,11 @@ import type { CSSProperties, HTMLAttributes, KeyboardEvent, ReactNode } from 're import { Fragment, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useClickOutside } from '../../hooks/useClickOutside'; import { useContainerSize } from '../../hooks/useContainerQuery'; -import { useDebouncedValue } from '@yaakapp-internal/ui'; +import { Icon, useDebouncedValue } from '@yaakapp-internal/ui'; import { useStateWithDeps } from '../../hooks/useStateWithDeps'; import { jotaiStore } from '../../lib/jotai'; import { Banner } from '../core/Banner'; import { CountBadge } from '../core/CountBadge'; -import { Icon } from '../core/Icon'; import { IconButton } from '../core/IconButton'; import { PlainInput } from '../core/PlainInput'; import { Markdown } from '../Markdown'; diff --git a/apps/yaak-client/components/graphql/GraphQLEditor.tsx b/apps/yaak-client/components/graphql/GraphQLEditor.tsx index 11b3c879..70e177c6 100644 --- a/apps/yaak-client/components/graphql/GraphQLEditor.tsx +++ b/apps/yaak-client/components/graphql/GraphQLEditor.tsx @@ -14,7 +14,7 @@ import { Dropdown } from '../core/Dropdown'; import type { EditorProps } from '../core/Editor/Editor'; import { Editor } from '../core/Editor/LazyEditor'; import { FormattedError } from '../core/FormattedError'; -import { Icon } from '../core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { Separator } from '../core/Separator'; import { showGraphQLDocExplorerAtom } from './graphqlAtoms'; diff --git a/apps/yaak-client/components/responseViewers/BinaryViewer.tsx b/apps/yaak-client/components/responseViewers/BinaryViewer.tsx index 94b586ba..e647ec1a 100644 --- a/apps/yaak-client/components/responseViewers/BinaryViewer.tsx +++ b/apps/yaak-client/components/responseViewers/BinaryViewer.tsx @@ -4,7 +4,7 @@ import { getContentTypeFromHeaders } from '../../lib/model_util'; import { Banner } from '../core/Banner'; import { Button } from '../core/Button'; import { InlineCode } from '../core/InlineCode'; -import { LoadingIcon } from '../core/LoadingIcon'; +import { LoadingIcon } from '@yaakapp-internal/ui'; import { EmptyStateText } from '../EmptyStateText'; interface Props { diff --git a/apps/yaak-client/components/responseViewers/EventStreamViewer.tsx b/apps/yaak-client/components/responseViewers/EventStreamViewer.tsx index de62b1f1..1b407d72 100644 --- a/apps/yaak-client/components/responseViewers/EventStreamViewer.tsx +++ b/apps/yaak-client/components/responseViewers/EventStreamViewer.tsx @@ -10,7 +10,7 @@ import type { EditorProps } from '../core/Editor/Editor'; import { Editor } from '../core/Editor/LazyEditor'; import { EventDetailHeader, EventViewer } from '../core/EventViewer'; import { EventViewerRow } from '../core/EventViewerRow'; -import { Icon } from '../core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { InlineCode } from '../core/InlineCode'; import { HStack, VStack } from '../core/Stacks'; diff --git a/apps/yaak-client/components/responseViewers/MultipartViewer.tsx b/apps/yaak-client/components/responseViewers/MultipartViewer.tsx index cceaec2c..e5dba255 100644 --- a/apps/yaak-client/components/responseViewers/MultipartViewer.tsx +++ b/apps/yaak-client/components/responseViewers/MultipartViewer.tsx @@ -2,8 +2,7 @@ import { type MultipartPart, parseMultipart } from '@mjackson/multipart-parser'; import { lazy, Suspense, useMemo } from 'react'; import { languageFromContentType } from '../../lib/contentType'; import { Banner } from '../core/Banner'; -import { Icon } from '../core/Icon'; -import { LoadingIcon } from '../core/LoadingIcon'; +import { Icon, LoadingIcon } from '@yaakapp-internal/ui'; import { TabContent, Tabs } from '../core/Tabs/Tabs'; import { AudioViewer } from './AudioViewer'; import { CsvViewer } from './CsvViewer'; diff --git a/apps/yaak-client/hooks/useAuthTab.tsx b/apps/yaak-client/hooks/useAuthTab.tsx index 19affc71..406d8888 100644 --- a/apps/yaak-client/hooks/useAuthTab.tsx +++ b/apps/yaak-client/hooks/useAuthTab.tsx @@ -3,7 +3,7 @@ import { modelTypeLabel, patchModel } from '@yaakapp-internal/models'; import { useMemo } from 'react'; import { openFolderSettings } from '../commands/openFolderSettings'; import { openWorkspaceSettings } from '../commands/openWorkspaceSettings'; -import { Icon } from '../components/core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { IconTooltip } from '../components/core/IconTooltip'; import { InlineCode } from '../components/core/InlineCode'; import { HStack } from '../components/core/Stacks'; diff --git a/apps/yaak-client/hooks/useCreateDropdownItems.tsx b/apps/yaak-client/hooks/useCreateDropdownItems.tsx index 04776a55..14c56cac 100644 --- a/apps/yaak-client/hooks/useCreateDropdownItems.tsx +++ b/apps/yaak-client/hooks/useCreateDropdownItems.tsx @@ -4,7 +4,7 @@ import { useAtomValue } from 'jotai'; import { useMemo } from 'react'; import { createFolder } from '../commands/commands'; import type { DropdownItem } from '../components/core/Dropdown'; -import { Icon } from '../components/core/Icon'; +import { Icon } from '@yaakapp-internal/ui'; import { createRequestAndNavigate } from '../lib/createRequestAndNavigate'; import { generateId } from '../lib/generateId'; import { BODY_TYPE_GRAPHQL } from '../lib/model_util'; diff --git a/apps/yaak-client/lib/initGlobalListeners.tsx b/apps/yaak-client/lib/initGlobalListeners.tsx index 4da61335..7968406b 100644 --- a/apps/yaak-client/lib/initGlobalListeners.tsx +++ b/apps/yaak-client/lib/initGlobalListeners.tsx @@ -17,7 +17,7 @@ import type { import { openSettings } from "../commands/openSettings"; import { Button } from "../components/core/Button"; import { ButtonInfiniteLoading } from "../components/core/ButtonInfiniteLoading"; -import { Icon } from "../components/core/Icon"; +import { Icon } from "@yaakapp-internal/ui"; import { HStack, VStack } from "../components/core/Stacks"; // Listen for toasts diff --git a/packages/ui/src/components/Button.tsx b/packages/ui/src/components/Button.tsx index 05a36d2f..59682377 100644 --- a/packages/ui/src/components/Button.tsx +++ b/packages/ui/src/components/Button.tsx @@ -1,16 +1,6 @@ +import type { Color } from "@yaakapp-internal/plugins"; import type { HTMLAttributes, ReactNode } from "react"; -type ButtonColor = - | "default" - | "custom" - | "primary" - | "secondary" - | "info" - | "success" - | "notice" - | "warning" - | "danger"; - type ButtonVariant = "border" | "solid"; type ButtonSize = "2xs" | "xs" | "sm" | "md" | "auto"; @@ -19,8 +9,8 @@ export type ButtonProps = Omit< "color" | "onChange" > & { innerClassName?: string; - color?: ButtonColor; - tone?: Exclude; + color?: Color | "custom" | "default"; + tone?: Color | "default"; variant?: ButtonVariant; isLoading?: boolean; size?: ButtonSize; diff --git a/apps/yaak-client/components/core/Icon.tsx b/packages/ui/src/components/Icon.tsx similarity index 100% rename from apps/yaak-client/components/core/Icon.tsx rename to packages/ui/src/components/Icon.tsx diff --git a/apps/yaak-client/components/core/LoadingIcon.tsx b/packages/ui/src/components/LoadingIcon.tsx similarity index 100% rename from apps/yaak-client/components/core/LoadingIcon.tsx rename to packages/ui/src/components/LoadingIcon.tsx diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 0071568a..26b56dfc 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -1,6 +1,9 @@ export { Button } from "./components/Button"; export type { ButtonProps } from "./components/Button"; export { HeaderSize } from "./components/HeaderSize"; +export { Icon } from "./components/Icon"; +export type { IconProps } from "./components/Icon"; +export { LoadingIcon } from "./components/LoadingIcon"; export { WindowControls } from "./components/WindowControls"; export { useIsFullscreen } from "./hooks/useIsFullscreen"; export { useDebouncedValue } from "./hooks/useDebouncedValue";