@dowel-ui/react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/blocks/admin-users/meta.js +27 -0
- package/dist/blocks/admin-users/meta.js.map +1 -0
- package/dist/blocks/ai-chat/meta.js +30 -0
- package/dist/blocks/ai-chat/meta.js.map +1 -0
- package/dist/blocks/dashboard/meta.js +23 -0
- package/dist/blocks/dashboard/meta.js.map +1 -0
- package/dist/blocks/forgot-password/meta.js +24 -0
- package/dist/blocks/forgot-password/meta.js.map +1 -0
- package/dist/blocks/login/meta.js +26 -0
- package/dist/blocks/login/meta.js.map +1 -0
- package/dist/blocks/pricing/meta.js +24 -0
- package/dist/blocks/pricing/meta.js.map +1 -0
- package/dist/blocks/settings/meta.js +29 -0
- package/dist/blocks/settings/meta.js.map +1 -0
- package/dist/blocks/signup/meta.js +25 -0
- package/dist/blocks/signup/meta.js.map +1 -0
- package/dist/components/accordion/accordion.d.ts +19 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +58 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/accordion/meta.js +17 -0
- package/dist/components/accordion/meta.js.map +1 -0
- package/dist/components/activity-feed/activity-feed.d.ts +39 -0
- package/dist/components/activity-feed/activity-feed.d.ts.map +1 -0
- package/dist/components/activity-feed/activity-feed.js +77 -0
- package/dist/components/activity-feed/activity-feed.js.map +1 -0
- package/dist/components/activity-feed/index.d.ts +2 -0
- package/dist/components/activity-feed/index.js +2 -0
- package/dist/components/activity-feed/meta.js +17 -0
- package/dist/components/activity-feed/meta.js.map +1 -0
- package/dist/components/ai-agent-status/ai-agent-status.d.ts +30 -0
- package/dist/components/ai-agent-status/ai-agent-status.d.ts.map +1 -0
- package/dist/components/ai-agent-status/ai-agent-status.js +43 -0
- package/dist/components/ai-agent-status/ai-agent-status.js.map +1 -0
- package/dist/components/ai-agent-status/index.d.ts +2 -0
- package/dist/components/ai-agent-status/index.js +2 -0
- package/dist/components/ai-agent-status/meta.js +17 -0
- package/dist/components/ai-agent-status/meta.js.map +1 -0
- package/dist/components/ai-conversation/ai-conversation.d.ts +45 -0
- package/dist/components/ai-conversation/ai-conversation.d.ts.map +1 -0
- package/dist/components/ai-conversation/ai-conversation.js +138 -0
- package/dist/components/ai-conversation/ai-conversation.js.map +1 -0
- package/dist/components/ai-conversation/index.d.ts +2 -0
- package/dist/components/ai-conversation/index.js +2 -0
- package/dist/components/ai-conversation/meta.js +17 -0
- package/dist/components/ai-conversation/meta.js.map +1 -0
- package/dist/components/ai-message/ai-message.d.ts +56 -0
- package/dist/components/ai-message/ai-message.d.ts.map +1 -0
- package/dist/components/ai-message/ai-message.js +90 -0
- package/dist/components/ai-message/ai-message.js.map +1 -0
- package/dist/components/ai-message/index.d.ts +2 -0
- package/dist/components/ai-message/index.js +2 -0
- package/dist/components/ai-message/meta.js +17 -0
- package/dist/components/ai-message/meta.js.map +1 -0
- package/dist/components/ai-model-selector/ai-model-selector.d.ts +42 -0
- package/dist/components/ai-model-selector/ai-model-selector.d.ts.map +1 -0
- package/dist/components/ai-model-selector/ai-model-selector.js +48 -0
- package/dist/components/ai-model-selector/ai-model-selector.js.map +1 -0
- package/dist/components/ai-model-selector/index.d.ts +2 -0
- package/dist/components/ai-model-selector/index.js +2 -0
- package/dist/components/ai-model-selector/meta.js +17 -0
- package/dist/components/ai-model-selector/meta.js.map +1 -0
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts +61 -0
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -0
- package/dist/components/ai-prompt-input/ai-prompt-input.js +170 -0
- package/dist/components/ai-prompt-input/ai-prompt-input.js.map +1 -0
- package/dist/components/ai-prompt-input/index.d.ts +2 -0
- package/dist/components/ai-prompt-input/index.js +2 -0
- package/dist/components/ai-prompt-input/meta.js +17 -0
- package/dist/components/ai-prompt-input/meta.js.map +1 -0
- package/dist/components/ai-reasoning/ai-reasoning.d.ts +24 -0
- package/dist/components/ai-reasoning/ai-reasoning.d.ts.map +1 -0
- package/dist/components/ai-reasoning/ai-reasoning.js +64 -0
- package/dist/components/ai-reasoning/ai-reasoning.js.map +1 -0
- package/dist/components/ai-reasoning/index.d.ts +2 -0
- package/dist/components/ai-reasoning/index.js +2 -0
- package/dist/components/ai-reasoning/meta.js +17 -0
- package/dist/components/ai-reasoning/meta.js.map +1 -0
- package/dist/components/ai-response/ai-response.d.ts +36 -0
- package/dist/components/ai-response/ai-response.d.ts.map +1 -0
- package/dist/components/ai-response/ai-response.js +46 -0
- package/dist/components/ai-response/ai-response.js.map +1 -0
- package/dist/components/ai-response/index.d.ts +2 -0
- package/dist/components/ai-response/index.js +2 -0
- package/dist/components/ai-response/meta.js +17 -0
- package/dist/components/ai-response/meta.js.map +1 -0
- package/dist/components/ai-sources/ai-sources.d.ts +44 -0
- package/dist/components/ai-sources/ai-sources.d.ts.map +1 -0
- package/dist/components/ai-sources/ai-sources.js +112 -0
- package/dist/components/ai-sources/ai-sources.js.map +1 -0
- package/dist/components/ai-sources/index.d.ts +2 -0
- package/dist/components/ai-sources/index.js +2 -0
- package/dist/components/ai-sources/meta.js +17 -0
- package/dist/components/ai-sources/meta.js.map +1 -0
- package/dist/components/ai-token-usage/ai-token-usage.d.ts +34 -0
- package/dist/components/ai-token-usage/ai-token-usage.d.ts.map +1 -0
- package/dist/components/ai-token-usage/ai-token-usage.js +58 -0
- package/dist/components/ai-token-usage/ai-token-usage.js.map +1 -0
- package/dist/components/ai-token-usage/index.d.ts +2 -0
- package/dist/components/ai-token-usage/index.js +2 -0
- package/dist/components/ai-token-usage/meta.js +17 -0
- package/dist/components/ai-token-usage/meta.js.map +1 -0
- package/dist/components/ai-tool/ai-tool.d.ts +50 -0
- package/dist/components/ai-tool/ai-tool.d.ts.map +1 -0
- package/dist/components/ai-tool/ai-tool.js +129 -0
- package/dist/components/ai-tool/ai-tool.js.map +1 -0
- package/dist/components/ai-tool/index.d.ts +2 -0
- package/dist/components/ai-tool/index.js +2 -0
- package/dist/components/ai-tool/meta.js +17 -0
- package/dist/components/ai-tool/meta.js.map +1 -0
- package/dist/components/alert/alert.d.ts +32 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/alert.js +49 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +2 -0
- package/dist/components/alert/meta.js +17 -0
- package/dist/components/alert/meta.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +23 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +44 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/avatar/meta.js +17 -0
- package/dist/components/avatar/meta.js.map +1 -0
- package/dist/components/badge/badge.d.ts +20 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +47 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/badge/meta.js +17 -0
- package/dist/components/badge/meta.js.map +1 -0
- package/dist/components/button/button.d.ts +28 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +77 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/button/meta.js +17 -0
- package/dist/components/button/meta.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +16 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -0
- package/dist/components/calendar/calendar.js +70 -0
- package/dist/components/calendar/calendar.js.map +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +2 -0
- package/dist/components/calendar/meta.js +17 -0
- package/dist/components/calendar/meta.js.map +1 -0
- package/dist/components/card/card.d.ts +23 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +53 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +2 -0
- package/dist/components/card/meta.js +17 -0
- package/dist/components/card/meta.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +15 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +45 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/checkbox/meta.js +17 -0
- package/dist/components/checkbox/meta.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +46 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.js +110 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +2 -0
- package/dist/components/code-block/meta.js +17 -0
- package/dist/components/code-block/meta.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +59 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -0
- package/dist/components/combobox/combobox.js +346 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/combobox/meta.js +17 -0
- package/dist/components/combobox/meta.js.map +1 -0
- package/dist/components/command/command.d.ts +65 -0
- package/dist/components/command/command.d.ts.map +1 -0
- package/dist/components/command/command.js +330 -0
- package/dist/components/command/command.js.map +1 -0
- package/dist/components/command/index.d.ts +2 -0
- package/dist/components/command/index.js +2 -0
- package/dist/components/command/meta.js +17 -0
- package/dist/components/command/meta.js.map +1 -0
- package/dist/components/data-table/data-table.d.ts +91 -0
- package/dist/components/data-table/data-table.d.ts.map +1 -0
- package/dist/components/data-table/data-table.js +263 -0
- package/dist/components/data-table/data-table.js.map +1 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +2 -0
- package/dist/components/data-table/meta.js +22 -0
- package/dist/components/data-table/meta.js.map +1 -0
- package/dist/components/date-picker/date-picker.d.ts +31 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.js +123 -0
- package/dist/components/date-picker/date-picker.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/date-picker/meta.js +21 -0
- package/dist/components/date-picker/meta.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +30 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -0
- package/dist/components/dialog/dialog.js +79 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dialog/meta.js +17 -0
- package/dist/components/dialog/meta.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +32 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/drawer.js +153 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/meta.js +17 -0
- package/dist/components/drawer/meta.js.map +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +43 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +130 -0
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/components/dropdown-menu/index.d.ts +2 -0
- package/dist/components/dropdown-menu/index.js +2 -0
- package/dist/components/dropdown-menu/meta.js +17 -0
- package/dist/components/dropdown-menu/meta.js.map +1 -0
- package/dist/components/empty-state/empty-state.d.ts +24 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state.js +73 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.js +2 -0
- package/dist/components/empty-state/meta.js +17 -0
- package/dist/components/empty-state/meta.js.map +1 -0
- package/dist/components/form/form.d.ts +43 -0
- package/dist/components/form/form.d.ts.map +1 -0
- package/dist/components/form/form.js +127 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +2 -0
- package/dist/components/form/meta.js +17 -0
- package/dist/components/form/meta.js.map +1 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.js +2 -0
- package/dist/components/input/input.d.ts +21 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/input.js +34 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/meta.js +17 -0
- package/dist/components/input/meta.js.map +1 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/index.js +2 -0
- package/dist/components/label/label.d.ts +14 -0
- package/dist/components/label/label.d.ts.map +1 -0
- package/dist/components/label/label.js +20 -0
- package/dist/components/label/label.js.map +1 -0
- package/dist/components/label/meta.js +17 -0
- package/dist/components/label/meta.js.map +1 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/pagination/meta.js +17 -0
- package/dist/components/pagination/meta.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +33 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/pagination.js +143 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +2 -0
- package/dist/components/popover/meta.js +17 -0
- package/dist/components/popover/meta.js.map +1 -0
- package/dist/components/popover/popover.d.ts +24 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/popover.js +60 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/index.js +2 -0
- package/dist/components/progress/meta.js +17 -0
- package/dist/components/progress/meta.js.map +1 -0
- package/dist/components/progress/progress.d.ts +21 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.js +55 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +2 -0
- package/dist/components/radio-group/meta.js +17 -0
- package/dist/components/radio-group/meta.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +17 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group/radio-group.js +29 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/select/meta.js +17 -0
- package/dist/components/select/meta.js.map +1 -0
- package/dist/components/select/select.d.ts +37 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/select/select.js +128 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/separator/meta.js +17 -0
- package/dist/components/separator/meta.js.map +1 -0
- package/dist/components/separator/separator.d.ts +15 -0
- package/dist/components/separator/separator.d.ts.map +1 -0
- package/dist/components/separator/separator.js +23 -0
- package/dist/components/separator/separator.js.map +1 -0
- package/dist/components/sheet/index.d.ts +2 -0
- package/dist/components/sheet/index.js +2 -0
- package/dist/components/sheet/meta.js +17 -0
- package/dist/components/sheet/meta.js.map +1 -0
- package/dist/components/sheet/sheet.d.ts +31 -0
- package/dist/components/sheet/sheet.d.ts.map +1 -0
- package/dist/components/sheet/sheet.js +90 -0
- package/dist/components/sheet/sheet.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeleton/meta.js +17 -0
- package/dist/components/skeleton/meta.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +20 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.js +29 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/meta.js +17 -0
- package/dist/components/slider/meta.js.map +1 -0
- package/dist/components/slider/slider.d.ts +29 -0
- package/dist/components/slider/slider.d.ts.map +1 -0
- package/dist/components/slider/slider.js +61 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.js +2 -0
- package/dist/components/spinner/meta.js +17 -0
- package/dist/components/spinner/meta.js.map +1 -0
- package/dist/components/spinner/spinner.d.ts +21 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.js +45 -0
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/switch/meta.js +17 -0
- package/dist/components/switch/meta.js.map +1 -0
- package/dist/components/switch/switch.d.ts +15 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/switch/switch.js +21 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/table/meta.js +17 -0
- package/dist/components/table/meta.js.map +1 -0
- package/dist/components/table/table.d.ts +41 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/table/table.js +78 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tabs/meta.js +17 -0
- package/dist/components/tabs/meta.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +28 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.js +58 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/index.js +3 -0
- package/dist/components/toast/meta.js +17 -0
- package/dist/components/toast/meta.js.map +1 -0
- package/dist/components/toast/toast-store.d.ts +84 -0
- package/dist/components/toast/toast-store.d.ts.map +1 -0
- package/dist/components/toast/toast-store.js +115 -0
- package/dist/components/toast/toast-store.js.map +1 -0
- package/dist/components/toast/toast.d.ts +39 -0
- package/dist/components/toast/toast.d.ts.map +1 -0
- package/dist/components/toast/toast.js +140 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/components/tooltip/meta.js +17 -0
- package/dist/components/tooltip/meta.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +24 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.js +38 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +51 -0
- package/dist/lib/styles.d.ts +21 -0
- package/dist/lib/styles.d.ts.map +1 -0
- package/dist/lib/styles.js +22 -0
- package/dist/lib/styles.js.map +1 -0
- package/dist/lib/utils.d.ts +11 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +21 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/registry/blocks.d.ts +15 -0
- package/dist/registry/blocks.d.ts.map +1 -0
- package/dist/registry/blocks.js +32 -0
- package/dist/registry/blocks.js.map +1 -0
- package/dist/registry/components.d.ts +18 -0
- package/dist/registry/components.d.ts.map +1 -0
- package/dist/registry/components.js +112 -0
- package/dist/registry/components.js.map +1 -0
- package/dist/registry/schema.d.ts +44 -0
- package/dist/registry/schema.d.ts.map +1 -0
- package/dist/registry/schema.js +33 -0
- package/dist/registry/schema.js.map +1 -0
- package/package.json +74 -0
- package/src/blocks/admin-users/admin-users.stories.tsx +83 -0
- package/src/blocks/admin-users/admin-users.test.tsx +159 -0
- package/src/blocks/admin-users/admin-users.tsx +251 -0
- package/src/blocks/admin-users/index.ts +1 -0
- package/src/blocks/admin-users/meta.ts +27 -0
- package/src/blocks/ai-chat/ai-chat.stories.tsx +149 -0
- package/src/blocks/ai-chat/ai-chat.test.tsx +166 -0
- package/src/blocks/ai-chat/ai-chat.tsx +280 -0
- package/src/blocks/ai-chat/index.ts +7 -0
- package/src/blocks/ai-chat/meta.ts +32 -0
- package/src/blocks/dashboard/dashboard.stories.tsx +106 -0
- package/src/blocks/dashboard/dashboard.test.tsx +94 -0
- package/src/blocks/dashboard/dashboard.tsx +192 -0
- package/src/blocks/dashboard/index.ts +6 -0
- package/src/blocks/dashboard/meta.ts +18 -0
- package/src/blocks/forgot-password/forgot-password.stories.tsx +41 -0
- package/src/blocks/forgot-password/forgot-password.test.tsx +62 -0
- package/src/blocks/forgot-password/forgot-password.tsx +158 -0
- package/src/blocks/forgot-password/index.ts +1 -0
- package/src/blocks/forgot-password/meta.ts +18 -0
- package/src/blocks/login/index.ts +1 -0
- package/src/blocks/login/login.stories.tsx +46 -0
- package/src/blocks/login/login.test.tsx +100 -0
- package/src/blocks/login/login.tsx +178 -0
- package/src/blocks/login/meta.ts +18 -0
- package/src/blocks/pricing/index.ts +1 -0
- package/src/blocks/pricing/meta.ts +18 -0
- package/src/blocks/pricing/pricing.stories.tsx +62 -0
- package/src/blocks/pricing/pricing.test.tsx +101 -0
- package/src/blocks/pricing/pricing.tsx +176 -0
- package/src/blocks/settings/index.ts +6 -0
- package/src/blocks/settings/meta.ts +29 -0
- package/src/blocks/settings/settings.stories.tsx +94 -0
- package/src/blocks/settings/settings.test.tsx +167 -0
- package/src/blocks/settings/settings.tsx +317 -0
- package/src/blocks/signup/index.ts +1 -0
- package/src/blocks/signup/meta.ts +18 -0
- package/src/blocks/signup/signup.stories.tsx +27 -0
- package/src/blocks/signup/signup.test.tsx +97 -0
- package/src/blocks/signup/signup.tsx +240 -0
- package/src/components/accordion/accordion.stories.tsx +90 -0
- package/src/components/accordion/accordion.test.tsx +156 -0
- package/src/components/accordion/accordion.tsx +88 -0
- package/src/components/accordion/index.ts +9 -0
- package/src/components/accordion/meta.ts +16 -0
- package/src/components/activity-feed/activity-feed.stories.tsx +163 -0
- package/src/components/activity-feed/activity-feed.test.tsx +125 -0
- package/src/components/activity-feed/activity-feed.tsx +115 -0
- package/src/components/activity-feed/index.ts +12 -0
- package/src/components/activity-feed/meta.ts +17 -0
- package/src/components/ai-agent-status/ai-agent-status.stories.tsx +86 -0
- package/src/components/ai-agent-status/ai-agent-status.test.tsx +66 -0
- package/src/components/ai-agent-status/ai-agent-status.tsx +88 -0
- package/src/components/ai-agent-status/index.ts +6 -0
- package/src/components/ai-agent-status/meta.ts +17 -0
- package/src/components/ai-conversation/ai-conversation.stories.tsx +126 -0
- package/src/components/ai-conversation/ai-conversation.test.tsx +144 -0
- package/src/components/ai-conversation/ai-conversation.tsx +229 -0
- package/src/components/ai-conversation/index.ts +9 -0
- package/src/components/ai-conversation/meta.ts +20 -0
- package/src/components/ai-message/ai-message.stories.tsx +106 -0
- package/src/components/ai-message/ai-message.test.tsx +160 -0
- package/src/components/ai-message/ai-message.tsx +162 -0
- package/src/components/ai-message/index.ts +13 -0
- package/src/components/ai-message/meta.ts +17 -0
- package/src/components/ai-model-selector/ai-model-selector.stories.tsx +66 -0
- package/src/components/ai-model-selector/ai-model-selector.test.tsx +120 -0
- package/src/components/ai-model-selector/ai-model-selector.tsx +112 -0
- package/src/components/ai-model-selector/index.ts +1 -0
- package/src/components/ai-model-selector/meta.ts +17 -0
- package/src/components/ai-prompt-input/ai-prompt-input.stories.tsx +145 -0
- package/src/components/ai-prompt-input/ai-prompt-input.test.tsx +273 -0
- package/src/components/ai-prompt-input/ai-prompt-input.tsx +306 -0
- package/src/components/ai-prompt-input/index.ts +11 -0
- package/src/components/ai-prompt-input/meta.ts +18 -0
- package/src/components/ai-reasoning/ai-reasoning.stories.tsx +60 -0
- package/src/components/ai-reasoning/ai-reasoning.test.tsx +95 -0
- package/src/components/ai-reasoning/ai-reasoning.tsx +106 -0
- package/src/components/ai-reasoning/index.ts +7 -0
- package/src/components/ai-reasoning/meta.ts +17 -0
- package/src/components/ai-response/ai-response.stories.tsx +75 -0
- package/src/components/ai-response/ai-response.test.tsx +96 -0
- package/src/components/ai-response/ai-response.tsx +95 -0
- package/src/components/ai-response/index.ts +7 -0
- package/src/components/ai-response/meta.ts +17 -0
- package/src/components/ai-sources/ai-sources.stories.tsx +93 -0
- package/src/components/ai-sources/ai-sources.test.tsx +102 -0
- package/src/components/ai-sources/ai-sources.tsx +186 -0
- package/src/components/ai-sources/index.ts +11 -0
- package/src/components/ai-sources/meta.ts +17 -0
- package/src/components/ai-token-usage/ai-token-usage.stories.tsx +59 -0
- package/src/components/ai-token-usage/ai-token-usage.test.tsx +83 -0
- package/src/components/ai-token-usage/ai-token-usage.tsx +105 -0
- package/src/components/ai-token-usage/index.ts +6 -0
- package/src/components/ai-token-usage/meta.ts +16 -0
- package/src/components/ai-tool/ai-tool.stories.tsx +96 -0
- package/src/components/ai-tool/ai-tool.test.tsx +137 -0
- package/src/components/ai-tool/ai-tool.tsx +235 -0
- package/src/components/ai-tool/index.ts +13 -0
- package/src/components/ai-tool/meta.ts +17 -0
- package/src/components/alert/alert.stories.tsx +101 -0
- package/src/components/alert/alert.test.tsx +94 -0
- package/src/components/alert/alert.tsx +89 -0
- package/src/components/alert/index.ts +8 -0
- package/src/components/alert/meta.ts +16 -0
- package/src/components/avatar/avatar.stories.tsx +58 -0
- package/src/components/avatar/avatar.test.tsx +64 -0
- package/src/components/avatar/avatar.tsx +68 -0
- package/src/components/avatar/index.ts +9 -0
- package/src/components/avatar/meta.ts +15 -0
- package/src/components/badge/badge.stories.tsx +68 -0
- package/src/components/badge/badge.test.tsx +61 -0
- package/src/components/badge/badge.tsx +54 -0
- package/src/components/badge/index.ts +1 -0
- package/src/components/badge/meta.ts +15 -0
- package/src/components/button/button.stories.tsx +128 -0
- package/src/components/button/button.test.tsx +224 -0
- package/src/components/button/button.tsx +114 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button/meta.ts +16 -0
- package/src/components/calendar/calendar.stories.tsx +105 -0
- package/src/components/calendar/calendar.test.tsx +255 -0
- package/src/components/calendar/calendar.tsx +115 -0
- package/src/components/calendar/index.ts +1 -0
- package/src/components/calendar/meta.ts +17 -0
- package/src/components/card/card.stories.tsx +61 -0
- package/src/components/card/card.test.tsx +66 -0
- package/src/components/card/card.tsx +81 -0
- package/src/components/card/index.ts +9 -0
- package/src/components/card/meta.ts +16 -0
- package/src/components/checkbox/checkbox.stories.tsx +124 -0
- package/src/components/checkbox/checkbox.test.tsx +121 -0
- package/src/components/checkbox/checkbox.tsx +66 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/meta.ts +16 -0
- package/src/components/code-block/code-block.stories.tsx +62 -0
- package/src/components/code-block/code-block.test.tsx +139 -0
- package/src/components/code-block/code-block.tsx +188 -0
- package/src/components/code-block/index.ts +1 -0
- package/src/components/code-block/meta.ts +17 -0
- package/src/components/combobox/combobox.stories.tsx +171 -0
- package/src/components/combobox/combobox.test.tsx +429 -0
- package/src/components/combobox/combobox.tsx +544 -0
- package/src/components/combobox/index.ts +15 -0
- package/src/components/combobox/meta.ts +17 -0
- package/src/components/command/command.stories.tsx +152 -0
- package/src/components/command/command.test.tsx +380 -0
- package/src/components/command/command.tsx +482 -0
- package/src/components/command/index.ts +17 -0
- package/src/components/command/meta.ts +18 -0
- package/src/components/data-table/data-table.stories.tsx +151 -0
- package/src/components/data-table/data-table.test.tsx +288 -0
- package/src/components/data-table/data-table.tsx +485 -0
- package/src/components/data-table/index.ts +13 -0
- package/src/components/data-table/meta.ts +19 -0
- package/src/components/date-picker/date-picker.stories.tsx +103 -0
- package/src/components/date-picker/date-picker.test.tsx +205 -0
- package/src/components/date-picker/date-picker.tsx +198 -0
- package/src/components/date-picker/index.ts +6 -0
- package/src/components/date-picker/meta.ts +18 -0
- package/src/components/dialog/dialog.stories.tsx +140 -0
- package/src/components/dialog/dialog.test.tsx +186 -0
- package/src/components/dialog/dialog.tsx +132 -0
- package/src/components/dialog/index.ts +16 -0
- package/src/components/dialog/meta.ts +16 -0
- package/src/components/drawer/drawer.stories.tsx +111 -0
- package/src/components/drawer/drawer.test.tsx +187 -0
- package/src/components/drawer/drawer.tsx +293 -0
- package/src/components/drawer/index.ts +16 -0
- package/src/components/drawer/meta.ts +16 -0
- package/src/components/dropdown-menu/dropdown-menu.stories.tsx +128 -0
- package/src/components/dropdown-menu/dropdown-menu.test.tsx +321 -0
- package/src/components/dropdown-menu/dropdown-menu.tsx +242 -0
- package/src/components/dropdown-menu/index.ts +21 -0
- package/src/components/dropdown-menu/meta.ts +17 -0
- package/src/components/empty-state/empty-state.stories.tsx +70 -0
- package/src/components/empty-state/empty-state.test.tsx +97 -0
- package/src/components/empty-state/empty-state.tsx +92 -0
- package/src/components/empty-state/index.ts +9 -0
- package/src/components/empty-state/meta.ts +16 -0
- package/src/components/form/form.stories.tsx +144 -0
- package/src/components/form/form.test.tsx +203 -0
- package/src/components/form/form.tsx +221 -0
- package/src/components/form/index.ts +13 -0
- package/src/components/form/meta.ts +17 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/input/input.stories.tsx +84 -0
- package/src/components/input/input.test.tsx +108 -0
- package/src/components/input/input.tsx +51 -0
- package/src/components/input/meta.ts +15 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/label/label.stories.tsx +51 -0
- package/src/components/label/label.test.tsx +55 -0
- package/src/components/label/label.tsx +26 -0
- package/src/components/label/meta.ts +15 -0
- package/src/components/pagination/index.ts +10 -0
- package/src/components/pagination/meta.ts +17 -0
- package/src/components/pagination/pagination.stories.tsx +129 -0
- package/src/components/pagination/pagination.test.tsx +119 -0
- package/src/components/pagination/pagination.tsx +142 -0
- package/src/components/popover/index.ts +9 -0
- package/src/components/popover/meta.ts +18 -0
- package/src/components/popover/popover.stories.tsx +84 -0
- package/src/components/popover/popover.test.tsx +163 -0
- package/src/components/popover/popover.tsx +89 -0
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/meta.ts +17 -0
- package/src/components/progress/progress.stories.tsx +90 -0
- package/src/components/progress/progress.test.tsx +78 -0
- package/src/components/progress/progress.tsx +70 -0
- package/src/components/radio-group/index.ts +6 -0
- package/src/components/radio-group/meta.ts +16 -0
- package/src/components/radio-group/radio-group.stories.tsx +102 -0
- package/src/components/radio-group/radio-group.test.tsx +152 -0
- package/src/components/radio-group/radio-group.tsx +53 -0
- package/src/components/select/index.ts +14 -0
- package/src/components/select/meta.ts +16 -0
- package/src/components/select/select.stories.tsx +137 -0
- package/src/components/select/select.test.tsx +209 -0
- package/src/components/select/select.tsx +222 -0
- package/src/components/separator/index.ts +1 -0
- package/src/components/separator/meta.ts +15 -0
- package/src/components/separator/separator.stories.tsx +42 -0
- package/src/components/separator/separator.test.tsx +46 -0
- package/src/components/separator/separator.tsx +33 -0
- package/src/components/sheet/index.ts +14 -0
- package/src/components/sheet/meta.ts +16 -0
- package/src/components/sheet/sheet.stories.tsx +107 -0
- package/src/components/sheet/sheet.test.tsx +152 -0
- package/src/components/sheet/sheet.tsx +160 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skeleton/meta.ts +15 -0
- package/src/components/skeleton/skeleton.stories.tsx +46 -0
- package/src/components/skeleton/skeleton.test.tsx +57 -0
- package/src/components/skeleton/skeleton.tsx +28 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/slider/meta.ts +19 -0
- package/src/components/slider/slider.stories.tsx +87 -0
- package/src/components/slider/slider.test.tsx +148 -0
- package/src/components/slider/slider.tsx +135 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/spinner/meta.ts +15 -0
- package/src/components/spinner/spinner.stories.tsx +47 -0
- package/src/components/spinner/spinner.test.tsx +41 -0
- package/src/components/spinner/spinner.tsx +68 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/meta.ts +15 -0
- package/src/components/switch/switch.stories.tsx +70 -0
- package/src/components/switch/switch.test.tsx +101 -0
- package/src/components/switch/switch.tsx +42 -0
- package/src/components/table/index.ts +11 -0
- package/src/components/table/meta.ts +17 -0
- package/src/components/table/table.stories.tsx +131 -0
- package/src/components/table/table.test.tsx +153 -0
- package/src/components/table/table.tsx +138 -0
- package/src/components/tabs/index.ts +11 -0
- package/src/components/tabs/meta.ts +17 -0
- package/src/components/tabs/tabs.stories.tsx +139 -0
- package/src/components/tabs/tabs.test.tsx +148 -0
- package/src/components/tabs/tabs.tsx +106 -0
- package/src/components/toast/index.ts +24 -0
- package/src/components/toast/meta.ts +18 -0
- package/src/components/toast/toast-store.ts +181 -0
- package/src/components/toast/toast.stories.tsx +167 -0
- package/src/components/toast/toast.test.tsx +306 -0
- package/src/components/toast/toast.tsx +241 -0
- package/src/components/tooltip/index.ts +8 -0
- package/src/components/tooltip/meta.ts +17 -0
- package/src/components/tooltip/tooltip.stories.tsx +89 -0
- package/src/components/tooltip/tooltip.test.tsx +120 -0
- package/src/components/tooltip/tooltip.tsx +58 -0
- package/src/index.ts +50 -0
- package/src/lib/styles.ts +26 -0
- package/src/lib/utils.test.ts +32 -0
- package/src/lib/utils.ts +24 -0
- package/src/registry/blocks.ts +30 -0
- package/src/registry/components.ts +114 -0
- package/src/registry/meta.test.ts +234 -0
- package/src/registry/schema.ts +58 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Collapsible } from "radix-ui";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
//#region src/components/ai-sources/ai-sources.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Where a response came from.
|
|
6
|
+
*
|
|
7
|
+
* Citations are the difference between an assertion and a claim someone can
|
|
8
|
+
* check, so they are first-class here rather than a footnote: an inline marker
|
|
9
|
+
* next to the sentence, and a list underneath that says what each marker is.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* An inline citation marker.
|
|
13
|
+
*
|
|
14
|
+
* The visible text is a bare number, which tells a screen reader user nothing,
|
|
15
|
+
* so the real title goes in the accessible name. Rendered as a link when given
|
|
16
|
+
* an href, and as plain text otherwise — a marker that looks clickable and is
|
|
17
|
+
* not is worse than one that does not.
|
|
18
|
+
*/
|
|
19
|
+
interface InlineCitationProps extends ComponentPropsWithRef<"a"> {
|
|
20
|
+
/** Position in the source list, starting at 1. */
|
|
21
|
+
index: number;
|
|
22
|
+
/** What is being cited. Becomes the accessible name. */
|
|
23
|
+
title: string;
|
|
24
|
+
}
|
|
25
|
+
declare function InlineCitation({ className, index, title, href, ...props }: InlineCitationProps): import("react").JSX.Element;
|
|
26
|
+
type SourcesProps = ComponentPropsWithRef<typeof Collapsible.Root>;
|
|
27
|
+
declare function Sources({ className, ...props }: SourcesProps): import("react").JSX.Element;
|
|
28
|
+
interface SourcesTriggerProps extends ComponentPropsWithRef<typeof Collapsible.Trigger> {
|
|
29
|
+
count: number;
|
|
30
|
+
}
|
|
31
|
+
declare function SourcesTrigger({ className, count, children, ...props }: SourcesTriggerProps): import("react").JSX.Element;
|
|
32
|
+
declare function SourcesContent({ className, children, ...props }: ComponentPropsWithRef<typeof Collapsible.Content>): import("react").JSX.Element;
|
|
33
|
+
interface SourceProps extends ComponentPropsWithRef<"a"> {
|
|
34
|
+
index: number;
|
|
35
|
+
title: string;
|
|
36
|
+
/** Where it came from — a domain, a filename, a document title. */
|
|
37
|
+
origin?: string;
|
|
38
|
+
/** The quoted passage, if there is one. */
|
|
39
|
+
excerpt?: string;
|
|
40
|
+
}
|
|
41
|
+
declare function Source({ className, index, title, origin, excerpt, ...props }: SourceProps): import("react").JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { InlineCitation, InlineCitationProps, Source, SourceProps, Sources, SourcesContent, SourcesProps, SourcesTrigger, SourcesTriggerProps };
|
|
44
|
+
//# sourceMappingURL=ai-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-sources.d.ts","names":[],"sources":["../../../src/components/ai-sources/ai-sources.tsx"],"mappings":";;;;;;;;;;;;;;;;;;UAwBiB,4BAA4B;;EAE3C;;EAEA;;iBAGc,iBACd,WACA,OACA,OACA,SACG,SACF,sCAAmB,IAAA;KAmCV,eAAe,6BAA6B,YAAqB;iBAE7D,UAAU,cAAc,SAAS,+BAAY,IAAA;UAU5C,4BAA4B,6BACpC,YAAqB;EAE5B;;iBAGc,iBAAiB,WAAW,OAAO,aAAa,SAAS,sCAAmB,IAAA;iBAgC5E,iBACd,WACA,aACG,SACF,6BAA6B,YAAqB,2BAAQ,IAAA;UAkB5C,oBAAoB;EACnC;EACA;;EAEA;;EAEA;;iBAGc,SAAS,WAAW,OAAO,OAAO,QAAQ,YAAY,SAAS,8BAAW,IAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { focusRing } from "../../lib/styles.js";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { Collapsible } from "radix-ui";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/ai-sources/ai-sources.tsx
|
|
7
|
+
function InlineCitation({ className, index, title, href, ...props }) {
|
|
8
|
+
const shared = cn("mx-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded px-1 align-[0.15em]", "bg-muted text-2xs font-medium text-muted-foreground tabular-nums", className);
|
|
9
|
+
if (!href) return /* @__PURE__ */ jsxs("span", {
|
|
10
|
+
"data-slot": "inline-citation",
|
|
11
|
+
className: shared,
|
|
12
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
children: index
|
|
15
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
16
|
+
className: "sr-only",
|
|
17
|
+
children: [
|
|
18
|
+
"Source ",
|
|
19
|
+
index,
|
|
20
|
+
": ",
|
|
21
|
+
title
|
|
22
|
+
]
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ jsx("a", {
|
|
26
|
+
"data-slot": "inline-citation",
|
|
27
|
+
href,
|
|
28
|
+
"aria-label": `Source ${String(index)}: ${title}`,
|
|
29
|
+
className: cn(shared, "transition-colors duration-[var(--duration-fast)] hover:bg-accent hover:text-foreground", focusRing),
|
|
30
|
+
...props,
|
|
31
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: index
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function Sources({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
39
|
+
"data-slot": "sources",
|
|
40
|
+
className: cn("w-full text-sm", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function SourcesTrigger({ className, count, children, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
46
|
+
"data-slot": "sources-trigger",
|
|
47
|
+
className: cn("flex items-center gap-1.5 rounded-md text-xs text-muted-foreground", "transition-colors duration-[var(--duration-fast)] hover:text-foreground", "[&[data-state=open]>svg:last-child]:rotate-180", focusRing, className),
|
|
48
|
+
...props,
|
|
49
|
+
children: [children ?? `${String(count)} ${count === 1 ? "source" : "sources"}`, /* @__PURE__ */ jsx("svg", {
|
|
50
|
+
viewBox: "0 0 24 24",
|
|
51
|
+
fill: "none",
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
className: "size-3.5 shrink-0 transition-transform duration-[var(--duration-normal)]",
|
|
54
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
55
|
+
d: "m6 9 6 6 6-6",
|
|
56
|
+
stroke: "currentColor",
|
|
57
|
+
strokeWidth: "2",
|
|
58
|
+
strokeLinecap: "round",
|
|
59
|
+
strokeLinejoin: "round"
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function SourcesContent({ className, children, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
66
|
+
"data-slot": "sources-content",
|
|
67
|
+
className: cn("overflow-hidden", "data-[state=closed]:animate-accordion-close data-[state=open]:animate-accordion-open", className),
|
|
68
|
+
...props,
|
|
69
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
70
|
+
className: "mt-2 flex flex-col gap-1.5",
|
|
71
|
+
children
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function Source({ className, index, title, origin, excerpt, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsx("li", {
|
|
77
|
+
"data-slot": "source",
|
|
78
|
+
children: /* @__PURE__ */ jsxs("a", {
|
|
79
|
+
className: cn("flex gap-2 rounded-md border border-border bg-card/50 px-2.5 py-2", "transition-colors duration-[var(--duration-fast)] hover:bg-accent/50", focusRing, className),
|
|
80
|
+
...props,
|
|
81
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
className: "mt-0.5 grid size-4 shrink-0 place-items-center rounded bg-muted text-2xs font-medium text-muted-foreground tabular-nums",
|
|
84
|
+
children: index
|
|
85
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
86
|
+
className: "min-w-0 flex-1",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: "block truncate text-xs font-medium text-foreground",
|
|
90
|
+
children: title
|
|
91
|
+
}),
|
|
92
|
+
origin ? /* @__PURE__ */ jsx("span", {
|
|
93
|
+
className: "block truncate text-2xs text-muted-foreground",
|
|
94
|
+
children: origin
|
|
95
|
+
}) : null,
|
|
96
|
+
excerpt ? /* @__PURE__ */ jsxs("span", {
|
|
97
|
+
className: "mt-1 line-clamp-2 block text-xs text-muted-foreground",
|
|
98
|
+
children: [
|
|
99
|
+
"“",
|
|
100
|
+
excerpt,
|
|
101
|
+
"”"
|
|
102
|
+
]
|
|
103
|
+
}) : null
|
|
104
|
+
]
|
|
105
|
+
})]
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { InlineCitation, Source, Sources, SourcesContent, SourcesTrigger };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=ai-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-sources.js","names":["CollapsiblePrimitive"],"sources":["../../../src/components/ai-sources/ai-sources.tsx"],"sourcesContent":["\"use client\";\n\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport type { ComponentPropsWithRef } from \"react\";\n\nimport { focusRing } from \"@/lib/styles\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * Where a response came from.\n *\n * Citations are the difference between an assertion and a claim someone can\n * check, so they are first-class here rather than a footnote: an inline marker\n * next to the sentence, and a list underneath that says what each marker is.\n */\n\n/**\n * An inline citation marker.\n *\n * The visible text is a bare number, which tells a screen reader user nothing,\n * so the real title goes in the accessible name. Rendered as a link when given\n * an href, and as plain text otherwise — a marker that looks clickable and is\n * not is worse than one that does not.\n */\nexport interface InlineCitationProps extends ComponentPropsWithRef<\"a\"> {\n /** Position in the source list, starting at 1. */\n index: number;\n /** What is being cited. Becomes the accessible name. */\n title: string;\n}\n\nexport function InlineCitation({\n className,\n index,\n title,\n href,\n ...props\n}: InlineCitationProps) {\n const shared = cn(\n \"mx-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded px-1 align-[0.15em]\",\n \"bg-muted text-2xs font-medium text-muted-foreground tabular-nums\",\n className,\n );\n\n if (!href) {\n return (\n <span data-slot=\"inline-citation\" className={shared}>\n <span aria-hidden=\"true\">{index}</span>\n <span className=\"sr-only\">\n Source {index}: {title}\n </span>\n </span>\n );\n }\n\n return (\n <a\n data-slot=\"inline-citation\"\n href={href}\n aria-label={`Source ${String(index)}: ${title}`}\n className={cn(\n shared,\n \"transition-colors duration-[var(--duration-fast)] hover:bg-accent hover:text-foreground\",\n focusRing,\n )}\n {...props}\n >\n <span aria-hidden=\"true\">{index}</span>\n </a>\n );\n}\n\nexport type SourcesProps = ComponentPropsWithRef<typeof CollapsiblePrimitive.Root>;\n\nexport function Sources({ className, ...props }: SourcesProps) {\n return (\n <CollapsiblePrimitive.Root\n data-slot=\"sources\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport interface SourcesTriggerProps extends ComponentPropsWithRef<\n typeof CollapsiblePrimitive.Trigger\n> {\n count: number;\n}\n\nexport function SourcesTrigger({ className, count, children, ...props }: SourcesTriggerProps) {\n return (\n <CollapsiblePrimitive.Trigger\n data-slot=\"sources-trigger\"\n className={cn(\n \"flex items-center gap-1.5 rounded-md text-xs text-muted-foreground\",\n \"transition-colors duration-[var(--duration-fast)] hover:text-foreground\",\n \"[&[data-state=open]>svg:last-child]:rotate-180\",\n focusRing,\n className,\n )}\n {...props}\n >\n {children ?? `${String(count)} ${count === 1 ? \"source\" : \"sources\"}`}\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className=\"size-3.5 shrink-0 transition-transform duration-[var(--duration-normal)]\"\n >\n <path\n d=\"m6 9 6 6 6-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </CollapsiblePrimitive.Trigger>\n );\n}\n\nexport function SourcesContent({\n className,\n children,\n ...props\n}: ComponentPropsWithRef<typeof CollapsiblePrimitive.Content>) {\n return (\n <CollapsiblePrimitive.Content\n data-slot=\"sources-content\"\n className={cn(\n \"overflow-hidden\",\n \"data-[state=closed]:animate-accordion-close data-[state=open]:animate-accordion-open\",\n className,\n )}\n {...props}\n >\n {/* Ordered, because the numbers in the inline markers refer to positions\n in this list. */}\n <ol className=\"mt-2 flex flex-col gap-1.5\">{children}</ol>\n </CollapsiblePrimitive.Content>\n );\n}\n\nexport interface SourceProps extends ComponentPropsWithRef<\"a\"> {\n index: number;\n title: string;\n /** Where it came from — a domain, a filename, a document title. */\n origin?: string;\n /** The quoted passage, if there is one. */\n excerpt?: string;\n}\n\nexport function Source({ className, index, title, origin, excerpt, ...props }: SourceProps) {\n return (\n <li data-slot=\"source\">\n <a\n className={cn(\n \"flex gap-2 rounded-md border border-border bg-card/50 px-2.5 py-2\",\n \"transition-colors duration-[var(--duration-fast)] hover:bg-accent/50\",\n focusRing,\n className,\n )}\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className=\"mt-0.5 grid size-4 shrink-0 place-items-center rounded bg-muted text-2xs font-medium text-muted-foreground tabular-nums\"\n >\n {index}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-xs font-medium text-foreground\">{title}</span>\n {origin ? (\n <span className=\"block truncate text-2xs text-muted-foreground\">{origin}</span>\n ) : null}\n {excerpt ? (\n <span className=\"mt-1 line-clamp-2 block text-xs text-muted-foreground\">\n “{excerpt}”\n </span>\n ) : null}\n </span>\n </a>\n </li>\n );\n}\n"],"mappings":";;;;;;AA+BA,SAAgB,eAAe,EAC7B,WACA,OACA,OACA,MACA,GAAG,SACmB;CACtB,MAAM,SAAS,GACb,0FACA,oEACA,SACF;CAEA,IAAI,CAAC,MACH,OACE,qBAAC,QAAD;EAAM,aAAU;EAAkB,WAAW;EAA7C,UAAA,CACE,oBAAC,QAAD;GAAM,eAAY;GAAQ,UAAA;EAAY,CAAA,GACtC,qBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IAA0B;IAChB;IAAM;IAAG;GACb;EACF,CAAA,CAAA;;CAIV,OACE,oBAAC,KAAD;EACE,aAAU;EACJ;EACN,cAAY,UAAU,OAAO,KAAK,EAAE,IAAI;EACxC,WAAW,GACT,QACA,2FACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,QAAD;GAAM,eAAY;GAAQ,UAAA;EAAY,CAAA;CACrC,CAAA;AAEP;AAIA,SAAgB,QAAQ,EAAE,WAAW,GAAG,SAAuB;CAC7D,OACE,oBAACA,YAAqB,MAAtB;EACE,aAAU;EACV,WAAW,GAAG,kBAAkB,SAAS;EACzC,GAAI;CACL,CAAA;AAEL;AAQA,SAAgB,eAAe,EAAE,WAAW,OAAO,UAAU,GAAG,SAA8B;CAC5F,OACE,qBAACA,YAAqB,SAAtB;EACE,aAAU;EACV,WAAW,GACT,sEACA,2EACA,kDACA,WACA,SACF;EACA,GAAI;EATN,UAAA,CAWG,YAAY,GAAG,OAAO,KAAK,EAAE,GAAG,UAAU,IAAI,WAAW,aAC1D,oBAAC,OAAD;GACE,SAAQ;GACR,MAAK;GACL,eAAY;GACZ,WAAU;GAEV,UAAA,oBAAC,QAAD;IACE,GAAE;IACF,QAAO;IACP,aAAY;IACZ,eAAc;IACd,gBAAe;GAChB,CAAA;EACE,CAAA,CACuB;;AAElC;AAEA,SAAgB,eAAe,EAC7B,WACA,UACA,GAAG,SAC0D;CAC7D,OACE,oBAACA,YAAqB,SAAtB;EACE,aAAU;EACV,WAAW,GACT,mBACA,wFACA,SACF;EACA,GAAI;EAIJ,UAAA,oBAAC,MAAD;GAAI,WAAU;GAA8B;EAAa,CAAA;CAC7B,CAAA;AAElC;AAWA,SAAgB,OAAO,EAAE,WAAW,OAAO,OAAO,QAAQ,SAAS,GAAG,SAAsB;CAC1F,OACE,oBAAC,MAAD;EAAI,aAAU;EACZ,UAAA,qBAAC,KAAD;GACE,WAAW,GACT,qEACA,wEACA,WACA,SACF;GACA,GAAI;GAPN,UAAA,CASE,oBAAC,QAAD;IACE,eAAY;IACZ,WAAU;IAET,UAAA;GACG,CAAA,GACN,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA;KACE,oBAAC,QAAD;MAAM,WAAU;MAAsD,UAAA;KAAY,CAAA;KACjF,SACC,oBAAC,QAAD;MAAM,WAAU;MAAiD,UAAA;KAAa,CAAA,IAC5E;KACH,UACC,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA;OAAwE;OACpE;OAAQ;MACN;KACJ,CAAA,IAAA;IACA;GACL,CAAA,CAAA;;CACD,CAAA;AAER"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { InlineCitation, InlineCitationProps, Source, SourceProps, Sources, SourcesContent, SourcesProps, SourcesTrigger, SourcesTriggerProps } from "./ai-sources.js";
|
|
2
|
+
export { InlineCitation, type InlineCitationProps, Source, type SourceProps, Sources, SourcesContent, type SourcesProps, SourcesTrigger, type SourcesTriggerProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineMeta } from "../../registry/schema.js";
|
|
2
|
+
//#region src/components/ai-sources/meta.ts
|
|
3
|
+
const meta = defineMeta({
|
|
4
|
+
name: "ai-sources",
|
|
5
|
+
title: "AI Sources",
|
|
6
|
+
description: "Inline citation markers and the source list they refer to.",
|
|
7
|
+
category: "ai",
|
|
8
|
+
status: "stable",
|
|
9
|
+
dependencies: ["radix-ui"],
|
|
10
|
+
registryDependencies: [],
|
|
11
|
+
files: ["ai-sources.tsx"],
|
|
12
|
+
a11y: "An inline marker shows a bare number, which conveys nothing on its own, so the source title is carried in its accessible name. A marker with no href renders as text rather than as a link that goes nowhere. The source list is ordered, because the marker numbers refer to positions in it."
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { meta };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","names":[],"sources":["../../../src/components/ai-sources/meta.ts"],"sourcesContent":["import { defineMeta } from \"@/registry/schema\";\n\nexport const meta = defineMeta({\n name: \"ai-sources\",\n title: \"AI Sources\",\n description: \"Inline citation markers and the source list they refer to.\",\n category: \"ai\",\n status: \"stable\",\n dependencies: [\"radix-ui\"],\n registryDependencies: [],\n files: [\"ai-sources.tsx\"],\n a11y:\n \"An inline marker shows a bare number, which conveys nothing on its own, so the source title \" +\n \"is carried in its accessible name. A marker with no href renders as text rather than as a \" +\n \"link that goes nowhere. The source list is ordered, because the marker numbers refer to \" +\n \"positions in it.\",\n});\n"],"mappings":";;AAEA,MAAa,OAAO,WAAW;CAC7B,MAAM;CACN,OAAO;CACP,aAAa;CACb,UAAU;CACV,QAAQ;CACR,cAAc,CAAC,UAAU;CACzB,sBAAsB,CAAC;CACvB,OAAO,CAAC,gBAAgB;CACxB,MACE;AAIJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
//#region src/components/ai-token-usage/ai-token-usage.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* How much of the context window a conversation has used.
|
|
5
|
+
*
|
|
6
|
+
* Worth showing because running out of context is a cliff, not a slope: the
|
|
7
|
+
* conversation stops behaving the way it did, and without a gauge that looks
|
|
8
|
+
* like the model getting worse rather than a limit being reached.
|
|
9
|
+
*
|
|
10
|
+
* The numbers are the message; the bar is a summary of them. Both are present,
|
|
11
|
+
* and the numbers are what a screen reader gets.
|
|
12
|
+
*/
|
|
13
|
+
interface TokenUsageProps extends ComponentPropsWithRef<"div"> {
|
|
14
|
+
/** Tokens used so far. */
|
|
15
|
+
used: number;
|
|
16
|
+
/** The context window. */
|
|
17
|
+
limit: number;
|
|
18
|
+
label?: string;
|
|
19
|
+
/** Fraction of the limit past which the gauge warns. */
|
|
20
|
+
warnAt?: number;
|
|
21
|
+
/** Formats the numbers. Defaults to the runtime locale's grouping. */
|
|
22
|
+
format?: (value: number) => string;
|
|
23
|
+
}
|
|
24
|
+
declare function TokenUsage({ className, used, limit, label, warnAt, format, ...props }: TokenUsageProps): import("react").JSX.Element;
|
|
25
|
+
interface TokenCountProps extends ComponentPropsWithRef<"span"> {
|
|
26
|
+
value: number;
|
|
27
|
+
label?: string;
|
|
28
|
+
format?: (value: number) => string;
|
|
29
|
+
}
|
|
30
|
+
/** A bare token count, for a message footer or a toolbar. */
|
|
31
|
+
declare function TokenCount({ className, value, label, format, ...props }: TokenCountProps): import("react").JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TokenCount, TokenCountProps, TokenUsage, TokenUsageProps };
|
|
34
|
+
//# sourceMappingURL=ai-token-usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-token-usage.d.ts","names":[],"sources":["../../../src/components/ai-token-usage/ai-token-usage.tsx"],"mappings":";;;;;;;;;;;;UAiBiB,wBAAwB;;EAEvC;;EAEA;EACA;;EAEA;;EAEA,UAAU;;iBAOI,aACd,WACA,MACA,OACA,OACA,QACA,WACG,SACF,kCAAe,IAAA;UAwCD,wBAAwB;EACvC;EACA;EACA,UAAU;;;iBAII,aACd,WACA,OACA,OACA,WACG,SACF,kCAAe,IAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ai-token-usage/ai-token-usage.tsx
|
|
5
|
+
function defaultFormat(value) {
|
|
6
|
+
return new Intl.NumberFormat().format(value);
|
|
7
|
+
}
|
|
8
|
+
function TokenUsage({ className, used, limit, label = "Context used", warnAt = .85, format = defaultFormat, ...props }) {
|
|
9
|
+
const fraction = limit > 0 ? Math.min(1, Math.max(0, used / limit)) : 0;
|
|
10
|
+
const percent = Math.round(fraction * 100);
|
|
11
|
+
const warning = fraction >= warnAt;
|
|
12
|
+
const over = used > limit;
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
"data-slot": "token-usage",
|
|
15
|
+
"data-warning": warning || void 0,
|
|
16
|
+
"data-over": over || void 0,
|
|
17
|
+
className: cn("flex w-full flex-col gap-1", className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "flex items-baseline justify-between gap-2 text-xs",
|
|
21
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: "text-muted-foreground",
|
|
23
|
+
children: label
|
|
24
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
25
|
+
className: cn("tabular-nums", over ? "text-destructive" : warning ? "text-warning" : "text-muted-foreground"),
|
|
26
|
+
children: [
|
|
27
|
+
format(used),
|
|
28
|
+
" / ",
|
|
29
|
+
format(limit)
|
|
30
|
+
]
|
|
31
|
+
})]
|
|
32
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: "h-1 w-full overflow-hidden rounded-full bg-muted",
|
|
35
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: cn("h-full rounded-full transition-[width] duration-[var(--duration-slow)] ease-[var(--ease-out-quint)]", over ? "bg-destructive" : warning ? "bg-warning" : "bg-primary"),
|
|
37
|
+
style: { width: `${String(percent)}%` }
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** A bare token count, for a message footer or a toolbar. */
|
|
43
|
+
function TokenCount({ className, value, label = "tokens", format = defaultFormat, ...props }) {
|
|
44
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
45
|
+
"data-slot": "token-count",
|
|
46
|
+
className: cn("text-2xs text-muted-foreground tabular-nums", className),
|
|
47
|
+
...props,
|
|
48
|
+
children: [
|
|
49
|
+
format(value),
|
|
50
|
+
" ",
|
|
51
|
+
label
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { TokenCount, TokenUsage };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=ai-token-usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-token-usage.js","names":[],"sources":["../../../src/components/ai-token-usage/ai-token-usage.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentPropsWithRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/**\n * How much of the context window a conversation has used.\n *\n * Worth showing because running out of context is a cliff, not a slope: the\n * conversation stops behaving the way it did, and without a gauge that looks\n * like the model getting worse rather than a limit being reached.\n *\n * The numbers are the message; the bar is a summary of them. Both are present,\n * and the numbers are what a screen reader gets.\n */\n\nexport interface TokenUsageProps extends ComponentPropsWithRef<\"div\"> {\n /** Tokens used so far. */\n used: number;\n /** The context window. */\n limit: number;\n label?: string;\n /** Fraction of the limit past which the gauge warns. */\n warnAt?: number;\n /** Formats the numbers. Defaults to the runtime locale's grouping. */\n format?: (value: number) => string;\n}\n\nfunction defaultFormat(value: number): string {\n return new Intl.NumberFormat().format(value);\n}\n\nexport function TokenUsage({\n className,\n used,\n limit,\n label = \"Context used\",\n warnAt = 0.85,\n format = defaultFormat,\n ...props\n}: TokenUsageProps) {\n const fraction = limit > 0 ? Math.min(1, Math.max(0, used / limit)) : 0;\n const percent = Math.round(fraction * 100);\n const warning = fraction >= warnAt;\n const over = used > limit;\n\n return (\n <div\n data-slot=\"token-usage\"\n data-warning={warning || undefined}\n data-over={over || undefined}\n className={cn(\"flex w-full flex-col gap-1\", className)}\n {...props}\n >\n <div className=\"flex items-baseline justify-between gap-2 text-xs\">\n <span className=\"text-muted-foreground\">{label}</span>\n <span\n className={cn(\n \"tabular-nums\",\n over ? \"text-destructive\" : warning ? \"text-warning\" : \"text-muted-foreground\",\n )}\n >\n {format(used)} / {format(limit)}\n </span>\n </div>\n {/* The bar summarises what the numbers above already say, so it is\n decorative rather than a second progressbar to read through. */}\n <div aria-hidden=\"true\" className=\"h-1 w-full overflow-hidden rounded-full bg-muted\">\n <div\n className={cn(\n \"h-full rounded-full transition-[width] duration-[var(--duration-slow)] ease-[var(--ease-out-quint)]\",\n over ? \"bg-destructive\" : warning ? \"bg-warning\" : \"bg-primary\",\n )}\n style={{ width: `${String(percent)}%` }}\n />\n </div>\n </div>\n );\n}\n\nexport interface TokenCountProps extends ComponentPropsWithRef<\"span\"> {\n value: number;\n label?: string;\n format?: (value: number) => string;\n}\n\n/** A bare token count, for a message footer or a toolbar. */\nexport function TokenCount({\n className,\n value,\n label = \"tokens\",\n format = defaultFormat,\n ...props\n}: TokenCountProps) {\n return (\n <span\n data-slot=\"token-count\"\n className={cn(\"text-2xs text-muted-foreground tabular-nums\", className)}\n {...props}\n >\n {format(value)} {label}\n </span>\n );\n}\n"],"mappings":";;;;AA6BA,SAAS,cAAc,OAAuB;CAC5C,OAAO,IAAI,KAAK,aAAa,CAAC,CAAC,OAAO,KAAK;AAC7C;AAEA,SAAgB,WAAW,EACzB,WACA,MACA,OACA,QAAQ,gBACR,SAAS,KACT,SAAS,eACT,GAAG,SACe;CAClB,MAAM,WAAW,QAAQ,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,OAAO,KAAK,CAAC,IAAI;CACtE,MAAM,UAAU,KAAK,MAAM,WAAW,GAAG;CACzC,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,OAAO;CAEpB,OACE,qBAAC,OAAD;EACE,aAAU;EACV,gBAAc,WAAW,KAAA;EACzB,aAAW,QAAQ,KAAA;EACnB,WAAW,GAAG,8BAA8B,SAAS;EACrD,GAAI;EALN,UAAA,CAOE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,QAAD;IAAM,WAAU;IAAyB,UAAA;GAAY,CAAA,GACrD,qBAAC,QAAD;IACE,WAAW,GACT,gBACA,OAAO,qBAAqB,UAAU,iBAAiB,uBACzD;IAJF,UAAA;KAMG,OAAO,IAAI;KAAE;KAAI,OAAO,KAAK;IAC1B;GACH,CAAA,CAAA;EAGL,CAAA,GAAA,oBAAC,OAAD;GAAK,eAAY;GAAO,WAAU;GAChC,UAAA,oBAAC,OAAD;IACE,WAAW,GACT,uGACA,OAAO,mBAAmB,UAAU,eAAe,YACrD;IACA,OAAO,EAAE,OAAO,GAAG,OAAO,OAAO,EAAE,GAAG;GACvC,CAAA;EACE,CAAA,CACF;;AAET;;AASA,SAAgB,WAAW,EACzB,WACA,OACA,QAAQ,UACR,SAAS,eACT,GAAG,SACe;CAClB,OACE,qBAAC,QAAD;EACE,aAAU;EACV,WAAW,GAAG,+CAA+C,SAAS;EACtE,GAAI;EAHN,UAAA;GAKG,OAAO,KAAK;GAAE;GAAE;EACb;;AAEV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineMeta } from "../../registry/schema.js";
|
|
2
|
+
//#region src/components/ai-token-usage/meta.ts
|
|
3
|
+
const meta = defineMeta({
|
|
4
|
+
name: "ai-token-usage",
|
|
5
|
+
title: "AI Token Usage",
|
|
6
|
+
description: "A gauge showing how much of the context window a conversation has used.",
|
|
7
|
+
category: "ai",
|
|
8
|
+
status: "stable",
|
|
9
|
+
dependencies: [],
|
|
10
|
+
registryDependencies: [],
|
|
11
|
+
files: ["ai-token-usage.tsx"],
|
|
12
|
+
a11y: "The numbers are the content and the bar only summarises them, so the bar is aria-hidden rather than a second progressbar to read past. Counts are formatted for the locale. Warning and over-limit states change the wording's colour but never remove the figures."
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { meta };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","names":[],"sources":["../../../src/components/ai-token-usage/meta.ts"],"sourcesContent":["import { defineMeta } from \"@/registry/schema\";\n\nexport const meta = defineMeta({\n name: \"ai-token-usage\",\n title: \"AI Token Usage\",\n description: \"A gauge showing how much of the context window a conversation has used.\",\n category: \"ai\",\n status: \"stable\",\n dependencies: [],\n registryDependencies: [],\n files: [\"ai-token-usage.tsx\"],\n a11y:\n \"The numbers are the content and the bar only summarises them, so the bar is aria-hidden \" +\n \"rather than a second progressbar to read past. Counts are formatted for the locale. Warning \" +\n \"and over-limit states change the wording's colour but never remove the figures.\",\n});\n"],"mappings":";;AAEA,MAAa,OAAO,WAAW;CAC7B,MAAM;CACN,OAAO;CACP,aAAa;CACb,UAAU;CACV,QAAQ;CACR,cAAc,CAAC;CACf,sBAAsB,CAAC;CACvB,OAAO,CAAC,oBAAoB;CAC5B,MACE;AAGJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Collapsible } from "radix-ui";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
+
//#region src/components/ai-tool/ai-tool.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* A tool the model called, and what came back.
|
|
7
|
+
*
|
|
8
|
+
* Collapsed by default: a tool call is provenance, not the answer. Someone
|
|
9
|
+
* checking why a response says what it does needs to open it; everybody else
|
|
10
|
+
* needs it to stay out of the way.
|
|
11
|
+
*
|
|
12
|
+
* The status is the whole point of the header, so it is text, never a coloured
|
|
13
|
+
* dot alone.
|
|
14
|
+
*/
|
|
15
|
+
type ToolStatus = "pending" | "running" | "success" | "error";
|
|
16
|
+
declare const toolVariants: (props?: ({
|
|
17
|
+
status?: "success" | "pending" | "running" | "error" | null | undefined;
|
|
18
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
|
+
interface ToolProps extends ComponentPropsWithRef<typeof Collapsible.Root>, VariantProps<typeof toolVariants> {
|
|
20
|
+
status?: ToolStatus;
|
|
21
|
+
}
|
|
22
|
+
declare function Tool({ className, status, ...props }: ToolProps): import("react").JSX.Element;
|
|
23
|
+
interface ToolHeaderProps extends ComponentPropsWithRef<typeof Collapsible.Trigger> {
|
|
24
|
+
/** The tool's name, as the model called it. */
|
|
25
|
+
name: string;
|
|
26
|
+
status?: ToolStatus;
|
|
27
|
+
/** Overrides the status wording. */
|
|
28
|
+
statusLabel?: string;
|
|
29
|
+
icon?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
declare function ToolHeader({ className, name, status, statusLabel, icon, ...props }: ToolHeaderProps): import("react").JSX.Element;
|
|
32
|
+
declare function ToolContent({ className, ...props }: ComponentPropsWithRef<typeof Collapsible.Content>): import("react").JSX.Element;
|
|
33
|
+
interface ToolSectionProps extends ComponentPropsWithRef<"div"> {
|
|
34
|
+
label: string;
|
|
35
|
+
}
|
|
36
|
+
/** A labelled block inside the disclosure: the arguments, or the result. */
|
|
37
|
+
declare function ToolSection({ className, label, children, ...props }: ToolSectionProps): import("react").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Serialised arguments or output.
|
|
40
|
+
*
|
|
41
|
+
* A `<pre>` with a tabindex, because JSON of any size scrolls and a scrollable
|
|
42
|
+
* box that cannot be focused is unreachable by keyboard.
|
|
43
|
+
*/
|
|
44
|
+
interface ToolPayloadProps extends ComponentPropsWithRef<"pre"> {
|
|
45
|
+
label?: string;
|
|
46
|
+
}
|
|
47
|
+
declare function ToolPayload({ className, label, ...props }: ToolPayloadProps): import("react").JSX.Element;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { Tool, ToolContent, ToolHeader, ToolHeaderProps, ToolPayload, ToolPayloadProps, ToolProps, ToolSection, ToolSectionProps, ToolStatus, toolVariants };
|
|
50
|
+
//# sourceMappingURL=ai-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-tool.d.ts","names":[],"sources":["../../../src/components/ai-tool/ai-tool.tsx"],"mappings":";;;;;;;;;;;;;;KAoBY;cASN,eAAY;;6CAYhB;UAEe,kBAEb,6BAA6B,YAAqB,OAClD,oBAAoB;EACtB,SAAS;;iBAGK,OAAO,WAAW,WAAuB,SAAS,4BAAS,IAAA;UAW1D,wBAAwB,6BAChC,YAAqB;;EAG5B;EACA,SAAS;;EAET;EACA,OAAO;;iBAGO,aACd,WACA,MACA,QACA,aACA,SACG,SACF,kCAAe,IAAA;iBA2FF,cACd,cACG,SACF,6BAA6B,YAAqB,2BAAQ,IAAA;UAc5C,yBAAyB;EACxC;;;iBAIc,cAAc,WAAW,OAAO,aAAa,SAAS,mCAAgB,IAAA;;;;;;;UAqBrE,yBAAyB;EACxC;;iBAGc,cAAc,WAAW,UAAsB,SAAS,mCAAgB,IAAA"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { focusRing } from "../../lib/styles.js";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { Collapsible } from "radix-ui";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/components/ai-tool/ai-tool.tsx
|
|
8
|
+
const STATUS_LABEL = {
|
|
9
|
+
pending: "Queued",
|
|
10
|
+
running: "Running",
|
|
11
|
+
success: "Completed",
|
|
12
|
+
error: "Failed"
|
|
13
|
+
};
|
|
14
|
+
const toolVariants = cva("overflow-hidden rounded-lg border text-sm", {
|
|
15
|
+
variants: { status: {
|
|
16
|
+
pending: "border-border bg-muted/30",
|
|
17
|
+
running: "border-info/30 bg-info/5",
|
|
18
|
+
success: "border-border bg-muted/30",
|
|
19
|
+
error: "border-destructive/30 bg-destructive/5"
|
|
20
|
+
} },
|
|
21
|
+
defaultVariants: { status: "pending" }
|
|
22
|
+
});
|
|
23
|
+
function Tool({ className, status = "pending", ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
25
|
+
"data-slot": "tool",
|
|
26
|
+
"data-status": status,
|
|
27
|
+
className: cn(toolVariants({ status }), className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function ToolHeader({ className, name, status = "pending", statusLabel, icon, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
33
|
+
"data-slot": "tool-header",
|
|
34
|
+
className: cn("flex w-full items-center gap-2 px-3 py-2 text-left", "transition-colors duration-[var(--duration-fast)] hover:bg-accent/50", "[&[data-state=open]>svg:last-child]:rotate-180", focusRing, className),
|
|
35
|
+
...props,
|
|
36
|
+
children: [
|
|
37
|
+
icon ?? /* @__PURE__ */ jsx(ToolIcon, { status }),
|
|
38
|
+
/* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "font-mono text-xs font-medium",
|
|
40
|
+
children: name
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx("span", {
|
|
43
|
+
"data-slot": "tool-status",
|
|
44
|
+
className: cn("ml-auto text-xs", status === "error" ? "text-destructive" : "text-muted-foreground"),
|
|
45
|
+
children: statusLabel ?? STATUS_LABEL[status]
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ jsx("svg", {
|
|
48
|
+
viewBox: "0 0 24 24",
|
|
49
|
+
fill: "none",
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: "size-3.5 shrink-0 text-muted-foreground transition-transform duration-[var(--duration-normal)]",
|
|
52
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
53
|
+
d: "m6 9 6 6 6-6",
|
|
54
|
+
stroke: "currentColor",
|
|
55
|
+
strokeWidth: "2",
|
|
56
|
+
strokeLinecap: "round",
|
|
57
|
+
strokeLinejoin: "round"
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function ToolIcon({ status }) {
|
|
64
|
+
if (status === "running") return /* @__PURE__ */ jsxs("svg", {
|
|
65
|
+
viewBox: "0 0 24 24",
|
|
66
|
+
fill: "none",
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
className: "size-3.5 shrink-0 animate-spin text-info",
|
|
69
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
70
|
+
cx: "12",
|
|
71
|
+
cy: "12",
|
|
72
|
+
r: "9",
|
|
73
|
+
stroke: "currentColor",
|
|
74
|
+
strokeWidth: "2.5",
|
|
75
|
+
opacity: "0.25"
|
|
76
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
77
|
+
d: "M12 3a9 9 0 0 1 9 9",
|
|
78
|
+
stroke: "currentColor",
|
|
79
|
+
strokeWidth: "2.5",
|
|
80
|
+
strokeLinecap: "round"
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
84
|
+
viewBox: "0 0 24 24",
|
|
85
|
+
fill: "none",
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
className: cn("size-3.5 shrink-0", status === "error" ? "text-destructive" : "text-muted-foreground"),
|
|
88
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
89
|
+
d: status === "success" ? "m5 13 4 4L19 7" : status === "error" ? "M12 8v5m0 3h.01M10.3 4.3 2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0Z" : "M14.7 6.3a4 4 0 0 1-5 5L5 16v3h3l4.7-4.7a4 4 0 0 1 5-5l-2.3 2.3",
|
|
90
|
+
stroke: "currentColor",
|
|
91
|
+
strokeWidth: "2",
|
|
92
|
+
strokeLinecap: "round",
|
|
93
|
+
strokeLinejoin: "round"
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function ToolContent({ className, ...props }) {
|
|
98
|
+
return /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
99
|
+
"data-slot": "tool-content",
|
|
100
|
+
className: cn("overflow-hidden border-t border-border", "data-[state=closed]:animate-accordion-close data-[state=open]:animate-accordion-open", className),
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/** A labelled block inside the disclosure: the arguments, or the result. */
|
|
105
|
+
function ToolSection({ className, label, children, ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
"data-slot": "tool-section",
|
|
108
|
+
className: cn("border-b border-border/60 px-3 py-2 last:border-b-0", className),
|
|
109
|
+
...props,
|
|
110
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
111
|
+
className: "mb-1 text-2xs font-medium tracking-wide text-muted-foreground uppercase",
|
|
112
|
+
children: label
|
|
113
|
+
}), children]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function ToolPayload({ className, label = "Payload", ...props }) {
|
|
117
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
118
|
+
"data-slot": "tool-payload",
|
|
119
|
+
tabIndex: 0,
|
|
120
|
+
role: "region",
|
|
121
|
+
"aria-label": label,
|
|
122
|
+
className: cn("max-h-56 overflow-auto rounded-md bg-muted/60 p-2 font-mono text-xs leading-relaxed", focusRing, className),
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { Tool, ToolContent, ToolHeader, ToolPayload, ToolSection, toolVariants };
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=ai-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-tool.js","names":["CollapsiblePrimitive"],"sources":["../../../src/components/ai-tool/ai-tool.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport type { ComponentPropsWithRef, ReactNode } from \"react\";\n\nimport { focusRing } from \"@/lib/styles\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * A tool the model called, and what came back.\n *\n * Collapsed by default: a tool call is provenance, not the answer. Someone\n * checking why a response says what it does needs to open it; everybody else\n * needs it to stay out of the way.\n *\n * The status is the whole point of the header, so it is text, never a coloured\n * dot alone.\n */\n\nexport type ToolStatus = \"pending\" | \"running\" | \"success\" | \"error\";\n\nconst STATUS_LABEL: Record<ToolStatus, string> = {\n pending: \"Queued\",\n running: \"Running\",\n success: \"Completed\",\n error: \"Failed\",\n};\n\nconst toolVariants = cva(\"overflow-hidden rounded-lg border text-sm\", {\n variants: {\n status: {\n pending: \"border-border bg-muted/30\",\n running: \"border-info/30 bg-info/5\",\n success: \"border-border bg-muted/30\",\n error: \"border-destructive/30 bg-destructive/5\",\n },\n },\n defaultVariants: {\n status: \"pending\",\n },\n});\n\nexport interface ToolProps\n extends\n ComponentPropsWithRef<typeof CollapsiblePrimitive.Root>,\n VariantProps<typeof toolVariants> {\n status?: ToolStatus;\n}\n\nexport function Tool({ className, status = \"pending\", ...props }: ToolProps) {\n return (\n <CollapsiblePrimitive.Root\n data-slot=\"tool\"\n data-status={status}\n className={cn(toolVariants({ status }), className)}\n {...props}\n />\n );\n}\n\nexport interface ToolHeaderProps extends ComponentPropsWithRef<\n typeof CollapsiblePrimitive.Trigger\n> {\n /** The tool's name, as the model called it. */\n name: string;\n status?: ToolStatus;\n /** Overrides the status wording. */\n statusLabel?: string;\n icon?: ReactNode;\n}\n\nexport function ToolHeader({\n className,\n name,\n status = \"pending\",\n statusLabel,\n icon,\n ...props\n}: ToolHeaderProps) {\n return (\n <CollapsiblePrimitive.Trigger\n data-slot=\"tool-header\"\n className={cn(\n \"flex w-full items-center gap-2 px-3 py-2 text-left\",\n \"transition-colors duration-[var(--duration-fast)] hover:bg-accent/50\",\n \"[&[data-state=open]>svg:last-child]:rotate-180\",\n focusRing,\n className,\n )}\n {...props}\n >\n {icon ?? <ToolIcon status={status} />}\n <span className=\"font-mono text-xs font-medium\">{name}</span>\n {/* Status in words. A coloured dot alone says nothing to a screen reader\n and nothing to anyone who cannot distinguish the colours. */}\n <span\n data-slot=\"tool-status\"\n className={cn(\n \"ml-auto text-xs\",\n status === \"error\" ? \"text-destructive\" : \"text-muted-foreground\",\n )}\n >\n {statusLabel ?? STATUS_LABEL[status]}\n </span>\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className=\"size-3.5 shrink-0 text-muted-foreground transition-transform duration-[var(--duration-normal)]\"\n >\n <path\n d=\"m6 9 6 6 6-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </CollapsiblePrimitive.Trigger>\n );\n}\n\nfunction ToolIcon({ status }: { status: ToolStatus }) {\n if (status === \"running\") {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className=\"size-3.5 shrink-0 animate-spin text-info\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" strokeWidth=\"2.5\" opacity=\"0.25\" />\n <path\n d=\"M12 3a9 9 0 0 1 9 9\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n }\n\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\n \"size-3.5 shrink-0\",\n status === \"error\" ? \"text-destructive\" : \"text-muted-foreground\",\n )}\n >\n <path\n d={\n status === \"success\"\n ? \"m5 13 4 4L19 7\"\n : status === \"error\"\n ? \"M12 8v5m0 3h.01M10.3 4.3 2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0Z\"\n : \"M14.7 6.3a4 4 0 0 1-5 5L5 16v3h3l4.7-4.7a4 4 0 0 1 5-5l-2.3 2.3\"\n }\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport function ToolContent({\n className,\n ...props\n}: ComponentPropsWithRef<typeof CollapsiblePrimitive.Content>) {\n return (\n <CollapsiblePrimitive.Content\n data-slot=\"tool-content\"\n className={cn(\n \"overflow-hidden border-t border-border\",\n \"data-[state=closed]:animate-accordion-close data-[state=open]:animate-accordion-open\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface ToolSectionProps extends ComponentPropsWithRef<\"div\"> {\n label: string;\n}\n\n/** A labelled block inside the disclosure: the arguments, or the result. */\nexport function ToolSection({ className, label, children, ...props }: ToolSectionProps) {\n return (\n <div\n data-slot=\"tool-section\"\n className={cn(\"border-b border-border/60 px-3 py-2 last:border-b-0\", className)}\n {...props}\n >\n <p className=\"mb-1 text-2xs font-medium tracking-wide text-muted-foreground uppercase\">\n {label}\n </p>\n {children}\n </div>\n );\n}\n\n/**\n * Serialised arguments or output.\n *\n * A `<pre>` with a tabindex, because JSON of any size scrolls and a scrollable\n * box that cannot be focused is unreachable by keyboard.\n */\nexport interface ToolPayloadProps extends ComponentPropsWithRef<\"pre\"> {\n label?: string;\n}\n\nexport function ToolPayload({ className, label = \"Payload\", ...props }: ToolPayloadProps) {\n return (\n <pre\n data-slot=\"tool-payload\"\n tabIndex={0}\n role=\"region\"\n aria-label={label}\n className={cn(\n \"max-h-56 overflow-auto rounded-md bg-muted/60 p-2 font-mono text-xs leading-relaxed\",\n focusRing,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { toolVariants };\n"],"mappings":";;;;;;;AAsBA,MAAM,eAA2C;CAC/C,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,MAAM,eAAe,IAAI,6CAA6C;CACpE,UAAU,EACR,QAAQ;EACN,SAAS;EACT,SAAS;EACT,SAAS;EACT,OAAO;CACT,EACF;CACA,iBAAiB,EACf,QAAQ,UACV;AACF,CAAC;AASD,SAAgB,KAAK,EAAE,WAAW,SAAS,WAAW,GAAG,SAAoB;CAC3E,OACE,oBAACA,YAAqB,MAAtB;EACE,aAAU;EACV,eAAa;EACb,WAAW,GAAG,aAAa,EAAE,OAAO,CAAC,GAAG,SAAS;EACjD,GAAI;CACL,CAAA;AAEL;AAaA,SAAgB,WAAW,EACzB,WACA,MACA,SAAS,WACT,aACA,MACA,GAAG,SACe;CAClB,OACE,qBAACA,YAAqB,SAAtB;EACE,aAAU;EACV,WAAW,GACT,sDACA,wEACA,kDACA,WACA,SACF;EACA,GAAI;EATN,UAAA;GAWG,QAAQ,oBAAC,UAAD,EAAkB,OAAS,CAAA;GACpC,oBAAC,QAAD;IAAM,WAAU;IAAiC,UAAA;GAAW,CAAA;GAG5D,oBAAC,QAAD;IACE,aAAU;IACV,WAAW,GACT,mBACA,WAAW,UAAU,qBAAqB,uBAC5C;IAEC,UAAA,eAAe,aAAa;GACzB,CAAA;GACN,oBAAC,OAAD;IACE,SAAQ;IACR,MAAK;IACL,eAAY;IACZ,WAAU;IAEV,UAAA,oBAAC,QAAD;KACE,GAAE;KACF,QAAO;KACP,aAAY;KACZ,eAAc;KACd,gBAAe;IAChB,CAAA;GACE,CAAA;EACuB;;AAElC;AAEA,SAAS,SAAS,EAAE,UAAkC;CACpD,IAAI,WAAW,WACb,OACE,qBAAC,OAAD;EACE,SAAQ;EACR,MAAK;EACL,eAAY;EACZ,WAAU;EAJZ,UAAA,CAME,oBAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;GAAI,QAAO;GAAe,aAAY;GAAM,SAAQ;EAAQ,CAAA,GACtF,oBAAC,QAAD;GACE,GAAE;GACF,QAAO;GACP,aAAY;GACZ,eAAc;EACf,CAAA,CACE;;CAIT,OACE,oBAAC,OAAD;EACE,SAAQ;EACR,MAAK;EACL,eAAY;EACZ,WAAW,GACT,qBACA,WAAW,UAAU,qBAAqB,uBAC5C;EAEA,UAAA,oBAAC,QAAD;GACE,GACE,WAAW,YACP,mBACA,WAAW,UACT,mGACA;GAER,QAAO;GACP,aAAY;GACZ,eAAc;GACd,gBAAe;EAChB,CAAA;CACE,CAAA;AAET;AAEA,SAAgB,YAAY,EAC1B,WACA,GAAG,SAC0D;CAC7D,OACE,oBAACA,YAAqB,SAAtB;EACE,aAAU;EACV,WAAW,GACT,0CACA,wFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAOA,SAAgB,YAAY,EAAE,WAAW,OAAO,UAAU,GAAG,SAA2B;CACtF,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,uDAAuD,SAAS;EAC9E,GAAI;EAHN,UAAA,CAKE,oBAAC,KAAD;GAAG,WAAU;GACV,UAAA;EACA,CAAA,GACF,QACE;;AAET;AAYA,SAAgB,YAAY,EAAE,WAAW,QAAQ,WAAW,GAAG,SAA2B;CACxF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,UAAU;EACV,MAAK;EACL,cAAY;EACZ,WAAW,GACT,uFACA,WACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Tool, ToolContent, ToolHeader, ToolHeaderProps, ToolPayload, ToolPayloadProps, ToolProps, ToolSection, ToolSectionProps, ToolStatus, toolVariants } from "./ai-tool.js";
|
|
2
|
+
export { Tool, ToolContent, ToolHeader, type ToolHeaderProps, ToolPayload, type ToolPayloadProps, type ToolProps, ToolSection, type ToolSectionProps, type ToolStatus, toolVariants };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineMeta } from "../../registry/schema.js";
|
|
2
|
+
//#region src/components/ai-tool/meta.ts
|
|
3
|
+
const meta = defineMeta({
|
|
4
|
+
name: "ai-tool",
|
|
5
|
+
title: "AI Tool Call",
|
|
6
|
+
description: "A collapsible record of a tool the model called, its arguments and its result.",
|
|
7
|
+
category: "ai",
|
|
8
|
+
status: "stable",
|
|
9
|
+
dependencies: ["class-variance-authority", "radix-ui"],
|
|
10
|
+
registryDependencies: [],
|
|
11
|
+
files: ["ai-tool.tsx"],
|
|
12
|
+
a11y: "A disclosure: the trigger exposes aria-expanded and controls the panel. Status is stated in words, not by a coloured dot — colour alone is unavailable to a screen reader and to anyone who cannot distinguish it. Payload blocks are focusable named regions, since JSON scrolls and an unfocusable scroll box is unreachable by keyboard."
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { meta };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","names":[],"sources":["../../../src/components/ai-tool/meta.ts"],"sourcesContent":["import { defineMeta } from \"@/registry/schema\";\n\nexport const meta = defineMeta({\n name: \"ai-tool\",\n title: \"AI Tool Call\",\n description: \"A collapsible record of a tool the model called, its arguments and its result.\",\n category: \"ai\",\n status: \"stable\",\n dependencies: [\"class-variance-authority\", \"radix-ui\"],\n registryDependencies: [],\n files: [\"ai-tool.tsx\"],\n a11y:\n \"A disclosure: the trigger exposes aria-expanded and controls the panel. Status is stated in \" +\n \"words, not by a coloured dot — colour alone is unavailable to a screen reader and to anyone \" +\n \"who cannot distinguish it. Payload blocks are focusable named regions, since JSON scrolls \" +\n \"and an unfocusable scroll box is unreachable by keyboard.\",\n});\n"],"mappings":";;AAEA,MAAa,OAAO,WAAW;CAC7B,MAAM;CACN,OAAO;CACP,aAAa;CACb,UAAU;CACV,QAAQ;CACR,cAAc,CAAC,4BAA4B,UAAU;CACrD,sBAAsB,CAAC;CACvB,OAAO,CAAC,aAAa;CACrB,MACE;AAIJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
//#region src/components/alert/alert.d.ts
|
|
4
|
+
declare const alertVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
/**
|
|
8
|
+
* How urgently the alert should interrupt a screen reader.
|
|
9
|
+
*
|
|
10
|
+
* - `off` (default): a static notice already present when the page rendered.
|
|
11
|
+
* - `polite`: appeared in response to something the user did; announce at the
|
|
12
|
+
* next pause.
|
|
13
|
+
* - `assertive`: an error that must interrupt whatever is being read.
|
|
14
|
+
*/
|
|
15
|
+
type AlertLive = "off" | "polite" | "assertive";
|
|
16
|
+
interface AlertProps extends ComponentPropsWithRef<"div">, VariantProps<typeof alertVariants> {
|
|
17
|
+
live?: AlertLive;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A callout that draws attention to a message.
|
|
21
|
+
*
|
|
22
|
+
* `live` defaults to `off` rather than always rendering role="alert". A live
|
|
23
|
+
* region that exists on first paint announces itself for no reason and trains
|
|
24
|
+
* users to ignore it; opt in when the alert actually appears in response to
|
|
25
|
+
* something.
|
|
26
|
+
*/
|
|
27
|
+
declare function Alert({ className, variant, live, ...props }: AlertProps): import("react").JSX.Element;
|
|
28
|
+
declare function AlertTitle({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
|
|
29
|
+
declare function AlertDescription({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Alert, AlertDescription, AlertLive, AlertProps, AlertTitle, alertVariants };
|
|
32
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","names":[],"sources":["../../../src/components/alert/alert.tsx"],"mappings":";;;cAKM,gBAAa;;6CAqBlB;;;;;;;;;KAUW;UAEK,mBACP,8BAA8B,oBAAoB;EAC1D,OAAO;;;;;;;;;;iBAWO,QAAQ,WAAW,SAAS,SAAiB,SAAS,6BAAU,IAAA;iBAchE,aAAa,cAAc,SAAS,+CAA4B,IAAA;iBAUhE,mBAAmB,cAAc,SAAS,+CAA4B,IAAA"}
|