@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,17 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
export type CardProps = Omit<useRender.ComponentProps<"div">, "className" | "data-slot" | "style">;
|
|
3
|
+
export type CardHeaderProps = Omit<useRender.ComponentProps<"div">, "className" | "data-slot" | "style">;
|
|
4
|
+
export type CardTitleProps = Omit<useRender.ComponentProps<"div">, "className" | "data-slot" | "style">;
|
|
5
|
+
export type CardDescriptionProps = Omit<useRender.ComponentProps<"div">, "className" | "data-slot" | "style">;
|
|
6
|
+
export type CardActionProps = Omit<useRender.ComponentProps<"div">, "className" | "data-slot" | "style">;
|
|
7
|
+
export type CardPanelProps = Omit<useRender.ComponentProps<"div">, "className" | "data-slot" | "style">;
|
|
8
|
+
export type CardFooterProps = Omit<useRender.ComponentProps<"div">, "className" | "data-slot" | "style">;
|
|
9
|
+
export type CardContentProps = CardPanelProps;
|
|
10
|
+
export declare function Card({ ref: forwardedRef, render, ...rest }: CardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
11
|
+
export declare function CardHeader({ ref: forwardedRef, render, ...rest }: CardHeaderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
12
|
+
export declare function CardTitle({ ref: forwardedRef, render, ...rest }: CardTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
13
|
+
export declare function CardDescription({ ref: forwardedRef, render, ...rest }: CardDescriptionProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
14
|
+
export declare function CardAction({ ref: forwardedRef, render, ...rest }: CardActionProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
15
|
+
export declare function CardPanel({ ref: forwardedRef, render, ...rest }: CardPanelProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
16
|
+
export declare function CardFooter({ ref: forwardedRef, render, ...rest }: CardFooterProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
17
|
+
export { CardPanel as CardContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{mergeProps}from"@base-ui/react/merge-props";import{useRender}from"@base-ui/react/use-render";import{props}from"@stylexjs/stylex";import{protectRenderSlot}from"../../render-utils";import{cardStyles}from"./card.styles";export function Card({ref:forwardedRef,render,...rest}){return useRender({defaultTagName:"div",props:mergeProps(rest,{...props(cardStyles.root),"data-slot":"card"}),ref:forwardedRef,render:protectRenderSlot("card",render)});}export function CardHeader({ref:forwardedRef,render,...rest}){return useRender({defaultTagName:"div",props:mergeProps(rest,{...props(cardStyles.header),"data-slot":"card-header"}),ref:forwardedRef,render:protectRenderSlot("card-header",render)});}export function CardTitle({ref:forwardedRef,render,...rest}){return useRender({defaultTagName:"div",props:mergeProps(rest,{...props(cardStyles.title),"data-slot":"card-title"}),ref:forwardedRef,render:protectRenderSlot("card-title",render)});}export function CardDescription({ref:forwardedRef,render,...rest}){return useRender({defaultTagName:"div",props:mergeProps(rest,{...props(cardStyles.description),"data-slot":"card-description"}),ref:forwardedRef,render:protectRenderSlot("card-description",render)});}export function CardAction({ref:forwardedRef,render,...rest}){return useRender({defaultTagName:"div",props:mergeProps(rest,{...props(cardStyles.action),"data-slot":"card-action"}),ref:forwardedRef,render:protectRenderSlot("card-action",render)});}export function CardPanel({ref:forwardedRef,render,...rest}){return useRender({defaultTagName:"div",props:mergeProps(rest,{...props(cardStyles.panel),"data-slot":"card-panel"}),ref:forwardedRef,render:protectRenderSlot("card-panel",render)});}export function CardFooter({ref:forwardedRef,render,...rest}){return useRender({defaultTagName:"div",props:mergeProps(rest,{...props(cardStyles.footer),"data-slot":"card-footer"}),ref:forwardedRef,render:protectRenderSlot("card-footer",render)});}export{CardPanel as CardContent};
|
|
@@ -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/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,letterSpacing,lineHeight}from"../../styles/typography.stylex";export const cardStyles={action:{kSGwAc:"xamitd3",kB7OPa:"x9f619",kBCFzs:"x1npkx4u",kpJH7q:"xf9r7lm",k1lYIM:"x1agbcgv",kFhvOy:"x1qab1bc",$$css:true},description:{kB7OPa:"x9f619",kMwMTN:"x125omll",kGuDYH:"xlh8hku",k63SB2:"x1lo1l87",kBCFzs:"xgkxs2y",kLWn49:"x2xzzt7",kqGvvJ:"x10im51j",$$css:true},footer:{kGNEyG:"x6s0dn4",kB7OPa:"x9f619",k1xSpc:"x78zum5",kOIVth:"xiw8qbs",kGO01o:"x1i17mcb",kLKAdn:"x1o5c4g5 xrm89jq",kg3NbH:"x9qdlnn",$$css:true},header:{kGNEyG:"x6s0dn4",kB7OPa:"x9f619",k1C7PZ:"xejpt2e",k1xSpc:"xrvj5dj",kOIVth:"x13hh4mm",kumcoG:"xju1xpo",k8WAf4:"x16z3cw9",kg3NbH:"x9qdlnn",$$css:true},panel:{kB7OPa:"x9f619",kMwMTN:"x14tvo57",kzQI83:"x1iyjqo2",k7Eaqz:"xeuugli",kGO01o:"x1i17mcb",kLKAdn:"x1o5c4g5 xrm89jq",kg3NbH:"x9qdlnn",$$css:true},root:{k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kWkggS:"xu84zt7",kaIpWk:"x4ig255",kB7OPa:"x9f619",kMwMTN:"x14tvo57",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x7jjmpn x1wfwxd8",k3XXqK:"x9v5kkp x1t137rt",kMeerF:"xm9seqh x1k57tk5",kVAEAm:"x1n2onr6",kybGjl:"x1hl2dhg",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x6ksxqd",kAMwcw:"xvhdtae",kzqmXN:"xh8yej3",$$css:true},title:{kB7OPa:"x9f619",kMwMTN:"x14tvo57",kGuDYH:"x12ama9c",k63SB2:"xlw70nr",kBCFzs:"xgkxs2y",kb6lSQ:"x15nokgc",kLWn49:"x1rn0pvf",kqGvvJ:"x10im51j",k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",$$css:true}};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
type AccessibleName = {
|
|
4
|
+
"aria-label": string;
|
|
5
|
+
"aria-labelledby"?: never;
|
|
6
|
+
} | {
|
|
7
|
+
"aria-label"?: never;
|
|
8
|
+
"aria-labelledby": string;
|
|
9
|
+
};
|
|
10
|
+
export type CarouselProps = Omit<Closed<ComponentPropsWithRef<"section">>, "aria-label" | "aria-labelledby" | "aria-roledescription" | "children" | "data-slot" | "role"> & AccessibleName & {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export type CarouselContentProps = Omit<Closed<ComponentPropsWithRef<"div">>, "aria-label" | "aria-labelledby" | "aria-roledescription" | "children" | "data-slot" | "role" | "tabIndex"> & {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export type CarouselItemProps = Omit<Closed<ComponentPropsWithRef<"div">>, "aria-roledescription" | "children" | "data-slot" | "role" | "tabIndex"> & {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export type CarouselIndicatorsProps = Omit<Closed<ComponentPropsWithRef<"div">>, "aria-label" | "children" | "data-slot" | "role"> & {
|
|
20
|
+
/** Names the group of slide buttons. Defaults to "Slides". */
|
|
21
|
+
"aria-label"?: string;
|
|
22
|
+
};
|
|
23
|
+
export type CarouselControlProps = Omit<Closed<ComponentPropsWithRef<"button">>, "aria-label" | "children" | "data-slot" | "disabled" | "onClick" | "role" | "type"> & {
|
|
24
|
+
"aria-label"?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function Carousel(carouselProps: CarouselProps): import("react").JSX.Element;
|
|
27
|
+
export declare function CarouselContent(contentProps: CarouselContentProps): import("react").JSX.Element;
|
|
28
|
+
export declare function CarouselItem(itemProps: CarouselItemProps): import("react").JSX.Element;
|
|
29
|
+
/** One button per slide; the current one stretches into a short pill. */
|
|
30
|
+
export declare function CarouselIndicators(indicatorProps: CarouselIndicatorsProps): import("react").JSX.Element;
|
|
31
|
+
export declare function CarouselPrevious(controlProps: CarouselControlProps): import("react").JSX.Element;
|
|
32
|
+
export declare function CarouselNext(controlProps: CarouselControlProps): import("react").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{createContext,useCallback,useContext,useRef,useState}from"react";import{IconChevronLeft,IconChevronRight}from"../../icons";import{assignRef}from"../../ref-utils";import{typeRoles}from"../../styles/typography.styles";import{Button}from"../button/button";import{carouselStyles}from"./carousel.styles";import{jsx as _jsx}from"react/jsx-runtime";const CarouselContext=createContext(null);function useCarouselContext(){const context=useContext(CarouselContext);if(!context){throw new Error("Carousel controls and content must be inside Carousel.");}return context;}function stripReservedProps(value,names){for(const name of names){Reflect.deleteProperty(value,name);}}const EMPTY_STATE={canNext:false,canPrevious:false,count:0,index:0};function sameState(left,right){return left.canNext===right.canNext&&left.canPrevious===right.canPrevious&&left.count===right.count&&left.index===right.index;}function getScrollState(viewport){const track=viewport.firstElementChild;if(!(track?.firstElementChild&&track.lastElementChild)){return EMPTY_STATE;}const{direction}=getComputedStyle(viewport);const viewportBounds=viewport.getBoundingClientRect();const firstBounds=track.firstElementChild.getBoundingClientRect();const lastBounds=track.lastElementChild.getBoundingClientRect();const tolerance=1;const canPrevious=direction==="rtl"?firstBounds.right>viewportBounds.right+tolerance:firstBounds.left<viewportBounds.left-tolerance;const canNext=direction==="rtl"?lastBounds.left<viewportBounds.left-tolerance:lastBounds.right>viewportBounds.right+tolerance;const items=Array.from(track.children);// At the far end the last slide may never reach the start edge, so it counts
|
|
2
|
+
// as current once nothing is left to scroll.
|
|
3
|
+
const index=canNext?getClosestSlideIndex(items,viewportBounds,direction==="rtl"):items.length-1;return{canNext,canPrevious,count:items.length,index};}function scrollToItem(viewport,target){const viewportBounds=viewport.getBoundingClientRect();const targetBounds=target.getBoundingClientRect();const delta=getComputedStyle(viewport).direction==="rtl"?targetBounds.right-viewportBounds.right:targetBounds.left-viewportBounds.left;const reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches;viewport.scrollBy({behavior:reducedMotion?"auto":"smooth",left:delta});}// Mouse drag: browsers scroll on touch and trackpads natively, but not when a
|
|
4
|
+
// mouse drags, so the viewport follows the pointer itself.
|
|
5
|
+
const DRAG_THRESHOLD=5;// Pixels per millisecond: a release faster than this moves one slide.
|
|
6
|
+
const FLICK_VELOCITY=0.3;// A pointer held still this long before release has stopped flicking.
|
|
7
|
+
const FLICK_WINDOW=80;function getSlides(viewport){return Array.from(viewport.firstElementChild?.children??[]);}function isRtl(element){return getComputedStyle(element).direction==="rtl";}function nearestSlide(viewport){return getClosestSlideIndex(getSlides(viewport),viewport.getBoundingClientRect(),isRtl(viewport));}function settleIndex(viewport,drag){const count=getSlides(viewport).length;const nearest=nearestSlide(viewport);if(Math.abs(drag.velocity)<FLICK_VELOCITY){return nearest;}// Pulling content toward the start reveals the next slide.
|
|
8
|
+
const forward=isRtl(viewport)?drag.velocity>0:drag.velocity<0;const target=forward?Math.max(nearest,drag.startIndex+1):Math.min(nearest,drag.startIndex-1);return Math.max(0,Math.min(count-1,target));}// The scroll position that puts a slide on its snap point, clamped to the
|
|
9
|
+
// scroll range (right-to-left positions run negative).
|
|
10
|
+
function snapLeft(viewport,target){const rtl=isRtl(viewport);const viewportBounds=viewport.getBoundingClientRect();const targetBounds=target.getBoundingClientRect();const delta=rtl?targetBounds.right-viewportBounds.right:targetBounds.left-viewportBounds.left;const max=viewport.scrollWidth-viewport.clientWidth;const left=viewport.scrollLeft+delta;return rtl?Math.min(0,Math.max(-max,left)):Math.max(0,Math.min(max,left));}// Eases out from the release, fast first like a throw, and lands exactly on
|
|
11
|
+
// the snap point so restoring snap moves nothing.
|
|
12
|
+
function glide(viewport,to,onDone){const from=viewport.scrollLeft;const distance=to-from;const reduced=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(reduced||Math.abs(distance)<1){viewport.scrollLeft=to;onDone();return()=>undefined;}const duration=Math.min(420,180+Math.abs(distance)*0.35);let startTime=null;let frame=0;const step=now=>{startTime??=now;const progress=Math.min(1,(now-startTime)/duration);viewport.scrollLeft=from+distance*(1-(1-progress)**3);if(progress<1){frame=requestAnimationFrame(step);}else{onDone();}};frame=requestAnimationFrame(step);return()=>cancelAnimationFrame(frame);}// A drag ends with a click on whatever sits under the pointer; swallow it.
|
|
13
|
+
function suppressNextClick(viewport){const swallow=event=>{event.preventDefault();event.stopPropagation();};viewport.addEventListener("click",swallow,{capture:true,once:true});setTimeout(()=>viewport.removeEventListener("click",swallow,true),0);}function trackVelocity(drag,event){const elapsed=event.timeStamp-drag.lastTime;if(elapsed>0){// Averages recent moves so one uneven event cannot decide a flick.
|
|
14
|
+
const sample=(event.clientX-drag.lastX)/elapsed;drag.velocity=drag.velocity*0.4+sample*0.6;}drag.lastTime=event.timeStamp;drag.lastX=event.clientX;}function attachMouseDrag(viewport){let drag=null;let cancelGlide=()=>undefined;const stopGlide=()=>{cancelGlide();viewport.removeAttribute("data-settling");};const onPointerDown=event=>{stopGlide();if(event.pointerType!=="mouse"||event.button!==0){return;}drag={dragging:false,lastTime:event.timeStamp,lastX:event.clientX,startIndex:nearestSlide(viewport),startLeft:viewport.scrollLeft,startX:event.clientX,velocity:0};};const startDragging=(state,event)=>{state.dragging=true;// Counts from here, so content does not jump by the threshold.
|
|
15
|
+
state.startX=event.clientX;viewport.setPointerCapture(event.pointerId);viewport.setAttribute("data-dragging","");window.getSelection()?.removeAllRanges();};const onPointerMove=event=>{const offset=drag?event.clientX-drag.startX:0;if(!drag||!drag.dragging&&Math.abs(offset)<DRAG_THRESHOLD){return;}if(!drag.dragging){startDragging(drag,event);}viewport.scrollLeft=drag.startLeft-(event.clientX-drag.startX);trackVelocity(drag,event);};const onPointerUp=event=>{const state=drag;drag=null;if(!state?.dragging){return;}if(viewport.hasPointerCapture(event.pointerId)){viewport.releasePointerCapture(event.pointerId);}if(event.timeStamp-state.lastTime>FLICK_WINDOW){state.velocity=0;}const target=getSlides(viewport)[settleIndex(viewport,state)];// Snap stays off until the glide lands, so the browser never snaps back.
|
|
16
|
+
viewport.setAttribute("data-settling","");viewport.removeAttribute("data-dragging");suppressNextClick(viewport);cancelGlide=target?glide(viewport,snapLeft(viewport,target),stopGlide):()=>undefined;if(!target){stopGlide();}};// Native image and link dragging would steal the gesture.
|
|
17
|
+
const onDragStart=event=>event.preventDefault();const listeners=[["pointerdown",onPointerDown],["pointermove",onPointerMove],["pointerup",onPointerUp],["pointercancel",onPointerUp],["dragstart",onDragStart],["wheel",stopGlide],["touchstart",stopGlide]];for(const[type,listener]of listeners){viewport.addEventListener(type,listener,{passive:type==="wheel"||type==="touchstart"});}return()=>{stopGlide();for(const[type,listener]of listeners){viewport.removeEventListener(type,listener);}};}function getInlineStartDistance(item,viewportBounds,directionIsRtl){const bounds=item.getBoundingClientRect();return Math.abs(directionIsRtl?viewportBounds.right-bounds.right:bounds.left-viewportBounds.left);}function getClosestSlideIndex(items,viewportBounds,directionIsRtl){let currentIndex=0;let closestDistance=Number.POSITIVE_INFINITY;for(const[index,item]of items.entries()){const distance=getInlineStartDistance(item,viewportBounds,directionIsRtl);if(distance<closestDistance){currentIndex=index;closestDistance=distance;}}return currentIndex;}export function Carousel(carouselProps){const{"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,children,ref:forwardedRef,...rest}=carouselProps;const accessibleName=ariaLabel??ariaLabelledBy;if(!accessibleName?.trim()){throw new TypeError("Carousel requires a non-empty accessible name.");}const[scrollState,setScrollState]=useState(EMPTY_STATE);const viewportElement=useRef(null);const pendingTargetIndex=useRef(null);const registerViewport=useCallback(viewport=>{viewportElement.current=viewport;if(!viewport){return;}const update=()=>{const nextState=getScrollState(viewport);setScrollState(current=>sameState(current,nextState)?current:nextState);};const clearPendingTarget=()=>{pendingTargetIndex.current=null;};const handleKeyDown=event=>{if(event.target===viewport&&["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp"," "].includes(event.key)){clearPendingTarget();}};const resizeObserver=typeof ResizeObserver==="undefined"?undefined:new ResizeObserver(()=>{clearPendingTarget();update();});const mutationObserver=typeof MutationObserver==="undefined"?undefined:new MutationObserver(()=>{clearPendingTarget();update();});const track=viewport.firstElementChild;resizeObserver?.observe(viewport);if(track){resizeObserver?.observe(track);mutationObserver?.observe(track,{childList:true});}viewport.addEventListener("scroll",update,{passive:true});viewport.addEventListener("scrollend",clearPendingTarget);viewport.addEventListener("wheel",clearPendingTarget,{passive:true});viewport.addEventListener("pointerdown",clearPendingTarget);viewport.addEventListener("touchstart",clearPendingTarget,{passive:true});viewport.addEventListener("keydown",handleKeyDown);const detachMouseDrag=attachMouseDrag(viewport);update();return()=>{detachMouseDrag();resizeObserver?.disconnect();mutationObserver?.disconnect();viewport.removeEventListener("scroll",update);viewport.removeEventListener("scrollend",clearPendingTarget);viewport.removeEventListener("wheel",clearPendingTarget);viewport.removeEventListener("pointerdown",clearPendingTarget);viewport.removeEventListener("touchstart",clearPendingTarget);viewport.removeEventListener("keydown",handleKeyDown);if(viewportElement.current===viewport){viewportElement.current=null;}};},[]);const move=useCallback(direction=>{const viewport=viewportElement.current;const track=viewport?.firstElementChild;if(!(viewport&&track)||track.children.length<2){return;}const viewportBounds=viewport.getBoundingClientRect();const directionIsRtl=getComputedStyle(viewport).direction==="rtl";const items=Array.from(track.children);const currentIndex=pendingTargetIndex.current??getClosestSlideIndex(items,viewportBounds,directionIsRtl);const nextIndex=Math.max(0,Math.min(items.length-1,currentIndex+(direction==="next"?1:-1)));const target=items[nextIndex];if(!target){return;}pendingTargetIndex.current=nextIndex;scrollToItem(viewport,target);},[]);const goTo=useCallback(index=>{const viewport=viewportElement.current;const target=viewport?.firstElementChild?.children[index];if(viewport&&target){pendingTargetIndex.current=index;scrollToItem(viewport,target);}},[]);const onNext=useCallback(()=>move("next"),[move]);const onPrevious=useCallback(()=>move("previous"),[move]);stripReservedProps(rest,["aria-roledescription","className","data-slot","role","style"]);return/*#__PURE__*/_jsx(CarouselContext.Provider,{value:{canNext:scrollState.canNext,canPrevious:scrollState.canPrevious,count:scrollState.count,goTo,index:scrollState.index,onNext,onPrevious,registerViewport},children:/*#__PURE__*/_jsx("section",{...rest,"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,"aria-roledescription":"carousel","data-slot":"carousel",ref:forwardedRef,...props(carouselStyles.root,typeRoles.body),children:children})});}export function CarouselContent(contentProps){const{children,ref:forwardedRef,...rest}=contentProps;const{registerViewport}=useCarouselContext();const viewportRef=useCallback(viewport=>{const cleanupViewport=registerViewport(viewport);const cleanupConsumerRef=assignRef(forwardedRef,viewport);if(typeof cleanupViewport!=="function"){return cleanupConsumerRef;}return()=>{cleanupViewport();cleanupConsumerRef?.();};},[forwardedRef,registerViewport]);stripReservedProps(rest,["aria-label","aria-labelledby","aria-roledescription","className","data-slot","role","style","tabIndex"]);return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"carousel-viewport",ref:viewportRef// biome-ignore lint/a11y/noNoninteractiveTabindex: A focusable scroll viewport lets keyboard users scroll the native track.
|
|
18
|
+
,tabIndex:0,...props(carouselStyles.viewport),children:/*#__PURE__*/_jsx("div",{"aria-live":"polite","data-slot":"carousel-track",...props(carouselStyles.track),children:children})});}export function CarouselItem(itemProps){const{children,ref:forwardedRef,...rest}=itemProps;stripReservedProps(rest,["aria-roledescription","className","data-slot","role","style","tabIndex"]);return(/*#__PURE__*/// biome-ignore lint/a11y/useSemanticElements: Each slide is a named group; a fieldset would misrepresent non-form content.
|
|
19
|
+
_jsx("div",{...rest,"aria-roledescription":"slide","data-slot":"carousel-item",ref:forwardedRef,role:"group",...props(carouselStyles.item),children:/*#__PURE__*/_jsx("div",{"data-slot":"carousel-item-surface",...props(carouselStyles.surface),children:children})}));}function CarouselIndicator({count,current,onSelect,slide}){const select=useCallback(()=>onSelect(slide),[onSelect,slide]);return/*#__PURE__*/_jsx("button",{"aria-current":current||undefined,"aria-label":`Slide ${slide+1} of ${count}`,"data-slot":"carousel-indicator",onClick:select,type:"button",...props(carouselStyles.indicator),children:/*#__PURE__*/_jsx("span",{"aria-hidden":"true",...props(carouselStyles.dot)})});}/** One button per slide; the current one stretches into a short pill. */export function CarouselIndicators(indicatorProps){const{"aria-label":ariaLabel="Slides",ref:forwardedRef,...rest}=indicatorProps;const{count,goTo,index}=useCarouselContext();stripReservedProps(rest,["className","data-slot","role","style"]);return(/*#__PURE__*/// biome-ignore lint/a11y/useSemanticElements: a set of slide buttons is a named group, not a form fieldset.
|
|
20
|
+
_jsx("div",{...rest,"aria-label":ariaLabel,"data-slot":"carousel-indicators",ref:forwardedRef,role:"group",...props(carouselStyles.indicators),children:Array.from({length:count},(_,slide)=>/*#__PURE__*/_jsx(CarouselIndicator,{count:count,current:slide===index// biome-ignore lint/suspicious/noArrayIndexKey: a slide's position is its identity here.
|
|
21
|
+
,onSelect:goTo,slide:slide},slide))}));}export function CarouselPrevious(controlProps){const{"aria-label":ariaLabel="Previous slide",ref:forwardedRef,...rest}=controlProps;const{canPrevious,onPrevious}=useCarouselContext();stripReservedProps(rest,["className","data-slot","disabled","onClick","role","style","type"]);return/*#__PURE__*/_jsx(Button,{...rest,"aria-label":ariaLabel,"data-slot":"carousel-previous",disabled:!canPrevious,onClick:onPrevious,ref:forwardedRef,size:"icon",type:"button",variant:"outline",children:/*#__PURE__*/_jsx(Chevron,{direction:"previous"})});}export function CarouselNext(controlProps){const{"aria-label":ariaLabel="Next slide",ref:forwardedRef,...rest}=controlProps;const{canNext,onNext}=useCarouselContext();stripReservedProps(rest,["className","data-slot","disabled","onClick","role","style","type"]);return/*#__PURE__*/_jsx(Button,{...rest,"aria-label":ariaLabel,"data-slot":"carousel-next",disabled:!canNext,onClick:onNext,ref:forwardedRef,size:"icon",type:"button",variant:"outline",children:/*#__PURE__*/_jsx(Chevron,{direction:"next"})});}function Chevron({direction}){const Icon=direction==="next"?IconChevronRight:IconChevronLeft;return/*#__PURE__*/_jsx(Icon,{"aria-hidden":"true",focusable:false,size:16,...props(carouselStyles.icon)});}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{create,keyframes}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";// A slide is full size when snapped and recedes as it scrolls in or out.
|
|
2
|
+
const recede="x1x8sguw-B";// Without scroll timelines the animation would run once and stay shrunk, so it
|
|
3
|
+
// applies only where the browser drives it from scrolling.
|
|
4
|
+
const SCROLL_TIMELINE="@supports (animation-timeline: view())";export const carouselStyles={dot:{kWkggS:"xskty3w x1a1gqr2 x1v0f6ea",kZKoxP:"xols6we",kaIpWk:"x18zih8k",k1xSpc:"x1lliihq",kzqmXN:"xchdy1f x1v4s8kt",kIyJzY:"x1e471i8 x115jf8",k1ekBW:"xjdoy98",kAMwcw:"xvhdtae",$$css:true},icon:{k3aq6I:"x19axjrm x1c071of",$$css:true},indicator:{kGNEyG:"x6s0dn4",kysU6D:"xjyslct",kWkggS:"xjbqb8w",kZKoxP:"xxk0z11",kMzoRj:"xc342km",kkrTdU:"x1ypdohk",k1xSpc:"x3nfvp2",kjj79g:"xl56j7k",kogj98:"x1ghz6dp",k7Eaqz:"x15kz4h8",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x2ssjo2",k3XXqK:"x9v5kkp x1t137rt",kMeerF:"x1vhx2qj",kmVPX3:"x1717udv",kg3NbH:"xdbhxi8",$$css:true},indicators:{kGNEyG:"x6s0dn4",k1xSpc:"x78zum5",kOIVth:"xxhr3t",k7Eaqz:"xeuugli",$$css:true},item:{kB7OPa:"x9f619",kCS8Yb:"x1l7klhg",kzQI83:"x1c4vz4f",kmuXW:"x2lah0s",k7Eaqz:"xeuugli",k5xd4v:"x1bhewko",$$css:true},root:{k7Eaqz:"xeuugli",kzqmXN:"xh8yej3",$$css:true},surface:{k44tkh:"x1cv21op",kWV6AL:"x11r8nx4",kKVMdj:"x1tzfbnl xpqv5wo x1a5igra",kjjejL:"x18nx4y3",kyAemX:"xf4zoo",kZKoxP:"x5yr21d",$$css:true},track:{k1xSpc:"x78zum5",kOIVth:"xiw8qbs",k7Eaqz:"xeuugli",$$css:true},viewport:{k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kaIpWk:"x1pjcqnp",kB7OPa:"x9f619",kkrTdU:"xdctgko x1jm3nie",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x7jjmpn x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"xm9seqh x1vhx2qj",kXHlph:"xw2csxc",kvh3hx:"x7p5m3t",k5wCbM:"x1rohswg",kc424l:"x1qg0tg xhfbhpw",kFalU9:"x1o5wbz4",kfSwDN:"xaspwu4",kzqmXN:"xh8yej3",$$css:true}};
|
|
@@ -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
|
+
export interface CategoryComparisonDatum {
|
|
5
|
+
/** A reference value, such as last year, drawn as a muted bar beside value. */
|
|
6
|
+
comparison?: number;
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
value: number;
|
|
10
|
+
}
|
|
11
|
+
export type CategoryComparisonOrientation = "horizontal" | "vertical";
|
|
12
|
+
export type CategoryComparisonProps = Omit<Closed<ComponentPropsWithRef<"div">>, "aria-label" | "children" | "data-slot" | "role"> & {
|
|
13
|
+
"aria-description"?: string;
|
|
14
|
+
"aria-label": string;
|
|
15
|
+
categories: readonly CategoryComparisonDatum[];
|
|
16
|
+
/** Names the comparison values; required when any category has one. */
|
|
17
|
+
comparisonLabel?: string;
|
|
18
|
+
formatAxisValue?: (value: number) => string;
|
|
19
|
+
formatValue?: (value: number) => string;
|
|
20
|
+
/** Shows the legend below the chart. Turn it off when a card header shows it. */
|
|
21
|
+
legend?: boolean;
|
|
22
|
+
locale?: string;
|
|
23
|
+
/** vertical suits ordered categories such as months. */
|
|
24
|
+
orientation?: CategoryComparisonOrientation;
|
|
25
|
+
seriesLabel: string;
|
|
26
|
+
tone?: ChartSeriesTone;
|
|
27
|
+
/** Draws a track behind each bar showing the full scale. */
|
|
28
|
+
track?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare function CategoryComparison({ "aria-description": ariaDescription, "aria-label": ariaLabel, categories: inputCategories, comparisonLabel, formatAxisValue, formatValue, legend, locale, orientation, ref: forwardedRef, seriesLabel, tone, track, ...rest }: CategoryComparisonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{barX,barY,defineChart,group}from"@tanstack/charts";import{decorative}from"@tanstack/charts/mark/decorative";import{scaleBand}from"@tanstack/charts/scales/band";import{scaleLinear}from"@tanstack/charts/scales/linear";import{tooltip as tooltipFeature}from"@tanstack/charts/tooltip";import{useMemo}from"react";import{colors}from"../../styles/colors.stylex";import{typeRoles}from"../../styles/typography.styles";import{chartColors}from"../chart-frame/chart-colors";import{bandCrosshair}from"../chart-frame/chart-crosshair";import{ChartFrame}from"../chart-frame/chart-frame";import{ChartLegend}from"../chart-legend/chart-legend";import{ChartTooltip}from"../chart-tooltip/chart-tooltip";import{categoryComparisonStyles}from"./category-comparison.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function assertCategory(category,ids){if(typeof category.id!=="string"||!category.id.trim()||typeof category.label!=="string"||!category.label.trim()){throw new TypeError("CategoryComparison categories require non-empty ids and labels.");}if(ids.has(category.id)){throw new RangeError("CategoryComparison category ids must be unique.");}for(const value of[category.value,category.comparison??0]){if(typeof value!=="number"||!Number.isFinite(value)){throw new RangeError("CategoryComparison values must be finite numbers.");}}ids.add(category.id);}function prepareCategories(categories){if(!Array.isArray(categories)){throw new TypeError("CategoryComparison categories must be an array.");}const ids=new Set();let min=0;let max=0;for(const category of categories){assertCategory(category,ids);const comparison=category.comparison??category.value;min=Math.min(min,category.value,comparison);max=Math.max(max,category.value,comparison);}if(!Number.isFinite(max-min)){throw new RangeError("CategoryComparison values exceed a finite chart range.");}return{categories:[...categories],domain:[min,max===min?1:max]};}function assertLabels(ariaLabel,seriesLabel){if(typeof ariaLabel!=="string"||typeof seriesLabel!=="string"||!ariaLabel.trim()||!seriesLabel.trim()){throw new TypeError("CategoryComparison requires non-empty aria-label and seriesLabel values.");}}function assertFormatters(formatValue,formatAxisValue){for(const[name,formatter]of Object.entries({formatAxisValue,formatValue})){if(formatter!==undefined&&typeof formatter!=="function"){throw new TypeError(`CategoryComparison ${name} must be a function.`);}}}function formatNumber(value,formatter,numberFormat,formatterName="formatValue"){const formatted=formatter?formatter(value):numberFormat.format(value);if(typeof formatted!=="string"){throw new TypeError(`CategoryComparison ${formatterName} must return a string.`);}return formatted;}function toRows(categories){return categories.flatMap(({comparison,id,label,value})=>[...(comparison===undefined?[]:[{category:id,id:`${id}:comparison`,label,series:"comparison",value:comparison}]),{category:id,id,label,series:"value",value}]);}function renderTooltip(context,labels,tone,format){const point=context.primaryPoint??context.points[0];if(!point){return null;}const rows=context.points.map(({datum})=>datum).filter(({category})=>category===point.datum.category).sort(left=>left.series==="value"?-1:1);return/*#__PURE__*/_jsx(ChartTooltip,{items:rows.map(row=>({id:row.id,label:row.series==="value"?labels.value:labels.comparison,tone:row.series==="value"?tone:"muted",value:format(row.value)})),label:point.datum.label});}// The focused category keeps full color while the rest recede.
|
|
2
|
+
const RECEDE=[{style:{opacity:0.35},transition:{duration:150,type:"tween"},when:{focus:"unmatched"}}];function barFill(tone){return row=>row.series==="value"?chartColors[tone]:chartColors.muted;}// Bar widths follow BoardUI's proportions: slim, fully rounded pairs when two
|
|
3
|
+
// bars share a slot, wider bars with softer corners when one stands alone.
|
|
4
|
+
function barSize(orientation,grouped){if(grouped){return{radius:5,thickness:10};}return orientation==="vertical"?{radius:8,thickness:28}:{radius:6,thickness:20};}// A full-scale track behind each category, as in a progress bar.
|
|
5
|
+
function getTrack(categories,orientation,{domain,grouped}){const{radius,thickness}=barSize(orientation,grouped);const common={fill:colors.controlSurface,id:"category-comparison-track",key:({id})=>id,maxThickness:grouped?thickness*2+6:thickness,radius:{end:radius}};return decorative(orientation==="vertical"?barY(categories,{...common,x:"id",y1:domain[0],y2:domain[1]}):barX(categories,{...common,x1:domain[0],x2:domain[1],y:"id"}));}function getBars(rows,orientation,{grouped,tone}){const{radius,thickness}=barSize(orientation,grouped);const common={fill:barFill(tone),id:"category-comparison-bars",key:row=>row.id,layout:grouped?group({padding:0.2}):undefined,maxThickness:thickness,radius:{end:radius},states:RECEDE,z:"series"};return orientation==="vertical"?barY(rows,{...common,x:"category",y:"value",y1:0}):barX(rows,{...common,x:"value",x1:0,y:"category"});}function getLegendItems(seriesLabel,tone,comparisonLabel){const items=[{id:"category-comparison-series",label:seriesLabel,tone}];return comparisonLabel===undefined?items:[...items,{id:"category-comparison-comparison",label:comparisonLabel,tone:"muted"}];}function getHeight(orientation,count,grouped){if(orientation==="vertical"){return 200;}return Math.max(240,count*(grouped?64:48)+72);}function CategoryComparisonChart({"aria-description":ariaDescription,"aria-label":ariaLabel,categories,comparisonLabel,domain,formatAxisValue,formatValue,legend,locale,orientation,seriesLabel,tone,track}){const numberFormat=useMemo(()=>new Intl.NumberFormat(locale),[locale]);// Axis ticks default to compact numbers ("13.5K"); tooltips stay exact.
|
|
6
|
+
const axisNumberFormat=useMemo(()=>new Intl.NumberFormat(locale,{maximumFractionDigits:1,notation:"compact"}),[locale]);const format=useMemo(()=>value=>formatNumber(value,formatValue,numberFormat),[formatValue,numberFormat]);const rows=useMemo(()=>toRows(categories),[categories]);const grouped=rows.length>categories.length;const definition=useMemo(()=>{const labels=new Map(categories.map(({id,label})=>[id,label]));// Tracks and the axis share one niced domain, so tracks reach the top tick.
|
|
7
|
+
const tickCount=orientation==="vertical"?4:5;const scale=scaleLinear().domain(domain).nice(tickCount);const[start,end]=scale.domain();const options={domain:[start,end],grouped,tone};const valueScale={axis:{ticks:{count:tickCount,format:value=>formatNumber(value,formatAxisValue??formatValue,axisNumberFormat,formatAxisValue?"formatAxisValue":"formatValue")}},grid:true,scale};const categoryScale={axis:{ticks:{format:id=>labels.get(id)??id}},scale:scaleBand().domain(categories.map(({id})=>id)).paddingInner(0.2).paddingOuter(0.08)};const vertical=orientation==="vertical";return defineChart({marks:[bandCrosshair(vertical?"x":"y"),...(track?[getTrack(categories,orientation,options)]:[]),getBars(rows,orientation,options)],scales:vertical?{x:categoryScale,y:valueScale}:{x:valueScale,y:categoryScale}},{focus:vertical?"group-x":"group-y",// The brand band marks the focused category, so no point ring.
|
|
8
|
+
focusRing:false,tooltip:tooltipFeature});},[categories,domain,formatAxisValue,axisNumberFormat,formatValue,grouped,orientation,rows,tone,track]);const renderTooltipBody=useMemo(()=>context=>renderTooltip(context,{comparison:comparisonLabel,value:seriesLabel},tone,format),[comparisonLabel,format,seriesLabel,tone]);return/*#__PURE__*/_jsxs("div",{"data-slot":"category-comparison-chart",children:[/*#__PURE__*/_jsx(ChartFrame,{"aria-description":ariaDescription,"aria-label":ariaLabel,definition:definition,height:getHeight(orientation,categories.length,grouped),renderTooltipBody:renderTooltipBody,tabIndex:0}),legend?/*#__PURE__*/_jsx("div",{"data-slot":"category-comparison-legend",...props(categoryComparisonStyles.legend),children:/*#__PURE__*/_jsx(ChartLegend,{"aria-label":`${seriesLabel} series`,items:getLegendItems(seriesLabel,tone,grouped?comparisonLabel:undefined)})}):null]});}function assertLocaleAndTone(locale,tone){if(typeof locale!=="string"||!locale.trim()){throw new TypeError("CategoryComparison locale must be a non-empty string.");}if(!Object.hasOwn(chartColors,tone)){throw new RangeError("CategoryComparison tone is not supported.");}// Throws a RangeError for an unknown locale.
|
|
9
|
+
new Intl.NumberFormat(locale).format(0);}function assertComparisonOptions(categories,comparisonLabel,orientation){if(orientation!=="horizontal"&&orientation!=="vertical"){throw new RangeError("CategoryComparison orientation must be 'horizontal' or 'vertical'.");}const hasComparison=Array.isArray(categories)&&categories.some(({comparison})=>comparison!==undefined);if(hasComparison&&(typeof comparisonLabel!=="string"||!comparisonLabel.trim())){throw new TypeError("CategoryComparison requires a comparisonLabel when categories have comparison values.");}}export function CategoryComparison({"aria-description":ariaDescription,"aria-label":ariaLabel,categories:inputCategories,comparisonLabel,formatAxisValue,formatValue,legend=true,locale="en-US",orientation="horizontal",ref:forwardedRef,seriesLabel,tone="series1",track=false,...rest}){assertLabels(ariaLabel,seriesLabel);assertFormatters(formatValue,formatAxisValue);assertComparisonOptions(inputCategories,comparisonLabel,orientation);assertLocaleAndTone(locale,tone);const{categories,domain}=useMemo(()=>prepareCategories(inputCategories),[inputCategories]);for(const name of["aria-label","children","className","data-slot","role","style"]){Reflect.deleteProperty(rest,name);}return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"category-comparison",ref:forwardedRef,...props(categoryComparisonStyles.root),children:categories.length===0?/*#__PURE__*/_jsx("p",{"aria-label":ariaLabel,role:"status",...props(typeRoles.body,categoryComparisonStyles.empty),children:"No categories available."}):/*#__PURE__*/_jsx(CategoryComparisonChart,{"aria-description":ariaDescription,"aria-label":ariaLabel,categories:categories,comparisonLabel:comparisonLabel,domain:domain,formatAxisValue:formatAxisValue,formatValue:formatValue,legend:legend,locale:locale,orientation:orientation,seriesLabel:seriesLabel,tone:tone,track:track})});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const categoryComparisonStyles={empty:{kqGvvJ:"x10im51j",$$css:true},legend:{keoZOQ:"x1fynrwi",$$css:true},root:{k7Eaqz:"xeuugli",$$css:true}};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// SVG arc paths for ring charts. Angles are in turns: 0 is twelve o'clock and
|
|
2
|
+
// values grow clockwise, so 0.25 is three o'clock.
|
|
3
|
+
// Server and browser math can differ in the last digit; thousandths keep the
|
|
4
|
+
// path identical on both sides, far below a pixel.
|
|
5
|
+
const round=value=>Math.round(value*1000)/1000;function point(cx,cy,radius,turn){const angle=turn*2*Math.PI;return[round(cx+radius*Math.sin(angle)),round(cy-radius*Math.cos(angle))];}export function arcPath(cx,cy,radius,start,end){// A full turn needs two half arcs; one arc cannot start and end on a point.
|
|
6
|
+
// They share one subpath, so a dash runs on across the seam.
|
|
7
|
+
if(end-start>=1){const[x,y]=point(cx,cy,radius,start);return`${arcPath(cx,cy,radius,start,start+0.5)} A${radius},${radius} 0 0 1 ${x},${y}`;}const[x1,y1]=point(cx,cy,radius,start);const[x2,y2]=point(cx,cy,radius,end);const large=end-start>0.5?1:0;return`M${x1},${y1} A${radius},${radius} 0 ${large} 1 ${x2},${y2}`;}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{chartColors}from"./chart-colors";// Shared input checks for chart components; messages name the component.
|
|
2
|
+
export function assertAriaLabel(component,ariaLabel){if(typeof ariaLabel!=="string"||!ariaLabel.trim()){throw new TypeError(`${component} requires a non-empty aria-label.`);}}/** Checks a non-empty id and label, and that the id is new to `ids`. */export function assertIdentity(component,item,ids){const{id,label}=item;if(typeof id!=="string"||!id.trim()||typeof label!=="string"||!label.trim()){throw new TypeError(`${component} items need non-empty ids and labels.`);}if(ids.has(id)){throw new RangeError(`${component} ids must be unique.`);}ids.add(id);}export function assertNonNegative(component,value){if(typeof value!=="number"||!Number.isFinite(value)||value<0){throw new RangeError(`${component} values must be finite and not negative.`);}}export function assertTone(component,tone){if(tone!==undefined&&!Object.hasOwn(chartColors,tone)){throw new RangeError(`${component} tone is not a supported chart tone.`);}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const chartColors: {
|
|
2
|
+
readonly muted: import("@stylexjs/stylex").StyleXVar<string>;
|
|
3
|
+
readonly series1: import("@stylexjs/stylex").StyleXVar<string>;
|
|
4
|
+
readonly series2: import("@stylexjs/stylex").StyleXVar<string>;
|
|
5
|
+
readonly series3: import("@stylexjs/stylex").StyleXVar<string>;
|
|
6
|
+
readonly series4: import("@stylexjs/stylex").StyleXVar<string>;
|
|
7
|
+
readonly series5: import("@stylexjs/stylex").StyleXVar<string>;
|
|
8
|
+
readonly series6: import("@stylexjs/stylex").StyleXVar<string>;
|
|
9
|
+
};
|
|
10
|
+
export type ChartSeriesTone = keyof typeof chartColors;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{colors}from"../../styles/colors.stylex";export const chartColors={// Reference series such as last year: a dashed line or quieter bars.
|
|
2
|
+
muted:colors.chartReference,series1:colors.chartSeries1,series2:colors.chartSeries2,series3:colors.chartSeries3,series4:colors.chartSeries4,series5:colors.chartSeries5,series6:colors.chartSeries6};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{crosshair}from"@tanstack/charts";import{resolveCrosshairGuide}from"@tanstack/charts/crosshair";import{colors}from"../../styles/colors.stylex";import{mizenAxisLabels,mizenTickGap}from"./chart-frame";// Mizen's focus guides wear the brand: a wine rule whose time label sits in a
|
|
2
|
+
// wine pill on the axis, and a lavender band behind the focused category.
|
|
3
|
+
const PILL_PADDING_X=8;const PILL_HEIGHT=18;// Tabular digits and short month names average a bit over half an em.
|
|
4
|
+
const CHARACTER_WIDTH=0.58;function isAxisLabel(node){return node.kind==="label"&&(node.className??"").includes("crosshair-label--x");}/** Puts a rounded wine pill behind the focused time label. */function withPill(node){if(node?.kind!=="group"){return node;}const children=node.children.flatMap(child=>{if(!isAxisLabel(child)){return[withPill(child)??child];}const fontSize=child.fontSize??mizenAxisLabels.fontSize;const width=child.text.length*fontSize*CHARACTER_WIDTH+PILL_PADDING_X*2;const center=child.y-fontSize*0.35;return[{height:PILL_HEIGHT,key:`${child.key}:pill`,kind:"rect",radius:PILL_HEIGHT/2,style:{fill:colors.brandForeground},width,x:child.x-width/2,y:center-PILL_HEIGHT/2},{...child,style:{...child.style,fill:colors.surface}}];});return{...node,children};}function pillCrosshair(mark){return{...mark,initialize:context=>{const initialized=mark.initialize(context);return{...initialized,render:renderContext=>{const scene=initialized.render(renderContext);return{...scene,focusGuides:scene.focusGuides?.map(guide=>({...guide,resolve:resolveContext=>withPill(resolveCrosshairGuide(resolveContext))}))};}};}};}// A tick closer than this to the focused time would show through the pill.
|
|
5
|
+
const PILL_CLEARANCE=40;/** Tick label options that hide the ticks under the focus pill while it shows. */export const pillTickLabels={opacity:({focus,position})=>focus&&Math.abs(position-focus.primary.x)<PILL_CLEARANCE?0:undefined};/** A vertical rule at the focused time, labeled in a pill on the x axis. */export function timeCrosshair(format){return pillCrosshair(crosshair({x:{// The pill covers the gray tick under it, so the label reads alone.
|
|
6
|
+
label:{fill:colors.surface,fillOpacity:1,fontSize:mizenAxisLabels.fontSize,fontWeight:mizenAxisLabels.fontWeight,format,offset:mizenTickGap,strokeWidth:0},stroke:colors.brandForeground,strokeOpacity:0.4,strokeWidth:1},y:false}));}/** A soft band behind the focused category, drawn under the bars. */export function bandCrosshair(axis){const band={band:{fill:colors.brandBackground,fillOpacity:1,inset:-4,radius:8},label:false};return crosshair(axis==="x"?{x:band,y:false}:{x:false,y:band});}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{visuallyHiddenStyles}from"../visually-hidden/visually-hidden.styles";/**
|
|
2
|
+
* A chart's exact values as a table for assistive technology. It stays out of
|
|
3
|
+
* sight: sighted readers get the same values from tooltips and keyboard focus.
|
|
4
|
+
*/import{jsx as _jsx}from"react/jsx-runtime";export function ChartDataTable({children}){return/*#__PURE__*/_jsx("div",{"data-slot":"chart-data",...props(visuallyHiddenStyles.root),children:children});}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ChartValue } from "@tanstack/charts";
|
|
2
|
+
import { type ChartProps } from "@tanstack/charts/react/tooltip";
|
|
3
|
+
import type { Closed } from "../../closed";
|
|
4
|
+
type ChartSizing = {
|
|
5
|
+
aspectRatio?: never;
|
|
6
|
+
height?: number;
|
|
7
|
+
} | {
|
|
8
|
+
aspectRatio: number;
|
|
9
|
+
height?: never;
|
|
10
|
+
};
|
|
11
|
+
export declare const mizenAxisLabels: {
|
|
12
|
+
fontSize: number;
|
|
13
|
+
fontWeight: number;
|
|
14
|
+
opacity: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const mizenTickGap = 4;
|
|
17
|
+
export type ChartFrameProps<TDatum = unknown, TXValue extends ChartValue = ChartValue, TYValue extends ChartValue = ChartValue> = Omit<Closed<ChartProps<TDatum, TXValue, TYValue>>, "ariaDescription" | "ariaLabel" | "aspectRatio" | "height" | "initialWidth" | "measureText" | "onRender" | "renderSvg" | "width"> & ChartSizing & {
|
|
18
|
+
/** Extra context for assistive tech, after the name. */
|
|
19
|
+
"aria-description"?: string;
|
|
20
|
+
"aria-label": string;
|
|
21
|
+
initialWidth?: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function ChartFrame<TDatum = unknown, TXValue extends ChartValue = ChartValue, TYValue extends ChartValue = ChartValue>({ "aria-description": ariaDescription, "aria-label": ariaLabel, aspectRatio, definition, height, initialWidth, idPrefix, onFocusChange, onFocusGroupChange, onSelect, renderTooltipBody, tabIndex, }: ChartFrameProps<TDatum, TXValue, TYValue>): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{Chart as TanStackChart}from"@tanstack/charts/react/tooltip";import{useMemo}from"react";import{colors}from"../../styles/colors.stylex";import{chartFrameStyles}from"./chart-frame.styles";import{jsx as _jsx}from"react/jsx-runtime";const mizenTheme={foreground:colors.content,grid:colors.border,muted:colors.mutedContent};// TanStack chart option in px, matching the caption role.
|
|
2
|
+
// eslint-disable-next-line no-restricted-syntax -- a charts API value, not CSS.
|
|
3
|
+
export const mizenAxisLabels={fontSize:12,fontWeight:400,opacity:1};// Gap between the plot and x tick labels, in px; overlays on a tick reuse it.
|
|
4
|
+
export const mizenTickGap=4;const mizenGrid={stroke:colors.controlSurface,strokeDasharray:"4 4",// The engine fades grids to 0.11 by default; the track color is quiet enough.
|
|
5
|
+
strokeOpacity:1,strokeWidth:1};function withMizenAxisLabel(label){if(typeof label==="string"){return{...mizenAxisLabels,text:label};}return label===undefined?undefined:{...mizenAxisLabels,...label};}function requireChartLabel(ariaLabel){if(typeof ariaLabel!=="string"||!ariaLabel.trim()){throw new TypeError("ChartFrame requires a non-empty aria-label.");}}function requirePositiveFinite(value,name){if(!Number.isFinite(value)||value<=0){throw new RangeError(`${name} must be a finite number greater than zero.`);}}function withMizenAxisDefaults(scale){if(scale===null){return null;}const{axis,...scaleProps}=scale;if(axis===false){return scale;}const{label,ticks,tickLabels,line,...axisProps}=axis??{};return{...scaleProps,axis:{...axisProps,label:withMizenAxisLabel(label),line:line??false,tickLabels:tickLabels===false?false:{...mizenAxisLabels,...tickLabels},ticks:ticks===false?false:{padding:mizenTickGap,size:0,...ticks}},// Grid lines are quiet dashes, so they guide the eye without boxing data.
|
|
6
|
+
grid:scaleProps.grid===true?mizenGrid:scaleProps.grid};}function withMizenSpec(spec){// Object.fromEntries widens keys; this transform keeps every original scale key.
|
|
7
|
+
const scales=Object.fromEntries(Object.entries(spec.scales).map(([name,scale])=>[name,withMizenAxisDefaults(scale)]));return{...spec,scales,theme:{...mizenTheme,...spec.theme}};}function withMizenTheme(definition){if("chart"in definition){return{...definition,chart:context=>withMizenSpec(definition.chart(context))};}return withMizenSpec(definition);}function styleChartPlot({svg}){const{className}=props(chartFrameStyles.plot);if(className){svg.classList.add(...className.split(" "));}}export function ChartFrame({"aria-description":ariaDescription,"aria-label":ariaLabel,aspectRatio,definition,height,initialWidth=896,idPrefix,onFocusChange,onFocusGroupChange,onSelect,renderTooltipBody,tabIndex}){requireChartLabel(ariaLabel);requirePositiveFinite(initialWidth,"initialWidth");if(aspectRatio!==undefined&&height!==undefined){throw new TypeError("ChartFrame accepts either height or aspectRatio, not both.");}if(aspectRatio!==undefined){requirePositiveFinite(aspectRatio,"aspectRatio");}if(height!==undefined){requirePositiveFinite(height,"height");}const themedDefinition=useMemo(()=>withMizenTheme(definition),[definition]);return/*#__PURE__*/_jsx("div",{"data-slot":"chart-frame",...props(chartFrameStyles.frame,renderTooltipBody&&chartFrameStyles.customTooltip),children:/*#__PURE__*/_jsx(TanStackChart,{ariaDescription:ariaDescription,ariaLabel:ariaLabel,aspectRatio:aspectRatio,definition:themedDefinition,height:aspectRatio===undefined?height??320:undefined,idPrefix:idPrefix,initialWidth:initialWidth,onFocusChange:onFocusChange,onFocusGroupChange:onFocusGroupChange,onRender:styleChartPlot,onSelect:onSelect,renderTooltipBody:renderTooltipBody,tabIndex:tabIndex})});}
|
|
@@ -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";export const chartFrameStyles={customTooltip:{"--ts-chart-tooltip-background":"xqkcryx","--ts-chart-tooltip-border":"xcbs2gc","--ts-chart-tooltip-padding":"xahq67p","--ts-chart-tooltip-shadow":"xioejq8",$$css:true},frame:{"--ts-chart-1":"x1gv1gpe","--ts-chart-2":"xm3pms3","--ts-chart-3":"x1omnh8i","--ts-chart-4":"x9w93sn","--ts-chart-5":"x1jyfi9a","--ts-chart-6":"xsrw3im","--ts-chart-crosshair-label-halo":"x1sguto8","--ts-chart-tooltip-background":"xete8um","--ts-chart-tooltip-border":"x1dptq7k","--ts-chart-tooltip-color":"x194wv71",kWkggS:"xjbqb8w",kMwMTN:"x14tvo57",kMv6JI:"xjb2p0i",kcqcaj:"xss6m8b",k7Eaqz:"xeuugli",kzqmXN:"xh8yej3",$$css:true},plot:{k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kjBf7l:"x12acm8b x1egkn3r",kInvED:"x1w1ofmy",k3XXqK:"x9v5kkp x1t137rt",kMeerF:"x1vhx2qj",$$css:true}};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";import{create,props}from"@stylexjs/stylex";import{useCallback,useRef,useState}from"react";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/motion.stylex";import{duration}from"../../styles/motion.stylex";import{space}from"../../styles/spacing.stylex";import{ChartTooltip}from"../chart-tooltip/chart-tooltip";// Hover for charts drawn without the chart engine: the hovered item stays at
|
|
2
|
+
// full strength while the rest recede, and a tooltip follows the pointer.
|
|
3
|
+
import{jsx as _jsx}from"react/jsx-runtime";const _temp={k87sOh:"x5mnzd7",kfzvcC:"x47corl",kVAEAm:"x10l6tqk",k3aq6I:"xsqj5wx",kzqmXN:"xezivpi",kY2c9j:"x1vjfegm","$$css":true};const styles={dim:{kSiTet:"xuzhngd",$$css:true},host:{kVAEAm:"x1n2onr6",$$css:true},mark:{kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x19991ni",$$css:true},tip:(x,y,flip)=>[_temp,{kLqNvP:x!=null?"x1lxsm33":x,$$css:true},{"--x-insetBlockStart":(val=>typeof val==="number"?val+"px":val!=null?val:undefined)(y),"--x-insetInlineStart":(val=>typeof val==="number"?val+"px":val!=null?val:undefined)(x),"--x-transform":(flip?`translate(calc(-100% - ${space["3"]}), -50%)`:`translate(${space["3"]}, -50%)`)!=null?flip?`translate(calc(-100% - ${space["3"]}), -50%)`:`translate(${space["3"]}, -50%)`:undefined}]};export function useChartHover(){const hostRef=useRef(null);const[hover,setHover]=useState(null);const[linked,setLinked]=useState(null);/** Pointer handlers for a mark: hovering shows its tooltip. */const markProps=useCallback((id,tip)=>({onPointerLeave:()=>setHover(null),onPointerMove:event=>{const box=hostRef.current?.getBoundingClientRect();if(!box){return;}const x=event.clientX-box.left;setHover({flip:x>box.width/2,id,tip,x,y:event.clientY-box.top});}}),[]);/** Pointer handlers for a legend tile or row: hovering highlights its mark. */const linkProps=useCallback(id=>({onPointerEnter:()=>setLinked(id),onPointerLeave:()=>setLinked(null)}),[]);const active=hover?.id??linked;/** StyleX styles for a mark or tile: it recedes while another item is active. */const fade=useCallback(id=>[styles.mark,active!==null&&active!==id&&styles.dim],[active]);return{active,fade,hostRef,hostStyle:styles.host,hover,linkProps,markProps};}export function ChartHoverTooltip({hover}){if(!hover?.tip){return null;}return/*#__PURE__*/_jsx("div",{"aria-hidden":"true",...props(styles.tip(hover.x,hover.y,hover.flip)),children:/*#__PURE__*/_jsx(ChartTooltip,{items:hover.tip.items,label:hover.tip.label})});}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Whether a chart's data is still on its way. */
|
|
2
|
+
export type ChartStatus = "loading" | "ready";
|
|
3
|
+
/** The plot of a chart whose data replaced its loading state wipes in. */
|
|
4
|
+
export declare const chartRevealStyles: Readonly<{
|
|
5
|
+
readonly reveal: Readonly<{
|
|
6
|
+
readonly animationDuration: import("@stylexjs/stylex").StyleXClassNameFor<"animationDuration", string>;
|
|
7
|
+
readonly animationFillMode: import("@stylexjs/stylex").StyleXClassNameFor<"animationFillMode", "both">;
|
|
8
|
+
readonly animationName: import("@stylexjs/stylex").StyleXClassNameFor<"animationName", string>;
|
|
9
|
+
readonly animationTimingFunction: import("@stylexjs/stylex").StyleXClassNameFor<"animationTimingFunction", string>;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* True once data arrives after a loading state, so the plot can reveal. A
|
|
14
|
+
* chart that starts ready shows at once. State updates during render, so no
|
|
15
|
+
* effect is needed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useLoadingReveal(status: ChartStatus): boolean;
|
|
18
|
+
/** A placeholder at the chart's own height while its data loads. */
|
|
19
|
+
export declare function ChartLoading({ grid, height, }: {
|
|
20
|
+
grid?: boolean;
|
|
21
|
+
height: number;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";import{create,keyframes,props}from"@stylexjs/stylex";import{useState}from"react";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";import{visuallyHiddenStyles}from"../visually-hidden/visually-hidden.styles";/** Whether a chart's data is still on its way. */import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const pulse="x1fmqiw-B";const wipe="xstdwuj-B";const wipeRtl="x1q2us3n-B";const fade="x18re5ia-B";const _temp={kZKoxP:"xyq6l7l",kVAEAm:"x1n2onr6","$$css":true};const styles={frame:height=>[_temp,{"--x-blockSize":(val=>typeof val==="number"?val+"px":val!=null?val:undefined)(height)}]};/** The plot of a chart whose data replaced its loading state wipes in. */export const chartRevealStyles={reveal:{k44tkh:"x1dselbi xof6966",kWV6AL:"x1u6ievf",kKVMdj:"x1ewgin x1j6fro6 xhnadnh",kyAemX:"xc8zlda",$$css:true}};/**
|
|
2
|
+
* True once data arrives after a loading state, so the plot can reveal. A
|
|
3
|
+
* chart that starts ready shows at once. State updates during render, so no
|
|
4
|
+
* effect is needed.
|
|
5
|
+
*/export function useLoadingReveal(status){const[sawLoading,setSawLoading]=useState(status==="loading");if(status==="loading"&&!sawLoading){setSawLoading(true);}return sawLoading&&status==="ready";}// A gentle rise across the plot reads as a chart without implying values.
|
|
6
|
+
const LINE="M0 30 C15 26 25 20 40 22 S65 12 80 14 S95 8 100 9";const AREA=`${LINE} L100 40 L0 40 Z`;const GRID_ROWS=[4,16,28,40];/** A placeholder at the chart's own height while its data loads. */export function ChartLoading({grid=true,height}){return/*#__PURE__*/_jsxs("div",{"data-slot":"chart-loading",role:"status",...props(styles.frame(height)),children:[/*#__PURE__*/_jsxs("svg",{"aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 100 40",...{className:"x5yr21d x1lliihq xh8yej3"},children:[grid?GRID_ROWS.map(y=>/*#__PURE__*/_jsx("line",{strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke",x1:"0",x2:"100",y1:y,y2:y,...{className:"x1uw5a2j xdb72bg"}},y)):null,/*#__PURE__*/_jsxs("g",{...{className:"x18hd8ej xa4qsjk x1tzfbnl x1qorlz2 x16mm3sk"},children:[/*#__PURE__*/_jsx("path",{d:AREA,...{className:"x1457vic x1azhm0p"}}),/*#__PURE__*/_jsx("path",{d:LINE,strokeWidth:2,vectorEffect:"non-scaling-stroke",...{className:"xbh8q5q x1uw5a2j x1bsw5e1"}})]})]}),/*#__PURE__*/_jsx("span",{...props(visuallyHiddenStyles.root),children:"Loading chart"})]});}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{create,props}from"@stylexjs/stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";import{arcPath}from"./arc-path";import{chartColors}from"./chart-colors";/** Optional hover wiring from `useChartHover`. */import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";// The track is the ring's own hue, quiet enough that the fill reads first.
|
|
2
|
+
const TRACK_OPACITY=0.18;/**
|
|
3
|
+
* Concentric rounded arcs, outermost first, each over a track of the same
|
|
4
|
+
* hue. `sweep` is how much of the circle a full track covers, in turns.
|
|
5
|
+
*/export function RingGraphic({diameter,gap,hover,rings,stroke,sweep=1}){const center=diameter/2;return/*#__PURE__*/_jsx("svg",{"aria-hidden":"true",height:diameter,viewBox:`0 0 ${diameter} ${diameter}`,width:diameter,...{className:"x1lliihq x2lah0s x1rea2x4"},children:rings.map(({fraction,id,tone},index)=>{const radius=center-stroke/2-index*(stroke+gap);const color=chartColors[tone];const fill=Math.min(Math.max(fraction,0),1)*sweep;return/*#__PURE__*/_jsxs("g",{fill:"none",strokeLinecap:"round",strokeWidth:stroke,...hover?.markProps(id),...(hover?props(...hover.fade(id)):null),children:[/*#__PURE__*/_jsx("path",{d:arcPath(center,center,radius,0,sweep),stroke:color,strokeOpacity:TRACK_OPACITY}),/*#__PURE__*/_jsx("path",{d:arcPath(center,center,radius,0,sweep),opacity:fill>0?1:0,pathLength:sweep,stroke:color,strokeDasharray:`${fill} ${sweep+1}`,...{className:"x1e471i8 x115jf8 xvfbvx2 xvhdtae"}})]},id);})});}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
import type { ChartSeriesTone } from "../chart-frame/chart-colors";
|
|
4
|
+
export interface ChartLegendItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
tone: ChartSeriesTone;
|
|
8
|
+
/** A total or current value shown after the label, such as "50,500". */
|
|
9
|
+
value?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export type ChartLegendProps = Omit<Closed<ComponentPropsWithRef<"ul">>, "aria-label" | "children" | "data-slot" | "role"> & {
|
|
12
|
+
"aria-label": string;
|
|
13
|
+
items: readonly ChartLegendItem[];
|
|
14
|
+
/** tiles shows each item as a tile with its value below the label. */
|
|
15
|
+
variant?: ChartLegendVariant;
|
|
16
|
+
};
|
|
17
|
+
export type ChartLegendVariant = "inline" | "tiles";
|
|
18
|
+
export declare function ChartLegend({ "aria-label": ariaLabel, items, ref: forwardedRef, variant, ...rest }: ChartLegendProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{controlLabel}from"../../control-label";import{typeRoles}from"../../styles/typography.styles";import{chartLegendStyles,chartLegendSwatches}from"./chart-legend.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function protectProps(attributes){for(const name of["aria-label","children","className","data-slot","role","style"]){Reflect.deleteProperty(attributes,name);}}function assertUniqueIds(items){if(new Set(items.map(({id})=>id)).size!==items.length){throw new TypeError("ChartLegend item ids must be unique.");}}export function ChartLegend({"aria-label":ariaLabel,items,ref:forwardedRef,variant="inline",...rest}){if(typeof ariaLabel!=="string"||!ariaLabel.trim()){throw new TypeError("ChartLegend requires a non-empty aria-label.");}protectProps(rest);assertUniqueIds(items);const tiles=variant==="tiles";return/*#__PURE__*/_jsx("ul",{...rest,"aria-label":ariaLabel,"data-slot":"chart-legend",ref:forwardedRef,...props(chartLegendStyles.root,tiles?chartLegendStyles.tiles:chartLegendStyles.list,typeRoles.ui),children:items.map(({id,label,tone,value})=>/*#__PURE__*/_jsxs("li",{"data-slot":"chart-legend-item",...props(tiles?chartLegendStyles.tile:chartLegendStyles.item),children:[/*#__PURE__*/_jsxs("span",{...props(chartLegendStyles.name),children:[/*#__PURE__*/_jsx("span",{"aria-hidden":"true","data-slot":"chart-legend-swatch",...props(chartLegendStyles.swatch,tiles&&chartLegendStyles.tileSwatch,chartLegendSwatches[tone])}),controlLabel(label)]}),value===undefined?null:/*#__PURE__*/_jsx("span",{"data-slot":"chart-legend-value",...props(chartLegendStyles.value,tiles&&chartLegendStyles.tileValue),children:value})]},id))});}
|
|
@@ -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";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontWeight}from"../../styles/typography.stylex";export const chartLegendSwatches={muted:{kWkggS:"x7txf9a",$$css:true},series1:{kWkggS:"xweh944",$$css:true},series2:{kWkggS:"x1tq06y8",$$css:true},series3:{kWkggS:"xmol5ik",$$css:true},series4:{kWkggS:"x1va1726",$$css:true},series5:{kWkggS:"x1pk9x1i",$$css:true},series6:{kWkggS:"x1mqk7k3",$$css:true}};export const chartLegendStyles={item:{kGNEyG:"x6s0dn4",k1xSpc:"x78zum5",kOIVth:"xp4ho6d",ks0D6T:"x193iq5w",k7Eaqz:"xeuugli",$$css:true},list:{k1C7PZ:"xejpt2e",k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kB88ic:"xe8uvvx",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",khm7nJ:"xfk3ji1",$$css:true},name:{kGNEyG:"x6s0dn4",k1xSpc:"x78zum5",kOIVth:"xp4ho6d",k7Eaqz:"xeuugli",$$css:true},root:{kMwMTN:"x125omll",k63SB2:"xuku2lm",k7Eaqz:"xeuugli",$$css:true},swatch:{kZKoxP:"xols6we",kaIpWk:"x1e6avla",kmuXW:"x2lah0s",kzqmXN:"x1v4s8kt",$$css:true},tile:{kWkggS:"xwn18cz",kaIpWk:"x42tf2m",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",k8WAf4:"x391bbb",kg3NbH:"xy7odpl",$$css:true},tileSwatch:{kZKoxP:"x1kpxq89",kaIpWk:"x12oqio5",kzqmXN:"xsmyaan",$$css:true},tiles:{k1xSpc:"xrvj5dj",kOIVth:"xp4ho6d",kumcoG:"x1cmj9de",kB88ic:"xe8uvvx",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",$$css:true},tileValue:{keTefX:"x1lziwak",$$css:true},value:{kMwMTN:"x14tvo57",kcqcaj:"xss6m8b",k63SB2:"xuku2lm",keTefX:"xi4je3c",$$css:true}};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
import type { ChartSeriesTone } from "../chart-frame/chart-colors";
|
|
4
|
+
export interface ChartTooltipItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
tone: ChartSeriesTone;
|
|
8
|
+
value: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export type ChartTooltipProps = Omit<Closed<ComponentPropsWithRef<"div">>, "children" | "data-slot" | "role"> & {
|
|
11
|
+
items: readonly ChartTooltipItem[];
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare function ChartTooltip({ items, label, ref: forwardedRef, ...rest }: ChartTooltipProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{typeRoles}from"../../styles/typography.styles";import{chartTooltipStyles,chartTooltipSwatches}from"./chart-tooltip.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function protectProps(attributes){for(const name of["children","className","data-slot","role","style"]){Reflect.deleteProperty(attributes,name);}}function assertUniqueIds(items){if(new Set(items.map(({id})=>id)).size!==items.length){throw new TypeError("ChartTooltip item ids must be unique.");}}export function ChartTooltip({items,label,ref:forwardedRef,...rest}){protectProps(rest);if(items.length===0){return null;}assertUniqueIds(items);return/*#__PURE__*/_jsxs("div",{...rest,"data-slot":"chart-tooltip",ref:forwardedRef,...props(chartTooltipStyles.root,typeRoles.ui),children:[label===null||label===undefined?null:/*#__PURE__*/_jsx("p",{"data-slot":"chart-tooltip-label",...props(chartTooltipStyles.label),children:label}),/*#__PURE__*/_jsx("dl",{"data-slot":"chart-tooltip-rows",...props(chartTooltipStyles.rows),children:items.map(({id,label:itemLabel,tone,value})=>/*#__PURE__*/_jsxs("div",{"data-slot":"chart-tooltip-row",...props(chartTooltipStyles.row),children:[/*#__PURE__*/_jsxs("dt",{"data-slot":"chart-tooltip-term",...props(chartTooltipStyles.term),children:[/*#__PURE__*/_jsx("span",{"aria-hidden":"true","data-slot":"chart-tooltip-swatch",...props(chartTooltipStyles.swatch,chartTooltipSwatches[tone])}),itemLabel]}),/*#__PURE__*/_jsx("dd",{"data-slot":"chart-tooltip-value",...props(chartTooltipStyles.value),children:value})]},id))})]});}
|
|
@@ -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/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{fontWeight}from"../../styles/typography.stylex";export const chartTooltipSwatches={muted:{kWkggS:"x7txf9a",$$css:true},series1:{kWkggS:"xweh944",$$css:true},series2:{kWkggS:"x1tq06y8",$$css:true},series3:{kWkggS:"xmol5ik",$$css:true},series4:{kWkggS:"x1va1726",$$css:true},series5:{kWkggS:"x1pk9x1i",$$css:true},series6:{kWkggS:"x1mqk7k3",$$css:true}};export const chartTooltipStyles={label:{k63SB2:"xlw70nr",kogj98:"x1ghz6dp",$$css:true},root:{kWkggS:"xui3q9s",kVAM5u:"x1l55r2k x155xxfk",kaIpWk:"x2b34ud",ksu8eU:"x1y0btm7",kMzoRj:"xmkeg23",kGVxlE:"x1mhlhek",kMwMTN:"x14tvo57",k1xSpc:"xrvj5dj",kOIVth:"xp4ho6d",k7Eaqz:"xeuugli",k8WAf4:"x391bbb",kg3NbH:"xy7odpl",$$css:true},row:{kGNEyG:"x1pha0wt",k1xSpc:"xrvj5dj",kOIVth:"xiw8qbs",kumcoG:"xju1xpo",$$css:true},rows:{k1xSpc:"xrvj5dj",kOIVth:"x13hh4mm",kogj98:"x1ghz6dp",$$css:true},swatch:{kZKoxP:"xols6we",kaIpWk:"x16rqkct",kmuXW:"x2lah0s",kzqmXN:"x1v4s8kt",$$css:true},term:{kGNEyG:"x6s0dn4",kMwMTN:"xbb0na1",k1xSpc:"x78zum5",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",$$css:true},value:{kcqcaj:"xss6m8b",k63SB2:"xuku2lm",kogj98:"x1ghz6dp",k9WMMc:"xp4054r",$$css:true}};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type CheckboxProps } from "./checkbox";
|
|
3
|
+
type CheckboxCardControlProps = Pick<CheckboxProps, "aria-describedby" | "checked" | "defaultChecked" | "form" | "id" | "indeterminate" | "inputRef" | "onCheckedChange" | "readOnly" | "required" | "value" | "uncheckedValue"> & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
name?: CheckboxProps["name"];
|
|
7
|
+
ref?: CheckboxProps["ref"];
|
|
8
|
+
size?: CheckboxProps["size"];
|
|
9
|
+
};
|
|
10
|
+
export type CheckboxCardProps = CheckboxCardControlProps & {
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
error?: ReactNode;
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export declare function CheckboxCard({ description, disabled, error, invalid, label, name, ...checkboxProps }: CheckboxCardProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Field as BaseField}from"@base-ui/react/field";import{props}from"@stylexjs/stylex";import{useId}from"react";import{Field,FieldDescription,FieldError}from"../field/field";import{Checkbox}from"./checkbox";import{checkboxCardStyles}from"./checkbox-card.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function CheckboxCard({description,disabled=false,error,invalid=false,label,name,...checkboxProps}){const labelId=useId();return/*#__PURE__*/_jsxs(Field,{disabled:disabled,invalid:invalid,name:name,children:[/*#__PURE__*/_jsxs(BaseField.Label,{...props(checkboxCardStyles.label),children:[/*#__PURE__*/_jsx(Checkbox,{...checkboxProps,"aria-labelledby":labelId,disabled:disabled,invalid:invalid,name:name}),/*#__PURE__*/_jsxs("span",{...props(checkboxCardStyles.content),children:[/*#__PURE__*/_jsx("span",{id:labelId,children:label}),description!==undefined&&description!==null?/*#__PURE__*/_jsx(FieldDescription,{render:/*#__PURE__*/_jsx("span",{}),children:description}):null]})]}),error!==undefined&&error!==null?/*#__PURE__*/_jsx(FieldError,{match:true,children:error}):null]});}
|
|
@@ -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}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 checkboxCardStyles={content:{k1xSpc:"x78zum5",kCS8Yb:"x1t1x2f9",kXwgrk:"xdt5ytf",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",$$css:true},label:{kGNEyG:"x1cy8zhl",kWkggS:"x16ab64p x1cj2ltm x12cs2gl xq0dpb xxsa5ao x1o7hn9x",kVAM5u:"x8u5kam x1yc2vkv x11q7dsn x155xxfk",kaIpWk:"x1jw0md8",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kGVxlE:"x1c0hry5 x1dh1zk2 xr81nds",kB7OPa:"x9f619",kMwMTN:"x14tvo57",kkrTdU:"x1r4mgf1 x1e9g8pd x1ypdohk",k1xSpc:"x78zum5",kGuDYH:"x12ama9c",k63SB2:"xuku2lm",kOIVth:"xp4ho6d",kLWn49:"x1rn0pvf",k8WAf4:"x58we3g",kg3NbH:"xy7odpl",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x11vqxbs",kAMwcw:"xvhdtae",kzqmXN:"xh8yej3",$$css:true}};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
|
|
2
|
+
import { type ComponentPropsWithRef } from "react";
|
|
3
|
+
type BaseCheckboxProps = ComponentPropsWithRef<typeof BaseCheckbox.Root>;
|
|
4
|
+
export type CheckboxSize = "default" | "lg" | "sm";
|
|
5
|
+
export type CheckboxProps = Omit<BaseCheckboxProps, "className" | "children" | "disabled" | "nativeButton" | "parent" | "ref" | "render" | "style"> & {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
parent?: boolean;
|
|
9
|
+
ref?: BaseCheckboxProps["ref"];
|
|
10
|
+
size?: CheckboxSize;
|
|
11
|
+
};
|
|
12
|
+
export declare function Checkbox({ disabled, indeterminate, invalid, parent, readOnly, ref: forwardedRef, size, ...rest }: CheckboxProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";import{Checkbox as BaseCheckbox}from"@base-ui/react/checkbox";import{props}from"@stylexjs/stylex";import{useCallback,useState}from"react";import{checkboxStyles}from"./checkbox.styles";import{jsx as _jsx}from"react/jsx-runtime";const sizeStyles={default:checkboxStyles.sizeDefault,lg:checkboxStyles.sizeLg,sm:checkboxStyles.sizeSm};// The marks are drawn here rather than taken from the icon pack: they are
|
|
2
|
+
// part of the control, and pathLength="1" lets the stroke draw on exactly.
|
|
3
|
+
// The stroke draws only when a check makes the mark appear, and once: a
|
|
4
|
+
// mark that mounts checked, or shows again after being hidden, stays still.
|
|
5
|
+
function CheckboxMark({state}){const[drawing,setDrawing]=useState(state.transitionStatus==="starting");const settle=useCallback(()=>setDrawing(false),[]);return/*#__PURE__*/_jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",viewBox:"0 0 16 16",...props(checkboxStyles.icon),children:/*#__PURE__*/_jsx("path",{d:state.indeterminate?"M4 8h8":"M3.5 8.5l3 3l6 -6.5",onAnimationEnd:settle,pathLength:1,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",...props(checkboxStyles.mark,drawing&&checkboxStyles.draw)})});}function renderIndicator(indicatorProps,state){return/*#__PURE__*/_jsx("span",{...indicatorProps,...props(checkboxStyles.indicator),children:/*#__PURE__*/_jsx(CheckboxMark,{state:state})});}export function Checkbox({disabled=false,indeterminate,invalid=false,parent=false,readOnly=false,ref:forwardedRef=undefined,size="default",...rest}){return/*#__PURE__*/_jsx(BaseCheckbox.Root,{...rest,"aria-invalid":invalid||undefined,disabled:disabled,indeterminate:indeterminate,parent:parent,readOnly:readOnly,ref:forwardedRef,...props(checkboxStyles.base,checkboxStyles.forcedColorsSelected,sizeStyles[size]),children:/*#__PURE__*/_jsx(BaseCheckbox.Indicator,{render:renderIndicator})});}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{create,keyframes}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors,fieldColors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/interaction.stylex";import{borderWidth,focus,focusMotion,focusOutline,opacity,scale}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";// The mark draws on along its stroke; pathLength="1" makes one unit the
|
|
2
|
+
// whole path.
|
|
3
|
+
const draw="xatw9dd-B";export const checkboxStyles={base:{kGNEyG:"x6s0dn4",k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kysU6D:"xjyslct",kWkggS:"x8g7iud x18f6qdl x1snul95 xfxevdu x1d32vvj x1p0w3uw x1ce2t89 xwn18cz",kVAM5u:"x3y5f5n xdgidc1 x19twv4c x4a1vbl x1m207df x73yop7 x1yn71q5 x1na5hby xiqzebz x2f8rew",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kGVxlE:"xg3a7mk x1gnnqk1",kB7OPa:"x9f619",kMwMTN:"xa34c4n",kkrTdU:"x1j1ks5o xktmlxf x1ypdohk",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kjj79g:"xl56j7k",kLWn49:"x14ju556",kSiTet:"x1yporm9 x1hc1fzr",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x7jjmpn x1w1ofmy",k3XXqK:"x9v5kkp xzc55om",kMeerF:"xm9seqh x1vhx2qj",kVAEAm:"x1n2onr6",k3aq6I:"x17zh1uw xdxpzd0 xbca3r6 x1uqg51p",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x15jt4lr",kAMwcw:"xvhdtae",kfSwDN:"x87ps6o",kXLuUW:"xxymvpz",$$css:true},draw:{k44tkh:"xui4633 x5hsz1j",kWV6AL:"x1u6ievf",kKVMdj:"xg51wch",kyAemX:"x17ay8nm",$$css:true},forcedColorsSelected:{kpNTys:"x74uwrl",kZ8EXX:"x1gyuuhj",kCiEXB:"x16tai58",kgoQ3:"xi5nuuf",ktokS7:"x1irqi1z",kROSvg:"x1fr76g0",$$css:true},icon:{k1xSpc:"x1lliihq",kZKoxP:"x5yr21d",kVQacm:"x1rea2x4",kzqmXN:"xh8yej3",$$css:true},indicator:{kGNEyG:"x6s0dn4",k1xSpc:"x3nfvp2",kZKoxP:"x5yr21d",kjj79g:"xl56j7k",kLWn49:"x14ju556",kSiTet:"xiyypsa x1hw7zpd x1hc1fzr",kfzvcC:"x47corl",k3aq6I:"x1y6pqz4 x1m3318d x19uwh5a",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x6o7n8i",kAMwcw:"x1bsmr72",kzqmXN:"xh8yej3",$$css:true},mark:{k5rJSQ:"xnq1ati",kfJifR:"xvlca1e",$$css:true},sizeDefault:{kT0f0o:"x1f1r4uc",kVL7Gh:"x15mj9rk",kfmiAY:"xk2zld1",krdFHd:"xnkaj69",kZKoxP:"xaylbqo",kzqmXN:"xsk17dz",$$css:true},sizeLg:{kT0f0o:"x1f1r4uc",kVL7Gh:"x15mj9rk",kfmiAY:"xk2zld1",krdFHd:"xnkaj69",kZKoxP:"xmll18r",kzqmXN:"xwqq7k2",$$css:true},sizeSm:{kT0f0o:"x1f1r4uc",kVL7Gh:"x15mj9rk",kfmiAY:"xk2zld1",krdFHd:"xnkaj69",kZKoxP:"x1l36t39",kzqmXN:"xcdlrvm",$$css:true}};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CheckboxGroup as BaseCheckboxGroup } from "@base-ui/react/checkbox-group";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
type BaseCheckboxGroupProps = ComponentPropsWithRef<typeof BaseCheckboxGroup>;
|
|
4
|
+
export type CheckboxGroupProps = Omit<BaseCheckboxGroupProps, "className" | "render" | "style">;
|
|
5
|
+
export declare function CheckboxGroup({ children, ref: forwardedRef, ...rest }: CheckboxGroupProps): import("react").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{CheckboxGroup as BaseCheckboxGroup}from"@base-ui/react/checkbox-group";import{props}from"@stylexjs/stylex";import{checkboxGroupStyles}from"./checkbox-group.styles";import{jsx as _jsx}from"react/jsx-runtime";export function CheckboxGroup({children,ref:forwardedRef=undefined,...rest}){return/*#__PURE__*/_jsx(BaseCheckboxGroup,{...rest,ref:forwardedRef,...props(checkboxGroupStyles.root),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const checkboxGroupStyles={root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"xp4ho6d",kzqmXN:"xh8yej3",$$css:true}};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
export type CitationProps = Omit<Closed<ComponentPropsWithRef<"cite">>, "children" | "data-slot" | "role"> & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare function Citation({ children, ref: forwardedRef, ...rest }: CitationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{citationStyles}from"./citation.styles";import{jsx as _jsx}from"react/jsx-runtime";export function Citation({children,ref:forwardedRef,...rest}){for(const prop of["className","data-slot","role","style"]){Reflect.deleteProperty(rest,prop);}return/*#__PURE__*/_jsx("cite",{...rest,"data-slot":"citation",ref:forwardedRef,...props(citationStyles.root),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";export const citationStyles={root:{kKX8nH:"x1k4tb9n",$$css:true}};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
type NativeCodeProps = ComponentPropsWithRef<"code">;
|
|
3
|
+
export type CodeProps = Omit<NativeCodeProps, "className" | "role" | "style">;
|
|
4
|
+
export declare function Code({ children, ref: forwardedRef, ...rest }: CodeProps): import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{codeStyles}from"./code.styles";import{jsx as _jsx}from"react/jsx-runtime";export function Code({children,ref:forwardedRef,...rest}){Reflect.deleteProperty(rest,"role");return/*#__PURE__*/_jsx("code",{...rest,"data-slot":"code",ref:forwardedRef,...props(codeStyles.base),children:children});}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/fonts.stylex";import{fonts}from"../../styles/fonts.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";// Inline code follows the surrounding text: em size with matched x-height,
|
|
2
|
+
// and the parent's line height so it never stretches the line box.
|
|
3
|
+
export const codeStyles={base:{kWkggS:"x1o7hn9x",kaIpWk:"xvozwe9",kMwMTN:"x14tvo57",kMv6JI:"x18brtc5",kGuDYH:"xeb7xqv",kC21eY:"x2vx8kg",kLWn49:"x15bjb6t",kHjlTd:"xj0a0fe",kg3NbH:"xdbhxi8",$$css:true}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{useCallback}from"react";import{IconCheck,IconCopy}from"../../icons";import{typeRoles}from"../../styles/typography.styles";import{useCopyToClipboard}from"../../use-copy-to-clipboard";import{Button}from"../button/button";import{visuallyHiddenStyles}from"../visually-hidden/visually-hidden.styles";import{codeBlockStyles}from"./code-block.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const statusMessages={copied:"Copied",failed:"Could not copy. Select the code to copy it.",idle:null};export function CodeBlockCopy({code,ref:forwardedRef}){const{copy,status}=useCopyToClipboard();const copyCode=useCallback(()=>copy(code),[code,copy]);return/*#__PURE__*/_jsxs("span",{"data-slot":"code-block-copy",...props(codeBlockStyles.copyControl),children:[/*#__PURE__*/_jsx(Button,{"aria-label":"Copy code",onClick:copyCode,ref:forwardedRef,size:"icon-xs",title:"Copy code",type:"button",variant:"ghost",children:status==="copied"?/*#__PURE__*/_jsx(IconCheck,{"aria-hidden":"true",size:"1em"}):/*#__PURE__*/_jsx(IconCopy,{"aria-hidden":"true",size:"1em"})}),/*#__PURE__*/_jsx("span",{"aria-live":"polite","data-slot":"code-block-copy-status",role:"status",...props(codeBlockStyles.copyStatus,typeRoles.ui,status!=="failed"&&visuallyHiddenStyles.root),children:statusMessages[status]})]});}
|