@synertech/ui 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/use-synertech-ui/SKILL.md +75 -4
- package/README.md +36 -8
- package/dist/components/accordion/Accordion.cjs +1 -0
- package/dist/components/accordion/Accordion.js +1 -0
- package/dist/components/accordion/index.cjs +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/advance-detachable/AdvanceDetachable.cjs +1 -0
- package/dist/components/advance-detachable/AdvanceDetachable.js +1 -0
- package/dist/components/advance-detachable/index.cjs +1 -0
- package/dist/components/advance-detachable/index.js +1 -0
- package/dist/components/area-chart/AreaChart.cjs +1 -0
- package/dist/components/area-chart/AreaChart.js +1 -0
- package/dist/components/area-chart/index.cjs +1 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/avatar/Avatar.cjs +1 -0
- package/dist/components/avatar/Avatar.js +1 -0
- package/dist/components/avatar/index.cjs +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/Badge.cjs +1 -0
- package/dist/components/badge/Badge.js +1 -0
- package/dist/components/badge/index.cjs +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/banner/Banner.cjs +1 -0
- package/dist/components/banner/Banner.js +1 -0
- package/dist/components/banner/index.cjs +1 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/bar-chart/BarChart.cjs +1 -0
- package/dist/components/bar-chart/BarChart.js +1 -0
- package/dist/components/bar-chart/index.cjs +1 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/box-plot/BoxPlot.cjs +1 -0
- package/dist/components/box-plot/BoxPlot.js +1 -0
- package/dist/components/box-plot/index.cjs +1 -0
- package/dist/components/box-plot/index.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.cjs +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/breadcrumb/index.cjs +1 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/bullet-chart/BulletChart.cjs +1 -0
- package/dist/components/bullet-chart/BulletChart.js +1 -0
- package/dist/components/bullet-chart/index.cjs +1 -0
- package/dist/components/bullet-chart/index.js +1 -0
- package/dist/components/button/Button.cjs +1 -0
- package/dist/components/button/Button.js +1 -0
- package/dist/components/button/index.cjs +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.cjs +1 -0
- package/dist/components/button-group/ButtonGroup.js +1 -0
- package/dist/components/button-group/index.cjs +1 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/calendar/Calendar.cjs +1 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/index.cjs +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/candlestick-chart/CandlestickChart.cjs +1 -0
- package/dist/components/candlestick-chart/CandlestickChart.js +1 -0
- package/dist/components/candlestick-chart/index.cjs +1 -0
- package/dist/components/candlestick-chart/index.js +1 -0
- package/dist/components/card/Card.cjs +1 -0
- package/dist/components/card/Card.js +1 -0
- package/dist/components/card/CardBody.cjs +1 -0
- package/dist/components/card/CardBody.js +1 -0
- package/dist/components/card/CardDescription.cjs +1 -0
- package/dist/components/card/CardDescription.js +1 -0
- package/dist/components/card/CardFooter.cjs +1 -0
- package/dist/components/card/CardFooter.js +1 -0
- package/dist/components/card/CardHeader.cjs +1 -0
- package/dist/components/card/CardHeader.js +1 -0
- package/dist/components/card/CardImage.cjs +1 -0
- package/dist/components/card/CardImage.js +1 -0
- package/dist/components/card/CardTitle.cjs +1 -0
- package/dist/components/card/CardTitle.js +1 -0
- package/dist/components/card/index.cjs +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/chart/ChartAnnotations.cjs +1 -0
- package/dist/components/chart/ChartAnnotations.js +1 -0
- package/dist/components/chart/ChartAxis.cjs +1 -0
- package/dist/components/chart/ChartAxis.js +1 -0
- package/dist/components/chart/ChartBrush.cjs +1 -0
- package/dist/components/chart/ChartBrush.js +1 -0
- package/dist/components/chart/ChartContainer.cjs +1 -0
- package/dist/components/chart/ChartContainer.js +1 -0
- package/dist/components/chart/ChartExportButton.cjs +1 -0
- package/dist/components/chart/ChartExportButton.js +1 -0
- package/dist/components/chart/ChartFacets.cjs +1 -0
- package/dist/components/chart/ChartFacets.js +1 -0
- package/dist/components/chart/ChartFilterBar.cjs +1 -0
- package/dist/components/chart/ChartFilterBar.js +1 -0
- package/dist/components/chart/ChartGrid.cjs +1 -0
- package/dist/components/chart/ChartGrid.js +1 -0
- package/dist/components/chart/ChartLegend.cjs +1 -0
- package/dist/components/chart/ChartLegend.js +1 -0
- package/dist/components/chart/ChartPatterns.cjs +1 -0
- package/dist/components/chart/ChartPatterns.js +1 -0
- package/dist/components/chart/ChartPeriodPicker.cjs +1 -0
- package/dist/components/chart/ChartPeriodPicker.js +1 -0
- package/dist/components/chart/ChartScaleLegend.cjs +1 -0
- package/dist/components/chart/ChartScaleLegend.js +1 -0
- package/dist/components/chart/ChartSync.cjs +1 -0
- package/dist/components/chart/ChartSync.js +1 -0
- package/dist/components/chart/ChartTableView.cjs +1 -0
- package/dist/components/chart/ChartTableView.js +1 -0
- package/dist/components/chart/ChartTooltip.cjs +1 -0
- package/dist/components/chart/ChartTooltip.js +1 -0
- package/dist/components/chart/chart.types.cjs +1 -0
- package/dist/components/chart/chart.types.js +0 -0
- package/dist/components/chart/index.cjs +1 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/chart/palette.cjs +1 -0
- package/dist/components/chart/palette.js +1 -0
- package/dist/components/chart/useChartSize.cjs +1 -0
- package/dist/components/chart/useChartSize.js +1 -0
- package/dist/components/chart/utils/bins.cjs +1 -0
- package/dist/components/chart/utils/bins.js +1 -0
- package/dist/components/chart/utils/cartesian.cjs +1 -0
- package/dist/components/chart/utils/cartesian.js +1 -0
- package/dist/components/chart/utils/data.cjs +1 -0
- package/dist/components/chart/utils/data.js +1 -0
- package/dist/components/chart/utils/decimate.cjs +1 -0
- package/dist/components/chart/utils/decimate.js +1 -0
- package/dist/components/chart/utils/export.cjs +2 -0
- package/dist/components/chart/utils/export.js +2 -0
- package/dist/components/chart/utils/format.cjs +1 -0
- package/dist/components/chart/utils/format.js +1 -0
- package/dist/components/chart/utils/path.cjs +1 -0
- package/dist/components/chart/utils/path.js +1 -0
- package/dist/components/chart/utils/period.cjs +1 -0
- package/dist/components/chart/utils/period.js +1 -0
- package/dist/components/chart/utils/quantile.cjs +1 -0
- package/dist/components/chart/utils/quantile.js +1 -0
- package/dist/components/chart/utils/scales.cjs +1 -0
- package/dist/components/chart/utils/scales.js +1 -0
- package/dist/components/chart/utils/stack.cjs +1 -0
- package/dist/components/chart/utils/stack.js +1 -0
- package/dist/components/chart/utils/text.cjs +1 -0
- package/dist/components/chart/utils/text.js +1 -0
- package/dist/components/chart/utils/ticks.cjs +1 -0
- package/dist/components/chart/utils/ticks.js +1 -0
- package/dist/components/chart/utils/time.cjs +1 -0
- package/dist/components/chart/utils/time.js +1 -0
- package/dist/components/checkbox/Checkbox.cjs +1 -0
- package/dist/components/checkbox/Checkbox.js +1 -0
- package/dist/components/checkbox/CheckboxGroup.cjs +1 -0
- package/dist/components/checkbox/CheckboxGroup.js +1 -0
- package/dist/components/checkbox/index.cjs +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.cjs +1 -0
- package/dist/components/chip/Chip.js +1 -0
- package/dist/components/chip/index.cjs +1 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/circular-progress/CircularProgress.cjs +1 -0
- package/dist/components/circular-progress/CircularProgress.js +1 -0
- package/dist/components/circular-progress/index.cjs +1 -0
- package/dist/components/circular-progress/index.js +1 -0
- package/dist/components/datagrid/DataGrid.cjs +2 -0
- package/dist/components/datagrid/DataGrid.js +2 -0
- package/dist/components/datagrid/index.cjs +1 -0
- package/dist/components/datagrid/index.js +1 -0
- package/dist/components/detachable/Detachable.cjs +1 -0
- package/dist/components/detachable/Detachable.js +1 -0
- package/dist/components/detachable/index.cjs +1 -0
- package/dist/components/detachable/index.js +1 -0
- package/dist/components/device-mockup/DeviceMockup.cjs +1 -0
- package/dist/components/device-mockup/DeviceMockup.js +1 -0
- package/dist/components/device-mockup/index.cjs +1 -0
- package/dist/components/device-mockup/index.js +1 -0
- package/dist/components/divider/Divider.cjs +1 -0
- package/dist/components/divider/Divider.js +1 -0
- package/dist/components/divider/index.cjs +1 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/Drawer.cjs +1 -0
- package/dist/components/drawer/Drawer.js +1 -0
- package/dist/components/drawer/index.cjs +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/dropdown/Dropdown.cjs +1 -0
- package/dist/components/dropdown/Dropdown.js +1 -0
- package/dist/components/dropdown/DropdownCheckboxItem.cjs +1 -0
- package/dist/components/dropdown/DropdownCheckboxItem.js +1 -0
- package/dist/components/dropdown/DropdownContent.cjs +1 -0
- package/dist/components/dropdown/DropdownContent.js +1 -0
- package/dist/components/dropdown/DropdownItem.cjs +1 -0
- package/dist/components/dropdown/DropdownItem.js +1 -0
- package/dist/components/dropdown/DropdownRadio.cjs +1 -0
- package/dist/components/dropdown/DropdownRadio.js +1 -0
- package/dist/components/dropdown/DropdownSeparator.cjs +1 -0
- package/dist/components/dropdown/DropdownSeparator.js +1 -0
- package/dist/components/dropdown/DropdownSubMenu.cjs +1 -0
- package/dist/components/dropdown/DropdownSubMenu.js +1 -0
- package/dist/components/dropdown/DropdownTrigger.cjs +1 -0
- package/dist/components/dropdown/DropdownTrigger.js +1 -0
- package/dist/components/dropdown/hooks/index.cjs +1 -0
- package/dist/components/dropdown/hooks/index.js +1 -0
- package/dist/components/dropdown/hooks/useClickOutside.cjs +1 -0
- package/dist/components/dropdown/hooks/useClickOutside.js +1 -0
- package/dist/components/dropdown/hooks/useKeyboardNavigation.cjs +1 -0
- package/dist/components/dropdown/hooks/useKeyboardNavigation.js +1 -0
- package/dist/components/dropdown/hooks/useLatest.cjs +1 -0
- package/dist/components/dropdown/hooks/useLatest.js +1 -0
- package/dist/components/dropdown/hooks/usePositioning.cjs +1 -0
- package/dist/components/dropdown/hooks/usePositioning.js +1 -0
- package/dist/components/dropdown/index.cjs +1 -0
- package/dist/components/dropdown/index.js +1 -0
- package/dist/components/dumbbell-chart/DumbbellChart.cjs +1 -0
- package/dist/components/dumbbell-chart/DumbbellChart.js +1 -0
- package/dist/components/dumbbell-chart/index.cjs +1 -0
- package/dist/components/dumbbell-chart/index.js +1 -0
- package/dist/components/file-selector/FileSelector.cjs +1 -0
- package/dist/components/file-selector/FileSelector.js +1 -0
- package/dist/components/file-selector/index.cjs +1 -0
- package/dist/components/file-selector/index.js +1 -0
- package/dist/components/footer/Footer.cjs +1 -0
- package/dist/components/footer/Footer.js +1 -0
- package/dist/components/footer/FooterBottom.cjs +1 -0
- package/dist/components/footer/FooterBottom.js +1 -0
- package/dist/components/footer/FooterColumn.cjs +1 -0
- package/dist/components/footer/FooterColumn.js +1 -0
- package/dist/components/footer/FooterLink.cjs +1 -0
- package/dist/components/footer/FooterLink.js +1 -0
- package/dist/components/footer/FooterSection.cjs +1 -0
- package/dist/components/footer/FooterSection.js +1 -0
- package/dist/components/footer/FooterSocial.cjs +1 -0
- package/dist/components/footer/FooterSocial.js +1 -0
- package/dist/components/footer/index.cjs +1 -0
- package/dist/components/footer/index.js +1 -0
- package/dist/components/form/index.cjs +1 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/input/Input.cjs +1 -0
- package/dist/components/form/input/Input.js +1 -0
- package/dist/components/form/input/index.cjs +1 -0
- package/dist/components/form/input/index.js +1 -0
- package/dist/components/form/mention-input/MentionInput.cjs +1 -0
- package/dist/components/form/mention-input/MentionInput.js +1 -0
- package/dist/components/form/mention-input/index.cjs +1 -0
- package/dist/components/form/mention-input/index.js +1 -0
- package/dist/components/form/number-input/NumberInput.cjs +1 -0
- package/dist/components/form/number-input/NumberInput.js +1 -0
- package/dist/components/form/number-input/index.cjs +1 -0
- package/dist/components/form/number-input/index.js +1 -0
- package/dist/components/form/shared/InputWrapper.cjs +1 -0
- package/dist/components/form/shared/InputWrapper.js +1 -0
- package/dist/components/form/shared/inputStyles.cjs +1 -0
- package/dist/components/form/shared/inputStyles.js +1 -0
- package/dist/components/form/types/mention.cjs +1 -0
- package/dist/components/form/types/mention.js +0 -0
- package/dist/components/funnel-chart/FunnelChart.cjs +1 -0
- package/dist/components/funnel-chart/FunnelChart.js +1 -0
- package/dist/components/funnel-chart/index.cjs +1 -0
- package/dist/components/funnel-chart/index.js +1 -0
- package/dist/components/gantt-chart/GanttChart.cjs +1 -0
- package/dist/components/gantt-chart/GanttChart.js +1 -0
- package/dist/components/gantt-chart/index.cjs +1 -0
- package/dist/components/gantt-chart/index.js +1 -0
- package/dist/components/header/Header.cjs +1 -0
- package/dist/components/header/Header.js +1 -0
- package/dist/components/header/index.cjs +1 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/heat-map/Heatmap.cjs +1 -0
- package/dist/components/heat-map/Heatmap.js +1 -0
- package/dist/components/heat-map/index.cjs +1 -0
- package/dist/components/heat-map/index.js +1 -0
- package/dist/components/help-button/HelpButton.cjs +22 -0
- package/dist/components/help-button/HelpButton.js +22 -0
- package/dist/components/help-button/MarkdownEditor.cjs +1 -0
- package/dist/components/help-button/MarkdownEditor.js +1 -0
- package/dist/components/help-button/index.cjs +1 -0
- package/dist/components/help-button/index.js +1 -0
- package/dist/components/help-button/types.cjs +1 -0
- package/dist/components/help-button/types.js +0 -0
- package/dist/components/image-uploader/ImageUploader.cjs +1 -0
- package/dist/components/image-uploader/ImageUploader.js +1 -0
- package/dist/components/image-uploader/index.cjs +1 -0
- package/dist/components/image-uploader/index.js +1 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/indicator/Indicator.cjs +1 -0
- package/dist/components/indicator/Indicator.js +1 -0
- package/dist/components/indicator/index.cjs +1 -0
- package/dist/components/indicator/index.js +1 -0
- package/dist/components/label/Label.cjs +1 -0
- package/dist/components/label/Label.js +1 -0
- package/dist/components/label/index.cjs +1 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/line-chart/LineChart.cjs +1 -0
- package/dist/components/line-chart/LineChart.js +1 -0
- package/dist/components/line-chart/index.cjs +1 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/modal/Modal.cjs +1 -0
- package/dist/components/modal/Modal.js +1 -0
- package/dist/components/modal/index.cjs +1 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/pagination/Pagination.cjs +1 -0
- package/dist/components/pagination/Pagination.js +1 -0
- package/dist/components/pagination/index.cjs +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pie-chart/PieChart.cjs +1 -0
- package/dist/components/pie-chart/PieChart.js +1 -0
- package/dist/components/pie-chart/index.cjs +1 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/progress-bar/ProgressBar.cjs +1 -0
- package/dist/components/progress-bar/ProgressBar.js +1 -0
- package/dist/components/progress-bar/index.cjs +1 -0
- package/dist/components/progress-bar/index.js +1 -0
- package/dist/components/radio-button/RadioButton.cjs +1 -0
- package/dist/components/radio-button/RadioButton.js +1 -0
- package/dist/components/radio-button/index.cjs +1 -0
- package/dist/components/radio-button/index.js +1 -0
- package/dist/components/scatter-chart/ScatterChart.cjs +1 -0
- package/dist/components/scatter-chart/ScatterChart.js +1 -0
- package/dist/components/scatter-chart/index.cjs +1 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/schema-editor/SchemaEditor.cjs +1 -0
- package/dist/components/schema-editor/SchemaEditor.js +1 -0
- package/dist/components/schema-editor/SchemaEditor.types.cjs +1 -0
- package/dist/components/schema-editor/SchemaEditor.types.js +0 -0
- package/dist/components/schema-editor/canvas/GridLayer.cjs +1 -0
- package/dist/components/schema-editor/canvas/GridLayer.js +1 -0
- package/dist/components/schema-editor/index.cjs +1 -0
- package/dist/components/schema-editor/index.js +1 -0
- package/dist/components/schema-editor/legend/SchemaLegend.cjs +1 -0
- package/dist/components/schema-editor/legend/SchemaLegend.js +1 -0
- package/dist/components/schema-editor/minimap/SchemaMinimap.cjs +1 -0
- package/dist/components/schema-editor/minimap/SchemaMinimap.js +1 -0
- package/dist/components/schema-editor/relations/SchemaRelationRenderer.cjs +1 -0
- package/dist/components/schema-editor/relations/SchemaRelationRenderer.js +1 -0
- package/dist/components/schema-editor/tables/SchemaTableRenderer.cjs +1 -0
- package/dist/components/schema-editor/tables/SchemaTableRenderer.js +1 -0
- package/dist/components/schema-editor/toolbar/SchemaToolbar.cjs +1 -0
- package/dist/components/schema-editor/toolbar/SchemaToolbar.js +1 -0
- package/dist/components/schema-editor/utils/auto-layout.cjs +1 -0
- package/dist/components/schema-editor/utils/auto-layout.js +1 -0
- package/dist/components/schema-editor/utils/geometry.cjs +1 -0
- package/dist/components/schema-editor/utils/geometry.js +1 -0
- package/dist/components/schema-editor/utils/schema-helpers.cjs +1 -0
- package/dist/components/schema-editor/utils/schema-helpers.js +1 -0
- package/dist/components/schema-editor/utils/sql-export.cjs +9 -0
- package/dist/components/schema-editor/utils/sql-export.js +9 -0
- package/dist/components/select/Select.cjs +1 -0
- package/dist/components/select/Select.js +1 -0
- package/dist/components/select/index.cjs +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/sidebar/Sidebar.cjs +1 -0
- package/dist/components/sidebar/Sidebar.js +1 -0
- package/dist/components/sidebar/index.cjs +1 -0
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/skeleton/Skeleton.cjs +1 -0
- package/dist/components/skeleton/Skeleton.js +1 -0
- package/dist/components/skeleton/index.cjs +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/slider/Slider.cjs +1 -0
- package/dist/components/slider/Slider.js +1 -0
- package/dist/components/slider/index.cjs +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/sparkline/Sparkline.cjs +1 -0
- package/dist/components/sparkline/Sparkline.js +1 -0
- package/dist/components/sparkline/index.cjs +1 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/stat-card/StatCard.cjs +1 -0
- package/dist/components/stat-card/StatCard.js +1 -0
- package/dist/components/stat-card/StatCardGroup.cjs +1 -0
- package/dist/components/stat-card/StatCardGroup.js +1 -0
- package/dist/components/stat-card/index.cjs +1 -0
- package/dist/components/stat-card/index.js +1 -0
- package/dist/components/table/Table.cjs +1 -0
- package/dist/components/table/Table.js +1 -0
- package/dist/components/table/TableBody.cjs +1 -0
- package/dist/components/table/TableBody.js +1 -0
- package/dist/components/table/TableCell.cjs +1 -0
- package/dist/components/table/TableCell.js +1 -0
- package/dist/components/table/TableHeader.cjs +1 -0
- package/dist/components/table/TableHeader.js +1 -0
- package/dist/components/table/TableHeaderCell.cjs +1 -0
- package/dist/components/table/TableHeaderCell.js +1 -0
- package/dist/components/table/TableRow.cjs +1 -0
- package/dist/components/table/TableRow.js +1 -0
- package/dist/components/table/index.cjs +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/Tabs.cjs +1 -0
- package/dist/components/tabs/Tabs.js +1 -0
- package/dist/components/tabs/TabsContent.cjs +1 -0
- package/dist/components/tabs/TabsContent.js +1 -0
- package/dist/components/tabs/TabsContext.cjs +1 -0
- package/dist/components/tabs/TabsContext.js +1 -0
- package/dist/components/tabs/TabsList.cjs +1 -0
- package/dist/components/tabs/TabsList.js +1 -0
- package/dist/components/tabs/TabsTrigger.cjs +1 -0
- package/dist/components/tabs/TabsTrigger.js +1 -0
- package/dist/components/tabs/index.cjs +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/toast/Toast.cjs +1 -0
- package/dist/components/toast/Toast.js +1 -0
- package/dist/components/toast/index.cjs +1 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/tooltip/Tooltip.cjs +1 -0
- package/dist/components/tooltip/Tooltip.js +1 -0
- package/dist/components/tooltip/index.cjs +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/waterfall-chart/WaterfallChart.cjs +1 -0
- package/dist/components/waterfall-chart/WaterfallChart.js +1 -0
- package/dist/components/waterfall-chart/index.cjs +1 -0
- package/dist/components/waterfall-chart/index.js +1 -0
- package/dist/components/wizard/Wizard.cjs +1 -0
- package/dist/components/wizard/Wizard.js +1 -0
- package/dist/components/wizard/index.cjs +1 -0
- package/dist/components/wizard/index.js +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.cjs +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.js +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.types.cjs +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.types.js +0 -0
- package/dist/components/workflow-editor/canvas/GridLayer.cjs +1 -0
- package/dist/components/workflow-editor/canvas/GridLayer.js +1 -0
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.cjs +1 -0
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.js +1 -0
- package/dist/components/workflow-editor/index.cjs +1 -0
- package/dist/components/workflow-editor/index.js +1 -0
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.cjs +1 -0
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.js +1 -0
- package/dist/components/workflow-editor/toolbar/WorkflowToolbar.cjs +1 -0
- package/dist/components/workflow-editor/toolbar/WorkflowToolbar.js +1 -0
- package/dist/components/workflow-editor/utils/geometry.cjs +1 -0
- package/dist/components/workflow-editor/utils/geometry.js +1 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDialogA11y.cjs +1 -0
- package/dist/hooks/useDialogA11y.js +1 -0
- package/dist/index.cjs +1 -32
- package/dist/index.d.cts +19 -6
- package/dist/index.d.ts +19 -6
- 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 +125 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BoxPlot as x}from"./BoxPlot.js";export{x as BoxPlot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var y=(n,s)=>{for(var l in s)m(n,l,{get:s[l],enumerable:!0})},k=(n,s,l,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of b(s))!N.call(n,r)&&r!==l&&m(n,r,{get:()=>s[r],enumerable:!(i=h(s,r))||i.enumerable});return n};var C=n=>k(m({},"__esModule",{value:!0}),n);var R={};y(R,{Breadcrumb:()=>B});module.exports=C(R);var t=require("../../lib/cn.cjs"),e=require("react/jsx-runtime"),v={sm:"text-xs",md:"text-sm",lg:"text-base"};function B({items:n,separator:s="/",size:l="md",maxItems:i,itemColor:r="text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100",activeColor:f="text-gray-700 font-medium dark:text-gray-200",separatorColor:p="text-gray-400 dark:text-gray-500",className:g,...u}){let d=n,x=!1;if(i&&n.length>i){x=!0;let a=n[0],o=n.slice(-(i-1));d=[a,...o]}return(0,e.jsx)("nav",{"aria-label":"Breadcrumb",className:(0,t.cn)("inline-flex items-center",v[l],g),...u,children:(0,e.jsx)("ol",{className:"inline-flex items-center space-x-1 md:space-x-2",children:d.map((a,o)=>{let c=o===d.length-1;return(0,e.jsxs)("li",{className:"inline-flex items-center",children:[x&&o===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:(0,t.cn)("mx-1 select-none",p),children:"..."}),(0,e.jsx)("span",{className:(0,t.cn)("mx-1 select-none",p),"aria-hidden":"true",children:s})]}),a.href||a.onClick?(0,e.jsxs)("a",{href:a.href,onClick:a.onClick,className:(0,t.cn)("inline-flex items-center gap-1.5 transition-colors",c?f:r),"aria-current":c?"page":void 0,children:[a.icon&&(0,e.jsx)("span",{className:"inline-flex","aria-hidden":"true",children:a.icon}),(0,e.jsx)("span",{children:a.label})]}):(0,e.jsxs)("span",{className:(0,t.cn)("inline-flex items-center gap-1.5",c?f:r),"aria-current":c?"page":void 0,children:[a.icon&&(0,e.jsx)("span",{className:"inline-flex","aria-hidden":"true",children:a.icon}),(0,e.jsx)("span",{children:a.label})]}),!c&&(0,e.jsx)("span",{className:(0,t.cn)("mx-2 select-none",p),"aria-hidden":"true",children:s})]},a.href??a.label)})})})}0&&(module.exports={Breadcrumb});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as n}from"../../lib/cn.js";import{Fragment as b,jsx as a,jsxs as l}from"react/jsx-runtime";var h={sm:"text-xs",md:"text-sm",lg:"text-base"};function k({items:r,separator:p="/",size:x="md",maxItems:i,itemColor:d="text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100",activeColor:m="text-gray-700 font-medium dark:text-gray-200",separatorColor:c="text-gray-400 dark:text-gray-500",className:g,...u}){let o=r,f=!1;if(i&&r.length>i){f=!0;let e=r[0],t=r.slice(-(i-1));o=[e,...t]}return a("nav",{"aria-label":"Breadcrumb",className:n("inline-flex items-center",h[x],g),...u,children:a("ol",{className:"inline-flex items-center space-x-1 md:space-x-2",children:o.map((e,t)=>{let s=t===o.length-1;return l("li",{className:"inline-flex items-center",children:[f&&t===1&&l(b,{children:[a("span",{className:n("mx-1 select-none",c),children:"..."}),a("span",{className:n("mx-1 select-none",c),"aria-hidden":"true",children:p})]}),e.href||e.onClick?l("a",{href:e.href,onClick:e.onClick,className:n("inline-flex items-center gap-1.5 transition-colors",s?m:d),"aria-current":s?"page":void 0,children:[e.icon&&a("span",{className:"inline-flex","aria-hidden":"true",children:e.icon}),a("span",{children:e.label})]}):l("span",{className:n("inline-flex items-center gap-1.5",s?m:d),"aria-current":s?"page":void 0,children:[e.icon&&a("span",{className:"inline-flex","aria-hidden":"true",children:e.icon}),a("span",{children:e.label})]}),!s&&a("span",{className:n("mx-2 select-none",c),"aria-hidden":"true",children:p})]},e.href??e.label)})})})}export{k as Breadcrumb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var u=(e,r)=>{for(var o in r)a(e,o,{get:r[o],enumerable:!0})},B=(e,r,o,b)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of p(r))!t.call(e,m)&&m!==o&&a(e,m,{get:()=>r[m],enumerable:!(b=d(r,m))||b.enumerable});return e};var f=e=>B(a({},"__esModule",{value:!0}),e);var x={};u(x,{Breadcrumb:()=>c.Breadcrumb});module.exports=f(x);var c=require("./Breadcrumb.cjs");0&&(module.exports={Breadcrumb});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Breadcrumb as m}from"./Breadcrumb.js";export{m as Breadcrumb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var ee=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var pe=(i,l)=>{for(var a in l)ee(i,a,{get:l[a],enumerable:!0})},ye=(i,l,a,e)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of fe(l))!be.call(i,s)&&s!==a&&ee(i,s,{get:()=>l[s],enumerable:!(e=he(l,s))||e.enumerable});return i};var ke=i=>ye(ee({},"__esModule",{value:!0}),i);var Ve={};pe(Ve,{BulletChart:()=>Se});module.exports=ke(Ve);var g=require("react"),se=require("../../lib/i18n.cjs"),te=require("../chart/ChartAxis.cjs"),ue=require("../chart/ChartContainer.cjs"),me=require("../chart/ChartTableView.cjs"),ce=require("../chart/ChartTooltip.cjs"),ge=require("../chart/palette.cjs"),I=require("../chart/utils/data.cjs"),X=require("../chart/utils/format.cjs"),ne=require("../chart/utils/path.cjs"),L=require("../chart/utils/scales.cjs"),ae=require("../chart/utils/text.cjs"),K=require("../chart/utils/ticks.cjs"),n=require("react/jsx-runtime"),Ce=22,xe=.42,oe=3,ie=8,ve=12,Re=["fill-gray-300 dark:fill-gray-500","fill-gray-200 dark:fill-gray-600","fill-gray-100 dark:fill-gray-700","fill-gray-50 dark:fill-gray-800"],Ne=(0,g.memo)(function({rows:l,color:a}){return(0,n.jsx)("g",{children:l.map(e=>(0,n.jsxs)("g",{children:[e.bands.map(s=>(0,n.jsx)("path",{d:s.d,className:s.className,fill:s.fill},s.key)),e.measure?(0,n.jsx)("path",{d:e.measure,fill:a}):null,e.target?(0,n.jsx)("line",{x1:e.target.x,y1:e.target.y1,x2:e.target.x,y2:e.target.y2,strokeWidth:2,strokeLinecap:"round",className:"stroke-gray-900 dark:stroke-white"}):null,e.label?(0,n.jsx)("text",{x:e.label.x,y:e.label.y,dominantBaseline:"middle",className:"fill-gray-700 text-[11px] font-medium [font-variant-numeric:tabular-nums] dark:fill-gray-200",children:e.label.text}):null]},e.key))})});function Te({width:i,height:l,rows:a,x:e,size:s,sharedDomain:h,showValues:V,trackSize:W,rangeColors:z,color:U,tooltip:B,plotLabel:q,formatValue:w,locale:D,onRowClick:G}){let[u,k]=(0,g.useState)(null),r=(0,g.useMemo)(()=>{let c=a.map(t=>t.label),x=V?a.map(t=>t.formattedValue):[],m={top:6,right:V?(0,ae.widestLabel)(x)+ie*2:8,bottom:h?26+(e.label?16:0):6,left:e.hidden?8:e.height??(0,ae.widestLabel)(c)+ve},p=Math.max(0,i-m.left-m.right),H=Math.max(0,l-m.top-m.bottom),f=(0,L.createBandScale)(a.map((t,d)=>d),[0,H],{paddingInner:.34}),v=Math.min(W??Ce,f.bandwidth),O=Math.max(3,v*xe),F=z??Re,Y=z!==void 0,P=a.map((t,d)=>{let $=Math.max(0,t.value??0,t.target??0,...t.ranges.length>0?t.ranges:[0]),A=h??(t.ranges.length>0?[0,$]:(0,K.niceDomain)(0,$,4)),R=(0,L.createLinearScale)(A,[0,p]),o=f(d)+(f.bandwidth-v)/2,N=o+v/2,T=t.ranges.length>0?[...t.ranges].sort((M,b)=>M-b):[A[1]],y=A[0],S=T.map((M,b)=>{let re=R(y),de=R(Math.max(y,M));y=M;let le=F[Math.min(b,F.length-1)];return{key:`${d}-${b}`,d:(0,ne.buildBarPath)({x:re,y:o,width:Math.max(0,de-re),height:v,radius:0}),className:Y?void 0:le,fill:Y?le:void 0}}),j=t.value===null?null:(0,ne.buildBarPath)({x:R(A[0]),y:N-O/2,width:Math.max(0,R(t.value)-R(A[0])),height:O,radius:2,round:"right"});return{key:`${d}`,bands:S,measure:j,target:t.target===null?null:{x:R(t.target),y1:o-oe,y2:o+v+oe},label:V?{x:p+ie,y:N,text:t.formattedValue}:null,top:f(d),height:f.bandwidth}}),E=e.hidden?[]:a.map((t,d)=>({value:t.x,offset:f.center(d),label:t.label})),_=h?(0,K.niceTicks)(h[0],h[1],5).map(t=>({value:t,offset:(0,L.createLinearScale)(h,[0,p])(t),label:w(t)})):[];return{margin:m,innerWidth:p,innerHeight:H,band:f,rendered:P,categoryTicks:E,valueTicks:_,centers:a.map((t,d)=>f.center(d))}},[a,e,i,l,h,V,W,z,w]),J=(0,g.useCallback)(c=>{if(B===!1||a.length===0)return;let x=c.currentTarget.getBoundingClientRect(),m=c.clientY-x.top-r.margin.top;k((0,L.nearestIndex)(r.centers,m))},[B,a.length,r.margin.top,r.centers]),Q=(0,g.useCallback)(c=>{if(a.length===0)return;let x=a.length-1,m=u??0,p=c.key==="ArrowDown"?Math.min(x,m+1):c.key==="ArrowUp"?Math.max(0,m-1):c.key==="Home"?0:c.key==="End"?x:c.key==="Escape"?null:void 0;p!==void 0&&(c.preventDefault(),k(p))},[a.length,u]),Z=(0,g.useCallback)(()=>{!G||u===null||G(a[u])},[G,u,a]),C=u===null?null:a[u];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{width:i,height:l,role:"img","aria-label":q??a.map(c=>c.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:J,onPointerLeave:()=>k(null),onKeyDown:Q,onBlur:()=>k(null),onClick:Z,children:[(0,n.jsxs)("g",{transform:`translate(${r.margin.left}, ${r.margin.top})`,children:[u!==null&&r.rendered[u]?(0,n.jsx)("rect",{x:-4,y:r.rendered[u].top,width:r.innerWidth+8,height:r.rendered[u].height,rx:4,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,(0,n.jsx)(Ne,{rows:r.rendered,color:U})]}),(0,n.jsx)("g",{transform:`translate(${r.margin.left}, ${r.margin.top})`,children:e.hidden?null:(0,n.jsx)(te.ChartAxis,{orientation:"left",ticks:r.categoryTicks,length:r.innerHeight,showLine:!1,tickSize:0,size:s})}),h?(0,n.jsx)("g",{transform:`translate(${r.margin.left}, ${r.margin.top+r.innerHeight})`,children:(0,n.jsx)(te.ChartAxis,{orientation:"bottom",ticks:r.valueTicks,length:r.innerWidth,label:e.label,size:s})}):null]}),C&&u!==null&&B!==!1?(0,n.jsx)(ce.ChartTooltip,{x:r.margin.left+r.innerWidth/2,y:r.margin.top+r.centers[u],containerWidth:i,children:typeof B=="function"?B(C):(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:C.label}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"h-0.5 w-3 shrink-0 rounded-full",style:{backgroundColor:U},"aria-hidden":"true"}),(0,n.jsx)("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:C.formattedValue}),C.attainment!==null?(0,n.jsx)("span",{className:"text-gray-500 [font-variant-numeric:tabular-nums] dark:text-gray-400",children:(0,X.formatPercent)(C.attainment,{locale:D})}):null]})]})}):null]})}function Se({data:i,x:l,value:a,target:e,ranges:s,domain:h,normalize:V="row",showValues:W=!0,trackSize:z,rangeColors:U,color:B,height:q,width:w,size:D="md",tooltip:G=!0,tableView:u=!1,title:k,description:r,loading:J=!1,emptyState:Q,error:Z=!1,errorState:C,onRetry:c,actions:x,locale:m,plotLabel:p,valueLabel:H,targetLabel:f,format:v,onRowClick:O,className:F,...Y}){let P=(0,se.useUILabels)(),E=(0,g.useMemo)(()=>v??(o=>(0,X.formatAuto)(o,m)),[v,m]),_=(0,g.useMemo)(()=>l.format??(o=>(0,X.formatXValue)(o,m)),[l.format,m]),t=(0,g.useMemo)(()=>i.map((o,N)=>{let T=(0,I.readXValue)(o,l.key,N),y=(0,I.readNumber)(o,a),S=e?(0,I.readNumber)(o,e):null,j=s?o[s]:void 0,M=Array.isArray(j)?j.map(b=>typeof b=="number"?b:Number(b)).filter(b=>Number.isFinite(b)):[];return{index:N,x:T,label:_(T,N),value:y,target:S,ranges:M,formattedValue:y===null?"\u2014":E(y),formattedTarget:S===null?"\u2014":E(S),attainment:y===null||S===null||S===0?null:y/S,datum:o}}),[i,l.key,a,e,s,E,_]),d=(0,g.useMemo)(()=>{if(h)return h;if(V!=="shared")return null;let o=t.reduce((N,T)=>Math.max(N,T.value??0,T.target??0,...T.ranges),0);return(0,K.niceDomain)(0,o,5)},[h,V,t]),$=q??Math.max(72,t.length*34+(d?30:12)),A=(0,g.useMemo)(()=>[{key:a,label:H??P.chartValue},...e?[{key:e,label:f??P.chartTarget}]:[]],[a,e,H,f,P.chartValue,P.chartTarget]),R=B??(0,ge.getSeriesColor)(0);return(0,n.jsx)(ue.ChartContainer,{title:k,description:r,height:$,width:w,size:D,loading:J,empty:t.length===0,emptyState:Q,error:Z,errorState:C,onRetry:c,actions:x,tableView:u,table:u?(0,n.jsx)(me.ChartTableView,{data:i,series:A,xKey:l.key,xLabel:l.label??l.key,formatX:_,formatValue:E,caption:typeof k=="string"?k:void 0}):void 0,className:F,...Y,children:({width:o})=>(0,n.jsx)(Te,{width:o,height:$,rows:t,x:l,size:D,sharedDomain:d,showValues:W,trackSize:z,rangeColors:U,color:R,tooltip:G,plotLabel:p,formatValue:E,locale:m,onRowClick:O})})}0&&(module.exports={BulletChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as ue,useCallback as J,useMemo as P,useState as me}from"react";import{useUILabels as ce}from"../../lib/i18n.js";import{ChartAxis as ee}from"../chart/ChartAxis.js";import{ChartContainer as ge}from"../chart/ChartContainer.js";import{ChartTableView as de}from"../chart/ChartTableView.js";import{ChartTooltip as he}from"../chart/ChartTooltip.js";import{getSeriesColor as fe}from"../chart/palette.js";import{readNumber as te,readXValue as be}from"../chart/utils/data.js";import{formatAuto as pe,formatPercent as ye,formatXValue as ke}from"../chart/utils/format.js";import{buildBarPath as ne}from"../chart/utils/path.js";import{createBandScale as Ce,createLinearScale as ae,nearestIndex as xe}from"../chart/utils/scales.js";import{widestLabel as re}from"../chart/utils/text.js";import{niceDomain as ie,niceTicks as ve}from"../chart/utils/ticks.js";import{Fragment as Ee,jsx as r,jsxs as M}from"react/jsx-runtime";var Re=22,Ne=.42,le=3,oe=8,Te=12,Se=["fill-gray-300 dark:fill-gray-500","fill-gray-200 dark:fill-gray-600","fill-gray-100 dark:fill-gray-700","fill-gray-50 dark:fill-gray-800"],Ve=ue(function({rows:u,color:a}){return r("g",{children:u.map(t=>M("g",{children:[t.bands.map(g=>r("path",{d:g.d,className:g.className,fill:g.fill},g.key)),t.measure?r("path",{d:t.measure,fill:a}):null,t.target?r("line",{x1:t.target.x,y1:t.target.y1,x2:t.target.x,y2:t.target.y2,strokeWidth:2,strokeLinecap:"round",className:"stroke-gray-900 dark:stroke-white"}):null,t.label?r("text",{x:t.label.x,y:t.label.y,dominantBaseline:"middle",className:"fill-gray-700 text-[11px] font-medium [font-variant-numeric:tabular-nums] dark:fill-gray-200",children:t.label.text}):null]},t.key))})});function Be({width:f,height:u,rows:a,x:t,size:g,sharedDomain:c,showValues:S,trackSize:$,rangeColors:X,color:I,tooltip:V,plotLabel:F,formatValue:K,locale:W,onRowClick:z}){let[o,y]=me(null),n=P(()=>{let s=a.map(e=>e.label),C=S?a.map(e=>e.formattedValue):[],i={top:6,right:S?re(C)+oe*2:8,bottom:c?26+(t.label?16:0):6,left:t.hidden?8:t.height??re(s)+Te},b=Math.max(0,f-i.left-i.right),G=Math.max(0,u-i.top-i.bottom),d=Ce(a.map((e,m)=>m),[0,G],{paddingInner:.34}),x=Math.min($??Re,d.bandwidth),U=Math.max(3,x*Ne),w=X??Se,D=X!==void 0,A=a.map((e,m)=>{let _=Math.max(0,e.value??0,e.target??0,...e.ranges.length>0?e.ranges:[0]),E=c??(e.ranges.length>0?[0,_]:ie(0,_,4)),v=ae(E,[0,b]),l=d(m)+(d.bandwidth-x)/2,R=l+x/2,N=e.ranges.length>0?[...e.ranges].sort((L,h)=>L-h):[E[1]],p=E[0],T=N.map((L,h)=>{let Q=v(p),se=v(Math.max(p,L));p=L;let Z=w[Math.min(h,w.length-1)];return{key:`${m}-${h}`,d:ne({x:Q,y:l,width:Math.max(0,se-Q),height:x,radius:0}),className:D?void 0:Z,fill:D?Z:void 0}}),O=e.value===null?null:ne({x:v(E[0]),y:R-U/2,width:Math.max(0,v(e.value)-v(E[0])),height:U,radius:2,round:"right"});return{key:`${m}`,bands:T,measure:O,target:e.target===null?null:{x:v(e.target),y1:l-le,y2:l+x+le},label:S?{x:b+oe,y:R,text:e.formattedValue}:null,top:d(m),height:d.bandwidth}}),B=t.hidden?[]:a.map((e,m)=>({value:e.x,offset:d.center(m),label:e.label})),H=c?ve(c[0],c[1],5).map(e=>({value:e,offset:ae(c,[0,b])(e),label:K(e)})):[];return{margin:i,innerWidth:b,innerHeight:G,band:d,rendered:A,categoryTicks:B,valueTicks:H,centers:a.map((e,m)=>d.center(m))}},[a,t,f,u,c,S,$,X,K]),Y=J(s=>{if(V===!1||a.length===0)return;let C=s.currentTarget.getBoundingClientRect(),i=s.clientY-C.top-n.margin.top;y(xe(n.centers,i))},[V,a.length,n.margin.top,n.centers]),j=J(s=>{if(a.length===0)return;let C=a.length-1,i=o??0,b=s.key==="ArrowDown"?Math.min(C,i+1):s.key==="ArrowUp"?Math.max(0,i-1):s.key==="Home"?0:s.key==="End"?C:s.key==="Escape"?null:void 0;b!==void 0&&(s.preventDefault(),y(b))},[a.length,o]),q=J(()=>{!z||o===null||z(a[o])},[z,o,a]),k=o===null?null:a[o];return M(Ee,{children:[M("svg",{width:f,height:u,role:"img","aria-label":F??a.map(s=>s.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:Y,onPointerLeave:()=>y(null),onKeyDown:j,onBlur:()=>y(null),onClick:q,children:[M("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[o!==null&&n.rendered[o]?r("rect",{x:-4,y:n.rendered[o].top,width:n.innerWidth+8,height:n.rendered[o].height,rx:4,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,r(Ve,{rows:n.rendered,color:I})]}),r("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:t.hidden?null:r(ee,{orientation:"left",ticks:n.categoryTicks,length:n.innerHeight,showLine:!1,tickSize:0,size:g})}),c?r("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:r(ee,{orientation:"bottom",ticks:n.valueTicks,length:n.innerWidth,label:t.label,size:g})}):null]}),k&&o!==null&&V!==!1?r(he,{x:n.margin.left+n.innerWidth/2,y:n.margin.top+n.centers[o],containerWidth:f,children:typeof V=="function"?V(k):M("div",{className:"flex flex-col gap-1",children:[r("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:k.label}),M("div",{className:"flex items-center gap-2",children:[r("span",{className:"h-0.5 w-3 shrink-0 rounded-full",style:{backgroundColor:I},"aria-hidden":"true"}),r("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:k.formattedValue}),k.attainment!==null?r("span",{className:"text-gray-500 [font-variant-numeric:tabular-nums] dark:text-gray-400",children:ye(k.attainment,{locale:W})}):null]})]})}):null]})}function Ue({data:f,x:u,value:a,target:t,ranges:g,domain:c,normalize:S="row",showValues:$=!0,trackSize:X,rangeColors:I,color:V,height:F,width:K,size:W="md",tooltip:z=!0,tableView:o=!1,title:y,description:n,loading:Y=!1,emptyState:j,error:q=!1,errorState:k,onRetry:s,actions:C,locale:i,plotLabel:b,valueLabel:G,targetLabel:d,format:x,onRowClick:U,className:w,...D}){let A=ce(),B=P(()=>x??(l=>pe(l,i)),[x,i]),H=P(()=>u.format??(l=>ke(l,i)),[u.format,i]),e=P(()=>f.map((l,R)=>{let N=be(l,u.key,R),p=te(l,a),T=t?te(l,t):null,O=g?l[g]:void 0,L=Array.isArray(O)?O.map(h=>typeof h=="number"?h:Number(h)).filter(h=>Number.isFinite(h)):[];return{index:R,x:N,label:H(N,R),value:p,target:T,ranges:L,formattedValue:p===null?"\u2014":B(p),formattedTarget:T===null?"\u2014":B(T),attainment:p===null||T===null||T===0?null:p/T,datum:l}}),[f,u.key,a,t,g,B,H]),m=P(()=>{if(c)return c;if(S!=="shared")return null;let l=e.reduce((R,N)=>Math.max(R,N.value??0,N.target??0,...N.ranges),0);return ie(0,l,5)},[c,S,e]),_=F??Math.max(72,e.length*34+(m?30:12)),E=P(()=>[{key:a,label:G??A.chartValue},...t?[{key:t,label:d??A.chartTarget}]:[]],[a,t,G,d,A.chartValue,A.chartTarget]),v=V??fe(0);return r(ge,{title:y,description:n,height:_,width:K,size:W,loading:Y,empty:e.length===0,emptyState:j,error:q,errorState:k,onRetry:s,actions:C,tableView:o,table:o?r(de,{data:f,series:E,xKey:u.key,xLabel:u.label??u.key,formatX:H,formatValue:B,caption:typeof y=="string"?y:void 0}):void 0,className:w,...D,children:({width:l})=>r(Be,{width:l,height:_,rows:e,x:u,size:W,sharedDomain:m,showValues:$,trackSize:X,rangeColors:I,color:v,tooltip:z,plotLabel:b,formatValue:B,locale:i,onRowClick:U})})}export{Ue as BulletChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var C=(l,t)=>{for(var e in t)o(l,e,{get:t[e],enumerable:!0})},f=(l,t,e,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of a(t))!h.call(l,r)&&r!==e&&o(l,r,{get:()=>t[r],enumerable:!(p=B(t,r))||p.enumerable});return l};var m=l=>f(o({},"__esModule",{value:!0}),l);var x={};C(x,{BulletChart:()=>u.BulletChart});module.exports=m(x);var u=require("./BulletChart.cjs");0&&(module.exports={BulletChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BulletChart as r}from"./BulletChart.js";export{r as BulletChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var z=(s,t)=>{for(var o in t)u(s,o,{get:t[o],enumerable:!0})},A=(s,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of k(t))!$.call(s,n)&&n!==o&&u(s,n,{get:()=>t[n],enumerable:!(r=S(t,n))||r.enumerable});return s};var D=s=>A(u({},"__esModule",{value:!0}),s);var j={};z(j,{Button:()=>V});module.exports=D(j);var a=require("../../lib/cn.cjs"),e=require("react/jsx-runtime");function H({className:s}){return(0,e.jsxs)("svg",{className:(0,a.cn)("animate-spin",s),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,e.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,e.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}var I={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-2.5 text-base gap-2",xl:"px-6 py-3 text-lg gap-2.5"},M={sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"},c={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5",xl:"h-6 w-6"},O={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function V({label:s,children:t,onClick:o,disabled:r=!1,className:n,type:h="button",size:l="md",loading:p=!1,leftIcon:m,rightIcon:g,icon:b,fullWidth:y=!1,rounded:N="lg",bgColor:w="bg-blue-600 hover:bg-blue-700",textColor:C="text-white",focusColor:i="focus:ring-blue-300",selected:f=!1,value:v,showFocusOnClick:d=!1,...R}){let B=r||p,x=b!==void 0&&!t&&!s,P=(0,a.cn)("inline-flex items-center justify-center font-medium transition-colors focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",d?"focus:ring-4":"focus-visible:ring-4"),W=(0,a.cn)(f?"bg-blue-700 text-white ring-2 ring-blue-500":w,!f&&C,i&&d&&`focus:ring-4 ${i}`,i&&!d&&`focus-visible:ring-4 ${i}`);return(0,e.jsx)("button",{type:h,onClick:o,disabled:B,"data-value":v,className:(0,a.cn)(P,x?M[l]:I[l],O[N],W,y&&"w-full",n),...R,children:p?(0,e.jsx)(H,{className:c[l]}):x?(0,e.jsx)("span",{className:c[l],children:b}):(0,e.jsxs)(e.Fragment,{children:[m&&(0,e.jsx)("span",{className:c[l],children:m}),t??s,g&&(0,e.jsx)("span",{className:c[l],children:g})]})})}0&&(module.exports={Button});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as l}from"../../lib/cn.js";import{Fragment as A,jsx as e,jsxs as g}from"react/jsx-runtime";function S({className:t}){return g("svg",{className:l("animate-spin",t),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}var k={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-2.5 text-base gap-2",xl:"px-6 py-3 text-lg gap-2.5"},$={sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"},o={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5",xl:"h-6 w-6"},z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function H({label:t,children:r,onClick:b,disabled:f=!1,className:x,type:h="button",size:s="md",loading:i=!1,leftIcon:c,rightIcon:d,icon:u,fullWidth:y=!1,rounded:N="lg",bgColor:w="bg-blue-600 hover:bg-blue-700",textColor:C="text-white",focusColor:n="focus:ring-blue-300",selected:p=!1,value:v,showFocusOnClick:a=!1,...R}){let B=f||i,m=u!==void 0&&!r&&!t,P=l("inline-flex items-center justify-center font-medium transition-colors focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",a?"focus:ring-4":"focus-visible:ring-4"),W=l(p?"bg-blue-700 text-white ring-2 ring-blue-500":w,!p&&C,n&&a&&`focus:ring-4 ${n}`,n&&!a&&`focus-visible:ring-4 ${n}`);return e("button",{type:h,onClick:b,disabled:B,"data-value":v,className:l(P,m?$[s]:k[s],z[N],W,y&&"w-full",x),...R,children:i?e(S,{className:o[s]}):m?e("span",{className:o[s],children:u}):g(A,{children:[c&&e("span",{className:o[s],children:c}),r??t,d&&e("span",{className:o[s],children:d})]})})}export{H as Button};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var x=(o,t)=>{for(var p in t)e(o,p,{get:t[p],enumerable:!0})},s=(o,t,p,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!m.call(o,r)&&r!==p&&e(o,r,{get:()=>t[r],enumerable:!(n=B(t,r))||n.enumerable});return o};var y=o=>s(e({},"__esModule",{value:!0}),o);var P={};x(P,{Button:()=>u.Button});module.exports=y(P);var u=require("./Button.cjs");0&&(module.exports={Button});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as r}from"./Button.js";export{r as Button};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var y=Object.create;var c=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var n in e)c(t,n,{get:e[n],enumerable:!0})},z=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of C(e))!N.call(t,r)&&r!==n&&c(t,r,{get:()=>e[r],enumerable:!(s=R(e,r))||s.enumerable});return t};var b=(t,e,n)=>(n=t!=null?y(M(t)):{},z(e||!t||!t.__esModule?c(n,"default",{value:t,enumerable:!0}):n,t)),A=t=>z(c({},"__esModule",{value:!0}),t);var H={};P(H,{ButtonGroup:()=>G});module.exports=A(H);var p=b(require("react"),1),u=require("../../lib/cn.cjs"),h=require("react/jsx-runtime");function G({children:t,orientation:e="horizontal",size:n,fullWidth:s=!1,selectedValue:r,onChange:i,className:B}){let m=p.default.Children.toArray(t).filter(o=>p.default.isValidElement(o)&&typeof o.type!="string"),g=(o,a)=>l=>{o!==void 0&&i&&i(o),a&&a(l)};return(0,h.jsx)("div",{className:(0,u.cn)("inline-flex",e==="horizontal"?"flex-row":"flex-col",s&&"w-full",B),role:"group",children:m.map((o,a)=>{let l=a===0,d=a===m.length-1,f=!l&&!d,v=o.props.value,E=r!==void 0&&v===r,x=(0,u.cn)(e==="horizontal"&&l&&"rounded-r-none",e==="horizontal"&&d&&"rounded-l-none",e==="horizontal"&&f&&"rounded-none",e==="horizontal"&&!l&&"-ml-px",e==="vertical"&&l&&"rounded-b-none",e==="vertical"&&d&&"rounded-t-none",e==="vertical"&&f&&"rounded-none",e==="vertical"&&!l&&"-mt-px",s&&"flex-1");return p.default.cloneElement(o,{...o.props,size:n??o.props.size,selected:E||o.props.selected,onClick:g(v,o.props.onClick),className:(0,u.cn)(x,o.props.className)})})})}0&&(module.exports={ButtonGroup});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import l from"react";import{cn as s}from"../../lib/cn.js";import{jsx as g}from"react/jsx-runtime";function R({children:m,orientation:t="horizontal",size:f,fullWidth:a=!1,selectedValue:c,onChange:p,className:v}){let u=l.Children.toArray(m).filter(e=>l.isValidElement(e)&&typeof e.type!="string"),z=(e,n)=>o=>{e!==void 0&&p&&p(e),n&&n(o)};return g("div",{className:s("inline-flex",t==="horizontal"?"flex-row":"flex-col",a&&"w-full",v),role:"group",children:u.map((e,n)=>{let o=n===0,r=n===u.length-1,d=!o&&!r,i=e.props.value,h=c!==void 0&&i===c,B=s(t==="horizontal"&&o&&"rounded-r-none",t==="horizontal"&&r&&"rounded-l-none",t==="horizontal"&&d&&"rounded-none",t==="horizontal"&&!o&&"-ml-px",t==="vertical"&&o&&"rounded-b-none",t==="vertical"&&r&&"rounded-t-none",t==="vertical"&&d&&"rounded-none",t==="vertical"&&!o&&"-mt-px",a&&"flex-1");return l.cloneElement(e,{...e.props,size:f??e.props.size,selected:h||e.props.selected,onClick:z(i,e.props.onClick),className:s(B,e.props.className)})})})}export{R as ButtonGroup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var m=(t,o)=>{for(var p in o)u(t,p,{get:o[p],enumerable:!0})},x=(t,o,p,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of G(o))!f.call(t,r)&&r!==p&&u(t,r,{get:()=>o[r],enumerable:!(e=B(o,r))||e.enumerable});return t};var s=t=>x(u({},"__esModule",{value:!0}),t);var y={};m(y,{ButtonGroup:()=>n.ButtonGroup});module.exports=s(y);var n=require("./ButtonGroup.cjs");0&&(module.exports={ButtonGroup});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ButtonGroup as r}from"./ButtonGroup.js";export{r as ButtonGroup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var le=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var Qe=Object.prototype.hasOwnProperty;var Xe=(e,a)=>{for(var s in a)le(e,s,{get:a[s],enumerable:!0})},Ze=(e,a,s,F)=>{if(a&&typeof a=="object"||typeof a=="function")for(let D of Je(a))!Qe.call(e,D)&&D!==s&&le(e,D,{get:()=>a[D],enumerable:!(F=qe(a,D))||F.enumerable});return e};var et=e=>Ze(le({},"__esModule",{value:!0}),e);var gt={};Xe(gt,{Calendar:()=>ct});module.exports=et(gt);var l=require("react"),c=require("../../lib/cn.cjs"),n=require("react/jsx-runtime"),tt=10080*60*1e3;function g(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function z(e){return new Date(e.getFullYear(),e.getMonth(),1)}function T(e,a){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+a)}function x(e,a){return new Date(e.getFullYear(),e.getMonth()+a,1)}function ie(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function N(e,a){return!e||!a?!1:e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function se(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()}function B(e,a){return e.getFullYear()*12+e.getMonth()-(a.getFullYear()*12+a.getMonth())}function q(e){let a=`${e.getMonth()+1}`.padStart(2,"0"),s=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${a}-${s}`}function at(e){let a=g(e);a.setDate(a.getDate()-(a.getDay()+6)%7+3);let s=new Date(a.getFullYear(),0,4);return s.setDate(s.getDate()-(s.getDay()+6)%7+3),1+Math.round((a.getTime()-s.getTime())/tt)}function ve(e,a,s){return a&&e<g(a)?g(a):s&&e>g(s)?g(s):e}function rt(e,a,s){let F=z(e),D=(F.getDay()-a+7)%7,K=T(F,-D),_=s?6:Math.ceil((D+ie(e))/7);return Array.from({length:_},(Q,H)=>Array.from({length:7},(de,A)=>T(K,H*7+A)))}function nt({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ot({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var lt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},st={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-white hover:bg-yellow-600 dark:bg-yellow-400 dark:text-gray-900 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},it={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},dt={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},ut={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},W={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function J(e,a){if(e==="multiple")return Array.isArray(a)?a.map(g):[];if(e==="range"){let s=a??null;return{from:s?.from?g(s.from):null,to:s?.to?g(s.to):null}}return a instanceof Date?g(a):null}function xe(e){return e?e instanceof Date?e:Array.isArray(e)?e[0]??null:e.from??e.to??null:null}function ct(e){let{mode:a="single",value:s,defaultValue:F,onChange:D,max:K,month:_,defaultMonth:Q,onMonthChange:H,numberOfMonths:de=1,weekStartsOn:A=0,locale:R,size:ke="md",color:v="primary",minDate:k,maxDate:w,disabledDates:j,disabled:y=!1,showOutsideDays:we=!0,showWeekNumbers:ue=!1,fixedWeeks:Ce=!1,captionLayout:X="label",fromYear:ce,toYear:ge,todayButton:Z=!1,clearButton:ee=!1,footer:fe,bordered:Me=!0,renderDay:be,labels:L,className:Se,...Ne}=e,h=lt[ke],C=Math.max(1,de),Y=(0,l.useMemo)(()=>g(new Date),[]),te=s!==void 0,[Fe,Re]=(0,l.useState)(()=>J(a,F)),E=te?J(a,s):Fe,ae=_!==void 0,[Ye,Pe]=(0,l.useState)(()=>z(Q??xe(J(a,F??s))??new Date)),f=ae?z(_):Ye,p=(0,l.useCallback)(t=>{let r=z(t);ae||Pe(r),H?.(r)},[ae,H]),ye=(0,l.useRef)(null),re=(0,l.useRef)(!1),[I,G]=(0,l.useState)(()=>{let t=xe(J(a,F??s)),r=z(Q??_??t??new Date),u=t&&se(t,r)?t:se(g(new Date),r)?g(new Date):r;return ve(u,k,w)}),Te=x(f,C-1),Ae=B(I,f)>=0&&B(I,Te)<=0?I:f;(0,l.useEffect)(()=>{if(!re.current)return;re.current=!1,ye.current?.querySelector(`[data-day="${q(I)}"]:not([data-outside])`)?.focus()},[I,f]);let P=(0,l.useCallback)(t=>{let r=ve(g(t),k,w);re.current=!0,G(r);let u=x(f,C-1);B(r,f)<0?p(r):B(r,u)>0&&p(x(r,-(C-1)))},[f,C,k,w,p]),V=(0,l.useCallback)(t=>y||k&&t<g(k)||w&&t>g(w)?!0:typeof j=="function"?j(t):Array.isArray(j)?j.some(r=>N(r,t)):!1,[y,k,w,j]),[ne,me]=(0,l.useState)(null),M=(0,l.useCallback)(t=>{te||Re(t),D?.(t)},[te,D]),U=(0,l.useCallback)(t=>{let r=g(t);if(V(r))return;if(a==="multiple"){let i=E??[];if(i.some(o=>N(o,r))){M(i.filter(o=>!N(o,r)));return}if(K!==void 0&&i.length>=K)return;M([...i,r].sort((o,b)=>o.getTime()-b.getTime()));return}if(a==="range"){let i=E??{from:null,to:null};if(!i.from||i.to){M({from:r,to:null});return}M(r<i.from?{from:r,to:i.from}:{from:i.from,to:r});return}M(N(E,r)?null:r)},[a,E,K,M,V]),Ee=(0,l.useCallback)(t=>{U(t),G(g(t)),B(t,f)<0?p(t):B(t,x(f,C-1))>0&&p(x(t,-(C-1)))},[U,f,C,p]),he=!y&&(!k||B(f,z(k))>0),pe=!y&&(!w||B(x(f,C-1),z(w))<0),Be=(0,l.useCallback)(()=>{p(x(f,-1))},[f,p]),Le=(0,l.useCallback)(()=>{p(x(f,1))},[f,p]),Ie=(0,l.useCallback)(t=>{if(y)return;let r=I;switch(t.key){case"ArrowLeft":t.preventDefault(),P(T(r,-1));break;case"ArrowRight":t.preventDefault(),P(T(r,1));break;case"ArrowUp":t.preventDefault(),P(T(r,-7));break;case"ArrowDown":t.preventDefault(),P(T(r,7));break;case"Home":t.preventDefault(),P(T(r,-((r.getDay()-A+7)%7)));break;case"End":t.preventDefault(),P(T(r,6-(r.getDay()-A+7)%7));break;case"PageUp":{t.preventDefault();let u=t.shiftKey?-12:-1,i=x(r,u),m=Math.min(r.getDate(),ie(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}case"PageDown":{t.preventDefault();let u=t.shiftKey?12:1,i=x(r,u),m=Math.min(r.getDate(),ie(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}default:break}},[y,I,P,A]),We=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{weekday:"short"}),r=new Intl.DateTimeFormat(R,{weekday:"long"}),u=new Date(2024,0,7);return Array.from({length:7},(i,m)=>{let o=T(u,(A+m)%7);return{short:t.format(o),long:r.format(o)}})},[R,A]),ze=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{month:"long"});return Array.from({length:12},(r,u)=>t.format(new Date(2024,u,1)))},[R]),De=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{month:"long",year:"numeric"}),[R]),Ve=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{dateStyle:"full"}),[R]),Ke=(0,l.useMemo)(()=>{if(X!=="dropdown")return[];let t=Y.getFullYear(),r=ce??k?.getFullYear()??t-100,u=ge??w?.getFullYear()??t+10;return u<r?[r]:Array.from({length:u-r+1},(i,m)=>r+m)},[X,ce,ge,k,w,Y]),S=a==="range"?E:null,_e=S&&S.from&&!S.to&&ne&&ne>S.from?ne:null,O=S?.to??_e,je=(0,l.useCallback)((t,r)=>{let u=!se(t,r),i=V(t),m=!1,o=!1,b=!1,d=!1;return a==="multiple"?m=(E??[]).some($=>N($,t)):a==="range"?(o=N(S?.from,t),b=N(O,t),m=o||b,d=!!(S?.from&&O&&t>S.from&&t<O)):m=N(E,t),{selected:m,today:N(t,Y),outside:u,disabled:i,rangeStart:o,rangeEnd:b,inRange:d}},[a,E,S,O,V,Y]),Oe=t=>{let r=x(f,t),u=rt(r,A,Ce),i=t===0,m=t===C-1;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("button",{type:"button",onClick:Be,disabled:!he,"aria-label":L?.previousMonth??"Previous month",className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[v],h.nav,!he&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!i&&"invisible"),children:(0,n.jsx)(nt,{className:h.icon})}),X==="dropdown"?(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("select",{"aria-label":L?.monthSelect??"Month",value:r.getMonth(),disabled:y,onChange:o=>p(new Date(r.getFullYear(),Number(o.target.value)-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[v],h.select,y&&"cursor-not-allowed opacity-50"),children:ze.map((o,b)=>(0,n.jsx)("option",{value:b,children:o},o))}),(0,n.jsx)("select",{"aria-label":L?.yearSelect??"Year",value:r.getFullYear(),disabled:y,onChange:o=>p(new Date(Number(o.target.value),r.getMonth()-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[v],h.select,y&&"cursor-not-allowed opacity-50"),children:Ke.map(o=>(0,n.jsx)("option",{value:o,children:o},o))})]}):(0,n.jsx)("div",{"aria-live":"polite",className:(0,c.cn)("font-semibold text-gray-900 dark:text-gray-100",h.caption),children:De.format(r)}),(0,n.jsx)("button",{type:"button",onClick:Le,disabled:!pe,"aria-label":L?.nextMonth??"Next month",className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[v],h.nav,!pe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!m&&"invisible"),children:(0,n.jsx)(ot,{className:h.icon})})]}),(0,n.jsxs)("table",{role:"grid","aria-label":De.format(r),className:"border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[ue&&(0,n.jsxs)("th",{scope:"col",className:(0,c.cn)("font-normal text-gray-400 dark:text-gray-500",h.head),children:[(0,n.jsx)("span",{className:"sr-only",children:L?.weekNumber??"Week number"}),(0,n.jsx)("span",{"aria-hidden":"true",children:"#"})]}),We.map(o=>(0,n.jsx)("th",{scope:"col",abbr:o.long,className:(0,c.cn)("font-medium uppercase text-gray-500 dark:text-gray-400",h.head),children:o.short},o.long))]})}),(0,n.jsx)("tbody",{children:u.map(o=>(0,n.jsxs)("tr",{children:[ue&&(0,n.jsx)("td",{className:(0,c.cn)("text-center align-middle text-gray-400 dark:text-gray-500",h.head),children:at(o[0])}),o.map(b=>{let d=je(b,r),$=q(b);if(d.outside&&!we)return(0,n.jsx)("td",{className:"p-0"},$);let Ue=N(b,Ae)&&!d.outside,oe=d.inRange||d.rangeStart&&!!O||d.rangeEnd&&!!S?.from;return(0,n.jsx)("td",{role:"presentation",className:(0,c.cn)("p-0",oe&&it[v],oe&&d.rangeStart&&"rounded-l-full",oe&&d.rangeEnd&&"rounded-r-full"),children:(0,n.jsx)("button",{type:"button","data-day":$,"data-selected":d.selected||void 0,"data-today":d.today||void 0,"data-outside":d.outside||void 0,role:"gridcell",tabIndex:Ue?0:-1,disabled:y,"aria-selected":d.selected,"aria-disabled":d.disabled||void 0,"aria-current":d.today?"date":void 0,"aria-label":Ve.format(b),onClick:()=>{d.disabled||Ee(b)},onMouseEnter:()=>a==="range"&&me(g(b)),onMouseLeave:()=>a==="range"&&me(null),onFocus:()=>G(g(b)),className:(0,c.cn)("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[v],h.day,d.selected?st[v]:d.inRange?(0,c.cn)(dt[v],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):d.today?(0,c.cn)(ut[v],"hover:bg-gray-100 dark:hover:bg-gray-700"):(0,c.cn)("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),d.outside&&!d.selected&&"text-gray-400 dark:text-gray-500",d.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:be?be(b,d):b.getDate()})},$)})]},q(o[0])))})]})]},q(r))},$e=(0,l.useCallback)(()=>{p(Y),G(Y),V(Y)||U(Y)},[Y,p,V,U]),He=(0,l.useCallback)(()=>{M(a==="multiple"?[]:a==="range"?{from:null,to:null}:null)},[a,M]),Ge=!!fe||Z||ee;return(0,n.jsxs)("div",{ref:ye,onKeyDown:Ie,className:(0,c.cn)("inline-block bg-white dark:bg-gray-900",Me&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",h.padding,y&&"opacity-60",Se),...Ne,children:[(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap",h.gap),children:Array.from({length:C},(t,r)=>Oe(r))}),Ge&&(0,n.jsxs)("div",{className:(0,c.cn)("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",h.footer),children:[(0,n.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:fe}),(Z||ee)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[Z&&(0,n.jsx)("button",{type:"button",onClick:$e,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[v],y&&"cursor-not-allowed opacity-50"),children:L?.today??"Today"}),ee&&(0,n.jsx)("button",{type:"button",onClick:He,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[v],y&&"cursor-not-allowed opacity-50"),children:L?.clear??"Clear"})]})]})]})}0&&(module.exports={Calendar});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCallback as p,useEffect as Xe,useMemo as K,useRef as ke,useState as Q}from"react";import{cn as c}from"../../lib/cn.js";import{jsx as o,jsxs as N}from"react/jsx-runtime";var Ze=10080*60*1e3;function u(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function W(a){return new Date(a.getFullYear(),a.getMonth(),1)}function P(a,r){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+r)}function v(a,r){return new Date(a.getFullYear(),a.getMonth()+r,1)}function ue(a){return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()}function S(a,r){return!a||!r?!1:a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()&&a.getDate()===r.getDate()}function de(a,r){return a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()}function E(a,r){return a.getFullYear()*12+a.getMonth()-(r.getFullYear()*12+r.getMonth())}function X(a){let r=`${a.getMonth()+1}`.padStart(2,"0"),i=`${a.getDate()}`.padStart(2,"0");return`${a.getFullYear()}-${r}-${i}`}function et(a){let r=u(a);r.setDate(r.getDate()-(r.getDay()+6)%7+3);let i=new Date(r.getFullYear(),0,4);return i.setDate(i.getDate()-(i.getDay()+6)%7+3),1+Math.round((r.getTime()-i.getTime())/Ze)}function we(a,r,i){return r&&a<u(r)?u(r):i&&a>u(i)?u(i):a}function tt(a,r,i){let z=W(a),_=(z.getDay()-r+7)%7,j=P(z,-_),O=i?6:Math.ceil((_+ue(a))/7);return Array.from({length:O},(ee,U)=>Array.from({length:7},(ce,T)=>P(j,U*7+T)))}function at({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function rt({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var nt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},ot={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-white hover:bg-yellow-600 dark:bg-yellow-400 dark:text-gray-900 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},lt={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},st={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},it={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},I={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function Z(a,r){if(a==="multiple")return Array.isArray(r)?r.map(u):[];if(a==="range"){let i=r??null;return{from:i?.from?u(i.from):null,to:i?.to?u(i.to):null}}return r instanceof Date?u(r):null}function Ce(a){return a?a instanceof Date?a:Array.isArray(a)?a[0]??null:a.from??a.to??null:null}function gt(a){let{mode:r="single",value:i,defaultValue:z,onChange:_,max:j,month:O,defaultMonth:ee,onMonthChange:U,numberOfMonths:ce=1,weekStartsOn:T=0,locale:F,size:Me="md",color:D="primary",minDate:x,maxDate:k,disabledDates:$,disabled:b=!1,showOutsideDays:Se=!0,showWeekNumbers:ge=!1,fixedWeeks:Ne=!1,captionLayout:te="label",fromYear:fe,toYear:be,todayButton:ae=!1,clearButton:re=!1,footer:ye,bordered:Fe=!0,renderDay:me,labels:B,className:Re,...Ye}=a,m=nt[Me],w=Math.max(1,ce),R=K(()=>u(new Date),[]),ne=i!==void 0,[Pe,Te]=Q(()=>Z(r,z)),A=ne?Z(r,i):Pe,oe=O!==void 0,[Ae,Ee]=Q(()=>W(ee??Ce(Z(r,z??i))??new Date)),g=oe?W(O):Ae,h=p(e=>{let t=W(e);oe||Ee(t),U?.(t)},[oe,U]),he=ke(null),le=ke(!1),[L,q]=Q(()=>{let e=Ce(Z(r,z??i)),t=W(ee??O??e??new Date),d=e&&de(e,t)?e:de(u(new Date),t)?u(new Date):t;return we(d,x,k)}),Be=v(g,w-1),Le=E(L,g)>=0&&E(L,Be)<=0?L:g;Xe(()=>{if(!le.current)return;le.current=!1,he.current?.querySelector(`[data-day="${X(L)}"]:not([data-outside])`)?.focus()},[L,g]);let Y=p(e=>{let t=we(u(e),x,k);le.current=!0,q(t);let d=v(g,w-1);E(t,g)<0?h(t):E(t,d)>0&&h(v(t,-(w-1)))},[g,w,x,k,h]),V=p(e=>b||x&&e<u(x)||k&&e>u(k)?!0:typeof $=="function"?$(e):Array.isArray($)?$.some(t=>S(t,e)):!1,[b,x,k,$]),[se,pe]=Q(null),C=p(e=>{ne||Te(e),_?.(e)},[ne,_]),J=p(e=>{let t=u(e);if(V(t))return;if(r==="multiple"){let l=A??[];if(l.some(n=>S(n,t))){C(l.filter(n=>!S(n,t)));return}if(j!==void 0&&l.length>=j)return;C([...l,t].sort((n,f)=>n.getTime()-f.getTime()));return}if(r==="range"){let l=A??{from:null,to:null};if(!l.from||l.to){C({from:t,to:null});return}C(t<l.from?{from:t,to:l.from}:{from:l.from,to:t});return}C(S(A,t)?null:t)},[r,A,j,C,V]),Ie=p(e=>{J(e),q(u(e)),E(e,g)<0?h(e):E(e,v(g,w-1))>0&&h(v(e,-(w-1)))},[J,g,w,h]),De=!b&&(!x||E(g,W(x))>0),ve=!b&&(!k||E(v(g,w-1),W(k))<0),We=p(()=>{h(v(g,-1))},[g,h]),ze=p(()=>{h(v(g,1))},[g,h]),Ve=p(e=>{if(b)return;let t=L;switch(e.key){case"ArrowLeft":e.preventDefault(),Y(P(t,-1));break;case"ArrowRight":e.preventDefault(),Y(P(t,1));break;case"ArrowUp":e.preventDefault(),Y(P(t,-7));break;case"ArrowDown":e.preventDefault(),Y(P(t,7));break;case"Home":e.preventDefault(),Y(P(t,-((t.getDay()-T+7)%7)));break;case"End":e.preventDefault(),Y(P(t,6-(t.getDay()-T+7)%7));break;case"PageUp":{e.preventDefault();let d=e.shiftKey?-12:-1,l=v(t,d),y=Math.min(t.getDate(),ue(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}case"PageDown":{e.preventDefault();let d=e.shiftKey?12:1,l=v(t,d),y=Math.min(t.getDate(),ue(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}default:break}},[b,L,Y,T]),Ke=K(()=>{let e=new Intl.DateTimeFormat(F,{weekday:"short"}),t=new Intl.DateTimeFormat(F,{weekday:"long"}),d=new Date(2024,0,7);return Array.from({length:7},(l,y)=>{let n=P(d,(T+y)%7);return{short:e.format(n),long:t.format(n)}})},[F,T]),_e=K(()=>{let e=new Intl.DateTimeFormat(F,{month:"long"});return Array.from({length:12},(t,d)=>e.format(new Date(2024,d,1)))},[F]),xe=K(()=>new Intl.DateTimeFormat(F,{month:"long",year:"numeric"}),[F]),je=K(()=>new Intl.DateTimeFormat(F,{dateStyle:"full"}),[F]),Oe=K(()=>{if(te!=="dropdown")return[];let e=R.getFullYear(),t=fe??x?.getFullYear()??e-100,d=be??k?.getFullYear()??e+10;return d<t?[t]:Array.from({length:d-t+1},(l,y)=>t+y)},[te,fe,be,x,k,R]),M=r==="range"?A:null,$e=M&&M.from&&!M.to&&se&&se>M.from?se:null,H=M?.to??$e,He=p((e,t)=>{let d=!de(e,t),l=V(e),y=!1,n=!1,f=!1,s=!1;return r==="multiple"?y=(A??[]).some(G=>S(G,e)):r==="range"?(n=S(M?.from,e),f=S(H,e),y=n||f,s=!!(M?.from&&H&&e>M.from&&e<H)):y=S(A,e),{selected:y,today:S(e,R),outside:d,disabled:l,rangeStart:n,rangeEnd:f,inRange:s}},[r,A,M,H,V,R]),Ge=e=>{let t=v(g,e),d=tt(t,T,Ne),l=e===0,y=e===w-1;return N("div",{className:"flex flex-col",children:[N("div",{className:"mb-2 flex items-center justify-between",children:[o("button",{type:"button",onClick:We,disabled:!De,"aria-label":B?.previousMonth??"Previous month",className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",I[D],m.nav,!De&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!l&&"invisible"),children:o(at,{className:m.icon})}),te==="dropdown"?N("div",{className:"flex items-center gap-1",children:[o("select",{"aria-label":B?.monthSelect??"Month",value:t.getMonth(),disabled:b,onChange:n=>h(new Date(t.getFullYear(),Number(n.target.value)-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",I[D],m.select,b&&"cursor-not-allowed opacity-50"),children:_e.map((n,f)=>o("option",{value:f,children:n},n))}),o("select",{"aria-label":B?.yearSelect??"Year",value:t.getFullYear(),disabled:b,onChange:n=>h(new Date(Number(n.target.value),t.getMonth()-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",I[D],m.select,b&&"cursor-not-allowed opacity-50"),children:Oe.map(n=>o("option",{value:n,children:n},n))})]}):o("div",{"aria-live":"polite",className:c("font-semibold text-gray-900 dark:text-gray-100",m.caption),children:xe.format(t)}),o("button",{type:"button",onClick:ze,disabled:!ve,"aria-label":B?.nextMonth??"Next month",className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",I[D],m.nav,!ve&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!y&&"invisible"),children:o(rt,{className:m.icon})})]}),N("table",{role:"grid","aria-label":xe.format(t),className:"border-collapse",children:[o("thead",{children:N("tr",{children:[ge&&N("th",{scope:"col",className:c("font-normal text-gray-400 dark:text-gray-500",m.head),children:[o("span",{className:"sr-only",children:B?.weekNumber??"Week number"}),o("span",{"aria-hidden":"true",children:"#"})]}),Ke.map(n=>o("th",{scope:"col",abbr:n.long,className:c("font-medium uppercase text-gray-500 dark:text-gray-400",m.head),children:n.short},n.long))]})}),o("tbody",{children:d.map(n=>N("tr",{children:[ge&&o("td",{className:c("text-center align-middle text-gray-400 dark:text-gray-500",m.head),children:et(n[0])}),n.map(f=>{let s=He(f,t),G=X(f);if(s.outside&&!Se)return o("td",{className:"p-0"},G);let Qe=S(f,Le)&&!s.outside,ie=s.inRange||s.rangeStart&&!!H||s.rangeEnd&&!!M?.from;return o("td",{role:"presentation",className:c("p-0",ie&<[D],ie&&s.rangeStart&&"rounded-l-full",ie&&s.rangeEnd&&"rounded-r-full"),children:o("button",{type:"button","data-day":G,"data-selected":s.selected||void 0,"data-today":s.today||void 0,"data-outside":s.outside||void 0,role:"gridcell",tabIndex:Qe?0:-1,disabled:b,"aria-selected":s.selected,"aria-disabled":s.disabled||void 0,"aria-current":s.today?"date":void 0,"aria-label":je.format(f),onClick:()=>{s.disabled||Ie(f)},onMouseEnter:()=>r==="range"&&pe(u(f)),onMouseLeave:()=>r==="range"&&pe(null),onFocus:()=>q(u(f)),className:c("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",I[D],m.day,s.selected?ot[D]:s.inRange?c(st[D],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):s.today?c(it[D],"hover:bg-gray-100 dark:hover:bg-gray-700"):c("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),s.outside&&!s.selected&&"text-gray-400 dark:text-gray-500",s.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:me?me(f,s):f.getDate()})},G)})]},X(n[0])))})]})]},X(t))},Ue=p(()=>{h(R),q(R),V(R)||J(R)},[R,h,V,J]),qe=p(()=>{C(r==="multiple"?[]:r==="range"?{from:null,to:null}:null)},[r,C]),Je=!!ye||ae||re;return N("div",{ref:he,onKeyDown:Ve,className:c("inline-block bg-white dark:bg-gray-900",Fe&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",m.padding,b&&"opacity-60",Re),...Ye,children:[o("div",{className:c("flex flex-wrap",m.gap),children:Array.from({length:w},(e,t)=>Ge(t))}),Je&&N("div",{className:c("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",m.footer),children:[o("div",{className:"text-gray-600 dark:text-gray-400",children:ye}),(ae||re)&&N("div",{className:"flex items-center gap-2",children:[ae&&o("button",{type:"button",onClick:Ue,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",I[D],b&&"cursor-not-allowed opacity-50"),children:B?.today??"Today"}),re&&o("button",{type:"button",onClick:qe,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",I[D],b&&"cursor-not-allowed opacity-50"),children:B?.clear??"Clear"})]})]})]})}export{gt as Calendar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var S=(e,a)=>{for(var l in a)d(e,l,{get:a[l],enumerable:!0})},f=(e,a,l,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of t(a))!p.call(e,r)&&r!==l&&d(e,r,{get:()=>a[r],enumerable:!(n=o(a,r))||n.enumerable});return e};var m=e=>f(d({},"__esModule",{value:!0}),e);var s={};S(s,{Calendar:()=>C.Calendar});module.exports=m(s);var C=require("./Calendar.cjs");0&&(module.exports={Calendar});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Calendar as r}from"./Calendar.js";export{r as Calendar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var Q=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var ye=(l,a)=>{for(var r in a)Q(l,r,{get:a[r],enumerable:!0})},pe=(l,a,r,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of fe(a))!be.call(l,g)&&g!==r&&Q(l,g,{get:()=>a[g],enumerable:!(o=me(a,g))||o.enumerable});return l};var Ce=l=>pe(Q({},"__esModule",{value:!0}),l);var Re={};ye(Re,{CandlestickChart:()=>Le});module.exports=Ce(Re);var c=require("react"),te=require("../../lib/i18n.cjs"),ee=require("../chart/ChartAxis.cjs"),ae=require("../chart/ChartContainer.cjs"),oe=require("../chart/ChartGrid.cjs"),le=require("../chart/ChartLegend.cjs"),ie=require("../chart/ChartTableView.cjs"),se=require("../chart/ChartTooltip.cjs"),_=require("../chart/palette.cjs"),ue=require("../chart/utils/cartesian.cjs"),L=require("../chart/utils/data.cjs"),$=require("../chart/utils/format.cjs"),he=require("../chart/utils/path.cjs"),ce=require("../chart/utils/scales.cjs"),e=require("react/jsx-runtime"),ke=16,xe=1.5,we=(0,c.memo)(function({candles:a}){return(0,e.jsx)("g",{children:a.map(r=>(0,e.jsxs)("g",{children:[r.wick?(0,e.jsx)("line",{x1:r.wick.x,y1:r.wick.y1,x2:r.wick.x,y2:r.wick.y2,stroke:r.color,strokeWidth:1.5}):null,r.body?(0,e.jsx)("path",{d:r.body,fill:r.hollow?"none":r.color,stroke:r.color,strokeWidth:r.hollow?1.5:0}):null]},r.key))})});function ve({width:l,height:a,data:r,candles:o,x:g,y:p,grid:R,size:X,candleSize:E,fillRising:P,palette:M,referenceLines:I,margin:W,tooltip:b,plotLabel:K,formatValue:y,formatX:D,onCandleClick:N}){let[u,S]=(0,c.useState)(null),C=(0,te.useUILabels)(),t=(0,c.useMemo)(()=>{let n=o.flatMap(s=>s.high===null||s.low===null?[]:[s.low,s.high]),i=(0,ue.buildCartesianGeometry)({width:l,height:a,data:r,x:g,y:p,bounds:n.length===0?null:[Math.min(...n),Math.max(...n)],margin:W,orientation:"vertical",placement:"band",formatValue:y,formatX:D,defaultIncludeZero:!1}),{valueScale:d,bandwidth:k,categoryPositions:z,innerWidth:U,innerHeight:j}=i,x=Math.min(E??ke,Math.max(1,k-2));return{rendered:o.map((s,G)=>{let H=z[G]+(k-x)/2,q=H+x/2,f=s.rising?M.up:M.down,O=s.high===null||s.low===null?null:{x:q,y1:d(s.high),y2:d(s.low)},w=null;if(s.open!==null&&s.close!==null){let T=d(s.open),v=d(s.close);w=(0,he.buildBarPath)({x:H,y:Math.min(T,v),width:x,height:Math.max(xe,Math.abs(v-T)),radius:0,round:"none"})}return{key:`${G}`,color:f,body:w,hollow:s.rising&&!P,wick:O,left:H,width:x}}),categoryPositions:z,categoryCenters:i.categoryCenters,bandwidth:k,categoryTicks:i.categoryTicks,valueTicks:i.valueTicks,valueScale:d,innerWidth:U,innerHeight:j,margin:i.margin}},[o,r,g,p,l,a,W,E,P,M,y,D]),B=(0,c.useCallback)(n=>{if(b===!1||o.length===0)return;let i=n.currentTarget.getBoundingClientRect(),d=n.clientX-i.left-t.margin.left;S((0,ce.nearestIndex)(t.categoryCenters,d))},[b,o.length,t.margin.left,t.categoryCenters]),Y=(0,c.useCallback)(n=>{if(o.length===0)return;let i=o.length-1,d=u??0,k=n.key==="ArrowRight"?Math.min(i,d+1):n.key==="ArrowLeft"?Math.max(0,d-1):n.key==="Home"?0:n.key==="End"?i:n.key==="Escape"?null:void 0;k!==void 0&&(n.preventDefault(),S(k))},[o.length,u]),F=(0,c.useCallback)(()=>{!N||u===null||N(o[u])},[N,u,o]),h=u===null?null:o[u];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("svg",{width:l,height:a,role:"img","aria-label":K??o.map(n=>n.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:B,onPointerLeave:()=>S(null),onKeyDown:Y,onBlur:()=>S(null),onClick:F,children:[(0,e.jsxs)("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:[(0,e.jsx)(oe.ChartGrid,{width:t.innerWidth,height:t.innerHeight,horizontal:R==="y"||R==="both"?t.valueTicks.map(n=>n.offset):void 0}),u!==null?(0,e.jsx)("rect",{x:t.categoryPositions[u],y:0,width:t.bandwidth,height:t.innerHeight,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,I?.map(n=>(0,e.jsxs)("g",{children:[(0,e.jsx)("line",{x1:0,y1:t.valueScale(n.value),x2:t.innerWidth,y2:t.valueScale(n.value),stroke:n.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:n.dashed===!1?void 0:"4 4"}),n.label?(0,e.jsx)("text",{x:t.innerWidth,y:t.valueScale(n.value)-4,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:n.label}):null]},`${n.value}-${n.label??""}`)),(0,e.jsx)(we,{candles:t.rendered})]}),(0,e.jsx)("g",{transform:`translate(${t.margin.left}, ${t.margin.top+t.innerHeight})`,children:g.hidden?null:(0,e.jsx)(ee.ChartAxis,{orientation:"bottom",ticks:t.categoryTicks,length:t.innerWidth,label:g.label,size:X})}),(0,e.jsx)("g",{transform:`translate(${t.margin.left}, ${t.margin.top})`,children:p?.hidden?null:(0,e.jsx)(ee.ChartAxis,{orientation:"left",ticks:t.valueTicks,length:t.innerHeight,showLine:!1,label:p?.label,size:X})})]}),h&&u!==null&&b!==!1?(0,e.jsx)(se.ChartTooltip,{x:t.margin.left+t.categoryCenters[u],y:t.margin.top+(h.high===null?t.innerHeight/2:t.valueScale(h.high)),containerWidth:l,children:typeof b=="function"?b(h):(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:h.label}),(0,e.jsx)("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[C.chartOpen,h.open],[C.chartHigh,h.high],[C.chartLow,h.low],[C.chartClose,h.close]].map(([n,i])=>(0,e.jsxs)("div",{className:"contents",children:[(0,e.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:n}),(0,e.jsx)("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:i===null?"\u2014":y(i)})]},n))}),h.change===null?null:(0,e.jsxs)("div",{className:"flex items-center gap-2 border-t border-gray-200 pt-1 dark:border-gray-700",children:[(0,e.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:h.rising?C.chartRise:C.chartFall}),(0,e.jsxs)("span",{className:"[font-variant-numeric:tabular-nums] font-semibold text-gray-900 dark:text-gray-100",children:[h.change>0?"+":"",y(h.change)]})]})]})}):null]})}function Le({data:l,x:a,y:r,open:o,high:g,low:p,close:R,candleSize:X,fillRising:E=!1,colors:P,referenceLines:M,height:I=300,width:W,size:b="md",grid:K="y",legend:y,tooltip:D=!0,tableView:N=!1,title:u,description:S,loading:C=!1,emptyState:t,error:B=!1,errorState:Y,onRetry:F,actions:h,margin:n,locale:i,plotLabel:d,openLabel:k,highLabel:z,lowLabel:U,closeLabel:j,riseLabel:x,fallLabel:Z,format:s,onCandleClick:G,className:H,...q}){let f=(0,te.useUILabels)(),O=(0,c.useMemo)(()=>r?.format??s??(m=>(0,$.formatAuto)(m,i)),[r?.format,s,i]),w=(0,c.useMemo)(()=>a.format??(m=>(0,$.formatXValue)(m,i)),[a.format,i]),T=(0,c.useMemo)(()=>l.map((m,J)=>{let re=(0,L.readXValue)(m,a.key,J),A=(0,L.readNumber)(m,o),V=(0,L.readNumber)(m,R);return{index:J,x:re,label:w(re,J),open:A,high:(0,L.readNumber)(m,g),low:(0,L.readNumber)(m,p),close:V,change:A===null||V===null?null:V-A,rising:A===null||V===null?!0:V>=A,datum:m}}),[l,a.key,o,g,p,R,w]),v=(0,c.useMemo)(()=>({up:P?.up??_.CHART_UP_COLOR,down:P?.down??_.CHART_DOWN_COLOR}),[P]),ge=(0,c.useMemo)(()=>[{key:"up",label:x??f.chartRise,color:v.up,marker:"rect"},{key:"down",label:Z??f.chartFall,color:v.down,marker:"rect"}],[v,x,Z,f.chartRise,f.chartFall]),de=y===void 0?!0:y!==!1,ne=typeof y=="string"?y:"bottom";return(0,e.jsx)(ae.ChartContainer,{title:u,description:S,height:I,width:W,size:b,loading:C,empty:T.length===0,emptyState:t,error:B,errorState:Y,onRetry:F,actions:h,tableView:N,legendPosition:ne,legend:de?(0,e.jsx)(le.ChartLegend,{items:ge,position:ne,marker:"rect",size:b}):void 0,table:N?(0,e.jsx)(ie.ChartTableView,{data:l,series:[{key:o,label:k??f.chartOpen},{key:g,label:z??f.chartHigh},{key:p,label:U??f.chartLow},{key:R,label:j??f.chartClose}],xKey:a.key,xLabel:a.label??a.key,formatX:w,formatValue:O,caption:typeof u=="string"?u:void 0}):void 0,className:H,...q,children:({width:m})=>(0,e.jsx)(ve,{width:m,height:I,data:l,candles:T,x:a,y:r,grid:K,size:b,candleSize:X,fillRising:E,palette:v,referenceLines:M,margin:n,tooltip:D,plotLabel:d,formatValue:O,formatX:w,onCandleClick:G})})}0&&(module.exports={CandlestickChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as oe,useCallback as J,useMemo as S,useState as le}from"react";import{useUILabels as ne}from"../../lib/i18n.js";import{ChartAxis as te}from"../chart/ChartAxis.js";import{ChartContainer as ie}from"../chart/ChartContainer.js";import{ChartGrid as se}from"../chart/ChartGrid.js";import{ChartLegend as ue}from"../chart/ChartLegend.js";import{ChartTableView as he}from"../chart/ChartTableView.js";import{ChartTooltip as ce}from"../chart/ChartTooltip.js";import{CHART_DOWN_COLOR as ge,CHART_UP_COLOR as de}from"../chart/palette.js";import{buildCartesianGeometry as me}from"../chart/utils/cartesian.js";import{readNumber as _,readXValue as fe}from"../chart/utils/data.js";import{formatAuto as be,formatXValue as ye}from"../chart/utils/format.js";import{buildBarPath as pe}from"../chart/utils/path.js";import{nearestIndex as Ce}from"../chart/utils/scales.js";import{Fragment as Le,jsx as n,jsxs as b}from"react/jsx-runtime";var ke=16,xe=1.5,we=oe(function({candles:u}){return n("g",{children:u.map(r=>b("g",{children:[r.wick?n("line",{x1:r.wick.x,y1:r.wick.y1,x2:r.wick.x,y2:r.wick.y2,stroke:r.color,strokeWidth:1.5}):null,r.body?n("path",{d:r.body,fill:r.hollow?"none":r.color,stroke:r.color,strokeWidth:r.hollow?1.5:0}):null]},r.key))})});function ve({width:g,height:u,data:r,candles:l,x:y,y:p,grid:L,size:X,candleSize:E,fillRising:R,palette:M,referenceLines:I,margin:W,tooltip:m,plotLabel:$,formatValue:f,formatX:D,onCandleClick:P}){let[i,N]=le(null),C=ne(),e=S(()=>{let t=l.flatMap(o=>o.high===null||o.low===null?[]:[o.low,o.high]),a=me({width:g,height:u,data:r,x:y,y:p,bounds:t.length===0?null:[Math.min(...t),Math.max(...t)],margin:W,orientation:"vertical",placement:"band",formatValue:f,formatX:D,defaultIncludeZero:!1}),{valueScale:h,bandwidth:k,categoryPositions:z,innerWidth:F,innerHeight:U}=a,x=Math.min(E??ke,Math.max(1,k-2));return{rendered:l.map((o,G)=>{let H=z[G]+(k-x)/2,Z=H+x/2,d=o.rising?M.up:M.down,O=o.high===null||o.low===null?null:{x:Z,y1:h(o.high),y2:h(o.low)},w=null;if(o.open!==null&&o.close!==null){let T=h(o.open),v=h(o.close);w=pe({x:H,y:Math.min(T,v),width:x,height:Math.max(xe,Math.abs(v-T)),radius:0,round:"none"})}return{key:`${G}`,color:d,body:w,hollow:o.rising&&!R,wick:O,left:H,width:x}}),categoryPositions:z,categoryCenters:a.categoryCenters,bandwidth:k,categoryTicks:a.categoryTicks,valueTicks:a.valueTicks,valueScale:h,innerWidth:F,innerHeight:U,margin:a.margin}},[l,r,y,p,g,u,W,E,R,M,f,D]),K=J(t=>{if(m===!1||l.length===0)return;let a=t.currentTarget.getBoundingClientRect(),h=t.clientX-a.left-e.margin.left;N(Ce(e.categoryCenters,h))},[m,l.length,e.margin.left,e.categoryCenters]),B=J(t=>{if(l.length===0)return;let a=l.length-1,h=i??0,k=t.key==="ArrowRight"?Math.min(a,h+1):t.key==="ArrowLeft"?Math.max(0,h-1):t.key==="Home"?0:t.key==="End"?a:t.key==="Escape"?null:void 0;k!==void 0&&(t.preventDefault(),N(k))},[l.length,i]),Y=J(()=>{!P||i===null||P(l[i])},[P,i,l]),s=i===null?null:l[i];return b(Le,{children:[b("svg",{width:g,height:u,role:"img","aria-label":$??l.map(t=>t.label).join(", "),tabIndex:0,className:"touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",onPointerMove:K,onPointerLeave:()=>N(null),onKeyDown:B,onBlur:()=>N(null),onClick:Y,children:[b("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[n(se,{width:e.innerWidth,height:e.innerHeight,horizontal:L==="y"||L==="both"?e.valueTicks.map(t=>t.offset):void 0}),i!==null?n("rect",{x:e.categoryPositions[i],y:0,width:e.bandwidth,height:e.innerHeight,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,I?.map(t=>b("g",{children:[n("line",{x1:0,y1:e.valueScale(t.value),x2:e.innerWidth,y2:e.valueScale(t.value),stroke:t.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:t.dashed===!1?void 0:"4 4"}),t.label?n("text",{x:e.innerWidth,y:e.valueScale(t.value)-4,textAnchor:"end",className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:t.label}):null]},`${t.value}-${t.label??""}`)),n(we,{candles:e.rendered})]}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:y.hidden?null:n(te,{orientation:"bottom",ticks:e.categoryTicks,length:e.innerWidth,label:y.label,size:X})}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:p?.hidden?null:n(te,{orientation:"left",ticks:e.valueTicks,length:e.innerHeight,showLine:!1,label:p?.label,size:X})})]}),s&&i!==null&&m!==!1?n(ce,{x:e.margin.left+e.categoryCenters[i],y:e.margin.top+(s.high===null?e.innerHeight/2:e.valueScale(s.high)),containerWidth:g,children:typeof m=="function"?m(s):b("div",{className:"flex flex-col gap-1",children:[n("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:s.label}),n("dl",{className:"grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5",children:[[C.chartOpen,s.open],[C.chartHigh,s.high],[C.chartLow,s.low],[C.chartClose,s.close]].map(([t,a])=>b("div",{className:"contents",children:[n("dt",{className:"text-gray-500 dark:text-gray-400",children:t}),n("dd",{className:"justify-self-end font-medium text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:a===null?"\u2014":f(a)})]},t))}),s.change===null?null:b("div",{className:"flex items-center gap-2 border-t border-gray-200 pt-1 dark:border-gray-700",children:[n("span",{className:"text-gray-500 dark:text-gray-400",children:s.rising?C.chartRise:C.chartFall}),b("span",{className:"[font-variant-numeric:tabular-nums] font-semibold text-gray-900 dark:text-gray-100",children:[s.change>0?"+":"",f(s.change)]})]})]})}):null]})}function ze({data:g,x:u,y:r,open:l,high:y,low:p,close:L,candleSize:X,fillRising:E=!1,colors:R,referenceLines:M,height:I=300,width:W,size:m="md",grid:$="y",legend:f,tooltip:D=!0,tableView:P=!1,title:i,description:N,loading:C=!1,emptyState:e,error:K=!1,errorState:B,onRetry:Y,actions:s,margin:t,locale:a,plotLabel:h,openLabel:k,highLabel:z,lowLabel:F,closeLabel:U,riseLabel:x,fallLabel:j,format:o,onCandleClick:G,className:H,...Z}){let d=ne(),O=S(()=>r?.format??o??(c=>be(c,a)),[r?.format,o,a]),w=S(()=>u.format??(c=>ye(c,a)),[u.format,a]),T=S(()=>g.map((c,q)=>{let ee=fe(c,u.key,q),A=_(c,l),V=_(c,L);return{index:q,x:ee,label:w(ee,q),open:A,high:_(c,y),low:_(c,p),close:V,change:A===null||V===null?null:V-A,rising:A===null||V===null?!0:V>=A,datum:c}}),[g,u.key,l,y,p,L,w]),v=S(()=>({up:R?.up??de,down:R?.down??ge}),[R]),re=S(()=>[{key:"up",label:x??d.chartRise,color:v.up,marker:"rect"},{key:"down",label:j??d.chartFall,color:v.down,marker:"rect"}],[v,x,j,d.chartRise,d.chartFall]),ae=f===void 0?!0:f!==!1,Q=typeof f=="string"?f:"bottom";return n(ie,{title:i,description:N,height:I,width:W,size:m,loading:C,empty:T.length===0,emptyState:e,error:K,errorState:B,onRetry:Y,actions:s,tableView:P,legendPosition:Q,legend:ae?n(ue,{items:re,position:Q,marker:"rect",size:m}):void 0,table:P?n(he,{data:g,series:[{key:l,label:k??d.chartOpen},{key:y,label:z??d.chartHigh},{key:p,label:F??d.chartLow},{key:L,label:U??d.chartClose}],xKey:u.key,xLabel:u.label??u.key,formatX:w,formatValue:O,caption:typeof i=="string"?i:void 0}):void 0,className:H,...Z,children:({width:c})=>n(ve,{width:c,height:I,data:g,candles:T,x:u,y:r,grid:$,size:m,candleSize:X,fillRising:E,palette:v,referenceLines:M,margin:t,tooltip:D,plotLabel:h,formatValue:O,formatX:w,onCandleClick:G})})}export{ze as CandlestickChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var C=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(r,t)=>{for(var e in t)C(r,e,{get:t[e],enumerable:!0})},c=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of n(t))!p.call(r,a)&&a!==e&&C(r,a,{get:()=>t[a],enumerable:!(o=l(t,a))||o.enumerable});return r};var h=r=>c(C({},"__esModule",{value:!0}),r);var i={};s(i,{CandlestickChart:()=>d.CandlestickChart});module.exports=h(i);var d=require("./CandlestickChart.cjs");0&&(module.exports={CandlestickChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CandlestickChart as a}from"./CandlestickChart.js";export{a as CandlestickChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var k=(e,r)=>{for(var a in r)s(e,a,{get:r[a],enumerable:!0})},N=(e,r,a,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of y(r))!R.call(e,n)&&n!==a&&s(e,n,{get:()=>r[n],enumerable:!(t=P(r,n))||t.enumerable});return e};var z=e=>N(s({},"__esModule",{value:!0}),e);var q={};k(q,{Card:()=>i});module.exports=z(q);var o=require("../../lib/cn.cjs"),u=require("react/jsx-runtime");function B(e,r,a){let t=a||"bg-white dark:bg-gray-800",n=r||"border-gray-200 dark:border-gray-700";switch(e){case"outlined":return(0,o.cn)("border-2 bg-transparent",n);case"elevated":return(0,o.cn)("shadow-lg border-0",t);case"filled":return(0,o.cn)(a||"bg-gray-100 dark:bg-gray-700","border-0");default:return(0,o.cn)("border",n,t)}}function W(e){switch(e){case"sm":return"max-w-sm";case"lg":return"max-w-2xl";default:return"max-w-md"}}function S(e){switch(e){case"none":return"rounded-none";case"sm":return"rounded-sm";case"md":return"rounded-md";case"xl":return"rounded-xl";case"full":return"rounded-3xl";default:return"rounded-lg"}}function V(e){switch(e){case"none":return"";case"sm":return"p-2";case"lg":return"p-6";default:return""}}function i({variant:e="default",size:r="md",rounded:a="lg",padding:t="none",bgColor:n,borderColor:c,shadowColor:g,hoverable:m=!1,clickable:d=!1,as:f="div",className:p,children:C,onClick:l,...h}){let b=f,v=m?"transition-all duration-200 hover:shadow-lg hover:-translate-y-0.5":"",w=d?"cursor-pointer active:scale-[0.98] transition-transform":"",x=g||"";return(0,u.jsx)(b,{className:(0,o.cn)("overflow-hidden",B(e,c,n),W(r),S(a),V(t),v,w,x,p),onClick:d||l?l:void 0,...h,children:C})}i.displayName="Card";0&&(module.exports={Card});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as r}from"../../lib/cn.js";import{jsx as R}from"react/jsx-runtime";function v(e,o,n){let a=n||"bg-white dark:bg-gray-800",t=o||"border-gray-200 dark:border-gray-700";switch(e){case"outlined":return r("border-2 bg-transparent",t);case"elevated":return r("shadow-lg border-0",a);case"filled":return r(n||"bg-gray-100 dark:bg-gray-700","border-0");default:return r("border",t,a)}}function w(e){switch(e){case"sm":return"max-w-sm";case"lg":return"max-w-2xl";default:return"max-w-md"}}function x(e){switch(e){case"none":return"rounded-none";case"sm":return"rounded-sm";case"md":return"rounded-md";case"xl":return"rounded-xl";case"full":return"rounded-3xl";default:return"rounded-lg"}}function P(e){switch(e){case"none":return"";case"sm":return"p-2";case"lg":return"p-6";default:return""}}function y({variant:e="default",size:o="md",rounded:n="lg",padding:a="none",bgColor:t,borderColor:l,shadowColor:i,hoverable:u=!1,clickable:s=!1,as:c="div",className:g,children:m,onClick:d,...f}){let p=c,C=u?"transition-all duration-200 hover:shadow-lg hover:-translate-y-0.5":"",h=s?"cursor-pointer active:scale-[0.98] transition-transform":"",b=i||"";return R(p,{className:r("overflow-hidden",v(e,l,t),w(o),x(n),P(a),C,h,b,g),onClick:s||d?d:void 0,...f,children:m})}y.displayName="Card";export{y as Card};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var y=(e,o)=>{for(var d in o)n(e,d,{get:o[d],enumerable:!0})},u=(e,o,d,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of c(o))!m.call(e,r)&&r!==d&&n(e,r,{get:()=>o[r],enumerable:!(t=i(o,r))||t.enumerable});return e};var f=e=>u(n({},"__esModule",{value:!0}),e);var l={};y(l,{CardBody:()=>a});module.exports=f(l);var p=require("../../lib/cn.cjs"),s=require("react/jsx-runtime");function C(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function a({padding:e="md",className:o,children:d,...t}){return(0,s.jsx)("div",{className:(0,p.cn)(C(e),o),...t,children:d})}a.displayName="CardBody";0&&(module.exports={CardBody});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as t}from"../../lib/cn.js";import{jsx as a}from"react/jsx-runtime";function n(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function p({padding:e="md",className:o,children:d,...r}){return a("div",{className:t(n(e),o),...r,children:d})}p.displayName="CardBody";export{p as CardBody};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of d(t))!m.call(e,o)&&o!==r&&i(e,o,{get:()=>t[o],enumerable:!(s=c(t,o))||s.enumerable});return e};var x=e=>u(i({},"__esModule",{value:!0}),e);var l={};f(l,{CardDescription:()=>a});module.exports=x(l);var p=require("../../lib/cn.cjs"),n=require("react/jsx-runtime");function C(e){switch(e){case"sm":return"text-xs";case"lg":return"text-base";default:return"text-sm"}}function a({size:e="md",className:t,children:r,...s}){return(0,n.jsx)("p",{className:(0,p.cn)("text-gray-500 dark:text-gray-400",C(e),t),...s,children:r})}a.displayName="CardDescription";0&&(module.exports={CardDescription});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as a}from"react/jsx-runtime";function i(e){switch(e){case"sm":return"text-xs";case"lg":return"text-base";default:return"text-sm"}}function p({size:e="md",className:t,children:r,...o}){return a("p",{className:s("text-gray-500 dark:text-gray-400",i(e),t),...o,children:r})}p.displayName="CardDescription";export{p as CardDescription};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var o in r)a(e,o,{get:r[o],enumerable:!0})},g=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!f.call(e,t)&&t!==o&&a(e,t,{get:()=>r[t],enumerable:!(n=c(r,t))||n.enumerable});return e};var m=e=>g(a({},"__esModule",{value:!0}),e);var b={};l(b,{CardFooter:()=>d});module.exports=m(b);var s=require("../../lib/cn.cjs"),i=require("react/jsx-runtime");function y(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function C(e){switch(e){case"center":return"justify-center";case"right":return"justify-end";case"between":return"justify-between";default:return"justify-start"}}function d({divider:e=!1,align:r="left",padding:o="md",className:n,children:t,...p}){return(0,i.jsx)("div",{className:(0,s.cn)("flex items-center gap-2",y(o),C(r),e&&"border-t border-gray-200 dark:border-gray-700",n),...p,children:t})}d.displayName="CardFooter";0&&(module.exports={CardFooter});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as c}from"react/jsx-runtime";function d(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function i(e){switch(e){case"center":return"justify-center";case"right":return"justify-end";case"between":return"justify-between";default:return"justify-start"}}function p({divider:e=!1,align:r="left",padding:t="md",className:o,children:n,...a}){return c("div",{className:s("flex items-center gap-2",d(t),i(r),e&&"border-t border-gray-200 dark:border-gray-700",o),...a,children:n})}p.displayName="CardFooter";export{p as CardFooter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(e,r)=>{for(var a in r)n(e,a,{get:r[a],enumerable:!0})},u=(e,r,a,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let d of m(r))!l.call(e,d)&&d!==a&&n(e,d,{get:()=>r[d],enumerable:!(o=c(r,d))||o.enumerable});return e};var g=e=>u(n({},"__esModule",{value:!0}),e);var x={};f(x,{CardHeader:()=>i});module.exports=g(x);var s=require("../../lib/cn.cjs"),t=require("react/jsx-runtime");function v(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function i({actions:e,divider:r=!1,padding:a="md",className:o,children:d,...p}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex items-center justify-between",v(a),r&&"border-b border-gray-200 dark:border-gray-700",o),...p,children:[(0,t.jsx)("div",{className:"flex-1",children:d}),e&&(0,t.jsx)("div",{className:"flex items-center gap-2 ml-4",children:e})]})}i.displayName="CardHeader";0&&(module.exports={CardHeader});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as r,jsxs as c}from"react/jsx-runtime";function i(e){switch(e){case"none":return"p-0";case"sm":return"px-3 py-2";case"lg":return"px-6 py-5";default:return"px-4 py-4"}}function p({actions:e,divider:d=!1,padding:a="md",className:t,children:o,...n}){return c("div",{className:s("flex items-center justify-between",i(a),d&&"border-b border-gray-200 dark:border-gray-700",t),...n,children:[r("div",{className:"flex-1",children:o}),e&&r("div",{className:"flex items-center gap-2 ml-4",children:e})]})}p.displayName="CardHeader";export{p as CardHeader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of m(t))!f.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(a=l(t,o))||a.enumerable});return e};var b=e=>C(s({},"__esModule",{value:!0}),e);var I={};g(I,{CardImage:()=>c});module.exports=b(I);var n=require("../../lib/cn.cjs"),i=require("react/jsx-runtime");function j(e){switch(e){case"square":return"aspect-square";case"video":return"aspect-video";case"wide":return"aspect-[21/9]";default:return""}}function v(e){switch(e){case"contain":return"object-contain";case"fill":return"object-fill";case"none":return"object-none";default:return"object-cover"}}function c({position:e="top",aspectRatio:t="auto",objectFit:r="cover",src:a,alt:o,className:p,...u}){let d=e==="top"?"rounded-t-lg":"rounded-b-lg";return(0,i.jsx)("img",{src:a,alt:o,className:(0,n.cn)("w-full",j(t),v(r),d,p),...u})}c.displayName="CardImage";0&&(module.exports={CardImage});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as i}from"../../lib/cn.js";import{jsx as l}from"react/jsx-runtime";function p(e){switch(e){case"square":return"aspect-square";case"video":return"aspect-video";case"wide":return"aspect-[21/9]";default:return""}}function u(e){switch(e){case"contain":return"object-contain";case"fill":return"object-fill";case"none":return"object-none";default:return"object-cover"}}function d({position:e="top",aspectRatio:t="auto",objectFit:o="cover",src:r,alt:a,className:s,...n}){let c=e==="top"?"rounded-t-lg":"rounded-b-lg";return l("img",{src:r,alt:a,className:i("w-full",p(t),u(o),c,s),...n})}d.displayName="CardImage";export{d as CardImage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!p.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return e};var f=e=>c(s({},"__esModule",{value:!0}),e);var u={};h(u,{CardTitle:()=>i});module.exports=f(u);var a=require("../../lib/cn.cjs"),d=require("react/jsx-runtime");function C(e){switch(e){case"sm":return"text-base font-medium";case"lg":return"text-2xl font-bold";default:return"text-xl font-semibold"}}function i({as:e="h3",size:t="md",className:r,children:n,...o}){return(0,d.jsx)(e,{className:(0,a.cn)("text-gray-900 dark:text-white",C(t),r),...o,children:n})}i.displayName="CardTitle";0&&(module.exports={CardTitle});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as s}from"../../lib/cn.js";import{jsx as d}from"react/jsx-runtime";function a(e){switch(e){case"sm":return"text-base font-medium";case"lg":return"text-2xl font-bold";default:return"text-xl font-semibold"}}function i({as:e="h3",size:t="md",className:o,children:r,...n}){return d(e,{className:s("text-gray-900 dark:text-white",a(t),o),...n,children:r})}i.displayName="CardTitle";export{i as CardTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var g=(o,r)=>{for(var p in r)t(o,p,{get:r[p],enumerable:!0})},l=(o,r,p,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of P(r))!c.call(o,e)&&e!==p&&t(o,e,{get:()=>r[e],enumerable:!(a=i(r,e))||a.enumerable});return o};var n=o=>l(t({},"__esModule",{value:!0}),o);var B={};g(B,{Card:()=>d.Card,CardBody:()=>m.CardBody,CardDescription:()=>y.CardDescription,CardFooter:()=>f.CardFooter,CardHeader:()=>C.CardHeader,CardImage:()=>x.CardImage,CardTitle:()=>s.CardTitle});module.exports=n(B);var d=require("./Card.cjs"),C=require("./CardHeader.cjs"),m=require("./CardBody.cjs"),f=require("./CardFooter.cjs"),x=require("./CardImage.cjs"),s=require("./CardTitle.cjs"),y=require("./CardDescription.cjs");0&&(module.exports={Card,CardBody,CardDescription,CardFooter,CardHeader,CardImage,CardTitle});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Card as e}from"./Card.js";import{CardHeader as t}from"./CardHeader.js";import{CardBody as d}from"./CardBody.js";import{CardFooter as m}from"./CardFooter.js";import{CardImage as x}from"./CardImage.js";import{CardTitle as y}from"./CardTitle.js";import{CardDescription as P}from"./CardDescription.js";export{e as Card,d as CardBody,P as CardDescription,m as CardFooter,t as CardHeader,x as CardImage,y as CardTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var k=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var D=(t,r)=>{for(var e in r)k(t,e,{get:r[e],enumerable:!0})},$=(t,r,e,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of v(r))!M.call(t,a)&&a!==e&&k(t,a,{get:()=>r[a],enumerable:!(l=_(r,a))||l.enumerable});return t};var w=t=>$(k({},"__esModule",{value:!0}),t);var L={};D(L,{ChartAnnotationLayer:()=>E,describeAnnotations:()=>G});module.exports=w(L);var m=require("./utils/text.cjs"),n=require("react/jsx-runtime"),A=10,C=15,x=5,h=6,b=4,B=.1;function P({x:t,y:r,text:e,align:l}){let a=(0,m.estimateTextWidth)(e,A)+x*2,y=l==="start"?t:t-a;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{x:y,y:r,width:a,height:C,rx:3,className:"fill-white stroke-gray-200 dark:fill-gray-800 dark:stroke-gray-700",strokeWidth:1}),(0,n.jsx)("text",{x:y+x,y:r+C/2,dominantBaseline:"central",className:"fill-gray-600 text-[10px] dark:fill-gray-300",children:e})]})}function E({annotations:t,xAt:r,yAt:e,width:l,height:a,bandwidth:y=0,layer:O="over"}){if(t.length===0)return null;if(O==="under"){let o=t.filter(s=>s.type==="band");return o.length===0?null:(0,n.jsx)("g",{"aria-hidden":"true",children:o.map((s,i)=>{let d=r(s.from),c=r(s.to);if(d===null||c===null)return null;let u=Math.max(0,Math.min(d,c)-y/2),g=Math.min(l,Math.max(d,c)+y/2)-u;if(g<=0)return null;let f=s.label??"",p=(0,m.estimateTextWidth)(f,A)+x*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{x:u,y:0,width:g,height:a,fill:s.color??"var(--color-chart-muted)",opacity:B}),f&&p<=g?(0,n.jsx)(P,{x:u+2,y:2,text:f,align:"start"}):null]},`band-${i}`)})})}let N=t.filter(o=>o.type!=="band");return N.length===0?null:(0,n.jsx)("g",{"aria-hidden":"true",children:N.map((o,s)=>{let i=r(o.x);if(i===null)return null;let d=o.color??"var(--color-chart-muted)";if(o.type==="line"){let p=o.label??"",W=(0,m.estimateTextWidth)(p,A)+x*2,T=i+h+W<=l?"start":"end";return(0,n.jsxs)("g",{children:[(0,n.jsx)("line",{x1:i,y1:0,x2:i,y2:a,stroke:d,strokeWidth:1,strokeDasharray:o.dashed===!1?void 0:"3 3"}),p?(0,n.jsx)(P,{x:T==="start"?i+h:i-h,y:2,text:p,align:T}):null]},`line-${s}`)}let c=e(o.y);if(!Number.isFinite(c))return null;let u=o.label??"",I=(0,m.estimateTextWidth)(u,A)+x*2,g=i+b+h+I<=l?"start":"end",f=Math.min(Math.max(0,c-C-h),a-C);return(0,n.jsxs)("g",{children:[(0,n.jsx)("circle",{cx:i,cy:c,r:b,fill:"none",stroke:d,strokeWidth:2}),u?(0,n.jsx)(P,{x:g==="start"?i+b+h:i-b-h,y:f,text:u,align:g}):null]},`point-${s}`)})})}function G(t,r){if(!t||t.length===0)return"";let e=t.map(l=>l.label).filter(l=>!!l);return e.length===0?"":`${r}: ${e.join(", ")}`}0&&(module.exports={ChartAnnotationLayer,describeAnnotations});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{estimateTextWidth as b}from"./utils/text.js";import{jsx as e,jsxs as C}from"react/jsx-runtime";var A=10,k=15,m=5,u=6,x=4,_=.1;function P({x:n,y:o,text:i,align:l}){let h=b(i,A)+m*2,y=l==="start"?n:n-h;return C("g",{children:[e("rect",{x:y,y:o,width:h,height:k,rx:3,className:"fill-white stroke-gray-200 dark:fill-gray-800 dark:stroke-gray-700",strokeWidth:1}),e("text",{x:y+m,y:o+k/2,dominantBaseline:"central",className:"fill-gray-600 text-[10px] dark:fill-gray-300",children:i})]})}function M({annotations:n,xAt:o,yAt:i,width:l,height:h,bandwidth:y=0,layer:O="over"}){if(n.length===0)return null;if(O==="under"){let t=n.filter(a=>a.type==="band");return t.length===0?null:e("g",{"aria-hidden":"true",children:t.map((a,r)=>{let d=o(a.from),s=o(a.to);if(d===null||s===null)return null;let c=Math.max(0,Math.min(d,s)-y/2),g=Math.min(l,Math.max(d,s)+y/2)-c;if(g<=0)return null;let f=a.label??"",p=b(f,A)+m*2;return C("g",{children:[e("rect",{x:c,y:0,width:g,height:h,fill:a.color??"var(--color-chart-muted)",opacity:_}),f&&p<=g?e(P,{x:c+2,y:2,text:f,align:"start"}):null]},`band-${r}`)})})}let N=n.filter(t=>t.type!=="band");return N.length===0?null:e("g",{"aria-hidden":"true",children:N.map((t,a)=>{let r=o(t.x);if(r===null)return null;let d=t.color??"var(--color-chart-muted)";if(t.type==="line"){let p=t.label??"",W=b(p,A)+m*2,T=r+u+W<=l?"start":"end";return C("g",{children:[e("line",{x1:r,y1:0,x2:r,y2:h,stroke:d,strokeWidth:1,strokeDasharray:t.dashed===!1?void 0:"3 3"}),p?e(P,{x:T==="start"?r+u:r-u,y:2,text:p,align:T}):null]},`line-${a}`)}let s=i(t.y);if(!Number.isFinite(s))return null;let c=t.label??"",I=b(c,A)+m*2,g=r+x+u+I<=l?"start":"end",f=Math.min(Math.max(0,s-k-u),h-k);return C("g",{children:[e("circle",{cx:r,cy:s,r:x,fill:"none",stroke:d,strokeWidth:2}),c?e(P,{x:g==="start"?r+x+u:r-x-u,y:f,text:c,align:g}):null]},`point-${a}`)})})}function D(n,o){if(!n||n.length===0)return"";let i=n.map(l=>l.label).filter(l=>!!l);return i.length===0?"":`${o}: ${i.join(", ")}`}export{M as ChartAnnotationLayer,D as describeAnnotations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var A=(a,r)=>{for(var o in r)m(a,o,{get:r[o],enumerable:!0})},w=(a,r,o,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of b(r))!c.call(a,e)&&e!==o&&m(a,e,{get:()=>r[e],enumerable:!(i=C(r,e))||i.enumerable});return a};var N=a=>w(m({},"__esModule",{value:!0}),a);var R={};A(R,{ChartAxis:()=>P});module.exports=N(R);var d=require("../../lib/cn.cjs"),f=require("./utils/text.cjs"),n=require("react/jsx-runtime"),$=10,O={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function P({orientation:a,ticks:r,length:o,showLine:i=!0,tickSize:e=4,tickPadding:l=6,label:h,size:x="md",className:p,...g}){let t=a==="bottom";return(0,n.jsxs)("g",{className:(0,d.cn)(O[x],p),"aria-hidden":"true",...g,children:[i&&(0,n.jsx)("line",{x1:0,y1:0,x2:t?o:0,y2:t?0:o,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"}),r.map(s=>{let y=t?s.offset:0,u=t?0:s.offset;return(0,n.jsxs)("g",{transform:`translate(${y}, ${u})`,children:[e>0?(0,n.jsx)("line",{x1:0,y1:0,x2:t?0:-e,y2:t?e:0,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1}):null,(0,n.jsx)("text",{x:t?0:-(e+l),y:t?e+l:0,textAnchor:t?"middle":"end",dominantBaseline:t?"hanging":"middle",className:"fill-gray-500 dark:fill-gray-400 [font-variant-numeric:tabular-nums]",children:s.label})]},`${s.label}-${s.offset}`)}),h?(0,n.jsx)("text",{x:t?o/2:0,y:t?e+l+16:0,textAnchor:"middle",dominantBaseline:t?"hanging":"middle",transform:t?void 0:`translate(${-(e+l+(0,f.widestLabel)(r.map(s=>s.label))+$)}, ${o/2}) rotate(-90)`,className:"fill-gray-600 dark:fill-gray-300 font-medium",children:h}):null]})}0&&(module.exports={ChartAxis});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as y}from"../../lib/cn.js";import{widestLabel as u}from"./utils/text.js";import{jsx as n,jsxs as l}from"react/jsx-runtime";var C=10,b={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function w({orientation:m,ticks:s,length:a,showLine:h=!0,tickSize:e=4,tickPadding:o=6,label:i,size:d="md",className:f,...x}){let t=m==="bottom";return l("g",{className:y(b[d],f),"aria-hidden":"true",...x,children:[h&&n("line",{x1:0,y1:0,x2:t?a:0,y2:t?0:a,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"}),s.map(r=>{let p=t?r.offset:0,g=t?0:r.offset;return l("g",{transform:`translate(${p}, ${g})`,children:[e>0?n("line",{x1:0,y1:0,x2:t?0:-e,y2:t?e:0,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1}):null,n("text",{x:t?0:-(e+o),y:t?e+o:0,textAnchor:t?"middle":"end",dominantBaseline:t?"hanging":"middle",className:"fill-gray-500 dark:fill-gray-400 [font-variant-numeric:tabular-nums]",children:r.label})]},`${r.label}-${r.offset}`)}),i?n("text",{x:t?a/2:0,y:t?e+o+16:0,textAnchor:"middle",dominantBaseline:t?"hanging":"middle",transform:t?void 0:`translate(${-(e+o+u(s.map(r=>r.label))+C)}, ${a/2}) rotate(-90)`,className:"fill-gray-600 dark:fill-gray-300 font-medium",children:i}):null]})}export{w as ChartAxis};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var P=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var K=(r,o)=>{for(var n in o)P(r,n,{get:o[n],enumerable:!0})},O=(r,o,n,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of M(o))!I.call(r,l)&&l!==n&&P(r,l,{get:()=>o[l],enumerable:!(i=A(o,l))||i.enumerable});return r};var U=r=>O(P({},"__esModule",{value:!0}),r);var H={};K(H,{ChartBrushLayer:()=>N,useChartBrush:()=>X});module.exports=U(H);var u=require("react"),b=require("./utils/scales.cjs"),E=require("react/jsx-runtime"),T=4,L=.14;function N({from:r,to:o,width:n,height:i,orientation:l="vertical",live:p=!1,label:s}){let g=Math.max(0,Math.min(r,o)),d=Math.min(l==="vertical"?n:i,Math.max(r,o)),h=d-g;if(h<=0)return null;let f=l==="vertical",y=f?{x:g,y:0,width:h,height:i}:{x:0,y:g,width:n,height:h},m=a=>f?{x1:a,y1:0,x2:a,y2:i}:{x1:0,y1:a,x2:n,y2:a};return(0,E.jsxs)("g",{"aria-hidden":s?void 0:"true",role:s?"img":void 0,"aria-label":s,children:[(0,E.jsx)("rect",{...y,className:"fill-blue-500",opacity:L}),[g,d].map(a=>(0,E.jsx)("line",{...m(a),className:"stroke-blue-600 dark:stroke-blue-400",strokeWidth:1.5,strokeDasharray:p?"3 3":void 0},a))]})}function X({enabled:r,active:o,centers:n,xValues:i,offset:l,orientation:p,onCommit:s}){let[g,d]=(0,u.useState)(null),h=(0,u.useRef)(null),f=(0,u.useRef)(!1),y=(0,u.useRef)(!1),m=(0,u.useRef)(null),a=(0,u.useCallback)((e,t)=>{let[c,x]=e<=t?[e,t]:[t,e];return{from:i[c],to:i[x],fromIndex:c,toIndex:x}},[i]),R=(0,u.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return p==="vertical"?e.clientX-t.left-l:e.clientY-t.top-l},[p,l]),S=(0,u.useCallback)(e=>{if(!r||n.length===0||e.button!==0)return;let t=R(e),c=(0,b.nearestIndex)(n,t);c<0||(h.current={index:c,pixel:t},f.current=!1,y.current=!1,e.currentTarget.setPointerCapture?.(e.pointerId))},[r,n,R]),G=(0,u.useCallback)(e=>{let t=h.current;if(!r||!t)return;let c=R(e);!f.current&&Math.abs(c-t.pixel)<T||(f.current=!0,d(a(t.index,(0,b.nearestIndex)(n,c))))},[r,n,R,a]),V=(0,u.useCallback)(e=>{let t=h.current;if(h.current=null,!r||!t)return;if(e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),!f.current){d(null),o&&s(null);return}y.current=!0,f.current=!1;let c=a(t.index,(0,b.nearestIndex)(n,R(e)));d(null),m.current=c.fromIndex,s(c)},[r,o,n,R,a,s]),v=(0,u.useCallback)((e,t)=>{if(!r||n.length===0)return;if(e.key==="Escape"){m.current=null,d(null),o&&s(null);return}if(!e.shiftKey){m.current=null;return}let c=p==="vertical",x=c?"ArrowRight":"ArrowDown",k=c?"ArrowLeft":"ArrowUp";if(e.key!==x&&e.key!==k)return;let w=n.length-1,C=m.current??t??0,D=Math.min(w,Math.max(0,(t??C)+(e.key===x?1:-1)));m.current=C,s(a(C,D))},[r,o,n.length,p,a,s]),B=(0,u.useCallback)(()=>{let e=y.current;return y.current=!1,e},[]);return{dragging:g,onPointerDown:S,onPointerMove:G,onPointerUp:V,onKeyDown:v,consumedClick:B}}0&&(module.exports={ChartBrushLayer,useChartBrush});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCallback as d,useRef as E,useState as A}from"react";import{nearestIndex as C}from"./utils/scales.js";import{jsx as P,jsxs as K}from"react/jsx-runtime";var M=4,I=.14;function T({from:u,to:i,width:n,height:s,orientation:m="vertical",live:p=!1,label:a}){let g=Math.max(0,Math.min(u,i)),h=Math.min(m==="vertical"?n:s,Math.max(u,i)),c=h-g;if(c<=0)return null;let l=m==="vertical",y=l?{x:g,y:0,width:c,height:s}:{x:0,y:g,width:n,height:c},f=t=>l?{x1:t,y1:0,x2:t,y2:s}:{x1:0,y1:t,x2:n,y2:t};return K("g",{"aria-hidden":a?void 0:"true",role:a?"img":void 0,"aria-label":a,children:[P("rect",{...y,className:"fill-blue-500",opacity:I}),[g,h].map(t=>P("line",{...f(t),className:"stroke-blue-600 dark:stroke-blue-400",strokeWidth:1.5,strokeDasharray:p?"3 3":void 0},t))]})}function L({enabled:u,active:i,centers:n,xValues:s,offset:m,orientation:p,onCommit:a}){let[g,h]=A(null),c=E(null),l=E(!1),y=E(!1),f=E(null),t=d((e,r)=>{let[o,x]=e<=r?[e,r]:[r,e];return{from:s[o],to:s[x],fromIndex:o,toIndex:x}},[s]),R=d(e=>{let r=e.currentTarget.getBoundingClientRect();return p==="vertical"?e.clientX-r.left-m:e.clientY-r.top-m},[p,m]),S=d(e=>{if(!u||n.length===0||e.button!==0)return;let r=R(e),o=C(n,r);o<0||(c.current={index:o,pixel:r},l.current=!1,y.current=!1,e.currentTarget.setPointerCapture?.(e.pointerId))},[u,n,R]),G=d(e=>{let r=c.current;if(!u||!r)return;let o=R(e);!l.current&&Math.abs(o-r.pixel)<M||(l.current=!0,h(t(r.index,C(n,o))))},[u,n,R,t]),V=d(e=>{let r=c.current;if(c.current=null,!u||!r)return;if(e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),!l.current){h(null),i&&a(null);return}y.current=!0,l.current=!1;let o=t(r.index,C(n,R(e)));h(null),f.current=o.fromIndex,a(o)},[u,i,n,R,t,a]),v=d((e,r)=>{if(!u||n.length===0)return;if(e.key==="Escape"){f.current=null,h(null),i&&a(null);return}if(!e.shiftKey){f.current=null;return}let o=p==="vertical",x=o?"ArrowRight":"ArrowDown",k=o?"ArrowLeft":"ArrowUp";if(e.key!==x&&e.key!==k)return;let w=n.length-1,b=f.current??r??0,D=Math.min(w,Math.max(0,(r??b)+(e.key===x?1:-1)));f.current=b,a(t(b,D))},[u,i,n.length,p,t,a]),B=d(()=>{let e=y.current;return y.current=!1,e},[]);return{dragging:g,onPointerDown:S,onPointerMove:G,onPointerUp:V,onKeyDown:v,consumedClick:B}}export{T as ChartBrushLayer,L as useChartBrush};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var g=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var X=(r,t)=>{for(var a in t)g(r,a,{get:t[a],enumerable:!0})},Y=(r,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of K(t))!Q.call(r,o)&&o!==a&&g(r,o,{get:()=>t[o],enumerable:!(l=J(t,o))||l.enumerable});return r};var _=r=>Y(g({},"__esModule",{value:!0}),r);var ae={};X(ae,{ChartContainer:()=>re});module.exports=_(ae);var c=require("react"),d=require("../../lib/cn.cjs"),I=require("../../lib/i18n.cjs"),T=require("../circular-progress/CircularProgress.cjs"),z=require("./useChartSize.cjs"),e=require("react/jsx-runtime"),ee=(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"text-red-600 dark:text-red-400",children:[(0,e.jsx)("path",{d:"M10 3.5 2.5 16.5h15L10 3.5Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M10 8v3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),(0,e.jsx)("circle",{cx:"10",cy:"14",r:"0.9",fill:"currentColor"})]}),te={sm:"text-xs",md:"text-sm",lg:"text-base"};function re({title:r,description:t,height:a=240,width:l,size:o="md",legend:i,legendPosition:u="bottom",actions:x,loading:n=!1,empty:y=!1,emptyState:A,error:f=!1,errorState:P,onRetry:v,errorLabel:j,errorHintLabel:H,retryLabel:W,table:m,tableView:w=!1,showTableLabel:B,hideTableLabel:D,noDataLabel:M,loadingLabel:O,ariaLabel:N,children:h,className:$,...U}){let s=(0,I.useUILabels)(),[b,V]=(0,c.useState)(!1),p=(0,c.useId)(),C=`${p}-table`,k=`${p}-title`,L=`${p}-description`,{ref:Z,width:q,measured:F}=(0,z.useChartSize)({width:l}),R=!!m&&w==="toggle",S=!!m&&(w===!0||R&&b),E=(0,e.jsx)("div",{ref:Z,className:"relative w-full",style:{height:a},"aria-busy":n||void 0,children:n&&(y||f)?(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,e.jsx)(T.CircularProgress,{indeterminate:!0,size:"md","aria-label":O??s.chartLoading})}):f&&!n?(0,e.jsx)("div",{role:"alert",className:"flex h-full w-full flex-col items-center justify-center gap-2 px-4 text-center",children:P??(0,e.jsxs)(e.Fragment,{children:[ee,(0,e.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:j??s.chartError}),(0,e.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:H??s.chartErrorHint}),v?(0,e.jsx)("button",{type:"button",onClick:v,className:"mt-1 cursor-pointer rounded-md border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:W??s.chartRetry}):null]})}):y&&!n&&!f?(0,e.jsx)("div",{className:"flex h-full w-full items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:A??M??s.chartNoData}):(0,e.jsx)("div",{className:(0,d.cn)("h-full w-full transition-opacity duration-200",n&&"opacity-60"),children:typeof h=="function"?h({width:q,height:a,measured:F}):h})});return(0,e.jsxs)("figure",{className:(0,d.cn)("flex w-full flex-col gap-3",$),"aria-label":N,"aria-labelledby":!N&&r?k:void 0,"aria-describedby":t?L:void 0,...U,children:[r||t||x?(0,e.jsxs)("figcaption",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r?(0,e.jsx)("span",{id:k,className:(0,d.cn)("font-semibold text-gray-900 dark:text-gray-100",te[o]),children:r}):null,t?(0,e.jsx)("span",{id:L,className:"text-xs text-gray-500 dark:text-gray-400",children:t}):null]}),x]}):null,i&&u==="top"?i:null,i&&u==="right"?(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsx)("div",{className:"min-w-0 grow",children:E}),i]}):E,i&&u==="bottom"?i:null,R&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsx)("button",{type:"button",onClick:()=>V(G=>!G),"aria-expanded":b,"aria-controls":S?C:void 0,className:"cursor-pointer rounded-sm text-xs font-medium text-gray-600 underline underline-offset-2 hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:text-gray-400 dark:hover:text-white",children:b?D??s.chartHideTable:B??s.chartShowTable})}),S&&(0,e.jsx)("div",{id:C,children:m})]})}0&&(module.exports={ChartContainer});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useId as Z,useState as q}from"react";import{cn as m}from"../../lib/cn.js";import{useUILabels as F}from"../../lib/i18n.js";import{CircularProgress as G}from"../circular-progress/CircularProgress.js";import{useChartSize as J}from"./useChartSize.js";import{Fragment as X,jsx as e,jsxs as a}from"react/jsx-runtime";var K=a("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"text-red-600 dark:text-red-400",children:[e("path",{d:"M10 3.5 2.5 16.5h15L10 3.5Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),e("path",{d:"M10 8v3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e("circle",{cx:"10",cy:"14",r:"0.9",fill:"currentColor"})]}),Q={sm:"text-xs",md:"text-sm",lg:"text-base"};function ie({title:s,description:i,height:h=240,width:R,size:S="md",legend:r,legendPosition:n="bottom",actions:b,loading:o=!1,empty:p=!1,emptyState:E,error:l=!1,errorState:I,onRetry:g,errorLabel:T,errorHintLabel:z,retryLabel:A,table:d,tableView:x=!1,showTableLabel:P,hideTableLabel:j,noDataLabel:H,loadingLabel:W,ariaLabel:y,children:c,className:B,...D}){let t=F(),[u,M]=q(!1),f=Z(),v=`${f}-table`,w=`${f}-title`,N=`${f}-description`,{ref:O,width:$,measured:U}=J({width:R}),C=!!d&&x==="toggle",k=!!d&&(x===!0||C&&u),L=e("div",{ref:O,className:"relative w-full",style:{height:h},"aria-busy":o||void 0,children:o&&(p||l)?e("div",{className:"flex h-full w-full items-center justify-center",children:e(G,{indeterminate:!0,size:"md","aria-label":W??t.chartLoading})}):l&&!o?e("div",{role:"alert",className:"flex h-full w-full flex-col items-center justify-center gap-2 px-4 text-center",children:I??a(X,{children:[K,e("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:T??t.chartError}),e("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:z??t.chartErrorHint}),g?e("button",{type:"button",onClick:g,className:"mt-1 cursor-pointer rounded-md border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:A??t.chartRetry}):null]})}):p&&!o&&!l?e("div",{className:"flex h-full w-full items-center justify-center text-sm text-gray-500 dark:text-gray-400",children:E??H??t.chartNoData}):e("div",{className:m("h-full w-full transition-opacity duration-200",o&&"opacity-60"),children:typeof c=="function"?c({width:$,height:h,measured:U}):c})});return a("figure",{className:m("flex w-full flex-col gap-3",B),"aria-label":y,"aria-labelledby":!y&&s?w:void 0,"aria-describedby":i?N:void 0,...D,children:[s||i||b?a("figcaption",{className:"flex items-start justify-between gap-3",children:[a("div",{className:"flex flex-col gap-0.5",children:[s?e("span",{id:w,className:m("font-semibold text-gray-900 dark:text-gray-100",Q[S]),children:s}):null,i?e("span",{id:N,className:"text-xs text-gray-500 dark:text-gray-400",children:i}):null]}),b]}):null,r&&n==="top"?r:null,r&&n==="right"?a("div",{className:"flex items-start gap-4",children:[e("div",{className:"min-w-0 grow",children:L}),r]}):L,r&&n==="bottom"?r:null,C&&e("div",{className:"flex",children:e("button",{type:"button",onClick:()=>M(V=>!V),"aria-expanded":u,"aria-controls":k?v:void 0,className:"cursor-pointer rounded-sm text-xs font-medium text-gray-600 underline underline-offset-2 hover:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 dark:text-gray-400 dark:hover:text-white",children:u?j??t.chartHideTable:P??t.chartShowTable})}),k&&e("div",{id:v,children:d})]})}export{ie as ChartContainer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var c=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var L=(t,o)=>{for(var s in o)c(t,s,{get:o[s],enumerable:!0})},M=(t,o,s,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of O(o))!S.call(t,n)&&n!==s&&c(t,n,{get:()=>o[n],enumerable:!(i=N(o,n))||i.enumerable});return t};var P=t=>M(c({},"__esModule",{value:!0}),t);var J={};L(J,{ChartExportButton:()=>j});module.exports=P(J);var b=require("react"),f=require("../../lib/cn.cjs"),y=require("../../lib/i18n.cjs"),v=require("../dropdown/Dropdown.cjs"),w=require("../dropdown/DropdownContent.cjs"),E=require("../dropdown/DropdownItem.cjs"),k=require("../dropdown/DropdownTrigger.cjs"),D=require("./utils/export.cjs"),r=require("react/jsx-runtime"),T={sm:"h-7 px-2.5 text-xs",md:"h-8 px-3 text-sm",lg:"h-10 px-4 text-sm"},C=(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"shrink-0",children:(0,r.jsx)("path",{d:"M8 2v8m0 0 3-3m-3 3L5 7M2.5 12.5h11",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})});function j({data:t,series:o,xKey:s,xLabel:i,formatX:n,formats:a=["csv","json"],filename:d="chart",size:F="md",label:z,onExport:p,className:B,disabled:h}){let l=(0,y.useUILabels)(),m=(0,b.useCallback)(e=>{let x={data:t,series:o,xKey:s,xLabel:i,formatX:n};p?p(e,x):(0,D.downloadChartData)(e,x,d)},[t,o,s,i,n,p,d]),g=z??l.chartExport,I=e=>e==="csv"?l.chartExportCsv:l.chartExportJson,u=(0,f.cn)("inline-flex cursor-pointer items-center gap-2 rounded-full border border-gray-300 bg-white font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",T[F],B);if(a.length<=1){let e=a[0]??"csv";return(0,r.jsxs)("button",{type:"button",onClick:()=>m(e),disabled:h||t.length===0,className:u,children:[C,(0,r.jsx)("span",{children:g})]})}return(0,r.jsxs)(v.Dropdown,{children:[(0,r.jsxs)(k.DropdownTrigger,{disabled:h||t.length===0,className:u,children:[C,(0,r.jsx)("span",{children:g})]}),(0,r.jsx)(w.DropdownContent,{children:a.map(e=>(0,r.jsx)(E.DropdownItem,{onSelect:()=>m(e),children:I(e)},e))})]})}0&&(module.exports={ChartExportButton});
|
|
@@ -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});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as x,jsx as s,jsxs as k}from"react/jsx-runtime";var l="var(--color-chart-surface)",f=["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(r){return!Number.isFinite(r)||r<0?"solid":f[Math.floor(r)%f.length]}function p(r,e){return`${r.replace(/[^a-zA-Z0-9_-]/g,"")}-texture-${Math.max(0,Math.floor(e))}`}function b(r,e,n,o){return!r||g(n)==="solid"?o:`url(#${p(e,n)})`}function C({id:r,entries:e}){return s("defs",{children:e.map(({slot:n,color:o})=>{let i=h[g(n)];if(!i)return null;let{tile:t,rotate:u,stroke:a,crossed:d,dot:c}=i;return k("pattern",{id:p(r,n),width:t,height:t,patternUnits:"userSpaceOnUse",patternTransform:u===0?void 0:`rotate(${u})`,children:[s("rect",{width:t,height:t,fill:o}),c?k(x,{children:[s("circle",{cx:t/4,cy:t/4,r:c,fill:l}),s("circle",{cx:t*3/4,cy:t*3/4,r:c,fill:l})]}):null,a>0?s("line",{x1:t/2,y1:0,x2:t/2,y2:t,stroke:l,strokeWidth:a}):null,d?s("line",{x1:0,y1:t/2,x2:t,y2:t/2,stroke:l,strokeWidth:a}):null]},p(r,n))})})}function m(r,e){let n=h[g(r)];if(!n)return{backgroundColor:e};let{tile:o,rotate:i,stroke:t,crossed:u,dot:a}=n;if(a)return{backgroundColor:e,backgroundImage:`radial-gradient(${l} ${a-.4}px, transparent ${a}px)`,backgroundSize:`${o/2}px ${o/2}px`};let d=c=>`repeating-linear-gradient(${c}deg, ${l} 0 ${t}px, transparent ${t}px ${o}px)`;return{backgroundColor:e,backgroundImage:u?`${d(i)}, ${d(i+90)}`:d(i)}}export{f as CHART_PATTERNS,l as CHART_SURFACE_COLOR,C as ChartPatternDefs,g as getPattern,m as patternBackground,b as patternFill,p as patternId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var C=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var te=(n,o)=>{for(var l in o)C(n,l,{get:o[l],enumerable:!0})},re=(n,o,l,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of Z(o))!ee.call(n,d)&&d!==l&&C(n,d,{get:()=>o[d],enumerable:!(c=X(o,d))||c.enumerable});return n};var oe=n=>re(C({},"__esModule",{value:!0}),n);var de={};te(de,{ChartPeriodPicker:()=>se});module.exports=oe(de);var t=require("react"),T=require("react-dom"),O=require("../../lib/aria-hide.cjs"),g=require("../../lib/cn.cjs"),N=require("../../lib/i18n.cjs"),z=require("../calendar/Calendar.cjs"),I=require("../dropdown/hooks/usePositioning.cjs"),a=require("./utils/period.cjs"),r=require("react/jsx-runtime"),ae={"7d":"chartPeriodLast7Days","30d":"chartPeriodLast30Days","90d":"chartPeriodLast90Days","12m":"chartPeriodLast12Months",mtd:"chartPeriodMonthToDate",qtd:"chartPeriodQuarterToDate",ytd:"chartPeriodYearToDate",custom:"chartPeriodCustom"},ne={sm:"h-7 px-2.5 text-xs",md:"h-8 px-3 text-sm",lg:"h-10 px-4 text-sm"},ie=(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:"M5 1.5v2M11 1.5v2M2.5 6h11M3.5 3h9a1 1 0 011 1v9a1 1 0 01-1 1h-9a1 1 0 01-1-1V4a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})});function se({value:n,defaultValue:o,onChange:l,presets:c=a.DEFAULT_CHART_PERIOD_PRESETS,custom:d=!0,presetLabels:A,now:f,minDate:F,maxDate:W,numberOfMonths:H=1,weekStartsOn:U,locale:k,size:_="md",align:B="start",disabled:K=!1,label:x,className:q,...Y}){let y=(0,N.useUILabels)(),m=(0,t.useRef)(null),p=(0,t.useRef)(null),D=(0,t.useRef)(null),[i,L]=(0,t.useState)(!1),[E,R]=(0,t.useState)(!1),[$,w]=(0,t.useState)(null),[Q,j]=(0,t.useState)(()=>typeof o=="string"?(0,a.createPeriod)(o,f):o||(0,a.createPeriod)(c[0]??"30d",f)),s=n??Q,P=(0,I.usePositioning)({triggerRef:m,contentRef:p,isOpen:i,side:"bottom",align:B}),u=(0,t.useCallback)((e=!0)=>{L(!1),R(!1),w(null),e&&m.current?.focus()},[]);(0,t.useEffect)(()=>{if(!i)return;let e=h=>{let S=h.target;p.current?.contains(S)||m.current?.contains(S)||u(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e,{passive:!0}),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[i,u]),(0,t.useEffect)(()=>{if(!i)return;let e=h=>{h.key==="Escape"&&(h.stopPropagation(),u())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i,u]),(0,t.useEffect)(()=>{let e=p.current;if(e)return(0,O.registerFloatingLayer)(e,()=>m.current)},[i]),(0,t.useEffect)(()=>{if(!i)return;let e=requestAnimationFrame(()=>D.current?.focus());return()=>cancelAnimationFrame(e)},[i]);let b=(0,t.useCallback)(e=>{n===void 0&&j(e),l?.(e),u()},[n,l,u]),G=(0,t.useCallback)(e=>b((0,a.createPeriod)(e,f)),[b,f]),J=(0,t.useCallback)(e=>{w(e),!(!e.from||!e.to)&&b({preset:"custom",from:(0,a.startOfDay)(e.from),to:(0,a.endOfDay)(e.to)})},[b]),v=e=>A?.[e]??y[ae[e]],M=s.preset==="custom"?(0,a.formatPeriodRange)(s.from,s.to,k):v(s.preset),V=(0,r.jsxs)("div",{ref:p,role:"dialog","aria-label":x??y.chartPeriod,style:{position:"fixed",top:P.top,left:P.left,visibility:P.isReady?"visible":"hidden"},className:"z-50 flex overflow-hidden rounded-lg border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800",children:[(0,r.jsxs)("div",{ref:D,tabIndex:-1,className:"flex min-w-44 flex-col p-1 outline-none",children:[c.map(e=>(0,r.jsx)("button",{type:"button","aria-pressed":s.preset===e,onClick:()=>G(e),className:(0,g.cn)("cursor-pointer rounded-md px-3 py-1.5 text-left text-sm text-gray-700 hover:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-blue-500 dark:text-gray-200 dark:hover:bg-gray-700",s.preset===e&&"bg-blue-50 font-medium text-blue-700 dark:bg-blue-950 dark:text-blue-300"),children:v(e)},e)),d?(0,r.jsx)("button",{type:"button","aria-pressed":s.preset==="custom","aria-expanded":E,onClick:()=>R(!0),className:(0,g.cn)("cursor-pointer rounded-md px-3 py-1.5 text-left text-sm text-gray-700 hover:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-blue-500 dark:text-gray-200 dark:hover:bg-gray-700",s.preset==="custom"&&"bg-blue-50 font-medium text-blue-700 dark:bg-blue-950 dark:text-blue-300"),children:v("custom")}):null]}),d&&E?(0,r.jsx)("div",{className:"border-l border-gray-200 p-2 dark:border-gray-700",children:(0,r.jsx)(z.Calendar,{mode:"range",value:$??{from:s.from,to:s.to},onChange:J,numberOfMonths:H,weekStartsOn:U,locale:k,minDate:F,maxDate:W,size:"sm"})}):null]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{ref:m,type:"button",disabled:K,"aria-haspopup":"dialog","aria-expanded":i,"aria-label":`${x??y.chartPeriod}: ${M}`,onClick:()=>i?u():L(!0),className:(0,g.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",ne[_],q),...Y,children:[ie,(0,r.jsx)("span",{children:M})]}),i&&typeof document<"u"?(0,T.createPortal)(V,document.body):null]})}0&&(module.exports={ChartPeriodPicker});
|