@mizen-labs/ui 0.0.0-stage → 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/README.md +72 -2
- package/dist/closed.d.ts +5 -0
- package/dist/closed.js +1 -0
- package/dist/components/accordion/accordion.d.ts +28 -0
- package/dist/components/accordion/accordion.js +1 -0
- package/dist/components/accordion/accordion.styles.js +1 -0
- package/dist/components/activity-feed/activity-feed.d.ts +28 -0
- package/dist/components/activity-feed/activity-feed.js +2 -0
- package/dist/components/activity-feed/activity-feed.styles.js +1 -0
- package/dist/components/agent-thinking/agent-thinking.d.ts +25 -0
- package/dist/components/agent-thinking/agent-thinking.js +16 -0
- package/dist/components/agent-thinking/agent-thinking.styles.js +3 -0
- package/dist/components/alert/alert.d.ts +14 -0
- package/dist/components/alert/alert.js +1 -0
- package/dist/components/alert/alert.styles.js +1 -0
- package/dist/components/alert/alert.stylex.js +1 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +29 -0
- package/dist/components/alert-dialog/alert-dialog.js +1 -0
- package/dist/components/alert-dialog/alert-dialog.styles.js +1 -0
- package/dist/components/approval-card/approval-card.d.ts +38 -0
- package/dist/components/approval-card/approval-card.js +8 -0
- package/dist/components/approval-card/approval-card.styles.js +1 -0
- package/dist/components/area-chart/area-chart.d.ts +29 -0
- package/dist/components/area-chart/area-chart.js +10 -0
- package/dist/components/area-chart/area-chart.styles.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.styles.js +1 -0
- package/dist/components/attachment/attachment.d.ts +20 -0
- package/dist/components/attachment/attachment.js +1 -0
- package/dist/components/attachment/attachment.styles.js +1 -0
- package/dist/components/avatar/avatar-character.styles.js +1 -0
- package/dist/components/avatar/avatar.d.ts +36 -0
- package/dist/components/avatar/avatar.js +4 -0
- package/dist/components/avatar/avatar.styles.js +1 -0
- package/dist/components/badge/badge.d.ts +8 -0
- package/dist/components/badge/badge.js +1 -0
- package/dist/components/badge/badge.styles.js +1 -0
- package/dist/components/bar-list/bar-list.d.ts +22 -0
- package/dist/components/bar-list/bar-list.js +4 -0
- package/dist/components/bar-list/bar-list.styles.js +1 -0
- package/dist/components/blockquote/blockquote.d.ts +12 -0
- package/dist/components/blockquote/blockquote.js +1 -0
- package/dist/components/blockquote/blockquote.styles.js +1 -0
- package/dist/components/breadcrumb/breadcrumb-link.d.ts +4 -0
- package/dist/components/breadcrumb/breadcrumb-link.js +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +16 -0
- package/dist/components/breadcrumb/breadcrumb.js +2 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +1 -0
- package/dist/components/button/button-colors.stylex.js +3 -0
- package/dist/components/button/button.css +16 -0
- package/dist/components/button/button.css.d.js +0 -0
- package/dist/components/button/button.d.ts +27 -0
- package/dist/components/button/button.js +1 -0
- package/dist/components/button/button.styles.js +3 -0
- package/dist/components/button-group/button-group.css +115 -0
- package/dist/components/button-group/button-group.d.ts +8 -0
- package/dist/components/button-group/button-group.js +3 -0
- package/dist/components/button-group/button-group.styles.js +1 -0
- package/dist/components/calendar/calendar-components.js +2 -0
- package/dist/components/calendar/calendar-context.js +1 -0
- package/dist/components/calendar/calendar-dropdowns.js +2 -0
- package/dist/components/calendar/calendar-utils.js +1 -0
- package/dist/components/calendar/calendar.d.ts +4 -0
- package/dist/components/calendar/calendar.js +1 -0
- package/dist/components/calendar/calendar.styles.js +1 -0
- package/dist/components/calendar/calendar.types.d.ts +48 -0
- package/dist/components/calendar/calendar.types.js +1 -0
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts +20 -0
- package/dist/components/calendar-heatmap/calendar-heatmap.js +9 -0
- package/dist/components/card/card.d.ts +17 -0
- package/dist/components/card/card.js +1 -0
- package/dist/components/card/card.styles.js +1 -0
- package/dist/components/carousel/carousel.d.ts +33 -0
- package/dist/components/carousel/carousel.js +21 -0
- package/dist/components/carousel/carousel.styles.js +4 -0
- package/dist/components/category-comparison/category-comparison.d.ts +30 -0
- package/dist/components/category-comparison/category-comparison.js +9 -0
- package/dist/components/category-comparison/category-comparison.styles.js +1 -0
- package/dist/components/chart-frame/arc-path.js +7 -0
- package/dist/components/chart-frame/chart-assert.js +2 -0
- package/dist/components/chart-frame/chart-colors.d.ts +10 -0
- package/dist/components/chart-frame/chart-colors.js +2 -0
- package/dist/components/chart-frame/chart-crosshair.js +6 -0
- package/dist/components/chart-frame/chart-data-table.js +4 -0
- package/dist/components/chart-frame/chart-frame.d.ts +24 -0
- package/dist/components/chart-frame/chart-frame.js +7 -0
- package/dist/components/chart-frame/chart-frame.styles.js +1 -0
- package/dist/components/chart-frame/chart-hover.js +3 -0
- package/dist/components/chart-frame/chart-loading.d.ts +22 -0
- package/dist/components/chart-frame/chart-loading.js +6 -0
- package/dist/components/chart-frame/ring-graphic.js +5 -0
- package/dist/components/chart-legend/chart-legend.d.ts +18 -0
- package/dist/components/chart-legend/chart-legend.js +1 -0
- package/dist/components/chart-legend/chart-legend.styles.js +1 -0
- package/dist/components/chart-tooltip/chart-tooltip.d.ts +14 -0
- package/dist/components/chart-tooltip/chart-tooltip.js +1 -0
- package/dist/components/chart-tooltip/chart-tooltip.styles.js +1 -0
- package/dist/components/checkbox/checkbox-card.d.ts +16 -0
- package/dist/components/checkbox/checkbox-card.js +1 -0
- package/dist/components/checkbox/checkbox-card.styles.js +1 -0
- package/dist/components/checkbox/checkbox.d.ts +13 -0
- package/dist/components/checkbox/checkbox.js +5 -0
- package/dist/components/checkbox/checkbox.styles.js +3 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +6 -0
- package/dist/components/checkbox-group/checkbox-group.js +1 -0
- package/dist/components/checkbox-group/checkbox-group.styles.js +1 -0
- package/dist/components/citation/citation.d.ts +6 -0
- package/dist/components/citation/citation.js +1 -0
- package/dist/components/citation/citation.styles.js +1 -0
- package/dist/components/code/code.d.ts +5 -0
- package/dist/components/code/code.js +1 -0
- package/dist/components/code/code.styles.js +3 -0
- package/dist/components/code-block/code-block-copy.d.ts +6 -0
- package/dist/components/code-block/code-block-copy.js +1 -0
- package/dist/components/code-block/code-block-highlight.d.ts +31 -0
- package/dist/components/code-block/code-block-highlight.js +8 -0
- package/dist/components/code-block/code-block.d.ts +22 -0
- package/dist/components/code-block/code-block.js +4 -0
- package/dist/components/code-block/code-block.styles.js +3 -0
- package/dist/components/collapsible/collapsible.d.ts +19 -0
- package/dist/components/collapsible/collapsible.js +1 -0
- package/dist/components/collapsible/collapsible.styles.js +1 -0
- package/dist/components/combobox/combobox-chips.js +1 -0
- package/dist/components/combobox/combobox-chips.styles.js +1 -0
- package/dist/components/combobox/combobox-context.d.ts +9 -0
- package/dist/components/combobox/combobox-context.js +1 -0
- package/dist/components/combobox/combobox-field.styles.js +1 -0
- package/dist/components/combobox/combobox-input.js +1 -0
- package/dist/components/combobox/combobox-popup.js +1 -0
- package/dist/components/combobox/combobox-popup.styles.js +1 -0
- package/dist/components/combobox/combobox-structure.js +1 -0
- package/dist/components/combobox/combobox.d.ts +27 -0
- package/dist/components/combobox/combobox.js +1 -0
- package/dist/components/combobox/combobox.types.d.ts +43 -0
- package/dist/components/combobox/combobox.types.js +1 -0
- package/dist/components/command/command-dialog.js +1 -0
- package/dist/components/command/command-dialog.styles.js +1 -0
- package/dist/components/command/command-field.styles.js +1 -0
- package/dist/components/command/command-input.js +1 -0
- package/dist/components/command/command-items.js +1 -0
- package/dist/components/command/command-items.styles.js +1 -0
- package/dist/components/command/command-structure.js +1 -0
- package/dist/components/command/command.d.ts +29 -0
- package/dist/components/command/command.js +2 -0
- package/dist/components/command/command.types.d.ts +28 -0
- package/dist/components/command/command.types.js +1 -0
- package/dist/components/composer/attachment-marker.stylex.js +2 -0
- package/dist/components/composer/composer-clipboard.js +1 -0
- package/dist/components/composer/composer-context-meter.d.ts +36 -0
- package/dist/components/composer/composer-context-meter.js +6 -0
- package/dist/components/composer/composer-dictation.d.ts +17 -0
- package/dist/components/composer/composer-dictation.js +5 -0
- package/dist/components/composer/composer-document.d.ts +32 -0
- package/dist/components/composer/composer-document.js +1 -0
- package/dist/components/composer/composer-editor.d.ts +57 -0
- package/dist/components/composer/composer-editor.js +4 -0
- package/dist/components/composer/composer-history.js +1 -0
- package/dist/components/composer/composer-options.d.ts +45 -0
- package/dist/components/composer/composer-options.js +1 -0
- package/dist/components/composer/composer-parts.d.ts +36 -0
- package/dist/components/composer/composer-parts.js +4 -0
- package/dist/components/composer/composer-parts.styles.js +4 -0
- package/dist/components/composer/composer-picker.d.ts +50 -0
- package/dist/components/composer/composer-picker.js +15 -0
- package/dist/components/composer/composer-progress-ring.js +1 -0
- package/dist/components/composer/composer-query.js +1 -0
- package/dist/components/composer/composer-scroll-area.js +1 -0
- package/dist/components/composer/composer-session.js +3 -0
- package/dist/components/composer/composer-value.d.ts +45 -0
- package/dist/components/composer/composer-value.js +1 -0
- package/dist/components/composer/composer.css +80 -0
- package/dist/components/composer/composer.d.ts +72 -0
- package/dist/components/composer/composer.js +3 -0
- package/dist/components/composer/composer.styles.js +2 -0
- package/dist/components/composer/use-composer-editor.d.ts +8 -0
- package/dist/components/composer/use-composer-editor.js +2 -0
- package/dist/components/context-menu/context-menu-items.d.ts +10 -0
- package/dist/components/context-menu/context-menu-items.js +2 -0
- package/dist/components/context-menu/context-menu-utils.js +1 -0
- package/dist/components/context-menu/context-menu.d.ts +22 -0
- package/dist/components/context-menu/context-menu.js +1 -0
- package/dist/components/context-menu/context-menu.types.d.ts +57 -0
- package/dist/components/context-menu/context-menu.types.js +1 -0
- package/dist/components/conversation/conversation.d.ts +41 -0
- package/dist/components/conversation/conversation.js +6 -0
- package/dist/components/conversation/conversation.styles.js +2 -0
- package/dist/components/data-table/data-table.d.ts +30 -0
- package/dist/components/data-table/data-table.js +13 -0
- package/dist/components/data-table/data-table.styles.js +1 -0
- package/dist/components/data-table/grid-navigation.js +10 -0
- package/dist/components/date-picker/date-picker-date.js +1 -0
- package/dist/components/date-picker/date-picker-icon.js +1 -0
- package/dist/components/date-picker/date-picker-state.js +1 -0
- package/dist/components/date-picker/date-picker.d.ts +4 -0
- package/dist/components/date-picker/date-picker.js +1 -0
- package/dist/components/date-picker/date-picker.styles.js +1 -0
- package/dist/components/date-picker/date-picker.types.d.ts +28 -0
- package/dist/components/date-picker/date-picker.types.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-date.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-state.js +1 -0
- package/dist/components/date-range-picker/date-range-picker-views.js +1 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +4 -0
- package/dist/components/date-range-picker/date-range-picker.js +1 -0
- package/dist/components/date-range-picker/date-range-picker.styles.js +1 -0
- package/dist/components/date-range-picker/date-range-picker.types.d.ts +37 -0
- package/dist/components/date-range-picker/date-range-picker.types.js +1 -0
- package/dist/components/date-time-input/date-time-input.d.ts +13 -0
- package/dist/components/date-time-input/date-time-input.js +1 -0
- package/dist/components/diagram/diagram-renderer.js +5 -0
- package/dist/components/diagram/diagram.css +51 -0
- package/dist/components/diagram/diagram.d.ts +11 -0
- package/dist/components/diagram/diagram.js +4 -0
- package/dist/components/diagram/diagram.styles.js +6 -0
- package/dist/components/dialog/dialog.d.ts +34 -0
- package/dist/components/dialog/dialog.js +1 -0
- package/dist/components/dialog/dialog.styles.js +1 -0
- package/dist/components/distribution/distribution.d.ts +16 -0
- package/dist/components/distribution/distribution.js +6 -0
- package/dist/components/distribution/distribution.styles.js +1 -0
- package/dist/components/drawer/drawer-affordance.styles.js +1 -0
- package/dist/components/drawer/drawer-bar.js +1 -0
- package/dist/components/drawer/drawer-content.js +1 -0
- package/dist/components/drawer/drawer-layout.js +1 -0
- package/dist/components/drawer/drawer-menu.d.ts +30 -0
- package/dist/components/drawer/drawer-menu.js +1 -0
- package/dist/components/drawer/drawer-menu.styles.js +1 -0
- package/dist/components/drawer/drawer-positions.styles.js +1 -0
- package/dist/components/drawer/drawer.context.js +1 -0
- package/dist/components/drawer/drawer.d.ts +22 -0
- package/dist/components/drawer/drawer.js +2 -0
- package/dist/components/drawer/drawer.styles.js +1 -0
- package/dist/components/drawer/drawer.types.d.ts +53 -0
- package/dist/components/drawer/drawer.types.js +1 -0
- package/dist/components/empty/empty.d.ts +18 -0
- package/dist/components/empty/empty.js +1 -0
- package/dist/components/empty/empty.styles.js +1 -0
- package/dist/components/error-state/error-state.d.ts +15 -0
- package/dist/components/error-state/error-state.js +1 -0
- package/dist/components/error-state/error-state.styles.js +1 -0
- package/dist/components/field/field-context.d.ts +33 -0
- package/dist/components/field/field-context.js +1 -0
- package/dist/components/field/field.d.ts +44 -0
- package/dist/components/field/field.js +3 -0
- package/dist/components/field/field.styles.js +1 -0
- package/dist/components/fieldset/fieldset.d.ts +14 -0
- package/dist/components/fieldset/fieldset.js +1 -0
- package/dist/components/fieldset/fieldset.styles.js +1 -0
- package/dist/components/file-upload/file-upload-context.js +1 -0
- package/dist/components/file-upload/file-upload-controls.d.ts +4 -0
- package/dist/components/file-upload/file-upload-controls.js +7 -0
- package/dist/components/file-upload/file-upload-item-preview.d.ts +5 -0
- package/dist/components/file-upload/file-upload-item-preview.js +3 -0
- package/dist/components/file-upload/file-upload-items.d.ts +8 -0
- package/dist/components/file-upload/file-upload-items.js +5 -0
- package/dist/components/file-upload/file-upload-motion.js +6 -0
- package/dist/components/file-upload/file-upload-validation.d.ts +18 -0
- package/dist/components/file-upload/file-upload-validation.js +1 -0
- package/dist/components/file-upload/file-upload.d.ts +19 -0
- package/dist/components/file-upload/file-upload.js +2 -0
- package/dist/components/file-upload/file-upload.styles.js +2 -0
- package/dist/components/file-upload/file-upload.types.d.ts +87 -0
- package/dist/components/file-upload/file-upload.types.js +1 -0
- package/dist/components/frame/frame.d.ts +13 -0
- package/dist/components/frame/frame.js +1 -0
- package/dist/components/frame/frame.styles.js +1 -0
- package/dist/components/funnel/funnel-flow.js +3 -0
- package/dist/components/funnel/funnel.d.ts +31 -0
- package/dist/components/funnel/funnel.js +4 -0
- package/dist/components/funnel/funnel.styles.js +1 -0
- package/dist/components/grid/grid.d.ts +5 -0
- package/dist/components/grid/grid.js +1 -0
- package/dist/components/grid/grid.styles.js +1 -0
- package/dist/components/group/group.d.ts +5 -0
- package/dist/components/group/group.js +1 -0
- package/dist/components/group/group.styles.js +1 -0
- package/dist/components/heading/heading.d.ts +10 -0
- package/dist/components/heading/heading.js +1 -0
- package/dist/components/heading/heading.styles.js +1 -0
- package/dist/components/heatmap/heatmap-scale.js +3 -0
- package/dist/components/heatmap/heatmap.d.ts +17 -0
- package/dist/components/heatmap/heatmap.js +2 -0
- package/dist/components/inline/inline.d.ts +5 -0
- package/dist/components/inline/inline.js +1 -0
- package/dist/components/inline/inline.styles.js +1 -0
- package/dist/components/inline-citation/citation-source.d.ts +27 -0
- package/dist/components/inline-citation/citation-source.js +13 -0
- package/dist/components/inline-citation/inline-citation.d.ts +22 -0
- package/dist/components/inline-citation/inline-citation.js +10 -0
- package/dist/components/inline-citation/inline-citation.styles.js +1 -0
- package/dist/components/input/input.d.ts +17 -0
- package/dist/components/input/input.js +3 -0
- package/dist/components/input/input.styles.js +1 -0
- package/dist/components/input-group/input-group.d.ts +17 -0
- package/dist/components/input-group/input-group.js +1 -0
- package/dist/components/input-group/input-group.styles.js +1 -0
- package/dist/components/kbd/kbd.d.ts +7 -0
- package/dist/components/kbd/kbd.js +1 -0
- package/dist/components/kbd/kbd.styles.js +1 -0
- package/dist/components/label/label.d.ts +5 -0
- package/dist/components/label/label.js +1 -0
- package/dist/components/label/label.styles.js +1 -0
- package/dist/components/lightbox/lightbox-gallery.d.ts +25 -0
- package/dist/components/lightbox/lightbox-gallery.js +6 -0
- package/dist/components/lightbox/lightbox.d.ts +30 -0
- package/dist/components/lightbox/lightbox.js +6 -0
- package/dist/components/lightbox/lightbox.styles.js +3 -0
- package/dist/components/link/link.d.ts +15 -0
- package/dist/components/link/link.js +1 -0
- package/dist/components/link/link.styles.js +1 -0
- package/dist/components/list/list.d.ts +10 -0
- package/dist/components/list/list.js +2 -0
- package/dist/components/list/list.styles.js +1 -0
- package/dist/components/markdown/markdown.d.ts +34 -0
- package/dist/components/markdown/markdown.js +8 -0
- package/dist/components/markdown/markdown.styles.js +1 -0
- package/dist/components/menu/menu-align-context.js +3 -0
- package/dist/components/menu/menu.d.ts +75 -0
- package/dist/components/menu/menu.js +2 -0
- package/dist/components/menu/menu.styles.js +1 -0
- package/dist/components/menubar/menubar.d.ts +13 -0
- package/dist/components/menubar/menubar.js +1 -0
- package/dist/components/menubar/menubar.styles.js +1 -0
- package/dist/components/message/message.d.ts +47 -0
- package/dist/components/message/message.js +16 -0
- package/dist/components/message/message.styles.js +3 -0
- package/dist/components/message-scroller/message-scroller-store.d.ts +58 -0
- package/dist/components/message-scroller/message-scroller-store.js +27 -0
- package/dist/components/message-scroller/message-scroller.d.ts +76 -0
- package/dist/components/message-scroller/message-scroller.js +30 -0
- package/dist/components/message-scroller/message-scroller.styles.js +4 -0
- package/dist/components/meter/meter.d.ts +30 -0
- package/dist/components/meter/meter.js +2 -0
- package/dist/components/meter/meter.styles.js +1 -0
- package/dist/components/metric/metric.d.ts +17 -0
- package/dist/components/metric/metric.js +4 -0
- package/dist/components/metric/metric.styles.js +1 -0
- package/dist/components/metric-trend/metric-trend.d.ts +26 -0
- package/dist/components/metric-trend/metric-trend.js +6 -0
- package/dist/components/metric-trend/metric-trend.styles.js +1 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +40 -0
- package/dist/components/navigation-menu/navigation-menu.js +1 -0
- package/dist/components/navigation-menu/navigation-menu.styles.js +1 -0
- package/dist/components/number-field/number-field-context.js +1 -0
- package/dist/components/number-field/number-field.d.ts +11 -0
- package/dist/components/number-field/number-field.js +1 -0
- package/dist/components/number-field/number-field.styles.js +1 -0
- package/dist/components/number-field/number-field.types.d.ts +30 -0
- package/dist/components/number-field/number-field.types.js +1 -0
- package/dist/components/otp-field/otp-field.d.ts +21 -0
- package/dist/components/otp-field/otp-field.js +1 -0
- package/dist/components/otp-field/otp-field.styles.js +1 -0
- package/dist/components/overflow-list/overflow-list.d.ts +10 -0
- package/dist/components/overflow-list/overflow-list.js +3 -0
- package/dist/components/overflow-list/overflow-list.styles.js +1 -0
- package/dist/components/pagination/pagination-link.d.ts +10 -0
- package/dist/components/pagination/pagination-link.js +1 -0
- package/dist/components/pagination/pagination.d.ts +22 -0
- package/dist/components/pagination/pagination.js +2 -0
- package/dist/components/pagination/pagination.styles.js +1 -0
- package/dist/components/part-to-whole/part-to-whole.d.ts +18 -0
- package/dist/components/part-to-whole/part-to-whole.js +2 -0
- package/dist/components/part-to-whole/part-to-whole.styles.js +1 -0
- package/dist/components/popover/popover.d.ts +33 -0
- package/dist/components/popover/popover.js +1 -0
- package/dist/components/popover/popover.styles.js +1 -0
- package/dist/components/preview-card/preview-card.d.ts +21 -0
- package/dist/components/preview-card/preview-card.js +1 -0
- package/dist/components/preview-card/preview-card.styles.js +1 -0
- package/dist/components/progress/progress.d.ts +28 -0
- package/dist/components/progress/progress.js +1 -0
- package/dist/components/progress/progress.styles.js +1 -0
- package/dist/components/progress-rings/progress-rings.d.ts +25 -0
- package/dist/components/progress-rings/progress-rings.js +2 -0
- package/dist/components/progress-rings/progress-rings.styles.js +1 -0
- package/dist/components/property-list/property-list.d.ts +9 -0
- package/dist/components/property-list/property-list.js +1 -0
- package/dist/components/property-list/property-list.styles.js +1 -0
- package/dist/components/question-card/question-card.d.ts +35 -0
- package/dist/components/question-card/question-card.js +13 -0
- package/dist/components/question-card/question-card.styles.js +1 -0
- package/dist/components/radar-chart/radar-chart.d.ts +28 -0
- package/dist/components/radar-chart/radar-chart.js +1 -0
- package/dist/components/radial-bars/radial-bars.d.ts +19 -0
- package/dist/components/radial-bars/radial-bars.js +8 -0
- package/dist/components/radio/radio-card.d.ts +15 -0
- package/dist/components/radio/radio-card.js +1 -0
- package/dist/components/radio/radio.d.ts +9 -0
- package/dist/components/radio/radio.js +1 -0
- package/dist/components/radio/radio.styles.js +1 -0
- package/dist/components/radio-group/radio-group.d.ts +3 -0
- package/dist/components/radio-group/radio-group.js +1 -0
- package/dist/components/sankey-chart/sankey-chart.d.ts +16 -0
- package/dist/components/sankey-chart/sankey-chart.js +1 -0
- package/dist/components/sankey-chart/sankey-layout.d.ts +34 -0
- package/dist/components/sankey-chart/sankey-layout.js +5 -0
- package/dist/components/scatter-chart/scatter-chart.d.ts +30 -0
- package/dist/components/scatter-chart/scatter-chart.js +6 -0
- package/dist/components/scatter-chart/scatter-chart.styles.js +1 -0
- package/dist/components/score-gauge/score-gauge.d.ts +24 -0
- package/dist/components/score-gauge/score-gauge.js +8 -0
- package/dist/components/score-gauge/score-gauge.styles.js +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +26 -0
- package/dist/components/scroll-area/scroll-area.js +1 -0
- package/dist/components/scroll-area/scroll-area.styles.js +2 -0
- package/dist/components/section/section.d.ts +5 -0
- package/dist/components/section/section.js +1 -0
- package/dist/components/section/section.styles.js +1 -0
- package/dist/components/segmented-control/segmented-control.d.ts +10 -0
- package/dist/components/segmented-control/segmented-control.js +1 -0
- package/dist/components/segmented-control/segmented-control.styles.js +1 -0
- package/dist/components/select/select.d.ts +55 -0
- package/dist/components/select/select.js +1 -0
- package/dist/components/select/select.styles.js +1 -0
- package/dist/components/separator/separator.d.ts +5 -0
- package/dist/components/separator/separator.js +1 -0
- package/dist/components/separator/separator.styles.js +1 -0
- package/dist/components/sheet/sheet-layout.js +1 -0
- package/dist/components/sheet/sheet-positions.styles.js +1 -0
- package/dist/components/sheet/sheet.d.ts +15 -0
- package/dist/components/sheet/sheet.js +1 -0
- package/dist/components/sheet/sheet.styles.js +1 -0
- package/dist/components/sheet/sheet.types.d.ts +32 -0
- package/dist/components/sheet/sheet.types.js +1 -0
- package/dist/components/skeleton/skeleton.d.ts +8 -0
- package/dist/components/skeleton/skeleton.js +1 -0
- package/dist/components/skeleton/skeleton.styles.js +1 -0
- package/dist/components/slider/slider-context.d.ts +23 -0
- package/dist/components/slider/slider-context.js +9 -0
- package/dist/components/slider/slider-default-anatomy.js +1 -0
- package/dist/components/slider/slider-ref-utils.js +1 -0
- package/dist/components/slider/slider-slot.js +1 -0
- package/dist/components/slider/slider.d.ts +15 -0
- package/dist/components/slider/slider.js +1 -0
- package/dist/components/slider/slider.styles.js +1 -0
- package/dist/components/slider/slider.types.d.ts +36 -0
- package/dist/components/slider/slider.types.js +1 -0
- package/dist/components/sources/sources.d.ts +22 -0
- package/dist/components/sources/sources.js +6 -0
- package/dist/components/sources/sources.styles.js +3 -0
- package/dist/components/spacer/spacer.d.ts +5 -0
- package/dist/components/spacer/spacer.js +1 -0
- package/dist/components/spacer/spacer.styles.js +1 -0
- package/dist/components/spinner/spinner.d.ts +18 -0
- package/dist/components/spinner/spinner.js +9 -0
- package/dist/components/spinner/spinner.styles.js +11 -0
- package/dist/components/stack/stack.d.ts +9 -0
- package/dist/components/stack/stack.js +1 -0
- package/dist/components/stack/stack.styles.d.ts +76 -0
- package/dist/components/stack/stack.styles.js +2 -0
- package/dist/components/status-dot/status-dot.d.ts +9 -0
- package/dist/components/status-dot/status-dot.js +1 -0
- package/dist/components/status-dot/status-dot.styles.js +1 -0
- package/dist/components/stepper/stepper.d.ts +42 -0
- package/dist/components/stepper/stepper.js +2 -0
- package/dist/components/stepper/stepper.styles.js +1 -0
- package/dist/components/streaming-text/streaming-text-words.d.ts +29 -0
- package/dist/components/streaming-text/streaming-text-words.js +19 -0
- package/dist/components/streaming-text/streaming-text.d.ts +35 -0
- package/dist/components/streaming-text/streaming-text.js +13 -0
- package/dist/components/streaming-text/streaming-text.styles.js +6 -0
- package/dist/components/suggestion/suggestion.d.ts +23 -0
- package/dist/components/suggestion/suggestion.js +7 -0
- package/dist/components/suggestion/suggestion.styles.js +3 -0
- package/dist/components/switch/switch.d.ts +12 -0
- package/dist/components/switch/switch.js +1 -0
- package/dist/components/switch/switch.styles.js +1 -0
- package/dist/components/table/table.d.ts +64 -0
- package/dist/components/table/table.js +1 -0
- package/dist/components/table/table.styles.js +1 -0
- package/dist/components/tabs/tabs.d.ts +32 -0
- package/dist/components/tabs/tabs.js +1 -0
- package/dist/components/tabs/tabs.styles.js +1 -0
- package/dist/components/task-list/task-list.d.ts +34 -0
- package/dist/components/task-list/task-list.js +10 -0
- package/dist/components/task-list/task-list.styles.js +2 -0
- package/dist/components/terminal/ansi.js +11 -0
- package/dist/components/terminal/terminal.d.ts +23 -0
- package/dist/components/terminal/terminal.js +15 -0
- package/dist/components/terminal/terminal.styles.js +1 -0
- package/dist/components/text/text.d.ts +11 -0
- package/dist/components/text/text.js +1 -0
- package/dist/components/text/text.styles.js +1 -0
- package/dist/components/textarea/textarea.d.ts +13 -0
- package/dist/components/textarea/textarea.js +3 -0
- package/dist/components/textarea/textarea.styles.js +1 -0
- package/dist/components/thumbnail/thumbnail.d.ts +9 -0
- package/dist/components/thumbnail/thumbnail.js +2 -0
- package/dist/components/thumbnail/thumbnail.styles.js +1 -0
- package/dist/components/time-input/time-input.d.ts +13 -0
- package/dist/components/time-input/time-input.js +1 -0
- package/dist/components/time-series/time-format.d.ts +16 -0
- package/dist/components/time-series/time-format.js +10 -0
- package/dist/components/time-series/time-series.d.ts +30 -0
- package/dist/components/time-series/time-series.js +10 -0
- package/dist/components/time-series/time-series.styles.js +1 -0
- package/dist/components/timestamp/timestamp.d.ts +15 -0
- package/dist/components/timestamp/timestamp.js +4 -0
- package/dist/components/timestamp/timestamp.styles.js +1 -0
- package/dist/components/toast/toast-anchored.styles.js +1 -0
- package/dist/components/toast/toast-animation.styles.js +1 -0
- package/dist/components/toast/toast-icons.js +1 -0
- package/dist/components/toast/toast-stacked.styles.js +1 -0
- package/dist/components/toast/toast-utils.js +1 -0
- package/dist/components/toast/toast-views.js +1 -0
- package/dist/components/toast/toast.d.ts +8 -0
- package/dist/components/toast/toast.js +1 -0
- package/dist/components/toast/toast.styles.js +1 -0
- package/dist/components/toast/toast.types.d.ts +18 -0
- package/dist/components/toast/toast.types.js +1 -0
- package/dist/components/toggle/toggle-colors.stylex.js +2 -0
- package/dist/components/toggle/toggle.d.ts +33 -0
- package/dist/components/toggle/toggle.js +1 -0
- package/dist/components/toggle/toggle.styles.js +1 -0
- package/dist/components/token/token.d.ts +16 -0
- package/dist/components/token/token.js +1 -0
- package/dist/components/token/token.styles.js +1 -0
- package/dist/components/tool-call/tool-call-group.d.ts +17 -0
- package/dist/components/tool-call/tool-call-group.js +6 -0
- package/dist/components/tool-call/tool-call.d.ts +36 -0
- package/dist/components/tool-call/tool-call.js +12 -0
- package/dist/components/tool-call/tool-call.styles.js +3 -0
- package/dist/components/toolbar/toolbar-context.js +2 -0
- package/dist/components/toolbar/toolbar.d.ts +37 -0
- package/dist/components/toolbar/toolbar.js +1 -0
- package/dist/components/toolbar/toolbar.styles.js +1 -0
- package/dist/components/tooltip/tooltip.d.ts +25 -0
- package/dist/components/tooltip/tooltip.js +1 -0
- package/dist/components/tooltip/tooltip.styles.js +1 -0
- package/dist/components/tree/tree.d.ts +31 -0
- package/dist/components/tree/tree.js +5 -0
- package/dist/components/tree/tree.styles.js +3 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +6 -0
- package/dist/components/visually-hidden/visually-hidden.js +1 -0
- package/dist/components/visually-hidden/visually-hidden.styles.js +1 -0
- package/dist/control-label.js +3 -0
- package/dist/copy-button.js +1 -0
- package/dist/form.d.ts +2 -0
- package/dist/form.js +2 -0
- package/dist/icon-masks.stylex.js +3 -0
- package/dist/icons.js +5 -0
- package/dist/index.d.ts +275 -0
- package/dist/index.js +1 -0
- package/dist/loading-indicator.js +3 -0
- package/dist/motion.js +9 -0
- package/dist/ref-utils.js +1 -0
- package/dist/render-utils.js +3 -0
- package/dist/styles/application-structure.stylex.js +1 -0
- package/dist/styles/colors.stylex.d.ts +50 -0
- package/dist/styles/colors.stylex.js +1 -0
- package/dist/styles/conditions.stylex.d.ts +9 -0
- package/dist/styles/conditions.stylex.js +1 -0
- package/dist/styles/dimensions.stylex.d.ts +14 -0
- package/dist/styles/dimensions.stylex.js +1 -0
- package/dist/styles/floating-item-colors.stylex.js +1 -0
- package/dist/styles/fonts.stylex.d.ts +5 -0
- package/dist/styles/fonts.stylex.js +1 -0
- package/dist/styles/interaction.stylex.d.ts +23 -0
- package/dist/styles/interaction.stylex.js +4 -0
- package/dist/styles/motion.stylex.d.ts +22 -0
- package/dist/styles/motion.stylex.js +3 -0
- package/dist/styles/overlay-layers.styles.js +1 -0
- package/dist/styles/palette.stylex.d.ts +26 -0
- package/dist/styles/palette.stylex.js +1 -0
- package/dist/styles/shadows.stylex.d.ts +10 -0
- package/dist/styles/shadows.stylex.js +1 -0
- package/dist/styles/shape.stylex.d.ts +9 -0
- package/dist/styles/shape.stylex.js +1 -0
- package/dist/styles/spacing.stylex.d.ts +14 -0
- package/dist/styles/spacing.stylex.js +3 -0
- package/dist/styles/themes.d.ts +49 -0
- package/dist/styles/themes.js +1 -0
- package/dist/styles/typography.styles.d.ts +90 -0
- package/dist/styles/typography.styles.js +8 -0
- package/dist/styles/typography.stylex.d.ts +35 -0
- package/dist/styles/typography.stylex.js +5 -0
- package/dist/styles.css +2125 -0
- package/dist/theme/index.d.ts +11 -0
- package/dist/theme/index.js +1 -0
- package/dist/theme/initialize.d.ts +4 -0
- package/dist/theme/initialize.js +1 -0
- package/dist/theme/theme-provider.d.ts +3 -0
- package/dist/theme/theme-provider.js +4 -0
- package/dist/theme/theme-root.js +1 -0
- package/dist/theme/theme-script.d.ts +3 -0
- package/dist/theme/theme-script.js +1 -0
- package/dist/theme/theme-storage.js +1 -0
- package/dist/theme/theme-tokens.js +1 -0
- package/dist/theme/theme-transition-guard.js +1 -0
- package/dist/theme/types.d.ts +25 -0
- package/dist/theme/types.js +1 -0
- package/dist/use-copy-to-clipboard.d.ts +17 -0
- package/dist/use-copy-to-clipboard.js +6 -0
- package/dist/use-elapsed.js +4 -0
- package/package.json +769 -3
- package/src/closed.ts +7 -0
- package/src/components/accordion/accordion.styles.ts +246 -0
- package/src/components/accordion/accordion.tsx +221 -0
- package/src/components/activity-feed/activity-feed.styles.ts +135 -0
- package/src/components/activity-feed/activity-feed.tsx +182 -0
- package/src/components/agent-thinking/agent-thinking.styles.ts +140 -0
- package/src/components/agent-thinking/agent-thinking.tsx +275 -0
- package/src/components/alert/alert.styles.ts +135 -0
- package/src/components/alert/alert.stylex.ts +6 -0
- package/src/components/alert/alert.tsx +123 -0
- package/src/components/alert-dialog/alert-dialog.styles.ts +29 -0
- package/src/components/alert-dialog/alert-dialog.tsx +197 -0
- package/src/components/approval-card/approval-card.styles.ts +69 -0
- package/src/components/approval-card/approval-card.tsx +379 -0
- package/src/components/area-chart/area-chart.styles.ts +14 -0
- package/src/components/area-chart/area-chart.tsx +571 -0
- package/src/components/aspect-ratio/aspect-ratio.styles.ts +20 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +43 -0
- package/src/components/attachment/attachment.styles.ts +71 -0
- package/src/components/attachment/attachment.tsx +132 -0
- package/src/components/avatar/avatar-character.styles.ts +32 -0
- package/src/components/avatar/avatar.styles.ts +118 -0
- package/src/components/avatar/avatar.tsx +262 -0
- package/src/components/badge/badge.styles.ts +116 -0
- package/src/components/badge/badge.tsx +66 -0
- package/src/components/bar-list/bar-list.styles.ts +72 -0
- package/src/components/bar-list/bar-list.tsx +157 -0
- package/src/components/blockquote/blockquote.styles.ts +26 -0
- package/src/components/blockquote/blockquote.tsx +75 -0
- package/src/components/breadcrumb/breadcrumb-link.tsx +32 -0
- package/src/components/breadcrumb/breadcrumb.styles.ts +114 -0
- package/src/components/breadcrumb/breadcrumb.tsx +137 -0
- package/src/components/button/button-colors.stylex.ts +7 -0
- package/src/components/button/button.css +16 -0
- package/src/components/button/button.css.d.ts +1 -0
- package/src/components/button/button.styles.ts +457 -0
- package/src/components/button/button.tsx +168 -0
- package/src/components/button-group/button-group.css +115 -0
- package/src/components/button-group/button-group.styles.ts +24 -0
- package/src/components/button-group/button-group.tsx +46 -0
- package/src/components/calendar/calendar-components.tsx +187 -0
- package/src/components/calendar/calendar-context.ts +16 -0
- package/src/components/calendar/calendar-dropdowns.tsx +84 -0
- package/src/components/calendar/calendar-utils.ts +67 -0
- package/src/components/calendar/calendar.styles.ts +270 -0
- package/src/components/calendar/calendar.tsx +244 -0
- package/src/components/calendar/calendar.types.ts +55 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +384 -0
- package/src/components/card/card.styles.ts +122 -0
- package/src/components/card/card.tsx +154 -0
- package/src/components/carousel/carousel.styles.ts +142 -0
- package/src/components/carousel/carousel.tsx +786 -0
- package/src/components/category-comparison/category-comparison.styles.ts +14 -0
- package/src/components/category-comparison/category-comparison.tsx +567 -0
- package/src/components/chart-frame/arc-path.ts +33 -0
- package/src/components/chart-frame/chart-assert.ts +47 -0
- package/src/components/chart-frame/chart-colors.ts +14 -0
- package/src/components/chart-frame/chart-crosshair.ts +129 -0
- package/src/components/chart-frame/chart-data-table.tsx +15 -0
- package/src/components/chart-frame/chart-frame.styles.ts +48 -0
- package/src/components/chart-frame/chart-frame.tsx +223 -0
- package/src/components/chart-frame/chart-hover.tsx +127 -0
- package/src/components/chart-frame/chart-loading.tsx +130 -0
- package/src/components/chart-frame/ring-graphic.tsx +100 -0
- package/src/components/chart-legend/chart-legend.styles.ts +80 -0
- package/src/components/chart-legend/chart-legend.tsx +107 -0
- package/src/components/chart-tooltip/chart-tooltip.styles.ts +71 -0
- package/src/components/chart-tooltip/chart-tooltip.tsx +94 -0
- package/src/components/checkbox/checkbox-card.styles.ts +75 -0
- package/src/components/checkbox/checkbox-card.tsx +71 -0
- package/src/components/checkbox/checkbox.styles.ts +199 -0
- package/src/components/checkbox/checkbox.tsx +104 -0
- package/src/components/checkbox-group/checkbox-group.styles.ts +11 -0
- package/src/components/checkbox-group/checkbox-group.tsx +29 -0
- package/src/components/citation/citation.styles.ts +7 -0
- package/src/components/citation/citation.tsx +30 -0
- package/src/components/code/code.styles.ts +22 -0
- package/src/components/code/code.tsx +22 -0
- package/src/components/code-block/code-block-copy.tsx +62 -0
- package/src/components/code-block/code-block-highlight.tsx +69 -0
- package/src/components/code-block/code-block.styles.ts +129 -0
- package/src/components/code-block/code-block.tsx +128 -0
- package/src/components/collapsible/collapsible.styles.ts +22 -0
- package/src/components/collapsible/collapsible.tsx +109 -0
- package/src/components/combobox/combobox-chips.styles.ts +182 -0
- package/src/components/combobox/combobox-chips.tsx +164 -0
- package/src/components/combobox/combobox-context.tsx +26 -0
- package/src/components/combobox/combobox-field.styles.ts +156 -0
- package/src/components/combobox/combobox-input.tsx +185 -0
- package/src/components/combobox/combobox-popup.styles.ts +190 -0
- package/src/components/combobox/combobox-popup.tsx +113 -0
- package/src/components/combobox/combobox-structure.tsx +138 -0
- package/src/components/combobox/combobox.tsx +162 -0
- package/src/components/combobox/combobox.types.ts +77 -0
- package/src/components/command/command-dialog.styles.ts +43 -0
- package/src/components/command/command-dialog.tsx +126 -0
- package/src/components/command/command-field.styles.ts +59 -0
- package/src/components/command/command-input.tsx +59 -0
- package/src/components/command/command-items.styles.ts +169 -0
- package/src/components/command/command-items.tsx +99 -0
- package/src/components/command/command-structure.tsx +172 -0
- package/src/components/command/command.tsx +157 -0
- package/src/components/command/command.types.ts +58 -0
- package/src/components/composer/attachment-marker.stylex.ts +4 -0
- package/src/components/composer/composer-clipboard.ts +49 -0
- package/src/components/composer/composer-context-meter.tsx +179 -0
- package/src/components/composer/composer-dictation.tsx +56 -0
- package/src/components/composer/composer-document.ts +508 -0
- package/src/components/composer/composer-editor.ts +544 -0
- package/src/components/composer/composer-history.ts +74 -0
- package/src/components/composer/composer-options.ts +51 -0
- package/src/components/composer/composer-parts.styles.ts +456 -0
- package/src/components/composer/composer-parts.tsx +245 -0
- package/src/components/composer/composer-picker.tsx +375 -0
- package/src/components/composer/composer-progress-ring.tsx +44 -0
- package/src/components/composer/composer-query.ts +52 -0
- package/src/components/composer/composer-scroll-area.tsx +29 -0
- package/src/components/composer/composer-session.ts +593 -0
- package/src/components/composer/composer-value.ts +46 -0
- package/src/components/composer/composer.css +80 -0
- package/src/components/composer/composer.styles.ts +236 -0
- package/src/components/composer/composer.tsx +581 -0
- package/src/components/composer/use-composer-editor.ts +153 -0
- package/src/components/context-menu/context-menu-items.tsx +230 -0
- package/src/components/context-menu/context-menu-utils.tsx +65 -0
- package/src/components/context-menu/context-menu.tsx +198 -0
- package/src/components/context-menu/context-menu.types.ts +97 -0
- package/src/components/conversation/conversation.styles.ts +56 -0
- package/src/components/conversation/conversation.tsx +142 -0
- package/src/components/data-table/data-table.styles.ts +63 -0
- package/src/components/data-table/data-table.tsx +723 -0
- package/src/components/data-table/grid-navigation.ts +186 -0
- package/src/components/date-picker/date-picker-date.ts +142 -0
- package/src/components/date-picker/date-picker-icon.tsx +6 -0
- package/src/components/date-picker/date-picker-state.ts +193 -0
- package/src/components/date-picker/date-picker.styles.ts +53 -0
- package/src/components/date-picker/date-picker.tsx +213 -0
- package/src/components/date-picker/date-picker.types.ts +32 -0
- package/src/components/date-range-picker/date-range-picker-date.ts +191 -0
- package/src/components/date-range-picker/date-range-picker-state.ts +235 -0
- package/src/components/date-range-picker/date-range-picker-views.tsx +144 -0
- package/src/components/date-range-picker/date-range-picker.styles.ts +80 -0
- package/src/components/date-range-picker/date-range-picker.tsx +208 -0
- package/src/components/date-range-picker/date-range-picker.types.ts +41 -0
- package/src/components/date-time-input/date-time-input.tsx +30 -0
- package/src/components/diagram/diagram-renderer.ts +35 -0
- package/src/components/diagram/diagram.css +51 -0
- package/src/components/diagram/diagram.styles.ts +130 -0
- package/src/components/diagram/diagram.tsx +238 -0
- package/src/components/dialog/dialog.styles.ts +226 -0
- package/src/components/dialog/dialog.tsx +227 -0
- package/src/components/distribution/distribution.styles.ts +14 -0
- package/src/components/distribution/distribution.tsx +450 -0
- package/src/components/drawer/drawer-affordance.styles.ts +61 -0
- package/src/components/drawer/drawer-bar.tsx +53 -0
- package/src/components/drawer/drawer-content.tsx +25 -0
- package/src/components/drawer/drawer-layout.tsx +129 -0
- package/src/components/drawer/drawer-menu.styles.ts +52 -0
- package/src/components/drawer/drawer-menu.tsx +222 -0
- package/src/components/drawer/drawer-positions.styles.ts +138 -0
- package/src/components/drawer/drawer.context.tsx +25 -0
- package/src/components/drawer/drawer.styles.ts +233 -0
- package/src/components/drawer/drawer.tsx +278 -0
- package/src/components/drawer/drawer.types.ts +85 -0
- package/src/components/empty/empty.styles.ts +118 -0
- package/src/components/empty/empty.tsx +175 -0
- package/src/components/error-state/error-state.styles.ts +97 -0
- package/src/components/error-state/error-state.tsx +151 -0
- package/src/components/field/field-context.ts +83 -0
- package/src/components/field/field.styles.ts +141 -0
- package/src/components/field/field.tsx +212 -0
- package/src/components/fieldset/fieldset.styles.ts +28 -0
- package/src/components/fieldset/fieldset.tsx +68 -0
- package/src/components/file-upload/file-upload-context.tsx +191 -0
- package/src/components/file-upload/file-upload-controls.tsx +280 -0
- package/src/components/file-upload/file-upload-item-preview.tsx +56 -0
- package/src/components/file-upload/file-upload-items.tsx +339 -0
- package/src/components/file-upload/file-upload-motion.ts +85 -0
- package/src/components/file-upload/file-upload-validation.ts +141 -0
- package/src/components/file-upload/file-upload.styles.ts +426 -0
- package/src/components/file-upload/file-upload.tsx +278 -0
- package/src/components/file-upload/file-upload.types.ts +161 -0
- package/src/components/frame/frame.styles.ts +66 -0
- package/src/components/frame/frame.tsx +126 -0
- package/src/components/funnel/funnel-flow.tsx +198 -0
- package/src/components/funnel/funnel.styles.ts +73 -0
- package/src/components/funnel/funnel.tsx +177 -0
- package/src/components/grid/grid.styles.ts +15 -0
- package/src/components/grid/grid.tsx +22 -0
- package/src/components/group/group.styles.ts +13 -0
- package/src/components/group/group.tsx +22 -0
- package/src/components/heading/heading.styles.ts +10 -0
- package/src/components/heading/heading.tsx +52 -0
- package/src/components/heatmap/heatmap-scale.tsx +92 -0
- package/src/components/heatmap/heatmap.tsx +402 -0
- package/src/components/inline/inline.styles.ts +13 -0
- package/src/components/inline/inline.tsx +22 -0
- package/src/components/inline-citation/citation-source.tsx +105 -0
- package/src/components/inline-citation/inline-citation.styles.ts +94 -0
- package/src/components/inline-citation/inline-citation.tsx +199 -0
- package/src/components/input/input.styles.ts +95 -0
- package/src/components/input/input.tsx +147 -0
- package/src/components/input-group/input-group.styles.ts +183 -0
- package/src/components/input-group/input-group.tsx +215 -0
- package/src/components/kbd/kbd.styles.ts +42 -0
- package/src/components/kbd/kbd.tsx +70 -0
- package/src/components/label/label.styles.ts +8 -0
- package/src/components/label/label.tsx +29 -0
- package/src/components/lightbox/lightbox-gallery.tsx +208 -0
- package/src/components/lightbox/lightbox.styles.ts +196 -0
- package/src/components/lightbox/lightbox.tsx +137 -0
- package/src/components/link/link.styles.ts +41 -0
- package/src/components/link/link.tsx +48 -0
- package/src/components/list/list.styles.ts +49 -0
- package/src/components/list/list.tsx +105 -0
- package/src/components/markdown/markdown.styles.ts +104 -0
- package/src/components/markdown/markdown.tsx +268 -0
- package/src/components/menu/menu-align-context.ts +8 -0
- package/src/components/menu/menu.styles.ts +281 -0
- package/src/components/menu/menu.tsx +485 -0
- package/src/components/menubar/menubar.styles.ts +97 -0
- package/src/components/menubar/menubar.tsx +89 -0
- package/src/components/message/message.styles.ts +145 -0
- package/src/components/message/message.tsx +501 -0
- package/src/components/message-scroller/message-scroller-store.ts +457 -0
- package/src/components/message-scroller/message-scroller.styles.ts +177 -0
- package/src/components/message-scroller/message-scroller.tsx +417 -0
- package/src/components/meter/meter.styles.ts +48 -0
- package/src/components/meter/meter.tsx +176 -0
- package/src/components/metric/metric.styles.ts +64 -0
- package/src/components/metric/metric.tsx +134 -0
- package/src/components/metric-trend/metric-trend.styles.ts +103 -0
- package/src/components/metric-trend/metric-trend.tsx +188 -0
- package/src/components/navigation-menu/navigation-menu.styles.ts +183 -0
- package/src/components/navigation-menu/navigation-menu.tsx +255 -0
- package/src/components/number-field/number-field-context.tsx +46 -0
- package/src/components/number-field/number-field.styles.ts +229 -0
- package/src/components/number-field/number-field.tsx +268 -0
- package/src/components/number-field/number-field.types.ts +46 -0
- package/src/components/otp-field/otp-field.styles.ts +138 -0
- package/src/components/otp-field/otp-field.tsx +174 -0
- package/src/components/overflow-list/overflow-list.styles.ts +25 -0
- package/src/components/overflow-list/overflow-list.tsx +84 -0
- package/src/components/pagination/pagination-link.tsx +96 -0
- package/src/components/pagination/pagination.styles.ts +137 -0
- package/src/components/pagination/pagination.tsx +153 -0
- package/src/components/part-to-whole/part-to-whole.styles.ts +56 -0
- package/src/components/part-to-whole/part-to-whole.tsx +329 -0
- package/src/components/popover/popover.styles.ts +177 -0
- package/src/components/popover/popover.tsx +197 -0
- package/src/components/preview-card/preview-card.styles.ts +61 -0
- package/src/components/preview-card/preview-card.tsx +94 -0
- package/src/components/progress/progress.styles.ts +82 -0
- package/src/components/progress/progress.tsx +153 -0
- package/src/components/progress-rings/progress-rings.styles.ts +65 -0
- package/src/components/progress-rings/progress-rings.tsx +163 -0
- package/src/components/property-list/property-list.styles.ts +49 -0
- package/src/components/property-list/property-list.tsx +91 -0
- package/src/components/question-card/question-card.styles.ts +106 -0
- package/src/components/question-card/question-card.tsx +525 -0
- package/src/components/radar-chart/radar-chart.tsx +281 -0
- package/src/components/radial-bars/radial-bars.tsx +197 -0
- package/src/components/radio/radio-card.tsx +57 -0
- package/src/components/radio/radio.styles.ts +57 -0
- package/src/components/radio/radio.tsx +61 -0
- package/src/components/radio-group/radio-group.tsx +29 -0
- package/src/components/sankey-chart/sankey-chart.tsx +340 -0
- package/src/components/sankey-chart/sankey-layout.ts +107 -0
- package/src/components/scatter-chart/scatter-chart.styles.ts +7 -0
- package/src/components/scatter-chart/scatter-chart.tsx +509 -0
- package/src/components/score-gauge/score-gauge.styles.ts +77 -0
- package/src/components/score-gauge/score-gauge.tsx +236 -0
- package/src/components/scroll-area/scroll-area.styles.ts +174 -0
- package/src/components/scroll-area/scroll-area.tsx +202 -0
- package/src/components/section/section.styles.ts +11 -0
- package/src/components/section/section.tsx +29 -0
- package/src/components/segmented-control/segmented-control.styles.ts +107 -0
- package/src/components/segmented-control/segmented-control.tsx +98 -0
- package/src/components/select/select.styles.ts +295 -0
- package/src/components/select/select.tsx +335 -0
- package/src/components/separator/separator.styles.ts +14 -0
- package/src/components/separator/separator.tsx +24 -0
- package/src/components/sheet/sheet-layout.tsx +92 -0
- package/src/components/sheet/sheet-positions.styles.ts +104 -0
- package/src/components/sheet/sheet.styles.ts +209 -0
- package/src/components/sheet/sheet.tsx +182 -0
- package/src/components/sheet/sheet.types.ts +67 -0
- package/src/components/skeleton/skeleton.styles.ts +52 -0
- package/src/components/skeleton/skeleton.tsx +35 -0
- package/src/components/slider/slider-context.tsx +414 -0
- package/src/components/slider/slider-default-anatomy.tsx +71 -0
- package/src/components/slider/slider-ref-utils.ts +16 -0
- package/src/components/slider/slider-slot.ts +7 -0
- package/src/components/slider/slider.styles.ts +368 -0
- package/src/components/slider/slider.tsx +303 -0
- package/src/components/slider/slider.types.ts +57 -0
- package/src/components/sources/sources.styles.ts +105 -0
- package/src/components/sources/sources.tsx +150 -0
- package/src/components/spacer/spacer.styles.ts +11 -0
- package/src/components/spacer/spacer.tsx +25 -0
- package/src/components/spinner/spinner.styles.ts +231 -0
- package/src/components/spinner/spinner.tsx +153 -0
- package/src/components/stack/stack.styles.ts +37 -0
- package/src/components/stack/stack.tsx +34 -0
- package/src/components/status-dot/status-dot.styles.ts +27 -0
- package/src/components/status-dot/status-dot.tsx +55 -0
- package/src/components/stepper/stepper.styles.ts +564 -0
- package/src/components/stepper/stepper.tsx +349 -0
- package/src/components/streaming-text/streaming-text-words.tsx +275 -0
- package/src/components/streaming-text/streaming-text.styles.ts +166 -0
- package/src/components/streaming-text/streaming-text.tsx +299 -0
- package/src/components/suggestion/suggestion.styles.ts +55 -0
- package/src/components/suggestion/suggestion.tsx +125 -0
- package/src/components/switch/switch.styles.ts +195 -0
- package/src/components/switch/switch.tsx +69 -0
- package/src/components/table/table.styles.ts +198 -0
- package/src/components/table/table.tsx +290 -0
- package/src/components/tabs/tabs.styles.ts +245 -0
- package/src/components/tabs/tabs.tsx +186 -0
- package/src/components/task-list/task-list.styles.ts +82 -0
- package/src/components/task-list/task-list.tsx +430 -0
- package/src/components/terminal/ansi.ts +86 -0
- package/src/components/terminal/terminal.styles.ts +20 -0
- package/src/components/terminal/terminal.tsx +339 -0
- package/src/components/text/text.styles.ts +8 -0
- package/src/components/text/text.tsx +47 -0
- package/src/components/textarea/textarea.styles.ts +85 -0
- package/src/components/textarea/textarea.tsx +163 -0
- package/src/components/thumbnail/thumbnail.styles.ts +33 -0
- package/src/components/thumbnail/thumbnail.tsx +63 -0
- package/src/components/time-input/time-input.tsx +30 -0
- package/src/components/time-series/time-format.ts +172 -0
- package/src/components/time-series/time-series.styles.ts +18 -0
- package/src/components/time-series/time-series.tsx +521 -0
- package/src/components/timestamp/timestamp.styles.ts +9 -0
- package/src/components/timestamp/timestamp.tsx +162 -0
- package/src/components/toast/toast-anchored.styles.ts +146 -0
- package/src/components/toast/toast-animation.styles.ts +64 -0
- package/src/components/toast/toast-icons.tsx +58 -0
- package/src/components/toast/toast-stacked.styles.ts +129 -0
- package/src/components/toast/toast-utils.ts +53 -0
- package/src/components/toast/toast-views.tsx +223 -0
- package/src/components/toast/toast.styles.ts +198 -0
- package/src/components/toast/toast.tsx +59 -0
- package/src/components/toast/toast.types.ts +41 -0
- package/src/components/toggle/toggle-colors.stylex.ts +27 -0
- package/src/components/toggle/toggle.styles.ts +267 -0
- package/src/components/toggle/toggle.tsx +193 -0
- package/src/components/token/token.styles.ts +135 -0
- package/src/components/token/token.tsx +208 -0
- package/src/components/tool-call/tool-call-group.tsx +147 -0
- package/src/components/tool-call/tool-call.styles.ts +146 -0
- package/src/components/tool-call/tool-call.tsx +324 -0
- package/src/components/toolbar/toolbar-context.ts +6 -0
- package/src/components/toolbar/toolbar.styles.ts +120 -0
- package/src/components/toolbar/toolbar.tsx +219 -0
- package/src/components/tooltip/tooltip.styles.ts +104 -0
- package/src/components/tooltip/tooltip.tsx +106 -0
- package/src/components/tree/tree.styles.ts +133 -0
- package/src/components/tree/tree.tsx +862 -0
- package/src/components/visually-hidden/visually-hidden.styles.ts +15 -0
- package/src/components/visually-hidden/visually-hidden.tsx +36 -0
- package/src/control-label.tsx +48 -0
- package/src/copy-button.tsx +38 -0
- package/src/form.ts +44 -0
- package/src/icon-masks.stylex.ts +7 -0
- package/src/icons.ts +43 -0
- package/src/index.ts +1392 -0
- package/src/loading-indicator.tsx +45 -0
- package/src/motion.tsx +124 -0
- package/src/ref-utils.ts +27 -0
- package/src/render-utils.ts +35 -0
- package/src/styles/application-structure.stylex.ts +5 -0
- package/src/styles/colors.stylex.ts +64 -0
- package/src/styles/conditions.stylex.ts +10 -0
- package/src/styles/dimensions.stylex.ts +17 -0
- package/src/styles/floating-item-colors.stylex.ts +22 -0
- package/src/styles/fonts.stylex.ts +9 -0
- package/src/styles/interaction.stylex.ts +34 -0
- package/src/styles/motion.stylex.ts +28 -0
- package/src/styles/overlay-layers.styles.ts +26 -0
- package/src/styles/palette.stylex.ts +28 -0
- package/src/styles/shadows.stylex.ts +14 -0
- package/src/styles/shape.stylex.ts +11 -0
- package/src/styles/spacing.stylex.ts +18 -0
- package/src/styles/themes.ts +57 -0
- package/src/styles/typography.styles.ts +116 -0
- package/src/styles/typography.stylex.ts +44 -0
- package/src/theme/index.ts +25 -0
- package/src/theme/initialize.ts +31 -0
- package/src/theme/theme-provider.tsx +189 -0
- package/src/theme/theme-root.ts +37 -0
- package/src/theme/theme-script.tsx +35 -0
- package/src/theme/theme-storage.ts +256 -0
- package/src/theme/theme-tokens.ts +11 -0
- package/src/theme/theme-transition-guard.ts +102 -0
- package/src/theme/types.ts +33 -0
- package/src/use-copy-to-clipboard.ts +57 -0
- package/src/use-elapsed.ts +40 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{tableStyles}from"./table.styles";import{jsx as _jsx}from"react/jsx-runtime";function stripReservedProps(attributes){Reflect.deleteProperty(attributes,"className");Reflect.deleteProperty(attributes,"data-slot");Reflect.deleteProperty(attributes,"role");Reflect.deleteProperty(attributes,"style");}export function TableContainer({"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,children,focusable=true,ref:forwardedRef,scroll="horizontal",...rest}){if(!(ariaLabel?.trim()||ariaLabelledBy?.trim())){throw new TypeError("TableContainer requires an accessible name");}stripReservedProps(rest);return/*#__PURE__*/_jsx("section",{...rest,"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,"data-slot":"table-container",ref:forwardedRef,tabIndex:focusable?0:undefined,...props(tableStyles.container,scroll==="both"&&tableStyles.containerBoth),children:children});}export function Table({children,grid=false,ref:forwardedRef,width,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("table",{...rest,"data-grid":grid||undefined,"data-slot":"table",ref:forwardedRef,role:grid==="interactive"?"grid":undefined,...props(tableStyles.table,width!==undefined&&tableStyles.fixedWidth(width)),children:children});}export function TableHeader({children,ref:forwardedRef,sticky=true,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("thead",{...rest,"data-slot":"table-header",ref:forwardedRef,...props(tableStyles.header,sticky&&tableStyles.headSticky),children:children});}export function TableBody({children,ref:forwardedRef,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("tbody",{...rest,"data-slot":"table-body",ref:forwardedRef,...props(tableStyles.body),children:children});}export function TableFooter({children,ref:forwardedRef,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("tfoot",{...rest,"data-slot":"table-footer",ref:forwardedRef,...props(tableStyles.footer),children:children});}export function TableRow({children,ref:forwardedRef,selected=false,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("tr",{...rest,"data-selected":selected?"true":undefined,"data-slot":"table-row",ref:forwardedRef,...props(tableStyles.row,tableStyles.rowHover,selected&&tableStyles.rowSelected),children:children});}const alignStyles={center:tableStyles.cellCenter,end:tableStyles.cellEnd,start:null};function cellStyles(align,numeric,sticky,head=false){const effectiveAlign=align??(numeric?"end":"start");return props(tableStyles.cell,head&&tableStyles.head,alignStyles[effectiveAlign],numeric&&tableStyles.cellNumeric,sticky&&tableStyles.stickyStart);}export function TableHead({align,children,numeric=false,ref:forwardedRef,scope="col",sticky=false,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("th",{...rest,"data-slot":"table-head",ref:forwardedRef,scope:scope,...cellStyles(align,numeric,sticky,true),children:children});}export function TableCell({align,children,numeric=false,ref:forwardedRef,sticky=false,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("td",{...rest,"data-slot":"table-cell",ref:forwardedRef,...cellStyles(align,numeric,sticky),children:children});}export function TableCaption({children,ref:forwardedRef,...rest}){stripReservedProps(rest);return/*#__PURE__*/_jsx("caption",{...rest,"data-slot":"table-caption",ref:forwardedRef,...props(tableStyles.caption),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/interaction.stylex";import{borderWidth,focus,focusMotion}from"../../styles/interaction.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontSize,fontWeight,lineHeight}from"../../styles/typography.stylex";const _temp={k7Eaqz:"xeuugli",kPzzVL:"x140o2bo","$$css":true};export const tableStyles={body:{kWkggS:"xwn18cz",$$css:true},caption:{kV37R7:"xhdg8po",kMwMTN:"x125omll",kGuDYH:"xlh8hku",kLWn49:"x2xzzt7",k8WAf4:"x391bbb",kg3NbH:"xt3hk1x xaqi9fd",k9WMMc:"x1yc453h",$$css:true},cell:{k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kWkggS:"xgcd1z6",kt9PQ7:"xediy8a x13k63ub",kEafiO:"x972fbf",kVAM5u:"x155xxfk",ke9TFa:"x1qm4zhy x10w94by",k2ei4v:"x14e42zd",ksu8eU:"x1y0btm7",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x11r2kya",k3XXqK:"x9v5kkp x1t137rt",kMeerF:"x1vhx2qj",k8WAf4:"x1ejqzik x58we3g",kg3NbH:"xt3hk1x xaqi9fd",k9WMMc:"x1yc453h",kXLuUW:"xxymvpz",$$css:true},cellCenter:{k9WMMc:"x2b8uid",$$css:true},cellEnd:{k9WMMc:"xp4054r",$$css:true},cellNumeric:{kcqcaj:"xss6m8b",khDVqt:"xuxw1ft",$$css:true},container:{k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kWkggS:"xwn18cz",kVAM5u:"x155xxfk",kaIpWk:"x1jw0md8",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",ks0D6T:"x193iq5w",kjBf7l:"x4dprnk xdrerpq",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp x1t137rt",kMeerF:"x1vhx2qj",kXHlph:"xw2csxc",kORKVm:"x10wlt62",kwDfHU:"x1pqk8vl",kuHK5b:"x5lxg6s",$$css:true},containerBoth:{kskxy:"xi58p9m",kORKVm:"x1odjw0f",$$css:true},fixedWidth:width=>[_temp,{kzqmXN:width!=null?"x5lhr3w":width,$$css:true},{"--x-width":(val=>typeof val==="number"?val+"px":val!=null?val:undefined)(width)}],footer:{kWkggS:"x1vs9wzj",k63SB2:"xuku2lm",$$css:true},head:{kWkggS:"xgcd1z6",kMwMTN:"xrpon01 x14tvo57",kGuDYH:"xlh8hku",k63SB2:"xuku2lm",kLWn49:"x2xzzt7",k7Eaqz:"xjenaaj x1571chb",kVAEAm:"x1n2onr6",k9WMMc:"x1yc453h",$$css:true},header:{kWkggS:"x1vs9wzj",kMwMTN:"x14tvo57",k63SB2:"xuku2lm",$$css:true},headSticky:{k87sOh:"x13vifvy",kVAEAm:"x7wzq59",kY2c9j:"xhtitgo",$$css:true},row:{kWkggS:"xgcd1z6",$$css:true},rowHover:{kWkggS:"xxsa5ao xcalm7 xgcd1z6",$$css:true},rowSelected:{kWkggS:"x19z06j xkmz2o3 x16d8uok",kMwMTN:"x14tvo57",$$css:true},stickyStart:{kBCPoo:"x8v21bb",k8ry5P:"x18b5jzi",ke9TFa:"x10w94by x1nzsr5q",kLqNvP:"xl075c3",kVAEAm:"x1uhb9sk x1be5253",kY2c9j:"xakne4p",$$css:true},table:{kWkggS:"xwn18cz",kLvRdT:"x1vathgz",kheTzg:"x1gukg7c",kMwMTN:"x14tvo57",kGuDYH:"xlh8hku",k63SB2:"x1lo1l87",kLWn49:"x2xzzt7",k7Eaqz:"xgqtt45",k9WMMc:"x1yc453h",$$css:true}};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from "@base-ui/react/tabs";
|
|
2
|
+
import { type ComponentPropsWithRef } from "react";
|
|
3
|
+
type BaseTabsProps = ComponentPropsWithRef<typeof BaseTabs.Root>;
|
|
4
|
+
type BaseTabsIndicatorProps = ComponentPropsWithRef<typeof BaseTabs.Indicator>;
|
|
5
|
+
type BaseTabsListProps = ComponentPropsWithRef<typeof BaseTabs.List>;
|
|
6
|
+
type BaseTabsPanelProps = ComponentPropsWithRef<typeof BaseTabs.Panel>;
|
|
7
|
+
type BaseTabsTabProps = ComponentPropsWithRef<typeof BaseTabs.Tab>;
|
|
8
|
+
export type TabsSize = "default" | "lg" | "sm";
|
|
9
|
+
export type TabsVariant = "default" | "underline";
|
|
10
|
+
export type TabsProps = Omit<BaseTabsProps, "className" | "ref" | "render" | "style"> & {
|
|
11
|
+
ref?: BaseTabsProps["ref"];
|
|
12
|
+
};
|
|
13
|
+
export type TabsListProps = Omit<BaseTabsListProps, "className" | "ref" | "render" | "style"> & {
|
|
14
|
+
ref?: BaseTabsListProps["ref"];
|
|
15
|
+
size?: TabsSize;
|
|
16
|
+
variant?: TabsVariant;
|
|
17
|
+
};
|
|
18
|
+
export type TabsTabProps = Omit<BaseTabsTabProps, "className" | "nativeButton" | "ref" | "render" | "style"> & {
|
|
19
|
+
ref?: BaseTabsTabProps["ref"];
|
|
20
|
+
};
|
|
21
|
+
export type TabsIndicatorProps = Omit<BaseTabsIndicatorProps, "className" | "ref" | "render" | "style"> & {
|
|
22
|
+
ref?: BaseTabsIndicatorProps["ref"];
|
|
23
|
+
};
|
|
24
|
+
export type TabsPanelProps = Omit<BaseTabsPanelProps, "className" | "ref" | "render" | "style"> & {
|
|
25
|
+
ref?: BaseTabsPanelProps["ref"];
|
|
26
|
+
};
|
|
27
|
+
export declare function Tabs({ orientation, ref: forwardedRef, ...rest }: TabsProps): import("react").JSX.Element;
|
|
28
|
+
export declare function TabsList({ children, ref: forwardedRef, size, variant, ...rest }: TabsListProps): import("react").JSX.Element;
|
|
29
|
+
export declare function TabsTab({ children, ref: forwardedRef, type, ...rest }: TabsTabProps): import("react").JSX.Element;
|
|
30
|
+
export declare function TabsIndicator(input: TabsIndicatorProps): import("react").JSX.Element;
|
|
31
|
+
export declare function TabsPanel({ ref: forwardedRef, ...rest }: TabsPanelProps): import("react").JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Tabs as BaseTabs}from"@base-ui/react/tabs";import{props}from"@stylexjs/stylex";import{createContext,useContext}from"react";import{controlLabel}from"../../control-label";import{tabsStyles}from"./tabs.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const defaultTabsListContext={size:"default",variant:"default"};const TabsListContext=createContext(defaultTabsListContext);const sizeStyles={default:tabsStyles.sizeDefault,lg:tabsStyles.sizeLg,sm:tabsStyles.sizeSm};export function Tabs({orientation="horizontal",ref:forwardedRef=undefined,...rest}){return/*#__PURE__*/_jsx(BaseTabs.Root,{...rest,"data-slot":"tabs",orientation:orientation,ref:forwardedRef,...props(orientation==="horizontal"?tabsStyles.rootHorizontal:tabsStyles.rootVertical)});}export function TabsList({children,ref:forwardedRef=undefined,size="default",variant="default",...rest}){return/*#__PURE__*/_jsx(TabsListContext,{value:{size,variant},children:/*#__PURE__*/_jsxs(BaseTabs.List,{...rest,"data-slot":"tabs-list",ref:forwardedRef,...props(tabsStyles.list,variant==="default"?tabsStyles.listDefault:tabsStyles.listUnderline),children:[children,/*#__PURE__*/_jsx(Indicator,{automatic:true})]})});}export function TabsTab({children,ref:forwardedRef=undefined,type,...rest}){const{size,variant}=useContext(TabsListContext);return/*#__PURE__*/_jsx(BaseTabs.Tab,{...rest,"data-slot":"tabs-tab",ref:forwardedRef,type:type??"button",...props(tabsStyles.tab,sizeStyles[size],variant==="default"?tabsStyles.activeDefault:tabsStyles.activeUnderline),children:controlLabel(children)});}export function TabsIndicator(input){return/*#__PURE__*/_jsx(Indicator,{...input});}function Indicator({automatic=false,ref:forwardedRef=undefined,...rest}){const{variant}=useContext(TabsListContext);return/*#__PURE__*/_jsx(BaseTabs.Indicator,{...rest,"data-auto-indicator":automatic||undefined,"data-slot":"tabs-indicator",ref:forwardedRef,...props(tabsStyles.indicator,automatic&&tabsStyles.automaticIndicator,variant==="default"?tabsStyles.indicatorDefault:tabsStyles.indicatorUnderline)});}export function TabsPanel({ref:forwardedRef=undefined,...rest}){return/*#__PURE__*/_jsx(BaseTabs.Panel,{...rest,"data-slot":"tabs-panel",ref:forwardedRef,...props(tabsStyles.panel)});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/dimensions.stylex";import{controlSize}from"../../styles/dimensions.stylex";import"../../styles/interaction.stylex";import{borderWidth,focusMotion,forcedColorAdjust,opacity}from"../../styles/interaction.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";import"../../styles/shadows.stylex";import{shadows}from"../../styles/shadows.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontSize,fontWeight,lineHeight}from"../../styles/typography.stylex";export const tabsStyles={activeDefault:{kUQuju:"x1p532u0",kZgtTg:"xylxqck",kaZCbk:"x6izkc5",$$css:true},activeUnderline:{kZgtTg:"x1o7ttl7",kaZCbk:"x6izkc5",$$css:true},automaticIndicator:{k1xSpc:"x1rtvaml x1lliihq",$$css:true},indicator:{kZKoxP:"x1gezbiy",kbCHJM:"xvbikie",kfzvcC:"x47corl",kVAEAm:"x10l6tqk",k87sOh:"x10uur0e",kIyJzY:"x1e471i8 x18kz1lc",k1ekBW:"x98hnz2",kAMwcw:"xvhdtae",kzqmXN:"xoffw1",$$css:true},indicatorDefault:{kWkggS:"x1g77xhq x16d8uok",kT0f0o:"x1hia2b7",kVL7Gh:"x1dz734k",kfmiAY:"x2dv6dr",krdFHd:"xn5rixj",kGVxlE:"xxmju8b",$$css:true},indicatorUnderline:{ks3ayO:"x13a9jd1 xt62fkq",kUfP38:"x1f3l70z",k5JduY:"x1s928wv",k4zj60:"x1kzxwl6 x3cntg4",k8Iv0R:"xvu3dzw x1xrz1ek",k3foIR:"xbxbwqn x1i63x89",kH8aOt:"x4vzu38 x1it8f1r",kc1e00:"x1j3namz xs8mn6b",kwXMNM:"x1j6awrg",kkgrvl:"xfa3am4 x183bm9d",$$css:true},list:{kGNEyG:"x1qjc9v5",kB7OPa:"x9f619",k1xSpc:"x3nfvp2",kXwgrk:"x1ngl2aw x1q0g3np",kHBbk8:"xc8icb0",ks0D6T:"x193iq5w",kXHlph:"xkwr49w xw2csxc",kVAEAm:"x1n2onr6",katHQp:"x1naeyz0",kzqmXN:"xeq5yr9",$$css:true},listDefault:{kWkggS:"x1o7hn9x",kaIpWk:"x1jw0md8",kGVxlE:"x1xxjdaf",kOIVth:"x13hh4mm",kmVPX3:"xlxy37g",$$css:true},listUnderline:{kGVxlE:"xytl3wm x9gjxf9",k1C7PZ:"xftm65n",k8WAf4:"x1eb0yt2 xt970qd",kg3NbH:"xagnyq0 xdbhxi8",khm7nJ:"xjcy2k7",$$css:true},panel:{kMwMTN:"x14tvo57",kGuDYH:"x12ama9c",kLWn49:"x1rn0pvf",k7Eaqz:"xeuugli",kLKAdn:"x1y7c9hq x1acq3q9",$$css:true},rootHorizontal:{k1xSpc:"x1lliihq",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",$$css:true},rootVertical:{kGNEyG:"x1cy8zhl",k1C7PZ:"xuw6xfb",k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",khm7nJ:"x1rtwujn",$$css:true},sizeDefault:{kGuDYH:"xlh8hku",kAzted:"x1vigsvi",kg3NbH:"xy7odpl",$$css:true},sizeLg:{kGuDYH:"xlh8hku",kAzted:"x1atkrcx",kg3NbH:"xy7odpl",$$css:true},sizeSm:{kGuDYH:"xlh8hku",kAzted:"x15j2gbd",kg3NbH:"xb5xqfq",$$css:true},tab:{kGNEyG:"x6s0dn4",k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kysU6D:"xjyslct",kWkggS:"xic4mr2 xjbqb8w",kVAM5u:"x9r1u3d",kaIpWk:"x2b34ud",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kB7OPa:"x9f619",kMwMTN:"x1289x4n x1jr31pm x125omll",k1C7PZ:"xftm65n",kkrTdU:"x1j1ks5o x1ypdohk",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kMv6JI:"xjb2p0i",k63SB2:"xuku2lm",kZKoxP:"xgaasie",kjj79g:"xl56j7k",kLWn49:"x1wrb330",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",kSiTet:"x1yporm9 x1hc1fzr",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x11r2kya",k3XXqK:"x9v5kkp x1t137rt",kMeerF:"xm9seqh x1vhx2qj",k8WAf4:"xt970qd",kVAEAm:"x1n2onr6",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x14lsq49",kAMwcw:"xvhdtae",kfSwDN:"x87ps6o",khDVqt:"xuxw1ft",kzqmXN:"xwe2phr",kY2c9j:"x1vjfegm",$$css:true}};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
export type TaskListStepState = "complete" | "error" | "pending" | "running";
|
|
4
|
+
export interface TaskListStep {
|
|
5
|
+
/** A second line, such as the data the step works on. */
|
|
6
|
+
detail?: string;
|
|
7
|
+
/** Seconds the step took, for a plan loaded from history. */
|
|
8
|
+
duration?: number;
|
|
9
|
+
/** Why the step failed, shown with Retry from here. */
|
|
10
|
+
error?: string;
|
|
11
|
+
id: string;
|
|
12
|
+
status: TaskListStepState;
|
|
13
|
+
title: string;
|
|
14
|
+
}
|
|
15
|
+
export type TaskListProps = Omit<Closed<ComponentPropsWithRef<"div">>, "children" | "data-slot" | "role" | "title"> & {
|
|
16
|
+
/** Asks before the agent starts, with Approve and Revise. */
|
|
17
|
+
approval?: boolean;
|
|
18
|
+
/** Seconds the whole plan took, for a plan loaded from history. */
|
|
19
|
+
duration?: number;
|
|
20
|
+
onApprove?: () => void;
|
|
21
|
+
/** Shows Retry from here under a failed step. */
|
|
22
|
+
onRetry?: (stepId: string) => void;
|
|
23
|
+
/** Asks the person what to change, such as by focusing the composer. */
|
|
24
|
+
onRevise?: () => void;
|
|
25
|
+
steps: readonly TaskListStep[];
|
|
26
|
+
/** The plan's goal, such as "Prepare the Q3 board update". */
|
|
27
|
+
title: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The steps an agent plans and how far it has got. It can ask before the
|
|
31
|
+
* agent starts; while steps run it stays open with the current one marked,
|
|
32
|
+
* and once every step is done it folds into a summary.
|
|
33
|
+
*/
|
|
34
|
+
export declare function TaskList({ approval, duration, onApprove, onRetry, onRevise, ref: forwardedRef, steps, title, ...rest }: TaskListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{useCallback,useState}from"react";import{IconAlertCircle,IconChevronDown,IconCircle,IconCircleCheck,IconListCheck,IconRefresh}from"../../icons";import{MotionScope,Pop,Rise}from"../../motion";import{typeRoles}from"../../styles/typography.styles";import{formatShortSeconds,useElapsed}from"../../use-elapsed";import{agentThinkingStyles}from"../agent-thinking/agent-thinking.styles";import{Button}from"../button/button";import{Collapsible,CollapsiblePanel,CollapsibleTrigger}from"../collapsible/collapsible";import{Spinner}from"../spinner/spinner";import{toolCallStyles}from"../tool-call/tool-call.styles";import{VisuallyHidden}from"../visually-hidden/visually-hidden";import{visuallyHiddenStyles}from"../visually-hidden/visually-hidden.styles";import{taskListStyles as styles}from"./task-list.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const STATE_TEXT={complete:"done",error:"failed",pending:"not started",running:"in progress"};function phaseOf(steps,approval){if(approval){return"approval";}if(steps.some(step=>step.status==="error")){return"error";}if(steps.length>0&&steps.every(step=>step.status==="complete")){return"complete";}return"running";}function metaOf(phase,steps){const total=steps.length;if(phase==="approval"){return`${total} ${total===1?"step":"steps"}`;}if(phase==="error"){const failed=steps.findIndex(step=>step.status==="error");return`Stopped at step ${failed+1}`;}const done=steps.filter(step=>step.status==="complete").length;return`${done} of ${total}`;}function Summary({markEnd,markStart,phase,seconds,steps,title}){if(phase!=="complete"){return/*#__PURE__*/_jsxs("span",{ref:phase==="running"?markStart:undefined,children:[/*#__PURE__*/_jsx("span",{...props(phase==="running"&&agentThinkingStyles.stage),children:title})," ",/*#__PURE__*/_jsxs("span",{...props(styles.meta,phase==="error"&&styles.errorText),children:["· ",metaOf(phase,steps)]})]});}const total=steps.length;return/*#__PURE__*/_jsxs("span",{ref:markEnd,children:[title," ",/*#__PURE__*/_jsxs("span",{...props(styles.meta),children:["· ",total," ",total===1?"step":"steps",seconds===undefined?null:` · ${formatShortSeconds(seconds)}`]})]});}// A running step starts the clock; a completed one stops it.
|
|
2
|
+
function timingRef(status,markStart,markEnd){if(status==="running"){return markStart;}return status==="complete"?markEnd:undefined;}// The step's mark. A change of status pops in; a step that loads or
|
|
3
|
+
// remounts shows its mark still.
|
|
4
|
+
function Marker({markEnd,markStart,status}){const failed=status==="error";const ended=status==="complete"||failed;const Icon=failed?IconAlertCircle:IconCircleCheck;return/*#__PURE__*/_jsxs(Pop,{change:status,look:[styles.marker,status==="complete"&&styles.markerComplete,failed&&styles.markerError],ref:timingRef(status,markStart,markEnd),children:[status==="running"?/*#__PURE__*/_jsx(Spinner,{"aria-hidden":"true"}):null,status==="pending"?/*#__PURE__*/_jsx(IconCircle,{"aria-hidden":"true",size:14}):null,ended?/*#__PURE__*/_jsx(Icon,{"aria-hidden":"true",size:16}):null]});}function Duration({seconds}){if(seconds===undefined){return null;}return/*#__PURE__*/_jsx("span",{...props(typeRoles.caption,styles.duration),children:formatShortSeconds(seconds)});}function StepError({error,onRetry,stepId}){const retry=useCallback(()=>onRetry?.(stepId),[onRetry,stepId]);return/*#__PURE__*/_jsxs("div",{"data-slot":"task-list-error",...props(styles.error),children:[/*#__PURE__*/_jsx("p",{...props(typeRoles.caption,styles.errorText),children:error??"This step failed."}),onRetry?/*#__PURE__*/_jsxs(Button,{onClick:retry,size:"xs",variant:"outline",children:[/*#__PURE__*/_jsx(IconRefresh,{"aria-hidden":"true",size:"1em"}),"Retry from here"]}):null]});}function Step({connected,onRetry,step}){const elapsed=useElapsed();const seconds=step.duration??elapsed.seconds;const ended=step.status==="complete"||step.status==="error";return/*#__PURE__*/_jsxs("li",{"aria-current":step.status==="running"?"step":undefined,"data-slot":"task-list-step","data-status":step.status,...props(styles.step,connected&&styles.stepConnected),children:[/*#__PURE__*/_jsx(Marker,{markEnd:elapsed.markEnd,markStart:elapsed.markStart,status:step.status}),/*#__PURE__*/_jsxs("div",{...props(styles.stepBody),children:[/*#__PURE__*/_jsxs("div",{...props(typeRoles.ui,styles.stepHead),children:[/*#__PURE__*/_jsxs("span",{...props(styles.stepTitle,step.status==="pending"&&styles.titlePending),children:[step.title,/*#__PURE__*/_jsxs(VisuallyHidden,{children:[", ",STATE_TEXT[step.status]]})]}),ended?/*#__PURE__*/_jsx(Duration,{seconds:seconds}):null]}),step.detail?/*#__PURE__*/_jsx("p",{...props(typeRoles.caption,styles.detail),children:step.detail}):null,step.status==="error"?/*#__PURE__*/_jsx(StepError,{error:step.error,onRetry:onRetry,stepId:step.id}):null]})]});}function Review({onApprove,onRevise}){return/*#__PURE__*/_jsxs("div",{"data-slot":"task-list-approval",...props(toolCallStyles.notice,toolCallStyles.noticeSlot),children:[/*#__PURE__*/_jsx("p",{...props(typeRoles.ui,toolCallStyles.noticeText),children:"Approve this plan to start."}),/*#__PURE__*/_jsxs("div",{...props(toolCallStyles.noticeActions),children:[onRevise?/*#__PURE__*/_jsx(Button,{onClick:onRevise,size:"sm",variant:"outline",children:"Revise"}):null,onApprove?/*#__PURE__*/_jsx(Button,{onClick:onApprove,size:"sm",children:"Approve"}):null]})]});}// One region, always present, announces each step as it starts and the end.
|
|
5
|
+
function Announcement({phase,steps,title}){const index=steps.findIndex(candidate=>candidate.status==="running"||candidate.status==="error");const step=steps[index];let message="";if(phase==="complete"){message=`Done: ${title}`;}else if(step&&phase!=="approval"){const verb=step.status==="error"?"Failed":"Step";message=`${verb} ${index+1} of ${steps.length}: ${step.title}`;}return/*#__PURE__*/_jsx("span",{"aria-live":"polite","data-slot":"task-list-status",role:"status",...props(visuallyHiddenStyles.root),children:message});}/**
|
|
6
|
+
* The steps an agent plans and how far it has got. It can ask before the
|
|
7
|
+
* agent starts; while steps run it stays open with the current one marked,
|
|
8
|
+
* and once every step is done it folds into a summary.
|
|
9
|
+
*/export function TaskList({approval=false,duration,onApprove,onRetry,onRevise,ref:forwardedRef,steps,title,...rest}){const elapsed=useElapsed();const phase=phaseOf(steps,approval);// null until the reader opens or closes it themselves.
|
|
10
|
+
const[open,setOpen]=useState(null);for(const prop of["className","data-slot","role","style"]){Reflect.deleteProperty(rest,prop);}const working=phase==="running";return/*#__PURE__*/_jsxs("div",{...rest,"data-slot":"task-list","data-status":phase,ref:forwardedRef,...props(toolCallStyles.root),children:[/*#__PURE__*/_jsx(Announcement,{phase:phase,steps:steps,title:title}),/*#__PURE__*/_jsx(MotionScope,{children:/*#__PURE__*/_jsxs(Collapsible,{onOpenChange:setOpen,open:open===null?phase!=="complete":open,render:/*#__PURE__*/_jsx("div",{...props(toolCallStyles.clip)}),children:[/*#__PURE__*/_jsxs(CollapsibleTrigger,{render:/*#__PURE__*/_jsx("button",{type:"button",...props(typeRoles.ui,toolCallStyles.row)}),children:[/*#__PURE__*/_jsx(Pop,{change:working?"working":"idle",look:toolCallStyles.icon,children:working?/*#__PURE__*/_jsx(Spinner,{"aria-hidden":"true"}):/*#__PURE__*/_jsx(IconListCheck,{"aria-hidden":"true",size:16})}),/*#__PURE__*/_jsx(Rise,{change:phase==="complete"?"complete":"open",look:toolCallStyles.title,children:/*#__PURE__*/_jsx(Summary,{markEnd:elapsed.markEnd,markStart:elapsed.markStart,phase:phase,seconds:duration??elapsed.seconds,steps:steps,title:title})}),/*#__PURE__*/_jsx(IconChevronDown,{"aria-hidden":"true",size:14,...props(toolCallStyles.chevron)})]}),/*#__PURE__*/_jsx(CollapsiblePanel,{children:/*#__PURE__*/_jsx("div",{...props(toolCallStyles.panel,toolCallStyles.details),children:/*#__PURE__*/_jsx("ol",{"aria-label":title,...props(styles.steps),children:steps.map((step,index)=>/*#__PURE__*/_jsx(Step,{connected:index<steps.length-1,onRetry:onRetry,step:step},step.id))})})}),phase==="approval"?/*#__PURE__*/_jsx(Review,{onApprove:onApprove,onRevise:onRevise}):null]})})]});}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/interaction.stylex";import{borderWidth}from"../../styles/interaction.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";// Steps line up with the header: marker under its icon, title under its text.
|
|
2
|
+
export const taskListStyles={detail:{kMwMTN:"x125omll",kogj98:"x1ghz6dp",$$css:true},duration:{kMwMTN:"x125omll",kcqcaj:"xss6m8b",khDVqt:"xuxw1ft",$$css:true},error:{kGNEyG:"x1cy8zhl",k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kOIVth:"xp4ho6d",kjj79g:"x1qughib",$$css:true},errorText:{kMwMTN:"x1ytrddi",kogj98:"x1ghz6dp",$$css:true},marker:{kGNEyG:"x6s0dn4",kZKoxP:"xe5mdie",kMwMTN:"x125omll",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kzqmXN:"xneo5a6",kjj79g:"xl56j7k",$$css:true},markerComplete:{kMwMTN:"x11dzyn",$$css:true},markerError:{kMwMTN:"x1ytrddi",$$css:true},meta:{kMwMTN:"x125omll",kcqcaj:"xss6m8b",$$css:true},step:{kGNEyG:"x1cy8zhl",k1xSpc:"x78zum5",kOIVth:"xp4ho6d",k7Eaqz:"xeuugli",k8WAf4:"x1lmimt7",kVAEAm:"x1n2onr6",$$css:true},stepBody:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kzQI83:"x1iyjqo2",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",k8WAf4:"xj8oexa",$$css:true},stepConnected:{ks3ayO:"x1hlq56q",k5JduY:"x100rkj9",kkgrvl:"xukks1t",k8Iv0R:"x14foyxu",k3foIR:"xefw2eg",kc1e00:"x128y9mk",kwXMNM:"x1j6awrg",$$css:true},stepHead:{kGNEyG:"x1pha0wt",k1xSpc:"x78zum5",kOIVth:"xp4ho6d",kjj79g:"x1qughib",k7Eaqz:"xeuugli",$$css:true},steps:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"xp4ho6d",kB88ic:"xe8uvvx",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",$$css:true},stepTitle:{k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",$$css:true},titlePending:{kMwMTN:"x125omll",$$css:true}};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** How a run of output looks: Mizen keeps red, bold, and dim. */const PLAIN={bold:false,muted:false,red:false};// Escape sequences: CSI codes such as colors and cursor moves, and OSC
|
|
2
|
+
// codes such as window titles and links. Built from character codes, so
|
|
3
|
+
// the source holds no raw control characters.
|
|
4
|
+
const ESC=String.fromCharCode(27);const BEL=String.fromCharCode(7);const CSI=`${ESC}\\[([0-9;?]*)([A-Za-z])`;const OSC=`${ESC}\\][^${BEL}${ESC}]*(?:${BEL}|${ESC}\\\\)`;const ESCAPE=new RegExp(`${CSI}|${OSC}`,"gu");// Each SGR code sets one part of the style. Hues other than red, and the
|
|
5
|
+
// background colors, keep the text plain: Mizen has text-safe tokens only
|
|
6
|
+
// for red and muted ink.
|
|
7
|
+
const CODES={0:PLAIN,1:{bold:true},2:{muted:true},22:{bold:false,muted:false},30:{muted:true,red:false},31:{muted:false,red:true},39:{muted:false,red:false},90:{muted:true,red:false},91:{muted:false,red:true}};function applyCodes(state,params){const codes=params===""?[0]:params.split(";").map(Number);const next={...state};for(const code of codes){Object.assign(next,CODES[code]);}return next;}/**
|
|
8
|
+
* A line that redraws itself with carriage returns, such as a progress
|
|
9
|
+
* bar, keeps only what it shows last.
|
|
10
|
+
*/function settleRedraws(output){return output.split("\n").map(line=>line.split("\r").findLast(part=>part!=="")??"").join("\n");}/** Output with its styles, ready to render as spans. */export function parseAnsi(output){const text=settleRedraws(output);const spans=[];let state=PLAIN;let from=0;for(const match of text.matchAll(ESCAPE)){if(match.index>from){spans.push({...state,text:text.slice(from,match.index)});}// Only "m" sequences style text; cursor moves and titles drop out.
|
|
11
|
+
if(match[2]==="m"){state=applyCodes(state,match[1]??"");}from=match.index+match[0].length;}if(from<text.length){spans.push({...state,text:text.slice(from)});}return spans;}/** Output as plain text, for copying. */export function plainOutput(output){return settleRedraws(output).replace(ESCAPE,"");}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
/** `running` while the command runs; then `complete` (exit 0) or `error`. */
|
|
4
|
+
export type TerminalStatus = "complete" | "error" | "running";
|
|
5
|
+
export type TerminalProps = Omit<Closed<ComponentPropsWithRef<"div">>, "children" | "data-slot" | "role"> & {
|
|
6
|
+
/** The command as typed, such as `pnpm build`. */
|
|
7
|
+
command: string;
|
|
8
|
+
/** Seconds it ran, for a command loaded from history. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/** The code it exited with; any code but 0 is a failure. */
|
|
11
|
+
exitCode?: number;
|
|
12
|
+
/** Shows Retry under a failed command. */
|
|
13
|
+
onRetry?: () => void;
|
|
14
|
+
/** Everything it printed so far. Terminal colors and redraws are kept. */
|
|
15
|
+
output?: string;
|
|
16
|
+
status: TerminalStatus;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A shell command the agent runs, as one line: what it ran, how long it
|
|
20
|
+
* took, and how it ended. It opens to the output, which streams in with
|
|
21
|
+
* the newest line in view; a failure opens on its own.
|
|
22
|
+
*/
|
|
23
|
+
export declare function Terminal({ command, duration, exitCode, onRetry, output, ref: forwardedRef, status, ...rest }: TerminalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{useState}from"react";import{IconAlertCircle,IconChevronDown,IconCircleCheck,IconRefresh,IconTerminal2}from"../../icons";import{MotionScope,Pop}from"../../motion";import{typeRoles}from"../../styles/typography.styles";import{formatShortSeconds,useElapsed}from"../../use-elapsed";import{agentThinkingStyles}from"../agent-thinking/agent-thinking.styles";import{Button}from"../button/button";import{CodeBlock,CodeBlockCopy,CodeBlockHeader,CodeBlockTitle}from"../code-block/code-block";import{codeBlockStyles}from"../code-block/code-block.styles";import{Collapsible,CollapsiblePanel,CollapsibleTrigger}from"../collapsible/collapsible";import{Spinner}from"../spinner/spinner";import{toolCallStyles}from"../tool-call/tool-call.styles";import{VisuallyHidden}from"../visually-hidden/visually-hidden";import{parseAnsi,plainOutput}from"./ansi";import{terminalStyles as styles}from"./terminal.styles";/** `running` while the command runs; then `complete` (exit 0) or `error`. */import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";// The newest line stays in view while output arrives, unless the reader
|
|
2
|
+
// scrolls up to read; scrolling back to the end follows it again.
|
|
3
|
+
function followTail(pre){if(!pre||typeof MutationObserver==="undefined"){return;}let pinned=true;const onScroll=()=>{pinned=pre.scrollHeight-pre.scrollTop-pre.clientHeight<8;};const observer=new MutationObserver(()=>{if(pinned){pre.scrollTop=pre.scrollHeight;}});pre.addEventListener("scroll",onScroll,{passive:true});observer.observe(pre,{characterData:true,childList:true,subtree:true});// A finished run opens at its end, where errors usually are.
|
|
4
|
+
pre.scrollTop=pre.scrollHeight;return()=>{observer.disconnect();pre.removeEventListener("scroll",onScroll);};}function Output({output}){return(/*#__PURE__*/// biome-ignore lint/a11y/useSemanticElements: pre keeps the output's spacing while naming the scroll region.
|
|
5
|
+
_jsx("pre",{"aria-label":"Output","data-slot":"terminal-output",ref:followTail,role:"region"// biome-ignore lint/a11y/noNoninteractiveTabindex: keyboard focus lets people scroll long output.
|
|
6
|
+
,tabIndex:0,...props(typeRoles.mono,codeBlockStyles.content,styles.output),children:/*#__PURE__*/_jsx("code",{...props(codeBlockStyles.code),children:parseAnsi(output).map((span,index)=>/*#__PURE__*/_jsx("span",{...props(span.bold&&styles.bold,span.muted&&styles.muted,span.red&&styles.red),children:span.text},index))})}));}function Title({command,exitCode,status}){const code=/*#__PURE__*/_jsx("code",{...props(typeRoles.mono,styles.command),children:command});if(status==="running"){return/*#__PURE__*/_jsxs("span",{...props(toolCallStyles.title),children:[/*#__PURE__*/_jsx("span",{...props(agentThinkingStyles.stage),children:"Running"})," ",code]});}if(status==="error"&&exitCode!==undefined){return/*#__PURE__*/_jsxs("span",{...props(toolCallStyles.title),children:[code," ",/*#__PURE__*/_jsxs("span",{...props(styles.verb),children:["exited with code ",exitCode]})]});}return/*#__PURE__*/_jsxs("span",{...props(toolCallStyles.title),children:[/*#__PURE__*/_jsx("span",{...props(styles.verb),children:status==="error"?"Failed":"Ran"})," ",code]});}function Status({markEnd,markStart,seconds,status}){if(status==="running"){return/*#__PURE__*/_jsxs("span",{ref:markStart,...props(toolCallStyles.status),children:[/*#__PURE__*/_jsx(Spinner,{"aria-hidden":"true"}),/*#__PURE__*/_jsx(VisuallyHidden,{children:"Running"})]});}const failed=status==="error";const Icon=failed?IconAlertCircle:IconCircleCheck;return/*#__PURE__*/_jsxs("span",{ref:markEnd,...props(typeRoles.ui,toolCallStyles.status),children:[/*#__PURE__*/_jsx(Icon,{"aria-hidden":"true",size:16,...props(failed?toolCallStyles.statusError:toolCallStyles.statusComplete)}),seconds===undefined?null:formatShortSeconds(seconds),/*#__PURE__*/_jsx(VisuallyHidden,{children:failed?"Failed":"Done"})]});}// Outside the fold, so Retry stays in view when the output is folded.
|
|
7
|
+
function Failure({onRetry}){if(!onRetry){return null;}return/*#__PURE__*/_jsxs("div",{"data-slot":"terminal-retry",...props(toolCallStyles.notice,toolCallStyles.noticeError,toolCallStyles.noticeSlot),children:[/*#__PURE__*/_jsxs("p",{...props(typeRoles.ui,toolCallStyles.noticeText,toolCallStyles.errorText),children:[/*#__PURE__*/_jsx(IconAlertCircle,{"aria-hidden":"true",size:16}),"The command failed."]}),/*#__PURE__*/_jsxs(Button,{onClick:onRetry,size:"sm",variant:"outline",children:[/*#__PURE__*/_jsx(IconRefresh,{"aria-hidden":"true",size:"1em"}),"Retry"]})]});}// The line: what ran, its time, and how it ended. With no output yet there
|
|
8
|
+
// is nothing to open, so it is a plain row without a chevron.
|
|
9
|
+
function Line({command,elapsed,exitCode,seconds,status,withOutput}){const content=/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("span",{"aria-hidden":"true",...props(toolCallStyles.icon),children:/*#__PURE__*/_jsx(IconTerminal2,{size:16})}),/*#__PURE__*/_jsx(Title,{command:command,exitCode:exitCode,status:status}),/*#__PURE__*/_jsx(Pop,{change:status,look:toolCallStyles.statusSlot,children:/*#__PURE__*/_jsx(Status,{markEnd:elapsed.markEnd,markStart:elapsed.markStart,seconds:seconds,status:status})})]});if(!withOutput){return/*#__PURE__*/_jsx("div",{"data-slot":"terminal-line",...props(typeRoles.ui,toolCallStyles.row,styles.plainRow),children:content});}return/*#__PURE__*/_jsxs(CollapsibleTrigger,{render:/*#__PURE__*/_jsx("button",{type:"button",...props(typeRoles.ui,toolCallStyles.row)}),children:[content,/*#__PURE__*/_jsx(IconChevronDown,{"aria-hidden":"true",size:14,...props(toolCallStyles.chevron)})]});}/**
|
|
10
|
+
* A shell command the agent runs, as one line: what it ran, how long it
|
|
11
|
+
* took, and how it ended. It opens to the output, which streams in with
|
|
12
|
+
* the newest line in view; a failure opens on its own.
|
|
13
|
+
*/export function Terminal({command,duration,exitCode,onRetry,output="",ref:forwardedRef,status,...rest}){const elapsed=useElapsed();// null until the reader opens or closes it themselves.
|
|
14
|
+
const[open,setOpen]=useState(null);// The output opens once it starts, and a failure stays open.
|
|
15
|
+
const attention=status==="error"||status==="running"&&output!=="";for(const prop of["className","data-slot","role","style"]){Reflect.deleteProperty(rest,prop);}return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"terminal","data-status":status,ref:forwardedRef,...props(toolCallStyles.root),children:/*#__PURE__*/_jsx(MotionScope,{children:/*#__PURE__*/_jsxs(Collapsible,{onOpenChange:setOpen,open:open===null?attention:open,render:/*#__PURE__*/_jsx("div",{...props(toolCallStyles.clip)}),children:[/*#__PURE__*/_jsx(Line,{command:command,elapsed:elapsed,exitCode:exitCode,seconds:duration??elapsed.seconds,status:status,withOutput:output!==""}),output===""?null:/*#__PURE__*/_jsx(CollapsiblePanel,{children:/*#__PURE__*/_jsx("div",{"data-slot":"terminal-details",...props(toolCallStyles.panel,toolCallStyles.details),children:/*#__PURE__*/_jsxs(CodeBlock,{children:[/*#__PURE__*/_jsxs(CodeBlockHeader,{children:[/*#__PURE__*/_jsx(CodeBlockTitle,{children:"Output"}),/*#__PURE__*/_jsx(CodeBlockCopy,{code:plainOutput(output)})]}),/*#__PURE__*/_jsx(Output,{output:output})]})})}),status==="error"?/*#__PURE__*/_jsx(Failure,{onRetry:onRetry}):null]})})});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontWeight,lineHeight}from"../../styles/typography.stylex";export const terminalStyles={bold:{k63SB2:"xlw70nr",$$css:true},command:{kMwMTN:"x14tvo57",$$css:true},muted:{kMwMTN:"x125omll",$$css:true},output:{kskxy:"xmnucol",kORKVm:"x1odjw0f",kZSYIv:"x14dwdkd",$$css:true},plainRow:{kWkggS:"xjbqb8w",kkrTdU:"xt0e3qv",$$css:true},red:{kMwMTN:"x1ytrddi",$$css:true},verb:{kMwMTN:"x14tvo57",$$css:true}};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
type NativeParagraphProps = ComponentPropsWithRef<"p">;
|
|
3
|
+
export type TextSize = "body" | "caption" | "ui";
|
|
4
|
+
export type TextTone = "default" | "muted";
|
|
5
|
+
export type TextProps = Omit<NativeParagraphProps, "className" | "role" | "style"> & {
|
|
6
|
+
size?: TextSize;
|
|
7
|
+
/** Ink. Defaults to muted for `caption` and to content otherwise. */
|
|
8
|
+
tone?: TextTone;
|
|
9
|
+
};
|
|
10
|
+
export declare function Text({ children, ref: forwardedRef, size, tone, ...rest }: TextProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{typeRoles}from"../../styles/typography.styles";import{textStyles}from"./text.styles";import{jsx as _jsx}from"react/jsx-runtime";const sizeStyles={body:typeRoles.body,caption:typeRoles.caption,ui:typeRoles.ui};export function Text({children,ref:forwardedRef,size="body",tone=size==="caption"?"muted":"default",...rest}){Reflect.deleteProperty(rest,"role");return/*#__PURE__*/_jsx("p",{...rest,"data-size":size,"data-slot":"text","data-tone":tone,ref:forwardedRef,...props(textStyles.base,sizeStyles[size],textStyles[tone]),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";export const textStyles={base:{kqGvvJ:"x10im51j",$$css:true},default:{kMwMTN:"x14tvo57",$$css:true},muted:{kMwMTN:"x125omll",$$css:true}};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
type NativeTextareaProps = ComponentPropsWithRef<"textarea">;
|
|
3
|
+
export type TextareaSize = "default" | "lg" | "sm";
|
|
4
|
+
export type TextareaProps = Omit<NativeTextareaProps, "className" | "onPointerEnter" | "onPointerLeave" | "size" | "style"> & {
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
onPointerEnter?: NativeTextareaProps["onPointerEnter"];
|
|
7
|
+
onPointerLeave?: NativeTextareaProps["onPointerLeave"];
|
|
8
|
+
ref?: NativeTextareaProps["ref"];
|
|
9
|
+
size?: TextareaSize;
|
|
10
|
+
unstyled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function Textarea({ disabled, invalid, readOnly, ref: forwardedRef, size, unstyled, onPointerEnter, onPointerLeave, ...rest }: TextareaProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";import{Field as BaseField}from"@base-ui/react/field";import{props}from"@stylexjs/stylex";import{useCallback,useState}from"react";import{assignRef}from"../../ref-utils";import{fieldStyles}from"../field/field.styles";import{isBoundStringField,useBoundFieldContext}from"../field/field-context";import{textareaStyles}from"./textarea.styles";import{jsx as _jsx}from"react/jsx-runtime";const sizeStyles={default:textareaStyles.default,lg:textareaStyles.lg,sm:textareaStyles.sm};const unstyledSizeStyles={default:textareaStyles.unstyledDefault,lg:textareaStyles.unstyledLg,sm:textareaStyles.unstyledSm};function useTextareaBinding(control){const boundContext=useBoundFieldContext();const boundField=isBoundStringField(boundContext)?boundContext:null;const userOnBlur=control.onBlur;const userOnChange=control.onChange;const handleBoundBlur=useCallback(event=>{boundField?.handleBlur();userOnBlur?.(event);},[boundField,userOnBlur]);const handleBoundChange=useCallback(event=>{boundField?.handleChange(event.currentTarget.value);userOnChange?.(event);},[boundField,userOnChange]);const isInvalid=boundField?boundField.state.meta.isTouched&&!boundField.state.meta.isValid:control.invalid;return{"aria-invalid":isInvalid||undefined,name:boundField?boundField.name:control.name,onBlur:boundField?handleBoundBlur:userOnBlur,onChange:boundField?handleBoundChange:userOnChange,value:boundField?boundField.state.value:control.value};}function textareaAppearance(size,unstyled){return unstyled?props(textareaStyles.unstyled,unstyledSizeStyles[size]):props(fieldStyles.input,textareaStyles.base,sizeStyles[size]);}export function Textarea({disabled=false,invalid=false,readOnly=false,ref:forwardedRef=undefined,size="default",unstyled=false,// biome-ignore lint/complexity/noUselessUndefined: Keep this optional in Babel's generated JS surface.
|
|
2
|
+
onPointerEnter=undefined,// biome-ignore lint/complexity/noUselessUndefined: Keep this optional in Babel's generated JS surface.
|
|
3
|
+
onPointerLeave=undefined,...rest}){const binding=useTextareaBinding({...rest,invalid});const[isHovered,setIsHovered]=useState(false);const handlePointerEnter=useCallback(event=>{if(!(readOnly||disabled)){setIsHovered(true);}onPointerEnter?.(event);},[disabled,onPointerEnter,readOnly]);const handlePointerLeave=useCallback(event=>{setIsHovered(false);onPointerLeave?.(event);},[onPointerLeave]);const setControlRef=useCallback(element=>element instanceof HTMLTextAreaElement||element===null?assignRef(forwardedRef,element):undefined,[forwardedRef]);const{autoFocus,defaultValue,id,name:_name,value:_value,...nativeProps}=rest;return/*#__PURE__*/_jsx(BaseField.Control,{"aria-invalid":binding["aria-invalid"],autoFocus:autoFocus,"data-hovered":isHovered?"true":undefined,"data-size":size,defaultValue:defaultValue,disabled:disabled,id:id,name:binding.name,readOnly:readOnly,ref:setControlRef,render:/*#__PURE__*/_jsx("textarea",{...nativeProps,onBlur:binding.onBlur,onChange:binding.onChange,onPointerEnter:handlePointerEnter,onPointerLeave:handlePointerLeave}),value:binding.value,...textareaAppearance(size,unstyled)});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontSize,fontWeight,lineHeight}from"../../styles/typography.stylex";export const textareaStyles={base:{kAzted:"x562ti3",kHenm0:"x288g5",kXLuUW:"x16dsc37",$$css:true},default:{kT0f0o:"x14h6bio",kVL7Gh:"x1r18r8a",kfmiAY:"x3q61c4",krdFHd:"x1p0g4lk",$$css:true},lg:{kT0f0o:"x14h6bio",kVL7Gh:"x1r18r8a",kfmiAY:"x3q61c4",krdFHd:"x1p0g4lk",kGuDYH:"x12ama9c",kAzted:"xattyca",$$css:true},sm:{kT0f0o:"x1hia2b7",kVL7Gh:"x1dz734k",kfmiAY:"x2dv6dr",krdFHd:"xn5rixj",kGuDYH:"xs18rgd x12ama9c",kLWn49:"x1gxzi7q x1rn0pvf",kAzted:"x1xkfc13",$$css:true},unstyled:{k8Qsv1:"x10l60j5",kH8XJS:"x7xwk5j",kysU6D:"xjyslct",kWkggS:"xjbqb8w",kVAM5u:"x9r1u3d",ksu8eU:"xng3xce",kMzoRj:"xc342km",kGVxlE:"x1gnnqk1",kB7OPa:"x9f619",kMwMTN:"xpfl6da x14tvo57",kkrTdU:"x1s07b3s x1ed109x",k1xSpc:"x1lliihq",kCS8Yb:"x1t1x2f9",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",kMv6JI:"xjb2p0i",kGuDYH:"x12ama9c",k63SB2:"x1lo1l87",kLWn49:"x1rn0pvf",k7Eaqz:"xeuugli",kSiTet:"x1hc1fzr",kjBf7l:"x1uczgqu",k3XXqK:"x1t137rt",kMeerF:"x1k57tk5",k8WAf4:"x391bbb",kg3NbH:"xy7odpl",kHenm0:"x288g5",kXLuUW:"x16dsc37",kzqmXN:"x14atkfc",$$css:true},unstyledDefault:{kAzted:"x1xkfc13",$$css:true},unstyledLg:{kGuDYH:"x12ama9c",kAzted:"x562ti3",$$css:true},unstyledSm:{kGuDYH:"xs18rgd x12ama9c",kAzted:"xd4eqea",$$css:true}};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
export type ThumbnailSize = "default" | "lg" | "sm";
|
|
4
|
+
export type ThumbnailProps = Omit<Closed<ComponentPropsWithRef<"img">>, "alt" | "children" | "data-slot" | "height" | "role" | "src" | "width"> & {
|
|
5
|
+
alt: string;
|
|
6
|
+
size?: ThumbnailSize;
|
|
7
|
+
src: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function Thumbnail({ alt, ref: forwardedRef, size, src, ...rest }: ThumbnailProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{thumbnailStyles}from"./thumbnail.styles";import{jsx as _jsx}from"react/jsx-runtime";const sizeStyles={default:thumbnailStyles.defaultSize,lg:thumbnailStyles.lg,sm:thumbnailStyles.sm};const dimensions={default:48,lg:64,sm:32};export function Thumbnail({alt,ref:forwardedRef,size="default",src,...rest}){if(!src.trim()){throw new TypeError("Thumbnail requires a non-empty image source.");}for(const name of["className","data-slot","height","role","style","width"]){Reflect.deleteProperty(rest,name);}const dimension=dimensions[size];return(/*#__PURE__*/// biome-ignore lint/performance/noImgElement: Keep this UI component framework-neutral instead of coupling it to Next.js image optimization.
|
|
2
|
+
_jsx("img",{...rest,alt:alt,"data-slot":"thumbnail",height:dimension,ref:forwardedRef,src:src,width:dimension,...props(thumbnailStyles.image,sizeStyles[size])}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";export const thumbnailStyles={defaultSize:{kZKoxP:"x1pizb70",kzqmXN:"x188tqju",$$css:true},image:{kOBAk4:"x1plog1",kWkggS:"x1vs9wzj",kaIpWk:"xpu5p1f x1jw0md8",k1xSpc:"x1lliihq",kVIFPx:"xl1xv1r",$$css:true},lg:{kZKoxP:"x1sh0tsm",kzqmXN:"xekueh",$$css:true},sm:{kaIpWk:"xpu5p1f x2b34ud",kZKoxP:"xettwda",kzqmXN:"xs5h3dt",$$css:true}};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { InputProps } from "../input/input";
|
|
3
|
+
export type TimeInputProps = Omit<InputProps, "data-slot" | "defaultValue" | "max" | "min" | "render" | "type" | "unstyled" | "value"> & {
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
"data-slot"?: never;
|
|
6
|
+
max?: string;
|
|
7
|
+
min?: string;
|
|
8
|
+
render?: never;
|
|
9
|
+
type?: never;
|
|
10
|
+
unstyled?: never;
|
|
11
|
+
value?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function TimeInput(timeInputProps: TimeInputProps): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Input}from"../input/input";import{jsx as _jsx}from"react/jsx-runtime";export function TimeInput(timeInputProps){return/*#__PURE__*/_jsx(Input,{...timeInputProps,"data-slot":"time-input",type:"time"});}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface TimeSeriesPoint {
|
|
2
|
+
time: number;
|
|
3
|
+
value: number | null;
|
|
4
|
+
}
|
|
5
|
+
export interface TimeSeriesDatum {
|
|
6
|
+
time: number;
|
|
7
|
+
value: number | null;
|
|
8
|
+
x: Date;
|
|
9
|
+
}
|
|
10
|
+
export declare const AXIS_TICK_MIN_GAP = 12;
|
|
11
|
+
export declare function preparePoints(points: readonly TimeSeriesPoint[], name?: string): TimeSeriesDatum[];
|
|
12
|
+
export declare const SMOOTH: import("@tanstack/charts").ChartCurve;
|
|
13
|
+
export declare function makeDateFormatter(locale: string, timeZone: string, points?: readonly TimeSeriesDatum[]): Intl.DateTimeFormat;
|
|
14
|
+
export declare function getTickCount(points: readonly TimeSeriesDatum[]): number;
|
|
15
|
+
export declare function makeAxisFormatter(locale: string, timeZone: string, points: readonly TimeSeriesDatum[]): Intl.DateTimeFormat;
|
|
16
|
+
export declare function formatNumber(value: number, formatter: ((value: number) => string) | undefined, numberFormat: Intl.NumberFormat, formatterName?: string, name?: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{d3Curve}from"@tanstack/charts/d3/shape";import{curveMonotoneX}from"d3-shape";// Shared by TimeSeries and AreaChart: point validation, date formatting, and
|
|
2
|
+
// tick density for a UTC time axis.
|
|
3
|
+
const DATE_LIMIT=8_640_000_000_000_000;// TanStack measures this gap in SVG pixels; 12px matches the space["3"] rhythm.
|
|
4
|
+
export const AXIS_TICK_MIN_GAP=12;export function preparePoints(points,name="TimeSeries"){if(!Array.isArray(points)){throw new TypeError(`${name} points must be an array.`);}const sorted=points.map(({time,value})=>{if(typeof time!=="number"||!Number.isSafeInteger(time)||Math.abs(time)>DATE_LIMIT){throw new RangeError(`${name} times must be valid integer epoch milliseconds.`);}if(value!==null&&(typeof value!=="number"||!Number.isFinite(value))){throw new RangeError(`${name} values must be finite numbers or null.`);}return{time,value,x:new Date(time)};});sorted.sort((left,right)=>left.time-right.time);for(let index=1;index<sorted.length;index+=1){if(sorted[index-1].time===sorted[index].time){throw new RangeError(`${name} times must be unique.`);}}return sorted;}// Monotone curves stay smooth without overshooting the data.
|
|
5
|
+
export const SMOOTH=d3Curve(curveMonotoneX);const DAY=86_400_000;// The smallest gap between points sets how precise dates need to be.
|
|
6
|
+
function getResolution(points){return points.slice(1).reduce((resolution,point,index)=>{const gap=point.time-points[index].time;return gap>0&&gap<resolution?gap:resolution;},Number.POSITIVE_INFINITY);}function getTooltipPrecision(resolution){const time={hour:"numeric",minute:"2-digit",timeZoneName:"short"};if(resolution>=DAY&&Number.isFinite(resolution)){return{};}if(resolution>=60_000){return time;}if(resolution>=1000){return{...time,second:"2-digit"};}return{...time,fractionalSecondDigits:3,second:"2-digit"};}export function makeDateFormatter(locale,timeZone,points=[]){return new Intl.DateTimeFormat(locale,{day:"numeric",month:"short",timeZone,year:"numeric",...getTooltipPrecision(getResolution(points))});}// At most one tick per data interval, so labels never repeat.
|
|
7
|
+
export function getTickCount(points){const duration=(points.at(-1)?.time??0)-(points.at(0)?.time??0);const resolution=getResolution(points);if(!(duration>0&&Number.isFinite(resolution))){return 5;}// Up to twelve ticks, such as every month of a year; thinning drops
|
|
8
|
+
// labels that would collide.
|
|
9
|
+
return Math.min(12,Math.max(1,Math.round(duration/resolution)));}export function makeAxisFormatter(locale,timeZone,points){const firstTime=points.at(0)?.time??0;const lastTime=points.at(-1)?.time??firstTime;const duration=lastTime-firstTime;const precision=getAxisPrecision(duration);return new Intl.DateTimeFormat(locale,{...precision,...(duration<90*86_400_000?{month:"short"}:{}),timeZone,...(duration<86_400_000?{timeZoneName:"short"}:{})});}function getAxisPrecision(duration){if(duration<1000){return{day:"numeric",fractionalSecondDigits:3,hour:"numeric",minute:"2-digit",second:"2-digit"};}if(duration<60_000){return{day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"};}if(duration<86_400_000){return{day:"numeric",hour:"numeric",minute:"2-digit"};}if(duration<90*86_400_000){return{day:"numeric"};}// A two-digit year reads as a day ("Jan 26"), so show it in full or not at all.
|
|
10
|
+
return duration<366*86_400_000?{month:"short"}:{month:"short",year:"numeric"};}export function formatNumber(value,formatter,numberFormat,formatterName="formatValue",name="TimeSeries"){const formatted=formatter?formatter(value):numberFormat.format(value);if(typeof formatted!=="string"){throw new TypeError(`${name} ${formatterName} must return a string.`);}return formatted;}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
import { type ChartSeriesTone } from "../chart-frame/chart-colors";
|
|
4
|
+
import { type ChartStatus } from "../chart-frame/chart-loading";
|
|
5
|
+
import { type TimeSeriesPoint } from "./time-format";
|
|
6
|
+
export type { TimeSeriesPoint } from "./time-format";
|
|
7
|
+
export type TimeSeriesPresentation = "chart" | "sparkline";
|
|
8
|
+
/** A second series, such as last year, drawn dashed in the muted tone. */
|
|
9
|
+
export interface TimeSeriesComparison {
|
|
10
|
+
label: string;
|
|
11
|
+
points: readonly TimeSeriesPoint[];
|
|
12
|
+
}
|
|
13
|
+
export type TimeSeriesProps = Omit<Closed<ComponentPropsWithRef<"div">>, "aria-label" | "children" | "data-slot" | "role"> & {
|
|
14
|
+
"aria-description"?: string;
|
|
15
|
+
"aria-label": string;
|
|
16
|
+
comparison?: TimeSeriesComparison;
|
|
17
|
+
formatAxisValue?: (value: number) => string;
|
|
18
|
+
formatValue?: (value: number) => string;
|
|
19
|
+
/** Shows the series legend below the chart. Turn it off when a card header shows it. */
|
|
20
|
+
legend?: boolean;
|
|
21
|
+
locale?: string;
|
|
22
|
+
points: readonly TimeSeriesPoint[];
|
|
23
|
+
presentation?: TimeSeriesPresentation;
|
|
24
|
+
seriesLabel: string;
|
|
25
|
+
/** "loading" holds the chart's space with a placeholder; data that replaces it wipes in. */
|
|
26
|
+
status?: ChartStatus;
|
|
27
|
+
timeZone: string;
|
|
28
|
+
tone?: ChartSeriesTone;
|
|
29
|
+
};
|
|
30
|
+
export declare function TimeSeries({ "aria-description": ariaDescription, "aria-label": ariaLabel, comparison, legend, formatAxisValue, formatValue, locale, points, presentation, ref: forwardedRef, seriesLabel, status, timeZone, tone, ...rest }: TimeSeriesProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{areaY,defineChart,dot,lineY}from"@tanstack/charts";import{decorative}from"@tanstack/charts/mark/decorative";import{scaleLinear}from"@tanstack/charts/scales/linear";import{tooltip as tooltipFeature}from"@tanstack/charts/tooltip";import{scaleUtc}from"d3-scale";import{useId,useMemo}from"react";import{typeRoles}from"../../styles/typography.styles";import{chartColors}from"../chart-frame/chart-colors";import{pillTickLabels,timeCrosshair}from"../chart-frame/chart-crosshair";import{ChartFrame}from"../chart-frame/chart-frame";import{ChartLoading,chartRevealStyles,useLoadingReveal}from"../chart-frame/chart-loading";import{ChartLegend}from"../chart-legend/chart-legend";import{ChartTooltip}from"../chart-tooltip/chart-tooltip";import{AXIS_TICK_MIN_GAP,formatNumber,getTickCount,makeAxisFormatter,makeDateFormatter,preparePoints,SMOOTH}from"./time-format";import{timeSeriesStyles}from"./time-series.styles";/** A second series, such as last year, drawn dashed in the muted tone. */import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";function assertLabels(seriesLabel,ariaLabel){if(typeof seriesLabel!=="string"||typeof ariaLabel!=="string"||!seriesLabel.trim()||!ariaLabel.trim()){throw new TypeError("TimeSeries requires non-empty seriesLabel and aria-label values.");}}function assertOptions(presentation,formatValue,formatAxisValue,tone,timeZone){if(presentation!=="chart"&&presentation!=="sparkline"){throw new RangeError("TimeSeries presentation must be 'chart' or 'sparkline'.");}if(formatValue!==undefined&&typeof formatValue!=="function"||formatAxisValue!==undefined&&typeof formatAxisValue!=="function"){throw new TypeError("TimeSeries formatters must be functions.");}if(!Object.hasOwn(chartColors,tone)){throw new RangeError("TimeSeries tone is not a supported chart series tone.");}if(typeof timeZone!=="string"||!timeZone.trim()){throw new TypeError("TimeSeries requires a non-empty timeZone.");}}// Points between two gaps have no line segment, so they keep a visible dot.
|
|
2
|
+
function getIsolatedRows(rows){return rows.filter((row,index)=>row.value!==null&&(rows[index-1]?.value??null)===null&&(rows[index+1]?.value??null)===null);}function toRows(points){return points.map(({time,x,value})=>({id:String(time),time,value,x}));}// The comparison is decorative: it shapes the scale but adds no focus targets.
|
|
3
|
+
function getComparisonMarks(comparison){if(!comparison){return[];}return[decorative(lineY(toRows(comparison.points),{curve:SMOOTH,id:"time-series-comparison",key:datum=>datum.id,stroke:chartColors.muted,strokeDasharray:"4 4",x:"x",y:"value"}))];}function getLegendItems(seriesLabel,tone,comparison){const items=[{id:"time-series",label:seriesLabel,tone}];return comparison?[...items,{id:"time-series-comparison",label:comparison.label,tone:"muted"}]:items;}function renderTooltip(context,seriesLabel,tone,dateFormatter,formatValue){const point=context.points.find(({datum})=>datum.value!==null);if(!point){return null;}return/*#__PURE__*/_jsx(ChartTooltip,{items:[{id:"time-series-value",label:seriesLabel,tone,value:formatValue(point.yValue)}],label:dateFormatter.format(point.xValue)});}function plotHeight(presentation){return presentation==="sparkline"?64:200;}function TimeSeriesLegend({comparison,legend,presentation,seriesLabel,tone}){return legend&&presentation==="chart"?/*#__PURE__*/_jsx("div",{"data-slot":"time-series-legend",...props(timeSeriesStyles.legend),children:/*#__PURE__*/_jsx(ChartLegend,{"aria-label":`${seriesLabel} series`,items:getLegendItems(seriesLabel,tone,comparison)})}):null;}// Loading holds the plot's space and keeps the legend, so data arrives in place.
|
|
4
|
+
function TimeSeriesContent({plot,status}){if(status==="loading"){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(ChartLoading,{grid:plot.presentation==="chart",height:plotHeight(plot.presentation)}),/*#__PURE__*/_jsx(TimeSeriesLegend,{...plot})]});}return plot.points.some(({value})=>value!==null)?/*#__PURE__*/_jsx(TimeSeriesPlot,{...plot}):/*#__PURE__*/_jsx("p",{role:"status",...props(typeRoles.body,timeSeriesStyles.empty),children:"No observations available."});}function TimeSeriesPlot({"aria-description":ariaDescription,"aria-label":ariaLabel,comparison,legend,formatAxisValue,formatValue,locale,points,presentation,reveal,seriesLabel,timeZone,tone}){const numberFormatter=useMemo(()=>new Intl.NumberFormat(locale),[locale]);// Axis ticks default to compact numbers ("13.5K"); tooltips stay exact.
|
|
5
|
+
const axisNumberFormatter=useMemo(()=>new Intl.NumberFormat(locale,{maximumFractionDigits:1,notation:"compact"}),[locale]);const dateFormatter=useMemo(()=>makeDateFormatter(locale,timeZone,points),[locale,points,timeZone]);const axisFormatter=useMemo(()=>makeAxisFormatter(locale,timeZone,points),[locale,points,timeZone]);const valueFormatter=useMemo(()=>value=>formatNumber(value,formatValue,numberFormatter),[formatValue,numberFormatter]);// Gradient IDs must stay unique when several charts share a page.
|
|
6
|
+
const idPrefix=useId().replace(/[^\w-]/gu,"");const definition=useMemo(()=>{const rows=toRows(points);return defineChart({// The area fills to zero; clipping ends it at the plot's bottom edge.
|
|
7
|
+
clip:true,gradients:[{id:"time-series-area",stops:[{color:chartColors[tone],offset:0,opacity:0.02},{color:chartColors[tone],offset:1,opacity:0.32}]}],guides:presentation==="sparkline"?false:undefined,marks:[// Decorative marks paint without owning focus or tooltip points.
|
|
8
|
+
decorative(areaY(rows,{curve:SMOOTH,fill:"url(#time-series-area)",fillOpacity:1,id:"time-series-area",key:datum=>datum.id,x:"x",y:"value"})),...getComparisonMarks(comparison),...(presentation==="chart"?[timeCrosshair(date=>axisFormatter.format(date))]:[]),// Hover and focus mark the active point; resting points stay quiet.
|
|
9
|
+
lineY(rows,{curve:SMOOTH,id:"time-series-line",key:datum=>datum.id,stroke:chartColors[tone],x:"x",y:"value"}),decorative(dot(getIsolatedRows(rows),{fill:chartColors[tone],id:"time-series-isolated",key:datum=>datum.id,r:2.5,x:"x",y:"value"}))],scales:{x:{axis:{tickLabels:{...pillTickLabels,thin:{minGap:AXIS_TICK_MIN_GAP}},ticks:{count:getTickCount(points),format:date=>axisFormatter.format(date)}},// The time domain ends at the data; nicing would pad empty time.
|
|
10
|
+
nice:false,scale:scaleUtc},y:{axis:{ticks:{count:4,format:value=>formatNumber(value,formatAxisValue??formatValue,axisNumberFormatter,formatAxisValue?"formatAxisValue":"formatValue")}},grid:true,nice:true,scale:scaleLinear}}},{tooltip:tooltipFeature});},[axisFormatter,axisNumberFormatter,comparison,formatAxisValue,formatValue,points,presentation,tone]);const renderTooltipBody=useMemo(()=>context=>renderTooltip(context,seriesLabel,tone,dateFormatter,valueFormatter),[dateFormatter,seriesLabel,tone,valueFormatter]);return/*#__PURE__*/_jsxs("div",{"data-slot":"time-series-chart",children:[/*#__PURE__*/_jsx("div",{...props(reveal&&chartRevealStyles.reveal),children:/*#__PURE__*/_jsx(ChartFrame,{"aria-description":ariaDescription,"aria-label":ariaLabel,definition:definition,height:plotHeight(presentation),idPrefix:idPrefix,initialWidth:presentation==="sparkline"?256:undefined,renderTooltipBody:renderTooltipBody,tabIndex:0})}),/*#__PURE__*/_jsx(TimeSeriesLegend,{comparison:comparison,legend:legend,presentation:presentation,seriesLabel:seriesLabel,tone:tone})]});}export function TimeSeries({"aria-description":ariaDescription,"aria-label":ariaLabel,comparison,legend=true,formatAxisValue,formatValue,locale="en-US",points,presentation="chart",ref:forwardedRef,seriesLabel,status="ready",timeZone,tone="series1",...rest}){const reveal=useLoadingReveal(status);assertLabels(seriesLabel,ariaLabel);assertOptions(presentation,formatValue,formatAxisValue,tone,timeZone);makeDateFormatter(locale,timeZone);const sortedPoints=preparePoints(points);const preparedComparison=comparison&&{label:comparison.label,points:preparePoints(comparison.points)};for(const name of["aria-label","children","className","data-slot","role","style"]){Reflect.deleteProperty(rest,name);}return/*#__PURE__*/_jsx("div",{...rest,"aria-busy":status==="loading"||undefined,"data-slot":"time-series",ref:forwardedRef,...props(timeSeriesStyles.root,presentation==="sparkline"&&timeSeriesStyles.sparkline),children:/*#__PURE__*/_jsx(TimeSeriesContent,{plot:{"aria-description":ariaDescription,"aria-label":ariaLabel,comparison:preparedComparison,formatAxisValue,formatValue,legend,locale,points:sortedPoints,presentation,reveal,seriesLabel,timeZone,tone},status:status})});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const timeSeriesStyles={empty:{kqGvvJ:"x10im51j",$$css:true},legend:{keoZOQ:"x1fynrwi",$$css:true},root:{k7Eaqz:"xeuugli",$$css:true},sparkline:{ks0D6T:"x1i5r0r9",kzqmXN:"xh8yej3",$$css:true}};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
export type TimestampFormat = "date" | "date-time" | "relative";
|
|
4
|
+
export type TimestampProps = Omit<Closed<ComponentPropsWithRef<"time">>, "children" | "data-slot" | "dateTime" | "lang" | "role"> & {
|
|
5
|
+
dateTime: string;
|
|
6
|
+
format?: TimestampFormat;
|
|
7
|
+
locale?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The instant `relative` counts from, as an ISO instant with a timezone.
|
|
10
|
+
* Defaults to the time of render.
|
|
11
|
+
*/
|
|
12
|
+
now?: string;
|
|
13
|
+
timeZone?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function Timestamp({ dateTime, format, locale, now, ref: forwardedRef, timeZone, ...rest }: TimestampProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{typeRoles}from"../../styles/typography.styles";import{visuallyHiddenStyles}from"../visually-hidden/visually-hidden.styles";import{timestampStyles}from"./timestamp.styles";import{jsxs as _jsxs}from"react/jsx-runtime";const FORMATS=new Set(["date","date-time","relative"]);// Each unit is used until the next one fits; weeks stop at a month.
|
|
2
|
+
const RELATIVE_UNITS=[["second",60],["minute",60],["hour",24],["day",7],["week",4.35],["month",12],["year",Number.POSITIVE_INFINITY]];function formatRelative(date,now,locale){const formatter=new Intl.RelativeTimeFormat(locale,{numeric:"auto"});let value=(date.getTime()-now.getTime())/1000;// Under a minute reads as "now" rather than a ticking count of seconds.
|
|
3
|
+
if(Math.abs(value)<60){return formatter.format(0,"second");}for(const[unit,size]of RELATIVE_UNITS){if(Math.abs(value)<size){return formatter.format(Math.round(value),unit);}value/=size;}return formatter.format(Math.round(value),"year");}const ISO_INSTANT_REGEX=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2})(?:\.\d+)?(?<timezone>Z|[+-]\d{2}:\d{2})$/u;function parseInstant(value){const match=ISO_INSTANT_REGEX.exec(value);if(!match){throw new RangeError("Timestamp requires an ISO instant with a timezone.");}const[,yearPart,monthPart,dayPart,hourPart,minutePart,secondPart]=match;const year=Number(yearPart);const month=Number(monthPart);const day=Number(dayPart);const hour=Number(hourPart);const minute=Number(minutePart);const second=Number(secondPart);const calendarDate=new Date(0);calendarDate.setUTCFullYear(year,month-1,day);calendarDate.setUTCHours(hour,minute,second,0);if(year===0||calendarDate.getUTCFullYear()!==year||calendarDate.getUTCMonth()!==month-1||calendarDate.getUTCDate()!==day||hour>23||minute>59||second>59){throw new RangeError("Timestamp requires a valid calendar date and time.");}const instant=new Date(Date.parse(value));if(!Number.isFinite(instant.getTime())){throw new RangeError("Timestamp requires a valid ISO instant with a timezone.");}return instant;}function formatTimestamp(date,format,locale,timeZone){const options=format==="date"?{day:"numeric",month:"short",year:"numeric"}:{day:"numeric",hour:"numeric",minute:"2-digit",month:"short",timeZoneName:"short",year:"numeric"};return new Intl.DateTimeFormat(locale,{...options,timeZone}).format(date);}export function Timestamp({dateTime,format="date-time",locale="en-US",now,ref:forwardedRef,timeZone="UTC",...rest}){if(!FORMATS.has(format)){throw new RangeError("Timestamp format must be 'date', 'date-time', or 'relative'.");}const date=parseInstant(dateTime);const relative=format==="relative";const exact=formatTimestamp(date,"date-time",locale,timeZone);const label=relative?formatRelative(date,now?parseInstant(now):new Date(),locale):formatTimestamp(date,format,locale,timeZone);for(const name of["className","data-slot","dateTime","lang","role","style"]){Reflect.deleteProperty(rest,name);}return/*#__PURE__*/_jsxs("time",{...rest,"data-slot":"timestamp",dateTime:dateTime,lang:locale,ref:forwardedRef// Server and client render moments apart, so relative text may differ.
|
|
4
|
+
,suppressHydrationWarning:relative,title:relative?exact:undefined,...props(timestampStyles.root,typeRoles.body),children:[label,relative?/*#__PURE__*/_jsxs("span",{...props(visuallyHiddenStyles.root),children:[", ",exact]}):null]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";export const timestampStyles={root:{kMwMTN:"x125omll",kcqcaj:"xss6m8b",$$css:true}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/interaction.stylex";import{borderWidth,focus,focusMotion,focusOutline}from"../../styles/interaction.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontSize,fontWeight,lineHeight}from"../../styles/typography.stylex";export const anchoredToastStyles={content:{kGNEyG:"x7a106z",kB7OPa:"x9f619",kMwMTN:"x14tvo57",k1xSpc:"x78zum5",kOIVth:"xp4ho6d",ks0D6T:"x16dxp4v",k7Eaqz:"x108j0tp",kmVPX3:"xvgr8tm",$$css:true},positioner:{kfzvcC:"x47corl",kVAEAm:"x10l6tqk",kY2c9j:"xfo81ep",$$css:true},root:{k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kB7OPa:"x9f619",kSiTet:"xiyypsa x1hw7zpd x1hc1fzr",kjBf7l:"x4dprnk xu383fl",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"x1vhx2qj",kfzvcC:"x67bb7w",k3aq6I:"x2bnnpm x1n9vljb x1c071of",kIyJzY:"x1e471i8 x107nfut x18kz1lc",k1ekBW:"xwcsmn1",kAMwcw:"xvhdtae",kfSwDN:"x87ps6o",$$css:true},tooltipContent:{kGNEyG:"x6s0dn4",kB7OPa:"x9f619",kMwMTN:"x14tvo57",k1xSpc:"x3nfvp2",ks0D6T:"xn5silr",k8WAf4:"x1lmimt7",kg3NbH:"xb5xqfq",$$css:true},tooltipRoot:{k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kaIpWk:"x2b34ud",kB7OPa:"x9f619",kSiTet:"xiyypsa x1hw7zpd x1hc1fzr",kjBf7l:"x4dprnk xu383fl",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"x1vhx2qj",kfzvcC:"x67bb7w",k3aq6I:"x2bnnpm x1n9vljb x1c071of",kIyJzY:"x1e471i8 x107nfut x18kz1lc",k1ekBW:"xwcsmn1",kAMwcw:"xvhdtae",kfSwDN:"x87ps6o",$$css:true},tooltipTitle:{kB7OPa:"x9f619",kMwMTN:"x14tvo57",kGuDYH:"x1ws78te",k63SB2:"xuku2lm",kLWn49:"x76y1r9",kogj98:"xvemdqa",kHjlTd:"xj0a0fe",$$css:true},viewport:{"--toast-focus-ring":"xc0co3w xa1v7o7",kjBf7l:"x1egkn3r x1uczgqu",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"x1vhx2qj",$$css:true}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create,keyframes}from"@stylexjs/stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";const pulseA="x1vbutyv-B";const pulseB="x1vbutyv-B";const shakeA="x6txfro-B";const shakeB="x6txfro-B";export const toastAnimationStyles={pulseEven:{k44tkh:"xui4633 x1i2v4ol",kKVMdj:"x1tzfbnl xo5bdlq",kyAemX:"x17ay8nm",$$css:true},pulseOdd:{k44tkh:"xui4633 x1i2v4ol",kKVMdj:"x1tzfbnl xo5bdlq",kyAemX:"x17ay8nm",$$css:true},shakeEven:{k44tkh:"xui4633 x1i2v4ol",kKVMdj:"x1tzfbnl x1li1nhu",kyAemX:"x17ay8nm",$$css:true},shakeOdd:{k44tkh:"xui4633 x1i2v4ol",kKVMdj:"x1tzfbnl x1li1nhu",kyAemX:"x17ay8nm",$$css:true}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{IconAlertTriangle,IconCircleCheck,IconCircleX,IconInfoCircle}from"../../icons";import{Spinner}from"../spinner/spinner";import{toastStyles}from"./toast.styles";import{jsx as _jsx}from"react/jsx-runtime";function isToastStatus(type){return type==="error"||type==="info"||type==="loading"||type==="success"||type==="warning";}const statusStyles={error:toastStyles.iconError,info:toastStyles.iconInfo,loading:toastStyles.iconLoading,success:toastStyles.iconSuccess,warning:toastStyles.iconWarning};const statusIcons={error:IconCircleX,info:IconInfoCircle,loading:Spinner,success:IconCircleCheck,warning:IconAlertTriangle};export function StatusIcon({type}){if(!isToastStatus(type)){return null;}const Icon=statusIcons[type];return/*#__PURE__*/_jsx("span",{"aria-hidden":"true","data-slot":"toast-icon",...props(toastStyles.icon,statusStyles[type]),children:/*#__PURE__*/_jsx(Icon,{"aria-hidden":"true",focusable:"false",size:16})});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/interaction.stylex";import{borderWidth,focus,focusMotion,focusOutline}from"../../styles/interaction.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const toastStackedStyles={content:{kSiTet:"xxek5qv x1wurjej x1hc1fzr",kfzvcC:"x1xt5f5a x67bb7w",kIyJzY:"x1e471i8 x1rvut6x",k1ekBW:"x19991ni",kAMwcw:"xvhdtae",$$css:true},root:{"--toast-calc-height":"xevb3p6","--toast-gap":"xxjwffl","--toast-inset":"x1uhnyjm","--toast-peek":"x14m22no","--toast-scale":"x1e94wy6","--toast-shrink":"x1c223hw",k5JduY:"x1s928wv",k4zj60:"xoglah7",kH8cDV:"x17cx49",kwXMNM:"x1j6awrg",kkgrvl:"x4eaejv",k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kB7OPa:"x9f619",kZKoxP:"x1096lto x1pghmh7",kSiTet:"xiyypsa xeqjt6k x1hc1fzr",kjBf7l:"x4dprnk xu383fl",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"x1vhx2qj",kfzvcC:"x67bb7w",kVAEAm:"x10l6tqk",kIyJzY:"x1e471i8 xsfkdxm",k1ekBW:"x19ix5ol",kAMwcw:"x4ycyq1 xb51amx",kfSwDN:"x87ps6o",kzqmXN:"xh8yej3",$$css:true},rootBottom:{"--toast-calc-offset-y":"xm0tlr3",k8Iv0R:"x1wpe5ba",krVfgx:"x1ey2m1c",k87sOh:"x80663w",k3aq6I:"x4mvzck x16fbmg8 xap15ez xawzv3b x1x0d9y8 xd6ppuq xlvqnih x6w6a9x",k3nNDw:"x1kq4lpq",$$css:true},rootTop:{"--toast-calc-offset-y":"xvnkh9m",k3foIR:"x1srwf7z",krVfgx:"xdd4er5",k87sOh:"x13vifvy",k3aq6I:"xr3q1j4 x16fbmg8 xap15ez xawzv3b x1x0d9y8 xd6ppuq x12f9jxt x246y51",k3nNDw:"x384s30",$$css:true}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getPositionSwipeDirections(position){switch(position){case"top-left":return["left","up"];case"top-center":return["up"];case"top-right":return["right","up"];case"bottom-left":return["left","down"];case"bottom-center":return["down"];default:return["right","down"];}}export function isTopPosition(position){return position==="top-left"||position==="top-center"||position==="top-right";}export function resolveSideOffset(sideOffset){return sideOffset??4;}export function getUpdateAnimation(type,updateKey){if(updateKey===undefined||updateKey<=0){return undefined;}const isEven=updateKey%2===0;if(type==="error"){return isEven?"shake-even":"shake-odd";}return isEven?"pulse-even":"pulse-odd";}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Toast as BaseToast}from"@base-ui/react/toast";import{props}from"@stylexjs/stylex";import{controlLabel}from"../../control-label";import{protectRenderSlot}from"../../render-utils";import{toastStyles}from"./toast.styles";import{anchoredToastStyles}from"./toast-anchored.styles";import{toastAnimationStyles}from"./toast-animation.styles";import{StatusIcon}from"./toast-icons";import{toastStackedStyles}from"./toast-stacked.styles";import{getPositionSwipeDirections,getUpdateAnimation,isTopPosition,resolveSideOffset}from"./toast-utils";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{createElement as _createElement}from"react";const posStyles={"bottom-center":toastStyles.bottomCenter,"bottom-left":toastStyles.bottomLeft,"bottom-right":toastStyles.bottomRight,"top-center":toastStyles.topCenter,"top-left":toastStyles.topLeft,"top-right":toastStyles.topRight};const animStyles={"pulse-even":toastAnimationStyles.pulseEven,"pulse-odd":toastAnimationStyles.pulseOdd,"shake-even":toastAnimationStyles.shakeEven,"shake-odd":toastAnimationStyles.shakeOdd};function renderToastAction(actionProps){return/*#__PURE__*/_jsx("button",{...actionProps,children:controlLabel(actionProps.children)});}function getStackedRootProps(isTop,animStyle){const stylexProps=props(toastStyles.surface,toastStackedStyles.root,isTop?toastStackedStyles.rootTop:toastStackedStyles.rootBottom,animStyle);return{...stylexProps,style:{...stylexProps.style,zIndex:"calc(1000 - var(--toast-index, 0))"}};}export function ToastStackedView({position}){const{toasts}=BaseToast.useToastManager();const isTop=isTopPosition(position);const swipeDirection=getPositionSwipeDirections(position);return/*#__PURE__*/_jsx(BaseToast.Viewport,{"data-slot":"toast-viewport",...props(toastStyles.viewport,posStyles[position]),children:toasts.map(toast=>{const animation=getUpdateAnimation(toast.type,toast.updateKey);const animStyle=animation?animStyles[animation]:null;return/*#__PURE__*/_createElement(BaseToast.Root,{...toast.data?.rootProps,"data-slot":"toast-root","data-update-animation":animation,key:toast.id,render:protectRenderSlot("toast-root",toast.data?.rootProps?.render),swipeDirection:swipeDirection,toast:toast,...getStackedRootProps(isTop,animStyle)},/*#__PURE__*/_jsxs(BaseToast.Content,{"data-slot":"toast-content",...props(toastStyles.content,toastStackedStyles.content),children:[/*#__PURE__*/_jsx(StatusIcon,{type:toast.type}),/*#__PURE__*/_jsxs("div",{...props(toastStyles.body),children:[/*#__PURE__*/_jsx(BaseToast.Title,{"data-slot":"toast-title",dir:"auto",...props(toastStyles.title)}),/*#__PURE__*/_jsx(BaseToast.Description,{"data-slot":"toast-description",dir:"auto",...props(toastStyles.description)})]}),toast.actionProps?/*#__PURE__*/_jsx(BaseToast.Action,{"data-slot":"toast-action",render:renderToastAction,...props(toastStyles.action)}):null]}));})});}function AnchoredTooltipRoot({toast}){const animation=getUpdateAnimation(toast.type,toast.updateKey);const animStyle=animation?animStyles[animation]:null;return/*#__PURE__*/_jsx(BaseToast.Root,{...toast.data?.rootProps,"data-slot":"toast-popup","data-update-animation":animation,render:protectRenderSlot("toast-popup",toast.data?.rootProps?.render),toast:toast,...props(toastStyles.surface,anchoredToastStyles.tooltipRoot,animStyle),children:/*#__PURE__*/_jsx(BaseToast.Content,{"data-slot":"toast-content",...props(anchoredToastStyles.tooltipContent),children:/*#__PURE__*/_jsx(BaseToast.Title,{"data-slot":"toast-title",dir:"auto",...props(anchoredToastStyles.tooltipTitle)})})});}function AnchoredStandardRoot({toast}){const animation=getUpdateAnimation(toast.type,toast.updateKey);const animStyle=animation?animStyles[animation]:null;return/*#__PURE__*/_jsx(BaseToast.Root,{...toast.data?.rootProps,"data-slot":"toast-popup","data-update-animation":animation,render:protectRenderSlot("toast-popup",toast.data?.rootProps?.render),toast:toast,...props(toastStyles.surface,anchoredToastStyles.root,animStyle),children:/*#__PURE__*/_jsxs(BaseToast.Content,{"data-slot":"toast-content",...props(anchoredToastStyles.content),children:[/*#__PURE__*/_jsx(StatusIcon,{type:toast.type}),/*#__PURE__*/_jsxs("div",{...props(toastStyles.body),children:[/*#__PURE__*/_jsx(BaseToast.Title,{"data-slot":"toast-title",dir:"auto",...props(toastStyles.title)}),/*#__PURE__*/_jsx(BaseToast.Description,{"data-slot":"toast-description",dir:"auto",...props(toastStyles.description)})]}),toast.actionProps?/*#__PURE__*/_jsx(BaseToast.Action,{"data-slot":"toast-action",render:renderToastAction,...props(toastStyles.action)}):null]})});}export function AnchoredToastView(){const{toasts}=BaseToast.useToastManager();return/*#__PURE__*/_jsx(BaseToast.Viewport,{"data-slot":"toast-viewport-anchored",...props(anchoredToastStyles.viewport),children:toasts.map(toast=>toast.positionerProps?.anchor?/*#__PURE__*/_jsx(BaseToast.Positioner,{"data-slot":"toast-positioner",toast:toast,...toast.positionerProps,sideOffset:resolveSideOffset(toast.positionerProps?.sideOffset),...props(anchoredToastStyles.positioner),children:toast.data?.tooltipStyle?/*#__PURE__*/_jsx(AnchoredTooltipRoot,{toast:toast}):/*#__PURE__*/_jsx(AnchoredStandardRoot,{toast:toast})},toast.id):null)});}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Toast as BaseToast } from "@base-ui/react/toast";
|
|
2
|
+
import type { AnchoredToastProviderProps, ToastData, ToastProviderProps } from "./toast.types";
|
|
3
|
+
export type { AnchoredToastProviderProps, ToastPosition, ToastProviderProps, } from "./toast.types";
|
|
4
|
+
export declare const ToastPrimitive: typeof BaseToast;
|
|
5
|
+
export declare const toastManager: import("@base-ui/react").ToastManager<ToastData>;
|
|
6
|
+
export declare const anchoredToastManager: import("@base-ui/react").ToastManager<ToastData>;
|
|
7
|
+
export declare function ToastProvider({ children, position, portalProps, toastManager: customManager, ...restProps }: ToastProviderProps): import("react").JSX.Element;
|
|
8
|
+
export declare function AnchoredToastProvider({ children, portalProps, toastManager: customManager, ...restProps }: AnchoredToastProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Toast as BaseToast}from"@base-ui/react/toast";import{AnchoredToastView,ToastStackedView}from"./toast-views";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const ToastPrimitive=BaseToast;export const toastManager=BaseToast.createToastManager();export const anchoredToastManager=BaseToast.createToastManager();export function ToastProvider({children,position="bottom-right",portalProps,toastManager:customManager,...restProps}){return/*#__PURE__*/_jsxs(BaseToast.Provider,{...restProps,toastManager:customManager??toastManager,children:[children,/*#__PURE__*/_jsx(BaseToast.Portal,{"data-slot":"toast-portal",...portalProps,children:/*#__PURE__*/_jsx(ToastStackedView,{position:position})})]});}export function AnchoredToastProvider({children,portalProps,toastManager:customManager,...restProps}){return/*#__PURE__*/_jsxs(BaseToast.Provider,{...restProps,toastManager:customManager??anchoredToastManager,children:[children,/*#__PURE__*/_jsx(BaseToast.Portal,{"data-slot":"toast-portal-anchored",...portalProps,children:/*#__PURE__*/_jsx(AnchoredToastView,{})})]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/interaction.stylex";import{borderWidth,focus,focusMotion,focusOutline,opacity}from"../../styles/interaction.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";import"../../styles/shadows.stylex";import{shadows}from"../../styles/shadows.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontSize,fontWeight,lineHeight}from"../../styles/typography.stylex";export const toastStyles={action:{kGNEyG:"x6s0dn4",kSGwAc:"xamitd3",k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kWkggS:"x1wq1ut0 x1o7hn9x",kVAM5u:"x155xxfk",kaIpWk:"x2b34ud",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kB7OPa:"x9f619",kMwMTN:"x14tvo57",kkrTdU:"x1s07b3s x1ypdohk",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kMv6JI:"xjb2p0i",kGuDYH:"xlh8hku",k63SB2:"xuku2lm",kOIVth:"x13hh4mm",kjj79g:"xl56j7k",kLWn49:"x1wrb330",keTefX:"xi4je3c",kAzted:"x1pw4g4d",kSiTet:"x1pymsji x1hc1fzr",kI3sdo:"x1a2a7pz",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"x1vhx2qj",k8WAf4:"x1lmimt7",kg3NbH:"xy7odpl",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"xce0r4z",kAMwcw:"xvhdtae",$$css:true},body:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kzQI83:"x1iyjqo2",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",$$css:true},bottomCenter:{kGNEyG:"x6s0dn4",krVfgx:"x19mxr8a",kbCHJM:"x1nrll8i",k3aq6I:"xuuh30",$$css:true},bottomLeft:{kGNEyG:"x1cy8zhl",krVfgx:"x19mxr8a",kbCHJM:"x9bol1h",$$css:true},bottomRight:{kGNEyG:"xuk3077",krVfgx:"x19mxr8a",kCIrl2:"xg9vteb",$$css:true},content:{kGNEyG:"x1cy8zhl",kB7OPa:"x9f619",k1xSpc:"x78zum5",kOIVth:"xp4ho6d",kVQacm:"xb3r6kr",kmVPX3:"xvgr8tm",kfzvcC:"x67bb7w",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x1kx2cm7",kAMwcw:"xvhdtae",kzqmXN:"xh8yej3",$$css:true},description:{kB7OPa:"x9f619",kMwMTN:"x125omll",kGuDYH:"xlh8hku",k63SB2:"x1lo1l87",kLWn49:"x2xzzt7",kogj98:"xvemdqa",kTgw9:"x13faqbe",$$css:true},icon:{kGNEyG:"x6s0dn4",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kZKoxP:"x1l36t39",keoZOQ:"xr9ek0c",kzqmXN:"xcdlrvm",$$css:true},iconError:{kMwMTN:"x1rncs7t",$$css:true},iconInfo:{kMwMTN:"x1dpkydq",$$css:true},iconLoading:{kMwMTN:"x14tvo57",$$css:true},iconSuccess:{kMwMTN:"x19d0d4p",$$css:true},iconWarning:{kMwMTN:"x11ihctc",$$css:true},surface:{kWkggS:"xui3q9s",kVAM5u:"x1l55r2k x155xxfk",kaIpWk:"x1yl01a3",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kGVxlE:"x1mhlhek",kMwMTN:"x14tvo57",$$css:true},title:{kB7OPa:"x9f619",kMwMTN:"x14tvo57",kGuDYH:"xlh8hku",k63SB2:"xuku2lm",kLWn49:"x2xzzt7",kogj98:"xvemdqa",kTgw9:"x13faqbe",$$css:true},topCenter:{kGNEyG:"x6s0dn4",kbCHJM:"x1nrll8i",k87sOh:"x1bvznid",k3aq6I:"xuuh30",$$css:true},topLeft:{kGNEyG:"x1cy8zhl",kbCHJM:"x9bol1h",k87sOh:"x1bvznid",$$css:true},topRight:{kGNEyG:"xuk3077",kCIrl2:"xg9vteb",k87sOh:"x1bvznid",$$css:true},viewport:{"--toast-focus-ring":"xc0co3w xa1v7o7",kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x13hh4mm",ks0D6T:"x1j9u4d2",kjBf7l:"x1egkn3r x1uczgqu",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"x1vhx2qj",kVAEAm:"xixxii4",kzqmXN:"xu8y5xj",kY2c9j:"xfo81ep",$$css:true}};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Toast as BaseToast } from "@base-ui/react/toast";
|
|
2
|
+
import type { ComponentProps, ComponentPropsWithRef } from "react";
|
|
3
|
+
export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
4
|
+
export type ToastSwipeDirection = "up" | "down" | "left" | "right";
|
|
5
|
+
export interface ToastData {
|
|
6
|
+
rootProps?: Omit<ComponentProps<typeof BaseToast.Root>, "children" | "className" | "style" | "swipeDirection" | "toast">;
|
|
7
|
+
tooltipStyle?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
type ToastPortalProps = Omit<ComponentPropsWithRef<typeof BaseToast.Portal>, "className" | "style">;
|
|
11
|
+
export type ToastProviderProps = Omit<ComponentPropsWithRef<typeof BaseToast.Provider>, "className" | "style"> & {
|
|
12
|
+
position?: ToastPosition;
|
|
13
|
+
portalProps?: ToastPortalProps;
|
|
14
|
+
};
|
|
15
|
+
export type AnchoredToastProviderProps = Omit<ComponentPropsWithRef<typeof BaseToast.Provider>, "className" | "style"> & {
|
|
16
|
+
portalProps?: ToastPortalProps;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{defineVars}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";// Forced colors keep pressed fills solid system colors in every state.
|
|
2
|
+
export const toggleColors={pressedActiveBackground:"var(--xk9quoq)",pressedBackground:"var(--xbpk6wk)",pressedBorder:"var(--x7rb0cl)",pressedForeground:"var(--x11vuibi)",pressedHoverBackground:"var(--x7gndsj)",__varGroupHash__:"xnoauj1"};
|