@synertech/ui 0.43.0 → 0.45.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/.claude/skills/use-synertech-ui/SKILL.md +178 -5
- package/README.md +36 -8
- package/dist/components/accordion/Accordion.cjs +1 -0
- package/dist/components/accordion/Accordion.js +1 -0
- package/dist/components/accordion/index.cjs +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/advance-detachable/AdvanceDetachable.cjs +1 -0
- package/dist/components/advance-detachable/AdvanceDetachable.js +1 -0
- package/dist/components/advance-detachable/index.cjs +1 -0
- package/dist/components/advance-detachable/index.js +1 -0
- package/dist/components/area-chart/AreaChart.cjs +1 -0
- package/dist/components/area-chart/AreaChart.js +1 -0
- package/dist/components/area-chart/index.cjs +1 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/avatar/Avatar.cjs +1 -0
- package/dist/components/avatar/Avatar.js +1 -0
- package/dist/components/avatar/index.cjs +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/Badge.cjs +1 -0
- package/dist/components/badge/Badge.js +1 -0
- package/dist/components/badge/index.cjs +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/banner/Banner.cjs +1 -0
- package/dist/components/banner/Banner.js +1 -0
- package/dist/components/banner/index.cjs +1 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/bar-chart/BarChart.cjs +1 -0
- package/dist/components/bar-chart/BarChart.js +1 -0
- package/dist/components/bar-chart/index.cjs +1 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/box-plot/BoxPlot.cjs +1 -0
- package/dist/components/box-plot/BoxPlot.js +1 -0
- package/dist/components/box-plot/index.cjs +1 -0
- package/dist/components/box-plot/index.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.cjs +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/breadcrumb/index.cjs +1 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/bullet-chart/BulletChart.cjs +1 -0
- package/dist/components/bullet-chart/BulletChart.js +1 -0
- package/dist/components/bullet-chart/index.cjs +1 -0
- package/dist/components/bullet-chart/index.js +1 -0
- package/dist/components/button/Button.cjs +1 -0
- package/dist/components/button/Button.js +1 -0
- package/dist/components/button/index.cjs +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.cjs +1 -0
- package/dist/components/button-group/ButtonGroup.js +1 -0
- package/dist/components/button-group/index.cjs +1 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/calendar/Calendar.cjs +1 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/index.cjs +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/candlestick-chart/CandlestickChart.cjs +1 -0
- package/dist/components/candlestick-chart/CandlestickChart.js +1 -0
- package/dist/components/candlestick-chart/index.cjs +1 -0
- package/dist/components/candlestick-chart/index.js +1 -0
- package/dist/components/card/Card.cjs +1 -0
- package/dist/components/card/Card.js +1 -0
- package/dist/components/card/CardBody.cjs +1 -0
- package/dist/components/card/CardBody.js +1 -0
- package/dist/components/card/CardDescription.cjs +1 -0
- package/dist/components/card/CardDescription.js +1 -0
- package/dist/components/card/CardFooter.cjs +1 -0
- package/dist/components/card/CardFooter.js +1 -0
- package/dist/components/card/CardHeader.cjs +1 -0
- package/dist/components/card/CardHeader.js +1 -0
- package/dist/components/card/CardImage.cjs +1 -0
- package/dist/components/card/CardImage.js +1 -0
- package/dist/components/card/CardTitle.cjs +1 -0
- package/dist/components/card/CardTitle.js +1 -0
- package/dist/components/card/index.cjs +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/chart/ChartAnnotations.cjs +1 -0
- package/dist/components/chart/ChartAnnotations.js +1 -0
- package/dist/components/chart/ChartAxis.cjs +1 -0
- package/dist/components/chart/ChartAxis.js +1 -0
- package/dist/components/chart/ChartBrush.cjs +1 -0
- package/dist/components/chart/ChartBrush.js +1 -0
- package/dist/components/chart/ChartContainer.cjs +1 -0
- package/dist/components/chart/ChartContainer.js +1 -0
- package/dist/components/chart/ChartExportButton.cjs +1 -0
- package/dist/components/chart/ChartExportButton.js +1 -0
- package/dist/components/chart/ChartFacets.cjs +1 -0
- package/dist/components/chart/ChartFacets.js +1 -0
- package/dist/components/chart/ChartFilterBar.cjs +1 -0
- package/dist/components/chart/ChartFilterBar.js +1 -0
- package/dist/components/chart/ChartGrid.cjs +1 -0
- package/dist/components/chart/ChartGrid.js +1 -0
- package/dist/components/chart/ChartLegend.cjs +1 -0
- package/dist/components/chart/ChartLegend.js +1 -0
- package/dist/components/chart/ChartPatterns.cjs +1 -0
- package/dist/components/chart/ChartPatterns.js +1 -0
- package/dist/components/chart/ChartPeriodPicker.cjs +1 -0
- package/dist/components/chart/ChartPeriodPicker.js +1 -0
- package/dist/components/chart/ChartScaleLegend.cjs +1 -0
- package/dist/components/chart/ChartScaleLegend.js +1 -0
- package/dist/components/chart/ChartSync.cjs +1 -0
- package/dist/components/chart/ChartSync.js +1 -0
- package/dist/components/chart/ChartTableView.cjs +1 -0
- package/dist/components/chart/ChartTableView.js +1 -0
- package/dist/components/chart/ChartTooltip.cjs +1 -0
- package/dist/components/chart/ChartTooltip.js +1 -0
- package/dist/components/chart/chart.types.cjs +1 -0
- package/dist/components/chart/chart.types.js +0 -0
- package/dist/components/chart/index.cjs +1 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/chart/palette.cjs +1 -0
- package/dist/components/chart/palette.js +1 -0
- package/dist/components/chart/useChartSize.cjs +1 -0
- package/dist/components/chart/useChartSize.js +1 -0
- package/dist/components/chart/utils/bins.cjs +1 -0
- package/dist/components/chart/utils/bins.js +1 -0
- package/dist/components/chart/utils/cartesian.cjs +1 -0
- package/dist/components/chart/utils/cartesian.js +1 -0
- package/dist/components/chart/utils/data.cjs +1 -0
- package/dist/components/chart/utils/data.js +1 -0
- package/dist/components/chart/utils/decimate.cjs +1 -0
- package/dist/components/chart/utils/decimate.js +1 -0
- package/dist/components/chart/utils/export.cjs +2 -0
- package/dist/components/chart/utils/export.js +2 -0
- package/dist/components/chart/utils/format.cjs +1 -0
- package/dist/components/chart/utils/format.js +1 -0
- package/dist/components/chart/utils/path.cjs +1 -0
- package/dist/components/chart/utils/path.js +1 -0
- package/dist/components/chart/utils/period.cjs +1 -0
- package/dist/components/chart/utils/period.js +1 -0
- package/dist/components/chart/utils/quantile.cjs +1 -0
- package/dist/components/chart/utils/quantile.js +1 -0
- package/dist/components/chart/utils/scales.cjs +1 -0
- package/dist/components/chart/utils/scales.js +1 -0
- package/dist/components/chart/utils/stack.cjs +1 -0
- package/dist/components/chart/utils/stack.js +1 -0
- package/dist/components/chart/utils/text.cjs +1 -0
- package/dist/components/chart/utils/text.js +1 -0
- package/dist/components/chart/utils/ticks.cjs +1 -0
- package/dist/components/chart/utils/ticks.js +1 -0
- package/dist/components/chart/utils/time.cjs +1 -0
- package/dist/components/chart/utils/time.js +1 -0
- package/dist/components/checkbox/Checkbox.cjs +1 -0
- package/dist/components/checkbox/Checkbox.js +1 -0
- package/dist/components/checkbox/CheckboxGroup.cjs +1 -0
- package/dist/components/checkbox/CheckboxGroup.js +1 -0
- package/dist/components/checkbox/index.cjs +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.cjs +1 -0
- package/dist/components/chip/Chip.js +1 -0
- package/dist/components/chip/index.cjs +1 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/circular-progress/CircularProgress.cjs +1 -0
- package/dist/components/circular-progress/CircularProgress.js +1 -0
- package/dist/components/circular-progress/index.cjs +1 -0
- package/dist/components/circular-progress/index.js +1 -0
- package/dist/components/datagrid/DataGrid.cjs +2 -0
- package/dist/components/datagrid/DataGrid.js +2 -0
- package/dist/components/datagrid/index.cjs +1 -0
- package/dist/components/datagrid/index.js +1 -0
- package/dist/components/detachable/Detachable.cjs +1 -0
- package/dist/components/detachable/Detachable.js +1 -0
- package/dist/components/detachable/index.cjs +1 -0
- package/dist/components/detachable/index.js +1 -0
- package/dist/components/device-mockup/DeviceMockup.cjs +1 -0
- package/dist/components/device-mockup/DeviceMockup.js +1 -0
- package/dist/components/device-mockup/index.cjs +1 -0
- package/dist/components/device-mockup/index.js +1 -0
- package/dist/components/divider/Divider.cjs +1 -0
- package/dist/components/divider/Divider.js +1 -0
- package/dist/components/divider/index.cjs +1 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/Drawer.cjs +1 -0
- package/dist/components/drawer/Drawer.js +1 -0
- package/dist/components/drawer/index.cjs +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/dropdown/Dropdown.cjs +1 -0
- package/dist/components/dropdown/Dropdown.js +1 -0
- package/dist/components/dropdown/DropdownCheckboxItem.cjs +1 -0
- package/dist/components/dropdown/DropdownCheckboxItem.js +1 -0
- package/dist/components/dropdown/DropdownContent.cjs +1 -0
- package/dist/components/dropdown/DropdownContent.js +1 -0
- package/dist/components/dropdown/DropdownItem.cjs +1 -0
- package/dist/components/dropdown/DropdownItem.js +1 -0
- package/dist/components/dropdown/DropdownRadio.cjs +1 -0
- package/dist/components/dropdown/DropdownRadio.js +1 -0
- package/dist/components/dropdown/DropdownSeparator.cjs +1 -0
- package/dist/components/dropdown/DropdownSeparator.js +1 -0
- package/dist/components/dropdown/DropdownSubMenu.cjs +1 -0
- package/dist/components/dropdown/DropdownSubMenu.js +1 -0
- package/dist/components/dropdown/DropdownTrigger.cjs +1 -0
- package/dist/components/dropdown/DropdownTrigger.js +1 -0
- package/dist/components/dropdown/hooks/index.cjs +1 -0
- package/dist/components/dropdown/hooks/index.js +1 -0
- package/dist/components/dropdown/hooks/useClickOutside.cjs +1 -0
- package/dist/components/dropdown/hooks/useClickOutside.js +1 -0
- package/dist/components/dropdown/hooks/useKeyboardNavigation.cjs +1 -0
- package/dist/components/dropdown/hooks/useKeyboardNavigation.js +1 -0
- package/dist/components/dropdown/hooks/useLatest.cjs +1 -0
- package/dist/components/dropdown/hooks/useLatest.js +1 -0
- package/dist/components/dropdown/hooks/usePositioning.cjs +1 -0
- package/dist/components/dropdown/hooks/usePositioning.js +1 -0
- package/dist/components/dropdown/index.cjs +1 -0
- package/dist/components/dropdown/index.js +1 -0
- package/dist/components/dumbbell-chart/DumbbellChart.cjs +1 -0
- package/dist/components/dumbbell-chart/DumbbellChart.js +1 -0
- package/dist/components/dumbbell-chart/index.cjs +1 -0
- package/dist/components/dumbbell-chart/index.js +1 -0
- package/dist/components/file-selector/FileSelector.cjs +1 -0
- package/dist/components/file-selector/FileSelector.js +1 -0
- package/dist/components/file-selector/index.cjs +1 -0
- package/dist/components/file-selector/index.js +1 -0
- package/dist/components/footer/Footer.cjs +1 -0
- package/dist/components/footer/Footer.js +1 -0
- package/dist/components/footer/FooterBottom.cjs +1 -0
- package/dist/components/footer/FooterBottom.js +1 -0
- package/dist/components/footer/FooterColumn.cjs +1 -0
- package/dist/components/footer/FooterColumn.js +1 -0
- package/dist/components/footer/FooterLink.cjs +1 -0
- package/dist/components/footer/FooterLink.js +1 -0
- package/dist/components/footer/FooterSection.cjs +1 -0
- package/dist/components/footer/FooterSection.js +1 -0
- package/dist/components/footer/FooterSocial.cjs +1 -0
- package/dist/components/footer/FooterSocial.js +1 -0
- package/dist/components/footer/index.cjs +1 -0
- package/dist/components/footer/index.js +1 -0
- package/dist/components/form/index.cjs +1 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/input/Input.cjs +1 -0
- package/dist/components/form/input/Input.js +1 -0
- package/dist/components/form/input/index.cjs +1 -0
- package/dist/components/form/input/index.js +1 -0
- package/dist/components/form/mention-input/MentionInput.cjs +1 -0
- package/dist/components/form/mention-input/MentionInput.js +1 -0
- package/dist/components/form/mention-input/index.cjs +1 -0
- package/dist/components/form/mention-input/index.js +1 -0
- package/dist/components/form/number-input/NumberInput.cjs +1 -0
- package/dist/components/form/number-input/NumberInput.js +1 -0
- package/dist/components/form/number-input/index.cjs +1 -0
- package/dist/components/form/number-input/index.js +1 -0
- package/dist/components/form/shared/InputWrapper.cjs +1 -0
- package/dist/components/form/shared/InputWrapper.js +1 -0
- package/dist/components/form/shared/inputStyles.cjs +1 -0
- package/dist/components/form/shared/inputStyles.js +1 -0
- package/dist/components/form/types/mention.cjs +1 -0
- package/dist/components/form/types/mention.js +0 -0
- package/dist/components/funnel-chart/FunnelChart.cjs +1 -0
- package/dist/components/funnel-chart/FunnelChart.js +1 -0
- package/dist/components/funnel-chart/index.cjs +1 -0
- package/dist/components/funnel-chart/index.js +1 -0
- package/dist/components/gantt-chart/GanttChart.cjs +1 -0
- package/dist/components/gantt-chart/GanttChart.js +1 -0
- package/dist/components/gantt-chart/index.cjs +1 -0
- package/dist/components/gantt-chart/index.js +1 -0
- package/dist/components/header/Header.cjs +1 -0
- package/dist/components/header/Header.js +1 -0
- package/dist/components/header/index.cjs +1 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/heat-map/Heatmap.cjs +1 -0
- package/dist/components/heat-map/Heatmap.js +1 -0
- package/dist/components/heat-map/index.cjs +1 -0
- package/dist/components/heat-map/index.js +1 -0
- package/dist/components/help-button/HelpButton.cjs +22 -0
- package/dist/components/help-button/HelpButton.js +22 -0
- package/dist/components/help-button/MarkdownEditor.cjs +1 -0
- package/dist/components/help-button/MarkdownEditor.js +1 -0
- package/dist/components/help-button/index.cjs +1 -0
- package/dist/components/help-button/index.js +1 -0
- package/dist/components/help-button/types.cjs +1 -0
- package/dist/components/help-button/types.js +0 -0
- package/dist/components/image-uploader/ImageUploader.cjs +1 -0
- package/dist/components/image-uploader/ImageUploader.js +1 -0
- package/dist/components/image-uploader/index.cjs +1 -0
- package/dist/components/image-uploader/index.js +1 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/indicator/Indicator.cjs +1 -0
- package/dist/components/indicator/Indicator.js +1 -0
- package/dist/components/indicator/index.cjs +1 -0
- package/dist/components/indicator/index.js +1 -0
- package/dist/components/label/Label.cjs +1 -0
- package/dist/components/label/Label.js +1 -0
- package/dist/components/label/index.cjs +1 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/line-chart/LineChart.cjs +1 -0
- package/dist/components/line-chart/LineChart.js +1 -0
- package/dist/components/line-chart/index.cjs +1 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/modal/Modal.cjs +1 -0
- package/dist/components/modal/Modal.js +1 -0
- package/dist/components/modal/index.cjs +1 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/pagination/Pagination.cjs +1 -0
- package/dist/components/pagination/Pagination.js +1 -0
- package/dist/components/pagination/index.cjs +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pie-chart/PieChart.cjs +1 -0
- package/dist/components/pie-chart/PieChart.js +1 -0
- package/dist/components/pie-chart/index.cjs +1 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/progress-bar/ProgressBar.cjs +1 -0
- package/dist/components/progress-bar/ProgressBar.js +1 -0
- package/dist/components/progress-bar/index.cjs +1 -0
- package/dist/components/progress-bar/index.js +1 -0
- package/dist/components/radio-button/RadioButton.cjs +1 -0
- package/dist/components/radio-button/RadioButton.js +1 -0
- package/dist/components/radio-button/index.cjs +1 -0
- package/dist/components/radio-button/index.js +1 -0
- package/dist/components/scatter-chart/ScatterChart.cjs +1 -0
- package/dist/components/scatter-chart/ScatterChart.js +1 -0
- package/dist/components/scatter-chart/index.cjs +1 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/schema-editor/SchemaEditor.cjs +1 -0
- package/dist/components/schema-editor/SchemaEditor.js +1 -0
- package/dist/components/schema-editor/SchemaEditor.types.cjs +1 -0
- package/dist/components/schema-editor/SchemaEditor.types.js +0 -0
- package/dist/components/schema-editor/canvas/GridLayer.cjs +1 -0
- package/dist/components/schema-editor/canvas/GridLayer.js +1 -0
- package/dist/components/schema-editor/index.cjs +1 -0
- package/dist/components/schema-editor/index.js +1 -0
- package/dist/components/schema-editor/legend/SchemaLegend.cjs +1 -0
- package/dist/components/schema-editor/legend/SchemaLegend.js +1 -0
- package/dist/components/schema-editor/minimap/SchemaMinimap.cjs +1 -0
- package/dist/components/schema-editor/minimap/SchemaMinimap.js +1 -0
- package/dist/components/schema-editor/relations/SchemaRelationRenderer.cjs +1 -0
- package/dist/components/schema-editor/relations/SchemaRelationRenderer.js +1 -0
- package/dist/components/schema-editor/tables/SchemaTableRenderer.cjs +1 -0
- package/dist/components/schema-editor/tables/SchemaTableRenderer.js +1 -0
- package/dist/components/schema-editor/toolbar/SchemaToolbar.cjs +1 -0
- package/dist/components/schema-editor/toolbar/SchemaToolbar.js +1 -0
- package/dist/components/schema-editor/utils/auto-layout.cjs +1 -0
- package/dist/components/schema-editor/utils/auto-layout.js +1 -0
- package/dist/components/schema-editor/utils/geometry.cjs +1 -0
- package/dist/components/schema-editor/utils/geometry.js +1 -0
- package/dist/components/schema-editor/utils/schema-helpers.cjs +1 -0
- package/dist/components/schema-editor/utils/schema-helpers.js +1 -0
- package/dist/components/schema-editor/utils/sql-export.cjs +9 -0
- package/dist/components/schema-editor/utils/sql-export.js +9 -0
- package/dist/components/select/Select.cjs +1 -0
- package/dist/components/select/Select.js +1 -0
- package/dist/components/select/index.cjs +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/sidebar/Sidebar.cjs +1 -0
- package/dist/components/sidebar/Sidebar.js +1 -0
- package/dist/components/sidebar/index.cjs +1 -0
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/skeleton/Skeleton.cjs +1 -0
- package/dist/components/skeleton/Skeleton.js +1 -0
- package/dist/components/skeleton/index.cjs +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/slider/Slider.cjs +1 -0
- package/dist/components/slider/Slider.js +1 -0
- package/dist/components/slider/index.cjs +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/sparkline/Sparkline.cjs +1 -0
- package/dist/components/sparkline/Sparkline.js +1 -0
- package/dist/components/sparkline/index.cjs +1 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/stat-card/StatCard.cjs +1 -0
- package/dist/components/stat-card/StatCard.js +1 -0
- package/dist/components/stat-card/StatCardGroup.cjs +1 -0
- package/dist/components/stat-card/StatCardGroup.js +1 -0
- package/dist/components/stat-card/index.cjs +1 -0
- package/dist/components/stat-card/index.js +1 -0
- package/dist/components/table/Table.cjs +1 -0
- package/dist/components/table/Table.js +1 -0
- package/dist/components/table/TableBody.cjs +1 -0
- package/dist/components/table/TableBody.js +1 -0
- package/dist/components/table/TableCell.cjs +1 -0
- package/dist/components/table/TableCell.js +1 -0
- package/dist/components/table/TableHeader.cjs +1 -0
- package/dist/components/table/TableHeader.js +1 -0
- package/dist/components/table/TableHeaderCell.cjs +1 -0
- package/dist/components/table/TableHeaderCell.js +1 -0
- package/dist/components/table/TableRow.cjs +1 -0
- package/dist/components/table/TableRow.js +1 -0
- package/dist/components/table/index.cjs +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/Tabs.cjs +1 -0
- package/dist/components/tabs/Tabs.js +1 -0
- package/dist/components/tabs/TabsContent.cjs +1 -0
- package/dist/components/tabs/TabsContent.js +1 -0
- package/dist/components/tabs/TabsContext.cjs +1 -0
- package/dist/components/tabs/TabsContext.js +1 -0
- package/dist/components/tabs/TabsList.cjs +1 -0
- package/dist/components/tabs/TabsList.js +1 -0
- package/dist/components/tabs/TabsTrigger.cjs +1 -0
- package/dist/components/tabs/TabsTrigger.js +1 -0
- package/dist/components/tabs/index.cjs +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/toast/Toast.cjs +1 -0
- package/dist/components/toast/Toast.js +1 -0
- package/dist/components/toast/index.cjs +1 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/tooltip/Tooltip.cjs +1 -0
- package/dist/components/tooltip/Tooltip.js +1 -0
- package/dist/components/tooltip/index.cjs +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/waterfall-chart/WaterfallChart.cjs +1 -0
- package/dist/components/waterfall-chart/WaterfallChart.js +1 -0
- package/dist/components/waterfall-chart/index.cjs +1 -0
- package/dist/components/waterfall-chart/index.js +1 -0
- package/dist/components/wizard/Wizard.cjs +1 -0
- package/dist/components/wizard/Wizard.js +1 -0
- package/dist/components/wizard/index.cjs +1 -0
- package/dist/components/wizard/index.js +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.cjs +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.js +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.types.cjs +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.types.js +0 -0
- package/dist/components/workflow-editor/canvas/GridLayer.cjs +1 -0
- package/dist/components/workflow-editor/canvas/GridLayer.js +1 -0
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.cjs +1 -0
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.js +1 -0
- package/dist/components/workflow-editor/index.cjs +1 -0
- package/dist/components/workflow-editor/index.js +1 -0
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.cjs +1 -0
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.js +1 -0
- package/dist/components/workflow-editor/toolbar/WorkflowToolbar.cjs +1 -0
- package/dist/components/workflow-editor/toolbar/WorkflowToolbar.js +1 -0
- package/dist/components/workflow-editor/utils/geometry.cjs +1 -0
- package/dist/components/workflow-editor/utils/geometry.js +1 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDialogA11y.cjs +1 -0
- package/dist/hooks/useDialogA11y.js +1 -0
- package/dist/index.cjs +1 -31
- package/dist/index.d.cts +778 -106
- package/dist/index.d.ts +778 -106
- package/dist/index.js +1 -31
- package/dist/lib/aria-hide.cjs +1 -0
- package/dist/lib/aria-hide.js +1 -0
- package/dist/lib/cn.cjs +1 -0
- package/dist/lib/cn.js +1 -0
- package/dist/lib/dialog-stack.cjs +1 -0
- package/dist/lib/dialog-stack.js +1 -0
- package/dist/lib/focus.cjs +1 -0
- package/dist/lib/focus.js +1 -0
- package/dist/lib/i18n.cjs +1 -0
- package/dist/lib/i18n.js +1 -0
- package/dist/markdown-editor.cjs +1 -1
- package/dist/markdown-editor.js +1 -1
- package/dist/styles.css +139 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as ct,useCallback as ee,useId as Ct,useMemo as M,useState as ze}from"react";import{cn as vt}from"../../lib/cn.js";import{useUILabels as xt}from"../../lib/i18n.js";import{ChartAnnotationLayer as rt,describeAnnotations as kt}from"../chart/ChartAnnotations.js";import{ChartAxis as ot}from"../chart/ChartAxis.js";import{ChartBrushLayer as wt,useChartBrush as St}from"../chart/ChartBrush.js";import{ChartContainer as Bt}from"../chart/ChartContainer.js";import{ChartGrid as Pt}from"../chart/ChartGrid.js";import{ChartLegend as Lt}from"../chart/ChartLegend.js";import{ChartPatternDefs as At,patternFill as Rt}from"../chart/ChartPatterns.js";import{ChartScaleLegend as Et}from"../chart/ChartScaleLegend.js";import{useChartSync as Mt}from"../chart/ChartSync.js";import{ChartTableView as Vt}from"../chart/ChartTableView.js";import{ChartTooltip as Tt,ChartTooltipContent as It}from"../chart/ChartTooltip.js";import{CHART_MUTED_COLOR as Dt,createDivergingScale as at,getSeriesLabel as lt,resolveSeriesColor as Wt,toLegendItems as Ht}from"../chart/palette.js";import{buildCartesianGeometry as Nt,createCategoryLocator as $t,createPlotContext as Ot,splitOverlay as Kt}from"../chart/utils/cartesian.js";import{collectAllValues as Ge,readNumber as ve}from"../chart/utils/data.js";import{formatAuto as _t,formatPercent as Xt,formatXValue as zt}from"../chart/utils/format.js";import{binValues as Gt}from"../chart/utils/bins.js";import{buildBarPath as Ut,buildLinePath as Ft}from"../chart/utils/path.js";import{nearestIndex as Yt,toKey as it}from"../chart/utils/scales.js";import{stackDiverging as Zt,stackExtent as jt,stackSeries as qt}from"../chart/utils/stack.js";import{estimateTextWidth as Jt}from"../chart/utils/text.js";import{extent as st,resolveDomain as Qt}from"../chart/utils/ticks.js";import{Fragment as ln,jsx as i,jsxs as ue}from"react/jsx-runtime";var en=24,Q=2,tn=4,ce=6,nn=10,Ue=!1,Fe=!1;function In(){Ue=!1,Fe=!1}var rn=ct(function({bars:b,patterns:n,patternBaseId:h}){return i("g",{children:b.map((f,P)=>ue("g",{children:[i("path",{d:f.d,fill:Rt(n,h,f.slot,f.color)}),f.label?i("text",{x:f.label.x,y:f.label.y,textAnchor:f.label.anchor,dominantBaseline:"middle",className:"fill-gray-600 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-300",children:f.label.text}):null]},`${f.key}-${P}`))})}),on=ct(function({lines:b}){return i("g",{children:b.map(n=>ue("g",{children:[i("path",{d:n.d,fill:"none",stroke:n.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:n.dashed?"5 4":void 0}),n.markers.map(h=>i("circle",{cx:h.x,cy:h.y,r:3,fill:n.color,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"},`${h.x}-${h.y}`))]},n.key))})});function an({width:C,height:b,data:n,resolvedSeries:h,x:f,y:P,grid:V,size:xe,orientation:L,stack:W,center:A,centerKey:T,valueColors:K,binned:te,curve:ke,barSize:we,showValues:Se,referenceLines:Ie,annotations:_,annotationsLabel:De,patterns:Be,patternBaseId:ne,overlay:Pe,brush:R,onBrush:X,brushLabel:We,syncEnabled:He,margin:re,tooltip:z,onPointClick:he,plotLabel:Le,formatValue:H,formatRaw:G,formatX:oe}){let[de,me]=ze(null),u=de!==null&&de<n.length?de:null,[Ne,$e]=ze(null),I=Mt(),p=He?I:null,e=M(()=>{let t=L==="vertical",r=h.filter(m=>!m.hidden),a=r.filter(m=>m.type!=="line"),g=r.filter(m=>m.type==="line"),k=a.map(m=>m.key),d=T!==null||W!=="none",$=T!==null?Zt(n,k,{centerKey:T,percent:W==="percent"}):qt(n,k,W),l=d?jt($):st(Ge(n,k)),o=st(Ge(n,g.map(m=>m.key))),s=l===null?o:o===null?l:[Math.min(l[0],o[0]),Math.max(l[1],o[1])],c=Nt({width:C,height:b,data:n,x:f,y:P,bounds:s===null?null:[Math.min(s[0],A),Math.max(s[1],A)],margin:re,orientation:L,placement:"band",bandPaddingInner:te?0:void 0,formatValue:H,formatX:oe,defaultIncludeZero:A===0}),{valueScale:Z,bandwidth:pe,categoryPositions:Ye,innerWidth:Ze,innerHeight:je}=c,ut=Z(A),Ee=Math.max(1,a.length),ht=d?pe:pe/Ee,O=Math.min(we??(te?Number.POSITIVE_INFINITY:en),Math.max(1,ht-(d&&!te?0:Q))),dt=d?O:Ee*O+(Ee-1)*Q,qe=(pe-dt)/2,Je=[],Qe=m=>d?m.end>=m.start:m.end>=A;$.forEach((m,Me)=>{let j=-1,Ve=-1;m.segments.forEach((B,ie)=>{B.value!==null&&B.outer!==!1&&(Qe(B)?j=ie:Ve=ie)});let le=0,ye=0;m.segments.forEach((B,ie)=>{if(B.value===null)return;let Ke=a[ie],y=Qe(B),et=Z(d?B.start:A),tt=Z(B.end),q=Math.min(et,tt),se=Math.abs(tt-et),ft=B.base??(y?le===0:ye===0),gt=t?!y:y;d&&!ft&&se>Q&&(se-=Q,gt&&(q+=Q)),y?le+=1:ye+=1;let Te=Ye[Me]+(d?qe:qe+ie*(O+Q)),bt=ie===(y?j:Ve)?t?y?"top":"bottom":y?"right":"left":"none",pt=t?{x:Te,y:q,width:O,height:se}:{x:q,y:Te,width:se,height:O},_e=null;if(Se&&!d){let Xe=G(B.value),nt=Jt(Xe,10);if(t){let J=y?q:q+se,Ce=y?J-ce:J+ce,yt=Ee>1?O+Q:pe;nt<=yt&&(y?Ce>8:Ce<je-4)&&(_e={x:Te+O/2,y:Ce,anchor:"middle",text:Xe})}else{let J=y?q+se:q,Ce=y?Ze-J-ce:J-ce;nt<=Ce&&(_e={x:y?J+ce:J-ce,y:Te+O/2,anchor:y?"start":"end",text:Xe})}}Je.push({key:Ke.key,slot:Ke.slot,color:K&&B.value!==null?K(B.value):Ke.color,d:Ut({...pt,radius:tn,round:bt}),label:_e})})});let mt=g.map(m=>{let Me=c.categoryCenters.map((j,Ve)=>{let le=ve(n[Ve],m.key),ye=le===null?Number.NaN:Z(le);return{x:t?j:ye,y:t?ye:j,defined:le!==null}});return{key:m.key,color:m.color,dashed:m.dashed,d:Ft(Me,ke),markers:Me.filter(j=>j.defined!==!1)}});return{vertical:t,visible:r,locate:$t(c),barSeries:a,rows:$,stacked:d,plot:Ot({geometry:c,width:C,height:b,data:n,series:r,formatValue:H,formatX:oe}),xValues:c.xValues,categoryPositions:Ye,categoryCenters:c.categoryCenters,bandwidth:pe,categoryTicks:c.categoryTicks,valueTicks:c.valueTicks,valueScale:Z,baseline:ut,innerWidth:Ze,innerHeight:je,margin:c.margin,bars:Je,lines:mt}},[n,h,f,P,C,b,re,L,W,A,T,K,te,ke,we,Se,H,G,oe]),fe=ee(t=>e.visible.map(r=>{let a=ve(n[t],r.key),g=e.barSeries.indexOf(r),k=g===-1?null:e.rows[t].segments[g],d=a===null?"\u2014":W==="percent"&&k!==null?`${G(a)} (${H(k.end-k.start)})`:H(a);return{seriesKey:r.key,seriesLabel:lt(r),color:r.color,value:a,formattedValue:d,datum:n[t]}}),[n,e.visible,e.barSeries,e.rows,W,H,G]),ge=p?p.brush:Ne,Ae=ee(t=>{$e(t),p?.setBrush(t),X?.(t)},[p,X]),v=St({enabled:R,active:ge!==null,centers:e.categoryCenters,xValues:e.xValues,offset:e.vertical?e.margin.left:e.margin.top,orientation:L,onCommit:Ae}),Oe=ee(t=>{if(v.onPointerMove(t),z===!1||n.length===0)return;let r=t.currentTarget.getBoundingClientRect(),a=e.vertical?t.clientX-r.left-e.margin.left:t.clientY-r.top-e.margin.top,g=Yt(e.categoryCenters,a);me(g>=0?g:null),p?.setHovered(g>=0?e.xValues[g]:null)},[v,z,n.length,e.vertical,e.margin,e.categoryCenters,e.xValues,p]),w=ee(()=>{me(null),p?.setHovered(null)},[p]),x=ee(t=>{if(n.length===0)return;v.onKeyDown(t,u);let r=n.length-1,a=u??0,g=e.vertical?"ArrowRight":"ArrowDown",k=e.vertical?"ArrowLeft":"ArrowUp",d=t.key===g?Math.min(r,a+1):t.key===k?Math.max(0,a-1):t.key==="Home"?0:t.key==="End"?r:t.key==="Escape"?null:void 0;d!==void 0&&(t.preventDefault(),me(d),p?.setHovered(d===null?null:e.xValues[d]))},[n.length,u,e.vertical,v,p,e.xValues]),U=ee(()=>{if(v.consumedClick()||!he||u===null)return;let[t]=fe(u);t&&he({...t,index:u,x:e.xValues[u]})},[v,he,u,fe,e.xValues]),N=u!==null||!p?.hovered?null:(()=>{let t=it(p.hovered),r=e.xValues.findIndex(a=>it(a)===t);return r<0?null:r})(),E=u??N,S=v.dragging??ge,D=(()=>{if(!S)return null;let t=e.locate(S.from),r=e.locate(S.to);if(t===null||r===null)return null;let a=e.bandwidth/2;return{from:Math.min(t,r)-a,to:Math.max(t,r)+a}})(),F=Kt(Pe),Re=u===null?null:fe(u),Y=u===null||Re===null?null:{x:e.xValues[u],xLabel:oe(e.xValues[u],u),index:u,points:Re},be=t=>{let r=e.rows[t].segments.filter(a=>a.value!==null).map(a=>e.valueScale(a.end));for(let a of e.lines){let g=ve(n[t],a.key);g!==null&&r.push(e.valueScale(g))}return r},ae=u===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[u],y:e.margin.top+Math.min(...be(u),e.baseline)}:{x:e.margin.left+Math.max(...be(u),e.baseline),y:e.margin.top+e.categoryCenters[u]};return ue(ln,{children:[ue("svg",{width:C,height:b,role:"img","aria-label":Le??[e.visible.map(t=>lt(t)).join(", "),kt(_,De)].filter(Boolean).join(". "),tabIndex:0,className:vt("touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",R&&"select-none"),onPointerDown:v.onPointerDown,onPointerMove:Oe,onPointerUp:v.onPointerUp,onPointerCancel:v.onPointerUp,onPointerLeave:w,onKeyDown:x,onBlur:w,onClick:U,children:[Be?i(At,{id:ne,entries:h.map(t=>({slot:t.slot,color:t.color}))}):null,ue("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[i(Pt,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(V==="y"||V==="both")?e.valueTicks.map(t=>t.offset):void 0,vertical:!e.vertical&&(V==="y"||V==="both")?e.valueTicks.map(t=>t.offset):void 0}),_?i(rt,{layer:"under",annotations:_,xAt:e.locate,yAt:e.valueScale,width:e.innerWidth,height:e.innerHeight,bandwidth:e.bandwidth}):null,D?i(wt,{from:D.from,to:D.to,width:e.innerWidth,height:e.innerHeight,orientation:L,live:v.dragging!==null,label:We}):null,E!==null?i("rect",{x:e.vertical?e.categoryPositions[E]:0,y:e.vertical?0:e.categoryPositions[E],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,F.under?.(e.plot),i(rn,{bars:e.bars,patterns:Be,patternBaseId:ne}),e.lines.length>0?i(on,{lines:e.lines}):null,i("line",{x1:e.vertical?0:e.baseline,y1:e.vertical?e.baseline:0,x2:e.vertical?e.innerWidth:e.baseline,y2:e.vertical?e.baseline:e.innerHeight,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"}),_?i(rt,{annotations:_,xAt:e.locate,yAt:e.valueScale,width:e.innerWidth,height:e.innerHeight,bandwidth:e.bandwidth}):null,F.over?.(e.plot),Ie?.map(t=>{let r=e.valueScale(t.value),a=r<nn?r+12:r-4;return ue("g",{children:[i("line",{x1:e.vertical?0:r,y1:e.vertical?r:0,x2:e.vertical?e.innerWidth:r,y2:e.vertical?r:e.innerHeight,stroke:t.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:t.dashed===!1?void 0:"4 4"}),t.label?i("text",{x:e.vertical?e.innerWidth:r+4,y:e.vertical?a:8,textAnchor:e.vertical?"end":"start",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:t.label}):null]},`${t.value}-${t.label??""}`)})]}),i("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?f.hidden:P?.hidden)?null:i(ot,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?f.label:P?.label,size:xe})}),i("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?P?.hidden:f.hidden)?null:i(ot,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?P?.label:f.label,size:xe})})]}),Y&&ae&&z!==!1?i(Tt,{x:ae.x,y:ae.y,containerWidth:C,children:typeof z=="function"?z(Y):i(It,{title:Y.xLabel,points:Y.points})}):null]})}function Dn({data:C,series:b,x:n,y:h,height:f=260,width:P,size:V="md",grid:xe="y",legend:L,tooltip:W=!0,tableView:A=!1,emphasis:T,title:K,description:te,loading:ke=!1,emptyState:we,error:Se=!1,errorState:Ie,onRetry:_,actions:De,onPointClick:Be,orientation:ne="vertical",stack:Pe="none",diverging:R,bins:X,curve:We="linear",barSize:He,sort:re="none",showValues:z=!1,referenceLines:he,annotations:Le,overlay:H,patterns:G=!1,legendToggle:oe=!0,brush:de=!1,onBrush:me,brushLabel:u,sync:Ne=!0,margin:$e,locale:I,plotLabel:p,className:e,...fe}){let ge=xt(),[Ae,v]=ze(()=>new Set),Oe=Ct(),w=X!==void 0&&X!==!1,x=w||typeof R!="string"?null:R,U=!w&&typeof R=="number"?R:0,N=M(()=>{let l=x===null?null:at([0,Math.max(1,b.length-1)],{center:Math.max(0,b.findIndex(o=>o.key===x)),symmetric:!1});return b.map((o,s)=>({...o,slot:s,hidden:o.hidden||Ae.has(o.key),color:l&&!o.color&&!T?o.key===x?Dt:l(s):Wt(o,s,T)}))},[b,Ae,T,x]),E=M(()=>l=>_t(l,I),[I]),S=M(()=>{if(!w)return null;b.length>1&&!Ue&&(Ue=!0,console.warn("[@synertech/ui] BarChart was given `bins` and more than one series. A histogram counts a single field \u2014 the extra series are ignored. Facet the chart, or draw the distributions side by side."));let l=b[0]?.key??"count",o=n.format?c=>n.format(c,0):c=>E(c),s=Gt(C.map(c=>ve(c,n.key)),X);return{rows:s.map(c=>({[n.key]:c.from,[l]:c.count})),labels:s.map(c=>`${o(c.from)}\u2013${o(c.to)}`)}},[w,X,C,n.key,n.format,b,E]),D=M(()=>{if(S)return S.rows;if(re==="none")return C;let l=N.filter(s=>!s.hidden).map(s=>s.key),o=s=>l.reduce((c,Z)=>c+(ve(s,Z)??0),0);return[...C].sort((s,c)=>re==="asc"?o(s)-o(c):o(c)-o(s))},[S,C,re,N]),F=!w&&Pe==="percent",Re=M(()=>F?{domain:x===null?[0,100]:[-100,100],...h}:h,[F,x,h]),Y=M(()=>{let l=h?.format??(F?o=>Xt(o,{locale:I,alreadyScaled:!0,maximumFractionDigits:0}):E);return x===null?l:o=>l(Math.abs(o))},[h?.format,F,I,E,x]),be=M(()=>S?(l,o)=>S.labels[o]??"":n.format??(l=>zt(l,I)),[S,n.format,I]),ae=M(()=>S?{...n,scale:"category"}:n,[S,n]),t=ee(l=>{v(o=>{let s=new Set(o);return s.has(l)?s.delete(l):s.add(l),s})},[]),r=ne==="vertical"?Le:void 0;Le&&ne!=="vertical"&&!Fe&&(Fe=!0,console.warn("[@synertech/ui] BarChart was given `annotations` and a horizontal orientation. Annotations are read on the category axis, which runs up the side there: they are ignored. Use `referenceLines` for a threshold on the value axis."));let a=L===void 0?b.length>=2:L!==!1,g=typeof L=="string"?L:"bottom",k=N.filter(l=>!l.hidden),d=k.length,$=M(()=>{if(w||R===void 0||R===!1||x!==null||d!==1)return null;let l=Ge(D,k.map(s=>s.key)),o=Qt([...l,U],{domain:h?.domain,includeZero:h?.includeZero??U===0,ticks:h?.ticks??5});return at(o,{center:U})},[w,R,x,d,k,D,U,h]);return i(Bt,{title:K,description:te,height:f,width:P,size:V,loading:ke,empty:D.length===0||d===0,emptyState:we,error:Se,errorState:Ie,onRetry:_,actions:De,tableView:A,legendPosition:g,legend:$?i(Et,{scale:$,label:h?.label,format:Y,size:V,locale:I}):a?i(Lt,{items:Ht(N,T,G),position:g,marker:"rect",size:V,onToggle:oe?t:void 0}):void 0,table:A?i(Vt,{data:D,series:N,xKey:ae.key,xLabel:n.label??n.key,formatX:be,formatValue:E,caption:typeof K=="string"?K:void 0}):void 0,className:e,...fe,children:({width:l})=>i(an,{width:l,height:f,data:D,resolvedSeries:N,x:ae,y:Re,grid:xe,size:V,orientation:ne,stack:w?"none":Pe,center:U,centerKey:x,valueColors:$,binned:w,curve:We,barSize:He,showValues:z,referenceLines:he,annotations:r,annotationsLabel:ge.chartAnnotations,patterns:G&&$===null,patternBaseId:Oe,overlay:H,brush:de,onBrush:me,brushLabel:u??ge.chartBrush,syncEnabled:Ne,margin:$e,tooltip:W,onPointClick:Be,plotLabel:p,formatValue:Y,formatRaw:E,formatX:be})})}export{Dn as BarChart,In as resetBarChartWarnings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var i=(a,r)=>{for(var e in r)h(a,e,{get:r[e],enumerable:!0})},s=(a,r,e,B)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of n(r))!p.call(a,t)&&t!==e&&h(a,t,{get:()=>r[t],enumerable:!(B=C(r,t))||B.enumerable});return a};var f=a=>s(h({},"__esModule",{value:!0}),a);var m={};i(m,{BarChart:()=>o.BarChart,resetBarChartWarnings:()=>o.resetBarChartWarnings});module.exports=f(m);var o=require("./BarChart.cjs");0&&(module.exports={BarChart,resetBarChartWarnings});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BarChart as t,resetBarChartWarnings as e}from"./BarChart.js";export{t as BarChart,e as resetBarChartWarnings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var se=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Ie=(m,o)=>{for(var d in o)se(m,d,{get:o[d],enumerable:!0})},ze=(m,o,d,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Ve(o))!De.call(m,n)&&n!==d&&se(m,n,{get:()=>o[n],enumerable:!(a=Xe(o,n))||a.enumerable});return m};var Ge=m=>ze(se({},"__esModule",{value:!0}),m);var _e={};Ie(_e,{BoxPlot:()=>Ue});module.exports=Ge(_e);var f=require("react"),ue=require("../../lib/i18n.cjs"),me=require("../chart/ChartAxis.cjs"),Ce=require("../chart/ChartContainer.cjs"),ke=require("../chart/ChartGrid.cjs"),ve=require("../chart/ChartTooltip.cjs"),Ne=require("../chart/palette.cjs"),Pe=require("../chart/utils/cartesian.cjs"),w=require("../chart/utils/data.cjs"),J=require("../chart/utils/format.cjs"),Be=require("../chart/utils/path.cjs"),Te=require("../chart/utils/quantile.cjs"),we=require("../chart/utils/scales.cjs"),Se=require("../table/Table.cjs"),Le=require("../table/TableBody.cjs"),z=require("../table/TableCell.cjs"),Re=require("../table/TableHeader.cjs"),B=require("../table/TableHeaderCell.cjs"),Me=require("../table/TableRow.cjs"),t=require("react/jsx-runtime"),qe=40,Ke=3,F=4,ce="text-right [font-variant-numeric:tabular-nums]",Oe=(0,f.memo)(function({boxes:o,color:d}){return(0,t.jsx)("g",{children:o.map(a=>(0,t.jsxs)("g",{children:[(0,t.jsx)("g",{stroke:d,strokeWidth:1.5,strokeLinecap:"round",children:a.whiskers.map(n=>(0,t.jsx)("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},n.key))}),a.body?(0,t.jsx)("path",{d:a.body,fill:d}):null,a.median?(0,t.jsx)("line",{x1:a.median.x1,y1:a.median.y1,x2:a.median.x2,y2:a.median.y2,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"}):null,a.mean?(0,t.jsx)("path",{d:`M${a.mean.cx},${a.mean.cy-F} L${a.mean.cx+F},${a.mean.cy} L${a.mean.cx},${a.mean.cy+F} L${a.mean.cx-F},${a.mean.cy} Z`,strokeWidth:1.5,stroke:d,className:"fill-white dark:fill-gray-800"}):null,a.outliers.map(n=>(0,t.jsx)("circle",{cx:n.cx,cy:n.cy,r:Ke,fill:d,strokeWidth:1.5,className:"stroke-white dark:stroke-gray-800"},n.key))]},a.key))})});function Qe({width:m,height:o,data:d,boxes:a,x:n,y:N,grid:M,size:G,orientation:S,boxSize:q,showOutliers:K,showMean:E,color:O,referenceLines:ee,margin:W,tooltip:L,plotLabel:te,formatValue:A,formatX:H,onBoxClick:X}){let[h,$]=(0,f.useState)(null),Q=(0,ue.useUILabels)(),e=(0,f.useMemo)(()=>{let r=S==="vertical",i=a.flatMap(c=>c.stats===null?[]:[c.stats.min,c.stats.max,...E&&c.mean!==null?[c.mean]:[]]),p=(0,Pe.buildCartesianGeometry)({width:m,height:o,data:d,x:n,y:N,bounds:i.length===0?null:[Math.min(...i),Math.max(...i)],margin:W,orientation:S,placement:"band",formatValue:A,formatX:H,defaultIncludeZero:!1}),{valueScale:x,bandwidth:C,categoryPositions:k,innerWidth:D,innerHeight:I}=p,P=Math.min(q??qe,C),l=P*.5,g=(c,b)=>r?{x:c,y:b}:{x:b,y:c},U=a.map((c,b)=>{let v=k[b]+(C-P)/2,u=v+P/2;if(c.stats===null)return{key:`${b}`,body:"",median:null,whiskers:[],outliers:[],mean:null,top:k[b],height:C};let{q1:y,q3:T,median:_,lower:Y,upper:Ae,outliers:He}=c.stats,de=x(y),he=x(T),ge=Math.min(de,he),ye=Math.abs(he-de),$e=(0,Be.buildBarPath)({...r?{x:v,y:ge,width:P,height:Math.max(1,ye)}:{x:ge,y:v,width:Math.max(1,ye),height:P},radius:2,round:"none"}),j=x(_),Ee=r?{x1:v,y1:j,x2:v+P,y2:j}:{x1:j,y1:v,x2:j,y2:v+P},le=[];for(let[R,oe,Z]of[["lower",Y,y],["upper",Ae,T]]){let ie=x(oe),We=x(Z),fe=g(u,ie),pe=g(u,We);le.push({key:`${R}-stem`,x1:pe.x,y1:pe.y,x2:fe.x,y2:fe.y});let xe=g(u-l/2,ie),be=g(u+l/2,ie);le.push({key:`${R}-cap`,x1:xe.x,y1:xe.y,x2:be.x,y2:be.y})}return{key:`${b}`,body:$e,median:Ee,whiskers:le,outliers:K?He.map((R,oe)=>{let Z=g(u,x(R));return{key:`${oe}`,cx:Z.x,cy:Z.y}}):[],mean:E&&c.mean!==null?(()=>{let R=g(u,x(c.mean));return{cx:R.x,cy:R.y}})():null,top:k[b],height:C}});return{vertical:r,rendered:U,categoryPositions:k,categoryCenters:p.categoryCenters,bandwidth:C,categoryTicks:p.categoryTicks,valueTicks:p.valueTicks,valueScale:x,innerWidth:D,innerHeight:I,margin:p.margin}},[a,d,n,N,m,o,W,S,q,K,E,A,H]),ae=(0,f.useCallback)(r=>{if(L===!1||a.length===0)return;let i=r.currentTarget.getBoundingClientRect(),p=e.vertical?r.clientX-i.left-e.margin.left:r.clientY-i.top-e.margin.top;$((0,we.nearestIndex)(e.categoryCenters,p))},[L,a.length,e.vertical,e.margin,e.categoryCenters]),re=(0,f.useCallback)(r=>{if(a.length===0)return;let i=a.length-1,p=h??0,x=e.vertical?"ArrowRight":"ArrowDown",C=e.vertical?"ArrowLeft":"ArrowUp",k=r.key===x?Math.min(i,p+1):r.key===C?Math.max(0,p-1):r.key==="Home"?0:r.key==="End"?i:r.key==="Escape"?null:void 0;k!==void 0&&(r.preventDefault(),$(k))},[a.length,h,e.vertical]),ne=(0,f.useCallback)(()=>{!X||h===null||X(a[h])},[X,h,a]),s=h===null?null:a[h],V=h===null||s===null||s.stats===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[h],y:e.margin.top+e.valueScale(s.stats.q3)}:{x:e.margin.left+e.valueScale(s.stats.q3),y:e.margin.top+e.categoryCenters[h]};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:m,height:o,role:"img","aria-label":te??a.map(r=>r.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:ae,onPointerLeave:()=>$(null),onKeyDown:re,onBlur:()=>$(null),onClick:ne,children:[(0,t.jsxs)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[(0,t.jsx)(ke.ChartGrid,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(M==="y"||M==="both")?e.valueTicks.map(r=>r.offset):void 0,vertical:!e.vertical&&(M==="y"||M==="both")?e.valueTicks.map(r=>r.offset):void 0}),h!==null?(0,t.jsx)("rect",{x:e.vertical?e.categoryPositions[h]:0,y:e.vertical?0:e.categoryPositions[h],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,ee?.map(r=>{let i=e.valueScale(r.value);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:e.vertical?0:i,y1:e.vertical?i:0,x2:e.vertical?e.innerWidth:i,y2:e.vertical?i:e.innerHeight,stroke:r.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:r.dashed===!1?void 0:"4 4"}),r.label?(0,t.jsx)("text",{x:e.vertical?e.innerWidth:i+4,y:e.vertical?i-4:8,textAnchor:e.vertical?"end":"start",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:r.label}):null]},`${r.value}-${r.label??""}`)}),(0,t.jsx)(Oe,{boxes:e.rendered,color:O})]}),(0,t.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?n.hidden:N?.hidden)?null:(0,t.jsx)(me.ChartAxis,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?n.label:N?.label,size:G})}),(0,t.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?N?.hidden:n.hidden)?null:(0,t.jsx)(me.ChartAxis,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?N?.label:n.label,size:G})})]}),s&&s.stats&&V&&L!==!1?(0,t.jsx)(ve.ChartTooltip,{x:V.x,y:V.y,containerWidth:m,children:typeof L=="function"?L(s):(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.label}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[["Max",s.stats.max],["Q3",s.stats.q3],[Q.chartMedian,s.stats.median],["Q1",s.stats.q1],["Min",s.stats.min]].map(([r,i])=>(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:r}),(0,t.jsx)("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:A(i)})]},r)),(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:Q.chartCount}),(0,t.jsx)("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:s.stats.count})]})]})]})}):null]})}function Ue({data:m,x:o,y:d,values:a,quantiles:n,whisker:N=1.5,orientation:M="vertical",boxSize:G,showOutliers:S=!0,showMean:q=!1,color:K,referenceLines:E,height:O=280,width:ee,size:W="md",grid:L="y",tooltip:te=!0,tableView:A=!1,title:H,description:X,loading:h=!1,emptyState:$,error:Q=!1,errorState:e,onRetry:ae,actions:re,margin:ne,locale:s,plotLabel:V,format:r,onBoxClick:i,className:p,...x}){let C=(0,ue.useUILabels)(),k=(0,f.useMemo)(()=>d?.format??r??(l=>(0,J.formatAuto)(l,s)),[d?.format,r,s]),D=(0,f.useMemo)(()=>o.format??(l=>(0,J.formatXValue)(l,s)),[o.format,s]),I=(0,f.useMemo)(()=>m.map((l,g)=>{let U=(0,w.readXValue)(l,o.key,g),c=a?(()=>{let u=l[a];return Array.isArray(u)?u.map(y=>typeof y=="number"?y:Number(y)).filter(y=>Number.isFinite(y)):null})():null,b=null,v=null;if(c!==null)b=(0,Te.boxStats)(c,N),v=c.length===0?null:c.reduce((u,y)=>u+y,0)/c.length;else if(n){let u=(0,w.readNumber)(l,n.q1),y=(0,w.readNumber)(l,n.median),T=(0,w.readNumber)(l,n.q3);if(u!==null&&y!==null&&T!==null){let _=n.min?(0,w.readNumber)(l,n.min)??u:u,Y=n.max?(0,w.readNumber)(l,n.max)??T:T;b={count:0,min:_,max:Y,q1:u,median:y,q3:T,iqr:T-u,lower:_,upper:Y,outliers:[]}}}return{index:g,x:U,label:D(U,g),stats:b,mean:v,datum:l}}),[m,o.key,a,n,N,D]),P=I.filter(l=>l.stats!==null);return(0,t.jsx)(Ce.ChartContainer,{title:H,description:X,height:O,width:ee,size:W,loading:h,empty:P.length===0,emptyState:$,error:Q,errorState:e,onRetry:ae,actions:re,tableView:A,table:A?(0,t.jsx)("div",{className:"w-full overflow-x-auto",children:(0,t.jsxs)(Se.Table,{children:[typeof H=="string"?(0,t.jsx)("caption",{className:"sr-only",children:H}):null,(0,t.jsxs)(Re.TableHeader,{children:[(0,t.jsx)(B.TableHeaderCell,{children:o.label??o.key}),a?(0,t.jsx)(B.TableHeaderCell,{className:"text-right",children:C.chartCount}):null,(0,t.jsx)(B.TableHeaderCell,{className:"text-right",children:"Min"}),(0,t.jsx)(B.TableHeaderCell,{className:"text-right",children:"Q1"}),(0,t.jsx)(B.TableHeaderCell,{className:"text-right",children:C.chartMedian}),(0,t.jsx)(B.TableHeaderCell,{className:"text-right",children:"Q3"}),(0,t.jsx)(B.TableHeaderCell,{className:"text-right",children:"Max"}),a&&S?(0,t.jsx)(B.TableHeaderCell,{className:"text-right",children:C.chartOutliers}):null]}),(0,t.jsx)(Le.TableBody,{children:I.map(l=>(0,t.jsxs)(Me.TableRow,{clickable:!1,children:[(0,t.jsx)(z.TableCell,{className:"font-medium text-gray-900 dark:text-gray-100",children:l.label}),a?(0,t.jsx)(z.TableCell,{className:ce,children:l.stats?.count??"\u2014"}):null,["min","q1","median","q3","max"].map(g=>(0,t.jsx)(z.TableCell,{className:ce,children:l.stats===null?"\u2014":k(l.stats[g])},g)),a&&S?(0,t.jsx)(z.TableCell,{className:ce,children:l.stats===null||l.stats.outliers.length===0?"\u2014":l.stats.outliers.map(k).join(", ")}):null]},l.index))})]})}):void 0,className:p,...x,children:({width:l})=>(0,t.jsx)(Qe,{width:l,height:O,data:m,boxes:I,x:o,y:d,grid:L,size:W,orientation:M,boxSize:G,showOutliers:S,showMean:q,color:K??(0,Ne.getSeriesColor)(0),referenceLines:E,margin:ne,tooltip:te,plotLabel:V,formatValue:k,formatX:D,onBoxClick:i})})}0&&(module.exports={BoxPlot});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as Be,useCallback as se,useMemo as J,useState as Te}from"react";import{useUILabels as be}from"../../lib/i18n.js";import{ChartAxis as xe}from"../chart/ChartAxis.js";import{ChartContainer as we}from"../chart/ChartContainer.js";import{ChartGrid as Se}from"../chart/ChartGrid.js";import{ChartTooltip as Le}from"../chart/ChartTooltip.js";import{getSeriesColor as Re}from"../chart/palette.js";import{buildCartesianGeometry as Me}from"../chart/utils/cartesian.js";import{readNumber as I,readXValue as Ae}from"../chart/utils/data.js";import{formatAuto as He,formatXValue as $e}from"../chart/utils/format.js";import{buildBarPath as Ee}from"../chart/utils/path.js";import{boxStats as We}from"../chart/utils/quantile.js";import{nearestIndex as Xe}from"../chart/utils/scales.js";import{Table as Ve}from"../table/Table.js";import{TableBody as De}from"../table/TableBody.js";import{TableCell as Z}from"../table/TableCell.js";import{TableHeader as Ie}from"../table/TableHeader.js";import{TableHeaderCell as T}from"../table/TableHeaderCell.js";import{TableRow as ze}from"../table/TableRow.js";import{Fragment as Qe,jsx as a,jsxs as p}from"react/jsx-runtime";var Ge=40,qe=3,F=4,ce="text-right [font-variant-numeric:tabular-nums]",Ke=Be(function({boxes:u,color:x}){return a("g",{children:u.map(t=>p("g",{children:[a("g",{stroke:x,strokeWidth:1.5,strokeLinecap:"round",children:t.whiskers.map(l=>a("line",{x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2},l.key))}),t.body?a("path",{d:t.body,fill:x}):null,t.median?a("line",{x1:t.median.x1,y1:t.median.y1,x2:t.median.x2,y2:t.median.y2,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"}):null,t.mean?a("path",{d:`M${t.mean.cx},${t.mean.cy-F} L${t.mean.cx+F},${t.mean.cy} L${t.mean.cx},${t.mean.cy+F} L${t.mean.cx-F},${t.mean.cy} Z`,strokeWidth:1.5,stroke:x,className:"fill-white dark:fill-gray-800"}):null,t.outliers.map(l=>a("circle",{cx:l.cx,cy:l.cy,r:qe,fill:x,strokeWidth:1.5,className:"stroke-white dark:stroke-gray-800"},l.key))]},t.key))})});function Oe({width:v,height:u,data:x,boxes:t,x:l,y:N,grid:R,size:z,orientation:w,boxSize:G,showOutliers:q,showMean:$,color:K,referenceLines:ee,margin:E,tooltip:S,plotLabel:te,formatValue:M,formatX:A,onBoxClick:W}){let[m,H]=Te(null),O=be(),e=J(()=>{let r=w==="vertical",o=t.flatMap(s=>s.stats===null?[]:[s.stats.min,s.stats.max,...$&&s.mean!==null?[s.mean]:[]]),g=Me({width:v,height:u,data:x,x:l,y:N,bounds:o.length===0?null:[Math.min(...o),Math.max(...o)],margin:E,orientation:w,placement:"band",formatValue:M,formatX:A,defaultIncludeZero:!1}),{valueScale:y,bandwidth:b,categoryPositions:C,innerWidth:V,innerHeight:D}=g,P=Math.min(G??Ge,b),n=P*.5,d=(s,f)=>r?{x:s,y:f}:{x:f,y:s},Q=t.map((s,f)=>{let k=C[f]+(b-P)/2,c=k+P/2;if(s.stats===null)return{key:`${f}`,body:"",median:null,whiskers:[],outliers:[],mean:null,top:C[f],height:b};let{q1:h,q3:B,median:U,lower:_,upper:Ce,outliers:ke}=s.stats,me=y(h),ue=y(B),de=Math.min(me,ue),he=Math.abs(ue-me),ve=Ee({...r?{x:k,y:de,width:P,height:Math.max(1,he)}:{x:de,y:k,width:Math.max(1,he),height:P},radius:2,round:"none"}),Y=y(U),Ne=r?{x1:k,y1:Y,x2:k+P,y2:Y}:{x1:Y,y1:k,x2:Y,y2:k+P},le=[];for(let[L,oe,j]of[["lower",_,h],["upper",Ce,B]]){let ie=y(oe),Pe=y(j),ge=d(c,ie),ye=d(c,Pe);le.push({key:`${L}-stem`,x1:ye.x,y1:ye.y,x2:ge.x,y2:ge.y});let fe=d(c-n/2,ie),pe=d(c+n/2,ie);le.push({key:`${L}-cap`,x1:fe.x,y1:fe.y,x2:pe.x,y2:pe.y})}return{key:`${f}`,body:ve,median:Ne,whiskers:le,outliers:q?ke.map((L,oe)=>{let j=d(c,y(L));return{key:`${oe}`,cx:j.x,cy:j.y}}):[],mean:$&&s.mean!==null?(()=>{let L=d(c,y(s.mean));return{cx:L.x,cy:L.y}})():null,top:C[f],height:b}});return{vertical:r,rendered:Q,categoryPositions:C,categoryCenters:g.categoryCenters,bandwidth:b,categoryTicks:g.categoryTicks,valueTicks:g.valueTicks,valueScale:y,innerWidth:V,innerHeight:D,margin:g.margin}},[t,x,l,N,v,u,E,w,G,q,$,M,A]),ae=se(r=>{if(S===!1||t.length===0)return;let o=r.currentTarget.getBoundingClientRect(),g=e.vertical?r.clientX-o.left-e.margin.left:r.clientY-o.top-e.margin.top;H(Xe(e.categoryCenters,g))},[S,t.length,e.vertical,e.margin,e.categoryCenters]),re=se(r=>{if(t.length===0)return;let o=t.length-1,g=m??0,y=e.vertical?"ArrowRight":"ArrowDown",b=e.vertical?"ArrowLeft":"ArrowUp",C=r.key===y?Math.min(o,g+1):r.key===b?Math.max(0,g-1):r.key==="Home"?0:r.key==="End"?o:r.key==="Escape"?null:void 0;C!==void 0&&(r.preventDefault(),H(C))},[t.length,m,e.vertical]),ne=se(()=>{!W||m===null||W(t[m])},[W,m,t]),i=m===null?null:t[m],X=m===null||i===null||i.stats===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[m],y:e.margin.top+e.valueScale(i.stats.q3)}:{x:e.margin.left+e.valueScale(i.stats.q3),y:e.margin.top+e.categoryCenters[m]};return p(Qe,{children:[p("svg",{width:v,height:u,role:"img","aria-label":te??t.map(r=>r.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:ae,onPointerLeave:()=>H(null),onKeyDown:re,onBlur:()=>H(null),onClick:ne,children:[p("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[a(Se,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(R==="y"||R==="both")?e.valueTicks.map(r=>r.offset):void 0,vertical:!e.vertical&&(R==="y"||R==="both")?e.valueTicks.map(r=>r.offset):void 0}),m!==null?a("rect",{x:e.vertical?e.categoryPositions[m]:0,y:e.vertical?0:e.categoryPositions[m],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,ee?.map(r=>{let o=e.valueScale(r.value);return p("g",{children:[a("line",{x1:e.vertical?0:o,y1:e.vertical?o:0,x2:e.vertical?e.innerWidth:o,y2:e.vertical?o:e.innerHeight,stroke:r.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:r.dashed===!1?void 0:"4 4"}),r.label?a("text",{x:e.vertical?e.innerWidth:o+4,y:e.vertical?o-4:8,textAnchor:e.vertical?"end":"start",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:r.label}):null]},`${r.value}-${r.label??""}`)}),a(Ke,{boxes:e.rendered,color:K})]}),a("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?l.hidden:N?.hidden)?null:a(xe,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?l.label:N?.label,size:z})}),a("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?N?.hidden:l.hidden)?null:a(xe,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?N?.label:l.label,size:z})})]}),i&&i.stats&&X&&S!==!1?a(Le,{x:X.x,y:X.y,containerWidth:v,children:typeof S=="function"?S(i):p("div",{className:"flex flex-col gap-1",children:[a("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:i.label}),p("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[["Max",i.stats.max],["Q3",i.stats.q3],[O.chartMedian,i.stats.median],["Q1",i.stats.q1],["Min",i.stats.min]].map(([r,o])=>p("div",{className:"contents",children:[a("dt",{className:"text-gray-500 dark:text-gray-400",children:r}),a("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:M(o)})]},r)),p("div",{className:"contents",children:[a("dt",{className:"text-gray-500 dark:text-gray-400",children:O.chartCount}),a("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:i.stats.count})]})]})]})}):null]})}function dt({data:v,x:u,y:x,values:t,quantiles:l,whisker:N=1.5,orientation:R="vertical",boxSize:z,showOutliers:w=!0,showMean:G=!1,color:q,referenceLines:$,height:K=280,width:ee,size:E="md",grid:S="y",tooltip:te=!0,tableView:M=!1,title:A,description:W,loading:m=!1,emptyState:H,error:O=!1,errorState:e,onRetry:ae,actions:re,margin:ne,locale:i,plotLabel:X,format:r,onBoxClick:o,className:g,...y}){let b=be(),C=J(()=>x?.format??r??(n=>He(n,i)),[x?.format,r,i]),V=J(()=>u.format??(n=>$e(n,i)),[u.format,i]),D=J(()=>v.map((n,d)=>{let Q=Ae(n,u.key,d),s=t?(()=>{let c=n[t];return Array.isArray(c)?c.map(h=>typeof h=="number"?h:Number(h)).filter(h=>Number.isFinite(h)):null})():null,f=null,k=null;if(s!==null)f=We(s,N),k=s.length===0?null:s.reduce((c,h)=>c+h,0)/s.length;else if(l){let c=I(n,l.q1),h=I(n,l.median),B=I(n,l.q3);if(c!==null&&h!==null&&B!==null){let U=l.min?I(n,l.min)??c:c,_=l.max?I(n,l.max)??B:B;f={count:0,min:U,max:_,q1:c,median:h,q3:B,iqr:B-c,lower:U,upper:_,outliers:[]}}}return{index:d,x:Q,label:V(Q,d),stats:f,mean:k,datum:n}}),[v,u.key,t,l,N,V]),P=D.filter(n=>n.stats!==null);return a(we,{title:A,description:W,height:K,width:ee,size:E,loading:m,empty:P.length===0,emptyState:H,error:O,errorState:e,onRetry:ae,actions:re,tableView:M,table:M?a("div",{className:"w-full overflow-x-auto",children:p(Ve,{children:[typeof A=="string"?a("caption",{className:"sr-only",children:A}):null,p(Ie,{children:[a(T,{children:u.label??u.key}),t?a(T,{className:"text-right",children:b.chartCount}):null,a(T,{className:"text-right",children:"Min"}),a(T,{className:"text-right",children:"Q1"}),a(T,{className:"text-right",children:b.chartMedian}),a(T,{className:"text-right",children:"Q3"}),a(T,{className:"text-right",children:"Max"}),t&&w?a(T,{className:"text-right",children:b.chartOutliers}):null]}),a(De,{children:D.map(n=>p(ze,{clickable:!1,children:[a(Z,{className:"font-medium text-gray-900 dark:text-gray-100",children:n.label}),t?a(Z,{className:ce,children:n.stats?.count??"\u2014"}):null,["min","q1","median","q3","max"].map(d=>a(Z,{className:ce,children:n.stats===null?"\u2014":C(n.stats[d])},d)),t&&w?a(Z,{className:ce,children:n.stats===null||n.stats.outliers.length===0?"\u2014":n.stats.outliers.map(C).join(", ")}):null]},n.index))})]})}):void 0,className:g,...y,children:({width:n})=>a(Oe,{width:n,height:K,data:v,boxes:D,x:u,y:x,grid:S,size:E,orientation:R,boxSize:z,showOutliers:w,showMean:G,color:q??Re(0),referenceLines:$,margin:ne,tooltip:te,plotLabel:X,formatValue:C,formatX:V,onBoxClick:o})})}export{dt as BoxPlot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var B=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var m=(t,o)=>{for(var l in o)B(t,l,{get:o[l],enumerable:!0})},s=(t,o,l,P)=>{if(o&&typeof o=="object"||typeof o=="function")for(let x of p(o))!f.call(t,x)&&x!==l&&B(t,x,{get:()=>o[x],enumerable:!(P=r(o,x))||P.enumerable});return t};var y=t=>s(B({},"__esModule",{value:!0}),t);var a={};m(a,{BoxPlot:()=>e.BoxPlot});module.exports=y(a);var e=require("./BoxPlot.cjs");0&&(module.exports={BoxPlot});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BoxPlot as x}from"./BoxPlot.js";export{x as BoxPlot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var y=(n,s)=>{for(var l in s)m(n,l,{get:s[l],enumerable:!0})},k=(n,s,l,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of b(s))!N.call(n,r)&&r!==l&&m(n,r,{get:()=>s[r],enumerable:!(i=h(s,r))||i.enumerable});return n};var C=n=>k(m({},"__esModule",{value:!0}),n);var R={};y(R,{Breadcrumb:()=>B});module.exports=C(R);var t=require("../../lib/cn.cjs"),e=require("react/jsx-runtime"),v={sm:"text-xs",md:"text-sm",lg:"text-base"};function B({items:n,separator:s="/",size:l="md",maxItems:i,itemColor:r="text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100",activeColor:f="text-gray-700 font-medium dark:text-gray-200",separatorColor:p="text-gray-400 dark:text-gray-500",className:g,...u}){let d=n,x=!1;if(i&&n.length>i){x=!0;let a=n[0],o=n.slice(-(i-1));d=[a,...o]}return(0,e.jsx)("nav",{"aria-label":"Breadcrumb",className:(0,t.cn)("inline-flex items-center",v[l],g),...u,children:(0,e.jsx)("ol",{className:"inline-flex items-center space-x-1 md:space-x-2",children:d.map((a,o)=>{let c=o===d.length-1;return(0,e.jsxs)("li",{className:"inline-flex items-center",children:[x&&o===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:(0,t.cn)("mx-1 select-none",p),children:"..."}),(0,e.jsx)("span",{className:(0,t.cn)("mx-1 select-none",p),"aria-hidden":"true",children:s})]}),a.href||a.onClick?(0,e.jsxs)("a",{href:a.href,onClick:a.onClick,className:(0,t.cn)("inline-flex items-center gap-1.5 transition-colors",c?f:r),"aria-current":c?"page":void 0,children:[a.icon&&(0,e.jsx)("span",{className:"inline-flex","aria-hidden":"true",children:a.icon}),(0,e.jsx)("span",{children:a.label})]}):(0,e.jsxs)("span",{className:(0,t.cn)("inline-flex items-center gap-1.5",c?f:r),"aria-current":c?"page":void 0,children:[a.icon&&(0,e.jsx)("span",{className:"inline-flex","aria-hidden":"true",children:a.icon}),(0,e.jsx)("span",{children:a.label})]}),!c&&(0,e.jsx)("span",{className:(0,t.cn)("mx-2 select-none",p),"aria-hidden":"true",children:s})]},a.href??a.label)})})})}0&&(module.exports={Breadcrumb});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as n}from"../../lib/cn.js";import{Fragment as b,jsx as a,jsxs as l}from"react/jsx-runtime";var h={sm:"text-xs",md:"text-sm",lg:"text-base"};function k({items:r,separator:p="/",size:x="md",maxItems:i,itemColor:d="text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100",activeColor:m="text-gray-700 font-medium dark:text-gray-200",separatorColor:c="text-gray-400 dark:text-gray-500",className:g,...u}){let o=r,f=!1;if(i&&r.length>i){f=!0;let e=r[0],t=r.slice(-(i-1));o=[e,...t]}return a("nav",{"aria-label":"Breadcrumb",className:n("inline-flex items-center",h[x],g),...u,children:a("ol",{className:"inline-flex items-center space-x-1 md:space-x-2",children:o.map((e,t)=>{let s=t===o.length-1;return l("li",{className:"inline-flex items-center",children:[f&&t===1&&l(b,{children:[a("span",{className:n("mx-1 select-none",c),children:"..."}),a("span",{className:n("mx-1 select-none",c),"aria-hidden":"true",children:p})]}),e.href||e.onClick?l("a",{href:e.href,onClick:e.onClick,className:n("inline-flex items-center gap-1.5 transition-colors",s?m:d),"aria-current":s?"page":void 0,children:[e.icon&&a("span",{className:"inline-flex","aria-hidden":"true",children:e.icon}),a("span",{children:e.label})]}):l("span",{className:n("inline-flex items-center gap-1.5",s?m:d),"aria-current":s?"page":void 0,children:[e.icon&&a("span",{className:"inline-flex","aria-hidden":"true",children:e.icon}),a("span",{children:e.label})]}),!s&&a("span",{className:n("mx-2 select-none",c),"aria-hidden":"true",children:p})]},e.href??e.label)})})})}export{k as Breadcrumb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var u=(e,r)=>{for(var o in r)a(e,o,{get:r[o],enumerable:!0})},B=(e,r,o,b)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of p(r))!t.call(e,m)&&m!==o&&a(e,m,{get:()=>r[m],enumerable:!(b=d(r,m))||b.enumerable});return e};var f=e=>B(a({},"__esModule",{value:!0}),e);var x={};u(x,{Breadcrumb:()=>c.Breadcrumb});module.exports=f(x);var c=require("./Breadcrumb.cjs");0&&(module.exports={Breadcrumb});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Breadcrumb as m}from"./Breadcrumb.js";export{m as Breadcrumb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var ee=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var pe=(i,l)=>{for(var a in l)ee(i,a,{get:l[a],enumerable:!0})},ye=(i,l,a,e)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of fe(l))!be.call(i,s)&&s!==a&&ee(i,s,{get:()=>l[s],enumerable:!(e=he(l,s))||e.enumerable});return i};var ke=i=>ye(ee({},"__esModule",{value:!0}),i);var Ve={};pe(Ve,{BulletChart:()=>Se});module.exports=ke(Ve);var g=require("react"),se=require("../../lib/i18n.cjs"),te=require("../chart/ChartAxis.cjs"),ue=require("../chart/ChartContainer.cjs"),me=require("../chart/ChartTableView.cjs"),ce=require("../chart/ChartTooltip.cjs"),ge=require("../chart/palette.cjs"),I=require("../chart/utils/data.cjs"),X=require("../chart/utils/format.cjs"),ne=require("../chart/utils/path.cjs"),L=require("../chart/utils/scales.cjs"),ae=require("../chart/utils/text.cjs"),K=require("../chart/utils/ticks.cjs"),n=require("react/jsx-runtime"),Ce=22,xe=.42,oe=3,ie=8,ve=12,Re=["fill-gray-300 dark:fill-gray-500","fill-gray-200 dark:fill-gray-600","fill-gray-100 dark:fill-gray-700","fill-gray-50 dark:fill-gray-800"],Ne=(0,g.memo)(function({rows:l,color:a}){return(0,n.jsx)("g",{children:l.map(e=>(0,n.jsxs)("g",{children:[e.bands.map(s=>(0,n.jsx)("path",{d:s.d,className:s.className,fill:s.fill},s.key)),e.measure?(0,n.jsx)("path",{d:e.measure,fill:a}):null,e.target?(0,n.jsx)("line",{x1:e.target.x,y1:e.target.y1,x2:e.target.x,y2:e.target.y2,strokeWidth:2,strokeLinecap:"round",className:"stroke-gray-900 dark:stroke-white"}):null,e.label?(0,n.jsx)("text",{x:e.label.x,y:e.label.y,dominantBaseline:"middle",className:"fill-gray-700 text-[11px] font-medium [font-variant-numeric:tabular-nums] dark:fill-gray-200",children:e.label.text}):null]},e.key))})});function Te({width:i,height:l,rows:a,x:e,size:s,sharedDomain:h,showValues:V,trackSize:W,rangeColors:z,color:U,tooltip:B,plotLabel:q,formatValue:w,locale:D,onRowClick:G}){let[u,k]=(0,g.useState)(null),r=(0,g.useMemo)(()=>{let c=a.map(t=>t.label),x=V?a.map(t=>t.formattedValue):[],m={top:6,right:V?(0,ae.widestLabel)(x)+ie*2:8,bottom:h?26+(e.label?16:0):6,left:e.hidden?8:e.height??(0,ae.widestLabel)(c)+ve},p=Math.max(0,i-m.left-m.right),H=Math.max(0,l-m.top-m.bottom),f=(0,L.createBandScale)(a.map((t,d)=>d),[0,H],{paddingInner:.34}),v=Math.min(W??Ce,f.bandwidth),O=Math.max(3,v*xe),F=z??Re,Y=z!==void 0,P=a.map((t,d)=>{let $=Math.max(0,t.value??0,t.target??0,...t.ranges.length>0?t.ranges:[0]),A=h??(t.ranges.length>0?[0,$]:(0,K.niceDomain)(0,$,4)),R=(0,L.createLinearScale)(A,[0,p]),o=f(d)+(f.bandwidth-v)/2,N=o+v/2,T=t.ranges.length>0?[...t.ranges].sort((M,b)=>M-b):[A[1]],y=A[0],S=T.map((M,b)=>{let re=R(y),de=R(Math.max(y,M));y=M;let le=F[Math.min(b,F.length-1)];return{key:`${d}-${b}`,d:(0,ne.buildBarPath)({x:re,y:o,width:Math.max(0,de-re),height:v,radius:0}),className:Y?void 0:le,fill:Y?le:void 0}}),j=t.value===null?null:(0,ne.buildBarPath)({x:R(A[0]),y:N-O/2,width:Math.max(0,R(t.value)-R(A[0])),height:O,radius:2,round:"right"});return{key:`${d}`,bands:S,measure:j,target:t.target===null?null:{x:R(t.target),y1:o-oe,y2:o+v+oe},label:V?{x:p+ie,y:N,text:t.formattedValue}:null,top:f(d),height:f.bandwidth}}),E=e.hidden?[]:a.map((t,d)=>({value:t.x,offset:f.center(d),label:t.label})),_=h?(0,K.niceTicks)(h[0],h[1],5).map(t=>({value:t,offset:(0,L.createLinearScale)(h,[0,p])(t),label:w(t)})):[];return{margin:m,innerWidth:p,innerHeight:H,band:f,rendered:P,categoryTicks:E,valueTicks:_,centers:a.map((t,d)=>f.center(d))}},[a,e,i,l,h,V,W,z,w]),J=(0,g.useCallback)(c=>{if(B===!1||a.length===0)return;let x=c.currentTarget.getBoundingClientRect(),m=c.clientY-x.top-r.margin.top;k((0,L.nearestIndex)(r.centers,m))},[B,a.length,r.margin.top,r.centers]),Q=(0,g.useCallback)(c=>{if(a.length===0)return;let x=a.length-1,m=u??0,p=c.key==="ArrowDown"?Math.min(x,m+1):c.key==="ArrowUp"?Math.max(0,m-1):c.key==="Home"?0:c.key==="End"?x:c.key==="Escape"?null:void 0;p!==void 0&&(c.preventDefault(),k(p))},[a.length,u]),Z=(0,g.useCallback)(()=>{!G||u===null||G(a[u])},[G,u,a]),C=u===null?null:a[u];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{width:i,height:l,role:"img","aria-label":q??a.map(c=>c.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:J,onPointerLeave:()=>k(null),onKeyDown:Q,onBlur:()=>k(null),onClick:Z,children:[(0,n.jsxs)("g",{transform:`translate(${r.margin.left}, ${r.margin.top})`,children:[u!==null&&r.rendered[u]?(0,n.jsx)("rect",{x:-4,y:r.rendered[u].top,width:r.innerWidth+8,height:r.rendered[u].height,rx:4,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,(0,n.jsx)(Ne,{rows:r.rendered,color:U})]}),(0,n.jsx)("g",{transform:`translate(${r.margin.left}, ${r.margin.top})`,children:e.hidden?null:(0,n.jsx)(te.ChartAxis,{orientation:"left",ticks:r.categoryTicks,length:r.innerHeight,showLine:!1,tickSize:0,size:s})}),h?(0,n.jsx)("g",{transform:`translate(${r.margin.left}, ${r.margin.top+r.innerHeight})`,children:(0,n.jsx)(te.ChartAxis,{orientation:"bottom",ticks:r.valueTicks,length:r.innerWidth,label:e.label,size:s})}):null]}),C&&u!==null&&B!==!1?(0,n.jsx)(ce.ChartTooltip,{x:r.margin.left+r.innerWidth/2,y:r.margin.top+r.centers[u],containerWidth:i,children:typeof B=="function"?B(C):(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:C.label}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"h-0.5 w-3 shrink-0 rounded-full",style:{backgroundColor:U},"aria-hidden":"true"}),(0,n.jsx)("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:C.formattedValue}),C.attainment!==null?(0,n.jsx)("span",{className:"text-gray-500 [font-variant-numeric:tabular-nums] dark:text-gray-400",children:(0,X.formatPercent)(C.attainment,{locale:D})}):null]})]})}):null]})}function Se({data:i,x:l,value:a,target:e,ranges:s,domain:h,normalize:V="row",showValues:W=!0,trackSize:z,rangeColors:U,color:B,height:q,width:w,size:D="md",tooltip:G=!0,tableView:u=!1,title:k,description:r,loading:J=!1,emptyState:Q,error:Z=!1,errorState:C,onRetry:c,actions:x,locale:m,plotLabel:p,valueLabel:H,targetLabel:f,format:v,onRowClick:O,className:F,...Y}){let P=(0,se.useUILabels)(),E=(0,g.useMemo)(()=>v??(o=>(0,X.formatAuto)(o,m)),[v,m]),_=(0,g.useMemo)(()=>l.format??(o=>(0,X.formatXValue)(o,m)),[l.format,m]),t=(0,g.useMemo)(()=>i.map((o,N)=>{let T=(0,I.readXValue)(o,l.key,N),y=(0,I.readNumber)(o,a),S=e?(0,I.readNumber)(o,e):null,j=s?o[s]:void 0,M=Array.isArray(j)?j.map(b=>typeof b=="number"?b:Number(b)).filter(b=>Number.isFinite(b)):[];return{index:N,x:T,label:_(T,N),value:y,target:S,ranges:M,formattedValue:y===null?"\u2014":E(y),formattedTarget:S===null?"\u2014":E(S),attainment:y===null||S===null||S===0?null:y/S,datum:o}}),[i,l.key,a,e,s,E,_]),d=(0,g.useMemo)(()=>{if(h)return h;if(V!=="shared")return null;let o=t.reduce((N,T)=>Math.max(N,T.value??0,T.target??0,...T.ranges),0);return(0,K.niceDomain)(0,o,5)},[h,V,t]),$=q??Math.max(72,t.length*34+(d?30:12)),A=(0,g.useMemo)(()=>[{key:a,label:H??P.chartValue},...e?[{key:e,label:f??P.chartTarget}]:[]],[a,e,H,f,P.chartValue,P.chartTarget]),R=B??(0,ge.getSeriesColor)(0);return(0,n.jsx)(ue.ChartContainer,{title:k,description:r,height:$,width:w,size:D,loading:J,empty:t.length===0,emptyState:Q,error:Z,errorState:C,onRetry:c,actions:x,tableView:u,table:u?(0,n.jsx)(me.ChartTableView,{data:i,series:A,xKey:l.key,xLabel:l.label??l.key,formatX:_,formatValue:E,caption:typeof k=="string"?k:void 0}):void 0,className:F,...Y,children:({width:o})=>(0,n.jsx)(Te,{width:o,height:$,rows:t,x:l,size:D,sharedDomain:d,showValues:W,trackSize:z,rangeColors:U,color:R,tooltip:G,plotLabel:p,formatValue:E,locale:m,onRowClick:O})})}0&&(module.exports={BulletChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as ue,useCallback as J,useMemo as P,useState as me}from"react";import{useUILabels as ce}from"../../lib/i18n.js";import{ChartAxis as ee}from"../chart/ChartAxis.js";import{ChartContainer as ge}from"../chart/ChartContainer.js";import{ChartTableView as de}from"../chart/ChartTableView.js";import{ChartTooltip as he}from"../chart/ChartTooltip.js";import{getSeriesColor as fe}from"../chart/palette.js";import{readNumber as te,readXValue as be}from"../chart/utils/data.js";import{formatAuto as pe,formatPercent as ye,formatXValue as ke}from"../chart/utils/format.js";import{buildBarPath as ne}from"../chart/utils/path.js";import{createBandScale as Ce,createLinearScale as ae,nearestIndex as xe}from"../chart/utils/scales.js";import{widestLabel as re}from"../chart/utils/text.js";import{niceDomain as ie,niceTicks as ve}from"../chart/utils/ticks.js";import{Fragment as Ee,jsx as r,jsxs as M}from"react/jsx-runtime";var Re=22,Ne=.42,le=3,oe=8,Te=12,Se=["fill-gray-300 dark:fill-gray-500","fill-gray-200 dark:fill-gray-600","fill-gray-100 dark:fill-gray-700","fill-gray-50 dark:fill-gray-800"],Ve=ue(function({rows:u,color:a}){return r("g",{children:u.map(t=>M("g",{children:[t.bands.map(g=>r("path",{d:g.d,className:g.className,fill:g.fill},g.key)),t.measure?r("path",{d:t.measure,fill:a}):null,t.target?r("line",{x1:t.target.x,y1:t.target.y1,x2:t.target.x,y2:t.target.y2,strokeWidth:2,strokeLinecap:"round",className:"stroke-gray-900 dark:stroke-white"}):null,t.label?r("text",{x:t.label.x,y:t.label.y,dominantBaseline:"middle",className:"fill-gray-700 text-[11px] font-medium [font-variant-numeric:tabular-nums] dark:fill-gray-200",children:t.label.text}):null]},t.key))})});function Be({width:f,height:u,rows:a,x:t,size:g,sharedDomain:c,showValues:S,trackSize:$,rangeColors:X,color:I,tooltip:V,plotLabel:F,formatValue:K,locale:W,onRowClick:z}){let[o,y]=me(null),n=P(()=>{let s=a.map(e=>e.label),C=S?a.map(e=>e.formattedValue):[],i={top:6,right:S?re(C)+oe*2:8,bottom:c?26+(t.label?16:0):6,left:t.hidden?8:t.height??re(s)+Te},b=Math.max(0,f-i.left-i.right),G=Math.max(0,u-i.top-i.bottom),d=Ce(a.map((e,m)=>m),[0,G],{paddingInner:.34}),x=Math.min($??Re,d.bandwidth),U=Math.max(3,x*Ne),w=X??Se,D=X!==void 0,A=a.map((e,m)=>{let _=Math.max(0,e.value??0,e.target??0,...e.ranges.length>0?e.ranges:[0]),E=c??(e.ranges.length>0?[0,_]:ie(0,_,4)),v=ae(E,[0,b]),l=d(m)+(d.bandwidth-x)/2,R=l+x/2,N=e.ranges.length>0?[...e.ranges].sort((L,h)=>L-h):[E[1]],p=E[0],T=N.map((L,h)=>{let Q=v(p),se=v(Math.max(p,L));p=L;let Z=w[Math.min(h,w.length-1)];return{key:`${m}-${h}`,d:ne({x:Q,y:l,width:Math.max(0,se-Q),height:x,radius:0}),className:D?void 0:Z,fill:D?Z:void 0}}),O=e.value===null?null:ne({x:v(E[0]),y:R-U/2,width:Math.max(0,v(e.value)-v(E[0])),height:U,radius:2,round:"right"});return{key:`${m}`,bands:T,measure:O,target:e.target===null?null:{x:v(e.target),y1:l-le,y2:l+x+le},label:S?{x:b+oe,y:R,text:e.formattedValue}:null,top:d(m),height:d.bandwidth}}),B=t.hidden?[]:a.map((e,m)=>({value:e.x,offset:d.center(m),label:e.label})),H=c?ve(c[0],c[1],5).map(e=>({value:e,offset:ae(c,[0,b])(e),label:K(e)})):[];return{margin:i,innerWidth:b,innerHeight:G,band:d,rendered:A,categoryTicks:B,valueTicks:H,centers:a.map((e,m)=>d.center(m))}},[a,t,f,u,c,S,$,X,K]),Y=J(s=>{if(V===!1||a.length===0)return;let C=s.currentTarget.getBoundingClientRect(),i=s.clientY-C.top-n.margin.top;y(xe(n.centers,i))},[V,a.length,n.margin.top,n.centers]),j=J(s=>{if(a.length===0)return;let C=a.length-1,i=o??0,b=s.key==="ArrowDown"?Math.min(C,i+1):s.key==="ArrowUp"?Math.max(0,i-1):s.key==="Home"?0:s.key==="End"?C:s.key==="Escape"?null:void 0;b!==void 0&&(s.preventDefault(),y(b))},[a.length,o]),q=J(()=>{!z||o===null||z(a[o])},[z,o,a]),k=o===null?null:a[o];return M(Ee,{children:[M("svg",{width:f,height:u,role:"img","aria-label":F??a.map(s=>s.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:Y,onPointerLeave:()=>y(null),onKeyDown:j,onBlur:()=>y(null),onClick:q,children:[M("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[o!==null&&n.rendered[o]?r("rect",{x:-4,y:n.rendered[o].top,width:n.innerWidth+8,height:n.rendered[o].height,rx:4,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,r(Ve,{rows:n.rendered,color:I})]}),r("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:t.hidden?null:r(ee,{orientation:"left",ticks:n.categoryTicks,length:n.innerHeight,showLine:!1,tickSize:0,size:g})}),c?r("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:r(ee,{orientation:"bottom",ticks:n.valueTicks,length:n.innerWidth,label:t.label,size:g})}):null]}),k&&o!==null&&V!==!1?r(he,{x:n.margin.left+n.innerWidth/2,y:n.margin.top+n.centers[o],containerWidth:f,children:typeof V=="function"?V(k):M("div",{className:"flex flex-col gap-1",children:[r("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:k.label}),M("div",{className:"flex items-center gap-2",children:[r("span",{className:"h-0.5 w-3 shrink-0 rounded-full",style:{backgroundColor:I},"aria-hidden":"true"}),r("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:k.formattedValue}),k.attainment!==null?r("span",{className:"text-gray-500 [font-variant-numeric:tabular-nums] dark:text-gray-400",children:ye(k.attainment,{locale:W})}):null]})]})}):null]})}function Ue({data:f,x:u,value:a,target:t,ranges:g,domain:c,normalize:S="row",showValues:$=!0,trackSize:X,rangeColors:I,color:V,height:F,width:K,size:W="md",tooltip:z=!0,tableView:o=!1,title:y,description:n,loading:Y=!1,emptyState:j,error:q=!1,errorState:k,onRetry:s,actions:C,locale:i,plotLabel:b,valueLabel:G,targetLabel:d,format:x,onRowClick:U,className:w,...D}){let A=ce(),B=P(()=>x??(l=>pe(l,i)),[x,i]),H=P(()=>u.format??(l=>ke(l,i)),[u.format,i]),e=P(()=>f.map((l,R)=>{let N=be(l,u.key,R),p=te(l,a),T=t?te(l,t):null,O=g?l[g]:void 0,L=Array.isArray(O)?O.map(h=>typeof h=="number"?h:Number(h)).filter(h=>Number.isFinite(h)):[];return{index:R,x:N,label:H(N,R),value:p,target:T,ranges:L,formattedValue:p===null?"\u2014":B(p),formattedTarget:T===null?"\u2014":B(T),attainment:p===null||T===null||T===0?null:p/T,datum:l}}),[f,u.key,a,t,g,B,H]),m=P(()=>{if(c)return c;if(S!=="shared")return null;let l=e.reduce((R,N)=>Math.max(R,N.value??0,N.target??0,...N.ranges),0);return ie(0,l,5)},[c,S,e]),_=F??Math.max(72,e.length*34+(m?30:12)),E=P(()=>[{key:a,label:G??A.chartValue},...t?[{key:t,label:d??A.chartTarget}]:[]],[a,t,G,d,A.chartValue,A.chartTarget]),v=V??fe(0);return r(ge,{title:y,description:n,height:_,width:K,size:W,loading:Y,empty:e.length===0,emptyState:j,error:q,errorState:k,onRetry:s,actions:C,tableView:o,table:o?r(de,{data:f,series:E,xKey:u.key,xLabel:u.label??u.key,formatX:H,formatValue:B,caption:typeof y=="string"?y:void 0}):void 0,className:w,...D,children:({width:l})=>r(Be,{width:l,height:_,rows:e,x:u,size:W,sharedDomain:m,showValues:$,trackSize:X,rangeColors:I,color:v,tooltip:z,plotLabel:b,formatValue:B,locale:i,onRowClick:U})})}export{Ue as BulletChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var C=(l,t)=>{for(var e in t)o(l,e,{get:t[e],enumerable:!0})},f=(l,t,e,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of a(t))!h.call(l,r)&&r!==e&&o(l,r,{get:()=>t[r],enumerable:!(p=B(t,r))||p.enumerable});return l};var m=l=>f(o({},"__esModule",{value:!0}),l);var x={};C(x,{BulletChart:()=>u.BulletChart});module.exports=m(x);var u=require("./BulletChart.cjs");0&&(module.exports={BulletChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BulletChart as r}from"./BulletChart.js";export{r as BulletChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var z=(s,t)=>{for(var o in t)u(s,o,{get:t[o],enumerable:!0})},A=(s,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of k(t))!$.call(s,n)&&n!==o&&u(s,n,{get:()=>t[n],enumerable:!(r=S(t,n))||r.enumerable});return s};var D=s=>A(u({},"__esModule",{value:!0}),s);var j={};z(j,{Button:()=>V});module.exports=D(j);var a=require("../../lib/cn.cjs"),e=require("react/jsx-runtime");function H({className:s}){return(0,e.jsxs)("svg",{className:(0,a.cn)("animate-spin",s),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,e.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,e.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}var I={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-2.5 text-base gap-2",xl:"px-6 py-3 text-lg gap-2.5"},M={sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"},c={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5",xl:"h-6 w-6"},O={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function V({label:s,children:t,onClick:o,disabled:r=!1,className:n,type:h="button",size:l="md",loading:p=!1,leftIcon:m,rightIcon:g,icon:b,fullWidth:y=!1,rounded:N="lg",bgColor:w="bg-blue-600 hover:bg-blue-700",textColor:C="text-white",focusColor:i="focus:ring-blue-300",selected:f=!1,value:v,showFocusOnClick:d=!1,...R}){let B=r||p,x=b!==void 0&&!t&&!s,P=(0,a.cn)("inline-flex items-center justify-center font-medium transition-colors focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",d?"focus:ring-4":"focus-visible:ring-4"),W=(0,a.cn)(f?"bg-blue-700 text-white ring-2 ring-blue-500":w,!f&&C,i&&d&&`focus:ring-4 ${i}`,i&&!d&&`focus-visible:ring-4 ${i}`);return(0,e.jsx)("button",{type:h,onClick:o,disabled:B,"data-value":v,className:(0,a.cn)(P,x?M[l]:I[l],O[N],W,y&&"w-full",n),...R,children:p?(0,e.jsx)(H,{className:c[l]}):x?(0,e.jsx)("span",{className:c[l],children:b}):(0,e.jsxs)(e.Fragment,{children:[m&&(0,e.jsx)("span",{className:c[l],children:m}),t??s,g&&(0,e.jsx)("span",{className:c[l],children:g})]})})}0&&(module.exports={Button});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as l}from"../../lib/cn.js";import{Fragment as A,jsx as e,jsxs as g}from"react/jsx-runtime";function S({className:t}){return g("svg",{className:l("animate-spin",t),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}var k={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-2.5 text-base gap-2",xl:"px-6 py-3 text-lg gap-2.5"},$={sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"},o={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5",xl:"h-6 w-6"},z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function H({label:t,children:r,onClick:b,disabled:f=!1,className:x,type:h="button",size:s="md",loading:i=!1,leftIcon:c,rightIcon:d,icon:u,fullWidth:y=!1,rounded:N="lg",bgColor:w="bg-blue-600 hover:bg-blue-700",textColor:C="text-white",focusColor:n="focus:ring-blue-300",selected:p=!1,value:v,showFocusOnClick:a=!1,...R}){let B=f||i,m=u!==void 0&&!r&&!t,P=l("inline-flex items-center justify-center font-medium transition-colors focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",a?"focus:ring-4":"focus-visible:ring-4"),W=l(p?"bg-blue-700 text-white ring-2 ring-blue-500":w,!p&&C,n&&a&&`focus:ring-4 ${n}`,n&&!a&&`focus-visible:ring-4 ${n}`);return e("button",{type:h,onClick:b,disabled:B,"data-value":v,className:l(P,m?$[s]:k[s],z[N],W,y&&"w-full",x),...R,children:i?e(S,{className:o[s]}):m?e("span",{className:o[s],children:u}):g(A,{children:[c&&e("span",{className:o[s],children:c}),r??t,d&&e("span",{className:o[s],children:d})]})})}export{H as Button};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var x=(o,t)=>{for(var p in t)e(o,p,{get:t[p],enumerable:!0})},s=(o,t,p,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!m.call(o,r)&&r!==p&&e(o,r,{get:()=>t[r],enumerable:!(n=B(t,r))||n.enumerable});return o};var y=o=>s(e({},"__esModule",{value:!0}),o);var P={};x(P,{Button:()=>u.Button});module.exports=y(P);var u=require("./Button.cjs");0&&(module.exports={Button});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as r}from"./Button.js";export{r as Button};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var y=Object.create;var c=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var n in e)c(t,n,{get:e[n],enumerable:!0})},z=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of C(e))!N.call(t,r)&&r!==n&&c(t,r,{get:()=>e[r],enumerable:!(s=R(e,r))||s.enumerable});return t};var b=(t,e,n)=>(n=t!=null?y(M(t)):{},z(e||!t||!t.__esModule?c(n,"default",{value:t,enumerable:!0}):n,t)),A=t=>z(c({},"__esModule",{value:!0}),t);var H={};P(H,{ButtonGroup:()=>G});module.exports=A(H);var p=b(require("react"),1),u=require("../../lib/cn.cjs"),h=require("react/jsx-runtime");function G({children:t,orientation:e="horizontal",size:n,fullWidth:s=!1,selectedValue:r,onChange:i,className:B}){let m=p.default.Children.toArray(t).filter(o=>p.default.isValidElement(o)&&typeof o.type!="string"),g=(o,a)=>l=>{o!==void 0&&i&&i(o),a&&a(l)};return(0,h.jsx)("div",{className:(0,u.cn)("inline-flex",e==="horizontal"?"flex-row":"flex-col",s&&"w-full",B),role:"group",children:m.map((o,a)=>{let l=a===0,d=a===m.length-1,f=!l&&!d,v=o.props.value,E=r!==void 0&&v===r,x=(0,u.cn)(e==="horizontal"&&l&&"rounded-r-none",e==="horizontal"&&d&&"rounded-l-none",e==="horizontal"&&f&&"rounded-none",e==="horizontal"&&!l&&"-ml-px",e==="vertical"&&l&&"rounded-b-none",e==="vertical"&&d&&"rounded-t-none",e==="vertical"&&f&&"rounded-none",e==="vertical"&&!l&&"-mt-px",s&&"flex-1");return p.default.cloneElement(o,{...o.props,size:n??o.props.size,selected:E||o.props.selected,onClick:g(v,o.props.onClick),className:(0,u.cn)(x,o.props.className)})})})}0&&(module.exports={ButtonGroup});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import l from"react";import{cn as s}from"../../lib/cn.js";import{jsx as g}from"react/jsx-runtime";function R({children:m,orientation:t="horizontal",size:f,fullWidth:a=!1,selectedValue:c,onChange:p,className:v}){let u=l.Children.toArray(m).filter(e=>l.isValidElement(e)&&typeof e.type!="string"),z=(e,n)=>o=>{e!==void 0&&p&&p(e),n&&n(o)};return g("div",{className:s("inline-flex",t==="horizontal"?"flex-row":"flex-col",a&&"w-full",v),role:"group",children:u.map((e,n)=>{let o=n===0,r=n===u.length-1,d=!o&&!r,i=e.props.value,h=c!==void 0&&i===c,B=s(t==="horizontal"&&o&&"rounded-r-none",t==="horizontal"&&r&&"rounded-l-none",t==="horizontal"&&d&&"rounded-none",t==="horizontal"&&!o&&"-ml-px",t==="vertical"&&o&&"rounded-b-none",t==="vertical"&&r&&"rounded-t-none",t==="vertical"&&d&&"rounded-none",t==="vertical"&&!o&&"-mt-px",a&&"flex-1");return l.cloneElement(e,{...e.props,size:f??e.props.size,selected:h||e.props.selected,onClick:z(i,e.props.onClick),className:s(B,e.props.className)})})})}export{R as ButtonGroup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var m=(t,o)=>{for(var p in o)u(t,p,{get:o[p],enumerable:!0})},x=(t,o,p,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of G(o))!f.call(t,r)&&r!==p&&u(t,r,{get:()=>o[r],enumerable:!(e=B(o,r))||e.enumerable});return t};var s=t=>x(u({},"__esModule",{value:!0}),t);var y={};m(y,{ButtonGroup:()=>n.ButtonGroup});module.exports=s(y);var n=require("./ButtonGroup.cjs");0&&(module.exports={ButtonGroup});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ButtonGroup as r}from"./ButtonGroup.js";export{r as ButtonGroup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var le=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var Qe=Object.prototype.hasOwnProperty;var Xe=(e,a)=>{for(var s in a)le(e,s,{get:a[s],enumerable:!0})},Ze=(e,a,s,F)=>{if(a&&typeof a=="object"||typeof a=="function")for(let D of Je(a))!Qe.call(e,D)&&D!==s&&le(e,D,{get:()=>a[D],enumerable:!(F=qe(a,D))||F.enumerable});return e};var et=e=>Ze(le({},"__esModule",{value:!0}),e);var gt={};Xe(gt,{Calendar:()=>ct});module.exports=et(gt);var l=require("react"),c=require("../../lib/cn.cjs"),n=require("react/jsx-runtime"),tt=10080*60*1e3;function g(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function z(e){return new Date(e.getFullYear(),e.getMonth(),1)}function T(e,a){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+a)}function x(e,a){return new Date(e.getFullYear(),e.getMonth()+a,1)}function ie(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function N(e,a){return!e||!a?!1:e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function se(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()}function B(e,a){return e.getFullYear()*12+e.getMonth()-(a.getFullYear()*12+a.getMonth())}function q(e){let a=`${e.getMonth()+1}`.padStart(2,"0"),s=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${a}-${s}`}function at(e){let a=g(e);a.setDate(a.getDate()-(a.getDay()+6)%7+3);let s=new Date(a.getFullYear(),0,4);return s.setDate(s.getDate()-(s.getDay()+6)%7+3),1+Math.round((a.getTime()-s.getTime())/tt)}function ve(e,a,s){return a&&e<g(a)?g(a):s&&e>g(s)?g(s):e}function rt(e,a,s){let F=z(e),D=(F.getDay()-a+7)%7,K=T(F,-D),_=s?6:Math.ceil((D+ie(e))/7);return Array.from({length:_},(Q,H)=>Array.from({length:7},(de,A)=>T(K,H*7+A)))}function nt({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ot({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var lt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},st={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-white hover:bg-yellow-600 dark:bg-yellow-400 dark:text-gray-900 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},it={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},dt={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},ut={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},W={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function J(e,a){if(e==="multiple")return Array.isArray(a)?a.map(g):[];if(e==="range"){let s=a??null;return{from:s?.from?g(s.from):null,to:s?.to?g(s.to):null}}return a instanceof Date?g(a):null}function xe(e){return e?e instanceof Date?e:Array.isArray(e)?e[0]??null:e.from??e.to??null:null}function ct(e){let{mode:a="single",value:s,defaultValue:F,onChange:D,max:K,month:_,defaultMonth:Q,onMonthChange:H,numberOfMonths:de=1,weekStartsOn:A=0,locale:R,size:ke="md",color:v="primary",minDate:k,maxDate:w,disabledDates:j,disabled:y=!1,showOutsideDays:we=!0,showWeekNumbers:ue=!1,fixedWeeks:Ce=!1,captionLayout:X="label",fromYear:ce,toYear:ge,todayButton:Z=!1,clearButton:ee=!1,footer:fe,bordered:Me=!0,renderDay:be,labels:L,className:Se,...Ne}=e,h=lt[ke],C=Math.max(1,de),Y=(0,l.useMemo)(()=>g(new Date),[]),te=s!==void 0,[Fe,Re]=(0,l.useState)(()=>J(a,F)),E=te?J(a,s):Fe,ae=_!==void 0,[Ye,Pe]=(0,l.useState)(()=>z(Q??xe(J(a,F??s))??new Date)),f=ae?z(_):Ye,p=(0,l.useCallback)(t=>{let r=z(t);ae||Pe(r),H?.(r)},[ae,H]),ye=(0,l.useRef)(null),re=(0,l.useRef)(!1),[I,G]=(0,l.useState)(()=>{let t=xe(J(a,F??s)),r=z(Q??_??t??new Date),u=t&&se(t,r)?t:se(g(new Date),r)?g(new Date):r;return ve(u,k,w)}),Te=x(f,C-1),Ae=B(I,f)>=0&&B(I,Te)<=0?I:f;(0,l.useEffect)(()=>{if(!re.current)return;re.current=!1,ye.current?.querySelector(`[data-day="${q(I)}"]:not([data-outside])`)?.focus()},[I,f]);let P=(0,l.useCallback)(t=>{let r=ve(g(t),k,w);re.current=!0,G(r);let u=x(f,C-1);B(r,f)<0?p(r):B(r,u)>0&&p(x(r,-(C-1)))},[f,C,k,w,p]),V=(0,l.useCallback)(t=>y||k&&t<g(k)||w&&t>g(w)?!0:typeof j=="function"?j(t):Array.isArray(j)?j.some(r=>N(r,t)):!1,[y,k,w,j]),[ne,me]=(0,l.useState)(null),M=(0,l.useCallback)(t=>{te||Re(t),D?.(t)},[te,D]),U=(0,l.useCallback)(t=>{let r=g(t);if(V(r))return;if(a==="multiple"){let i=E??[];if(i.some(o=>N(o,r))){M(i.filter(o=>!N(o,r)));return}if(K!==void 0&&i.length>=K)return;M([...i,r].sort((o,b)=>o.getTime()-b.getTime()));return}if(a==="range"){let i=E??{from:null,to:null};if(!i.from||i.to){M({from:r,to:null});return}M(r<i.from?{from:r,to:i.from}:{from:i.from,to:r});return}M(N(E,r)?null:r)},[a,E,K,M,V]),Ee=(0,l.useCallback)(t=>{U(t),G(g(t)),B(t,f)<0?p(t):B(t,x(f,C-1))>0&&p(x(t,-(C-1)))},[U,f,C,p]),he=!y&&(!k||B(f,z(k))>0),pe=!y&&(!w||B(x(f,C-1),z(w))<0),Be=(0,l.useCallback)(()=>{p(x(f,-1))},[f,p]),Le=(0,l.useCallback)(()=>{p(x(f,1))},[f,p]),Ie=(0,l.useCallback)(t=>{if(y)return;let r=I;switch(t.key){case"ArrowLeft":t.preventDefault(),P(T(r,-1));break;case"ArrowRight":t.preventDefault(),P(T(r,1));break;case"ArrowUp":t.preventDefault(),P(T(r,-7));break;case"ArrowDown":t.preventDefault(),P(T(r,7));break;case"Home":t.preventDefault(),P(T(r,-((r.getDay()-A+7)%7)));break;case"End":t.preventDefault(),P(T(r,6-(r.getDay()-A+7)%7));break;case"PageUp":{t.preventDefault();let u=t.shiftKey?-12:-1,i=x(r,u),m=Math.min(r.getDate(),ie(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}case"PageDown":{t.preventDefault();let u=t.shiftKey?12:1,i=x(r,u),m=Math.min(r.getDate(),ie(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}default:break}},[y,I,P,A]),We=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{weekday:"short"}),r=new Intl.DateTimeFormat(R,{weekday:"long"}),u=new Date(2024,0,7);return Array.from({length:7},(i,m)=>{let o=T(u,(A+m)%7);return{short:t.format(o),long:r.format(o)}})},[R,A]),ze=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{month:"long"});return Array.from({length:12},(r,u)=>t.format(new Date(2024,u,1)))},[R]),De=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{month:"long",year:"numeric"}),[R]),Ve=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{dateStyle:"full"}),[R]),Ke=(0,l.useMemo)(()=>{if(X!=="dropdown")return[];let t=Y.getFullYear(),r=ce??k?.getFullYear()??t-100,u=ge??w?.getFullYear()??t+10;return u<r?[r]:Array.from({length:u-r+1},(i,m)=>r+m)},[X,ce,ge,k,w,Y]),S=a==="range"?E:null,_e=S&&S.from&&!S.to&&ne&&ne>S.from?ne:null,O=S?.to??_e,je=(0,l.useCallback)((t,r)=>{let u=!se(t,r),i=V(t),m=!1,o=!1,b=!1,d=!1;return a==="multiple"?m=(E??[]).some($=>N($,t)):a==="range"?(o=N(S?.from,t),b=N(O,t),m=o||b,d=!!(S?.from&&O&&t>S.from&&t<O)):m=N(E,t),{selected:m,today:N(t,Y),outside:u,disabled:i,rangeStart:o,rangeEnd:b,inRange:d}},[a,E,S,O,V,Y]),Oe=t=>{let r=x(f,t),u=rt(r,A,Ce),i=t===0,m=t===C-1;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("button",{type:"button",onClick:Be,disabled:!he,"aria-label":L?.previousMonth??"Previous month",className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[v],h.nav,!he&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!i&&"invisible"),children:(0,n.jsx)(nt,{className:h.icon})}),X==="dropdown"?(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("select",{"aria-label":L?.monthSelect??"Month",value:r.getMonth(),disabled:y,onChange:o=>p(new Date(r.getFullYear(),Number(o.target.value)-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[v],h.select,y&&"cursor-not-allowed opacity-50"),children:ze.map((o,b)=>(0,n.jsx)("option",{value:b,children:o},o))}),(0,n.jsx)("select",{"aria-label":L?.yearSelect??"Year",value:r.getFullYear(),disabled:y,onChange:o=>p(new Date(Number(o.target.value),r.getMonth()-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[v],h.select,y&&"cursor-not-allowed opacity-50"),children:Ke.map(o=>(0,n.jsx)("option",{value:o,children:o},o))})]}):(0,n.jsx)("div",{"aria-live":"polite",className:(0,c.cn)("font-semibold text-gray-900 dark:text-gray-100",h.caption),children:De.format(r)}),(0,n.jsx)("button",{type:"button",onClick:Le,disabled:!pe,"aria-label":L?.nextMonth??"Next month",className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[v],h.nav,!pe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!m&&"invisible"),children:(0,n.jsx)(ot,{className:h.icon})})]}),(0,n.jsxs)("table",{role:"grid","aria-label":De.format(r),className:"border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[ue&&(0,n.jsxs)("th",{scope:"col",className:(0,c.cn)("font-normal text-gray-400 dark:text-gray-500",h.head),children:[(0,n.jsx)("span",{className:"sr-only",children:L?.weekNumber??"Week number"}),(0,n.jsx)("span",{"aria-hidden":"true",children:"#"})]}),We.map(o=>(0,n.jsx)("th",{scope:"col",abbr:o.long,className:(0,c.cn)("font-medium uppercase text-gray-500 dark:text-gray-400",h.head),children:o.short},o.long))]})}),(0,n.jsx)("tbody",{children:u.map(o=>(0,n.jsxs)("tr",{children:[ue&&(0,n.jsx)("td",{className:(0,c.cn)("text-center align-middle text-gray-400 dark:text-gray-500",h.head),children:at(o[0])}),o.map(b=>{let d=je(b,r),$=q(b);if(d.outside&&!we)return(0,n.jsx)("td",{className:"p-0"},$);let Ue=N(b,Ae)&&!d.outside,oe=d.inRange||d.rangeStart&&!!O||d.rangeEnd&&!!S?.from;return(0,n.jsx)("td",{role:"presentation",className:(0,c.cn)("p-0",oe&&it[v],oe&&d.rangeStart&&"rounded-l-full",oe&&d.rangeEnd&&"rounded-r-full"),children:(0,n.jsx)("button",{type:"button","data-day":$,"data-selected":d.selected||void 0,"data-today":d.today||void 0,"data-outside":d.outside||void 0,role:"gridcell",tabIndex:Ue?0:-1,disabled:y,"aria-selected":d.selected,"aria-disabled":d.disabled||void 0,"aria-current":d.today?"date":void 0,"aria-label":Ve.format(b),onClick:()=>{d.disabled||Ee(b)},onMouseEnter:()=>a==="range"&&me(g(b)),onMouseLeave:()=>a==="range"&&me(null),onFocus:()=>G(g(b)),className:(0,c.cn)("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[v],h.day,d.selected?st[v]:d.inRange?(0,c.cn)(dt[v],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):d.today?(0,c.cn)(ut[v],"hover:bg-gray-100 dark:hover:bg-gray-700"):(0,c.cn)("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),d.outside&&!d.selected&&"text-gray-400 dark:text-gray-500",d.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:be?be(b,d):b.getDate()})},$)})]},q(o[0])))})]})]},q(r))},$e=(0,l.useCallback)(()=>{p(Y),G(Y),V(Y)||U(Y)},[Y,p,V,U]),He=(0,l.useCallback)(()=>{M(a==="multiple"?[]:a==="range"?{from:null,to:null}:null)},[a,M]),Ge=!!fe||Z||ee;return(0,n.jsxs)("div",{ref:ye,onKeyDown:Ie,className:(0,c.cn)("inline-block bg-white dark:bg-gray-900",Me&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",h.padding,y&&"opacity-60",Se),...Ne,children:[(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap",h.gap),children:Array.from({length:C},(t,r)=>Oe(r))}),Ge&&(0,n.jsxs)("div",{className:(0,c.cn)("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",h.footer),children:[(0,n.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:fe}),(Z||ee)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[Z&&(0,n.jsx)("button",{type:"button",onClick:$e,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[v],y&&"cursor-not-allowed opacity-50"),children:L?.today??"Today"}),ee&&(0,n.jsx)("button",{type:"button",onClick:He,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[v],y&&"cursor-not-allowed opacity-50"),children:L?.clear??"Clear"})]})]})]})}0&&(module.exports={Calendar});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCallback as p,useEffect as Xe,useMemo as K,useRef as ke,useState as Q}from"react";import{cn as c}from"../../lib/cn.js";import{jsx as o,jsxs as N}from"react/jsx-runtime";var Ze=10080*60*1e3;function u(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function W(a){return new Date(a.getFullYear(),a.getMonth(),1)}function P(a,r){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+r)}function v(a,r){return new Date(a.getFullYear(),a.getMonth()+r,1)}function ue(a){return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()}function S(a,r){return!a||!r?!1:a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()&&a.getDate()===r.getDate()}function de(a,r){return a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()}function E(a,r){return a.getFullYear()*12+a.getMonth()-(r.getFullYear()*12+r.getMonth())}function X(a){let r=`${a.getMonth()+1}`.padStart(2,"0"),i=`${a.getDate()}`.padStart(2,"0");return`${a.getFullYear()}-${r}-${i}`}function et(a){let r=u(a);r.setDate(r.getDate()-(r.getDay()+6)%7+3);let i=new Date(r.getFullYear(),0,4);return i.setDate(i.getDate()-(i.getDay()+6)%7+3),1+Math.round((r.getTime()-i.getTime())/Ze)}function we(a,r,i){return r&&a<u(r)?u(r):i&&a>u(i)?u(i):a}function tt(a,r,i){let z=W(a),_=(z.getDay()-r+7)%7,j=P(z,-_),O=i?6:Math.ceil((_+ue(a))/7);return Array.from({length:O},(ee,U)=>Array.from({length:7},(ce,T)=>P(j,U*7+T)))}function at({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function rt({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var nt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},ot={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-white hover:bg-yellow-600 dark:bg-yellow-400 dark:text-gray-900 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},lt={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},st={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},it={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},I={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function Z(a,r){if(a==="multiple")return Array.isArray(r)?r.map(u):[];if(a==="range"){let i=r??null;return{from:i?.from?u(i.from):null,to:i?.to?u(i.to):null}}return r instanceof Date?u(r):null}function Ce(a){return a?a instanceof Date?a:Array.isArray(a)?a[0]??null:a.from??a.to??null:null}function gt(a){let{mode:r="single",value:i,defaultValue:z,onChange:_,max:j,month:O,defaultMonth:ee,onMonthChange:U,numberOfMonths:ce=1,weekStartsOn:T=0,locale:F,size:Me="md",color:D="primary",minDate:x,maxDate:k,disabledDates:$,disabled:b=!1,showOutsideDays:Se=!0,showWeekNumbers:ge=!1,fixedWeeks:Ne=!1,captionLayout:te="label",fromYear:fe,toYear:be,todayButton:ae=!1,clearButton:re=!1,footer:ye,bordered:Fe=!0,renderDay:me,labels:B,className:Re,...Ye}=a,m=nt[Me],w=Math.max(1,ce),R=K(()=>u(new Date),[]),ne=i!==void 0,[Pe,Te]=Q(()=>Z(r,z)),A=ne?Z(r,i):Pe,oe=O!==void 0,[Ae,Ee]=Q(()=>W(ee??Ce(Z(r,z??i))??new Date)),g=oe?W(O):Ae,h=p(e=>{let t=W(e);oe||Ee(t),U?.(t)},[oe,U]),he=ke(null),le=ke(!1),[L,q]=Q(()=>{let e=Ce(Z(r,z??i)),t=W(ee??O??e??new Date),d=e&&de(e,t)?e:de(u(new Date),t)?u(new Date):t;return we(d,x,k)}),Be=v(g,w-1),Le=E(L,g)>=0&&E(L,Be)<=0?L:g;Xe(()=>{if(!le.current)return;le.current=!1,he.current?.querySelector(`[data-day="${X(L)}"]:not([data-outside])`)?.focus()},[L,g]);let Y=p(e=>{let t=we(u(e),x,k);le.current=!0,q(t);let d=v(g,w-1);E(t,g)<0?h(t):E(t,d)>0&&h(v(t,-(w-1)))},[g,w,x,k,h]),V=p(e=>b||x&&e<u(x)||k&&e>u(k)?!0:typeof $=="function"?$(e):Array.isArray($)?$.some(t=>S(t,e)):!1,[b,x,k,$]),[se,pe]=Q(null),C=p(e=>{ne||Te(e),_?.(e)},[ne,_]),J=p(e=>{let t=u(e);if(V(t))return;if(r==="multiple"){let l=A??[];if(l.some(n=>S(n,t))){C(l.filter(n=>!S(n,t)));return}if(j!==void 0&&l.length>=j)return;C([...l,t].sort((n,f)=>n.getTime()-f.getTime()));return}if(r==="range"){let l=A??{from:null,to:null};if(!l.from||l.to){C({from:t,to:null});return}C(t<l.from?{from:t,to:l.from}:{from:l.from,to:t});return}C(S(A,t)?null:t)},[r,A,j,C,V]),Ie=p(e=>{J(e),q(u(e)),E(e,g)<0?h(e):E(e,v(g,w-1))>0&&h(v(e,-(w-1)))},[J,g,w,h]),De=!b&&(!x||E(g,W(x))>0),ve=!b&&(!k||E(v(g,w-1),W(k))<0),We=p(()=>{h(v(g,-1))},[g,h]),ze=p(()=>{h(v(g,1))},[g,h]),Ve=p(e=>{if(b)return;let t=L;switch(e.key){case"ArrowLeft":e.preventDefault(),Y(P(t,-1));break;case"ArrowRight":e.preventDefault(),Y(P(t,1));break;case"ArrowUp":e.preventDefault(),Y(P(t,-7));break;case"ArrowDown":e.preventDefault(),Y(P(t,7));break;case"Home":e.preventDefault(),Y(P(t,-((t.getDay()-T+7)%7)));break;case"End":e.preventDefault(),Y(P(t,6-(t.getDay()-T+7)%7));break;case"PageUp":{e.preventDefault();let d=e.shiftKey?-12:-1,l=v(t,d),y=Math.min(t.getDate(),ue(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}case"PageDown":{e.preventDefault();let d=e.shiftKey?12:1,l=v(t,d),y=Math.min(t.getDate(),ue(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}default:break}},[b,L,Y,T]),Ke=K(()=>{let e=new Intl.DateTimeFormat(F,{weekday:"short"}),t=new Intl.DateTimeFormat(F,{weekday:"long"}),d=new Date(2024,0,7);return Array.from({length:7},(l,y)=>{let n=P(d,(T+y)%7);return{short:e.format(n),long:t.format(n)}})},[F,T]),_e=K(()=>{let e=new Intl.DateTimeFormat(F,{month:"long"});return Array.from({length:12},(t,d)=>e.format(new Date(2024,d,1)))},[F]),xe=K(()=>new Intl.DateTimeFormat(F,{month:"long",year:"numeric"}),[F]),je=K(()=>new Intl.DateTimeFormat(F,{dateStyle:"full"}),[F]),Oe=K(()=>{if(te!=="dropdown")return[];let e=R.getFullYear(),t=fe??x?.getFullYear()??e-100,d=be??k?.getFullYear()??e+10;return d<t?[t]:Array.from({length:d-t+1},(l,y)=>t+y)},[te,fe,be,x,k,R]),M=r==="range"?A:null,$e=M&&M.from&&!M.to&&se&&se>M.from?se:null,H=M?.to??$e,He=p((e,t)=>{let d=!de(e,t),l=V(e),y=!1,n=!1,f=!1,s=!1;return r==="multiple"?y=(A??[]).some(G=>S(G,e)):r==="range"?(n=S(M?.from,e),f=S(H,e),y=n||f,s=!!(M?.from&&H&&e>M.from&&e<H)):y=S(A,e),{selected:y,today:S(e,R),outside:d,disabled:l,rangeStart:n,rangeEnd:f,inRange:s}},[r,A,M,H,V,R]),Ge=e=>{let t=v(g,e),d=tt(t,T,Ne),l=e===0,y=e===w-1;return N("div",{className:"flex flex-col",children:[N("div",{className:"mb-2 flex items-center justify-between",children:[o("button",{type:"button",onClick:We,disabled:!De,"aria-label":B?.previousMonth??"Previous month",className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",I[D],m.nav,!De&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!l&&"invisible"),children:o(at,{className:m.icon})}),te==="dropdown"?N("div",{className:"flex items-center gap-1",children:[o("select",{"aria-label":B?.monthSelect??"Month",value:t.getMonth(),disabled:b,onChange:n=>h(new Date(t.getFullYear(),Number(n.target.value)-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",I[D],m.select,b&&"cursor-not-allowed opacity-50"),children:_e.map((n,f)=>o("option",{value:f,children:n},n))}),o("select",{"aria-label":B?.yearSelect??"Year",value:t.getFullYear(),disabled:b,onChange:n=>h(new Date(Number(n.target.value),t.getMonth()-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",I[D],m.select,b&&"cursor-not-allowed opacity-50"),children:Oe.map(n=>o("option",{value:n,children:n},n))})]}):o("div",{"aria-live":"polite",className:c("font-semibold text-gray-900 dark:text-gray-100",m.caption),children:xe.format(t)}),o("button",{type:"button",onClick:ze,disabled:!ve,"aria-label":B?.nextMonth??"Next month",className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",I[D],m.nav,!ve&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!y&&"invisible"),children:o(rt,{className:m.icon})})]}),N("table",{role:"grid","aria-label":xe.format(t),className:"border-collapse",children:[o("thead",{children:N("tr",{children:[ge&&N("th",{scope:"col",className:c("font-normal text-gray-400 dark:text-gray-500",m.head),children:[o("span",{className:"sr-only",children:B?.weekNumber??"Week number"}),o("span",{"aria-hidden":"true",children:"#"})]}),Ke.map(n=>o("th",{scope:"col",abbr:n.long,className:c("font-medium uppercase text-gray-500 dark:text-gray-400",m.head),children:n.short},n.long))]})}),o("tbody",{children:d.map(n=>N("tr",{children:[ge&&o("td",{className:c("text-center align-middle text-gray-400 dark:text-gray-500",m.head),children:et(n[0])}),n.map(f=>{let s=He(f,t),G=X(f);if(s.outside&&!Se)return o("td",{className:"p-0"},G);let Qe=S(f,Le)&&!s.outside,ie=s.inRange||s.rangeStart&&!!H||s.rangeEnd&&!!M?.from;return o("td",{role:"presentation",className:c("p-0",ie&<[D],ie&&s.rangeStart&&"rounded-l-full",ie&&s.rangeEnd&&"rounded-r-full"),children:o("button",{type:"button","data-day":G,"data-selected":s.selected||void 0,"data-today":s.today||void 0,"data-outside":s.outside||void 0,role:"gridcell",tabIndex:Qe?0:-1,disabled:b,"aria-selected":s.selected,"aria-disabled":s.disabled||void 0,"aria-current":s.today?"date":void 0,"aria-label":je.format(f),onClick:()=>{s.disabled||Ie(f)},onMouseEnter:()=>r==="range"&&pe(u(f)),onMouseLeave:()=>r==="range"&&pe(null),onFocus:()=>q(u(f)),className:c("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",I[D],m.day,s.selected?ot[D]:s.inRange?c(st[D],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):s.today?c(it[D],"hover:bg-gray-100 dark:hover:bg-gray-700"):c("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),s.outside&&!s.selected&&"text-gray-400 dark:text-gray-500",s.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:me?me(f,s):f.getDate()})},G)})]},X(n[0])))})]})]},X(t))},Ue=p(()=>{h(R),q(R),V(R)||J(R)},[R,h,V,J]),qe=p(()=>{C(r==="multiple"?[]:r==="range"?{from:null,to:null}:null)},[r,C]),Je=!!ye||ae||re;return N("div",{ref:he,onKeyDown:Ve,className:c("inline-block bg-white dark:bg-gray-900",Fe&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",m.padding,b&&"opacity-60",Re),...Ye,children:[o("div",{className:c("flex flex-wrap",m.gap),children:Array.from({length:w},(e,t)=>Ge(t))}),Je&&N("div",{className:c("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",m.footer),children:[o("div",{className:"text-gray-600 dark:text-gray-400",children:ye}),(ae||re)&&N("div",{className:"flex items-center gap-2",children:[ae&&o("button",{type:"button",onClick:Ue,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",I[D],b&&"cursor-not-allowed opacity-50"),children:B?.today??"Today"}),re&&o("button",{type:"button",onClick:qe,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",I[D],b&&"cursor-not-allowed opacity-50"),children:B?.clear??"Clear"})]})]})]})}export{gt as Calendar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var S=(e,a)=>{for(var l in a)d(e,l,{get:a[l],enumerable:!0})},f=(e,a,l,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of t(a))!p.call(e,r)&&r!==l&&d(e,r,{get:()=>a[r],enumerable:!(n=o(a,r))||n.enumerable});return e};var m=e=>f(d({},"__esModule",{value:!0}),e);var s={};S(s,{Calendar:()=>C.Calendar});module.exports=m(s);var C=require("./Calendar.cjs");0&&(module.exports={Calendar});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Calendar as r}from"./Calendar.js";export{r as Calendar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var Q=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var ye=(l,a)=>{for(var r in a)Q(l,r,{get:a[r],enumerable:!0})},pe=(l,a,r,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of fe(a))!be.call(l,g)&&g!==r&&Q(l,g,{get:()=>a[g],enumerable:!(o=me(a,g))||o.enumerable});return l};var Ce=l=>pe(Q({},"__esModule",{value:!0}),l);var Re={};ye(Re,{CandlestickChart:()=>Le});module.exports=Ce(Re);var c=require("react"),te=require("../../lib/i18n.cjs"),ee=require("../chart/ChartAxis.cjs"),ae=require("../chart/ChartContainer.cjs"),oe=require("../chart/ChartGrid.cjs"),le=require("../chart/ChartLegend.cjs"),ie=require("../chart/ChartTableView.cjs"),se=require("../chart/ChartTooltip.cjs"),_=require("../chart/palette.cjs"),ue=require("../chart/utils/cartesian.cjs"),L=require("../chart/utils/data.cjs"),$=require("../chart/utils/format.cjs"),he=require("../chart/utils/path.cjs"),ce=require("../chart/utils/scales.cjs"),e=require("react/jsx-runtime"),ke=16,xe=1.5,we=(0,c.memo)(function({candles:a}){return(0,e.jsx)("g",{children:a.map(r=>(0,e.jsxs)("g",{children:[r.wick?(0,e.jsx)("line",{x1:r.wick.x,y1:r.wick.y1,x2:r.wick.x,y2:r.wick.y2,stroke:r.color,strokeWidth:1.5}):null,r.body?(0,e.jsx)("path",{d:r.body,fill:r.hollow?"none":r.color,stroke:r.color,strokeWidth:r.hollow?1.5:0}):null]},r.key))})});function ve({width:l,height:a,data:r,candles:o,x:g,y:p,grid:R,size:X,candleSize:E,fillRising:P,palette:M,referenceLines:I,margin:W,tooltip:b,plotLabel:K,formatValue:y,formatX:D,onCandleClick:N}){let[u,S]=(0,c.useState)(null),C=(0,te.useUILabels)(),t=(0,c.useMemo)(()=>{let n=o.flatMap(s=>s.high===null||s.low===null?[]:[s.low,s.high]),i=(0,ue.buildCartesianGeometry)({width:l,height:a,data:r,x:g,y:p,bounds:n.length===0?null:[Math.min(...n),Math.max(...n)],margin:W,orientation:"vertical",placement:"band",formatValue:y,formatX:D,defaultIncludeZero:!1}),{valueScale:d,bandwidth:k,categoryPositions:z,innerWidth:U,innerHeight:j}=i,x=Math.min(E??ke,Math.max(1,k-2));return{rendered:o.map((s,G)=>{let H=z[G]+(k-x)/2,q=H+x/2,f=s.rising?M.up:M.down,O=s.high===null||s.low===null?null:{x:q,y1:d(s.high),y2:d(s.low)},w=null;if(s.open!==null&&s.close!==null){let T=d(s.open),v=d(s.close);w=(0,he.buildBarPath)({x:H,y:Math.min(T,v),width:x,height:Math.max(xe,Math.abs(v-T)),radius:0,round:"none"})}return{key:`${G}`,color:f,body:w,hollow:s.rising&&!P,wick:O,left:H,width:x}}),categoryPositions:z,categoryCenters:i.categoryCenters,bandwidth:k,categoryTicks:i.categoryTicks,valueTicks:i.valueTicks,valueScale:d,innerWidth:U,innerHeight:j,margin:i.margin}},[o,r,g,p,l,a,W,E,P,M,y,D]),B=(0,c.useCallback)(n=>{if(b===!1||o.length===0)return;let i=n.currentTarget.getBoundingClientRect(),d=n.clientX-i.left-t.margin.left;S((0,ce.nearestIndex)(t.categoryCenters,d))},[b,o.length,t.margin.left,t.categoryCenters]),Y=(0,c.useCallback)(n=>{if(o.length===0)return;let i=o.length-1,d=u??0,k=n.key==="ArrowRight"?Math.min(i,d+1):n.key==="ArrowLeft"?Math.max(0,d-1):n.key==="Home"?0:n.key==="End"?i:n.key==="Escape"?null:void 0;k!==void 0&&(n.preventDefault(),S(k))},[o.length,u]),F=(0,c.useCallback)(()=>{!N||u===null||N(o[u])},[N,u,o]),h=u===null?null:o[u];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("svg",{width:l,height:a,role:"img","aria-label":K??o.map(n=>n.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:B,onPointerLeave:()=>S(null),onKeyDown:Y,onBlur:()=>S(null),onClick:F,children:[(0,e.jsxs)("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:[(0,e.jsx)(oe.ChartGrid,{width:t.innerWidth,height:t.innerHeight,horizontal:R==="y"||R==="both"?t.valueTicks.map(n=>n.offset):void 0}),u!==null?(0,e.jsx)("rect",{x:t.categoryPositions[u],y:0,width:t.bandwidth,height:t.innerHeight,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,I?.map(n=>(0,e.jsxs)("g",{children:[(0,e.jsx)("line",{x1:0,y1:t.valueScale(n.value),x2:t.innerWidth,y2:t.valueScale(n.value),stroke:n.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:n.dashed===!1?void 0:"4 4"}),n.label?(0,e.jsx)("text",{x:t.innerWidth,y:t.valueScale(n.value)-4,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:n.label}):null]},`${n.value}-${n.label??""}`)),(0,e.jsx)(we,{candles:t.rendered})]}),(0,e.jsx)("g",{transform:`translate(${t.margin.left}, ${t.margin.top+t.innerHeight})`,children:g.hidden?null:(0,e.jsx)(ee.ChartAxis,{orientation:"bottom",ticks:t.categoryTicks,length:t.innerWidth,label:g.label,size:X})}),(0,e.jsx)("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:p?.hidden?null:(0,e.jsx)(ee.ChartAxis,{orientation:"left",ticks:t.valueTicks,length:t.innerHeight,showLine:!1,label:p?.label,size:X})})]}),h&&u!==null&&b!==!1?(0,e.jsx)(se.ChartTooltip,{x:t.margin.left+t.categoryCenters[u],y:t.margin.top+(h.high===null?t.innerHeight/2:t.valueScale(h.high)),containerWidth:l,children:typeof b=="function"?b(h):(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:h.label}),(0,e.jsx)("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[C.chartOpen,h.open],[C.chartHigh,h.high],[C.chartLow,h.low],[C.chartClose,h.close]].map(([n,i])=>(0,e.jsxs)("div",{className:"contents",children:[(0,e.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:n}),(0,e.jsx)("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:i===null?"\u2014":y(i)})]},n))}),h.change===null?null:(0,e.jsxs)("div",{className:"flex items-center gap-2 border-t border-gray-200 pt-1 dark:border-gray-700",children:[(0,e.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:h.rising?C.chartRise:C.chartFall}),(0,e.jsxs)("span",{className:"[font-variant-numeric:tabular-nums] font-semibold text-gray-900 dark:text-gray-100",children:[h.change>0?"+":"",y(h.change)]})]})]})}):null]})}function Le({data:l,x:a,y:r,open:o,high:g,low:p,close:R,candleSize:X,fillRising:E=!1,colors:P,referenceLines:M,height:I=300,width:W,size:b="md",grid:K="y",legend:y,tooltip:D=!0,tableView:N=!1,title:u,description:S,loading:C=!1,emptyState:t,error:B=!1,errorState:Y,onRetry:F,actions:h,margin:n,locale:i,plotLabel:d,openLabel:k,highLabel:z,lowLabel:U,closeLabel:j,riseLabel:x,fallLabel:Z,format:s,onCandleClick:G,className:H,...q}){let f=(0,te.useUILabels)(),O=(0,c.useMemo)(()=>r?.format??s??(m=>(0,$.formatAuto)(m,i)),[r?.format,s,i]),w=(0,c.useMemo)(()=>a.format??(m=>(0,$.formatXValue)(m,i)),[a.format,i]),T=(0,c.useMemo)(()=>l.map((m,J)=>{let re=(0,L.readXValue)(m,a.key,J),A=(0,L.readNumber)(m,o),V=(0,L.readNumber)(m,R);return{index:J,x:re,label:w(re,J),open:A,high:(0,L.readNumber)(m,g),low:(0,L.readNumber)(m,p),close:V,change:A===null||V===null?null:V-A,rising:A===null||V===null?!0:V>=A,datum:m}}),[l,a.key,o,g,p,R,w]),v=(0,c.useMemo)(()=>({up:P?.up??_.CHART_UP_COLOR,down:P?.down??_.CHART_DOWN_COLOR}),[P]),ge=(0,c.useMemo)(()=>[{key:"up",label:x??f.chartRise,color:v.up,marker:"rect"},{key:"down",label:Z??f.chartFall,color:v.down,marker:"rect"}],[v,x,Z,f.chartRise,f.chartFall]),de=y===void 0?!0:y!==!1,ne=typeof y=="string"?y:"bottom";return(0,e.jsx)(ae.ChartContainer,{title:u,description:S,height:I,width:W,size:b,loading:C,empty:T.length===0,emptyState:t,error:B,errorState:Y,onRetry:F,actions:h,tableView:N,legendPosition:ne,legend:de?(0,e.jsx)(le.ChartLegend,{items:ge,position:ne,marker:"rect",size:b}):void 0,table:N?(0,e.jsx)(ie.ChartTableView,{data:l,series:[{key:o,label:k??f.chartOpen},{key:g,label:z??f.chartHigh},{key:p,label:U??f.chartLow},{key:R,label:j??f.chartClose}],xKey:a.key,xLabel:a.label??a.key,formatX:w,formatValue:O,caption:typeof u=="string"?u:void 0}):void 0,className:H,...q,children:({width:m})=>(0,e.jsx)(ve,{width:m,height:I,data:l,candles:T,x:a,y:r,grid:K,size:b,candleSize:X,fillRising:E,palette:v,referenceLines:M,margin:n,tooltip:D,plotLabel:d,formatValue:O,formatX:w,onCandleClick:G})})}0&&(module.exports={CandlestickChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as oe,useCallback as J,useMemo as S,useState as le}from"react";import{useUILabels as ne}from"../../lib/i18n.js";import{ChartAxis as te}from"../chart/ChartAxis.js";import{ChartContainer as ie}from"../chart/ChartContainer.js";import{ChartGrid as se}from"../chart/ChartGrid.js";import{ChartLegend as ue}from"../chart/ChartLegend.js";import{ChartTableView as he}from"../chart/ChartTableView.js";import{ChartTooltip as ce}from"../chart/ChartTooltip.js";import{CHART_DOWN_COLOR as ge,CHART_UP_COLOR as de}from"../chart/palette.js";import{buildCartesianGeometry as me}from"../chart/utils/cartesian.js";import{readNumber as _,readXValue as fe}from"../chart/utils/data.js";import{formatAuto as be,formatXValue as ye}from"../chart/utils/format.js";import{buildBarPath as pe}from"../chart/utils/path.js";import{nearestIndex as Ce}from"../chart/utils/scales.js";import{Fragment as Le,jsx as n,jsxs as b}from"react/jsx-runtime";var ke=16,xe=1.5,we=oe(function({candles:u}){return n("g",{children:u.map(r=>b("g",{children:[r.wick?n("line",{x1:r.wick.x,y1:r.wick.y1,x2:r.wick.x,y2:r.wick.y2,stroke:r.color,strokeWidth:1.5}):null,r.body?n("path",{d:r.body,fill:r.hollow?"none":r.color,stroke:r.color,strokeWidth:r.hollow?1.5:0}):null]},r.key))})});function ve({width:g,height:u,data:r,candles:l,x:y,y:p,grid:L,size:X,candleSize:E,fillRising:R,palette:M,referenceLines:I,margin:W,tooltip:m,plotLabel:$,formatValue:f,formatX:D,onCandleClick:P}){let[i,N]=le(null),C=ne(),e=S(()=>{let t=l.flatMap(o=>o.high===null||o.low===null?[]:[o.low,o.high]),a=me({width:g,height:u,data:r,x:y,y:p,bounds:t.length===0?null:[Math.min(...t),Math.max(...t)],margin:W,orientation:"vertical",placement:"band",formatValue:f,formatX:D,defaultIncludeZero:!1}),{valueScale:h,bandwidth:k,categoryPositions:z,innerWidth:F,innerHeight:U}=a,x=Math.min(E??ke,Math.max(1,k-2));return{rendered:l.map((o,G)=>{let H=z[G]+(k-x)/2,Z=H+x/2,d=o.rising?M.up:M.down,O=o.high===null||o.low===null?null:{x:Z,y1:h(o.high),y2:h(o.low)},w=null;if(o.open!==null&&o.close!==null){let T=h(o.open),v=h(o.close);w=pe({x:H,y:Math.min(T,v),width:x,height:Math.max(xe,Math.abs(v-T)),radius:0,round:"none"})}return{key:`${G}`,color:d,body:w,hollow:o.rising&&!R,wick:O,left:H,width:x}}),categoryPositions:z,categoryCenters:a.categoryCenters,bandwidth:k,categoryTicks:a.categoryTicks,valueTicks:a.valueTicks,valueScale:h,innerWidth:F,innerHeight:U,margin:a.margin}},[l,r,y,p,g,u,W,E,R,M,f,D]),K=J(t=>{if(m===!1||l.length===0)return;let a=t.currentTarget.getBoundingClientRect(),h=t.clientX-a.left-e.margin.left;N(Ce(e.categoryCenters,h))},[m,l.length,e.margin.left,e.categoryCenters]),B=J(t=>{if(l.length===0)return;let a=l.length-1,h=i??0,k=t.key==="ArrowRight"?Math.min(a,h+1):t.key==="ArrowLeft"?Math.max(0,h-1):t.key==="Home"?0:t.key==="End"?a:t.key==="Escape"?null:void 0;k!==void 0&&(t.preventDefault(),N(k))},[l.length,i]),Y=J(()=>{!P||i===null||P(l[i])},[P,i,l]),s=i===null?null:l[i];return b(Le,{children:[b("svg",{width:g,height:u,role:"img","aria-label":$??l.map(t=>t.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:K,onPointerLeave:()=>N(null),onKeyDown:B,onBlur:()=>N(null),onClick:Y,children:[b("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[n(se,{width:e.innerWidth,height:e.innerHeight,horizontal:L==="y"||L==="both"?e.valueTicks.map(t=>t.offset):void 0}),i!==null?n("rect",{x:e.categoryPositions[i],y:0,width:e.bandwidth,height:e.innerHeight,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,I?.map(t=>b("g",{children:[n("line",{x1:0,y1:e.valueScale(t.value),x2:e.innerWidth,y2:e.valueScale(t.value),stroke:t.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:t.dashed===!1?void 0:"4 4"}),t.label?n("text",{x:e.innerWidth,y:e.valueScale(t.value)-4,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:t.label}):null]},`${t.value}-${t.label??""}`)),n(we,{candles:e.rendered})]}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:y.hidden?null:n(te,{orientation:"bottom",ticks:e.categoryTicks,length:e.innerWidth,label:y.label,size:X})}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:p?.hidden?null:n(te,{orientation:"left",ticks:e.valueTicks,length:e.innerHeight,showLine:!1,label:p?.label,size:X})})]}),s&&i!==null&&m!==!1?n(ce,{x:e.margin.left+e.categoryCenters[i],y:e.margin.top+(s.high===null?e.innerHeight/2:e.valueScale(s.high)),containerWidth:g,children:typeof m=="function"?m(s):b("div",{className:"flex flex-col gap-1",children:[n("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.label}),n("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[C.chartOpen,s.open],[C.chartHigh,s.high],[C.chartLow,s.low],[C.chartClose,s.close]].map(([t,a])=>b("div",{className:"contents",children:[n("dt",{className:"text-gray-500 dark:text-gray-400",children:t}),n("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:a===null?"\u2014":f(a)})]},t))}),s.change===null?null:b("div",{className:"flex items-center gap-2 border-t border-gray-200 pt-1 dark:border-gray-700",children:[n("span",{className:"text-gray-500 dark:text-gray-400",children:s.rising?C.chartRise:C.chartFall}),b("span",{className:"[font-variant-numeric:tabular-nums] font-semibold text-gray-900 dark:text-gray-100",children:[s.change>0?"+":"",f(s.change)]})]})]})}):null]})}function ze({data:g,x:u,y:r,open:l,high:y,low:p,close:L,candleSize:X,fillRising:E=!1,colors:R,referenceLines:M,height:I=300,width:W,size:m="md",grid:$="y",legend:f,tooltip:D=!0,tableView:P=!1,title:i,description:N,loading:C=!1,emptyState:e,error:K=!1,errorState:B,onRetry:Y,actions:s,margin:t,locale:a,plotLabel:h,openLabel:k,highLabel:z,lowLabel:F,closeLabel:U,riseLabel:x,fallLabel:j,format:o,onCandleClick:G,className:H,...Z}){let d=ne(),O=S(()=>r?.format??o??(c=>be(c,a)),[r?.format,o,a]),w=S(()=>u.format??(c=>ye(c,a)),[u.format,a]),T=S(()=>g.map((c,q)=>{let ee=fe(c,u.key,q),A=_(c,l),V=_(c,L);return{index:q,x:ee,label:w(ee,q),open:A,high:_(c,y),low:_(c,p),close:V,change:A===null||V===null?null:V-A,rising:A===null||V===null?!0:V>=A,datum:c}}),[g,u.key,l,y,p,L,w]),v=S(()=>({up:R?.up??de,down:R?.down??ge}),[R]),re=S(()=>[{key:"up",label:x??d.chartRise,color:v.up,marker:"rect"},{key:"down",label:j??d.chartFall,color:v.down,marker:"rect"}],[v,x,j,d.chartRise,d.chartFall]),ae=f===void 0?!0:f!==!1,Q=typeof f=="string"?f:"bottom";return n(ie,{title:i,description:N,height:I,width:W,size:m,loading:C,empty:T.length===0,emptyState:e,error:K,errorState:B,onRetry:Y,actions:s,tableView:P,legendPosition:Q,legend:ae?n(ue,{items:re,position:Q,marker:"rect",size:m}):void 0,table:P?n(he,{data:g,series:[{key:l,label:k??d.chartOpen},{key:y,label:z??d.chartHigh},{key:p,label:F??d.chartLow},{key:L,label:U??d.chartClose}],xKey:u.key,xLabel:u.label??u.key,formatX:w,formatValue:O,caption:typeof i=="string"?i:void 0}):void 0,className:H,...Z,children:({width:c})=>n(ve,{width:c,height:I,data:g,candles:T,x:u,y:r,grid:$,size:m,candleSize:X,fillRising:E,palette:v,referenceLines:M,margin:t,tooltip:D,plotLabel:h,formatValue:O,formatX:w,onCandleClick:G})})}export{ze as CandlestickChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var C=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(r,t)=>{for(var e in t)C(r,e,{get:t[e],enumerable:!0})},c=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of n(t))!p.call(r,a)&&a!==e&&C(r,a,{get:()=>t[a],enumerable:!(o=l(t,a))||o.enumerable});return r};var h=r=>c(C({},"__esModule",{value:!0}),r);var i={};s(i,{CandlestickChart:()=>d.CandlestickChart});module.exports=h(i);var d=require("./CandlestickChart.cjs");0&&(module.exports={CandlestickChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CandlestickChart as a}from"./CandlestickChart.js";export{a as CandlestickChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var k=(e,r)=>{for(var a in r)s(e,a,{get:r[a],enumerable:!0})},N=(e,r,a,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of y(r))!R.call(e,n)&&n!==a&&s(e,n,{get:()=>r[n],enumerable:!(t=P(r,n))||t.enumerable});return e};var z=e=>N(s({},"__esModule",{value:!0}),e);var q={};k(q,{Card:()=>i});module.exports=z(q);var o=require("../../lib/cn.cjs"),u=require("react/jsx-runtime");function B(e,r,a){let t=a||"bg-white dark:bg-gray-800",n=r||"border-gray-200 dark:border-gray-700";switch(e){case"outlined":return(0,o.cn)("border-2 bg-transparent",n);case"elevated":return(0,o.cn)("shadow-lg border-0",t);case"filled":return(0,o.cn)(a||"bg-gray-100 dark:bg-gray-700","border-0");default:return(0,o.cn)("border",n,t)}}function W(e){switch(e){case"sm":return"max-w-sm";case"lg":return"max-w-2xl";default:return"max-w-md"}}function S(e){switch(e){case"none":return"rounded-none";case"sm":return"rounded-sm";case"md":return"rounded-md";case"xl":return"rounded-xl";case"full":return"rounded-3xl";default:return"rounded-lg"}}function V(e){switch(e){case"none":return"";case"sm":return"p-2";case"lg":return"p-6";default:return""}}function i({variant:e="default",size:r="md",rounded:a="lg",padding:t="none",bgColor:n,borderColor:c,shadowColor:g,hoverable:m=!1,clickable:d=!1,as:f="div",className:p,children:C,onClick:l,...h}){let b=f,v=m?"transition-all duration-200 hover:shadow-lg hover:-translate-y-0.5":"",w=d?"cursor-pointer active:scale-[0.98] transition-transform":"",x=g||"";return(0,u.jsx)(b,{className:(0,o.cn)("overflow-hidden",B(e,c,n),W(r),S(a),V(t),v,w,x,p),onClick:d||l?l:void 0,...h,children:C})}i.displayName="Card";0&&(module.exports={Card});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as r}from"../../lib/cn.js";import{jsx as R}from"react/jsx-runtime";function v(e,o,n){let a=n||"bg-white dark:bg-gray-800",t=o||"border-gray-200 dark:border-gray-700";switch(e){case"outlined":return r("border-2 bg-transparent",t);case"elevated":return r("shadow-lg border-0",a);case"filled":return r(n||"bg-gray-100 dark:bg-gray-700","border-0");default:return r("border",t,a)}}function w(e){switch(e){case"sm":return"max-w-sm";case"lg":return"max-w-2xl";default:return"max-w-md"}}function x(e){switch(e){case"none":return"rounded-none";case"sm":return"rounded-sm";case"md":return"rounded-md";case"xl":return"rounded-xl";case"full":return"rounded-3xl";default:return"rounded-lg"}}function P(e){switch(e){case"none":return"";case"sm":return"p-2";case"lg":return"p-6";default:return""}}function y({variant:e="default",size:o="md",rounded:n="lg",padding:a="none",bgColor:t,borderColor:l,shadowColor:i,hoverable:u=!1,clickable:s=!1,as:c="div",className:g,children:m,onClick:d,...f}){let p=c,C=u?"transition-all duration-200 hover:shadow-lg hover:-translate-y-0.5":"",h=s?"cursor-pointer active:scale-[0.98] transition-transform":"",b=i||"";return R(p,{className:r("overflow-hidden",v(e,l,t),w(o),x(n),P(a),C,h,b,g),onClick:s||d?d:void 0,...f,children:m})}y.displayName="Card";export{y as Card};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var y=(e,o)=>{for(var d in o)n(e,d,{get:o[d],enumerable:!0})},u=(e,o,d,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of c(o))!m.call(e,r)&&r!==d&&n(e,r,{get:()=>o[r],enumerable:!(t=i(o,r))||t.enumerable});return e};var f=e=>u(n({},"__esModule",{value:!0}),e);var l={};y(l,{CardBody:()=>a});module.exports=f(l);var p=require("../../lib/cn.cjs"),s=require("react/jsx-runtime");function C(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function a({padding:e="md",className:o,children:d,...t}){return(0,s.jsx)("div",{className:(0,p.cn)(C(e),o),...t,children:d})}a.displayName="CardBody";0&&(module.exports={CardBody});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as t}from"../../lib/cn.js";import{jsx as a}from"react/jsx-runtime";function n(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function p({padding:e="md",className:o,children:d,...r}){return a("div",{className:t(n(e),o),...r,children:d})}p.displayName="CardBody";export{p as CardBody};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of d(t))!m.call(e,o)&&o!==r&&i(e,o,{get:()=>t[o],enumerable:!(s=c(t,o))||s.enumerable});return e};var x=e=>u(i({},"__esModule",{value:!0}),e);var l={};f(l,{CardDescription:()=>a});module.exports=x(l);var p=require("../../lib/cn.cjs"),n=require("react/jsx-runtime");function C(e){switch(e){case"sm":return"text-xs";case"lg":return"text-base";default:return"text-sm"}}function a({size:e="md",className:t,children:r,...s}){return(0,n.jsx)("p",{className:(0,p.cn)("text-gray-500 dark:text-gray-400",C(e),t),...s,children:r})}a.displayName="CardDescription";0&&(module.exports={CardDescription});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as a}from"react/jsx-runtime";function i(e){switch(e){case"sm":return"text-xs";case"lg":return"text-base";default:return"text-sm"}}function p({size:e="md",className:t,children:r,...o}){return a("p",{className:s("text-gray-500 dark:text-gray-400",i(e),t),...o,children:r})}p.displayName="CardDescription";export{p as CardDescription};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var o in r)a(e,o,{get:r[o],enumerable:!0})},g=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!f.call(e,t)&&t!==o&&a(e,t,{get:()=>r[t],enumerable:!(n=c(r,t))||n.enumerable});return e};var m=e=>g(a({},"__esModule",{value:!0}),e);var b={};l(b,{CardFooter:()=>d});module.exports=m(b);var s=require("../../lib/cn.cjs"),i=require("react/jsx-runtime");function y(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function C(e){switch(e){case"center":return"justify-center";case"right":return"justify-end";case"between":return"justify-between";default:return"justify-start"}}function d({divider:e=!1,align:r="left",padding:o="md",className:n,children:t,...p}){return(0,i.jsx)("div",{className:(0,s.cn)("flex items-center gap-2",y(o),C(r),e&&"border-t border-gray-200 dark:border-gray-700",n),...p,children:t})}d.displayName="CardFooter";0&&(module.exports={CardFooter});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as c}from"react/jsx-runtime";function d(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function i(e){switch(e){case"center":return"justify-center";case"right":return"justify-end";case"between":return"justify-between";default:return"justify-start"}}function p({divider:e=!1,align:r="left",padding:t="md",className:o,children:n,...a}){return c("div",{className:s("flex items-center gap-2",d(t),i(r),e&&"border-t border-gray-200 dark:border-gray-700",o),...a,children:n})}p.displayName="CardFooter";export{p as CardFooter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(e,r)=>{for(var a in r)n(e,a,{get:r[a],enumerable:!0})},u=(e,r,a,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let d of m(r))!l.call(e,d)&&d!==a&&n(e,d,{get:()=>r[d],enumerable:!(o=c(r,d))||o.enumerable});return e};var g=e=>u(n({},"__esModule",{value:!0}),e);var x={};f(x,{CardHeader:()=>i});module.exports=g(x);var s=require("../../lib/cn.cjs"),t=require("react/jsx-runtime");function v(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function i({actions:e,divider:r=!1,padding:a="md",className:o,children:d,...p}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex items-center justify-between",v(a),r&&"border-b border-gray-200 dark:border-gray-700",o),...p,children:[(0,t.jsx)("div",{className:"flex-1",children:d}),e&&(0,t.jsx)("div",{className:"flex items-center gap-2 ml-4",children:e})]})}i.displayName="CardHeader";0&&(module.exports={CardHeader});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as r,jsxs as c}from"react/jsx-runtime";function i(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function p({actions:e,divider:d=!1,padding:a="md",className:t,children:o,...n}){return c("div",{className:s("flex items-center justify-between",i(a),d&&"border-b border-gray-200 dark:border-gray-700",t),...n,children:[r("div",{className:"flex-1",children:o}),e&&r("div",{className:"flex items-center gap-2 ml-4",children:e})]})}p.displayName="CardHeader";export{p as CardHeader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of m(t))!f.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(a=l(t,o))||a.enumerable});return e};var b=e=>C(s({},"__esModule",{value:!0}),e);var I={};g(I,{CardImage:()=>c});module.exports=b(I);var n=require("../../lib/cn.cjs"),i=require("react/jsx-runtime");function j(e){switch(e){case"square":return"aspect-square";case"video":return"aspect-video";case"wide":return"aspect-[21/9]";default:return""}}function v(e){switch(e){case"contain":return"object-contain";case"fill":return"object-fill";case"none":return"object-none";default:return"object-cover"}}function c({position:e="top",aspectRatio:t="auto",objectFit:r="cover",src:a,alt:o,className:p,...u}){let d=e==="top"?"rounded-t-lg":"rounded-b-lg";return(0,i.jsx)("img",{src:a,alt:o,className:(0,n.cn)("w-full",j(t),v(r),d,p),...u})}c.displayName="CardImage";0&&(module.exports={CardImage});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as i}from"../../lib/cn.js";import{jsx as l}from"react/jsx-runtime";function p(e){switch(e){case"square":return"aspect-square";case"video":return"aspect-video";case"wide":return"aspect-[21/9]";default:return""}}function u(e){switch(e){case"contain":return"object-contain";case"fill":return"object-fill";case"none":return"object-none";default:return"object-cover"}}function d({position:e="top",aspectRatio:t="auto",objectFit:o="cover",src:r,alt:a,className:s,...n}){let c=e==="top"?"rounded-t-lg":"rounded-b-lg";return l("img",{src:r,alt:a,className:i("w-full",p(t),u(o),c,s),...n})}d.displayName="CardImage";export{d as CardImage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!p.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return e};var f=e=>c(s({},"__esModule",{value:!0}),e);var u={};h(u,{CardTitle:()=>i});module.exports=f(u);var a=require("../../lib/cn.cjs"),d=require("react/jsx-runtime");function C(e){switch(e){case"sm":return"text-base font-medium";case"lg":return"text-2xl font-bold";default:return"text-xl font-semibold"}}function i({as:e="h3",size:t="md",className:r,children:n,...o}){return(0,d.jsx)(e,{className:(0,a.cn)("text-gray-900 dark:text-white",C(t),r),...o,children:n})}i.displayName="CardTitle";0&&(module.exports={CardTitle});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as d}from"react/jsx-runtime";function a(e){switch(e){case"sm":return"text-base font-medium";case"lg":return"text-2xl font-bold";default:return"text-xl font-semibold"}}function i({as:e="h3",size:t="md",className:o,children:r,...n}){return d(e,{className:s("text-gray-900 dark:text-white",a(t),o),...n,children:r})}i.displayName="CardTitle";export{i as CardTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var g=(o,r)=>{for(var p in r)t(o,p,{get:r[p],enumerable:!0})},l=(o,r,p,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of P(r))!c.call(o,e)&&e!==p&&t(o,e,{get:()=>r[e],enumerable:!(a=i(r,e))||a.enumerable});return o};var n=o=>l(t({},"__esModule",{value:!0}),o);var B={};g(B,{Card:()=>d.Card,CardBody:()=>m.CardBody,CardDescription:()=>y.CardDescription,CardFooter:()=>f.CardFooter,CardHeader:()=>C.CardHeader,CardImage:()=>x.CardImage,CardTitle:()=>s.CardTitle});module.exports=n(B);var d=require("./Card.cjs"),C=require("./CardHeader.cjs"),m=require("./CardBody.cjs"),f=require("./CardFooter.cjs"),x=require("./CardImage.cjs"),s=require("./CardTitle.cjs"),y=require("./CardDescription.cjs");0&&(module.exports={Card,CardBody,CardDescription,CardFooter,CardHeader,CardImage,CardTitle});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Card as e}from"./Card.js";import{CardHeader as t}from"./CardHeader.js";import{CardBody as d}from"./CardBody.js";import{CardFooter as m}from"./CardFooter.js";import{CardImage as x}from"./CardImage.js";import{CardTitle as y}from"./CardTitle.js";import{CardDescription as P}from"./CardDescription.js";export{e as Card,d as CardBody,P as CardDescription,m as CardFooter,t as CardHeader,x as CardImage,y as CardTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var k=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var D=(t,r)=>{for(var e in r)k(t,e,{get:r[e],enumerable:!0})},$=(t,r,e,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of v(r))!M.call(t,a)&&a!==e&&k(t,a,{get:()=>r[a],enumerable:!(l=_(r,a))||l.enumerable});return t};var w=t=>$(k({},"__esModule",{value:!0}),t);var L={};D(L,{ChartAnnotationLayer:()=>E,describeAnnotations:()=>G});module.exports=w(L);var m=require("./utils/text.cjs"),n=require("react/jsx-runtime"),A=10,C=15,x=5,h=6,b=4,B=.1;function P({x:t,y:r,text:e,align:l}){let a=(0,m.estimateTextWidth)(e,A)+x*2,y=l==="start"?t:t-a;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{x:y,y:r,width:a,height:C,rx:3,className:"fill-white stroke-gray-200 dark:fill-gray-800 dark:stroke-gray-700",strokeWidth:1}),(0,n.jsx)("text",{x:y+x,y:r+C/2,dominantBaseline:"central",className:"fill-gray-600 text-[10px] dark:fill-gray-300",children:e})]})}function E({annotations:t,xAt:r,yAt:e,width:l,height:a,bandwidth:y=0,layer:O="over"}){if(t.length===0)return null;if(O==="under"){let o=t.filter(s=>s.type==="band");return o.length===0?null:(0,n.jsx)("g",{"aria-hidden":"true",children:o.map((s,i)=>{let d=r(s.from),c=r(s.to);if(d===null||c===null)return null;let u=Math.max(0,Math.min(d,c)-y/2),g=Math.min(l,Math.max(d,c)+y/2)-u;if(g<=0)return null;let f=s.label??"",p=(0,m.estimateTextWidth)(f,A)+x*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{x:u,y:0,width:g,height:a,fill:s.color??"var(--color-chart-muted)",opacity:B}),f&&p<=g?(0,n.jsx)(P,{x:u+2,y:2,text:f,align:"start"}):null]},`band-${i}`)})})}let N=t.filter(o=>o.type!=="band");return N.length===0?null:(0,n.jsx)("g",{"aria-hidden":"true",children:N.map((o,s)=>{let i=r(o.x);if(i===null)return null;let d=o.color??"var(--color-chart-muted)";if(o.type==="line"){let p=o.label??"",W=(0,m.estimateTextWidth)(p,A)+x*2,T=i+h+W<=l?"start":"end";return(0,n.jsxs)("g",{children:[(0,n.jsx)("line",{x1:i,y1:0,x2:i,y2:a,stroke:d,strokeWidth:1,strokeDasharray:o.dashed===!1?void 0:"3 3"}),p?(0,n.jsx)(P,{x:T==="start"?i+h:i-h,y:2,text:p,align:T}):null]},`line-${s}`)}let c=e(o.y);if(!Number.isFinite(c))return null;let u=o.label??"",I=(0,m.estimateTextWidth)(u,A)+x*2,g=i+b+h+I<=l?"start":"end",f=Math.min(Math.max(0,c-C-h),a-C);return(0,n.jsxs)("g",{children:[(0,n.jsx)("circle",{cx:i,cy:c,r:b,fill:"none",stroke:d,strokeWidth:2}),u?(0,n.jsx)(P,{x:g==="start"?i+b+h:i-b-h,y:f,text:u,align:g}):null]},`point-${s}`)})})}function G(t,r){if(!t||t.length===0)return"";let e=t.map(l=>l.label).filter(l=>!!l);return e.length===0?"":`${r}: ${e.join(", ")}`}0&&(module.exports={ChartAnnotationLayer,describeAnnotations});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{estimateTextWidth as b}from"./utils/text.js";import{jsx as e,jsxs as C}from"react/jsx-runtime";var A=10,k=15,m=5,u=6,x=4,_=.1;function P({x:n,y:o,text:i,align:l}){let h=b(i,A)+m*2,y=l==="start"?n:n-h;return C("g",{children:[e("rect",{x:y,y:o,width:h,height:k,rx:3,className:"fill-white stroke-gray-200 dark:fill-gray-800 dark:stroke-gray-700",strokeWidth:1}),e("text",{x:y+m,y:o+k/2,dominantBaseline:"central",className:"fill-gray-600 text-[10px] dark:fill-gray-300",children:i})]})}function M({annotations:n,xAt:o,yAt:i,width:l,height:h,bandwidth:y=0,layer:O="over"}){if(n.length===0)return null;if(O==="under"){let t=n.filter(a=>a.type==="band");return t.length===0?null:e("g",{"aria-hidden":"true",children:t.map((a,r)=>{let d=o(a.from),s=o(a.to);if(d===null||s===null)return null;let c=Math.max(0,Math.min(d,s)-y/2),g=Math.min(l,Math.max(d,s)+y/2)-c;if(g<=0)return null;let f=a.label??"",p=b(f,A)+m*2;return C("g",{children:[e("rect",{x:c,y:0,width:g,height:h,fill:a.color??"var(--color-chart-muted)",opacity:_}),f&&p<=g?e(P,{x:c+2,y:2,text:f,align:"start"}):null]},`band-${r}`)})})}let N=n.filter(t=>t.type!=="band");return N.length===0?null:e("g",{"aria-hidden":"true",children:N.map((t,a)=>{let r=o(t.x);if(r===null)return null;let d=t.color??"var(--color-chart-muted)";if(t.type==="line"){let p=t.label??"",W=b(p,A)+m*2,T=r+u+W<=l?"start":"end";return C("g",{children:[e("line",{x1:r,y1:0,x2:r,y2:h,stroke:d,strokeWidth:1,strokeDasharray:t.dashed===!1?void 0:"3 3"}),p?e(P,{x:T==="start"?r+u:r-u,y:2,text:p,align:T}):null]},`line-${a}`)}let s=i(t.y);if(!Number.isFinite(s))return null;let c=t.label??"",I=b(c,A)+m*2,g=r+x+u+I<=l?"start":"end",f=Math.min(Math.max(0,s-k-u),h-k);return C("g",{children:[e("circle",{cx:r,cy:s,r:x,fill:"none",stroke:d,strokeWidth:2}),c?e(P,{x:g==="start"?r+x+u:r-x-u,y:f,text:c,align:g}):null]},`point-${a}`)})})}function D(n,o){if(!n||n.length===0)return"";let i=n.map(l=>l.label).filter(l=>!!l);return i.length===0?"":`${o}: ${i.join(", ")}`}export{M as ChartAnnotationLayer,D as describeAnnotations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var A=(a,r)=>{for(var o in r)m(a,o,{get:r[o],enumerable:!0})},w=(a,r,o,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of b(r))!c.call(a,e)&&e!==o&&m(a,e,{get:()=>r[e],enumerable:!(i=C(r,e))||i.enumerable});return a};var N=a=>w(m({},"__esModule",{value:!0}),a);var R={};A(R,{ChartAxis:()=>P});module.exports=N(R);var d=require("../../lib/cn.cjs"),f=require("./utils/text.cjs"),n=require("react/jsx-runtime"),$=10,O={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function P({orientation:a,ticks:r,length:o,showLine:i=!0,tickSize:e=4,tickPadding:l=6,label:h,size:x="md",className:p,...g}){let t=a==="bottom";return(0,n.jsxs)("g",{className:(0,d.cn)(O[x],p),"aria-hidden":"true",...g,children:[i&&(0,n.jsx)("line",{x1:0,y1:0,x2:t?o:0,y2:t?0:o,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"}),r.map(s=>{let y=t?s.offset:0,u=t?0:s.offset;return(0,n.jsxs)("g",{transform:`translate(${y}, ${u})`,children:[e>0?(0,n.jsx)("line",{x1:0,y1:0,x2:t?0:-e,y2:t?e:0,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1}):null,(0,n.jsx)("text",{x:t?0:-(e+l),y:t?e+l:0,textAnchor:t?"middle":"end",dominantBaseline:t?"hanging":"middle",className:"fill-gray-500 dark:fill-gray-400 [font-variant-numeric:tabular-nums]",children:s.label})]},`${s.label}-${s.offset}`)}),h?(0,n.jsx)("text",{x:t?o/2:0,y:t?e+l+16:0,textAnchor:"middle",dominantBaseline:t?"hanging":"middle",transform:t?void 0:`translate(${-(e+l+(0,f.widestLabel)(r.map(s=>s.label))+$)}, ${o/2}) rotate(-90)`,className:"fill-gray-600 dark:fill-gray-300 font-medium",children:h}):null]})}0&&(module.exports={ChartAxis});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as y}from"../../lib/cn.js";import{widestLabel as u}from"./utils/text.js";import{jsx as n,jsxs as l}from"react/jsx-runtime";var C=10,b={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function w({orientation:m,ticks:s,length:a,showLine:h=!0,tickSize:e=4,tickPadding:o=6,label:i,size:d="md",className:f,...x}){let t=m==="bottom";return l("g",{className:y(b[d],f),"aria-hidden":"true",...x,children:[h&&n("line",{x1:0,y1:0,x2:t?a:0,y2:t?0:a,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"}),s.map(r=>{let p=t?r.offset:0,g=t?0:r.offset;return l("g",{transform:`translate(${p}, ${g})`,children:[e>0?n("line",{x1:0,y1:0,x2:t?0:-e,y2:t?e:0,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1}):null,n("text",{x:t?0:-(e+o),y:t?e+o:0,textAnchor:t?"middle":"end",dominantBaseline:t?"hanging":"middle",className:"fill-gray-500 dark:fill-gray-400 [font-variant-numeric:tabular-nums]",children:r.label})]},`${r.label}-${r.offset}`)}),i?n("text",{x:t?a/2:0,y:t?e+o+16:0,textAnchor:"middle",dominantBaseline:t?"hanging":"middle",transform:t?void 0:`translate(${-(e+o+u(s.map(r=>r.label))+C)}, ${a/2}) rotate(-90)`,className:"fill-gray-600 dark:fill-gray-300 font-medium",children:i}):null]})}export{w as ChartAxis};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var P=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var K=(r,o)=>{for(var n in o)P(r,n,{get:o[n],enumerable:!0})},O=(r,o,n,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of M(o))!I.call(r,l)&&l!==n&&P(r,l,{get:()=>o[l],enumerable:!(i=A(o,l))||i.enumerable});return r};var U=r=>O(P({},"__esModule",{value:!0}),r);var H={};K(H,{ChartBrushLayer:()=>N,useChartBrush:()=>X});module.exports=U(H);var u=require("react"),b=require("./utils/scales.cjs"),E=require("react/jsx-runtime"),T=4,L=.14;function N({from:r,to:o,width:n,height:i,orientation:l="vertical",live:p=!1,label:s}){let g=Math.max(0,Math.min(r,o)),d=Math.min(l==="vertical"?n:i,Math.max(r,o)),h=d-g;if(h<=0)return null;let f=l==="vertical",y=f?{x:g,y:0,width:h,height:i}:{x:0,y:g,width:n,height:h},m=a=>f?{x1:a,y1:0,x2:a,y2:i}:{x1:0,y1:a,x2:n,y2:a};return(0,E.jsxs)("g",{"aria-hidden":s?void 0:"true",role:s?"img":void 0,"aria-label":s,children:[(0,E.jsx)("rect",{...y,className:"fill-blue-500",opacity:L}),[g,d].map(a=>(0,E.jsx)("line",{...m(a),className:"stroke-blue-600 dark:stroke-blue-400",strokeWidth:1.5,strokeDasharray:p?"3 3":void 0},a))]})}function X({enabled:r,active:o,centers:n,xValues:i,offset:l,orientation:p,onCommit:s}){let[g,d]=(0,u.useState)(null),h=(0,u.useRef)(null),f=(0,u.useRef)(!1),y=(0,u.useRef)(!1),m=(0,u.useRef)(null),a=(0,u.useCallback)((e,t)=>{let[c,x]=e<=t?[e,t]:[t,e];return{from:i[c],to:i[x],fromIndex:c,toIndex:x}},[i]),R=(0,u.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return p==="vertical"?e.clientX-t.left-l:e.clientY-t.top-l},[p,l]),S=(0,u.useCallback)(e=>{if(!r||n.length===0||e.button!==0)return;let t=R(e),c=(0,b.nearestIndex)(n,t);c<0||(h.current={index:c,pixel:t},f.current=!1,y.current=!1,e.currentTarget.setPointerCapture?.(e.pointerId))},[r,n,R]),G=(0,u.useCallback)(e=>{let t=h.current;if(!r||!t)return;let c=R(e);!f.current&&Math.abs(c-t.pixel)<T||(f.current=!0,d(a(t.index,(0,b.nearestIndex)(n,c))))},[r,n,R,a]),V=(0,u.useCallback)(e=>{let t=h.current;if(h.current=null,!r||!t)return;if(e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),!f.current){d(null),o&&s(null);return}y.current=!0,f.current=!1;let c=a(t.index,(0,b.nearestIndex)(n,R(e)));d(null),m.current=c.fromIndex,s(c)},[r,o,n,R,a,s]),v=(0,u.useCallback)((e,t)=>{if(!r||n.length===0)return;if(e.key==="Escape"){m.current=null,d(null),o&&s(null);return}if(!e.shiftKey){m.current=null;return}let c=p==="vertical",x=c?"ArrowRight":"ArrowDown",k=c?"ArrowLeft":"ArrowUp";if(e.key!==x&&e.key!==k)return;let w=n.length-1,C=m.current??t??0,D=Math.min(w,Math.max(0,(t??C)+(e.key===x?1:-1)));m.current=C,s(a(C,D))},[r,o,n.length,p,a,s]),B=(0,u.useCallback)(()=>{let e=y.current;return y.current=!1,e},[]);return{dragging:g,onPointerDown:S,onPointerMove:G,onPointerUp:V,onKeyDown:v,consumedClick:B}}0&&(module.exports={ChartBrushLayer,useChartBrush});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCallback as d,useRef as E,useState as A}from"react";import{nearestIndex as C}from"./utils/scales.js";import{jsx as P,jsxs as K}from"react/jsx-runtime";var M=4,I=.14;function T({from:u,to:i,width:n,height:s,orientation:m="vertical",live:p=!1,label:a}){let g=Math.max(0,Math.min(u,i)),h=Math.min(m==="vertical"?n:s,Math.max(u,i)),c=h-g;if(c<=0)return null;let l=m==="vertical",y=l?{x:g,y:0,width:c,height:s}:{x:0,y:g,width:n,height:c},f=t=>l?{x1:t,y1:0,x2:t,y2:s}:{x1:0,y1:t,x2:n,y2:t};return K("g",{"aria-hidden":a?void 0:"true",role:a?"img":void 0,"aria-label":a,children:[P("rect",{...y,className:"fill-blue-500",opacity:I}),[g,h].map(t=>P("line",{...f(t),className:"stroke-blue-600 dark:stroke-blue-400",strokeWidth:1.5,strokeDasharray:p?"3 3":void 0},t))]})}function L({enabled:u,active:i,centers:n,xValues:s,offset:m,orientation:p,onCommit:a}){let[g,h]=A(null),c=E(null),l=E(!1),y=E(!1),f=E(null),t=d((e,r)=>{let[o,x]=e<=r?[e,r]:[r,e];return{from:s[o],to:s[x],fromIndex:o,toIndex:x}},[s]),R=d(e=>{let r=e.currentTarget.getBoundingClientRect();return p==="vertical"?e.clientX-r.left-m:e.clientY-r.top-m},[p,m]),S=d(e=>{if(!u||n.length===0||e.button!==0)return;let r=R(e),o=C(n,r);o<0||(c.current={index:o,pixel:r},l.current=!1,y.current=!1,e.currentTarget.setPointerCapture?.(e.pointerId))},[u,n,R]),G=d(e=>{let r=c.current;if(!u||!r)return;let o=R(e);!l.current&&Math.abs(o-r.pixel)<M||(l.current=!0,h(t(r.index,C(n,o))))},[u,n,R,t]),V=d(e=>{let r=c.current;if(c.current=null,!u||!r)return;if(e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),!l.current){h(null),i&&a(null);return}y.current=!0,l.current=!1;let o=t(r.index,C(n,R(e)));h(null),f.current=o.fromIndex,a(o)},[u,i,n,R,t,a]),v=d((e,r)=>{if(!u||n.length===0)return;if(e.key==="Escape"){f.current=null,h(null),i&&a(null);return}if(!e.shiftKey){f.current=null;return}let o=p==="vertical",x=o?"ArrowRight":"ArrowDown",k=o?"ArrowLeft":"ArrowUp";if(e.key!==x&&e.key!==k)return;let w=n.length-1,b=f.current??r??0,D=Math.min(w,Math.max(0,(r??b)+(e.key===x?1:-1)));f.current=b,a(t(b,D))},[u,i,n.length,p,t,a]),B=d(()=>{let e=y.current;return y.current=!1,e},[]);return{dragging:g,onPointerDown:S,onPointerMove:G,onPointerUp:V,onKeyDown:v,consumedClick:B}}export{T as ChartBrushLayer,L as useChartBrush};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var g=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var X=(r,t)=>{for(var a in t)g(r,a,{get:t[a],enumerable:!0})},Y=(r,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of K(t))!Q.call(r,o)&&o!==a&&g(r,o,{get:()=>t[o],enumerable:!(l=J(t,o))||l.enumerable});return r};var _=r=>Y(g({},"__esModule",{value:!0}),r);var ae={};X(ae,{ChartContainer:()=>re});module.exports=_(ae);var c=require("react"),d=require("../../lib/cn.cjs"),I=require("../../lib/i18n.cjs"),T=require("../circular-progress/CircularProgress.cjs"),z=require("./useChartSize.cjs"),e=require("react/jsx-runtime"),ee=(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"text-red-600 dark:text-red-400",children:[(0,e.jsx)("path",{d:"M10 3.5 2.5 16.5h15L10 3.5Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M10 8v3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),(0,e.jsx)("circle",{cx:"10",cy:"14",r:"0.9",fill:"currentColor"})]}),te={sm:"text-xs",md:"text-sm",lg:"text-base"};function re({title:r,description:t,height:a=240,width:l,size:o="md",legend:i,legendPosition:u="bottom",actions:x,loading:n=!1,empty:y=!1,emptyState:A,error:f=!1,errorState:P,onRetry:v,errorLabel:j,errorHintLabel:H,retryLabel:W,table:m,tableView:w=!1,showTableLabel:B,hideTableLabel:D,noDataLabel:M,loadingLabel:O,ariaLabel:N,children:h,className:$,...U}){let s=(0,I.useUILabels)(),[b,V]=(0,c.useState)(!1),p=(0,c.useId)(),C=`${p}-table`,k=`${p}-title`,L=`${p}-description`,{ref:Z,width:q,measured:F}=(0,z.useChartSize)({width:l}),R=!!m&&w==="toggle",S=!!m&&(w===!0||R&&b),E=(0,e.jsx)("div",{ref:Z,className:"relative w-full",style:{height:a},"aria-busy":n||void 0,children:n&&(y||f)?(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,e.jsx)(T.CircularProgress,{indeterminate:!0,size:"md","aria-label":O??s.chartLoading})}):f&&!n?(0,e.jsx)("div",{role:"alert",className:"flex h-full w-full flex-col items-center justify-center gap-2 px-4 text-center",children:P??(0,e.jsxs)(e.Fragment,{children:[ee,(0,e.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:j??s.chartError}),(0,e.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:H??s.chartErrorHint}),v?(0,e.jsx)("button",{type:"button",onClick:v,className:"mt-1 cursor-pointer rounded-md border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:W??s.chartRetry}):null]})}):y&&!n&&!f?(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:A??M??s.chartNoData}):(0,e.jsx)("div",{className:(0,d.cn)("h-full w-full transition-opacity duration-200",n&&"opacity-60"),children:typeof h=="function"?h({width:q,height:a,measured:F}):h})});return(0,e.jsxs)("figure",{className:(0,d.cn)("flex w-full flex-col gap-3",$),"aria-label":N,"aria-labelledby":!N&&r?k:void 0,"aria-describedby":t?L:void 0,...U,children:[r||t||x?(0,e.jsxs)("figcaption",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r?(0,e.jsx)("span",{id:k,className:(0,d.cn)("font-semibold text-gray-900 dark:text-gray-100",te[o]),children:r}):null,t?(0,e.jsx)("span",{id:L,className:"text-xs text-gray-500 dark:text-gray-400",children:t}):null]}),x]}):null,i&&u==="top"?i:null,i&&u==="right"?(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsx)("div",{className:"min-w-0 grow",children:E}),i]}):E,i&&u==="bottom"?i:null,R&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsx)("button",{type:"button",onClick:()=>V(G=>!G),"aria-expanded":b,"aria-controls":S?C:void 0,className:"cursor-pointer rounded-sm text-xs font-medium text-gray-600 underline underline-offset-2 hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:text-gray-400 dark:hover:text-white",children:b?D??s.chartHideTable:B??s.chartShowTable})}),S&&(0,e.jsx)("div",{id:C,children:m})]})}0&&(module.exports={ChartContainer});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useId as Z,useState as q}from"react";import{cn as m}from"../../lib/cn.js";import{useUILabels as F}from"../../lib/i18n.js";import{CircularProgress as G}from"../circular-progress/CircularProgress.js";import{useChartSize as J}from"./useChartSize.js";import{Fragment as X,jsx as e,jsxs as a}from"react/jsx-runtime";var K=a("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"text-red-600 dark:text-red-400",children:[e("path",{d:"M10 3.5 2.5 16.5h15L10 3.5Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),e("path",{d:"M10 8v3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e("circle",{cx:"10",cy:"14",r:"0.9",fill:"currentColor"})]}),Q={sm:"text-xs",md:"text-sm",lg:"text-base"};function ie({title:s,description:i,height:h=240,width:R,size:S="md",legend:r,legendPosition:n="bottom",actions:b,loading:o=!1,empty:p=!1,emptyState:E,error:l=!1,errorState:I,onRetry:g,errorLabel:T,errorHintLabel:z,retryLabel:A,table:d,tableView:x=!1,showTableLabel:P,hideTableLabel:j,noDataLabel:H,loadingLabel:W,ariaLabel:y,children:c,className:B,...D}){let t=F(),[u,M]=q(!1),f=Z(),v=`${f}-table`,w=`${f}-title`,N=`${f}-description`,{ref:O,width:$,measured:U}=J({width:R}),C=!!d&&x==="toggle",k=!!d&&(x===!0||C&&u),L=e("div",{ref:O,className:"relative w-full",style:{height:h},"aria-busy":o||void 0,children:o&&(p||l)?e("div",{className:"flex h-full w-full items-center justify-center",children:e(G,{indeterminate:!0,size:"md","aria-label":W??t.chartLoading})}):l&&!o?e("div",{role:"alert",className:"flex h-full w-full flex-col items-center justify-center gap-2 px-4 text-center",children:I??a(X,{children:[K,e("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:T??t.chartError}),e("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:z??t.chartErrorHint}),g?e("button",{type:"button",onClick:g,className:"mt-1 cursor-pointer rounded-md border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:A??t.chartRetry}):null]})}):p&&!o&&!l?e("div",{className:"flex h-full w-full items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:E??H??t.chartNoData}):e("div",{className:m("h-full w-full transition-opacity duration-200",o&&"opacity-60"),children:typeof c=="function"?c({width:$,height:h,measured:U}):c})});return a("figure",{className:m("flex w-full flex-col gap-3",B),"aria-label":y,"aria-labelledby":!y&&s?w:void 0,"aria-describedby":i?N:void 0,...D,children:[s||i||b?a("figcaption",{className:"flex items-start justify-between gap-3",children:[a("div",{className:"flex flex-col gap-0.5",children:[s?e("span",{id:w,className:m("font-semibold text-gray-900 dark:text-gray-100",Q[S]),children:s}):null,i?e("span",{id:N,className:"text-xs text-gray-500 dark:text-gray-400",children:i}):null]}),b]}):null,r&&n==="top"?r:null,r&&n==="right"?a("div",{className:"flex items-start gap-4",children:[e("div",{className:"min-w-0 grow",children:L}),r]}):L,r&&n==="bottom"?r:null,C&&e("div",{className:"flex",children:e("button",{type:"button",onClick:()=>M(V=>!V),"aria-expanded":u,"aria-controls":k?v:void 0,className:"cursor-pointer rounded-sm text-xs font-medium text-gray-600 underline underline-offset-2 hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:text-gray-400 dark:hover:text-white",children:u?j??t.chartHideTable:P??t.chartShowTable})}),k&&e("div",{id:v,children:d})]})}export{ie as ChartContainer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var c=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var L=(t,o)=>{for(var s in o)c(t,s,{get:o[s],enumerable:!0})},M=(t,o,s,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of O(o))!S.call(t,n)&&n!==s&&c(t,n,{get:()=>o[n],enumerable:!(i=N(o,n))||i.enumerable});return t};var P=t=>M(c({},"__esModule",{value:!0}),t);var J={};L(J,{ChartExportButton:()=>j});module.exports=P(J);var b=require("react"),f=require("../../lib/cn.cjs"),y=require("../../lib/i18n.cjs"),v=require("../dropdown/Dropdown.cjs"),w=require("../dropdown/DropdownContent.cjs"),E=require("../dropdown/DropdownItem.cjs"),k=require("../dropdown/DropdownTrigger.cjs"),D=require("./utils/export.cjs"),r=require("react/jsx-runtime"),T={sm:"h-7 px-2.5 text-xs",md:"h-8 px-3 text-sm",lg:"h-10 px-4 text-sm"},C=(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"shrink-0",children:(0,r.jsx)("path",{d:"M8 2v8m0 0 3-3m-3 3L5 7M2.5 12.5h11",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})});function j({data:t,series:o,xKey:s,xLabel:i,formatX:n,formats:a=["csv","json"],filename:d="chart",size:F="md",label:z,onExport:p,className:B,disabled:h}){let l=(0,y.useUILabels)(),m=(0,b.useCallback)(e=>{let x={data:t,series:o,xKey:s,xLabel:i,formatX:n};p?p(e,x):(0,D.downloadChartData)(e,x,d)},[t,o,s,i,n,p,d]),g=z??l.chartExport,I=e=>e==="csv"?l.chartExportCsv:l.chartExportJson,u=(0,f.cn)("inline-flex cursor-pointer items-center gap-2 rounded-full border border-gray-300 bg-white font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",T[F],B);if(a.length<=1){let e=a[0]??"csv";return(0,r.jsxs)("button",{type:"button",onClick:()=>m(e),disabled:h||t.length===0,className:u,children:[C,(0,r.jsx)("span",{children:g})]})}return(0,r.jsxs)(v.Dropdown,{children:[(0,r.jsxs)(k.DropdownTrigger,{disabled:h||t.length===0,className:u,children:[C,(0,r.jsx)("span",{children:g})]}),(0,r.jsx)(w.DropdownContent,{children:a.map(e=>(0,r.jsx)(E.DropdownItem,{onSelect:()=>m(e),children:I(e)},e))})]})}0&&(module.exports={ChartExportButton});
|