@photon-ai/pho-ui 4.18.4 → 4.18.5
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/README.md +1 -1
- package/dist/chunks/{IconAlertCircleFilled-VxKU8TYK.js → IconAlertCircleFilled-D6mUlVaE.js} +2 -2
- package/dist/chunks/IconAlertCircleFilled-D6mUlVaE.js.map +1 -0
- package/dist/chunks/{IconArrowUpRight-DGgKzQwV.js → IconArrowUpRight-OK8Fp0KQ.js} +2 -2
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +1 -0
- package/dist/chunks/{IconCheck-D2WuculQ.js → IconCheck-DwSMn1wK.js} +2 -2
- package/dist/chunks/IconCheck-DwSMn1wK.js.map +1 -0
- package/dist/chunks/{IconChevronDown-CZilB71T.js → IconChevronDown-Cd68NnX2.js} +2 -2
- package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +1 -0
- package/dist/chunks/{IconChevronLeft-CSWMKQ4C.js → IconChevronLeft-CptqhdxO.js} +2 -2
- package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +1 -0
- package/dist/chunks/{IconChevronRight-CzoJnYNI.js → IconChevronRight-BNkXCTk6.js} +2 -2
- package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +1 -0
- package/dist/chunks/{IconChevronUp-CrpWSgIl.js → IconChevronUp-Bxllwz8J.js} +2 -2
- package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +1 -0
- package/dist/chunks/{IconInfoCircle-L0zfhg7R.js → IconInfoCircle-CTAynhe8.js} +2 -2
- package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +1 -0
- package/dist/chunks/{IconSearch-BKAHkLyX.js → IconSearch-DkcWWZ1H.js} +2 -2
- package/dist/chunks/IconSearch-DkcWWZ1H.js.map +1 -0
- package/dist/chunks/{IconX-pZ9vrtSr.js → IconX-DnPlFC68.js} +2 -2
- package/dist/chunks/IconX-DnPlFC68.js.map +1 -0
- package/dist/chunks/animated-height-zr7BmFY1.js.map +1 -1
- package/dist/chunks/{avatar-BkmGDIqf.js → avatar-PgBOfszL.js} +4 -4
- package/dist/chunks/avatar-PgBOfszL.js.map +1 -0
- package/dist/chunks/{badge-DlLJPLeZ.js → badge-CVViIYj_.js} +2 -2
- package/dist/chunks/badge-CVViIYj_.js.map +1 -0
- package/dist/chunks/{bar-chart-CNCmuhQV.js → bar-chart-ZNuOoH7c.js} +2 -2
- package/dist/chunks/bar-chart-ZNuOoH7c.js.map +1 -0
- package/dist/chunks/{basic-page-D_Wgu2pJ.js → basic-page-BKvtEQkZ.js} +20 -20
- package/dist/chunks/basic-page-BKvtEQkZ.js.map +1 -0
- package/dist/chunks/{box-search-C9EVZgcb.js → box-search-CMl5bQ7Y.js} +5 -5
- package/dist/chunks/box-search-CMl5bQ7Y.js.map +1 -0
- package/dist/chunks/{bubble-eaoLJP4N.js → bubble-D88Edlgj.js} +2 -2
- package/dist/chunks/bubble-D88Edlgj.js.map +1 -0
- package/dist/chunks/{button-C9VqBBIr.js → button-CLfWdqm-.js} +3 -3
- package/dist/chunks/button-CLfWdqm-.js.map +1 -0
- package/dist/chunks/{calendar-4OFiCLAv.js → calendar-DDWITGo4.js} +7 -7
- package/dist/chunks/calendar-DDWITGo4.js.map +1 -0
- package/dist/chunks/{card-N-tvFsuV.js → card-zyRAihYE.js} +2 -2
- package/dist/chunks/{card-N-tvFsuV.js.map → card-zyRAihYE.js.map} +1 -1
- package/dist/chunks/{chart-B5wjhkBu.js → chart-Btnw7KXV.js} +3 -3
- package/dist/chunks/chart-Btnw7KXV.js.map +1 -0
- package/dist/chunks/{chat-Bu8UyIbT.js → chat-ZUzGmTWE.js} +11 -11
- package/dist/chunks/chat-ZUzGmTWE.js.map +1 -0
- package/dist/chunks/{checkbox-CwvoEJhd.js → checkbox-DpWLbKVS.js} +2 -2
- package/dist/chunks/checkbox-DpWLbKVS.js.map +1 -0
- package/dist/chunks/choice-card-_Ocs0iUj.js.map +1 -1
- package/dist/chunks/chrome-Ds7WykBJ.js.map +1 -1
- package/dist/chunks/{close-button-GvqWbLl0.js → close-button-Ck4rY1Fp.js} +3 -3
- package/dist/chunks/close-button-Ck4rY1Fp.js.map +1 -0
- package/dist/chunks/{cn-ChIgwEl3.js → cn-CPbhpG1q.js} +162 -83
- package/dist/chunks/cn-CPbhpG1q.js.map +1 -0
- package/dist/chunks/{code-block-DekLMMtV.js → code-block-Yxg2wZGJ.js} +10 -10
- package/dist/chunks/code-block-Yxg2wZGJ.js.map +1 -0
- package/dist/chunks/{collapsible-Dv306QOT.js → collapsible-C2tn_b1Q.js} +2 -2
- package/dist/chunks/collapsible-C2tn_b1Q.js.map +1 -0
- package/dist/chunks/{combobox-BJusx5b2.js → combobox-OQOi5hlB.js} +2 -2
- package/dist/chunks/combobox-OQOi5hlB.js.map +1 -0
- package/dist/chunks/{copy-button-BmGshaq9.js → copy-button-BLvirhXk.js} +4 -4
- package/dist/chunks/copy-button-BLvirhXk.js.map +1 -0
- package/dist/chunks/{createReactComponent-BqCmnqfX.js → createReactComponent-yKZn9MIX.js} +6 -6
- package/dist/chunks/createReactComponent-yKZn9MIX.js.map +1 -0
- package/dist/chunks/{data-table-T4QKnrxQ.js → data-table-CAz_8HQw.js} +8 -8
- package/dist/chunks/data-table-CAz_8HQw.js.map +1 -0
- package/dist/chunks/{date-picker-CZbcNIe-.js → date-picker-vJQrTol9.js} +5 -5
- package/dist/chunks/date-picker-vJQrTol9.js.map +1 -0
- package/dist/chunks/{description-list-BRRQ0oF6.js → description-list-Duhhralt.js} +3 -3
- package/dist/chunks/description-list-Duhhralt.js.map +1 -0
- package/dist/chunks/{dialog-12foDiQb.js → dialog-CCfeyQBG.js} +5 -5
- package/dist/chunks/dialog-CCfeyQBG.js.map +1 -0
- package/dist/chunks/{error-D5SzZ0ev.js → error-yAVi4cBu.js} +8 -8
- package/dist/chunks/error-yAVi4cBu.js.map +1 -0
- package/dist/chunks/{filter-bar-upeYW4dQ.js → filter-bar-qqCZf1x4.js} +9 -9
- package/dist/chunks/filter-bar-qqCZf1x4.js.map +1 -0
- package/dist/chunks/{form-AiHbbw4m.js → form-CXT6ayt0.js} +2 -2
- package/dist/chunks/{form-AiHbbw4m.js.map → form-CXT6ayt0.js.map} +1 -1
- package/dist/chunks/{ghost-search-8PzP73zS.js → ghost-search-CMUI2UH0.js} +4 -4
- package/dist/chunks/ghost-search-CMUI2UH0.js.map +1 -0
- package/dist/chunks/{input-fFWvPJOf.js → input-DWnb33UF.js} +4 -4
- package/dist/chunks/input-DWnb33UF.js.map +1 -0
- package/dist/chunks/{input-group-fc9_jD4d.js → input-group-C3upo2OU.js} +39 -37
- package/dist/chunks/input-group-C3upo2OU.js.map +1 -0
- package/dist/chunks/is-react-component-DSnjtBmo.js.map +1 -1
- package/dist/chunks/{kbd-DNI10uy7.js → kbd-DWDs_6U1.js} +2 -2
- package/dist/chunks/kbd-DWDs_6U1.js.map +1 -0
- package/dist/chunks/{line-chart-BODTNBrX.js → line-chart-pOwE2_Oz.js} +2 -2
- package/dist/chunks/line-chart-pOwE2_Oz.js.map +1 -0
- package/dist/chunks/link-provider-DXzDQ08N.js.map +1 -1
- package/dist/chunks/{log-list-tNuCFGlP.js → log-list-QbSYHZu3.js} +8 -8
- package/dist/chunks/log-list-QbSYHZu3.js.map +1 -0
- package/dist/chunks/{menu-CoMrYnd1.js → menu-CC3fhf83.js} +3 -3
- package/dist/chunks/menu-CC3fhf83.js.map +1 -0
- package/dist/chunks/{message-Dz2-numf.js → message-DRAWQlW-.js} +2 -2
- package/dist/chunks/message-DRAWQlW-.js.map +1 -0
- package/dist/chunks/{popover-BhBJO346.js → popover-B0NBrYV5.js} +2 -2
- package/dist/chunks/popover-B0NBrYV5.js.map +1 -0
- package/dist/chunks/popup-anchor-C3_iXdbh.js.map +1 -1
- package/dist/chunks/resolve-variant-CcD8iG5l.js.map +1 -1
- package/dist/chunks/{scroll-area-DSwD9th7.js → scroll-area-Dhl5hqay.js} +2 -2
- package/dist/chunks/scroll-area-Dhl5hqay.js.map +1 -0
- package/dist/chunks/{select-DU_0zVbn.js → select-xhSvDNbw.js} +3 -3
- package/dist/chunks/select-xhSvDNbw.js.map +1 -0
- package/dist/chunks/{sidebar-BP39w1iA.js → sidebar-CgaSEWVr.js} +11 -11
- package/dist/chunks/sidebar-CgaSEWVr.js.map +1 -0
- package/dist/chunks/{skeleton-DwjSl4vC.js → skeleton-CqZlGphn.js} +2 -2
- package/dist/chunks/skeleton-CqZlGphn.js.map +1 -0
- package/dist/chunks/{spinner-BzLUo4Xk.js → spinner-BSutFL4l.js} +2 -2
- package/dist/chunks/spinner-BSutFL4l.js.map +1 -0
- package/dist/chunks/{stat-hnNqjWVG.js → stat-BXBfMQ9Q.js} +4 -4
- package/dist/chunks/stat-BXBfMQ9Q.js.map +1 -0
- package/dist/chunks/{status-view-C8tabjDu.js → status-view-I_Y6eEyX.js} +2 -2
- package/dist/chunks/status-view-I_Y6eEyX.js.map +1 -0
- package/dist/chunks/{toast-BACxYsv6.js → toast-DrLKzrDJ.js} +7 -7
- package/dist/chunks/toast-DrLKzrDJ.js.map +1 -0
- package/dist/chunks/{toggle-o84tawXy.js → toggle-Ca4SS3YD.js} +2 -2
- package/dist/chunks/toggle-Ca4SS3YD.js.map +1 -0
- package/dist/chunks/{tooltip-BTF7GChl.js → tooltip-4J1PUJmB.js} +2 -2
- package/dist/chunks/tooltip-4J1PUJmB.js.map +1 -0
- package/dist/chunks/{trace-DyjsBY-S.js → trace-D9F0sne7.js} +11 -11
- package/dist/chunks/trace-D9F0sne7.js.map +1 -0
- package/dist/chunks/use-copy-D6JwKUll.js.map +1 -1
- package/dist/chunks/use-press-pulse-IbNstUT0.js.map +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/bar-chart.js +1 -1
- package/dist/components/bubble.js +1 -1
- package/dist/components/button.js +2 -2
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.js +4 -4
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +2 -2
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/error.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/fieldset.js +1 -1
- package/dist/components/fieldset.js.map +1 -1
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/line-chart.js +1 -1
- package/dist/components/log-list.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/message.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/meter.js.map +1 -1
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/notification.js +4 -4
- package/dist/components/notification.js.map +1 -1
- package/dist/components/number-field.js +1 -1
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/otp-field.js +1 -1
- package/dist/components/otp-field.js.map +1 -1
- package/dist/components/phone-input.js +35 -45
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/preview-card.js +1 -1
- package/dist/components/preview-card.js.map +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/scope.js +10 -10
- package/dist/components/scope.js.map +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-view.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/theme-toggle.js +2 -2
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.js +27 -27
- package/dist/motion.js.map +1 -1
- package/dist/sections/basic-page.js +2 -2
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/accordion/accordion.d.ts +5 -5
- package/dist/src/components/autocomplete/autocomplete.d.ts +9 -9
- package/dist/src/components/avatar/avatar.d.ts +3 -3
- package/dist/src/components/badge/badge.d.ts +1 -1
- package/dist/src/components/bar-chart/bar-chart.d.ts +1 -1
- package/dist/src/components/bubble/bubble.d.ts +3 -3
- package/dist/src/components/button/button.d.ts +4 -4
- package/dist/src/components/button/close-button.d.ts +1 -1
- package/dist/src/components/calendar/calendar.d.ts +1 -1
- package/dist/src/components/card/card.d.ts +7 -7
- package/dist/src/components/chart/chart.d.ts +1 -1
- package/dist/src/components/chart/legend.d.ts +2 -2
- package/dist/src/components/chart/shell.d.ts +1 -1
- package/dist/src/components/chart/skeleton.d.ts +1 -1
- package/dist/src/components/chart/tooltip.d.ts +1 -1
- package/dist/src/components/chat/chat.d.ts +17 -17
- package/dist/src/components/checkbox/check-glyph.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox-card.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox-group.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/code-block/code-block.d.ts +1 -1
- package/dist/src/components/code-block/languages.d.ts +27 -27
- package/dist/src/components/collapsible/collapsible.d.ts +2 -2
- package/dist/src/components/combobox/combobox.d.ts +15 -15
- package/dist/src/components/command/command.d.ts +12 -12
- package/dist/src/components/context-menu/context-menu.d.ts +48 -0
- package/dist/src/components/copy-button/copy-button.d.ts +1 -1
- package/dist/src/components/data-table/data-table.d.ts +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +1 -1
- package/dist/src/components/description-list/description-list.d.ts +2 -2
- package/dist/src/components/dialog/dialog.d.ts +11 -11
- package/dist/src/components/drawer/drawer.d.ts +6 -6
- package/dist/src/components/error/error.d.ts +2 -2
- package/dist/src/components/field/field.d.ts +6 -6
- package/dist/src/components/fieldset/fieldset.d.ts +2 -2
- package/dist/src/components/filter-bar/filter-bar.d.ts +1 -1
- package/dist/src/components/form/form.d.ts +1 -1
- package/dist/src/components/input/input.d.ts +1 -1
- package/dist/src/components/input-group/box-search.d.ts +1 -1
- package/dist/src/components/input-group/input-group.d.ts +6 -5
- package/dist/src/components/kbd/kbd.d.ts +1 -1
- package/dist/src/components/line-chart/line-chart.d.ts +1 -1
- package/dist/src/components/log-list/log-list.d.ts +7 -7
- package/dist/src/components/menu/menu-pending.d.ts +3 -4
- package/dist/src/components/menu/menu.d.ts +81 -0
- package/dist/src/components/menubar/menubar.d.ts +1 -1
- package/dist/src/components/message/message.d.ts +7 -7
- package/dist/src/components/meter/meter.d.ts +5 -5
- package/dist/src/components/navigation-menu/navigation-menu.d.ts +8 -8
- package/dist/src/components/notification/notification.d.ts +1 -1
- package/dist/src/components/number-field/number-field.d.ts +6 -6
- package/dist/src/components/otp-field/otp-field.d.ts +1 -1
- package/dist/src/components/phone-input/phone-input.d.ts +2 -2
- package/dist/src/components/popover/popover.d.ts +4 -4
- package/dist/src/components/preview-card/preview-card.d.ts +3 -3
- package/dist/src/components/progress/progress.d.ts +5 -5
- package/dist/src/components/radio-group/radio-card.d.ts +1 -1
- package/dist/src/components/radio-group/radio-group.d.ts +2 -2
- package/dist/src/components/scope/scope.d.ts +1 -1
- package/dist/src/components/scroll-area/scroll-area-edges.d.ts +1 -1
- package/dist/src/components/scroll-area/scroll-area.d.ts +5 -5
- package/dist/src/components/select/select.d.ts +9 -9
- package/dist/src/components/separator/separator.d.ts +1 -1
- package/dist/src/components/slider/slider.d.ts +7 -7
- package/dist/src/components/spinner/spinner.d.ts +1 -1
- package/dist/src/components/stat/stat.d.ts +2 -2
- package/dist/src/components/status-view/status-view.d.ts +1 -1
- package/dist/src/components/switch/switch.d.ts +1 -1
- package/dist/src/components/tabs/tabs.d.ts +4 -4
- package/dist/src/components/theme-toggle/theme-toggle.d.ts +1 -1
- package/dist/src/components/toast/toast.d.ts +7 -7
- package/dist/src/components/toggle/toggle.d.ts +1 -1
- package/dist/src/components/toggle-group/toggle-group.d.ts +1 -1
- package/dist/src/components/toolbar/toolbar.d.ts +6 -6
- package/dist/src/components/tooltip/tooltip.d.ts +3 -3
- package/dist/src/components/trace/span-primitive.d.ts +3 -3
- package/dist/src/components/trace/trace.d.ts +3 -3
- package/dist/src/icons/discord.d.ts +1 -1
- package/dist/src/icons/github.d.ts +1 -1
- package/dist/src/icons/google.d.ts +1 -1
- package/dist/src/icons/imessage.d.ts +1 -1
- package/dist/src/icons/photon-mark.d.ts +1 -1
- package/dist/src/icons/reddit.d.ts +1 -1
- package/dist/src/icons/slack.d.ts +1 -1
- package/dist/src/icons/telegram.d.ts +1 -1
- package/dist/src/icons/whatsapp.d.ts +1 -1
- package/dist/src/icons/x.d.ts +1 -1
- package/dist/src/icons/youtube.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/sections/basic-page/basic-page.d.ts +46 -46
- package/dist/src/sections/sidebar/sidebar.d.ts +11 -11
- package/dist/src/utils/animated-height.d.ts +1 -1
- package/dist/src/utils/ghost-search.d.ts +1 -1
- package/dist/src/utils/link-provider.d.ts +1 -1
- package/dist/src/utils/popup-anchor.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +24 -24
- package/src/styles/pho.css +1 -1
- package/src/styles/theme.css +1 -1
- package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js.map +0 -1
- package/dist/chunks/IconArrowUpRight-DGgKzQwV.js.map +0 -1
- package/dist/chunks/IconCheck-D2WuculQ.js.map +0 -1
- package/dist/chunks/IconChevronDown-CZilB71T.js.map +0 -1
- package/dist/chunks/IconChevronLeft-CSWMKQ4C.js.map +0 -1
- package/dist/chunks/IconChevronRight-CzoJnYNI.js.map +0 -1
- package/dist/chunks/IconChevronUp-CrpWSgIl.js.map +0 -1
- package/dist/chunks/IconInfoCircle-L0zfhg7R.js.map +0 -1
- package/dist/chunks/IconSearch-BKAHkLyX.js.map +0 -1
- package/dist/chunks/IconX-pZ9vrtSr.js.map +0 -1
- package/dist/chunks/avatar-BkmGDIqf.js.map +0 -1
- package/dist/chunks/badge-DlLJPLeZ.js.map +0 -1
- package/dist/chunks/bar-chart-CNCmuhQV.js.map +0 -1
- package/dist/chunks/basic-page-D_Wgu2pJ.js.map +0 -1
- package/dist/chunks/box-search-C9EVZgcb.js.map +0 -1
- package/dist/chunks/bubble-eaoLJP4N.js.map +0 -1
- package/dist/chunks/button-C9VqBBIr.js.map +0 -1
- package/dist/chunks/calendar-4OFiCLAv.js.map +0 -1
- package/dist/chunks/chart-B5wjhkBu.js.map +0 -1
- package/dist/chunks/chat-Bu8UyIbT.js.map +0 -1
- package/dist/chunks/checkbox-CwvoEJhd.js.map +0 -1
- package/dist/chunks/close-button-GvqWbLl0.js.map +0 -1
- package/dist/chunks/cn-ChIgwEl3.js.map +0 -1
- package/dist/chunks/code-block-DekLMMtV.js.map +0 -1
- package/dist/chunks/collapsible-Dv306QOT.js.map +0 -1
- package/dist/chunks/combobox-BJusx5b2.js.map +0 -1
- package/dist/chunks/copy-button-BmGshaq9.js.map +0 -1
- package/dist/chunks/createReactComponent-BqCmnqfX.js.map +0 -1
- package/dist/chunks/data-table-T4QKnrxQ.js.map +0 -1
- package/dist/chunks/date-picker-CZbcNIe-.js.map +0 -1
- package/dist/chunks/description-list-BRRQ0oF6.js.map +0 -1
- package/dist/chunks/dialog-12foDiQb.js.map +0 -1
- package/dist/chunks/error-D5SzZ0ev.js.map +0 -1
- package/dist/chunks/filter-bar-upeYW4dQ.js.map +0 -1
- package/dist/chunks/ghost-search-8PzP73zS.js.map +0 -1
- package/dist/chunks/input-fFWvPJOf.js.map +0 -1
- package/dist/chunks/input-group-fc9_jD4d.js.map +0 -1
- package/dist/chunks/kbd-DNI10uy7.js.map +0 -1
- package/dist/chunks/line-chart-BODTNBrX.js.map +0 -1
- package/dist/chunks/log-list-tNuCFGlP.js.map +0 -1
- package/dist/chunks/menu-CoMrYnd1.js.map +0 -1
- package/dist/chunks/message-Dz2-numf.js.map +0 -1
- package/dist/chunks/popover-BhBJO346.js.map +0 -1
- package/dist/chunks/scroll-area-DSwD9th7.js.map +0 -1
- package/dist/chunks/select-DU_0zVbn.js.map +0 -1
- package/dist/chunks/sidebar-BP39w1iA.js.map +0 -1
- package/dist/chunks/skeleton-DwjSl4vC.js.map +0 -1
- package/dist/chunks/spinner-BzLUo4Xk.js.map +0 -1
- package/dist/chunks/stat-hnNqjWVG.js.map +0 -1
- package/dist/chunks/status-view-C8tabjDu.js.map +0 -1
- package/dist/chunks/toast-BACxYsv6.js.map +0 -1
- package/dist/chunks/toggle-o84tawXy.js.map +0 -1
- package/dist/chunks/tooltip-BTF7GChl.js.map +0 -1
- package/dist/chunks/trace-DyjsBY-S.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"box-search-C9EVZgcb.js","names":[],"sources":["../../src/components/input-group/box-search.tsx"],"sourcesContent":["import { useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { IconSearch, IconX } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { InputGroup } from \"./input-group\";\n\n/**\n * The quiet focus of a search riding on a list or table. The field keeps\n * its resting hairline when it takes focus: the list it narrows is where\n * the eye goes, and a ring would box the field off from it. Focus shows\n * in the caret and in the magnifier, which takes the primary ink. Put it\n * on the field's surface after the surface's own classes (an `Input`'s\n * `wrapperClassName`, an `InputGroup.Root`'s `className`): tailwind-merge\n * keeps the ring at its rest width and ink.\n */\nexport const QUIET_SEARCH_FOCUS =\n \"has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-pho-primary has-[input:focus-visible]:ring-1 has-[input:focus-visible]:ring-pho-primary\";\n\n/**\n * The text control: `InputGroup.Input`'s `sm` classes on a plain input.\n * Not a Base UI `Field.Control` — inside a host's `Field` that would make\n * the search the field's control, taking its name and its label. The\n * browser's own clear glyph gives way to the field's.\n */\nconst BOX_SEARCH_INPUT =\n \"my-0.5 w-full min-w-0 flex-1 bg-transparent py-1.5 text-pho-primary outline-none placeholder:text-pho-placeholder disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none\";\n\nexport interface BoxSearchProps extends Omit<\n ComponentProps<\"input\">,\n \"type\" | \"size\" | \"children\"\n> {\n /**\n * Empties the query from the field's own clear button, shown while the\n * field holds text; focus stays in the field. Without it, no button.\n */\n onClear?: () => void;\n /** Quiet words at the field's end, before the clear button — a count. */\n trailing?: ReactNode;\n /** Classes for the field's surface: its width, its place in a row. */\n className?: string;\n}\n\n/**\n * The boxed search over a list or table — an `sm` field with the\n * magnifier leading, a `trailing` slot, and a clear button. Its focus is\n * quiet (see `QUIET_SEARCH_FOCUS`). Shared by `BasicPage.Search`,\n * `FilterBar`, and `Scope`; the boxless face is `GhostSearch`.\n */\nexport function BoxSearch({\n className,\n onClear,\n trailing,\n value,\n onChange,\n disabled,\n ref,\n ...props\n}: BoxSearchProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const filled = value != null && String(value) !== \"\";\n return (\n <InputGroup.Root\n size=\"sm\"\n className={cn(\"group/search\", QUIET_SEARCH_FOCUS, className)}\n >\n <InputGroup.Addon>\n <IconSearch\n aria-hidden\n className=\"text-pho-description group-focus-within/search:text-pho-primary transition-colors duration-100 ease-linear\"\n />\n </InputGroup.Addon>\n <input\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref != null) ref.current = node;\n }}\n type=\"search\"\n value={value}\n // The query is the list's, not a form's: an enclosing form that\n // saves on change or shows a save row once dirty never hears it.\n onChange={(event) => {\n event.stopPropagation();\n onChange?.(event);\n }}\n disabled={disabled}\n autoComplete=\"off\"\n spellCheck={false}\n className={BOX_SEARCH_INPUT}\n {...props}\n />\n {trailing != null ? (\n <InputGroup.Addon className=\"text-pho-description text-xs tabular-nums\">\n {trailing}\n </InputGroup.Addon>\n ) : null}\n {onClear != null && filled && !disabled ? (\n <InputGroup.Addon>\n <button\n type=\"button\"\n aria-label=\"Clear search\"\n // Reachable by click, skipped by Tab: `Escape` clears from the\n // keyboard, and Tab moves on to the list.\n tabIndex={-1}\n onClick={() => {\n onClear();\n inputRef.current?.focus();\n }}\n className=\"text-pho-secondary hover:text-pho-secondary-hover flex cursor-pointer items-center transition-colors duration-100 ease-linear\"\n >\n <IconX aria-hidden />\n </button>\n </InputGroup.Addon>\n ) : null}\n </InputGroup.Root>\n );\n}\n"],"mappings":";;;;;;;AAcA,IAAa,IACX,iJAQI,IACJ;AAuBF,SAAgB,EAAU,EACxB,WAAA,GACA,SAAA,GACA,UAAA,GACA,OAAA,GACA,UAAA,GACA,UAAA,GACA,KAAA,GACA,GAAG,EAAA,GACc;AACjB,QAAM,IAAW,EAAgC,IAAI,GAC/C,IAAS,KAAS,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],"sourcesContent":["import {\n createContext,\n useContext,\n type ComponentProps,\n type Ref,\n} from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Bubble — one message's surface: the rounded chip that carries the text,\n * an image, or a line of prose, aligned to whichever side its author sits\n * on. It knows nothing about who sent it or when; `Message` owns the row\n * (avatar, header, footer) and `Chat` owns the thread.\n *\n * Design notes:\n * - Monochrome, like every Pho surface. The received message is the card\n * surface with the site hairline; the sent message is the inverted chip\n * (the site's \"msgbbl\" token — literally its message bubble). There is\n * no tinted brand bubble because there is no brand hue.\n * - `base` radius with a `sm` tail corner on the author's side, so the\n * bubble points at its sender the way the dashboard's already does.\n * - `Content` renders through Base UI's `render`, so a bubble can be a\n * `button` (open the message's record) or a link without a wrapper;\n * the hover wash and focus ring only apply then.\n */\n\n/* ------------------------------- variants ------------------------------- */\n\n/**\n * Surface axis — a closed monochrome set. `outlined` is the default:\n * the received message. `inverse` is the sent one.\n */\nexport const BUBBLE_VARIANTS = {\n outlined: {\n classes: cn(\n \"bg-pho-primary text-pho-primary ring-1 ring-pho-secondary ring-inset\",\n \"[&:is(button,a):hover]:bg-pho-primary-hover\",\n ),\n description:\n \"Default — the card surface with the hairline; a message received\",\n },\n inverse: {\n classes: cn(\n \"bg-pho-inverse text-pho-inverse\",\n \"[&:is(button,a):hover]:opacity-90\",\n ),\n description: \"The inverted chip — a message sent\",\n },\n subtle: {\n classes: cn(\n \"bg-pho-secondary text-pho-primary\",\n \"[&:is(button,a):hover]:bg-pho-primary-hover\",\n ),\n description: \"The quiet surface — a note, a system line, a quote\",\n },\n ghost: {\n classes: cn(\n \"rounded-none bg-transparent p-0 text-pho-primary\",\n \"[&:is(button,a):hover]:bg-pho-ghost-hover\",\n ),\n description: \"No surface — prose from an assistant, full width\",\n },\n error: {\n classes: cn(\n \"bg-pho-error-primary text-pho-error\",\n \"[&:is(button,a):hover]:bg-pho-error-primary\",\n ),\n description: \"Something failed — the send that did not go through\",\n },\n} satisfies VariantMap;\n\nexport type BubbleVariant = keyof typeof BUBBLE_VARIANTS;\nexport type BubbleAlign = \"start\" | \"end\";\n\nconst BubbleContext = createContext<{\n variant: BubbleVariant;\n align: BubbleAlign;\n}>({ variant: \"outlined\", align: \"start\" });\n\n/* --------------------------------- group -------------------------------- */\n\n/**\n * Consecutive bubbles from one author — a tighter stack than the gap\n * between messages, so they read as one turn.\n */\nfunction Group({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-bubble-group=\"\"\n className={cn(\"flex min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\n/* --------------------------------- root --------------------------------- */\n\nexport interface BubbleRootProps extends ComponentProps<\"div\"> {\n /** Surface. @default \"outlined\" */\n variant?: BubbleVariant;\n /** Which side the author sits on. @default \"start\" */\n align?: BubbleAlign;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The bubble's column: the surface (`Content`) with anything anchored to\n * it (`Reactions`). Caps at 80% of the row so the other side stays open;\n * `ghost` runs full width.\n */\nfunction Root({\n variant = \"outlined\",\n align = \"start\",\n className,\n ...props\n}: BubbleRootProps) {\n return (\n <BubbleContext.Provider value={{ variant, align }}>\n <div\n data-bubble=\"\"\n data-variant={variant}\n data-align={align}\n className={cn(\n \"group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1\",\n align === \"end\" && \"items-end self-end\",\n variant === \"ghost\" && \"max-w-full\",\n className,\n )}\n {...props}\n />\n </BubbleContext.Provider>\n );\n}\n\n/* -------------------------------- content ------------------------------- */\n\nexport interface BubbleContentProps extends useRender.ComponentProps<\"div\"> {\n /**\n * The bubble whose record is open beside the thread — a brand ring\n * lifts it off the page. Pair with `aria-pressed` or `aria-current`\n * on an interactive bubble so the state is announced too.\n */\n selected?: boolean;\n}\n\n/**\n * The surface itself. Text wraps and keeps its line breaks. Pass\n * `render={<button type=\"button\" />}` (or a router link) to make the\n * bubble the control that opens the message — it then takes the hover\n * wash and the focus ring.\n */\nfunction Content({\n className,\n render,\n selected,\n ...props\n}: BubbleContentProps) {\n const { variant, align } = useContext(BubbleContext);\n return useRender({\n defaultTagName: \"div\",\n render,\n props: {\n ...props,\n className: cn(\n \"rounded-base w-fit max-w-full min-w-0 overflow-hidden px-3.5 py-2 text-left text-base leading-normal break-words whitespace-pre-wrap\",\n // The tail: a tighter corner on the author's side.\n align === \"end\" ? \"rounded-br-sm\" : \"rounded-bl-sm\",\n resolveVariant(BUBBLE_VARIANTS, variant),\n // Interactive bubbles — a button or a link — take the ring.\n \"outline-none [&:is(button,a)]:cursor-pointer [&:is(button,a)]:transition-[background-color,opacity,box-shadow] [&:is(button,a)]:duration-100 [&:is(button,a)]:ease-linear\",\n \"[&:is(button,a)]:focus-visible:ring-pho-brand [&:is(button,a)]:focus-visible:ring-2 [&:is(button,a)]:focus-visible:ring-offset-2 [&:is(button,a)]:focus-visible:ring-offset-(--pho-bubble-backdrop,var(--background-color-pho-primary))\",\n selected &&\n \"ring-pho-brand ring-2 ring-offset-2 ring-offset-(--pho-bubble-backdrop,var(--background-color-pho-primary))\",\n className,\n ),\n \"data-bubble-content\": \"\",\n \"data-selected\": selected ? \"\" : undefined,\n },\n });\n}\n\n/* ------------------------------- reactions ------------------------------ */\n\nexport interface BubbleReactionsProps extends ComponentProps<\"div\"> {\n /** Which edge of the bubble the pill hangs from. @default \"bottom\" */\n side?: \"top\" | \"bottom\";\n /** Which corner. Defaults to the corner away from the tail. */\n align?: BubbleAlign;\n}\n\n/**\n * A small pill hanging off a corner of the bubble — an emoji tapback, a\n * count. The bubble's column reserves no room for it: it overlaps the\n * edge, as tapbacks do.\n */\nfunction Reactions({\n side = \"bottom\",\n align,\n className,\n ...props\n}: BubbleReactionsProps) {\n const bubble = useContext(BubbleContext);\n const corner = align ?? (bubble.align === \"end\" ? \"start\" : \"end\");\n return (\n <div\n data-bubble-reactions=\"\"\n data-side={side}\n data-align={corner}\n className={cn(\n \"bg-pho-primary text-pho-primary ring-pho-secondary absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full px-1.5 py-0.5 text-xs leading-none ring-1 has-[button]:p-0\",\n side === \"top\" ? \"top-0 -translate-y-3/4\" : \"bottom-0 translate-y-3/4\",\n corner === \"start\" ? \"left-2\" : \"right-2\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * A message's surface. `Root` takes the `variant` and `align`; `Content`\n * is the chip (a `div`, or a `button` / link through `render`);\n * `Reactions` hangs off a corner. Stack one author's consecutive bubbles\n * in a `Group`.\n *\n * ```tsx\n * <Bubble.Root variant=\"inverse\" align=\"end\">\n * <Bubble.Content>On my way.</Bubble.Content>\n * <Bubble.Reactions>👍</Bubble.Reactions>\n * </Bubble.Root>\n * ```\n */\nexport const Bubble = { Root, Content, Reactions, Group };\n"],"mappings":";;;;;;AAkCA,IAAa,IAAkB;AAAA,EAC7B,UAAU;AAAA,IACR,SAAS,EACP,wEACA,6CACF;AAAA,IACA,aACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SAAS,EACP,mCACA,mCACF;AAAA,IACA,aAAa;AAAA,EACf;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,EACP,qCACA,6CACF;AAAA,IACA,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,SAAS,EACP,oDACA,2CACF;AAAA,IACA,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,SAAS,EACP,uCACA,6CACF;AAAA,IACA,aAAa;AAAA,EACf;AACF,GAKM,IAAgB,EAGnB;AAAA,EAAE,SAAS;AAAA,EAAY,OAAO;AAAQ,CAAC;AAQ1C,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgC;AAC7D,SACE,gBAAA,EAAC,OAAD;AAAA,IACE,qBAAkB;AAAA,IAClB,WAAW,EAAG,+BAA+B,CAAS;AAAA,IACtD,GAAI;AAAA,EACL,CAAA;AAEL;AAiBA,SAAS,EA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AM,SAAA;AAAA,EAAS,WAAA;AAAA,EAAW,OAAA;AAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-C9VqBBIr.js","names":[],"sources":["../../src/components/button/button.tsx"],"sourcesContent":["import {\n isValidElement,\n useEffect,\n useMemo,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type ComponentType,\n type FC,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport { SPRING_PRESS } from \"../../motion\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport { isReactComponent } from \"../../utils/is-react-component\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\nimport { Spinner } from \"../spinner/spinner\";\n\n/**\n * Design notes:\n * - TWO visual axes: `variant` is the surface (filled / outlined / ghost /\n * effect) and `color` is the semantic ink (default / destructive). Dialog\n * confirms use the default `effect`; danger-zone triggers are `ghost` +\n * `destructive`. `effect` is the marketing pill: same-hue 1.5px outer rim\n * plus inset sheen that springs on hover.\n * - `iconReveal` is a separate boolean: on hover, prefix/suffix icons spring\n * in from collapsed — works with any variant, independent of `effect`.\n * - Press scale (Motion `whileTap` → 0.97) is shared by every variant; only\n * `effect` also springs its inset sheen on hover/press, and replays a\n * one-shot sheen glint when it leaves `disabled`/`loading` (wake).\n * - THREE sizes (`sm` / `md` / `lg`, default `md`). No `xs` / `xl`.\n * - `prefix` / `suffix` are generic slots (icon, spinner, count…), not\n * icon-only props. `svgOnly` makes an icon button and *requires* an\n * `aria-label`. `loading` is declarative. Effect’s rim/sheen are\n * box-shadow layers (not layout `border`).\n * - Navigation belongs to `ButtonLink`; an inline text link is an anchor.\n */\n\nconst COMMON_ROOT = cn(\n // Transition colors/shadows in CSS; transform (press scale) is owned by Motion.\n // Inset focus so the ring stays inside a clipping ancestor (a card, a\n // scrollport) and inside the pill itself — never drop the ring.\n \"group relative inline-flex h-max cursor-pointer items-center justify-center whitespace-nowrap outline-pho-brand transition-[color,background-color,border-color,opacity,box-shadow,outline-color] duration-100 ease-linear focus-visible:outline-2 focus-visible:-outline-offset-2\",\n // Disabled (native `disabled` on <button>, `aria-disabled` on links).\n \"disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none\",\n);\n\n/**\n * Size axis — padding, text size, and icon-only (svgOnly) padding.\n *\n * Icon-side tuck (optical correction): a side that carries an icon sits 4px\n * closer to its edge than the label does to the other — sm 12/16 · md 14/18 ·\n * lg 18/22. An icon's box brings its own whitespace, so equal padding reads\n * as a looser icon side; the tuck is small enough to look equal, not measured\n * to be. Selected structurally via `:has()` on the slot markers (`data-icon`\n * is `prefix`, `suffix`, or `loading` — the spinner is an icon too). The\n * label has no padding of its own: its inset from an icon is the `gap`.\n */\nexport const BUTTON_SIZES = {\n sm: {\n classes: cn(\n \"gap-1.5 px-4 py-1.5 text-base font-medium data-svg-only:p-2\",\n \"has-[[data-icon=prefix]]:pl-3 has-[[data-icon=loading]]:pl-3 has-[[data-icon=suffix]]:pr-3\",\n ),\n description: \"Small — compact rows, tables, and toolbars\",\n },\n md: {\n classes: cn(\n \"gap-1.5 px-4.5 py-2 text-base font-medium data-svg-only:p-2.5\",\n \"has-[[data-icon=prefix]]:pl-3.5 has-[[data-icon=loading]]:pl-3.5 has-[[data-icon=suffix]]:pr-3.5\",\n ),\n description: \"Medium — the default\",\n },\n lg: {\n classes: cn(\n \"gap-2 px-5.5 py-2.5 text-md font-medium data-svg-only:p-3\",\n \"has-[[data-icon=prefix]]:pl-4.5 has-[[data-icon=loading]]:pl-4.5 has-[[data-icon=suffix]]:pr-4.5\",\n ),\n description: \"Large — prominent and marketing actions\",\n },\n} satisfies VariantMap;\n\n/** Shape axis — corner treatment. Pills are the photon.codes default. */\nexport const BUTTON_SHAPES = {\n rounded: {\n classes: \"rounded-full\",\n description: \"Pill — the default; every button on photon.codes\",\n },\n square: {\n classes: \"rounded-base\",\n description: \"Gently rounded corners for dense app chrome\",\n },\n circle: {\n classes: \"rounded-full\",\n description: \"Circular — pair with svgOnly for round icon buttons\",\n },\n} satisfies VariantMap;\n\n/**\n * At `lg`, square buttons add squircle smoothing on top of `rounded-base`\n * (12px) — the same treatment as Input `lg`, so 44px buttons and fields share\n * a corner language. 12/44 ≈ 0.272 — LiftKit's half-step decimal (√φ − 1).\n */\nconst SQUARE_LG_RADIUS = \"squircle\";\n\n/**\n * Optical pad for `effect`: the 1.5px outer rim is a box-shadow (no layout\n * cost), so without this the painted height reads ~3px taller than filled /\n * outlined / ghost. Subtract 1.5px from each side so fill+rim matches siblings.\n */\nconst EFFECT_OPTICAL_PAD: Record<ButtonSize, string> = {\n sm: \"py-[4.5px] data-svg-only:p-[6.5px]\",\n md: \"py-[6.5px] data-svg-only:p-[8.5px]\",\n lg: \"py-[8.5px] data-svg-only:p-[10.5px]\",\n};\n\n/** Surface axis — how the control is drawn. `effect` is the default. */\nexport const BUTTON_VARIANTS = {\n effect: {\n classes: \"\",\n description:\n \"Default — marketing pill with same-hue outer rim and inset sheen\",\n },\n filled: {\n classes: \"\",\n description: \"Solid fill without sheen\",\n },\n outlined: {\n classes: \"\",\n description: \"Hairline ring — supporting action\",\n },\n ghost: {\n classes: \"\",\n description: \"Borderless — quiet / inline action\",\n },\n} satisfies VariantMap;\n\n/** Color axis — semantic ink. `default` is the default. */\nexport const BUTTON_COLORS = {\n default: {\n classes: \"\",\n description: \"Neutral / brand contrast\",\n },\n destructive: {\n classes: \"\",\n description: \"Destructive intent (delete, discard)\",\n },\n} satisfies VariantMap;\n\n/**\n * Surface × color looks. Kept as a matrix so each cell can own its tokens\n * (filled destructive is solid red; ghost destructive is red text only).\n */\nconst BUTTON_LOOKS: Record<\n keyof typeof BUTTON_VARIANTS,\n Record<keyof typeof BUTTON_COLORS, string>\n> = {\n // Icons inherit the label ink (currentColor) — no separate opacity/tint.\n // The rim replicates photon.codes' Framer CTA border: 1.5px in the fill hue\n // at 62% alpha, reading as a soft same-hue edge (the site has NO outer\n // glow — verified against live computed styles). Sheen geometry is CSS\n // vars that Motion springs on hover (see Button). All edges are shadows —\n // never a layout `border` — so height stays paired with other variants.\n effect: {\n default: cn(\n \"squircle overflow-visible bg-pho-brand-solid text-pho-on-brand transition-none\",\n \"hover:bg-pho-brand-solid data-loading:bg-pho-brand-solid\",\n \"[--pho-rim:color-mix(in_oklab,var(--background-color-pho-brand-solid)_62%,transparent)]\",\n \"[--pho-sheen:light-dark(rgba(255,255,255,0.5),rgba(0,0,0,0.12))]\",\n \"shadow-[0_0_0_1.5px_var(--pho-rim),inset_0_0_0_1px_var(--border-color-pho-on-brand),inset_0_var(--pho-sheen-y,0px)_var(--pho-sheen-blur,5px)_var(--pho-sheen-spread,2px)_var(--pho-sheen)]\",\n ),\n destructive: cn(\n \"squircle overflow-visible bg-pho-error-solid text-white outline-pho-error transition-none\",\n \"hover:bg-pho-error-solid data-loading:bg-pho-error-solid\",\n \"[--pho-rim:color-mix(in_oklab,var(--background-color-pho-error-solid)_62%,transparent)]\",\n \"[--pho-sheen:light-dark(rgba(255,255,255,0.45),rgba(0,0,0,0.18))]\",\n \"shadow-[0_0_0_1.5px_var(--pho-rim),inset_0_0_0_1px_oklch(1_0_0/0.2),inset_0_var(--pho-sheen-y,0px)_var(--pho-sheen-blur,5px)_var(--pho-sheen-spread,2px)_var(--pho-sheen)]\",\n ),\n },\n filled: {\n default:\n \"bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover data-loading:bg-pho-brand-solid-hover\",\n destructive:\n \"bg-pho-error-solid text-white outline-pho-error hover:bg-pho-error-solid-hover data-loading:bg-pho-error-solid-hover\",\n },\n outlined: {\n default:\n // Rest hairline is the card stroke; hover climbs to primary ink so the\n // edge reads as black (white in dark), matching the label's hover lift.\n // The ring spans the full ladder, so ease it in gently — 200ms ease-out\n // approximates the effect variant's soft spring instead of base's\n // 100ms linear snap. Prefer the named `ring-pho-ink` token over an\n // arbitrary value so consumers' Tailwind scanners pick it up reliably.\n \"bg-pho-primary text-pho-secondary ring-1 ring-pho-secondary ring-inset duration-200 ease-out hover:bg-pho-primary-hover hover:text-pho-secondary-hover hover:ring-pho-ink data-loading:bg-pho-primary-hover\",\n destructive:\n \"bg-pho-primary text-pho-error outline-pho-error ring-1 ring-pho-error ring-inset duration-200 ease-out hover:bg-pho-error-primary hover:text-pho-error-hover data-loading:bg-pho-error-primary\",\n },\n ghost: {\n default:\n \"text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-secondary-hover data-loading:bg-pho-ghost-hover\",\n destructive:\n \"text-pho-error outline-pho-error hover:bg-pho-error-primary hover:text-pho-error-hover data-loading:bg-pho-error-primary\",\n },\n};\n\nexport type ButtonSize = keyof typeof BUTTON_SIZES;\nexport type ButtonShape = keyof typeof BUTTON_SHAPES;\nexport type ButtonVariant = keyof typeof BUTTON_VARIANTS;\nexport type ButtonColor = keyof typeof BUTTON_COLORS;\n\n/** Compose the full class string for a button — exported for reuse/testing. */\nexport function buttonVariants(opts?: {\n variant?: ButtonVariant;\n color?: ButtonColor;\n size?: ButtonSize;\n shape?: ButtonShape;\n className?: string;\n}): string {\n const {\n variant = \"effect\",\n color = \"default\",\n size = \"md\",\n shape: shapeOpt = \"rounded\",\n className,\n } = opts ?? {};\n // Effect pills are always fully rounded — shape is ignored.\n const shape = variant === \"effect\" ? \"rounded\" : shapeOpt;\n const look =\n BUTTON_LOOKS[variant as keyof typeof BUTTON_LOOKS]?.[\n color as keyof (typeof BUTTON_LOOKS)[\"effect\"]\n ] ?? \"\";\n return cn(\n COMMON_ROOT,\n resolveVariant(BUTTON_SHAPES, shape),\n shape === \"square\" && size === \"lg\" && SQUARE_LG_RADIUS,\n resolveVariant(BUTTON_SIZES, size),\n // Outer rim is a 1.5px box-shadow (no layout cost). Shrink padding by the\n // same amount so fill+rim paints at the same visual size as filled /\n // outlined / ghost siblings of the same `size`.\n variant === \"effect\" && EFFECT_OPTICAL_PAD[size],\n look,\n className,\n );\n}\n\n/** An icon/element slot rendered before or after the label. */\ntype Slottable = ReactNode | FC<{ className?: string }>;\n\ninterface ButtonBaseProps {\n /** Surface variant. @default \"effect\" */\n variant?: ButtonVariant;\n /** Semantic color. @default \"default\" */\n color?: ButtonColor;\n /** Size variant. @default \"md\" */\n size?: ButtonSize;\n /** Corner shape. @default \"rounded\" */\n shape?: ButtonShape;\n /** Slot before the label — a component (`Plus`) or element (`<Plus />`). */\n prefix?: Slottable;\n /** Slot after the label. */\n suffix?: Slottable;\n /**\n * Reveal prefix/suffix icons on hover — collapsed and invisible at rest,\n * spring in on hover. Independent of `variant` (including `effect`).\n * Ignored when `svgOnly`. @default false\n */\n iconReveal?: boolean;\n /** Render as an icon-only button. Requires an `aria-label`. */\n svgOnly?: boolean;\n /** Show a spinner and block interaction while staying readable. */\n loading?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * DOM event handlers whose React signatures clash with Motion's gesture\n * props of the same name (Motion re-types these on `motion.*` elements).\n * Excluded from the public API — Button renders through Motion when the\n * sheen or icon reveal is active, so these handlers would be intercepted.\n */\ntype MotionHandlerConflicts =\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onDragEnter\"\n | \"onDragExit\"\n | \"onDragLeave\"\n | \"onDragOver\"\n | \"onDrop\";\n\nexport interface ButtonProps\n extends\n ButtonBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ButtonBaseProps | MotionHandlerConflicts\n > {\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface ButtonLinkProps\n extends\n ButtonBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ButtonBaseProps | MotionHandlerConflicts\n > {\n /** Navigate to this URL (rendered via the host's `LinkProvider`). */\n href: string;\n /** Visually and semantically disable the link. */\n disabled?: boolean;\n}\n\nconst SLOT_CLASS =\n // Icons scale with the label: 1.125em tracks the button's font size\n // (16px icon beside 14px text, 18px beside 16px) so small buttons never\n // carry an oversized glyph.\n \"transition-inherit-all pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-[1.125em] [&>svg]:shrink-0\";\n\nfunction Slot({\n position,\n children,\n}: {\n position: \"prefix\" | \"suffix\" | \"loading\";\n children: ReactNode;\n}) {\n return (\n <span data-icon={position} className={SLOT_CLASS}>\n {children}\n </span>\n );\n}\n\nfunction renderSlot(icon: Slottable, position: \"prefix\" | \"suffix\") {\n if (icon == null || icon === false) return null;\n if (isReactComponent(icon)) {\n const Icon = icon;\n return (\n <Slot position={position}>\n <Icon />\n </Slot>\n );\n }\n if (isValidElement(icon)) return <Slot position={position}>{icon}</Slot>;\n return null;\n}\n\nfunction warnMissingLabel(svgOnly: boolean | undefined, label: unknown) {\n if (\n svgOnly &&\n !label &&\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.warn(\n \"Button: `svgOnly` buttons require an `aria-label` that names the action.\",\n );\n }\n}\n\n/* ======================== Motion: sheen + icon reveal ======================== */\n\n/** Framer source transition: `spring-physics 200 30 0.1`. */\nconst BUTTON_SPRING = SPRING_PRESS;\n\nconst EFFECT_SHEEN_REST = {\n \"--pho-sheen-y\": \"0px\",\n \"--pho-sheen-blur\": \"5px\",\n \"--pho-sheen-spread\": \"2px\",\n} as const;\n\n/** Per-size sheen hover targets. */\nconst EFFECT_SHEEN_HOVER = {\n sm: {\n \"--pho-sheen-y\": \"-3px\",\n \"--pho-sheen-blur\": \"8px\",\n \"--pho-sheen-spread\": \"2px\",\n },\n md: {\n \"--pho-sheen-y\": \"-3px\",\n \"--pho-sheen-blur\": \"8px\",\n \"--pho-sheen-spread\": \"2px\",\n },\n lg: {\n \"--pho-sheen-y\": \"-6px\",\n \"--pho-sheen-blur\": \"14px\",\n \"--pho-sheen-spread\": \"1px\",\n },\n} as const;\n\n/**\n * Per-size sheen press targets — the inverse gesture of hover: the light\n * drops back below the rest line and tightens while the pill compresses\n * slightly, so hover → press reads as \"lift, then push in\".\n */\nconst EFFECT_SHEEN_PRESS = {\n sm: {\n \"--pho-sheen-y\": \"1.5px\",\n \"--pho-sheen-blur\": \"4px\",\n \"--pho-sheen-spread\": \"1px\",\n },\n md: {\n \"--pho-sheen-y\": \"1.5px\",\n \"--pho-sheen-blur\": \"4px\",\n \"--pho-sheen-spread\": \"1px\",\n },\n lg: {\n \"--pho-sheen-y\": \"3px\",\n \"--pho-sheen-blur\": \"7px\",\n \"--pho-sheen-spread\": \"1px\",\n },\n} as const;\n\n/** Pill compression while pressed — subtle, transform-only; every variant. */\nconst BUTTON_PRESS_SCALE = 0.97;\n\n/**\n * One-shot \"wake\" glint when an effect pill re-enables (disabled / loading →\n * interactive). The keyframes replay the pill's own gesture in reverse: the\n * sheen starts from its pressed-in position (low, tight — the dormant read),\n * springs up past the hover line, and settles at rest. Shadow-only, so the\n * pill never moves or resizes next to its neighbours.\n */\nconst EFFECT_SHEEN_WAKE = {\n sm: {\n \"--pho-sheen-y\": [\"1.5px\", \"-4px\", \"0px\"],\n \"--pho-sheen-blur\": [\"4px\", \"9px\", \"5px\"],\n \"--pho-sheen-spread\": [\"1px\", \"2px\", \"2px\"],\n },\n md: {\n \"--pho-sheen-y\": [\"1.5px\", \"-4px\", \"0px\"],\n \"--pho-sheen-blur\": [\"4px\", \"9px\", \"5px\"],\n \"--pho-sheen-spread\": [\"1px\", \"2px\", \"2px\"],\n },\n lg: {\n \"--pho-sheen-y\": [\"3px\", \"-8px\", \"0px\"],\n \"--pho-sheen-blur\": [\"7px\", \"16px\", \"5px\"],\n \"--pho-sheen-spread\": [\"1px\", \"1px\", \"2px\"],\n },\n} as const;\n\n/**\n * Wake timing: a short delay lets the 100ms opacity fade land first, then a\n * quick rise (feedback) and a relaxed settle. Keyframes need a tween — the\n * shared spring only animates between two values.\n */\nconst WAKE_TRANSITION = {\n duration: 0.6,\n delay: 0.05,\n times: [0, 0.4, 1],\n ease: [\"easeOut\", \"easeInOut\"],\n} as const;\n\n/**\n * Fire the wake glint on the disabled/loading → enabled edge (never on\n * mount), skipped under reduced motion. `data-waking` mirrors the window so\n * tests and styling can observe it.\n */\nfunction useWakeOnEnable(inert: boolean, sheen: boolean) {\n const [waking, setWaking] = useState(false);\n const prevInert = useRef(inert);\n const reduceMotion = useReducedMotion();\n\n useEffect(() => {\n if (prevInert.current && !inert && sheen && !reduceMotion) {\n setWaking(true);\n } else if (inert) {\n setWaking(false);\n }\n prevInert.current = inert;\n }, [inert, sheen, reduceMotion]);\n\n return {\n waking,\n onWakeComplete: (definition: unknown) => {\n if (definition === \"wake\") setWaking(false);\n },\n };\n}\n\n/**\n * Icon reveal sizes — collapsed at rest, full on hover. `lg` matches the\n * Framer 20×21 source; `sm`/`md` scale with the 14px label.\n */\nconst ICON_REVEAL_VARIANTS = {\n sm: {\n rest: { opacity: 0, width: 1, height: 9 },\n hover: { opacity: 1, width: 17, height: 18 },\n },\n md: {\n rest: { opacity: 0, width: 1, height: 9 },\n hover: { opacity: 1, width: 17, height: 18 },\n },\n lg: {\n rest: { opacity: 0, width: 1, height: 10 },\n hover: { opacity: 1, width: 20, height: 21 },\n },\n} as const;\n\n/**\n * When icons are hidden at rest, undo Button's icon-side padding tuck so the\n * pill doesn't look lopsided. Same `:has()` keys as the tuck (later wins).\n */\nconst ICON_REVEAL_PAD_RESTORE: Record<ButtonSize, string> = {\n sm: \"has-[[data-icon=prefix]]:pl-4 has-[[data-icon=loading]]:pl-4 has-[[data-icon=suffix]]:pr-4\",\n md: \"has-[[data-icon=prefix]]:pl-4.5 has-[[data-icon=loading]]:pl-4.5 has-[[data-icon=suffix]]:pr-4.5\",\n lg: \"has-[[data-icon=prefix]]:pl-5.5 has-[[data-icon=loading]]:pl-5.5 has-[[data-icon=suffix]]:pr-5.5\",\n};\n\nfunction RevealSlot({\n position,\n size,\n children,\n}: {\n position: \"prefix\" | \"suffix\";\n size: ButtonSize;\n children: ReactNode;\n}) {\n return (\n <motion.span\n data-icon={position}\n variants={ICON_REVEAL_VARIANTS[size]}\n transition={BUTTON_SPRING}\n style={{\n display: \"inline-flex\",\n flex: \"none\",\n alignItems: \"center\",\n overflow: \"hidden\",\n }}\n className=\"pointer-events-none [&>svg]:block [&>svg]:size-full\"\n >\n {children}\n </motion.span>\n );\n}\n\nfunction wrapRevealIcon(\n icon: Slottable,\n position: \"prefix\" | \"suffix\",\n size: ButtonSize,\n): ReactNode | undefined {\n if (icon == null || icon === false) return undefined;\n if (isReactComponent(icon)) {\n const Icon = icon;\n return (\n <RevealSlot position={position} size={size}>\n <Icon />\n </RevealSlot>\n );\n }\n if (isValidElement(icon)) {\n return (\n <RevealSlot position={position} size={size}>\n {icon}\n </RevealSlot>\n );\n }\n return (\n <RevealSlot position={position} size={size}>\n {icon}\n </RevealSlot>\n );\n}\n\nfunction buttonInner({\n svgOnly,\n loading,\n prefix,\n suffix,\n children,\n iconReveal,\n size,\n}: Pick<\n ButtonBaseProps,\n | \"svgOnly\"\n | \"loading\"\n | \"prefix\"\n | \"suffix\"\n | \"children\"\n | \"iconReveal\"\n | \"size\"\n> & { size: ButtonSize }) {\n if (svgOnly) {\n return loading ? <Spinner /> : children;\n }\n const reveal = Boolean(iconReveal);\n return (\n <>\n {loading ? (\n <Slot position=\"loading\">\n <Spinner />\n </Slot>\n ) : reveal ? (\n wrapRevealIcon(prefix, \"prefix\", size)\n ) : (\n renderSlot(prefix, \"prefix\")\n )}\n {children != null && children !== false && (\n <span data-text className=\"transition-inherit-all\">\n {children}\n </span>\n )}\n {reveal\n ? wrapRevealIcon(suffix, \"suffix\", size)\n : renderSlot(suffix, \"suffix\")}\n </>\n );\n}\n\n/**\n * Root Motion props — press scale on every variant; sheen + icon-reveal gap\n * only when those features are on. Press composes over hover (`whileTap` >\n * `whileHover`): effect sheen inverts while the pill compresses; other\n * variants get the same scale with no sheen change. `waking` plays the\n * one-shot re-enable glint; a real hover mid-glint takes over seamlessly.\n */\nfunction buttonRootMotionProps(\n size: ButtonSize,\n inert: boolean | undefined,\n opts: { sheen: boolean; iconReveal: boolean; waking?: boolean },\n) {\n const rest: Record<string, string | number> = {\n scale: 1,\n ...(opts.sheen ? EFFECT_SHEEN_REST : {}),\n };\n const hover: Record<string, string | number> = opts.sheen\n ? { ...EFFECT_SHEEN_HOVER[size] }\n : {};\n const press: Record<string, string | number> = {\n scale: BUTTON_PRESS_SCALE,\n ...(opts.sheen ? EFFECT_SHEEN_PRESS[size] : {}),\n };\n const wake = opts.sheen\n ? { ...EFFECT_SHEEN_WAKE[size], transition: WAKE_TRANSITION }\n : {};\n if (opts.iconReveal) {\n // Collapse gap at rest so the hidden icon leaves no hole; hover opens it.\n rest.gap = 0;\n hover.gap = size === \"lg\" ? 6 : 2;\n }\n return {\n initial: false as const,\n animate: opts.waking && opts.sheen ? \"wake\" : \"rest\",\n whileHover: inert ? undefined : \"hover\",\n whileTap: inert ? undefined : \"press\",\n variants: { rest, hover, press, wake },\n transition: BUTTON_SPRING,\n };\n}\n\nfunction buttonClassName({\n variant,\n color,\n size,\n shape,\n loading,\n svgOnly,\n className,\n}: {\n variant?: ButtonVariant;\n color?: ButtonColor;\n size?: ButtonSize;\n shape?: ButtonShape;\n loading?: boolean;\n svgOnly?: boolean;\n className?: string;\n}) {\n return cn(\n buttonVariants({ variant, color, size, shape }),\n loading && \"pointer-events-none\",\n svgOnly && \"[&>svg]:size-[1.25em] [&>svg]:shrink-0\",\n className,\n );\n}\n\n/**\n * Button — triggers an action that mutates state (submit, save, delete).\n * For navigation that changes the URL, use {@link ButtonLink}.\n *\n * Default surface is `effect` (same-hue 1.5px outer rim + inset sheen). Use\n * `filled` for a solid fill without those layers. `iconReveal` springs\n * prefix/suffix icons in on hover — independent of variant.\n */\nexport function Button({\n variant = \"effect\",\n color,\n size = \"md\",\n shape,\n prefix,\n suffix,\n iconReveal = false,\n svgOnly,\n loading,\n children,\n className,\n ref,\n ...props\n}: ButtonProps) {\n warnMissingLabel(svgOnly, props[\"aria-label\"]);\n const sheen = variant === \"effect\";\n const reveal = iconReveal && !svgOnly;\n const inert = Boolean(props.disabled || loading);\n const { waking, onWakeComplete } = useWakeOnEnable(inert, sheen);\n const cls = buttonClassName({\n variant,\n color,\n size,\n shape,\n loading,\n svgOnly,\n className: cn(reveal && ICON_REVEAL_PAD_RESTORE[size], className),\n });\n const inner = buttonInner({\n svgOnly,\n loading,\n prefix,\n suffix,\n children,\n iconReveal: reveal,\n size,\n });\n\n return (\n <motion.button\n ref={ref}\n type=\"button\"\n {...buttonRootMotionProps(size, inert, {\n sheen,\n iconReveal: reveal,\n waking,\n })}\n onAnimationComplete={onWakeComplete}\n {...props}\n aria-busy={loading || undefined}\n data-loading={loading ? \"true\" : undefined}\n data-svg-only={svgOnly ? \"true\" : undefined}\n data-waking={waking || undefined}\n className={cls}\n >\n {inner}\n </motion.button>\n );\n}\n\nButton.displayName = \"Button\";\n\n/**\n * ButtonLink — a link styled as a button, for navigation that changes the URL.\n * Shares every visual prop with {@link Button}; renders the host router's link\n * via `LinkProvider`.\n */\nexport function ButtonLink({\n variant = \"effect\",\n color,\n size = \"md\",\n shape,\n prefix,\n suffix,\n iconReveal = false,\n svgOnly,\n loading,\n disabled,\n href,\n children,\n className,\n ...props\n}: ButtonLinkProps) {\n warnMissingLabel(svgOnly, props[\"aria-label\"]);\n const Link = useLinkComponent();\n const sheen = variant === \"effect\";\n const reveal = iconReveal && !svgOnly;\n const cls = buttonClassName({\n variant,\n color,\n size,\n shape,\n loading,\n svgOnly,\n className: cn(reveal && ICON_REVEAL_PAD_RESTORE[size], className),\n });\n const inner = buttonInner({\n svgOnly,\n loading,\n prefix,\n suffix,\n children,\n iconReveal: reveal,\n size,\n });\n // Hooks must run unconditionally — only used when Motion is needed.\n const MotionLink = useMemo(\n // LinkProvider requires `href`; motion.create needs an open prop record —\n // bridge the two through `unknown` (props are supplied at the call site).\n () =>\n motion.create(Link as unknown as ComponentType<Record<string, unknown>>),\n [Link],\n );\n\n const inert = Boolean(disabled || loading);\n const { waking, onWakeComplete } = useWakeOnEnable(inert, sheen);\n const shared = {\n ...props,\n ...(inert ? {} : { href }),\n \"aria-disabled\": inert || undefined,\n \"aria-busy\": loading || undefined,\n \"data-loading\": loading ? (\"true\" as const) : undefined,\n \"data-svg-only\": svgOnly ? (\"true\" as const) : undefined,\n className: cls,\n tabIndex: inert ? -1 : props.tabIndex,\n onClick: inert\n ? (event: ReactMouseEvent<HTMLAnchorElement>) => {\n event.preventDefault();\n }\n : props.onClick,\n };\n\n if (inert) {\n return <span {...shared}>{inner}</span>;\n }\n\n return (\n <MotionLink\n {...buttonRootMotionProps(size, inert, {\n sheen,\n iconReveal: reveal,\n waking,\n })}\n onAnimationComplete={onWakeComplete}\n data-waking={waking || undefined}\n {...shared}\n >\n {inner}\n </MotionLink>\n );\n}\n\nButtonLink.displayName = \"ButtonLink\";\n\n/* ======================= EffectButton (compat alias) ======================= */\n\nexport const EFFECT_BUTTON_SIZES = BUTTON_SIZES;\nexport type EffectButtonSize = ButtonSize;\n\n/** Compose classes for an effect pill — `Button` with `variant=\"effect\"`. */\nexport function effectButtonVariants(opts?: {\n size?: EffectButtonSize;\n fullWidth?: boolean;\n className?: string;\n}): string {\n const { size = \"md\", fullWidth, className } = opts ?? {};\n return buttonVariants({\n variant: \"effect\",\n size,\n className: cn(fullWidth && \"w-full\", className),\n });\n}\n\n/**\n * Legacy EffectButton also reserved `style` (sheen variables lived there) and\n * never exposed the HTML `color` attribute — Button's semantic `color` prop\n * now occupies that name.\n */\ntype MotionConflicts = MotionHandlerConflicts | \"style\" | \"color\";\n\ninterface EffectButtonBaseProps {\n /** Size variant — Button's scale (32 / 36 / 44px). @default \"md\" */\n size?: EffectButtonSize;\n /** Stretch to the container's full width (stacked login / OAuth pills). */\n fullWidth?: boolean;\n /**\n * @deprecated Use `iconReveal` on `Button` instead. Mapped to `iconReveal`\n * when set.\n */\n animated?: boolean;\n /** @see ButtonBaseProps.iconReveal */\n iconReveal?: boolean;\n prefix?: Slottable;\n suffix?: Slottable;\n svgOnly?: boolean;\n loading?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\nexport interface EffectButtonProps\n extends\n EffectButtonBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof EffectButtonBaseProps | MotionConflicts\n > {\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface EffectButtonLinkProps\n extends\n EffectButtonBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof EffectButtonBaseProps | MotionConflicts\n > {\n href: string;\n disabled?: boolean;\n}\n\n/**\n * @deprecated Prefer `<Button variant=\"effect\">`. Thin alias that forwards to\n * Button with the sheen surface (no icon reveal).\n */\nexport function EffectButton({\n size = \"md\",\n fullWidth,\n animated,\n iconReveal,\n className,\n ...props\n}: EffectButtonProps) {\n return (\n <Button\n variant=\"effect\"\n size={size}\n iconReveal={iconReveal ?? animated ?? true}\n className={cn(fullWidth && \"w-full\", className)}\n {...props}\n />\n );\n}\n\nEffectButton.displayName = \"EffectButton\";\n\n/**\n * @deprecated Prefer `<ButtonLink variant=\"effect\">`.\n */\nexport function EffectButtonLink({\n size = \"md\",\n fullWidth,\n animated,\n iconReveal,\n className,\n ...props\n}: EffectButtonLinkProps) {\n return (\n <ButtonLink\n variant=\"effect\"\n size={size}\n iconReveal={iconReveal ?? animated ?? true}\n className={cn(fullWidth && \"w-full\", className)}\n {...props}\n />\n );\n}\n\nEffectButtonLink.displayName = \"EffectButtonLink\";\n"],"mappings":";;;;;;;;;;AA0CA,IAAM,KAAc,EAIlB,sRAEA,6IACF,GAaa,IAAe;AAAA,EAC1B,IAAI;AAAA,IACF,SAAS,EACP,+DACA,4FACF;AAAA,IACA,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IACF,SAAS,EACP,iEACA,kGACF;AAAA,IACA,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IACF,SAAS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EAAW,cAAc;AAIzB,IAAa,KAAsB;AAInC,SAAgB,GAAqB,GAI1B;AACT,QAAM,EAAE,MAAA,IAAO,MAAM,WAAA,GAAW,WAAA,EAAA,IAAc,KAAQ,CAAC;AACvD,SAAO,EAAe;AAAA,IACpB,SAAS;AAAA,IACT,MAAA;AAAA,IACA,WAAW,EAAG,KAAa,UAAU,CAAS;AAAA,EAChD,CAAC;AACH;AAsDA,SAAgB,GAAa,EAC3B,MAAA,IAAO,MACP,WAAA,GACA,UAAA,GACA,YAAA,GACA,WAAA,GACA,GAAG,EAAA,GACiB;AACpB,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAQ;AAAA,IACF,MAAA;AAAA,IACN,YAAY,KAAc,KAAY;AAAA,IACtC,WAAW,EAAG,KAAa,UAAU,CAAS;AAAA,IAC9C,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,GAAa,cAAc;AAK3B,SAAgB,GAAiB,EAC/B,MAAA,IAAO,MACP,WAAA,GACA,UAAA,GACA,YAAA,GACA,WAAA,GACA,GAAG,EAAA,GACqB;AACxB,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAQ;AAAA,IACF,MAAA;AAAA,IACN,YAAY,KAAc,KAAY;AAAA,IACtC,WAAW,EAAG,KAAa,UAAU,CAAS;AAAA,IAC9C,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,GAAiB,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-4OFiCLAv.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconPointFilled.mjs","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z\", \"key\": \"svg-0\" }]];\nconst IconPointFilled = createReactComponent(\"filled\", \"point-filled\", \"PointFilled\", __iconNode);\n\nexport { __iconNode, IconPointFilled as default };\n//# sourceMappingURL=IconPointFilled.mjs.map\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type TdHTMLAttributes,\n} from \"react\";\nimport {\n DayPicker,\n useDayPicker,\n type ChevronProps,\n type ClassNames,\n type CustomComponents,\n type DayButtonProps,\n type DayPickerProps,\n type DayProps,\n type Modifiers,\n type MonthCaptionProps,\n type MonthGridProps,\n type MonthProps,\n type NavProps,\n} from \"react-day-picker\";\nimport {\n IconChevronDown,\n IconChevronLeft,\n IconChevronRight,\n IconChevronUp,\n IconPointFilled,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * One square per day — the unit the whole grid is measured in. The header\n * cells share the width so the weekday initials sit over their column.\n */\nconst DAY_SIZE = \"size-9\";\n\n/**\n * Seven of those columns — the width the month grid comes to, and the width\n * the jump lists hold to, so the panel never changes shape under a tap.\n */\nconst GRID_WIDTH = \"w-63\";\n\n/**\n * How far the year dropdown reaches when the page has not bounded the\n * calendar: ten years back and ten on, which covers the dates a dashboard\n * asks for and still fits one glance. Set `startMonth` / `endMonth` for a\n * birthday, an archive, anything further out.\n */\nconst DROPDOWN_YEAR_REACH = 10;\n\n/** Ghost icon button — the month arrows, sized to the caption row. */\nconst NAV_BUTTON = cn(\n \"text-pho-secondary flex size-7 cursor-pointer items-center justify-center rounded-sm\",\n \"transition-[color,background-color] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-secondary-hover\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1\",\n // Past the first or last navigable month the arrow stays put and dims.\n \"aria-disabled:pointer-events-none aria-disabled:opacity-30\",\n);\n\n/**\n * The structural classes. Every element DayPicker renders is named here — the\n * ones Pho dresses from the modifiers instead are named empty — so the\n * library's own stylesheet is never imported and no `rdp-*` class reaches the\n * DOM. A consumer's `classNames` merges over this map, element by element.\n */\nconst CALENDAR_CLASS_NAMES: Partial<ClassNames> = {\n root: \"text-pho-primary inline-block text-base\",\n // `relative` anchors the nav; months sit side by side once there is room.\n months: \"relative flex flex-col gap-6 sm:flex-row\",\n month: \"flex flex-col gap-2\",\n nav: \"absolute top-0 right-0 flex items-center gap-0.5\",\n button_previous: NAV_BUTTON,\n button_next: NAV_BUTTON,\n chevron: \"size-4\",\n // Matches the nav buttons' height so caption and arrows share a baseline.\n month_caption: \"flex h-7 items-center\",\n caption_label:\n \"text-pho-primary inline-flex items-center gap-0.5 font-medium\",\n dropdowns: \"flex items-center gap-1\",\n // The native select is a transparent overlay; the label under it is what shows.\n dropdown_root:\n \"relative -mx-1 inline-flex items-center rounded-sm px-1 hover:bg-pho-ghost-hover has-[select:focus-visible]:outline-pho-brand has-[select:focus-visible]:outline-2\",\n dropdown: \"absolute inset-0 cursor-pointer opacity-0\",\n months_dropdown: \"\",\n years_dropdown: \"\",\n // Separate borders so a range band's rounded ends actually round.\n month_grid: \"border-separate border-spacing-0\",\n weekdays: \"\",\n weekday: \"text-pho-description w-9 pb-1 text-xs font-normal\",\n weeks: \"\",\n week: \"\",\n week_number: \"text-pho-placeholder w-9 text-xs font-normal\",\n week_number_header: \"text-pho-description w-9 pb-1 text-xs font-normal\",\n footer: \"text-pho-description pt-3 text-base\",\n day: \"p-0 text-center align-middle\",\n // Day state is read off the modifiers in the two components below — as data\n // attributes on the cell and as classes on the button — so the library's own\n // state classes stay empty rather than doubling up.\n day_button: \"\",\n selected: \"\",\n range_start: \"\",\n range_middle: \"\",\n range_end: \"\",\n today: \"\",\n outside: \"\",\n focused: \"\",\n disabled: \"\",\n hidden: \"invisible\",\n};\n\n/** The day's own classes, resolved from the modifiers DayPicker hands down. */\nfunction dayButtonClassName(modifiers: Modifiers): string {\n const selectedEnd = Boolean(modifiers.selected && !modifiers.range_middle);\n\n return cn(\n \"relative flex cursor-pointer items-center justify-center rounded-sm tabular-nums select-none\",\n DAY_SIZE,\n \"text-pho-secondary\",\n \"transition-[color,background-color,box-shadow] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-primary\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1\",\n // A day from the neighbouring month is context, not a choice — it recedes\n // to the placeholder step but stays clickable.\n modifiers.outside && \"text-pho-placeholder\",\n // Today is marked with the field hairline, not a fill: the fill means\n // selected, and the two must never be confused.\n modifiers.today &&\n !modifiers.selected &&\n \"ring-pho-primary ring-1 ring-inset font-medium text-pho-primary\",\n // Inside a range the band behind carries the selection; the number just\n // reads as normal ink.\n modifiers.range_middle && \"text-pho-primary\",\n // The chosen day (and both ends of a range) takes the action fill.\n selectedEnd &&\n \"bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover hover:text-pho-on-brand font-medium ring-0\",\n \"disabled:pointer-events-none disabled:text-pho-disabled\",\n \"aria-disabled:pointer-events-none aria-disabled:text-pho-disabled\",\n );\n}\n\n/**\n * The grid cell. Carries the range band: a continuous wash behind the days\n * between both ends, rounded where the range starts and stops. The ends' own\n * buttons paint over their half of it, so the band reads as one shape.\n */\nfunction CalendarDay({\n // `day` is DayPicker's own object — kept out of the spread so it never\n // reaches the DOM as an attribute.\n day: _day,\n modifiers,\n className,\n ...props\n}: DayProps) {\n const inRange =\n modifiers.range_start || modifiers.range_middle || modifiers.range_end;\n\n return (\n <td\n {...(props as TdHTMLAttributes<HTMLTableCellElement>)}\n data-range-start={modifiers.range_start || undefined}\n data-range-middle={modifiers.range_middle || undefined}\n data-range-end={modifiers.range_end || undefined}\n className={cn(\n className,\n inRange && \"bg-pho-secondary\",\n modifiers.range_start && \"rounded-l-sm\",\n modifiers.range_end && \"rounded-r-sm\",\n )}\n />\n );\n}\n\n/**\n * The day button. Mirrors the library's own focus handover — roving tabindex\n * moves the `focused` modifier, and the newly focused day claims the caret —\n * then dresses itself from the modifiers.\n */\nfunction CalendarDayButton({\n day: _day,\n modifiers,\n className,\n ...props\n}: DayButtonProps) {\n const ref = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <button\n ref={ref}\n {...props}\n className={cn(dayButtonClassName(modifiers), className)}\n />\n );\n}\n\n/** The system's stroke chevrons in place of the library's filled triangles. */\nfunction CalendarChevron({ orientation = \"left\", className }: ChevronProps) {\n const Icon =\n orientation === \"up\"\n ? IconChevronUp\n : orientation === \"down\"\n ? IconChevronDown\n : orientation === \"right\"\n ? IconChevronRight\n : IconChevronLeft;\n\n return <Icon className={className} aria-hidden />;\n}\n\n/* ------------------------------------------------- the caption's two views */\n\nconst startOfMonth = (date: Date) =>\n new Date(date.getFullYear(), date.getMonth(), 1);\n\n/** Which face the calendar is showing — the days, or a way to jump. */\ntype CalendarView = \"days\" | \"months\" | \"years\";\n\ninterface ViewState {\n view: CalendarView;\n /** Which displayed month opened it; only one view is up at a time. */\n index: number;\n show: (view: CalendarView, index: number) => void;\n /** The word on the button back to today, for the label and the tooltip. */\n todayLabel: string;\n}\n\n// Always provided, even where the caption only reads: the nav below needs the\n// today label whether or not the caption drills down.\nconst ViewContext = createContext<ViewState>({\n view: \"days\",\n index: 0,\n show: () => {},\n todayLabel: \"Today\",\n});\n\n/** The month a `Month` subtree belongs to — `MonthGrid` has no other way to know. */\nconst MonthContext = createContext<{ date: Date; index: number }>({\n date: new Date(0),\n index: 0,\n});\n\n/** A month or a year to jump to — the day button's manners at list size. */\nconst JUMP_BUTTON = cn(\n \"flex cursor-pointer items-center justify-center rounded-sm text-base tabular-nums select-none\",\n \"text-pho-secondary transition-[color,background-color] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-primary\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1\",\n \"disabled:pointer-events-none disabled:text-pho-disabled\",\n);\n\nconst JUMP_BUTTON_ON = cn(\n \"bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover\",\n \"hover:text-pho-on-brand font-medium\",\n);\n\n/** The words for a month and a year, in the calendar's own locale. */\nfunction useMonthYearWords() {\n const { dayPickerProps } = useDayPicker();\n const code = dayPickerProps.locale?.code;\n return useMemo(\n () => ({\n month: new Intl.DateTimeFormat(code, { month: \"short\" }),\n monthLong: new Intl.DateTimeFormat(code, { month: \"long\" }),\n }),\n [code],\n );\n}\n\n/** The first and last month the page allows, as plain years. */\nfunction useNavYears() {\n const { dayPickerProps } = useDayPicker();\n const now = dayPickerProps.today ?? new Date();\n const first =\n dayPickerProps.startMonth?.getFullYear() ??\n now.getFullYear() - DROPDOWN_YEAR_REACH;\n const last =\n dayPickerProps.endMonth?.getFullYear() ??\n now.getFullYear() + DROPDOWN_YEAR_REACH;\n return { first, last };\n}\n\n/**\n * The caption. Its month and its year are each a button into their own view,\n * so a date two years out is two taps: the year, then the month.\n */\nfunction CalendarMonthCaption({\n calendarMonth,\n displayIndex,\n className,\n ...props\n}: MonthCaptionProps) {\n const views = useContext(ViewContext);\n const words = useMonthYearWords();\n const open = views.index === displayIndex ? views.view : \"days\";\n\n return (\n // The buttons carry their own padding, so the row pulls back to keep the\n // month's first letter over the grid's left edge.\n <div className={cn(className, \"-ml-1.5 gap-0.5\")} {...props}>\n <button\n type=\"button\"\n aria-expanded={open === \"months\"}\n onClick={() =>\n views.show(open === \"months\" ? \"days\" : \"months\", displayIndex)\n }\n className={CAPTION_BUTTON}\n >\n {words.monthLong.format(calendarMonth.date)}\n <IconChevronDown\n aria-hidden\n className={cn(CAPTION_CHEVRON, open === \"months\" && \"rotate-180\")}\n />\n </button>\n <button\n type=\"button\"\n aria-expanded={open === \"years\"}\n onClick={() =>\n views.show(open === \"years\" ? \"days\" : \"years\", displayIndex)\n }\n className={CAPTION_BUTTON}\n >\n {calendarMonth.date.getFullYear()}\n <IconChevronDown\n aria-hidden\n className={cn(CAPTION_CHEVRON, open === \"years\" && \"rotate-180\")}\n />\n </button>\n </div>\n );\n}\n\n/** The twelve months of the year on screen. Picking one lands on the days. */\nfunction MonthsView() {\n const views = useContext(ViewContext);\n const { date, index } = useContext(MonthContext);\n const { goToMonth, dayPickerProps } = useDayPicker();\n const words = useMonthYearWords();\n const { first, last } = useNavYears();\n const year = date.getFullYear();\n const today = dayPickerProps.today ?? new Date();\n const span = dayPickerProps.numberOfMonths ?? 1;\n\n /**\n * The first month `goToMonth` would be given for a choice, and whether the\n * whole strip still fits between the navigable ends. Without the second\n * check DayPicker clamps the value and the pick lands under a different\n * caption than the one that was clicked.\n */\n const reachable = (month: number) => {\n const lead = new Date(year, month - index, 1);\n const tail = new Date(year, month - index + span - 1, 1);\n if (year < first || year > last) return false;\n if (\n dayPickerProps.startMonth &&\n lead < startOfMonth(dayPickerProps.startMonth)\n ) {\n return false;\n }\n if (\n dayPickerProps.endMonth &&\n tail > startOfMonth(dayPickerProps.endMonth)\n ) {\n return false;\n }\n return true;\n };\n\n return (\n <div\n // A labelled set of buttons, not a form section — `fieldset` would say\n // the wrong thing about what this is.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n aria-label={String(year)}\n className={cn(\n GRID_WIDTH,\n \"grid h-[202px] grid-cols-3 content-start gap-1\",\n )}\n >\n {Array.from({ length: 12 }, (_, month) => {\n const when = new Date(year, month, 1);\n const outOfReach = !reachable(month);\n return (\n <button\n key={month}\n type=\"button\"\n disabled={outOfReach}\n onClick={() => {\n // `goToMonth` names the FIRST month on screen, so a caption\n // further along the strip steps back by its own offset and the\n // pick lands under the caption that was clicked.\n goToMonth(new Date(year, month - index, 1));\n views.show(\"days\", views.index);\n }}\n className={cn(\n JUMP_BUTTON,\n \"h-11\",\n month === date.getMonth() && JUMP_BUTTON_ON,\n month !== date.getMonth() &&\n year === today.getFullYear() &&\n month === today.getMonth() &&\n \"ring-pho-primary text-pho-primary font-medium ring-1 ring-inset\",\n )}\n >\n {words.month.format(when)}\n </button>\n );\n })}\n </div>\n );\n}\n\n/** Every year the page allows. Picking one asks for the month next. */\nfunction YearsView() {\n const views = useContext(ViewContext);\n const { date, index } = useContext(MonthContext);\n const { goToMonth, dayPickerProps } = useDayPicker();\n const { first, last } = useNavYears();\n const current = useRef<HTMLButtonElement>(null);\n const today = dayPickerProps.today ?? new Date();\n\n // Open on the year in play, however far down the list it sits.\n useEffect(() => {\n current.current?.scrollIntoView({ block: \"center\" });\n }, []);\n\n return (\n <div\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n aria-label=\"Year\"\n className={cn(\n GRID_WIDTH,\n \"grid h-[202px] grid-cols-4 content-start gap-1 overflow-y-auto\",\n )}\n >\n {Array.from({ length: last - first + 1 }, (_, step) => {\n const year = first + step;\n const chosen = year === date.getFullYear();\n return (\n <button\n key={year}\n type=\"button\"\n ref={chosen ? current : undefined}\n onClick={() => {\n goToMonth(new Date(year, date.getMonth() - index, 1));\n // The year alone does not name a day: ask for the month next.\n views.show(\"months\", views.index);\n }}\n className={cn(\n JUMP_BUTTON,\n \"h-9\",\n chosen && JUMP_BUTTON_ON,\n !chosen &&\n year === today.getFullYear() &&\n \"ring-pho-primary text-pho-primary font-medium ring-1 ring-inset\",\n )}\n >\n {year}\n </button>\n );\n })}\n </div>\n );\n}\n\n/** Puts the month a subtree belongs to in reach of the grid below it. */\nfunction CalendarMonthWrapper({\n calendarMonth,\n displayIndex,\n ...props\n}: MonthProps) {\n const value = useMemo(\n () => ({ date: calendarMonth.date, index: displayIndex }),\n [calendarMonth.date, displayIndex],\n );\n return (\n <MonthContext.Provider value={value}>\n <div {...props} />\n </MonthContext.Provider>\n );\n}\n\n/** The days, or whichever jump list the caption asked for in their place. */\nfunction CalendarMonthGrid(props: MonthGridProps) {\n const views = useContext(ViewContext);\n const { index } = useContext(MonthContext);\n const showing = views.index === index ? views.view : \"days\";\n\n if (showing === \"months\") return <MonthsView />;\n if (showing === \"years\") return <YearsView />;\n return <table {...props} />;\n}\n\n/** The month arrows step the days; a jump list is its own navigation. */\n/**\n * Back a month, back to today, on a month. The middle button moves the view\n * to today's month and leaves the selection alone — it is a way back, not a\n * way to choose. It stays lit while sitting on today's month, where the click\n * is a harmless no-op, because a control that reads as broken on first sight\n * is worse than one that sometimes does nothing; it dims only where it truly\n * cannot go, out past `startMonth` / `endMonth`, as the arrows do.\n */\nfunction CalendarNav({\n onPreviousClick,\n onNextClick,\n previousMonth,\n nextMonth,\n ...navProps\n}: NavProps) {\n const views = useContext(ViewContext);\n const { classNames, components, goToMonth, labels, dayPickerProps } =\n useDayPicker();\n\n // A jump list is its own navigation, so the arrows step aside. The nav is\n // absolutely positioned, so nothing below it moves.\n if (views.view !== \"days\") return <></>;\n\n const today = startOfMonth(dayPickerProps.today ?? new Date());\n const outOfReach =\n (dayPickerProps.startMonth != null &&\n today < startOfMonth(dayPickerProps.startMonth)) ||\n (dayPickerProps.endMonth != null &&\n today > startOfMonth(dayPickerProps.endMonth));\n\n return (\n <nav {...navProps}>\n <components.PreviousMonthButton\n type=\"button\"\n className={classNames.button_previous}\n tabIndex={previousMonth ? undefined : -1}\n aria-disabled={previousMonth ? undefined : true}\n aria-label={labels.labelPrevious(previousMonth)}\n onClick={(event) => {\n if (previousMonth) onPreviousClick?.(event);\n }}\n >\n <components.Chevron\n disabled={previousMonth ? undefined : true}\n className={classNames.chevron}\n orientation=\"left\"\n />\n </components.PreviousMonthButton>\n\n <button\n type=\"button\"\n className={NAV_BUTTON}\n tabIndex={outOfReach ? -1 : undefined}\n aria-disabled={outOfReach ? true : undefined}\n aria-label={views.todayLabel}\n title={views.todayLabel}\n onClick={() => {\n if (!outOfReach) goToMonth(today);\n }}\n >\n <IconPointFilled className={classNames.chevron} aria-hidden />\n </button>\n\n <components.NextMonthButton\n type=\"button\"\n className={classNames.button_next}\n tabIndex={nextMonth ? undefined : -1}\n aria-disabled={nextMonth ? undefined : true}\n aria-label={labels.labelNext(nextMonth)}\n onClick={(event) => {\n if (nextMonth) onNextClick?.(event);\n }}\n >\n <components.Chevron\n disabled={nextMonth ? undefined : true}\n className={classNames.chevron}\n orientation=\"right\"\n />\n </components.NextMonthButton>\n </nav>\n );\n}\n\nconst CAPTION_BUTTON = cn(\n \"text-pho-primary flex cursor-pointer items-center gap-0.5 rounded-sm px-1.5 py-0.5 font-medium\",\n \"transition-[color,background-color] duration-150 ease-out hover:bg-pho-ghost-hover\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1\",\n);\n\nconst CAPTION_CHEVRON =\n \"text-pho-secondary size-3.5 transition-transform duration-150 ease-out\";\n\nconst CALENDAR_COMPONENTS: Partial<CustomComponents> = {\n Day: CalendarDay,\n DayButton: CalendarDayButton,\n Chevron: CalendarChevron,\n Nav: CalendarNav,\n};\n\n/** The extra parts the drill-down caption needs on top of the base set. */\nconst JUMP_COMPONENTS: Partial<CustomComponents> = {\n Month: CalendarMonthWrapper,\n MonthCaption: CalendarMonthCaption,\n MonthGrid: CalendarMonthGrid,\n};\n\nexport type CalendarProps = DayPickerProps & {\n /**\n * The word on the button back to today, used as its label and its tooltip.\n * @default \"Today\"\n */\n todayLabel?: string;\n};\n\n/**\n * Calendar built on React DayPicker — a month of days to read or to choose\n * from. Pass `mode` to make it selectable (`single`, `multiple`, `range`);\n * without one it is a static month. Every DayPicker prop passes through, so\n * `numberOfMonths`, `disabled`, `startMonth` / `endMonth`, `captionLayout`,\n * and the locale props all work as documented upstream.\n *\n * Pho supplies the whole class map, so the library's stylesheet is neither\n * imported nor needed. `classNames` and `components` merge over Pho's,\n * element by element.\n *\n * The caption is clickable: month and year each open a jump list, so a date\n * two years out is two taps rather than twenty-four. Pass\n * `captionLayout=\"label\"` for a caption that only reads, and `startMonth` /\n * `endMonth` to say how far the year list should reach. Between the month\n * arrows sits a way back to today's month.\n *\n * Selection follows DayPicker's own contract: hand it `onSelect` and the\n * calendar is controlled, so `selected` has to come with it. Leave both off\n * and it keeps the selection itself.\n *\n * For a calendar behind a field — a trigger that shows the chosen date and\n * opens this in a popover — use `DatePicker`.\n */\nexport function Calendar({\n className,\n classNames,\n components,\n showOutsideDays = true,\n captionLayout,\n startMonth,\n endMonth,\n todayLabel = \"Today\",\n ...props\n}: CalendarProps) {\n // No layout named means Pho's own: a caption that drills down. Name one and\n // DayPicker's handling of it stands, untouched.\n const jumps = captionLayout === undefined;\n const [view, setView] = useState<CalendarView>(\"days\");\n const [index, setIndex] = useState(0);\n const views = useMemo<ViewState>(\n () => ({\n view,\n index,\n show: (next, at) => {\n setView(next);\n setIndex(at);\n },\n todayLabel,\n }),\n [view, index, todayLabel],\n );\n\n // A jump list needs a first and last year to offer, even when none was set.\n // The window has to hold the month the page asked for as well as today:\n // DayPicker clamps a `month` / `defaultMonth` outside it, so a calendar\n // opened on 1979 would silently render this decade instead.\n const bounded = jumps || captionLayout !== \"label\";\n const thisYear = (props.today ?? new Date()).getFullYear();\n const askedYear = (\n props.month ??\n props.defaultMonth ??\n props.today ??\n new Date()\n ).getFullYear();\n const navStart =\n startMonth ??\n (bounded\n ? new Date(Math.min(thisYear, askedYear) - DROPDOWN_YEAR_REACH, 0, 1)\n : undefined);\n const navEnd =\n endMonth ??\n (bounded\n ? new Date(Math.max(thisYear, askedYear) + DROPDOWN_YEAR_REACH, 11, 1)\n : undefined);\n\n const picker = (\n <DayPicker\n showOutsideDays={showOutsideDays}\n // Pho's caption replaces the label wholesale, so DayPicker is told to\n // build the plain one and hand it over.\n captionLayout={jumps ? \"label\" : captionLayout}\n startMonth={navStart}\n endMonth={navEnd}\n classNames={{\n ...CALENDAR_CLASS_NAMES,\n ...classNames,\n // DayPicker concatenates `className` onto the root's classes; folding\n // it in here runs it through `cn` instead, so a caller's `text-md`\n // actually replaces the root's `text-base` rather than fighting it.\n root: cn(CALENDAR_CLASS_NAMES.root, classNames?.root, className),\n }}\n components={{\n ...CALENDAR_COMPONENTS,\n ...(jumps ? JUMP_COMPONENTS : null),\n ...components,\n }}\n {...props}\n />\n );\n\n // Provided either way: the nav's way back to today needs its word even\n // where the caption itself only reads.\n return <ViewContext.Provider value={views}>{picker}</ViewContext.Provider>;\n}\n\nCalendar.displayName = \"Calendar\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AASA,IAAM,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAA+E,KAAO;AAAQ,CAAC,CAAC,GAC9H,KAAkB,EAAqB,UAAU,gBAAgB,eAAe,CAAU,GC2B1F,KAAW,UAMX,IAAa,QAQb,IAAsB,IAGtB,IAAa,EACjB,wFACA,6DACA,2DACA,4EAEA,4DACF,GAQM,IAA4C;AAAA,EAChD,MAAM;AAAA,EAEN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AAAA,EACL,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,SAAS;AAAA,EAET,eAAe;AAAA,EACf,eACE;AAAA,EACF,WAAW;AAAA,EAEX,eACE;AAAA,EACF,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAEhB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,QAAQ;AAAA,EACR,KAAK;AAAA,EAIL,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,aAAa;AAAA,EACb,cAAc;AAAA,EACd,WAAW;AAAA,EACX,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AACV;AAGA,SAAS,GAAmB,GAA8B;AACxD,QAAM,IAAc,GAAQ,EAAU,YAAY,CAAC,EAAU;AAE7D,SAAO,EACL,gGACA,IACA,sBACA,wEACA,mDACA,6EAGA,EAAU,WAAW,wBAGrB,EAAU,SACR,CAAC,EAAU,YACX,mEAGF,EAAU,gBAAgB,oBAE1B,KACE,kHACF,2DACA,mEACF;AACF;AAOA,SAAS,GAAY,EAGn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AAM,EAAG,EAAqB,MAAM,GAAY,MAAM,CAAS;AAAA,IACjE;AAAA,IACA,YAAY;AAAA,MACV,GAAG;AAAA,MACH,GAAI,IAAQ,KAAkB;AAAA,MAC9B,GAAG;AAAA,IACL;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAKH,SAAO,gBAAA,EAAC,EAAY,UAAb;AAAA,IAAsB,OAAO;AAAA,IAAQ,UAAA;AAAA,EAA6B,CAAA;AAC3E;AAEA,GAAS,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chart-B5wjhkBu.js","names":[],"sources":["../../../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js","../../../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js","../../src/components/chart/color.ts","../../src/components/chart/format.ts","../../src/components/chart/legend.tsx","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/interval.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/millisecond.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/duration.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/second.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/day.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/week.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/month.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/year.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/ticks.js","../../src/components/chart/scale.ts","../../src/components/chart/shell.tsx","../../src/components/chart/skeleton.tsx","../../src/components/chart/theme.ts","../../src/components/chart/tooltip.tsx","../../src/components/chart/use-measure.ts","../../src/components/chart/chart.tsx"],"sourcesContent":["function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","import type { ChartColor } from \"./types\";\n\n/** The categorical slots, in the order series take them. */\nexport const CHART_SLOTS = [\n \"chart-1\",\n \"chart-2\",\n \"chart-3\",\n \"chart-4\",\n \"chart-5\",\n \"chart-6\",\n] as const satisfies ReadonlyArray<ChartColor>;\n\n/**\n * The CSS value for a series colour: the named colour, or the categorical\n * slot at `index` when the series names none. Slots are an ordered,\n * validated set — a seventh series wraps, so fold a long tail into\n * \"Other\" before it gets there.\n */\nexport function chartColor(\n color: ChartColor | undefined,\n index: number,\n): string {\n const name = color ?? CHART_SLOTS[index % CHART_SLOTS.length]!;\n const token = name.startsWith(\"chart-\") ? name : `chart-${name}`;\n return `var(--color-pho-${token})`;\n}\n","import type { ChartDatum } from \"./types\";\n\n/**\n * The default number format: grouped digits for a value someone reads\n * (\"12,001\"), compact for an axis tick (\"12K\") where room is short.\n */\nexport function numberFormatter(\n locale: string | undefined,\n compact = false,\n): (value: number) => string {\n const format = new Intl.NumberFormat(\n locale,\n compact\n ? { notation: \"compact\", maximumFractionDigits: 1 }\n : { maximumFractionDigits: 2 },\n );\n return (value) => format.format(value);\n}\n\n/** A number under a series key, or nothing: missing, null, or not a number. */\nexport function readValue(datum: object, key: string): number | null {\n const value = (datum as Record<string, unknown>)[key];\n return typeof value === \"number\" && Number.isFinite(value) ? value : null;\n}\n\n/** \"Inbound and outbound\", \"p50, p90 and p99\". */\nexport function joinNames(names: ReadonlyArray<string>): string {\n if (names.length <= 1) return names[0] ?? \"\";\n return `${names.slice(0, -1).join(\", \")} and ${names[names.length - 1]}`;\n}\n\nexport interface DescribedSeries {\n key: string;\n label: string;\n /** Bars sum to a total; lines run between a low and a high. */\n kind: \"bar\" | \"line\";\n}\n\ninterface DescribeOptions<T extends ChartDatum> {\n data: ReadonlyArray<T>;\n series: ReadonlyArray<DescribedSeries>;\n valueFormat: (value: number) => string;\n timeFormat: (date: Date) => string;\n}\n\n/**\n * What the figure says about itself to assistive tech: which series, over\n * what range, and for each one the total (bars) or the low and high\n * (lines), plus where it peaked.\n */\nexport function describeChart<T extends ChartDatum>({\n data,\n series,\n valueFormat,\n timeFormat,\n}: DescribeOptions<T>): string {\n if (data.length === 0) return \"No data to show.\";\n const first = data[0]!;\n const last = data[data.length - 1]!;\n const range =\n data.length > 1\n ? `${timeFormat(new Date(first.x))} to ${timeFormat(new Date(last.x))}`\n : timeFormat(new Date(first.x));\n const parts = [`${joinNames(series.map((s) => s.label))}, ${range}.`];\n for (const s of series) {\n let total = 0;\n let min = Infinity;\n let max = -Infinity;\n let peakAt: Date | null = null;\n let seen = 0;\n for (const datum of data) {\n const value = readValue(datum, s.key);\n if (value == null) continue;\n seen++;\n total += value;\n if (value < min) min = value;\n if (value > max) {\n max = value;\n peakAt = new Date(datum.x);\n }\n }\n if (seen === 0) {\n parts.push(`${s.label}: no values.`);\n continue;\n }\n const peak = peakAt\n ? `, peak ${valueFormat(max)} at ${timeFormat(peakAt)}`\n : \"\";\n parts.push(\n s.kind === \"bar\"\n ? `${s.label}: ${valueFormat(total)} in total${peak}.`\n : `${s.label}: from ${valueFormat(min)} to ${valueFormat(max)}${peak}.`,\n );\n }\n return parts.join(\" \");\n}\n","import { type ComponentProps } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** A legend or tooltip key mirrors its mark: a square for a bar, a stroke for a line. */\nexport type ChartSwatchKind = \"rect\" | \"line\";\n\nexport interface ChartSwatchProps {\n /** A CSS colour value — what `chartColor` returns. */\n color: string;\n kind?: ChartSwatchKind;\n dashed?: boolean;\n}\n\nexport function ChartSwatch({\n color,\n kind = \"rect\",\n dashed,\n}: ChartSwatchProps) {\n if (kind === \"line\") {\n return (\n <svg aria-hidden width=\"14\" height=\"6\" className=\"shrink-0\">\n <line\n x1=\"1\"\n x2=\"13\"\n y1=\"3\"\n y2=\"3\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeDasharray={dashed ? \"3 3\" : undefined}\n />\n </svg>\n );\n }\n return (\n <span\n aria-hidden\n className=\"inline-block size-2 shrink-0 rounded-[2px]\"\n style={{ background: color }}\n />\n );\n}\n\nexport interface ChartLegendItem {\n label: string;\n /** A CSS colour value — what `chartColor` returns. */\n color: string;\n kind?: ChartSwatchKind;\n dashed?: boolean;\n}\n\nexport interface ChartLegendProps extends Omit<\n ComponentProps<\"ul\">,\n \"children\"\n> {\n items: ReadonlyArray<ChartLegendItem>;\n}\n\n/**\n * The legend a chart of two or more series carries below the plot: a key\n * per series, in series order, wrapping when the row runs out. Text stays\n * in the UI ink; the swatch alone carries the colour.\n */\nexport function ChartLegend({ items, className, ...props }: ChartLegendProps) {\n return (\n <ul\n className={cn(\n \"text-pho-secondary flex flex-wrap gap-x-4 gap-y-1 text-xs\",\n className,\n )}\n {...props}\n >\n {items.map((item) => (\n <li key={item.label} className=\"flex items-center gap-1.5\">\n <ChartSwatch\n color={item.color}\n kind={item.kind}\n dashed={item.dashed}\n />\n {item.label}\n </li>\n ))}\n </ul>\n );\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import { tickStep, ticks } from \"d3-array\";\nimport { timeDay, timeTicks, timeYear } from \"d3-time\";\n\n/** Epoch milliseconds for a datum's `x`. */\nexport function toTime(x: Date | number): number {\n return typeof x === \"number\" ? x : x.getTime();\n}\n\n/**\n * A y domain on round numbers with three to five ticks, the last tick on\n * or above the data's high end so the top of the plot is labelled.\n * `count` is the tick count that produced them, for a scale's `.ticks()`.\n *\n * When `integer` is set — or when both ends are whole numbers — the step\n * stays ≥ 1 so a count axis never labels 0.5 / 1.5.\n */\nexport function niceLinearDomain(\n min: number,\n max: number,\n options?: { integer?: boolean },\n): { domain: [number, number]; ticks: number[]; count: number } {\n if (!Number.isFinite(min) || !Number.isFinite(max)) {\n return { domain: [0, 1], ticks: [0, 1], count: 1 };\n }\n if (min > max) [min, max] = [max, min];\n const integer =\n options?.integer ?? (Number.isInteger(min) && Number.isInteger(max));\n if (min === max) {\n // A flat series still needs room to sit in.\n if (max === 0) {\n return integer\n ? { domain: [0, 1], ticks: [0, 1], count: 1 }\n : { domain: [0, 1], ticks: [0, 0.5, 1], count: 2 };\n }\n if (max > 0) min = 0;\n else max = 0;\n }\n for (let count = 4; count >= 2; count--) {\n const step = integer\n ? wholeTickStep(min, max, count)\n : tickStep(min, max, count);\n const lo = Math.floor(min / step) * step;\n const hi = Math.ceil(max / step) * step;\n const values = integer ? rangeTicks(lo, hi, step) : ticks(lo, hi, count);\n if (values.length <= 5 || count === 2) {\n // A whole-number step can differ from d3's own for `count`; the\n // interval count asks a scale for the same lines back.\n return {\n domain: [lo, hi],\n ticks: values,\n count: integer ? Math.max(1, values.length - 1) : count,\n };\n }\n }\n return { domain: [min, max], ticks: [min, max], count: 1 };\n}\n\n/** A 1-2-5 step that is never a fraction. */\nfunction wholeTickStep(min: number, max: number, count: number): number {\n const raw = tickStep(min, max, count);\n if (raw <= 1) return 1;\n if (Number.isInteger(raw)) return raw;\n const exp = Math.floor(Math.log10(raw));\n const mag = 10 ** exp;\n const n = raw / mag;\n const nice = n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10;\n return nice * mag;\n}\n\nfunction rangeTicks(lo: number, hi: number, step: number): number[] {\n const values: number[] = [];\n for (let at = lo; at <= hi + step / 2; at += step) values.push(at);\n return values;\n}\n\n/** The gap between buckets, in ms — the median step, so one hole doesn't skew it. */\nexport function bucketSpan(times: ReadonlyArray<number>): number {\n if (times.length < 2) return 0;\n const steps = [];\n for (let i = 1; i < times.length; i++) steps.push(times[i]! - times[i - 1]!);\n steps.sort((a, b) => a - b);\n return steps[Math.floor(steps.length / 2)]!;\n}\n\nconst DAY = 86_400_000;\n\n/**\n * Time ticks for a plot `width` px wide: one every ~96px, on the round\n * boundaries d3-time picks (5 minutes, an hour, a day, a month…). A band\n * axis passes the buckets its span covers (one fewer than its columns) as\n * `maxCount`: asking for more makes d3 step finer than the buckets, and a\n * week of daily columns on a wide plot would be labelled at noon.\n */\nexport function timeAxisTicks(\n start: number,\n stop: number,\n width: number,\n maxCount = Infinity,\n): Date[] {\n if (stop <= start || width <= 0) return [new Date(start)];\n const count = Math.min(Math.max(2, Math.floor(width / 96)), maxCount);\n const chosen = timeTicks(new Date(start), new Date(stop), count);\n // d3's every-nth-day interval counts from the first of the month, so a\n // two-day step reads Aug 29, Aug 31, Sep 1, Sep 3. Re-step multi-day\n // ticks evenly from the first one instead.\n if (chosen.length > 2 && chosen.every((t) => isMidnight(t))) {\n const gaps = chosen.slice(1).map((t, i) => timeDay.count(chosen[i]!, t));\n const step = Math.max(...gaps);\n if (step > 1 && gaps.some((gap) => gap !== step)) {\n return timeDay.range(chosen[0]!, new Date(stop + 1), step);\n }\n }\n return chosen;\n}\n\nfunction isMidnight(date: Date): boolean {\n return timeDay(date).getTime() === date.getTime();\n}\n\n/**\n * Labels a tick by the boundary it sits on: a time within a day, a date at\n * midnight, month and year at a new year. `Intl` does the wording, so the\n * labels follow the locale.\n */\nexport function timeTickFormatter(locale?: string): (date: Date) => string {\n const time = new Intl.DateTimeFormat(locale, {\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n const day = new Intl.DateTimeFormat(locale, {\n month: \"short\",\n day: \"numeric\",\n });\n const year = new Intl.DateTimeFormat(locale, {\n month: \"short\",\n year: \"numeric\",\n });\n return (date) => {\n if (timeDay(date).getTime() < date.getTime()) return time.format(date);\n if (timeYear(date).getTime() < date.getTime()) return day.format(date);\n return year.format(date);\n };\n}\n\n/**\n * The tooltip's heading for a bucket: the date alone when buckets are a\n * day or longer, date and time below that.\n */\nexport function bucketTimeFormatter(\n locale: string | undefined,\n span: number,\n): (date: Date) => string {\n const format = new Intl.DateTimeFormat(\n locale,\n span >= DAY\n ? { month: \"short\", day: \"numeric\" }\n : { month: \"short\", day: \"numeric\", hour: \"numeric\", minute: \"2-digit\" },\n );\n return (date) => format.format(date);\n}\n\n/** Estimated width of a tick label at the axis's 11px, with breathing room. */\nfunction labelWidth(label: string): number {\n return label.length * 6.5 + 16;\n}\n\n/** Keep every nth tick so the labels fit the width without touching. */\nexport function thinTicks<T>(\n values: ReadonlyArray<T>,\n labelOf: (value: T) => string,\n width: number,\n): T[] {\n if (values.length < 2) return [...values];\n const widest = Math.max(...values.map((value) => labelWidth(labelOf(value))));\n const fit = Math.max(1, Math.floor(width / widest));\n const every = Math.ceil(values.length / fit);\n if (every <= 1) return [...values];\n return values.filter((_, index) => index % every === 0);\n}\n\n/** The index of the position nearest `px` in an ascending list. */\nexport function nearestIndex(positions: ReadonlyArray<number>, px: number) {\n if (positions.length === 0) return -1;\n let lo = 0;\n let hi = positions.length - 1;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (positions[mid]! < px) lo = mid + 1;\n else hi = mid;\n }\n if (lo > 0 && px - positions[lo - 1]! < positions[lo]! - px) return lo - 1;\n return lo;\n}\n","import {\n useId,\n type ComponentProps,\n type CSSProperties,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** The bands around the plot, and the inner box the marks draw in. */\nexport interface ChartLayout {\n width: number;\n height: number;\n left: number;\n top: number;\n right: number;\n bottom: number;\n innerWidth: number;\n innerHeight: number;\n /** The same bands in the shape visx takes. */\n margin: { top: number; right: number; bottom: number; left: number };\n}\n\nconst TOP = 8;\nconst RIGHT = 8;\nconst X_AXIS = 22;\n\n/** The plot's box for a measured width and the y-axis labels it must fit. */\nexport function chartLayout(\n width: number,\n height: number,\n yLabels: ReadonlyArray<string>,\n): ChartLayout {\n const widest = yLabels.reduce((max, label) => Math.max(max, label.length), 0);\n const left = Math.ceil(widest * 6.5) + 10;\n const bottom = height - X_AXIS;\n return {\n width,\n height,\n left,\n top: TOP,\n right: width - RIGHT,\n bottom,\n innerWidth: Math.max(0, width - left - RIGHT),\n innerHeight: Math.max(0, bottom - TOP),\n margin: { top: TOP, right: RIGHT, bottom: X_AXIS, left },\n };\n}\n\n/**\n * The surface a stacked segment's gap is cut in: the nearest registered\n * surface, the card by default. Read once here so the stroke below and\n * the hover rings agree.\n */\nconst SURFACE_STYLE = {\n \"--pho-chart-surface\":\n \"var(--pho-surface, var(--background-color-pho-primary))\",\n} as CSSProperties;\n\nexport interface ChartShellProps extends Omit<\n ComponentProps<\"div\">,\n \"children\"\n> {\n /** The figure's `aria-label`. */\n label: string;\n /** The figure's spoken summary. */\n description: string;\n height: number;\n containerRef: RefObject<HTMLDivElement | null>;\n legend?: ReactNode;\n loading?: boolean;\n empty?: ReactNode;\n /** The frame says `empty` instead of drawing. */\n showEmpty?: boolean;\n /** What stands in for the plot while the first data is on its way. */\n placeholder?: ReactNode;\n /**\n * The figure itself — the svg and its tooltip. Presentational to\n * assistive tech: the frame's label and description speak for it.\n */\n children?: ReactNode;\n}\n\n/**\n * The frame every chart draws in: a fixed-height plot box holding the\n * figure (`role=\"img\"`, labelled and described for assistive tech), the\n * legend on its own line below. Width comes from the parent; `height`\n * covers the plot and the x-axis band, so a card never grows a nested\n * scroll.\n */\nexport function ChartShell({\n label,\n description,\n height,\n containerRef,\n legend,\n loading,\n empty,\n showEmpty,\n placeholder,\n className,\n children,\n ...props\n}: ChartShellProps) {\n const descriptionId = useId();\n return (\n <div\n data-chart=\"\"\n className={cn(\"flex w-full min-w-0 flex-col gap-3\", className)}\n {...props}\n >\n <div\n ref={containerRef}\n aria-busy={loading || undefined}\n className={cn(\n \"relative w-full transition-opacity duration-150 ease-out\",\n loading && \"opacity-50\",\n )}\n style={{ height }}\n >\n <div\n // A drawn figure is `role=\"img\"`; there is no <img> to reach\n // for, and the svg is visx's, so the role sits on its box.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"img\"\n aria-label={label}\n aria-describedby={descriptionId}\n // The 2px gap between stacked segments is a stroke in the\n // surface colour on every segment: one pixel shaved off each\n // side of a boundary, and nothing drawn that isn't surface.\n className=\"animate-pho-chart-in relative size-full select-none [&_.visx-bar-stack_.visx-bar]:stroke-(--pho-chart-surface) [&_.visx-bar-stack_.visx-bar]:stroke-2 [&_svg]:block [&_svg]:overflow-visible\"\n style={SURFACE_STYLE}\n >\n {children}\n </div>\n <p id={descriptionId} className=\"sr-only\">\n {description}\n </p>\n {placeholder}\n {showEmpty && (\n <div className=\"text-pho-description absolute inset-0 flex items-center justify-center text-xs\">\n {empty}\n </div>\n )}\n </div>\n {legend}\n </div>\n );\n}\n","import { Skeleton } from \"../skeleton\";\nimport { cn } from \"../../utils/cn\";\nimport type { ChartLayout } from \"./shell\";\n\n/**\n * Heights for the column bones, as a share of the plot: a made-up week\n * or two that reads as a chart without pretending to be one. Fixed, so\n * the placeholder is the same on the server and the browser.\n */\nconst BARS = [\n 0.42, 0.58, 0.5, 0.7, 0.62, 0.8, 0.66, 0.9, 0.72, 0.56, 0.76, 0.64,\n];\n\n/** The grid rows, as a share of the plot from the top; the last is the baseline. */\nconst ROWS = [0, 1 / 3, 2 / 3, 1];\n\n/** Time labels along the bottom band. */\nconst X_LABELS = 5;\n\n/**\n * Bones in the shape of a chart, for a first load with nothing to hold:\n * the frame's own coordinate system — hairline rows, a baseline, a label\n * bone at every row on the left and a few along the bottom — with a\n * dozen columns standing on the baseline in the plot's box. A refetch\n * never shows this; the chart keeps its last render at half opacity.\n */\nexport function ChartSkeleton({ layout }: { layout: ChartLayout }) {\n const { margin } = layout;\n return (\n <div\n aria-hidden\n data-chart-skeleton=\"\"\n className=\"absolute inset-0 grid\"\n style={{\n gridTemplateColumns: `${margin.left}px 1fr ${margin.right}px`,\n gridTemplateRows: `${margin.top}px 1fr ${margin.bottom}px`,\n }}\n >\n <div className=\"relative col-start-1 row-start-2\">\n {ROWS.map((share) => (\n <Skeleton\n key={share}\n data-bone=\"y\"\n className=\"absolute right-2 h-2.5 w-4 -translate-y-1/2\"\n style={{ top: `${share * 100}%` }}\n />\n ))}\n </div>\n <div className=\"relative col-start-2 row-start-2\">\n {ROWS.map((share, index) => (\n <div\n key={share}\n data-bone={index === ROWS.length - 1 ? \"baseline\" : \"grid\"}\n className={cn(\n \"absolute inset-x-0 border-t\",\n index === ROWS.length - 1\n ? \"border-pho-chart-crosshair\"\n : \"border-pho-chart-grid\",\n )}\n style={{ top: `${share * 100}%` }}\n />\n ))}\n <div className=\"absolute inset-0 flex items-end justify-between gap-2\">\n {BARS.map((share, index) => (\n <Skeleton\n key={index}\n data-bone=\"bar\"\n className=\"w-full max-w-6 rounded-t-[4px] rounded-b-none\"\n style={{ height: `${share * 100}%` }}\n />\n ))}\n </div>\n </div>\n <div className=\"col-start-2 row-start-3 flex items-center justify-between px-1\">\n {Array.from({ length: X_LABELS }, (_, index) => (\n <Skeleton key={index} data-bone=\"x\" className=\"h-2.5 w-8\" />\n ))}\n </div>\n </div>\n );\n}\n","import { buildChartTheme, type XYChartTheme } from \"@visx/xychart\";\n\n/**\n * The tick label: the axis's 11px in description ink, tabular so a column\n * of numbers lines up, in the page's own font rather than visx's stack.\n */\nconst LABEL = {\n fontFamily: \"inherit\",\n fontSize: 11,\n fontWeight: 400,\n letterSpacing: 0,\n fill: \"var(--text-color-pho-description)\",\n style: { fontVariantNumeric: \"tabular-nums\" },\n} as const;\n\n/**\n * The visx theme for a chart's furniture: gridlines one step off the\n * surface, description-ink ticks, and the series colours in part order\n * as the fallback palette. Everything is a CSS custom property, so the\n * theme follows light and dark without a second copy.\n */\nexport function buildPhoTheme(colors: ReadonlyArray<string>): XYChartTheme {\n return buildChartTheme({\n backgroundColor: \"var(--pho-surface, var(--background-color-pho-primary))\",\n colors: [...colors],\n gridColor: \"var(--color-pho-chart-grid)\",\n gridColorDark: \"var(--color-pho-chart-crosshair)\",\n // Labels hang this far off the plot; the tick lines themselves are hidden.\n tickLength: 4,\n svgLabelSmall: LABEL,\n svgLabelBig: LABEL,\n htmlLabel: {\n fontFamily: \"inherit\",\n fontSize: 11,\n fontWeight: 400,\n letterSpacing: 0,\n color: \"var(--text-color-pho-description)\",\n },\n });\n}\n","import { type ReactNode } from \"react\";\nimport { ChartSwatch, type ChartSwatchKind } from \"./legend\";\nimport type { ChartBreakdownItem } from \"./types\";\n\nexport interface ChartTooltipRow {\n label: string;\n value: string;\n color: string;\n kind?: ChartSwatchKind;\n dashed?: boolean;\n}\n\nexport interface ChartTooltipProps {\n /** The snapped x of the hovered bucket, in container px. */\n x: number;\n /** The container's width — the tooltip flips to the left past the middle. */\n width: number;\n /** Where the tooltip's top sits — the plot's top. */\n top: number;\n heading: string;\n rows: ReadonlyArray<ChartTooltipRow>;\n breakdown?: ReadonlyArray<ChartBreakdownItem>;\n breakdownTitle?: ReactNode;\n valueFormat: (value: number) => string;\n /** Said in place of the rows when no series has a value in this bucket. */\n empty?: ReactNode;\n}\n\n/**\n * The readout for one bucket: its time, then every series' value (values\n * lead, in primary ink; labels follow), then the bucket's breakdown when\n * it carries one, or `empty` when there is no value to list. Presentational — the figure's description already\n * speaks the data — and it never takes the pointer.\n */\nexport function ChartTooltip({\n x,\n width,\n top,\n heading,\n rows,\n breakdown,\n breakdownTitle,\n valueFormat,\n empty,\n}: ChartTooltipProps) {\n const flip = x > width / 2;\n return (\n <div\n aria-hidden\n data-chart-tooltip=\"\"\n className=\"bg-pho-primary shadow-pho-lg ring-pho-secondary rounded-base pointer-events-none absolute z-10 max-w-72 min-w-40 px-3 py-2 text-xs ring-1 ring-inset\"\n style={flip ? { right: width - x + 12, top } : { left: x + 12, top }}\n >\n <div className=\"text-pho-primary font-medium\">{heading}</div>\n {rows.length === 0 && empty != null && (\n <div className=\"text-pho-description mt-1\">{empty}</div>\n )}\n <ul className=\"mt-1 flex flex-col gap-0.5\">\n {rows.map((row) => (\n <li\n key={row.label}\n className=\"flex items-center justify-between gap-4\"\n >\n <span className=\"text-pho-secondary flex min-w-0 items-center gap-1.5\">\n <ChartSwatch\n color={row.color}\n kind={row.kind}\n dashed={row.dashed}\n />\n <span className=\"truncate\">{row.label}</span>\n </span>\n <span className=\"text-pho-primary font-medium tabular-nums\">\n {row.value}\n </span>\n </li>\n ))}\n </ul>\n {breakdown != null && breakdown.length > 0 && (\n <div className=\"border-pho-secondary mt-2 border-t pt-2\">\n {breakdownTitle != null && (\n <div className=\"text-pho-description mb-1\">{breakdownTitle}</div>\n )}\n <ul className=\"flex flex-col gap-0.5\">\n {breakdown.map((item) => (\n <li\n key={item.label}\n className=\"flex items-center justify-between gap-4\"\n >\n <span className=\"text-pho-secondary truncate\">\n {item.label}\n </span>\n <span className=\"text-pho-primary tabular-nums\">\n {valueFormat(item.value)}\n </span>\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n","import {\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type RefObject,\n} from \"react\";\n\n// React 18 warns that useLayoutEffect does nothing on the server (19 dropped\n// the warning); a plain effect there keeps a server render quiet.\nexport const useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\n/**\n * The width of the element the ref lands on, kept current through a\n * ResizeObserver. Nothing runs on the server: the first render is 0 wide\n * and the plot fills in once the browser has measured. A `fixed` width\n * skips measuring altogether.\n */\nexport function useMeasuredWidth<T extends HTMLElement>(\n fixed?: number,\n): [RefObject<T | null>, number] {\n const ref = useRef<T>(null);\n const [width, setWidth] = useState(0);\n useIsomorphicLayoutEffect(() => {\n if (fixed != null) return;\n const element = ref.current;\n if (element == null) return;\n setWidth(element.getBoundingClientRect().width);\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver((entries) => {\n const next = entries[0]?.contentRect.width;\n if (next != null) setWidth(next);\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [fixed]);\n return [ref, fixed ?? width];\n}\n","import {\n Children,\n Fragment,\n isValidElement,\n useCallback,\n useContext,\n useId,\n useMemo,\n useRef,\n type ReactNode,\n} from \"react\";\nimport { curveLinear, curveMonotoneX } from \"d3-shape\";\nimport { useAnimate, useReducedMotion } from \"motion/react\";\nimport {\n AreaSeries,\n Axis,\n BarGroup,\n BarSeries,\n BarStack,\n DataContext,\n DataProvider,\n Grid,\n LineSeries,\n TooltipContext,\n TooltipProvider,\n XYChart,\n} from \"@visx/xychart\";\nimport {\n FADE_ENTRANCE,\n RISE_PX,\n SPAN_SCALE,\n SPRING_ENTRANCE,\n} from \"../../motion\";\nimport { chartColor } from \"./color\";\nimport { describeChart, numberFormatter, readValue } from \"./format\";\nimport { ChartLegend } from \"./legend\";\nimport {\n bucketSpan,\n bucketTimeFormatter,\n nearestIndex,\n niceLinearDomain,\n thinTicks,\n timeAxisTicks,\n timeTickFormatter,\n toTime,\n} from \"./scale\";\nimport { ChartShell, chartLayout, type ChartLayout } from \"./shell\";\nimport { ChartSkeleton } from \"./skeleton\";\nimport { buildPhoTheme } from \"./theme\";\nimport { ChartTooltip, type ChartTooltipRow } from \"./tooltip\";\nimport type {\n ChartBarProps,\n ChartColor,\n ChartCurve,\n ChartDatum,\n ChartGaps,\n ChartLineProps,\n ChartProps,\n} from \"./types\";\nimport { useIsomorphicLayoutEffect, useMeasuredWidth } from \"./use-measure\";\n\n/**\n * Chart — buckets over time, drawn as the parts it is given: `Chart.Bar`\n * for columns, `Chart.Line` for lines, mixed when a page wants a daily\n * count under its rolling average. The root owns everything the parts\n * share: the frame, the scales, the axes and grid, the tooltip, the\n * legend and the figure's spoken summary. Built on @visx/xychart.\n *\n * Design notes:\n * - Bars are thin: a column never fills its band and never runs past\n * 24px; the leftover is air. The data end is rounded (4px), the\n * baseline end square — in a stack only the column's top gets the\n * corners, whichever series has a value on top in that bucket (a clip,\n * see `StackClip`), and a 2px stroke in the surface colour separates\n * segments instead of a border. Side by side, bars sit 2px apart inside\n * the same slot.\n * - Lines are 2px with round joins, straight by default: a curve invents\n * values between samples, so `curve=\"monotone\"` is a choice the page\n * makes for a smooth-by-nature quantity. `area` washes the surface\n * under a line at 10%. A bucket with no value breaks the line, unless\n * the part asks for `gaps=\"connect\"`: then the line joins its\n * neighbours across the hole, for a measure with no reading there\n * rather than a reading of nothing (a percentile in an hour with no\n * requests). Hover still lands on the hole, and `emptyBucket` names it.\n * A reading no line reaches — a hole on each side, or a connected\n * series with one bucket in the window — is a dot of its own, not the\n * stroke's round cap.\n * - Charts with bars run on a band scale, buckets centred in equal bands;\n * lines alone run edge to edge on a time scale. Either way the x-axis\n * labels the round times that fit, and the y-axis three to five round\n * numbers with a hairline grid.\n * - Hover snaps to the nearest bucket: bars lift it with the ghost wash,\n * lines get a crosshair and a surface-ringed point per series, and one\n * tooltip lists every part with a value plus the bucket's `breakdown`.\n * - Data arrives the way a page section does, on the entrance spring and\n * fade `Reveal` uses. A chart that mounts with data rises from its\n * base; data that follows the bones slides in from the left, the same\n * reveal turned along the time axis. A range switch follows the range:\n * a wider span opens outward from inside the plot, a narrower one\n * closes inward from outside it (clipped to the plot); the same span\n * slides in again. A first load with nothing to hold shows bones in\n * the chart's shape, coordinate system included; a refetch keeps the\n * last render at half opacity. Reduced motion makes every arrival\n * static.\n * - The figure is `role=\"img\"` with the `label` and a spoken summary; the\n * legend is real text below the plot, present for two or more parts.\n * Marks register with visx after mount, so a server render carries the\n * frame, the legend and the summary, and the plot fills on hydration.\n */\n\nconst BAR_MAX = 24;\nconst RADIUS = 4;\n/** The surface stroke between stacked segments (`stroke-2` in `ChartShell`); half of it falls inside each segment. */\nconst SEGMENT_INSET = 1;\nconst LINE_WIDTH = 2;\nconst POINT_RADIUS = 4;\nconst LONE_RADIUS = 3;\nconst SURFACE = \"var(--pho-chart-surface)\";\nconst WASH = \"var(--background-color-pho-ghost-hover)\";\nconst CROSSHAIR = \"var(--color-pho-chart-crosshair)\";\n\n/* ---------------------------------- parts --------------------------------- */\n\n/**\n * `Chart.Bar` — one bar series. Renders nothing itself: the root reads\n * its props and draws the columns among the other parts.\n */\nexport function ChartBar(_props: ChartBarProps): null {\n return null;\n}\nChartBar.displayName = \"Chart.Bar\";\nChartBar.chartPart = \"bar\" as const;\n\n/**\n * `Chart.Line` — one line series. Renders nothing itself: the root reads\n * its props and draws the line among the other parts.\n */\nexport function ChartLine(_props: ChartLineProps): null {\n return null;\n}\nChartLine.displayName = \"Chart.Line\";\nChartLine.chartPart = \"line\" as const;\n\ninterface Part {\n kind: \"bar\" | \"line\";\n dataKey: string;\n label: string;\n color?: ChartColor;\n dashed?: boolean;\n curve: ChartCurve;\n area?: boolean;\n gaps?: ChartGaps;\n}\n\n/** What a part element is, by the marker on its component rather than its identity: a hot reload or a second copy of the library must not lose the parts. */\nfunction partKind(type: unknown): \"bar\" | \"line\" | undefined {\n return (type as { chartPart?: \"bar\" | \"line\" } | null)?.chartPart;\n}\n\n/** The parts among `children`, in order; fragments are looked through. */\nfunction collectParts(children: ReactNode, into: Part[] = []): Part[] {\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n const kind = partKind(child.type);\n if (child.type === Fragment) {\n collectParts((child.props as { children?: ReactNode }).children, into);\n } else if (kind === \"bar\") {\n const p = child.props as ChartBarProps;\n into.push({\n kind: \"bar\",\n dataKey: p.dataKey,\n label: p.label,\n color: p.color,\n curve: \"linear\",\n });\n } else if (kind === \"line\") {\n const p = child.props as ChartLineProps;\n into.push({\n kind: \"line\",\n dataKey: p.dataKey,\n label: p.label,\n color: p.color,\n dashed: p.dashed,\n curve: p.curve ?? \"linear\",\n area: p.area,\n gaps: p.gaps ?? \"break\",\n });\n }\n });\n return into;\n}\n\n/* -------------------------------- accessors ------------------------------- */\n// visx registers a series again whenever an accessor's identity changes,\n// so these are made once per key and shared.\n\ntype Datum = object;\ntype Accessor = (d: Datum) => number;\n\n/**\n * visx's nearest-datum search on a time scale weighs the points either\n * side of the pointer, and reads the one after it even when there is\n * none: past the last point a series registered — a connected line whose\n * newest buckets are holes — it is handed `undefined`. NaN loses that\n * comparison, so the last point is the nearest, as it should be.\n */\nconst xAccessor: Accessor = (d) =>\n d == null ? NaN : toTime((d as ChartDatum).x);\n\nconst barAccessors = new Map<string, Accessor>();\n/** A bar's value; a hole reads as zero so the segments above still stack. */\nfunction barAccessor(key: string): Accessor {\n let fn = barAccessors.get(key);\n if (fn == null) {\n fn = (d) => readValue(d, key) ?? 0;\n barAccessors.set(key, fn);\n }\n return fn;\n}\n\nconst lineAccessors = new Map<string, Accessor>();\n/** A line's value; a hole reads as NaN so the line breaks there. */\nfunction lineAccessor(key: string): Accessor {\n let fn = lineAccessors.get(key);\n if (fn == null) {\n fn = (d) => readValue(d, key) ?? NaN;\n lineAccessors.set(key, fn);\n }\n return fn;\n}\n\nconst fillAccessors = new Map<string, (d: Datum) => string>();\n/** A bar's fill: its colour, or nothing for an empty bucket so no sliver shows. */\nfunction fillAccessor(key: string, color: string): (d: Datum) => string {\n const id = `${key} ${color}`;\n let fn = fillAccessors.get(id);\n if (fn == null) {\n fn = (d) => (readValue(d, key) ? color : \"transparent\");\n fillAccessors.set(id, fn);\n }\n return fn;\n}\n\n/* --------------------------------- scales --------------------------------- */\n\ntype Positioner = (value: number | Date) => number | undefined;\n\n/** A value's x: the middle of its band, or its point on the time scale. */\nfunction xPositioner(scale: unknown): Positioner {\n const s = scale as ((v: number | Date) => number | undefined) & {\n bandwidth?: () => number;\n };\n const half = typeof s.bandwidth === \"function\" ? s.bandwidth() / 2 : 0;\n return (value) => {\n const x = s(value);\n return typeof x === \"number\" && Number.isFinite(x) ? x + half : undefined;\n };\n}\n\nfunction yPositioner(scale: unknown): Positioner {\n const s = scale as (v: number) => number | undefined;\n return (value) => {\n const y = s(Number(value));\n return typeof y === \"number\" && Number.isFinite(y) ? y : undefined;\n };\n}\n\n/** A band scale's step; a continuous scale has none. */\nfunction stepOf(scale: unknown): number {\n const s = scale as { step?: () => number };\n return typeof s.step === \"function\" ? s.step() : 0;\n}\n\ninterface BandLayout {\n /** The bands' padding: what keeps a bar thin and, in a group, apart. */\n paddingInner: number;\n paddingOuter: number;\n /** The padding inside a group of bars, for visx's group scale. */\n groupPadding: number;\n}\n\n/**\n * How much of each band the bars take. Buckets are centred in equal\n * bands (`paddingOuter` is half the inner padding, so every step is the\n * same width and the tooltip's snapping matches the marks). The bar slot\n * is capped at 24px with a 2px gap; a group spends 2px between its bars,\n * a stack 2px on its surface stroke, so the visible mark stays in the\n * slot.\n */\nfunction bandLayout(\n innerWidth: number,\n count: number,\n groups: number,\n stacked: boolean,\n): BandLayout {\n const step = count > 0 ? innerWidth / count : 0;\n const gap = step >= 6 ? 2 : step >= 3 ? 1 : 0;\n const slot = Math.max(1, Math.min(BAR_MAX, step - gap));\n const inner = Math.min(2, gap);\n const target = stacked ? slot + inner : groups > 1 ? slot + 2 * inner : slot;\n const bandwidth = Math.min(step, target);\n const paddingInner = step > 0 ? 1 - bandwidth / step : 0;\n // A group's band scale pads inside and outside alike; this keeps the\n // gaps between bars at `inner` px.\n const groupPadding =\n groups > 1 && bandwidth > inner\n ? Math.min(0.5, (inner * groups) / (bandwidth - inner))\n : 0;\n return { paddingInner, paddingOuter: paddingInner / 2, groupPadding };\n}\n\n/* --------------------------------- layers --------------------------------- */\n\n/**\n * visx makes its scales once a series has registered, and hands out a\n * placeholder before that: nothing is drawn against it, on the server or\n * in the first client frame.\n */\nfunction Registered({ children }: { children: ReactNode }) {\n const { dataRegistry } = useContext(DataContext);\n const ready =\n dataRegistry?.entries().some((entry) => entry.data.length > 0) ?? false;\n return ready ? <>{children}</> : null;\n}\n\n/**\n * The hovered bucket's index, when visx has one and it still exists.\n *\n * Without a `gaps=\"connect\"` line, every registered series shares the same\n * unfiltered array, so visx's own `nearestDatum.index` already is the\n * bucket's place in `data` — used as-is, bounds-checked against the\n * current length so a hover from before the data shrank can't outlive it.\n *\n * A connect line is registered under its own filtered (holes removed)\n * array instead, so that bounds-check alone isn't enough: visx compares x\n * *and* y distance across series to pick the nearest one, so a hole —\n * nothing is registered there — can lose to a neighbouring visible point\n * whenever the pointer sits far from that point's height, not only near\n * the boundary between them. Once any line connects, the bucket is found\n * by x position alone instead, against every bucket in the full data —\n * the same read `HoverWash`'s wash and `HoverMarks`' crosshair already do\n * in the other direction. A bucket is a bucket, hole or not, and the\n * nearest one by x is always the right one.\n */\nfunction useHoveredIndex(\n data: ReadonlyArray<ChartDatum>,\n xScale: unknown,\n hasConnectedLines: boolean,\n): number | null {\n const tooltip = useContext(TooltipContext);\n if (!tooltip?.tooltipOpen) return null;\n if (hasConnectedLines) {\n const left = tooltip.tooltipLeft;\n if (left == null || xScale == null || data.length === 0) return null;\n const positioner = xPositioner(xScale);\n const positions: number[] = [];\n for (const d of data) {\n const x = positioner(toTime(d.x));\n if (x == null) return null;\n positions.push(x);\n }\n return nearestIndex(positions, left);\n }\n const index = tooltip.tooltipData?.nearestDatum?.index;\n return index != null && index >= 0 && index < data.length ? index : null;\n}\n\ninterface LayerProps {\n data: ReadonlyArray<ChartDatum>;\n layout: ChartLayout;\n /** See `useHoveredIndex`. */\n hasConnectedLines: boolean;\n}\n\n/** The time labels along the bottom; the end labels tuck inside the plot. */\nfunction BottomAxis({\n values,\n format,\n layout,\n}: {\n values: ReadonlyArray<number | Date>;\n format: (value: number | Date) => string;\n layout: ChartLayout;\n}) {\n const { xScale } = useContext(DataContext);\n const tickLabelProps = useCallback(\n (raw: unknown) => {\n const value = raw as number | Date;\n const x = xPositioner(xScale)(value) ?? layout.left;\n const half = (format(value).length * 6.5) / 2;\n const textAnchor =\n x - half < layout.left\n ? \"start\"\n : x + half > layout.right\n ? \"end\"\n : \"middle\";\n return { textAnchor } as const;\n },\n [xScale, format, layout.left, layout.right],\n );\n return (\n <Axis\n orientation=\"bottom\"\n tickValues={[...values]}\n tickFormat={(value: unknown) => format(value as number | Date)}\n hideAxisLine\n hideTicks\n tickLabelProps={tickLabelProps}\n />\n );\n}\n\n/** The ghost wash under the hovered bucket's column. */\nfunction HoverWash({ data, layout, hasConnectedLines }: LayerProps) {\n const { xScale } = useContext(DataContext);\n const index = useHoveredIndex(data, xScale, hasConnectedLines);\n if (index == null || xScale == null) return null;\n const cx = xPositioner(xScale)(toTime(data[index]!.x));\n const step = stepOf(xScale);\n if (cx == null) return null;\n return (\n <rect\n data-hover-wash=\"\"\n x={cx - step / 2}\n y={layout.top}\n width={step}\n height={layout.innerHeight}\n fill={WASH}\n />\n );\n}\n\n/** The bars' baseline, a touch stronger than the grid so they stand on something. */\nfunction ZeroLine({ layout }: { layout: ChartLayout }) {\n const { yScale } = useContext(DataContext);\n const y = yScale ? yPositioner(yScale)(0) : undefined;\n if (y == null) return null;\n return (\n <line\n data-zero=\"\"\n x1={layout.left}\n x2={layout.right}\n y1={y}\n y2={y}\n stroke={CROSSHAIR}\n />\n );\n}\n\n/** The crosshair on a line chart, and a surface-ringed point per line at the hovered bucket. */\nfunction HoverMarks({\n data,\n layout,\n lines,\n crosshair,\n hasConnectedLines,\n}: LayerProps & {\n lines: ReadonlyArray<{ dataKey: string; color: string }>;\n crosshair: boolean;\n}) {\n const { xScale, yScale } = useContext(DataContext);\n const index = useHoveredIndex(data, xScale, hasConnectedLines);\n if (index == null || xScale == null || yScale == null) return null;\n const datum = data[index]!;\n const cx = xPositioner(xScale)(toTime(datum.x));\n if (cx == null) return null;\n const y = yPositioner(yScale);\n return (\n <g data-hover=\"\">\n {crosshair && (\n <line\n x1={cx}\n x2={cx}\n y1={layout.top}\n y2={layout.bottom}\n stroke={CROSSHAIR}\n />\n )}\n {lines.length > 0 && (\n <g data-points=\"\">\n {lines.map((line) => {\n const value = readValue(datum, line.dataKey);\n const cy = value == null ? undefined : y(value);\n if (cy == null) return null;\n return (\n <circle\n key={line.dataKey}\n cx={cx}\n cy={cy}\n r={POINT_RADIUS}\n fill={line.color}\n // The surface ring keeps a dot legible where lines cross.\n stroke={SURFACE}\n strokeWidth={2}\n />\n );\n })}\n </g>\n )}\n </g>\n );\n}\n\ninterface LoneLine {\n dataKey: string;\n color: string;\n /** The readings with nothing either side of them. */\n points: ReadonlyArray<{ x: Date | number; value: number }>;\n}\n\n/**\n * The dots under readings no line reaches. visx rounds a line's cap so a\n * datum between two holes is visible at all, but at 2px that is a speck,\n * and a `gaps=\"connect\"` series with one bucket in the window is nothing\n * else. Those readings get a real dot instead — the hovered point's\n * surface ring, so they stay legible where series cross, one step under\n * its radius so hover is still the emphasis. The ring paints under the\n * fill: centred on the edge it would cover the outer third of a dot this\n * small, and a 6px reading would arrive as 4.\n */\nfunction LoneMarks({ lines }: { lines: ReadonlyArray<LoneLine> }) {\n const { xScale, yScale } = useContext(DataContext);\n if (lines.length === 0 || xScale == null || yScale == null) return null;\n const x = xPositioner(xScale);\n const y = yPositioner(yScale);\n return (\n <g data-lone-points=\"\">\n {lines.map((line) =>\n line.points.map((point, i) => {\n const cx = x(toTime(point.x));\n const cy = y(point.value);\n if (cx == null || cy == null) return null;\n return (\n <circle\n key={`${line.dataKey} ${i}`}\n cx={cx}\n cy={cy}\n r={LONE_RADIUS}\n fill={line.color}\n stroke={SURFACE}\n strokeWidth={2}\n paintOrder=\"stroke\"\n />\n );\n }),\n )}\n </g>\n );\n}\n\n/**\n * The marks' arrival, on `SPRING_ENTRANCE` and `FADE_ENTRANCE` like a\n * `Reveal`. A chart that mounts with data rises from its base (scaleY\n * from 0 at the bottom of what it draws). Data that follows an empty\n * plot — the bones, or a cleared range — slides in from the left by the\n * reveal's own distance, the arrival turned along the time axis. From\n * there a change follows what the range did: a wider span opens outward\n * (scaleX from `SPAN_SCALE` about the middle), a narrower one closes\n * inward (from its inverse, clipped to the plot so nothing crosses the\n * axes), the same span slides in again. A refetch that lands mid-flight\n * restarts it. The layout effect sets the first frame before paint, so\n * new marks never flash at full size first. Static under reduced motion.\n */\nfunction Rise({\n data,\n range,\n layout,\n children,\n}: {\n data: ReadonlyArray<unknown>;\n /** The span of time the data covers, in ms; 0 with no data. */\n range: number;\n layout: ChartLayout;\n children: ReactNode;\n}) {\n const reduceMotion = useReducedMotion();\n const [scope, animate] = useAnimate<SVGGElement>();\n const clipId = useId();\n // The span last shown, 0 for an empty plot; nothing before the mount.\n const shown = useRef<number | null>(null);\n useIsomorphicLayoutEffect(() => {\n const node = scope.current;\n const previous = shown.current;\n shown.current = range;\n if (data.length === 0 || reduceMotion || node == null) return;\n const fade = { opacity: FADE_ENTRANCE };\n const controls =\n previous == null\n ? animate(\n node,\n { scaleY: [0, 1], scaleX: 1, x: 0, opacity: [0, 1], originY: 1 },\n { scaleY: SPRING_ENTRANCE, ...fade },\n )\n : previous === 0 || range === previous\n ? animate(\n node,\n { x: [-RISE_PX, 0], scaleX: 1, scaleY: 1, opacity: [0, 1] },\n { x: SPRING_ENTRANCE, ...fade },\n )\n : animate(\n node,\n {\n scaleX: [range > previous ? SPAN_SCALE : 1 / SPAN_SCALE, 1],\n scaleY: 1,\n x: 0,\n opacity: [0, 1],\n originX: 0.5,\n },\n { scaleX: SPRING_ENTRANCE, ...fade },\n );\n return () => controls.stop();\n }, [data, range, reduceMotion]);\n // A breath of room so a stroke on the plot's edge is never shaved.\n const pad = 4;\n return (\n <g clipPath={`url(#${clipId})`}>\n <defs>\n <clipPath id={clipId}>\n <rect\n x={layout.left - pad}\n y={layout.top - pad}\n width={layout.innerWidth + 2 * pad}\n height={layout.innerHeight + 2 * pad}\n />\n </clipPath>\n </defs>\n <g ref={scope} data-marks=\"\">\n {children}\n </g>\n </g>\n );\n}\n\n/**\n * The rounded tops of a stack. visx rounds a whole series, not the\n * segment that happens to be on top in a bucket, so a stack draws every\n * segment square and is clipped instead: one rect per bucket, the bar's\n * own band (`xScale(x)`, `bandwidth()`) from the top of its positive\n * total down past the plot's bottom, its corners rounded. Only the top\n * two land on the plot, so the column's data end is rounded whichever\n * series is on top there, and its baseline end stays square.\n *\n * Each segment wears a 2px stroke in the surface colour, half of it over\n * the segment's own edge, so the colour starts 1px inside the geometry.\n * The clip is inset by that pixel on the top and the sides: its 4px\n * corners then land on the colour itself (at the geometry they would\n * round only the stroke, and the colour would stay all but square), and\n * no surface-coloured rim is left outside the column.\n *\n * The positive total is summed in part order, a hole as zero, exactly as\n * d3's stack (and visx's diverging offset, once any value is negative)\n * accumulates it, so the clip's edge is the top segment's own y. A\n * bucket with nothing above zero gets a square rect from the baseline\n * down: it rounds nothing, and its negative segments, if any, still show\n * square at both ends. The radius is clamped to half the visible\n * column's width and height, as visx clamps a rounded bar.\n *\n * The clip lives inside the marks group, so it rides the arrival's\n * transforms with the bars and never cuts one mid-flight. The bars stay\n * mounted while visx registers them: before the scales exist the clip is\n * simply empty, and so is the plot.\n */\nfunction StackClip({\n data,\n keys,\n children,\n}: {\n data: ReadonlyArray<ChartDatum>;\n keys: ReadonlyArray<string>;\n children: ReactNode;\n}) {\n const { xScale, yScale } = useContext(DataContext);\n const clipId = useId();\n const columns: ReactNode[] = [];\n const s = xScale as\n | (((v: number) => number | undefined) & { bandwidth?: () => number })\n | undefined;\n const y = yScale as\n | (((v: number) => number | undefined) & { range: () => number[] })\n | undefined;\n if (s != null && y != null && typeof s.bandwidth === \"function\") {\n const width = Math.max(0, s.bandwidth() - 2 * SEGMENT_INSET);\n const zero = y(0);\n // Past the plot's bottom by a corner and the segment stroke, so the\n // lower corners never reach anything drawn.\n const floor = Math.max(...y.range()) + 2 * RADIUS + 2;\n for (const [index, d] of data.entries()) {\n const x = s(toTime(d.x));\n let total = 0;\n for (const key of keys) {\n const value = readValue(d, key) ?? 0;\n if (value >= 0) total += value;\n }\n const end = total > 0 ? y(total) : zero;\n if (x == null || end == null || zero == null) continue;\n if (!Number.isFinite(x) || !Number.isFinite(end)) continue;\n const top = total > 0 ? end + SEGMENT_INSET : end;\n const corner =\n total > 0\n ? Math.max(0, Math.min(RADIUS, width / 2, (zero - top) / 2))\n : 0;\n columns.push(\n <rect\n key={index}\n data-stack-top={index}\n x={x + SEGMENT_INSET}\n y={top}\n width={width}\n height={Math.max(0, floor - top)}\n rx={corner}\n ry={corner}\n />,\n );\n }\n }\n return (\n <g data-stack-clip=\"\">\n <defs>\n <clipPath id={clipId}>{columns}</clipPath>\n </defs>\n <g clipPath={`url(#${clipId})`}>{children}</g>\n </g>\n );\n}\n\n/** The readout beside the hovered bucket: finite part values, then the breakdown. */\nfunction HoverTooltip({\n data,\n layout,\n parts,\n colors,\n width,\n headingFormat,\n valueFormat,\n breakdownTitle,\n emptyBucket,\n hasConnectedLines,\n}: LayerProps & {\n parts: ReadonlyArray<Part>;\n colors: ReadonlyArray<string>;\n width: number;\n headingFormat: (date: Date) => string;\n valueFormat: (value: number) => string;\n breakdownTitle?: ReactNode;\n emptyBucket?: ReactNode;\n}) {\n const { xScale } = useContext(DataContext);\n const index = useHoveredIndex(data, xScale, hasConnectedLines);\n if (index == null || xScale == null) return null;\n const datum = data[index]!;\n const x = xPositioner(xScale)(toTime(datum.x));\n if (x == null) return null;\n return (\n <ChartTooltip\n x={x}\n width={width}\n top={layout.top}\n heading={headingFormat(new Date(datum.x))}\n rows={parts.flatMap<ChartTooltipRow>((part, i) => {\n const value = readValue(datum, part.dataKey);\n return value == null\n ? []\n : [\n {\n label: part.label,\n value: valueFormat(value),\n color: colors[i]!,\n kind: part.kind === \"bar\" ? \"rect\" : \"line\",\n dashed: part.dashed,\n },\n ];\n })}\n breakdown={datum.breakdown}\n breakdownTitle={breakdownTitle}\n valueFormat={valueFormat}\n empty={emptyBucket}\n />\n );\n}\n\n/* ---------------------------------- root ---------------------------------- */\n\n// visx wraps a left label to the margin's width; the margin is sized to\n// the labels here, so a label never wraps.\nconst LEFT_TICK_LABEL = {\n dx: \"-0.35em\",\n dy: \"0.35em\",\n width: undefined,\n} as const;\n\nexport function Chart<T extends ChartDatum>({\n data,\n children,\n label,\n description,\n height = 200,\n width: fixedWidth,\n valueFormat,\n timeFormat,\n locale,\n legend,\n baseline = \"zero\",\n stacked = false,\n breakdownTitle,\n loading,\n empty = \"Nothing here yet.\",\n emptyBucket,\n className,\n ...props\n}: ChartProps<T>) {\n const [containerRef, width] = useMeasuredWidth<HTMLDivElement>(fixedWidth);\n const parts = useMemo(() => collectParts(children), [children]);\n\n const model = useMemo(() => {\n const times = data.map((d) => toTime(d.x));\n const span = bucketSpan(times);\n const axisFormat = valueFormat ?? numberFormatter(locale, true);\n const fullFormat = valueFormat ?? numberFormatter(locale);\n const headingFormat = timeFormat ?? bucketTimeFormatter(locale, span);\n const colors = parts.map((part, index) => chartColor(part.color, index));\n const bars = parts.filter((part) => part.kind === \"bar\");\n const lines = parts\n .map((part, index) => ({ ...part, color: colors[index]! }))\n .filter((part) => part.kind === \"line\");\n let min = Infinity;\n let max = -Infinity;\n const consider = (value: number) => {\n if (value < min) min = value;\n if (value > max) max = value;\n };\n if (stacked && bars.length > 1) {\n for (const d of data) {\n let positive = 0;\n let negative = 0;\n for (const bar of bars) {\n const value = readValue(d, bar.dataKey);\n if (value == null) continue;\n if (value > 0) positive += value;\n else negative += value;\n }\n consider(positive);\n consider(negative);\n }\n } else {\n for (const bar of bars) {\n for (const d of data) {\n const value = readValue(d, bar.dataKey);\n if (value != null) consider(value);\n }\n }\n }\n for (const line of lines) {\n for (const d of data) {\n const value = readValue(d, line.dataKey);\n if (value != null) consider(value);\n }\n }\n if (min === Infinity) {\n min = 0;\n max = 0;\n }\n // Columns rise from zero, so a chart with bars always keeps it.\n if (baseline === \"zero\" || bars.length > 0) {\n min = Math.min(0, min);\n max = Math.max(0, max);\n }\n const y = niceLinearDomain(min, max);\n return {\n times,\n span,\n colors,\n bars,\n lines,\n hasBars: bars.length > 0,\n axisFormat,\n fullFormat,\n headingFormat,\n y,\n yLabels: y.ticks.map(axisFormat),\n described:\n description ??\n describeChart({\n data,\n series: parts.map((part) => ({\n key: part.dataKey,\n label: part.label,\n kind: part.kind,\n })),\n valueFormat: fullFormat,\n timeFormat: headingFormat,\n }),\n };\n }, [\n data,\n parts,\n stacked,\n baseline,\n valueFormat,\n timeFormat,\n locale,\n description,\n ]);\n\n const n = data.length;\n const t0 = model.times[0] ?? 0;\n const t1 = model.times[n - 1] ?? 0;\n // The span the buckets cover: their spread plus the last bucket itself.\n const range = n > 0 ? t1 - t0 + model.span : 0;\n const layout = useMemo(\n () => chartLayout(width, height, model.yLabels),\n [width, height, model.yLabels],\n );\n const band = useMemo(\n () => bandLayout(layout.innerWidth, n, model.bars.length, stacked),\n [layout.innerWidth, n, model.bars.length, stacked],\n );\n\n // Bars need a band; lines alone run edge to edge on time.\n const xScale = useMemo(\n () =>\n model.hasBars\n ? {\n type: \"band\" as const,\n domain: model.times,\n paddingInner: band.paddingInner,\n paddingOuter: band.paddingOuter,\n }\n : {\n type: \"time\" as const,\n domain: t1 > t0 ? [t0, t1] : [t0 - 1, t0 + 1],\n },\n [model.hasBars, model.times, band.paddingInner, band.paddingOuter, t0, t1],\n );\n const yScale = useMemo(\n () => ({\n type: \"linear\" as const,\n domain: model.y.domain,\n zero: false,\n nice: false,\n }),\n [model.y.domain],\n );\n const theme = useMemo(() => buildPhoTheme(model.colors), [model.colors]);\n\n const xTicks = useMemo(() => {\n const format = timeTickFormatter(locale);\n if (n === 0 || layout.innerWidth <= 0) {\n return { values: [] as Array<number | Date>, format: () => \"\" };\n }\n const ticks = thinTicks(\n timeAxisTicks(\n t0,\n t1,\n layout.innerWidth,\n model.hasBars ? Math.max(1, n - 1) : undefined,\n ),\n format,\n layout.innerWidth,\n );\n if (!model.hasBars) {\n return {\n values: ticks as Array<number | Date>,\n format: (value: number | Date) => format(new Date(value)),\n };\n }\n // A band takes only its own values: each round tick lands on the\n // nearest bucket, and keeps the round time as its label.\n const labels = new Map<number, string>();\n for (const tick of ticks) {\n const at = model.times[nearestIndex(model.times, tick.getTime())]!;\n if (!labels.has(at)) labels.set(at, format(tick));\n }\n return {\n values: [...labels.keys()] as Array<number | Date>,\n format: (value: number | Date) =>\n labels.get(toTime(value)) ?? format(new Date(value)),\n };\n }, [n, t0, t1, layout.innerWidth, locale, model.hasBars, model.times]);\n\n const showLegend = legend ?? parts.length > 1;\n const showEmpty = n === 0 && !loading;\n // Bones only when there is no last render to hold.\n const showSkeleton = n === 0 && loading === true;\n const zeroAtEdge = model.y.domain[0] >= 0 || model.y.domain[1] <= 0;\n const series = data as T[];\n // A connecting line is handed only the buckets it has a value for, so\n // the path runs straight across the holes; hover and the tooltip keep\n // the full data, and land on a hole like any other bucket.\n const lineData = useMemo(() => {\n const out = new Map<string, T[]>();\n for (const line of model.lines) {\n if (line.gaps === \"connect\") {\n out.set(\n line.dataKey,\n series.filter((d) => readValue(d, line.dataKey) != null),\n );\n }\n }\n return out;\n }, [model.lines, series]);\n const hasConnectedLines = lineData.size > 0;\n\n const barMarks = (() => {\n const { bars } = model;\n if (bars.length === 0) return null;\n // A stack's segments are square; `StackClip` rounds each column's top.\n const rounded = !stacked || bars.length === 1;\n const marks = bars.map((bar) => {\n const color = model.colors[parts.indexOf(bar)]!;\n return (\n <BarSeries\n key={bar.dataKey}\n dataKey={bar.dataKey}\n data={series}\n xAccessor={xAccessor}\n yAccessor={barAccessor(bar.dataKey)}\n colorAccessor={fillAccessor(bar.dataKey, color)}\n radius={rounded ? RADIUS : undefined}\n radiusTop={rounded}\n data-series={bar.dataKey}\n />\n );\n });\n if (bars.length === 1) return marks;\n return stacked ? (\n <StackClip data={series} keys={bars.map((bar) => bar.dataKey)}>\n <BarStack>{marks}</BarStack>\n </StackClip>\n ) : (\n <BarGroup padding={band.groupPadding}>{marks}</BarGroup>\n );\n })();\n\n const lineMarks = model.lines.map((line) => {\n const curve = line.curve === \"monotone\" ? curveMonotoneX : curveLinear;\n const dash = line.dashed ? \"4 4\" : undefined;\n const points = lineData.get(line.dataKey) ?? series;\n return line.area ? (\n <AreaSeries\n key={line.dataKey}\n dataKey={line.dataKey}\n data={points}\n xAccessor={xAccessor}\n yAccessor={lineAccessor(line.dataKey)}\n curve={curve}\n fill={line.color}\n fillOpacity={0.1}\n lineProps={{\n stroke: line.color,\n strokeWidth: LINE_WIDTH,\n strokeLinejoin: \"round\",\n strokeDasharray: dash,\n }}\n data-series={line.dataKey}\n />\n ) : (\n <LineSeries\n key={line.dataKey}\n dataKey={line.dataKey}\n data={points}\n xAccessor={xAccessor}\n yAccessor={lineAccessor(line.dataKey)}\n curve={curve}\n stroke={line.color}\n strokeWidth={LINE_WIDTH}\n strokeLinejoin=\"round\"\n strokeDasharray={dash}\n data-series={line.dataKey}\n />\n );\n });\n\n // Which readings stand alone, over the very array the line is drawn\n // from: a value with nothing either side of it. With `gaps=\"connect\"`\n // that array is already filtered, so a series with one bucket in the\n // window is the whole of it.\n const loneLines = model.lines.flatMap<LoneLine>((line) => {\n const points = lineData.get(line.dataKey) ?? series;\n const lone = points.flatMap((d, i) => {\n const value = readValue(d, line.dataKey);\n const before = points[i - 1];\n const after = points[i + 1];\n return value == null ||\n (before != null && readValue(before, line.dataKey) != null) ||\n (after != null && readValue(after, line.dataKey) != null)\n ? []\n : [{ x: d.x, value }];\n });\n return lone.length === 0\n ? []\n : [{ dataKey: line.dataKey, color: line.color, points: lone }];\n });\n\n return (\n <ChartShell\n label={label}\n description={model.described}\n height={height}\n containerRef={containerRef}\n loading={loading}\n empty={empty}\n showEmpty={showEmpty}\n placeholder={showSkeleton ? <ChartSkeleton layout={layout} /> : null}\n className={className}\n legend={\n showLegend ? (\n <ChartLegend\n items={parts.map((part, index) => ({\n label: part.label,\n color: model.colors[index]!,\n kind: part.kind === \"bar\" ? \"rect\" : \"line\",\n dashed: part.dashed,\n }))}\n />\n ) : null\n }\n {...props}\n >\n {width > 0 && !showEmpty && (\n <DataProvider\n xScale={xScale}\n yScale={yScale}\n theme={theme}\n initialDimensions={{ width, height, margin: layout.margin }}\n >\n <TooltipProvider hideTooltipDebounceMs={0}>\n <XYChart\n width={width}\n height={height}\n margin={layout.margin}\n accessibilityLabel={label}\n >\n <Registered>\n <Grid rows columns={false} numTicks={model.y.count} />\n </Registered>\n <Axis\n orientation=\"left\"\n tickValues={model.y.ticks}\n tickFormat={(value: unknown) => model.axisFormat(Number(value))}\n hideAxisLine\n hideTicks\n tickLabelProps={LEFT_TICK_LABEL}\n />\n <BottomAxis\n values={xTicks.values}\n format={xTicks.format}\n layout={layout}\n />\n {model.hasBars && (\n <HoverWash\n data={data}\n layout={layout}\n hasConnectedLines={hasConnectedLines}\n />\n )}\n <Rise data={data} range={range} layout={layout}>\n {barMarks}\n {lineMarks}\n <Registered>\n <LoneMarks lines={loneLines} />\n </Registered>\n </Rise>\n {model.hasBars && zeroAtEdge && (\n <Registered>\n <ZeroLine layout={layout} />\n </Registered>\n )}\n <HoverMarks\n data={data}\n layout={layout}\n lines={model.lines}\n crosshair={!model.hasBars}\n hasConnectedLines={hasConnectedLines}\n />\n </XYChart>\n <HoverTooltip\n data={data}\n layout={layout}\n parts={parts}\n colors={model.colors}\n width={width}\n headingFormat={model.headingFormat}\n valueFormat={model.fullFormat}\n breakdownTitle={breakdownTitle}\n emptyBucket={emptyBucket}\n hasConnectedLines={hasConnectedLines}\n />\n </TooltipProvider>\n </DataProvider>\n )}\n </ChartShell>\n );\n}\n\nChart.displayName = \"Chart\";\nChart.Bar = ChartBar;\nChart.Line = ChartLine;\n"],"x_google_ignoreList":[0,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":";;;;;;;;AAAA,SAAS,GAAO,GAAS;AACvB,OAAK,WAAW;AAClB;AAEA,GAAO,YAAY;AAAA,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