@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,5 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{useCallback,useRef,useState}from"react";import{flushSync}from"react-dom";import{IconX}from"../../icons";import{assignRef}from"../../ref-utils";import{Progress}from"../progress/progress";import{fileUploadStyles}from"./file-upload.styles";import{FileUploadItemContext,stripForbidden,useFileUploadContext,useFileUploadItemContext}from"./file-upload-context";import{collapseItem,growItem,settleList}from"./file-upload-motion";import{formatFileSize}from"./file-upload-validation";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export function FileUploadList({children,layout="rows",ref:forwardedRef,...rest}){const context=useFileUploadContext();const cleanProps=stripForbidden(rest);// Children attach before the list, so only later items animate in.
|
|
2
|
+
const mergedRef=useCallback(node=>{settleList(node);return assignRef(forwardedRef,node);},[forwardedRef]);return/*#__PURE__*/_jsx("ul",{...cleanProps,"data-slot":"file-upload-list",ref:mergedRef,...props(fileUploadStyles.list,layout==="tiles"?fileUploadStyles.tiles:fileUploadStyles.rows),children:typeof children==="function"?context.files.map((file,index)=>children(file,index)):children??null});}export function FileUploadItem({children,file,index,layout="row",ref:forwardedRef,...rest}){const context=useFileUploadContext();const cleanProps=stripForbidden(rest);const mergedRef=useCallback(node=>{growItem(node);return assignRef(forwardedRef,node);},[forwardedRef]);return/*#__PURE__*/_jsx(FileUploadItemContext.Provider,{value:{file,index,layout},children:/*#__PURE__*/_jsx("li",{...cleanProps,"data-disabled":context.disabled?"":undefined,"data-layout":layout,"data-slot":"file-upload-item",ref:mergedRef,...props(fileUploadStyles.item,layout==="upload"&&fileUploadStyles.upload,layout==="tile"?fileUploadStyles.tile:fileUploadStyles.rowItem),children:/*#__PURE__*/_jsx("div",{"data-slot":"file-upload-item-content",...props(fileUploadStyles.itemContent,layout==="upload"&&fileUploadStyles.uploadContent,layout==="tile"&&fileUploadStyles.tileContent),children:children})})});}export function FileUploadItemName({children,ref:forwardedRef,...rest}){const itemContext=useFileUploadItemContext();const cleanProps=stripForbidden(rest);return/*#__PURE__*/_jsx("span",{...cleanProps,"data-slot":"file-upload-item-name",ref:forwardedRef,title:cleanProps.title??itemContext.file.name,...props(fileUploadStyles.name,itemContext.layout==="upload"&&fileUploadStyles.uploadName,itemContext.layout==="tile"&&fileUploadStyles.tileName),children:children??itemContext.file.name});}export function FileUploadItemSize({children,ref:forwardedRef,...rest}){const itemContext=useFileUploadItemContext();const cleanProps=stripForbidden(rest);return/*#__PURE__*/_jsx("span",{...cleanProps,"data-slot":"file-upload-item-size",ref:forwardedRef,...props(fileUploadStyles.size),children:children??formatFileSize(itemContext.file.size)});}// The check strokes on when an upload finishes, like the Checkbox mark. An
|
|
3
|
+
// item that is already done when it renders shows the check drawn.
|
|
4
|
+
function StatusCheck({status}){const[shown,setShown]=useState(status);const[drawing,setDrawing]=useState(false);const settle=useCallback(()=>setDrawing(false),[]);if(status!==shown){setShown(status);setDrawing(status==="success");}if(status!=="success"){return null;}return/*#__PURE__*/_jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",viewBox:"0 0 16 16",...props(fileUploadStyles.statusCheck),children:/*#__PURE__*/_jsx("path",{d:"M3.5 8.5l3 3l6 -6.5",onAnimationEnd:settle,pathLength:1,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",...props(fileUploadStyles.statusCheckMark,drawing&&fileUploadStyles.statusCheckDraw)})});}export function FileUploadItemStatus({children,ref:forwardedRef,status,...rest}){const cleanProps=stripForbidden(rest);return/*#__PURE__*/_jsxs("span",{...cleanProps,"aria-atomic":cleanProps["aria-atomic"]??true,"data-slot":"file-upload-item-status","data-status":status,ref:forwardedRef,role:cleanProps.role??"status",...props(fileUploadStyles.status),children:[/*#__PURE__*/_jsx(StatusCheck,{status:status}),children??status]});}export function FileUploadItemProgress({"aria-label":ariaLabel,"aria-labelledby":ariaLabelledBy,ref:forwardedRef,value,...rest}){const itemContext=useFileUploadItemContext();const cleanProps=stripForbidden(rest);const progressLabel=ariaLabel??(ariaLabelledBy?undefined:`${itemContext.file.name} progress`);return/*#__PURE__*/_jsx("div",{...cleanProps,"data-slot":"file-upload-item-progress",ref:forwardedRef,...props(fileUploadStyles.progress),children:/*#__PURE__*/_jsx(Progress,{"aria-label":progressLabel,"aria-labelledby":ariaLabelledBy,value:value??null})});}const defaultRemoveIcon=/*#__PURE__*/_jsx(IconX,{"aria-hidden":"true",focusable:"false",size:"1em"});function RemoveButtonContent({children,fileName,hasName}){const needsFallback=children!==null&&children!==undefined&&!hasName;return/*#__PURE__*/_jsxs(_Fragment,{children:[children??defaultRemoveIcon,needsFallback?/*#__PURE__*/_jsxs("span",{...props(fileUploadStyles.visuallyHidden),children:["Remove ",fileName]}):null]});}export function FileUploadItemRemove({"aria-label":ariaLabel,children,disabled=false,onClick,ref:forwardedRef,...rest}){const context=useFileUploadContext();const itemContext=useFileUploadItemContext();const isDisabled=context.disabled||disabled;// The row collapses before removal, so read the newest file list then.
|
|
5
|
+
const removeRef=useRef(()=>undefined);const mergedRef=useCallback(node=>{removeRef.current=()=>context.removeFile(itemContext.index,itemContext.file);return assignRef(forwardedRef,node);},[context,forwardedRef,itemContext.file,itemContext.index]);const handleClick=useCallback(event=>{onClick?.(event);if(!(event.defaultPrevented||isDisabled)){collapseItem(event.currentTarget.closest("[data-slot='file-upload-item']"),()=>flushSync(()=>removeRef.current()));}},[isDisabled,onClick]);const cleanProps=stripForbidden(rest,["type"]);const hasCustomName=ariaLabel||cleanProps["aria-labelledby"];const defaultAriaLabel=(children===null||children===undefined)&&!hasCustomName?`Remove ${itemContext.file.name}`:undefined;return/*#__PURE__*/_jsx("button",{...cleanProps,"aria-label":ariaLabel??defaultAriaLabel,"data-slot":"file-upload-item-remove",disabled:isDisabled,onClick:handleClick,ref:mergedRef,type:"button",...props(fileUploadStyles.remove,itemContext.layout==="tile"&&fileUploadStyles.tileRemove),children:/*#__PURE__*/_jsx(RemoveButtonContent,{fileName:itemContext.file.name,hasName:Boolean(hasCustomName),children:children})});}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Rows grow open when a file arrives and collapse before it leaves, so the
|
|
2
|
+
// list never jumps. Items already in the list on first render stay still.
|
|
3
|
+
const OPTIONS={duration:240,easing:"cubic-bezier(0.16, 1, 0.3, 1)"};const settledLists=new WeakSet();const seenItems=new WeakSet();const leavingItems=new WeakSet();// Skips motion when the user asks for less, or the DOM can't animate (jsdom).
|
|
4
|
+
function stillMotion(node){return typeof node.animate!=="function"||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches!==false;}// The closed frame also takes back the list gap beside the item.
|
|
5
|
+
function closedGap(node,isTile){const parent=node.parentElement;const gap=parent?getComputedStyle(parent)[isTile?"columnGap":"rowGap"]:"0px";const side=node.previousElementSibling?"Start":"End";const margin=isTile?`marginInline${side}`:`marginBlock${side}`;return gap==="normal"?{}:{[margin]:`-${gap}`};}function sizeFrames(node){const style=getComputedStyle(node);const isTile=node.dataset.layout==="tile";const open=isTile?{width:style.width}:{height:style.height,paddingBlockEnd:style.paddingBlockEnd,paddingBlockStart:style.paddingBlockStart};const closed=isTile?{width:"0px"}:{height:"0px",paddingBlockEnd:"0px",paddingBlockStart:"0px"};return[{...closed,...closedGap(node,isTile),opacity:0,overflow:"hidden"},{...open,opacity:1,overflow:"hidden"}];}export function settleList(node){if(node){settledLists.add(node);}}export function growItem(node){if(!node||seenItems.has(node)){return;}seenItems.add(node);const list=node.parentElement;if(list&&settledLists.has(list)&&!stillMotion(node)){node.animate(sizeFrames(node),OPTIONS);}}// Collapses the item, then removes it. A removal the app cancels opens it again.
|
|
6
|
+
export function collapseItem(node,remove){if(!node||stillMotion(node)){remove();return;}if(leavingItems.has(node)){return;}leavingItems.add(node);const animation=node.animate(sizeFrames(node).reverse(),{...OPTIONS,fill:"forwards"});animation.onfinish=()=>{remove();leavingItems.delete(node);animation.cancel();};}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type FileRejectionCode = "file-invalid-type" | "file-too-large" | "too-many-files";
|
|
2
|
+
export interface FileRejection {
|
|
3
|
+
readonly code: FileRejectionCode;
|
|
4
|
+
readonly file: File;
|
|
5
|
+
}
|
|
6
|
+
export interface ValidationOptions {
|
|
7
|
+
accept?: string;
|
|
8
|
+
currentFiles?: readonly File[];
|
|
9
|
+
maxFiles?: number;
|
|
10
|
+
maxSize?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidationResult {
|
|
13
|
+
accepted: File[];
|
|
14
|
+
rejected: FileRejection[];
|
|
15
|
+
}
|
|
16
|
+
export declare function formatFileSize(bytes: number): string;
|
|
17
|
+
export declare function validateFiles(files: readonly File[], options?: ValidationOptions): ValidationResult;
|
|
18
|
+
export declare function cloneRejections(rejections: readonly FileRejection[]): FileRejection[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function formatFileSize(bytes){if(bytes<1024){return`${bytes} B`;}const kb=1024;const mb=kb*1024;if(bytes<mb){return`${Number((bytes/kb).toFixed(1))} KB`;}return`${Number((bytes/mb).toFixed(1))} MB`;}function matchesPattern(name,type,pattern){if(pattern.startsWith(".")){return name.endsWith(pattern);}if(pattern.endsWith("/*")){return type.startsWith(pattern.slice(0,-1));}return type===pattern;}function matchesAccept(file,accept){const patterns=accept.split(",").map(pattern=>pattern.trim().toLowerCase()).filter(pattern=>pattern.length>0);if(patterns.length===0){return true;}const name=file.name.toLowerCase();const type=file.type.toLowerCase();return patterns.some(pattern=>matchesPattern(name,type,pattern));}function computeAvailableSlots(maxFiles,currentCount=0){if(maxFiles===undefined){return Number.POSITIVE_INFINITY;}if(!Number.isSafeInteger(maxFiles)||maxFiles<=0){return 0;}if(maxFiles===1){return 1;}return Math.max(0,maxFiles-currentCount);}function checkFileRejection(file,accept,maxSize={kind:"unlimited"},availableSlots=Number.POSITIVE_INFINITY){if(accept&&!matchesAccept(file,accept)){return"file-invalid-type";}if(maxSize.kind==="invalid"||maxSize.kind==="valid"&&file.size>maxSize.limit){return"file-too-large";}if(availableSlots<=0){return"too-many-files";}return null;}function computeEffectiveMaxSize(maxSize){if(maxSize===undefined){return{kind:"unlimited"};}if(!Number.isSafeInteger(maxSize)||maxSize<0){return{kind:"invalid"};}return{kind:"valid",limit:maxSize};}export function validateFiles(files,options={}){const{accept,currentFiles=[],maxFiles,maxSize}=options;const effectiveMaxSize=computeEffectiveMaxSize(maxSize);const accepted=[];const rejected=[];let availableSlots=computeAvailableSlots(maxFiles,currentFiles.length);for(const file of files){const rejection=checkFileRejection(file,accept,effectiveMaxSize,availableSlots);if(rejection){rejected.push({code:rejection,file});}else{accepted.push(file);availableSlots-=1;}}return{accepted,rejected};}export function cloneRejections(rejections){return rejections.map(r=>({code:r.code,file:r.file}));}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FileUploadProps } from "./file-upload.types";
|
|
2
|
+
import { FileUploadDropzone as BaseDropzone, FileUploadInput as BaseInput, FileUploadTrigger as BaseTrigger } from "./file-upload-controls";
|
|
3
|
+
import { FileUploadItemPreview as BaseItemPreview } from "./file-upload-item-preview";
|
|
4
|
+
import { FileUploadItem as BaseItem, FileUploadItemName as BaseItemName, FileUploadItemProgress as BaseItemProgress, FileUploadItemRemove as BaseItemRemove, FileUploadItemSize as BaseItemSize, FileUploadItemStatus as BaseItemStatus, FileUploadList as BaseList } from "./file-upload-items";
|
|
5
|
+
export declare function FileUpload({ accept, children, defaultValue, disabled, maxFiles, maxSize, name, onBlur, onFileReject, onValueChange, ref: forwardedRef, value, ...rest }: FileUploadProps): import("react").JSX.Element;
|
|
6
|
+
export declare const FileUploadDropzone: typeof BaseDropzone;
|
|
7
|
+
export declare const FileUploadTrigger: typeof BaseTrigger;
|
|
8
|
+
export declare const FileUploadInput: typeof BaseInput;
|
|
9
|
+
export declare const FileUploadList: typeof BaseList;
|
|
10
|
+
export declare const FileUploadItem: typeof BaseItem;
|
|
11
|
+
export type { FileUploadItemPreviewProps } from "./file-upload-item-preview";
|
|
12
|
+
export declare const FileUploadItemPreview: typeof BaseItemPreview;
|
|
13
|
+
export declare const FileUploadItemName: typeof BaseItemName;
|
|
14
|
+
export declare const FileUploadItemSize: typeof BaseItemSize;
|
|
15
|
+
export declare const FileUploadItemStatus: typeof BaseItemStatus;
|
|
16
|
+
export declare const FileUploadItemProgress: typeof BaseItemProgress;
|
|
17
|
+
export declare const FileUploadItemRemove: typeof BaseItemRemove;
|
|
18
|
+
export type * from "./file-upload.types";
|
|
19
|
+
export type { FileRejection, FileRejectionCode, } from "./file-upload-validation";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{props as stylexProps}from"@stylexjs/stylex";import{useCallback,useRef,useState}from"react";import{assignRef}from"../../ref-utils";import{fileUploadStyles}from"./file-upload.styles";import{attachFormResetListener,computeNextFiles,createChangeDetails,FileUploadContext,restoreFocusAfterRemoval,stripForbidden,syncInputFiles}from"./file-upload-context";import{FileUploadDropzone as BaseDropzone,FileUploadInput as BaseInput,FileUploadTrigger as BaseTrigger}from"./file-upload-controls";import{FileUploadItemPreview as BaseItemPreview}from"./file-upload-item-preview";import{FileUploadItem as BaseItem,FileUploadItemName as BaseItemName,FileUploadItemProgress as BaseItemProgress,FileUploadItemRemove as BaseItemRemove,FileUploadItemSize as BaseItemSize,FileUploadItemStatus as BaseItemStatus,FileUploadList as BaseList}from"./file-upload-items";import{cloneRejections,validateFiles}from"./file-upload-validation";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const NO_FILES=[];export function FileUpload({accept,children,defaultValue,disabled=false,maxFiles=1,maxSize,name,onBlur,onFileReject,onValueChange,ref:forwardedRef,value,...rest}){// Controlled or not is fixed at mount, like a native input.
|
|
2
|
+
const[isControlled]=useState(value!==undefined);const initialFiles=defaultValue?[...defaultValue]:[];const[uncontrolledFiles,setUncontrolledFiles]=useState(initialFiles);const[message,setMessage]=useState("");const[revision,setRevision]=useState(0);const announce=m=>{setMessage(m);setRevision(r=>r+1);};const currentFiles=isControlled?value??NO_FILES:uncontrolledFiles;const initialDefaultRef=useRef(initialFiles);const controlledSnapshotRef=useRef({files:isControlled?value??NO_FILES:NO_FILES,revision:0});const rootRef=useRef(null),inputRef=useRef(null),triggerRef=useRef(null);const setInputCallbackRef=useCallback(node=>{inputRef.current=node;if(!node){return;}if(isControlled){controlledSnapshotRef.current.files=currentFiles;controlledSnapshotRef.current.revision+=1;}syncInputFiles(node,currentFiles);const removeResetListener=attachFormResetListener(node,()=>{const target=isControlled?value??NO_FILES:initialDefaultRef.current;if(!isControlled){setUncontrolledFiles(target);}syncInputFiles(node,target);});return()=>{inputRef.current=null;removeResetListener?.();};},[currentFiles,isControlled,value]);const commitTransition=(nextFiles,details,action)=>{const snap=controlledSnapshotRef.current;const startRevision=snap.revision;const committed=isControlled?snap.files:currentFiles;syncInputFiles(inputRef.current,nextFiles);let succeeded=false;try{action?.();succeeded=!details.isCanceled;}finally{if(isControlled){syncInputFiles(inputRef.current,snap.revision>startRevision?snap.files:committed);}else if(succeeded){setUncontrolledFiles(nextFiles);}else{syncInputFiles(inputRef.current,committed);}}};const processIncomingFiles=(incoming,source)=>{const{accepted,rejected}=validateFiles(incoming,{accept,currentFiles,maxFiles,maxSize});const nextFiles=computeNextFiles(currentFiles,accepted,maxFiles);const details=createChangeDetails({accepted:[...accepted],reason:source,rejected:cloneRejections(rejected)});const msg=rejected.length?`Rejected ${rejected.map(r=>r.file.name).join(", ")}`:"";commitTransition(nextFiles,details,()=>{if(msg){onFileReject?.(cloneRejections(rejected));announce(msg);}onValueChange?.([...nextFiles],details);});};const handleInputChange=event=>{const files=Array.from(event.target.files??[]);if(files.length>0){processIncomingFiles(files,"picker");}};const removeFile=(removeIndex,expectedFile)=>{const file=currentFiles[removeIndex];if(!file||expectedFile&&file!==expectedFile){return;}const nextFiles=currentFiles.filter((_,index)=>index!==removeIndex);const details=createChangeDetails({file,index:removeIndex,reason:"remove"});commitTransition(nextFiles,details,()=>{onValueChange?.([...nextFiles],details);});if(!details.isCanceled){announce(`Removed ${file.name}`);queueMicrotask?.(()=>restoreFocusAfterRemoval(rootRef.current,removeIndex,triggerRef.current));}};const mergedRootRef=useCallback(node=>{rootRef.current=node;const consumerCleanup=assignRef(forwardedRef,node);return()=>{rootRef.current=null;consumerCleanup?.();};},[forwardedRef]);const handleBlur=useCallback(event=>{const target=event.relatedTarget;if(target instanceof Node&&rootRef.current?.contains(target)){return;}onBlur?.(event);},[onBlur]);const rootProps={...stripForbidden(rest),onBlur:handleBlur};return/*#__PURE__*/_jsx(FileUploadContext,{value:{accept,disabled,files:currentFiles,handleDropFiles:f=>processIncomingFiles(f,"drop"),handleInputChange,inputRef,maxFiles,name,onBlur,openPicker:()=>inputRef.current?.click(),removeFile,rootRef,setInputCallbackRef,triggerRef},children:/*#__PURE__*/_jsxs("div",{...rootProps,"data-disabled":disabled?"":undefined,"data-slot":"file-upload",ref:mergedRootRef,...stylexProps(fileUploadStyles.root),children:[children,/*#__PURE__*/_jsx("div",{"aria-atomic":"true","aria-live":"polite",...stylexProps(fileUploadStyles.liveRegion),children:message?/*#__PURE__*/_jsx("span",{children:message},revision):null})]})});}export const FileUploadDropzone=BaseDropzone;export const FileUploadTrigger=BaseTrigger;export const FileUploadInput=BaseInput;export const FileUploadList=BaseList;export const FileUploadItem=BaseItem;export const FileUploadItemPreview=BaseItemPreview;export const FileUploadItemName=BaseItemName;export const FileUploadItemSize=BaseItemSize;export const FileUploadItemStatus=BaseItemStatus;export const FileUploadItemProgress=BaseItemProgress;export const FileUploadItemRemove=BaseItemRemove;
|
|
@@ -0,0 +1,2 @@
|
|
|
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/dimensions.stylex";import{controlSize}from"../../styles/dimensions.stylex";import"../../styles/interaction.stylex";import{borderWidth,focus,focusMotion,focusOutline,opacity}from"../../styles/interaction.stylex";import"../../styles/motion.stylex";import{duration,easing}from"../../styles/motion.stylex";import"../../styles/shadows.stylex";import{shadows}from"../../styles/shadows.stylex";import"../../styles/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontSize,fontWeight,lineHeight}from"../../styles/typography.stylex";const draw="xatw9dd-B";// One dash period is 11px; two periods per loop keeps the march seamless.
|
|
2
|
+
const march="xn80elx-B";export const fileUploadStyles={dropzone:{kGNEyG:"x6s0dn4",k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kWkggS:"x1uyda3a xwghqzh xjbqb8w",kVAM5u:"x3b2qip x1oraeyi x13szql6 x52v64k x7pd7o1",kaIpWk:"x1jw0md8",ksu8eU:"xbsl7fq",kMzoRj:"x1cdonsl",kB7OPa:"x9f619",kMwMTN:"x14tvo57",kkrTdU:"x57cc4 xt0e3qv",k1xSpc:"x78zum5",kXwgrk:"x1q0g3np",kwnvtZ:"x1a02dak",kOIVth:"xiw8qbs",kjj79g:"x1nhvcw1",kSiTet:"x1upygmc x1hc1fzr",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x1w1ofmy",k3XXqK:"xzc55om",kMeerF:"x1vhx2qj",k8WAf4:"x58we3g",kg3NbH:"xaqi9fd",kVAEAm:"x1n2onr6",k9WMMc:"x1yc453h",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"xv5ivc1",kAMwcw:"xvhdtae",kzqmXN:"xh8yej3",$$css:true},dropzoneEdge:{k44tkh:"x1m9vv7p",ko0y90:"xa4qsjk",kKVMdj:"x1tzfbnl x1ptevtc",kyAemX:"x1esw782",kZKoxP:"x1332wxa",kDwRjp:"xbh8q5q",kzqmXN:"xqfe7b2",k87sOh:"x1em35hw",kLqNvP:"xu0g1v3",kSiTet:"xw5uauq xg01cxk",kfzvcC:"x47corl",kVAEAm:"x10l6tqk",kjVXCG:"x1tsy410",k5rJSQ:"x1h6d93d",kfJifR:"xt0szss",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x19991ni",$$css:true},hiddenInput:{k1xSpc:"x1s85apg",$$css:true},item:{kGNEyG:"x6s0dn4",kWkggS:"xxsa5ao x1snul95 xwn18cz",kVAM5u:"x1l2x7e3 x155xxfk",kaIpWk:"x1jw0md8",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kGVxlE:"xr81nds",kB7OPa:"x9f619",k1xSpc:"x78zum5",kOIVth:"xp4ho6d",k8WAf4:"x58we3g",kg3NbH:"xy7odpl",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"x11vqxbs",kzqmXN:"xh8yej3",$$css:true},itemContent:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kzQI83:"x1iyjqo2",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",$$css:true},list:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"xp4ho6d",kB88ic:"xe8uvvx",kogj98:"xvemdqa",kmVPX3:"xkif0i3",kzqmXN:"xh8yej3",$$css:true},liveRegion:{kMcinP:"xeh89do",kZKoxP:"xjm9jq1",kogj98:"xkdpibf",kVQacm:"xb3r6kr",kmVPX3:"xkif0i3",kVAEAm:"x10l6tqk",khDVqt:"xuxw1ft",kzqmXN:"x1i1rx1s",$$css:true},name:{kMwMTN:"x14tvo57",kGuDYH:"xlh8hku",k63SB2:"xuku2lm",kLWn49:"x2xzzt7",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:true},preview:{kGNEyG:"x1cy8zhl",kaIpWk:"x1pjcqnp",kB7OPa:"x9f619",kMwMTN:"xdnyjpo",k1xSpc:"x78zum5",kZKoxP:"x181ylwm",kjj79g:"x1nhvcw1",kVQacm:"xb3r6kr",kmVPX3:"x1btfdvn",kzqmXN:"xh8yej3",$$css:true},previewFull:{kZKoxP:"x5yr21d",kmVPX3:"x1717udv",$$css:true},previewImage:{kZKoxP:"x5yr21d",kVIFPx:"xl1xv1r",kzqmXN:"xh8yej3",$$css:true},previewRow:{kGNEyG:"x6s0dn4",kWkggS:"x16d8uok",kaIpWk:"x2b34ud",kmuXW:"x2lah0s",kZKoxP:"xwaiz5r",kjj79g:"xl56j7k",kmVPX3:"x1717udv",kzqmXN:"xvm51jw",$$css:true},previewUpload:{kGNEyG:"x6s0dn4",kWkggS:"x16d8uok",kaIpWk:"x2b34ud",kmuXW:"x2lah0s",kZKoxP:"xwaiz5r",kjj79g:"xl56j7k",kmVPX3:"x1717udv",kzqmXN:"xvm51jw",$$css:true},progress:{kzqmXN:"xh8yej3",$$css:true},remove:{kGNEyG:"x6s0dn4",k44tkh:"x1iha7go",kKVMdj:"x1b5t0b2",kWkggS:"x1j0xaqr x1oqui1x xxsa5ao xjbqb8w",kVAM5u:"x9r1u3d",kaIpWk:"x2b34ud",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kMwMTN:"x1wh1csg x17xg5fq xbb0na1",kkrTdU:"x1s07b3s x1ypdohk",k1xSpc:"x3nfvp2",kmuXW:"x2lah0s",kZKoxP:"x126keg0 x15ja3qx",kjj79g:"xl56j7k",kLWn49:"x1wrb330",kSiTet:"x1pymsji x1hc1fzr",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x1w1ofmy",k3XXqK:"xzc55om",kMeerF:"x1vhx2qj",kmVPX3:"xkif0i3",kIyJzY:"x1e471i8 x1j5v3x2",k1ekBW:"xce0r4z",kfSwDN:"x87ps6o",kzqmXN:"xsarbd5 xdr7e86",$$css:true},root:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"xiw8qbs",kzqmXN:"xh8yej3",$$css:true},rowItem:{kWkggS:"xrhsbah",kt9PQ7:"x1t1lzn6 x13k63ub",kVAM5u:"x155xxfk",kaIpWk:"x2u8bby",kMzoRj:"xc342km",kGVxlE:"x1gnnqk1",$$css:true},rows:{kVAM5u:"x155xxfk",kaIpWk:"x1jw0md8",ksu8eU:"x1y0btm7",kMzoRj:"x68orb2 x1cdonsl",kOIVth:"xxhr3t",kVQacm:"xb3r6kr",$$css:true},size:{kMwMTN:"xbb0na1",kGuDYH:"x1ws78te",kcqcaj:"xss6m8b",k63SB2:"x1lo1l87",kLWn49:"x76y1r9",khDVqt:"xuxw1ft",$$css:true},status:{kGNEyG:"x6s0dn4",kMwMTN:"xjh2v56 x1dmhwm9 x64ed0u xbb0na1",k1xSpc:"x3nfvp2",kGuDYH:"x1ws78te",k63SB2:"xuku2lm",kOIVth:"x13hh4mm",kLWn49:"x76y1r9",khDVqt:"xuxw1ft",$$css:true},statusCheck:{kmuXW:"x2lah0s",kZKoxP:"x1derqce",kVQacm:"x1rea2x4",kzqmXN:"xnqnt2z",$$css:true},statusCheckDraw:{k44tkh:"xui4633 x1i47e9z",kWV6AL:"x1u6ievf",kKVMdj:"xg51wch",kyAemX:"x17ay8nm",$$css:true},statusCheckMark:{k5rJSQ:"xnq1ati",kfJifR:"xvlca1e",$$css:true},tile:{kaIpWk:"x1jw0md8",kGVxlE:"x1gnnqk1",kmuXW:"x2lah0s",kZKoxP:"x1q7yecz",k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kVAEAm:"x1n2onr6",kzqmXN:"x1q22l7i",$$css:true},tileContent:{kaIpWk:"x1hvvpii",kOIVth:"xxhr3t",kZKoxP:"x5yr21d",kVAEAm:"x1n2onr6",$$css:true},tileName:{krVfgx:"x8snvin",kz4h6p:"xiciryn x1gj8qfm",kMwMTN:"xbb0na1",kGuDYH:"x1ws78te",kkqhue:"x1dxu21k",kVAEAm:"x10l6tqk",$$css:true},tileRemove:{kWkggS:"xr60ue3 x1ylkqan",kaIpWk:"x10hpsqq",kGVxlE:"x1gnnqk1",kGuDYH:"xlh8hku",k87sOh:"x1v5m63d",kt4wiu:"x1vld3ni",kVAEAm:"x10l6tqk",kY2c9j:"x1vjfegm",$$css:true},tiles:{kXwgrk:"x1q0g3np",kOIVth:"xp4ho6d",kXHlph:"xw2csxc",k8WAf4:"x1lmimt7",kg3NbH:"xdbhxi8",$$css:true},upload:{kWkggS:"x1snul95 xwn18cz",kaIpWk:"x1jw0md8",kGVxlE:"x1gnnqk1",kkrTdU:"x1j1ks5o x1sqbtui",k8WAf4:"x58we3g",kg3NbH:"xy7odpl",kVAEAm:"x1n2onr6",$$css:true},uploadContent:{kGNEyG:"x6s0dn4",kOIVth:"xiw8qbs",k9WMMc:"x1yc453h",$$css:true},uploadName:{ks0D6T:"x193iq5w",kHjlTd:"xj0a0fe",khDVqt:"xeaf4i8",$$css:true},visuallyHidden:{kz4h6p:"x1hyvwdk",kZKoxP:"xjm9jq1",kVQacm:"xb3r6kr",kVAEAm:"x10l6tqk",khDVqt:"xuxw1ft",kzqmXN:"x1i1rx1s",$$css:true}};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, FocusEvent, ReactNode, Ref } from "react";
|
|
2
|
+
import type { FileRejection } from "./file-upload-validation";
|
|
3
|
+
export type FileUploadStatus = "error" | "pending" | "success" | "uploading";
|
|
4
|
+
export type FileUploadChangeDetails = {
|
|
5
|
+
readonly accepted: readonly File[];
|
|
6
|
+
readonly cancel: () => void;
|
|
7
|
+
readonly isCanceled: boolean;
|
|
8
|
+
readonly reason: "picker";
|
|
9
|
+
readonly rejected: readonly FileRejection[];
|
|
10
|
+
} | {
|
|
11
|
+
readonly accepted: readonly File[];
|
|
12
|
+
readonly cancel: () => void;
|
|
13
|
+
readonly isCanceled: boolean;
|
|
14
|
+
readonly reason: "drop";
|
|
15
|
+
readonly rejected: readonly FileRejection[];
|
|
16
|
+
} | {
|
|
17
|
+
readonly cancel: () => void;
|
|
18
|
+
readonly file: File;
|
|
19
|
+
readonly index: number;
|
|
20
|
+
readonly isCanceled: boolean;
|
|
21
|
+
readonly reason: "remove";
|
|
22
|
+
};
|
|
23
|
+
declare abstract class BivariantWrapper<T extends (...args: never[]) => unknown> {
|
|
24
|
+
abstract bivariance(...args: Parameters<T>): ReturnType<T>;
|
|
25
|
+
}
|
|
26
|
+
type BivariantCallback<T extends (...args: never[]) => unknown> = BivariantWrapper<T>["bivariance"];
|
|
27
|
+
export type FileUploadProps = Omit<ComponentPropsWithRef<"div">, "className" | "data-slot" | "defaultValue" | "multiple" | "required" | "style" | "value"> & {
|
|
28
|
+
accept?: string;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
defaultValue?: readonly File[];
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
maxFiles?: number;
|
|
33
|
+
maxSize?: number;
|
|
34
|
+
name?: string;
|
|
35
|
+
onBlur?: (event: FocusEvent<HTMLElement>) => void;
|
|
36
|
+
onFileReject?: BivariantCallback<(rejections: readonly FileRejection[]) => void>;
|
|
37
|
+
onValueChange?: BivariantCallback<(files: readonly File[], details: FileUploadChangeDetails) => void>;
|
|
38
|
+
ref?: Ref<HTMLDivElement>;
|
|
39
|
+
value?: readonly File[];
|
|
40
|
+
};
|
|
41
|
+
export interface FileUploadDropzoneState {
|
|
42
|
+
/** Files under the pointer; 0 when the browser hides the count. */
|
|
43
|
+
dragCount: number;
|
|
44
|
+
isDragging: boolean;
|
|
45
|
+
}
|
|
46
|
+
export type FileUploadDropzoneProps = Omit<ComponentPropsWithRef<"div">, "children" | "className" | "data-slot" | "style"> & {
|
|
47
|
+
children?: ReactNode | ((state: FileUploadDropzoneState) => ReactNode);
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
ref?: Ref<HTMLDivElement>;
|
|
50
|
+
};
|
|
51
|
+
export type FileUploadTriggerProps = Omit<ComponentPropsWithRef<"button">, "className" | "data-slot" | "style" | "type"> & {
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
ref?: Ref<HTMLButtonElement>;
|
|
54
|
+
};
|
|
55
|
+
export type FileUploadInputProps = Omit<ComponentPropsWithRef<"input">, "accept" | "children" | "className" | "data-slot" | "defaultValue" | "disabled" | "multiple" | "name" | "onChange" | "required" | "style" | "type" | "value"> & {
|
|
56
|
+
ref?: Ref<HTMLInputElement>;
|
|
57
|
+
};
|
|
58
|
+
export type FileUploadListProps = Omit<ComponentPropsWithRef<"ul">, "children" | "className" | "data-slot" | "style"> & {
|
|
59
|
+
children?: ReactNode | ((file: File, index: number) => ReactNode);
|
|
60
|
+
layout?: "rows" | "tiles";
|
|
61
|
+
ref?: Ref<HTMLUListElement>;
|
|
62
|
+
};
|
|
63
|
+
export type FileUploadItemProps = Omit<ComponentPropsWithRef<"li">, "className" | "data-slot" | "style"> & {
|
|
64
|
+
file: File;
|
|
65
|
+
index: number;
|
|
66
|
+
layout?: "row" | "tile" | "upload";
|
|
67
|
+
ref?: Ref<HTMLLIElement>;
|
|
68
|
+
};
|
|
69
|
+
export type FileUploadItemNameProps = Omit<ComponentPropsWithRef<"span">, "className" | "data-slot" | "style"> & {
|
|
70
|
+
ref?: Ref<HTMLSpanElement>;
|
|
71
|
+
};
|
|
72
|
+
export type FileUploadItemSizeProps = Omit<ComponentPropsWithRef<"span">, "className" | "data-slot" | "style"> & {
|
|
73
|
+
ref?: Ref<HTMLSpanElement>;
|
|
74
|
+
};
|
|
75
|
+
export type FileUploadItemStatusProps = Omit<ComponentPropsWithRef<"span">, "className" | "data-slot" | "style"> & {
|
|
76
|
+
ref?: Ref<HTMLSpanElement>;
|
|
77
|
+
status?: FileUploadStatus;
|
|
78
|
+
};
|
|
79
|
+
export type FileUploadItemProgressProps = Omit<ComponentPropsWithRef<"div">, "children" | "className" | "data-slot" | "style"> & {
|
|
80
|
+
ref?: Ref<HTMLDivElement>;
|
|
81
|
+
value?: number | null;
|
|
82
|
+
};
|
|
83
|
+
export type FileUploadItemRemoveProps = Omit<ComponentPropsWithRef<"button">, "className" | "data-slot" | "style" | "type"> & {
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
ref?: Ref<HTMLButtonElement>;
|
|
86
|
+
};
|
|
87
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class BivariantWrapper{}export{};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export type FrameProps = Omit<ComponentPropsWithRef<"div">, "className" | "style">;
|
|
3
|
+
export type FramePanelProps = Omit<ComponentPropsWithRef<"div">, "className" | "style">;
|
|
4
|
+
export type FrameHeaderProps = Omit<ComponentPropsWithRef<"header">, "className" | "style">;
|
|
5
|
+
export type FrameTitleProps = Omit<ComponentPropsWithRef<"div">, "className" | "style">;
|
|
6
|
+
export type FrameDescriptionProps = Omit<ComponentPropsWithRef<"div">, "className" | "style">;
|
|
7
|
+
export type FrameFooterProps = Omit<ComponentPropsWithRef<"footer">, "className" | "style">;
|
|
8
|
+
export declare function Frame({ children, ref: forwardedRef, ...rest }: FrameProps): import("react").JSX.Element;
|
|
9
|
+
export declare function FramePanel({ children, ref: forwardedRef, ...rest }: FramePanelProps): import("react").JSX.Element;
|
|
10
|
+
export declare function FrameHeader({ children, ref: forwardedRef, ...rest }: FrameHeaderProps): import("react").JSX.Element;
|
|
11
|
+
export declare function FrameTitle({ children, ref: forwardedRef, ...rest }: FrameTitleProps): import("react").JSX.Element;
|
|
12
|
+
export declare function FrameDescription({ children, ref: forwardedRef, ...rest }: FrameDescriptionProps): import("react").JSX.Element;
|
|
13
|
+
export declare function FrameFooter({ children, ref: forwardedRef, ...rest }: FrameFooterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{frameStyles}from"./frame.styles";import{jsx as _jsx}from"react/jsx-runtime";export function Frame({children,ref:forwardedRef,...rest}){return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"frame",ref:forwardedRef,...props(frameStyles.frame),children:children});}export function FramePanel({children,ref:forwardedRef,...rest}){return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"frame-panel",ref:forwardedRef,...props(frameStyles.panel),children:children});}export function FrameHeader({children,ref:forwardedRef,...rest}){return/*#__PURE__*/_jsx("header",{...rest,"data-slot":"frame-panel-header",ref:forwardedRef,...props(frameStyles.header),children:children});}export function FrameTitle({children,ref:forwardedRef,...rest}){return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"frame-panel-title",ref:forwardedRef,...props(frameStyles.title),children:children});}export function FrameDescription({children,ref:forwardedRef,...rest}){return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"frame-panel-description",ref:forwardedRef,...props(frameStyles.description),children:children});}export function FrameFooter({children,ref:forwardedRef,...rest}){return/*#__PURE__*/_jsx("footer",{...rest,"data-slot":"frame-panel-footer",ref:forwardedRef,...props(frameStyles.footer),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/interaction.stylex";import{borderWidth}from"../../styles/interaction.stylex";import"../../styles/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 frameStyles={description:{kB7OPa:"x9f619",kMwMTN:"xbb0na1",kGuDYH:"xlh8hku",k63SB2:"x1lo1l87",kLWn49:"x2xzzt7",$$css:true},footer:{kB7OPa:"x9f619",k8WAf4:"x7bohs8",kg3NbH:"x1qv7r7n",$$css:true},frame:{kWkggS:"x1vs9wzj",kaIpWk:"xrpjxqk",kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",kmVPX3:"xlxy37g",kVAEAm:"x1n2onr6",kzqmXN:"xh8yej3",$$css:true},header:{kB7OPa:"x9f619",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",k8WAf4:"x7bohs8",kg3NbH:"x1qv7r7n",$$css:true},panel:{kHypHr:"xx83zyx",kWkggS:"xwn18cz",kVAM5u:"x155xxfk",kaIpWk:"x4ig255",ksu8eU:"x1y0btm7",kMzoRj:"x1cdonsl",kGVxlE:"xr81nds",kB7OPa:"x9f619",k7Eaqz:"xeuugli",kmVPX3:"x11ant10",kVAEAm:"x1n2onr6",$$css:true},title:{kB7OPa:"x9f619",kMwMTN:"x14tvo57",kGuDYH:"xlh8hku",k63SB2:"xlw70nr",kLWn49:"x2xzzt7",$$css:true}};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{create,props}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{typeRoles}from"../../styles/typography.styles";import"../../styles/typography.stylex";import{fontWeight}from"../../styles/typography.stylex";import{chartColors}from"../chart-frame/chart-colors";import{ChartHoverTooltip,useChartHover}from"../chart-frame/chart-hover";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const HEIGHT=160;const STAGE=100;// Each stage holds its height for 60% of its width, then eases to the next.
|
|
2
|
+
const HOLD=0.6;const HALO_OPACITY=0.16;const _temp={kWkggS:"xwn18cz",kaIpWk:"x1e6avla",kMwMTN:"x14tvo57",kcqcaj:"xss6m8b",k63SB2:"xuku2lm",k87sOh:"xwa60dl",k8WAf4:"x1dus959",kg3NbH:"xb5xqfq",kVAEAm:"x10l6tqk",k3aq6I:"x11lhmoz","$$css":true};const _temp2={kZKoxP:"x1qa65zt",kaIpWk:"x18zih8k",kmuXW:"x2lah0s",kzqmXN:"x1e7hgle","$$css":true};const _temp3={k1xSpc:"xrvj5dj",kOIVth:"xp4ho6d",kumcoG:"xqketvx",kB88ic:"xe8uvvx",kogj98:"x1ghz6dp",kmVPX3:"x1717udv","$$css":true};const styles={figure:{kZKoxP:"x1ymw6g",kVAEAm:"x1n2onr6",$$css:true},pill:left=>[_temp,{kLqNvP:left!=null?"x1lxsm33":left,$$css:true},{"--x-insetInlineStart":(val=>typeof val==="number"?val+"px":val!=null?val:undefined)(left)}],swatch:backgroundColor=>[_temp2,{kWkggS:backgroundColor!=null?"xl8spv7":backgroundColor,$$css:true},{"--x-backgroundColor":backgroundColor!=null?backgroundColor:undefined}],tile:{kWkggS:"xwn18cz",kaIpWk:"x2b34ud",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x13hh4mm",k7Eaqz:"xeuugli",k8WAf4:"x391bbb",kg3NbH:"xy7odpl",$$css:true},tileLabel:{kMwMTN:"x125omll",$$css:true},tiles:count=>[_temp3,{"--x-gridTemplateColumns":`repeat(auto-fit, minmax(max(7rem, (100% - ${count-1} * ${space["2"]}) / ${count}), 1fr))`!=null?`repeat(auto-fit, minmax(max(7rem, (100% - ${count-1} * ${space["2"]}) / ${count}), 1fr))`:undefined}]};// One stage's shape: it holds its height, then eases to the next stage's.
|
|
3
|
+
function stagePath(heights,index){const center=HEIGHT/2;const x0=index*STAGE;const x1=x0+STAGE;const hold=x0+STAGE*HOLD;const mid=(hold+x1)/2;const half=heights[index]/2;const next=(heights[index+1]??heights[index])/2;return[`M${x0},${center-half} L${hold},${center-half}`,`C${mid},${center-half} ${mid},${center-next} ${x1},${center-next}`,`L${x1},${center+next}`,`C${mid},${center+next} ${mid},${center+half} ${hold},${center+half}`,`L${x0},${center+half} Z`].join(" ");}export function FunnelFlow({"aria-label":ariaLabel,format,share,stages}){const{fade,hostRef,hostStyle,hover,linkProps,markProps}=useChartHover();const heights=stages.map(({share:stageShare})=>Math.max(4,stageShare*HEIGHT*0.78));const halo=heights.map(height=>Math.min(HEIGHT,height*1.12+10));return/*#__PURE__*/_jsxs("div",{"data-slot":"funnel-flow",...{className:"x78zum5 xdt5ytf xiw8qbs xeuugli"},children:[/*#__PURE__*/_jsxs("div",{ref:hostRef,...props(styles.figure,hostStyle),children:[/*#__PURE__*/_jsxs("svg",{"aria-hidden":"true",preserveAspectRatio:"none",viewBox:`0 0 ${stages.length*STAGE} ${HEIGHT}`,...{className:"x1ymw6g x1lliihq xh8yej3"},children:[stages.map(({id,label,share:stageShare,tone,value},index)=>/*#__PURE__*/_jsxs("g",{...markProps(id,{items:[{id,label,tone,value:`${format(value)} · ${share.format(stageShare)}`}]}),...props(...fade(id)),children:[/*#__PURE__*/_jsx("path",{d:stagePath(halo,index),fill:chartColors[tone],fillOpacity:HALO_OPACITY}),/*#__PURE__*/_jsx("path",{d:stagePath(heights,index),fill:chartColors[tone]})]},id)),stages.slice(1).map(({id},index)=>/*#__PURE__*/_jsx("line",{stroke:colors.surface,strokeWidth:2,vectorEffect:"non-scaling-stroke",x1:(index+1)*STAGE,x2:(index+1)*STAGE,y1:0,y2:HEIGHT},id))]}),stages.map(({id,share:stageShare},index)=>/*#__PURE__*/_jsx("span",{"aria-hidden":"true",...props(styles.pill(`${(index+HOLD/2)/stages.length*100}%`),typeRoles.caption),children:share.format(stageShare)},id)),/*#__PURE__*/_jsx(ChartHoverTooltip,{hover:hover})]}),/*#__PURE__*/_jsx("ol",{"aria-label":ariaLabel,...props(styles.tiles(stages.length)),children:stages.map(({id,label,share:stageShare,tone,value})=>/*#__PURE__*/_jsxs("li",{"data-slot":"funnel-stage",...linkProps(id),...props(styles.tile,...fade(id)),children:[/*#__PURE__*/_jsxs("span",{...{className:"x6s0dn4 x78zum5 xp4ho6d x125omll"},children:[/*#__PURE__*/_jsx("span",{"aria-hidden":"true",...props(styles.swatch(chartColors[tone]))}),label]}),/*#__PURE__*/_jsxs("span",{children:[/*#__PURE__*/_jsx("span",{...{className:"x14tvo57 xss6m8b xuku2lm"},children:format(value)}),/*#__PURE__*/_jsxs("span",{...props(styles.tileLabel,typeRoles.caption),children:[" ",share.format(stageShare)]})]})]},id))})]});}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 FunnelStage {
|
|
5
|
+
/** A decorative glyph at the start of the stage's bar. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
value: number;
|
|
10
|
+
}
|
|
11
|
+
export type FunnelProps = Omit<Closed<ComponentPropsWithRef<"div">>, "aria-label" | "children" | "data-slot" | "role"> & {
|
|
12
|
+
"aria-label": string;
|
|
13
|
+
formatValue?: (value: number) => string;
|
|
14
|
+
locale?: string;
|
|
15
|
+
/** bars lists stages on a shared track; flow draws one band that narrows. */
|
|
16
|
+
presentation?: FunnelPresentation;
|
|
17
|
+
/** Up to six stages, each in its palette color unless `tone` sets one hue. */
|
|
18
|
+
stages: readonly FunnelStage[];
|
|
19
|
+
tone?: ChartSeriesTone;
|
|
20
|
+
};
|
|
21
|
+
export type FunnelPresentation = "bars" | "flow";
|
|
22
|
+
/** A stage with its palette tone and its share of the first stage. */
|
|
23
|
+
export interface PlacedFunnelStage extends FunnelStage {
|
|
24
|
+
share: number;
|
|
25
|
+
tone: ChartSeriesTone;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Ordered stages, each with its value and its share of the first stage, as bars
|
|
29
|
+
* on a shared track or as one band that narrows.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Funnel({ "aria-label": ariaLabel, formatValue, locale, presentation, ref: forwardedRef, stages, tone, ...rest }: FunnelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{typeRoles}from"../../styles/typography.styles";import{assertIdentity,assertNonNegative}from"../chart-frame/chart-assert";import{chartColors}from"../chart-frame/chart-colors";import{useChartHover}from"../chart-frame/chart-hover";import{funnelStyles}from"./funnel.styles";import{FunnelFlow}from"./funnel-flow";/** A stage with its palette tone and its share of the first stage. */import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const PALETTE=["series1","series2","series3","series4","series5","series6"];function assertStages(stages,tone){if(!Array.isArray(stages)){throw new TypeError("Funnel stages must be an array.");}if(tone===undefined&&stages.length>PALETTE.length){throw new RangeError("Funnel colors up to six stages; set tone for more stages in one hue.");}const ids=new Set();for(const stage of stages){assertIdentity("Funnel",stage,ids);assertNonNegative("Funnel",stage.value);}}function assertOptions(ariaLabel,tone){if(typeof ariaLabel!=="string"||!ariaLabel.trim()){throw new TypeError("Funnel requires a non-empty aria-label.");}if(tone!==undefined&&!Object.hasOwn(chartColors,tone)){throw new RangeError("Funnel tone is not a supported chart series tone.");}}function FunnelBars({"aria-label":ariaLabel,format,share,stages}){const{fade,linkProps}=useChartHover();return/*#__PURE__*/_jsx("ol",{"aria-label":ariaLabel,...props(funnelStyles.list),children:stages.map(({icon,id,label,share:stageShare,tone,value})=>/*#__PURE__*/_jsxs("li",{"data-slot":"funnel-stage",...linkProps(id),...props(funnelStyles.row),children:[/*#__PURE__*/_jsx("span",{"data-slot":"funnel-label",...props(funnelStyles.label),children:label}),/*#__PURE__*/_jsx("span",{"aria-hidden":"true",...props(funnelStyles.track),children:/*#__PURE__*/_jsx("span",{"data-slot":"funnel-bar",...props(...fade(id),funnelStyles.fill(`${Math.min(stageShare,1)*100}%`,chartColors[tone])),children:icon?/*#__PURE__*/_jsx("span",{...props(funnelStyles.icon),children:icon}):null})}),/*#__PURE__*/_jsxs("span",{"data-slot":"funnel-value",...props(funnelStyles.value),children:[format(value),/*#__PURE__*/_jsx("span",{...props(funnelStyles.share,typeRoles.caption),children:share.format(stageShare)})]})]},id))});}/**
|
|
2
|
+
* Ordered stages, each with its value and its share of the first stage, as bars
|
|
3
|
+
* on a shared track or as one band that narrows.
|
|
4
|
+
*/export function Funnel({"aria-label":ariaLabel,formatValue,locale="en-US",presentation="bars",ref:forwardedRef,stages,tone,...rest}){assertOptions(ariaLabel,tone);assertStages(stages,tone);for(const name of["children","className","data-slot","role","style"]){Reflect.deleteProperty(rest,name);}const format=formatValue??new Intl.NumberFormat(locale).format;const share=new Intl.NumberFormat(locale,{maximumFractionDigits:0,style:"percent"});const base=stages[0]?.value||1;const placed=stages.map((stage,index)=>({...stage,share:stage.value/base,tone:tone??PALETTE[index]}));const Presentation=presentation==="flow"?FunnelFlow:FunnelBars;return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"funnel",ref:forwardedRef,...props(funnelStyles.root,typeRoles.ui),children:/*#__PURE__*/_jsx(Presentation,{"aria-label":ariaLabel,format:format,share:share,stages:placed})});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontWeight}from"../../styles/typography.stylex";const PILL="1.25rem";const _temp={kGNEyG:"x6s0dn4",kaIpWk:"x1e6avla",kMwMTN:"xa34c4n",k1xSpc:"x78zum5",kzqmXN:"x1uyokj7",k7Eaqz:"x199i5n0",kZCmMZ:"x19h85wv","$$css":true};export const funnelStyles={fill:(inlineSize,backgroundColor)=>[_temp,{kWkggS:backgroundColor!=null?"xl8spv7":backgroundColor,$$css:true},{"--x-backgroundColor":backgroundColor!=null?backgroundColor:undefined,"--x-inlineSize":(val=>typeof val==="number"?val+"px":val!=null?val:undefined)(inlineSize)}],icon:{k1xSpc:"x3nfvp2",kZKoxP:"x1h81to8 xt7dq6l",kzqmXN:"x1pqx829 x14atkfc",$$css:true},label:{kMwMTN:"x125omll",kVQacm:"xb3r6kr",k9WMMc:"xp4054r",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:true},list:{kGNEyG:"x6s0dn4",k1C7PZ:"xejpt2e",k1xSpc:"xrvj5dj",kumcoG:"x1ug8u0s",kB88ic:"xe8uvvx",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",khm7nJ:"x1m3h4ob",$$css:true},root:{k7Eaqz:"xeuugli",$$css:true},row:{k1xSpc:"xrvj5dj",kWZpDQ:"xx1abn8",kEXP64:"xcrlgei",kumcoG:"x4w6khx",$$css:true},share:{kMwMTN:"x125omll",k1xSpc:"x1rg5ohu",kcqcaj:"xss6m8b",keTefX:"xdd4mtk",k7Eaqz:"xj9j1fp",k9WMMc:"xp4054r",$$css:true},track:{kWkggS:"x1o7hn9x",kZKoxP:"xmll18r",kaIpWk:"x1e6avla",k1xSpc:"x78zum5",kVQacm:"xb3r6kr",$$css:true},value:{kMwMTN:"x14tvo57",kcqcaj:"xss6m8b",k63SB2:"xuku2lm",k9WMMc:"xp4054r",$$css:true}};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
type NativeDivProps = ComponentPropsWithRef<"div">;
|
|
3
|
+
export type GridProps = Omit<NativeDivProps, "className" | "role" | "style">;
|
|
4
|
+
export declare function Grid({ children, ref: forwardedRef, ...rest }: GridProps): import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{gridStyles}from"./grid.styles";import{jsx as _jsx}from"react/jsx-runtime";export function Grid({children,ref:forwardedRef,...rest}){Reflect.deleteProperty(rest,"role");return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"grid",ref:forwardedRef,...props(gridStyles.base),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const gridStyles={base:{k1xSpc:"xrvj5dj",kOIVth:"xiw8qbs",kumcoG:"x1mkdm3x x1qgos7m",k7Eaqz:"xeuugli",$$css:true}};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
type NativeDivProps = ComponentPropsWithRef<"div">;
|
|
3
|
+
export type GroupProps = Omit<NativeDivProps, "className" | "role" | "style">;
|
|
4
|
+
export declare function Group({ children, ref: forwardedRef, ...rest }: GroupProps): import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{groupStyles}from"./group.styles";import{jsx as _jsx}from"react/jsx-runtime";export function Group({children,ref:forwardedRef,...rest}){Reflect.deleteProperty(rest,"role");return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"group",ref:forwardedRef,...props(groupStyles.base),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const groupStyles={base:{kGNEyG:"x6s0dn4",k1xSpc:"x78zum5",kXwgrk:"x1q0g3np",kwnvtZ:"x1a02dak",kOIVth:"xp4ho6d",k7Eaqz:"xeuugli",$$css:true}};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
type NativeHeadingProps = ComponentPropsWithRef<"h2">;
|
|
3
|
+
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
export type HeadingSize = "display" | "heading" | "subheading" | "title";
|
|
5
|
+
export type HeadingProps = Omit<NativeHeadingProps, "className" | "style"> & {
|
|
6
|
+
level?: HeadingLevel;
|
|
7
|
+
size?: HeadingSize;
|
|
8
|
+
};
|
|
9
|
+
export declare function Heading({ children, level, ref: forwardedRef, size, ...rest }: HeadingProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{typeRoles}from"../../styles/typography.styles";import{headingStyles}from"./heading.styles";import{jsx as _jsx}from"react/jsx-runtime";const headingElements={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};const sizeStyles={display:typeRoles.display,heading:typeRoles.heading,subheading:typeRoles.subheading,title:typeRoles.title};export function Heading({children,level=2,ref:forwardedRef,size="heading",...rest}){const Component=headingElements[level];return/*#__PURE__*/_jsx(Component,{...rest,"data-size":size,"data-slot":"heading",ref:forwardedRef,...props(headingStyles.base,sizeStyles[size]),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";export const headingStyles={base:{kMwMTN:"x14tvo57",kqGvvJ:"x10im51j",kHjlTd:"xj0a0fe",$$css:true}};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{create,props}from"@stylexjs/stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import{typeRoles}from"../../styles/typography.styles";import{chartColors}from"../chart-frame/chart-colors";// Shared by Heatmap and CalendarHeatmap: six sequential buckets of one hue,
|
|
2
|
+
// mixed from the workarea, plus a separate "missing" color.
|
|
3
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const BUCKETS=[0,1,2,3,4,5];export const COLOR_DOMAIN=["missing",...BUCKETS];const _temp={kZKoxP:"x18gu5k8",kaIpWk:"x18zih8k",kmuXW:"x2lah0s",kzqmXN:"xd466ng","$$css":true};const styles={label:{kMwMTN:"x125omll",$$css:true},swatch:backgroundColor=>[_temp,{kWkggS:backgroundColor!=null?"xl8spv7":backgroundColor,$$css:true},{"--x-backgroundColor":backgroundColor!=null?backgroundColor:undefined}]};export function getBucket(value,maximum){return Math.min(BUCKETS.length-1,Math.floor(value/(maximum||1)*BUCKETS.length));}export function colorRange(tone){return[colors.workarea,...BUCKETS.map(bucket=>`color-mix(in oklab, ${colors.workarea} ${100-(bucket+1)/BUCKETS.length*100}%, ${chartColors[tone]})`)];}export function HeatmapLegend({high,tone,valueLabel}){return/*#__PURE__*/_jsxs("div",{"aria-label":`${valueLabel} range; No data is shown separately`,"data-slot":"heatmap-legend",role:"img",...{className:"x6s0dn4 xejpt2e x78zum5 x1a02dak x13a6bvl x1fynrwi xjcy2k7"},children:[/*#__PURE__*/_jsxs("span",{...{className:"x6s0dn4 x78zum5 x1a02dak x13hh4mm xeuugli"},children:[/*#__PURE__*/_jsx("span",{...props(typeRoles.caption,styles.label),children:"Low 0"}),colorRange(tone).slice(1).map(color=>/*#__PURE__*/_jsx("span",{"aria-hidden":"true",...props(styles.swatch(color))},color)),/*#__PURE__*/_jsxs("span",{...props(typeRoles.caption,styles.label),children:["High ",high]})]}),/*#__PURE__*/_jsxs("span",{...{className:"x6s0dn4 x78zum5 x1a02dak x13hh4mm xeuugli"},children:[/*#__PURE__*/_jsx("span",{"aria-hidden":"true",...props(styles.swatch(colors.workarea))}),/*#__PURE__*/_jsx("span",{...props(typeRoles.caption,styles.label),children:"No data"})]})]});}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
import { type ChartSeriesTone } from "../chart-frame/chart-colors";
|
|
4
|
+
export interface HeatmapRow {
|
|
5
|
+
label: string;
|
|
6
|
+
values: readonly (number | null)[];
|
|
7
|
+
}
|
|
8
|
+
export type HeatmapProps = Omit<Closed<ComponentPropsWithRef<"div">>, "aria-label" | "children" | "data-slot" | "role"> & {
|
|
9
|
+
"aria-label": string;
|
|
10
|
+
columns: readonly string[];
|
|
11
|
+
formatValue?: (value: number) => string;
|
|
12
|
+
max?: number;
|
|
13
|
+
rows: readonly HeatmapRow[];
|
|
14
|
+
tone?: ChartSeriesTone;
|
|
15
|
+
valueLabel?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function Heatmap({ "aria-label": ariaLabel, columns, formatValue: formatter, max, ref: forwardedRef, rows, tone, valueLabel, ...rest }: HeatmapProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{create,props}from"@stylexjs/stylex";import{cell,defineChart}from"@tanstack/charts";import{scaleBand}from"@tanstack/charts/scales/band";import{tooltip as tooltipFeature}from"@tanstack/charts/tooltip";import{useMemo}from"react";import{typeRoles}from"../../styles/typography.styles";import{chartColors}from"../chart-frame/chart-colors";import{ChartDataTable}from"../chart-frame/chart-data-table";import{ChartFrame}from"../chart-frame/chart-frame";import{ChartTooltip}from"../chart-tooltip/chart-tooltip";import{Table,TableBody,TableCaption,TableCell,TableContainer,TableHead,TableHeader,TableRow}from"../table/table";import{COLOR_DOMAIN,colorRange,getBucket,HeatmapLegend}from"./heatmap-scale";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const _temp={ks0D6T:"x13i5qev","$$css":true};const styles={plot:columnCount=>[_temp,{"--x-maxInlineSize":(val=>typeof val==="number"?val+"px":val!=null?val:undefined)(`calc(${columnCount} * 2.25rem + 6rem)`)}]};function requireLabel(label,name,seen){if(typeof label!=="string"||!label.trim()){throw new TypeError(`Heatmap ${name} labels must be non-empty strings.`);}if(seen.has(label)){throw new RangeError(`Heatmap ${name} labels must be unique.`);}seen.add(label);}function assertUniqueLabels(labels,name){const seen=new Set();for(const label of labels){requireLabel(label,name,seen);}}function isArray(value){return Array.isArray(value);}function assertRows(rows,columnCount){const seen=new Set();for(const row of rows){requireLabel(row?.label,"row",seen);if(!isArray(row.values)||row.values.length!==columnCount){throw new RangeError("Heatmap rows must match the column count.");}}}function assertValues(rows){let maximum=0;for(const row of rows){for(const value of row.values){if(value===null){continue;}if(typeof value!=="number"||!Number.isFinite(value)||value<0){throw new RangeError("Heatmap values must be finite non-negative numbers or null.");}maximum=Math.max(maximum,value);}}return maximum;}function assertMaximum(max){if(max!==undefined&&(typeof max!=="number"||!Number.isFinite(max)||max<0)){throw new RangeError("Heatmap max must be a finite non-negative number.");}}function prepareCells(columns,rows,max){if(!(isArray(columns)&&isArray(rows))){throw new TypeError("Heatmap columns and rows must be arrays.");}assertMaximum(max);assertUniqueLabels(columns,"column");assertRows(rows,columns.length);const observedMax=assertValues(rows);const maximum=max??observedMax;if(max===0&&observedMax>0){throw new RangeError("Heatmap max must be greater than zero when values are positive.");}return{cells:rows.flatMap(({label,values})=>values.map((value,index)=>{const colorKey=value===null?"missing":getBucket(value,maximum);return{colorKey,column:columns[index],row:label,value};})),maximum};}function formatValue(value,formatter){const formatted=formatter?formatter(value):String(value);if(typeof formatted!=="string"){throw new TypeError("Heatmap formatValue must return a string.");}return formatted;}function assertProps(ariaLabel,valueLabel,formatter,tone){if(typeof ariaLabel!=="string"||!ariaLabel.trim()||typeof valueLabel!=="string"||!valueLabel.trim()){throw new TypeError("Heatmap requires non-empty aria-label and valueLabel strings.");}if(formatter!==undefined&&typeof formatter!=="function"){throw new TypeError("Heatmap formatValue must be a function.");}if(!Object.hasOwn(chartColors,tone)){throw new RangeError("Heatmap tone is not supported.");}}function stripReservedProps(attributes){for(const name of["aria-label","children","className","data-slot","role","style"]){Reflect.deleteProperty(attributes,name);}}function renderTooltip(context,valueLabel,tone,formatter){const point=context.primaryPoint??context.points[0];if(!point){return null;}const{column,row,value}=point.datum;return/*#__PURE__*/_jsx(ChartTooltip,{items:[{id:"heatmap-value",label:valueLabel,tone,value:value===null?"No data":formatValue(value,formatter)}],label:`${row} · ${column}`});}function HeatmapTable({"aria-label":ariaLabel,columns,formatValue:formatter,rows}){return/*#__PURE__*/_jsx(ChartDataTable,{children:/*#__PURE__*/_jsx(TableContainer,{"aria-label":`${ariaLabel} data`,children:/*#__PURE__*/_jsxs(Table,{children:[/*#__PURE__*/_jsxs(TableCaption,{children:[ariaLabel," values"]}),/*#__PURE__*/_jsx(TableHeader,{sticky:false,children:/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(TableHead,{scope:"col",children:"Row"}),columns.map(column=>/*#__PURE__*/_jsx(TableHead,{children:column},column))]})}),/*#__PURE__*/_jsx(TableBody,{children:rows.map(({label,values})=>/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(TableHead,{scope:"row",children:label}),values.map((value,index)=>/*#__PURE__*/_jsx(TableCell,{numeric:true,children:value===null?"No data":/*#__PURE__*/_jsx("data",{value:value,children:formatValue(value,formatter)})},columns[index]))]},label))})]})})});}function HeatmapChart({"aria-label":ariaLabel,columns,cells,formatValue:formatter,maximum,rows,tone,valueLabel}){const definition=useMemo(()=>defineChart({color:{domain:COLOR_DOMAIN,range:colorRange(tone)},marks:[cell(cells,{color:"colorKey",id:"heatmap-cells",inset:1.5,key:({row,column})=>JSON.stringify([row,column]),radius:4,x:"column",y:"row"})],scales:{x:{scale:scaleBand().domain(columns).paddingInner(0.1).paddingOuter(0)},y:{scale:scaleBand().domain(rows.map(({label})=>label)).paddingInner(0.1).paddingOuter(0)}}},{tooltip:tooltipFeature}),[cells,columns,rows,tone]);const renderTooltipBody=useMemo(()=>context=>renderTooltip(context,valueLabel,tone,formatter),[formatter,tone,valueLabel]);return/*#__PURE__*/_jsxs("div",{...props(styles.plot(columns.length)),children:[/*#__PURE__*/_jsx(ChartFrame,{"aria-label":ariaLabel,definition:definition,height:rows.length*30+40,renderTooltipBody:renderTooltipBody,tabIndex:0}),/*#__PURE__*/_jsx(HeatmapLegend,{high:formatValue(maximum,formatter),tone:tone,valueLabel:valueLabel})]});}export function Heatmap({"aria-label":ariaLabel,columns,formatValue:formatter,max,ref:forwardedRef,rows,tone="series1",valueLabel="Value",...rest}){assertProps(ariaLabel,valueLabel,formatter,tone);const{cells,maximum}=useMemo(()=>prepareCells(columns,rows,max),[columns,max,rows]);stripReservedProps(rest);return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"heatmap",ref:forwardedRef,...{className:"xeuugli"},children:rows.length===0||columns.length===0?/*#__PURE__*/// biome-ignore lint/a11y/useSemanticElements: Names an empty chart, not a form group; the status keeps its own text.
|
|
2
|
+
_jsx("div",{"aria-label":ariaLabel,role:"group",children:/*#__PURE__*/_jsx("p",{role:"status",...props(typeRoles.body),children:"No data available."})}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(HeatmapChart,{"aria-label":ariaLabel,cells:cells,columns:columns,formatValue:formatter,maximum:maximum,rows:rows,tone:tone,valueLabel:valueLabel}),/*#__PURE__*/_jsx(HeatmapTable,{"aria-label":ariaLabel,columns:columns,formatValue:formatter,rows:rows})]})});}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
type NativeDivProps = ComponentPropsWithRef<"div">;
|
|
3
|
+
export type InlineProps = Omit<NativeDivProps, "className" | "role" | "style">;
|
|
4
|
+
export declare function Inline({ children, ref: forwardedRef, ...rest }: InlineProps): import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{props}from"@stylexjs/stylex";import{inlineStyles}from"./inline.styles";import{jsx as _jsx}from"react/jsx-runtime";export function Inline({children,ref:forwardedRef,...rest}){Reflect.deleteProperty(rest,"role");return/*#__PURE__*/_jsx("div",{...rest,"data-slot":"inline",ref:forwardedRef,...props(inlineStyles.base),children:children});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const inlineStyles={base:{kGNEyG:"x6s0dn4",k1xSpc:"x78zum5",kXwgrk:"x1q0g3np",kwnvtZ:"x1a02dak",kOIVth:"xiw8qbs",k7Eaqz:"xeuugli",$$css:true}};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A cited source. With `href` it is a link labelled by its domain, and the
|
|
3
|
+
* title is optional. Without one, such as an uploaded document, it needs a
|
|
4
|
+
* title and shows as text.
|
|
5
|
+
*/
|
|
6
|
+
export type CitationSource = {
|
|
7
|
+
/** One line on what the source says, shown in its preview. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/**
|
|
10
|
+
* A small square image. Defaults to the site's own `/favicon.ico`; a
|
|
11
|
+
* globe stands in when there is none.
|
|
12
|
+
*/
|
|
13
|
+
icon?: string;
|
|
14
|
+
} & ({
|
|
15
|
+
href: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
} | {
|
|
18
|
+
href?: undefined;
|
|
19
|
+
title: string;
|
|
20
|
+
});
|
|
21
|
+
/** What the chip shows: the domain of a link, or the title of a document. */
|
|
22
|
+
export declare function sourceLabel(source: CitationSource): string;
|
|
23
|
+
/** The fullest name available: the title, or the domain without one. */
|
|
24
|
+
export declare function sourceName(source: CitationSource): string;
|
|
25
|
+
export declare function SourceIcon({ source }: {
|
|
26
|
+
source: CitationSource;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{useCallback,useState}from"react";import{IconFile,IconWorld}from"../../icons";import{inlineCitationStyles as styles}from"./inline-citation.styles";/**
|
|
2
|
+
* A cited source. With `href` it is a link labelled by its domain, and the
|
|
3
|
+
* title is optional. Without one, such as an uploaded document, it needs a
|
|
4
|
+
* title and shows as text.
|
|
5
|
+
*/import{jsx as _jsx}from"react/jsx-runtime";const LEADING_WWW=/^www\./u;// Reserved for examples and tests (RFC 2606); they never serve an icon.
|
|
6
|
+
const RESERVED_HOST=/(?:^|\.)(?:example\.(?:com|net|org)|example|test|invalid|localhost)$/u;function sourceDomain(href){return URL.canParse(href)?new URL(href).hostname.replace(LEADING_WWW,""):href;}/** What the chip shows: the domain of a link, or the title of a document. */export function sourceLabel(source){return source.href===undefined?source.title:sourceDomain(source.href);}/** The fullest name available: the title, or the domain without one. */export function sourceName(source){return source.title??sourceLabel(source);}// The site's own icon, so no third-party service learns what was cited.
|
|
7
|
+
function faviconOf(source){if(source.icon){return source.icon;}if(source.href===undefined||!URL.canParse(source.href)){return;}const url=new URL(source.href);const web=url.protocol==="https:"||url.protocol==="http:";return web&&!RESERVED_HOST.test(url.hostname)?`${url.origin}/favicon.ico`:undefined;}export function SourceIcon({source}){const src=faviconOf(source);const[failed,setFailed]=useState(null);const fail=useCallback(()=>setFailed(src??null),[src]);// A server-rendered icon can fail before hydration, when no handler is
|
|
8
|
+
// attached yet; a finished image with no width has failed.
|
|
9
|
+
const check=useCallback(image=>{if(image?.complete&&image.naturalWidth===0){fail();}},[fail]);if(source.href===undefined&&!source.icon){// A document, such as a file from the person's workspace.
|
|
10
|
+
return/*#__PURE__*/_jsx(IconFile,{"aria-hidden":"true",size:12,...props(styles.faviconFallback)});}if(!src||failed===src){return/*#__PURE__*/_jsx(IconWorld,{"aria-hidden":"true",size:12,...props(styles.faviconFallback)});}return(/*#__PURE__*/// biome-ignore lint/performance/noImgElement: Mizen stays framework-neutral, so it uses a native image.
|
|
11
|
+
// biome-ignore lint/correctness/useImageSize: the icon is a fixed 12px square set in styles.
|
|
12
|
+
// biome-ignore lint/a11y/noNoninteractiveElementInteractions: onError swaps in the globe when a site has no icon; it is not an interaction.
|
|
13
|
+
_jsx("img",{alt:"",onError:fail,ref:check,referrerPolicy:"no-referrer",src:src,...props(styles.favicon)}));}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type StyleXStyles } from "@stylexjs/stylex";
|
|
2
|
+
import { type CitationSource } from "./citation-source";
|
|
3
|
+
/** A page or document the text cites. */
|
|
4
|
+
export type InlineCitationSource = CitationSource;
|
|
5
|
+
export interface InlineCitationProps {
|
|
6
|
+
/**
|
|
7
|
+
* The sources behind this point in the text. Several show as one chip,
|
|
8
|
+
* such as "web.dev +2", that opens a list of them.
|
|
9
|
+
*/
|
|
10
|
+
sources: readonly InlineCitationSource[];
|
|
11
|
+
}
|
|
12
|
+
/** The chip, with an optional entrance for text that is still arriving. */
|
|
13
|
+
export declare function CitationChip({ arrival, sources, }: {
|
|
14
|
+
arrival?: StyleXStyles;
|
|
15
|
+
sources: readonly CitationSource[];
|
|
16
|
+
}): import("react").JSX.Element | null;
|
|
17
|
+
/**
|
|
18
|
+
* A source in the sentence it supports: the site's favicon and name, opening
|
|
19
|
+
* the page. On hover or focus it previews the title and what the page says.
|
|
20
|
+
* Several sources at one point show as one chip that lists them.
|
|
21
|
+
*/
|
|
22
|
+
export declare function InlineCitation({ sources }: InlineCitationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";import{props}from"@stylexjs/stylex";import{typeRoles}from"../../styles/typography.styles";import{Popover,PopoverPrimitive}from"../popover/popover";import{popoverStyles}from"../popover/popover.styles";import{PreviewCard,PreviewCardPrimitive}from"../preview-card/preview-card";import{previewCardStyles}from"../preview-card/preview-card.styles";import{SourceRow,uniqueSources}from"../sources/sources";import{sourcesStyles}from"../sources/sources.styles";import{VisuallyHidden}from"../visually-hidden/visually-hidden";import{SourceIcon,sourceLabel,sourceName}from"./citation-source";import{inlineCitationStyles as styles}from"./inline-citation.styles";/** A page or document the text cites. */import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";// Previews wait a moment, so passing over the text does not flash cards.
|
|
2
|
+
const PREVIEW_DELAY=300;function SourceCard({source}){return/*#__PURE__*/_jsxs("div",{"data-slot":"inline-citation-card",...props(styles.card),children:[/*#__PURE__*/_jsxs("span",{...props(typeRoles.caption,styles.cardSite),children:[/*#__PURE__*/_jsx(SourceIcon,{source:source}),sourceLabel(source)]}),source.title?/*#__PURE__*/_jsx("p",{...props(typeRoles.label,styles.cardTitle),children:source.title}):null,source.description?/*#__PURE__*/_jsx("p",{...props(typeRoles.caption,styles.cardDescription),children:source.description}):null]});}// A link to the page, with a preview on hover or focus.
|
|
3
|
+
function LinkChip({arrival,source}){const label=sourceLabel(source);const name=sourceName(source);return/*#__PURE__*/_jsxs(PreviewCard,{children:[/*#__PURE__*/_jsxs(PreviewCardPrimitive.Trigger,{delay:PREVIEW_DELAY,href:source.href,render:/*#__PURE__*/_jsx("a",{"data-slot":"inline-citation",rel:"noopener noreferrer",target:"_blank",...props(typeRoles.caption,styles.chip,arrival)}),children:[/*#__PURE__*/_jsx(SourceIcon,{source:source}),label,/*#__PURE__*/_jsxs(VisuallyHidden,{children:[name===label?"":`, ${name}`,", opens in a new tab"]})]}),/*#__PURE__*/_jsx(PreviewCardPrimitive.Portal,{children:/*#__PURE__*/_jsx(PreviewCardPrimitive.Positioner,{sideOffset:4,...props(previewCardStyles.positioner),children:/*#__PURE__*/_jsx(PreviewCardPrimitive.Popup,{...props(previewCardStyles.popup,styles.cardPopup),children:/*#__PURE__*/_jsx(SourceCard,{source:source})})})})]});}// Several sources at one point: the first site and a count, opening a list.
|
|
4
|
+
function GroupChip({arrival,sources}){const[first]=sources;if(!first){return null;}const more=sources.length-1;return/*#__PURE__*/_jsxs(Popover,{children:[/*#__PURE__*/_jsxs(PopoverPrimitive.Trigger,{delay:PREVIEW_DELAY,openOnHover:true,render:/*#__PURE__*/_jsx("button",{"data-slot":"inline-citation",type:"button",...props(typeRoles.caption,styles.chip,arrival)}),children:[/*#__PURE__*/_jsx(SourceIcon,{source:first}),sourceLabel(first),/*#__PURE__*/_jsxs("span",{...props(styles.count),children:[" +",more]}),/*#__PURE__*/_jsxs(VisuallyHidden,{children:[", ",sources.length," sources"]})]}),/*#__PURE__*/_jsx(PopoverPrimitive.Portal,{children:/*#__PURE__*/_jsx(PopoverPrimitive.Positioner,{sideOffset:4,...props(popoverStyles.positioner),children:/*#__PURE__*/_jsx(PopoverPrimitive.Popup,{...props(popoverStyles.popup,styles.listPopup),children:/*#__PURE__*/_jsx("ul",{"aria-label":"Sources","data-slot":"inline-citation-sources",...props(sourcesStyles.list,styles.group),children:sources.map((source,index)=>/*#__PURE__*/// biome-ignore lint/suspicious/noArrayIndexKey: sources keep their order, and a document may share a title.
|
|
5
|
+
_jsx("li",{children:/*#__PURE__*/_jsx(SourceRow,{source:source})},index))})})})})]});}/** The chip, with an optional entrance for text that is still arriving. */export function CitationChip({arrival,sources}){const unique=uniqueSources(sources);const[source]=unique;if(!source){return null;}if(unique.length>1){return/*#__PURE__*/_jsx(GroupChip,{arrival:arrival,sources:unique});}if(source.href===undefined){// A document has nothing to open; its title is the label.
|
|
6
|
+
return/*#__PURE__*/_jsxs("span",{"data-slot":"inline-citation",...props(typeRoles.caption,styles.chip,styles.chipStatic,arrival),children:[/*#__PURE__*/_jsx(SourceIcon,{source:source}),sourceLabel(source)]});}return/*#__PURE__*/_jsx(LinkChip,{arrival:arrival,source:source});}/**
|
|
7
|
+
* A source in the sentence it supports: the site's favicon and name, opening
|
|
8
|
+
* the page. On hover or focus it previews the title and what the page says.
|
|
9
|
+
* Several sources at one point show as one chip that lists them.
|
|
10
|
+
*/export function InlineCitation({sources}){return/*#__PURE__*/_jsx(CitationChip,{sources:sources});}
|
|
@@ -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/shape.stylex";import{shape}from"../../styles/shape.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";export const inlineCitationStyles={card:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x13hh4mm",kzqmXN:"x1qyi71f",ks0D6T:"x193iq5w",$$css:true},cardDescription:{kMwMTN:"x125omll",kogj98:"x1ghz6dp",$$css:true},cardPopup:{k8WAf4:"x58we3g",kg3NbH:"xaqi9fd",$$css:true},cardSite:{kGNEyG:"x6s0dn4",kMwMTN:"x125omll",k1xSpc:"x78zum5",kOIVth:"x13hh4mm",$$css:true},cardTitle:{kMwMTN:"x14tvo57",kogj98:"x1ghz6dp",$$css:true},chip:{kLkRvE:"x1uupfv5 xjf3280 x1xfgomm",kPB484:"x186vvcl",kgeoSG:"x1cpjm7i",kFcpXp:"x1fy2dh",kEoFBp:"x1hmns74",kxmVGU:"xy5mcqj",kGNEyG:"x6s0dn4",kysU6D:"xjyslct",kWkggS:"xjbqb8w",kaIpWk:"x1d39uln",kMzoRj:"xc342km",kMwMTN:"x11elz0g x125omll",kkrTdU:"x1ypdohk",k1xSpc:"x3nfvp2",kMv6JI:"xjb2p0i",kOIVth:"x13hh4mm",kHBbk8:"xc8icb0",kogj98:"x3sra5",keTefX:"x1lziwak",kjBf7l:"x4dprnk x1uczgqu",kInvED:"x2ssjo2",k3XXqK:"x9v5kkp x1t137rt",kMeerF:"x1vhx2qj",kmVPX3:"xlxy37g",kg3NbH:"x1b05yfv",kVAEAm:"x1n2onr6",kybGjl:"x1hl2dhg",kXLuUW:"xdnv9to",khDVqt:"xuxw1ft",$$css:true},chipStatic:{kkrTdU:"xt0e3qv",$$css:true},count:{kcqcaj:"xss6m8b",$$css:true},favicon:{kZKoxP:"x1kpxq89",kaIpWk:"x18zih8k",k1xSpc:"x1lliihq",kmuXW:"x2lah0s",kzqmXN:"xsmyaan",kVIFPx:"xl1xv1r",$$css:true},faviconFallback:{kMwMTN:"x125omll",kmuXW:"x2lah0s",$$css:true},group:{kzqmXN:"x1nqqiwj",ks0D6T:"x193iq5w",$$css:true},listPopup:{kmVPX3:"x1btfdvn",$$css:true}};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Input as BaseInput } from "@base-ui/react/input";
|
|
2
|
+
import type { ComponentPropsWithRef, InputHTMLAttributes } from "react";
|
|
3
|
+
type BaseInputProps = ComponentPropsWithRef<typeof BaseInput>;
|
|
4
|
+
export type InputSize = "default" | "lg" | "sm";
|
|
5
|
+
export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "onPointerEnter" | "onPointerLeave" | "size" | "style"> & {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
onPointerEnter?: InputHTMLAttributes<HTMLInputElement>["onPointerEnter"];
|
|
9
|
+
onPointerLeave?: InputHTMLAttributes<HTMLInputElement>["onPointerLeave"];
|
|
10
|
+
ref?: BaseInputProps["ref"];
|
|
11
|
+
render?: BaseInputProps["render"];
|
|
12
|
+
size?: InputSize;
|
|
13
|
+
unstyled?: boolean;
|
|
14
|
+
onValueChange?: BaseInputProps["onValueChange"];
|
|
15
|
+
};
|
|
16
|
+
export declare function Input({ disabled, invalid, readOnly, ref: forwardedRef, size, unstyled, onPointerEnter, onPointerLeave, ...rest }: InputProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";import{Input as BaseInput}from"@base-ui/react/input";import{props}from"@stylexjs/stylex";import{useCallback,useState}from"react";import{isBoundStringField,useBoundFieldContext}from"../field/field-context";import{inputStyles}from"./input.styles";import{jsx as _jsx}from"react/jsx-runtime";const sizeStyles={default:inputStyles.sizeDefault,lg:inputStyles.sizeLg,sm:inputStyles.sizeSm};const unstyledSizeStyles={default:inputStyles.unstyledDefault,lg:inputStyles.unstyledLg,sm:inputStyles.unstyledSm};function useInputBinding(control){const boundContext=useBoundFieldContext();const boundField=isBoundStringField(boundContext)?boundContext:null;const userOnBlur=control.onBlur;const userOnValueChange=control.onValueChange;const handleBoundBlur=useCallback(event=>{boundField?.handleBlur();userOnBlur?.(event);},[boundField,userOnBlur]);const handleBoundValueChange=useCallback((val,details)=>{userOnValueChange?.(val,details);if(!details.isCanceled){boundField?.handleChange(val);}},[boundField,userOnValueChange]);const isInvalid=boundField?boundField.state.meta.isTouched&&!boundField.state.meta.isValid:control.invalid;return{"aria-invalid":isInvalid||undefined,...(boundField?{name:boundField.name,onBlur:handleBoundBlur,onValueChange:handleBoundValueChange,value:boundField.state.value}:{})};}function inputAppearance(size,unstyled){return unstyled?props(inputStyles.unstyled,unstyledSizeStyles[size],inputStyles.nativeFeatures):props(inputStyles.input,sizeStyles[size],inputStyles.nativeFeatures);}export function Input({disabled=false,invalid=false,readOnly=false,ref:forwardedRef=undefined,size="default",unstyled=false,// biome-ignore lint/complexity/noUselessUndefined: Keep this optional in Babel's generated JS surface.
|
|
2
|
+
onPointerEnter=undefined,// biome-ignore lint/complexity/noUselessUndefined: Keep this optional in Babel's generated JS surface.
|
|
3
|
+
onPointerLeave=undefined,...rest}){const binding=useInputBinding({...rest,invalid});const[isHovered,setIsHovered]=useState(false);const handlePointerEnter=useCallback(event=>{if(!(disabled||readOnly)){setIsHovered(true);}onPointerEnter?.(event);},[disabled,onPointerEnter,readOnly]);const handlePointerLeave=useCallback(event=>{setIsHovered(false);onPointerLeave?.(event);},[onPointerLeave]);return/*#__PURE__*/_jsx(BaseInput,{...rest,...binding,"data-hovered":isHovered?"true":undefined,"data-size":size,disabled:disabled,onPointerEnter:handlePointerEnter,onPointerLeave:handlePointerLeave,readOnly:readOnly,ref:forwardedRef,...inputAppearance(size,unstyled)});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{create}from"@stylexjs/stylex";import"../../icon-masks.stylex";import{iconMasks}from"../../icon-masks.stylex";import"../../styles/colors.stylex";import{colors}from"../../styles/colors.stylex";import"../../styles/conditions.stylex";import{conditions}from"../../styles/conditions.stylex";import"../../styles/dimensions.stylex";import{controlSize}from"../../styles/dimensions.stylex";import"../../styles/fonts.stylex";import{fonts}from"../../styles/fonts.stylex";import"../../styles/interaction.stylex";import{borderWidth}from"../../styles/interaction.stylex";import"../../styles/spacing.stylex";import{space}from"../../styles/spacing.stylex";import"../../styles/typography.stylex";import{fontSize,fontWeight,lineHeight}from"../../styles/typography.stylex";import{fieldStyles}from"../field/field.styles";const inputUnstyledStyles={nativeFeatures:{kONv6d:"x1ad04t7",k6bigS:"x5qecgm xythjdh",kZikHe:"x13s3p3m",kNMCen:"x1eukatj",kUKRLr:"x1gpaafl",k2O5kd:"xchrlfk",kCGpWS:"xeugw9r",kXLmdK:"x19awjbf",klxQux:"xy23zu1",kcqcaj:"x1ufjfkg x1wgrp8u",$$css:true},unstyled:{k8Qsv1:"x10l60j5",kH8XJS:"x7xwk5j",kysU6D:"xjyslct",kWkggS:"xjbqb8w",kVAM5u:"x9r1u3d",ksu8eU:"xng3xce",kMzoRj:"xc342km",kGVxlE:"x1gnnqk1",kB7OPa:"x9f619",kMwMTN:"xpfl6da x14tvo57",kkrTdU:"x1s07b3s x1ed109x",k1xSpc:"x1lliihq",kCS8Yb:"x1t1x2f9",kzQI83:"x1iyjqo2",kmuXW:"xs83m0k",kMv6JI:"xjb2p0i",kGuDYH:"x12ama9c",kC21eY:"x2vx8kg",k63SB2:"x1lo1l87",kLWn49:"x1rn0pvf",k7Eaqz:"xeuugli",kSiTet:"x1hc1fzr",kjBf7l:"x1uczgqu",k3XXqK:"x1t137rt",kMeerF:"x1k57tk5",k8WAf4:"x1a8o3s8",kwRFfy:"x9ln08h x18gr29s",kZCmMZ:"x1t24ow8 x14s0xwm",kzqmXN:"x14atkfc",$$css:true},unstyledDefault:{kZKoxP:"xx2mv8v",$$css:true},unstyledLg:{kGuDYH:"x12ama9c",kZKoxP:"x1vk83p6",$$css:true},unstyledSm:{kGuDYH:"xs18rgd x12ama9c",kZKoxP:"x97r3th",$$css:true}};export const inputStyles={...fieldStyles,nativeFeatures:inputUnstyledStyles.nativeFeatures,unstyled:inputUnstyledStyles.unstyled,unstyledDefault:inputUnstyledStyles.unstyledDefault,unstyledLg:inputUnstyledStyles.unstyledLg,unstyledSm:inputUnstyledStyles.unstyledSm};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactElement } from "react";
|
|
2
|
+
import type { Closed } from "../../closed";
|
|
3
|
+
import type { InputProps } from "../input/input";
|
|
4
|
+
import type { TextareaProps } from "../textarea/textarea";
|
|
5
|
+
export type InputGroupProps = Closed<Omit<ComponentPropsWithRef<"div">, "data-slot">>;
|
|
6
|
+
export type InputGroupAddonAlign = "block-end" | "block-start" | "inline-end" | "inline-start";
|
|
7
|
+
export type InputGroupAddonProps = Closed<Omit<ComponentPropsWithRef<"div">, "data-slot"> & {
|
|
8
|
+
align?: InputGroupAddonAlign;
|
|
9
|
+
}>;
|
|
10
|
+
export type InputGroupTextProps = Closed<Omit<ComponentPropsWithRef<"span">, "data-slot">>;
|
|
11
|
+
export type InputGroupInputProps = Closed<Omit<InputProps, "data-slot" | "unstyled">>;
|
|
12
|
+
export type InputGroupTextareaProps = Closed<Omit<TextareaProps, "data-slot" | "unstyled">>;
|
|
13
|
+
export declare function InputGroup({ role, children, ref: forwardedRef, ...rest }: InputGroupProps): ReactElement;
|
|
14
|
+
export declare function InputGroupAddon({ align, children, onMouseDown, ref: forwardedRef, ...rest }: InputGroupAddonProps): ReactElement;
|
|
15
|
+
export declare function InputGroupText({ children, ref: forwardedRef, ...rest }: InputGroupTextProps): ReactElement;
|
|
16
|
+
export declare function InputGroupInput({ ref: forwardedRef, render, ...rest }: InputGroupInputProps): ReactElement;
|
|
17
|
+
export declare function InputGroupTextarea({ ref: forwardedRef, ...rest }: InputGroupTextareaProps): ReactElement;
|