{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "schema-form",
  "title": "Schema form",
  "author": "superzero11 <https://github.com/superzero11/uiset>",
  "description": "A form from one definition: its fields with UISet's controls, steps with a review, checks as people type and on submit, and an agent that fills it by field name while a person approves the submit. The same definition is JSON Schema for an agent tool.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.5",
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://uiset.dev/r/uiset.json",
    "https://uiset.dev/r/button.json",
    "https://uiset.dev/r/checkbox.json",
    "https://uiset.dev/r/date-input.json",
    "https://uiset.dev/r/field.json",
    "https://uiset.dev/r/number-input.json",
    "https://uiset.dev/r/radio.json",
    "https://uiset.dev/r/select.json",
    "https://uiset.dev/r/stepper.json",
    "https://uiset.dev/r/switch.json",
    "https://uiset.dev/r/textarea.json"
  ],
  "files": [
    {
      "path": "registry/uiset/ui/schema-form.tsx",
      "content": "\"use client\"\n\nimport type { StateOf } from \"@ui-sdk/core\"\nimport { usePart, usePrimitive, type PartProps } from \"@ui-sdk/react/primitive\"\nimport { useEffect, useId, useLayoutEffect, useRef, type ReactNode } from \"react\"\nimport { Button } from \"./button\"\nimport { Checkbox } from \"./checkbox\"\nimport { DateInput } from \"./date-input\"\nimport { Field, FieldDescription, FieldError, FieldLabel, Input } from \"./field\"\nimport { NumberInput, NumberInputControl, NumberInputDecrement, NumberInputGroup, NumberInputIncrement } from \"./number-input\"\nimport { Radio, RadioGroup } from \"./radio\"\nimport { Select, SelectContent, SelectItem, SelectTrigger } from \"./select\"\nimport { Stepper } from \"./stepper\"\nimport { Switch } from \"./switch\"\nimport { Textarea } from \"./textarea\"\nimport { schemaForm, type SchemaFormStepReason, type SchemaFormValueReason, type SubmitDetails } from \"./schema-form/form\"\nimport type { Fields, FieldSpec, FormDefinition, FormErrors, FormValues } from \"./schema-form/schema\"\nimport { autocompleteFor, controlIn, defaultLabels, shownValue, type SchemaFormLabels } from \"./schema-form/labels\"\nimport type { ChangeDetails } from \"@ui-sdk/core\"\nimport \"./shell/shell.css\"\nimport \"./schema-form/schema-form.css\"\n\ntype RootState = StateOf<typeof schemaForm, \"root\">\ntype Api = ReturnType<typeof usePrimitive<typeof schemaForm>>[\"api\"]\n\ntype SchemaFormProps<F extends Fields> = Omit<PartProps<\"form\", RootState>, \"children\" | \"defaultValue\" | \"onSubmit\" | \"title\"> & {\n  /** What `defineForm` returns: the fields, their rules, and the steps. */\n  form: FormDefinition<F>\n  value?: FormValues<F>\n  defaultValue?: Partial<FormValues<F>>\n  onValueChange?: (value: FormValues<F>, details: ChangeDetails<SchemaFormValueReason>) => void\n  step?: number\n  defaultStep?: number\n  onStepChange?: (step: number, details: ChangeDetails<SchemaFormStepReason>) => void\n  /** Sends the values once they pass. Return problems by field, or under `form`, to show them. */\n  onSubmit?: (value: FormValues<F>, details: SubmitDetails) => void | FormErrors | Promise<void | FormErrors>\n  disabled?: boolean\n  /**\n   * What the submit does, as a sentence a person approves when an agent presses it, like\n   * \"Sends the invite to the address given\". An agent fills the form; a person sends it.\n   * `false` lets an agent send it on its own.\n   */\n  confirm?: string | false\n  /** Said, and shown under the form, once it's sent. */\n  doneMessage?: string\n  /** The title's heading level, or `false` to leave the title to your page (then give `aria-label`). */\n  heading?: 2 | 3 | 4 | false\n  labels?: Partial<SchemaFormLabels>\n  locale?: string\n}\n\n/** One field: its label, its control, its description and its problem, connected by Field. */\nfunction FormField({ name, field, value, error, api, disabled, labels }: { name: string; field: FieldSpec; value: unknown; error?: string; api: Api; disabled: boolean; labels: SchemaFormLabels }) {\n  const set = (next: unknown) => api.setField(name, next)\n  const leave = () => api.leaveField(name)\n  const required = field.required || undefined\n  const description = field.description && <FieldDescription>{field.description}</FieldDescription>\n  const problem = error && <FieldError match>{error}</FieldError>\n  const common = { disabled, \"aria-required\": required, onBlur: leave }\n  let control: ReactNode\n  switch (field.kind) {\n    case \"textarea\":\n      control = <Textarea {...common} value={value as string} placeholder={field.placeholder} onValueChange={(next) => set(next)} />\n      break\n    case \"number\":\n      control = (\n        <NumberInput {...common} value={value as number | null} min={field.min} max={field.max} step={field.step} onValueChange={(next) => set(next)}>\n          <NumberInputGroup>\n            <NumberInputDecrement aria-label={labels.decrease} />\n            <NumberInputControl />\n            <NumberInputIncrement aria-label={labels.increase} />\n          </NumberInputGroup>\n        </NumberInput>\n      )\n      break\n    case \"date\":\n      control = <DateInput {...common} value={(value as string) || null} min={field.min} max={field.max} onValueChange={(next) => set(next ?? \"\")} />\n      break\n    case \"choice\":\n      control =\n        field.display === \"radio\" ? (\n          <RadioGroup {...common} value={value as string | null} onValueChange={(next) => set(next)} className=\"schema-form-options\">\n            {field.options.map((option) => (\n              <label key={option.value}>\n                <Radio value={option.value} />\n                {option.label}\n              </label>\n            ))}\n          </RadioGroup>\n        ) : (\n          <Select disabled={disabled} value={value as string | null} onValueChange={(next) => set(next)} onOpenChange={(open) => !open && leave()}>\n            <SelectTrigger aria-required={required} />\n            <SelectContent>\n              {field.options.map((option) => (\n                <SelectItem key={option.value} value={option.value}>\n                  {option.label}\n                </SelectItem>\n              ))}\n            </SelectContent>\n          </Select>\n        )\n      break\n    case \"boolean\": {\n      const Toggle = field.display === \"switch\" ? Switch : Checkbox\n      return (\n        <Field name={name} invalid={error ? true : undefined} className=\"schema-form-field\" data-schema-field={name}>\n          <div className=\"schema-form-toggle\">\n            <Toggle disabled={disabled} aria-required={required} checked={value === true} onCheckedChange={(next: unknown) => set(next === true)} />\n            <FieldLabel>{field.label}</FieldLabel>\n          </div>\n          {description}\n          {problem}\n        </Field>\n      )\n    }\n    default:\n      control = (\n        <Input\n          {...common}\n          type={field.kind === \"text\" ? \"text\" : field.kind}\n          value={value as string}\n          placeholder={field.placeholder}\n          autoComplete={autocompleteFor(field.kind)}\n          onValueChange={(next) => set(next)}\n        />\n      )\n  }\n  return (\n    <Field name={name} invalid={error ? true : undefined} className=\"schema-form-field\" data-schema-field={name}>\n      <FieldLabel>{field.label}</FieldLabel>\n      {control}\n      {description}\n      {problem}\n    </Field>\n  )\n}\n\nfunction FormBody({\n  state,\n  api,\n  titleId,\n  heading,\n  labels,\n  confirm,\n  locale,\n  doneMessage,\n}: {\n  state: RootState\n  api: Api\n  titleId: string\n  heading: 2 | 3 | 4 | false\n  labels: SchemaFormLabels\n  confirm: string | false\n  locale?: string\n  doneMessage?: string\n}) {\n  const { form, value, errors, step, status, disabled } = state\n  const body = useRef<HTMLDivElement>(null)\n  const steps = form.steps\n  const review = steps ? step >= steps.length : false\n  const names = steps ? (steps[step]?.fields ?? []) : form.names\n\n  // After a submit or Next finds problems, the first one takes focus once it's drawn.\n  useEffect(() => {\n    if (!state.focus) return\n    controlIn(body.current?.closest(\"form\")?.querySelector(`[data-schema-field=\"${CSS.escape(state.focus)}\"]`))?.focus()\n    api.focused()\n  }, [state.focus, api])\n\n  // What had focus may go with its step (a field on Enter, Back on the first step, an Edit on\n  // the review): focus goes on to the new step's first field, or to the send on the review,\n  // once the new step's controls are bound (a radio group picks its tab stop then). A blur\n  // with nowhere to go is settled after the draw that caused it.\n  const focusInside = useRef(false)\n  useLayoutEffect(() => {\n    const root = body.current\n    if (!root || !focusInside.current || state.focus || root.contains(document.activeElement)) return\n    queueMicrotask(() => {\n      if (root.contains(document.activeElement)) return\n      ;(review ? root.querySelector<HTMLElement>(\".schema-form-actions [type=submit]\") : controlIn(root.querySelector(\".schema-form-fields\")))?.focus()\n    })\n    // Only a step change takes the focused element out.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [step])\n\n  const Heading = heading ? (`h${heading}` as const) : null\n  const sending = status === \"submitting\"\n  return (\n    <div\n      ref={body}\n      className=\"schema-form-body\"\n      onFocus={() => (focusInside.current = true)}\n      onBlur={() => queueMicrotask(() => (focusInside.current = !!body.current?.contains(document.activeElement)))}\n    >\n      {(Heading || form.description) && (\n        <div className=\"schema-form-head\">\n          {Heading && <Heading id={titleId}>{form.title}</Heading>}\n          {form.description && <p>{form.description}</p>}\n        </div>\n      )}\n      {steps && (\n        <Stepper\n          label={labels.steps}\n          steps={[...steps.map((s, index) => ({ value: String(index), label: s.title, description: s.description })), { value: String(steps.length), label: labels.review }]}\n          value={String(step)}\n          onValueChange={(next) => api.goTo(Number(next))}\n        />\n      )}\n      {review ? (\n        <div className=\"schema-form-review\">\n          {steps!.map((s, index) => (\n            <section key={s.title} className=\"schema-form-review-step\" aria-labelledby={`${titleId}-review-${index}`}>\n              <header>\n                <h3 id={`${titleId}-review-${index}`}>{s.title}</h3>\n                <Button type=\"button\" variant=\"ghost\" onClick={(event) => api.goTo(index, event.nativeEvent)}>\n                  {labels.edit(s.title)}\n                </Button>\n              </header>\n              <dl>\n                {s.fields.map((name) => (\n                  <div key={name} className=\"schema-form-review-row\">\n                    <dt>{form.fields[name]!.label}</dt>\n                    <dd>{shownValue(form.fields[name]!, value[name], labels, locale)}</dd>\n                  </div>\n                ))}\n              </dl>\n            </section>\n          ))}\n        </div>\n      ) : (\n        <div className=\"schema-form-fields\">\n          {names.map((name) => (\n            <FormField key={name} name={name} field={form.fields[name]!} value={value[name]} error={errors[name]} api={api} disabled={disabled} labels={labels} />\n          ))}\n        </div>\n      )}\n      {errors.form && (\n        <p className=\"schema-form-problem\" role=\"alert\">\n          {errors.form}\n        </p>\n      )}\n      {status === \"done\" && doneMessage && <p className=\"schema-form-done\">{doneMessage}</p>}\n      <div className=\"schema-form-actions\">\n        {steps && step > 0 && (\n          <Button type=\"button\" variant=\"outline\" onClick={(event) => api.back(event.nativeEvent)}>\n            {labels.back}\n          </Button>\n        )}\n        {/* On a step, Next is the form's submit, so Enter in any field goes on too; the form's\n            submit goes to the next step until the review. Keyed apart from the send: one\n            button that changed into the other during its own click would send the form. */}\n        {steps && !review ? (\n          <Button key=\"next\" type=\"submit\">\n            {labels.next}\n          </Button>\n        ) : (\n          <Button key=\"submit\" type=\"submit\" aria-disabled={sending || disabled || undefined} data-agent-confirm={confirm || undefined}>\n            {sending ? labels.submitting : labels.submit}\n          </Button>\n        )}\n      </div>\n    </div>\n  )\n}\n\n/**\n * A form drawn from one definition: its fields with UISet's controls, its steps and a review,\n * checked as people type and on submit. An agent fills it by field name or label with `fill`,\n * and a person approves the submit (`confirm`). `formTool` makes the same definition a tool.\n */\nfunction SchemaForm<F extends Fields>({\n  form,\n  value,\n  defaultValue,\n  onValueChange,\n  step,\n  defaultStep,\n  onStepChange,\n  onSubmit,\n  disabled,\n  confirm,\n  doneMessage,\n  heading = 2,\n  labels: given,\n  locale,\n  className,\n  ...props\n}: SchemaFormProps<F>) {\n  const titleId = useId()\n  const labels = { ...defaultLabels, ...given }\n  const handle = usePrimitive(schemaForm, {\n    form: form as FormDefinition,\n    value: value as Record<string, unknown> | undefined,\n    defaultValue: defaultValue && { ...(defaultValue as Record<string, unknown>) },\n    onValueChange: onValueChange as ((value: Record<string, unknown>, details: ChangeDetails<SchemaFormValueReason>) => void) | undefined,\n    step,\n    defaultStep,\n    onStepChange,\n    onSubmit: onSubmit as ((value: Record<string, unknown>, details: SubmitDetails) => void | FormErrors | Promise<void | FormErrors>) | undefined,\n    disabled,\n    doneMessage,\n  })\n  return usePart(\n    handle,\n    \"root\",\n    {},\n    {\n      \"aria-labelledby\": heading ? titleId : undefined,\n      // The form checks its own fields, so the browser's bubbles stay out of the way.\n      noValidate: true,\n      // Before hydration a native submit (Enter, or Next) would load the page with what was\n      // typed in its URL. Outside an open dialog, a dialog form's submit does nothing.\n      method: \"dialog\",\n      ...props,\n      className: [\"schema-form\", className].filter(Boolean).join(\" \"),\n      children: (state: RootState) => (\n        <FormBody\n          state={state}\n          api={handle.api}\n          titleId={titleId}\n          heading={heading}\n          labels={labels}\n          confirm={confirm === undefined ? form.title : confirm}\n          locale={locale}\n          doneMessage={doneMessage}\n        />\n      ),\n    },\n    \"form\",\n  )\n}\n\nexport { SchemaForm }\nexport { defineForm, toJSONSchema, validateForm } from \"./schema-form/schema\"\nexport { formTool, registerFormTool } from \"./schema-form/tool\"\nexport type { FormTool, FormToolOptions, FormToolResult } from \"./schema-form/tool\"\nexport type { SchemaFormLabels, SchemaFormProps }\nexport type { FieldSpec, FormDefinition, FormErrors, FormValues, StandardSchemaV1 } from \"./schema-form/schema\"\n",
      "type": "registry:ui",
      "target": "@ui/schema-form.tsx"
    },
    {
      "path": "registry/uiset/ui/schema-form/schema.ts",
      "content": "// A form described once. Its fields render the form, check what's entered, and become the\n// JSON Schema of an agent tool that fills it. No framework here, so every renderer shares it.\n\ntype FieldOption = { value: string; label: string }\n\n/** What's wrong with a value, or nothing when it can be saved. Gets every value, for rules across fields. */\ntype FieldCheck<Value> = (value: Value, values: Record<string, unknown>) => string | null | undefined | void\n\ntype FieldBase = {\n  label: string\n  /** A line under the label, like a format or a reason. */\n  description?: string\n  required?: boolean\n  placeholder?: string\n}\n\ntype TextField = FieldBase & {\n  kind: \"text\" | \"email\" | \"url\" | \"tel\" | \"textarea\"\n  /** The fewest and most characters. */\n  min?: number\n  max?: number\n  /** A regular expression the whole text matches, with `patternMessage` saying what's expected. */\n  pattern?: string\n  patternMessage?: string\n  default?: string\n  validate?: FieldCheck<string>\n}\n\ntype NumberField = FieldBase & {\n  kind: \"number\"\n  min?: number\n  max?: number\n  /** 1 for whole numbers. */\n  step?: number\n  default?: number | null\n  validate?: FieldCheck<number | null>\n}\n\ntype ChoiceField = FieldBase & {\n  kind: \"choice\"\n  options: readonly FieldOption[]\n  /** A select (the default), or radio buttons for a few options seen at once. */\n  display?: \"select\" | \"radio\"\n  default?: string | null\n  validate?: FieldCheck<string | null>\n}\n\ntype BooleanField = FieldBase & {\n  kind: \"boolean\"\n  /** A checkbox (the default) or a switch. With `required`, it must be on, like accepting terms. */\n  display?: \"checkbox\" | \"switch\"\n  default?: boolean\n  validate?: FieldCheck<boolean>\n}\n\ntype DateField = FieldBase & {\n  kind: \"date\"\n  /** ISO dates, like \"2026-11-20\". */\n  min?: string\n  max?: string\n  default?: string\n  validate?: FieldCheck<string>\n}\n\ntype FieldSpec = TextField | NumberField | ChoiceField | BooleanField | DateField\ntype Fields = Record<string, FieldSpec>\n\ntype ValueOf<F> = F extends { kind: \"number\" }\n  ? number | null\n  : F extends { kind: \"boolean\" }\n    ? boolean\n    : F extends { kind: \"choice\"; options: readonly { value: infer V extends string }[] }\n      ? V | null\n      : string\n\n/** The values a form holds, by field name, typed from its fields. */\ntype FormValues<F extends Fields> = { -readonly [K in keyof F]: ValueOf<F[K]> }\n/** Problems by field name; a problem with the whole form is under `form`. */\ntype FormErrors = Partial<Record<string, string>>\n\ntype FormStep<F extends Fields> = { title: string; description?: string; fields: readonly (keyof F & string)[] }\n\n/** A Standard Schema (zod, valibot, arktype and others implement it), for rules across fields. */\ntype StandardSchemaV1 = {\n  readonly \"~standard\": {\n    readonly version: 1\n    readonly vendor: string\n    readonly validate: (value: unknown) => StandardResult | Promise<StandardResult>\n  }\n}\ntype StandardResult =\n  | { readonly value: unknown; readonly issues?: undefined }\n  | { readonly issues: readonly { readonly message: string; readonly path?: readonly (PropertyKey | { readonly key: PropertyKey })[] }[] }\n\ntype FormMessages = {\n  required: (label: string) => string\n  tooShort: (label: string, min: number) => string\n  tooLong: (label: string, max: number) => string\n  pattern: (label: string) => string\n  email: string\n  url: string\n  number: string\n  wholeNumber: string\n  tooLow: (label: string, min: number) => string\n  tooHigh: (label: string, max: number) => string\n  choice: (options: string[]) => string\n  date: string\n  tooEarly: (label: string, min: string) => string\n  tooLate: (label: string, max: string) => string\n  boolean: string\n  unknownField: (key: string, fields: string[]) => string\n}\n\nconst defaultMessages: FormMessages = {\n  required: (label) => `${label} is required.`,\n  tooShort: (label, min) => `${label} needs at least ${min} characters.`,\n  tooLong: (label, max) => `${label} takes at most ${max} characters.`,\n  pattern: (label) => `${label} isn't in the expected format.`,\n  email: \"Enter an email address, like name@example.com.\",\n  url: \"Enter a web address, like https://example.com.\",\n  number: \"Enter a number.\",\n  wholeNumber: \"Enter a whole number.\",\n  tooLow: (label, min) => `${label} is at least ${min}.`,\n  tooHigh: (label, max) => `${label} is at most ${max}.`,\n  choice: (options) => `Choose one of: ${options.join(\", \")}.`,\n  date: \"Enter a date like 2026-11-20.\",\n  tooEarly: (label, min) => `${label} is on or after ${min}.`,\n  tooLate: (label, max) => `${label} is on or before ${max}.`,\n  boolean: \"Use true or false.\",\n  unknownField: (key, fields) => `No field \"${key}\". Its fields: ${fields.join(\", \")}.`,\n}\n\ntype FormSpec<F extends Fields> = {\n  /** The agent tool's name: lowercase letters, digits and underscores, like \"invite_teammate\". */\n  name: string\n  /** What the form does, like \"Invite a teammate\". It names the form and starts the tool's description. */\n  title: string\n  description?: string\n  fields: F\n  /** Steps of a longer form, each with some of the fields in order, then a review. Every field is in one step. */\n  steps?: readonly FormStep<F>[]\n  /** Rules across fields, checked on submit after each field's own. */\n  schema?: StandardSchemaV1\n  messages?: Partial<FormMessages>\n}\n\n/** A described form. Its steps name fields as plain text here; `defineForm` checked them. */\ntype FormDefinition<F extends Fields = Fields> = Readonly<Omit<FormSpec<F>, \"steps\">> & {\n  readonly steps?: readonly { readonly title: string; readonly description?: string; readonly fields: readonly string[] }[]\n  readonly names: readonly (keyof F & string)[]\n  readonly words: FormMessages\n}\n\n/**\n * Describes a form. The values' type comes from the fields: `FormValues<typeof form.fields>`.\n * @example\n * const invite = defineForm({\n *   name: \"invite_teammate\",\n *   title: \"Invite a teammate\",\n *   fields: {\n *     email: { kind: \"email\", label: \"Email\", required: true },\n *     role: { kind: \"choice\", label: \"Role\", options: [{ value: \"viewer\", label: \"Viewer\" }, { value: \"admin\", label: \"Admin\" }] },\n *   },\n * })\n */\nfunction defineForm<const F extends Fields>(spec: FormSpec<F>): FormDefinition<F> {\n  if (!/^[a-z][a-z0-9_]*$/.test(spec.name)) throw new Error(`defineForm: \"${spec.name}\" isn't a tool name. Use lowercase letters, digits and underscores.`)\n  const names = Object.keys(spec.fields) as (keyof F & string)[]\n  if (spec.steps) {\n    const seen = new Set<string>()\n    for (const step of spec.steps) {\n      for (const field of step.fields) {\n        if (!(field in spec.fields)) throw new Error(`defineForm: step \"${step.title}\" names no field \"${field}\".`)\n        if (seen.has(field)) throw new Error(`defineForm: \"${field}\" is in two steps.`)\n        seen.add(field)\n      }\n    }\n    const left = names.filter((name) => !seen.has(name))\n    if (left.length) throw new Error(`defineForm: ${left.join(\", \")} ${left.length === 1 ? \"is\" : \"are\"} in no step.`)\n  }\n  return { ...spec, names, words: { ...defaultMessages, ...spec.messages } }\n}\n\n/** Each field's default: its `default`, or empty. */\nfunction initialValues<F extends Fields>(form: FormDefinition<F>): FormValues<F> {\n  const values: Record<string, unknown> = {}\n  for (const name of form.names) {\n    const field = form.fields[name]!\n    values[name] =\n      field.kind === \"number\" ? (field.default ?? null) : field.kind === \"boolean\" ? (field.default ?? false) : field.kind === \"choice\" ? (field.default ?? null) : (field.default ?? \"\")\n  }\n  return values as FormValues<F>\n}\n\nconst isEmpty = (value: unknown) => value === null || value === undefined || value === \"\" || value === false\nconst isoDate = /^\\d{4}-\\d{2}-\\d{2}$/\nconst realDate = (text: string) => isoDate.test(text) && !Number.isNaN(Date.parse(`${text}T00:00:00Z`)) && new Date(`${text}T00:00:00Z`).toISOString().startsWith(text)\n\n/** What's wrong with one field's value, from its own rules, or null. */\nfunction checkField(form: FormDefinition, name: string, value: unknown, values: Record<string, unknown>): string | null {\n  const field = form.fields[name]\n  if (!field) return null\n  const words = form.words\n  if (isEmpty(value)) return field.required ? words.required(field.label) : null\n  const own = () => (field.validate ? ((field.validate as FieldCheck<unknown>)(value, values) ?? null) : null) || null\n  switch (field.kind) {\n    case \"text\":\n    case \"email\":\n    case \"url\":\n    case \"tel\":\n    case \"textarea\": {\n      const text = String(value)\n      if (field.min !== undefined && text.length < field.min) return words.tooShort(field.label, field.min)\n      if (field.max !== undefined && text.length > field.max) return words.tooLong(field.label, field.max)\n      if (field.kind === \"email\" && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(text)) return words.email\n      if (field.kind === \"url\" && !URL.canParse(text)) return words.url\n      if (field.pattern && !new RegExp(`^(?:${field.pattern})$`, \"u\").test(text)) return field.patternMessage ?? words.pattern(field.label)\n      return own()\n    }\n    case \"number\": {\n      if (typeof value !== \"number\" || Number.isNaN(value)) return words.number\n      if (field.step === 1 && !Number.isInteger(value)) return words.wholeNumber\n      if (field.min !== undefined && value < field.min) return words.tooLow(field.label, field.min)\n      if (field.max !== undefined && value > field.max) return words.tooHigh(field.label, field.max)\n      return own()\n    }\n    case \"choice\":\n      if (!field.options.some((option) => option.value === value)) return words.choice(field.options.map((option) => option.label))\n      return own()\n    case \"boolean\":\n      return own()\n    case \"date\": {\n      const text = String(value)\n      if (!realDate(text)) return words.date\n      if (field.min && text < field.min) return words.tooEarly(field.label, field.min)\n      if (field.max && text > field.max) return words.tooLate(field.label, field.max)\n      return own()\n    }\n  }\n}\n\n/** Each named field's problems (every field without `names`), from the fields' own rules. */\nfunction checkFields(form: FormDefinition, values: Record<string, unknown>, names: readonly string[] = form.names): FormErrors {\n  const errors: FormErrors = {}\n  for (const name of names) {\n    const problem = checkField(form, name, values[name], values)\n    if (problem) errors[name] = problem\n  }\n  return errors\n}\n\n/** Every problem: the fields' own rules, then the form's `schema` once those pass. */\nasync function validateForm(form: FormDefinition, values: Record<string, unknown>): Promise<FormErrors> {\n  const errors = checkFields(form, values)\n  if (Object.keys(errors).length || !form.schema) return errors\n  const result = await form.schema[\"~standard\"].validate(values)\n  for (const issue of result.issues ?? []) {\n    const first = issue.path?.[0]\n    const key = typeof first === \"object\" && first !== null ? first.key : first\n    const name = typeof key === \"string\" && key in form.fields ? key : \"form\"\n    errors[name] ??= issue.message\n  }\n  return errors\n}\n\n/** The field a key names: its name, or its label, regardless of case. */\nfunction fieldFor(form: FormDefinition, key: string): string | undefined {\n  if (key in form.fields) return key\n  const wanted = key.trim().toLowerCase()\n  return form.names.find((name) => name.toLowerCase() === wanted) ?? form.names.find((name) => form.fields[name]!.label.toLowerCase() === wanted)\n}\n\n/**\n * A value an agent or a script gives, as the field holds it: a number from \"12\", a choice by\n * its value or its label, a date from a Date or a timestamp. Says what's wrong when it can't.\n */\nfunction coerceValue(form: FormDefinition, name: string, input: unknown): { value: unknown } | { error: string } {\n  const field = form.fields[name]!\n  const words = form.words\n  if (input === null || input === undefined || input === \"\") {\n    return { value: field.kind === \"number\" || field.kind === \"choice\" ? null : field.kind === \"boolean\" ? false : \"\" }\n  }\n  switch (field.kind) {\n    case \"number\": {\n      const value = typeof input === \"number\" ? input : typeof input === \"string\" && input.trim() !== \"\" ? Number(input) : Number.NaN\n      return Number.isNaN(value) ? { error: words.number } : { value }\n    }\n    case \"boolean\": {\n      if (typeof input === \"boolean\") return { value: input }\n      const text = String(input).trim().toLowerCase()\n      if ([\"true\", \"yes\", \"on\", \"1\"].includes(text)) return { value: true }\n      if ([\"false\", \"no\", \"off\", \"0\"].includes(text)) return { value: false }\n      return { error: words.boolean }\n    }\n    case \"choice\": {\n      const text = String(input).trim()\n      const option =\n        field.options.find((o) => o.value === text) ??\n        field.options.find((o) => o.value.toLowerCase() === text.toLowerCase()) ??\n        field.options.find((o) => o.label.toLowerCase() === text.toLowerCase())\n      return option ? { value: option.value } : { error: words.choice(field.options.map((o) => o.label)) }\n    }\n    case \"date\": {\n      const text = input instanceof Date ? input.toISOString().slice(0, 10) : String(input).trim().slice(0, 10)\n      return realDate(text) ? { value: text } : { error: words.date }\n    }\n    default:\n      return { value: typeof input === \"string\" ? input : String(input) }\n  }\n}\n\ntype JSONSchema = Record<string, unknown>\n\n/** The form's fields as JSON Schema: an agent tool's input, the shape model APIs and WebMCP take. */\nfunction toJSONSchema(form: FormDefinition): JSONSchema {\n  const properties: Record<string, JSONSchema> = {}\n  const required: string[] = []\n  for (const name of form.names) {\n    const field = form.fields[name]!\n    const notes = [field.description].filter(Boolean) as string[]\n    let property: JSONSchema\n    switch (field.kind) {\n      case \"number\":\n        property = { type: field.step === 1 ? \"integer\" : \"number\", minimum: field.min, maximum: field.max, multipleOf: field.step === 1 ? undefined : field.step }\n        break\n      case \"boolean\":\n        property = { type: \"boolean\" }\n        if (field.required) notes.push(\"Must be true.\")\n        break\n      case \"choice\":\n        property = { type: \"string\", enum: field.options.map((o) => o.value) }\n        notes.push(`One of: ${field.options.map((o) => (o.label === o.value ? o.value : `${o.value} (${o.label})`)).join(\", \")}.`)\n        break\n      case \"date\":\n        property = { type: \"string\", format: \"date\", formatMinimum: field.min, formatMaximum: field.max }\n        break\n      default:\n        property = {\n          type: \"string\",\n          format: field.kind === \"email\" ? \"email\" : field.kind === \"url\" ? \"uri\" : undefined,\n          minLength: field.min,\n          maxLength: field.max,\n          pattern: field.pattern ? `^(?:${field.pattern})$` : undefined,\n        }\n    }\n    property = Object.fromEntries(Object.entries({ title: field.label, ...property, description: notes.join(\" \") || undefined }).filter(([, v]) => v !== undefined))\n    properties[name] = property\n    if (field.required) required.push(name)\n  }\n  return { type: \"object\", properties, required, additionalProperties: false }\n}\n\nexport { checkField, checkFields, coerceValue, defaultMessages, defineForm, fieldFor, initialValues, toJSONSchema, validateForm }\nexport type {\n  BooleanField,\n  ChoiceField,\n  DateField,\n  FieldOption,\n  FieldSpec,\n  Fields,\n  FormDefinition,\n  FormErrors,\n  FormMessages,\n  FormSpec,\n  FormStep,\n  FormValues,\n  JSONSchema,\n  NumberField,\n  StandardSchemaV1,\n  TextField,\n}\n",
      "type": "registry:file",
      "target": "@ui/schema-form/schema.ts"
    },
    {
      "path": "registry/uiset/ui/schema-form/form.ts",
      "content": "import { announce, createChange, definePrimitive, type ChangeDetails } from \"@ui-sdk/core\"\nimport { checkField, checkFields, coerceValue, defineForm, fieldFor, initialValues, validateForm, type FormDefinition, type FormErrors } from \"./schema\"\n\ntype Values = Record<string, unknown>\ntype SchemaFormValueReason = \"input\" | \"fill\" | \"reset\" | \"imperative\"\ntype SchemaFormStepReason = \"next\" | \"back\" | \"step-press\" | \"imperative\"\n/** Who sent the form: a person's submit, or a press an agent made. */\ntype SubmitDetails = { event?: Event }\ntype SubmitResult = void | FormErrors | Promise<void | FormErrors>\n\ntype SchemaFormOptions = {\n  form: FormDefinition\n  value?: Values\n  defaultValue?: Values\n  onValueChange?: (value: Values, details: ChangeDetails<SchemaFormValueReason>) => void\n  /** The step showing, from 0; the review is the step after the last. */\n  step?: number\n  defaultStep?: number\n  onStepChange?: (step: number, details: ChangeDetails<SchemaFormStepReason>) => void\n  /** Sends the values once they pass. Return problems by field, or under `form`, to show them. */\n  onSubmit?: (value: Values, details: SubmitDetails) => SubmitResult\n  disabled?: boolean\n  /** Said once the form is sent. */\n  doneMessage?: string\n}\n\nconst labelOf = (form: FormDefinition, name: string) => form.fields[name]?.label ?? name\n/** \"Seats is at least 1.\" stands alone; \"Enter a number.\" gets its field's name in front. */\nconst said = (form: FormDefinition, name: string, problem: string) => {\n  const label = labelOf(form, name)\n  return problem.startsWith(label) ? problem : `${label}: ${problem}`\n}\n/** What a form shows before it's given a definition, as an element is before a page sets `form`. */\nconst noForm: FormDefinition = defineForm({ name: \"form\", title: \"\", fields: {} })\nconst sameValues = (a: Values, b: Values) => Object.keys(a).length === Object.keys(b).length && Object.keys(a).every((key) => Object.is(a[key], b[key]))\n\nconst stepOf = (form: FormDefinition, name: string) => form.steps?.findIndex((step) => step.fields.includes(name)) ?? -1\n\n/** @internal Left out of @uiset/web's declarations: its type names UI SDK internals. */\nconst schemaForm = definePrimitive({\n  name: \"schema-form\",\n  options: {\n    form: \"value\",\n    value: \"value\",\n    defaultValue: \"value\",\n    onValueChange: \"callback\",\n    step: \"number\",\n    defaultStep: \"number\",\n    onStepChange: \"callback\",\n    onSubmit: \"action\",\n    disabled: \"boolean\",\n    doneMessage: \"string\",\n  },\n  controlled: [\"value\", \"step\"],\n  state: (options: SchemaFormOptions) => ({\n    form: options.form ?? noForm,\n    // A partial default fills the rest from each field's own default.\n    value: options.value ?? { ...(initialValues(options.form ?? noForm) as Values), ...options.defaultValue },\n    step: options.step ?? options.defaultStep ?? 0,\n    errors: {} as FormErrors,\n    status: \"idle\" as \"idle\" | \"submitting\" | \"done\",\n    /** A field to take focus once it's drawn: the first problem after a submit or Next. */\n    focus: null as string | null,\n    disabled: options.disabled ?? false,\n  }),\n  sync: (options) => ({\n    form: options.form ?? noForm,\n    ...(options.value === undefined ? {} : { value: options.value }),\n    ...(options.step === undefined ? {} : { step: options.step }),\n    disabled: options.disabled ?? false,\n  }),\n  api: (context) => {\n    const change = createChange(context)\n    const { store } = context\n    const form = () => store.get().form\n    const values = () => store.get().value\n    const lastStep = () => form().steps?.length ?? 0\n\n    /** Shows these problems in place of the named fields' old ones. */\n    const show = (names: readonly string[], found: FormErrors, focus: boolean) => {\n      const errors: FormErrors = { ...store.get().errors }\n      for (const name of names) delete errors[name]\n      Object.assign(errors, found)\n      const first = form().names.find((name) => found[name]) ?? null\n      store.set({ errors, focus: focus ? first : store.get().focus })\n      return first\n    }\n\n    // A definition given later (an element's `form`, set after it's on the page), or another\n    // one: the fields it adds start at their defaults, and values it keeps stay.\n    context.onOptions((options) => {\n      const next = options.form ?? noForm\n      const state = store.get()\n      if (next === state.form || options.value !== undefined) return\n      const kept = Object.fromEntries(Object.entries(state.value).filter(([name]) => name in next.fields))\n      store.set({ value: { ...(initialValues(next) as Values), ...options.defaultValue, ...kept } })\n    })\n\n    const setStep = (step: number, reason: SchemaFormStepReason, event?: Event) => change(\"step\", Math.max(0, Math.min(lastStep(), step)), { reason, event })\n\n    /** Whether every step before `target` passes; if not, shows the first that doesn't. */\n    const reach = (target: number, event?: Event) => {\n      const steps = form().steps ?? []\n      for (let index = 0; index < Math.min(target, steps.length); index++) {\n        const names = steps[index]!.fields\n        const found = checkFields(form(), values(), names)\n        if (Object.keys(found).length) {\n          show(names, found, true)\n          if (store.get().step !== index) setStep(index, \"imperative\", event)\n          return Object.entries(found).map(([name, problem]) => said(form(), name, problem!))\n        }\n      }\n      return []\n    }\n\n    return {\n      /** A person's change to one field. A field showing a problem is checked again. */\n      setField(name: string, value: unknown, event?: Event) {\n        const next = { ...values(), [name]: value }\n        if (!change(\"value\", next, { reason: \"input\", event })) return false\n        if (store.get().errors[name]) {\n          const problem = checkField(form(), name, value, next)\n          show([name], problem ? { [name]: problem } : {}, false)\n        }\n        return true\n      },\n      /** Leaving a field shows what's wrong with what was typed. An empty field waits for the submit. */\n      leaveField(name: string) {\n        const value = values()[name]\n        if (value === \"\" || value === null || value === undefined) return\n        const problem = checkField(form(), name, value, values())\n        show([name], problem ? { [name]: problem } : {}, false)\n      },\n      /**\n       * Fills fields by name or label, as an agent does: `fill({ Email: \"ada@example.com\", role: \"Admin\" })`.\n       * Values are read as each field takes them (numbers from text, a choice by its label).\n       * What can't be filled, and what's filled but wrong, is shown and thrown, so the agent hears why.\n       */\n      fill(entries: Record<string, unknown>) {\n        if (!entries || typeof entries !== \"object\" || Array.isArray(entries)) {\n          throw new Error(`fill takes the values by field name or label, like { \"${form().names[0] ?? \"name\"}\": \"…\" }.`)\n        }\n        const problems: string[] = []\n        const next = { ...values() }\n        const filled: string[] = []\n        for (const [key, input] of Object.entries(entries)) {\n          const name = fieldFor(form(), key)\n          if (!name) {\n            problems.push(form().words.unknownField(key, form().names.map((n) => labelOf(form(), n))))\n            continue\n          }\n          const result = coerceValue(form(), name, input)\n          if (\"error\" in result) problems.push(said(form(), name, result.error))\n          else {\n            next[name] = result.value\n            filled.push(name)\n          }\n        }\n        if (filled.length && !change(\"value\", next, { reason: \"fill\" })) throw new Error(\"The change was refused.\")\n        const found = checkFields(form(), next, filled)\n        show(filled, found, false)\n        for (const name of filled) if (found[name]) problems.push(said(form(), name, found[name]))\n        // A person sees what the agent filled: the step with the first field it filled shows.\n        const first = filled.length ? stepOf(form(), filled[0]!) : -1\n        if (first >= 0 && first !== store.get().step && !problems.length) setStep(first, \"imperative\")\n        if (problems.length) throw new Error(problems.join(\" \"))\n        return filled.map((name) => labelOf(form(), name))\n      },\n      /** Shows a step. Going forward checks the steps on the way, as Next does; the review is `steps.length`. */\n      goTo(step: number, event?: Event) {\n        const target = Number(step)\n        if (!Number.isInteger(target) || target < 0 || target > lastStep()) throw new Error(`Steps go from 0 to ${lastStep()}.`)\n        if (target > store.get().step) {\n          const problems = reach(target, event)\n          if (problems.length) throw new Error(problems.join(\" \"))\n        }\n        return setStep(target, target > store.get().step ? \"next\" : \"back\", event)\n      },\n      /** The next step, once this one's fields pass. */\n      next(event?: Event) {\n        const at = store.get().step\n        if (reach(at + 1, event).length) return false\n        return setStep(at + 1, \"next\", event)\n      },\n      back(event?: Event) {\n        return setStep(store.get().step - 1, \"back\", event)\n      },\n      /** Checks everything, then sends it through `onSubmit`. Problems show, and focus goes to the first. */\n      async submit(details: SubmitDetails = {}) {\n        if (store.get().status === \"submitting\" || store.get().disabled) return false\n        const found = await validateForm(form(), values())\n        const first = show(form().names, found, true)\n        if (Object.keys(found).length) {\n          const step = first ? stepOf(form(), first) : -1\n          if (step >= 0 && step !== store.get().step) setStep(step, \"imperative\", details.event)\n          const count = Object.keys(found).length\n          announce(count === 1 ? Object.values(found)[0]! : `${count} problems: ${Object.values(found)[0]}`, { priority: \"assertive\" })\n          return false\n        }\n        store.set({ status: \"submitting\" })\n        let result: void | FormErrors\n        try {\n          result = await context.options().onSubmit?.(values(), details)\n        } catch (error) {\n          result = { form: error instanceof Error ? error.message : String(error) }\n        }\n        const sent = !result || Object.keys(result).length === 0\n        if (!sent) {\n          const failed = show(form().names, result as FormErrors, true)\n          store.set({ status: \"idle\" })\n          const step = failed ? stepOf(form(), failed) : -1\n          if (step >= 0 && step !== store.get().step) setStep(step, \"imperative\", details.event)\n          announce(Object.values(result as FormErrors)[0] ?? \"\", { priority: \"assertive\" })\n          return false\n        }\n        store.set({ status: \"done\" })\n        const done = context.options().doneMessage\n        if (done) announce(done)\n        return true\n      },\n      /** Every field's value now. */\n      values: () => values(),\n      /**\n       * Sets the values from code, as a controller would: fields left out go to their defaults,\n       * and a field showing a problem is checked again. The same values change nothing.\n       */\n      setValues(given: Values, event?: Event) {\n        const next = { ...(initialValues(form()) as Values), ...given }\n        if (sameValues(next, values())) return false\n        if (!change(\"value\", next, { reason: \"imperative\", event })) return false\n        const showing = Object.keys(store.get().errors).filter((name) => name in form().fields)\n        if (showing.length) show(showing, checkFields(form(), next, showing), false)\n        return true\n      },\n      /** Back to the defaults, with no problems showing, at the first step. */\n      reset(event?: Event) {\n        change(\"value\", { ...(initialValues(form()) as Values), ...context.options().defaultValue }, { reason: \"reset\", event })\n        store.set({ errors: {}, status: \"idle\", focus: null })\n        setStep(0, \"imperative\", event)\n      },\n      /** The field that took focus after a problem, so it isn't focused again. */\n      focused() {\n        store.set({ focus: null })\n      },\n      /** The fields, for an agent: what `fill` takes. */\n      fields: () => form().names.map((name) => ({ value: name, label: labelOf(form(), name) })),\n    }\n  },\n  slots: (slot) => ({\n    root: slot<\n      {},\n      { value: Values; errors: FormErrors; step: number; status: \"idle\" | \"submitting\" | \"done\"; disabled: boolean; focus: string | null; form: FormDefinition }\n    >({\n      state: (state) => ({\n        value: state.value,\n        errors: state.errors,\n        step: state.step,\n        status: state.status,\n        disabled: state.disabled,\n        focus: state.focus,\n        form: state.form,\n      }),\n      attrs: (state) => ({\n        \"aria-busy\": state.status === \"submitting\" ? \"true\" : undefined,\n        \"data-status\": state.status,\n        \"data-invalid\": Object.keys(state.errors).length ? \"\" : undefined,\n        \"data-disabled\": state.disabled ? \"\" : undefined,\n      }),\n      on: {\n        // The form's own submit, from Enter in a field or the submit button, a person's or an\n        // agent's press. Before the review, Enter in a field goes on to the next step.\n        submit: (event, { api, store }) => {\n          event.preventDefault()\n          const steps = store.get().form.steps\n          if (steps && store.get().step < steps.length) api.next(event)\n          else void api.submit({ event })\n        },\n      },\n    }),\n  }),\n  agent: { actions: [\"fill\", \"goTo\", \"reset\"], items: (api) => api.fields() },\n})\n\nexport { schemaForm }\nexport type { SchemaFormOptions, SchemaFormStepReason, SchemaFormValueReason, SubmitDetails }\n",
      "type": "registry:file",
      "target": "@ui/schema-form/form.ts"
    },
    {
      "path": "registry/uiset/ui/schema-form/tool.ts",
      "content": "// A form's definition as an agent tool: its fields are the tool's input, and a call fills the\n// form on the page through the agent bridge, so the bridge's `allow` and the submit's\n// `data-agent-confirm` still decide what happens. The person sees every value land.\nimport { toJSONSchema, type FormDefinition, type JSONSchema } from \"./schema\"\n\ntype BridgeStep = { ref: string; action: string; args?: unknown[] }\n/** The agent bridge from `createAgent`, as far as a form tool needs it. */\ntype Bridge = { act: (input: { steps: BridgeStep[] }) => Promise<{ ok: boolean; error?: { message: string } }> }\n\ntype FormToolOptions = {\n  /** The form's name on the page, when it isn't its title (a form with `heading={false}` and its own `aria-label`). */\n  ref?: string\n  /**\n   * The submit button's label, to press it after filling. A submit marked with\n   * `data-agent-confirm` (the form's default) waits for the person to approve it.\n   */\n  submit?: string\n}\n\ntype FormToolResult = { ok: true; filled: string[] } | { ok: false; error: string }\n\ntype FormTool = {\n  name: string\n  description: string\n  inputSchema: JSONSchema\n  annotations: { readOnlyHint: boolean; untrustedContentHint: boolean; consequentialHint: boolean }\n  execute: (input: Record<string, unknown>) => Promise<FormToolResult>\n}\n\n/**\n * The form as a tool for a model: name, description, JSON Schema input and `execute`. Hand it\n * to your model SDK (AI SDK's `tool({ description, inputSchema: jsonSchema(t.inputSchema),\n * execute: t.execute })`), or to the browser's agent with `registerFormTool`.\n */\nfunction formTool(form: FormDefinition, agent: Bridge, options: FormToolOptions = {}): FormTool {\n  const ref = options.ref ?? form.title\n  const fields = form.names.map((name) => form.fields[name]!.label).join(\", \")\n  return {\n    name: form.name,\n    description: [\n      `${form.title}.`,\n      form.description,\n      `Fills the \"${ref}\" form on the page (${fields}).`,\n      options.submit ? `Then presses ${options.submit}, which may wait for the person to approve it.` : \"The person reviews it and sends it.\",\n    ]\n      .filter(Boolean)\n      .join(\" \"),\n    inputSchema: toJSONSchema(form),\n    // Results carry the page's words (labels, problems), and a submit can't be taken back.\n    annotations: { readOnlyHint: false, untrustedContentHint: true, consequentialHint: !!options.submit },\n    async execute(input) {\n      const steps: BridgeStep[] = [{ ref, action: \"fill\", args: [input ?? {}] }]\n      if (options.submit) steps.push({ ref: options.submit, action: \"press\" })\n      const result = await agent.act({ steps })\n      return result.ok ? { ok: true, filled: Object.keys(input ?? {}) } : { ok: false, error: result.error?.message ?? `\"${ref}\" couldn't be filled.` }\n    },\n  }\n}\n\ntype ModelContext = { registerTool?: (tool: Omit<FormTool, \"execute\"> & { execute: (input: Record<string, unknown>) => Promise<FormToolResult> }, options: { signal: AbortSignal }) => Promise<unknown> }\n\n/**\n * Registers the form's tool with the browser's own agent through WebMCP\n * (`document.modelContext.registerTool`), as UI SDK's `registerTools` does for its three.\n * Does nothing where the browser has no WebMCP. Returns a function that unregisters it.\n */\nfunction registerFormTool(form: FormDefinition, agent: Bridge, options: FormToolOptions = {}) {\n  const context = (globalThis.document as (Document & { modelContext?: ModelContext }) | undefined)?.modelContext\n  if (!context?.registerTool) return () => {}\n  const controller = new AbortController()\n  const tool = formTool(form, agent, options)\n  context.registerTool({ ...tool, execute: (input) => tool.execute(input) }, { signal: controller.signal }).catch(() => {})\n  return () => controller.abort()\n}\n\nexport { formTool, registerFormTool }\nexport type { Bridge, FormTool, FormToolOptions, FormToolResult }\n",
      "type": "registry:file",
      "target": "@ui/schema-form/tool.ts"
    },
    {
      "path": "registry/uiset/ui/schema-form/labels.ts",
      "content": "// The form's own words, how the review shows each value, and what takes focus in a field:\n// shared by React's SchemaForm and the <uiset-schema-form> element, so both read the same.\nimport type { FieldSpec } from \"./schema\"\n\ntype SchemaFormLabels = {\n  next: string\n  back: string\n  submit: string\n  submitting: string\n  /** The review's name in the steps. */\n  review: string\n  /** Each step's Edit button on the review, like \"Edit Who\". */\n  edit: (step: string) => string\n  steps: string\n  yes: string\n  no: string\n  /** What the review shows for a field left empty. */\n  empty: string\n  /** The number field's step buttons. */\n  decrease: string\n  increase: string\n}\n\nconst defaultLabels: SchemaFormLabels = {\n  next: \"Next\",\n  back: \"Back\",\n  submit: \"Submit\",\n  submitting: \"Sending…\",\n  review: \"Review\",\n  edit: (step) => `Edit ${step}`,\n  steps: \"Steps\",\n  yes: \"Yes\",\n  no: \"No\",\n  empty: \"Not given\",\n  decrease: \"Decrease\",\n  increase: \"Increase\",\n}\n\n/** What the review shows for a value. */\nfunction shownValue(field: FieldSpec, value: unknown, labels: SchemaFormLabels, locale?: string) {\n  if (value === null || value === undefined || value === \"\") return labels.empty\n  switch (field.kind) {\n    case \"boolean\":\n      return value ? labels.yes : labels.no\n    case \"choice\":\n      return field.options.find((option) => option.value === value)?.label ?? String(value)\n    case \"number\":\n      return new Intl.NumberFormat(locale).format(value as number)\n    case \"date\":\n      return new Intl.DateTimeFormat(locale, { dateStyle: \"medium\", timeZone: \"UTC\" }).format(new Date(`${value}T00:00:00Z`))\n    default:\n      return String(value)\n  }\n}\n\n/** The autocomplete a text field asks for, by its kind. */\nconst autocompleteFor = (kind: FieldSpec[\"kind\"]) => (kind === \"email\" ? \"email\" : kind === \"tel\" ? \"tel\" : kind === \"url\" ? \"url\" : \"off\")\n\n/** What takes focus in a field: its text box, its spin button, its combobox, or its checked radio (the radios' one tab stop). */\nconst controlIn = (field: Element | null | undefined) =>\n  field?.querySelector<HTMLElement>(\n    \"input:not([type=hidden], [tabindex='-1']), textarea, [role=combobox], [role=spinbutton], [tabindex]:not([tabindex='-1']), button:not([tabindex='-1'])\",\n  ) ?? null\n\nexport { autocompleteFor, controlIn, defaultLabels, shownValue }\nexport type { SchemaFormLabels }\n",
      "type": "registry:file",
      "target": "@ui/schema-form/labels.ts"
    },
    {
      "path": "registry/uiset/ui/schema-form/schema-form.css",
      "content": "/* A form drawn from its definition: fields in a column, steps above them, a review, and the\n   actions under it. Every color is a token, so each skin draws it. */\n\n@layer uiset.base {\n  .schema-form {\n    display: grid;\n    gap: calc(var(--ui-spacing) * 5);\n    max-inline-size: 36rem;\n    min-inline-size: 0;\n  }\n\n  /* Wrappers that only group for React: the form's grid lays out what's inside them. */\n  .schema-form-body,\n  .schema-form-review-row {\n    display: contents;\n  }\n\n  .schema-form-head {\n    display: grid;\n    gap: calc(var(--ui-spacing) * 1);\n\n    & :is(h2, h3, h4) {\n      margin: 0;\n      font-size: 1.125rem;\n      line-height: 1.3;\n    }\n\n    & p {\n      margin: 0;\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  .schema-form-fields {\n    display: grid;\n    gap: calc(var(--ui-spacing) * 4);\n    min-inline-size: 0;\n  }\n\n  .schema-form-field {\n    display: grid;\n    gap: calc(var(--ui-spacing) * 1.5);\n    min-inline-size: 0;\n  }\n\n  /* A checkbox or switch sits before its label, on one line. */\n  .schema-form-toggle {\n    display: flex;\n    align-items: center;\n    gap: calc(var(--ui-spacing) * 2);\n  }\n\n  .schema-form-options {\n    display: grid;\n    gap: calc(var(--ui-spacing) * 2);\n\n    & label {\n      display: flex;\n      align-items: center;\n      gap: calc(var(--ui-spacing) * 2);\n    }\n  }\n\n  /* A container, so its rows stack when the form is narrow, wherever the form sits. */\n  .schema-form-review {\n    display: grid;\n    gap: calc(var(--ui-spacing) * 4);\n    container-type: inline-size;\n  }\n\n  .schema-form-review-step {\n    display: grid;\n    gap: calc(var(--ui-spacing) * 2);\n    padding-block-end: calc(var(--ui-spacing) * 4);\n    border-block-end: 1px solid var(--ui-border);\n\n    &:last-child {\n      padding-block-end: 0;\n      border-block-end: 0;\n    }\n\n    & header {\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      gap: calc(var(--ui-spacing) * 2);\n    }\n\n    & h3 {\n      margin: 0;\n      font-size: 1rem;\n    }\n\n    & dl {\n      display: grid;\n      grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);\n      gap: calc(var(--ui-spacing) * 1.5) calc(var(--ui-spacing) * 4);\n      margin: 0;\n    }\n\n    & dt {\n      color: var(--ui-muted-foreground);\n    }\n\n    & dd {\n      margin: 0;\n      overflow-wrap: anywhere;\n    }\n  }\n\n  /* Back at the start, the step's own action at the end. */\n  .schema-form-actions {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: calc(var(--ui-spacing) * 2);\n\n    & > :last-child {\n      margin-inline-start: auto;\n    }\n  }\n\n  .schema-form-problem,\n  .schema-form-done {\n    margin: 0;\n  }\n\n  .schema-form-problem {\n    color: var(--ui-destructive);\n  }\n\n  /* On a narrow form the review's labels sit over their values. */\n  @container (max-width: 24rem) {\n    .schema-form-review-step dl {\n      grid-template-columns: minmax(0, 1fr);\n      row-gap: calc(var(--ui-spacing) * 0.5);\n\n      & dd {\n        margin-block-end: calc(var(--ui-spacing) * 2);\n      }\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/schema-form/schema-form.css"
    },
    {
      "path": "registry/uiset/ui/shell/shell.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n@layer uiset.base {\n  :where([data-uiset]) {\n    /* Status colors: text and edges hold 4.5:1 / 3:1 on --ui-background in each scheme. */\n    /* Dark values also clear 4.5:1 on the mid-dark Blueprint and Studio panels. */\n    --tone-info: light-dark(oklch(0.48 0.15 255), oklch(0.86 0.08 240));\n    --tone-success: light-dark(oklch(0.47 0.12 150), oklch(0.87 0.11 150));\n    --tone-warning: light-dark(oklch(0.5 0.12 70), oklch(0.89 0.11 85));\n    --tone-danger: light-dark(oklch(0.46 0.19 27), oklch(0.86 0.08 25));\n    --tone-neutral: var(--ui-muted-foreground);\n  }\n\n  .uiset-visually-hidden {\n    position: absolute;\n    width: 1px;\n    height: 1px;\n    overflow: hidden;\n    clip-path: inset(50%);\n    white-space: nowrap;\n  }\n\n  .uiset-icon {\n    width: 1rem;\n    height: 1rem;\n    flex-shrink: 0;\n    fill: none;\n    stroke: currentColor;\n    stroke-width: 1.75;\n    stroke-linecap: round;\n    stroke-linejoin: round;\n  }\n\n  /* App shell */\n\n  .app-shell {\n    --sidebar-width: 15rem;\n    display: grid;\n    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);\n    min-height: var(--app-shell-height, 100dvh);\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n\n    &[data-narrow] {\n      grid-template-columns: minmax(0, 1fr);\n    }\n  }\n\n  [data-sidebar=\"collapsed\"] .app-shell:not([data-narrow]) {\n    --sidebar-width: 3.75rem;\n  }\n\n  .app-sidebar,\n  .app-drawer {\n    display: flex;\n    flex-direction: column;\n    gap: 0.75rem;\n    min-width: 0;\n    padding: 0.75rem;\n    border-inline-end: 1px solid var(--ui-border);\n    background: color-mix(in oklab, var(--ui-muted) 55%, var(--ui-background));\n    overflow: hidden;\n  }\n\n  .app-sidebar-top {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.5rem;\n    min-height: 2.25rem;\n  }\n\n  .app-brand {\n    min-width: 0;\n    margin: 0;\n    overflow: hidden;\n    font-weight: 600;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n  }\n\n  [data-sidebar=\"collapsed\"] .app-sidebar .app-brand {\n    display: none;\n  }\n\n  .app-sidebar-toggle,\n  .app-menu-button {\n    flex-shrink: 0;\n    width: 2.25rem;\n    height: 2.25rem;\n    padding: 0;\n  }\n\n  .app-main {\n    display: flex;\n    flex-direction: column;\n    min-width: 0;\n  }\n\n  /* Its padding counts in its height, with or without a page's box-sizing reset. */\n  .app-header {\n    box-sizing: border-box;\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.75rem;\n    min-height: 3.25rem;\n    padding: 0.5rem 1rem;\n    border-bottom: 1px solid var(--ui-border);\n  }\n\n  /* The padding is a variable, so a full-bleed page (an inbox) can cancel it exactly. */\n  .app-content {\n    --app-shell-pad: clamp(1rem, 3vw, 2rem);\n    flex: 1;\n    min-width: 0;\n    padding: var(--app-shell-pad);\n  }\n\n  .sidebar-nav {\n    display: grid;\n    gap: 1rem;\n  }\n\n  .sidebar-group {\n    display: grid;\n    gap: 0.25rem;\n\n    ul {\n      display: grid;\n      gap: 2px;\n      margin: 0;\n      padding: 0;\n      list-style: none;\n    }\n  }\n\n  .sidebar-group-title {\n    margin: 0;\n    padding-inline: 0.5rem;\n    font-size: 0.75rem;\n    font-weight: 600;\n    color: var(--ui-muted-foreground);\n  }\n\n  /* Collapsed to icons: group titles leave the layout (a hidden title used to keep its\n     width and push the icons off center), and a rule separates the groups instead. */\n  [data-sidebar=\"collapsed\"] .app-sidebar {\n    .sidebar-group-title {\n      position: absolute;\n      width: 1px;\n      height: 1px;\n      overflow: hidden;\n      clip-path: inset(50%);\n      white-space: nowrap;\n    }\n\n    .sidebar-nav {\n      gap: 0.5rem;\n    }\n\n    .sidebar-group + .sidebar-group {\n      padding-block-start: 0.5rem;\n      border-block-start: 1px solid var(--ui-border);\n    }\n  }\n\n  /* A tooltip trigger, so UI SDK's stylesheet would draw it as a button: reset that. */\n  .sidebar-link {\n    display: flex;\n    align-items: center;\n    justify-content: flex-start;\n    gap: 0.625rem;\n    width: 100%;\n    height: auto;\n    min-height: 2.25rem;\n    padding: 0.375rem 0.5rem;\n    border: 0;\n    border-radius: var(--ui-radius);\n    background: transparent;\n    color: var(--ui-foreground);\n    font-weight: 400;\n    text-decoration: none;\n\n    &:hover {\n      background: var(--ui-muted);\n    }\n\n    &[aria-current=\"page\"] {\n      position: relative;\n      background: var(--ui-muted);\n      font-weight: 600;\n\n      /* A short bar, inset from the corners (an inset shadow bent around them). */\n      &::before {\n        content: \"\";\n        position: absolute;\n        inset-block: 0.5rem;\n        inset-inline-start: 0;\n        inline-size: 3px;\n        border-radius: 999px;\n        background: var(--ui-primary);\n      }\n    }\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: -2px;\n    }\n  }\n\n  .sidebar-icon {\n    display: inline-grid;\n    place-items: center;\n    width: 1.25rem;\n    flex-shrink: 0;\n  }\n\n  .sidebar-label {\n    flex: 1;\n    min-width: 0;\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n  }\n\n  .sidebar-badge {\n    font-size: 0.75rem;\n  }\n\n  /* Each link is a square icon button, centered in the rail under the toggle; the current\n     page shows by its fill and an accent icon (a side bar on a square reads as a glitch). */\n  [data-sidebar=\"collapsed\"] .app-sidebar {\n    .sidebar-link {\n      justify-content: center;\n      inline-size: 2.25rem;\n      min-block-size: 2.25rem;\n      margin-inline: auto;\n      padding: 0;\n\n      &[aria-current=\"page\"] {\n        color: color-mix(in oklch, var(--ui-primary) 55%, var(--ui-foreground));\n\n        &::before {\n          display: none;\n        }\n      }\n    }\n\n    .sidebar-label,\n    .sidebar-badge {\n      position: absolute;\n      width: 1px;\n      height: 1px;\n      overflow: hidden;\n      clip-path: inset(50%);\n    }\n  }\n\n  /* The tooltip repeats the visible label, so it only shows when labels are hidden. */\n  [data-sidebar=\"expanded\"] .sidebar-tooltip,\n  .app-drawer .sidebar-tooltip {\n    display: none;\n  }\n\n  /* Page structure */\n\n  .breadcrumbs ol {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.25rem;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n    font-size: 0.875rem;\n  }\n\n  .breadcrumbs li {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    color: var(--ui-muted-foreground);\n\n    a {\n      color: inherit;\n      text-underline-offset: 0.2em;\n    }\n\n    [aria-current=\"page\"] {\n      color: var(--ui-foreground);\n      font-weight: 500;\n    }\n  }\n\n  .breadcrumbs-separator {\n    width: 0.875rem;\n    height: 0.875rem;\n  }\n\n  .page-header {\n    display: grid;\n    gap: 0.75rem;\n    margin-bottom: 1.5rem;\n  }\n\n  .page-header-row {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: flex-end;\n    justify-content: space-between;\n    gap: 1rem;\n  }\n\n  .page-header-title {\n    margin: 0;\n    font-size: clamp(1.5rem, 3vw, 1.875rem);\n    line-height: 1.15;\n    text-wrap: balance;\n  }\n\n  .page-header-description {\n    max-width: 42rem;\n    margin: 0.375rem 0 0;\n    color: var(--ui-muted-foreground);\n  }\n\n  .page-header-actions {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n  }\n\n  .card {\n    display: grid;\n    gap: 1rem;\n    min-width: 0;\n    padding: 1.25rem;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius) + 6px);\n    background: var(--ui-background);\n  }\n\n  .card-header {\n    display: grid;\n    gap: 0.25rem;\n  }\n\n  .card-title {\n    margin: 0;\n    font-size: 1rem;\n    font-weight: 600;\n  }\n\n  .card-description {\n    margin: 0;\n    color: var(--ui-muted-foreground);\n    font-size: 0.875rem;\n  }\n\n  .card-footer {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n    padding-top: 1rem;\n    border-top: 1px solid var(--ui-border);\n  }\n\n  /* Data display */\n\n  .badge {\n    --badge-color: var(--tone-neutral);\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    padding: 0.0625rem 0.5rem;\n    border: 1px solid color-mix(in oklab, var(--badge-color) 55%, transparent);\n    border-radius: min(999px, calc(var(--ui-radius) * 999));\n    background: color-mix(in oklab, var(--badge-color) 10%, var(--ui-background));\n    color: var(--badge-color);\n    font-size: 0.75rem;\n    font-weight: 600;\n    line-height: 1.5;\n    white-space: nowrap;\n\n    &[data-tone=\"info\"] {\n      --badge-color: var(--tone-info);\n    }\n\n    &[data-tone=\"success\"] {\n      --badge-color: var(--tone-success);\n    }\n\n    &[data-tone=\"warning\"] {\n      --badge-color: var(--tone-warning);\n    }\n\n    &[data-tone=\"danger\"] {\n      --badge-color: var(--tone-danger);\n    }\n  }\n\n  .count-badge {\n    position: relative;\n    display: inline-flex;\n    vertical-align: middle;\n  }\n\n  /* The solid button's colors: every skin already holds 4.5:1 between them. */\n  .count-badge-count {\n    position: absolute;\n    inset-block-start: 0;\n    inset-inline-end: 0;\n    translate: 40% -40%;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    box-sizing: border-box;\n    min-width: 1.125rem;\n    height: 1.125rem;\n    padding-inline: 0.3125rem;\n    border-radius: min(999px, calc(var(--ui-radius) * 999));\n    background: var(--uiset-solid-bg);\n    color: var(--uiset-solid-fg);\n    box-shadow: 0 0 0 2px var(--ui-background);\n    font-size: 0.6875rem;\n    font-weight: 600;\n    font-variant-numeric: tabular-nums;\n    line-height: 1;\n    white-space: nowrap;\n    pointer-events: none;\n\n    &:dir(rtl) {\n      translate: -40% -40%;\n    }\n\n    &[data-dot] {\n      min-width: 0.625rem;\n      width: 0.625rem;\n      height: 0.625rem;\n      padding: 0;\n      translate: 20% -20%;\n\n      &:dir(rtl) {\n        translate: -20% -20%;\n      }\n    }\n  }\n\n  /* Each avatar overlaps the one before it, with a ring of the page color between them. */\n  .avatar-group {\n    display: inline-flex;\n    align-items: center;\n    vertical-align: middle;\n\n    & > * {\n      box-shadow: 0 0 0 2px var(--ui-background);\n    }\n\n    /* A small overlap: more would cover the next avatar's initials. */\n    & > * + * {\n      margin-inline-start: calc(var(--ui-spacing) * -1);\n    }\n  }\n\n  .avatar-group-more {\n    font-variant-numeric: tabular-nums;\n  }\n\n  /* Content sits at the top, so figures in a row line up whether or not one has a trend. */\n  .stat {\n    display: grid;\n    align-content: start;\n    gap: 0.25rem;\n\n    p {\n      margin: 0;\n    }\n  }\n\n  .stat-label {\n    font-size: 0.875rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .stat-trend {\n    max-inline-size: 100%;\n  }\n\n  /* A standalone figure keeps proportional digits; tabular ones look loose this big. */\n  .stat-value {\n    font-size: 1.75rem;\n    font-weight: 650;\n    line-height: 1.15;\n  }\n\n  .stat-change {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    font-size: 0.875rem;\n    font-weight: 600;\n\n    &[data-good] {\n      color: var(--tone-success);\n    }\n\n    &[data-bad] {\n      color: var(--tone-danger);\n    }\n  }\n\n  .stat-period,\n  .stat-description {\n    color: var(--ui-muted-foreground);\n    font-weight: 400;\n  }\n\n  .stat-description {\n    font-size: 0.8125rem;\n  }\n\n  .empty-state {\n    display: grid;\n    justify-items: center;\n    gap: 0.5rem;\n    padding: 2.5rem 1rem;\n    text-align: center;\n  }\n\n  .empty-state-icon {\n    width: 2rem;\n    height: 2rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .empty-state-title {\n    margin: 0.25rem 0 0;\n    font-size: 1.0625rem;\n  }\n\n  .empty-state-description {\n    max-width: 28rem;\n    margin: 0;\n    color: var(--ui-muted-foreground);\n  }\n\n  .empty-state-actions {\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: center;\n    gap: 0.5rem;\n    margin-top: 0.5rem;\n  }\n\n  .skeleton {\n    display: block;\n    width: 100%;\n    border-radius: var(--ui-radius);\n    background: linear-gradient(\n        90deg,\n        var(--ui-muted) 0 35%,\n        color-mix(in oklab, var(--ui-muted), var(--ui-foreground) 8%) 50%,\n        var(--ui-muted) 65% 100%\n      )\n      0 0 / 300% 100%;\n    animation: skeleton-wave 1.6s ease-in-out infinite;\n  }\n\n  .skeleton-text {\n    display: grid;\n    gap: 0.5rem;\n\n    .skeleton {\n      height: 0.75rem;\n    }\n  }\n\n  @keyframes skeleton-wave {\n    from {\n      background-position: 100% 0;\n    }\n    to {\n      background-position: 0 0;\n    }\n  }\n\n  .description-list {\n    display: grid;\n    margin: 0;\n\n    &[data-layout=\"columns\"] .description-item {\n      display: grid;\n      grid-template-columns: minmax(8rem, 1fr) 2fr;\n      gap: 1rem;\n    }\n\n    dt {\n      color: var(--ui-muted-foreground);\n    }\n\n    dd {\n      margin: 0;\n      min-width: 0;\n      overflow-wrap: anywhere;\n    }\n  }\n\n  .description-item {\n    padding-block: 0.625rem;\n    border-bottom: 1px solid var(--ui-border);\n\n    &:last-child {\n      border-bottom: 0;\n    }\n  }\n\n  .item-list {\n    display: grid;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  .item {\n    display: flex;\n    align-items: center;\n    gap: 0.75rem;\n    min-height: 3rem;\n    padding-block: 0.625rem;\n    border-bottom: 1px solid var(--ui-border);\n\n    &:last-child {\n      border-bottom: 0;\n    }\n  }\n\n  .item-text {\n    display: grid;\n    flex: 1;\n    min-width: 0;\n  }\n\n  .item-title {\n    overflow: hidden;\n    color: var(--ui-foreground);\n    font-weight: 500;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n  }\n\n  a.item-title {\n    text-decoration: none;\n\n    &:hover {\n      text-decoration: underline;\n    }\n  }\n\n  .item-description,\n  .item-meta {\n    color: var(--ui-muted-foreground);\n    font-size: 0.8125rem;\n  }\n\n  .item-actions {\n    display: flex;\n    gap: 0.25rem;\n  }\n\n  .alert {\n    --alert-color: var(--tone-info);\n    display: grid;\n    grid-template-columns: auto minmax(0, 1fr) auto;\n    gap: 0.75rem;\n    align-items: start;\n    padding: 0.875rem 1rem;\n    position: relative;\n    overflow: hidden;\n    padding-inline-start: calc(1rem + 3px);\n    border: 1px solid color-mix(in oklab, var(--alert-color) 45%, var(--ui-border));\n    border-radius: calc(var(--ui-radius) + 4px);\n    background: color-mix(in oklab, var(--alert-color) 7%, var(--ui-background));\n\n    /* The accent is a straight bar the corners clip; a thick border would taper into them. */\n    &::before {\n      content: \"\";\n      position: absolute;\n      inset-block: 0;\n      inset-inline-start: 0;\n      inline-size: 4px;\n      background: var(--alert-color);\n    }\n\n    &[data-tone=\"success\"] {\n      --alert-color: var(--tone-success);\n    }\n\n    &[data-tone=\"warning\"] {\n      --alert-color: var(--tone-warning);\n    }\n\n    &[data-tone=\"danger\"] {\n      --alert-color: var(--tone-danger);\n    }\n  }\n\n  .alert-icon {\n    width: 1.25rem;\n    height: 1.25rem;\n    color: var(--alert-color);\n  }\n\n  .alert-body {\n    display: grid;\n    gap: 0.25rem;\n  }\n\n  .alert-title {\n    margin: 0;\n    font-weight: 600;\n  }\n\n  .alert-text {\n    color: var(--ui-foreground);\n  }\n\n  .alert-actions {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n    margin-top: 0.375rem;\n  }\n\n  .alert-dismiss {\n    width: 2rem;\n    height: 2rem;\n    padding: 0;\n  }\n\n  /* Sized in its own em so a key sits inside a line of text, not below it. */\n  .kbd {\n    display: inline-flex;\n    align-items: center;\n    min-width: 1.75em;\n    height: 1.75em;\n    justify-content: center;\n    padding-inline: 0.4em;\n    vertical-align: 0.125em;\n    line-height: 1;\n    border: 1px solid var(--ui-input);\n    border-bottom-width: 2px;\n    border-radius: calc(var(--ui-radius) / 2 + 2px);\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n    font-family: var(--ui-font-mono);\n    font-size: 0.75rem;\n  }\n\n  .spinner {\n    display: inline-block;\n    flex-shrink: 0;\n    border: 2px solid color-mix(in oklab, var(--ui-foreground) 18%, transparent);\n    border-top-color: var(--ui-primary);\n    border-radius: 50%;\n    animation: spinner-turn 0.8s linear infinite;\n  }\n\n  @keyframes spinner-turn {\n    to {\n      rotate: 1turn;\n    }\n  }\n\n  .stepper {\n    container-type: inline-size;\n  }\n\n  .stepper ol {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.25rem 1rem;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  /* Marks line up across steps, whether a step has a description or not. */\n  .stepper-step {\n    align-items: flex-start;\n    gap: 0.625rem;\n    height: auto;\n    min-height: 2.75rem;\n    padding: 0.375rem 0.625rem 0.375rem 0.375rem;\n    text-align: start;\n  }\n\n  @container (max-width: 30rem) {\n    .stepper ol {\n      flex-direction: column;\n      flex-wrap: nowrap;\n    }\n  }\n\n  .stepper-mark {\n    box-sizing: border-box;\n    display: inline-grid;\n    place-items: center;\n    width: 1.75rem;\n    height: 1.75rem;\n    flex-shrink: 0;\n    border: 2px solid var(--ui-input);\n    border-radius: 50%;\n    font-size: 0.8125rem;\n    font-weight: 600;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .stepper li[data-state=\"current\"] .stepper-mark {\n    border-color: var(--ui-primary);\n    color: var(--ui-primary);\n  }\n\n  .stepper li[data-state=\"complete\"] .stepper-mark {\n    border-color: var(--ui-primary);\n    background: var(--ui-primary);\n    color: var(--ui-primary-foreground);\n  }\n\n  /* The label's first line centers on the mark, whatever the page's line height. */\n  .stepper-text {\n    display: grid;\n    padding-block-start: max(0px, calc((1.75rem - 1lh) / 2));\n  }\n\n  .stepper-label {\n    font-weight: 600;\n  }\n\n  .stepper-description {\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .search-field {\n    position: relative;\n    display: flex;\n    /* A row even as a UI SDK field (which stacks its parts), so the icon centers. */\n    flex-direction: row;\n    align-items: center;\n    width: 100%;\n\n    [data-slot=\"input\"] {\n      width: 100%;\n      padding-inline: 2.125rem 3rem;\n    }\n  }\n\n  .search-field-icon {\n    position: absolute;\n    inset-inline-start: 0.625rem;\n    color: var(--ui-muted-foreground);\n    pointer-events: none;\n  }\n\n  .search-field-clear {\n    position: absolute;\n    inset-inline-end: 0.25rem;\n    width: 1.75rem;\n    height: 1.75rem;\n    padding: 0;\n  }\n\n  /* The browser's own clear button would duplicate ours. */\n  .search-field input[type=\"search\"]::-webkit-search-cancel-button {\n    display: none;\n  }\n\n  .search-field-hint {\n    position: absolute;\n    inset-inline-end: 0.5rem;\n    pointer-events: none;\n  }\n\n  .copy-button {\n    gap: 0.375rem;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    .skeleton,\n    .spinner {\n      animation-duration: 0s;\n    }\n\n    .spinner {\n      border-top-color: var(--ui-muted-foreground);\n    }\n  }\n\n  @media (forced-colors: active) {\n    .badge,\n    .alert,\n    .kbd {\n      border-color: CanvasText;\n    }\n\n    /* Shadows don't draw here, so the rings become real edges. */\n    .avatar-group > *,\n    .count-badge-count {\n      outline: 1px solid CanvasText;\n    }\n\n    .count-badge-count {\n      background: Canvas;\n      color: CanvasText;\n    }\n\n    .sidebar-link[aria-current=\"page\"] {\n      outline: 2px solid Highlight;\n    }\n\n    .stepper li[data-state=\"complete\"] .stepper-mark {\n      background: Highlight;\n      color: HighlightText;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/shell/shell.css"
    },
    {
      "path": "registry/uiset/ui/shell/icons.tsx",
      "content": "import { iconPaths, type IconName } from \"./icon-paths\"\n\nfunction Icon({ name, className }: { name: IconName; className?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 24 24\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      className={[\"uiset-icon\", className].filter(Boolean).join(\" \")}\n    >\n      <path d={iconPaths[name]} />\n    </svg>\n  )\n}\n\nexport { Icon }\nexport type { IconName }\n",
      "type": "registry:file",
      "target": "@ui/shell/icons.tsx"
    },
    {
      "path": "registry/uiset/ui/shell/icon-paths.ts",
      "content": "// UISet's icons as SVG path data on a 24×24 grid, stroked: framework-free, so the React\n// Icon and the web elements draw the same shapes.\nconst iconPaths = {\n  // Text editing (the rich text editor's toolbar).\n  bold: \"M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z\",\n  italic: \"M10 5h8M6 19h8M14 5l-4 14\",\n  underline: \"M7 5v6a5 5 0 0 0 10 0V5M5 20h14\",\n  strike: \"M5 12h14M16 7a4 4 0 0 0-3.5-2h-1A3.5 3.5 0 0 0 8 8.5c0 1.4.8 2.4 2.5 3M8 17a4 4 0 0 0 3.5 2h1a3.5 3.5 0 0 0 3.5-3.5c0-.6-.1-1.1-.4-1.5\",\n  \"code-inline\": \"M9 8l-4 4 4 4M15 8l4 4-4 4\",\n  link: \"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1\",\n  \"list-bullet\": \"M9 6h11M9 12h11M9 18h11M4.5 6v.01M4.5 12v.01M4.5 18v.01\",\n  \"list-ordered\": \"M10 6h10M10 12h10M10 18h10M4 4.5l1.5-.5v4.5M4 15a1.3 1.3 0 0 1 2.4.6c0 .8-2.4 1.7-2.4 2.9h2.6\",\n  \"list-check\": \"M11 6h9M11 12h9M11 18h9M3.5 6l1.5 1.5L8 4.5M3.5 12l1.5 1.5 3-3M3.5 18l1.5 1.5 3-3\",\n  quote: \"M6 7h4v4c0 3-1.3 5-4 6M14 7h4v4c0 3-1.3 5-4 6\",\n  undo: \"M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3\",\n  redo: \"M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3\",\n  image: \"M4 5h16v14H4zM4 16l5-5 4 4 3-3 4 4M15 9.5v.01\",\n  \"code-block\": \"M4 5h16v14H4zM9.5 10l-2 2 2 2M14.5 10l2 2-2 2\",\n  rule: \"M4 12h16M8 8h8M8 16h8\",\n  menu: \"M4 7h16M4 12h16M4 17h16\",\n  sidebar: \"M4 5h16v14H4zM9 5v14\",\n  chevron: \"M9 6l6 6-6 6\",\n  search: \"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM20 20l-4-4\",\n  close: \"M6 6l12 12M18 6L6 18\",\n  copy: \"M8 8h11v11H8zM5 16V5h11\",\n  check: \"M5 12.5l4.5 4.5L19 7.5\",\n  info: \"M12 11v6M12 7.5v.01M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18z\",\n  success: \"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18z\",\n  warning:\n    \"M12 9v4M12 16.5v.01M10.3 4.2L2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.2a2 2 0 0 0-3.4 0z\",\n  danger: \"M15 9l-6 6M9 9l6 6M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18z\",\n  up: \"M7 14l5-5 5 5\",\n  down: \"M7 10l5 5 5-5\",\n  inbox: \"M4 13l2.5-7h11l2.5 7v6H4zM4 13h5l1 2h4l1-2h5\",\n  more: \"M4.8 12a1.2 1.2 0 1 0 2.4 0a1.2 1.2 0 1 0-2.4 0M10.8 12a1.2 1.2 0 1 0 2.4 0a1.2 1.2 0 1 0-2.4 0M16.8 12a1.2 1.2 0 1 0 2.4 0a1.2 1.2 0 1 0-2.4 0\",\n  columns: \"M4 5h16v14H4zM10 5v14M15 5v14\",\n  download: \"M12 4v11M7 10l5 5 5-5M5 20h14\",\n  upload: \"M12 15V4M7 9l5-5 5 5M5 20h14\",\n  retry: \"M20 12a8 8 0 1 1-8-8c2.2 0 4.3.9 5.9 2.4L20 8.5M20 4v4.5h-4.5\",\n  filter: \"M4 6h16M7 12h10M10 18h4\",\n  home: \"M4 11l8-7 8 7M6 9.5V20h12V9.5M10 20v-5h4v5\",\n  users: \"M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM3 20c0-3.3 2.7-6 6-6s6 2.7 6 6M16 4.5a3.5 3.5 0 0 1 0 6.5M21 20c0-2.6-1.6-4.8-4-5.6\",\n  orders: \"M6 4h12l1 16H5zM9 8a3 3 0 0 0 6 0\",\n  reports: \"M5 20V10M12 20V4M19 20v-7\",\n  settings: \"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 13.5l1.6 1.2-2 3.4-1.9-.7a7 7 0 0 1-2 1.2l-.3 2h-4l-.3-2a7 7 0 0 1-2-1.2l-1.9.7-2-3.4 1.6-1.2a7 7 0 0 1 0-3l-1.6-1.2 2-3.4 1.9.7a7 7 0 0 1 2-1.2l.3-2h4l.3 2a7 7 0 0 1 2 1.2l1.9-.7 2 3.4-1.6 1.2a7 7 0 0 1 0 3z\",\n  mail: \"M4 6h16v12H4zM4 7l8 6 8-6\",\n  star: \"M12 4l2.5 5.2 5.5.8-4 3.9.9 5.6L12 16.8 7.1 19.5l.9-5.6-4-3.9 5.5-.8z\",\n  archive: \"M4 5h16v4H4zM6 9v10h12V9M10 13h4\",\n  trash: \"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13\",\n  plus: \"M12 5v14M5 12h14\",\n  minus: \"M5 12h14\",\n  fit: \"M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5\",\n  folder: \"M3.5 6.5a1.5 1.5 0 0 1 1.5-1.5h4l2 2h8a1.5 1.5 0 0 1 1.5 1.5v9a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 0 1-1.5-1.5z\",\n  file: \"M6 3.5h8l4 4v13H6zM14 3.5v4h4\",\n  branch: \"M6 4v16M18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM18 8c0 5-6 5-12 8\",\n  grip: \"M9 6.5v.01M15 6.5v.01M9 12v.01M15 12v.01M9 17.5v.01M15 17.5v.01\",\n  edit: \"M5 19h4L19 9l-4-4L5 15zM14 6l4 4\",\n  send: \"M4 12l16-8-6 16-2-7z\",\n  card: \"M3 6h18v12H3zM3 10h18M7 15h4\",\n  shield: \"M12 3l7 3v5c0 4.5-3 8.5-7 10-4-1.5-7-5.5-7-10V6z\",\n  bell: \"M6 16V11a6 6 0 0 1 12 0v5l2 2H4zM10 20a2 2 0 0 0 4 0\",\n}\n\ntype IconName = keyof typeof iconPaths\n\n/** An icon as an SVG element, for code without React. */\nfunction iconElement(name: IconName, className?: string) {\n  const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\")\n  svg.setAttribute(\"viewBox\", \"0 0 24 24\")\n  svg.setAttribute(\"aria-hidden\", \"true\")\n  svg.setAttribute(\"focusable\", \"false\")\n  svg.setAttribute(\"class\", [\"uiset-icon\", className].filter(Boolean).join(\" \"))\n  const path = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\")\n  path.setAttribute(\"d\", iconPaths[name])\n  svg.append(path)\n  return svg\n}\n\nexport { iconElement, iconPaths }\nexport type { IconName }\n",
      "type": "registry:file",
      "target": "@ui/shell/icon-paths.ts"
    }
  ],
  "type": "registry:ui"
}