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
2 changes: 2 additions & 0 deletions docs/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"license": "Apache-2.0",
"main": "index.js",
"scripts": {
"build:deps": "pnpm --filter @livekit/component-docs-storybook^... build",
"predev": "pnpm build:deps",
"build": "storybook build",
"clean": "rm -rf .turbo && rm -rf node_modules",
"dev": "storybook dev -p 6006",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"gen:docs:watch": "nodemon --watch \"tooling/api-documenter/src/**/*\" --watch \"packages/react/src/**/*\" --ignore \"packages/react/src/assets/**/*\" -e js,jsx,ts,tsx -x \"pnpm gen:docs\"",
"lint": "turbo run lint -- --quiet",
"preinstall": "npx only-allow pnpm",
"shadcn:publish:all": "TURBO_UI=true turbo run shadcn:publish:all --filter=@livekit/agents-ui...",
"ci:publish": "turbo run build --filter=./packages/* && pnpm gen:docs && changeset publish",
"start:next": "turbo run start --filter=@livekit/component-example-next...",
"test": "turbo run test",
Expand Down
54 changes: 50 additions & 4 deletions packages/shadcn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,64 @@ You can find the components in [Storybook](http://localhost:6006) under the `Age

```bash
# Build the shadcn registry
pnpm registry:build
pnpm shadcn:build

# Serve the registry locally (http://localhost:3210)
pnpm registry:serve
pnpm shadcn:serve

# Generate prop documentation
pnpm registry:doc-gen
pnpm shadcn:doc-gen

# Build and deploy to configured destination paths
pnpm registry:update
pnpm shadcn:deploy
```

### Publishing downstream updates

These scripts are maintainer-only release helpers. They require an authenticated `gh`
CLI session with access to the target repositories, push branches to those
repositories, and open GitHub PRs.

```bash
# Sync the registry into livekit-examples/agent-starter-react
pnpm shadcn:publish:agent-starter-react

# Sync the hosted registry, prop docs, and installed @agents-ui components
# in apps/www and apps/docs into livekit/web
pnpm shadcn:publish:livekit-web

# Run both downstream publish scripts
pnpm shadcn:publish:all
```

Each script clones the target repo into a temp directory, makes the change, and prints the
repo, branch, title, body, and a `git diff --stat` summary before asking `Create this PR?
(y/N)`. Pass `-y`/`--yes` to skip that prompt and auto-approve (still prints the summary
first):

```bash
# From packages/shadcn — no -- needed
pnpm shadcn:publish:livekit-web -y

# From the repo root — shadcn:publish:all goes through turbo, which requires
# -- to forward flags to the underlying task
pnpm shadcn:publish:all -- -y
```

#### Dry run

To see the full diff a run would produce — including the confirmation summary — without
ever committing, pushing, or opening a PR, just answer `n` (or let it default) at the
prompt. This still does all the real work (build, clone, install, format), it just stops
before touching anything remote:

```bash
echo "n" | pnpm shadcn:publish:livekit-web
```

The temp clone, local registry server, and any `.env.local` changes are cleaned up
automatically whether you confirm, decline, or `Ctrl-C` out mid-run.

### Environment Variables

Create a `.env.local` file with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

/**
* @license
*
Expand All @@ -10,8 +12,6 @@
* © 2026 UNCRN LLC
*/

'use client';

import React, { useMemo, type ComponentProps } from 'react';
import { type VariantProps, cva } from 'class-variance-authority';
import { type LocalAudioTrack, type RemoteAudioTrack } from 'livekit-client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { cn } from '@/lib/utils';
* Excess values are trimmed from the end; if there are too few, the last
* value is duplicated to fill the remainder. An empty array is padded with 0s.
*/
function normalizeVolumeBands(bands: number[], count: number): number[] {
export function normalizeVolumeBands(bands: number[], count: number): number[] {
if (bands.length === count) return bands;
if (bands.length > count) return bands.slice(0, count);
const lastValue = bands[bands.length - 1] ?? 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, {
useMemo,
} from 'react';
import { type VariantProps, cva } from 'class-variance-authority';
import { LocalAudioTrack, RemoteAudioTrack } from 'livekit-client';
import type { LocalAudioTrack, RemoteAudioTrack } from 'livekit-client';
import {
type AgentState,
type TrackReferenceOrPlaceholder,
Expand All @@ -28,7 +28,7 @@ import { cn } from '@/lib/utils';
* Excess values are trimmed from the end; if there are too few, the last
* value is duplicated to fill the remainder. An empty array is padded with 0s.
*/
function normalizeVolumeBands(bands: number[], count: number): number[] {
export function normalizeVolumeBands(bands: number[], count: number): number[] {
if (bands.length === count) return bands;
if (bands.length > count) return bands.slice(0, count);
const lastValue = bands[bands.length - 1] ?? 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useAgentAudioVisualizerRadialAnimator } from '@/hooks/agents-ui/use-age
* Excess values are trimmed from the end; if there are too few, the last
* value is duplicated to fill the remainder. An empty array is padded with 0s.
*/
function normalizeVolumeBands(bands: number[], count: number): number[] {
export function normalizeVolumeBands(bands: number[], count: number): number[] {
if (bands.length === count) return bands;
if (bands.length > count) return bands.slice(0, count);
const lastValue = bands[bands.length - 1] ?? 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { type AgentState, type TrackReferenceOrPlaceholder } from '@livekit/comp
import { ReactShaderToy } from '@/components/agents-ui/react-shader-toy';
import { useAgentAudioVisualizerWave } from '@/hooks/agents-ui/use-agent-audio-visualizer-wave';
import { cn } from '@/lib/utils';
import { LocalAudioTrack, RemoteAudioTrack } from 'livekit-client';
import type { LocalAudioTrack, RemoteAudioTrack } from 'livekit-client';

const DEFAULT_COLOR = '#1FD5F9';

Expand Down
4 changes: 2 additions & 2 deletions packages/shadcn/components/agents-ui/agent-control-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ export function AgentControlBar({
'bg-destructive/10 dark:bg-destructive/10 text-destructive hover:bg-destructive/20 dark:hover:bg-destructive/20 focus:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/4 rounded-full font-mono text-xs font-bold tracking-wider',
)}
>
<span className="hidden md:inline">End call</span>
<span className="inline md:hidden">End</span>
<span className="hidden md:inline uppercase">End call</span>
<span className="inline md:hidden uppercase">End</span>
</AgentDisconnectButton>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { type ComponentProps } from 'react';
import { Button, buttonVariants } from '@/components/ui/button';
import { Button, type buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { useSessionContext } from '@livekit/components-react';
import { type VariantProps } from 'class-variance-authority';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type SessionProviderProps,
type RoomAudioRendererProps,
} from '@livekit/components-react';
import { Room } from 'livekit-client';
import { type Room } from 'livekit-client';

/**
* Props for the AgentSessionProvider component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { useEffect, useMemo, useState } from 'react';
import { type VariantProps, cva } from 'class-variance-authority';
import { LocalAudioTrack, LocalVideoTrack } from 'livekit-client';
import {
type TrackReferenceOrPlaceholder,
useMaybeRoomContext,
Expand All @@ -17,7 +16,7 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
import { toggleVariants } from '@/components/ui/toggle';
import { type toggleVariants } from '@/components/ui/toggle';
import { cn } from '@/lib/utils';

const selectVariants = cva(
Expand Down
4 changes: 0 additions & 4 deletions packages/shadcn/components/agents-ui/react-shader-toy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ const uniformTypeToGLSLType = (t: string) => {
const LinearFilter = 9729;
const NearestFilter = 9728;
const LinearMipMapLinearFilter = 9987;
const NearestMipMapLinearFilter = 9986;
const LinearMipMapNearestFilter = 9985;
const NearestMipMapNearestFilter = 9984;
const MirroredRepeatWrapping = 33648;
const ClampToEdgeWrapping = 33071;
const RepeatWrapping = 10497;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type ComponentProps } from 'react';
import { useEnsureRoom, useStartAudio } from '@livekit/components-react';
import { Button } from '@/components/ui/button';
import { Room } from 'livekit-client';
import { type Room } from 'livekit-client';

/**
* Props for the StartAudioButton component.
Expand Down
13 changes: 9 additions & 4 deletions packages/shadcn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
"type": "module",
"main": "index.ts",
"scripts": {
"registry:build": "pnpm test && rm -rf dist && shadcn build --output ./dist/r && pnpm registry:doc-gen",
"registry:serve": "python3 -m http.server 3210 -d ./dist",
"registry:doc-gen": "node --experimental-strip-types --env-file=.env.local ./scripts/doc-gen.ts",
"registry:update": "pnpm registry:build && node --experimental-strip-types --env-file=.env.local ./scripts/update.ts",
"build:deps": "pnpm --filter @livekit/agents-ui^... build",
"pretest": "pnpm build:deps",
"shadcn:build": "pnpm test && rm -rf dist && shadcn build --output ./dist/r && pnpm shadcn:doc-gen",
"shadcn:serve": "pnpm shadcn:build && python3 -m http.server 3210 -d ./dist",
"shadcn:doc-gen": "node --experimental-strip-types ./scripts/doc-gen.ts",
"shadcn:deploy": "pnpm shadcn:build && node --experimental-strip-types --env-file=.env.local ./scripts/update.ts",
"shadcn:publish:agent-starter-react": "node --experimental-strip-types ./scripts/publish-agent-starter-react.ts",
"shadcn:publish:livekit-web": "node --experimental-strip-types ./scripts/publish-livekit-web.ts",
"shadcn:publish:all": "node --experimental-strip-types ./scripts/publish-downstream.ts",
"shadcn:update": "pnpm dlx shadcn@latest add alert button button-group select separator sonner toggle tooltip message-scroller message bubble && pnpm format",
"test": "vitest --run",
"test:watch": "vitest",
Expand Down
Loading
Loading