@devalok/shilp-sutra 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/_chunks/badge-group.js +306 -246
- package/dist/_chunks/badge-group.js.map +1 -0
- package/dist/_chunks/chat.js +518 -0
- package/dist/_chunks/chat.js.map +1 -0
- package/dist/_chunks/date-picker.js +748 -0
- package/dist/_chunks/date-picker.js.map +1 -0
- package/dist/_chunks/document-preview.js +109 -90
- package/dist/_chunks/document-preview.js.map +1 -0
- package/dist/_chunks/file-preview.js +492 -504
- package/dist/_chunks/file-preview.js.map +1 -0
- package/dist/_chunks/framer.js +5564 -5613
- package/dist/_chunks/framer.js.map +1 -0
- package/dist/_chunks/image-preview.js +127 -88
- package/dist/_chunks/image-preview.js.map +1 -0
- package/dist/_chunks/keybinding.js +12 -14
- package/dist/_chunks/keybinding.js.map +1 -0
- package/dist/_chunks/link-context.js +19 -16
- package/dist/_chunks/link-context.js.map +1 -0
- package/dist/_chunks/mention-suggestion.js +353 -350
- package/dist/_chunks/mention-suggestion.js.map +1 -0
- package/dist/_chunks/motion-provider.js +26 -20
- package/dist/_chunks/motion-provider.js.map +1 -0
- package/dist/_chunks/popover.js +123 -0
- package/dist/_chunks/popover.js.map +1 -0
- package/dist/_chunks/primitives.js +7585 -6426
- package/dist/_chunks/primitives.js.map +1 -0
- package/dist/_chunks/rich-chat-input.js +2071 -0
- package/dist/_chunks/rich-chat-input.js.map +1 -0
- package/dist/_chunks/rolldown-runtime.js +21 -0
- package/dist/_chunks/shared.js +126 -0
- package/dist/_chunks/shared.js.map +1 -0
- package/dist/_chunks/sonner.js +605 -734
- package/dist/_chunks/sonner.js.map +1 -0
- package/dist/_chunks/stat-row.js +418 -440
- package/dist/_chunks/stat-row.js.map +1 -0
- package/dist/_chunks/tiptap.js +15850 -19964
- package/dist/_chunks/tiptap.js.map +1 -0
- package/dist/_chunks/tree-view.js +231 -290
- package/dist/_chunks/tree-view.js.map +1 -0
- package/dist/_chunks/use-calendar.js +161 -208
- package/dist/_chunks/use-calendar.js.map +1 -0
- package/dist/_chunks/vendor-client.js +314 -2199
- package/dist/_chunks/vendor-client.js.map +1 -0
- package/dist/_chunks/vendor-utils.js +1721 -2978
- package/dist/_chunks/vendor-utils.js.map +1 -0
- package/dist/ai/ai-command-provider.js +23 -17
- package/dist/ai/ai-command-provider.js.map +1 -0
- package/dist/ai/block-renderer.js +68 -51
- package/dist/ai/block-renderer.js.map +1 -0
- package/dist/ai/blocks/index.js +2 -12
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/command-bar.js +470 -519
- package/dist/ai/command-bar.js.map +1 -0
- package/dist/ai/conversation.js +241 -227
- package/dist/ai/conversation.js.map +1 -0
- package/dist/ai/devadoot-icon.d.ts.map +1 -1
- package/dist/ai/index.js +181 -167
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/types.js +0 -1
- package/dist/composed/activity-feed.js +232 -202
- package/dist/composed/activity-feed.js.map +1 -0
- package/dist/composed/avatar-group.js +164 -222
- package/dist/composed/avatar-group.js.map +1 -0
- package/dist/composed/bulk-action-bar.js +166 -165
- package/dist/composed/bulk-action-bar.js.map +1 -0
- package/dist/composed/command-palette.js +290 -308
- package/dist/composed/command-palette.js.map +1 -0
- package/dist/composed/confirm-dialog.js +28 -48
- package/dist/composed/confirm-dialog.js.map +1 -0
- package/dist/composed/content-card.js +69 -108
- package/dist/composed/content-card.js.map +1 -0
- package/dist/composed/date-picker/index.js +3 -13
- package/dist/composed/deadline-indicator.js +68 -74
- package/dist/composed/deadline-indicator.js.map +1 -0
- package/dist/composed/emoji-picker.js +83 -110
- package/dist/composed/emoji-picker.js.map +1 -0
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +64 -103
- package/dist/composed/empty-state.js.map +1 -0
- package/dist/composed/error-boundary.js +129 -127
- package/dist/composed/error-boundary.js.map +1 -0
- package/dist/composed/file-preview.js +2 -12
- package/dist/composed/filter-bar.js +98 -130
- package/dist/composed/filter-bar.js.map +1 -0
- package/dist/composed/form-section.js +61 -45
- package/dist/composed/form-section.js.map +1 -0
- package/dist/composed/global-loading.js +34 -47
- package/dist/composed/global-loading.js.map +1 -0
- package/dist/composed/index.js +34 -92
- package/dist/composed/inline-edit.js +92 -107
- package/dist/composed/inline-edit.js.map +1 -0
- package/dist/composed/lib/string-utils.js +8 -8
- package/dist/composed/lib/string-utils.js.map +1 -0
- package/dist/composed/loading-skeleton.js +103 -171
- package/dist/composed/loading-skeleton.js.map +1 -0
- package/dist/composed/markdown-viewer.js +187 -139
- package/dist/composed/markdown-viewer.js.map +1 -0
- package/dist/composed/master-detail.js +147 -156
- package/dist/composed/master-detail.js.map +1 -0
- package/dist/composed/member-picker.js +46 -49
- package/dist/composed/member-picker.js.map +1 -0
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +185 -179
- package/dist/composed/multi-select-popover.js.map +1 -0
- package/dist/composed/page-header.js +54 -76
- package/dist/composed/page-header.js.map +1 -0
- package/dist/composed/page-skeletons.js +143 -127
- package/dist/composed/page-skeletons.js.map +1 -0
- package/dist/composed/priority-indicator.js +105 -111
- package/dist/composed/priority-indicator.js.map +1 -0
- package/dist/composed/responsive-overlay.js +36 -41
- package/dist/composed/responsive-overlay.js.map +1 -0
- package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +2 -1860
- package/dist/composed/rich-text-editor.js +561 -424
- package/dist/composed/rich-text-editor.js.map +1 -0
- package/dist/composed/schedule-view.js +134 -185
- package/dist/composed/schedule-view.js.map +1 -0
- package/dist/composed/simple-tooltip.js +21 -21
- package/dist/composed/simple-tooltip.js.map +1 -0
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +133 -137
- package/dist/composed/status-badge.js.map +1 -0
- package/dist/hooks/index.js +7 -12
- package/dist/hooks/use-color-mode.js +28 -25
- package/dist/hooks/use-color-mode.js.map +1 -0
- package/dist/hooks/use-mobile.js +13 -13
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-toast.js +2 -4
- package/dist/hooks/use-touch-device.js +9 -11
- package/dist/hooks/use-touch-device.js.map +1 -0
- package/dist/hooks/use-viewport-height.js +14 -14
- package/dist/hooks/use-viewport-height.js.map +1 -0
- package/dist/motion/check-motion-provider.d.ts +3 -0
- package/dist/motion/check-motion-provider.d.ts.map +1 -0
- package/dist/motion/index.js +17 -11
- package/dist/motion/index.js.map +1 -0
- package/dist/motion/primitives-index.js +226 -186
- package/dist/motion/primitives-index.js.map +1 -0
- package/dist/primitives/react-accordion.d.ts +114 -114
- package/dist/primitives/react-alert-dialog.d.ts +51 -51
- package/dist/primitives/react-aspect-ratio.d.ts +11 -11
- package/dist/primitives/react-avatar.d.ts +24 -24
- package/dist/primitives/react-checkbox.d.ts +50 -50
- package/dist/primitives/react-collapsible.d.ts +33 -33
- package/dist/primitives/react-context-menu.d.ts +96 -96
- package/dist/primitives/react-dialog.d.ts +103 -103
- package/dist/primitives/react-dropdown-menu.d.ts +97 -97
- package/dist/primitives/react-hover-card.d.ts +79 -79
- package/dist/primitives/react-label.d.ts +10 -10
- package/dist/primitives/react-menu.d.ts +169 -169
- package/dist/primitives/react-menubar.d.ts +115 -115
- package/dist/primitives/react-navigation-menu.d.ts +126 -126
- package/dist/primitives/react-popover.d.ts +85 -85
- package/dist/primitives/react-progress.d.ts +19 -19
- package/dist/primitives/react-radio-group.d.ts +58 -58
- package/dist/primitives/react-roving-focus.d.ts +49 -49
- package/dist/primitives/react-select.d.ts +137 -137
- package/dist/primitives/react-separator.d.ts +21 -21
- package/dist/primitives/react-slider.d.ts +75 -75
- package/dist/primitives/react-switch.d.ts +21 -21
- package/dist/primitives/react-tabs.d.ts +56 -56
- package/dist/primitives/react-toast.d.ts +120 -120
- package/dist/primitives/react-toggle-group.d.ts +75 -75
- package/dist/primitives/react-toggle.d.ts +24 -24
- package/dist/primitives/react-tooltip.d.ts +101 -101
- package/dist/primitives/react-visually-hidden.d.ts +22 -22
- package/dist/shell/app-command-palette.d.ts +2 -0
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js +94 -238
- package/dist/shell/app-command-palette.js.map +1 -0
- package/dist/shell/bottom-navbar.js +150 -190
- package/dist/shell/bottom-navbar.js.map +1 -0
- package/dist/shell/command-registry.js +13 -14
- package/dist/shell/command-registry.js.map +1 -0
- package/dist/shell/index.js +10 -20
- package/dist/shell/link-context.js +2 -5
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +263 -259
- package/dist/shell/notification-center.js.map +1 -0
- package/dist/shell/notification-preferences.js +241 -184
- package/dist/shell/notification-preferences.js.map +1 -0
- package/dist/shell/sidebar.js +251 -281
- package/dist/shell/sidebar.js.map +1 -0
- package/dist/shell/top-bar.js +203 -237
- package/dist/shell/top-bar.js.map +1 -0
- package/dist/tailwind/index.cjs +473 -442
- package/dist/tailwind/index.js +2 -4
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +490 -459
- package/dist/tailwind/preset.js.map +1 -0
- package/dist/tokens/index.css +4 -4
- package/dist/tokens/primitives.css +442 -442
- package/dist/tokens/semantic.css +742 -547
- package/dist/tokens/typography-semantic.css +123 -100
- package/dist/tokens/typography.css +422 -422
- package/dist/ui/accordion.js +52 -60
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +6 -2
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +112 -156
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +3 -2
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +203 -99
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/aspect-ratio.js +13 -16
- package/dist/ui/aspect-ratio.js.map +1 -0
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +137 -148
- package/dist/ui/autocomplete.js.map +1 -0
- package/dist/ui/avatar.js +196 -169
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge-group.js +2 -7
- package/dist/ui/badge-indicator.js +42 -51
- package/dist/ui/badge-indicator.js.map +1 -0
- package/dist/ui/badge.js +2 -15
- package/dist/ui/banner.js +76 -68
- package/dist/ui/banner.js.map +1 -0
- package/dist/ui/breadcrumb.js +65 -84
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button-group.js +109 -102
- package/dist/ui/button-group.js.map +1 -0
- package/dist/ui/button-processing.d.ts.map +1 -1
- package/dist/ui/button-processing.js +89 -72
- package/dist/ui/button-processing.js.map +1 -0
- package/dist/ui/button.js +393 -279
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.js +151 -157
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -0
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/index.js +1025 -1319
- package/dist/ui/charts/index.js.map +1 -0
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/chat/index.js +2 -11
- package/dist/ui/chat/message-input.d.ts.map +1 -1
- package/dist/ui/chat/message-list.d.ts +1 -1
- package/dist/ui/chat/message-list.d.ts.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/chat/system-message.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +82 -100
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/code.js +18 -32
- package/dist/ui/code.js.map +1 -0
- package/dist/ui/collapsible.js +21 -29
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +455 -372
- package/dist/ui/color-input.js.map +1 -0
- package/dist/ui/color-swatch.js +60 -90
- package/dist/ui/color-swatch.js.map +1 -0
- package/dist/ui/combobox.d.ts +7 -0
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +278 -293
- package/dist/ui/combobox.js.map +1 -0
- package/dist/ui/container.js +18 -24
- package/dist/ui/container.js.map +1 -0
- package/dist/ui/context-menu.js +154 -203
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/data-table-body.js +116 -213
- package/dist/ui/data-table-body.js.map +1 -0
- package/dist/ui/data-table-bulk-actions.js +43 -59
- package/dist/ui/data-table-bulk-actions.js.map +1 -0
- package/dist/ui/data-table-card.js +84 -71
- package/dist/ui/data-table-card.js.map +1 -0
- package/dist/ui/data-table-context.js +39 -42
- package/dist/ui/data-table-context.js.map +1 -0
- package/dist/ui/data-table-header.js +98 -139
- package/dist/ui/data-table-header.js.map +1 -0
- package/dist/ui/data-table-pagination.js +69 -82
- package/dist/ui/data-table-pagination.js.map +1 -0
- package/dist/ui/data-table-toolbar.js +104 -130
- package/dist/ui/data-table-toolbar.js.map +1 -0
- package/dist/ui/data-table.js +281 -354
- package/dist/ui/data-table.js.map +1 -0
- package/dist/ui/devalok-grain.js +77 -66
- package/dist/ui/devalok-grain.js.map +1 -0
- package/dist/ui/dialog.js +118 -151
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dropdown-menu.js +152 -203
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/file-upload.js +242 -266
- package/dist/ui/file-upload.js.map +1 -0
- package/dist/ui/form.d.ts +8 -0
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +62 -56
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/hover-card.js +54 -54
- package/dist/ui/hover-card.js.map +1 -0
- package/dist/ui/icon-button.js +21 -26
- package/dist/ui/icon-button.js.map +1 -0
- package/dist/ui/icon-context.js +17 -17
- package/dist/ui/icon-context.js.map +1 -0
- package/dist/ui/icon-group.js +22 -29
- package/dist/ui/icon-group.js.map +1 -0
- package/dist/ui/icon.js +201 -121
- package/dist/ui/icon.js.map +1 -0
- package/dist/ui/index.d.ts +4 -4
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +90 -350
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input-otp.d.ts +12 -3
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +58 -48
- package/dist/ui/input-otp.js.map +1 -0
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +93 -169
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js +23 -23
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/lib/check-tokens.d.ts +3 -0
- package/dist/ui/lib/check-tokens.d.ts.map +1 -0
- package/dist/ui/lib/date-utils.js +14 -11
- package/dist/ui/lib/date-utils.js.map +1 -0
- package/dist/ui/lib/motion.d.ts +15 -4
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/motion.js +83 -33
- package/dist/ui/lib/motion.js.map +1 -0
- package/dist/ui/lib/utils.js +39 -16
- package/dist/ui/lib/utils.js.map +1 -0
- package/dist/ui/link.js +13 -24
- package/dist/ui/link.js.map +1 -0
- package/dist/ui/menubar.js +132 -210
- package/dist/ui/menubar.js.map +1 -0
- package/dist/ui/navigation-menu.js +163 -193
- package/dist/ui/navigation-menu.js.map +1 -0
- package/dist/ui/number-input.d.ts +16 -1
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +102 -95
- package/dist/ui/number-input.js.map +1 -0
- package/dist/ui/pagination.js +122 -159
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/popover.js +2 -131
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +133 -143
- package/dist/ui/progress-ring.js.map +1 -0
- package/dist/ui/progress.js +51 -95
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +47 -49
- package/dist/ui/radio.js.map +1 -0
- package/dist/ui/search-input.js +51 -53
- package/dist/ui/search-input.js.map +1 -0
- package/dist/ui/segmented-control.d.ts +1 -1
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +95 -114
- package/dist/ui/segmented-control.js.map +1 -0
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +137 -157
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +18 -25
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.js +135 -163
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.js +357 -600
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.js +179 -231
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.d.ts +22 -3
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +62 -34
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/spinner.js +226 -205
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +228 -276
- package/dist/ui/split-button.js.map +1 -0
- package/dist/ui/stack.js +56 -70
- package/dist/ui/stack.js.map +1 -0
- package/dist/ui/stat-card.js +259 -251
- package/dist/ui/stat-card.js.map +1 -0
- package/dist/ui/status-dot.js +67 -63
- package/dist/ui/status-dot.js.map +1 -0
- package/dist/ui/stepper.d.ts +10 -0
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +124 -168
- package/dist/ui/stepper.js.map +1 -0
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +56 -55
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.js +57 -90
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +3 -1
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +159 -156
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/text.d.ts +1 -1
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/text.js +60 -59
- package/dist/ui/text.js.map +1 -0
- package/dist/ui/textarea.js +40 -57
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toast-registry.d.ts +8 -0
- package/dist/ui/toast-registry.d.ts.map +1 -0
- package/dist/ui/toast-registry.js +13 -0
- package/dist/ui/toast-registry.js.map +1 -0
- package/dist/ui/toast-types.js +0 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +559 -536
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toaster.d.ts.map +1 -1
- package/dist/ui/toaster.js +24 -33
- package/dist/ui/toaster.js.map +1 -0
- package/dist/ui/toggle-group.d.ts +2 -0
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js +44 -41
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.d.ts +2 -0
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +44 -40
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.js +80 -65
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/tree-view/index.js +2 -6
- package/dist/ui/visually-hidden.js +12 -10
- package/dist/ui/visually-hidden.js.map +1 -0
- package/docs/components/_header.md +85 -85
- package/docs/components/composed/activity-feed.md +62 -62
- package/docs/components/composed/avatar-group.md +65 -65
- package/docs/components/composed/bulk-action-bar.md +40 -40
- package/docs/components/composed/command-palette.md +40 -40
- package/docs/components/composed/confirm-dialog.md +46 -46
- package/docs/components/composed/content-card.md +36 -36
- package/docs/components/composed/date-picker.md +130 -130
- package/docs/components/composed/deadline-indicator.md +27 -27
- package/docs/components/composed/emoji-picker.md +52 -52
- package/docs/components/composed/empty-state.md +53 -53
- package/docs/components/composed/error-boundary.md +29 -29
- package/docs/components/composed/file-preview.md +40 -40
- package/docs/components/composed/filter-bar.md +57 -57
- package/docs/components/composed/form-section.md +31 -31
- package/docs/components/composed/global-loading.md +27 -27
- package/docs/components/composed/inline-edit.md +35 -35
- package/docs/components/composed/loading-skeleton.md +51 -51
- package/docs/components/composed/markdown-viewer.md +27 -27
- package/docs/components/composed/master-detail.md +48 -48
- package/docs/components/composed/member-picker.md +35 -35
- package/docs/components/composed/multi-select-popover.md +62 -62
- package/docs/components/composed/page-header.md +41 -41
- package/docs/components/composed/page-skeletons.md +32 -32
- package/docs/components/composed/priority-indicator.md +32 -32
- package/docs/components/composed/responsive-overlay.md +34 -34
- package/docs/components/composed/rich-text-editor.md +82 -82
- package/docs/components/composed/schedule-view.md +39 -39
- package/docs/components/composed/simple-tooltip.md +33 -33
- package/docs/components/composed/status-badge.md +55 -55
- package/docs/components/shell/app-command-palette.md +44 -44
- package/docs/components/shell/bottom-navbar.md +52 -52
- package/docs/components/shell/command-registry.md +48 -48
- package/docs/components/shell/link-context.md +41 -41
- package/docs/components/shell/notification-center.md +63 -63
- package/docs/components/shell/notification-preferences.md +42 -42
- package/docs/components/shell/sidebar.md +92 -92
- package/docs/components/shell/top-bar.md +143 -143
- package/docs/components/ui/accordion.md +51 -51
- package/docs/components/ui/alert-dialog.md +61 -61
- package/docs/components/ui/alert.md +46 -46
- package/docs/components/ui/aspect-ratio.md +25 -25
- package/docs/components/ui/autocomplete.md +48 -48
- package/docs/components/ui/avatar.md +56 -56
- package/docs/components/ui/badge.md +83 -82
- package/docs/components/ui/banner.md +42 -42
- package/docs/components/ui/breadcrumb.md +37 -37
- package/docs/components/ui/button-group.md +41 -41
- package/docs/components/ui/button.md +94 -93
- package/docs/components/ui/card.md +52 -52
- package/docs/components/ui/charts.md +43 -43
- package/docs/components/ui/checkbox.md +36 -36
- package/docs/components/ui/chip.md +47 -47
- package/docs/components/ui/code.md +28 -28
- package/docs/components/ui/collapsible.md +40 -40
- package/docs/components/ui/color-input.md +91 -91
- package/docs/components/ui/color-swatch.md +25 -25
- package/docs/components/ui/combobox.md +54 -54
- package/docs/components/ui/container.md +26 -26
- package/docs/components/ui/context-menu.md +43 -43
- package/docs/components/ui/data-table-body.md +1 -1
- package/docs/components/ui/data-table-bulk-actions.md +1 -1
- package/docs/components/ui/data-table-card.md +1 -1
- package/docs/components/ui/data-table-context.md +1 -1
- package/docs/components/ui/data-table-header.md +1 -1
- package/docs/components/ui/data-table-pagination.md +1 -1
- package/docs/components/ui/data-table-toolbar.md +44 -44
- package/docs/components/ui/data-table.md +94 -94
- package/docs/components/ui/dialog.md +54 -54
- package/docs/components/ui/dropdown-menu.md +48 -48
- package/docs/components/ui/file-upload.md +41 -41
- package/docs/components/ui/form.md +51 -51
- package/docs/components/ui/hover-card.md +32 -32
- package/docs/components/ui/icon-button.md +40 -40
- package/docs/components/ui/input-otp.md +44 -44
- package/docs/components/ui/input.md +74 -74
- package/docs/components/ui/label.md +25 -25
- package/docs/components/ui/link.md +29 -29
- package/docs/components/ui/menubar.md +44 -44
- package/docs/components/ui/navigation-menu.md +46 -46
- package/docs/components/ui/number-input.md +44 -44
- package/docs/components/ui/pagination.md +48 -48
- package/docs/components/ui/popover.md +30 -30
- package/docs/components/ui/progress-ring.md +41 -41
- package/docs/components/ui/progress.md +34 -34
- package/docs/components/ui/radio.md +34 -34
- package/docs/components/ui/search-input.md +43 -43
- package/docs/components/ui/segmented-control.md +50 -50
- package/docs/components/ui/select.md +53 -53
- package/docs/components/ui/separator.md +32 -32
- package/docs/components/ui/sheet.md +47 -47
- package/docs/components/ui/sidebar.md +72 -72
- package/docs/components/ui/skeleton.md +77 -77
- package/docs/components/ui/slider.md +29 -29
- package/docs/components/ui/spinner.md +54 -54
- package/docs/components/ui/stack.md +39 -39
- package/docs/components/ui/stat-card.md +61 -61
- package/docs/components/ui/status-dot.md +26 -26
- package/docs/components/ui/stepper.md +49 -49
- package/docs/components/ui/switch.md +47 -47
- package/docs/components/ui/table.md +47 -47
- package/docs/components/ui/tabs.md +60 -60
- package/docs/components/ui/text.md +37 -37
- package/docs/components/ui/textarea.md +39 -39
- package/docs/components/ui/toast.md +65 -65
- package/docs/components/ui/toaster.md +47 -47
- package/docs/components/ui/toggle-group.md +43 -43
- package/docs/components/ui/toggle.md +37 -37
- package/docs/components/ui/tooltip.md +38 -38
- package/docs/components/ui/tree-view.md +65 -65
- package/docs/components/ui/visually-hidden.md +21 -21
- package/llms-full.txt +5266 -5264
- package/llms.txt +624 -580
- package/package.json +7 -8
- package/dist/_chunks/date-time-picker.js +0 -851
- package/dist/_chunks/typing-indicator.js +0 -565
package/dist/ui/charts/index.js
CHANGED
|
@@ -1,1330 +1,1036 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
2
|
+
import { a as e } from "../../_chunks/framer.js";
|
|
3
|
+
import { motionProps as t, tweens as n } from "../lib/motion.js";
|
|
4
|
+
import { cn as r } from "../lib/utils.js";
|
|
5
|
+
import { n as i } from "../../_chunks/motion-provider.js";
|
|
6
|
+
import * as a from "react";
|
|
7
|
+
import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
8
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import { scaleBand as p, scaleLinear as m, scalePoint as h } from "d3-scale";
|
|
10
|
+
import { axisBottom as g, axisLeft as _, axisRight as v, axisTop as y } from "d3-axis";
|
|
11
|
+
import { select as b } from "d3-selection";
|
|
12
|
+
import { arc as x, area as S, curveLinear as C, curveLinearClosed as w, curveMonotoneX as T, line as E, lineRadial as D, pie as O, stack as k, stackOffsetNone as A, stackOrderNone as j } from "d3-shape";
|
|
13
|
+
//#region src/ui/charts/_internal/types.ts
|
|
14
|
+
var M = {
|
|
15
|
+
top: 20,
|
|
16
|
+
right: 20,
|
|
17
|
+
bottom: 40,
|
|
18
|
+
left: 50
|
|
19
|
+
}, N = a.forwardRef(({ height: e = 300, margin: t, className: n, ariaLabel: i = "Chart", ariaDescription: a, children: o, ...u }, p) => {
|
|
20
|
+
let m = c(null), [h, g] = l(0), _ = {
|
|
21
|
+
...M,
|
|
22
|
+
...t
|
|
23
|
+
};
|
|
24
|
+
s(() => {
|
|
25
|
+
if (!m.current) return;
|
|
26
|
+
let e = new ResizeObserver((e) => {
|
|
27
|
+
let t = e[0];
|
|
28
|
+
t && g(t.contentRect.width);
|
|
29
|
+
});
|
|
30
|
+
return e.observe(m.current), () => e.disconnect();
|
|
31
|
+
}, []);
|
|
32
|
+
let v = Math.max(0, h - _.left - _.right), y = Math.max(0, e - _.top - _.bottom);
|
|
33
|
+
return /* @__PURE__ */ d("div", {
|
|
34
|
+
ref: (e) => {
|
|
35
|
+
m.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
|
|
36
|
+
},
|
|
37
|
+
className: r("relative w-full", n),
|
|
38
|
+
...u,
|
|
39
|
+
children: h > 0 && /* @__PURE__ */ f("svg", {
|
|
40
|
+
width: h,
|
|
41
|
+
height: e,
|
|
42
|
+
role: "img",
|
|
43
|
+
"aria-label": i,
|
|
44
|
+
children: [a && /* @__PURE__ */ d("desc", { children: a }), /* @__PURE__ */ d("g", {
|
|
45
|
+
transform: `translate(${_.left},${_.top})`,
|
|
46
|
+
children: o({
|
|
47
|
+
width: v,
|
|
48
|
+
height: y,
|
|
49
|
+
margin: _
|
|
50
|
+
})
|
|
51
|
+
})]
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
N.displayName = "ChartContainer";
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/ui/charts/_internal/axes.tsx
|
|
58
|
+
function P({ scale: e, orientation: t, transform: n, tickCount: r, tickFormat: i, label: a, className: o }) {
|
|
59
|
+
let l = c(null);
|
|
60
|
+
return s(() => {
|
|
61
|
+
if (!l.current) return;
|
|
62
|
+
let n = {
|
|
63
|
+
top: y,
|
|
64
|
+
right: v,
|
|
65
|
+
bottom: g,
|
|
66
|
+
left: _
|
|
67
|
+
}[t], a = n(e);
|
|
68
|
+
r && (a = a.ticks(r)), i && (a = a.tickFormat(i));
|
|
69
|
+
let o = b(l.current);
|
|
70
|
+
o.call(a), o.selectAll(".tick line").attr("stroke", "var(--color-surface-border)"), o.selectAll(".tick text").attr("fill", "var(--color-surface-fg-muted)").attr("font-size", "var(--font-size-xs)"), o.selectAll(".domain").attr("stroke", "var(--color-surface-border-strong)");
|
|
71
|
+
}, [
|
|
72
|
+
e,
|
|
73
|
+
t,
|
|
74
|
+
r,
|
|
75
|
+
i
|
|
76
|
+
]), /* @__PURE__ */ d("g", {
|
|
77
|
+
ref: l,
|
|
78
|
+
transform: n,
|
|
79
|
+
className: o,
|
|
80
|
+
children: a && /* @__PURE__ */ d("text", {
|
|
81
|
+
textAnchor: "middle",
|
|
82
|
+
fill: "var(--color-surface-fg-muted)",
|
|
83
|
+
fontSize: "var(--font-size-sm)",
|
|
84
|
+
...t === "bottom" ? {
|
|
85
|
+
x: "50%",
|
|
86
|
+
dy: 35
|
|
87
|
+
} : t === "left" ? {
|
|
88
|
+
transform: "rotate(-90)",
|
|
89
|
+
y: -40,
|
|
90
|
+
x: 0
|
|
91
|
+
} : {},
|
|
92
|
+
children: a
|
|
93
|
+
})
|
|
94
|
+
});
|
|
83
95
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"line",
|
|
109
|
-
{
|
|
110
|
-
x1: o(i),
|
|
111
|
-
x2: o(i),
|
|
112
|
-
y1: 0,
|
|
113
|
-
y2: a,
|
|
114
|
-
stroke: "var(--color-surface-border)",
|
|
115
|
-
strokeDasharray: "3,3",
|
|
116
|
-
opacity: 0.6
|
|
117
|
-
},
|
|
118
|
-
`v-${k}`
|
|
119
|
-
))
|
|
120
|
-
] });
|
|
96
|
+
P.displayName = "Axis";
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/ui/charts/_internal/grid-lines.tsx
|
|
99
|
+
function F({ width: e, height: t, xScale: n, yScale: r, horizontal: i = !0, vertical: a = !1 }) {
|
|
100
|
+
return /* @__PURE__ */ f("g", {
|
|
101
|
+
className: "grid-lines",
|
|
102
|
+
children: [i && r?.ticks && r.ticks().map((t, n) => /* @__PURE__ */ d("line", {
|
|
103
|
+
x1: 0,
|
|
104
|
+
x2: e,
|
|
105
|
+
y1: r(t),
|
|
106
|
+
y2: r(t),
|
|
107
|
+
stroke: "var(--color-surface-border)",
|
|
108
|
+
strokeDasharray: "3,3",
|
|
109
|
+
opacity: .6
|
|
110
|
+
}, `h-${n}`)), a && n?.ticks && n.ticks().map((e, r) => /* @__PURE__ */ d("line", {
|
|
111
|
+
x1: n(e),
|
|
112
|
+
x2: n(e),
|
|
113
|
+
y1: 0,
|
|
114
|
+
y2: t,
|
|
115
|
+
stroke: "var(--color-surface-border)",
|
|
116
|
+
strokeDasharray: "3,3",
|
|
117
|
+
opacity: .6
|
|
118
|
+
}, `v-${r}`))]
|
|
119
|
+
});
|
|
121
120
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
className: "inline-block h-3 w-3 shrink-0 rounded-ds-sm",
|
|
137
|
-
style: { backgroundColor: d.color }
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
/* @__PURE__ */ e("span", { children: d.label })
|
|
141
|
-
] }, d.label))
|
|
142
|
-
}
|
|
143
|
-
);
|
|
121
|
+
F.displayName = "GridLines";
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/ui/charts/_internal/legend.tsx
|
|
124
|
+
function I({ items: e, position: t = "bottom", className: n }) {
|
|
125
|
+
return /* @__PURE__ */ d("div", {
|
|
126
|
+
className: r("flex gap-ds-04 text-ds-sm text-surface-fg-muted", t === "left" || t === "right" ? "flex-col" : "flex-row flex-wrap justify-center", n),
|
|
127
|
+
children: e.map((e) => /* @__PURE__ */ f("div", {
|
|
128
|
+
className: "flex items-center gap-ds-02",
|
|
129
|
+
children: [/* @__PURE__ */ d("span", {
|
|
130
|
+
className: "inline-block h-3 w-3 shrink-0 rounded-ds-sm",
|
|
131
|
+
style: { backgroundColor: e.color }
|
|
132
|
+
}), /* @__PURE__ */ d("span", { children: e.label })]
|
|
133
|
+
}, e.label))
|
|
134
|
+
});
|
|
144
135
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
),
|
|
158
|
-
style: { left: t.x + 12, top: t.y - 12 },
|
|
159
|
-
children: t.content
|
|
160
|
-
}
|
|
161
|
-
) : null;
|
|
136
|
+
I.displayName = "Legend";
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/ui/charts/_internal/tooltip.tsx
|
|
139
|
+
function L({ state: e, className: t }) {
|
|
140
|
+
return e.visible ? /* @__PURE__ */ d("div", {
|
|
141
|
+
className: r("pointer-events-none absolute z-tooltip", "rounded-ds-md border border-surface-border-strong", "bg-surface-overlay px-ds-03 py-ds-02", "shadow-raised-hover", "text-ds-sm text-surface-fg", t),
|
|
142
|
+
style: {
|
|
143
|
+
left: e.x + 12,
|
|
144
|
+
top: e.y - 12
|
|
145
|
+
},
|
|
146
|
+
children: e.content
|
|
147
|
+
}) : null;
|
|
162
148
|
}
|
|
163
|
-
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
149
|
+
L.displayName = "ChartTooltip";
|
|
150
|
+
function R() {
|
|
151
|
+
let [e, t] = l({
|
|
152
|
+
visible: !1,
|
|
153
|
+
x: 0,
|
|
154
|
+
y: 0,
|
|
155
|
+
content: null
|
|
156
|
+
});
|
|
157
|
+
return {
|
|
158
|
+
tooltip: e,
|
|
159
|
+
show: o((e, n, r) => {
|
|
160
|
+
t({
|
|
161
|
+
visible: !0,
|
|
162
|
+
x: e,
|
|
163
|
+
y: n,
|
|
164
|
+
content: r
|
|
165
|
+
});
|
|
166
|
+
}, []),
|
|
167
|
+
hide: o(() => {
|
|
168
|
+
t((e) => ({
|
|
169
|
+
...e,
|
|
170
|
+
visible: !1
|
|
171
|
+
}));
|
|
172
|
+
}, [])
|
|
173
|
+
};
|
|
176
174
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/ui/charts/_internal/colors.ts
|
|
177
|
+
var z = [
|
|
178
|
+
"chart-1",
|
|
179
|
+
"chart-2",
|
|
180
|
+
"chart-3",
|
|
181
|
+
"chart-4",
|
|
182
|
+
"chart-5",
|
|
183
|
+
"chart-6",
|
|
184
|
+
"chart-7",
|
|
185
|
+
"chart-8"
|
|
186
186
|
];
|
|
187
|
-
function
|
|
188
|
-
|
|
187
|
+
function B(e) {
|
|
188
|
+
return `var(--${e})`;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
|
|
190
|
+
function V(e, t = 0) {
|
|
191
|
+
return e ? z.includes(e) ? B(e) : e : B(z[t % z.length]);
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/ui/charts/_internal/animation.ts
|
|
195
|
+
function H() {
|
|
196
|
+
let { reducedMotion: e } = i();
|
|
197
|
+
return e;
|
|
196
198
|
}
|
|
197
|
-
function
|
|
198
|
-
|
|
199
|
+
function U(e, t = 300) {
|
|
200
|
+
return e ? 0 : t;
|
|
199
201
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
);
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
)
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
)
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
min: o = 0,
|
|
1036
|
-
label: x,
|
|
1037
|
-
valueLabel: d,
|
|
1038
|
-
color: M,
|
|
1039
|
-
trackColor: i = "var(--color-surface-border)",
|
|
1040
|
-
height: k = 200,
|
|
1041
|
-
startAngle: G = -120,
|
|
1042
|
-
endAngle: P = 120,
|
|
1043
|
-
thickness: v = 16,
|
|
1044
|
-
animate: R = !0,
|
|
1045
|
-
className: Z,
|
|
1046
|
-
...B
|
|
1047
|
-
}, N) => {
|
|
1048
|
-
const z = le(), X = Ee(z, R ? 600 : 0), W = R && !z, q = ae(M, 0), j = k, T = j / 2, V = Math.min(Math.max(t, o), a), J = a === o ? 0 : (V - o) / (a - o), E = G + (P - G) * J, m = typeof d == "function" ? d(V) : typeof d == "string" ? d : String(V), S = ve().innerRadius(T - v).outerRadius(T).startAngle(ge(G)).endAngle(ge(P)).cornerRadius(v / 2), y = ve().innerRadius(T - v).outerRadius(T).startAngle(ge(G)).endAngle(ge(E)).cornerRadius(v / 2), c = S(null) ?? "", I = y(null) ?? "";
|
|
1049
|
-
return /* @__PURE__ */ e(
|
|
1050
|
-
re.div,
|
|
1051
|
-
{
|
|
1052
|
-
ref: N,
|
|
1053
|
-
className: H("inline-flex flex-col items-center", Z),
|
|
1054
|
-
...W ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
|
|
1055
|
-
...ce(B),
|
|
1056
|
-
role: "meter",
|
|
1057
|
-
"aria-valuenow": V,
|
|
1058
|
-
"aria-valuemin": o,
|
|
1059
|
-
"aria-valuemax": a,
|
|
1060
|
-
"aria-label": x ?? "Gauge chart",
|
|
1061
|
-
children: /* @__PURE__ */ e("svg", { width: j, height: j, role: "img", "aria-hidden": "true", children: /* @__PURE__ */ p("g", { transform: `translate(${T},${T})`, children: [
|
|
1062
|
-
/* @__PURE__ */ e("path", { d: c, fill: i }),
|
|
1063
|
-
/* @__PURE__ */ e(
|
|
1064
|
-
"path",
|
|
1065
|
-
{
|
|
1066
|
-
d: I,
|
|
1067
|
-
fill: q,
|
|
1068
|
-
style: X > 0 ? { transition: `d ${X}ms ease-out` } : void 0
|
|
1069
|
-
}
|
|
1070
|
-
),
|
|
1071
|
-
/* @__PURE__ */ e(
|
|
1072
|
-
"text",
|
|
1073
|
-
{
|
|
1074
|
-
x: 0,
|
|
1075
|
-
y: x ? -4 : 0,
|
|
1076
|
-
textAnchor: "middle",
|
|
1077
|
-
dominantBaseline: "central",
|
|
1078
|
-
className: "fill-surface-fg text-ds-2xl font-semibold",
|
|
1079
|
-
children: m
|
|
1080
|
-
}
|
|
1081
|
-
),
|
|
1082
|
-
x && /* @__PURE__ */ e(
|
|
1083
|
-
"text",
|
|
1084
|
-
{
|
|
1085
|
-
x: 0,
|
|
1086
|
-
y: 20,
|
|
1087
|
-
textAnchor: "middle",
|
|
1088
|
-
dominantBaseline: "central",
|
|
1089
|
-
className: "fill-surface-fg-muted text-ds-xs",
|
|
1090
|
-
children: x
|
|
1091
|
-
}
|
|
1092
|
-
)
|
|
1093
|
-
] }) })
|
|
1094
|
-
}
|
|
1095
|
-
);
|
|
1096
|
-
}
|
|
1097
|
-
);
|
|
1098
|
-
He.displayName = "GaugeChart";
|
|
1099
|
-
const Ke = ne.forwardRef(
|
|
1100
|
-
({
|
|
1101
|
-
data: t,
|
|
1102
|
-
axes: a,
|
|
1103
|
-
series: o,
|
|
1104
|
-
maxValue: x,
|
|
1105
|
-
levels: d = 5,
|
|
1106
|
-
fillOpacity: M = 0.25,
|
|
1107
|
-
showDots: i = !1,
|
|
1108
|
-
height: k = 300,
|
|
1109
|
-
showTooltip: G = !0,
|
|
1110
|
-
showLegend: P = !1,
|
|
1111
|
-
animate: v = !0,
|
|
1112
|
-
ariaLabel: R,
|
|
1113
|
-
className: Z,
|
|
1114
|
-
...B
|
|
1115
|
-
}, N) => {
|
|
1116
|
-
const z = ye(null), [X, W] = me(0), { tooltip: q, show: j, hide: T } = pe(), V = le(), J = v && !V;
|
|
1117
|
-
xe(() => {
|
|
1118
|
-
if (!z.current) return;
|
|
1119
|
-
const u = new ResizeObserver((l) => {
|
|
1120
|
-
const s = l[0];
|
|
1121
|
-
s && W(s.contentRect.width);
|
|
1122
|
-
});
|
|
1123
|
-
return u.observe(z.current), () => u.disconnect();
|
|
1124
|
-
}, []);
|
|
1125
|
-
const m = (X > 0 ? Math.min(X, k) : k) / 2 - 40, S = o.map((u, l) => ae(u.color, l)), y = x ?? Math.max(
|
|
1126
|
-
...t.flatMap((u) => o.map((l) => Number(u[l.key]) || 0)),
|
|
1127
|
-
1
|
|
1128
|
-
), c = 2 * Math.PI / a.length, I = We().radius((u) => m * u / y).angle((u, l) => l * c).curve(Ie), C = (u) => a.map((l, s) => Number(t[s]?.[u]) || 0), L = (u, l) => {
|
|
1129
|
-
const s = c * u - Math.PI / 2, b = m * l / y;
|
|
1130
|
-
return {
|
|
1131
|
-
x: b * Math.cos(s),
|
|
1132
|
-
y: b * Math.sin(s)
|
|
1133
|
-
};
|
|
1134
|
-
};
|
|
1135
|
-
return /* @__PURE__ */ p(
|
|
1136
|
-
re.div,
|
|
1137
|
-
{
|
|
1138
|
-
ref: (u) => {
|
|
1139
|
-
z.current = u, typeof N == "function" ? N(u) : N && (N.current = u);
|
|
1140
|
-
},
|
|
1141
|
-
className: H("relative w-full", Z),
|
|
1142
|
-
...J ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
|
|
1143
|
-
...ce(B),
|
|
1144
|
-
children: [
|
|
1145
|
-
X > 0 && /* @__PURE__ */ p(te, { children: [
|
|
1146
|
-
/* @__PURE__ */ e(
|
|
1147
|
-
"svg",
|
|
1148
|
-
{
|
|
1149
|
-
width: X,
|
|
1150
|
-
height: k,
|
|
1151
|
-
role: "img",
|
|
1152
|
-
"aria-label": R ?? "Radar chart",
|
|
1153
|
-
children: /* @__PURE__ */ p("g", { transform: `translate(${X / 2},${k / 2})`, children: [
|
|
1154
|
-
Array.from({ length: d }, (u, l) => {
|
|
1155
|
-
const s = m / d * (l + 1), b = a.map((n, r) => {
|
|
1156
|
-
const f = c * r - Math.PI / 2;
|
|
1157
|
-
return `${s * Math.cos(f)},${s * Math.sin(f)}`;
|
|
1158
|
-
}).join(" ");
|
|
1159
|
-
return /* @__PURE__ */ e(
|
|
1160
|
-
"polygon",
|
|
1161
|
-
{
|
|
1162
|
-
points: b,
|
|
1163
|
-
fill: "none",
|
|
1164
|
-
stroke: "var(--color-surface-border)",
|
|
1165
|
-
strokeDasharray: "3,3",
|
|
1166
|
-
strokeWidth: 1
|
|
1167
|
-
},
|
|
1168
|
-
`grid-${l}`
|
|
1169
|
-
);
|
|
1170
|
-
}),
|
|
1171
|
-
a.map((u, l) => {
|
|
1172
|
-
const s = c * l - Math.PI / 2, b = m * Math.cos(s), n = m * Math.sin(s);
|
|
1173
|
-
return /* @__PURE__ */ e(
|
|
1174
|
-
"line",
|
|
1175
|
-
{
|
|
1176
|
-
x1: 0,
|
|
1177
|
-
y1: 0,
|
|
1178
|
-
x2: b,
|
|
1179
|
-
y2: n,
|
|
1180
|
-
stroke: "var(--color-surface-border)",
|
|
1181
|
-
strokeWidth: 1
|
|
1182
|
-
},
|
|
1183
|
-
`axis-${l}`
|
|
1184
|
-
);
|
|
1185
|
-
}),
|
|
1186
|
-
a.map((u, l) => {
|
|
1187
|
-
const s = c * l - Math.PI / 2, b = m + 18, n = b * Math.cos(s), r = b * Math.sin(s);
|
|
1188
|
-
let f = "middle";
|
|
1189
|
-
return Math.abs(Math.cos(s)) > 0.1 && (f = Math.cos(s) > 0 ? "start" : "end"), /* @__PURE__ */ e(
|
|
1190
|
-
"text",
|
|
1191
|
-
{
|
|
1192
|
-
x: n,
|
|
1193
|
-
y: r,
|
|
1194
|
-
textAnchor: f,
|
|
1195
|
-
dominantBaseline: "central",
|
|
1196
|
-
className: "fill-surface-fg-muted text-ds-xs",
|
|
1197
|
-
children: u
|
|
1198
|
-
},
|
|
1199
|
-
`label-${l}`
|
|
1200
|
-
);
|
|
1201
|
-
}),
|
|
1202
|
-
Array.from({ length: d }, (u, l) => {
|
|
1203
|
-
const s = Math.round(y / d * (l + 1)), b = m / d * (l + 1), n = -Math.PI / 2, r = b * Math.cos(n) + 4, f = b * Math.sin(n);
|
|
1204
|
-
return /* @__PURE__ */ e(
|
|
1205
|
-
"text",
|
|
1206
|
-
{
|
|
1207
|
-
x: r,
|
|
1208
|
-
y: f,
|
|
1209
|
-
textAnchor: "start",
|
|
1210
|
-
dominantBaseline: "auto",
|
|
1211
|
-
className: "fill-surface-fg-subtle text-ds-xs",
|
|
1212
|
-
children: s
|
|
1213
|
-
},
|
|
1214
|
-
`level-label-${l}`
|
|
1215
|
-
);
|
|
1216
|
-
}),
|
|
1217
|
-
o.map((u, l) => {
|
|
1218
|
-
const s = C(u.key), b = I(s);
|
|
1219
|
-
return b ? /* @__PURE__ */ p("g", { children: [
|
|
1220
|
-
/* @__PURE__ */ e(
|
|
1221
|
-
"path",
|
|
1222
|
-
{
|
|
1223
|
-
d: b,
|
|
1224
|
-
fill: S[l],
|
|
1225
|
-
fillOpacity: M,
|
|
1226
|
-
stroke: S[l],
|
|
1227
|
-
strokeWidth: 2,
|
|
1228
|
-
strokeLinejoin: "round"
|
|
1229
|
-
}
|
|
1230
|
-
),
|
|
1231
|
-
i && s.map((n, r) => {
|
|
1232
|
-
const { x: f, y: A } = L(r, n);
|
|
1233
|
-
return /* @__PURE__ */ e(
|
|
1234
|
-
"circle",
|
|
1235
|
-
{
|
|
1236
|
-
cx: f,
|
|
1237
|
-
cy: A,
|
|
1238
|
-
r: 4,
|
|
1239
|
-
fill: S[l],
|
|
1240
|
-
stroke: "var(--color-surface-base)",
|
|
1241
|
-
strokeWidth: 2,
|
|
1242
|
-
className: "transition-opacity"
|
|
1243
|
-
},
|
|
1244
|
-
`dot-${u.key}-${r}`
|
|
1245
|
-
);
|
|
1246
|
-
})
|
|
1247
|
-
] }, u.key) : null;
|
|
1248
|
-
}),
|
|
1249
|
-
G && a.map((u, l) => {
|
|
1250
|
-
const s = c * l - Math.PI / 2, b = m * Math.cos(s), n = m * Math.sin(s);
|
|
1251
|
-
return /* @__PURE__ */ e(
|
|
1252
|
-
"circle",
|
|
1253
|
-
{
|
|
1254
|
-
cx: b,
|
|
1255
|
-
cy: n,
|
|
1256
|
-
r: 16,
|
|
1257
|
-
fill: "transparent",
|
|
1258
|
-
className: "cursor-pointer",
|
|
1259
|
-
onMouseMove: (r) => {
|
|
1260
|
-
const f = r.currentTarget.closest("div")?.getBoundingClientRect();
|
|
1261
|
-
j(
|
|
1262
|
-
r.clientX - (f?.left ?? 0),
|
|
1263
|
-
r.clientY - (f?.top ?? 0),
|
|
1264
|
-
/* @__PURE__ */ p("div", { children: [
|
|
1265
|
-
/* @__PURE__ */ e("div", { className: "font-medium", children: u }),
|
|
1266
|
-
o.map((A, w) => {
|
|
1267
|
-
const $ = Number(t[l]?.[A.key]) || 0;
|
|
1268
|
-
return /* @__PURE__ */ p(
|
|
1269
|
-
"div",
|
|
1270
|
-
{
|
|
1271
|
-
className: "flex items-center gap-ds-02",
|
|
1272
|
-
children: [
|
|
1273
|
-
/* @__PURE__ */ e(
|
|
1274
|
-
"span",
|
|
1275
|
-
{
|
|
1276
|
-
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
1277
|
-
style: { backgroundColor: S[w] }
|
|
1278
|
-
}
|
|
1279
|
-
),
|
|
1280
|
-
/* @__PURE__ */ p("span", { className: "text-surface-fg-muted", children: [
|
|
1281
|
-
A.label,
|
|
1282
|
-
":"
|
|
1283
|
-
] }),
|
|
1284
|
-
" ",
|
|
1285
|
-
$.toLocaleString()
|
|
1286
|
-
]
|
|
1287
|
-
},
|
|
1288
|
-
A.key
|
|
1289
|
-
);
|
|
1290
|
-
})
|
|
1291
|
-
] })
|
|
1292
|
-
);
|
|
1293
|
-
},
|
|
1294
|
-
onMouseLeave: T
|
|
1295
|
-
},
|
|
1296
|
-
`hover-${l}`
|
|
1297
|
-
);
|
|
1298
|
-
})
|
|
1299
|
-
] })
|
|
1300
|
-
}
|
|
1301
|
-
),
|
|
1302
|
-
G && /* @__PURE__ */ e(ue, { state: q })
|
|
1303
|
-
] }),
|
|
1304
|
-
P && /* @__PURE__ */ e(
|
|
1305
|
-
ie,
|
|
1306
|
-
{
|
|
1307
|
-
items: o.map((u, l) => ({
|
|
1308
|
-
label: u.label,
|
|
1309
|
-
color: S[l]
|
|
1310
|
-
})),
|
|
1311
|
-
className: "mt-ds-04"
|
|
1312
|
-
}
|
|
1313
|
-
)
|
|
1314
|
-
]
|
|
1315
|
-
}
|
|
1316
|
-
);
|
|
1317
|
-
}
|
|
1318
|
-
);
|
|
1319
|
-
Ke.displayName = "RadarChart";
|
|
1320
|
-
export {
|
|
1321
|
-
qe as AreaChart,
|
|
1322
|
-
Ue as BarChart,
|
|
1323
|
-
be as ChartContainer,
|
|
1324
|
-
He as GaugeChart,
|
|
1325
|
-
ie as Legend,
|
|
1326
|
-
Ze as LineChart,
|
|
1327
|
-
Je as PieChart,
|
|
1328
|
-
Ke as RadarChart,
|
|
1329
|
-
Qe as Sparkline
|
|
1330
|
-
};
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/ui/charts/bar-chart.tsx
|
|
204
|
+
var W = a.forwardRef(({ data: i, xKey: a, yKey: o, orientation: s = "vertical", stacked: c = !1, grouped: l = !1, color: h, height: g = 300, showGrid: _ = !0, showTooltip: v = !0, showLegend: y = !1, animate: b = !0, barRadius: x = 4, xLabel: S, yLabel: C, seriesLabels: w, ariaLabel: T, className: E, ...D }, O) => {
|
|
205
|
+
let { tooltip: k, show: A, hide: j } = R(), M = H(), z = s === "vertical", B = b && !M, U = Array.isArray(o) ? o : [o], W = U.length > 1, G = W ? U.map((e, t) => V(Array.isArray(h) ? h[t] : typeof h == "string" ? h : void 0, t)) : [V(typeof h == "string" ? h : Array.isArray(h) ? h[0] : void 0, 0)];
|
|
206
|
+
return /* @__PURE__ */ f(e.div, {
|
|
207
|
+
ref: O,
|
|
208
|
+
className: r("relative", E),
|
|
209
|
+
...B ? {
|
|
210
|
+
initial: {
|
|
211
|
+
opacity: 0,
|
|
212
|
+
scale: .96
|
|
213
|
+
},
|
|
214
|
+
animate: {
|
|
215
|
+
opacity: 1,
|
|
216
|
+
scale: 1
|
|
217
|
+
},
|
|
218
|
+
transition: n.fade
|
|
219
|
+
} : {},
|
|
220
|
+
...t(D),
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ d(N, {
|
|
223
|
+
height: g,
|
|
224
|
+
ariaLabel: T ?? "Bar chart",
|
|
225
|
+
children: ({ width: e, height: t, margin: n }) => {
|
|
226
|
+
let r = i.map((e) => String(e[a])), o = i.map((e) => `${String(e[a])} — ${U.map((t, n) => `${w?.[n] ?? t}: ${Number(e[t]).toLocaleString()}`).join(", ")}`).join(". "), s;
|
|
227
|
+
s = Math.max(...c ? i.map((e) => U.reduce((t, n) => t + (Number(e[n]) || 0), 0)) : i.flatMap((e) => U.map((t) => Number(e[t]) || 0)));
|
|
228
|
+
let h = p().domain(r).range(z ? [0, e] : [0, t]).padding(.2), g = m().domain([0, s * 1.1]).range(z ? [t, 0] : [0, e]).nice(), y = h.bandwidth(), b = W && l ? y / U.length : y;
|
|
229
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
230
|
+
/* @__PURE__ */ d("desc", { children: o }),
|
|
231
|
+
_ && /* @__PURE__ */ d(F, {
|
|
232
|
+
width: e,
|
|
233
|
+
height: t,
|
|
234
|
+
yScale: z ? g : void 0,
|
|
235
|
+
xScale: z ? void 0 : g,
|
|
236
|
+
horizontal: z,
|
|
237
|
+
vertical: !z
|
|
238
|
+
}),
|
|
239
|
+
i.map((e) => {
|
|
240
|
+
let n = String(e[a]), r = 0;
|
|
241
|
+
return U.map((i, a) => {
|
|
242
|
+
let o = Number(e[i]) || 0, s = G[a] || G[0], u, p, m, _;
|
|
243
|
+
z ? (u = (h(n) ?? 0) + (l && W ? a * b : 0), p = g(c ? r + o : o), m = b, _ = c ? g(r) - g(r + o) : t - g(o)) : (u = c ? g(r) : 0, p = (h(n) ?? 0) + (l && W ? a * b : 0), m = c ? g(r + o) - g(r) : g(o), _ = b), c && (r += o);
|
|
244
|
+
let y = w?.[a] ?? i, S = W ? `${n}, ${y}: ${o.toLocaleString()}` : `${n}: ${o.toLocaleString()}`, C = /* @__PURE__ */ f("div", { children: [
|
|
245
|
+
/* @__PURE__ */ d("div", {
|
|
246
|
+
className: "font-medium",
|
|
247
|
+
children: n
|
|
248
|
+
}),
|
|
249
|
+
W && /* @__PURE__ */ d("div", {
|
|
250
|
+
className: "text-surface-fg-muted",
|
|
251
|
+
children: y
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ d("div", { children: o.toLocaleString() })
|
|
254
|
+
] });
|
|
255
|
+
return /* @__PURE__ */ d("rect", {
|
|
256
|
+
x: u,
|
|
257
|
+
y: p,
|
|
258
|
+
width: Math.max(0, m),
|
|
259
|
+
height: Math.max(0, _),
|
|
260
|
+
rx: x,
|
|
261
|
+
fill: s,
|
|
262
|
+
className: "transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:opacity-80",
|
|
263
|
+
tabIndex: v ? 0 : void 0,
|
|
264
|
+
role: v ? "graphics-symbol" : void 0,
|
|
265
|
+
"aria-label": S,
|
|
266
|
+
onMouseMove: (e) => {
|
|
267
|
+
if (v) {
|
|
268
|
+
let t = e.currentTarget.closest("div")?.getBoundingClientRect();
|
|
269
|
+
A(e.clientX - (t?.left ?? 0), e.clientY - (t?.top ?? 0), C);
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
onMouseLeave: j,
|
|
273
|
+
onFocus: (e) => {
|
|
274
|
+
if (v) {
|
|
275
|
+
let t = e.currentTarget.closest("div")?.getBoundingClientRect(), n = e.currentTarget.getBoundingClientRect();
|
|
276
|
+
A(n.left + n.width / 2 - (t?.left ?? 0), n.top - (t?.top ?? 0), C);
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
onBlur: j
|
|
280
|
+
}, `${n}-${i}`);
|
|
281
|
+
});
|
|
282
|
+
}),
|
|
283
|
+
z ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(P, {
|
|
284
|
+
scale: h,
|
|
285
|
+
orientation: "bottom",
|
|
286
|
+
transform: `translate(0,${t})`,
|
|
287
|
+
label: S
|
|
288
|
+
}), /* @__PURE__ */ d(P, {
|
|
289
|
+
scale: g,
|
|
290
|
+
orientation: "left",
|
|
291
|
+
label: C
|
|
292
|
+
})] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(P, {
|
|
293
|
+
scale: g,
|
|
294
|
+
orientation: "bottom",
|
|
295
|
+
transform: `translate(0,${t})`,
|
|
296
|
+
label: S
|
|
297
|
+
}), /* @__PURE__ */ d(P, {
|
|
298
|
+
scale: h,
|
|
299
|
+
orientation: "left",
|
|
300
|
+
label: C
|
|
301
|
+
})] })
|
|
302
|
+
] });
|
|
303
|
+
}
|
|
304
|
+
}),
|
|
305
|
+
v && /* @__PURE__ */ d(L, { state: k }),
|
|
306
|
+
y && W && /* @__PURE__ */ d(I, {
|
|
307
|
+
items: U.map((e, t) => ({
|
|
308
|
+
label: w?.[t] ?? e,
|
|
309
|
+
color: G[t]
|
|
310
|
+
})),
|
|
311
|
+
className: "mt-ds-04"
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
W.displayName = "BarChart";
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/ui/charts/line-chart.tsx
|
|
319
|
+
var G = a.forwardRef(({ data: i, xKey: a, series: o, curved: s = !1, showDots: c = !1, dotSize: l = 4, strokeWidth: p = 2, height: g = 300, showGrid: _ = !0, showTooltip: v = !0, showLegend: y = !1, animate: b = !0, xLabel: x, yLabel: S, ariaLabel: w, className: D, ...O }, k) => {
|
|
320
|
+
let { tooltip: A, show: j, hide: M } = R(), z = H(), B = b && !z, U = o.map((e, t) => V(e.color, t));
|
|
321
|
+
return /* @__PURE__ */ f(e.div, {
|
|
322
|
+
ref: k,
|
|
323
|
+
className: r("relative", D),
|
|
324
|
+
...B ? {
|
|
325
|
+
initial: {
|
|
326
|
+
opacity: 0,
|
|
327
|
+
scale: .96
|
|
328
|
+
},
|
|
329
|
+
animate: {
|
|
330
|
+
opacity: 1,
|
|
331
|
+
scale: 1
|
|
332
|
+
},
|
|
333
|
+
transition: n.fade
|
|
334
|
+
} : {},
|
|
335
|
+
...t(O),
|
|
336
|
+
children: [
|
|
337
|
+
/* @__PURE__ */ d(N, {
|
|
338
|
+
height: g,
|
|
339
|
+
ariaLabel: w ?? "Line chart",
|
|
340
|
+
children: ({ width: e, height: t, margin: n }) => {
|
|
341
|
+
let r = i.map((e) => e[a]), g = r.every((e) => typeof e == "number"), y, b;
|
|
342
|
+
if (g) {
|
|
343
|
+
let t = r, n = Math.min(...t), i = Math.max(...t), o = m().domain([n, i]).range([0, e]);
|
|
344
|
+
y = o, b = (e) => o(Number(e[a]));
|
|
345
|
+
} else {
|
|
346
|
+
let t = r.map(String), n = h().domain(t).range([0, e]).padding(.5);
|
|
347
|
+
y = n, b = (e) => n(String(e[a])) ?? 0;
|
|
348
|
+
}
|
|
349
|
+
let w = i.flatMap((e) => o.map((t) => Number(e[t.key]) || 0)), D = Math.max(...w), O = m().domain([0, D * 1.1]).range([t, 0]).nice(), k = s ? T : C, A = E().curve(k).defined((e) => e != null);
|
|
350
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
351
|
+
/* @__PURE__ */ d("desc", { children: i.map((e) => `${String(e[a])} — ${o.map((t) => `${t.label}: ${Number(e[t.key]).toLocaleString()}`).join(", ")}`).join(". ") }),
|
|
352
|
+
_ && /* @__PURE__ */ d(F, {
|
|
353
|
+
width: e,
|
|
354
|
+
height: t,
|
|
355
|
+
yScale: O,
|
|
356
|
+
horizontal: !0
|
|
357
|
+
}),
|
|
358
|
+
o.map((e, t) => /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
|
|
359
|
+
d: A.x((e) => b(e)).y((t) => O(Number(t[e.key]) || 0))(i) ?? "",
|
|
360
|
+
fill: "none",
|
|
361
|
+
stroke: U[t],
|
|
362
|
+
strokeWidth: p,
|
|
363
|
+
strokeLinejoin: "round",
|
|
364
|
+
strokeLinecap: "round"
|
|
365
|
+
}), c && i.map((n, r) => /* @__PURE__ */ d("circle", {
|
|
366
|
+
cx: b(n),
|
|
367
|
+
cy: O(Number(n[e.key]) || 0),
|
|
368
|
+
r: l,
|
|
369
|
+
fill: U[t],
|
|
370
|
+
className: "transition-opacity hover:opacity-80"
|
|
371
|
+
}, `${e.key}-dot-${r}`))] }, e.key)),
|
|
372
|
+
v && i.map((n, r) => {
|
|
373
|
+
let s = b(n), c = e / Math.max(i.length - 1, 1), l = String(n[a]), u = `${l}: ${o.map((e) => `${e.label} ${Number(n[e.key]).toLocaleString()}`).join(", ")}`, p = /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
|
|
374
|
+
className: "font-medium",
|
|
375
|
+
children: l
|
|
376
|
+
}), o.map((e, t) => /* @__PURE__ */ f("div", {
|
|
377
|
+
className: "flex items-center gap-ds-02",
|
|
378
|
+
children: [
|
|
379
|
+
/* @__PURE__ */ d("span", {
|
|
380
|
+
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
381
|
+
style: { backgroundColor: U[t] }
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ f("span", {
|
|
384
|
+
className: "text-surface-fg-muted",
|
|
385
|
+
children: [e.label, ":"]
|
|
386
|
+
}),
|
|
387
|
+
" ",
|
|
388
|
+
Number(n[e.key]).toLocaleString()
|
|
389
|
+
]
|
|
390
|
+
}, e.key))] });
|
|
391
|
+
return /* @__PURE__ */ d("rect", {
|
|
392
|
+
x: s - c / 2,
|
|
393
|
+
y: 0,
|
|
394
|
+
width: c,
|
|
395
|
+
height: t,
|
|
396
|
+
fill: "transparent",
|
|
397
|
+
tabIndex: 0,
|
|
398
|
+
role: "graphics-symbol",
|
|
399
|
+
"aria-label": u,
|
|
400
|
+
className: "focus-visible:outline-none",
|
|
401
|
+
onMouseMove: (e) => {
|
|
402
|
+
let t = e.currentTarget.closest("div")?.getBoundingClientRect();
|
|
403
|
+
j(e.clientX - (t?.left ?? 0), e.clientY - (t?.top ?? 0), p);
|
|
404
|
+
},
|
|
405
|
+
onMouseLeave: M,
|
|
406
|
+
onFocus: (e) => {
|
|
407
|
+
let t = e.currentTarget.closest("div")?.getBoundingClientRect(), n = e.currentTarget.getBoundingClientRect();
|
|
408
|
+
j(n.left + n.width / 2 - (t?.left ?? 0), n.top + n.height / 2 - (t?.top ?? 0), p);
|
|
409
|
+
},
|
|
410
|
+
onBlur: M
|
|
411
|
+
}, `hover-${r}`);
|
|
412
|
+
}),
|
|
413
|
+
/* @__PURE__ */ d(P, {
|
|
414
|
+
scale: y,
|
|
415
|
+
orientation: "bottom",
|
|
416
|
+
transform: `translate(0,${t})`,
|
|
417
|
+
label: x
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ d(P, {
|
|
420
|
+
scale: O,
|
|
421
|
+
orientation: "left",
|
|
422
|
+
label: S
|
|
423
|
+
})
|
|
424
|
+
] });
|
|
425
|
+
}
|
|
426
|
+
}),
|
|
427
|
+
v && /* @__PURE__ */ d(L, { state: A }),
|
|
428
|
+
y && o.length > 1 && /* @__PURE__ */ d(I, {
|
|
429
|
+
items: o.map((e, t) => ({
|
|
430
|
+
label: e.label,
|
|
431
|
+
color: U[t]
|
|
432
|
+
})),
|
|
433
|
+
className: "mt-ds-04"
|
|
434
|
+
})
|
|
435
|
+
]
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
G.displayName = "LineChart";
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/ui/charts/area-chart.tsx
|
|
441
|
+
var K = a.forwardRef(({ data: i, xKey: o, series: s, curved: c = !1, stacked: l = !1, fillOpacity: p = .3, gradient: g = !1, strokeWidth: _ = 2, height: v = 300, showGrid: y = !0, showTooltip: b = !0, showLegend: x = !1, animate: w = !0, xLabel: D, yLabel: O, ariaLabel: M, className: z, ...B }, U) => {
|
|
442
|
+
let { tooltip: W, show: G, hide: K } = R(), q = H(), J = w && !q, Y = s.map((e, t) => V(e.color, t)), X = a.useId();
|
|
443
|
+
return /* @__PURE__ */ f(e.div, {
|
|
444
|
+
ref: U,
|
|
445
|
+
className: r("relative", z),
|
|
446
|
+
...J ? {
|
|
447
|
+
initial: {
|
|
448
|
+
opacity: 0,
|
|
449
|
+
scale: .96
|
|
450
|
+
},
|
|
451
|
+
animate: {
|
|
452
|
+
opacity: 1,
|
|
453
|
+
scale: 1
|
|
454
|
+
},
|
|
455
|
+
transition: n.fade
|
|
456
|
+
} : {},
|
|
457
|
+
...t(B),
|
|
458
|
+
children: [
|
|
459
|
+
/* @__PURE__ */ d(N, {
|
|
460
|
+
height: v,
|
|
461
|
+
ariaLabel: M ?? "Area chart",
|
|
462
|
+
children: ({ width: e, height: t, margin: n }) => {
|
|
463
|
+
let r = i.map((e) => e[o]), a = r.every((e) => typeof e == "number"), v, x, w;
|
|
464
|
+
if (a) {
|
|
465
|
+
let t = r, n = Math.min(...t), a = Math.max(...t), s = m().domain([n, a]).range([0, e]);
|
|
466
|
+
v = s, x = (e) => s(Number(e[o])), w = (e) => s(Number(i[e][o]));
|
|
467
|
+
} else {
|
|
468
|
+
let t = r.map(String), n = h().domain(t).range([0, e]).padding(.5);
|
|
469
|
+
v = n, x = (e) => n(String(e[o])) ?? 0, w = (e) => n(String(i[e][o])) ?? 0;
|
|
470
|
+
}
|
|
471
|
+
let M;
|
|
472
|
+
M = Math.max(...l ? i.map((e) => s.reduce((t, n) => t + (Number(e[n.key]) || 0), 0)) : i.flatMap((e) => s.map((t) => Number(e[t.key]) || 0)));
|
|
473
|
+
let N = m().domain([0, M * 1.1]).range([t, 0]).nice(), I = c ? T : C, L = () => i.map((n, r) => {
|
|
474
|
+
let a = x(n), c = e / Math.max(i.length - 1, 1);
|
|
475
|
+
return /* @__PURE__ */ d("rect", {
|
|
476
|
+
x: a - c / 2,
|
|
477
|
+
y: 0,
|
|
478
|
+
width: c,
|
|
479
|
+
height: t,
|
|
480
|
+
fill: "transparent",
|
|
481
|
+
onMouseMove: (e) => {
|
|
482
|
+
let t = e.currentTarget.closest("div")?.getBoundingClientRect();
|
|
483
|
+
G(e.clientX - (t?.left ?? 0), e.clientY - (t?.top ?? 0), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
|
|
484
|
+
className: "font-medium",
|
|
485
|
+
children: String(n[o])
|
|
486
|
+
}), s.map((e, t) => /* @__PURE__ */ f("div", {
|
|
487
|
+
className: "flex items-center gap-ds-02",
|
|
488
|
+
children: [
|
|
489
|
+
/* @__PURE__ */ d("span", {
|
|
490
|
+
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
491
|
+
style: { backgroundColor: Y[t] }
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ f("span", {
|
|
494
|
+
className: "text-surface-fg-muted",
|
|
495
|
+
children: [e.label, ":"]
|
|
496
|
+
}),
|
|
497
|
+
" ",
|
|
498
|
+
Number(n[e.key]).toLocaleString()
|
|
499
|
+
]
|
|
500
|
+
}, e.key))] }));
|
|
501
|
+
},
|
|
502
|
+
onMouseLeave: K
|
|
503
|
+
}, `hover-${r}`);
|
|
504
|
+
}), R = () => g ? /* @__PURE__ */ d("defs", { children: s.map((e, t) => /* @__PURE__ */ f("linearGradient", {
|
|
505
|
+
id: `${X}-gradient-${t}`,
|
|
506
|
+
x1: "0",
|
|
507
|
+
y1: "0",
|
|
508
|
+
x2: "0",
|
|
509
|
+
y2: "1",
|
|
510
|
+
children: [/* @__PURE__ */ d("stop", {
|
|
511
|
+
offset: "0%",
|
|
512
|
+
stopColor: Y[t],
|
|
513
|
+
stopOpacity: p
|
|
514
|
+
}), /* @__PURE__ */ d("stop", {
|
|
515
|
+
offset: "100%",
|
|
516
|
+
stopColor: Y[t],
|
|
517
|
+
stopOpacity: .05
|
|
518
|
+
})]
|
|
519
|
+
}, `grad-${t}`)) }) : null, z = () => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(P, {
|
|
520
|
+
scale: v,
|
|
521
|
+
orientation: "bottom",
|
|
522
|
+
transform: `translate(0,${t})`,
|
|
523
|
+
label: D
|
|
524
|
+
}), /* @__PURE__ */ d(P, {
|
|
525
|
+
scale: N,
|
|
526
|
+
orientation: "left",
|
|
527
|
+
label: O
|
|
528
|
+
})] });
|
|
529
|
+
if (l) {
|
|
530
|
+
let n = s.map((e) => e.key), r = k().keys(n).order(j).offset(A)(i.map((e) => {
|
|
531
|
+
let t = { [o]: String(e[o]) };
|
|
532
|
+
for (let n of s) t[n.key] = Number(e[n.key]) || 0;
|
|
533
|
+
return t;
|
|
534
|
+
})), a = S().curve(I).x((e, t) => w(t)).y0((e) => N(e[0])).y1((e) => N(e[1])), c = E().curve(I).x((e, t) => w(t)).y((e) => N(e[1]));
|
|
535
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
536
|
+
R(),
|
|
537
|
+
y && /* @__PURE__ */ d(F, {
|
|
538
|
+
width: e,
|
|
539
|
+
height: t,
|
|
540
|
+
yScale: N,
|
|
541
|
+
horizontal: !0
|
|
542
|
+
}),
|
|
543
|
+
[...r].reverse().map((e, t) => {
|
|
544
|
+
let n = r.length - 1 - t, i = e, o = a(i) ?? "", l = c(i) ?? "";
|
|
545
|
+
return /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
|
|
546
|
+
d: o,
|
|
547
|
+
fill: g ? `url(#${X}-gradient-${n})` : Y[n],
|
|
548
|
+
opacity: g ? 1 : p
|
|
549
|
+
}), /* @__PURE__ */ d("path", {
|
|
550
|
+
d: l,
|
|
551
|
+
fill: "none",
|
|
552
|
+
stroke: Y[n],
|
|
553
|
+
strokeWidth: _,
|
|
554
|
+
strokeLinejoin: "round",
|
|
555
|
+
strokeLinecap: "round"
|
|
556
|
+
})] }, s[n].key);
|
|
557
|
+
}),
|
|
558
|
+
b && L(),
|
|
559
|
+
z()
|
|
560
|
+
] });
|
|
561
|
+
}
|
|
562
|
+
let B = S().curve(I).defined((e) => e != null), V = E().curve(I).defined((e) => e != null);
|
|
563
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
564
|
+
R(),
|
|
565
|
+
y && /* @__PURE__ */ d(F, {
|
|
566
|
+
width: e,
|
|
567
|
+
height: t,
|
|
568
|
+
yScale: N,
|
|
569
|
+
horizontal: !0
|
|
570
|
+
}),
|
|
571
|
+
[...s].reverse().map((e, n) => {
|
|
572
|
+
let r = s.length - 1 - n, a = B.x((e) => x(e)).y0(t).y1((t) => N(Number(t[e.key]) || 0)), o = V.x((e) => x(e)).y((t) => N(Number(t[e.key]) || 0)), c = a(i) ?? "", l = o(i) ?? "";
|
|
573
|
+
return /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
|
|
574
|
+
d: c,
|
|
575
|
+
fill: g ? `url(#${X}-gradient-${r})` : Y[r],
|
|
576
|
+
opacity: g ? 1 : p
|
|
577
|
+
}), /* @__PURE__ */ d("path", {
|
|
578
|
+
d: l,
|
|
579
|
+
fill: "none",
|
|
580
|
+
stroke: Y[r],
|
|
581
|
+
strokeWidth: _,
|
|
582
|
+
strokeLinejoin: "round",
|
|
583
|
+
strokeLinecap: "round"
|
|
584
|
+
})] }, e.key);
|
|
585
|
+
}),
|
|
586
|
+
b && L(),
|
|
587
|
+
z()
|
|
588
|
+
] });
|
|
589
|
+
}
|
|
590
|
+
}),
|
|
591
|
+
b && /* @__PURE__ */ d(L, { state: W }),
|
|
592
|
+
x && s.length > 1 && /* @__PURE__ */ d(I, {
|
|
593
|
+
items: s.map((e, t) => ({
|
|
594
|
+
label: e.label,
|
|
595
|
+
color: Y[t]
|
|
596
|
+
})),
|
|
597
|
+
className: "mt-ds-04"
|
|
598
|
+
})
|
|
599
|
+
]
|
|
600
|
+
});
|
|
601
|
+
});
|
|
602
|
+
K.displayName = "AreaChart";
|
|
603
|
+
//#endregion
|
|
604
|
+
//#region src/ui/charts/pie-chart.tsx
|
|
605
|
+
var q = a.forwardRef(({ data: i, variant: a = "pie", innerRadius: o = .6, padAngle: p = 0, cornerRadius: m = 0, height: h = 300, showTooltip: g = !0, showLegend: _ = !1, showLabels: v = !1, animate: y = !0, className: b, centerLabel: S, ariaLabel: C, ...w }, T) => {
|
|
606
|
+
let E = c(null), [D, k] = l(0), [A, j] = l(null), { tooltip: M, show: N, hide: P } = R(), F = H(), z = y && !F;
|
|
607
|
+
s(() => {
|
|
608
|
+
if (!E.current) return;
|
|
609
|
+
let e = new ResizeObserver((e) => {
|
|
610
|
+
let t = e[0];
|
|
611
|
+
t && k(t.contentRect.width);
|
|
612
|
+
});
|
|
613
|
+
return e.observe(E.current), () => e.disconnect();
|
|
614
|
+
}, []);
|
|
615
|
+
let B = (D > 0 ? Math.min(D, h) : h) / 2, U = a === "donut" ? B * o : 0, W = i.map((e, t) => V(e.color, t)), G = i.reduce((e, t) => e + t.value, 0), K = O().value((e) => e.value).padAngle(p).sort(null)(i), q = x().innerRadius(U).outerRadius(B - 2).cornerRadius(m), J = U + (B - 2 - U) * .7, Y = x().innerRadius(J).outerRadius(J);
|
|
616
|
+
return /* @__PURE__ */ f(e.div, {
|
|
617
|
+
ref: (e) => {
|
|
618
|
+
E.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
|
|
619
|
+
},
|
|
620
|
+
className: r("relative w-full", b),
|
|
621
|
+
...z ? {
|
|
622
|
+
initial: {
|
|
623
|
+
opacity: 0,
|
|
624
|
+
scale: .96
|
|
625
|
+
},
|
|
626
|
+
animate: {
|
|
627
|
+
opacity: 1,
|
|
628
|
+
scale: 1
|
|
629
|
+
},
|
|
630
|
+
transition: n.fade
|
|
631
|
+
} : {},
|
|
632
|
+
...t(w),
|
|
633
|
+
children: [D > 0 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("svg", {
|
|
634
|
+
width: D,
|
|
635
|
+
height: h,
|
|
636
|
+
role: "img",
|
|
637
|
+
"aria-label": C ?? "Pie chart",
|
|
638
|
+
children: /* @__PURE__ */ f("g", {
|
|
639
|
+
transform: `translate(${D / 2},${h / 2})`,
|
|
640
|
+
children: [
|
|
641
|
+
K.map((e, t) => {
|
|
642
|
+
let n = q(e);
|
|
643
|
+
if (!n) return null;
|
|
644
|
+
let [r, i] = q.centroid(e), a = Math.atan2(i, r), o = Math.cos(a) * 4, s = Math.sin(a) * 4, c = A === t;
|
|
645
|
+
return /* @__PURE__ */ d("path", {
|
|
646
|
+
d: n,
|
|
647
|
+
fill: W[t],
|
|
648
|
+
className: "cursor-pointer transition-transform",
|
|
649
|
+
style: { transform: c ? `translate(${o}px, ${s}px)` : void 0 },
|
|
650
|
+
onMouseEnter: () => j(t),
|
|
651
|
+
onMouseMove: (t) => {
|
|
652
|
+
if (g) {
|
|
653
|
+
let n = t.currentTarget.closest("div")?.getBoundingClientRect(), r = G > 0 ? (e.data.value / G * 100).toFixed(1) : "0";
|
|
654
|
+
N(t.clientX - (n?.left ?? 0), t.clientY - (n?.top ?? 0), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
|
|
655
|
+
className: "font-medium",
|
|
656
|
+
children: e.data.label
|
|
657
|
+
}), /* @__PURE__ */ f("div", { children: [
|
|
658
|
+
e.data.value.toLocaleString(),
|
|
659
|
+
" (",
|
|
660
|
+
r,
|
|
661
|
+
"%)"
|
|
662
|
+
] })] }));
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
onMouseLeave: () => {
|
|
666
|
+
j(null), P();
|
|
667
|
+
}
|
|
668
|
+
}, `slice-${e.data.label}-${t}`);
|
|
669
|
+
}),
|
|
670
|
+
v && K.map((e, t) => {
|
|
671
|
+
let [n, r] = Y.centroid(e), i = G > 0 ? (e.data.value / G * 100).toFixed(0) : "0";
|
|
672
|
+
return G > 0 && e.data.value / G < .03 ? null : /* @__PURE__ */ f("text", {
|
|
673
|
+
x: n,
|
|
674
|
+
y: r,
|
|
675
|
+
textAnchor: "middle",
|
|
676
|
+
dominantBaseline: "central",
|
|
677
|
+
className: "pointer-events-none fill-accent-fg text-ds-xs font-medium",
|
|
678
|
+
children: [i, "%"]
|
|
679
|
+
}, `label-${e.data.label}-${t}`);
|
|
680
|
+
}),
|
|
681
|
+
a === "donut" && S && U > 0 && /* @__PURE__ */ d("foreignObject", {
|
|
682
|
+
x: -U * .7,
|
|
683
|
+
y: -U * .7,
|
|
684
|
+
width: U * 1.4,
|
|
685
|
+
height: U * 1.4,
|
|
686
|
+
children: /* @__PURE__ */ d("div", {
|
|
687
|
+
className: "flex h-full w-full items-center justify-center text-center text-surface-fg",
|
|
688
|
+
children: S
|
|
689
|
+
})
|
|
690
|
+
})
|
|
691
|
+
]
|
|
692
|
+
})
|
|
693
|
+
}), g && /* @__PURE__ */ d(L, { state: M })] }), _ && /* @__PURE__ */ d(I, {
|
|
694
|
+
items: i.map((e, t) => ({
|
|
695
|
+
label: e.label,
|
|
696
|
+
color: W[t]
|
|
697
|
+
})),
|
|
698
|
+
className: "mt-ds-04"
|
|
699
|
+
})]
|
|
700
|
+
});
|
|
701
|
+
});
|
|
702
|
+
q.displayName = "PieChart";
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region src/ui/charts/sparkline.tsx
|
|
705
|
+
var J = {
|
|
706
|
+
duration: 1,
|
|
707
|
+
ease: "easeOut"
|
|
708
|
+
}, Y = a.forwardRef(({ data: t, variant: n = "line", width: i = 120, height: a = 32, color: o, showLastDot: s = !1, strokeWidth: c = 1.5, animate: l = !0, className: u, ...p }, h) => {
|
|
709
|
+
let g = V(o, 0), _ = H(), v = l && !_;
|
|
710
|
+
if (!t.length) return null;
|
|
711
|
+
let y = n === "bar" ? 1 : c, b = i - y * 2, x = a - y * 2, C = m().domain([0, Math.max(t.length - 1, 1)]).range([y, y + b]), w = Math.min(...t), D = Math.max(...t), O = w === D ? [w - 1, D + 1] : [w, D], k = m().domain(O).range([y + x, y]);
|
|
712
|
+
if (n === "bar") {
|
|
713
|
+
let e = Math.max(1, (b - 1 * (t.length - 1)) / t.length), n = y + x;
|
|
714
|
+
return /* @__PURE__ */ d("svg", {
|
|
715
|
+
ref: h,
|
|
716
|
+
width: i,
|
|
717
|
+
height: a,
|
|
718
|
+
role: "img",
|
|
719
|
+
"aria-label": "Sparkline bar chart",
|
|
720
|
+
className: r("inline-block align-middle", u),
|
|
721
|
+
...p,
|
|
722
|
+
children: t.map((t, r) => {
|
|
723
|
+
let i = y + r * (e + 1), a = k(t);
|
|
724
|
+
return /* @__PURE__ */ d("rect", {
|
|
725
|
+
x: i,
|
|
726
|
+
y: a,
|
|
727
|
+
width: e,
|
|
728
|
+
height: Math.max(1, n - a),
|
|
729
|
+
rx: Math.min(1, e / 2),
|
|
730
|
+
fill: g
|
|
731
|
+
}, r);
|
|
732
|
+
})
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
if (n === "area") {
|
|
736
|
+
let n = S().curve(T).x((e, t) => C(t)).y0(y + x).y1((e) => k(e)), o = E().curve(T).x((e, t) => C(t)).y((e) => k(e)), l = n(t) ?? "", m = o(t) ?? "", _ = C(t.length - 1), b = k(t[t.length - 1]);
|
|
737
|
+
return /* @__PURE__ */ f("svg", {
|
|
738
|
+
ref: h,
|
|
739
|
+
width: i,
|
|
740
|
+
height: a,
|
|
741
|
+
role: "img",
|
|
742
|
+
"aria-label": "Sparkline area chart",
|
|
743
|
+
className: r("inline-block align-middle", u),
|
|
744
|
+
...p,
|
|
745
|
+
children: [
|
|
746
|
+
/* @__PURE__ */ d("path", {
|
|
747
|
+
d: l,
|
|
748
|
+
fill: g,
|
|
749
|
+
opacity: .2
|
|
750
|
+
}),
|
|
751
|
+
v ? /* @__PURE__ */ d(e.path, {
|
|
752
|
+
d: m,
|
|
753
|
+
fill: "none",
|
|
754
|
+
stroke: g,
|
|
755
|
+
strokeWidth: c,
|
|
756
|
+
strokeLinejoin: "round",
|
|
757
|
+
strokeLinecap: "round",
|
|
758
|
+
initial: { pathLength: 0 },
|
|
759
|
+
animate: { pathLength: 1 },
|
|
760
|
+
transition: J
|
|
761
|
+
}) : /* @__PURE__ */ d("path", {
|
|
762
|
+
d: m,
|
|
763
|
+
fill: "none",
|
|
764
|
+
stroke: g,
|
|
765
|
+
strokeWidth: c,
|
|
766
|
+
strokeLinejoin: "round",
|
|
767
|
+
strokeLinecap: "round"
|
|
768
|
+
}),
|
|
769
|
+
s && /* @__PURE__ */ d("circle", {
|
|
770
|
+
cx: _,
|
|
771
|
+
cy: b,
|
|
772
|
+
r: c + 1,
|
|
773
|
+
fill: g
|
|
774
|
+
})
|
|
775
|
+
]
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
let A = E().curve(T).x((e, t) => C(t)).y((e) => k(e))(t) ?? "", j = C(t.length - 1), M = k(t[t.length - 1]);
|
|
779
|
+
return /* @__PURE__ */ f("svg", {
|
|
780
|
+
ref: h,
|
|
781
|
+
width: i,
|
|
782
|
+
height: a,
|
|
783
|
+
role: "img",
|
|
784
|
+
"aria-label": "Sparkline chart",
|
|
785
|
+
className: r("inline-block align-middle", u),
|
|
786
|
+
...p,
|
|
787
|
+
children: [v ? /* @__PURE__ */ d(e.path, {
|
|
788
|
+
d: A,
|
|
789
|
+
fill: "none",
|
|
790
|
+
stroke: g,
|
|
791
|
+
strokeWidth: c,
|
|
792
|
+
strokeLinejoin: "round",
|
|
793
|
+
strokeLinecap: "round",
|
|
794
|
+
initial: { pathLength: 0 },
|
|
795
|
+
animate: { pathLength: 1 },
|
|
796
|
+
transition: J
|
|
797
|
+
}) : /* @__PURE__ */ d("path", {
|
|
798
|
+
d: A,
|
|
799
|
+
fill: "none",
|
|
800
|
+
stroke: g,
|
|
801
|
+
strokeWidth: c,
|
|
802
|
+
strokeLinejoin: "round",
|
|
803
|
+
strokeLinecap: "round"
|
|
804
|
+
}), s && /* @__PURE__ */ d("circle", {
|
|
805
|
+
cx: j,
|
|
806
|
+
cy: M,
|
|
807
|
+
r: c + 1,
|
|
808
|
+
fill: g
|
|
809
|
+
})]
|
|
810
|
+
});
|
|
811
|
+
});
|
|
812
|
+
Y.displayName = "Sparkline";
|
|
813
|
+
//#endregion
|
|
814
|
+
//#region src/ui/charts/gauge-chart.tsx
|
|
815
|
+
var X = (e) => e * Math.PI / 180, Z = a.forwardRef(({ value: i, max: a = 100, min: o = 0, label: s, valueLabel: c, color: l, trackColor: u = "var(--color-surface-border)", height: p = 200, startAngle: m = -120, endAngle: h = 120, thickness: g = 16, animate: _ = !0, className: v, ...y }, b) => {
|
|
816
|
+
let S = H(), C = U(S, _ ? 600 : 0), w = _ && !S, T = V(l, 0), E = p, D = E / 2, O = Math.min(Math.max(i, o), a), k = a === o ? 0 : (O - o) / (a - o), A = m + (h - m) * k, j = typeof c == "function" ? c(O) : typeof c == "string" ? c : String(O), M = x().innerRadius(D - g).outerRadius(D).startAngle(X(m)).endAngle(X(h)).cornerRadius(g / 2), N = x().innerRadius(D - g).outerRadius(D).startAngle(X(m)).endAngle(X(A)).cornerRadius(g / 2), P = M(null) ?? "", F = N(null) ?? "";
|
|
817
|
+
return /* @__PURE__ */ d(e.div, {
|
|
818
|
+
ref: b,
|
|
819
|
+
className: r("inline-flex flex-col items-center", v),
|
|
820
|
+
...w ? {
|
|
821
|
+
initial: {
|
|
822
|
+
opacity: 0,
|
|
823
|
+
scale: .96
|
|
824
|
+
},
|
|
825
|
+
animate: {
|
|
826
|
+
opacity: 1,
|
|
827
|
+
scale: 1
|
|
828
|
+
},
|
|
829
|
+
transition: n.fade
|
|
830
|
+
} : {},
|
|
831
|
+
...t(y),
|
|
832
|
+
role: "meter",
|
|
833
|
+
"aria-valuenow": O,
|
|
834
|
+
"aria-valuemin": o,
|
|
835
|
+
"aria-valuemax": a,
|
|
836
|
+
"aria-label": s ?? "Gauge chart",
|
|
837
|
+
children: /* @__PURE__ */ d("svg", {
|
|
838
|
+
width: E,
|
|
839
|
+
height: E,
|
|
840
|
+
role: "img",
|
|
841
|
+
"aria-hidden": "true",
|
|
842
|
+
children: /* @__PURE__ */ f("g", {
|
|
843
|
+
transform: `translate(${D},${D})`,
|
|
844
|
+
children: [
|
|
845
|
+
/* @__PURE__ */ d("path", {
|
|
846
|
+
d: P,
|
|
847
|
+
fill: u
|
|
848
|
+
}),
|
|
849
|
+
/* @__PURE__ */ d("path", {
|
|
850
|
+
d: F,
|
|
851
|
+
fill: T,
|
|
852
|
+
style: C > 0 ? { transition: `d ${C}ms ease-out` } : void 0
|
|
853
|
+
}),
|
|
854
|
+
/* @__PURE__ */ d("text", {
|
|
855
|
+
x: 0,
|
|
856
|
+
y: s ? -4 : 0,
|
|
857
|
+
textAnchor: "middle",
|
|
858
|
+
dominantBaseline: "central",
|
|
859
|
+
className: "fill-surface-fg text-ds-2xl font-semibold",
|
|
860
|
+
children: j
|
|
861
|
+
}),
|
|
862
|
+
s && /* @__PURE__ */ d("text", {
|
|
863
|
+
x: 0,
|
|
864
|
+
y: 20,
|
|
865
|
+
textAnchor: "middle",
|
|
866
|
+
dominantBaseline: "central",
|
|
867
|
+
className: "fill-surface-fg-muted text-ds-xs",
|
|
868
|
+
children: s
|
|
869
|
+
})
|
|
870
|
+
]
|
|
871
|
+
})
|
|
872
|
+
})
|
|
873
|
+
});
|
|
874
|
+
});
|
|
875
|
+
Z.displayName = "GaugeChart";
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region src/ui/charts/radar-chart.tsx
|
|
878
|
+
var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5, fillOpacity: h = .25, showDots: g = !1, height: _ = 300, showTooltip: v = !0, showLegend: y = !1, animate: b = !0, ariaLabel: x, className: S, ...C }, T) => {
|
|
879
|
+
let E = c(null), [O, k] = l(0), { tooltip: A, show: j, hide: M } = R(), N = H(), P = b && !N;
|
|
880
|
+
s(() => {
|
|
881
|
+
if (!E.current) return;
|
|
882
|
+
let e = new ResizeObserver((e) => {
|
|
883
|
+
let t = e[0];
|
|
884
|
+
t && k(t.contentRect.width);
|
|
885
|
+
});
|
|
886
|
+
return e.observe(E.current), () => e.disconnect();
|
|
887
|
+
}, []);
|
|
888
|
+
let F = (O > 0 ? Math.min(O, _) : _) / 2 - 40, z = o.map((e, t) => V(e.color, t)), B = p ?? Math.max(...i.flatMap((e) => o.map((t) => Number(e[t.key]) || 0)), 1), U = 2 * Math.PI / a.length, W = D().radius((e) => F * e / B).angle((e, t) => t * U).curve(w), G = (e) => a.map((t, n) => Number(i[n]?.[e]) || 0), K = (e, t) => {
|
|
889
|
+
let n = U * e - Math.PI / 2, r = F * t / B;
|
|
890
|
+
return {
|
|
891
|
+
x: r * Math.cos(n),
|
|
892
|
+
y: r * Math.sin(n)
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
return /* @__PURE__ */ f(e.div, {
|
|
896
|
+
ref: (e) => {
|
|
897
|
+
E.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
|
|
898
|
+
},
|
|
899
|
+
className: r("relative w-full", S),
|
|
900
|
+
...P ? {
|
|
901
|
+
initial: {
|
|
902
|
+
opacity: 0,
|
|
903
|
+
scale: .96
|
|
904
|
+
},
|
|
905
|
+
animate: {
|
|
906
|
+
opacity: 1,
|
|
907
|
+
scale: 1
|
|
908
|
+
},
|
|
909
|
+
transition: n.fade
|
|
910
|
+
} : {},
|
|
911
|
+
...t(C),
|
|
912
|
+
children: [O > 0 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("svg", {
|
|
913
|
+
width: O,
|
|
914
|
+
height: _,
|
|
915
|
+
role: "img",
|
|
916
|
+
"aria-label": x ?? "Radar chart",
|
|
917
|
+
children: /* @__PURE__ */ f("g", {
|
|
918
|
+
transform: `translate(${O / 2},${_ / 2})`,
|
|
919
|
+
children: [
|
|
920
|
+
Array.from({ length: m }, (e, t) => {
|
|
921
|
+
let n = F / m * (t + 1);
|
|
922
|
+
return /* @__PURE__ */ d("polygon", {
|
|
923
|
+
points: a.map((e, t) => {
|
|
924
|
+
let r = U * t - Math.PI / 2;
|
|
925
|
+
return `${n * Math.cos(r)},${n * Math.sin(r)}`;
|
|
926
|
+
}).join(" "),
|
|
927
|
+
fill: "none",
|
|
928
|
+
stroke: "var(--color-surface-border)",
|
|
929
|
+
strokeDasharray: "3,3",
|
|
930
|
+
strokeWidth: 1
|
|
931
|
+
}, `grid-${t}`);
|
|
932
|
+
}),
|
|
933
|
+
a.map((e, t) => {
|
|
934
|
+
let n = U * t - Math.PI / 2;
|
|
935
|
+
return /* @__PURE__ */ d("line", {
|
|
936
|
+
x1: 0,
|
|
937
|
+
y1: 0,
|
|
938
|
+
x2: F * Math.cos(n),
|
|
939
|
+
y2: F * Math.sin(n),
|
|
940
|
+
stroke: "var(--color-surface-border)",
|
|
941
|
+
strokeWidth: 1
|
|
942
|
+
}, `axis-${t}`);
|
|
943
|
+
}),
|
|
944
|
+
a.map((e, t) => {
|
|
945
|
+
let n = U * t - Math.PI / 2, r = F + 18, i = r * Math.cos(n), a = r * Math.sin(n), o = "middle";
|
|
946
|
+
return Math.abs(Math.cos(n)) > .1 && (o = Math.cos(n) > 0 ? "start" : "end"), /* @__PURE__ */ d("text", {
|
|
947
|
+
x: i,
|
|
948
|
+
y: a,
|
|
949
|
+
textAnchor: o,
|
|
950
|
+
dominantBaseline: "central",
|
|
951
|
+
className: "fill-surface-fg-muted text-ds-xs",
|
|
952
|
+
children: e
|
|
953
|
+
}, `label-${t}`);
|
|
954
|
+
}),
|
|
955
|
+
Array.from({ length: m }, (e, t) => {
|
|
956
|
+
let n = Math.round(B / m * (t + 1)), r = F / m * (t + 1), i = -Math.PI / 2;
|
|
957
|
+
return /* @__PURE__ */ d("text", {
|
|
958
|
+
x: r * Math.cos(i) + 4,
|
|
959
|
+
y: r * Math.sin(i),
|
|
960
|
+
textAnchor: "start",
|
|
961
|
+
dominantBaseline: "auto",
|
|
962
|
+
className: "fill-surface-fg-subtle text-ds-xs",
|
|
963
|
+
children: n
|
|
964
|
+
}, `level-label-${t}`);
|
|
965
|
+
}),
|
|
966
|
+
o.map((e, t) => {
|
|
967
|
+
let n = G(e.key), r = W(n);
|
|
968
|
+
return r ? /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
|
|
969
|
+
d: r,
|
|
970
|
+
fill: z[t],
|
|
971
|
+
fillOpacity: h,
|
|
972
|
+
stroke: z[t],
|
|
973
|
+
strokeWidth: 2,
|
|
974
|
+
strokeLinejoin: "round"
|
|
975
|
+
}), g && n.map((n, r) => {
|
|
976
|
+
let { x: i, y: a } = K(r, n);
|
|
977
|
+
return /* @__PURE__ */ d("circle", {
|
|
978
|
+
cx: i,
|
|
979
|
+
cy: a,
|
|
980
|
+
r: 4,
|
|
981
|
+
fill: z[t],
|
|
982
|
+
stroke: "var(--color-surface-base)",
|
|
983
|
+
strokeWidth: 2,
|
|
984
|
+
className: "transition-opacity"
|
|
985
|
+
}, `dot-${e.key}-${r}`);
|
|
986
|
+
})] }, e.key) : null;
|
|
987
|
+
}),
|
|
988
|
+
v && a.map((e, t) => {
|
|
989
|
+
let n = U * t - Math.PI / 2;
|
|
990
|
+
return /* @__PURE__ */ d("circle", {
|
|
991
|
+
cx: F * Math.cos(n),
|
|
992
|
+
cy: F * Math.sin(n),
|
|
993
|
+
r: 16,
|
|
994
|
+
fill: "transparent",
|
|
995
|
+
className: "cursor-pointer",
|
|
996
|
+
onMouseMove: (n) => {
|
|
997
|
+
let r = n.currentTarget.closest("div")?.getBoundingClientRect();
|
|
998
|
+
j(n.clientX - (r?.left ?? 0), n.clientY - (r?.top ?? 0), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
|
|
999
|
+
className: "font-medium",
|
|
1000
|
+
children: e
|
|
1001
|
+
}), o.map((e, n) => {
|
|
1002
|
+
let r = Number(i[t]?.[e.key]) || 0;
|
|
1003
|
+
return /* @__PURE__ */ f("div", {
|
|
1004
|
+
className: "flex items-center gap-ds-02",
|
|
1005
|
+
children: [
|
|
1006
|
+
/* @__PURE__ */ d("span", {
|
|
1007
|
+
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
1008
|
+
style: { backgroundColor: z[n] }
|
|
1009
|
+
}),
|
|
1010
|
+
/* @__PURE__ */ f("span", {
|
|
1011
|
+
className: "text-surface-fg-muted",
|
|
1012
|
+
children: [e.label, ":"]
|
|
1013
|
+
}),
|
|
1014
|
+
" ",
|
|
1015
|
+
r.toLocaleString()
|
|
1016
|
+
]
|
|
1017
|
+
}, e.key);
|
|
1018
|
+
})] }));
|
|
1019
|
+
},
|
|
1020
|
+
onMouseLeave: M
|
|
1021
|
+
}, `hover-${t}`);
|
|
1022
|
+
})
|
|
1023
|
+
]
|
|
1024
|
+
})
|
|
1025
|
+
}), v && /* @__PURE__ */ d(L, { state: A })] }), y && /* @__PURE__ */ d(I, {
|
|
1026
|
+
items: o.map((e, t) => ({
|
|
1027
|
+
label: e.label,
|
|
1028
|
+
color: z[t]
|
|
1029
|
+
})),
|
|
1030
|
+
className: "mt-ds-04"
|
|
1031
|
+
})]
|
|
1032
|
+
});
|
|
1033
|
+
});
|
|
1034
|
+
Q.displayName = "RadarChart";
|
|
1035
|
+
//#endregion
|
|
1036
|
+
export { K as AreaChart, W as BarChart, N as ChartContainer, Z as GaugeChart, I as Legend, G as LineChart, q as PieChart, Q as RadarChart, Y as Sparkline };
|