@synertech/ui 0.44.0 → 0.45.1
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 +76 -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/chart/utils/timestamp.cjs +1 -0
- package/dist/components/chart/utils/timestamp.js +1 -0
- package/dist/components/chart/utils/touch.cjs +1 -0
- package/dist/components/chart/utils/touch.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 -32
- package/dist/index.d.cts +35 -9
- package/dist/index.d.ts +35 -9
- package/dist/index.js +1 -32
- 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 +152 -0
- package/package.json +13 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as Te,useCallback as se,useMemo as J,useState as we}from"react";import{useUILabels as be}from"../../lib/i18n.js";import{ChartAxis as xe}from"../chart/ChartAxis.js";import{ChartContainer as Re}from"../chart/ChartContainer.js";import{ChartGrid as Se}from"../chart/ChartGrid.js";import{ChartTooltip as Le}from"../chart/ChartTooltip.js";import{getSeriesColor as Me}from"../chart/palette.js";import{buildCartesianGeometry as Ae}from"../chart/utils/cartesian.js";import{readNumber as G,readXValue as He}from"../chart/utils/data.js";import{formatAuto as $e,formatXValue as Ee}from"../chart/utils/format.js";import{buildBarPath as We}from"../chart/utils/path.js";import{boxStats as Xe}from"../chart/utils/quantile.js";import{nearestIndex as Ve}from"../chart/utils/scales.js";import{CHART_TOUCH as Ie}from"../chart/utils/touch.js";import{Table as De}from"../table/Table.js";import{TableBody as ze}from"../table/TableBody.js";import{TableCell as Z}from"../table/TableCell.js";import{TableHeader as Ge}from"../table/TableHeader.js";import{TableHeaderCell as B}from"../table/TableHeaderCell.js";import{TableRow as qe}from"../table/TableRow.js";import{Fragment as Qe,jsx as a,jsxs as y}from"react/jsx-runtime";var Ke=40,Oe=3,F=4,ce="text-right [font-variant-numeric:tabular-nums]",Ue=Te(function({boxes:h,color:f}){return a("g",{children:h.map(t=>y("g",{children:[a("g",{stroke:f,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:f}):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:f,className:"fill-white dark:fill-gray-800"}):null,t.outliers.map(l=>a("circle",{cx:l.cx,cy:l.cy,r:Oe,fill:f,strokeWidth:1.5,className:"stroke-white dark:stroke-gray-800"},l.key))]},t.key))})});function _e({width:C,height:h,data:f,boxes:t,x:l,y:k,grid:L,size:q,orientation:T,boxSize:K,showOutliers:O,showMean:W,color:U,referenceLines:ee,margin:X,tooltip:w,plotLabel:te,formatValue:M,formatX:A,onBoxClick:V}){let[I,H]=we(null),u=I!==null&&I<t.length?I:null,_=be(),e=J(()=>{let r=T==="vertical",o=t.flatMap(s=>s.stats===null?[]:[s.stats.min,s.stats.max,...W&&s.mean!==null?[s.mean]:[]]),g=Ae({width:C,height:h,data:f,x:l,y:k,bounds:o.length===0?null:[Math.min(...o),Math.max(...o)],margin:X,orientation:T,placement:"band",formatValue:M,formatX:A,defaultIncludeZero:!1}),{valueScale:d,bandwidth:p,categoryPositions:x,innerWidth:D,innerHeight:ne}=g,n=Math.min(K??Ke,p),v=n*.5,P=(s,b)=>r?{x:s,y:b}:{x:b,y:s},R=t.map((s,b)=>{let i=x[b]+(p-n)/2,c=i+n/2;if(s.stats===null)return{key:`${b}`,body:"",median:null,whiskers:[],outliers:[],mean:null,top:x[b],height:p};let{q1:N,q3:z,median:Q,lower:Ce,upper:ke,outliers:ve}=s.stats,me=d(N),ue=d(z),de=Math.min(me,ue),he=Math.abs(ue-me),Pe=We({...r?{x:i,y:de,width:n,height:Math.max(1,he)}:{x:de,y:i,width:Math.max(1,he),height:n},radius:2,round:"none"}),Y=d(Q),Ne=r?{x1:i,y1:Y,x2:i+n,y2:Y}:{x1:Y,y1:i,x2:Y,y2:i+n},le=[];for(let[S,oe,j]of[["lower",Ce,N],["upper",ke,z]]){let ie=d(oe),Be=d(j),ge=P(c,ie),ye=P(c,Be);le.push({key:`${S}-stem`,x1:ye.x,y1:ye.y,x2:ge.x,y2:ge.y});let fe=P(c-v/2,ie),pe=P(c+v/2,ie);le.push({key:`${S}-cap`,x1:fe.x,y1:fe.y,x2:pe.x,y2:pe.y})}return{key:`${b}`,body:Pe,median:Ne,whiskers:le,outliers:O?ve.map((S,oe)=>{let j=P(c,d(S));return{key:`${oe}`,cx:j.x,cy:j.y}}):[],mean:W&&s.mean!==null?(()=>{let S=P(c,d(s.mean));return{cx:S.x,cy:S.y}})():null,top:x[b],height:p}});return{vertical:r,rendered:R,categoryPositions:x,categoryCenters:g.categoryCenters,bandwidth:p,categoryTicks:g.categoryTicks,valueTicks:g.valueTicks,valueScale:d,innerWidth:D,innerHeight:ne,margin:g.margin}},[t,f,l,k,C,h,X,T,K,O,W,M,A]),ae=se(r=>{if(w===!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(Ve(e.categoryCenters,g))},[w,t.length,e.vertical,e.margin,e.categoryCenters]),re=se(r=>{if(t.length===0)return;let o=t.length-1,g=u??0,d=e.vertical?"ArrowRight":"ArrowDown",p=e.vertical?"ArrowLeft":"ArrowUp",x=r.key===d?Math.min(o,g+1):r.key===p?Math.max(0,g-1):r.key==="Home"?0:r.key==="End"?o:r.key==="Escape"?null:void 0;x!==void 0&&(r.preventDefault(),H(x))},[t.length,u,e.vertical]),$=se(()=>{!V||u===null||V(t[u])},[V,u,t]),m=u===null?null:t[u],E=u===null||m===null||m.stats===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[u],y:e.margin.top+e.valueScale(m.stats.q3)}:{x:e.margin.left+e.valueScale(m.stats.q3),y:e.margin.top+e.categoryCenters[u]};return y(Qe,{children:[y("svg",{width:C,height:h,role:"img","aria-label":te??t.map(r=>r.label).join(", "),tabIndex:0,className:`${Ie} 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:$,children:[y("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[a(Se,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(L==="y"||L==="both")?e.valueTicks.map(r=>r.offset):void 0,vertical:!e.vertical&&(L==="y"||L==="both")?e.valueTicks.map(r=>r.offset):void 0}),u!==null?a("rect",{x:e.vertical?e.categoryPositions[u]:0,y:e.vertical?0:e.categoryPositions[u],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 y("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(Ue,{boxes:e.rendered,color:U})]}),a("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?l.hidden:k?.hidden)?null:a(xe,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?l.label:k?.label,size:q})}),a("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?k?.hidden:l.hidden)?null:a(xe,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?k?.label:l.label,size:q})})]}),m&&m.stats&&E&&w!==!1?a(Le,{x:E.x,y:E.y,containerWidth:C,children:typeof w=="function"?w(m):y("div",{className:"flex flex-col gap-1",children:[a("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:m.label}),y("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[["Max",m.stats.max],["Q3",m.stats.q3],[_.chartMedian,m.stats.median],["Q1",m.stats.q1],["Min",m.stats.min]].map(([r,o])=>y("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)),y("div",{className:"contents",children:[a("dt",{className:"text-gray-500 dark:text-gray-400",children:_.chartCount}),a("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:m.stats.count})]})]})]})}):null]})}function yt({data:C,x:h,y:f,values:t,quantiles:l,whisker:k=1.5,orientation:L="vertical",boxSize:q,showOutliers:T=!0,showMean:K=!1,color:O,referenceLines:W,height:U=280,width:ee,size:X="md",grid:w="y",tooltip:te=!0,tableView:M=!1,title:A,description:V,loading:I=!1,emptyState:H,error:u=!1,errorState:_,onRetry:e,actions:ae,margin:re,locale:$,plotLabel:m,format:E,onBoxClick:r,className:o,...g}){let d=be(),p=J(()=>f?.format??E??(n=>$e(n,$)),[f?.format,E,$]),x=J(()=>h.format??(n=>Ee(n,$)),[h.format,$]),D=J(()=>C.map((n,v)=>{let P=He(n,h.key,v),R=t?(()=>{let i=n[t];return Array.isArray(i)?i.map(c=>typeof c=="number"?c:Number(c)).filter(c=>Number.isFinite(c)):null})():null,s=null,b=null;if(R!==null)s=Xe(R,k),b=R.length===0?null:R.reduce((i,c)=>i+c,0)/R.length;else if(l){let i=G(n,l.q1),c=G(n,l.median),N=G(n,l.q3);if(i!==null&&c!==null&&N!==null){let z=l.min?G(n,l.min)??i:i,Q=l.max?G(n,l.max)??N:N;s={count:0,min:z,max:Q,q1:i,median:c,q3:N,iqr:N-i,lower:z,upper:Q,outliers:[]}}}return{index:v,x:P,label:x(P,v),stats:s,mean:b,datum:n}}),[C,h.key,t,l,k,x]),ne=D.filter(n=>n.stats!==null);return a(Re,{title:A,description:V,height:U,width:ee,size:X,loading:I,empty:ne.length===0,emptyState:H,error:u,errorState:_,onRetry:e,actions:ae,tableView:M,table:M?a("div",{className:"w-full overflow-x-auto",children:y(De,{children:[typeof A=="string"?a("caption",{className:"sr-only",children:A}):null,y(Ge,{children:[a(B,{children:h.label??h.key}),t?a(B,{className:"text-right",children:d.chartCount}):null,a(B,{className:"text-right",children:"Min"}),a(B,{className:"text-right",children:"Q1"}),a(B,{className:"text-right",children:d.chartMedian}),a(B,{className:"text-right",children:"Q3"}),a(B,{className:"text-right",children:"Max"}),t&&T?a(B,{className:"text-right",children:d.chartOutliers}):null]}),a(ze,{children:D.map(n=>y(qe,{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(v=>a(Z,{className:ce,children:n.stats===null?"\u2014":p(n.stats[v])},v)),t&&T?a(Z,{className:ce,children:n.stats===null||n.stats.outliers.length===0?"\u2014":n.stats.outliers.map(p).join(", ")}):null]},n.index))})]})}):void 0,className:o,...g,children:({width:n})=>a(_e,{width:n,height:U,data:C,boxes:D,x:h,y:f,grid:w,size:X,orientation:L,boxSize:q,showOutliers:T,showMean:K,color:O??Me(0),referenceLines:W,margin:re,tooltip:te,plotLabel:m,formatValue:p,formatX:x,onBoxClick:r})})}export{yt 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 te=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var ke=(i,l)=>{for(var t in l)te(i,t,{get:l[t],enumerable:!0})},Ce=(i,l,t,e)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of pe(l))!ye.call(i,s)&&s!==t&&te(i,s,{get:()=>l[s],enumerable:!(e=be(l,s))||e.enumerable});return i};var xe=i=>Ce(te({},"__esModule",{value:!0}),i);var Ee={};ke(Ee,{BulletChart:()=>Be});module.exports=xe(Ee);var c=require("react"),ue=require("../../lib/i18n.cjs"),ne=require("../chart/ChartAxis.cjs"),me=require("../chart/ChartContainer.cjs"),ce=require("../chart/ChartTableView.cjs"),ge=require("../chart/ChartTooltip.cjs"),de=require("../chart/palette.cjs"),G=require("../chart/utils/data.cjs"),X=require("../chart/utils/format.cjs"),ae=require("../chart/utils/path.cjs"),L=require("../chart/utils/scales.cjs"),re=require("../chart/utils/text.cjs"),I=require("../chart/utils/ticks.cjs"),he=require("../chart/utils/touch.cjs"),n=require("react/jsx-runtime"),Re=22,ve=.42,ie=3,se=8,Te=12,Ne=["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"],Se=(0,c.memo)(function({rows:l,color:t}){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:t}):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 Ve({width:i,height:l,rows:t,x:e,size:s,sharedDomain:d,showValues:T,trackSize:K,rangeColors:z,color:W,tooltip:N,plotLabel:q,formatValue:U,locale:w,onRowClick:H}){let[M,R]=(0,c.useState)(null),u=M!==null&&M<t.length?M:null,r=(0,c.useMemo)(()=>{let m=t.map(a=>a.label),h=T?t.map(a=>a.formattedValue):[],f={top:6,right:T?(0,re.widestLabel)(h)+se*2:8,bottom:d?26+(e.label?16:0):6,left:e.hidden?8:e.height??(0,re.widestLabel)(m)+Te},p=Math.max(0,i-f.left-f.right),_=Math.max(0,l-f.top-f.bottom),b=(0,L.createBandScale)(t.map((a,g)=>g),[0,_],{paddingInner:.34}),S=Math.min(K??Re,b.bandwidth),D=Math.max(3,S*ve),O=z??Ne,V=z!==void 0,B=t.map((a,g)=>{let F=Math.max(0,a.value??0,a.target??0,...a.ranges.length>0?a.ranges:[0]),A=d??(a.ranges.length>0?[0,F]:(0,I.niceDomain)(0,F,4)),o=(0,L.createLinearScale)(A,[0,p]),y=b(g)+(b.bandwidth-S)/2,x=y+S/2,P=a.ranges.length>0?[...a.ranges].sort((C,j)=>C-j):[A[1]],k=A[0],Y=P.map((C,j)=>{let le=o(k),fe=o(Math.max(k,C));k=C;let oe=O[Math.min(j,O.length-1)];return{key:`${g}-${j}`,d:(0,ae.buildBarPath)({x:le,y,width:Math.max(0,fe-le),height:S,radius:0}),className:V?void 0:oe,fill:V?oe:void 0}}),ee=a.value===null?null:(0,ae.buildBarPath)({x:o(A[0]),y:x-D/2,width:Math.max(0,o(a.value)-o(A[0])),height:D,radius:2,round:"right"});return{key:`${g}`,bands:Y,measure:ee,target:a.target===null?null:{x:o(a.target),y1:y-ie,y2:y+S+ie},label:T?{x:p+se,y:x,text:a.formattedValue}:null,top:b(g),height:b.bandwidth}}),$=e.hidden?[]:t.map((a,g)=>({value:a.x,offset:b.center(g),label:a.label})),E=d?(0,I.niceTicks)(d[0],d[1],5).map(a=>({value:a,offset:(0,L.createLinearScale)(d,[0,p])(a),label:U(a)})):[];return{margin:f,innerWidth:p,innerHeight:_,band:b,rendered:B,categoryTicks:$,valueTicks:E,centers:t.map((a,g)=>b.center(g))}},[t,e,i,l,d,T,K,z,U]),J=(0,c.useCallback)(m=>{if(N===!1||t.length===0)return;let h=m.currentTarget.getBoundingClientRect(),f=m.clientY-h.top-r.margin.top;R((0,L.nearestIndex)(r.centers,f))},[N,t.length,r.margin.top,r.centers]),Q=(0,c.useCallback)(m=>{if(t.length===0)return;let h=t.length-1,f=u??0,p=m.key==="ArrowDown"?Math.min(h,f+1):m.key==="ArrowUp"?Math.max(0,f-1):m.key==="Home"?0:m.key==="End"?h:m.key==="Escape"?null:void 0;p!==void 0&&(m.preventDefault(),R(p))},[t.length,u]),Z=(0,c.useCallback)(()=>{!H||u===null||H(t[u])},[H,u,t]),v=u===null?null:t[u];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{width:i,height:l,role:"img","aria-label":q??t.map(m=>m.label).join(", "),tabIndex:0,className:`${he.CHART_TOUCH} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:J,onPointerLeave:()=>R(null),onKeyDown:Q,onBlur:()=>R(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)(Se,{rows:r.rendered,color:W})]}),(0,n.jsx)("g",{transform:`translate(${r.margin.left}, ${r.margin.top})`,children:e.hidden?null:(0,n.jsx)(ne.ChartAxis,{orientation:"left",ticks:r.categoryTicks,length:r.innerHeight,showLine:!1,tickSize:0,size:s})}),d?(0,n.jsx)("g",{transform:`translate(${r.margin.left}, ${r.margin.top+r.innerHeight})`,children:(0,n.jsx)(ne.ChartAxis,{orientation:"bottom",ticks:r.valueTicks,length:r.innerWidth,label:e.label,size:s})}):null]}),v&&u!==null&&N!==!1?(0,n.jsx)(ge.ChartTooltip,{x:r.margin.left+r.innerWidth/2,y:r.margin.top+r.centers[u],containerWidth:i,children:typeof N=="function"?N(v):(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:v.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:W},"aria-hidden":"true"}),(0,n.jsx)("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:v.formattedValue}),v.attainment!==null?(0,n.jsx)("span",{className:"text-gray-500 [font-variant-numeric:tabular-nums] dark:text-gray-400",children:(0,X.formatPercent)(v.attainment,{locale:w})}):null]})]})}):null]})}function Be({data:i,x:l,value:t,target:e,ranges:s,domain:d,normalize:T="row",showValues:K=!0,trackSize:z,rangeColors:W,color:N,height:q,width:U,size:w="md",tooltip:H=!0,tableView:M=!1,title:R,description:u,loading:r=!1,emptyState:J,error:Q=!1,errorState:Z,onRetry:v,actions:m,locale:h,plotLabel:f,valueLabel:p,targetLabel:_,format:b,onRowClick:S,className:D,...O}){let V=(0,ue.useUILabels)(),B=(0,c.useMemo)(()=>b??(o=>(0,X.formatAuto)(o,h)),[b,h]),$=(0,c.useMemo)(()=>l.format??(o=>(0,X.formatXValue)(o,h)),[l.format,h]),E=(0,c.useMemo)(()=>i.map((o,y)=>{let x=(0,G.readXValue)(o,l.key,y),P=(0,G.readNumber)(o,t),k=e?(0,G.readNumber)(o,e):null,Y=s?o[s]:void 0,ee=Array.isArray(Y)?Y.map(C=>typeof C=="number"?C:Number(C)).filter(C=>Number.isFinite(C)):[];return{index:y,x,label:$(x,y),value:P,target:k,ranges:ee,formattedValue:P===null?"\u2014":B(P),formattedTarget:k===null?"\u2014":B(k),attainment:P===null||k===null||k===0?null:P/k,datum:o}}),[i,l.key,t,e,s,B,$]),a=(0,c.useMemo)(()=>{if(d)return d;if(T!=="shared")return null;let o=E.reduce((y,x)=>Math.max(y,x.value??0,x.target??0,...x.ranges),0);return(0,I.niceDomain)(0,o,5)},[d,T,E]),g=q??Math.max(72,E.length*34+(a?30:12)),F=(0,c.useMemo)(()=>[{key:t,label:p??V.chartValue},...e?[{key:e,label:_??V.chartTarget}]:[]],[t,e,p,_,V.chartValue,V.chartTarget]),A=N??(0,de.getSeriesColor)(0);return(0,n.jsx)(me.ChartContainer,{title:R,description:u,height:g,width:U,size:w,loading:r,empty:E.length===0,emptyState:J,error:Q,errorState:Z,onRetry:v,actions:m,tableView:M,table:M?(0,n.jsx)(ce.ChartTableView,{data:i,series:F,xKey:l.key,xLabel:l.label??l.key,formatX:$,formatValue:B,caption:typeof R=="string"?R:void 0}):void 0,className:D,...O,children:({width:o})=>(0,n.jsx)(Ve,{width:o,height:g,rows:E,x:l,size:w,sharedDomain:a,showValues:K,trackSize:z,rangeColors:W,color:A,tooltip:H,plotLabel:f,formatValue:B,locale:h,onRowClick:S})})}0&&(module.exports={BulletChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as me,useCallback as Q,useMemo as L,useState as ce}from"react";import{useUILabels as ge}from"../../lib/i18n.js";import{ChartAxis as te}from"../chart/ChartAxis.js";import{ChartContainer as de}from"../chart/ChartContainer.js";import{ChartTableView as he}from"../chart/ChartTableView.js";import{ChartTooltip as fe}from"../chart/ChartTooltip.js";import{getSeriesColor as be}from"../chart/palette.js";import{readNumber as ne,readXValue as pe}from"../chart/utils/data.js";import{formatAuto as ye,formatPercent as ke,formatXValue as Ce}from"../chart/utils/format.js";import{buildBarPath as ae}from"../chart/utils/path.js";import{createBandScale as xe,createLinearScale as re,nearestIndex as Re}from"../chart/utils/scales.js";import{widestLabel as le}from"../chart/utils/text.js";import{niceDomain as se,niceTicks as ve}from"../chart/utils/ticks.js";import{CHART_TOUCH as Te}from"../chart/utils/touch.js";import{Fragment as Pe,jsx as l,jsxs as M}from"react/jsx-runtime";var Ne=22,Se=.42,oe=3,ie=8,Ve=12,Be=["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"],Ee=me(function({rows:s,color:a}){return l("g",{children:s.map(e=>M("g",{children:[e.bands.map(d=>l("path",{d:d.d,className:d.className,fill:d.fill},d.key)),e.measure?l("path",{d:e.measure,fill:a}):null,e.target?l("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?l("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 Ae({width:k,height:s,rows:a,x:e,size:d,sharedDomain:m,showValues:v,trackSize:$,rangeColors:X,color:G,tooltip:T,plotLabel:F,formatValue:I,locale:K,onRowClick:z}){let[P,x]=ce(null),o=P!==null&&P<a.length?P:null,n=L(()=>{let i=a.map(t=>t.label),c=v?a.map(t=>t.formattedValue):[],g={top:6,right:v?le(c)+ie*2:8,bottom:m?26+(e.label?16:0):6,left:e.hidden?8:e.height??le(i)+Ve},f=Math.max(0,k-g.left-g.right),H=Math.max(0,s-g.top-g.bottom),h=xe(a.map((t,u)=>u),[0,H],{paddingInner:.34}),N=Math.min($??Ne,h.bandwidth),W=Math.max(3,N*Se),U=X??Be,S=X!==void 0,V=a.map((t,u)=>{let w=Math.max(0,t.value??0,t.target??0,...t.ranges.length>0?t.ranges:[0]),E=m??(t.ranges.length>0?[0,w]:se(0,w,4)),r=re(E,[0,f]),b=h(u)+(h.bandwidth-N)/2,C=b+N/2,A=t.ranges.length>0?[...t.ranges].sort((y,O)=>y-O):[E[1]],p=E[0],D=A.map((y,O)=>{let Z=r(p),ue=r(Math.max(p,y));p=y;let ee=U[Math.min(O,U.length-1)];return{key:`${u}-${O}`,d:ae({x:Z,y:b,width:Math.max(0,ue-Z),height:N,radius:0}),className:S?void 0:ee,fill:S?ee:void 0}}),J=t.value===null?null:ae({x:r(E[0]),y:C-W/2,width:Math.max(0,r(t.value)-r(E[0])),height:W,radius:2,round:"right"});return{key:`${u}`,bands:D,measure:J,target:t.target===null?null:{x:r(t.target),y1:b-oe,y2:b+N+oe},label:v?{x:f+ie,y:C,text:t.formattedValue}:null,top:h(u),height:h.bandwidth}}),_=e.hidden?[]:a.map((t,u)=>({value:t.x,offset:h.center(u),label:t.label})),B=m?ve(m[0],m[1],5).map(t=>({value:t,offset:re(m,[0,f])(t),label:I(t)})):[];return{margin:g,innerWidth:f,innerHeight:H,band:h,rendered:V,categoryTicks:_,valueTicks:B,centers:a.map((t,u)=>h.center(u))}},[a,e,k,s,m,v,$,X,I]),Y=Q(i=>{if(T===!1||a.length===0)return;let c=i.currentTarget.getBoundingClientRect(),g=i.clientY-c.top-n.margin.top;x(Re(n.centers,g))},[T,a.length,n.margin.top,n.centers]),j=Q(i=>{if(a.length===0)return;let c=a.length-1,g=o??0,f=i.key==="ArrowDown"?Math.min(c,g+1):i.key==="ArrowUp"?Math.max(0,g-1):i.key==="Home"?0:i.key==="End"?c:i.key==="Escape"?null:void 0;f!==void 0&&(i.preventDefault(),x(f))},[a.length,o]),q=Q(()=>{!z||o===null||z(a[o])},[z,o,a]),R=o===null?null:a[o];return M(Pe,{children:[M("svg",{width:k,height:s,role:"img","aria-label":F??a.map(i=>i.label).join(", "),tabIndex:0,className:`${Te} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:Y,onPointerLeave:()=>x(null),onKeyDown:j,onBlur:()=>x(null),onClick:q,children:[M("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[o!==null&&n.rendered[o]?l("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,l(Ee,{rows:n.rendered,color:G})]}),l("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:e.hidden?null:l(te,{orientation:"left",ticks:n.categoryTicks,length:n.innerHeight,showLine:!1,tickSize:0,size:d})}),m?l("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:l(te,{orientation:"bottom",ticks:n.valueTicks,length:n.innerWidth,label:e.label,size:d})}):null]}),R&&o!==null&&T!==!1?l(fe,{x:n.margin.left+n.innerWidth/2,y:n.margin.top+n.centers[o],containerWidth:k,children:typeof T=="function"?T(R):M("div",{className:"flex flex-col gap-1",children:[l("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:R.label}),M("div",{className:"flex items-center gap-2",children:[l("span",{className:"h-0.5 w-3 shrink-0 rounded-full",style:{backgroundColor:G},"aria-hidden":"true"}),l("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:R.formattedValue}),R.attainment!==null?l("span",{className:"text-gray-500 [font-variant-numeric:tabular-nums] dark:text-gray-400",children:ke(R.attainment,{locale:K})}):null]})]})}):null]})}function Oe({data:k,x:s,value:a,target:e,ranges:d,domain:m,normalize:v="row",showValues:$=!0,trackSize:X,rangeColors:G,color:T,height:F,width:I,size:K="md",tooltip:z=!0,tableView:P=!1,title:x,description:o,loading:n=!1,emptyState:Y,error:j=!1,errorState:q,onRetry:R,actions:i,locale:c,plotLabel:g,valueLabel:f,targetLabel:H,format:h,onRowClick:N,className:W,...U}){let S=ge(),V=L(()=>h??(r=>ye(r,c)),[h,c]),_=L(()=>s.format??(r=>Ce(r,c)),[s.format,c]),B=L(()=>k.map((r,b)=>{let C=pe(r,s.key,b),A=ne(r,a),p=e?ne(r,e):null,D=d?r[d]:void 0,J=Array.isArray(D)?D.map(y=>typeof y=="number"?y:Number(y)).filter(y=>Number.isFinite(y)):[];return{index:b,x:C,label:_(C,b),value:A,target:p,ranges:J,formattedValue:A===null?"\u2014":V(A),formattedTarget:p===null?"\u2014":V(p),attainment:A===null||p===null||p===0?null:A/p,datum:r}}),[k,s.key,a,e,d,V,_]),t=L(()=>{if(m)return m;if(v!=="shared")return null;let r=B.reduce((b,C)=>Math.max(b,C.value??0,C.target??0,...C.ranges),0);return se(0,r,5)},[m,v,B]),u=F??Math.max(72,B.length*34+(t?30:12)),w=L(()=>[{key:a,label:f??S.chartValue},...e?[{key:e,label:H??S.chartTarget}]:[]],[a,e,f,H,S.chartValue,S.chartTarget]),E=T??be(0);return l(de,{title:x,description:o,height:u,width:I,size:K,loading:n,empty:B.length===0,emptyState:Y,error:j,errorState:q,onRetry:R,actions:i,tableView:P,table:P?l(he,{data:k,series:w,xKey:s.key,xLabel:s.label??s.key,formatX:_,formatValue:V,caption:typeof x=="string"?x:void 0}):void 0,className:W,...U,children:({width:r})=>l(Ae,{width:r,height:u,rows:B,x:s,size:K,sharedDomain:t,showValues:$,trackSize:X,rangeColors:G,color:E,tooltip:z,plotLabel:g,formatValue:V,locale:c,onRowClick:N})})}export{Oe 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 ee=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var ye=(l,a)=>{for(var r in a)ee(l,r,{get:a[r],enumerable:!0})},Ce=(l,a,r,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of be(a))!pe.call(l,c)&&c!==r&&ee(l,c,{get:()=>a[c],enumerable:!(o=fe(a,c))||o.enumerable});return l};var ke=l=>Ce(ee({},"__esModule",{value:!0}),l);var Pe={};ye(Pe,{CandlestickChart:()=>Re});module.exports=ke(Pe);var h=require("react"),ne=require("../../lib/i18n.cjs"),te=require("../chart/ChartAxis.cjs"),oe=require("../chart/ChartContainer.cjs"),le=require("../chart/ChartGrid.cjs"),ie=require("../chart/ChartLegend.cjs"),se=require("../chart/ChartTableView.cjs"),ue=require("../chart/ChartTooltip.cjs"),B=require("../chart/palette.cjs"),he=require("../chart/utils/cartesian.cjs"),L=require("../chart/utils/data.cjs"),Y=require("../chart/utils/format.cjs"),ce=require("../chart/utils/path.cjs"),ge=require("../chart/utils/scales.cjs"),me=require("../chart/utils/touch.cjs"),t=require("react/jsx-runtime"),xe=16,we=1.5,ve=(0,h.memo)(function({candles:a}){return(0,t.jsx)("g",{children:a.map(r=>(0,t.jsxs)("g",{children:[r.wick?(0,t.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,t.jsx)("path",{d:r.body,fill:r.hollow?"none":r.color,stroke:r.color,strokeWidth:r.hollow?1.5:0}):null]},r.key))})});function Le({width:l,height:a,data:r,candles:o,x:c,y,grid:R,size:I,candleSize:E,fillRising:P,palette:M,referenceLines:W,margin:D,tooltip:b,plotLabel:F,formatValue:p,formatX:O,onCandleClick:N}){let[x,S]=(0,h.useState)(null),g=x!==null&&x<o.length?x:null,C=(0,ne.useUILabels)(),n=(0,h.useMemo)(()=>{let e=o.flatMap(i=>i.high===null||i.low===null?[]:[i.low,i.high]),u=(0,he.buildCartesianGeometry)({width:l,height:a,data:r,x:c,y,bounds:e.length===0?null:[Math.min(...e),Math.max(...e)],margin:D,orientation:"vertical",placement:"band",formatValue:p,formatX:O,defaultIncludeZero:!1}),{valueScale:m,bandwidth:k,categoryPositions:z,innerWidth:q,innerHeight:G}=u,w=Math.min(E??xe,Math.max(1,k-2));return{rendered:o.map((i,_)=>{let T=z[_]+(k-w)/2,f=T+w/2,$=i.rising?M.up:M.down,H=i.high===null||i.low===null?null:{x:f,y1:m(i.high),y2:m(i.low)},A=null;if(i.open!==null&&i.close!==null){let v=m(i.open),K=m(i.close);A=(0,ce.buildBarPath)({x:T,y:Math.min(v,K),width:w,height:Math.max(we,Math.abs(K-v)),radius:0,round:"none"})}return{key:`${_}`,color:$,body:A,hollow:i.rising&&!P,wick:H,left:T,width:w}}),categoryPositions:z,categoryCenters:u.categoryCenters,bandwidth:k,categoryTicks:u.categoryTicks,valueTicks:u.valueTicks,valueScale:m,innerWidth:q,innerHeight:G,margin:u.margin}},[o,r,c,y,l,a,D,E,P,M,p,O]),U=(0,h.useCallback)(e=>{if(b===!1||o.length===0)return;let u=e.currentTarget.getBoundingClientRect(),m=e.clientX-u.left-n.margin.left;S((0,ge.nearestIndex)(n.categoryCenters,m))},[b,o.length,n.margin.left,n.categoryCenters]),j=(0,h.useCallback)(e=>{if(o.length===0)return;let u=o.length-1,m=g??0,k=e.key==="ArrowRight"?Math.min(u,m+1):e.key==="ArrowLeft"?Math.max(0,m-1):e.key==="Home"?0:e.key==="End"?u:e.key==="Escape"?null:void 0;k!==void 0&&(e.preventDefault(),S(k))},[o.length,g]),Z=(0,h.useCallback)(()=>{!N||g===null||N(o[g])},[N,g,o]),s=g===null?null:o[g];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:l,height:a,role:"img","aria-label":F??o.map(e=>e.label).join(", "),tabIndex:0,className:`${me.CHART_TOUCH} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:U,onPointerLeave:()=>S(null),onKeyDown:j,onBlur:()=>S(null),onClick:Z,children:[(0,t.jsxs)("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[(0,t.jsx)(le.ChartGrid,{width:n.innerWidth,height:n.innerHeight,horizontal:R==="y"||R==="both"?n.valueTicks.map(e=>e.offset):void 0}),g!==null?(0,t.jsx)("rect",{x:n.categoryPositions[g],y:0,width:n.bandwidth,height:n.innerHeight,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,W?.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:0,y1:n.valueScale(e.value),x2:n.innerWidth,y2:n.valueScale(e.value),stroke:e.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:e.dashed===!1?void 0:"4 4"}),e.label?(0,t.jsx)("text",{x:n.innerWidth,y:n.valueScale(e.value)-4,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:e.label}):null]},`${e.value}-${e.label??""}`)),(0,t.jsx)(ve,{candles:n.rendered})]}),(0,t.jsx)("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:c.hidden?null:(0,t.jsx)(te.ChartAxis,{orientation:"bottom",ticks:n.categoryTicks,length:n.innerWidth,label:c.label,size:I})}),(0,t.jsx)("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:y?.hidden?null:(0,t.jsx)(te.ChartAxis,{orientation:"left",ticks:n.valueTicks,length:n.innerHeight,showLine:!1,label:y?.label,size:I})})]}),s&&g!==null&&b!==!1?(0,t.jsx)(ue.ChartTooltip,{x:n.margin.left+n.categoryCenters[g],y:n.margin.top+(s.high===null?n.innerHeight/2:n.valueScale(s.high)),containerWidth:l,children:typeof b=="function"?b(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.jsx)("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(([e,u])=>(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:e}),(0,t.jsx)("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:u===null?"\u2014":p(u)})]},e))}),s.change===null?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 border-t border-gray-200 pt-1 dark:border-gray-700",children:[(0,t.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:s.rising?C.chartRise:C.chartFall}),(0,t.jsxs)("span",{className:"[font-variant-numeric:tabular-nums] font-semibold text-gray-900 dark:text-gray-100",children:[s.change>0?"+":"",p(s.change)]})]})]})}):null]})}function Re({data:l,x:a,y:r,open:o,high:c,low:y,close:R,candleSize:I,fillRising:E=!1,colors:P,referenceLines:M,height:W=300,width:D,size:b="md",grid:F="y",legend:p,tooltip:O=!0,tableView:N=!1,title:x,description:S,loading:g=!1,emptyState:C,error:n=!1,errorState:U,onRetry:j,actions:Z,margin:s,locale:e,plotLabel:u,openLabel:m,highLabel:k,lowLabel:z,closeLabel:q,riseLabel:G,fallLabel:w,format:J,onCandleClick:i,className:_,...T}){let f=(0,ne.useUILabels)(),$=(0,h.useMemo)(()=>r?.format??J??(d=>(0,Y.formatAuto)(d,e)),[r?.format,J,e]),H=(0,h.useMemo)(()=>a.format??(d=>(0,Y.formatXValue)(d,e)),[a.format,e]),A=(0,h.useMemo)(()=>l.map((d,Q)=>{let ae=(0,L.readXValue)(d,a.key,Q),V=(0,L.readNumber)(d,o),X=(0,L.readNumber)(d,R);return{index:Q,x:ae,label:H(ae,Q),open:V,high:(0,L.readNumber)(d,c),low:(0,L.readNumber)(d,y),close:X,change:V===null||X===null?null:X-V,rising:V===null||X===null?!0:X>=V,datum:d}}),[l,a.key,o,c,y,R,H]),v=(0,h.useMemo)(()=>({up:P?.up??B.CHART_UP_COLOR,down:P?.down??B.CHART_DOWN_COLOR}),[P]),K=(0,h.useMemo)(()=>[{key:"up",label:G??f.chartRise,color:v.up,marker:"rect"},{key:"down",label:w??f.chartFall,color:v.down,marker:"rect"}],[v,G,w,f.chartRise,f.chartFall]),de=p===void 0?!0:p!==!1,re=typeof p=="string"?p:"bottom";return(0,t.jsx)(oe.ChartContainer,{title:x,description:S,height:W,width:D,size:b,loading:g,empty:A.length===0,emptyState:C,error:n,errorState:U,onRetry:j,actions:Z,tableView:N,legendPosition:re,legend:de?(0,t.jsx)(ie.ChartLegend,{items:K,position:re,marker:"rect",size:b}):void 0,table:N?(0,t.jsx)(se.ChartTableView,{data:l,series:[{key:o,label:m??f.chartOpen},{key:c,label:k??f.chartHigh},{key:y,label:z??f.chartLow},{key:R,label:q??f.chartClose}],xKey:a.key,xLabel:a.label??a.key,formatX:H,formatValue:$,caption:typeof x=="string"?x:void 0}):void 0,className:_,...T,children:({width:d})=>(0,t.jsx)(Le,{width:d,height:W,data:l,candles:A,x:a,y:r,grid:F,size:b,candleSize:I,fillRising:E,palette:v,referenceLines:M,margin:s,tooltip:O,plotLabel:u,formatValue:$,formatX:H,onCandleClick:i})})}0&&(module.exports={CandlestickChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as oe,useCallback as Q,useMemo as H,useState as le}from"react";import{useUILabels as re}from"../../lib/i18n.js";import{ChartAxis as ne}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 me}from"../chart/palette.js";import{buildCartesianGeometry as de}from"../chart/utils/cartesian.js";import{readNumber as B,readXValue as fe}from"../chart/utils/data.js";import{formatAuto as be,formatXValue as pe}from"../chart/utils/format.js";import{buildBarPath as ye}from"../chart/utils/path.js";import{nearestIndex as Ce}from"../chart/utils/scales.js";import{CHART_TOUCH as ke}from"../chart/utils/touch.js";import{Fragment as Re,jsx as n,jsxs as b}from"react/jsx-runtime";var xe=16,we=1.5,ve=oe(function({candles:s}){return n("g",{children:s.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 Le({width:g,height:s,data:r,candles:a,x:p,y,grid:L,size:I,candleSize:E,fillRising:R,palette:M,referenceLines:W,margin:D,tooltip:d,plotLabel:Y,formatValue:f,formatX:O,onCandleClick:P}){let[x,N]=le(null),u=x!==null&&x<a.length?x:null,C=re(),t=H(()=>{let e=a.flatMap(o=>o.high===null||o.low===null?[]:[o.low,o.high]),i=de({width:g,height:s,data:r,x:p,y,bounds:e.length===0?null:[Math.min(...e),Math.max(...e)],margin:D,orientation:"vertical",placement:"band",formatValue:f,formatX:O,defaultIncludeZero:!1}),{valueScale:h,bandwidth:k,categoryPositions:z,innerWidth:Z,innerHeight:G}=i,w=Math.min(E??xe,Math.max(1,k-2));return{rendered:a.map((o,_)=>{let T=z[_]+(k-w)/2,m=T+w/2,$=o.rising?M.up:M.down,S=o.high===null||o.low===null?null:{x:m,y1:h(o.high),y2:h(o.low)},A=null;if(o.open!==null&&o.close!==null){let v=h(o.open),K=h(o.close);A=ye({x:T,y:Math.min(v,K),width:w,height:Math.max(we,Math.abs(K-v)),radius:0,round:"none"})}return{key:`${_}`,color:$,body:A,hollow:o.rising&&!R,wick:S,left:T,width:w}}),categoryPositions:z,categoryCenters:i.categoryCenters,bandwidth:k,categoryTicks:i.categoryTicks,valueTicks:i.valueTicks,valueScale:h,innerWidth:Z,innerHeight:G,margin:i.margin}},[a,r,p,y,g,s,D,E,R,M,f,O]),F=Q(e=>{if(d===!1||a.length===0)return;let i=e.currentTarget.getBoundingClientRect(),h=e.clientX-i.left-t.margin.left;N(Ce(t.categoryCenters,h))},[d,a.length,t.margin.left,t.categoryCenters]),U=Q(e=>{if(a.length===0)return;let i=a.length-1,h=u??0,k=e.key==="ArrowRight"?Math.min(i,h+1):e.key==="ArrowLeft"?Math.max(0,h-1):e.key==="Home"?0:e.key==="End"?i:e.key==="Escape"?null:void 0;k!==void 0&&(e.preventDefault(),N(k))},[a.length,u]),j=Q(()=>{!P||u===null||P(a[u])},[P,u,a]),l=u===null?null:a[u];return b(Re,{children:[b("svg",{width:g,height:s,role:"img","aria-label":Y??a.map(e=>e.label).join(", "),tabIndex:0,className:`${ke} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:F,onPointerLeave:()=>N(null),onKeyDown:U,onBlur:()=>N(null),onClick:j,children:[b("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:[n(se,{width:t.innerWidth,height:t.innerHeight,horizontal:L==="y"||L==="both"?t.valueTicks.map(e=>e.offset):void 0}),u!==null?n("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,W?.map(e=>b("g",{children:[n("line",{x1:0,y1:t.valueScale(e.value),x2:t.innerWidth,y2:t.valueScale(e.value),stroke:e.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:e.dashed===!1?void 0:"4 4"}),e.label?n("text",{x:t.innerWidth,y:t.valueScale(e.value)-4,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:e.label}):null]},`${e.value}-${e.label??""}`)),n(ve,{candles:t.rendered})]}),n("g",{transform:`translate(${t.margin.left}, ${t.margin.top+t.innerHeight})`,children:p.hidden?null:n(ne,{orientation:"bottom",ticks:t.categoryTicks,length:t.innerWidth,label:p.label,size:I})}),n("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:y?.hidden?null:n(ne,{orientation:"left",ticks:t.valueTicks,length:t.innerHeight,showLine:!1,label:y?.label,size:I})})]}),l&&u!==null&&d!==!1?n(ce,{x:t.margin.left+t.categoryCenters[u],y:t.margin.top+(l.high===null?t.innerHeight/2:t.valueScale(l.high)),containerWidth:g,children:typeof d=="function"?d(l):b("div",{className:"flex flex-col gap-1",children:[n("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:l.label}),n("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[C.chartOpen,l.open],[C.chartHigh,l.high],[C.chartLow,l.low],[C.chartClose,l.close]].map(([e,i])=>b("div",{className:"contents",children:[n("dt",{className:"text-gray-500 dark:text-gray-400",children:e}),n("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:i===null?"\u2014":f(i)})]},e))}),l.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:l.rising?C.chartRise:C.chartFall}),b("span",{className:"[font-variant-numeric:tabular-nums] font-semibold text-gray-900 dark:text-gray-100",children:[l.change>0?"+":"",f(l.change)]})]})]})}):null]})}function Ge({data:g,x:s,y:r,open:a,high:p,low:y,close:L,candleSize:I,fillRising:E=!1,colors:R,referenceLines:M,height:W=300,width:D,size:d="md",grid:Y="y",legend:f,tooltip:O=!0,tableView:P=!1,title:x,description:N,loading:u=!1,emptyState:C,error:t=!1,errorState:F,onRetry:U,actions:j,margin:l,locale:e,plotLabel:i,openLabel:h,highLabel:k,lowLabel:z,closeLabel:Z,riseLabel:G,fallLabel:w,format:q,onCandleClick:o,className:_,...T}){let m=re(),$=H(()=>r?.format??q??(c=>be(c,e)),[r?.format,q,e]),S=H(()=>s.format??(c=>pe(c,e)),[s.format,e]),A=H(()=>g.map((c,J)=>{let te=fe(c,s.key,J),V=B(c,a),X=B(c,L);return{index:J,x:te,label:S(te,J),open:V,high:B(c,p),low:B(c,y),close:X,change:V===null||X===null?null:X-V,rising:V===null||X===null?!0:X>=V,datum:c}}),[g,s.key,a,p,y,L,S]),v=H(()=>({up:R?.up??me,down:R?.down??ge}),[R]),K=H(()=>[{key:"up",label:G??m.chartRise,color:v.up,marker:"rect"},{key:"down",label:w??m.chartFall,color:v.down,marker:"rect"}],[v,G,w,m.chartRise,m.chartFall]),ae=f===void 0?!0:f!==!1,ee=typeof f=="string"?f:"bottom";return n(ie,{title:x,description:N,height:W,width:D,size:d,loading:u,empty:A.length===0,emptyState:C,error:t,errorState:F,onRetry:U,actions:j,tableView:P,legendPosition:ee,legend:ae?n(ue,{items:K,position:ee,marker:"rect",size:d}):void 0,table:P?n(he,{data:g,series:[{key:a,label:h??m.chartOpen},{key:p,label:k??m.chartHigh},{key:y,label:z??m.chartLow},{key:L,label:Z??m.chartClose}],xKey:s.key,xLabel:s.label??s.key,formatX:S,formatValue:$,caption:typeof x=="string"?x:void 0}):void 0,className:_,...T,children:({width:c})=>n(Le,{width:c,height:W,data:g,candles:A,x:s,y:r,grid:Y,size:d,candleSize:I,fillRising:E,palette:v,referenceLines:M,margin:l,tooltip:O,plotLabel:i,formatValue:$,formatX:S,onCandleClick:o})})}export{Ge 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});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCallback as w}from"react";import{cn as E}from"../../lib/cn.js";import{useUILabels as k}from"../../lib/i18n.js";import{Dropdown as D}from"../dropdown/Dropdown.js";import{DropdownContent as F}from"../dropdown/DropdownContent.js";import{DropdownItem as z}from"../dropdown/DropdownItem.js";import{DropdownTrigger as B}from"../dropdown/DropdownTrigger.js";import{downloadChartData as I}from"./utils/export.js";import{jsx as o,jsxs as i}from"react/jsx-runtime";var N={sm:"h-7 px-2.5 text-xs",md:"h-8 px-3 text-sm",lg:"h-10 px-4 text-sm"},C=o("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"shrink-0",children:o("path",{d:"M8 2v8m0 0 3-3m-3 3L5 7M2.5 12.5h11",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})});function R({data:r,series:a,xKey:p,xLabel:l,formatX:c,formats:e=["csv","json"],filename:d="chart",size:b="md",label:f,onExport:n,className:y,disabled:h}){let s=k(),m=w(t=>{let x={data:r,series:a,xKey:p,xLabel:l,formatX:c};n?n(t,x):I(t,x,d)},[r,a,p,l,c,n,d]),g=f??s.chartExport,v=t=>t==="csv"?s.chartExportCsv:s.chartExportJson,u=E("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",N[b],y);if(e.length<=1){let t=e[0]??"csv";return i("button",{type:"button",onClick:()=>m(t),disabled:h||r.length===0,className:u,children:[C,o("span",{children:g})]})}return i(D,{children:[i(B,{disabled:h||r.length===0,className:u,children:[C,o("span",{children:g})]}),o(F,{children:e.map(t=>o(z,{onSelect:()=>m(t),children:v(t)},t))})]})}export{R as ChartExportButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var O=(n,r)=>{for(var i in r)x(n,i,{get:r[i],enumerable:!0})},Z=(n,r,i,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of K(r))!M.call(n,m)&&m!==i&&x(n,m,{get:()=>r[m],enumerable:!(d=B(r,m))||d.enumerable});return n};var _=n=>Z(x({},"__esModule",{value:!0}),n);var J={};O(J,{ChartFacets:()=>H,resetFacetWarnings:()=>I});module.exports=_(J);var u=require("../../lib/cn.cjs"),c=require("./utils/data.cjs"),P=require("./utils/format.cjs"),C=require("./utils/scales.cjs"),V=require("./utils/ticks.cjs"),s=require("react/jsx-runtime"),F=12,b=!1,q={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},G={sm:"text-xs",md:"text-sm",lg:"text-base"};function H({data:n,by:r,values:i,domain:d,includeZero:m=!1,ticks:k=5,order:y,sort:v="none",columns:w,minPanelWidth:S=220,formatLabel:X,showLabels:W=!0,title:f,description:g,size:N="md",locale:z,emptyState:A,children:E,className:R,...D}){let $=X??(e=>(0,P.formatXValue)(e,z)),h=new Map;n.forEach((e,t)=>{let a=(0,c.readXValue)(e,r,t),l=(0,C.toKey)(a),p=h.get(l);p?p.rows.push(e):h.set(l,{value:a,rows:[e]})});let o=[...h.entries()];if(y)o=y.map(C.toKey).map(t=>o.find(([a])=>a===t)).filter(t=>t!==void 0);else if(v!=="none"){let e=t=>t.reduce((a,l)=>a+i.reduce((p,T)=>p+((0,c.readNumber)(l,T)??0),0),0);o=[...o].sort(([,t],[,a])=>v==="asc"?e(t.rows)-e(a.rows):e(a.rows)-e(t.rows))}let L=d??(0,V.resolveDomain)((0,c.collectAllValues)(n,i),{includeZero:m,ticks:k});return o.length>F&&!b&&(b=!0,console.warn(`[@synertech/ui] ChartFacets was given ${o.length} panels. Past ${F} a facet grid stops being a comparison \u2014 filter the data down to the panels the reader is actually comparing.`)),o.length===0?(0,s.jsx)("div",{className:(0,u.cn)("text-sm text-gray-500 dark:text-gray-400",R),...D,children:A}):(0,s.jsxs)("div",{className:(0,u.cn)("flex w-full flex-col gap-3",R),...D,children:[f||g?(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[f?(0,s.jsx)("span",{className:(0,u.cn)("font-semibold text-gray-900 dark:text-gray-100",G[N]),children:f}):null,g?(0,s.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:g}):null]}):null,(0,s.jsx)("div",{className:"grid gap-x-4 gap-y-3",style:{gridTemplateColumns:w?`repeat(${w}, minmax(0, 1fr))`:`repeat(auto-fit, minmax(${S}px, 1fr))`},children:o.map(([e,t],a)=>{let l=$(t.value,a);return(0,s.jsxs)("div",{role:"group","aria-label":l,className:"flex min-w-0 flex-col gap-1",children:[W?(0,s.jsx)("span",{className:(0,u.cn)("font-medium text-gray-700 dark:text-gray-200",q[N]),children:l}):null,E({key:e,label:l,data:t.rows,domain:L,index:a,count:o.length})]},e)})})]})}function I(){b=!1}0&&(module.exports={ChartFacets,resetFacetWarnings});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as l}from"../../lib/cn.js";import{collectAllValues as $,readNumber as L,readXValue as T}from"./utils/data.js";import{formatXValue as B}from"./utils/format.js";import{toKey as v}from"./utils/scales.js";import{resolveDomain as K}from"./utils/ticks.js";import{jsx as s,jsxs as u}from"react/jsx-runtime";var w=12,d=!1,M={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},O={sm:"text-xs",md:"text-sm",lg:"text-base"};function I({data:p,by:N,values:f,domain:R,includeZero:D=!1,ticks:F=5,order:g,sort:h="none",columns:x,minPanelWidth:P=220,formatLabel:V,showLabels:k=!0,title:i,description:m,size:C="md",locale:S,emptyState:X,children:W,className:b,...y}){let z=V??(e=>B(e,S)),c=new Map;p.forEach((e,t)=>{let a=T(e,N,t),n=v(a),o=c.get(n);o?o.rows.push(e):c.set(n,{value:a,rows:[e]})});let r=[...c.entries()];if(g)r=g.map(v).map(t=>r.find(([a])=>a===t)).filter(t=>t!==void 0);else if(h!=="none"){let e=t=>t.reduce((a,n)=>a+f.reduce((o,E)=>o+(L(n,E)??0),0),0);r=[...r].sort(([,t],[,a])=>h==="asc"?e(t.rows)-e(a.rows):e(a.rows)-e(t.rows))}let A=R??K($(p,f),{includeZero:D,ticks:F});return r.length>w&&!d&&(d=!0,console.warn(`[@synertech/ui] ChartFacets was given ${r.length} panels. Past ${w} a facet grid stops being a comparison \u2014 filter the data down to the panels the reader is actually comparing.`)),r.length===0?s("div",{className:l("text-sm text-gray-500 dark:text-gray-400",b),...y,children:X}):u("div",{className:l("flex w-full flex-col gap-3",b),...y,children:[i||m?u("div",{className:"flex flex-col gap-0.5",children:[i?s("span",{className:l("font-semibold text-gray-900 dark:text-gray-100",O[C]),children:i}):null,m?s("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:m}):null]}):null,s("div",{className:"grid gap-x-4 gap-y-3",style:{gridTemplateColumns:x?`repeat(${x}, minmax(0, 1fr))`:`repeat(auto-fit, minmax(${P}px, 1fr))`},children:r.map(([e,t],a)=>{let n=z(t.value,a);return u("div",{role:"group","aria-label":n,className:"flex min-w-0 flex-col gap-1",children:[k?s("span",{className:l("font-medium text-gray-700 dark:text-gray-200",M[C]),children:n}):null,W({key:e,label:n,data:t.rows,domain:A,index:a,count:r.length})]},e)})})]})}function J(){d=!1}export{I as ChartFacets,J as resetFacetWarnings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var l=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var a in e)l(r,a,{get:e[a],enumerable:!0})},u=(r,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of g(e))!f.call(r,t)&&t!==a&&l(r,t,{get:()=>e[t],enumerable:!(o=b(e,t))||o.enumerable});return r};var C=r=>u(l({},"__esModule",{value:!0}),r);var k={};h(k,{ChartFilterBar:()=>R});module.exports=C(k);var s=require("../../lib/cn.cjs"),p=require("../../lib/i18n.cjs"),i=require("react/jsx-runtime"),y={sm:"gap-1.5",md:"gap-2",lg:"gap-3"};function R({label:r,actions:e,sticky:a=!1,bordered:o=!0,size:t="md",children:d,className:c,...n}){let m=(0,p.useUILabels)();return(0,i.jsxs)("div",{role:"group","aria-label":r??m.chartFilters,className:(0,s.cn)("flex w-full flex-wrap items-center",y[t],o&&"border-b border-gray-200 pb-3 dark:border-gray-700",a&&"sticky top-0 z-10 bg-white/95 pt-3 backdrop-blur-sm dark:bg-gray-900/95",c),...n,children:[d,e?(0,i.jsx)("div",{className:"ml-auto flex items-center gap-2",children:e}):null]})}0&&(module.exports={ChartFilterBar});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{cn as d}from"../../lib/cn.js";import{useUILabels as c}from"../../lib/i18n.js";import{jsx as m,jsxs as b}from"react/jsx-runtime";var n={sm:"gap-1.5",md:"gap-2",lg:"gap-3"};function h({label:r,actions:e,sticky:t=!1,bordered:a=!0,size:o="md",children:i,className:l,...s}){let p=c();return b("div",{role:"group","aria-label":r??p.chartFilters,className:d("flex w-full flex-wrap items-center",n[o],a&&"border-b border-gray-200 pb-3 dark:border-gray-700",t&&"sticky top-0 z-10 bg-white/95 pt-3 backdrop-blur-sm dark:bg-gray-900/95",l),...s,children:[i,e?m("div",{className:"ml-auto flex items-center gap-2",children:e}):null]})}export{h as ChartFilterBar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var g=(e,r)=>{for(var i in r)p(e,i,{get:r[i],enumerable:!0})},c=(e,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!y.call(e,t)&&t!==i&&p(e,t,{get:()=>r[t],enumerable:!(a=s(r,t))||a.enumerable});return e};var k=e=>c(p({},"__esModule",{value:!0}),e);var b={};g(b,{ChartGrid:()=>x});module.exports=k(b);var m=require("../../lib/cn.cjs"),o=require("react/jsx-runtime"),h=[];function x({width:e,height:r,horizontal:i=h,vertical:a=h,className:t,...d}){return(0,o.jsxs)("g",{className:(0,m.cn)("stroke-gray-200 dark:stroke-gray-700",t),strokeWidth:1,shapeRendering:"crispEdges","aria-hidden":"true",...d,children:[i.map(n=>(0,o.jsx)("line",{x1:0,y1:n,x2:e,y2:n},`h-${n}`)),a.map(n=>(0,o.jsx)("line",{x1:n,y1:0,x2:n,y2:r},`v-${n}`))]})}0&&(module.exports={ChartGrid});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as m}from"../../lib/cn.js";import{jsx as t,jsxs as d}from"react/jsx-runtime";var e=[];function u({width:n,height:i,horizontal:o=e,vertical:a=e,className:p,...h}){return d("g",{className:m("stroke-gray-200 dark:stroke-gray-700",p),strokeWidth:1,shapeRendering:"crispEdges","aria-hidden":"true",...h,children:[o.map(r=>t("line",{x1:0,y1:r,x2:n,y2:r},`h-${r}`)),a.map(r=>t("line",{x1:r,y1:0,x2:r,y2:i},`v-${r}`))]})}export{u as ChartGrid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var y=(n,e)=>{for(var o in e)d(n,o,{get:e[o],enumerable:!0})},b=(n,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of C(e))!k.call(n,a)&&a!==o&&d(n,a,{get:()=>e[a],enumerable:!(l=x(e,a))||l.enumerable});return n};var L=n=>b(d({},"__esModule",{value:!0}),n);var N={};y(N,{ChartLegend:()=>P});module.exports=L(N);var s=require("../../lib/cn.cjs"),u=require("./ChartPatterns.cjs"),r=require("react/jsx-runtime"),w={line:"h-0.5 w-3 rounded-full",rect:"h-2.5 w-2.5 rounded-sm",dot:"h-2 w-2 rounded-full"},v={sm:"text-[11px]",md:"text-xs",lg:"text-sm"};function P({items:n,position:e="bottom",marker:o="line",onToggle:l,size:a="md",className:h,...g}){return n.length===0?null:(0,r.jsx)("ul",{className:(0,s.cn)("flex list-none flex-wrap gap-x-4 gap-y-1 p-0",e==="right"?"flex-col":"flex-row",e==="top"||e==="bottom"?"justify-center":"",v[a],h),...g,children:n.map(t=>{let i=t.pattern!==void 0&&(t.marker??o)==="rect",f=(0,r.jsx)("span",{className:(0,s.cn)("shrink-0",i?"h-3 w-3.5 rounded-sm":w[t.marker??o]),style:i?(0,u.patternBackground)(t.pattern,t.color):{backgroundColor:t.color},"aria-hidden":"true"}),m=(0,r.jsx)("span",{className:(0,s.cn)(t.hidden&&"line-through"),children:t.label}),c=(0,r.jsxs)(r.Fragment,{children:[f,m]}),p=(0,s.cn)("flex items-center gap-1.5 text-gray-600 dark:text-gray-300",t.hidden&&"text-gray-400 dark:text-gray-500");return(0,r.jsx)("li",{children:l?(0,r.jsx)("button",{type:"button",onClick:()=>l(t.key),"aria-pressed":!t.hidden,className:(0,s.cn)(p,"cursor-pointer rounded-sm hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:hover:text-white"),children:c}):(0,r.jsx)("span",{className:p,children:c})},t.key)})})}0&&(module.exports={ChartLegend});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as r}from"../../lib/cn.js";import{patternBackground as f}from"./ChartPatterns.js";import{Fragment as C,jsx as t,jsxs as k}from"react/jsx-runtime";var m={line:"h-0.5 w-3 rounded-full",rect:"h-2.5 w-2.5 rounded-sm",dot:"h-2 w-2 rounded-full"},x={sm:"text-[11px]",md:"text-xs",lg:"text-sm"};function L({items:o,position:n="bottom",marker:a="line",onToggle:s,size:c="md",className:p,...u}){return o.length===0?null:t("ul",{className:r("flex list-none flex-wrap gap-x-4 gap-y-1 p-0",n==="right"?"flex-col":"flex-row",n==="top"||n==="bottom"?"justify-center":"",x[c],p),...u,children:o.map(e=>{let l=e.pattern!==void 0&&(e.marker??a)==="rect",h=t("span",{className:r("shrink-0",l?"h-3 w-3.5 rounded-sm":m[e.marker??a]),style:l?f(e.pattern,e.color):{backgroundColor:e.color},"aria-hidden":"true"}),g=t("span",{className:r(e.hidden&&"line-through"),children:e.label}),d=k(C,{children:[h,g]}),i=r("flex items-center gap-1.5 text-gray-600 dark:text-gray-300",e.hidden&&"text-gray-400 dark:text-gray-500");return t("li",{children:s?t("button",{type:"button",onClick:()=>s(e.key),"aria-pressed":!e.hidden,className:r(i,"cursor-pointer rounded-sm hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:hover:text-white"),children:d}):t("span",{className:i,children:d})},e.key)})})}export{L as ChartLegend};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var f=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var m=(t,r)=>{for(var n in r)f(t,n,{get:r[n],enumerable:!0})},P=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of b(r))!C.call(t,o)&&o!==n&&f(t,o,{get:()=>r[o],enumerable:!(i=x(r,o))||i.enumerable});return t};var $=t=>P(f({},"__esModule",{value:!0}),t);var R={};m(R,{CHART_PATTERNS:()=>k,CHART_SURFACE_COLOR:()=>l,ChartPatternDefs:()=>S,getPattern:()=>g,patternBackground:()=>w,patternFill:()=>y,patternId:()=>p});module.exports=$(R);var a=require("react/jsx-runtime"),l="var(--color-chart-surface)",k=["solid","diagonal","diagonal-reverse","cross","dots","diagonal-wide","diagonal-reverse-wide","dots-wide"],h={solid:null,diagonal:{tile:6,rotate:45,stroke:2},"diagonal-reverse":{tile:6,rotate:-45,stroke:2},cross:{tile:6,rotate:45,stroke:1.25,crossed:!0},dots:{tile:6,rotate:0,stroke:0,dot:1.5},"diagonal-wide":{tile:10,rotate:45,stroke:3},"diagonal-reverse-wide":{tile:10,rotate:-45,stroke:3},"dots-wide":{tile:10,rotate:0,stroke:0,dot:2.6}};function g(t){return!Number.isFinite(t)||t<0?"solid":k[Math.floor(t)%k.length]}function p(t,r){return`${t.replace(/[^a-zA-Z0-9_-]/g,"")}-texture-${Math.max(0,Math.floor(r))}`}function y(t,r,n,i){return!t||g(n)==="solid"?i:`url(#${p(r,n)})`}function S({id:t,entries:r}){return(0,a.jsx)("defs",{children:r.map(({slot:n,color:i})=>{let o=h[g(n)];if(!o)return null;let{tile:e,rotate:u,stroke:s,crossed:d,dot:c}=o;return(0,a.jsxs)("pattern",{id:p(t,n),width:e,height:e,patternUnits:"userSpaceOnUse",patternTransform:u===0?void 0:`rotate(${u})`,children:[(0,a.jsx)("rect",{width:e,height:e,fill:i}),c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:e/4,cy:e/4,r:c,fill:l}),(0,a.jsx)("circle",{cx:e*3/4,cy:e*3/4,r:c,fill:l})]}):null,s>0?(0,a.jsx)("line",{x1:e/2,y1:0,x2:e/2,y2:e,stroke:l,strokeWidth:s}):null,d?(0,a.jsx)("line",{x1:0,y1:e/2,x2:e,y2:e/2,stroke:l,strokeWidth:s}):null]},p(t,n))})})}function w(t,r){let n=h[g(t)];if(!n)return{backgroundColor:r};let{tile:i,rotate:o,stroke:e,crossed:u,dot:s}=n;if(s)return{backgroundColor:r,backgroundImage:`radial-gradient(${l} ${s-.4}px, transparent ${s}px)`,backgroundSize:`${i/2}px ${i/2}px`};let d=c=>`repeating-linear-gradient(${c}deg, ${l} 0 ${e}px, transparent ${e}px ${i}px)`;return{backgroundColor:r,backgroundImage:u?`${d(o)}, ${d(o+90)}`:d(o)}}0&&(module.exports={CHART_PATTERNS,CHART_SURFACE_COLOR,ChartPatternDefs,getPattern,patternBackground,patternFill,patternId});
|