From da7e8673be71f5230b6101bd85c5eaa218f644d0 Mon Sep 17 00:00:00 2001 From: 0xPratik Date: Mon, 19 Oct 2026 16:49:18 +0530 Subject: [PATCH 1/7] docs(stories): label the textarea and select controls --- stories/primitives/select.stories.tsx | 122 +++++++++++++----------- stories/primitives/textarea.stories.tsx | 84 ++++++++++------ 2 files changed, 119 insertions(+), 87 deletions(-) diff --git a/stories/primitives/select.stories.tsx b/stories/primitives/select.stories.tsx index 155cbd59..b021deb6 100644 --- a/stories/primitives/select.stories.tsx +++ b/stories/primitives/select.stories.tsx @@ -1,3 +1,4 @@ +import type * as React from "react"; import { useState } from "react"; import { Select } from "../../src/ui/select.js"; @@ -10,58 +11,67 @@ const options = [ { value: "haiku", label: "Haiku" }, ]; +const optionElements = options.map((option) => ( + +)); + +function Field({ children }: { readonly children: React.ReactNode }) { + return ( + + ); +} + export const Default = () => { const [value, setValue] = useState("sonnet"); return ( - + + + ); }; export const Focus = () => ( - + + + ); export const Disabled = () => ( - + + + ); export const Invalid = () => ( - + + + ); export const DisabledWithDescription = () => (
- + + +

Model selection is locked for this workspace.

@@ -70,17 +80,15 @@ export const DisabledWithDescription = () => ( export const InvalidWithDescription = () => (
- + + +

Choose a model available on your plan.

@@ -89,18 +97,16 @@ export const InvalidWithDescription = () => ( export const DisabledInvalid = () => (
- + + +

Choose a model available on your plan.

diff --git a/stories/primitives/textarea.stories.tsx b/stories/primitives/textarea.stories.tsx index 1577f0ba..44828153 100644 --- a/stories/primitives/textarea.stories.tsx +++ b/stories/primitives/textarea.stories.tsx @@ -1,39 +1,59 @@ +import type * as React from "react"; import { useState } from "react"; import { Textarea } from "../../src/ui/textarea.js"; export default { title: "Primitives / Textarea" }; +function Field({ children }: { readonly children: React.ReactNode }) { + return ( + + ); +} + export const Default = () => { const [value, setValue] = useState(""); return ( -