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 content/solid/status-glyph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ There are five kinds of work, and a way of moving for each. The points are alway

A state that lasts minutes is not minutes of one motion: an activity takes several figures in turn, holding each for a few seconds and then turning into the next. `STATUS_FIGURES` lists every figure on its own, and the `figure` prop plays just one.

In a React Server Components project, the default glyph can be rendered from a server page. A `figure` is a function, so choose from `STATUS_FIGURES` or define a custom figure inside a `"use client"` component, then pass it to `StatusGlyph` there. The same applies to the `figure` prop on `TurnStatus`.

<ComponentPreview name="status-glyph-figures" previewClassName="h-96" />

## Inline
Expand Down
2 changes: 2 additions & 0 deletions src/blocks/agent-workspace.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import * as React from "react"
import {
ChevronRightIcon,
Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/ask-card.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import { cn } from "@/lib/utils"

/**
Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/composer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import * as React from "react"
import { ArrowUp, ChevronDown, Square } from "lucide-react"

Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/context-ring.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import * as React from "react"
import { ChevronDown } from "lucide-react"

Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/status-glyph.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import * as React from "react"

import { cn } from "@/lib/utils"
Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/tool-steps.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import * as React from "react"
import { ChevronRight } from "lucide-react"

Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/turn-status.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import * as React from "react"
import { ChevronRight } from "lucide-react"

Expand Down
5 changes: 1 addition & 4 deletions src/site/component-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ function useSource(load: (() => Promise<string>) | undefined) {
return text
}

/** As it would be written in a project: the site's own paths become the ones shadcn installs to. */
const asInstalled = (code: string) => code.replace(/^"use client"\n\n?/, "")

/**
* A component shown live over its code, as on ui.shadcn.com: the preview on top, and under it the
* first lines of the source, fading out, with a button that shows the rest.
Expand All @@ -67,7 +64,7 @@ export function ComponentPreview({
const Example = exampleOf(name)
const source = useSource(sources[`/src/examples/${name}.tsx`])
const [open, setOpen] = React.useState(false)
const code = source ? asInstalled(source) : ""
const code = source ?? ""

return (
<div data-slot="component-preview" className={cn("group relative mt-4 mb-12 flex flex-col overflow-hidden rounded-2xl border", wrapperClassName)}>
Expand Down
Loading