Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/use-client-directives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@surf-kit/core': patch
'@surf-kit/agent': patch
'@surf-kit/hooks': patch
'@surf-kit/theme': patch
---

Add 'use client' directives for React Server Components compatibility
2 changes: 2 additions & 0 deletions packages/agent/src/chat/MessageComposer/MessageComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useRef, useCallback } from 'react'

Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/chat/MessageThread/MessageThread.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useEffect, useRef } from 'react'
import type { ChatMessage } from '../../types/chat'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useState } from 'react'
import type { ConfidenceBreakdown as ConfidenceBreakdownType } from '../../types/agent'
import { ConfidenceBadge } from '../ConfidenceBadge'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useState } from 'react'
import type { VerificationResult } from '../../types/agent'
import { VerificationBadge } from '../VerificationBadge'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useState } from 'react'
import { Dialog, Button, TextArea } from '@surf-kit/core'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useState } from 'react'

type FeedbackRating = 'positive' | 'negative'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/hooks/useAgentChat.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useReducer, useCallback, useRef } from 'react'
import type { ChatMessage, ChatError } from '../types/chat'
import type { AgentResponse } from '../types/agent'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/hooks/useAgentTheme.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useMemo } from 'react'
import type { AgentInfo } from '../types/agent'

Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/hooks/useCharacterDrain.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useState, useRef, useEffect } from 'react'

export interface CharacterDrainResult {
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/hooks/useConversation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useState, useCallback } from 'react'
import type { ChatMessage } from '../types/chat'
import type { ConversationSummary } from '../types/chat'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/hooks/useFeedback.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useState, useCallback, useRef } from 'react'

export type FeedbackState = 'idle' | 'submitting' | 'submitted' | 'error'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/hooks/useStreaming.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useState, useCallback, useRef, useEffect } from 'react'
import type { StreamEvent, StreamState } from '../types/streaming'
import type { Source } from '../types/agent'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/layouts/AgentFullPage/AgentFullPage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useCallback } from 'react'
import { AgentChat } from '../../chat/AgentChat'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/layouts/AgentPanel/AgentPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef, useEffect } from 'react'
import { AgentChat } from '../../chat/AgentChat'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/layouts/AgentWidget/AgentWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useCallback } from 'react'
import { AgentChat } from '../../chat/AgentChat'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useRef, useEffect } from 'react'
import { cva } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/mcp/MCPServerStatus/MCPServerStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useState } from 'react'
import { cva } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/sources/SourceList/SourceList.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useState } from 'react'
import type { Source } from '../../types/agent'
import { SourceCard } from '../SourceCard'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useEffect, useRef } from 'react'
import { Spinner } from '@surf-kit/core'
import type { StreamState } from '../../types/streaming'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useEffect, useState } from 'react'

export type TypewriterTextProps = {
Expand Down
1 change: 1 addition & 0 deletions packages/agent/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export default defineConfig((options) => ({
sourcemap: true,
clean: !options.watch,
external: ['react', 'react-dom', /^@surf-kit\//],
banner: { js: "'use client';" },
}))
2 changes: 2 additions & 0 deletions packages/core/src/data/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useRef, useCallback } from 'react'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/data/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { useState, useRef, useCallback, useEffect, Children } from 'react'
import { twMerge } from 'tailwind-merge'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/data/Collapsible/Collapsible.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { createContext, useCallback, useContext, useState } from 'react'
import { twMerge } from 'tailwind-merge'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/data/Table/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React from 'react'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/feedback/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva, type VariantProps } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { useState } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/feedback/Toast/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, {
createContext,
useContext,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva, type VariantProps } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useCalendar, useCalendarGrid, useCalendarCell, useButton, useLocale } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useCheckbox } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva, type VariantProps } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/RadioGroup/RadioGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { createContext, useContext, useRef } from 'react'
import { useRadioGroup, useRadio } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/SearchInput/SearchInput.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useSearchField, useButton } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useSelect, useListBox, useOption, useButton, HiddenSelect } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/Slider/Slider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useSlider, useSliderThumb, VisuallyHidden } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/Switch/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useSwitch } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/TextArea/TextArea.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useTextField } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useTextField } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/Toggle/Toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva, type VariantProps } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { createContext, useContext, useRef } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/inputs/ToggleGroup/ToggleGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useCallback, useState } from 'react'
import { ToggleGroupCtx } from '../Toggle'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/layout/Resizable/Resizable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useRef, useCallback, useEffect } from 'react'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/navigation/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useBreadcrumbs, useBreadcrumbItem } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/navigation/Menubar/Menubar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useRef, useEffect, useCallback, createContext, useContext } from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useRef, useEffect, useCallback } from 'react'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/navigation/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva, type VariantProps } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/navigation/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useTabList, useTab, useTabPanel } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/Command/Command.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, {
useState,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/ContextMenu/ContextMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useRef, useEffect, useCallback } from 'react'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { useRef, useEffect } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva, type VariantProps } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { useRef, useEffect } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useMenuTrigger, useMenu, useMenuItem, useButton } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/HoverCard/HoverCard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useState, useRef, useCallback, useEffect } from 'react'

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/Popover/Popover.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef } from 'react'
import { useOverlay, DismissButton, FocusScope } from 'react-aria'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/Sheet/Sheet.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { cva } from 'class-variance-authority'
import { twMerge } from 'tailwind-merge'
import React, { useRef, useEffect } from 'react'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/overlay/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { twMerge } from 'tailwind-merge'
import React, { useRef, cloneElement } from 'react'
import { useTooltip, useTooltipTrigger, mergeProps } from 'react-aria'
Expand Down
1 change: 1 addition & 0 deletions packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export default defineConfig((options) => ({
sourcemap: true,
clean: !options.watch,
external: ['react', 'react-dom', /^@surf-kit\//],
banner: { js: "'use client';" },
}))
2 changes: 2 additions & 0 deletions packages/hooks/src/useAnnounce.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useCallback, useEffect, useRef } from 'react'

type Priority = 'polite' | 'assertive'
Expand Down
2 changes: 2 additions & 0 deletions packages/hooks/src/useClipboard.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useState, useCallback, useRef } from 'react'

export function useClipboard(): { copy: (text: string) => Promise<void>; copied: boolean } {
Expand Down
2 changes: 2 additions & 0 deletions packages/hooks/src/useFocusTrap.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useEffect, useRef, type RefObject } from 'react'

const FOCUSABLE_SELECTOR =
Expand Down
2 changes: 2 additions & 0 deletions packages/hooks/src/useKeyboardShortcut.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useEffect } from 'react'

interface ShortcutOptions {
Expand Down
2 changes: 2 additions & 0 deletions packages/hooks/src/useLocalStorage.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useState, useCallback } from 'react'

type SetValue<T> = T | ((prev: T) => T)
Expand Down
2 changes: 2 additions & 0 deletions packages/hooks/src/useMediaQuery.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useState, useEffect } from 'react'

export function useMediaQuery(query: string): boolean {
Expand Down
1 change: 1 addition & 0 deletions packages/hooks/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default defineConfig((options) => ({
sourcemap: true,
clean: !options.watch,
external: ['react'],
banner: { js: "'use client';" },
}))
2 changes: 2 additions & 0 deletions packages/theme/src/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, {
createContext,
useCallback,
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/src/useColorMode.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import { useCallback, useEffect, useState } from 'react'
import { useTheme } from './useTheme'
import type { ColorMode, ColorModePreference } from './types'
Expand Down
Loading