@logicplanes/kaeso-ui 0.4.3 → 0.4.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/ai/component-guides.md +279 -98
- package/ai/component-registry.json +352 -236
- package/ai/component-registry.md +241 -219
- package/ai/icons.md +2 -2
- package/ai/tokens.md +18 -14
- package/dist/blocks/delete-resource.js +3 -3
- package/dist/blocks/delete-resource.js.map +1 -1
- package/dist/blocks/pages.js +47 -42
- package/dist/blocks/pages.js.map +1 -1
- package/dist/blocks/resource-list.js +68 -55
- package/dist/blocks/resource-list.js.map +1 -1
- package/dist/chunks/agent-avatar-DHieggHK.js +188 -0
- package/dist/chunks/agent-avatar-DHieggHK.js.map +1 -0
- package/dist/chunks/app-frame-DysOel2X.js +232 -0
- package/dist/chunks/app-frame-DysOel2X.js.map +1 -0
- package/dist/chunks/arrow-focus-B0KdRFX8.js +20 -0
- package/dist/chunks/arrow-focus-B0KdRFX8.js.map +1 -0
- package/dist/chunks/avatar-CYNMK7uY.js +110 -0
- package/dist/chunks/avatar-CYNMK7uY.js.map +1 -0
- package/dist/chunks/badge-C0GC3B9X.js +27 -0
- package/dist/chunks/badge-C0GC3B9X.js.map +1 -0
- package/dist/chunks/banner-B3DGLTBu.js +88 -0
- package/dist/chunks/banner-B3DGLTBu.js.map +1 -0
- package/dist/chunks/button-IblhXUyZ.js +202 -0
- package/dist/chunks/button-IblhXUyZ.js.map +1 -0
- package/dist/chunks/{calendar-BWaf2MXc.js → calendar-Dc6_dl0f.js} +4 -4
- package/dist/chunks/calendar-Dc6_dl0f.js.map +1 -0
- package/dist/chunks/checkbox-9tbimmF3.js +141 -0
- package/dist/chunks/checkbox-9tbimmF3.js.map +1 -0
- package/dist/chunks/{cn-Dj6sRgkF.js → cn-BjnOAUrA.js} +45 -4
- package/dist/chunks/cn-BjnOAUrA.js.map +1 -0
- package/dist/chunks/code-block-64e-Cy1S.js +346 -0
- package/dist/chunks/code-block-64e-Cy1S.js.map +1 -0
- package/dist/chunks/code-block-KIvuE8jg.js +352 -0
- package/dist/chunks/code-block-KIvuE8jg.js.map +1 -0
- package/dist/chunks/{code-tqj0uhBL.js → code-xqjww4Pv.js} +5 -6
- package/dist/chunks/code-xqjww4Pv.js.map +1 -0
- package/dist/chunks/combobox-DkcjkWc6.js +352 -0
- package/dist/chunks/combobox-DkcjkWc6.js.map +1 -0
- package/dist/chunks/command-list-CypqsC4T.js +456 -0
- package/dist/chunks/command-list-CypqsC4T.js.map +1 -0
- package/dist/chunks/{copy-button-FJvPJn72.js → copy-button-CwU8t_9_.js} +22 -15
- package/dist/chunks/copy-button-CwU8t_9_.js.map +1 -0
- package/dist/chunks/core-CmK-8ObW.js +505 -0
- package/dist/chunks/core-CmK-8ObW.js.map +1 -0
- package/dist/chunks/data-table-CqY8_6IS.js +581 -0
- package/dist/chunks/data-table-CqY8_6IS.js.map +1 -0
- package/dist/chunks/date-popup-DAnjptFt.js +58 -0
- package/dist/chunks/date-popup-DAnjptFt.js.map +1 -0
- package/dist/chunks/{de-CPXJh9cq.js → de-CqC4aSIV.js} +81 -40
- package/dist/chunks/de-CqC4aSIV.js.map +1 -0
- package/dist/chunks/{dialog-Cg9A_6SF.js → dialog-2zb6ClNR.js} +156 -134
- package/dist/chunks/dialog-2zb6ClNR.js.map +1 -0
- package/dist/chunks/disclosure-BtYRTDO3.js +22 -0
- package/dist/chunks/disclosure-BtYRTDO3.js.map +1 -0
- package/dist/chunks/domain-obd_w9xk.js +28 -0
- package/dist/chunks/domain-obd_w9xk.js.map +1 -0
- package/dist/chunks/{empty-DvhyMXQq.js → empty-BpiUgGzm.js} +2 -2
- package/dist/chunks/{empty-DvhyMXQq.js.map → empty-BpiUgGzm.js.map} +1 -1
- package/dist/chunks/{field-TviMvYa2.js → field-D7m-yl-D.js} +37 -34
- package/dist/chunks/field-D7m-yl-D.js.map +1 -0
- package/dist/chunks/{icon-D7ja-_Yk.js → icon-CBzOwqrX.js} +7 -6
- package/dist/chunks/{icon-D7ja-_Yk.js.map → icon-CBzOwqrX.js.map} +1 -1
- package/dist/chunks/icon-CPJWE2N-.js +95 -0
- package/dist/chunks/{icon-DVooQfk4.js.map → icon-CPJWE2N-.js.map} +1 -1
- package/dist/chunks/{icon-button-CrdF_eMG.js → icon-button-Dfwpvmav.js} +7 -6
- package/dist/chunks/icon-button-Dfwpvmav.js.map +1 -0
- package/dist/chunks/{identity-BmhQ6BQ-.js → identity-3Foi5F8w.js} +7 -7
- package/dist/chunks/{identity-BmhQ6BQ-.js.map → identity-3Foi5F8w.js.map} +1 -1
- package/dist/chunks/{input-2VJuj_M4.js → input-Bo5-UZg2.js} +15 -9
- package/dist/chunks/input-Bo5-UZg2.js.map +1 -0
- package/dist/chunks/{input-group-DQ_4DoXg.js → input-group-jPcK9T_a.js} +42 -29
- package/dist/chunks/input-group-jPcK9T_a.js.map +1 -0
- package/dist/chunks/iso-field-DoqHBg8n.js +52 -0
- package/dist/chunks/iso-field-DoqHBg8n.js.map +1 -0
- package/dist/chunks/json-view-DZ2nL2Ir.js +253 -0
- package/dist/chunks/json-view-DZ2nL2Ir.js.map +1 -0
- package/dist/chunks/{kbd-BF1vKXJf.js → kbd-8A0ML_up.js} +30 -28
- package/dist/chunks/kbd-8A0ML_up.js.map +1 -0
- package/dist/chunks/label-DW24Aj0Z.js +26 -0
- package/dist/chunks/label-DW24Aj0Z.js.map +1 -0
- package/dist/chunks/{link-KWI7PevW.js → link-CMjkcLQK.js} +14 -14
- package/dist/chunks/link-CMjkcLQK.js.map +1 -0
- package/dist/chunks/list-B4G-sWwV.js +540 -0
- package/dist/chunks/list-B4G-sWwV.js.map +1 -0
- package/dist/chunks/{loader-DCfPndXa.js → loader-zo8CCIGJ.js} +2 -2
- package/dist/chunks/{loader-DCfPndXa.js.map → loader-zo8CCIGJ.js.map} +1 -1
- package/dist/chunks/markdown-C565aBR7.js +338 -0
- package/dist/chunks/markdown-C565aBR7.js.map +1 -0
- package/dist/chunks/menu-Clvv6ftq.js +485 -0
- package/dist/chunks/menu-Clvv6ftq.js.map +1 -0
- package/dist/chunks/merge-refs-BN1FyQt9.js +20 -0
- package/dist/chunks/merge-refs-BN1FyQt9.js.map +1 -0
- package/dist/chunks/meter-CASMHlxl.js +100 -0
- package/dist/chunks/meter-CASMHlxl.js.map +1 -0
- package/dist/chunks/nav-sheet-Dt6JSvzX.js +67 -0
- package/dist/chunks/nav-sheet-Dt6JSvzX.js.map +1 -0
- package/dist/chunks/{nav-wordmark-_pjheAsZ.js → nav-wordmark-J4pB_vjr.js} +4 -8
- package/dist/chunks/nav-wordmark-J4pB_vjr.js.map +1 -0
- package/dist/chunks/page-header-kS5tdmvb.js +45 -0
- package/dist/chunks/page-header-kS5tdmvb.js.map +1 -0
- package/dist/chunks/pagination-D7fAm8qg.js +147 -0
- package/dist/chunks/pagination-D7fAm8qg.js.map +1 -0
- package/dist/chunks/picker-popover-1FHb1LQG.js +119 -0
- package/dist/chunks/picker-popover-1FHb1LQG.js.map +1 -0
- package/dist/chunks/popover-Bl5QYqnh.js +51 -0
- package/dist/chunks/popover-Bl5QYqnh.js.map +1 -0
- package/dist/chunks/{portal-context-BBbzDKmY.js → portal-context-CTatR2Z8.js} +14 -4
- package/dist/chunks/portal-context-CTatR2Z8.js.map +1 -0
- package/dist/chunks/{radio-CDDFpdtL.js → radio-C6GtzF_t.js} +38 -23
- package/dist/chunks/radio-C6GtzF_t.js.map +1 -0
- package/dist/chunks/range-popup-lGiZsG3s.js +160 -0
- package/dist/chunks/range-popup-lGiZsG3s.js.map +1 -0
- package/dist/chunks/reasoning-frame-C3HdQRRS.js +51 -0
- package/dist/chunks/reasoning-frame-C3HdQRRS.js.map +1 -0
- package/dist/chunks/release-art-ChiT4T2S.js +582 -0
- package/dist/chunks/release-art-ChiT4T2S.js.map +1 -0
- package/dist/chunks/rights-B68ocZuq.js +312 -0
- package/dist/chunks/rights-B68ocZuq.js.map +1 -0
- package/dist/chunks/{scroll-area-D8MD7Vpo.js → scroll-area-_Ljh4-bG.js} +11 -6
- package/dist/chunks/scroll-area-_Ljh4-bG.js.map +1 -0
- package/dist/chunks/section-CFBYhsUi.js +77 -0
- package/dist/chunks/section-CFBYhsUi.js.map +1 -0
- package/dist/chunks/section-header-DU1Q4Tdf.js +28 -0
- package/dist/chunks/section-header-DU1Q4Tdf.js.map +1 -0
- package/dist/chunks/segmented-D9i1avik.js +119 -0
- package/dist/chunks/segmented-D9i1avik.js.map +1 -0
- package/dist/chunks/select-BqjmQOqx.js +222 -0
- package/dist/chunks/select-BqjmQOqx.js.map +1 -0
- package/dist/chunks/{separator-D7TzNHmX.js → separator-BNWf6BBj.js} +13 -8
- package/dist/chunks/separator-BNWf6BBj.js.map +1 -0
- package/dist/chunks/sidebar-Dq7oGOje.js +664 -0
- package/dist/chunks/sidebar-Dq7oGOje.js.map +1 -0
- package/dist/chunks/{sidebar-menu-BN3jkTlK.js → sidebar-menu-QSSNu1jJ.js} +2 -2
- package/dist/chunks/{sidebar-menu-BN3jkTlK.js.map → sidebar-menu-QSSNu1jJ.js.map} +1 -1
- package/dist/chunks/{skeleton-Dcz57Zyp.js → skeleton-D-qk3mes.js} +3 -3
- package/dist/chunks/skeleton-D-qk3mes.js.map +1 -0
- package/dist/chunks/slider-CcE8GtuV.js +58 -0
- package/dist/chunks/slider-CcE8GtuV.js.map +1 -0
- package/dist/chunks/{status-dot-QJTF0Yv4.js → status-dot-CP6runiC.js} +4 -4
- package/dist/chunks/{status-dot-QJTF0Yv4.js.map → status-dot-CP6runiC.js.map} +1 -1
- package/dist/chunks/{styles-CVJU9t9v.js → styles-hkFkoBbi.js} +2 -2
- package/dist/chunks/{styles-CVJU9t9v.js.map → styles-hkFkoBbi.js.map} +1 -1
- package/dist/chunks/{swap-text-Dr0Irxz6.js → swap-text-SlUjrTlG.js} +3 -3
- package/dist/chunks/swap-text-SlUjrTlG.js.map +1 -0
- package/dist/chunks/switch-ngywMQdl.js +76 -0
- package/dist/chunks/switch-ngywMQdl.js.map +1 -0
- package/dist/chunks/table-CTK5E0J7.js +102 -0
- package/dist/chunks/table-CTK5E0J7.js.map +1 -0
- package/dist/chunks/tag-BGr6lTSV.js +100 -0
- package/dist/chunks/tag-BGr6lTSV.js.map +1 -0
- package/dist/chunks/{text-CIXH8rmT.js → text-DkKdTVUf.js} +9 -9
- package/dist/chunks/text-DkKdTVUf.js.map +1 -0
- package/dist/chunks/{textarea--4FRL3Pb.js → textarea-CO0HP6fK.js} +47 -36
- package/dist/chunks/textarea-CO0HP6fK.js.map +1 -0
- package/dist/chunks/timeseries-Ck-q0wWn.js +381 -0
- package/dist/chunks/timeseries-Ck-q0wWn.js.map +1 -0
- package/dist/chunks/toolbar-u0Gm7Q7-.js +61 -0
- package/dist/chunks/toolbar-u0Gm7Q7-.js.map +1 -0
- package/dist/chunks/tooltip-Tkm-urbi.js +202 -0
- package/dist/chunks/tooltip-Tkm-urbi.js.map +1 -0
- package/dist/chunks/tooltip-root-BC_RNNiP.js +70 -0
- package/dist/chunks/tooltip-root-BC_RNNiP.js.map +1 -0
- package/dist/chunks/truncated-d1afmUJT.js +33 -0
- package/dist/chunks/truncated-d1afmUJT.js.map +1 -0
- package/dist/chunks/use-coarse-pointer-Ml5oE6oX.js +28 -0
- package/dist/chunks/use-coarse-pointer-Ml5oE6oX.js.map +1 -0
- package/dist/chunks/use-hydrating-COtYVRo4.js +8 -0
- package/dist/chunks/use-hydrating-COtYVRo4.js.map +1 -0
- package/dist/chunks/use-scroll-fade-uc8mWSDX.js +30 -0
- package/dist/chunks/use-scroll-fade-uc8mWSDX.js.map +1 -0
- package/dist/chunks/{zh-CN-29X4CDLE.js → zh-CN-BlpsT6d_.js} +80 -39
- package/dist/chunks/zh-CN-BlpsT6d_.js.map +1 -0
- package/dist/components/agent-avatar.js +1 -1
- package/dist/components/app-frame.js +2 -2
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/button-group.js +22 -22
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/charts/bar.js +235 -160
- package/dist/components/charts/bar.js.map +1 -1
- package/dist/components/charts/donut.js +144 -99
- package/dist/components/charts/donut.js.map +1 -1
- package/dist/components/charts/gauge.js +61 -49
- package/dist/components/charts/gauge.js.map +1 -1
- package/dist/components/charts/heatmap.js +179 -70
- package/dist/components/charts/heatmap.js.map +1 -1
- package/dist/components/charts/sankey.js +144 -77
- package/dist/components/charts/sankey.js.map +1 -1
- package/dist/components/charts/sparkline.js +54 -38
- package/dist/components/charts/sparkline.js.map +1 -1
- package/dist/components/charts/timeseries.js +1 -1
- package/dist/components/charts.js +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +4 -3
- package/dist/components/code.js +1 -1
- package/dist/components/collapsible.js +77 -1
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-list.js +2 -2
- package/dist/components/command-palette.js +89 -66
- package/dist/components/command-palette.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +1 -459
- package/dist/components/date-picker.js +162 -151
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dialog.js +74 -63
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/display-options.js +76 -64
- package/dist/components/display-options.js.map +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/figure.js +2 -2
- package/dist/components/filter-chip.js +36 -27
- package/dist/components/filter-chip.js.map +1 -1
- package/dist/components/filter-row.js +4 -4
- package/dist/components/filter-row.js.map +1 -1
- package/dist/components/flow.js +94 -63
- package/dist/components/flow.js.map +1 -1
- package/dist/components/heading.js +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/icon.js +2 -2
- package/dist/components/input.js +176 -98
- package/dist/components/input.js.map +1 -1
- package/dist/components/kaeso/conversation.js +51 -46
- package/dist/components/kaeso/conversation.js.map +1 -1
- package/dist/components/kaeso/identity.js +1 -1
- package/dist/components/kaeso/moments.js +23 -20
- package/dist/components/kaeso/moments.js.map +1 -1
- package/dist/components/kaeso/rights.js +1 -1
- package/dist/components/kaeso/usage.js +90 -74
- package/dist/components/kaeso/usage.js.map +1 -1
- package/dist/components/kaeso.js +200 -187
- package/dist/components/kaeso.js.map +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/key-value.js +32 -47
- package/dist/components/key-value.js.map +1 -1
- package/dist/components/label.js +1 -25
- package/dist/components/layout.js +2 -2
- package/dist/components/layout.js.map +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/loader.js +11 -10
- package/dist/components/loader.js.map +1 -1
- package/dist/components/logo.js +2 -2
- package/dist/components/markdown.js +1 -1
- package/dist/components/menu.js +2 -2
- package/dist/components/meter.js +1 -1
- package/dist/components/page-header.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/playground.js +644 -529
- package/dist/components/playground.js.map +1 -1
- package/dist/components/popover.js +4 -4
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.js +1 -1
- package/dist/components/qr-code.js +2 -2
- package/dist/components/qr-code.js.map +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/release-art.js +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/section.js +1 -1
- package/dist/components/segmented.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/settings.js +39 -46
- package/dist/components/settings.js.map +1 -1
- package/dist/components/sheet.js +10 -9
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/stat.js +98 -84
- package/dist/components/stat.js.map +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/surface.js +1 -1
- package/dist/components/swap-text.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +73 -55
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/theme-image.js +1 -1
- package/dist/components/theme-menu.js +5 -2
- package/dist/components/theme-menu.js.map +1 -1
- package/dist/components/theme-select.js +1 -1
- package/dist/components/thumbnail.js +35 -24
- package/dist/components/thumbnail.js.map +1 -1
- package/dist/components/timeline.js +51 -35
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/toast.js +76 -66
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toc.js +14 -8
- package/dist/components/toc.js.map +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/visually-hidden.js +1 -1
- package/dist/i18n-provider.js +1 -1
- package/dist/index.js +101 -101
- package/dist/kaeso.css +605 -67
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/types/blocks/delete-resource/delete-resource.d.ts +2 -2
- package/dist/types/components/agent-avatar/agent-avatar.d.ts +24 -19
- package/dist/types/components/badge/badge.d.ts +3 -3
- package/dist/types/components/banner/banner.d.ts +3 -3
- package/dist/types/components/button/button.d.ts +2 -2
- package/dist/types/components/button-group/button-group.d.ts +1 -1
- package/dist/types/components/charts/domain.d.ts +11 -0
- package/dist/types/components/charts/marks.d.ts +1 -0
- package/dist/types/components/code/code.d.ts +3 -3
- package/dist/types/components/code-block/diff-view.d.ts +30 -0
- package/dist/types/components/code-block/diff.d.ts +26 -0
- package/dist/types/components/code-block/docs.d.ts +14 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/json-view.d.ts +2 -1
- package/dist/types/components/code-block/numbers.d.ts +1 -0
- package/dist/types/components/collapsible/collapsible.d.ts +2 -2
- package/dist/types/components/collapsible/disclosure.d.ts +2 -0
- package/dist/types/components/data-table/data-table.d.ts +6 -5
- package/dist/types/components/data-table/docs.d.ts +1 -0
- package/dist/types/components/data-table/time-columns.d.ts +1 -0
- package/dist/types/components/date-picker/focus-day.d.ts +1 -0
- package/dist/types/components/date-picker/iso-field.d.ts +8 -1
- package/dist/types/components/dialog/dialog.d.ts +7 -7
- package/dist/types/components/field/field.d.ts +1 -1
- package/dist/types/components/flow/flow.d.ts +1 -1
- package/dist/types/components/icon-button/icon-button.d.ts +1 -1
- package/dist/types/components/input/input-group.d.ts +2 -0
- package/dist/types/components/input/number-input.d.ts +4 -4
- package/dist/types/components/input/otp-input.d.ts +3 -3
- package/dist/types/components/kaeso/client-button.d.ts +2 -1
- package/dist/types/components/kaeso/provider-picker.d.ts +1 -0
- package/dist/types/components/kaeso/rights.d.ts +1 -1
- package/dist/types/components/kaeso/role-picker.d.ts +1 -0
- package/dist/types/components/key-value/key-value.d.ts +2 -2
- package/dist/types/components/layout/layout.d.ts +2 -2
- package/dist/types/components/link/link.d.ts +4 -4
- package/dist/types/components/list/list.d.ts +2 -2
- package/dist/types/components/menu/menu.d.ts +2 -1
- package/dist/types/components/menu/styles.d.ts +3 -3
- package/dist/types/components/meter/meter.d.ts +3 -3
- package/dist/types/components/page-header/page-header.d.ts +1 -1
- package/dist/types/components/pagination/pagination.d.ts +2 -2
- package/dist/types/components/playground/prompt-suggestions.d.ts +1 -0
- package/dist/types/components/playground/reasoning-frame.d.ts +14 -0
- package/dist/types/components/playground/reasoning.d.ts +1 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/scroll-area/scroll-area.d.ts +2 -2
- package/dist/types/components/section/section-header.d.ts +6 -0
- package/dist/types/components/segmented/segmented.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/sheet/sheet.d.ts +3 -3
- package/dist/types/components/sidebar/sidebar.d.ts +1 -0
- package/dist/types/components/slider/slider.d.ts +2 -2
- package/dist/types/components/stat/stat.d.ts +1 -1
- package/dist/types/components/tabs/tabs.d.ts +6 -4
- package/dist/types/components/text/truncated.d.ts +7 -0
- package/dist/types/components/timeline/timeline.d.ts +5 -5
- package/dist/types/components/toc/toc.d.ts +1 -1
- package/dist/types/components/toolbar/toolbar.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tooltip/trigger-props.d.ts +1 -0
- package/dist/types/hooks/use-coarse-pointer.d.ts +1 -0
- package/dist/types/hooks/use-hydrating.d.ts +1 -0
- package/dist/types/icons/groups.d.ts +1 -1
- package/dist/types/icons/vocabulary.d.ts +5 -0
- package/dist/types/utils/arrow-focus.d.ts +4 -1
- package/dist/types/utils/cn.d.ts +33 -0
- package/dist/types/utils/portal-context.d.ts +7 -1
- package/dist/utils.js +2 -2
- package/foundations/accessibility.md +3 -2
- package/foundations/color.md +5 -1
- package/foundations/elevation.md +1 -0
- package/foundations/motion.md +1 -1
- package/foundations/shape.md +2 -2
- package/foundations/typography.md +12 -12
- package/package.json +2 -2
- package/dist/chunks/agent-avatar-0pdBTWkR.js +0 -171
- package/dist/chunks/agent-avatar-0pdBTWkR.js.map +0 -1
- package/dist/chunks/app-frame-DogGRmsu.js +0 -221
- package/dist/chunks/app-frame-DogGRmsu.js.map +0 -1
- package/dist/chunks/arrow-focus-BcySmwwU.js +0 -11
- package/dist/chunks/arrow-focus-BcySmwwU.js.map +0 -1
- package/dist/chunks/avatar-CWbdwbJv.js +0 -83
- package/dist/chunks/avatar-CWbdwbJv.js.map +0 -1
- package/dist/chunks/badge-C2KtxCLB.js +0 -26
- package/dist/chunks/badge-C2KtxCLB.js.map +0 -1
- package/dist/chunks/banner-BA2ALw9M.js +0 -85
- package/dist/chunks/banner-BA2ALw9M.js.map +0 -1
- package/dist/chunks/button-CzuxqawA.js +0 -164
- package/dist/chunks/button-CzuxqawA.js.map +0 -1
- package/dist/chunks/calendar-BWaf2MXc.js.map +0 -1
- package/dist/chunks/checkbox-CQjwCPkc.js +0 -126
- package/dist/chunks/checkbox-CQjwCPkc.js.map +0 -1
- package/dist/chunks/cn-Dj6sRgkF.js.map +0 -1
- package/dist/chunks/code-block-D5A-CGXG.js +0 -330
- package/dist/chunks/code-block-D5A-CGXG.js.map +0 -1
- package/dist/chunks/code-tqj0uhBL.js.map +0 -1
- package/dist/chunks/collapsible-CKrCX_T9.js +0 -87
- package/dist/chunks/collapsible-CKrCX_T9.js.map +0 -1
- package/dist/chunks/combobox-DjDI7SUC.js +0 -319
- package/dist/chunks/combobox-DjDI7SUC.js.map +0 -1
- package/dist/chunks/command-list-C2Y7V_lt.js +0 -418
- package/dist/chunks/command-list-C2Y7V_lt.js.map +0 -1
- package/dist/chunks/copy-button-FJvPJn72.js.map +0 -1
- package/dist/chunks/core-BYns5ytV.js +0 -472
- package/dist/chunks/core-BYns5ytV.js.map +0 -1
- package/dist/chunks/date-popup-CPA_zt6o.js +0 -35
- package/dist/chunks/date-popup-CPA_zt6o.js.map +0 -1
- package/dist/chunks/de-CPXJh9cq.js.map +0 -1
- package/dist/chunks/dialog-Cg9A_6SF.js.map +0 -1
- package/dist/chunks/field-TviMvYa2.js.map +0 -1
- package/dist/chunks/hidden-description-B2zSmLcn.js +0 -23
- package/dist/chunks/hidden-description-B2zSmLcn.js.map +0 -1
- package/dist/chunks/icon-DVooQfk4.js +0 -94
- package/dist/chunks/icon-button-CrdF_eMG.js.map +0 -1
- package/dist/chunks/input-2VJuj_M4.js.map +0 -1
- package/dist/chunks/input-group-DQ_4DoXg.js.map +0 -1
- package/dist/chunks/iso-field-B2rTwiBo.js +0 -33
- package/dist/chunks/iso-field-B2rTwiBo.js.map +0 -1
- package/dist/chunks/json-view-Dqd2TDkc.js +0 -175
- package/dist/chunks/json-view-Dqd2TDkc.js.map +0 -1
- package/dist/chunks/kbd-BF1vKXJf.js.map +0 -1
- package/dist/chunks/link-KWI7PevW.js.map +0 -1
- package/dist/chunks/list-M1csq-d4.js +0 -494
- package/dist/chunks/list-M1csq-d4.js.map +0 -1
- package/dist/chunks/markdown-DULktoTK.js +0 -313
- package/dist/chunks/markdown-DULktoTK.js.map +0 -1
- package/dist/chunks/menu-DEmBfdPm.js +0 -450
- package/dist/chunks/menu-DEmBfdPm.js.map +0 -1
- package/dist/chunks/meter-Bj4N3Xuh.js +0 -84
- package/dist/chunks/meter-Bj4N3Xuh.js.map +0 -1
- package/dist/chunks/nav-sheet-CzgIwgAm.js +0 -60
- package/dist/chunks/nav-sheet-CzgIwgAm.js.map +0 -1
- package/dist/chunks/nav-wordmark-_pjheAsZ.js.map +0 -1
- package/dist/chunks/page-header-DL2y2iZp.js +0 -41
- package/dist/chunks/page-header-DL2y2iZp.js.map +0 -1
- package/dist/chunks/pagination-Cn_qF4cg.js +0 -86
- package/dist/chunks/pagination-Cn_qF4cg.js.map +0 -1
- package/dist/chunks/picker-popover-BxyU1U9F.js +0 -106
- package/dist/chunks/picker-popover-BxyU1U9F.js.map +0 -1
- package/dist/chunks/popover-DNN4S47w.js +0 -50
- package/dist/chunks/popover-DNN4S47w.js.map +0 -1
- package/dist/chunks/portal-context-BBbzDKmY.js.map +0 -1
- package/dist/chunks/radio-CDDFpdtL.js.map +0 -1
- package/dist/chunks/range-popup-CRyWYUB1.js +0 -128
- package/dist/chunks/range-popup-CRyWYUB1.js.map +0 -1
- package/dist/chunks/release-art-ZwfFQImt.js +0 -561
- package/dist/chunks/release-art-ZwfFQImt.js.map +0 -1
- package/dist/chunks/rights-Cyp0Pzp-.js +0 -279
- package/dist/chunks/rights-Cyp0Pzp-.js.map +0 -1
- package/dist/chunks/scroll-area-D8MD7Vpo.js.map +0 -1
- package/dist/chunks/scroll-parent-WXvzQcUo.js +0 -14
- package/dist/chunks/scroll-parent-WXvzQcUo.js.map +0 -1
- package/dist/chunks/section-Ce1efbsP.js +0 -87
- package/dist/chunks/section-Ce1efbsP.js.map +0 -1
- package/dist/chunks/segmented-CErcoxwi.js +0 -114
- package/dist/chunks/segmented-CErcoxwi.js.map +0 -1
- package/dist/chunks/select-x4XVsdCI.js +0 -210
- package/dist/chunks/select-x4XVsdCI.js.map +0 -1
- package/dist/chunks/separator-D7TzNHmX.js.map +0 -1
- package/dist/chunks/sidebar-3r1ZRXlN.js +0 -621
- package/dist/chunks/sidebar-3r1ZRXlN.js.map +0 -1
- package/dist/chunks/skeleton-Dcz57Zyp.js.map +0 -1
- package/dist/chunks/slider-Ci83PGtj.js +0 -57
- package/dist/chunks/slider-Ci83PGtj.js.map +0 -1
- package/dist/chunks/swap-text-Dr0Irxz6.js.map +0 -1
- package/dist/chunks/switch-BNMq_kGt.js +0 -59
- package/dist/chunks/switch-BNMq_kGt.js.map +0 -1
- package/dist/chunks/table-BeOSKl_3.js +0 -84
- package/dist/chunks/table-BeOSKl_3.js.map +0 -1
- package/dist/chunks/tag-D_M1s2qS.js +0 -87
- package/dist/chunks/tag-D_M1s2qS.js.map +0 -1
- package/dist/chunks/text-CIXH8rmT.js.map +0 -1
- package/dist/chunks/textarea--4FRL3Pb.js.map +0 -1
- package/dist/chunks/timeseries-D1xjRXfk.js +0 -339
- package/dist/chunks/timeseries-D1xjRXfk.js.map +0 -1
- package/dist/chunks/toolbar-WA_oZgu-.js +0 -37
- package/dist/chunks/toolbar-WA_oZgu-.js.map +0 -1
- package/dist/chunks/tooltip-OcwO0VUT.js +0 -154
- package/dist/chunks/tooltip-OcwO0VUT.js.map +0 -1
- package/dist/chunks/tooltip-root-DzahJDVj.js +0 -60
- package/dist/chunks/tooltip-root-DzahJDVj.js.map +0 -1
- package/dist/chunks/zh-CN-29X4CDLE.js.map +0 -1
- package/dist/components/data-table.js.map +0 -1
- package/dist/components/label.js.map +0 -1
|
@@ -1,110 +1,177 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../../chunks/cn-
|
|
2
|
+
import { t as e } from "../../chunks/cn-BjnOAUrA.js";
|
|
3
3
|
import { i as t } from "../../chunks/context-BELWW79w.js";
|
|
4
4
|
import { formatNumber as n } from "../../format.js";
|
|
5
|
-
import { D as r,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { D as r, E as i, b as a, h as o, n as s, r as c } from "../../chunks/core-CmK-8ObW.js";
|
|
6
|
+
import { i as l } from "../../chunks/domain-obd_w9xk.js";
|
|
7
|
+
import { forwardRef as u, useId as d, useMemo as f, useState as p } from "react";
|
|
8
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import { sankey as g, sankeyLinkHorizontal as _ } from "d3-sankey";
|
|
9
10
|
//#region src/components/charts/sankey.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
var v = { size: { md: { classes: "" } } }, y = { size: "md" }, b = 8, x = 8, S = 24, C = 13, w = (e) => o(e) * (C / 12), T = /* @__PURE__ */ u(function({ nodes: o, links: u, height: v = 320, formatValue: y = (e) => n(e), className: T, "aria-label": E, ...D }, O) {
|
|
12
|
+
let k = t(), [A, j] = r(), [M, N] = p(null), P = d().replace(/:/g, ""), F = u.filter((e) => Number.isFinite(e.value) && e.value > 0), I = new Set(F.flatMap((e) => [e.source, e.target])), L = o.filter((e) => I.has(e.id)), R = D.empty ?? F.length === 0, z = f(() => a(o.map((e) => e.id)), [o]), B = (e) => z.get(e), V = f(() => {
|
|
13
|
+
if (!j.width || R) return null;
|
|
14
|
+
let e = g().nodeId((e) => e.id).nodeWidth(b).nodePadding(16).extent([[0, 4], [j.width, v - 4]])({
|
|
15
|
+
nodes: L.map((e) => ({ ...e })),
|
|
16
|
+
links: F.map((e) => ({ ...e }))
|
|
17
|
+
}), t = e.nodes, n = Math.max(0, ...t.map((e) => e.depth ?? 0)), r = Array.from({ length: n + 1 }, (e, n) => t.filter((e) => e.depth === n)), i = (e) => `${e.label} ${y(e.value ?? 0)}`, a = (e) => r.map((t) => Math.max(0, ...t.map((t) => w(e ? i(t) : t.label))) + x), o = (e) => (n + 1) * b + e.reduce((e, t) => e + t, 0) + Math.max(0, n - 1) * S + (n > 0 ? S : 0), s = !0, c = a(!0);
|
|
18
|
+
o(c) > j.width && (s = !1, c = a(!1));
|
|
19
|
+
let u = j.width - o(c);
|
|
20
|
+
if (u < 0) {
|
|
21
|
+
let e = c.reduce((e, t) => e + t, 0) || 1;
|
|
22
|
+
c = c.map((t) => Math.max(32, t + u * t / e));
|
|
23
|
+
}
|
|
24
|
+
let d = n > 0 ? Math.max(0, u) / n : 0, f = r.map(() => 0);
|
|
25
|
+
for (let e = 1; e <= n; e++) f[e] = f[e - 1] + b + (e - 1 == n - 1 && n > 0 ? c[e - 1] + S + c[e] : c[e - 1] + S) + d;
|
|
26
|
+
n === 0 && (f[0] = 0);
|
|
27
|
+
for (let e of t) {
|
|
28
|
+
let t = e.depth ?? 0;
|
|
29
|
+
e.x0 = Math.round(t === n && n > 0 ? Math.min(j.width - b, f[t]) : f[t]), e.x1 = e.x0 + b;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
graph: e,
|
|
33
|
+
placed: t.map((e) => {
|
|
34
|
+
let t = e.depth ?? 0, r = t === n && n > 0, a = s ? i(e) : e.label, o = l(e.label, c[t] - x - (s ? w(` ${y(e.value ?? 0)}`) : 0), C);
|
|
35
|
+
return {
|
|
36
|
+
n: e,
|
|
37
|
+
left: r,
|
|
38
|
+
label: o,
|
|
39
|
+
value: s ? y(e.value ?? 0) : null,
|
|
40
|
+
cut: o !== e.label || a !== i(e)
|
|
41
|
+
};
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
}, [
|
|
45
|
+
L,
|
|
46
|
+
F,
|
|
47
|
+
j.width,
|
|
48
|
+
v,
|
|
49
|
+
R,
|
|
50
|
+
y
|
|
51
|
+
]), H = {
|
|
20
52
|
columns: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
53
|
+
k("sankey.from", "From"),
|
|
54
|
+
k("sankey.to", "To"),
|
|
55
|
+
k("sankey.requests", "Requests")
|
|
24
56
|
],
|
|
25
|
-
rows:
|
|
57
|
+
rows: F.map((e) => [
|
|
26
58
|
o.find((t) => t.id === e.source)?.label ?? e.source,
|
|
27
59
|
o.find((t) => t.id === e.target)?.label ?? e.target,
|
|
28
|
-
|
|
60
|
+
y(e.value)
|
|
29
61
|
])
|
|
30
|
-
},
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
ref:
|
|
33
|
-
className: e("min-w-0",
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
label:
|
|
36
|
-
height:
|
|
37
|
-
table:
|
|
38
|
-
state:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
}, U = (V?.placed ?? []).slice().sort((e, t) => (e.n.depth ?? 0) - (t.n.depth ?? 0) || (e.n.y0 ?? 0) - (t.n.y0 ?? 0)), W = R || !!D.loading || !!D.error, G = i(W ? 0 : U.length, { start: 0 }), K = G.index === null ? void 0 : U[G.index]?.n, q = M ?? K?.id ?? null, J = _(), Y = (e) => !q || e.source.id === q || e.target.id === q;
|
|
63
|
+
return /* @__PURE__ */ m("div", {
|
|
64
|
+
ref: O,
|
|
65
|
+
className: e("w-full min-w-0", T),
|
|
66
|
+
children: /* @__PURE__ */ m(s, {
|
|
67
|
+
label: E,
|
|
68
|
+
height: v,
|
|
69
|
+
table: H,
|
|
70
|
+
state: {
|
|
71
|
+
...D,
|
|
72
|
+
empty: R
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ h("div", {
|
|
75
|
+
ref: A,
|
|
76
|
+
role: "group",
|
|
77
|
+
"aria-label": E,
|
|
78
|
+
...G.props,
|
|
79
|
+
className: "absolute inset-0 rounded-cell focus-ring",
|
|
80
|
+
children: [V && /* @__PURE__ */ h("svg", {
|
|
81
|
+
width: j.width,
|
|
82
|
+
height: v,
|
|
45
83
|
role: "presentation",
|
|
46
|
-
className: "
|
|
84
|
+
className: "block",
|
|
47
85
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
id: `${
|
|
86
|
+
/* @__PURE__ */ m("defs", { children: V.graph.links.map((e, t) => /* @__PURE__ */ h("linearGradient", {
|
|
87
|
+
id: `${P}-${t}`,
|
|
50
88
|
gradientUnits: "userSpaceOnUse",
|
|
51
89
|
x1: e.source.x1,
|
|
52
90
|
x2: e.target.x0,
|
|
53
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ m("stop", {
|
|
54
92
|
offset: "0%",
|
|
55
|
-
stopColor:
|
|
56
|
-
}), /* @__PURE__ */
|
|
93
|
+
stopColor: B(e.source.id)
|
|
94
|
+
}), /* @__PURE__ */ m("stop", {
|
|
57
95
|
offset: "100%",
|
|
58
|
-
stopColor:
|
|
96
|
+
stopColor: B(e.target.id)
|
|
59
97
|
})]
|
|
60
98
|
}, t)) }),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
d:
|
|
99
|
+
/* @__PURE__ */ m("g", { children: V.graph.links.map((e, t) => /* @__PURE__ */ m("path", {
|
|
100
|
+
d: J(e) ?? "",
|
|
63
101
|
fill: "none",
|
|
64
|
-
stroke: `url(#${
|
|
65
|
-
strokeOpacity:
|
|
102
|
+
stroke: `url(#${P}-${t})`,
|
|
103
|
+
strokeOpacity: .5,
|
|
104
|
+
opacity: q ? Y(e) ? 1 : .12 : .48,
|
|
66
105
|
strokeWidth: Math.max(1, e.width ?? 1),
|
|
67
106
|
className: "opacity-motion",
|
|
68
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ m("title", { children: k("sankey.link", "{source} → {target}: {value}", {
|
|
69
108
|
source: e.source.label,
|
|
70
109
|
target: e.target.label,
|
|
71
|
-
value:
|
|
110
|
+
value: y(e.value)
|
|
72
111
|
}) })
|
|
73
112
|
}, t)) }),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
113
|
+
/* @__PURE__ */ m("g", { children: V.placed.map(({ n: e, left: t, label: n, value: r, cut: i }) => {
|
|
114
|
+
let a = K?.id === e.id, o = ((e.y0 ?? 0) + (e.y1 ?? 0)) / 2;
|
|
115
|
+
return /* @__PURE__ */ h("g", {
|
|
116
|
+
onMouseEnter: () => N(e.id),
|
|
117
|
+
onMouseLeave: () => N(null),
|
|
118
|
+
className: "cursor-default",
|
|
119
|
+
children: [
|
|
120
|
+
a && /* @__PURE__ */ m("rect", {
|
|
121
|
+
x: (e.x0 ?? 0) - 3,
|
|
122
|
+
y: (e.y0 ?? 0) - 3,
|
|
123
|
+
width: 14,
|
|
124
|
+
height: Math.max(2, (e.y1 ?? 0) - (e.y0 ?? 0)) + 6,
|
|
125
|
+
rx: 6,
|
|
126
|
+
fill: "none",
|
|
127
|
+
stroke: "var(--k-text)",
|
|
128
|
+
strokeWidth: 1.5
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ m("rect", {
|
|
131
|
+
x: e.x0,
|
|
132
|
+
y: e.y0,
|
|
133
|
+
width: b,
|
|
134
|
+
height: Math.max(2, (e.y1 ?? 0) - (e.y0 ?? 0)),
|
|
135
|
+
rx: 4,
|
|
136
|
+
fill: B(e.id)
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ h("text", {
|
|
139
|
+
x: t ? (e.x0 ?? 0) - x : (e.x1 ?? 0) + x,
|
|
140
|
+
y: o,
|
|
141
|
+
dy: "0.32em",
|
|
142
|
+
textAnchor: t ? "end" : "start",
|
|
143
|
+
fill: "var(--k-text)",
|
|
144
|
+
fontSize: C,
|
|
145
|
+
fontWeight: 500,
|
|
146
|
+
stroke: "var(--k-bg-panel)",
|
|
147
|
+
strokeWidth: 3,
|
|
148
|
+
strokeLinejoin: "round",
|
|
149
|
+
paintOrder: "stroke",
|
|
150
|
+
children: [
|
|
151
|
+
n,
|
|
152
|
+
r !== null && /* @__PURE__ */ m("tspan", {
|
|
153
|
+
fill: "var(--k-text-tertiary)",
|
|
154
|
+
dx: 6,
|
|
155
|
+
style: { fontVariantNumeric: "tabular-nums" },
|
|
156
|
+
children: r
|
|
157
|
+
}),
|
|
158
|
+
i && /* @__PURE__ */ m("title", { children: `${e.label} ${y(e.value ?? 0)}` })
|
|
159
|
+
]
|
|
160
|
+
})
|
|
161
|
+
]
|
|
162
|
+
}, e.id);
|
|
163
|
+
}) })
|
|
100
164
|
]
|
|
101
|
-
})
|
|
165
|
+
}), /* @__PURE__ */ m(c, { children: K ? k("sankey.node", "{node}: {value}", {
|
|
166
|
+
node: K.label,
|
|
167
|
+
value: y(K.value ?? 0)
|
|
168
|
+
}) : null })]
|
|
102
169
|
})
|
|
103
170
|
})
|
|
104
171
|
});
|
|
105
172
|
});
|
|
106
|
-
process.env.NODE_ENV !== "production" && (
|
|
173
|
+
process.env.NODE_ENV !== "production" && (T.displayName = "Sankey");
|
|
107
174
|
//#endregion
|
|
108
|
-
export {
|
|
175
|
+
export { y as KAESO_SANKEY_DEFAULT_VARIANTS, v as KAESO_SANKEY_VARIANTS, T as Sankey };
|
|
109
176
|
|
|
110
177
|
//# sourceMappingURL=sankey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sankey.js","names":["d3sankey","cn","useUiText","useSize","seriesColors","ChartFrame","KAESO_SANKEY_VARIANTS","KAESO_SANKEY_DEFAULT_VARIANTS","Sankey","formatNumber","v","ariaLabel","state","t","box","size","focus","setFocus","useState","gid","useId","palette","useMemo","nodes","n","seriesColor","id","graph","sankey","d","height","links","l","table","formatValue","linkPath","sankeyLinkHorizontal","lit","className","i"],"sources":["../../../src/components/charts/sankey.tsx"],"sourcesContent":["import { forwardRef, useId, useMemo, useState } from \"react\";\nimport { sankey as d3sankey, sankeyLinkHorizontal, type SankeyLink, type SankeyNode } from \"d3-sankey\";\nimport { cn } from \"../../utils/cn.js\";\nimport { formatNumber } from \"../../format/index.js\";\nimport { useUiText } from \"../../i18n/context.js\";\nimport { ChartFrame, seriesColors, useSize, type ChartState } from \"./core.js\";\n\nexport const KAESO_SANKEY_VARIANTS = {\n size: { md: { classes: \"\" } },\n} as const;\nexport const KAESO_SANKEY_DEFAULT_VARIANTS = { size: \"md\" } as const;\n\nexport interface SankeyNodeIn {\n id: string;\n label: string;\n}\nexport interface SankeyLinkIn {\n source: string;\n target: string;\n value: number;\n}\n\ntype N = SankeyNode<SankeyNodeIn, SankeyLinkIn>;\ntype L = SankeyLink<SankeyNodeIn, SankeyLinkIn>;\n\nexport const Sankey = /* @__PURE__ */ forwardRef<\n HTMLDivElement,\n {\n nodes: SankeyNodeIn[];\n links: SankeyLinkIn[];\n height?: number | undefined;\n formatValue?: ((v: number) => string) | undefined;\n \"aria-label\": string;\n className?: string | undefined;\n } & ChartState\n>(function Sankey({ nodes, links, height = 320, formatValue = (v) => formatNumber(v), className, \"aria-label\": ariaLabel, ...state }, ref) {\n const t = useUiText();\n const [box, size] = useSize<HTMLDivElement>();\n const [focus, setFocus] = useState<string | null>(null);\n const gid = useId().replace(/:/g, \"\");\n const palette = useMemo(() => seriesColors(nodes.map((n) => n.id)), [nodes]);\n const seriesColor = (id: string) => palette.get(id)!;\n const graph = useMemo(() => {\n if (!size.width) return null;\n const layout = d3sankey<SankeyNodeIn, SankeyLinkIn>()\n .nodeId((d) => d.id)\n .nodeWidth(8)\n .nodePadding(16)\n .extent([\n [0, 4],\n [size.width - 140, height - 4],\n ]);\n return layout({ nodes: nodes.map((n) => ({ ...n })), links: links.map((l) => ({ ...l })) });\n }, [nodes, links, size.width, height]);\n const table = {\n columns: [t(\"sankey.from\", \"From\"), t(\"sankey.to\", \"To\"), t(\"sankey.requests\", \"Requests\")],\n rows: links.map((l) => [\n nodes.find((n) => n.id === l.source)?.label ?? l.source,\n nodes.find((n) => n.id === l.target)?.label ?? l.target,\n formatValue(l.value),\n ]),\n };\n const linkPath = sankeyLinkHorizontal<SankeyNodeIn, SankeyLinkIn>();\n const lit = (l: L) => !focus || (l.source as N).id === focus || (l.target as N).id === focus;\n return (\n <div ref={ref} className={cn(\"min-w-0\", className)}>\n <ChartFrame label={ariaLabel} height={height} table={table} state={state}>\n <div ref={box} className=\"absolute inset-0\">\n {graph && (\n <svg width={size.width} height={height} role=\"presentation\" className=\"overflow-visible\">\n <defs>\n {(graph.links as L[]).map((l, i) => (\n <linearGradient key={i} id={`${gid}-${i}`} gradientUnits=\"userSpaceOnUse\" x1={(l.source as N).x1} x2={(l.target as N).x0}>\n <stop offset=\"0%\" stopColor={seriesColor((l.source as N).id)} />\n <stop offset=\"100%\" stopColor={seriesColor((l.target as N).id)} />\n </linearGradient>\n ))}\n </defs>\n <g>\n {(graph.links as L[]).map((l, i) => (\n <path\n key={i}\n d={linkPath(l) ?? \"\"}\n fill=\"none\"\n stroke={`url(#${gid}-${i})`}\n strokeOpacity={focus ? (lit(l) ? 0.5 : 0.06) : 0.24}\n strokeWidth={Math.max(1, l.width ?? 1)}\n className=\"opacity-motion\"\n >\n <title>\n {t(\"sankey.link\", \"{source} → {target}: {value}\", {\n source: (l.source as N).label,\n target: (l.target as N).label,\n value: formatValue(l.value),\n })}\n </title>\n </path>\n ))}\n </g>\n <g>\n {(graph.nodes as N[]).map((n) => (\n <g key={n.id} onMouseEnter={() => setFocus(n.id)} onMouseLeave={() => setFocus(null)} className=\"cursor-default\">\n <rect x={n.x0} y={n.y0} width={(n.x1 ?? 0) - (n.x0 ?? 0)} height={Math.max(2, (n.y1 ?? 0) - (n.y0 ?? 0))} rx={4} fill={seriesColor(n.id)} />\n <text x={(n.x1 ?? 0) + 10} y={((n.y0 ?? 0) + (n.y1 ?? 0)) / 2} dy=\"0.32em\" fill=\"var(--k-text)\" fontSize={13} fontWeight={500}>\n {n.label}\n <tspan fill=\"var(--k-text-tertiary)\" dx={6} style={{ fontVariantNumeric: \"tabular-nums\" }}>\n {formatValue(n.value ?? 0)}\n </tspan>\n </text>\n </g>\n ))}\n </g>\n </svg>\n )}\n </div>\n </ChartFrame>\n </div>\n );\n});\nif (process.env.NODE_ENV !== \"production\") Sankey.displayName = \"Sankey\";\n"],"mappings":";;;;;;;;;AAOA,IAAaM,IAAwB,EACnC,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,EAAE,EAC9B,GACaC,IAAgC,EAAE,MAAM,KAAK,GAe7CC,IAAyB,kBAUpC,SAAgB,EAAE,UAAO,UAAO,YAAS,KAAK,kBAAe,MAAMC,EAAaC,CAAC,GAAG,cAAW,cAAcC,GAAW,GAAGC,KAAS,GAAK;CACzI,IAAMC,IAAIX,EAAU,GACd,CAACY,GAAKC,KAAQZ,EAAwB,GACtC,CAACa,GAAOC,KAAYC,EAAwB,IAAI,GAChDC,IAAMC,EAAM,CAAC,CAAC,QAAQ,MAAM,EAAE,GAC9BC,IAAUC,QAAclB,EAAamB,EAAM,KAAK,MAAMC,EAAE,EAAE,CAAC,GAAG,CAACD,CAAK,CAAC,GACrEE,KAAe,MAAeJ,EAAQ,IAAIK,CAAE,GAC5CC,IAAQL,QACPP,EAAK,QACKf,EAAqC,CAAC,CAClD,QAAQ,MAAM6B,EAAE,EAAE,CAAC,CACnB,UAAU,CAAC,CAAC,CACZ,YAAY,EAAE,CAAC,CACf,OAAO,CACN,CAAC,GAAG,CAAC,GACL,CAACd,EAAK,QAAQ,KAAKe,IAAS,CAAC,CAC/B,CACK,CAAA,CAAO;EAAE,OAAOP,EAAM,KAAK,OAAO,EAAE,GAAGC,EAAE,EAAE;EAAG,OAAOO,EAAM,KAAK,OAAO,EAAE,GAAGC,EAAE,EAAE;CAAE,CAAC,IATlE,MAUvB;EAACT;EAAOQ;EAAOhB,EAAK;EAAOe;CAAM,CAAC,GAC/BG,IAAQ;EACZ,SAAS;GAACpB,EAAE,eAAe,MAAM;GAAGA,EAAE,aAAa,IAAI;GAAGA,EAAE,mB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OAC/C,aAAa,KAAK,IAAI,GAAGA,EAAE,SAAS,CAAC;OACrC,WAAU;OAEV,UAAA,kBAAC,SAAD,EAAA,UACGnB,EAAE,eAAe,gCAAgC;QAChD,QAASmB,EAAE,OAAa;QACxB,QAASA,EAAE,OAAa;QACxB,OAAOE,EAAYF,EAAE,KAAK;OAC5B,CAAC,EACI,CAAA;MACH,GAfCO,CAeD,CACP,EACA,CAAA;MACH,kBAAC,KAAD,EAAA,UACIZ,EAAM,MAAc,KAAK,MACzB,kBAAC,KAAD;OAAc,oBAAoBV,EAASO,EAAE,EAAE;OAAG,oBAAoBP,EAAS,IAAI;OAAG,WAAU;OAAhG,UAAA,CACE,kBAAC,QAAD;QAAM,GAAGO,EAAE;QAAI,GAAGA,EAAE;QAAI,QAAQA,EAAE,MAAM,MAAMA,EAAE,MAAM;QAAI,QAAQ,KAAK,IAAI,IAAIA,EAAE,MAAM,MAAMA,EAAE,MAAM,EAAE;QAAG,IAAI;QAAG,MAAMC,EAAYD,EAAE,EAAE;OAAI,CAAA,GAC3I,kBAAC,QAAD;QAAM,IAAIA,EAAE,MAAM,KAAK;QAAI,KAAKA,EAAE,MAAM,MAAMA,EAAE,MAAM,MAAM;QAAG,IAAG;QAAS,MAAK;QAAgB,UAAU;QAAI,YAAY;QAA1H,UAAA,CACGA,EAAE,OACH,kBAAC,SAAD;SAAO,MAAK;SAAyB,IAAI;SAAG,OAAO,EAAE,oBAAoB,eAAe;SACrF,UAAAU,EAAYV,EAAE,SAAS,CAAC;QACpB,CAAA,CACH;OACL,CAAA,CAAA;MARK,GAAAA,EAAE,EAQP,CACJ,EACA,CAAA;KACA;;GAEJ,CAAA;EACK,CAAA;CACT,CAAA;AAET,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAO,cAAc"}
|
|
1
|
+
{"version":3,"file":"sankey.js","names":["d3sankey","cn","useUiText","useSize","useChartKeys","seriesColors","labelWidth","ChartFrame","ChartLive","fitLabel","KAESO_SANKEY_VARIANTS","KAESO_SANKEY_DEFAULT_VARIANTS","NODE","LABEL_GAP","COLUMN_GAP","FONT","width13","text","Sankey","formatNumber","v","ariaLabel","state","t","box","size","hover","setHover","useState","gid","useId","flowing","links","l","used","shown","nodes","n","empty","palette","useMemo","seriesColor","id","layout","graph","sankey","d","height","all","last","columns","full","formatValue","room","col","withValues","need","r","a","w","values","widths","spare","total","extra","x0","left","fitted","table","order","b","quiet","keys","keyed","focus","linkPath","sankeyLinkHorizontal","lit","className","i","on","y","label","value","cut"],"sources":["../../../src/components/charts/sankey.tsx"],"sourcesContent":["import { forwardRef, useId, useMemo, useState } from \"react\";\nimport { sankey as d3sankey, sankeyLinkHorizontal, type SankeyLink, type SankeyNode } from \"d3-sankey\";\nimport { cn } from \"../../utils/cn.js\";\nimport { formatNumber } from \"../../format/index.js\";\nimport { useUiText } from \"../../i18n/context.js\";\nimport { ChartFrame, ChartLive, labelWidth, seriesColors, useChartKeys, useSize, type ChartState } from \"./core.js\";\nimport { fitLabel } from \"./domain.js\";\n\nexport const KAESO_SANKEY_VARIANTS = {\n size: { md: { classes: \"\" } },\n} as const;\nexport const KAESO_SANKEY_DEFAULT_VARIANTS = { size: \"md\" } as const;\n\nexport interface SankeyNodeIn {\n id: string;\n label: string;\n}\nexport interface SankeyLinkIn {\n source: string;\n target: string;\n value: number;\n}\n\ntype N = SankeyNode<SankeyNodeIn, SankeyLinkIn>;\ntype L = SankeyLink<SankeyNodeIn, SankeyLinkIn>;\n\nconst NODE = 8;\nconst LABEL_GAP = 8;\nconst COLUMN_GAP = 24;\nconst FONT = 13;\nconst width13 = (text: string) => labelWidth(text) * (FONT / 12);\n\nexport const Sankey = /* @__PURE__ */ forwardRef<\n HTMLDivElement,\n {\n nodes: SankeyNodeIn[];\n links: SankeyLinkIn[];\n height?: number | undefined;\n formatValue?: ((v: number) => string) | undefined;\n \"aria-label\": string;\n className?: string | undefined;\n } & ChartState\n>(function Sankey({ nodes, links, height = 320, formatValue = (v) => formatNumber(v), className, \"aria-label\": ariaLabel, ...state }, ref) {\n const t = useUiText();\n const [box, size] = useSize<HTMLDivElement>();\n const [hover, setHover] = useState<string | null>(null);\n const gid = useId().replace(/:/g, \"\");\n const flowing = links.filter((l) => Number.isFinite(l.value) && l.value > 0);\n const used = new Set(flowing.flatMap((l) => [l.source, l.target]));\n const shown = nodes.filter((n) => used.has(n.id));\n const empty = state.empty ?? flowing.length === 0;\n const palette = useMemo(() => seriesColors(nodes.map((n) => n.id)), [nodes]);\n const seriesColor = (id: string) => palette.get(id)!;\n const layout = useMemo(() => {\n if (!size.width || empty) return null;\n const graph = d3sankey<SankeyNodeIn, SankeyLinkIn>()\n .nodeId((d) => d.id)\n .nodeWidth(NODE)\n .nodePadding(16)\n .extent([\n [0, 4],\n [size.width, height - 4],\n ])({ nodes: shown.map((n) => ({ ...n })), links: flowing.map((l) => ({ ...l })) });\n const all = graph.nodes as N[];\n const last = Math.max(0, ...all.map((n) => n.depth ?? 0));\n const columns = Array.from({ length: last + 1 }, (_, d) => all.filter((n) => n.depth === d));\n const full = (n: N) => `${n.label} ${formatValue(n.value ?? 0)}`;\n const room = (withValues: boolean) => columns.map((col) => Math.max(0, ...col.map((n) => width13(withValues ? full(n) : n.label))) + LABEL_GAP);\n const need = (r: number[]) => (last + 1) * NODE + r.reduce((a, w) => a + w, 0) + Math.max(0, last - 1) * COLUMN_GAP + (last > 0 ? COLUMN_GAP : 0);\n let values = true;\n let widths = room(true);\n if (need(widths) > size.width) {\n values = false;\n widths = room(false);\n }\n const spare = size.width - need(widths);\n if (spare < 0) {\n const total = widths.reduce((a, w) => a + w, 0) || 1;\n widths = widths.map((w) => Math.max(LABEL_GAP + 24, w + (spare * w) / total));\n }\n const extra = last > 0 ? Math.max(0, spare) / last : 0;\n const x0 = columns.map(() => 0);\n for (let d = 1; d <= last; d++) {\n x0[d] = x0[d - 1]! + NODE + (d - 1 === last - 1 && last > 0 ? widths[d - 1]! + COLUMN_GAP + widths[d]! : widths[d - 1]! + COLUMN_GAP) + extra;\n }\n if (last === 0) x0[0] = 0;\n for (const n of all) {\n const d = n.depth ?? 0;\n n.x0 = Math.round(d === last && last > 0 ? Math.min(size.width - NODE, x0[d]!) : x0[d]!);\n n.x1 = n.x0 + NODE;\n }\n const placed = all.map((n) => {\n const d = n.depth ?? 0;\n const left = d === last && last > 0;\n const text = values ? full(n) : n.label;\n const fitted = fitLabel(n.label, widths[d]! - LABEL_GAP - (values ? width13(` ${formatValue(n.value ?? 0)}`) : 0), FONT);\n return { n, left, label: fitted, value: values ? formatValue(n.value ?? 0) : null, cut: fitted !== n.label || text !== full(n) };\n });\n return { graph, placed };\n }, [shown, flowing, size.width, height, empty, formatValue]);\n const table = {\n columns: [t(\"sankey.from\", \"From\"), t(\"sankey.to\", \"To\"), t(\"sankey.requests\", \"Requests\")],\n rows: flowing.map((l) => [\n nodes.find((n) => n.id === l.source)?.label ?? l.source,\n nodes.find((n) => n.id === l.target)?.label ?? l.target,\n formatValue(l.value),\n ]),\n };\n const order = (layout?.placed ?? []).slice().sort((a, b) => (a.n.depth ?? 0) - (b.n.depth ?? 0) || (a.n.y0 ?? 0) - (b.n.y0 ?? 0));\n const quiet = empty || !!state.loading || !!state.error;\n const keys = useChartKeys(quiet ? 0 : order.length, { start: 0 });\n const keyed = keys.index !== null ? order[keys.index]?.n : undefined;\n const focus = hover ?? keyed?.id ?? null;\n const linkPath = sankeyLinkHorizontal<SankeyNodeIn, SankeyLinkIn>();\n const lit = (l: L) => !focus || (l.source as N).id === focus || (l.target as N).id === focus;\n return (\n <div ref={ref} className={cn(\"w-full min-w-0\", className)}>\n <ChartFrame label={ariaLabel} height={height} table={table} state={{ ...state, empty }}>\n <div ref={box} role=\"group\" aria-label={ariaLabel} {...keys.props} className=\"absolute inset-0 rounded-cell focus-ring\">\n {layout && (\n <svg width={size.width} height={height} role=\"presentation\" className=\"block\">\n <defs>\n {(layout.graph.links as L[]).map((l, i) => (\n <linearGradient key={i} id={`${gid}-${i}`} gradientUnits=\"userSpaceOnUse\" x1={(l.source as N).x1} x2={(l.target as N).x0}>\n <stop offset=\"0%\" stopColor={seriesColor((l.source as N).id)} />\n <stop offset=\"100%\" stopColor={seriesColor((l.target as N).id)} />\n </linearGradient>\n ))}\n </defs>\n <g>\n {(layout.graph.links as L[]).map((l, i) => (\n <path\n key={i}\n d={linkPath(l) ?? \"\"}\n fill=\"none\"\n stroke={`url(#${gid}-${i})`}\n strokeOpacity={0.5}\n opacity={focus ? (lit(l) ? 1 : 0.12) : 0.48}\n strokeWidth={Math.max(1, l.width ?? 1)}\n className=\"opacity-motion\"\n >\n <title>\n {t(\"sankey.link\", \"{source} → {target}: {value}\", {\n source: (l.source as N).label,\n target: (l.target as N).label,\n value: formatValue(l.value),\n })}\n </title>\n </path>\n ))}\n </g>\n <g>\n {layout.placed.map(({ n, left, label, value, cut }) => {\n const on = keyed?.id === n.id;\n const y = ((n.y0 ?? 0) + (n.y1 ?? 0)) / 2;\n return (\n <g key={n.id} onMouseEnter={() => setHover(n.id)} onMouseLeave={() => setHover(null)} className=\"cursor-default\">\n {on && (\n <rect\n x={(n.x0 ?? 0) - 3}\n y={(n.y0 ?? 0) - 3}\n width={NODE + 6}\n height={Math.max(2, (n.y1 ?? 0) - (n.y0 ?? 0)) + 6}\n rx={6}\n fill=\"none\"\n stroke=\"var(--k-text)\"\n strokeWidth={1.5}\n />\n )}\n <rect x={n.x0} y={n.y0} width={NODE} height={Math.max(2, (n.y1 ?? 0) - (n.y0 ?? 0))} rx={4} fill={seriesColor(n.id)} />\n <text\n x={left ? (n.x0 ?? 0) - LABEL_GAP : (n.x1 ?? 0) + LABEL_GAP}\n y={y}\n dy=\"0.32em\"\n textAnchor={left ? \"end\" : \"start\"}\n fill=\"var(--k-text)\"\n fontSize={FONT}\n fontWeight={500}\n stroke=\"var(--k-bg-panel)\"\n strokeWidth={3}\n strokeLinejoin=\"round\"\n paintOrder=\"stroke\"\n >\n {label}\n {value !== null && (\n <tspan fill=\"var(--k-text-tertiary)\" dx={6} style={{ fontVariantNumeric: \"tabular-nums\" }}>\n {value}\n </tspan>\n )}\n {cut && <title>{`${n.label} ${formatValue(n.value ?? 0)}`}</title>}\n </text>\n </g>\n );\n })}\n </g>\n </svg>\n )}\n <ChartLive>{keyed ? t(\"sankey.node\", \"{node}: {value}\", { node: keyed.label, value: formatValue(keyed.value ?? 0) }) : null}</ChartLive>\n </div>\n </ChartFrame>\n </div>\n );\n});\nif (process.env.NODE_ENV !== \"production\") Sankey.displayName = \"Sankey\";\n"],"mappings":";;;;;;;;;;AAQA,IAAaU,IAAwB,EACnC,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,EAAE,EAC9B,GACaC,IAAgC,EAAE,MAAM,KAAK,GAepDC,IAAO,GACPC,IAAY,GACZC,IAAa,IACbC,IAAO,IACPC,KAAW,MAAiBV,EAAWW,CAAI,KAAKF,IAAO,KAEhDG,IAAyB,kBAUpC,SAAgB,EAAE,UAAO,UAAO,YAAS,KAAK,kBAAe,MAAMC,EAAaC,CAAC,GAAG,cAAW,cAAcC,GAAW,GAAGC,KAAS,GAAK;CACzI,IAAMC,IAAIrB,EAAU,GACd,CAACsB,GAAKC,KAAQtB,EAAwB,GACtC,CAACuB,GAAOC,KAAYC,EAAwB,IAAI,GAChDC,IAAMC,EAAM,CAAC,CAAC,QAAQ,MAAM,EAAE,GAC9BC,IAAUC,EAAM,QAAQ,MAAM,OAAO,SAASC,EAAE,KAAK,KAAKA,EAAE,QAAQ,CAAC,GACrEC,IAAO,IAAI,IAAIH,EAAQ,SAAS,MAAM,CAACE,EAAE,QAAQA,EAAE,MAAM,CAAC,CAAC,GAC3DE,IAAQC,EAAM,QAAQ,MAAMF,EAAK,IAAIG,EAAE,EAAE,CAAC,GAC1CC,IAAQhB,EAAM,SAASS,EAAQ,WAAW,GAC1CQ,IAAUC,QAAcnC,EAAa+B,EAAM,KAAK,MAAMC,EAAE,EAAE,CAAC,GAAG,CAACD,CAAK,CAAC,GACrEK,KAAe,MAAeF,EAAQ,IAAI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ACD,QAAA,IAAA,aAA6B,iBAAc,EAAO,cAAc"}
|
|
@@ -1,72 +1,88 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../../chunks/cn-
|
|
2
|
+
import { t as e } from "../../chunks/cn-BjnOAUrA.js";
|
|
3
3
|
import { forwardRef as t, useId as n } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { area as
|
|
6
|
-
import { max as
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { area as o, curveMonotoneX as s, line as c } from "d3-shape";
|
|
6
|
+
import { max as l, min as u } from "d3-array";
|
|
7
7
|
//#region src/components/charts/sparkline.tsx
|
|
8
|
-
function
|
|
8
|
+
function d(e, t, n, r) {
|
|
9
9
|
let i = t - e;
|
|
10
10
|
return (t) => {
|
|
11
11
|
let a = i ? (t - e) / i : Number.isNaN(i) ? NaN : .5;
|
|
12
12
|
return n * (1 - a) + r * a;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
var
|
|
16
|
-
let
|
|
15
|
+
var f = { size: { md: { classes: "w-80 h-24" } } }, p = { size: "md" }, m = /* @__PURE__ */ t(function({ values: t, color: f = "var(--k-viz-1)", fluid: p, className: m, "aria-label": h }, g) {
|
|
16
|
+
let _ = p ? 240 : 80, v = p ? 32 : 24, y = t.filter(Number.isFinite), b = d(0, Math.max(1, t.length - 1), 2, _ - 4), x = u(y) ?? 0, S = l(y) ?? 0, C = S === x ? () => v / 2 : d(x, S, v - 3, 3), w = c().defined(Number.isFinite).x((e, t) => b(t)).y((e) => C(e)).curve(s), T = o().defined(Number.isFinite).x((e, t) => b(t)).y0(v).y1((e) => C(e)).curve(s), E = t.findLastIndex(Number.isFinite), D = y.length === 1, O = D ? _ - 4 : b(E), k = n().replace(/:/g, "");
|
|
17
17
|
return /* @__PURE__ */ i("svg", {
|
|
18
|
-
ref:
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
21
|
-
viewBox: `0 0 ${
|
|
22
|
-
...
|
|
18
|
+
ref: g,
|
|
19
|
+
width: p ? "100%" : _,
|
|
20
|
+
height: v,
|
|
21
|
+
viewBox: `0 0 ${_} ${v}`,
|
|
22
|
+
...p ? { preserveAspectRatio: "none" } : {},
|
|
23
23
|
role: "img",
|
|
24
|
-
"aria-label":
|
|
25
|
-
className: e("block shrink-0 overflow-visible",
|
|
26
|
-
children:
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
"aria-label": h,
|
|
25
|
+
className: e("block shrink-0 overflow-visible", m),
|
|
26
|
+
children: y.length === 0 ? /* @__PURE__ */ i("line", {
|
|
27
|
+
x1: 2,
|
|
28
|
+
x2: _ - 4,
|
|
29
|
+
y1: v / 2,
|
|
30
|
+
y2: v / 2,
|
|
31
|
+
stroke: "var(--k-line-strong)",
|
|
32
|
+
strokeWidth: 1.5,
|
|
33
|
+
strokeLinecap: "round",
|
|
34
|
+
vectorEffect: "non-scaling-stroke"
|
|
35
|
+
}) : /* @__PURE__ */ a(r, { children: [
|
|
36
|
+
/* @__PURE__ */ i("defs", { children: /* @__PURE__ */ a("linearGradient", {
|
|
37
|
+
id: k,
|
|
29
38
|
x1: "0",
|
|
30
39
|
y1: "0",
|
|
31
40
|
x2: "0",
|
|
32
41
|
y2: "1",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ i("stop", {
|
|
34
43
|
offset: "0%",
|
|
35
|
-
stopColor:
|
|
44
|
+
stopColor: f,
|
|
36
45
|
className: "chart-fill-top"
|
|
37
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ i("stop", {
|
|
38
47
|
offset: "100%",
|
|
39
|
-
stopColor:
|
|
48
|
+
stopColor: f,
|
|
40
49
|
stopOpacity: 0
|
|
41
50
|
})]
|
|
42
51
|
}) }),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
d:
|
|
45
|
-
fill: `url(#${
|
|
52
|
+
!D && /* @__PURE__ */ i("path", {
|
|
53
|
+
d: T(t) ?? "",
|
|
54
|
+
fill: `url(#${k})`
|
|
46
55
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
d:
|
|
56
|
+
!D && /* @__PURE__ */ i("path", {
|
|
57
|
+
d: w(t) ?? "",
|
|
49
58
|
fill: "none",
|
|
50
|
-
stroke:
|
|
59
|
+
stroke: f,
|
|
51
60
|
strokeWidth: 1.5,
|
|
52
61
|
strokeLinejoin: "round",
|
|
53
62
|
strokeLinecap: "round",
|
|
54
63
|
vectorEffect: "non-scaling-stroke"
|
|
55
64
|
}),
|
|
56
|
-
!
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
(!p || D) && /* @__PURE__ */ a("g", {
|
|
66
|
+
"data-dot": "",
|
|
67
|
+
children: [/* @__PURE__ */ i("path", {
|
|
68
|
+
d: `M${O} ${C(t[E] ?? 0)}h0`,
|
|
69
|
+
stroke: "var(--k-bg-panel)",
|
|
70
|
+
strokeWidth: 8,
|
|
71
|
+
strokeLinecap: "round",
|
|
72
|
+
vectorEffect: "non-scaling-stroke"
|
|
73
|
+
}), /* @__PURE__ */ i("path", {
|
|
74
|
+
d: `M${O} ${C(t[E] ?? 0)}h0`,
|
|
75
|
+
stroke: f,
|
|
76
|
+
strokeWidth: 5,
|
|
77
|
+
strokeLinecap: "round",
|
|
78
|
+
vectorEffect: "non-scaling-stroke"
|
|
79
|
+
})]
|
|
64
80
|
})
|
|
65
|
-
]
|
|
81
|
+
] })
|
|
66
82
|
});
|
|
67
83
|
});
|
|
68
|
-
process.env.NODE_ENV !== "production" && (
|
|
84
|
+
process.env.NODE_ENV !== "production" && (m.displayName = "Sparkline");
|
|
69
85
|
//#endregion
|
|
70
|
-
export {
|
|
86
|
+
export { p as KAESO_SPARKLINE_DEFAULT_VARIANTS, f as KAESO_SPARKLINE_VARIANTS, m as Sparkline };
|
|
71
87
|
|
|
72
88
|
//# sourceMappingURL=sparkline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparkline.js","names":["d3min","d3max","line","d3line","area","d3area","cn","linear","span","d1","d0","t","v","r0","r1","KAESO_SPARKLINE_VARIANTS","KAESO_SPARKLINE_DEFAULT_VARIANTS","Sparkline","ariaLabel","W","fluid","H","
|
|
1
|
+
{"version":3,"file":"sparkline.js","names":["d3min","d3max","line","d3line","area","d3area","_Fragment","cn","Fragment$1","linear","span","d1","d0","t","v","r0","r1","KAESO_SPARKLINE_VARIANTS","KAESO_SPARKLINE_DEFAULT_VARIANTS","Sparkline","ariaLabel","W","fluid","H","points","values","x","lo","min","hi","max","y","line$1","line","i","curveMonotoneX","area$1","area","lastIndex","single","dotX","gid","useId","className","color"],"sources":["../../../src/components/charts/sparkline.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport { area as d3area, curveMonotoneX, line as d3line } from \"d3-shape\";\nimport { max as d3max, min as d3min } from \"d3-array\";\nimport { cn } from \"../../utils/cn.js\";\n\nfunction linear(d0: number, d1: number, r0: number, r1: number): (v: number) => number {\n const span = d1 - d0;\n return (v) => {\n const t = span ? (v - d0) / span : Number.isNaN(span) ? NaN : 0.5;\n return r0 * (1 - t) + r1 * t;\n };\n}\n\nexport const KAESO_SPARKLINE_VARIANTS = {\n size: { md: { classes: \"w-80 h-24\" } },\n} as const;\nexport const KAESO_SPARKLINE_DEFAULT_VARIANTS = { size: \"md\" } as const;\n\nexport const Sparkline = /* @__PURE__ */ forwardRef<\n SVGSVGElement,\n { values: number[]; color?: string | undefined; fluid?: boolean | undefined; \"aria-label\": string; className?: string | undefined }\n>(function Sparkline({ values, color = \"var(--k-viz-1)\", fluid, className, \"aria-label\": ariaLabel }, ref) {\n const W = fluid ? 240 : 80;\n const H = fluid ? 32 : 24;\n const points = values.filter(Number.isFinite);\n const x = linear(0, Math.max(1, values.length - 1), 2, W - 4);\n const lo = d3min(points) ?? 0;\n const hi = d3max(points) ?? 0;\n const y = hi === lo ? () => H / 2 : linear(lo, hi, H - 3, 3);\n const line = d3line<number>()\n .defined(Number.isFinite)\n .x((_, i) => x(i))\n .y((v) => y(v))\n .curve(curveMonotoneX);\n const area = d3area<number>()\n .defined(Number.isFinite)\n .x((_, i) => x(i))\n .y0(H)\n .y1((v) => y(v))\n .curve(curveMonotoneX);\n const lastIndex = values.findLastIndex(Number.isFinite);\n const single = points.length === 1;\n const dotX = single ? W - 4 : x(lastIndex);\n const gid = useId().replace(/:/g, \"\");\n return (\n <svg\n ref={ref}\n width={fluid ? \"100%\" : W}\n height={H}\n viewBox={`0 0 ${W} ${H}`}\n {...(fluid ? { preserveAspectRatio: \"none\" } : {})}\n role=\"img\"\n aria-label={ariaLabel}\n className={cn(\"block shrink-0 overflow-visible\", className)}\n >\n {points.length === 0 ? (\n <line x1={2} x2={W - 4} y1={H / 2} y2={H / 2} stroke=\"var(--k-line-strong)\" strokeWidth={1.5} strokeLinecap=\"round\" vectorEffect=\"non-scaling-stroke\" />\n ) : (\n <>\n <defs>\n <linearGradient id={gid} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={color} className=\"chart-fill-top\" />\n <stop offset=\"100%\" stopColor={color} stopOpacity={0} />\n </linearGradient>\n </defs>\n {!single && <path d={area(values) ?? \"\"} fill={`url(#${gid})`} />}\n {!single && (\n <path\n d={line(values) ?? \"\"}\n fill=\"none\"\n stroke={color}\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n vectorEffect=\"non-scaling-stroke\"\n />\n )}\n {(!fluid || single) && (\n <g data-dot=\"\">\n <path\n d={`M${dotX} ${y(values[lastIndex] ?? 0)}h0`}\n stroke=\"var(--k-bg-panel)\"\n strokeWidth={8}\n strokeLinecap=\"round\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <path d={`M${dotX} ${y(values[lastIndex] ?? 0)}h0`} stroke={color} strokeWidth={5} strokeLinecap=\"round\" vectorEffect=\"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CACE,kBAAC,QAAD;KACE,GAAG,IAAIC,EAAK,GAAGT,EAAEN,EAAOa,MAAc,CAAC,EAAE;KACzC,QAAO;KACP,aAAa;KACb,eAAc;KACd,cAAa;IACd,CAAA,GACD,kBAAC,QAAD;KAAM,GAAG,IAAIE,EAAK,GAAGT,EAAEN,EAAOa,MAAc,CAAC,EAAE;KAAK,QAAQM;KAAO,aAAa;KAAG,eAAc;KAAQ,cAAa;IAAsB,CAAA,CAC3I;;EAEL,EAAA,CAAA;CAED,CAAA;AAET,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAU,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { t as KAESO_TIMESERIES_CHART_DEFAULT_VARIANTS, n as KAESO_TIMESERIES_CHART_VARIANTS, r as TimeseriesChart } from "../../chunks/timeseries-
|
|
2
|
+
export { t as KAESO_TIMESERIES_CHART_DEFAULT_VARIANTS, n as KAESO_TIMESERIES_CHART_VARIANTS, r as TimeseriesChart } from "../../chunks/timeseries-Ck-q0wWn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { KAESO_SPARKLINE_DEFAULT_VARIANTS as e, KAESO_SPARKLINE_VARIANTS as t, Sparkline as n } from "./charts/sparkline.js";
|
|
3
|
-
import { A as r, C as i, D as a, E as o, O as s, S as c, T as l, _ as u, a as d, b as f, c as p, d as m, f as h, g, h as _, i as v, j as y, k as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A, w as j, x as M, y as N } from "../chunks/core-
|
|
4
|
-
import { n as P, r as F, t as I } from "../chunks/timeseries-
|
|
3
|
+
import { A as r, C as i, D as a, E as o, O as s, S as c, T as l, _ as u, a as d, b as f, c as p, d as m, f as h, g, h as _, i as v, j as y, k as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A, w as j, x as M, y as N } from "../chunks/core-CmK-8ObW.js";
|
|
4
|
+
import { n as P, r as F, t as I } from "../chunks/timeseries-Ck-q0wWn.js";
|
|
5
5
|
import { BarChart as L, KAESO_BAR_CHART_DEFAULT_VARIANTS as R, KAESO_BAR_CHART_VARIANTS as z } from "./charts/bar.js";
|
|
6
6
|
import { Donut as B, KAESO_DONUT_DEFAULT_VARIANTS as V, KAESO_DONUT_VARIANTS as H, KAESO_SHARE_BAR_DEFAULT_VARIANTS as U, KAESO_SHARE_BAR_VARIANTS as W, Ring as G, ShareBar as K, groupSmall as q, shareLabel as J, wholeShares as Y } from "./charts/donut.js";
|
|
7
7
|
import { Heatmap as X, KAESO_HEATMAP_DEFAULT_VARIANTS as Z, KAESO_HEATMAP_VARIANTS as Q } from "./charts/heatmap.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { t as Checkbox, n as CheckboxBox, r as CheckboxGroup, i as KAESO_CHECKBOX_DEFAULT_VARIANTS, a as KAESO_CHECKBOX_GROUP_DEFAULT_VARIANTS, o as KAESO_CHECKBOX_GROUP_VARIANTS, s as KAESO_CHECKBOX_VARIANTS } from "../chunks/checkbox-
|
|
2
|
+
export { t as Checkbox, n as CheckboxBox, r as CheckboxGroup, i as KAESO_CHECKBOX_DEFAULT_VARIANTS, a as KAESO_CHECKBOX_GROUP_DEFAULT_VARIANTS, o as KAESO_CHECKBOX_GROUP_VARIANTS, s as KAESO_CHECKBOX_VARIANTS } from "../chunks/checkbox-9tbimmF3.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { n as s, r as c, t as l } from "../chunks/json-view-
|
|
4
|
-
|
|
2
|
+
import { c as e, i as t, l as n, n as r, r as i, s as a, t as o } from "../chunks/code-block-64e-Cy1S.js";
|
|
3
|
+
import { n as s, r as c, t as l } from "../chunks/json-view-DZ2nL2Ir.js";
|
|
4
|
+
import { n as u, r as d, t as f } from "../chunks/code-block-KIvuE8jg.js";
|
|
5
|
+
export { a as CODE_LANGS, o as CodeBlock, r as CodeHighlighted, f as DiffView, l as JsonView, i as KAESO_CODE_BLOCK_DEFAULT_VARIANTS, t as KAESO_CODE_BLOCK_VARIANTS, u as KAESO_DIFF_VIEW_DEFAULT_VARIANTS, d as KAESO_DIFF_VIEW_VARIANTS, s as KAESO_JSON_VIEW_DEFAULT_VARIANTS, c as KAESO_JSON_VIEW_VARIANTS, e as highlight, n as kaesoShikiTheme };
|
package/dist/components/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { t as Code, n as KAESO_CODE_DEFAULT_VARIANTS, r as KAESO_CODE_VARIANTS } from "../chunks/code-
|
|
2
|
+
export { t as Code, n as KAESO_CODE_DEFAULT_VARIANTS, r as KAESO_CODE_VARIANTS } from "../chunks/code-xqjww4Pv.js";
|
|
@@ -1,2 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { t as e } from "../chunks/cn-BjnOAUrA.js";
|
|
3
|
+
import { n as t, t as n } from "../chunks/disclosure-BtYRTDO3.js";
|
|
4
|
+
import { forwardRef as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Collapsible as o } from "@base-ui/react/collapsible";
|
|
7
|
+
import { Accordion as s } from "@base-ui/react/accordion";
|
|
8
|
+
//#region src/components/collapsible/collapsible.tsx
|
|
9
|
+
var c = { state: {
|
|
10
|
+
closed: { classes: "" },
|
|
11
|
+
open: { classes: "group-data-panel-open/dt:rotate-90" }
|
|
12
|
+
} }, l = { state: "closed" }, u = `${n} min-h-40 py-8 text-body font-medium text-fg hover:bg-fill-1 active:bg-fill-2 coarse:min-h-44`, d = /* @__PURE__ */ r(function({ title: n, children: r, open: s, defaultOpen: c, onOpenChange: l, hint: d, className: f }, p) {
|
|
13
|
+
return /* @__PURE__ */ a(o.Root, {
|
|
14
|
+
ref: p,
|
|
15
|
+
...s === void 0 ? {} : { open: s },
|
|
16
|
+
...c === void 0 ? {} : { defaultOpen: c },
|
|
17
|
+
...l ? { onOpenChange: (e) => l(e) } : {},
|
|
18
|
+
className: e("flex flex-col", f),
|
|
19
|
+
children: [/* @__PURE__ */ a(o.Trigger, {
|
|
20
|
+
className: u,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ i("span", {
|
|
23
|
+
className: "min-w-0 flex-1",
|
|
24
|
+
children: n
|
|
25
|
+
}),
|
|
26
|
+
d && /* @__PURE__ */ i("span", {
|
|
27
|
+
className: "text-small font-regular text-fg-secondary",
|
|
28
|
+
children: d
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ i(t, {})
|
|
31
|
+
]
|
|
32
|
+
}), /* @__PURE__ */ i(o.Panel, {
|
|
33
|
+
className: "collapse-motion",
|
|
34
|
+
children: /* @__PURE__ */ i("div", {
|
|
35
|
+
className: "px-12 pt-4 pb-12",
|
|
36
|
+
children: r
|
|
37
|
+
})
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
process.env.NODE_ENV !== "production" && (d.displayName = "Collapsible");
|
|
42
|
+
var f = /* @__PURE__ */ r(function({ items: n, multiple: r = !1, defaultValue: o, className: c }, l) {
|
|
43
|
+
return /* @__PURE__ */ i(s.Root, {
|
|
44
|
+
ref: l,
|
|
45
|
+
...r ? { multiple: !0 } : {},
|
|
46
|
+
...o ? { defaultValue: o } : {},
|
|
47
|
+
className: e("flex flex-col", c),
|
|
48
|
+
children: n.map((e) => /* @__PURE__ */ a(s.Item, {
|
|
49
|
+
value: e.value,
|
|
50
|
+
className: "py-4 hairline-b",
|
|
51
|
+
children: [/* @__PURE__ */ i(s.Header, { children: /* @__PURE__ */ a(s.Trigger, {
|
|
52
|
+
className: u,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ i("span", {
|
|
55
|
+
className: "min-w-0 flex-1",
|
|
56
|
+
children: e.title
|
|
57
|
+
}),
|
|
58
|
+
e.hint && /* @__PURE__ */ i("span", {
|
|
59
|
+
className: "text-small font-regular text-fg-secondary",
|
|
60
|
+
children: e.hint
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ i(t, {})
|
|
63
|
+
]
|
|
64
|
+
}) }), /* @__PURE__ */ i(s.Panel, {
|
|
65
|
+
className: "collapse-motion",
|
|
66
|
+
children: /* @__PURE__ */ i("div", {
|
|
67
|
+
className: "px-12 pt-4 pb-12 text-body text-fg-secondary",
|
|
68
|
+
children: e.content
|
|
69
|
+
})
|
|
70
|
+
})]
|
|
71
|
+
}, e.value))
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
process.env.NODE_ENV !== "production" && (f.displayName = "Accordion");
|
|
75
|
+
//#endregion
|
|
76
|
+
export { f as Accordion, d as Collapsible, l as KAESO_COLLAPSIBLE_DEFAULT_VARIANTS, c as KAESO_COLLAPSIBLE_VARIANTS };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=collapsible.js.map
|