@senvenli/react 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 +32 -2
- package/dist/action/button-group.d.ts +26 -0
- package/dist/action/button-group.js +12 -0
- package/dist/action/button-group.js.map +1 -0
- package/dist/action/button.d.ts +42 -0
- package/dist/action/button.js +58 -0
- package/dist/action/button.js.map +1 -0
- package/dist/action/close-button.d.ts +12 -0
- package/dist/action/close-button.js +13 -0
- package/dist/action/close-button.js.map +1 -0
- package/dist/action/copy-button.d.ts +21 -0
- package/dist/action/copy-button.js +38 -0
- package/dist/action/copy-button.js.map +1 -0
- package/dist/action/fab.d.ts +29 -0
- package/dist/action/fab.js +57 -0
- package/dist/action/fab.js.map +1 -0
- package/dist/action/files.d.ts +70 -0
- package/dist/action/files.js +156 -0
- package/dist/action/files.js.map +1 -0
- package/dist/action/index.d.ts +23 -0
- package/dist/action/index.js +16 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/language-names.d.ts +19 -0
- package/dist/action/language-names.js +79 -0
- package/dist/action/language-names.js.map +1 -0
- package/dist/action/language-switcher.d.ts +57 -0
- package/dist/action/language-switcher.js +53 -0
- package/dist/action/language-switcher.js.map +1 -0
- package/dist/action/link-button.d.ts +57 -0
- package/dist/action/link-button.js +48 -0
- package/dist/action/link-button.js.map +1 -0
- package/dist/action/link.d.ts +24 -0
- package/dist/action/link.js +18 -0
- package/dist/action/link.js.map +1 -0
- package/dist/action/pressable.d.ts +40 -0
- package/dist/action/pressable.js +65 -0
- package/dist/action/pressable.js.map +1 -0
- package/dist/action/styles.d.ts +60 -0
- package/dist/action/styles.js +109 -0
- package/dist/action/styles.js.map +1 -0
- package/dist/action/theme-script.d.ts +12 -0
- package/dist/action/theme-script.js +23 -0
- package/dist/action/theme-script.js.map +1 -0
- package/dist/action/theme-switcher.d.ts +43 -0
- package/dist/action/theme-switcher.js +260 -0
- package/dist/action/theme-switcher.js.map +1 -0
- package/dist/action/theme-toggle.d.ts +43 -0
- package/dist/action/theme-toggle.js +259 -0
- package/dist/action/theme-toggle.js.map +1 -0
- package/dist/action/toggle.d.ts +44 -0
- package/dist/action/toggle.js +28 -0
- package/dist/action/toggle.js.map +1 -0
- package/dist/action/touch-target.d.ts +9 -0
- package/dist/action/touch-target.js +14 -0
- package/dist/action/touch-target.js.map +1 -0
- package/dist/charts/axis-width.d.ts +186 -0
- package/dist/charts/axis-width.js +1262 -0
- package/dist/charts/axis-width.js.map +1 -0
- package/dist/charts/bar-public.d.ts +16 -0
- package/dist/charts/bar-public.js +16 -0
- package/dist/charts/bar-public.js.map +1 -0
- package/dist/charts/chart-parts.d.ts +136 -0
- package/dist/charts/chart-parts.js +160 -0
- package/dist/charts/chart-parts.js.map +1 -0
- package/dist/charts/core-charts.d.ts +157 -0
- package/dist/charts/core-charts.js +505 -0
- package/dist/charts/core-charts.js.map +1 -0
- package/dist/charts/index.d.ts +12 -0
- package/dist/charts/index.js +8 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/list-charts.d.ts +124 -0
- package/dist/charts/list-charts.js +308 -0
- package/dist/charts/list-charts.js.map +1 -0
- package/dist/charts/more-charts.d.ts +138 -0
- package/dist/charts/more-charts.js +284 -0
- package/dist/charts/more-charts.js.map +1 -0
- package/dist/charts/report-charts.d.ts +138 -0
- package/dist/charts/report-charts.js +370 -0
- package/dist/charts/report-charts.js.map +1 -0
- package/dist/charts/value-tick.d.ts +178 -0
- package/dist/charts/value-tick.js +240 -0
- package/dist/charts/value-tick.js.map +1 -0
- package/dist/collection/data-table-url-hook.d.ts +34 -0
- package/dist/collection/data-table-url-hook.js +70 -0
- package/dist/collection/data-table-url-hook.js.map +1 -0
- package/dist/collection/data-table-url.d.ts +30 -0
- package/dist/collection/data-table-url.js +48 -0
- package/dist/collection/data-table-url.js.map +1 -0
- package/dist/collection/data-table.d.ts +112 -0
- package/dist/collection/data-table.js +188 -0
- package/dist/collection/data-table.js.map +1 -0
- package/dist/collection/grid-list-public.d.ts +18 -0
- package/dist/collection/grid-list-public.js +19 -0
- package/dist/collection/grid-list-public.js.map +1 -0
- package/dist/collection/grid-list.d.ts +73 -0
- package/dist/collection/grid-list.js +46 -0
- package/dist/collection/grid-list.js.map +1 -0
- package/dist/collection/index.d.ts +14 -0
- package/dist/collection/index.js +8 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/list.d.ts +61 -0
- package/dist/collection/list.js +38 -0
- package/dist/collection/list.js.map +1 -0
- package/dist/collection/selection-checkbox.d.ts +5 -0
- package/dist/collection/selection-checkbox.js +13 -0
- package/dist/collection/selection-checkbox.js.map +1 -0
- package/dist/collection/table.d.ts +91 -0
- package/dist/collection/table.js +183 -0
- package/dist/collection/table.js.map +1 -0
- package/dist/collection/tree.d.ts +31 -0
- package/dist/collection/tree.js +22 -0
- package/dist/collection/tree.js.map +1 -0
- package/dist/color/color.d.ts +87 -0
- package/dist/color/color.js +200 -0
- package/dist/color/color.js.map +1 -0
- package/dist/color/contrast.d.ts +34 -0
- package/dist/color/contrast.js +44 -0
- package/dist/color/contrast.js.map +1 -0
- package/dist/color/index.d.ts +4 -0
- package/dist/color/index.js +5 -0
- package/dist/color/index.js.map +1 -0
- package/dist/date/calendar.d.ts +71 -0
- package/dist/date/calendar.js +291 -0
- package/dist/date/calendar.js.map +1 -0
- package/dist/date/fields.d.ts +174 -0
- package/dist/date/fields.js +250 -0
- package/dist/date/fields.js.map +1 -0
- package/dist/date/index.d.ts +7 -0
- package/dist/date/index.js +6 -0
- package/dist/date/index.js.map +1 -0
- package/dist/date/month-grid.d.ts +31 -0
- package/dist/date/month-grid.js +115 -0
- package/dist/date/month-grid.js.map +1 -0
- package/dist/date/pickers.d.ts +118 -0
- package/dist/date/pickers.js +176 -0
- package/dist/date/pickers.js.map +1 -0
- package/dist/date/public.d.ts +25 -0
- package/dist/date/public.js +24 -0
- package/dist/date/public.js.map +1 -0
- package/dist/date/segments.d.ts +153 -0
- package/dist/date/segments.js +433 -0
- package/dist/date/segments.js.map +1 -0
- package/dist/defaults.d.ts +74 -0
- package/dist/defaults.js +100 -0
- package/dist/defaults.js.map +1 -0
- package/dist/density.d.ts +2 -0
- package/dist/density.js +2 -0
- package/dist/density.js.map +1 -0
- package/dist/display/avatar.d.ts +29 -0
- package/dist/display/avatar.js +71 -0
- package/dist/display/avatar.js.map +1 -0
- package/dist/display/badge.d.ts +65 -0
- package/dist/display/badge.js +99 -0
- package/dist/display/badge.js.map +1 -0
- package/dist/display/card.d.ts +72 -0
- package/dist/display/card.js +91 -0
- package/dist/display/card.js.map +1 -0
- package/dist/display/carousel.d.ts +47 -0
- package/dist/display/carousel.js +214 -0
- package/dist/display/carousel.js.map +1 -0
- package/dist/display/description-list.d.ts +25 -0
- package/dist/display/description-list.js +36 -0
- package/dist/display/description-list.js.map +1 -0
- package/dist/display/icon-aliases.d.ts +1 -0
- package/dist/display/icon-aliases.js +259 -0
- package/dist/display/icon-aliases.js.map +1 -0
- package/dist/display/icon-names.d.ts +4 -0
- package/dist/display/icon-names.js +2 -0
- package/dist/display/icon-names.js.map +1 -0
- package/dist/display/icon.d.ts +51 -0
- package/dist/display/icon.js +96 -0
- package/dist/display/icon.js.map +1 -0
- package/dist/display/image-crop.d.ts +106 -0
- package/dist/display/image-crop.js +117 -0
- package/dist/display/image-crop.js.map +1 -0
- package/dist/display/image-cropper.d.ts +68 -0
- package/dist/display/image-cropper.js +284 -0
- package/dist/display/image-cropper.js.map +1 -0
- package/dist/display/image-viewer.d.ts +54 -0
- package/dist/display/image-viewer.js +84 -0
- package/dist/display/image-viewer.js.map +1 -0
- package/dist/display/image.d.ts +26 -0
- package/dist/display/image.js +17 -0
- package/dist/display/image.js.map +1 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +16 -0
- package/dist/display/index.js.map +1 -0
- package/dist/display/iso-chip.d.ts +19 -0
- package/dist/display/iso-chip.js +21 -0
- package/dist/display/iso-chip.js.map +1 -0
- package/dist/display/kbd.d.ts +11 -0
- package/dist/display/kbd.js +33 -0
- package/dist/display/kbd.js.map +1 -0
- package/dist/display/lozenge.d.ts +30 -0
- package/dist/display/lozenge.js +55 -0
- package/dist/display/lozenge.js.map +1 -0
- package/dist/display/scroll-area.d.ts +29 -0
- package/dist/display/scroll-area.js +95 -0
- package/dist/display/scroll-area.js.map +1 -0
- package/dist/display/separator.d.ts +13 -0
- package/dist/display/separator.js +24 -0
- package/dist/display/separator.js.map +1 -0
- package/dist/display/stat.d.ts +35 -0
- package/dist/display/stat.js +41 -0
- package/dist/display/stat.js.map +1 -0
- package/dist/display/timeline.d.ts +44 -0
- package/dist/display/timeline.js +111 -0
- package/dist/display/timeline.js.map +1 -0
- package/dist/display/typography.d.ts +37 -0
- package/dist/display/typography.js +53 -0
- package/dist/display/typography.js.map +1 -0
- package/dist/display/visually-hidden.d.ts +14 -0
- package/dist/display/visually-hidden.js +10 -0
- package/dist/display/visually-hidden.js.map +1 -0
- package/dist/feedback/banner.d.ts +46 -0
- package/dist/feedback/banner.js +157 -0
- package/dist/feedback/banner.js.map +1 -0
- package/dist/feedback/cooldown.d.ts +17 -0
- package/dist/feedback/cooldown.js +59 -0
- package/dist/feedback/cooldown.js.map +1 -0
- package/dist/feedback/empty-state.d.ts +35 -0
- package/dist/feedback/empty-state.js +39 -0
- package/dist/feedback/empty-state.js.map +1 -0
- package/dist/feedback/index.d.ts +12 -0
- package/dist/feedback/index.js +11 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/feedback/meter.d.ts +33 -0
- package/dist/feedback/meter.js +42 -0
- package/dist/feedback/meter.js.map +1 -0
- package/dist/feedback/motion.d.ts +9 -0
- package/dist/feedback/motion.js +57 -0
- package/dist/feedback/motion.js.map +1 -0
- package/dist/feedback/progress.d.ts +39 -0
- package/dist/feedback/progress.js +68 -0
- package/dist/feedback/progress.js.map +1 -0
- package/dist/feedback/skeleton.d.ts +48 -0
- package/dist/feedback/skeleton.js +61 -0
- package/dist/feedback/skeleton.js.map +1 -0
- package/dist/feedback/spinner.d.ts +19 -0
- package/dist/feedback/spinner.js +29 -0
- package/dist/feedback/spinner.js.map +1 -0
- package/dist/feedback/status-dot.d.ts +23 -0
- package/dist/feedback/status-dot.js +37 -0
- package/dist/feedback/status-dot.js.map +1 -0
- package/dist/form/countries.d.ts +34 -0
- package/dist/form/countries.js +273 -0
- package/dist/form/countries.js.map +1 -0
- package/dist/form/data-attributes.d.ts +11 -0
- package/dist/form/data-attributes.js +22 -0
- package/dist/form/data-attributes.js.map +1 -0
- package/dist/form/field-parts.d.ts +113 -0
- package/dist/form/field-parts.js +178 -0
- package/dist/form/field-parts.js.map +1 -0
- package/dist/form/field.d.ts +36 -0
- package/dist/form/field.js +65 -0
- package/dist/form/field.js.map +1 -0
- package/dist/form/files.d.ts +70 -0
- package/dist/form/files.js +156 -0
- package/dist/form/files.js.map +1 -0
- package/dist/form/form.d.ts +40 -0
- package/dist/form/form.js +74 -0
- package/dist/form/form.js.map +1 -0
- package/dist/form/image-crop.d.ts +106 -0
- package/dist/form/image-crop.js +117 -0
- package/dist/form/image-crop.js.map +1 -0
- package/dist/form/image-cropper.d.ts +68 -0
- package/dist/form/image-cropper.js +284 -0
- package/dist/form/image-cropper.js.map +1 -0
- package/dist/form/index.d.ts +24 -0
- package/dist/form/index.js +15 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/input-group.d.ts +63 -0
- package/dist/form/input-group.js +63 -0
- package/dist/form/input-group.js.map +1 -0
- package/dist/form/input-otp.d.ts +35 -0
- package/dist/form/input-otp.js +83 -0
- package/dist/form/input-otp.js.map +1 -0
- package/dist/form/input.d.ts +36 -0
- package/dist/form/input.js +41 -0
- package/dist/form/input.js.map +1 -0
- package/dist/form/number-field.d.ts +84 -0
- package/dist/form/number-field.js +81 -0
- package/dist/form/number-field.js.map +1 -0
- package/dist/form/otp-field.d.ts +37 -0
- package/dist/form/otp-field.js +116 -0
- package/dist/form/otp-field.js.map +1 -0
- package/dist/form/password-field.d.ts +61 -0
- package/dist/form/password-field.js +61 -0
- package/dist/form/password-field.js.map +1 -0
- package/dist/form/phone-field.d.ts +104 -0
- package/dist/form/phone-field.js +275 -0
- package/dist/form/phone-field.js.map +1 -0
- package/dist/form/phone-paste.d.ts +24 -0
- package/dist/form/phone-paste.js +40 -0
- package/dist/form/phone-paste.js.map +1 -0
- package/dist/form/phone.d.ts +159 -0
- package/dist/form/phone.js +309 -0
- package/dist/form/phone.js.map +1 -0
- package/dist/form/search-field.d.ts +29 -0
- package/dist/form/search-field.js +23 -0
- package/dist/form/search-field.js.map +1 -0
- package/dist/form/styles.d.ts +31 -0
- package/dist/form/styles.js +43 -0
- package/dist/form/styles.js.map +1 -0
- package/dist/form/text-area.d.ts +70 -0
- package/dist/form/text-area.js +93 -0
- package/dist/form/text-area.js.map +1 -0
- package/dist/form/text-field.d.ts +131 -0
- package/dist/form/text-field.js +59 -0
- package/dist/form/text-field.js.map +1 -0
- package/dist/form/validation.d.ts +145 -0
- package/dist/form/validation.js +136 -0
- package/dist/form/validation.js.map +1 -0
- package/dist/i18n.d.ts +438 -0
- package/dist/i18n.js +948 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/intl-locale.d.ts +30 -0
- package/dist/intl-locale.js +83 -0
- package/dist/intl-locale.js.map +1 -0
- package/dist/layers.d.ts +32 -0
- package/dist/layers.js +33 -0
- package/dist/layers.js.map +1 -0
- package/dist/layout/auth-form-layout.d.ts +71 -0
- package/dist/layout/auth-form-layout.js +61 -0
- package/dist/layout/auth-form-layout.js.map +1 -0
- package/dist/layout/auth-layout.d.ts +59 -0
- package/dist/layout/auth-layout.js +26 -0
- package/dist/layout/auth-layout.js.map +1 -0
- package/dist/layout/box.d.ts +26 -0
- package/dist/layout/box.js +16 -0
- package/dist/layout/box.js.map +1 -0
- package/dist/layout/grid.d.ts +27 -0
- package/dist/layout/grid.js +26 -0
- package/dist/layout/grid.js.map +1 -0
- package/dist/layout/index.d.ts +16 -0
- package/dist/layout/index.js +12 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/pressable.d.ts +40 -0
- package/dist/layout/pressable.js +65 -0
- package/dist/layout/pressable.js.map +1 -0
- package/dist/layout/reset-sent-card.d.ts +39 -0
- package/dist/layout/reset-sent-card.js +22 -0
- package/dist/layout/reset-sent-card.js.map +1 -0
- package/dist/layout/scroll-area.d.ts +29 -0
- package/dist/layout/scroll-area.js +95 -0
- package/dist/layout/scroll-area.js.map +1 -0
- package/dist/layout/section.d.ts +41 -0
- package/dist/layout/section.js +22 -0
- package/dist/layout/section.js.map +1 -0
- package/dist/layout/split.d.ts +50 -0
- package/dist/layout/split.js +35 -0
- package/dist/layout/split.js.map +1 -0
- package/dist/layout/stack.d.ts +44 -0
- package/dist/layout/stack.js +36 -0
- package/dist/layout/stack.js.map +1 -0
- package/dist/layout/tokens.d.ts +33 -0
- package/dist/layout/tokens.js +85 -0
- package/dist/layout/tokens.js.map +1 -0
- package/dist/layout/toolbar.d.ts +37 -0
- package/dist/layout/toolbar.js +334 -0
- package/dist/layout/toolbar.js.map +1 -0
- package/dist/navigate-context.d.ts +12 -0
- package/dist/navigate-context.js +13 -0
- package/dist/navigate-context.js.map +1 -0
- package/dist/navigation/accordion.d.ts +40 -0
- package/dist/navigation/accordion.js +33 -0
- package/dist/navigation/accordion.js.map +1 -0
- package/dist/navigation/bottom-nav.d.ts +29 -0
- package/dist/navigation/bottom-nav.js +48 -0
- package/dist/navigation/bottom-nav.js.map +1 -0
- package/dist/navigation/brand-link-context.d.ts +8 -0
- package/dist/navigation/brand-link-context.js +9 -0
- package/dist/navigation/brand-link-context.js.map +1 -0
- package/dist/navigation/breadcrumbs.d.ts +36 -0
- package/dist/navigation/breadcrumbs.js +51 -0
- package/dist/navigation/breadcrumbs.js.map +1 -0
- package/dist/navigation/dock.d.ts +27 -0
- package/dist/navigation/dock.js +47 -0
- package/dist/navigation/dock.js.map +1 -0
- package/dist/navigation/footer.d.ts +43 -0
- package/dist/navigation/footer.js +43 -0
- package/dist/navigation/footer.js.map +1 -0
- package/dist/navigation/index.d.ts +22 -0
- package/dist/navigation/index.js +17 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/language-names.d.ts +19 -0
- package/dist/navigation/language-names.js +79 -0
- package/dist/navigation/language-names.js.map +1 -0
- package/dist/navigation/language-switcher.d.ts +55 -0
- package/dist/navigation/language-switcher.js +53 -0
- package/dist/navigation/language-switcher.js.map +1 -0
- package/dist/navigation/nav-panel.d.ts +18 -0
- package/dist/navigation/nav-panel.js +51 -0
- package/dist/navigation/nav-panel.js.map +1 -0
- package/dist/navigation/navbar.d.ts +73 -0
- package/dist/navigation/navbar.js +64 -0
- package/dist/navigation/navbar.js.map +1 -0
- package/dist/navigation/page-header.d.ts +37 -0
- package/dist/navigation/page-header.js +50 -0
- package/dist/navigation/page-header.js.map +1 -0
- package/dist/navigation/pagination.d.ts +25 -0
- package/dist/navigation/pagination.js +51 -0
- package/dist/navigation/pagination.js.map +1 -0
- package/dist/navigation/panel-header.d.ts +37 -0
- package/dist/navigation/panel-header.js +50 -0
- package/dist/navigation/panel-header.js.map +1 -0
- package/dist/navigation/sidebar-script.d.ts +12 -0
- package/dist/navigation/sidebar-script.js +20 -0
- package/dist/navigation/sidebar-script.js.map +1 -0
- package/dist/navigation/sidebar.d.ts +149 -0
- package/dist/navigation/sidebar.js +332 -0
- package/dist/navigation/sidebar.js.map +1 -0
- package/dist/navigation/skip-link.d.ts +12 -0
- package/dist/navigation/skip-link.js +30 -0
- package/dist/navigation/skip-link.js.map +1 -0
- package/dist/navigation/stepper.d.ts +50 -0
- package/dist/navigation/stepper.js +96 -0
- package/dist/navigation/stepper.js.map +1 -0
- package/dist/navigation/tabs.d.ts +84 -0
- package/dist/navigation/tabs.js +118 -0
- package/dist/navigation/tabs.js.map +1 -0
- package/dist/navigation/toolbar.d.ts +37 -0
- package/dist/navigation/toolbar.js +334 -0
- package/dist/navigation/toolbar.js.map +1 -0
- package/dist/overlay/alert-dialog.d.ts +63 -0
- package/dist/overlay/alert-dialog.js +76 -0
- package/dist/overlay/alert-dialog.js.map +1 -0
- package/dist/overlay/command-palette.d.ts +53 -0
- package/dist/overlay/command-palette.js +130 -0
- package/dist/overlay/command-palette.js.map +1 -0
- package/dist/overlay/command.d.ts +53 -0
- package/dist/overlay/command.js +129 -0
- package/dist/overlay/command.js.map +1 -0
- package/dist/overlay/context-menu.d.ts +29 -0
- package/dist/overlay/context-menu.js +58 -0
- package/dist/overlay/context-menu.js.map +1 -0
- package/dist/overlay/dialog.d.ts +162 -0
- package/dist/overlay/dialog.js +174 -0
- package/dist/overlay/dialog.js.map +1 -0
- package/dist/overlay/drawer.d.ts +41 -0
- package/dist/overlay/drawer.js +114 -0
- package/dist/overlay/drawer.js.map +1 -0
- package/dist/overlay/floating.d.ts +142 -0
- package/dist/overlay/floating.js +226 -0
- package/dist/overlay/floating.js.map +1 -0
- package/dist/overlay/hover-card.d.ts +19 -0
- package/dist/overlay/hover-card.js +31 -0
- package/dist/overlay/hover-card.js.map +1 -0
- package/dist/overlay/index.d.ts +18 -0
- package/dist/overlay/index.js +12 -0
- package/dist/overlay/index.js.map +1 -0
- package/dist/overlay/overlay-base.d.ts +105 -0
- package/dist/overlay/overlay-base.js +250 -0
- package/dist/overlay/overlay-base.js.map +1 -0
- package/dist/overlay/overlay.d.ts +299 -0
- package/dist/overlay/overlay.js +558 -0
- package/dist/overlay/overlay.js.map +1 -0
- package/dist/overlay/toast.d.ts +58 -0
- package/dist/overlay/toast.js +145 -0
- package/dist/overlay/toast.js.map +1 -0
- package/dist/provider.d.ts +26 -0
- package/dist/provider.js +30 -0
- package/dist/provider.js.map +1 -0
- package/dist/selection/autocomplete.d.ts +54 -0
- package/dist/selection/autocomplete.js +122 -0
- package/dist/selection/autocomplete.js.map +1 -0
- package/dist/selection/checkbox.d.ts +56 -0
- package/dist/selection/checkbox.js +49 -0
- package/dist/selection/checkbox.js.map +1 -0
- package/dist/selection/choice-size.d.ts +26 -0
- package/dist/selection/choice-size.js +50 -0
- package/dist/selection/choice-size.js.map +1 -0
- package/dist/selection/choice-text.d.ts +21 -0
- package/dist/selection/choice-text.js +33 -0
- package/dist/selection/choice-text.js.map +1 -0
- package/dist/selection/combobox.d.ts +173 -0
- package/dist/selection/combobox.js +410 -0
- package/dist/selection/combobox.js.map +1 -0
- package/dist/selection/index.d.ts +20 -0
- package/dist/selection/index.js +13 -0
- package/dist/selection/index.js.map +1 -0
- package/dist/selection/list-box.d.ts +30 -0
- package/dist/selection/list-box.js +16 -0
- package/dist/selection/list-box.js.map +1 -0
- package/dist/selection/listbox.d.ts +44 -0
- package/dist/selection/listbox.js +49 -0
- package/dist/selection/listbox.js.map +1 -0
- package/dist/selection/match.d.ts +20 -0
- package/dist/selection/match.js +57 -0
- package/dist/selection/match.js.map +1 -0
- package/dist/selection/multi-select.d.ts +72 -0
- package/dist/selection/multi-select.js +138 -0
- package/dist/selection/multi-select.js.map +1 -0
- package/dist/selection/radio-card.d.ts +31 -0
- package/dist/selection/radio-card.js +29 -0
- package/dist/selection/radio-card.js.map +1 -0
- package/dist/selection/radio.d.ts +72 -0
- package/dist/selection/radio.js +64 -0
- package/dist/selection/radio.js.map +1 -0
- package/dist/selection/select-public.d.ts +19 -0
- package/dist/selection/select-public.js +24 -0
- package/dist/selection/select-public.js.map +1 -0
- package/dist/selection/select.d.ts +72 -0
- package/dist/selection/select.js +69 -0
- package/dist/selection/select.js.map +1 -0
- package/dist/selection/slider.d.ts +16 -0
- package/dist/selection/slider.js +44 -0
- package/dist/selection/slider.js.map +1 -0
- package/dist/selection/styles.d.ts +26 -0
- package/dist/selection/styles.js +78 -0
- package/dist/selection/styles.js.map +1 -0
- package/dist/selection/switch.d.ts +24 -0
- package/dist/selection/switch.js +27 -0
- package/dist/selection/switch.js.map +1 -0
- package/dist/selection/tag-group.d.ts +38 -0
- package/dist/selection/tag-group.js +45 -0
- package/dist/selection/tag-group.js.map +1 -0
- package/dist/tone.d.ts +6 -0
- package/dist/tone.js +2 -0
- package/dist/tone.js.map +1 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +42 -0
- package/dist/utils.js.map +1 -0
- package/manifest/component.full.schema.json +391 -0
- package/manifest/component.schema.json +279 -0
- package/manifests/accordion.json +299 -0
- package/manifests/alert-dialog.json +261 -0
- package/manifests/area-chart.json +338 -0
- package/manifests/autocomplete.json +299 -0
- package/manifests/avatar.json +253 -0
- package/manifests/badge.json +288 -0
- package/manifests/banner.json +185 -0
- package/manifests/bar-chart.json +454 -0
- package/manifests/bar-list.json +262 -0
- package/manifests/bottom-nav.json +139 -0
- package/manifests/box.json +3450 -0
- package/manifests/breadcrumbs.json +199 -0
- package/manifests/button-group.json +2294 -0
- package/manifests/button.json +1211 -0
- package/manifests/calendar-heatmap.json +218 -0
- package/manifests/calendar.json +299 -0
- package/manifests/card.json +308 -0
- package/manifests/carousel.json +263 -0
- package/manifests/chart-parts.json +309 -0
- package/manifests/checkbox.json +998 -0
- package/manifests/close-button.json +1000 -0
- package/manifests/color-field.json +276 -0
- package/manifests/color-picker.json +161 -0
- package/manifests/color-swatch-picker.json +220 -0
- package/manifests/color-swatch.json +140 -0
- package/manifests/combobox.json +581 -0
- package/manifests/command.json +275 -0
- package/manifests/composed-chart.json +287 -0
- package/manifests/context-menu.json +148 -0
- package/manifests/copy-button.json +192 -0
- package/manifests/data-table.json +334 -0
- package/manifests/date-field.json +302 -0
- package/manifests/date-picker.json +472 -0
- package/manifests/description-list.json +201 -0
- package/manifests/dialog.json +322 -0
- package/manifests/donut-chart.json +264 -0
- package/manifests/drawer.json +211 -0
- package/manifests/empty-state.json +185 -0
- package/manifests/fab.json +172 -0
- package/manifests/field.json +209 -0
- package/manifests/file-upload.json +791 -0
- package/manifests/form.json +829 -0
- package/manifests/funnel-chart.json +223 -0
- package/manifests/gauge-chart.json +252 -0
- package/manifests/grid-list.json +335 -0
- package/manifests/grid.json +3482 -0
- package/manifests/heading.json +183 -0
- package/manifests/heatmap.json +265 -0
- package/manifests/hover-card.json +172 -0
- package/manifests/icon.json +201 -0
- package/manifests/image-cropper.json +295 -0
- package/manifests/image-viewer.json +198 -0
- package/manifests/image.json +193 -0
- package/manifests/index.json +2035 -0
- package/manifests/input-group.json +3571 -0
- package/manifests/input.json +1557 -0
- package/manifests/kbd.json +98 -0
- package/manifests/language-switcher.json +274 -0
- package/manifests/line-chart.json +342 -0
- package/manifests/link.json +867 -0
- package/manifests/list-box.json +213 -0
- package/manifests/menu.json +453 -0
- package/manifests/meter.json +145 -0
- package/manifests/navbar.json +281 -0
- package/manifests/otp-field.json +1029 -0
- package/manifests/page-header.json +164 -0
- package/manifests/pagination.json +181 -0
- package/manifests/popover.json +205 -0
- package/manifests/pressable.json +367 -0
- package/manifests/progress.json +282 -0
- package/manifests/radar-chart.json +229 -0
- package/manifests/radial-chart.json +195 -0
- package/manifests/radio.json +975 -0
- package/manifests/scatter-chart.json +277 -0
- package/manifests/scroll-area.json +127 -0
- package/manifests/section.json +169 -0
- package/manifests/select.json +474 -0
- package/manifests/separator.json +119 -0
- package/manifests/sidebar.json +584 -0
- package/manifests/skeleton.json +235 -0
- package/manifests/skip-link.json +89 -0
- package/manifests/slider.json +706 -0
- package/manifests/sparkline.json +208 -0
- package/manifests/spinner.json +105 -0
- package/manifests/split.json +6618 -0
- package/manifests/stack.json +3541 -0
- package/manifests/stat.json +192 -0
- package/manifests/stepper.json +279 -0
- package/manifests/switch.json +205 -0
- package/manifests/table.json +375 -0
- package/manifests/tabs.json +438 -0
- package/manifests/tag-group.json +264 -0
- package/manifests/text-area.json +1136 -0
- package/manifests/text.json +244 -0
- package/manifests/theme-switcher.json +152 -0
- package/manifests/time-field.json +284 -0
- package/manifests/timeline.json +196 -0
- package/manifests/toast.json +87 -0
- package/manifests/toggle-button.json +1489 -0
- package/manifests/toolbar.json +145 -0
- package/manifests/tooltip.json +181 -0
- package/manifests/tracker.json +192 -0
- package/manifests/tree.json +245 -0
- package/manifests/visually-hidden.json +114 -0
- package/package.json +117 -3
- package/styles/base.css +56 -0
- package/styles/theme.css +154 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The two report charts: WaterfallChart and Heatmap. Both sit on the shared ChartFrame (loading, empty
|
|
5
|
+
* and the data-table alternative) through the charts' Shell, unchanged.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Bar, BarChart as RechartsBarChart, CartesianGrid, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
|
9
|
+
import { useLocale } from "react-aria-components";
|
|
10
|
+
import { cn } from "../utils.js";
|
|
11
|
+
import { chartChangeLabel, chartDecreaseLabel, chartIncreaseLabel, chartNoValueLabel, chartPeriodLabel, chartTotalLabel, chartValueLabel, heatmapLessLabel, heatmapMoreLabel, } from "../i18n.js";
|
|
12
|
+
import { formattedValues, tickAxisWidth, tickOverhang, tickWrapWidth, valueAxisTicks } from "./axis-width.js";
|
|
13
|
+
import { ChartLegend, ChartTooltip, useChartAnimation, useChartDirection } from "./chart-parts.js";
|
|
14
|
+
import { HEAT_LEVELS, heatmapThresholds, levelOf } from "./list-charts.js";
|
|
15
|
+
import { Shell, useOnce } from "./more-charts.js";
|
|
16
|
+
import { CategoryTick, LineSpan, ValueTick, placedLine } from "./value-tick.js";
|
|
17
|
+
const plain = (value) => String(value);
|
|
18
|
+
/**
|
|
19
|
+
* The size is in `style` as well, with its unit: Recharts measures a tick for wrapping in a hidden span that
|
|
20
|
+
* takes only the tick's `style` (assigned as is, so a bare 11 is dropped). Without it the span kept the page's
|
|
21
|
+
* body size (14–16px) and a tick that fits at 11px broke over two lines ("−€" above "1.350.000").
|
|
22
|
+
*/
|
|
23
|
+
const AXIS_TICK = { fill: "var(--ds-text-subtlest)", fontSize: 11, style: { fontVariantNumeric: "tabular-nums", fontSize: "11px" } };
|
|
24
|
+
/** U+2212: the typographic minus, the same width as the plus. */
|
|
25
|
+
const MINUS = "−";
|
|
26
|
+
/** Relative tolerance under which a sum counts as zero: float residue such as 0.1 + 0.2 − 0.3 (5.6e−17). */
|
|
27
|
+
const RESIDUE = 1e-9;
|
|
28
|
+
/**
|
|
29
|
+
* The waterfall's bars: the start total from zero, each step from the running total to the next one, the end
|
|
30
|
+
* total from zero to where the steps left it. Running totals may go below zero. A start or step without a
|
|
31
|
+
* finite value is left out (the chart warns), so the end total is the sum of the finite figures. Running totals
|
|
32
|
+
* and changes within float residue of zero (relative to the largest figure), and −0, are stored as 0, so they
|
|
33
|
+
* never print as "−€ 0" or count as a decrease.
|
|
34
|
+
*/
|
|
35
|
+
export function waterfallRows(start, steps, endLabel) {
|
|
36
|
+
const finite = [start, ...steps].filter((step) => step !== undefined && Number.isFinite(step.value));
|
|
37
|
+
const scale = Math.max(1, ...finite.map((step) => Math.abs(step.value)));
|
|
38
|
+
// `|| 0` turns −0 into 0.
|
|
39
|
+
const clean = (value) => (Math.abs(value) < RESIDUE * scale ? 0 : value || 0);
|
|
40
|
+
const rows = [];
|
|
41
|
+
let running = 0;
|
|
42
|
+
if (start && Number.isFinite(start.value)) {
|
|
43
|
+
running = clean(start.value);
|
|
44
|
+
rows.push({ key: "0", name: start.name, kind: "start", from: 0, to: running });
|
|
45
|
+
}
|
|
46
|
+
for (const step of steps) {
|
|
47
|
+
if (!Number.isFinite(step.value))
|
|
48
|
+
continue;
|
|
49
|
+
const from = running;
|
|
50
|
+
const change = clean(step.value);
|
|
51
|
+
running = clean(running + change);
|
|
52
|
+
const kind = change < 0 ? "decrease" : change > 0 ? "increase" : "zero";
|
|
53
|
+
rows.push({ key: String(rows.length), name: step.name, kind, change, from, to: running });
|
|
54
|
+
}
|
|
55
|
+
rows.push({ key: String(rows.length), name: endLabel, kind: "end", from: 0, to: running });
|
|
56
|
+
return rows;
|
|
57
|
+
}
|
|
58
|
+
/** The value axis's narrowest: the 56px it always had. */
|
|
59
|
+
const AXIS_MIN = 56;
|
|
60
|
+
/** The value axis's tick count; its ticks are Recharts' own for it. */
|
|
61
|
+
const WATERFALL_TICKS = 5;
|
|
62
|
+
/** A tick of the value axis: the size through the formatter, a negative one with the typographic minus. */
|
|
63
|
+
const tickText = (format) => (value) => (value < 0 ? `${MINUS}${format(-value)}` : format(value));
|
|
64
|
+
/**
|
|
65
|
+
* The ticks the value axis draws between the data's extremes: Recharts' own nice ticks for its `["auto", "auto"]`
|
|
66
|
+
* domain, which takes in zero (every total stands on it).
|
|
67
|
+
*/
|
|
68
|
+
export function waterfallTicks(low, high) {
|
|
69
|
+
return valueAxisTicks([low, high], WATERFALL_TICKS);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The value axis's width, as the other charts size theirs (axis-width's tickAxisWidth): its longest
|
|
73
|
+
* tick as Recharts draws it (a negative one with its minus), at its estimated width plus the 8px Recharts draws it
|
|
74
|
+
* in from the plot, never under 56px and never over 128px. Ticks too long for 128px are shown with compact figures
|
|
75
|
+
* in the chart's locale, and the axis is sized for those. It was 7px a character of the longer of the data's ends
|
|
76
|
+
* rounded up: over a figure's real 7px, under a "€" or an "%", and not always the tick drawn.
|
|
77
|
+
*/
|
|
78
|
+
export function waterfallAxisWidth(low, high, format, locale) {
|
|
79
|
+
const ticks = waterfallTicks(low, high);
|
|
80
|
+
return tickAxisWidth(ticks.map(tickText(format)), AXIS_MIN, 0, locale, formattedValues(ticks, tickText(format)));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* How the three kinds part without hue: all in `ds-chart-1`. Totals are solid; steps
|
|
84
|
+
* are outlined in it, an increase filled with a 25% tint (lighter), a decrease hatched (a pattern). Every label
|
|
85
|
+
* and table cell carries the sign as well. These are the legend's and the tooltip's keys; the bars draw the same.
|
|
86
|
+
*/
|
|
87
|
+
const KEY_OUTLINE = ["0 0/100% 1.5px", "0 100%/100% 1.5px", "0 0/1.5px 100%", "100% 0/1.5px 100%"]
|
|
88
|
+
.map((place) => `linear-gradient(var(--ds-chart-1), var(--ds-chart-1)) ${place} no-repeat`)
|
|
89
|
+
.join(", ");
|
|
90
|
+
const INCREASE_TINT = "color-mix(in oklab, var(--ds-chart-1) 25%, transparent)";
|
|
91
|
+
const WATERFALL_KEY = {
|
|
92
|
+
total: "var(--ds-chart-1)",
|
|
93
|
+
increase: `${KEY_OUTLINE}, ${INCREASE_TINT}`,
|
|
94
|
+
decrease: `${KEY_OUTLINE}, repeating-linear-gradient(135deg, var(--ds-chart-1) 0 1.5px, transparent 1.5px 3.5px)`,
|
|
95
|
+
/** A zero step's tooltip key: the outline alone, neither tinted nor hatched. Never in the legend. */
|
|
96
|
+
zero: KEY_OUTLINE,
|
|
97
|
+
};
|
|
98
|
+
const keyOf = (kind) => (kind === "start" || kind === "end" ? WATERFALL_KEY.total : WATERFALL_KEY[kind]);
|
|
99
|
+
/** `+€ 12.000`, `−€ 3.400`, `€ 0`: the sign spelled out, the size through the formatter. */
|
|
100
|
+
const signed = (value, format, plus = true) => `${value > 0 && plus ? "+" : value < 0 ? MINUS : ""}${format(Math.abs(value))}`;
|
|
101
|
+
/**
|
|
102
|
+
* A running total built from positive and negative steps, with the start and end totals: how revenue becomes
|
|
103
|
+
* net after each expense. Bars float from the running total before a step to the one after it, joined by thin
|
|
104
|
+
* dashed connectors; totals stand on zero, and a zero line shows when a total goes negative. Totals are solid
|
|
105
|
+
* `ds-chart-1`, increases outlined with a 25% tint, decreases outlined and hatched, each labeled with its signed
|
|
106
|
+
* value. The arrow keys move between bars with the tooltip (change and running total); the data table has them all.
|
|
107
|
+
*/
|
|
108
|
+
export function WaterfallChart({ title, "aria-label": ariaLabel, period, start, steps, endLabel, valueFormatter = plain, isLoading, emptyState, height = 240 }) {
|
|
109
|
+
const { locale } = useLocale();
|
|
110
|
+
const animate = useChartAnimation();
|
|
111
|
+
const direction = useChartDirection();
|
|
112
|
+
const patternId = `ds-waterfall-hatch-${React.useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
113
|
+
useOnce([start, ...steps].some((step) => step && !Number.isFinite(step.value)), "WaterfallChart: a start or steps without a finite value are left out; the end total is the sum of the finite figures.");
|
|
114
|
+
const rows = waterfallRows(start, steps, endLabel).map((row) => ({ ...row, band: [Math.min(row.from, row.to), Math.max(row.from, row.to)] }));
|
|
115
|
+
// Nothing to draw: no step, or every figure zero (start included), which counts as nothing measured.
|
|
116
|
+
const isEmpty = rows.every((row) => row.from === 0 && row.to === 0);
|
|
117
|
+
const low = Math.min(0, ...rows.map((row) => row.band[0]));
|
|
118
|
+
const high = Math.max(0, ...rows.map((row) => row.band[1]));
|
|
119
|
+
const axisWidth = waterfallAxisWidth(low, high, valueFormatter, locale);
|
|
120
|
+
// The 20px top margin holds a top value tick of up to three lines; one of more takes the room it needs above its
|
|
121
|
+
// gridline past the 8px a one-line tick takes (axis-width's tickOverhang).
|
|
122
|
+
const axisTicks = waterfallTicks(low, high);
|
|
123
|
+
const axisTexts = axisTicks.map(tickText(valueFormatter));
|
|
124
|
+
const top = Math.max(20, 8 + tickOverhang(axisTexts.at(-1), tickWrapWidth(axisWidth), locale, axisTexts, formattedValues(axisTicks, tickText(valueFormatter))));
|
|
125
|
+
const total = chartTotalLabel(locale);
|
|
126
|
+
const change = chartChangeLabel(locale);
|
|
127
|
+
const isTotal = (row) => row.kind === "start" || row.kind === "end";
|
|
128
|
+
const label = (row) => (isTotal(row) ? signed(row.to, valueFormatter, false) : signed(row.change, valueFormatter));
|
|
129
|
+
const tableRows = rows.map((row) => ({ ...row, changeText: isTotal(row) ? "" : signed(row.change, valueFormatter), totalText: signed(row.to, valueFormatter, false) }));
|
|
130
|
+
const columns = [
|
|
131
|
+
{ key: "name", header: title ?? ariaLabel ?? "", isRowHeader: true },
|
|
132
|
+
{ key: "changeText", header: change, align: "end" },
|
|
133
|
+
{ key: "totalText", header: total, align: "end" },
|
|
134
|
+
];
|
|
135
|
+
// A zero step enables no key: it is neither an increase nor a decrease, and its label says "€ 0".
|
|
136
|
+
const kinds = new Set(rows.map((row) => (isTotal(row) ? "total" : row.kind)));
|
|
137
|
+
const legend = (_jsx(ChartLegend, { items: [
|
|
138
|
+
{ key: "increase", label: chartIncreaseLabel(locale), color: WATERFALL_KEY.increase, kind: "bar" },
|
|
139
|
+
{ key: "decrease", label: chartDecreaseLabel(locale), color: WATERFALL_KEY.decrease, kind: "bar" },
|
|
140
|
+
{ key: "total", label: total, color: WATERFALL_KEY.total, kind: "bar" },
|
|
141
|
+
].filter((item) => kinds.has(item.key)) }));
|
|
142
|
+
return (_jsx(Shell, { title: title, "aria-label": ariaLabel, period: period, isLoading: isLoading, emptyState: emptyState, isEmpty: isEmpty, height: height, legend: legend, columns: columns, rows: tableRows, children: _jsx("div", { "data-slot": "waterfall", className: "h-full min-w-0", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(RechartsBarChart, { data: rows, barCategoryGap: "20%", accessibilityLayer: true, margin: { top, right: 4, bottom: 0, left: 4 }, children: [_jsx("defs", { children: _jsx("pattern", { id: patternId, "data-slot": "waterfall-hatch", width: "5", height: "5", patternUnits: "userSpaceOnUse", patternTransform: "rotate(45)", children: _jsx("line", { x1: "0", y1: "0", x2: "0", y2: "5", stroke: "var(--ds-chart-1)", strokeWidth: "1.5" }) }) }), _jsx(CartesianGrid, { vertical: false, stroke: "var(--ds-border)" }), _jsx(XAxis, { dataKey: "key", reversed: direction.reversed, tickLine: false, axisLine: { stroke: "var(--ds-border-bold)" },
|
|
143
|
+
// Recharts' ticks, kept inside the chart: the last step's name may be wider than its band.
|
|
144
|
+
tick: _jsx(CategoryTick, { ...AXIS_TICK }), tickFormatter: (key) => rows[Number(key)]?.name ?? "" }), _jsx(YAxis, { orientation: direction.valueAxis, tickLine: false, axisLine: false,
|
|
145
|
+
// The DS's tick (ValueTick), given the room the axis has for it: a figure never parts from its sign and
|
|
146
|
+
// currency, and ticks too long for 128px show compact figures.
|
|
147
|
+
tick: _jsx(ValueTick, { ...AXIS_TICK, width: tickWrapWidth(axisWidth), axisTicks: waterfallTicks(low, high) }), tickCount: WATERFALL_TICKS,
|
|
148
|
+
// Wide enough for its longest tick ("−€ 2.000.000"), 56–128px.
|
|
149
|
+
width: axisWidth,
|
|
150
|
+
// Every total stands on zero, so the data's own range includes it; "auto" rounds both ends.
|
|
151
|
+
domain: ["auto", "auto"], tickFormatter: tickText(valueFormatter) }), low < 0 && _jsx(ReferenceLine, { y: 0, stroke: "var(--ds-border-bold)", className: "ds-waterfall-zero" }), rows.slice(0, -1).map((row, index) => (_jsx(ReferenceLine, { segment: [
|
|
152
|
+
{ x: row.key, y: row.to },
|
|
153
|
+
{ x: rows[index + 1].key, y: row.to },
|
|
154
|
+
], stroke: "var(--ds-border-bold)", strokeDasharray: "2 2", ifOverflow: "visible" }, `connector-${row.key}`))), _jsx(Bar, { dataKey: "band", isAnimationActive: animate, shape: (props) => _jsx(WaterfallBar, { ...props, patternId: patternId, label: label }) }), _jsx(Tooltip, { isAnimationActive: animate, cursor: { fill: "var(--ds-background-neutral)", opacity: 0.5 }, content: ({ active, payload }) => {
|
|
155
|
+
const row = payload?.[0]?.payload;
|
|
156
|
+
if (!active || !row)
|
|
157
|
+
return null;
|
|
158
|
+
return (_jsx(ChartTooltip, { active: true, label: row.name, payload: isTotal(row)
|
|
159
|
+
? [{ dataKey: "total", name: total, value: signed(row.to, valueFormatter, false), color: keyOf(row.kind) }]
|
|
160
|
+
: [
|
|
161
|
+
{ dataKey: "change", name: change, value: signed(row.change, valueFormatter), color: keyOf(row.kind) },
|
|
162
|
+
{ dataKey: "total", name: total, value: signed(row.to, valueFormatter, false), color: "transparent" },
|
|
163
|
+
] }));
|
|
164
|
+
} })] }) }) }) }));
|
|
165
|
+
}
|
|
166
|
+
/** About how wide an 11px tabular label is, per character: enough to tell whether it fits over its bar. */
|
|
167
|
+
const LABEL_CHAR = 6;
|
|
168
|
+
/**
|
|
169
|
+
* One waterfall bar: solid for a total, outlined and tinted for an increase, outlined and hatched for a decrease, a
|
|
170
|
+
* flat line for a zero step;
|
|
171
|
+
* its signed value above it while that fits the bar's band (a narrow chart leaves it to the tooltip and table).
|
|
172
|
+
*/
|
|
173
|
+
function WaterfallBar({ x = 0, y = 0, width = 0, height = 0, payload, patternId, label }) {
|
|
174
|
+
if (!payload)
|
|
175
|
+
return null;
|
|
176
|
+
// Range bars can arrive with a negative size (a reversed axis); draw from the top-left corner. A zero step
|
|
177
|
+
// shows as a flat 1.5px ds-chart-1 line at the running total (no outline box, no tint), so its place is not a gap.
|
|
178
|
+
const left = width < 0 ? x + width : x;
|
|
179
|
+
const top = height < 0 ? y + height : y;
|
|
180
|
+
const w = Math.abs(width);
|
|
181
|
+
const h = Math.max(1, Math.abs(height));
|
|
182
|
+
const total = payload.kind === "start" || payload.kind === "end";
|
|
183
|
+
const fill = total ? "var(--ds-chart-1)" : payload.kind === "increase" ? INCREASE_TINT : `url(#${patternId})`;
|
|
184
|
+
const text = label(payload);
|
|
185
|
+
// The bar is 80% of its band (barCategoryGap 20%): the label may use the whole band.
|
|
186
|
+
const fits = text.length * LABEL_CHAR <= w / 0.8 - 4;
|
|
187
|
+
return (_jsxs("g", { "data-slot": "waterfall-bar", "data-kind": payload.kind, children: [fits && (_jsx("text", { "data-slot": "waterfall-label", x: left + w / 2, y: top - 6, textAnchor: "middle", fill: "var(--ds-text-subtle)", fontSize: 11, style: { fontVariantNumeric: "tabular-nums" }, children: _jsx(LineSpan, { ...placedLine(text, left + w / 2, "middle"), inherited: "middle", dy: "0", children: text }) })), total ? (_jsx("rect", { x: left, y: top, width: w, height: h, rx: 2, fill: fill })) : payload.kind === "zero" ? (_jsx("rect", { x: left, y: top - 0.75, width: w, height: 1.5, fill: "var(--ds-chart-1)" })) : (
|
|
188
|
+
// The outline inside the bar's box, so increases and decreases keep the totals' width.
|
|
189
|
+
_jsx("rect", { x: left + 0.75, y: top + 0.75, width: Math.max(0, w - 1.5), height: Math.max(0, h - 1.5), rx: 1.5, fill: fill, stroke: "var(--ds-chart-1)", strokeWidth: 1.5 }))] }));
|
|
190
|
+
}
|
|
191
|
+
/** A cell with no data: hatched, so it never passes for zero's flat `ds-background-neutral`. */
|
|
192
|
+
const HEAT_MISSING = "repeating-linear-gradient(135deg, var(--ds-background-neutral-pressed) 0 2px, transparent 2px 5px)";
|
|
193
|
+
/** Whether the bounds rise strictly, each one finite: otherwise the steps no longer follow the values. */
|
|
194
|
+
const ascending = (bounds) => bounds.every((bound, index) => Number.isFinite(bound) && (index === 0 || bound > bounds[index - 1]));
|
|
195
|
+
const hasDuplicates = (names) => new Set(names).size !== names.length;
|
|
196
|
+
/**
|
|
197
|
+
* A value over a grid of two cycles, month by weekday or week by weekday: when demand peaks. Cells share
|
|
198
|
+
* the CalendarHeatmap's five steps (zero or less in `ds-background-neutral`, then the `ds-chart-1` ramp, steps
|
|
199
|
+
* that differ in lightness), a cell with no data is hatched and named "No data", and a pair with no entry draws an
|
|
200
|
+
* empty gap. Column labels above, row labels at the inline start, a "Less … More" scale under the grid. No text is
|
|
201
|
+
* drawn over the cells.
|
|
202
|
+
*
|
|
203
|
+
* Screen readers: every row of the grid has as many cells as the header row (the corner is a column header named
|
|
204
|
+
* by `rowHeader`, a gap an empty, unfocusable grid cell), so each cell sits under its own column's header.
|
|
205
|
+
*
|
|
206
|
+
* Keyboard and pointer: one tab stop. The arrow keys move focus a cell (mirrored in RTL, skipping gaps), Home
|
|
207
|
+
* and End go to the row's ends, Ctrl+Home and Ctrl+End to the grid's; Enter and Space press the focused cell.
|
|
208
|
+
* Hovering never moves focus or the tab stop. The tooltip shows the cell under the pointer while it is over one,
|
|
209
|
+
* and the focused cell otherwise; a key that moves focus hands the tooltip back to the focused cell until the
|
|
210
|
+
* pointer enters another cell. Escape hides it.
|
|
211
|
+
*/
|
|
212
|
+
export function Heatmap({ title, "aria-label": ariaLabel, period, rows, columns, data, rowHeader, thresholds, valueFormatter = plain, onCellPress, isLoading, emptyState }) {
|
|
213
|
+
const { locale } = useLocale();
|
|
214
|
+
const { isRtl } = useChartDirection();
|
|
215
|
+
const animate = useChartAnimation();
|
|
216
|
+
const noValue = chartNoValueLabel(locale);
|
|
217
|
+
const rowHeaderLabel = rowHeader ?? chartPeriodLabel(locale);
|
|
218
|
+
// Cells by position; a pair given twice keeps its last entry.
|
|
219
|
+
const byPair = new Map();
|
|
220
|
+
for (const cell of data)
|
|
221
|
+
if (rows.includes(cell.row) && columns.includes(cell.column))
|
|
222
|
+
byPair.set(`${cell.row}\u0000${cell.column}`, cell);
|
|
223
|
+
useOnce(data.some((cell) => !rows.includes(cell.row) || !columns.includes(cell.column)), "Heatmap: a cell outside rows and columns is left out.");
|
|
224
|
+
useOnce(hasDuplicates(rows) || hasDuplicates(columns), "Heatmap: rows and columns need unique names; a repeated name's cells are drawn in its first row or column only.");
|
|
225
|
+
useOnce(thresholds !== undefined && !ascending(thresholds), "Heatmap: thresholds must be four finite, strictly ascending bounds.");
|
|
226
|
+
const slots = [];
|
|
227
|
+
const grid = rows.map((row, r) => columns.map((column, c) => {
|
|
228
|
+
// A repeated name is a gap after its first place, so no cell is drawn (or reached by the arrows) twice.
|
|
229
|
+
if (rows.indexOf(row) !== r || columns.indexOf(column) !== c)
|
|
230
|
+
return undefined;
|
|
231
|
+
const cell = byPair.get(`${row}\u0000${column}`);
|
|
232
|
+
if (!cell)
|
|
233
|
+
return undefined;
|
|
234
|
+
const slot = { cell, row: r, column: c, index: slots.length };
|
|
235
|
+
slots.push(slot);
|
|
236
|
+
return slot;
|
|
237
|
+
}));
|
|
238
|
+
const values = slots.map((slot) => slot.cell.value).filter((value) => value !== null && Number.isFinite(value));
|
|
239
|
+
const bounds = thresholds ?? heatmapThresholds(values);
|
|
240
|
+
const hasMissing = slots.some((slot) => slot.cell.value === null || !Number.isFinite(slot.cell.value));
|
|
241
|
+
const format = (value) => (value === null || !Number.isFinite(value) ? noValue : valueFormatter(value));
|
|
242
|
+
const nameOf = (cell) => cell.label ?? `${cell.row}, ${cell.column}: ${format(cell.value)}`;
|
|
243
|
+
// levelOf gives a negative value step 0, the same as zero.
|
|
244
|
+
const fillOf = (cell) => (cell.value === null || !Number.isFinite(cell.value) ? HEAT_MISSING : HEAT_LEVELS[levelOf(cell.value, bounds)]);
|
|
245
|
+
// The roving tab stop and the keys follow focus only (the first cell until the reader moves); the pointer only
|
|
246
|
+
// ever sets `hovered`, which the tooltip prefers while `tip.hover` holds.
|
|
247
|
+
const [focused, setFocused] = React.useState(0);
|
|
248
|
+
const [hovered, setHovered] = React.useState(null);
|
|
249
|
+
const [tip, setTip] = React.useState({ focus: false, hover: false });
|
|
250
|
+
const current = Math.min(focused, Math.max(0, slots.length - 1));
|
|
251
|
+
const cells = React.useRef([]);
|
|
252
|
+
const move = (from, key, ctrl) => {
|
|
253
|
+
const forward = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
254
|
+
const back = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
255
|
+
const walk = (dr, dc) => {
|
|
256
|
+
for (let r = from.row + dr, c = from.column + dc; r >= 0 && r < rows.length && c >= 0 && c < columns.length; r += dr, c += dc) {
|
|
257
|
+
if (grid[r][c])
|
|
258
|
+
return grid[r][c];
|
|
259
|
+
}
|
|
260
|
+
return undefined;
|
|
261
|
+
};
|
|
262
|
+
if (key === forward)
|
|
263
|
+
return walk(0, 1);
|
|
264
|
+
if (key === back)
|
|
265
|
+
return walk(0, -1);
|
|
266
|
+
if (key === "ArrowDown")
|
|
267
|
+
return walk(1, 0);
|
|
268
|
+
if (key === "ArrowUp")
|
|
269
|
+
return walk(-1, 0);
|
|
270
|
+
if (key === "Home")
|
|
271
|
+
return ctrl ? slots[0] : grid[from.row].find(Boolean);
|
|
272
|
+
if (key === "End")
|
|
273
|
+
return ctrl ? slots[slots.length - 1] : [...grid[from.row]].reverse().find(Boolean);
|
|
274
|
+
return undefined;
|
|
275
|
+
};
|
|
276
|
+
const tableRows = rows.map((row, r) => ({
|
|
277
|
+
id: r,
|
|
278
|
+
row,
|
|
279
|
+
...Object.fromEntries(columns.map((_, c) => [`c${c}`, grid[r][c] ? format(grid[r][c].cell.value) : ""])),
|
|
280
|
+
}));
|
|
281
|
+
const tableColumns = [
|
|
282
|
+
{ key: "row", header: rowHeaderLabel, isRowHeader: true },
|
|
283
|
+
...columns.map((column, c) => ({ key: `c${c}`, header: column, align: "end" })),
|
|
284
|
+
];
|
|
285
|
+
// Cell rows of 28px with 3px gaps, the column labels, the scale and their gaps.
|
|
286
|
+
const height = 16 + 6 + rows.length * 28 + Math.max(0, rows.length - 1) * 3 + 12 + 20;
|
|
287
|
+
const focusedSlot = slots[current];
|
|
288
|
+
const hoveredSlot = hovered === null ? undefined : slots[hovered];
|
|
289
|
+
const tipSlot = tip.hover && hoveredSlot ? hoveredSlot : tip.focus ? focusedSlot : undefined;
|
|
290
|
+
return (_jsx(Shell, { title: title, "aria-label": ariaLabel, period: period, isLoading: isLoading, emptyState: emptyState, isEmpty: values.length === 0, height: height, columns: tableColumns, rows: tableRows, children: _jsxs("div", { "data-slot": "heatmap", className: "relative flex min-w-0 flex-col gap-ds-150", children: [_jsx("div", { className: "min-w-0 overflow-x-auto", "data-slot": "heatmap-scroll", children: _jsxs("div", { role: "grid", "aria-label": title ?? ariaLabel, "data-slot": "heatmap-grid", className: "grid min-w-max gap-[3px]", style: { gridTemplateColumns: `max-content repeat(${columns.length}, minmax(1.5rem, 1fr))` }, onKeyDown: (event) => {
|
|
291
|
+
// Every key acts on the focused cell, never on the one under the pointer.
|
|
292
|
+
if (!focusedSlot)
|
|
293
|
+
return;
|
|
294
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
295
|
+
// Space never scrolls the page from inside the grid.
|
|
296
|
+
event.preventDefault();
|
|
297
|
+
onCellPress?.(focusedSlot.cell);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (event.key === "Escape") {
|
|
301
|
+
setTip({ focus: false, hover: false });
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const next = move(focusedSlot, event.key, event.ctrlKey || event.metaKey);
|
|
305
|
+
if (!next)
|
|
306
|
+
return;
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
setFocused(next.index);
|
|
309
|
+
// The keyboard takes the tooltip back from the pointer.
|
|
310
|
+
setTip({ focus: true, hover: false });
|
|
311
|
+
cells.current[next.index]?.focus();
|
|
312
|
+
}, onFocus: () => setTip((state) => ({ ...state, focus: true })), onBlur: (event) => {
|
|
313
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
314
|
+
setTip((state) => ({ ...state, focus: false }));
|
|
315
|
+
}, onMouseLeave: () => {
|
|
316
|
+
setHovered(null);
|
|
317
|
+
setTip((state) => ({ ...state, hover: false }));
|
|
318
|
+
}, children: [_jsxs("div", { role: "row", className: "contents", children: [_jsx("span", { role: "columnheader", "aria-label": rowHeaderLabel, "data-slot": "heatmap-corner", className: "h-4" }), columns.map((column, c) => (_jsx("span", { role: "columnheader", "data-slot": "heatmap-column", className: "h-4 truncate text-center text-[11px] leading-4 text-ds-text-subtlest", children: column }, c)))] }), rows.map((row, r) => (_jsxs("div", { role: "row", "data-slot": "heatmap-row", className: "contents", children: [_jsx("span", { role: "rowheader", className: "flex h-7 items-center truncate pe-ds-100 text-body-small text-ds-text-subtle", children: _jsx("bdi", { children: row }) }), columns.map((_, c) => {
|
|
319
|
+
const slot = grid[r][c];
|
|
320
|
+
// An empty, unfocusable cell: it keeps the column count, so the cells after it stay under their headers.
|
|
321
|
+
if (!slot)
|
|
322
|
+
return _jsx("span", { role: "gridcell", "data-slot": "heatmap-gap", className: "h-7" }, c);
|
|
323
|
+
const missing = slot.cell.value === null || !Number.isFinite(slot.cell.value);
|
|
324
|
+
return (_jsx("span", { ref: (element) => {
|
|
325
|
+
cells.current[slot.index] = element;
|
|
326
|
+
}, role: "gridcell", "aria-label": nameOf(slot.cell), "data-slot": "heatmap-cell", "data-state": missing ? "missing" : slot.cell.value === 0 ? "zero" : "value", "data-level": missing ? undefined : levelOf(slot.cell.value, bounds), tabIndex: slot.index === current ? 0 : -1, onFocus: () => setFocused(slot.index), onMouseEnter: () => {
|
|
327
|
+
setHovered(slot.index);
|
|
328
|
+
setTip((state) => ({ ...state, hover: true }));
|
|
329
|
+
}, onMouseLeave: () => setHovered((index) => (index === slot.index ? null : index)), onClick: () => onCellPress?.(slot.cell), className: cn("h-7 rounded-[3px] outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused", animate && "transition-[background-color] duration-150", onCellPress && "cursor-pointer"), style: { background: fillOf(slot.cell) } }, c));
|
|
330
|
+
})] }, r)))] }) }), _jsxs("div", { "data-slot": "heatmap-scale", className: "flex flex-wrap items-center gap-x-ds-200 gap-y-ds-050 text-body-small text-ds-text-subtle", children: [_jsxs("span", { className: "flex items-center gap-ds-075", children: [_jsx("span", { children: heatmapLessLabel(locale) }), _jsx("span", { "aria-hidden": true, className: "flex gap-[3px]", children: HEAT_LEVELS.map((background, level) => (_jsx("span", { "data-level": level, className: "size-3 rounded-[2px]", style: { background } }, level))) }), _jsx("span", { children: heatmapMoreLabel(locale) })] }), hasMissing && (_jsxs("span", { "data-slot": "heatmap-missing-key", className: "flex items-center gap-ds-075", children: [_jsx("span", { "aria-hidden": true, className: "size-3 rounded-[2px]", style: { background: HEAT_MISSING } }), noValue] }))] }), tipSlot && (_jsx(HeatTooltip, { anchor: cells.current[tipSlot.index] ?? null, title: tipSlot.cell.label ?? `${tipSlot.cell.row} · ${tipSlot.cell.column}`, children: _jsx(ChartTooltip, { active: true, label: tipSlot.cell.label ?? `${tipSlot.cell.row} · ${tipSlot.cell.column}`, payload: [{ dataKey: "value", name: chartValueLabel(locale), value: format(tipSlot.cell.value), color: fillOf(tipSlot.cell) }] }) }))] }) }));
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* The shared ChartTooltip over a cell: above it, or under it when there is no room; kept inside the chart's
|
|
334
|
+
* width. Placed again when the grid's sideways scroll container scrolls or the window resizes, so it stays on
|
|
335
|
+
* its cell. Hidden from screen readers, which read the cell's own name.
|
|
336
|
+
*/
|
|
337
|
+
function HeatTooltip({ anchor, title, children }) {
|
|
338
|
+
const ref = React.useRef(null);
|
|
339
|
+
const [place, setPlace] = React.useState(null);
|
|
340
|
+
React.useLayoutEffect(() => {
|
|
341
|
+
const tooltip = ref.current;
|
|
342
|
+
const box = tooltip?.parentElement;
|
|
343
|
+
if (!tooltip || !box || !anchor)
|
|
344
|
+
return;
|
|
345
|
+
const position = () => {
|
|
346
|
+
const frame = box.getBoundingClientRect();
|
|
347
|
+
const cell = anchor.getBoundingClientRect();
|
|
348
|
+
const width = tooltip.offsetWidth;
|
|
349
|
+
const heightOf = tooltip.offsetHeight;
|
|
350
|
+
const center = cell.left - frame.left + cell.width / 2;
|
|
351
|
+
const left = Math.min(Math.max(0, center - width / 2), Math.max(0, frame.width - width));
|
|
352
|
+
// Above the cell while it fits in the viewport, under it otherwise.
|
|
353
|
+
const top = cell.top - heightOf - 8 >= 0 ? cell.top - frame.top - heightOf - 8 : cell.bottom - frame.top + 8;
|
|
354
|
+
setPlace((previous) => (previous && previous.left === left && previous.top === top ? previous : { left, top }));
|
|
355
|
+
};
|
|
356
|
+
position();
|
|
357
|
+
const scroller = anchor.closest("[data-slot='heatmap-scroll']");
|
|
358
|
+
scroller?.addEventListener("scroll", position, { passive: true });
|
|
359
|
+
window.addEventListener("resize", position);
|
|
360
|
+
return () => {
|
|
361
|
+
scroller?.removeEventListener("scroll", position);
|
|
362
|
+
window.removeEventListener("resize", position);
|
|
363
|
+
};
|
|
364
|
+
}, [anchor, title]);
|
|
365
|
+
return (_jsx("div", { ref: ref, "aria-hidden": true, "data-slot": "heatmap-tooltip",
|
|
366
|
+
// Its own width (max-content, at most the chart's), never squeezed by where it sits, so the placing
|
|
367
|
+
// above measures the width it will have.
|
|
368
|
+
className: "pointer-events-none absolute z-10 w-max max-w-full", style: place ? { left: place.left, top: place.top } : { left: 0, top: 0, visibility: "hidden" }, children: children }));
|
|
369
|
+
}
|
|
370
|
+
//# sourceMappingURL=report-charts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-charts.js","sourceRoot":"","sources":["../../src/charts/report-charts.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,QAAQ,IAAI,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACvI,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAA4B,MAAM,eAAe,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7E,MAAM,KAAK,GAAwB,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5D;;;;GAIG;AACH,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,yBAAyB,EAAE,QAAQ,EAAE,EAAE,EAAE,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,IAAI,KAAK,IAAI,IAAI,QAAQ,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QAClH,CAAC,CAAC;QACF,QAAQ,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;QAChE,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC5C,OAAO,GAAG,EAAE;YACV,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAClD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IACpB,OAAO,CACL,cACE,GAAG,EAAE,GAAG,oCAEE,iBAAiB;QAC3B,oGAAoG;QACpG,yCAAyC;QACzC,SAAS,EAAC,oDAAoD,EAC9D,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,YAE9F,QAAQ,GACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\n/**\n * The two report charts: WaterfallChart and Heatmap. Both sit on the shared ChartFrame (loading, empty\n * and the data-table alternative) through the charts' Shell, unchanged.\n */\n\nimport * as React from \"react\";\nimport { Bar, BarChart as RechartsBarChart, CartesianGrid, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis } from \"recharts\";\nimport { useLocale } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport type { TableColumn } from \"../collection/table\";\nimport {\n chartChangeLabel,\n chartDecreaseLabel,\n chartIncreaseLabel,\n chartNoValueLabel,\n chartPeriodLabel,\n chartTotalLabel,\n chartValueLabel,\n heatmapLessLabel,\n heatmapMoreLabel,\n} from \"../i18n\";\nimport { formattedValues, tickAxisWidth, tickOverhang, tickWrapWidth, valueAxisTicks } from \"./axis-width\";\nimport { ChartLegend, ChartTooltip, useChartAnimation, useChartDirection, type ChartValueFormatter } from \"./chart-parts\";\nimport { HEAT_LEVELS, heatmapThresholds, levelOf } from \"./list-charts\";\nimport { Shell, useOnce } from \"./more-charts\";\nimport { CategoryTick, LineSpan, ValueTick, placedLine } from \"./value-tick\";\n\nconst plain: ChartValueFormatter = (value) => String(value);\n/**\n * The size is in `style` as well, with its unit: Recharts measures a tick for wrapping in a hidden span that\n * takes only the tick's `style` (assigned as is, so a bare 11 is dropped). Without it the span kept the page's\n * body size (14–16px) and a tick that fits at 11px broke over two lines (\"−€\" above \"1.350.000\").\n */\nconst AXIS_TICK = { fill: \"var(--ds-text-subtlest)\", fontSize: 11, style: { fontVariantNumeric: \"tabular-nums\", fontSize: \"11px\" } } as const;\n/** U+2212: the typographic minus, the same width as the plus. */\nconst MINUS = \"−\";\n\ntype FrameProps = {\n /** What the chart shows (\"Income and expenses\"), over it; leave it out when a card or a heading already says so. */\n title?: string;\n /** Names the chart when it has no visible `title`. */\n \"aria-label\"?: string;\n /** The period it covers (\"September 2026\"). */\n period?: string;\n isLoading?: boolean;\n /** Shown instead of the plot when there is no data: an `EmptyState size=\"small\"` or text; \"No data\" by default. */\n emptyState?: React.ReactNode;\n};\n\n/* ── WaterfallChart ───────────────────────────────────────────────────────── */\n\nexport type WaterfallChartStep = { name: string; value: number };\n\nexport type WaterfallChartProps = FrameProps & {\n /**\n * The opening total (\"Opening balance\"), a total bar from zero; the running total starts at 0 without it. A\n * start without a finite value (NaN, ±Infinity) is left out the same way, with a warning in the console: no\n * start bar, the running total starts at 0, and the end total is the finite steps' sum (never NaN).\n */\n start?: WaterfallChartStep;\n /**\n * The changes, in order: a positive value raises the running total, a negative one lowers it, and a zero leaves\n * it (a neutral step: a flat 1.5px line at the running total, labeled \"€ 0\" with no sign, and no legend key of\n * its own). Steps without a finite value are left out, with a warning in the console. When nothing moves off\n * zero (no step, or every figure zero, start included), the chart counts it as nothing measured and shows the\n * empty state.\n */\n steps: readonly WaterfallChartStep[];\n /** The closing total's name (\"Net\"): a total bar from zero to the start plus every step. */\n endLabel: string;\n /**\n * Shared by the axis, the labels, the tooltip and the table (\"€ 48.920\"). Changes and a negative total are\n * formatted by their size with a `+` or `−` before them, so the formatter sees non-negative values there.\n */\n valueFormatter?: ChartValueFormatter;\n /** The plot's height in px; 240 by default. */\n height?: number;\n};\n\n/** One bar of the waterfall: where it starts and ends on the value axis, and what it is. */\nexport type WaterfallRow = {\n key: string;\n name: string;\n /** `zero`: a step of 0 (or one within float residue of it), neither an increase nor a decrease. */\n kind: \"start\" | \"increase\" | \"decrease\" | \"zero\" | \"end\";\n /** The step's signed change; undefined for a total. */\n change?: number;\n /** The running total before and after this bar (a total runs from 0). */\n from: number;\n to: number;\n};\n\n/** Relative tolerance under which a sum counts as zero: float residue such as 0.1 + 0.2 − 0.3 (5.6e−17). */\nconst RESIDUE = 1e-9;\n\n/**\n * The waterfall's bars: the start total from zero, each step from the running total to the next one, the end\n * total from zero to where the steps left it. Running totals may go below zero. A start or step without a\n * finite value is left out (the chart warns), so the end total is the sum of the finite figures. Running totals\n * and changes within float residue of zero (relative to the largest figure), and −0, are stored as 0, so they\n * never print as \"−€ 0\" or count as a decrease.\n */\nexport function waterfallRows(start: WaterfallChartStep | undefined, steps: readonly WaterfallChartStep[], endLabel: string): WaterfallRow[] {\n const finite = [start, ...steps].filter((step): step is WaterfallChartStep => step !== undefined && Number.isFinite(step.value));\n const scale = Math.max(1, ...finite.map((step) => Math.abs(step.value)));\n // `|| 0` turns −0 into 0.\n const clean = (value: number) => (Math.abs(value) < RESIDUE * scale ? 0 : value || 0);\n const rows: WaterfallRow[] = [];\n let running = 0;\n if (start && Number.isFinite(start.value)) {\n running = clean(start.value);\n rows.push({ key: \"0\", name: start.name, kind: \"start\", from: 0, to: running });\n }\n for (const step of steps) {\n if (!Number.isFinite(step.value)) continue;\n const from = running;\n const change = clean(step.value);\n running = clean(running + change);\n const kind = change < 0 ? \"decrease\" : change > 0 ? \"increase\" : \"zero\";\n rows.push({ key: String(rows.length), name: step.name, kind, change, from, to: running });\n }\n rows.push({ key: String(rows.length), name: endLabel, kind: \"end\", from: 0, to: running });\n return rows;\n}\n\n/** The value axis's narrowest: the 56px it always had. */\nconst AXIS_MIN = 56;\n/** The value axis's tick count; its ticks are Recharts' own for it. */\nconst WATERFALL_TICKS = 5;\n\n/** A tick of the value axis: the size through the formatter, a negative one with the typographic minus. */\nconst tickText = (format: ChartValueFormatter) => (value: number) => (value < 0 ? `${MINUS}${format(-value)}` : format(value));\n\n/**\n * The ticks the value axis draws between the data's extremes: Recharts' own nice ticks for its `[\"auto\", \"auto\"]`\n * domain, which takes in zero (every total stands on it).\n */\nexport function waterfallTicks(low: number, high: number): number[] {\n return valueAxisTicks([low, high], WATERFALL_TICKS);\n}\n\n/**\n * The value axis's width, as the other charts size theirs (axis-width's tickAxisWidth): its longest\n * tick as Recharts draws it (a negative one with its minus), at its estimated width plus the 8px Recharts draws it\n * in from the plot, never under 56px and never over 128px. Ticks too long for 128px are shown with compact figures\n * in the chart's locale, and the axis is sized for those. It was 7px a character of the longer of the data's ends\n * rounded up: over a figure's real 7px, under a \"€\" or an \"%\", and not always the tick drawn.\n */\nexport function waterfallAxisWidth(low: number, high: number, format: ChartValueFormatter, locale?: string): number {\n const ticks = waterfallTicks(low, high);\n return tickAxisWidth(ticks.map(tickText(format)), AXIS_MIN, 0, locale, formattedValues(ticks, tickText(format)));\n}\n\n/**\n * How the three kinds part without hue: all in `ds-chart-1`. Totals are solid; steps\n * are outlined in it, an increase filled with a 25% tint (lighter), a decrease hatched (a pattern). Every label\n * and table cell carries the sign as well. These are the legend's and the tooltip's keys; the bars draw the same.\n */\nconst KEY_OUTLINE = [\"0 0/100% 1.5px\", \"0 100%/100% 1.5px\", \"0 0/1.5px 100%\", \"100% 0/1.5px 100%\"]\n .map((place) => `linear-gradient(var(--ds-chart-1), var(--ds-chart-1)) ${place} no-repeat`)\n .join(\", \");\nconst INCREASE_TINT = \"color-mix(in oklab, var(--ds-chart-1) 25%, transparent)\";\nconst WATERFALL_KEY = {\n total: \"var(--ds-chart-1)\",\n increase: `${KEY_OUTLINE}, ${INCREASE_TINT}`,\n decrease: `${KEY_OUTLINE}, repeating-linear-gradient(135deg, var(--ds-chart-1) 0 1.5px, transparent 1.5px 3.5px)`,\n /** A zero step's tooltip key: the outline alone, neither tinted nor hatched. Never in the legend. */\n zero: KEY_OUTLINE,\n} as const;\nconst keyOf = (kind: WaterfallRow[\"kind\"]) => (kind === \"start\" || kind === \"end\" ? WATERFALL_KEY.total : WATERFALL_KEY[kind]);\n\n/** `+€ 12.000`, `−€ 3.400`, `€ 0`: the sign spelled out, the size through the formatter. */\nconst signed = (value: number, format: ChartValueFormatter, plus = true) =>\n `${value > 0 && plus ? \"+\" : value < 0 ? MINUS : \"\"}${format(Math.abs(value))}`;\n\ntype PlotRow = WaterfallRow & { band: [number, number] };\n\n/**\n * A running total built from positive and negative steps, with the start and end totals: how revenue becomes\n * net after each expense. Bars float from the running total before a step to the one after it, joined by thin\n * dashed connectors; totals stand on zero, and a zero line shows when a total goes negative. Totals are solid\n * `ds-chart-1`, increases outlined with a 25% tint, decreases outlined and hatched, each labeled with its signed\n * value. The arrow keys move between bars with the tooltip (change and running total); the data table has them all.\n */\nexport function WaterfallChart({ title, \"aria-label\": ariaLabel, period, start, steps, endLabel, valueFormatter = plain, isLoading, emptyState, height = 240 }: WaterfallChartProps) {\n const { locale } = useLocale();\n const animate = useChartAnimation();\n const direction = useChartDirection();\n const patternId = `ds-waterfall-hatch-${React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n useOnce(\n [start, ...steps].some((step) => step && !Number.isFinite(step.value)),\n \"WaterfallChart: a start or steps without a finite value are left out; the end total is the sum of the finite figures.\",\n );\n const rows: PlotRow[] = waterfallRows(start, steps, endLabel).map((row) => ({ ...row, band: [Math.min(row.from, row.to), Math.max(row.from, row.to)] }));\n // Nothing to draw: no step, or every figure zero (start included), which counts as nothing measured.\n const isEmpty = rows.every((row) => row.from === 0 && row.to === 0);\n const low = Math.min(0, ...rows.map((row) => row.band[0]));\n const high = Math.max(0, ...rows.map((row) => row.band[1]));\n const axisWidth = waterfallAxisWidth(low, high, valueFormatter, locale);\n // The 20px top margin holds a top value tick of up to three lines; one of more takes the room it needs above its\n // gridline past the 8px a one-line tick takes (axis-width's tickOverhang).\n const axisTicks = waterfallTicks(low, high);\n const axisTexts = axisTicks.map(tickText(valueFormatter));\n const top = Math.max(20, 8 + tickOverhang(axisTexts.at(-1), tickWrapWidth(axisWidth), locale, axisTexts, formattedValues(axisTicks, tickText(valueFormatter))));\n const total = chartTotalLabel(locale);\n const change = chartChangeLabel(locale);\n const isTotal = (row: WaterfallRow) => row.kind === \"start\" || row.kind === \"end\";\n const label = (row: WaterfallRow) => (isTotal(row) ? signed(row.to, valueFormatter, false) : signed(row.change!, valueFormatter));\n const tableRows = rows.map((row) => ({ ...row, changeText: isTotal(row) ? \"\" : signed(row.change!, valueFormatter), totalText: signed(row.to, valueFormatter, false) }));\n const columns: TableColumn<(typeof tableRows)[number]>[] = [\n { key: \"name\", header: title ?? ariaLabel ?? \"\", isRowHeader: true },\n { key: \"changeText\", header: change, align: \"end\" },\n { key: \"totalText\", header: total, align: \"end\" },\n ];\n // A zero step enables no key: it is neither an increase nor a decrease, and its label says \"€ 0\".\n const kinds = new Set<string>(rows.map((row) => (isTotal(row) ? \"total\" : row.kind)));\n const legend = (\n <ChartLegend\n items={[\n { key: \"increase\", label: chartIncreaseLabel(locale), color: WATERFALL_KEY.increase, kind: \"bar\" as const },\n { key: \"decrease\", label: chartDecreaseLabel(locale), color: WATERFALL_KEY.decrease, kind: \"bar\" as const },\n { key: \"total\", label: total, color: WATERFALL_KEY.total, kind: \"bar\" as const },\n ].filter((item) => kinds.has(item.key))}\n />\n );\n return (\n <Shell title={title} aria-label={ariaLabel} period={period} isLoading={isLoading} emptyState={emptyState} isEmpty={isEmpty} height={height} legend={legend} columns={columns} rows={tableRows}>\n <div data-slot=\"waterfall\" className=\"h-full min-w-0\">\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsBarChart data={rows} barCategoryGap=\"20%\" accessibilityLayer margin={{ top, right: 4, bottom: 0, left: 4 }}>\n <defs>\n {/* The decrease's hatch: 1.5px ds-chart-1 stripes at 45°, every 5px. */}\n <pattern id={patternId} data-slot=\"waterfall-hatch\" width=\"5\" height=\"5\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(45)\">\n <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"5\" stroke=\"var(--ds-chart-1)\" strokeWidth=\"1.5\" />\n </pattern>\n </defs>\n <CartesianGrid vertical={false} stroke=\"var(--ds-border)\" />\n <XAxis\n dataKey=\"key\"\n reversed={direction.reversed}\n tickLine={false}\n axisLine={{ stroke: \"var(--ds-border-bold)\" }}\n // Recharts' ticks, kept inside the chart: the last step's name may be wider than its band.\n tick={<CategoryTick {...AXIS_TICK} />}\n tickFormatter={(key: string) => rows[Number(key)]?.name ?? \"\"}\n />\n <YAxis\n orientation={direction.valueAxis}\n tickLine={false}\n axisLine={false}\n // The DS's tick (ValueTick), given the room the axis has for it: a figure never parts from its sign and\n // currency, and ticks too long for 128px show compact figures.\n tick={<ValueTick {...AXIS_TICK} width={tickWrapWidth(axisWidth)} axisTicks={waterfallTicks(low, high)} />}\n tickCount={WATERFALL_TICKS}\n // Wide enough for its longest tick (\"−€ 2.000.000\"), 56–128px.\n width={axisWidth}\n // Every total stands on zero, so the data's own range includes it; \"auto\" rounds both ends.\n domain={[\"auto\", \"auto\"]}\n tickFormatter={tickText(valueFormatter)}\n />\n {low < 0 && <ReferenceLine y={0} stroke=\"var(--ds-border-bold)\" className=\"ds-waterfall-zero\" />}\n {/* Connectors: from each bar's end level to the next bar, so the eye follows the running total. */}\n {rows.slice(0, -1).map((row, index) => (\n <ReferenceLine\n key={`connector-${row.key}`}\n segment={[\n { x: row.key, y: row.to },\n { x: rows[index + 1]!.key, y: row.to },\n ]}\n stroke=\"var(--ds-border-bold)\"\n strokeDasharray=\"2 2\"\n ifOverflow=\"visible\"\n />\n ))}\n <Bar dataKey=\"band\" isAnimationActive={animate} shape={(props: unknown) => <WaterfallBar {...(props as BarShape)} patternId={patternId} label={label} />} />\n <Tooltip\n isAnimationActive={animate}\n cursor={{ fill: \"var(--ds-background-neutral)\", opacity: 0.5 }}\n content={({ active, payload }) => {\n const row = payload?.[0]?.payload as PlotRow | undefined;\n if (!active || !row) return null;\n return (\n <ChartTooltip\n active\n label={row.name}\n payload={\n isTotal(row)\n ? [{ dataKey: \"total\", name: total, value: signed(row.to, valueFormatter, false), color: keyOf(row.kind) }]\n : [\n { dataKey: \"change\", name: change, value: signed(row.change!, valueFormatter), color: keyOf(row.kind) },\n { dataKey: \"total\", name: total, value: signed(row.to, valueFormatter, false), color: \"transparent\" },\n ]\n }\n />\n );\n }}\n />\n </RechartsBarChart>\n </ResponsiveContainer>\n </div>\n </Shell>\n );\n}\n\ntype BarShape = { x?: number; y?: number; width?: number; height?: number; payload?: PlotRow };\n\n/** About how wide an 11px tabular label is, per character: enough to tell whether it fits over its bar. */\nconst LABEL_CHAR = 6;\n\n/**\n * One waterfall bar: solid for a total, outlined and tinted for an increase, outlined and hatched for a decrease, a\n * flat line for a zero step;\n * its signed value above it while that fits the bar's band (a narrow chart leaves it to the tooltip and table).\n */\nfunction WaterfallBar({ x = 0, y = 0, width = 0, height = 0, payload, patternId, label }: BarShape & { patternId: string; label: (row: WaterfallRow) => string }) {\n if (!payload) return null;\n // Range bars can arrive with a negative size (a reversed axis); draw from the top-left corner. A zero step\n // shows as a flat 1.5px ds-chart-1 line at the running total (no outline box, no tint), so its place is not a gap.\n const left = width < 0 ? x + width : x;\n const top = height < 0 ? y + height : y;\n const w = Math.abs(width);\n const h = Math.max(1, Math.abs(height));\n const total = payload.kind === \"start\" || payload.kind === \"end\";\n const fill = total ? \"var(--ds-chart-1)\" : payload.kind === \"increase\" ? INCREASE_TINT : `url(#${patternId})`;\n const text = label(payload);\n // The bar is 80% of its band (barCategoryGap 20%): the label may use the whole band.\n const fits = text.length * LABEL_CHAR <= w / 0.8 - 4;\n return (\n <g data-slot=\"waterfall-bar\" data-kind={payload.kind}>\n {fits && (\n <text\n data-slot=\"waterfall-label\"\n x={left + w / 2}\n y={top - 6}\n textAnchor=\"middle\"\n fill=\"var(--ds-text-subtle)\"\n fontSize={11}\n style={{ fontVariantNumeric: \"tabular-nums\" }}\n >\n {/* In its own reading direction, centered where it was (value-tick's LineSpan). */}\n <LineSpan {...placedLine(text, left + w / 2, \"middle\")} inherited=\"middle\" dy=\"0\">\n {text}\n </LineSpan>\n </text>\n )}\n {total ? (\n <rect x={left} y={top} width={w} height={h} rx={2} fill={fill} />\n ) : payload.kind === \"zero\" ? (\n <rect x={left} y={top - 0.75} width={w} height={1.5} fill=\"var(--ds-chart-1)\" />\n ) : (\n // The outline inside the bar's box, so increases and decreases keep the totals' width.\n <rect x={left + 0.75} y={top + 0.75} width={Math.max(0, w - 1.5)} height={Math.max(0, h - 1.5)} rx={1.5} fill={fill} stroke=\"var(--ds-chart-1)\" strokeWidth={1.5} />\n )}\n </g>\n );\n}\n\n/* ── Heatmap ───────────────────────────────────────────────────── */\n\nexport type HeatmapCell = {\n /** The cell's row and column, as named in `rows` and `columns`. */\n row: string;\n column: string;\n /**\n * `null`: the period is in the grid but has no data (hatched, \"No data\"), never the same as 0. A negative value\n * draws as step 0, like zero (the scale counts up from nothing); its name and the table keep the signed value.\n */\n value: number | null;\n /** The cell's name for screen readers and the tooltip's title; \"row, column: value\" by default. */\n label?: string;\n};\n\nexport type HeatmapProps = FrameProps & {\n /** The rows, top to bottom (\"Week 1\" …, or the months). Names are unique: cells find their row by name. */\n rows: readonly string[];\n /**\n * The columns, from the inline start (the weekdays, or the weeks). Names are unique, as for `rows`: a name given\n * twice draws both, but every cell of that name lands in the first (the chart warns).\n */\n columns: readonly string[];\n /** One entry per cell; a row and column with no entry draws no cell (a day outside the month). */\n data: readonly HeatmapCell[];\n /** The row headers' name (\"Week\"), on the data table's first header and the grid's corner; \"Period\" by default. */\n rowHeader?: string;\n /**\n * Four strictly ascending lower bounds of the four intensity steps; from the positive values' quartiles by\n * default. Bounds out of order still count each bound a value reaches, so the steps no longer follow the values\n * (the chart warns).\n */\n thresholds?: readonly [number, number, number, number];\n valueFormatter?: ChartValueFormatter;\n onCellPress?: (cell: HeatmapCell) => void;\n};\n\n/** A cell with no data: hatched, so it never passes for zero's flat `ds-background-neutral`. */\nconst HEAT_MISSING = \"repeating-linear-gradient(135deg, var(--ds-background-neutral-pressed) 0 2px, transparent 2px 5px)\";\n\ntype Slot = { cell: HeatmapCell; row: number; column: number; index: number };\n\n/** Whether the bounds rise strictly, each one finite: otherwise the steps no longer follow the values. */\nconst ascending = (bounds: readonly number[]) => bounds.every((bound, index) => Number.isFinite(bound) && (index === 0 || bound > bounds[index - 1]!));\nconst hasDuplicates = (names: readonly string[]) => new Set(names).size !== names.length;\n\n/**\n * A value over a grid of two cycles, month by weekday or week by weekday: when demand peaks. Cells share\n * the CalendarHeatmap's five steps (zero or less in `ds-background-neutral`, then the `ds-chart-1` ramp, steps\n * that differ in lightness), a cell with no data is hatched and named \"No data\", and a pair with no entry draws an\n * empty gap. Column labels above, row labels at the inline start, a \"Less … More\" scale under the grid. No text is\n * drawn over the cells.\n *\n * Screen readers: every row of the grid has as many cells as the header row (the corner is a column header named\n * by `rowHeader`, a gap an empty, unfocusable grid cell), so each cell sits under its own column's header.\n *\n * Keyboard and pointer: one tab stop. The arrow keys move focus a cell (mirrored in RTL, skipping gaps), Home\n * and End go to the row's ends, Ctrl+Home and Ctrl+End to the grid's; Enter and Space press the focused cell.\n * Hovering never moves focus or the tab stop. The tooltip shows the cell under the pointer while it is over one,\n * and the focused cell otherwise; a key that moves focus hands the tooltip back to the focused cell until the\n * pointer enters another cell. Escape hides it.\n */\nexport function Heatmap({ title, \"aria-label\": ariaLabel, period, rows, columns, data, rowHeader, thresholds, valueFormatter = plain, onCellPress, isLoading, emptyState }: HeatmapProps) {\n const { locale } = useLocale();\n const { isRtl } = useChartDirection();\n const animate = useChartAnimation();\n const noValue = chartNoValueLabel(locale);\n const rowHeaderLabel = rowHeader ?? chartPeriodLabel(locale);\n // Cells by position; a pair given twice keeps its last entry.\n const byPair = new Map<string, HeatmapCell>();\n for (const cell of data) if (rows.includes(cell.row) && columns.includes(cell.column)) byPair.set(`${cell.row}\\u0000${cell.column}`, cell);\n useOnce(data.some((cell) => !rows.includes(cell.row) || !columns.includes(cell.column)), \"Heatmap: a cell outside rows and columns is left out.\");\n useOnce(hasDuplicates(rows) || hasDuplicates(columns), \"Heatmap: rows and columns need unique names; a repeated name's cells are drawn in its first row or column only.\");\n useOnce(thresholds !== undefined && !ascending(thresholds), \"Heatmap: thresholds must be four finite, strictly ascending bounds.\");\n const slots: Slot[] = [];\n const grid: (Slot | undefined)[][] = rows.map((row, r) =>\n columns.map((column, c) => {\n // A repeated name is a gap after its first place, so no cell is drawn (or reached by the arrows) twice.\n if (rows.indexOf(row) !== r || columns.indexOf(column) !== c) return undefined;\n const cell = byPair.get(`${row}\\u0000${column}`);\n if (!cell) return undefined;\n const slot = { cell, row: r, column: c, index: slots.length };\n slots.push(slot);\n return slot;\n }),\n );\n const values = slots.map((slot) => slot.cell.value).filter((value): value is number => value !== null && Number.isFinite(value));\n const bounds = thresholds ?? heatmapThresholds(values);\n const hasMissing = slots.some((slot) => slot.cell.value === null || !Number.isFinite(slot.cell.value));\n const format = (value: number | null) => (value === null || !Number.isFinite(value) ? noValue : valueFormatter(value));\n const nameOf = (cell: HeatmapCell) => cell.label ?? `${cell.row}, ${cell.column}: ${format(cell.value)}`;\n // levelOf gives a negative value step 0, the same as zero.\n const fillOf = (cell: HeatmapCell) => (cell.value === null || !Number.isFinite(cell.value) ? HEAT_MISSING : HEAT_LEVELS[levelOf(cell.value, bounds)]!);\n\n // The roving tab stop and the keys follow focus only (the first cell until the reader moves); the pointer only\n // ever sets `hovered`, which the tooltip prefers while `tip.hover` holds.\n const [focused, setFocused] = React.useState(0);\n const [hovered, setHovered] = React.useState<number | null>(null);\n const [tip, setTip] = React.useState<{ focus: boolean; hover: boolean }>({ focus: false, hover: false });\n const current = Math.min(focused, Math.max(0, slots.length - 1));\n const cells = React.useRef<(HTMLElement | null)[]>([]);\n const move = (from: Slot, key: string, ctrl: boolean): Slot | undefined => {\n const forward = isRtl ? \"ArrowLeft\" : \"ArrowRight\";\n const back = isRtl ? \"ArrowRight\" : \"ArrowLeft\";\n const walk = (dr: number, dc: number) => {\n for (let r = from.row + dr, c = from.column + dc; r >= 0 && r < rows.length && c >= 0 && c < columns.length; r += dr, c += dc) {\n if (grid[r]![c]) return grid[r]![c];\n }\n return undefined;\n };\n if (key === forward) return walk(0, 1);\n if (key === back) return walk(0, -1);\n if (key === \"ArrowDown\") return walk(1, 0);\n if (key === \"ArrowUp\") return walk(-1, 0);\n if (key === \"Home\") return ctrl ? slots[0] : grid[from.row]!.find(Boolean);\n if (key === \"End\") return ctrl ? slots[slots.length - 1] : [...grid[from.row]!].reverse().find(Boolean);\n return undefined;\n };\n\n const tableRows = rows.map((row, r) => ({\n id: r,\n row,\n ...Object.fromEntries(columns.map((_, c) => [`c${c}`, grid[r]![c] ? format(grid[r]![c]!.cell.value) : \"\"])),\n })) as ({ id: number; row: string } & Record<string, string>)[];\n const tableColumns: TableColumn<(typeof tableRows)[number]>[] = [\n { key: \"row\", header: rowHeaderLabel, isRowHeader: true },\n ...columns.map((column, c) => ({ key: `c${c}`, header: column, align: \"end\" as const })),\n ];\n // Cell rows of 28px with 3px gaps, the column labels, the scale and their gaps.\n const height = 16 + 6 + rows.length * 28 + Math.max(0, rows.length - 1) * 3 + 12 + 20;\n const focusedSlot = slots[current];\n const hoveredSlot = hovered === null ? undefined : slots[hovered];\n const tipSlot = tip.hover && hoveredSlot ? hoveredSlot : tip.focus ? focusedSlot : undefined;\n\n return (\n <Shell\n title={title}\n aria-label={ariaLabel}\n period={period}\n isLoading={isLoading}\n emptyState={emptyState}\n isEmpty={values.length === 0}\n height={height}\n columns={tableColumns}\n rows={tableRows}\n >\n <div data-slot=\"heatmap\" className=\"relative flex min-w-0 flex-col gap-ds-150\">\n <div className=\"min-w-0 overflow-x-auto\" data-slot=\"heatmap-scroll\">\n <div\n role=\"grid\"\n aria-label={title ?? ariaLabel}\n data-slot=\"heatmap-grid\"\n className=\"grid min-w-max gap-[3px]\"\n style={{ gridTemplateColumns: `max-content repeat(${columns.length}, minmax(1.5rem, 1fr))` }}\n onKeyDown={(event) => {\n // Every key acts on the focused cell, never on the one under the pointer.\n if (!focusedSlot) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n // Space never scrolls the page from inside the grid.\n event.preventDefault();\n onCellPress?.(focusedSlot.cell);\n return;\n }\n if (event.key === \"Escape\") {\n setTip({ focus: false, hover: false });\n return;\n }\n const next = move(focusedSlot, event.key, event.ctrlKey || event.metaKey);\n if (!next) return;\n event.preventDefault();\n setFocused(next.index);\n // The keyboard takes the tooltip back from the pointer.\n setTip({ focus: true, hover: false });\n cells.current[next.index]?.focus();\n }}\n onFocus={() => setTip((state) => ({ ...state, focus: true }))}\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setTip((state) => ({ ...state, focus: false }));\n }}\n onMouseLeave={() => {\n setHovered(null);\n setTip((state) => ({ ...state, hover: false }));\n }}\n >\n <div role=\"row\" className=\"contents\">\n {/* The corner heads the row headers' column, so every row has as many cells as this one. */}\n <span role=\"columnheader\" aria-label={rowHeaderLabel} data-slot=\"heatmap-corner\" className=\"h-4\" />\n {columns.map((column, c) => (\n <span key={c} role=\"columnheader\" data-slot=\"heatmap-column\" className=\"h-4 truncate text-center text-[11px] leading-4 text-ds-text-subtlest\">\n {column}\n </span>\n ))}\n </div>\n {rows.map((row, r) => (\n <div key={r} role=\"row\" data-slot=\"heatmap-row\" className=\"contents\">\n <span role=\"rowheader\" className=\"flex h-7 items-center truncate pe-ds-100 text-body-small text-ds-text-subtle\">\n <bdi>{row}</bdi>\n </span>\n {columns.map((_, c) => {\n const slot = grid[r]![c];\n // An empty, unfocusable cell: it keeps the column count, so the cells after it stay under their headers.\n if (!slot) return <span key={c} role=\"gridcell\" data-slot=\"heatmap-gap\" className=\"h-7\" />;\n const missing = slot.cell.value === null || !Number.isFinite(slot.cell.value);\n return (\n <span\n key={c}\n ref={(element) => {\n cells.current[slot.index] = element;\n }}\n role=\"gridcell\"\n aria-label={nameOf(slot.cell)}\n data-slot=\"heatmap-cell\"\n data-state={missing ? \"missing\" : slot.cell.value === 0 ? \"zero\" : \"value\"}\n data-level={missing ? undefined : levelOf(slot.cell.value!, bounds)}\n tabIndex={slot.index === current ? 0 : -1}\n onFocus={() => setFocused(slot.index)}\n onMouseEnter={() => {\n setHovered(slot.index);\n setTip((state) => ({ ...state, hover: true }));\n }}\n onMouseLeave={() => setHovered((index) => (index === slot.index ? null : index))}\n onClick={() => onCellPress?.(slot.cell)}\n className={cn(\n \"h-7 rounded-[3px] outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused\",\n animate && \"transition-[background-color] duration-150\",\n onCellPress && \"cursor-pointer\",\n )}\n style={{ background: fillOf(slot.cell) }}\n />\n );\n })}\n </div>\n ))}\n </div>\n </div>\n <div data-slot=\"heatmap-scale\" className=\"flex flex-wrap items-center gap-x-ds-200 gap-y-ds-050 text-body-small text-ds-text-subtle\">\n <span className=\"flex items-center gap-ds-075\">\n <span>{heatmapLessLabel(locale)}</span>\n <span aria-hidden className=\"flex gap-[3px]\">\n {HEAT_LEVELS.map((background, level) => (\n <span key={level} data-level={level} className=\"size-3 rounded-[2px]\" style={{ background }} />\n ))}\n </span>\n <span>{heatmapMoreLabel(locale)}</span>\n </span>\n {hasMissing && (\n <span data-slot=\"heatmap-missing-key\" className=\"flex items-center gap-ds-075\">\n <span aria-hidden className=\"size-3 rounded-[2px]\" style={{ background: HEAT_MISSING }} />\n {noValue}\n </span>\n )}\n </div>\n {tipSlot && (\n <HeatTooltip anchor={cells.current[tipSlot.index] ?? null} title={tipSlot.cell.label ?? `${tipSlot.cell.row} · ${tipSlot.cell.column}`}>\n <ChartTooltip\n active\n label={tipSlot.cell.label ?? `${tipSlot.cell.row} · ${tipSlot.cell.column}`}\n payload={[{ dataKey: \"value\", name: chartValueLabel(locale), value: format(tipSlot.cell.value), color: fillOf(tipSlot.cell) }]}\n />\n </HeatTooltip>\n )}\n </div>\n </Shell>\n );\n}\n\n/**\n * The shared ChartTooltip over a cell: above it, or under it when there is no room; kept inside the chart's\n * width. Placed again when the grid's sideways scroll container scrolls or the window resizes, so it stays on\n * its cell. Hidden from screen readers, which read the cell's own name.\n */\nfunction HeatTooltip({ anchor, title, children }: { anchor: HTMLElement | null; title: string; children: React.ReactNode }) {\n const ref = React.useRef<HTMLDivElement>(null);\n const [place, setPlace] = React.useState<{ left: number; top: number } | null>(null);\n React.useLayoutEffect(() => {\n const tooltip = ref.current;\n const box = tooltip?.parentElement;\n if (!tooltip || !box || !anchor) return;\n const position = () => {\n const frame = box.getBoundingClientRect();\n const cell = anchor.getBoundingClientRect();\n const width = tooltip.offsetWidth;\n const heightOf = tooltip.offsetHeight;\n const center = cell.left - frame.left + cell.width / 2;\n const left = Math.min(Math.max(0, center - width / 2), Math.max(0, frame.width - width));\n // Above the cell while it fits in the viewport, under it otherwise.\n const top = cell.top - heightOf - 8 >= 0 ? cell.top - frame.top - heightOf - 8 : cell.bottom - frame.top + 8;\n setPlace((previous) => (previous && previous.left === left && previous.top === top ? previous : { left, top }));\n };\n position();\n const scroller = anchor.closest(\"[data-slot='heatmap-scroll']\");\n scroller?.addEventListener(\"scroll\", position, { passive: true });\n window.addEventListener(\"resize\", position);\n return () => {\n scroller?.removeEventListener(\"scroll\", position);\n window.removeEventListener(\"resize\", position);\n };\n }, [anchor, title]);\n return (\n <div\n ref={ref}\n aria-hidden\n data-slot=\"heatmap-tooltip\"\n // Its own width (max-content, at most the chart's), never squeezed by where it sits, so the placing\n // above measures the width it will have.\n className=\"pointer-events-none absolute z-10 w-max max-w-full\"\n style={place ? { left: place.left, top: place.top } : { left: 0, top: 0, visibility: \"hidden\" }}\n >\n {children}\n </div>\n );\n}\n"]}
|