Commit Graph

99 Commits

Author SHA1 Message Date
streamdown-github-app[bot] 2f97e9784f Version Packages (#168)
Co-authored-by: ai-elements-bot[bot] <ai-elements-bot[bot]@users.noreply.github.com>
2025-10-27 23:59:59 -07:00
Hayden Bleasel dccf114dd8 replace jsdom with vitest browser mode (#176)
* Swap from jsdom to browser

* Create clever-toys-travel.md

* Add missing packages

* Attempt more test fixes

* Update testing matrix

* Update test.yml

* Update test.yml
2025-10-27 22:46:08 -07:00
Tobias Büschel cdd4d0b282 test: add vitest-fail-on-console and improve test stability (#170)
* test: add vitest-fail-on-console and improve test stability

- Integrate `vitest-fail-on-console` plugin to ensure console logs cause test failures
- Use `act` to wrap asynchronous updates in test interactions
- Add `happy-dom` for improved test environment compatibility
- Update test descriptions to remove async usage where unnecessary

* feat: enhance button accessibility and update tsconfig with testing types

- Add 'type="button"' to improve button element accessibility in test files
- Include 'vitest/globals' and '@testing-library/jest-dom' types in tsconfig for better testing support

* Create grumpy-ways-look.md

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 21:22:57 -07:00
Hayden Bleasel 4d20259861 Update chatbot.tsx 2025-10-27 21:13:30 -07:00
chaxus f50f548e0b fix: add missing PromptInputFooter import in chatbot example (#172)
- Add PromptInputFooter to imports in chatbot.tsx
- Remove duplicate PromptInputFooter import in prompt-input.tsx
- Fixes pnpm dev startup error
2025-10-27 21:13:07 -07:00
Hayden Bleasel 43dbf312e2 Release cleanup (#174)
* Bump deps

* Update package.json

* Update shadcn/ui

* Run Ultracite

* Run Ultracite

* Fix unit tests

* Update prompt-input.tsx

* Build fixes

* Modify docs styles

* Fix terminal titles

* Update code-block.mdx

* Add tool-approval docs and examples

* Rename ToolApproval to Confirmation

* Fix confirmation

* Misc fixes

* Update test.yml

* Downgrade jsdom

* Update confirmation.test.tsx
2025-10-27 21:12:09 -07:00
Tobias Büschel 2135d806f1 refactor: replace react-syntax-highlighter with shiki in CodeBlock (#149)
* refactor: replace react-syntax-highlighter with shiki in CodeBlock

* Create perky-wolves-grow.md

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 19:07:34 -07:00
Tobias Büschel 686577d848 feat: add tool approval state and tool approval component (#163)
* feat: add tool approval state and tool approval component

* Delete apps/test/app/examples/tool-approval.tsx

* Delete apps/test/app/examples/tool.tsx

* Delete apps/test/app/page.tsx

* Delete apps/test/package.json

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml

* Create slow-dancers-tap.md

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:57:16 -07:00
dependabot[bot] da5520fd98 Bump ai from 5.0.72 to 5.0.74 (#144)
Bumps [ai](https://github.com/vercel/ai) from 5.0.72 to 5.0.74.
- [Release notes](https://github.com/vercel/ai/releases)
- [Changelog](https://github.com/vercel/ai/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vercel/ai/compare/ai@5.0.72...ai@5.0.74)

---
updated-dependencies:
- dependency-name: ai
  dependency-version: 5.0.74
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-27 18:50:24 -07:00
Tobias Büschel 8a4be1356e feat: improve layout and design of PromptInputAttachments (#151)
* feat: improve layout and design of PromptInputAttachments

* Delete apps/test/app/examples/prompt-input.tsx

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:47:11 -07:00
chaxus 60058420e7 fix: correct import by using PromptInputFooter instead of PromptInputToolBar (#155)
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:44:31 -07:00
Sora Morimoto 4a5afad0bb Fix type error in Edge component by using const assertion (#158)
* Fix type error in Edge component by using const assertion

Add 'as const' to the return value of `getHandleCoordsByPosition` to ensure
it is typed as a readonly tuple `[number, number]` rather than a mutable
array `number[]`, which was causing TypeScript to infer the elements as
potentially undefined when destructured in the Animated component.

Signed-off-by: Sora Morimoto <sora@morimoto.io>

* Create odd-knives-relax.md

---------

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:43:11 -07:00
Sora Morimoto 2fce23cf38 Fix type error in InlineCitationCardTrigger by checking sources[0] directly (#159)
* Fix type error in `InlineCitationCardTrigger` by checking `sources[0]` directly

Change the condition from `sources.length` to `sources[0]` to ensure
TypeScript recognises that `sources[0]` is defined when passed to the URL
constructor. This resolves the `string | undefined` is not assignable to
`string | URL` type error.

Signed-off-by: Sora Morimoto <sora@morimoto.io>

* Create proud-rocks-study.md

---------

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:41:41 -07:00
Sora Morimoto 27dbfc2c2b Use optional chaining for speech recognition result access (#160)
* Use optional chaining for speech recognition result access

Prevent potential undefined access when retrieving the first alternative
from speech recognition results. The `SpeechRecognitionResult` index
access may return `undefined`, so use optional chaining to safely handle
this case.

Signed-off-by: Sora Morimoto <sora@morimoto.io>

* Use nullish coalescing operator to provide a default empty string

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Create sharp-numbers-think.md

---------

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:39:47 -07:00
Brendan Dash a848cf8d60 refactor: update tokenlens api (#164)
* refactor: update tokenlens api

* Create red-kids-report.md

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:38:23 -07:00
Brendan Dash 40067f2b4a chore: lint @typescript-eslint/no-redeclare (#165)
* chore: lint @typescript-eslint/no-redeclare

* Create famous-heads-marry.md

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-27 18:37:12 -07:00
Hayden Bleasel 00c5835e3a Fix tests 2025-10-27 18:32:41 -07:00
Hayden Bleasel 958d6329c7 Update package.json 2025-10-27 18:10:13 -07:00
Hayden Bleasel 2504ab052f Fix preview 2025-10-27 16:39:57 -07:00
Hayden Bleasel f2cb8c7505 Open source documentation (#156)
* Initial port

* Remove test repo

* Misc fixes

* Fix folder groups

* Docs and design fixes

* Add primary color, fix manual install

* Fix elements demo

* Delete .source

* Update .gitignore

* Update package.json

* Update shadcn-ui

* Upgrade to Next.js and Fumadocs 16

* Add missing examples

* Fix metadata

* Add base path

* Update next-env.d.ts

* Add microfrontends config

* Create microfrontends.json
2025-10-27 13:40:56 -07:00
Hayden Bleasel 2fc2e45b62 Update demo files 2025-10-16 12:21:56 -07:00
Hayden Bleasel 14888a6475 October update (#135)
* Add Shiki to test repo

* Fix controls unit test

* Bump deps

* Cleanup and merge task queue elements

* Rename to Queue

* Update page.tsx

* Update queue.tsx

* Update queue.tsx

* Rebuild queue

* Continue breaking apart Queue component

* Cleanup

* Finish decomposing Queue

* Update queue.tsx

* Misc cleanup and renaming

* Add PromptInputHeader, Footer and Tabs

* Improve exports

* Rename Tabs -> HoverCard

* Add Rules example

* Add PromptInputCommand

* Add tests for Queue

* Update prompt-input.test.tsx

* Create Shimmer component

* Redo colors

* Update reasoning.tsx

* Create Plan component

* Update prompt-input.tsx

* Linter improvements

* Add check / fix commands

* Run Ultracite

* Update prompt-input.tsx
2025-10-15 21:11:00 -07:00
UncleBigBay e26284988f Feat (new element): implement reusable task queue and panel (message and todo default) (#131)
* feat(hook): add useTaskQueue context and hook for unified task and message queue management

* feat: add reusable TaskQueuePanel component for queue and todo management

* chore (example): add TaskQueuePanel usage example with shared task queue context

* Feat (example): add TaskQueuePanel to example workflow page

* chore: add sample todo and message data to task queue

* fix: prevent double-seeding of demo tasks in React Strict Mode with useRef guard
2025-10-15 16:38:10 -07:00
Tobias Büschel 7d36fddb19 feat: pressing backspace deletes last attachment when textarea is empty (#130) 2025-10-15 16:36:50 -07:00
mridul 11358e3cf5 fix: resolve onError type conflict in PromptInputProps (#132)
Exclude "onError" from HTMLAttributes<HTMLFormElement> to prevent conflict
with the custom onError callback that provides specific file upload error
codes ("max_files", "max_file_size", "accept").
2025-10-15 16:35:58 -07:00
Sora Morimoto fda2d1c811 Prevent form submission during IME composition (#134)
Add composition event handlers to PromptInputTextarea to prevent
premature form submission when users press Enter to confirm IME input
(e.g., Japanese, Chinese, Korean). The component now tracks composition
state explicitly using onCompositionStart and onCompositionEnd events,
in addition to checking the native isComposing property.

This fixes an issue where Japanese users typing with an IME would
accidentally submit the form when pressing Enter to convert kanji,
instead of just confirming the conversion.

Signed-off-by: Sora Morimoto <sora@morimoto.io>
2025-10-15 16:34:16 -07:00
Hayden Bleasel ae7091290c Fix controls dark mode 2025-10-07 14:02:46 -07:00
Hayden Bleasel 50c755f596 Rename hooks 2025-10-06 14:59:03 -07:00
Hayden Bleasel 3d9dff9662 Update prompt-input.tsx 2025-10-06 14:14:07 -07:00
Hayden Bleasel 1ef040abd9 Increase test coverage from 95.5% to 96.34% 2025-10-06 14:10:22 -07:00
Hayden Bleasel 8944115c60 Increase test coverage from 94.43% to 95.5% 2025-10-06 14:03:40 -07:00
Hayden Bleasel 0e3111cda0 Misc fixes 2025-10-06 14:01:58 -07:00
Hayden Bleasel 17df70e47d Increase test coverage from 92.94% to 94.43% 2025-10-06 13:59:18 -07:00
Hayden Bleasel dda289ac83 Fix vitest config 2025-10-06 13:52:35 -07:00
Hayden Bleasel 815c1240da Increase test coverage from 92.69% to 92.94% 2025-10-06 13:50:52 -07:00
Hayden Bleasel 9d4f904ed6 Increase test coverage from 92.33% to 92.69% 2025-10-06 13:45:44 -07:00
Hayden Bleasel f87ec1cb02 Fix broken imports 2025-10-06 13:43:33 -07:00
Hayden Bleasel 2bcbae72b3 Increase test coverage from 84.71% to 92.33% 2025-10-06 13:41:20 -07:00
Hayden Bleasel d75a5ee2f0 Increase test coverage from 81.35% to 84.71% 2025-10-06 13:35:25 -07:00
Hayden Bleasel a85bbf5b7a Improve unit tests 2025-10-06 13:27:50 -07:00
Hayden Bleasel 517cdfe966 Add unit tests for new components 2025-10-06 13:27:41 -07:00
Hayden Bleasel fbe92b4a9e Run Ultracite 2025-10-06 13:18:55 -07:00
Milind Mishra ccd7037ec3 feat: add stt and add to test and example apps (#112)
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-06 13:16:35 -07:00
Matthias Platzer 2db6495cee Added PromptInputProvider (#96)
* Added PromptInputProvider
- to access attachements outside the PromptInput context
- also added textInput controlls

Adapted PromptInput attachement rendering for non-image attachements
- show filename, use tooltip to show more
- group files, then images

* Merge provider back into prompt-input file

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-06 13:07:49 -07:00
Hayden Bleasel 98e36007b2 Resolves #122 2025-10-06 11:21:09 -07:00
Hayden Bleasel c3a463dffd Resolves #127 2025-10-06 11:18:15 -07:00
Hayden Bleasel 7f41880e17 Update shadcn/ui 2025-10-06 11:05:40 -07:00
Hayden Bleasel 0c64c3dedb Resolves #126 2025-10-06 10:55:19 -07:00
Hayden Bleasel e3bc4435cb Workflow Elements (#116)
* Draft workflow elements

* Create canvas.tsx

* Draft examples

* Improve demo

* Add Connection component

* Add Controls and Panel

* Update components

* Update workflow.tsx

* Update node.tsx

* Update edge.tsx

* Update node.tsx

* Scaffold Toolbar

* Fix toolbar classname

* Update controls.tsx
2025-10-06 10:48:18 -07:00
zxzinn 323b184f09 Improve form submission handling by using form reference and resettin… (#125)
* Prevent race condition by resetting form before async file processing

Add test for clearing textarea after form submission

Improve form submission handling by using form reference and resetting form after submission

* Update test case titles to include issue #125

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
2025-10-06 07:21:47 -07:00