From 4d792c7f9ffd15b45c0bcda959ce14b728450550 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 12 Mar 2026 19:32:04 -0700 Subject: [PATCH] Move inlinecode to shared ui package --- apps/yaak-client/commands/commands.tsx | 2 +- apps/yaak-client/components/BinaryFileEditor.tsx | 3 +-- apps/yaak-client/components/ConfirmLargeRequestBody.tsx | 3 +-- apps/yaak-client/components/ConfirmLargeResponse.tsx | 3 +-- apps/yaak-client/components/ConfirmLargeResponseRequest.tsx | 3 +-- apps/yaak-client/components/CookieDialog.tsx | 3 +-- apps/yaak-client/components/CookieDropdown.tsx | 3 +-- apps/yaak-client/components/EnvironmentEditDialog.tsx | 3 +-- apps/yaak-client/components/ErrorBoundary.tsx | 3 +-- apps/yaak-client/components/FolderSettingsDialog.tsx | 3 +-- apps/yaak-client/components/GrpcEditor.tsx | 2 +- apps/yaak-client/components/GrpcProtoSelectionDialog.tsx | 3 +-- apps/yaak-client/components/HttpAuthenticationEditor.tsx | 3 +-- apps/yaak-client/components/HttpRequestPane.tsx | 2 +- apps/yaak-client/components/MoveToWorkspaceDialog.tsx | 2 +- apps/yaak-client/components/Settings/SettingsCertificates.tsx | 2 +- apps/yaak-client/components/Settings/SettingsPlugins.tsx | 3 +-- apps/yaak-client/components/Settings/SettingsProxy.tsx | 2 +- apps/yaak-client/components/Sidebar.tsx | 2 +- apps/yaak-client/components/SwitchWorkspaceDialog.tsx | 3 +-- apps/yaak-client/components/TemplateFunctionDialog.tsx | 4 +--- apps/yaak-client/components/WorkspaceSettingsDialog.tsx | 3 +-- apps/yaak-client/components/git/GitCommitDialog.tsx | 3 +-- apps/yaak-client/components/git/GitDropdown.tsx | 3 +-- apps/yaak-client/components/git/credentials.tsx | 3 +-- apps/yaak-client/components/git/diverged.tsx | 2 +- apps/yaak-client/components/responseViewers/BinaryViewer.tsx | 3 +-- .../components/responseViewers/EventStreamViewer.tsx | 3 +-- apps/yaak-client/hooks/useActiveWorkspaceChangedToast.tsx | 2 +- apps/yaak-client/hooks/useAuthTab.tsx | 3 +-- apps/yaak-client/hooks/useCheckForUpdates.tsx | 2 +- apps/yaak-client/hooks/useSaveResponse.tsx | 2 +- apps/yaak-client/lib/deleteModelWithConfirm.tsx | 2 +- apps/yaak-client/lib/renameModelWithPrompt.tsx | 2 +- .../core => packages/ui/src/components}/InlineCode.tsx | 0 packages/ui/src/index.ts | 1 + 36 files changed, 35 insertions(+), 56 deletions(-) rename {apps/yaak-client/components/core => packages/ui/src/components}/InlineCode.tsx (100%) diff --git a/apps/yaak-client/commands/commands.tsx b/apps/yaak-client/commands/commands.tsx index 516604ed..9a75b5fd 100644 --- a/apps/yaak-client/commands/commands.tsx +++ b/apps/yaak-client/commands/commands.tsx @@ -1,9 +1,9 @@ import { createWorkspaceModel, type Folder, modelTypeLabel } from '@yaakapp-internal/models'; import { applySync, calculateSync } from '@yaakapp-internal/sync'; import { Button } from '../components/core/Button'; -import { InlineCode } from '../components/core/InlineCode'; import { Banner, + InlineCode, Table, TableBody, TableCell, diff --git a/apps/yaak-client/components/BinaryFileEditor.tsx b/apps/yaak-client/components/BinaryFileEditor.tsx index e1a19a20..29be9679 100644 --- a/apps/yaak-client/components/BinaryFileEditor.tsx +++ b/apps/yaak-client/components/BinaryFileEditor.tsx @@ -1,9 +1,8 @@ import type { HttpRequest } from '@yaakapp-internal/models'; import mime from 'mime'; import { useKeyValue } from '../hooks/useKeyValue'; -import { Banner } from '@yaakapp-internal/ui'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; import { Button } from './core/Button'; -import { InlineCode } from './core/InlineCode'; import { HStack, VStack } from './core/Stacks'; import { SelectFile } from './SelectFile'; diff --git a/apps/yaak-client/components/ConfirmLargeRequestBody.tsx b/apps/yaak-client/components/ConfirmLargeRequestBody.tsx index 5cae8308..4f797977 100644 --- a/apps/yaak-client/components/ConfirmLargeRequestBody.tsx +++ b/apps/yaak-client/components/ConfirmLargeRequestBody.tsx @@ -3,9 +3,8 @@ import { patchModel } from '@yaakapp-internal/models'; import type { ReactNode } from 'react'; import { useToggle } from '../hooks/useToggle'; import { showConfirm } from '../lib/confirm'; -import { Banner } from '@yaakapp-internal/ui'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; import { Button } from './core/Button'; -import { InlineCode } from './core/InlineCode'; import { Link } from './core/Link'; import { SizeTag } from './core/SizeTag'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/ConfirmLargeResponse.tsx b/apps/yaak-client/components/ConfirmLargeResponse.tsx index 4de62f19..682bd562 100644 --- a/apps/yaak-client/components/ConfirmLargeResponse.tsx +++ b/apps/yaak-client/components/ConfirmLargeResponse.tsx @@ -6,9 +6,8 @@ import { isProbablyTextContentType } from '../lib/contentType'; import { getContentTypeFromHeaders } from '../lib/model_util'; import { getResponseBodyText } from '../lib/responseBody'; import { CopyButton } from './CopyButton'; -import { Banner } from '@yaakapp-internal/ui'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; import { Button } from './core/Button'; -import { InlineCode } from './core/InlineCode'; import { SizeTag } from './core/SizeTag'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/ConfirmLargeResponseRequest.tsx b/apps/yaak-client/components/ConfirmLargeResponseRequest.tsx index efb1121a..bba66b72 100644 --- a/apps/yaak-client/components/ConfirmLargeResponseRequest.tsx +++ b/apps/yaak-client/components/ConfirmLargeResponseRequest.tsx @@ -5,9 +5,8 @@ import { useToggle } from '../hooks/useToggle'; import { isProbablyTextContentType } from '../lib/contentType'; import { getContentTypeFromHeaders } from '../lib/model_util'; import { CopyButton } from './CopyButton'; -import { Banner } from '@yaakapp-internal/ui'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; import { Button } from './core/Button'; -import { InlineCode } from './core/InlineCode'; import { SizeTag } from './core/SizeTag'; import { HStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/CookieDialog.tsx b/apps/yaak-client/components/CookieDialog.tsx index 448b30d4..bd50957c 100644 --- a/apps/yaak-client/components/CookieDialog.tsx +++ b/apps/yaak-client/components/CookieDialog.tsx @@ -2,9 +2,8 @@ import type { Cookie } from '@yaakapp-internal/models'; import { cookieJarsAtom, patchModel } from '@yaakapp-internal/models'; import { useAtomValue } from 'jotai'; import { cookieDomain } from '../lib/model_util'; -import { Banner } from '@yaakapp-internal/ui'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; -import { InlineCode } from './core/InlineCode'; interface Props { cookieJarId: string | null; diff --git a/apps/yaak-client/components/CookieDropdown.tsx b/apps/yaak-client/components/CookieDropdown.tsx index 79aa5be5..b33cd54b 100644 --- a/apps/yaak-client/components/CookieDropdown.tsx +++ b/apps/yaak-client/components/CookieDropdown.tsx @@ -9,9 +9,8 @@ import { showPrompt } from '../lib/prompt'; import { setWorkspaceSearchParams } from '../lib/setWorkspaceSearchParams'; import { CookieDialog } from './CookieDialog'; import { Dropdown, type DropdownItem } from './core/Dropdown'; -import { Icon } from '@yaakapp-internal/ui'; +import { Icon, InlineCode } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; -import { InlineCode } from './core/InlineCode'; export const CookieDropdown = memo(function CookieDropdown() { const activeCookieJar = useActiveCookieJar(); diff --git a/apps/yaak-client/components/EnvironmentEditDialog.tsx b/apps/yaak-client/components/EnvironmentEditDialog.tsx index 2e1e1b2e..94353d77 100644 --- a/apps/yaak-client/components/EnvironmentEditDialog.tsx +++ b/apps/yaak-client/components/EnvironmentEditDialog.tsx @@ -1,7 +1,7 @@ import type { Environment, Workspace } from '@yaakapp-internal/models'; import { duplicateModel, patchModel } from '@yaakapp-internal/models'; import type { TreeHandle, TreeNode, TreeProps } from '@yaakapp-internal/ui'; -import { Banner, Icon, SplitLayout, Tree } from '@yaakapp-internal/ui'; +import { Banner, Icon, InlineCode, SplitLayout, Tree } from '@yaakapp-internal/ui'; import { atom, useAtomValue } from 'jotai'; import { atomFamily } from 'jotai/utils'; import { useCallback, useLayoutEffect, useRef, useState } from 'react'; @@ -22,7 +22,6 @@ import type { ContextMenuProps, DropdownItem } from './core/Dropdown'; import { ContextMenu } from './core/Dropdown'; import { IconButton } from './core/IconButton'; import { IconTooltip } from './core/IconTooltip'; -import { InlineCode } from './core/InlineCode'; import type { PairEditorHandle } from './core/PairEditor'; import { EnvironmentColorIndicator } from './EnvironmentColorIndicator'; import { EnvironmentEditor } from './EnvironmentEditor'; diff --git a/apps/yaak-client/components/ErrorBoundary.tsx b/apps/yaak-client/components/ErrorBoundary.tsx index 2dad0e2b..49aa7024 100644 --- a/apps/yaak-client/components/ErrorBoundary.tsx +++ b/apps/yaak-client/components/ErrorBoundary.tsx @@ -1,9 +1,8 @@ import type { ErrorInfo, ReactNode } from 'react'; import { Component, useEffect } from 'react'; import { showDialog } from '../lib/dialog'; -import { Banner } from '@yaakapp-internal/ui'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; import { Button } from './core/Button'; -import { InlineCode } from './core/InlineCode'; import RouteError from './RouteError'; interface ErrorBoundaryProps { diff --git a/apps/yaak-client/components/FolderSettingsDialog.tsx b/apps/yaak-client/components/FolderSettingsDialog.tsx index bb299ac6..079a509b 100644 --- a/apps/yaak-client/components/FolderSettingsDialog.tsx +++ b/apps/yaak-client/components/FolderSettingsDialog.tsx @@ -15,8 +15,7 @@ import { hideDialog } from '../lib/dialog'; import { CopyIconButton } from './CopyIconButton'; import { Button } from './core/Button'; import { CountBadge } from './core/CountBadge'; -import { Icon } from '@yaakapp-internal/ui'; -import { InlineCode } from './core/InlineCode'; +import { Icon, InlineCode } from '@yaakapp-internal/ui'; import { Input } from './core/Input'; import { Link } from './core/Link'; import { HStack, VStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/GrpcEditor.tsx b/apps/yaak-client/components/GrpcEditor.tsx index 6727e8f6..67695a93 100644 --- a/apps/yaak-client/components/GrpcEditor.tsx +++ b/apps/yaak-client/components/GrpcEditor.tsx @@ -19,7 +19,7 @@ import { Button } from './core/Button'; import type { EditorProps } from './core/Editor/Editor'; import { Editor } from './core/Editor/LazyEditor'; import { FormattedError } from './core/FormattedError'; -import { InlineCode } from './core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { VStack } from './core/Stacks'; import { GrpcProtoSelectionDialog } from './GrpcProtoSelectionDialog'; diff --git a/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx b/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx index bc46627e..88fcf257 100644 --- a/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx +++ b/apps/yaak-client/components/GrpcProtoSelectionDialog.tsx @@ -5,9 +5,8 @@ import { useGrpc } from '../hooks/useGrpc'; import { useGrpcProtoFiles } from '../hooks/useGrpcProtoFiles'; import { pluralizeCount } from '../lib/pluralize'; import { Button } from './core/Button'; -import { Banner, Icon } from '@yaakapp-internal/ui'; +import { Banner, Icon, InlineCode } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; -import { InlineCode } from './core/InlineCode'; import { Link } from './core/Link'; import { HStack, VStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/HttpAuthenticationEditor.tsx b/apps/yaak-client/components/HttpAuthenticationEditor.tsx index 450637d8..ab048f9a 100644 --- a/apps/yaak-client/components/HttpAuthenticationEditor.tsx +++ b/apps/yaak-client/components/HttpAuthenticationEditor.tsx @@ -14,9 +14,8 @@ 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 '@yaakapp-internal/ui'; +import { Icon, InlineCode } from '@yaakapp-internal/ui'; import { IconButton } from './core/IconButton'; -import { InlineCode } from './core/InlineCode'; import { Input, type InputProps } from './core/Input'; import { Link } from './core/Link'; import { SegmentedControl } from './core/SegmentedControl'; diff --git a/apps/yaak-client/components/HttpRequestPane.tsx b/apps/yaak-client/components/HttpRequestPane.tsx index 75f857b3..292c43e5 100644 --- a/apps/yaak-client/components/HttpRequestPane.tsx +++ b/apps/yaak-client/components/HttpRequestPane.tsx @@ -38,7 +38,7 @@ import { ConfirmLargeRequestBody } from './ConfirmLargeRequestBody'; import { CountBadge } from './core/CountBadge'; import type { GenericCompletionConfig } from './core/Editor/genericCompletion'; import { Editor } from './core/Editor/LazyEditor'; -import { InlineCode } from './core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import type { Pair } from './core/PairEditor'; import { PlainInput } from './core/PlainInput'; import type { TabItem, TabsRef } from './core/Tabs/Tabs'; diff --git a/apps/yaak-client/components/MoveToWorkspaceDialog.tsx b/apps/yaak-client/components/MoveToWorkspaceDialog.tsx index d6f405ec..9fc4ef0b 100644 --- a/apps/yaak-client/components/MoveToWorkspaceDialog.tsx +++ b/apps/yaak-client/components/MoveToWorkspaceDialog.tsx @@ -6,8 +6,8 @@ import { pluralizeCount } from '../lib/pluralize'; import { resolvedModelName } from '../lib/resolvedModelName'; import { router } from '../lib/router'; import { showToast } from '../lib/toast'; +import { InlineCode } from '@yaakapp-internal/ui'; import { Button } from './core/Button'; -import { InlineCode } from './core/InlineCode'; import { Select } from './core/Select'; import { VStack } from './core/Stacks'; diff --git a/apps/yaak-client/components/Settings/SettingsCertificates.tsx b/apps/yaak-client/components/Settings/SettingsCertificates.tsx index e6081e72..e1be3287 100644 --- a/apps/yaak-client/components/Settings/SettingsCertificates.tsx +++ b/apps/yaak-client/components/Settings/SettingsCertificates.tsx @@ -8,7 +8,7 @@ import { Checkbox } from '../core/Checkbox'; import { DetailsBanner } from '../core/DetailsBanner'; import { Heading } from '../core/Heading'; import { IconButton } from '../core/IconButton'; -import { InlineCode } from '../core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { PlainInput } from '../core/PlainInput'; import { Separator } from '../core/Separator'; import { HStack, VStack } from '../core/Stacks'; diff --git a/apps/yaak-client/components/Settings/SettingsPlugins.tsx b/apps/yaak-client/components/Settings/SettingsPlugins.tsx index d045b9f4..66b257f4 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 { Icon, LoadingIcon, useDebouncedValue } from '@yaakapp-internal/ui'; +import { Icon, InlineCode, LoadingIcon, useDebouncedValue } from '@yaakapp-internal/ui'; import { useInstallPlugin } from '../../hooks/useInstallPlugin'; import { usePluginInfo } from '../../hooks/usePluginInfo'; import { usePluginsKey, useRefreshPlugins } from '../../hooks/usePlugins'; @@ -22,7 +22,6 @@ import { Button } from '../core/Button'; import { Checkbox } from '../core/Checkbox'; import { CountBadge } from '../core/CountBadge'; import { IconButton } from '../core/IconButton'; -import { InlineCode } from '../core/InlineCode'; import { Link } from '../core/Link'; import { PlainInput } from '../core/PlainInput'; import { HStack } from '../core/Stacks'; diff --git a/apps/yaak-client/components/Settings/SettingsProxy.tsx b/apps/yaak-client/components/Settings/SettingsProxy.tsx index 49019bad..a63b9071 100644 --- a/apps/yaak-client/components/Settings/SettingsProxy.tsx +++ b/apps/yaak-client/components/Settings/SettingsProxy.tsx @@ -3,7 +3,7 @@ import { useAtomValue } from 'jotai'; import { Checkbox } from '../core/Checkbox'; import { Heading } from '../core/Heading'; -import { InlineCode } from '../core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { PlainInput } from '../core/PlainInput'; import { Select } from '../core/Select'; import { Separator } from '../core/Separator'; diff --git a/apps/yaak-client/components/Sidebar.tsx b/apps/yaak-client/components/Sidebar.tsx index adc169af..660466a6 100644 --- a/apps/yaak-client/components/Sidebar.tsx +++ b/apps/yaak-client/components/Sidebar.tsx @@ -60,10 +60,10 @@ import { Tree, isSelectedFamily, selectedIdsFamily, + InlineCode, } from '@yaakapp-internal/ui'; import type { TreeNode, TreeHandle, TreeProps, TreeItemProps } 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 { atomWithKVStorage } from '../lib/atoms/atomWithKVStorage'; diff --git a/apps/yaak-client/components/SwitchWorkspaceDialog.tsx b/apps/yaak-client/components/SwitchWorkspaceDialog.tsx index 1c7298d8..5feb916d 100644 --- a/apps/yaak-client/components/SwitchWorkspaceDialog.tsx +++ b/apps/yaak-client/components/SwitchWorkspaceDialog.tsx @@ -5,8 +5,7 @@ import { useState } from 'react'; import { switchWorkspace } from '../commands/switchWorkspace'; import { Button } from './core/Button'; import { Checkbox } from './core/Checkbox'; -import { Icon } from '@yaakapp-internal/ui'; -import { InlineCode } from './core/InlineCode'; +import { Icon, InlineCode } from '@yaakapp-internal/ui'; import { HStack, VStack } from './core/Stacks'; interface Props { diff --git a/apps/yaak-client/components/TemplateFunctionDialog.tsx b/apps/yaak-client/components/TemplateFunctionDialog.tsx index 0d970b89..ea997113 100644 --- a/apps/yaak-client/components/TemplateFunctionDialog.tsx +++ b/apps/yaak-client/components/TemplateFunctionDialog.tsx @@ -12,7 +12,7 @@ import { parseTemplate } from '@yaakapp-internal/templates'; import classNames from 'classnames'; import { useEffect, useMemo, useState } from 'react'; import { activeWorkspaceAtom } from '../hooks/useActiveWorkspace'; -import { useDebouncedValue } from '@yaakapp-internal/ui'; +import { InlineCode, LoadingIcon, useDebouncedValue } from '@yaakapp-internal/ui'; import { useRenderTemplate } from '../hooks/useRenderTemplate'; import { useTemplateFunctionConfig } from '../hooks/useTemplateFunctionConfig'; import { @@ -27,8 +27,6 @@ import { setupOrConfigureEncryption } from '../lib/setupOrConfigureEncryption'; 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 '@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/WorkspaceSettingsDialog.tsx b/apps/yaak-client/components/WorkspaceSettingsDialog.tsx index 32ef1a92..5ab2be45 100644 --- a/apps/yaak-client/components/WorkspaceSettingsDialog.tsx +++ b/apps/yaak-client/components/WorkspaceSettingsDialog.tsx @@ -6,10 +6,9 @@ import { useInheritedHeaders } from '../hooks/useInheritedHeaders'; import { deleteModelWithConfirm } from '../lib/deleteModelWithConfirm'; import { router } from '../lib/router'; import { CopyIconButton } from './CopyIconButton'; -import { Banner } from '@yaakapp-internal/ui'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; import { Button } from './core/Button'; import { CountBadge } from './core/CountBadge'; -import { InlineCode } from './core/InlineCode'; import { PlainInput } from './core/PlainInput'; import { HStack, VStack } from './core/Stacks'; import { TabContent, Tabs } from './core/Tabs/Tabs'; diff --git a/apps/yaak-client/components/git/GitCommitDialog.tsx b/apps/yaak-client/components/git/GitCommitDialog.tsx index d7269b79..7aed055d 100644 --- a/apps/yaak-client/components/git/GitCommitDialog.tsx +++ b/apps/yaak-client/components/git/GitCommitDialog.tsx @@ -18,8 +18,7 @@ import { Button } from '../core/Button'; import type { CheckboxProps } from '../core/Checkbox'; import { Checkbox } from '../core/Checkbox'; import { DiffViewer } from '../core/Editor/DiffViewer'; -import { Banner, Icon, SplitLayout } from '@yaakapp-internal/ui'; -import { InlineCode } from '../core/InlineCode'; +import { Banner, Icon, InlineCode, SplitLayout } from '@yaakapp-internal/ui'; import { Input } from '../core/Input'; import { Separator } from '../core/Separator'; import { HStack } from '../core/Stacks'; diff --git a/apps/yaak-client/components/git/GitDropdown.tsx b/apps/yaak-client/components/git/GitDropdown.tsx index 4ca06172..1f981c0a 100644 --- a/apps/yaak-client/components/git/GitDropdown.tsx +++ b/apps/yaak-client/components/git/GitDropdown.tsx @@ -15,8 +15,7 @@ import { showPrompt } from '../../lib/prompt'; import { showErrorToast, showToast } from '../../lib/toast'; import type { DropdownItem } from '../core/Dropdown'; import { Dropdown } from '../core/Dropdown'; -import { Banner, Icon } from '@yaakapp-internal/ui'; -import { InlineCode } from '../core/InlineCode'; +import { Banner, Icon, InlineCode } from '@yaakapp-internal/ui'; import { gitCallbacks } from './callbacks'; import { GitCommitDialog } from './GitCommitDialog'; import { GitRemotesDialog } from './GitRemotesDialog'; diff --git a/apps/yaak-client/components/git/credentials.tsx b/apps/yaak-client/components/git/credentials.tsx index 6a90aa28..16787128 100644 --- a/apps/yaak-client/components/git/credentials.tsx +++ b/apps/yaak-client/components/git/credentials.tsx @@ -1,6 +1,5 @@ import { showPromptForm } from '../../lib/prompt-form'; -import { Banner } from '@yaakapp-internal/ui'; -import { InlineCode } from '../core/InlineCode'; +import { Banner, InlineCode } from '@yaakapp-internal/ui'; export interface GitCredentials { username: string; diff --git a/apps/yaak-client/components/git/diverged.tsx b/apps/yaak-client/components/git/diverged.tsx index 60b3dc45..9d16d465 100644 --- a/apps/yaak-client/components/git/diverged.tsx +++ b/apps/yaak-client/components/git/diverged.tsx @@ -1,8 +1,8 @@ import type { DivergedStrategy } from '@yaakapp-internal/git'; import { useState } from 'react'; import { showDialog } from '../../lib/dialog'; +import { InlineCode } from '@yaakapp-internal/ui'; import { Button } from '../core/Button'; -import { InlineCode } from '../core/InlineCode'; import { RadioCards } from '../core/RadioCards'; import { HStack } from '../core/Stacks'; diff --git a/apps/yaak-client/components/responseViewers/BinaryViewer.tsx b/apps/yaak-client/components/responseViewers/BinaryViewer.tsx index 28fc3ef4..25056125 100644 --- a/apps/yaak-client/components/responseViewers/BinaryViewer.tsx +++ b/apps/yaak-client/components/responseViewers/BinaryViewer.tsx @@ -2,8 +2,7 @@ import type { HttpResponse } from '@yaakapp-internal/models'; import { useSaveResponse } from '../../hooks/useSaveResponse'; import { getContentTypeFromHeaders } from '../../lib/model_util'; import { Button } from '../core/Button'; -import { InlineCode } from '../core/InlineCode'; -import { Banner, LoadingIcon } from '@yaakapp-internal/ui'; +import { Banner, InlineCode, 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 61745185..911e2ca7 100644 --- a/apps/yaak-client/components/responseViewers/EventStreamViewer.tsx +++ b/apps/yaak-client/components/responseViewers/EventStreamViewer.tsx @@ -10,8 +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 '@yaakapp-internal/ui'; -import { InlineCode } from '../core/InlineCode'; +import { Icon, InlineCode } from '@yaakapp-internal/ui'; import { HStack, VStack } from '../core/Stacks'; interface Props { diff --git a/apps/yaak-client/hooks/useActiveWorkspaceChangedToast.tsx b/apps/yaak-client/hooks/useActiveWorkspaceChangedToast.tsx index 19f31247..1f7d9255 100644 --- a/apps/yaak-client/hooks/useActiveWorkspaceChangedToast.tsx +++ b/apps/yaak-client/hooks/useActiveWorkspaceChangedToast.tsx @@ -1,6 +1,6 @@ import { useAtomValue } from 'jotai'; import { useEffect, useState } from 'react'; -import { InlineCode } from '../components/core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { showToast } from '../lib/toast'; import { activeWorkspaceAtom } from './useActiveWorkspace'; diff --git a/apps/yaak-client/hooks/useAuthTab.tsx b/apps/yaak-client/hooks/useAuthTab.tsx index 406d8888..045d7c32 100644 --- a/apps/yaak-client/hooks/useAuthTab.tsx +++ b/apps/yaak-client/hooks/useAuthTab.tsx @@ -3,9 +3,8 @@ import { modelTypeLabel, patchModel } from '@yaakapp-internal/models'; import { useMemo } from 'react'; import { openFolderSettings } from '../commands/openFolderSettings'; import { openWorkspaceSettings } from '../commands/openWorkspaceSettings'; -import { Icon } from '@yaakapp-internal/ui'; +import { Icon, InlineCode } from '@yaakapp-internal/ui'; import { IconTooltip } from '../components/core/IconTooltip'; -import { InlineCode } from '../components/core/InlineCode'; import { HStack } from '../components/core/Stacks'; import type { TabItem } from '../components/core/Tabs/Tabs'; import { capitalize } from '../lib/capitalize'; diff --git a/apps/yaak-client/hooks/useCheckForUpdates.tsx b/apps/yaak-client/hooks/useCheckForUpdates.tsx index 5ff81765..1f7f3e74 100644 --- a/apps/yaak-client/hooks/useCheckForUpdates.tsx +++ b/apps/yaak-client/hooks/useCheckForUpdates.tsx @@ -1,5 +1,5 @@ import { useMutation } from '@tanstack/react-query'; -import { InlineCode } from '../components/core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { showAlert } from '../lib/alert'; import { appInfo } from '../lib/appInfo'; import { minPromiseMillis } from '../lib/minPromiseMillis'; diff --git a/apps/yaak-client/hooks/useSaveResponse.tsx b/apps/yaak-client/hooks/useSaveResponse.tsx index ba4f1d9c..44b41031 100644 --- a/apps/yaak-client/hooks/useSaveResponse.tsx +++ b/apps/yaak-client/hooks/useSaveResponse.tsx @@ -3,7 +3,7 @@ import type { HttpResponse } from '@yaakapp-internal/models'; import { getModel } from '@yaakapp-internal/models'; import mime from 'mime'; import slugify from 'slugify'; -import { InlineCode } from '../components/core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { getContentTypeFromHeaders } from '../lib/model_util'; import { invokeCmd } from '../lib/tauri'; import { showToast } from '../lib/toast'; diff --git a/apps/yaak-client/lib/deleteModelWithConfirm.tsx b/apps/yaak-client/lib/deleteModelWithConfirm.tsx index 9cb8c1c7..29dfef86 100644 --- a/apps/yaak-client/lib/deleteModelWithConfirm.tsx +++ b/apps/yaak-client/lib/deleteModelWithConfirm.tsx @@ -1,6 +1,6 @@ import type { AnyModel } from '@yaakapp-internal/models'; import { deleteModel, modelTypeLabel } from '@yaakapp-internal/models'; -import { InlineCode } from '../components/core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { Prose } from '../components/Prose'; import { showConfirmDelete } from './confirm'; import { pluralizeCount } from './pluralize'; diff --git a/apps/yaak-client/lib/renameModelWithPrompt.tsx b/apps/yaak-client/lib/renameModelWithPrompt.tsx index 9002a171..3a9debf9 100644 --- a/apps/yaak-client/lib/renameModelWithPrompt.tsx +++ b/apps/yaak-client/lib/renameModelWithPrompt.tsx @@ -1,6 +1,6 @@ import type { AnyModel } from '@yaakapp-internal/models'; import { patchModel } from '@yaakapp-internal/models'; -import { InlineCode } from '../components/core/InlineCode'; +import { InlineCode } from '@yaakapp-internal/ui'; import { showPrompt } from './prompt'; export async function renameModelWithPrompt(model: Extract | null) { diff --git a/apps/yaak-client/components/core/InlineCode.tsx b/packages/ui/src/components/InlineCode.tsx similarity index 100% rename from apps/yaak-client/components/core/InlineCode.tsx rename to packages/ui/src/components/InlineCode.tsx diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index a250cc2e..088330a0 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -33,3 +33,4 @@ export { Portal } from "./components/Portal"; export { usePortal } from "./hooks/usePortal"; export { Banner } from "./components/Banner"; export type { BannerProps } from "./components/Banner"; +export { InlineCode } from "./components/InlineCode";