@synertech/ui 0.44.0 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/use-synertech-ui/SKILL.md +76 -5
- package/README.md +36 -8
- package/dist/components/accordion/Accordion.cjs +1 -0
- package/dist/components/accordion/Accordion.js +1 -0
- package/dist/components/accordion/index.cjs +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/advance-detachable/AdvanceDetachable.cjs +1 -0
- package/dist/components/advance-detachable/AdvanceDetachable.js +1 -0
- package/dist/components/advance-detachable/index.cjs +1 -0
- package/dist/components/advance-detachable/index.js +1 -0
- package/dist/components/area-chart/AreaChart.cjs +1 -0
- package/dist/components/area-chart/AreaChart.js +1 -0
- package/dist/components/area-chart/index.cjs +1 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/avatar/Avatar.cjs +1 -0
- package/dist/components/avatar/Avatar.js +1 -0
- package/dist/components/avatar/index.cjs +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/Badge.cjs +1 -0
- package/dist/components/badge/Badge.js +1 -0
- package/dist/components/badge/index.cjs +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/banner/Banner.cjs +1 -0
- package/dist/components/banner/Banner.js +1 -0
- package/dist/components/banner/index.cjs +1 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/bar-chart/BarChart.cjs +1 -0
- package/dist/components/bar-chart/BarChart.js +1 -0
- package/dist/components/bar-chart/index.cjs +1 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/box-plot/BoxPlot.cjs +1 -0
- package/dist/components/box-plot/BoxPlot.js +1 -0
- package/dist/components/box-plot/index.cjs +1 -0
- package/dist/components/box-plot/index.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.cjs +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/breadcrumb/index.cjs +1 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/bullet-chart/BulletChart.cjs +1 -0
- package/dist/components/bullet-chart/BulletChart.js +1 -0
- package/dist/components/bullet-chart/index.cjs +1 -0
- package/dist/components/bullet-chart/index.js +1 -0
- package/dist/components/button/Button.cjs +1 -0
- package/dist/components/button/Button.js +1 -0
- package/dist/components/button/index.cjs +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.cjs +1 -0
- package/dist/components/button-group/ButtonGroup.js +1 -0
- package/dist/components/button-group/index.cjs +1 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/calendar/Calendar.cjs +1 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/index.cjs +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/candlestick-chart/CandlestickChart.cjs +1 -0
- package/dist/components/candlestick-chart/CandlestickChart.js +1 -0
- package/dist/components/candlestick-chart/index.cjs +1 -0
- package/dist/components/candlestick-chart/index.js +1 -0
- package/dist/components/card/Card.cjs +1 -0
- package/dist/components/card/Card.js +1 -0
- package/dist/components/card/CardBody.cjs +1 -0
- package/dist/components/card/CardBody.js +1 -0
- package/dist/components/card/CardDescription.cjs +1 -0
- package/dist/components/card/CardDescription.js +1 -0
- package/dist/components/card/CardFooter.cjs +1 -0
- package/dist/components/card/CardFooter.js +1 -0
- package/dist/components/card/CardHeader.cjs +1 -0
- package/dist/components/card/CardHeader.js +1 -0
- package/dist/components/card/CardImage.cjs +1 -0
- package/dist/components/card/CardImage.js +1 -0
- package/dist/components/card/CardTitle.cjs +1 -0
- package/dist/components/card/CardTitle.js +1 -0
- package/dist/components/card/index.cjs +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/chart/ChartAnnotations.cjs +1 -0
- package/dist/components/chart/ChartAnnotations.js +1 -0
- package/dist/components/chart/ChartAxis.cjs +1 -0
- package/dist/components/chart/ChartAxis.js +1 -0
- package/dist/components/chart/ChartBrush.cjs +1 -0
- package/dist/components/chart/ChartBrush.js +1 -0
- package/dist/components/chart/ChartContainer.cjs +1 -0
- package/dist/components/chart/ChartContainer.js +1 -0
- package/dist/components/chart/ChartExportButton.cjs +1 -0
- package/dist/components/chart/ChartExportButton.js +1 -0
- package/dist/components/chart/ChartFacets.cjs +1 -0
- package/dist/components/chart/ChartFacets.js +1 -0
- package/dist/components/chart/ChartFilterBar.cjs +1 -0
- package/dist/components/chart/ChartFilterBar.js +1 -0
- package/dist/components/chart/ChartGrid.cjs +1 -0
- package/dist/components/chart/ChartGrid.js +1 -0
- package/dist/components/chart/ChartLegend.cjs +1 -0
- package/dist/components/chart/ChartLegend.js +1 -0
- package/dist/components/chart/ChartPatterns.cjs +1 -0
- package/dist/components/chart/ChartPatterns.js +1 -0
- package/dist/components/chart/ChartPeriodPicker.cjs +1 -0
- package/dist/components/chart/ChartPeriodPicker.js +1 -0
- package/dist/components/chart/ChartScaleLegend.cjs +1 -0
- package/dist/components/chart/ChartScaleLegend.js +1 -0
- package/dist/components/chart/ChartSync.cjs +1 -0
- package/dist/components/chart/ChartSync.js +1 -0
- package/dist/components/chart/ChartTableView.cjs +1 -0
- package/dist/components/chart/ChartTableView.js +1 -0
- package/dist/components/chart/ChartTooltip.cjs +1 -0
- package/dist/components/chart/ChartTooltip.js +1 -0
- package/dist/components/chart/chart.types.cjs +1 -0
- package/dist/components/chart/chart.types.js +0 -0
- package/dist/components/chart/index.cjs +1 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/chart/palette.cjs +1 -0
- package/dist/components/chart/palette.js +1 -0
- package/dist/components/chart/useChartSize.cjs +1 -0
- package/dist/components/chart/useChartSize.js +1 -0
- package/dist/components/chart/utils/bins.cjs +1 -0
- package/dist/components/chart/utils/bins.js +1 -0
- package/dist/components/chart/utils/cartesian.cjs +1 -0
- package/dist/components/chart/utils/cartesian.js +1 -0
- package/dist/components/chart/utils/data.cjs +1 -0
- package/dist/components/chart/utils/data.js +1 -0
- package/dist/components/chart/utils/decimate.cjs +1 -0
- package/dist/components/chart/utils/decimate.js +1 -0
- package/dist/components/chart/utils/export.cjs +2 -0
- package/dist/components/chart/utils/export.js +2 -0
- package/dist/components/chart/utils/format.cjs +1 -0
- package/dist/components/chart/utils/format.js +1 -0
- package/dist/components/chart/utils/path.cjs +1 -0
- package/dist/components/chart/utils/path.js +1 -0
- package/dist/components/chart/utils/period.cjs +1 -0
- package/dist/components/chart/utils/period.js +1 -0
- package/dist/components/chart/utils/quantile.cjs +1 -0
- package/dist/components/chart/utils/quantile.js +1 -0
- package/dist/components/chart/utils/scales.cjs +1 -0
- package/dist/components/chart/utils/scales.js +1 -0
- package/dist/components/chart/utils/stack.cjs +1 -0
- package/dist/components/chart/utils/stack.js +1 -0
- package/dist/components/chart/utils/text.cjs +1 -0
- package/dist/components/chart/utils/text.js +1 -0
- package/dist/components/chart/utils/ticks.cjs +1 -0
- package/dist/components/chart/utils/ticks.js +1 -0
- package/dist/components/chart/utils/time.cjs +1 -0
- package/dist/components/chart/utils/time.js +1 -0
- package/dist/components/chart/utils/timestamp.cjs +1 -0
- package/dist/components/chart/utils/timestamp.js +1 -0
- package/dist/components/chart/utils/touch.cjs +1 -0
- package/dist/components/chart/utils/touch.js +1 -0
- package/dist/components/checkbox/Checkbox.cjs +1 -0
- package/dist/components/checkbox/Checkbox.js +1 -0
- package/dist/components/checkbox/CheckboxGroup.cjs +1 -0
- package/dist/components/checkbox/CheckboxGroup.js +1 -0
- package/dist/components/checkbox/index.cjs +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.cjs +1 -0
- package/dist/components/chip/Chip.js +1 -0
- package/dist/components/chip/index.cjs +1 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/circular-progress/CircularProgress.cjs +1 -0
- package/dist/components/circular-progress/CircularProgress.js +1 -0
- package/dist/components/circular-progress/index.cjs +1 -0
- package/dist/components/circular-progress/index.js +1 -0
- package/dist/components/datagrid/DataGrid.cjs +2 -0
- package/dist/components/datagrid/DataGrid.js +2 -0
- package/dist/components/datagrid/index.cjs +1 -0
- package/dist/components/datagrid/index.js +1 -0
- package/dist/components/detachable/Detachable.cjs +1 -0
- package/dist/components/detachable/Detachable.js +1 -0
- package/dist/components/detachable/index.cjs +1 -0
- package/dist/components/detachable/index.js +1 -0
- package/dist/components/device-mockup/DeviceMockup.cjs +1 -0
- package/dist/components/device-mockup/DeviceMockup.js +1 -0
- package/dist/components/device-mockup/index.cjs +1 -0
- package/dist/components/device-mockup/index.js +1 -0
- package/dist/components/divider/Divider.cjs +1 -0
- package/dist/components/divider/Divider.js +1 -0
- package/dist/components/divider/index.cjs +1 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/Drawer.cjs +1 -0
- package/dist/components/drawer/Drawer.js +1 -0
- package/dist/components/drawer/index.cjs +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/dropdown/Dropdown.cjs +1 -0
- package/dist/components/dropdown/Dropdown.js +1 -0
- package/dist/components/dropdown/DropdownCheckboxItem.cjs +1 -0
- package/dist/components/dropdown/DropdownCheckboxItem.js +1 -0
- package/dist/components/dropdown/DropdownContent.cjs +1 -0
- package/dist/components/dropdown/DropdownContent.js +1 -0
- package/dist/components/dropdown/DropdownItem.cjs +1 -0
- package/dist/components/dropdown/DropdownItem.js +1 -0
- package/dist/components/dropdown/DropdownRadio.cjs +1 -0
- package/dist/components/dropdown/DropdownRadio.js +1 -0
- package/dist/components/dropdown/DropdownSeparator.cjs +1 -0
- package/dist/components/dropdown/DropdownSeparator.js +1 -0
- package/dist/components/dropdown/DropdownSubMenu.cjs +1 -0
- package/dist/components/dropdown/DropdownSubMenu.js +1 -0
- package/dist/components/dropdown/DropdownTrigger.cjs +1 -0
- package/dist/components/dropdown/DropdownTrigger.js +1 -0
- package/dist/components/dropdown/hooks/index.cjs +1 -0
- package/dist/components/dropdown/hooks/index.js +1 -0
- package/dist/components/dropdown/hooks/useClickOutside.cjs +1 -0
- package/dist/components/dropdown/hooks/useClickOutside.js +1 -0
- package/dist/components/dropdown/hooks/useKeyboardNavigation.cjs +1 -0
- package/dist/components/dropdown/hooks/useKeyboardNavigation.js +1 -0
- package/dist/components/dropdown/hooks/useLatest.cjs +1 -0
- package/dist/components/dropdown/hooks/useLatest.js +1 -0
- package/dist/components/dropdown/hooks/usePositioning.cjs +1 -0
- package/dist/components/dropdown/hooks/usePositioning.js +1 -0
- package/dist/components/dropdown/index.cjs +1 -0
- package/dist/components/dropdown/index.js +1 -0
- package/dist/components/dumbbell-chart/DumbbellChart.cjs +1 -0
- package/dist/components/dumbbell-chart/DumbbellChart.js +1 -0
- package/dist/components/dumbbell-chart/index.cjs +1 -0
- package/dist/components/dumbbell-chart/index.js +1 -0
- package/dist/components/file-selector/FileSelector.cjs +1 -0
- package/dist/components/file-selector/FileSelector.js +1 -0
- package/dist/components/file-selector/index.cjs +1 -0
- package/dist/components/file-selector/index.js +1 -0
- package/dist/components/footer/Footer.cjs +1 -0
- package/dist/components/footer/Footer.js +1 -0
- package/dist/components/footer/FooterBottom.cjs +1 -0
- package/dist/components/footer/FooterBottom.js +1 -0
- package/dist/components/footer/FooterColumn.cjs +1 -0
- package/dist/components/footer/FooterColumn.js +1 -0
- package/dist/components/footer/FooterLink.cjs +1 -0
- package/dist/components/footer/FooterLink.js +1 -0
- package/dist/components/footer/FooterSection.cjs +1 -0
- package/dist/components/footer/FooterSection.js +1 -0
- package/dist/components/footer/FooterSocial.cjs +1 -0
- package/dist/components/footer/FooterSocial.js +1 -0
- package/dist/components/footer/index.cjs +1 -0
- package/dist/components/footer/index.js +1 -0
- package/dist/components/form/index.cjs +1 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/input/Input.cjs +1 -0
- package/dist/components/form/input/Input.js +1 -0
- package/dist/components/form/input/index.cjs +1 -0
- package/dist/components/form/input/index.js +1 -0
- package/dist/components/form/mention-input/MentionInput.cjs +1 -0
- package/dist/components/form/mention-input/MentionInput.js +1 -0
- package/dist/components/form/mention-input/index.cjs +1 -0
- package/dist/components/form/mention-input/index.js +1 -0
- package/dist/components/form/number-input/NumberInput.cjs +1 -0
- package/dist/components/form/number-input/NumberInput.js +1 -0
- package/dist/components/form/number-input/index.cjs +1 -0
- package/dist/components/form/number-input/index.js +1 -0
- package/dist/components/form/shared/InputWrapper.cjs +1 -0
- package/dist/components/form/shared/InputWrapper.js +1 -0
- package/dist/components/form/shared/inputStyles.cjs +1 -0
- package/dist/components/form/shared/inputStyles.js +1 -0
- package/dist/components/form/types/mention.cjs +1 -0
- package/dist/components/form/types/mention.js +0 -0
- package/dist/components/funnel-chart/FunnelChart.cjs +1 -0
- package/dist/components/funnel-chart/FunnelChart.js +1 -0
- package/dist/components/funnel-chart/index.cjs +1 -0
- package/dist/components/funnel-chart/index.js +1 -0
- package/dist/components/gantt-chart/GanttChart.cjs +1 -0
- package/dist/components/gantt-chart/GanttChart.js +1 -0
- package/dist/components/gantt-chart/index.cjs +1 -0
- package/dist/components/gantt-chart/index.js +1 -0
- package/dist/components/header/Header.cjs +1 -0
- package/dist/components/header/Header.js +1 -0
- package/dist/components/header/index.cjs +1 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/heat-map/Heatmap.cjs +1 -0
- package/dist/components/heat-map/Heatmap.js +1 -0
- package/dist/components/heat-map/index.cjs +1 -0
- package/dist/components/heat-map/index.js +1 -0
- package/dist/components/help-button/HelpButton.cjs +22 -0
- package/dist/components/help-button/HelpButton.js +22 -0
- package/dist/components/help-button/MarkdownEditor.cjs +1 -0
- package/dist/components/help-button/MarkdownEditor.js +1 -0
- package/dist/components/help-button/index.cjs +1 -0
- package/dist/components/help-button/index.js +1 -0
- package/dist/components/help-button/types.cjs +1 -0
- package/dist/components/help-button/types.js +0 -0
- package/dist/components/image-uploader/ImageUploader.cjs +1 -0
- package/dist/components/image-uploader/ImageUploader.js +1 -0
- package/dist/components/image-uploader/index.cjs +1 -0
- package/dist/components/image-uploader/index.js +1 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/indicator/Indicator.cjs +1 -0
- package/dist/components/indicator/Indicator.js +1 -0
- package/dist/components/indicator/index.cjs +1 -0
- package/dist/components/indicator/index.js +1 -0
- package/dist/components/label/Label.cjs +1 -0
- package/dist/components/label/Label.js +1 -0
- package/dist/components/label/index.cjs +1 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/line-chart/LineChart.cjs +1 -0
- package/dist/components/line-chart/LineChart.js +1 -0
- package/dist/components/line-chart/index.cjs +1 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/modal/Modal.cjs +1 -0
- package/dist/components/modal/Modal.js +1 -0
- package/dist/components/modal/index.cjs +1 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/pagination/Pagination.cjs +1 -0
- package/dist/components/pagination/Pagination.js +1 -0
- package/dist/components/pagination/index.cjs +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pie-chart/PieChart.cjs +1 -0
- package/dist/components/pie-chart/PieChart.js +1 -0
- package/dist/components/pie-chart/index.cjs +1 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/progress-bar/ProgressBar.cjs +1 -0
- package/dist/components/progress-bar/ProgressBar.js +1 -0
- package/dist/components/progress-bar/index.cjs +1 -0
- package/dist/components/progress-bar/index.js +1 -0
- package/dist/components/radio-button/RadioButton.cjs +1 -0
- package/dist/components/radio-button/RadioButton.js +1 -0
- package/dist/components/radio-button/index.cjs +1 -0
- package/dist/components/radio-button/index.js +1 -0
- package/dist/components/scatter-chart/ScatterChart.cjs +1 -0
- package/dist/components/scatter-chart/ScatterChart.js +1 -0
- package/dist/components/scatter-chart/index.cjs +1 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/schema-editor/SchemaEditor.cjs +1 -0
- package/dist/components/schema-editor/SchemaEditor.js +1 -0
- package/dist/components/schema-editor/SchemaEditor.types.cjs +1 -0
- package/dist/components/schema-editor/SchemaEditor.types.js +0 -0
- package/dist/components/schema-editor/canvas/GridLayer.cjs +1 -0
- package/dist/components/schema-editor/canvas/GridLayer.js +1 -0
- package/dist/components/schema-editor/index.cjs +1 -0
- package/dist/components/schema-editor/index.js +1 -0
- package/dist/components/schema-editor/legend/SchemaLegend.cjs +1 -0
- package/dist/components/schema-editor/legend/SchemaLegend.js +1 -0
- package/dist/components/schema-editor/minimap/SchemaMinimap.cjs +1 -0
- package/dist/components/schema-editor/minimap/SchemaMinimap.js +1 -0
- package/dist/components/schema-editor/relations/SchemaRelationRenderer.cjs +1 -0
- package/dist/components/schema-editor/relations/SchemaRelationRenderer.js +1 -0
- package/dist/components/schema-editor/tables/SchemaTableRenderer.cjs +1 -0
- package/dist/components/schema-editor/tables/SchemaTableRenderer.js +1 -0
- package/dist/components/schema-editor/toolbar/SchemaToolbar.cjs +1 -0
- package/dist/components/schema-editor/toolbar/SchemaToolbar.js +1 -0
- package/dist/components/schema-editor/utils/auto-layout.cjs +1 -0
- package/dist/components/schema-editor/utils/auto-layout.js +1 -0
- package/dist/components/schema-editor/utils/geometry.cjs +1 -0
- package/dist/components/schema-editor/utils/geometry.js +1 -0
- package/dist/components/schema-editor/utils/schema-helpers.cjs +1 -0
- package/dist/components/schema-editor/utils/schema-helpers.js +1 -0
- package/dist/components/schema-editor/utils/sql-export.cjs +9 -0
- package/dist/components/schema-editor/utils/sql-export.js +9 -0
- package/dist/components/select/Select.cjs +1 -0
- package/dist/components/select/Select.js +1 -0
- package/dist/components/select/index.cjs +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/sidebar/Sidebar.cjs +1 -0
- package/dist/components/sidebar/Sidebar.js +1 -0
- package/dist/components/sidebar/index.cjs +1 -0
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/skeleton/Skeleton.cjs +1 -0
- package/dist/components/skeleton/Skeleton.js +1 -0
- package/dist/components/skeleton/index.cjs +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/slider/Slider.cjs +1 -0
- package/dist/components/slider/Slider.js +1 -0
- package/dist/components/slider/index.cjs +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/sparkline/Sparkline.cjs +1 -0
- package/dist/components/sparkline/Sparkline.js +1 -0
- package/dist/components/sparkline/index.cjs +1 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/stat-card/StatCard.cjs +1 -0
- package/dist/components/stat-card/StatCard.js +1 -0
- package/dist/components/stat-card/StatCardGroup.cjs +1 -0
- package/dist/components/stat-card/StatCardGroup.js +1 -0
- package/dist/components/stat-card/index.cjs +1 -0
- package/dist/components/stat-card/index.js +1 -0
- package/dist/components/table/Table.cjs +1 -0
- package/dist/components/table/Table.js +1 -0
- package/dist/components/table/TableBody.cjs +1 -0
- package/dist/components/table/TableBody.js +1 -0
- package/dist/components/table/TableCell.cjs +1 -0
- package/dist/components/table/TableCell.js +1 -0
- package/dist/components/table/TableHeader.cjs +1 -0
- package/dist/components/table/TableHeader.js +1 -0
- package/dist/components/table/TableHeaderCell.cjs +1 -0
- package/dist/components/table/TableHeaderCell.js +1 -0
- package/dist/components/table/TableRow.cjs +1 -0
- package/dist/components/table/TableRow.js +1 -0
- package/dist/components/table/index.cjs +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/Tabs.cjs +1 -0
- package/dist/components/tabs/Tabs.js +1 -0
- package/dist/components/tabs/TabsContent.cjs +1 -0
- package/dist/components/tabs/TabsContent.js +1 -0
- package/dist/components/tabs/TabsContext.cjs +1 -0
- package/dist/components/tabs/TabsContext.js +1 -0
- package/dist/components/tabs/TabsList.cjs +1 -0
- package/dist/components/tabs/TabsList.js +1 -0
- package/dist/components/tabs/TabsTrigger.cjs +1 -0
- package/dist/components/tabs/TabsTrigger.js +1 -0
- package/dist/components/tabs/index.cjs +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/toast/Toast.cjs +1 -0
- package/dist/components/toast/Toast.js +1 -0
- package/dist/components/toast/index.cjs +1 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/tooltip/Tooltip.cjs +1 -0
- package/dist/components/tooltip/Tooltip.js +1 -0
- package/dist/components/tooltip/index.cjs +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/waterfall-chart/WaterfallChart.cjs +1 -0
- package/dist/components/waterfall-chart/WaterfallChart.js +1 -0
- package/dist/components/waterfall-chart/index.cjs +1 -0
- package/dist/components/waterfall-chart/index.js +1 -0
- package/dist/components/wizard/Wizard.cjs +1 -0
- package/dist/components/wizard/Wizard.js +1 -0
- package/dist/components/wizard/index.cjs +1 -0
- package/dist/components/wizard/index.js +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.cjs +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.js +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.types.cjs +1 -0
- package/dist/components/workflow-editor/WorkflowEditor.types.js +0 -0
- package/dist/components/workflow-editor/canvas/GridLayer.cjs +1 -0
- package/dist/components/workflow-editor/canvas/GridLayer.js +1 -0
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.cjs +1 -0
- package/dist/components/workflow-editor/edges/WorkflowEdgeRenderer.js +1 -0
- package/dist/components/workflow-editor/index.cjs +1 -0
- package/dist/components/workflow-editor/index.js +1 -0
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.cjs +1 -0
- package/dist/components/workflow-editor/nodes/WorkflowNodeRenderer.js +1 -0
- package/dist/components/workflow-editor/toolbar/WorkflowToolbar.cjs +1 -0
- package/dist/components/workflow-editor/toolbar/WorkflowToolbar.js +1 -0
- package/dist/components/workflow-editor/utils/geometry.cjs +1 -0
- package/dist/components/workflow-editor/utils/geometry.js +1 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDialogA11y.cjs +1 -0
- package/dist/hooks/useDialogA11y.js +1 -0
- package/dist/index.cjs +1 -32
- package/dist/index.d.cts +35 -9
- package/dist/index.d.ts +35 -9
- package/dist/index.js +1 -32
- package/dist/lib/aria-hide.cjs +1 -0
- package/dist/lib/aria-hide.js +1 -0
- package/dist/lib/cn.cjs +1 -0
- package/dist/lib/cn.js +1 -0
- package/dist/lib/dialog-stack.cjs +1 -0
- package/dist/lib/dialog-stack.js +1 -0
- package/dist/lib/focus.cjs +1 -0
- package/dist/lib/focus.js +1 -0
- package/dist/lib/i18n.cjs +1 -0
- package/dist/lib/i18n.js +1 -0
- package/dist/markdown-editor.cjs +1 -1
- package/dist/markdown-editor.js +1 -1
- package/dist/styles.css +152 -0
- package/package.json +13 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as he,useCallback as O,useMemo as D,useState as se}from"react";import{useUILabels as ge}from"../../lib/i18n.js";import{ChartAxis as le}from"../chart/ChartAxis.js";import{ChartContainer as be}from"../chart/ChartContainer.js";import{ChartGrid as fe}from"../chart/ChartGrid.js";import{ChartLegend as ye}from"../chart/ChartLegend.js";import{ChartTableView as pe}from"../chart/ChartTableView.js";import{ChartTooltip as Ce,ChartTooltipContent as ve}from"../chart/ChartTooltip.js";import{CHART_ALL_PAIRS_LIMIT as oe,getSeriesLabel as ue,resolveSeriesColor as ke,toLegendItems as xe}from"../chart/palette.js";import{buildCartesianGeometry as Re}from"../chart/utils/cartesian.js";import{collectAllValues as Se,readNumber as De,readXValue as Le}from"../chart/utils/data.js";import{formatAuto as Pe,formatXValue as we}from"../chart/utils/format.js";import{nearestIndex as Te}from"../chart/utils/scales.js";import{estimateTextWidth as Ae}from"../chart/utils/text.js";import{extent as Ve}from"../chart/utils/ticks.js";import{CHART_TOUCH as Ne}from"../chart/utils/touch.js";import{Fragment as ze,jsx as l,jsxs as X}from"react/jsx-runtime";var We=5,Ee=3,ie=10,Q=!1;function et(){Q=!1}var He=he(function({rows:i,radius:p}){return l("g",{children:i.map(t=>X("g",{children:[t.connector?l("line",{x1:t.connector.x1,y1:t.connector.y,x2:t.connector.x2,y2:t.connector.y,strokeWidth:Ee,strokeLinecap:"round",className:"stroke-gray-300 dark:stroke-gray-600"}):null,t.dots.map(s=>l("circle",{cx:s.cx,cy:s.cy,r:p,fill:s.color,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"},s.key)),t.label?l("text",{x:t.label.x,y:t.label.y,dominantBaseline:"middle",className:"fill-gray-600 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-300",children:t.label.text}):null]},t.key))})});function Ie({width:k,height:i,data:p,rows:t,resolvedSeries:s,x:L,y:T,grid:$,size:K,showValues:_,dotSize:Y,referenceLines:W,margin:G,tooltip:g,plotLabel:B,formatValue:E,formatX:H,onRowClick:I}){let[P,A]=se(null),u=P!==null&&P<t.length?P:null,e=D(()=>{let d=s.filter(o=>!o.hidden).map(o=>o.key),c=Re({width:k,height:i,data:p,x:L,y:T,bounds:Ve(Se(p,d)),margin:G,orientation:"horizontal",placement:"band",formatValue:E,formatX:H,defaultIncludeZero:!1}),{valueScale:b,bandwidth:V,categoryPositions:z,innerWidth:U,innerHeight:F}=c;return{rendered:t.map((o,M)=>{let C=z[M]+V/2,w=o.points.map((a,h)=>({key:a.seriesKey,value:a.value,cx:a.value===null?Number.NaN:b(a.value),cy:C,color:a.color,order:h})).filter(a=>a.value!==null),N=o.from===null||o.to===null||w.length<2?null:{x1:b(o.from),x2:b(o.to),y:C},v=null;if(_&&o.to!==null){let a=E(o.to),h=b(o.to);Ae(a,10)<=U-h-ie&&(v={x:h+ie,y:C,text:a})}return{key:`${M}`,connector:N,dots:w.map(a=>({key:a.key,cx:a.cx,cy:a.cy,color:a.color})),label:v,top:z[M],height:V}}),categoryPositions:z,categoryCenters:c.categoryCenters,bandwidth:V,categoryTicks:c.categoryTicks,valueTicks:c.valueTicks,valueScale:b,innerWidth:U,innerHeight:F,margin:c.margin}},[p,t,s,L,T,k,i,G,_,E,H]),Z=O(n=>{if(g===!1||t.length===0)return;let d=n.currentTarget.getBoundingClientRect(),c=n.clientY-d.top-e.margin.top;A(Te(e.categoryCenters,c))},[g,t.length,e.margin.top,e.categoryCenters]),j=O(n=>{if(t.length===0)return;let d=t.length-1,c=u??0,b=n.key==="ArrowDown"?Math.min(d,c+1):n.key==="ArrowUp"?Math.max(0,c-1):n.key==="Home"?0:n.key==="End"?d:n.key==="Escape"?null:void 0;b!==void 0&&(n.preventDefault(),A(b))},[t.length,u]),q=O(()=>{!I||u===null||I(t[u])},[I,u,t]),x=u===null?null:t[u];return X(ze,{children:[X("svg",{width:k,height:i,role:"img","aria-label":B??s.map(n=>ue(n)).join(", "),tabIndex:0,className:`${Ne} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:Z,onPointerLeave:()=>A(null),onKeyDown:j,onBlur:()=>A(null),onClick:q,children:[X("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[l(fe,{width:e.innerWidth,height:e.innerHeight,vertical:$==="y"||$==="both"?e.valueTicks.map(n=>n.offset):void 0}),u!==null?l("rect",{x:0,y:e.categoryPositions[u],width:e.innerWidth,height:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,W?.map(n=>X("g",{children:[l("line",{x1:e.valueScale(n.value),y1:0,x2:e.valueScale(n.value),y2:e.innerHeight,stroke:n.color??"var(--color-chart-muted)",strokeWidth:1,strokeDasharray:n.dashed===!1?void 0:"4 4"}),n.label?l("text",{x:e.valueScale(n.value)+4,y:8,className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:n.label}):null]},`${n.value}-${n.label??""}`)),l(He,{rows:e.rendered,radius:Y})]}),l("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:T?.hidden?null:l(le,{orientation:"bottom",ticks:e.valueTicks,length:e.innerWidth,label:T?.label,size:K})}),l("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:L.hidden?null:l(le,{orientation:"left",ticks:e.categoryTicks,length:e.innerHeight,showLine:!1,tickSize:0,label:L.label,size:K})})]}),x&&u!==null&&g!==!1?l(Ce,{x:e.margin.left+(x.to===null?e.innerWidth/2:e.valueScale(x.to)),y:e.margin.top+e.categoryCenters[u],containerWidth:k,children:typeof g=="function"?g(x):l(ve,{title:x.label,points:x.points})}):null]})}function tt({data:k,x:i,y:p,series:t,sort:s="none",sortBy:L,showValues:T=!1,dotSize:$=We,referenceLines:K,height:_,width:Y,size:W="md",grid:G="y",legend:g,legendToggle:B=!0,tooltip:E=!0,tableView:H=!1,showChange:I=!0,title:P,description:A,loading:u=!1,emptyState:e,error:Z=!1,errorState:j,onRetry:q,actions:x,margin:n,locale:d,plotLabel:c,changeLabel:b,format:V,onRowClick:z,className:U,...F}){let ee=ge(),[o,M]=se(()=>new Set);t.length>oe&&!Q&&(Q=!0,console.warn(`[@synertech/ui] A DumbbellChart was given ${t.length} series. Any two dots of a row can sit side by side, and only the first ${oe} palette slots stay tellable apart under that test: facet the chart instead.`));let C=D(()=>t.map((r,m)=>({...r,hidden:r.hidden||o.has(r.key),color:ke(r,m)})),[t,o]),w=D(()=>p?.format??V??(r=>Pe(r,d)),[p?.format,V,d]),N=D(()=>i.format??(r=>we(r,d)),[i.format,d]),v=D(()=>C.filter(r=>!r.hidden),[C]),a=D(()=>k.map((r,m)=>{let f=Le(r,i.key,m),y=v.map(S=>{let J=De(r,S.key);return{seriesKey:S.key,seriesLabel:ue(S),color:S.color,value:J,formattedValue:J===null?"\u2014":w(J),datum:r}}),R=y.map(S=>S.value).filter(S=>S!==null),re=y[0]?.value??null,ae=y[y.length-1]?.value??null;return{index:m,x:f,label:N(f,m),points:y,from:R.length>0?Math.min(...R):null,to:R.length>0?Math.max(...R):null,change:re===null||ae===null?null:ae-re,datum:r}}),[k,i.key,v,w,N]),h=D(()=>{if(s==="none")return a;let r=L??v[v.length-1]?.key,m=y=>s==="gap"?Math.abs(y.change??0):y.points.find(R=>R.seriesKey===r)?.value??0,f=[...a].sort((y,R)=>m(y)-m(R));return s==="asc"?f:f.reverse()},[a,s,L,v]),ce=O(r=>{M(m=>{let f=new Set(m);return f.has(r)?f.delete(r):f.add(r),f})},[]),te=_??Math.max(96,h.length*30+44),me=D(()=>h.map(r=>({...r.datum,__change:r.change})),[h]),de=g===void 0?t.length>=2:g!==!1,ne=typeof g=="string"?g:"bottom";return l(be,{title:P,description:A,height:te,width:Y,size:W,loading:u,empty:h.length===0||v.length===0,emptyState:e,error:Z,errorState:j,onRetry:q,actions:x,tableView:H,legendPosition:ne,legend:de?l(ye,{items:xe(C),position:ne,marker:"dot",size:W,onToggle:B?ce:void 0}):void 0,table:H?l(pe,{data:me,series:[...C,...I?[{key:"__change",label:b??ee.chartChange}]:[]],xKey:i.key,xLabel:i.label??i.key,formatX:N,formatValue:w,caption:typeof P=="string"?P:void 0}):void 0,className:U,...F,children:({width:r})=>l(Ie,{width:r,height:te,data:h.map(m=>m.datum),rows:h,resolvedSeries:C,x:i,y:p,grid:G,size:W,showValues:T,dotSize:$,referenceLines:K,margin:n,tooltip:E,plotLabel:c,formatValue:w,formatX:N,onRowClick:z})})}export{tt as DumbbellChart,et as resetDumbbellWarnings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var p=(l,b)=>{for(var r in b)t(l,r,{get:b[r],enumerable:!0})},h=(l,b,r,o)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of D(b))!a.call(l,e)&&e!==r&&t(l,e,{get:()=>b[e],enumerable:!(o=u(b,e))||o.enumerable});return l};var s=l=>h(t({},"__esModule",{value:!0}),l);var C={};p(C,{DumbbellChart:()=>m.DumbbellChart,resetDumbbellWarnings:()=>m.resetDumbbellWarnings});module.exports=s(C);var m=require("./DumbbellChart.cjs");0&&(module.exports={DumbbellChart,resetDumbbellWarnings});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DumbbellChart as e,resetDumbbellWarnings as r}from"./DumbbellChart.js";export{e as DumbbellChart,r as resetDumbbellWarnings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var R=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var ge=(l,i)=>{for(var c in i)R(l,c,{get:i[c],enumerable:!0})},xe=(l,i,c,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let x of de(i))!pe.call(l,x)&&x!==c&&R(l,x,{get:()=>i[x],enumerable:!(u=fe(i,x))||u.enumerable});return l};var he=l=>xe(R({},"__esModule",{value:!0}),l);var Ne={};ge(Ne,{FileSelector:()=>we});module.exports=he(Ne);var a=require("react"),p=require("../../lib/cn.cjs"),t=require("react/jsx-runtime"),be={sm:{dropzone:"py-4 px-3",text:"text-xs",subtext:"text-[10px]",icon:"w-6 h-6",button:"px-2.5 py-1.5 text-xs",fileItem:"py-1 px-2 text-xs",gap:"gap-1"},md:{dropzone:"py-6 px-4",text:"text-sm",subtext:"text-xs",icon:"w-8 h-8",button:"px-3 py-2 text-sm",fileItem:"py-1.5 px-3 text-sm",gap:"gap-1.5"},lg:{dropzone:"py-8 px-6",text:"text-base",subtext:"text-sm",icon:"w-10 h-10",button:"px-4 py-2.5 text-base",fileItem:"py-2 px-4 text-base",gap:"gap-2"}},X=l=>{if(l===0)return"0 B";let i=["B","KB","MB","GB"],c=Math.floor(Math.log(l)/Math.log(1024));return`${(l/Math.pow(1024,c)).toFixed(c===0?0:1)} ${i[c]}`},W=l=>l.webkitRelativePath||l.name,me=(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-full h-full",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})}),ye=(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-full h-full",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 00-1.883 2.542l.857 6a2.25 2.25 0 002.227 1.932H19.05a2.25 2.25 0 002.227-1.932l.857-6a2.25 2.25 0 00-1.883-2.542m-16.5 0V6A2.25 2.25 0 016 3.75h3.879a1.5 1.5 0 011.06.44l2.122 2.12a1.5 1.5 0 001.06.44H18A2.25 2.25 0 0120.25 9v.776"})}),ve=0;async function ke(l){let i=[],c=async u=>{if(u.isFile){let x=await new Promise((b,r)=>u.file(b,r));i.push(x)}else if(u.isDirectory){let x=u.createReader(),b=()=>new Promise((D,B)=>x.readEntries(D,B)),r=await b();for(;r.length>0;){for(let D of r)await c(D);r=await b()}}};for(let u of l)await c(u);return i}function we({value:l,onChange:i,accept:c,multiple:u=!1,maxSize:x=10*1024*1024,maxFiles:b,mode:r="file",variant:D="dropzone",size:B="md",disabled:o=!1,readOnly:s=!1,label:H,helperText:M,error:v,showFileList:T=!0,placeholder:j,browseLabel:I,browseFolderLabel:U,icon:Y,onReject:V,className:Z}){let[O,z]=(0,a.useState)([]),[G,A]=(0,a.useState)(!1),y=(0,a.useRef)(null),L=(0,a.useRef)(null),w=(0,a.useId)(),k=l!==void 0,N=k?l.map((e,f)=>({file:e,id:`ctrl-${f}`})):O,g=be[B];(0,a.useEffect)(()=>{r==="directory"&&y.current&&y.current.setAttribute("webkitdirectory",""),r==="both"&&L.current&&L.current.setAttribute("webkitdirectory","")},[r]);let $=(0,a.useMemo)(()=>X(x),[x]),S=(0,a.useMemo)(()=>c?c.split(",").map(e=>e.trim()).map(e=>e.startsWith(".")?e.toUpperCase():e.endsWith("/*")?e.replace("/*","").toUpperCase():e).join(", "):"All files",[c]),K=r==="directory"?"Drag & drop a folder here, or":r==="both"?"Drag & drop files or folders here, or":u?"Drag & drop files here, or":"Drag & drop a file here, or",ee=r==="directory"?"Browse folder":"Browse",te="Browse folder",_=(0,a.useCallback)(e=>{if(e.size>x)return`File exceeds maximum size of ${$}`;if(c){let f=c.split(",").map(n=>n.trim()),d=`.${e.name.split(".").pop()?.toLowerCase()}`;if(!f.some(n=>n.startsWith(".")?d===n.toLowerCase():n.endsWith("/*")?e.type.startsWith(n.replace("/*","/")):e.type===n))return`File type not accepted. Expected: ${S}`}return null},[c,S,x,$]),C=(0,a.useCallback)(e=>{if(o||s)return;let f=Array.from(e),d=[];for(let h of f){let n=_(h);n?V?.(h,n):d.push(h)}if(d.length!==0)if(k)if(u){let n=[...l??[],...d],m=b?n.slice(0,b):n;i?.(m)}else i?.([d[0]]);else z(h=>{let n=d.map(m=>({file:m,id:`file-${++ve}`}));if(u){let m=[...h,...n],Q=b?m.slice(0,b):m,ce=Q.map(ue=>ue.file);return i?.(ce),Q}return i?.([d[0]]),[n[0]]})},[o,s,k,u,b,l,i,V,_]),re=(0,a.useCallback)(e=>{if(!(o||s)){if(k){let f=(l??[]).filter((d,h)=>h!==e);i?.(f)}else z(f=>{let d=f.filter((h,n)=>n!==e);return i?.(d.map(h=>h.file)),d});y.current&&(y.current.value="")}},[o,s,k,l,i]),oe=(0,a.useCallback)(()=>{o||s||(k?i?.([]):(z([]),i?.([])),y.current&&(y.current.value=""))},[o,s,k,i]),q=(0,a.useCallback)(e=>{e.target.files&&e.target.files.length>0&&C(e.target.files)},[C]),se=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),!o&&!s&&A(!0)},[o,s]),ne=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),A(!1)},[]),ie=(0,a.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),A(!1),o||s)return;let f=e.dataTransfer.items;if(f&&f.length>0&&(r==="directory"||r==="both")){let d=[];for(let n=0;n<f.length;n++){let m=f[n].webkitGetAsEntry?.();m&&d.push(m)}if(d.some(n=>n.isDirectory)){ke(d).then(n=>{n.length>0&&C(n)});return}}e.dataTransfer.files&&e.dataTransfer.files.length>0&&C(e.dataTransfer.files)},[o,s,r,C]),E=(0,a.useCallback)(()=>{!o&&!s&&y.current?.click()},[o,s]),J=(0,a.useCallback)(()=>{!o&&!s&&L.current?.click()},[o,s]),F=N.length>0,ae=Y||(r==="directory"?ye:me),le=T&&F&&(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col",g.gap),children:[N.map((e,f)=>(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center justify-between rounded-md border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50",g.fileItem),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 shrink-0 text-gray-400 dark:text-gray-500",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),(0,t.jsx)("span",{className:"truncate text-gray-700 dark:text-gray-300",children:W(e.file)}),(0,t.jsxs)("span",{className:"shrink-0 text-gray-400 dark:text-gray-500",children:["(",X(e.file.size),")"]})]}),!o&&!s&&(0,t.jsx)("button",{type:"button",onClick:()=>re(f),className:"shrink-0 ml-2 text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 transition-colors cursor-pointer","aria-label":`Remove ${W(e.file)}`,children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},e.id)),u&&N.length>1&&!o&&!s&&(0,t.jsx)("button",{type:"button",onClick:oe,className:(0,p.cn)("self-start text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 transition-colors cursor-pointer",g.subtext),children:"Remove all"})]}),P=(0,p.cn)("rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200 font-medium transition-colors","hover:bg-gray-50 dark:hover:bg-gray-700","disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1",g.button,v&&"border-red-300 dark:border-red-600");return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col",g.gap,Z),children:[H&&(0,t.jsx)("label",{htmlFor:w,className:(0,p.cn)("block font-medium text-gray-700 dark:text-gray-300",g.text),children:H}),(0,t.jsx)("input",{ref:y,id:w,type:"file",accept:r!=="directory"?c:void 0,multiple:u,onChange:q,className:"sr-only",disabled:o||s,"aria-describedby":v?`${w}-error`:M?`${w}-helper`:void 0,"aria-invalid":!!v}),r==="both"&&(0,t.jsx)("input",{ref:L,type:"file",onChange:q,className:"sr-only",disabled:o||s,tabIndex:-1,"aria-hidden":"true"}),D==="dropzone"?(0,t.jsxs)("div",{role:r==="both"?"group":"button",tabIndex:r==="both"?void 0:o||s?-1:0,onClick:r==="both"?void 0:E,onKeyDown:r==="both"?void 0:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),E())},onDragOver:se,onDragLeave:ne,onDrop:ie,className:(0,p.cn)("flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",g.dropzone,G&&!o&&!s?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800",!o&&!s&&"hover:border-blue-400 dark:hover:border-blue-500 hover:bg-gray-50 dark:hover:bg-gray-800/70",r!=="both"&&!o&&!s&&"cursor-pointer",o&&"opacity-50 cursor-not-allowed",s&&"cursor-default",v&&"border-red-300 dark:border-red-600"),"aria-label":r==="both"?"File and folder drop zone":j||K,children:[(0,t.jsx)("div",{className:(0,p.cn)("text-gray-400 dark:text-gray-500 mb-2",g.icon,G&&"text-blue-500 dark:text-blue-400"),children:ae}),(0,t.jsxs)("p",{className:(0,p.cn)("text-gray-600 dark:text-gray-400",g.text),children:[j||K," ",!o&&!s&&r!=="both"&&(0,t.jsx)("span",{className:"text-blue-600 dark:text-blue-400 font-medium",children:I||ee})]}),r==="both"&&!o&&!s&&(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center gap-3 mt-1",g.text),children:[(0,t.jsx)("button",{type:"button",onClick:E,className:"text-blue-600 dark:text-blue-400 font-medium hover:underline cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded",children:I||"Browse files"}),(0,t.jsx)("span",{className:"text-gray-300 dark:text-gray-600",children:"\xB7"}),(0,t.jsx)("button",{type:"button",onClick:J,className:"text-blue-600 dark:text-blue-400 font-medium hover:underline cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded",children:U||te})]}),(0,t.jsxs)("p",{className:(0,p.cn)("text-gray-400 dark:text-gray-500 mt-1",g.subtext),children:[S," - Max ",$,u&&b&&` - Up to ${b} files`]})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r==="both"?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:E,disabled:o||s,className:P,children:I||(F?"Change files":"Choose files")}),(0,t.jsx)("button",{type:"button",onClick:J,disabled:o||s,className:P,children:U||"Choose folder"})]}):(0,t.jsx)("button",{type:"button",onClick:E,disabled:o||s,className:P,children:I||(r==="directory"?F?"Change folder":"Choose folder":F?"Change file":"Choose file")}),!F&&(0,t.jsx)("span",{className:(0,p.cn)("text-gray-400 dark:text-gray-500",g.text),children:r==="directory"?"No folder selected":r==="both"?"No file or folder selected":"No file selected"}),F&&!T&&(0,t.jsx)("span",{className:(0,p.cn)("text-gray-600 dark:text-gray-400 truncate",g.text),children:N.length===1?W(N[0].file):`${N.length} files selected`})]}),le,v&&(0,t.jsx)("p",{id:`${w}-error`,className:(0,p.cn)("text-red-600 dark:text-red-400",g.subtext),role:"alert",children:v}),M&&!v&&(0,t.jsx)("p",{id:`${w}-helper`,className:(0,p.cn)("text-gray-400 dark:text-gray-500",g.subtext),children:M})]})}0&&(module.exports={FileSelector});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useState as X,useRef as Y,useCallback as b,useEffect as ge,useMemo as Z,useId as xe}from"react";import{cn as d}from"../../lib/cn.js";import{Fragment as ke,jsx as n,jsxs as h}from"react/jsx-runtime";var he={sm:{dropzone:"py-4 px-3",text:"text-xs",subtext:"text-[10px]",icon:"w-6 h-6",button:"px-2.5 py-1.5 text-xs",fileItem:"py-1 px-2 text-xs",gap:"gap-1"},md:{dropzone:"py-6 px-4",text:"text-sm",subtext:"text-xs",icon:"w-8 h-8",button:"px-3 py-2 text-sm",fileItem:"py-1.5 px-3 text-sm",gap:"gap-1.5"},lg:{dropzone:"py-8 px-6",text:"text-base",subtext:"text-sm",icon:"w-10 h-10",button:"px-4 py-2.5 text-base",fileItem:"py-2 px-4 text-base",gap:"gap-2"}},O=c=>{if(c===0)return"0 B";let i=["B","KB","MB","GB"],p=Math.floor(Math.log(c)/Math.log(1024));return`${(c/Math.pow(1024,p)).toFixed(p===0?0:1)} ${i[p]}`},W=c=>c.webkitRelativePath||c.name,be=n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-full h-full",children:n("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})}),me=n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-full h-full",children:n("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 00-1.883 2.542l.857 6a2.25 2.25 0 002.227 1.932H19.05a2.25 2.25 0 002.227-1.932l.857-6a2.25 2.25 0 00-1.883-2.542m-16.5 0V6A2.25 2.25 0 016 3.75h3.879a1.5 1.5 0 011.06.44l2.122 2.12a1.5 1.5 0 001.06.44H18A2.25 2.25 0 0120.25 9v.776"})}),ye=0;async function ve(c){let i=[],p=async u=>{if(u.isFile){let y=await new Promise((x,t)=>u.file(x,t));i.push(y)}else if(u.isDirectory){let y=u.createReader(),x=()=>new Promise((C,M)=>y.readEntries(C,M)),t=await x();for(;t.length>0;){for(let C of t)await p(C);t=await x()}}};for(let u of c)await p(u);return i}function Fe({value:c,onChange:i,accept:p,multiple:u=!1,maxSize:y=10*1024*1024,maxFiles:x,mode:t="file",variant:C="dropzone",size:M="md",disabled:r=!1,readOnly:o=!1,label:H,helperText:z,error:k,showFileList:T=!0,placeholder:j,browseLabel:L,browseFolderLabel:U,icon:ee,onReject:V,className:te}){let[re,A]=X([]),[G,$]=X(!1),v=Y(null),B=Y(null),N=xe(),w=c!==void 0,F=w?c.map((e,a)=>({file:e,id:`ctrl-${a}`})):re,f=he[M];ge(()=>{t==="directory"&&v.current&&v.current.setAttribute("webkitdirectory",""),t==="both"&&B.current&&B.current.setAttribute("webkitdirectory","")},[t]);let S=Z(()=>O(y),[y]),P=Z(()=>p?p.split(",").map(e=>e.trim()).map(e=>e.startsWith(".")?e.toUpperCase():e.endsWith("/*")?e.replace("/*","").toUpperCase():e).join(", "):"All files",[p]),K=t==="directory"?"Drag & drop a folder here, or":t==="both"?"Drag & drop files or folders here, or":u?"Drag & drop files here, or":"Drag & drop a file here, or",oe=t==="directory"?"Browse folder":"Browse",se="Browse folder",_=b(e=>{if(e.size>y)return`File exceeds maximum size of ${S}`;if(p){let a=p.split(",").map(s=>s.trim()),l=`.${e.name.split(".").pop()?.toLowerCase()}`;if(!a.some(s=>s.startsWith(".")?l===s.toLowerCase():s.endsWith("/*")?e.type.startsWith(s.replace("/*","/")):e.type===s))return`File type not accepted. Expected: ${P}`}return null},[p,P,y,S]),E=b(e=>{if(r||o)return;let a=Array.from(e),l=[];for(let g of a){let s=_(g);s?V?.(g,s):l.push(g)}if(l.length!==0)if(w)if(u){let s=[...c??[],...l],m=x?s.slice(0,x):s;i?.(m)}else i?.([l[0]]);else A(g=>{let s=l.map(m=>({file:m,id:`file-${++ye}`}));if(u){let m=[...g,...s],Q=x?m.slice(0,x):m,de=Q.map(pe=>pe.file);return i?.(de),Q}return i?.([l[0]]),[s[0]]})},[r,o,w,u,x,c,i,V,_]),ne=b(e=>{if(!(r||o)){if(w){let a=(c??[]).filter((l,g)=>g!==e);i?.(a)}else A(a=>{let l=a.filter((g,s)=>s!==e);return i?.(l.map(g=>g.file)),l});v.current&&(v.current.value="")}},[r,o,w,c,i]),ie=b(()=>{r||o||(w?i?.([]):(A([]),i?.([])),v.current&&(v.current.value=""))},[r,o,w,i]),q=b(e=>{e.target.files&&e.target.files.length>0&&E(e.target.files)},[E]),ae=b(e=>{e.preventDefault(),e.stopPropagation(),!r&&!o&&$(!0)},[r,o]),le=b(e=>{e.preventDefault(),e.stopPropagation(),$(!1)},[]),ce=b(e=>{if(e.preventDefault(),e.stopPropagation(),$(!1),r||o)return;let a=e.dataTransfer.items;if(a&&a.length>0&&(t==="directory"||t==="both")){let l=[];for(let s=0;s<a.length;s++){let m=a[s].webkitGetAsEntry?.();m&&l.push(m)}if(l.some(s=>s.isDirectory)){ve(l).then(s=>{s.length>0&&E(s)});return}}e.dataTransfer.files&&e.dataTransfer.files.length>0&&E(e.dataTransfer.files)},[r,o,t,E]),I=b(()=>{!r&&!o&&v.current?.click()},[r,o]),J=b(()=>{!r&&!o&&B.current?.click()},[r,o]),D=F.length>0,ue=ee||(t==="directory"?me:be),fe=T&&D&&h("div",{className:d("flex flex-col",f.gap),children:[F.map((e,a)=>h("div",{className:d("flex items-center justify-between rounded-md border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50",f.fileItem),children:[h("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 shrink-0 text-gray-400 dark:text-gray-500",children:n("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),n("span",{className:"truncate text-gray-700 dark:text-gray-300",children:W(e.file)}),h("span",{className:"shrink-0 text-gray-400 dark:text-gray-500",children:["(",O(e.file.size),")"]})]}),!r&&!o&&n("button",{type:"button",onClick:()=>ne(a),className:"shrink-0 ml-2 text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 transition-colors cursor-pointer","aria-label":`Remove ${W(e.file)}`,children:n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4",children:n("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},e.id)),u&&F.length>1&&!r&&!o&&n("button",{type:"button",onClick:ie,className:d("self-start text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 transition-colors cursor-pointer",f.subtext),children:"Remove all"})]}),R=d("rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200 font-medium transition-colors","hover:bg-gray-50 dark:hover:bg-gray-700","disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1",f.button,k&&"border-red-300 dark:border-red-600");return h("div",{className:d("flex flex-col",f.gap,te),children:[H&&n("label",{htmlFor:N,className:d("block font-medium text-gray-700 dark:text-gray-300",f.text),children:H}),n("input",{ref:v,id:N,type:"file",accept:t!=="directory"?p:void 0,multiple:u,onChange:q,className:"sr-only",disabled:r||o,"aria-describedby":k?`${N}-error`:z?`${N}-helper`:void 0,"aria-invalid":!!k}),t==="both"&&n("input",{ref:B,type:"file",onChange:q,className:"sr-only",disabled:r||o,tabIndex:-1,"aria-hidden":"true"}),C==="dropzone"?h("div",{role:t==="both"?"group":"button",tabIndex:t==="both"?void 0:r||o?-1:0,onClick:t==="both"?void 0:I,onKeyDown:t==="both"?void 0:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),I())},onDragOver:ae,onDragLeave:le,onDrop:ce,className:d("flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",f.dropzone,G&&!r&&!o?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800",!r&&!o&&"hover:border-blue-400 dark:hover:border-blue-500 hover:bg-gray-50 dark:hover:bg-gray-800/70",t!=="both"&&!r&&!o&&"cursor-pointer",r&&"opacity-50 cursor-not-allowed",o&&"cursor-default",k&&"border-red-300 dark:border-red-600"),"aria-label":t==="both"?"File and folder drop zone":j||K,children:[n("div",{className:d("text-gray-400 dark:text-gray-500 mb-2",f.icon,G&&"text-blue-500 dark:text-blue-400"),children:ue}),h("p",{className:d("text-gray-600 dark:text-gray-400",f.text),children:[j||K," ",!r&&!o&&t!=="both"&&n("span",{className:"text-blue-600 dark:text-blue-400 font-medium",children:L||oe})]}),t==="both"&&!r&&!o&&h("div",{className:d("flex items-center gap-3 mt-1",f.text),children:[n("button",{type:"button",onClick:I,className:"text-blue-600 dark:text-blue-400 font-medium hover:underline cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded",children:L||"Browse files"}),n("span",{className:"text-gray-300 dark:text-gray-600",children:"\xB7"}),n("button",{type:"button",onClick:J,className:"text-blue-600 dark:text-blue-400 font-medium hover:underline cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded",children:U||se})]}),h("p",{className:d("text-gray-400 dark:text-gray-500 mt-1",f.subtext),children:[P," - Max ",S,u&&x&&` - Up to ${x} files`]})]}):h("div",{className:"flex items-center gap-2",children:[t==="both"?h(ke,{children:[n("button",{type:"button",onClick:I,disabled:r||o,className:R,children:L||(D?"Change files":"Choose files")}),n("button",{type:"button",onClick:J,disabled:r||o,className:R,children:U||"Choose folder"})]}):n("button",{type:"button",onClick:I,disabled:r||o,className:R,children:L||(t==="directory"?D?"Change folder":"Choose folder":D?"Change file":"Choose file")}),!D&&n("span",{className:d("text-gray-400 dark:text-gray-500",f.text),children:t==="directory"?"No folder selected":t==="both"?"No file or folder selected":"No file selected"}),D&&!T&&n("span",{className:d("text-gray-600 dark:text-gray-400 truncate",f.text),children:F.length===1?W(F[0].file):`${F.length} files selected`})]}),fe,k&&n("p",{id:`${N}-error`,className:d("text-red-600 dark:text-red-400",f.subtext),role:"alert",children:k}),z&&!k&&n("p",{id:`${N}-helper`,className:d("text-gray-400 dark:text-gray-500",f.subtext),children:z})]})}export{Fe as FileSelector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var f=(l,e)=>{for(var r in e)t(l,r,{get:e[r],enumerable:!0})},m=(l,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of F(e))!S.call(l,o)&&o!==r&&t(l,o,{get:()=>e[o],enumerable:!(c=p(e,o))||c.enumerable});return l};var x=l=>m(t({},"__esModule",{value:!0}),l);var d={};f(d,{FileSelector:()=>i.FileSelector});module.exports=x(d);var i=require("./FileSelector.cjs");0&&(module.exports={FileSelector});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FileSelector as o}from"./FileSelector.js";export{o as FileSelector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var m=(r,e)=>{for(var a in e)s(r,a,{get:e[a],enumerable:!0})},u=(r,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of y(e))!p.call(r,t)&&t!==a&&s(r,t,{get:()=>e[t],enumerable:!(o=c(e,t))||o.enumerable});return r};var f=r=>u(s({},"__esModule",{value:!0}),r);var x={};m(x,{Footer:()=>i});module.exports=f(x);var d=require("../../lib/cn.cjs"),n=require("react/jsx-runtime");function l(r){switch(r){case"bordered":return"border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-300";case"minimal":return"bg-transparent text-gray-600 dark:text-gray-400";case"dark":return"bg-gray-900 text-gray-300";default:return"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300"}}function b(r){switch(r){case"sm":return"py-6";case"lg":return"py-16";default:return"py-10"}}function i({variant:r="default",size:e="md",sticky:a=!1,className:o,children:t,...g}){return(0,n.jsx)("footer",{className:(0,d.cn)(l(r),b(e),a&&"sticky bottom-0 z-40",o),...g,children:(0,n.jsx)("div",{className:"container mx-auto px-4",children:t})})}i.displayName="Footer";0&&(module.exports={Footer});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as d}from"../../lib/cn.js";import{jsx as e}from"react/jsx-runtime";function i(r){switch(r){case"bordered":return"border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-300";case"minimal":return"bg-transparent text-gray-600 dark:text-gray-400";case"dark":return"bg-gray-900 text-gray-300";default:return"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300"}}function g(r){switch(r){case"sm":return"py-6";case"lg":return"py-16";default:return"py-10"}}function c({variant:r="default",size:t="md",sticky:a=!1,className:o,children:s,...n}){return e("footer",{className:d(i(r),g(t),a&&"sticky bottom-0 z-40",o),...n,children:e("div",{className:"container mx-auto px-4",children:s})})}c.displayName="Footer";export{c as Footer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(o,t)=>{for(var e in t)p(o,e,{get:t[e],enumerable:!0})},l=(o,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of n(t))!c.call(o,r)&&r!==e&&p(o,r,{get:()=>t[r],enumerable:!(a=i(t,r))||a.enumerable});return o};var x=o=>l(p({},"__esModule",{value:!0}),o);var y={};f(y,{FooterBottom:()=>d});module.exports=x(y);var s=require("../../lib/cn.cjs"),m=require("react/jsx-runtime");function d({copyright:o,className:t,children:e,...a}){return(0,m.jsxs)("div",{className:(0,s.cn)("mt-8 border-t border-gray-200 dark:border-gray-700 pt-6 flex flex-col sm:flex-row items-center justify-between gap-4",t),...a,children:[o&&(0,m.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:o}),e]})}d.displayName="FooterBottom";0&&(module.exports={FooterBottom});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as a}from"../../lib/cn.js";import{jsx as p,jsxs as s}from"react/jsx-runtime";function m({copyright:t,className:o,children:e,...r}){return s("div",{className:a("mt-8 border-t border-gray-200 dark:border-gray-700 pt-6 flex flex-col sm:flex-row items-center justify-between gap-4",o),...r,children:[t&&p("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:t}),e]})}m.displayName="FooterBottom";export{m as FooterBottom};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(o,e)=>{for(var r in e)a(o,r,{get:e[r],enumerable:!0})},f=(o,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of l(e))!c.call(o,t)&&t!==r&&a(o,t,{get:()=>e[t],enumerable:!(n=p(e,t))||n.enumerable});return o};var u=o=>f(a({},"__esModule",{value:!0}),o);var x={};d(x,{FooterColumn:()=>m});module.exports=u(x);var s=require("../../lib/cn.cjs"),i=require("react/jsx-runtime");function m({title:o,titleClassName:e,className:r,children:n,...t}){return(0,i.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-3",r),...t,children:[o&&(0,i.jsx)("h4",{className:(0,s.cn)("text-sm font-semibold uppercase tracking-wider text-gray-900 dark:text-white",e),children:o}),n]})}m.displayName="FooterColumn";0&&(module.exports={FooterColumn});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as o}from"../../lib/cn.js";import{jsx as s,jsxs as m}from"react/jsx-runtime";function a({title:e,titleClassName:t,className:r,children:n,...i}){return m("div",{className:o("flex flex-col gap-3",r),...i,children:[e&&s("h4",{className:o("text-sm font-semibold uppercase tracking-wider text-gray-900 dark:text-white",t),children:e}),n]})}a.displayName="FooterColumn";export{a as FooterColumn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var k=(o,e)=>{for(var t in e)a(o,t,{get:e[t],enumerable:!0})},l=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!m.call(o,r)&&r!==t&&a(o,r,{get:()=>e[r],enumerable:!(n=f(e,r))||n.enumerable});return o};var x=o=>l(a({},"__esModule",{value:!0}),o);var c={};k(c,{FooterLink:()=>p});module.exports=x(c);var i=require("../../lib/cn.cjs"),s=require("react/jsx-runtime");function p({external:o=!1,className:e,children:t,...n}){return(0,s.jsx)("a",{className:(0,i.cn)("text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",e),target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,...n,children:t})}p.displayName="FooterLink";0&&(module.exports={FooterLink});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as n}from"../../lib/cn.js";import{jsx as i}from"react/jsx-runtime";function a({external:e=!1,className:o,children:t,...r}){return i("a",{className:n("text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",o),target:e?"_blank":void 0,rel:e?"noopener noreferrer":void 0,...r,children:t})}a.displayName="FooterLink";export{a as FooterLink};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(r,e)=>{for(var o in e)c(r,o,{get:e[o],enumerable:!0})},u=(r,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!m.call(r,t)&&t!==o&&c(r,t,{get:()=>e[t],enumerable:!(s=g(e,t))||s.enumerable});return r};var f=r=>u(c({},"__esModule",{value:!0}),r);var N={};p(N,{FooterSection:()=>n});module.exports=f(N);var l=require("../../lib/cn.cjs"),i=require("react/jsx-runtime");function h(r){switch(r){case 1:return"grid-cols-1";case 2:return"grid-cols-1 sm:grid-cols-2";case 3:return"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3";case 4:return"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4";case 5:return"grid-cols-1 sm:grid-cols-2 lg:grid-cols-5";case 6:return"grid-cols-2 sm:grid-cols-3 lg:grid-cols-6";default:return""}}function n({title:r,titleClassName:e,columns:o,className:s,children:t,...d}){return(0,i.jsxs)("div",{className:(0,l.cn)(o&&"grid gap-8",h(o),s),...d,children:[r&&(0,i.jsx)("h3",{className:(0,l.cn)("text-sm font-semibold uppercase tracking-wider text-gray-900 dark:text-white",o&&"col-span-full",e),children:r}),t]})}n.displayName="FooterSection";0&&(module.exports={FooterSection});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as o}from"../../lib/cn.js";import{jsx as d,jsxs as g}from"react/jsx-runtime";function l(r){switch(r){case 1:return"grid-cols-1";case 2:return"grid-cols-1 sm:grid-cols-2";case 3:return"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3";case 4:return"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4";case 5:return"grid-cols-1 sm:grid-cols-2 lg:grid-cols-5";case 6:return"grid-cols-2 sm:grid-cols-3 lg:grid-cols-6";default:return""}}function n({title:r,titleClassName:t,columns:e,className:s,children:i,...c}){return g("div",{className:o(e&&"grid gap-8",l(e),s),...c,children:[r&&d("h3",{className:o("text-sm font-semibold uppercase tracking-wider text-gray-900 dark:text-white",e&&"col-span-full",t),children:r}),i]})}n.displayName="FooterSection";export{n as FooterSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var m=(e,o)=>{for(var t in o)i(e,t,{get:o[t],enumerable:!0})},x=(e,o,t,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of d(o))!f.call(e,r)&&r!==t&&i(e,r,{get:()=>o[r],enumerable:!(a=s(o,r))||a.enumerable});return e};var F=e=>x(i({},"__esModule",{value:!0}),e);var S={};m(S,{FooterSocial:()=>l,FooterSocialLink:()=>p});module.exports=F(S);var n=require("../../lib/cn.cjs"),c=require("react/jsx-runtime");function l({className:e,children:o,...t}){return(0,c.jsx)("div",{className:(0,n.cn)("flex items-center gap-4",e),...t,children:o})}l.displayName="FooterSocial";function p({icon:e,label:o,className:t,...a}){return(0,c.jsx)("a",{className:(0,n.cn)("text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",t),target:"_blank",rel:"noopener noreferrer","aria-label":o,...a,children:e})}p.displayName="FooterSocialLink";0&&(module.exports={FooterSocial,FooterSocialLink});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as r}from"../../lib/cn.js";import{jsx as a}from"react/jsx-runtime";function n({className:o,children:e,...t}){return a("div",{className:r("flex items-center gap-4",o),...t,children:e})}n.displayName="FooterSocial";function c({icon:o,label:e,className:t,...i}){return a("a",{className:r("text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",t),target:"_blank",rel:"noopener noreferrer","aria-label":e,...i,children:o})}c.displayName="FooterSocialLink";export{n as FooterSocial,c as FooterSocialLink};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var F=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var P=(r,o)=>{for(var e in o)F(r,e,{get:o[e],enumerable:!0})},y=(r,o,e,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of S(o))!s.call(r,t)&&t!==e&&F(r,t,{get:()=>o[t],enumerable:!(m=l(o,t))||m.enumerable});return r};var a=r=>y(F({},"__esModule",{value:!0}),r);var k={};P(k,{Footer:()=>i.Footer,FooterBottom:()=>c.FooterBottom,FooterColumn:()=>x.FooterColumn,FooterLink:()=>n.FooterLink,FooterSection:()=>f.FooterSection,FooterSocial:()=>p.FooterSocial,FooterSocialLink:()=>p.FooterSocialLink});module.exports=a(k);var i=require("./Footer.cjs"),f=require("./FooterSection.cjs"),x=require("./FooterColumn.cjs"),n=require("./FooterLink.cjs"),c=require("./FooterBottom.cjs"),p=require("./FooterSocial.cjs");0&&(module.exports={Footer,FooterBottom,FooterColumn,FooterLink,FooterSection,FooterSocial,FooterSocialLink});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Footer as t}from"./Footer.js";import{FooterSection as p}from"./FooterSection.js";import{FooterColumn as m}from"./FooterColumn.js";import{FooterLink as f}from"./FooterLink.js";import{FooterBottom as n}from"./FooterBottom.js";import{FooterSocial as l,FooterSocialLink as S}from"./FooterSocial.js";export{t as Footer,n as FooterBottom,m as FooterColumn,f as FooterLink,p as FooterSection,l as FooterSocial,S as FooterSocialLink};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var s=(n,t)=>{for(var p in t)e(n,p,{get:t[p],enumerable:!0})},y=(n,t,p,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!I.call(n,o)&&o!==p&&e(n,o,{get:()=>t[o],enumerable:!(r=f(t,o))||r.enumerable});return n};var M=n=>y(e({},"__esModule",{value:!0}),n);var a={};s(a,{Input:()=>u.Input,MentionInput:()=>m.MentionInput,NumberInput:()=>i.NumberInput});module.exports=M(a);var u=require("./input/index.cjs"),m=require("./mention-input/index.cjs"),i=require("./number-input/index.cjs");0&&(module.exports={Input,MentionInput,NumberInput});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Input as o}from"./input/index.js";import{MentionInput as e}from"./mention-input/index.js";import{NumberInput as u}from"./number-input/index.js";export{o as Input,e as MentionInput,u as NumberInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var T=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var j=(t,e)=>{for(var a in e)T(t,a,{get:e[a],enumerable:!0})},B=(t,e,a,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!z.call(t,n)&&n!==a&&T(t,n,{get:()=>e[n],enumerable:!(p=v(e,n))||p.enumerable});return t};var F=t=>B(T({},"__esModule",{value:!0}),t);var O={};j(O,{Input:()=>g});module.exports=F(O);var s=require("react"),C=require("../../../lib/cn.cjs"),i=require("../shared/inputStyles.cjs"),P=require("../shared/InputWrapper.cjs"),l=require("react/jsx-runtime"),g=(0,s.forwardRef)(({label:t,inline:e=!1,size:a="md",labelColor:p,borderColor:n,textColor:f,disabled:r=!1,readOnly:o=!1,error:b=!1,helperText:W,hideLabel:y=!1,icon:m,iconPosition:R="left",multiline:L=!1,rows:A=3,focused:M=!1,className:S,...d},u)=>{let E=(0,s.useRef)(null),H=I=>{E.current=I,typeof u=="function"?u(I):u&&(u.current=I)};(0,s.useEffect)(()=>{M&&E.current?.focus()},[M]);let c=(0,s.useId)(),x=(0,C.cn)((0,i.getBaseInputClasses)({size:a,error:b,disabled:r,readOnly:o,icon:m,iconPosition:R}),L&&"resize-vertical",S),N={...n&&{borderColor:n},...f&&{color:f}},h=n||f?N:void 0;return(0,l.jsx)(P.InputWrapper,{label:t,hideLabel:y,labelColor:p,error:b,helperText:W,inline:e,htmlFor:c,children:(0,l.jsxs)("div",{className:"relative w-full",children:[m&&(0,l.jsx)("span",{className:(0,i.getIconClasses)(R),children:m}),L?(0,l.jsx)("textarea",{ref:H,id:c,disabled:r,readOnly:o,rows:A,tabIndex:o||r?-1:void 0,className:x,style:h,...d}):(0,l.jsx)("input",{ref:H,id:c,disabled:r,readOnly:o,tabIndex:o||r?-1:void 0,className:x,style:h,...d})]})})});g.displayName="Input";0&&(module.exports={Input});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{forwardRef as g,useEffect as W,useId as y,useRef as A}from"react";import{cn as S}from"../../../lib/cn.js";import{getBaseInputClasses as N,getIconClasses as v}from"../shared/inputStyles.js";import{InputWrapper as w}from"../shared/InputWrapper.js";import{jsx as s,jsxs as j}from"react/jsx-runtime";var z=g(({label:L,inline:M=!1,size:d="md",labelColor:E,borderColor:l,textColor:a,disabled:e=!1,readOnly:t=!1,error:u=!1,helperText:H,hideLabel:x=!1,icon:r,iconPosition:i="left",multiline:f=!1,rows:h=3,focused:m=!1,className:C,...c},n)=>{let I=A(null),T=p=>{I.current=p,typeof n=="function"?n(p):n&&(n.current=p)};W(()=>{m&&I.current?.focus()},[m]);let o=y(),b=S(N({size:d,error:u,disabled:e,readOnly:t,icon:r,iconPosition:i}),f&&"resize-vertical",C),P={...l&&{borderColor:l},...a&&{color:a}},R=l||a?P:void 0;return s(w,{label:L,hideLabel:x,labelColor:E,error:u,helperText:H,inline:M,htmlFor:o,children:j("div",{className:"relative w-full",children:[r&&s("span",{className:v(i),children:r}),f?s("textarea",{ref:T,id:o,disabled:e,readOnly:t,rows:h,tabIndex:t||e?-1:void 0,className:b,style:R,...c}):s("input",{ref:T,id:o,disabled:e,readOnly:t,tabIndex:t||e?-1:void 0,className:b,style:R,...c})]})})});z.displayName="Input";export{z as Input};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var x=(t,p)=>{for(var r in p)e(t,r,{get:p[r],enumerable:!0})},s=(t,p,r,n)=>{if(p&&typeof p=="object"||typeof p=="function")for(let o of f(p))!m.call(t,o)&&o!==r&&e(t,o,{get:()=>p[o],enumerable:!(n=I(p,o))||n.enumerable});return t};var y=t=>s(e({},"__esModule",{value:!0}),t);var P={};x(P,{Input:()=>u.Input});module.exports=y(P);var u=require("./Input.cjs");0&&(module.exports={Input});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Input as o}from"./Input.js";export{o as Input};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var X=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var xe=(l,d)=>{for(var m in d)X(l,m,{get:d[m],enumerable:!0})},he=(l,d,m,M)=>{if(d&&typeof d=="object"||typeof d=="function")for(let f of ge(d))!be.call(l,f)&&f!==m&&X(l,f,{get:()=>d[f],enumerable:!(M=me(d,f))||M.enumerable});return l};var ve=l=>he(X({},"__esModule",{value:!0}),l);var Ne={};xe(Ne,{MentionInput:()=>oe});module.exports=ve(Ne);var o=require("react"),te=require("react-dom/client"),R=require("../../../lib/cn.cjs"),L=require("../shared/inputStyles.cjs"),ne=require("../shared/InputWrapper.cjs"),re=require("../../chip/Chip.cjs"),c=require("react/jsx-runtime"),ye=l=>(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[l.avatar&&(0,c.jsx)("img",{src:l.avatar,alt:l.label,className:"w-6 h-6 rounded-full"}),(0,c.jsx)("span",{className:"text-sm text-gray-900 dark:text-white",children:l.label})]}),oe=(0,o.forwardRef)(({label:l,inline:d=!1,size:m="md",labelColor:M,borderColor:f,textColor:k,disabled:g=!1,readOnly:C=!1,error:$=!1,helperText:ae,hideLabel:ie=!1,icon:B,iconPosition:K="left",mentionTrigger:b="@",suggestions:T=[],onMentionSearch:W,onMentionSelect:F,onMentionRemove:Q,renderSuggestion:U,value:p,onChange:x,placeholder:H,loading:se=!1,maxSuggestions:O=10,chipVariant:j="soft",chipColor:G="primary",chipSize:J="sm"},I)=>{let Y=(0,o.useId)(),s=(0,o.useRef)(null),[_,w]=(0,o.useState)(!1),[D,V]=(0,o.useState)(0),[Ce,P]=(0,o.useState)(""),le=(0,R.cn)((0,L.getBaseInputClasses)({size:m,error:$,disabled:g,readOnly:C,icon:B,iconPosition:K}),"min-h-[42px]","whitespace-pre-wrap","break-words"),ce={...f&&{borderColor:f},...k&&{color:k}},de=f||k?ce:void 0,h=(0,o.useCallback)(()=>{if(!s.current)return{text:"",mentions:[]};let e="",n=[],t=0,a=r=>{if(r.nodeType===Node.TEXT_NODE)e+=r.textContent||"",t+=(r.textContent||"").length;else if(r.nodeType===Node.ELEMENT_NODE){let i=r;if(i.hasAttribute("data-mention-id")){let u=i.getAttribute("data-mention-id"),v=i.getAttribute("data-mention-label")||"",A=i.getAttribute("data-mention-avatar")||void 0,y=`@${v}`,S=t;n.push({trigger:b,suggestion:{id:u||"",label:v,avatar:A},startIndex:S,endIndex:S+y.length}),e+=y,t+=y.length}else i.childNodes.forEach(a)}};return s.current.childNodes.forEach(a),{text:e,mentions:n}},[b]),Z=(0,o.useCallback)((e,n)=>{let t=document.createElement("span");return t.contentEditable="false",t.setAttribute("data-mention-id",e.id),t.setAttribute("data-mention-label",e.label),e.avatar&&t.setAttribute("data-mention-avatar",e.avatar),t.className="inline-block align-middle mx-0.5",t.style.userSelect="none",(0,te.createRoot)(t).render((0,c.jsx)(re.Chip,{label:e.label,variant:j,color:G,size:J,closable:!g&&!C,onClose:n,disabled:g,avatar:e.avatar?(0,c.jsx)("img",{src:e.avatar,alt:e.label,className:"w-full h-full object-cover"}):void 0})),t},[j,G,J,g,C]),E=(0,o.useCallback)(e=>{if(!s.current)return;let n=s.current.querySelector(`[data-mention-id="${e}"]`);if(n){n.remove();let t=h();x?.(t);let a=p?.mentions.find(r=>r.suggestion.id===e)?.suggestion;a&&Q?.(a)}},[h,x,Q,p?.mentions]),ue=(0,o.useCallback)(()=>{if(!s.current)return;let e=window.getSelection();if(!e||e.rangeCount===0)return;let n=e.getRangeAt(0),t="";n.startContainer.nodeType===Node.TEXT_NODE&&(t=n.startContainer.textContent?.substring(0,n.startOffset)||"");let a=t.match(new RegExp(`${b}(\\w*)$`));if(a){let i=a[1];P(i),w(!0),V(0),W?.(i)}else w(!1),P("");let r=h();x?.(r)},[b,W,x,h]),q=(0,o.useCallback)(e=>{if(!s.current)return;let n=window.getSelection();if(!n||n.rangeCount===0)return;let t=n.getRangeAt(0);if(t.startContainer.nodeType===Node.TEXT_NODE){let r=t.startContainer,i=r.textContent||"",u=t.startOffset,A=i.substring(0,u).lastIndexOf(b);if(A!==-1){let y=i.substring(0,A),S=i.substring(u),N=Z(e,()=>{E(e.id)});if(y?(r.textContent=y,r.parentNode?.insertBefore(N,r.nextSibling)):(r.parentNode?.insertBefore(N,r),r.textContent="",r.textContent||r.remove()),S){let pe=document.createTextNode(S);N.parentNode?.insertBefore(pe,N.nextSibling)}let ee=document.createTextNode(" ");N.parentNode?.insertBefore(ee,N.nextSibling);let z=document.createRange();z.setStartAfter(ee),z.collapse(!0),n.removeAllRanges(),n.addRange(z)}}w(!1),P("");let a=h();x?.(a),F?.(e),s.current.focus()},[b,Z,E,h,x,F]),fe=(0,o.useCallback)(e=>{let n=T.slice(0,O);if(_&&n.length>0)switch(e.key){case"ArrowDown":e.preventDefault(),V(t=>t<n.length-1?t+1:0);return;case"ArrowUp":e.preventDefault(),V(t=>t>0?t-1:n.length-1);return;case"Enter":case"Tab":e.preventDefault(),n[D]&&q(n[D]);return;case"Escape":e.preventDefault(),w(!1);return}if(e.key==="Backspace"){let t=window.getSelection();if(!t||t.rangeCount===0)return;let a=t.getRangeAt(0);if(a.collapsed&&a.startOffset===0){let r=a.startContainer.previousSibling;if(r&&r.nodeType===Node.ELEMENT_NODE){let i=r;if(i.hasAttribute("data-mention-id")){e.preventDefault();let u=i.getAttribute("data-mention-id");u&&E(u);return}}}if(a.collapsed&&a.startContainer.nodeType===Node.TEXT_NODE){let r=a.startContainer;if(a.startOffset===0){let i=r.previousSibling;if(i&&i.nodeType===Node.ELEMENT_NODE){let u=i;if(u.hasAttribute("data-mention-id")){e.preventDefault();let v=u.getAttribute("data-mention-id");v&&E(v);return}}}}}},[_,T,D,O,q,E]);return(0,o.useEffect)(()=>{s.current&&(!(s.current.textContent||s.current.querySelector("[data-mention-id]"))&&H?s.current.setAttribute("data-placeholder",H):s.current.removeAttribute("data-placeholder"))},[H,p]),(0,o.useEffect)(()=>{s.current&&p?.text===""&&p?.mentions.length===0&&s.current.innerHTML.trim()&&(s.current.innerHTML="")},[p?.text,p?.mentions.length]),(0,c.jsx)(ne.InputWrapper,{label:l,hideLabel:ie,labelColor:M,error:$,helperText:ae,inline:d,htmlFor:Y,children:(0,c.jsxs)("div",{className:"relative w-full",children:[B&&(0,c.jsx)("span",{className:(0,L.getIconClasses)(K),children:B}),(0,c.jsx)("div",{ref:e=>{typeof I=="function"?I(e):I&&(I.current=e),s.current=e},id:Y,contentEditable:!g&&!C,suppressContentEditableWarning:!0,onInput:ue,onKeyDown:fe,className:(0,R.cn)(le,"empty:before:content-[attr(data-placeholder)] empty:before:text-gray-400 empty:before:dark:text-gray-500"),style:de,role:"textbox","aria-label":l,"aria-multiline":"true",tabIndex:C||g?-1:0}),_&&T.length>0&&(0,c.jsx)("div",{className:"absolute z-10 mt-1 w-full max-h-60 overflow-auto rounded-lg border border-gray-300 bg-white dark:bg-gray-700 dark:border-gray-600 shadow-lg",children:se?(0,c.jsx)("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Loading..."}):T.slice(0,O).map((e,n)=>(0,c.jsx)("div",{onClick:()=>q(e),className:(0,R.cn)(n===D&&"bg-gray-100 dark:bg-gray-600"),children:U?U(e):ye(e)},e.id))})]})})});oe.displayName="MentionInput";0&&(module.exports={MentionInput});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{forwardRef as ue,useCallback as h,useEffect as J,useId as fe,useRef as pe,useState as _}from"react";import{createRoot as me}from"react-dom/client";import{cn as V}from"../../../lib/cn.js";import{getBaseInputClasses as ge,getIconClasses as be}from"../shared/inputStyles.js";import{InputWrapper as xe}from"../shared/InputWrapper.js";import{Chip as he}from"../../chip/Chip.js";import{jsx as l,jsxs as Y}from"react/jsx-runtime";var ve=c=>Y("div",{className:"flex items-center gap-2 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[c.avatar&&l("img",{src:c.avatar,alt:c.label,className:"w-6 h-6 rounded-full"}),l("span",{className:"text-sm text-gray-900 dark:text-white",children:c.label})]}),ye=ue(({label:c,inline:Z=!1,size:ee="md",labelColor:te,borderColor:I,textColor:w,disabled:u=!1,readOnly:v=!1,error:P=!1,helperText:ne,hideLabel:re=!1,icon:D,iconPosition:q="left",mentionTrigger:f="@",suggestions:C=[],onMentionSearch:z,onMentionSelect:X,onMentionRemove:$,renderSuggestion:K,value:d,onChange:p,placeholder:A,loading:oe=!1,maxSuggestions:R=10,chipVariant:W="soft",chipColor:F="primary",chipSize:Q="sm"},E)=>{let U=fe(),i=pe(null),[L,S]=_(!1),[M,k]=_(0),[Ne,B]=_(""),ae=V(ge({size:ee,error:P,disabled:u,readOnly:v,icon:D,iconPosition:q}),"min-h-[42px]","whitespace-pre-wrap","break-words"),ie={...I&&{borderColor:I},...w&&{color:w}},se=I||w?ie:void 0,m=h(()=>{if(!i.current)return{text:"",mentions:[]};let e="",n=[],t=0,o=r=>{if(r.nodeType===Node.TEXT_NODE)e+=r.textContent||"",t+=(r.textContent||"").length;else if(r.nodeType===Node.ELEMENT_NODE){let a=r;if(a.hasAttribute("data-mention-id")){let s=a.getAttribute("data-mention-id"),g=a.getAttribute("data-mention-label")||"",T=a.getAttribute("data-mention-avatar")||void 0,b=`@${g}`,N=t;n.push({trigger:f,suggestion:{id:s||"",label:g,avatar:T},startIndex:N,endIndex:N+b.length}),e+=b,t+=b.length}else a.childNodes.forEach(o)}};return i.current.childNodes.forEach(o),{text:e,mentions:n}},[f]),j=h((e,n)=>{let t=document.createElement("span");return t.contentEditable="false",t.setAttribute("data-mention-id",e.id),t.setAttribute("data-mention-label",e.label),e.avatar&&t.setAttribute("data-mention-avatar",e.avatar),t.className="inline-block align-middle mx-0.5",t.style.userSelect="none",me(t).render(l(he,{label:e.label,variant:W,color:F,size:Q,closable:!u&&!v,onClose:n,disabled:u,avatar:e.avatar?l("img",{src:e.avatar,alt:e.label,className:"w-full h-full object-cover"}):void 0})),t},[W,F,Q,u,v]),y=h(e=>{if(!i.current)return;let n=i.current.querySelector(`[data-mention-id="${e}"]`);if(n){n.remove();let t=m();p?.(t);let o=d?.mentions.find(r=>r.suggestion.id===e)?.suggestion;o&&$?.(o)}},[m,p,$,d?.mentions]),le=h(()=>{if(!i.current)return;let e=window.getSelection();if(!e||e.rangeCount===0)return;let n=e.getRangeAt(0),t="";n.startContainer.nodeType===Node.TEXT_NODE&&(t=n.startContainer.textContent?.substring(0,n.startOffset)||"");let o=t.match(new RegExp(`${f}(\\w*)$`));if(o){let a=o[1];B(a),S(!0),k(0),z?.(a)}else S(!1),B("");let r=m();p?.(r)},[f,z,p,m]),H=h(e=>{if(!i.current)return;let n=window.getSelection();if(!n||n.rangeCount===0)return;let t=n.getRangeAt(0);if(t.startContainer.nodeType===Node.TEXT_NODE){let r=t.startContainer,a=r.textContent||"",s=t.startOffset,T=a.substring(0,s).lastIndexOf(f);if(T!==-1){let b=a.substring(0,T),N=a.substring(s),x=j(e,()=>{y(e.id)});if(b?(r.textContent=b,r.parentNode?.insertBefore(x,r.nextSibling)):(r.parentNode?.insertBefore(x,r),r.textContent="",r.textContent||r.remove()),N){let de=document.createTextNode(N);x.parentNode?.insertBefore(de,x.nextSibling)}let G=document.createTextNode(" ");x.parentNode?.insertBefore(G,x.nextSibling);let O=document.createRange();O.setStartAfter(G),O.collapse(!0),n.removeAllRanges(),n.addRange(O)}}S(!1),B("");let o=m();p?.(o),X?.(e),i.current.focus()},[f,j,y,m,p,X]),ce=h(e=>{let n=C.slice(0,R);if(L&&n.length>0)switch(e.key){case"ArrowDown":e.preventDefault(),k(t=>t<n.length-1?t+1:0);return;case"ArrowUp":e.preventDefault(),k(t=>t>0?t-1:n.length-1);return;case"Enter":case"Tab":e.preventDefault(),n[M]&&H(n[M]);return;case"Escape":e.preventDefault(),S(!1);return}if(e.key==="Backspace"){let t=window.getSelection();if(!t||t.rangeCount===0)return;let o=t.getRangeAt(0);if(o.collapsed&&o.startOffset===0){let r=o.startContainer.previousSibling;if(r&&r.nodeType===Node.ELEMENT_NODE){let a=r;if(a.hasAttribute("data-mention-id")){e.preventDefault();let s=a.getAttribute("data-mention-id");s&&y(s);return}}}if(o.collapsed&&o.startContainer.nodeType===Node.TEXT_NODE){let r=o.startContainer;if(o.startOffset===0){let a=r.previousSibling;if(a&&a.nodeType===Node.ELEMENT_NODE){let s=a;if(s.hasAttribute("data-mention-id")){e.preventDefault();let g=s.getAttribute("data-mention-id");g&&y(g);return}}}}}},[L,C,M,R,H,y]);return J(()=>{i.current&&(!(i.current.textContent||i.current.querySelector("[data-mention-id]"))&&A?i.current.setAttribute("data-placeholder",A):i.current.removeAttribute("data-placeholder"))},[A,d]),J(()=>{i.current&&d?.text===""&&d?.mentions.length===0&&i.current.innerHTML.trim()&&(i.current.innerHTML="")},[d?.text,d?.mentions.length]),l(xe,{label:c,hideLabel:re,labelColor:te,error:P,helperText:ne,inline:Z,htmlFor:U,children:Y("div",{className:"relative w-full",children:[D&&l("span",{className:be(q),children:D}),l("div",{ref:e=>{typeof E=="function"?E(e):E&&(E.current=e),i.current=e},id:U,contentEditable:!u&&!v,suppressContentEditableWarning:!0,onInput:le,onKeyDown:ce,className:V(ae,"empty:before:content-[attr(data-placeholder)] empty:before:text-gray-400 empty:before:dark:text-gray-500"),style:se,role:"textbox","aria-label":c,"aria-multiline":"true",tabIndex:v||u?-1:0}),L&&C.length>0&&l("div",{className:"absolute z-10 mt-1 w-full max-h-60 overflow-auto rounded-lg border border-gray-300 bg-white dark:bg-gray-700 dark:border-gray-600 shadow-lg",children:oe?l("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Loading..."}):C.slice(0,R).map((e,n)=>l("div",{onClick:()=>H(e),className:V(n===M&&"bg-gray-100 dark:bg-gray-600"),children:K?K(e):ve(e)},e.id))})]})})});ye.displayName="MentionInput";export{ye as MentionInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var f=(t,n)=>{for(var p in n)e(t,p,{get:n[p],enumerable:!0})},m=(t,n,p,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of I(n))!M.call(t,o)&&o!==p&&e(t,o,{get:()=>n[o],enumerable:!(r=u(n,o))||r.enumerable});return t};var x=t=>m(e({},"__esModule",{value:!0}),t);var s={};f(s,{MentionInput:()=>i.MentionInput});module.exports=x(s);var i=require("./MentionInput.cjs");0&&(module.exports={MentionInput});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MentionInput as o}from"./MentionInput.js";export{o as MentionInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var N=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var ie=(s,t)=>{for(var c in t)N(s,c,{get:t[c],enumerable:!0})},ae=(s,t,c,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of le(t))!ue.call(s,l)&&l!==c&&N(s,l,{get:()=>t[l],enumerable:!(h=se(t,l))||h.enumerable});return s};var oe=s=>ae(N({},"__esModule",{value:!0}),s);var ce={};ie(ce,{NumberInput:()=>U});module.exports=oe(ce);var i=require("react"),B=require("../../../lib/cn.cjs"),y=require("../shared/inputStyles.cjs"),O=require("../shared/InputWrapper.cjs"),o=require("react/jsx-runtime"),U=(0,i.forwardRef)(({label:s,inline:t=!1,size:c="md",labelColor:h,borderColor:l,textColor:I,disabled:w=!1,readOnly:$=!1,error:C=!1,helperText:W,hideLabel:x=!1,icon:m,iconPosition:d="left",className:z,value:f,onChange:v,format:g="number",currency:M="USD",locale:u="en-US",decimals:a,min:E,max:F,step:pe=1,prefix:p,suffix:b,thousandSeparator:S=!0,allowNegative:K=!0,onBlur:L,onFocus:T,...G},P)=>{let H=(0,i.useId)(),[V,D]=(0,i.useState)(null),k=(0,i.useMemo)(()=>{let n=g==="currency"?{style:"currency",currency:M,minimumFractionDigits:a??2,maximumFractionDigits:a??2}:g==="percentage"?{minimumFractionDigits:a??0,maximumFractionDigits:a??2}:{minimumFractionDigits:a??0,maximumFractionDigits:a??(g==="decimal"?2:0),useGrouping:S};try{return new Intl.NumberFormat(u,n)}catch{return null}},[g,M,u,a,S]),_=n=>{if(n==null)return"";if(!k)return String(n);let e=k.format(n);return g==="percentage"?(e=p?`${p}${e}`:e,e=b||!e.includes("%")?`${e}%`:e,e):(p&&(e=`${p}${e}`),b&&(e=`${e}${b}`),e)},R=n=>{if(!n||n.trim()==="")return null;let e=n;if(p&&(e=e.replace(p,"")),b&&(e=e.replace(b,"")),e=e.replace(/[^\d.,-]/g,""),u.includes("fr")||u.includes("de")?e=e.replace(/\s/g,"").replace(",","."):e=e.replace(",",""),!e||e==="-"||e===".")return null;let r=parseFloat(e);return isNaN(r)?null:!K&&r<0?Math.abs(r):E!==void 0&&r<E?E:F!==void 0&&r>F?F:r},A=V??_(f??null),q=n=>{let e=u.includes("fr")||u.includes("de")?",":".";return new RegExp(`^-?[0-9${e===","?",":"\\."}]*$`).test(n)},J=n=>{let e=n.target.value;if(e===""||q(e)){D(e);let r=R(e);v&&v(r)}},Q=n=>{let e=u.includes("fr")||u.includes("de")?",":".",r=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],ee=/^[0-9]$/.test(n.key),ne=n.key===e,te=n.key==="-"&&K&&A.indexOf("-")===-1,re=n.ctrlKey||n.metaKey;!ee&&!ne&&!te&&!r.includes(n.key)&&!re&&n.preventDefault()},X=n=>{let e=f!=null?String(f):"";D(e),T&&T(n)},Y=n=>{let e=R(V??"");v&&e!==f&&v(e),D(null),L&&L(n)},Z=(0,B.cn)((0,y.getBaseInputClasses)({size:c,error:C,disabled:w,readOnly:$,icon:m,iconPosition:d}),l&&`border-[${l}]`,I&&`text-[${I}]`,z),j=(0,o.jsxs)("div",{className:"relative",children:[m&&d==="left"&&(0,o.jsx)("div",{className:(0,y.getIconClasses)(d),children:m}),(0,o.jsx)("input",{ref:P,id:H,type:"text",inputMode:"decimal",className:Z,style:{borderColor:l,color:I},disabled:w,readOnly:$,value:A,onChange:J,onKeyDown:Q,onFocus:X,onBlur:Y,...G}),m&&d==="right"&&(0,o.jsx)("div",{className:(0,y.getIconClasses)(d),children:m})]});return(0,o.jsx)(O.InputWrapper,{label:s,hideLabel:x,labelColor:h,error:C,helperText:W,inline:t,htmlFor:H,children:j})});U.displayName="NumberInput";0&&(module.exports={NumberInput});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{forwardRef as j,useId as ee,useState as ne,useMemo as te}from"react";import{cn as re}from"../../../lib/cn.js";import{getBaseInputClasses as se,getIconClasses as L}from"../shared/inputStyles.js";import{InputWrapper as le}from"../shared/InputWrapper.js";import{jsx as m,jsxs as ie}from"react/jsx-runtime";var ue=j(({label:T,inline:H=!1,size:V="md",labelColor:k,borderColor:d,textColor:f,disabled:h=!1,readOnly:v=!1,error:I=!1,helperText:R,hideLabel:A=!1,icon:u,iconPosition:i="left",className:B,value:a,onChange:p,format:o="number",currency:E="USD",locale:r="en-US",decimals:s,min:g,max:b,step:ae=1,prefix:l,suffix:c,thousandSeparator:F=!0,allowNegative:D=!0,onBlur:N,onFocus:w,...O},U)=>{let $=ee(),[C,y]=ne(null),M=te(()=>{let n=o==="currency"?{style:"currency",currency:E,minimumFractionDigits:s??2,maximumFractionDigits:s??2}:o==="percentage"?{minimumFractionDigits:s??0,maximumFractionDigits:s??2}:{minimumFractionDigits:s??0,maximumFractionDigits:s??(o==="decimal"?2:0),useGrouping:F};try{return new Intl.NumberFormat(r,n)}catch{return null}},[o,E,r,s,F]),W=n=>{if(n==null)return"";if(!M)return String(n);let e=M.format(n);return o==="percentage"?(e=l?`${l}${e}`:e,e=c||!e.includes("%")?`${e}%`:e,e):(l&&(e=`${l}${e}`),c&&(e=`${e}${c}`),e)},S=n=>{if(!n||n.trim()==="")return null;let e=n;if(l&&(e=e.replace(l,"")),c&&(e=e.replace(c,"")),e=e.replace(/[^\d.,-]/g,""),r.includes("fr")||r.includes("de")?e=e.replace(/\s/g,"").replace(",","."):e=e.replace(",",""),!e||e==="-"||e===".")return null;let t=parseFloat(e);return isNaN(t)?null:!D&&t<0?Math.abs(t):g!==void 0&&t<g?g:b!==void 0&&t>b?b:t},K=C??W(a??null),x=n=>{let e=r.includes("fr")||r.includes("de")?",":".";return new RegExp(`^-?[0-9${e===","?",":"\\."}]*$`).test(n)},z=n=>{let e=n.target.value;if(e===""||x(e)){y(e);let t=S(e);p&&p(t)}},G=n=>{let e=r.includes("fr")||r.includes("de")?",":".",t=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Q=/^[0-9]$/.test(n.key),X=n.key===e,Y=n.key==="-"&&D&&K.indexOf("-")===-1,Z=n.ctrlKey||n.metaKey;!Q&&!X&&!Y&&!t.includes(n.key)&&!Z&&n.preventDefault()},P=n=>{let e=a!=null?String(a):"";y(e),w&&w(n)},_=n=>{let e=S(C??"");p&&e!==a&&p(e),y(null),N&&N(n)},q=re(se({size:V,error:I,disabled:h,readOnly:v,icon:u,iconPosition:i}),d&&`border-[${d}]`,f&&`text-[${f}]`,B),J=ie("div",{className:"relative",children:[u&&i==="left"&&m("div",{className:L(i),children:u}),m("input",{ref:U,id:$,type:"text",inputMode:"decimal",className:q,style:{borderColor:d,color:f},disabled:h,readOnly:v,value:K,onChange:z,onKeyDown:G,onFocus:P,onBlur:_,...O}),u&&i==="right"&&m("div",{className:L(i),children:u})]});return m(le,{label:T,hideLabel:A,labelColor:k,error:I,helperText:R,inline:H,htmlFor:$,children:J})});ue.displayName="NumberInput";export{ue as NumberInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var N=(p,r)=>{for(var t in r)u(p,t,{get:r[t],enumerable:!0})},f=(p,r,t,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of n(r))!I.call(p,e)&&e!==t&&u(p,e,{get:()=>r[e],enumerable:!(m=b(r,e))||m.enumerable});return p};var x=p=>f(u({},"__esModule",{value:!0}),p);var s={};N(s,{NumberInput:()=>o.NumberInput});module.exports=x(s);var o=require("./NumberInput.cjs");0&&(module.exports={NumberInput});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NumberInput as e}from"./NumberInput.js";export{e as NumberInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var b=(r,e)=>{for(var l in e)m(r,l,{get:e[l],enumerable:!0})},x=(r,e,l,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of d(e))!g.call(r,a)&&a!==l&&m(r,a,{get:()=>e[a],enumerable:!(s=i(e,a))||s.enumerable});return r};var N=r=>x(m({},"__esModule",{value:!0}),r);var h={};b(h,{InputWrapper:()=>u});module.exports=N(h);var n=require("../../../lib/cn.cjs"),p=require("./inputStyles.cjs"),o=require("react/jsx-runtime"),u=({label:r,hideLabel:e,labelColor:l,error:s,helperText:a,inline:t,children:c,htmlFor:f})=>(0,o.jsxs)("div",{className:t?"flex items-center gap-4":"flex flex-col",children:[r&&!e&&(0,o.jsx)("label",{htmlFor:f,className:(0,p.getLabelClasses)(t||!1,l),style:l?{color:l}:void 0,children:r}),(0,o.jsx)("div",{className:t?"flex-1":"w-full",children:c}),a&&(0,o.jsx)("p",{className:(0,n.cn)((0,p.getHelperTextClasses)(s),t&&"ml-34"),children:a})]});0&&(module.exports={InputWrapper});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as n}from"../../../lib/cn.js";import{getLabelClasses as c,getHelperTextClasses as f}from"./inputStyles.js";import{jsx as l,jsxs as i}from"react/jsx-runtime";var b=({label:a,hideLabel:s,labelColor:r,error:t,helperText:o,inline:e,children:p,htmlFor:m})=>i("div",{className:e?"flex items-center gap-4":"flex flex-col",children:[a&&!s&&l("label",{htmlFor:m,className:c(e||!1,r),style:r?{color:r}:void 0,children:a}),l("div",{className:e?"flex-1":"w-full",children:p}),o&&l("p",{className:n(f(t),e&&"ml-34"),children:o})]});export{b as InputWrapper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var p=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},b=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of d(t))!i.call(e,r)&&r!==o&&a(e,r,{get:()=>t[r],enumerable:!(n=g(t,r))||n.enumerable});return e};var x=e=>b(a({},"__esModule",{value:!0}),e);var k={};p(k,{getBaseInputClasses:()=>m,getHelperTextClasses:()=>y,getIconClasses:()=>f,getLabelClasses:()=>u});module.exports=x(k);var s=require("../../../lib/cn.cjs"),c=(e="md")=>({sm:"text-xs p-1.5",md:"text-sm p-2.5",lg:"text-base p-3.5"})[e],m=({size:e="md",error:t,disabled:o,readOnly:n,icon:r,iconPosition:l})=>(0,s.cn)("bg-gray-50 rounded-lg block w-full","border focus:outline-none focus:ring-0","dark:bg-gray-700 dark:placeholder-gray-400",c(e),r&&l==="left"?"pl-9":"",r&&l==="right"?"pr-9":"",o?"opacity-50 cursor-not-allowed":"",n?"bg-gray-100 dark:bg-gray-600 cursor-default":"",t?"border-red-500 dark:border-red-500":"border-gray-300 dark:border-gray-600"),u=(e,t)=>(0,s.cn)("text-sm font-medium",e?"min-w-[120px]":"block mb-2",!t&&"text-gray-900 dark:text-white"),y=e=>(0,s.cn)("mt-1 text-xs",e?"text-red-500 dark:text-red-400":"text-gray-500 dark:text-gray-400"),f=e=>(0,s.cn)("absolute inset-y-0 flex items-center pointer-events-none",e==="left"?"left-2.5":"right-2.5");0&&(module.exports={getBaseInputClasses,getHelperTextClasses,getIconClasses,getLabelClasses});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cn as r}from"../../../lib/cn.js";var l=(e="md")=>({sm:"text-xs p-1.5",md:"text-sm p-2.5",lg:"text-base p-3.5"})[e],d=({size:e="md",error:t,disabled:n,readOnly:a,icon:o,iconPosition:s})=>r("bg-gray-50 rounded-lg block w-full","border focus:outline-none focus:ring-0","dark:bg-gray-700 dark:placeholder-gray-400",l(e),o&&s==="left"?"pl-9":"",o&&s==="right"?"pr-9":"",n?"opacity-50 cursor-not-allowed":"",a?"bg-gray-100 dark:bg-gray-600 cursor-default":"",t?"border-red-500 dark:border-red-500":"border-gray-300 dark:border-gray-600"),i=(e,t)=>r("text-sm font-medium",e?"min-w-[120px]":"block mb-2",!t&&"text-gray-900 dark:text-white"),p=e=>r("mt-1 text-xs",e?"text-red-500 dark:text-red-400":"text-gray-500 dark:text-gray-400"),b=e=>r("absolute inset-y-0 flex items-center pointer-events-none",e==="left"?"left-2.5":"right-2.5");export{d as getBaseInputClasses,p as getHelperTextClasses,b as getIconClasses,i as getLabelClasses};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var u=(t,n,a,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of o(n))!s.call(t,e)&&e!==a&&r(t,e,{get:()=>n[e],enumerable:!(i=g(n,e))||i.enumerable});return t};var d=t=>u(r({},"__esModule",{value:!0}),t);var x={};module.exports=d(x);
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var Q=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var de=Object.prototype.hasOwnProperty;var fe=(o,n)=>{for(var t in n)Q(o,t,{get:n[t],enumerable:!0})},he=(o,n,t,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let b of ce(n))!de.call(o,b)&&b!==t&&Q(o,b,{get:()=>n[b],enumerable:!(p=me(n,b))||p.enumerable});return o};var pe=o=>he(Q({},"__esModule",{value:!0}),o);var ke={};fe(ke,{FunnelChart:()=>Ce});module.exports=pe(ke);var m=require("react"),ee=require("../../lib/i18n.cjs"),te=require("../chart/ChartAxis.cjs"),ne=require("../chart/ChartContainer.cjs"),re=require("../chart/ChartTooltip.cjs"),A=require("../chart/palette.cjs"),P=require("../chart/utils/data.cjs"),y=require("../chart/utils/format.cjs"),ae=require("../chart/utils/path.cjs"),F=require("../chart/utils/scales.cjs"),K=require("../chart/utils/text.cjs"),le=require("../chart/utils/touch.cjs"),oe=require("../table/Table.cjs"),ie=require("../table/TableBody.cjs"),B=require("../table/TableCell.cjs"),se=require("../table/TableHeader.cjs"),X=require("../table/TableHeaderCell.cjs"),ue=require("../table/TableRow.cjs"),e=require("react/jsx-runtime"),be=8,ge=12,ve=44,Z="text-right [font-variant-numeric:tabular-nums]",ye=(0,m.memo)(function({stages:n}){return(0,e.jsx)("g",{children:n.map(t=>(0,e.jsxs)("g",{children:[(0,e.jsx)("path",{d:t.d,fill:t.color}),t.value?(0,e.jsx)("text",{x:t.value.x,y:t.value.y,textAnchor:t.value.anchor,dominantBaseline:"middle",className:t.value.inside?t.value.onDark?"fill-gray-50 text-[11px] font-semibold [font-variant-numeric:tabular-nums] dark:fill-gray-900":"fill-gray-900 text-[11px] font-semibold [font-variant-numeric:tabular-nums] dark:fill-gray-50":"fill-gray-700 text-[11px] font-semibold [font-variant-numeric:tabular-nums] dark:fill-gray-200",children:t.value.text}):null,t.conversion?(0,e.jsx)("text",{x:t.conversion.x,y:t.conversion.y,textAnchor:"middle",dominantBaseline:"middle",className:"fill-gray-500 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-400",children:t.conversion.text}):null]},t.key))})});function xe({width:o,height:n,stages:t,x:p,size:b,align:E,showConversion:H,showValues:V,stageSize:W,ramp:M,tooltip:x,plotLabel:U,locale:T,onStageClick:N}){let[O,D]=(0,m.useState)(null),i=O!==null&&O<t.length?O:null,$=(0,ee.useUILabels)(),r=(0,m.useMemo)(()=>{let s=t.map(a=>a.label),c={top:6,right:12,bottom:6,left:p.hidden?8:p.height??(0,K.widestLabel)(s)+ge},d=Math.max(0,o-c.left-c.right),k=Math.max(0,n-c.top-c.bottom),f=(0,F.createBandScale)(t.map((a,u)=>u),[0,k],{paddingInner:H?.45:.28}),R=Math.min(W??ve,f.bandwidth),j=Math.max(0,...t.map(a=>a.value??0)),_=(0,F.createLinearScale)([0,j],[0,d]),I=t.map((a,u)=>{let S=a.value===null?0:Math.max(0,_(a.value)),l=E==="center"?(d-S)/2:0,w=f(u)+(f.bandwidth-R)/2,v=w+R/2,z=null;if(V&&a.value!==null){let J=a.formattedValue;z=(0,K.estimateTextWidth)(J,11)+16<=S?{x:l+S/2,y:v,anchor:"middle",text:J,inside:!0,onDark:M.onDark(u)}:{x:l+S+be,y:v,anchor:"start",text:J,inside:!1,onDark:!1}}let h=f(u-1)+(f.bandwidth-R)/2+R,L=H&&a.conversion!==null&&u>0?{x:d/2,y:(h+w)/2,text:(0,y.formatPercent)(a.conversion,{locale:T,maximumFractionDigits:0})}:null;return{key:`${u}`,d:(0,ae.buildBarPath)({x:l,y:w,width:S,height:R,radius:4,round:E==="center"?"none":"right"}),color:M(u),value:z,conversion:L,top:f(u),height:f.bandwidth}}),G=p.hidden?[]:t.map((a,u)=>({value:a.x,offset:f.center(u),label:a.label}));return{margin:c,innerWidth:d,innerHeight:k,rendered:I,stageTicks:G,centers:t.map((a,u)=>f.center(u))}},[t,p,o,n,E,H,V,W,M,T]),q=(0,m.useCallback)(s=>{if(x===!1||t.length===0)return;let c=s.currentTarget.getBoundingClientRect(),d=s.clientY-c.top-r.margin.top;D((0,F.nearestIndex)(r.centers,d))},[x,t.length,r.margin.top,r.centers]),Y=(0,m.useCallback)(s=>{if(t.length===0)return;let c=t.length-1,d=i??0,k=s.key==="ArrowDown"?Math.min(c,d+1):s.key==="ArrowUp"?Math.max(0,d-1):s.key==="Home"?0:s.key==="End"?c:s.key==="Escape"?null:void 0;k!==void 0&&(s.preventDefault(),D(k))},[t.length,i]),C=(0,m.useCallback)(()=>{!N||i===null||N(t[i])},[N,i,t]),g=i===null?null:t[i];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("svg",{width:o,height:n,role:"img","aria-label":U??t.map(s=>s.label).join(", "),tabIndex:0,className:`${le.CHART_TOUCH} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:q,onPointerLeave:()=>D(null),onKeyDown:Y,onBlur:()=>D(null),onClick:C,children:[(0,e.jsxs)("g",{transform:`translate(${r.margin.left}, ${r.margin.top})`,children:[i!==null&&r.rendered[i]?(0,e.jsx)("rect",{x:-4,y:r.rendered[i].top,width:r.innerWidth+8,height:r.rendered[i].height,rx:4,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,(0,e.jsx)(ye,{stages:r.rendered})]}),(0,e.jsx)("g",{transform:`translate(${r.margin.left}, ${r.margin.top})`,children:p.hidden?null:(0,e.jsx)(te.ChartAxis,{orientation:"left",ticks:r.stageTicks,length:r.innerHeight,showLine:!1,tickSize:0,size:b})})]}),g&&i!==null&&x!==!1?(0,e.jsx)(re.ChartTooltip,{x:r.margin.left+r.innerWidth/2,y:r.margin.top+r.centers[i],containerWidth:o,children:typeof x=="function"?x(g):(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:g.label}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:r.rendered[i]?.color},"aria-hidden":"true"}),(0,e.jsx)("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:g.formattedValue})]}),g.conversion!==null?(0,e.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,e.jsx)("span",{children:$.chartConversion}),(0,e.jsx)("span",{className:"[font-variant-numeric:tabular-nums]",children:(0,y.formatPercent)(g.conversion,{locale:T,maximumFractionDigits:1})})]}):null,g.overall!==null?(0,e.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,e.jsx)("span",{children:t[0]?.label}),(0,e.jsx)("span",{className:"[font-variant-numeric:tabular-nums]",children:(0,y.formatPercent)(g.overall,{locale:T,maximumFractionDigits:1})})]}):null]})}):null]})}function Ce({data:o,x:n,value:t,align:p="center",showConversion:b=!0,showValues:E=!0,stageSize:H,colors:V,height:W,width:M,size:x="md",tooltip:U=!0,tableView:T=!1,title:N,description:O,loading:D=!1,emptyState:i,error:$=!1,errorState:r,onRetry:q,actions:Y,locale:C,plotLabel:g,valueLabel:s,conversionLabel:c,dropOffLabel:d,format:k,onStageClick:f,className:R,...j}){let _=(0,ee.useUILabels)(),I=(0,m.useMemo)(()=>k??(l=>(0,y.formatAuto)(l,C)),[k,C]),G=(0,m.useMemo)(()=>n.format??(l=>(0,y.formatXValue)(l,C)),[n.format,C]),a=(0,m.useMemo)(()=>{let l=(0,P.readNumber)(o[0]??{},t);return o.map((w,v)=>{let z=(0,P.readXValue)(w,n.key,v),h=(0,P.readNumber)(w,t),L=v===0?null:(0,P.readNumber)(o[v-1],t);return{index:v,x:z,label:G(z,v),value:h,overall:v===0||l===null||l===0||h===null?null:h/l,conversion:L===null||L===0||h===null?null:h/L,dropOff:L===null||h===null?null:L-h,formattedValue:h===null?"\u2014":I(h),datum:w}})},[o,n.key,t,I,G]),u=(0,m.useMemo)(()=>(0,A.createSequentialScale)([0,Math.max(1,a.length-1)],{colors:V??A.CHART_ORDINAL_COLORS,...V?{}:{darkStops:A.CHART_ORDINAL_DARK_STOPS}}),[a.length,V]),S=W??Math.max(96,a.length*(b?56:44)+12);return(0,e.jsx)(ne.ChartContainer,{title:N,description:O,height:S,width:M,size:x,loading:D,empty:a.length===0,emptyState:i,error:$,errorState:r,onRetry:q,actions:Y,tableView:T,table:T?(0,e.jsx)("div",{className:"w-full overflow-x-auto",children:(0,e.jsxs)(oe.Table,{children:[typeof N=="string"?(0,e.jsx)("caption",{className:"sr-only",children:N}):null,(0,e.jsxs)(se.TableHeader,{children:[(0,e.jsx)(X.TableHeaderCell,{children:n.label??n.key}),(0,e.jsx)(X.TableHeaderCell,{className:"text-right",children:s??_.chartValue}),(0,e.jsx)(X.TableHeaderCell,{className:"text-right",children:c??_.chartConversion}),(0,e.jsx)(X.TableHeaderCell,{className:"text-right",children:d??_.chartDropOff})]}),(0,e.jsx)(ie.TableBody,{children:a.map(l=>(0,e.jsxs)(ue.TableRow,{clickable:!1,children:[(0,e.jsx)(B.TableCell,{className:"font-medium text-gray-900 dark:text-gray-100",children:l.label}),(0,e.jsx)(B.TableCell,{className:Z,children:l.formattedValue}),(0,e.jsx)(B.TableCell,{className:Z,children:l.conversion===null?"\u2014":(0,y.formatPercent)(l.conversion,{locale:C,maximumFractionDigits:1})}),(0,e.jsx)(B.TableCell,{className:Z,children:l.dropOff===null?"\u2014":I(l.dropOff)})]},l.index))})]})}):void 0,className:R,...j,children:({width:l})=>(0,e.jsx)(xe,{width:l,height:S,stages:a,x:n,size:x,align:p,showConversion:b,showValues:E,stageSize:H,ramp:u,tooltip:U,plotLabel:g,locale:C,onStageClick:f})})}0&&(module.exports={FunnelChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as Z,useCallback as Y,useMemo as M,useState as ee}from"react";import{useUILabels as Q}from"../../lib/i18n.js";import{ChartAxis as te}from"../chart/ChartAxis.js";import{ChartContainer as ne}from"../chart/ChartContainer.js";import{ChartTooltip as re}from"../chart/ChartTooltip.js";import{CHART_ORDINAL_COLORS as ae,CHART_ORDINAL_DARK_STOPS as le,createSequentialScale as oe}from"../chart/palette.js";import{readNumber as j,readXValue as ie}from"../chart/utils/data.js";import{formatAuto as se,formatPercent as X,formatXValue as ue}from"../chart/utils/format.js";import{buildBarPath as me}from"../chart/utils/path.js";import{createBandScale as ce,createLinearScale as de,nearestIndex as fe}from"../chart/utils/scales.js";import{estimateTextWidth as he,widestLabel as pe}from"../chart/utils/text.js";import{CHART_TOUCH as be}from"../chart/utils/touch.js";import{Table as ge}from"../table/Table.js";import{TableBody as ve}from"../table/TableBody.js";import{TableCell as z}from"../table/TableCell.js";import{TableHeader as ye}from"../table/TableHeader.js";import{TableHeaderCell as B}from"../table/TableHeaderCell.js";import{TableRow as xe}from"../table/TableRow.js";import{Fragment as Re,jsx as t,jsxs as f}from"react/jsx-runtime";var Ce=8,ke=12,Se=44,J="text-right [font-variant-numeric:tabular-nums]",Te=Z(function({stages:s}){return t("g",{children:s.map(e=>f("g",{children:[t("path",{d:e.d,fill:e.color}),e.value?t("text",{x:e.value.x,y:e.value.y,textAnchor:e.value.anchor,dominantBaseline:"middle",className:e.value.inside?e.value.onDark?"fill-gray-50 text-[11px] font-semibold [font-variant-numeric:tabular-nums] dark:fill-gray-900":"fill-gray-900 text-[11px] font-semibold [font-variant-numeric:tabular-nums] dark:fill-gray-50":"fill-gray-700 text-[11px] font-semibold [font-variant-numeric:tabular-nums] dark:fill-gray-200",children:e.value.text}):null,e.conversion?t("text",{x:e.conversion.x,y:e.conversion.y,textAnchor:"middle",dominantBaseline:"middle",className:"fill-gray-500 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-400",children:e.conversion.text}):null]},e.key))})});function Ne({width:h,height:s,stages:e,x:C,size:O,align:V,showConversion:D,showValues:w,stageSize:_,ramp:P,tooltip:g,plotLabel:W,locale:k,onStageClick:S}){let[A,L]=ee(null),l=A!==null&&A<e.length?A:null,G=Q(),n=M(()=>{let o=e.map(r=>r.label),u={top:6,right:12,bottom:6,left:C.hidden?8:C.height??pe(o)+ke},m=Math.max(0,h-u.left-u.right),y=Math.max(0,s-u.top-u.bottom),c=ce(e.map((r,i)=>i),[0,y],{paddingInner:D?.45:.28}),T=Math.min(_??Se,c.bandwidth),$=Math.max(0,...e.map(r=>r.value??0)),F=de([0,$],[0,m]),E=e.map((r,i)=>{let x=r.value===null?0:Math.max(0,F(r.value)),a=V==="center"?(m-x)/2:0,N=c(i)+(c.bandwidth-T)/2,b=N+T/2,H=null;if(w&&r.value!==null){let q=r.formattedValue;H=he(q,11)+16<=x?{x:a+x/2,y:b,anchor:"middle",text:q,inside:!0,onDark:P.onDark(i)}:{x:a+x+Ce,y:b,anchor:"start",text:q,inside:!1,onDark:!1}}let d=c(i-1)+(c.bandwidth-T)/2+T,R=D&&r.conversion!==null&&i>0?{x:m/2,y:(d+N)/2,text:X(r.conversion,{locale:k,maximumFractionDigits:0})}:null;return{key:`${i}`,d:me({x:a,y:N,width:x,height:T,radius:4,round:V==="center"?"none":"right"}),color:P(i),value:H,conversion:R,top:c(i),height:c.bandwidth}}),I=C.hidden?[]:e.map((r,i)=>({value:r.x,offset:c.center(i),label:r.label}));return{margin:u,innerWidth:m,innerHeight:y,rendered:E,stageTicks:I,centers:e.map((r,i)=>c.center(i))}},[e,C,h,s,V,D,w,_,P,k]),K=Y(o=>{if(g===!1||e.length===0)return;let u=o.currentTarget.getBoundingClientRect(),m=o.clientY-u.top-n.margin.top;L(fe(n.centers,m))},[g,e.length,n.margin.top,n.centers]),U=Y(o=>{if(e.length===0)return;let u=e.length-1,m=l??0,y=o.key==="ArrowDown"?Math.min(u,m+1):o.key==="ArrowUp"?Math.max(0,m-1):o.key==="Home"?0:o.key==="End"?u:o.key==="Escape"?null:void 0;y!==void 0&&(o.preventDefault(),L(y))},[e.length,l]),v=Y(()=>{!S||l===null||S(e[l])},[S,l,e]),p=l===null?null:e[l];return f(Re,{children:[f("svg",{width:h,height:s,role:"img","aria-label":W??e.map(o=>o.label).join(", "),tabIndex:0,className:`${be} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:K,onPointerLeave:()=>L(null),onKeyDown:U,onBlur:()=>L(null),onClick:v,children:[f("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[l!==null&&n.rendered[l]?t("rect",{x:-4,y:n.rendered[l].top,width:n.innerWidth+8,height:n.rendered[l].height,rx:4,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,t(Te,{stages:n.rendered})]}),t("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:C.hidden?null:t(te,{orientation:"left",ticks:n.stageTicks,length:n.innerHeight,showLine:!1,tickSize:0,size:O})})]}),p&&l!==null&&g!==!1?t(re,{x:n.margin.left+n.innerWidth/2,y:n.margin.top+n.centers[l],containerWidth:h,children:typeof g=="function"?g(p):f("div",{className:"flex flex-col gap-1",children:[t("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:p.label}),f("div",{className:"flex items-center gap-2",children:[t("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:n.rendered[l]?.color},"aria-hidden":"true"}),t("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:p.formattedValue})]}),p.conversion!==null?f("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[t("span",{children:G.chartConversion}),t("span",{className:"[font-variant-numeric:tabular-nums]",children:X(p.conversion,{locale:k,maximumFractionDigits:1})})]}):null,p.overall!==null?f("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[t("span",{children:e[0]?.label}),t("span",{className:"[font-variant-numeric:tabular-nums]",children:X(p.overall,{locale:k,maximumFractionDigits:1})})]}):null]})}):null]})}function $e({data:h,x:s,value:e,align:C="center",showConversion:O=!0,showValues:V=!0,stageSize:D,colors:w,height:_,width:P,size:g="md",tooltip:W=!0,tableView:k=!1,title:S,description:A,loading:L=!1,emptyState:l,error:G=!1,errorState:n,onRetry:K,actions:U,locale:v,plotLabel:p,valueLabel:o,conversionLabel:u,dropOffLabel:m,format:y,onStageClick:c,className:T,...$}){let F=Q(),E=M(()=>y??(a=>se(a,v)),[y,v]),I=M(()=>s.format??(a=>ue(a,v)),[s.format,v]),r=M(()=>{let a=j(h[0]??{},e);return h.map((N,b)=>{let H=ie(N,s.key,b),d=j(N,e),R=b===0?null:j(h[b-1],e);return{index:b,x:H,label:I(H,b),value:d,overall:b===0||a===null||a===0||d===null?null:d/a,conversion:R===null||R===0||d===null?null:d/R,dropOff:R===null||d===null?null:R-d,formattedValue:d===null?"\u2014":E(d),datum:N}})},[h,s.key,e,E,I]),i=M(()=>oe([0,Math.max(1,r.length-1)],{colors:w??ae,...w?{}:{darkStops:le}}),[r.length,w]),x=_??Math.max(96,r.length*(O?56:44)+12);return t(ne,{title:S,description:A,height:x,width:P,size:g,loading:L,empty:r.length===0,emptyState:l,error:G,errorState:n,onRetry:K,actions:U,tableView:k,table:k?t("div",{className:"w-full overflow-x-auto",children:f(ge,{children:[typeof S=="string"?t("caption",{className:"sr-only",children:S}):null,f(ye,{children:[t(B,{children:s.label??s.key}),t(B,{className:"text-right",children:o??F.chartValue}),t(B,{className:"text-right",children:u??F.chartConversion}),t(B,{className:"text-right",children:m??F.chartDropOff})]}),t(ve,{children:r.map(a=>f(xe,{clickable:!1,children:[t(z,{className:"font-medium text-gray-900 dark:text-gray-100",children:a.label}),t(z,{className:J,children:a.formattedValue}),t(z,{className:J,children:a.conversion===null?"\u2014":X(a.conversion,{locale:v,maximumFractionDigits:1})}),t(z,{className:J,children:a.dropOff===null?"\u2014":E(a.dropOff)})]},a.index))})]})}):void 0,className:T,...$,children:({width:a})=>t(Ne,{width:a,height:x,stages:r,x:s,size:g,align:C,showConversion:O,showValues:V,stageSize:D,ramp:i,tooltip:W,plotLabel:p,locale:v,onStageClick:c})})}export{$e as FunnelChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var h=(n,e)=>{for(var t in e)o(n,t,{get:e[t],enumerable:!0})},C=(n,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!F.call(n,r)&&r!==t&&o(n,r,{get:()=>e[r],enumerable:!(a=p(e,r))||a.enumerable});return n};var f=n=>C(o({},"__esModule",{value:!0}),n);var m={};h(m,{FunnelChart:()=>l.FunnelChart});module.exports=f(m);var l=require("./FunnelChart.cjs");0&&(module.exports={FunnelChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FunnelChart as r}from"./FunnelChart.js";export{r as FunnelChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var gt=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var Ht=Object.prototype.hasOwnProperty;var Wt=(c,o)=>{for(var C in o)gt(c,C,{get:o[C],enumerable:!0})},Xt=(c,o,C,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let h of It(o))!Ht.call(c,h)&&h!==C&>(c,h,{get:()=>o[h],enumerable:!(r=Et(o,h))||r.enumerable});return c};var Vt=c=>Xt(gt({},"__esModule",{value:!0}),c);var Yt={};Wt(Yt,{GanttChart:()=>Ut});module.exports=Vt(Yt);var i=require("react"),ft=require("../../lib/i18n.cjs"),ht=require("../chart/ChartAxis.cjs"),vt=require("../chart/ChartContainer.cjs"),wt=require("../chart/ChartGrid.cjs"),Nt=require("../chart/ChartLegend.cjs"),St=require("../chart/ChartTooltip.cjs"),et=require("../chart/palette.cjs"),$t=require("../chart/utils/cartesian.cjs"),rt=require("../chart/utils/data.cjs"),F=require("../chart/utils/format.cjs"),pt=require("../chart/utils/path.cjs"),Lt=require("../chart/utils/scales.cjs"),x=require("../chart/utils/time.cjs"),Pt=require("../chart/utils/touch.cjs"),Rt=require("../table/Table.cjs"),Mt=require("../table/TableBody.cjs"),U=require("../table/TableCell.cjs"),Gt=require("../table/TableHeader.cjs"),Y=require("../table/TableHeaderCell.cjs"),Dt=require("../table/TableRow.cjs"),t=require("react/jsx-runtime"),zt=18,Tt=.5,_t=.3,tt=7,kt=10,xt=.02,dt="text-right [font-variant-numeric:tabular-nums]",Bt=(0,i.memo)(function({tasks:o,arrows:C}){return(0,t.jsxs)("g",{children:[(0,t.jsx)("g",{className:"fill-gray-400 stroke-gray-400 dark:fill-gray-500 dark:stroke-gray-500",children:C.map(r=>(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{d:r.d,fill:"none",strokeWidth:1}),(0,t.jsx)("path",{d:r.head,strokeWidth:0})]},r.key))}),o.map(r=>(0,t.jsxs)("g",{children:[r.track?(0,t.jsx)("path",{d:r.track,fill:r.color,fillOpacity:r.trackOpacity}):null,r.progress?(0,t.jsx)("path",{d:r.progress,fill:r.color}):null,r.milestone?(0,t.jsx)("path",{d:r.milestone,fill:r.color,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"}):null]},r.key))]})});function Kt({width:c,height:o,data:C,tasks:r,x:h,domain:w,unit:R,timeTicks:O,today:S,grid:E,size:I,barSize:X,colorOf:Z,margin:j,tooltip:$,plotLabel:nt,todayLabel:at,locale:L,formatDate:q,formatX:M,onTaskClick:V}){let[H,P]=(0,i.useState)(null),y=H!==null&&H<r.length?H:null,z=(0,ft.useUILabels)(),n=(0,i.useMemo)(()=>{let l=(0,$t.buildCartesianGeometry)({width:c,height:o,data:C,x:h,y:{domain:w},bounds:w,margin:j,orientation:"horizontal",placement:"band",formatValue:a=>(0,x.formatTimeTick)(a,R,L),formatX:M}),{valueScale:s,bandwidth:g,categoryPositions:T,innerWidth:st,innerHeight:ct}=l,G=Math.min(X??zt,g),J=new Map(r.map((a,m)=>[a.id,m])),mt=r.map((a,m)=>{let f=T[m]+(g-G)/2,u=f+G/2,N=Z(a);if(a.start===null)return{key:`${m}`,color:N,track:null,trackOpacity:1,progress:null,milestone:null,top:T[m],height:g};let d=s(a.start);if(a.milestone)return{key:`${m}`,color:N,track:null,trackOpacity:1,progress:null,milestone:`M${d},${u-tt} L${d+tt},${u} L${d},${u+tt} L${d-tt},${u} Z`,top:T[m],height:g};let D=s(a.end??a.start),k=Math.max(2,D-d);return{key:`${m}`,color:N,track:(0,pt.buildBarPath)({x:d,y:f,width:k,height:G,radius:3}),trackOpacity:a.progress===null?1:_t,progress:a.progress===null?null:(0,pt.buildBarPath)({x:d,y:u-G*Tt/2,width:Math.max(0,k*Math.min(1,Math.max(0,a.progress))),height:G*Tt,radius:2,round:"right"}),milestone:null,top:T[m],height:g}}),Q=[];r.forEach((a,m)=>{if(a.start!==null)for(let f of a.dependsOn){let u=J.get(f);if(u===void 0||u===m)continue;let N=r[u];if(N.start===null)continue;let d=s(N.end??N.start),D=T[u]+g/2,k=s(a.start),A=T[m]+g/2,_=Math.max(d+kt,k-kt);Q.push({key:`${f}-${a.id}`,d:`M${d},${D} L${_},${D} L${_},${A} L${k-5},${A}`,head:`M${k},${A} L${k-5},${A-3.5} L${k-5},${A+3.5} Z`})}});let ut=O.map(a=>({value:a,offset:s(a),label:(0,x.formatTimeTick)(a,R,L)}));return{rendered:mt,arrows:Q,categoryPositions:T,categoryCenters:l.categoryCenters,bandwidth:g,categoryTicks:l.categoryTicks,valueTicks:ut,valueScale:s,innerWidth:st,innerHeight:ct,margin:l.margin}},[r,C,h,w,R,O,c,o,j,X,Z,L,M]),ot=(0,i.useCallback)(l=>{if($===!1||r.length===0)return;let s=l.currentTarget.getBoundingClientRect(),g=l.clientY-s.top-n.margin.top;P((0,Lt.nearestIndex)(n.categoryCenters,g))},[$,r.length,n.margin.top,n.categoryCenters]),lt=(0,i.useCallback)(l=>{if(r.length===0)return;let s=r.length-1,g=y??0,T=l.key==="ArrowDown"?Math.min(s,g+1):l.key==="ArrowUp"?Math.max(0,g-1):l.key==="Home"?0:l.key==="End"?s:l.key==="Escape"?null:void 0;T!==void 0&&(l.preventDefault(),P(T))},[r.length,y]),it=(0,i.useCallback)(()=>{!V||y===null||V(r[y])},[V,y,r]),p=y===null?null:r[y];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:c,height:o,role:"img","aria-label":nt??r.map(l=>l.label).join(", "),tabIndex:0,className:`${Pt.CHART_TOUCH} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:ot,onPointerLeave:()=>P(null),onKeyDown:lt,onBlur:()=>P(null),onClick:it,children:[(0,t.jsxs)("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[(0,t.jsx)(wt.ChartGrid,{width:n.innerWidth,height:n.innerHeight,vertical:E?n.valueTicks.map(l=>l.offset):void 0}),y!==null?(0,t.jsx)("rect",{x:0,y:n.categoryPositions[y],width:n.innerWidth,height:n.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,(0,t.jsx)(Bt,{tasks:n.rendered,arrows:n.arrows}),S!==null?(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:n.valueScale(S),y1:0,x2:n.valueScale(S),y2:n.innerHeight,className:"stroke-gray-900 dark:stroke-white",strokeWidth:1,strokeDasharray:"4 4"}),(0,t.jsx)("text",{x:n.valueScale(S)+4,y:8,className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:at})]}):null]}),(0,t.jsx)("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:(0,t.jsx)(ht.ChartAxis,{orientation:"bottom",ticks:n.valueTicks,length:n.innerWidth,size:I})}),(0,t.jsx)("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:h.hidden?null:(0,t.jsx)(ht.ChartAxis,{orientation:"left",ticks:n.categoryTicks,length:n.innerHeight,showLine:!1,tickSize:0,label:h.label,size:I})})]}),p&&y!==null&&$!==!1?(0,t.jsx)(St.ChartTooltip,{x:n.margin.left+(p.start===null?n.innerWidth/2:n.valueScale(p.start)),y:n.margin.top+n.categoryCenters[y],containerWidth:c,children:typeof $=="function"?$(p):(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:p.label}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,t.jsx)("span",{children:z.chartStart}),(0,t.jsx)("span",{className:"[font-variant-numeric:tabular-nums] text-gray-900 dark:text-gray-100",children:p.start===null?"\u2014":q(p.start)})]}),p.milestone?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,t.jsx)("span",{children:z.chartEnd}),(0,t.jsx)("span",{className:"[font-variant-numeric:tabular-nums] text-gray-900 dark:text-gray-100",children:p.end===null?"\u2014":q(p.end)})]}),p.progress===null?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,t.jsx)("span",{children:z.chartProgress}),(0,t.jsx)("span",{className:"[font-variant-numeric:tabular-nums] text-gray-900 dark:text-gray-100",children:(0,F.formatPercent)(p.progress,{locale:L,maximumFractionDigits:0})})]})]})}):null]})}function Ut({data:c,x:o,start:C,end:r,id:h,progress:w,milestone:R,dependencies:O,group:S,domain:E,today:I,ticks:X=6,barSize:Z,rowSize:j=30,color:$,height:nt,width:at,size:L="md",grid:q=!0,legend:M,tooltip:V=!0,tableView:H=!1,title:P,description:y,loading:z=!1,emptyState:n,error:ot=!1,errorState:lt,onRetry:it,actions:p,margin:l,locale:s,plotLabel:g,startLabel:T,endLabel:st,progressLabel:ct,todayLabel:G,formatDate:J,onTaskClick:mt,className:Q,...ut}){let a=(0,ft.useUILabels)(),m=(0,i.useMemo)(()=>o.format??(e=>(0,F.formatXValue)(e,s)),[o.format,s]),f=(0,i.useMemo)(()=>c.map((e,b)=>{let B=(0,rt.readXValue)(e,o.key,b),W=(0,x.toTimestamp)(e[C]),v=r?(0,x.toTimestamp)(e[r]):null,K=R?!!e[R]:v===null,Ct=O?e[O]:void 0;return{index:b,id:String(h?e[h]??b:b),x:B,label:m(B,b),start:W,end:K?W:v??W,progress:w?(0,rt.readNumber)(e,w):null,milestone:K,dependsOn:Array.isArray(Ct)?Ct.map(Ot=>String(Ot)):[],group:S?e[S]??null:null,datum:e}}),[c,o.key,C,r,h,w,R,O,S,m]),u=(0,i.useMemo)(()=>{let e=[];for(let b of f)b.group!==null&&!e.includes(b.group)&&e.push(b.group);return e},[f]),N=(0,i.useCallback)(e=>e.group===null?$??(0,et.getSeriesColor)(0):(0,et.getSeriesColor)(u.indexOf(e.group)),[u,$]),d=(0,i.useMemo)(()=>{if(E){let v=(0,x.toTimestamp)(E[0]),K=(0,x.toTimestamp)(E[1]);if(v!==null&&K!==null)return[v,K]}let e=f.flatMap(v=>v.start===null?[]:[v.start,v.end??v.start]);if(e.length===0)return[0,1];let b=Math.min(...e),B=Math.max(...e),W=B-b||864e5;return[b-W*xt,B+W*xt]},[E,f]),D=(0,i.useMemo)(()=>(0,x.niceTimeTicks)(d[0],d[1],X),[d,X]),k=(0,i.useMemo)(()=>J??(e=>new Intl.DateTimeFormat(s,{day:"numeric",month:"short",year:"numeric"}).format(new Date(e))),[J,s]),A=(0,i.useMemo)(()=>I===!1?null:(0,x.toTimestamp)(I??Date.now()),[I]),_=(0,i.useMemo)(()=>u.map((e,b)=>({key:e,label:e,color:(0,et.getSeriesColor)(b),marker:"rect"})),[u]),bt=nt??Math.max(120,f.length*j+48),At=M===void 0?u.length>=2:M!==!1,yt=typeof M=="string"?M:"bottom";return(0,t.jsx)(vt.ChartContainer,{title:P,description:y,height:bt,width:at,size:L,loading:z,empty:f.length===0,emptyState:n,error:ot,errorState:lt,onRetry:it,actions:p,tableView:H,legendPosition:yt,legend:At&&_.length>0?(0,t.jsx)(Nt.ChartLegend,{items:_,position:yt,marker:"rect",size:L}):void 0,table:H?(0,t.jsx)("div",{className:"w-full overflow-x-auto",children:(0,t.jsxs)(Rt.Table,{children:[typeof P=="string"?(0,t.jsx)("caption",{className:"sr-only",children:P}):null,(0,t.jsxs)(Gt.TableHeader,{children:[(0,t.jsx)(Y.TableHeaderCell,{children:o.label??o.key}),(0,t.jsx)(Y.TableHeaderCell,{className:"text-right",children:T??a.chartStart}),(0,t.jsx)(Y.TableHeaderCell,{className:"text-right",children:st??a.chartEnd}),w?(0,t.jsx)(Y.TableHeaderCell,{className:"text-right",children:ct??a.chartProgress}):null]}),(0,t.jsx)(Mt.TableBody,{children:f.map(e=>(0,t.jsxs)(Dt.TableRow,{clickable:!1,children:[(0,t.jsx)(U.TableCell,{className:"font-medium text-gray-900 dark:text-gray-100",children:e.label}),(0,t.jsx)(U.TableCell,{className:dt,children:e.start===null?"\u2014":k(e.start)}),(0,t.jsx)(U.TableCell,{className:dt,children:e.milestone||e.end===null?"\u2014":k(e.end)}),w?(0,t.jsx)(U.TableCell,{className:dt,children:e.progress===null?"\u2014":(0,F.formatPercent)(e.progress,{locale:s,maximumFractionDigits:0})}):null]},e.index))})]})}):void 0,className:Q,...ut,children:({width:e})=>(0,t.jsx)(Kt,{width:e,height:bt,data:c,tasks:f,x:o,domain:d,unit:D.unit,timeTicks:D.values,today:A,grid:q,size:L,barSize:Z,colorOf:N,margin:l,tooltip:V,plotLabel:g,todayLabel:G??a.chartToday,locale:s,formatDate:k,formatX:m,onTaskClick:mt})})}0&&(module.exports={GanttChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as St,useCallback as et,useMemo as v,useState as $t}from"react";import{useUILabels as xt}from"../../lib/i18n.js";import{ChartAxis as ft}from"../chart/ChartAxis.js";import{ChartContainer as Lt}from"../chart/ChartContainer.js";import{ChartGrid as Pt}from"../chart/ChartGrid.js";import{ChartLegend as Rt}from"../chart/ChartLegend.js";import{ChartTooltip as Mt}from"../chart/ChartTooltip.js";import{getSeriesColor as ut}from"../chart/palette.js";import{buildCartesianGeometry as Gt}from"../chart/utils/cartesian.js";import{readNumber as Dt,readXValue as At}from"../chart/utils/data.js";import{formatPercent as vt,formatXValue as Ot}from"../chart/utils/format.js";import{buildBarPath as bt}from"../chart/utils/path.js";import{nearestIndex as Et}from"../chart/utils/scales.js";import{formatTimeTick as yt,niceTimeTicks as It,toTimestamp as U}from"../chart/utils/time.js";import{CHART_TOUCH as Ht}from"../chart/utils/touch.js";import{Table as Wt}from"../table/Table.js";import{TableBody as Xt}from"../table/TableBody.js";import{TableCell as J}from"../table/TableCell.js";import{TableHeader as Vt}from"../table/TableHeader.js";import{TableHeaderCell as Q}from"../table/TableHeaderCell.js";import{TableRow as zt}from"../table/TableRow.js";import{Fragment as Yt,jsx as e,jsxs as h}from"react/jsx-runtime";var _t=18,Ct=.5,Bt=.3,tt=7,Tt=10,kt=.02,gt="text-right [font-variant-numeric:tabular-nums]",Kt=St(function({tasks:p,arrows:P}){return h("g",{children:[e("g",{className:"fill-gray-400 stroke-gray-400 dark:fill-gray-500 dark:stroke-gray-500",children:P.map(r=>h("g",{children:[e("path",{d:r.d,fill:"none",strokeWidth:1}),e("path",{d:r.head,strokeWidth:0})]},r.key))}),p.map(r=>h("g",{children:[r.track?e("path",{d:r.track,fill:r.color,fillOpacity:r.trackOpacity}):null,r.progress?e("path",{d:r.progress,fill:r.color}):null,r.milestone?e("path",{d:r.milestone,fill:r.color,strokeWidth:2,className:"stroke-white dark:stroke-gray-800"}):null]},r.key))]})});function Ut({width:T,height:p,data:P,tasks:r,x:w,domain:k,unit:R,timeTicks:O,today:N,grid:E,size:I,barSize:X,colorOf:Y,margin:F,tooltip:S,plotLabel:rt,todayLabel:nt,locale:$,formatDate:Z,formatX:M,onTaskClick:V}){let[H,L]=$t(null),f=H!==null&&H<r.length?H:null,z=xt(),n=v(()=>{let o=Gt({width:T,height:p,data:P,x:w,y:{domain:k},bounds:k,margin:F,orientation:"horizontal",placement:"band",formatValue:a=>yt(a,R,$),formatX:M}),{valueScale:l,bandwidth:c,categoryPositions:b,innerWidth:it,innerHeight:st}=o,G=Math.min(X??_t,c),j=new Map(r.map((a,i)=>[a.id,i])),ct=r.map((a,i)=>{let g=b[i]+(c-G)/2,s=g+G/2,x=Y(a);if(a.start===null)return{key:`${i}`,color:x,track:null,trackOpacity:1,progress:null,milestone:null,top:b[i],height:c};let m=l(a.start);if(a.milestone)return{key:`${i}`,color:x,track:null,trackOpacity:1,progress:null,milestone:`M${m},${s-tt} L${m+tt},${s} L${m},${s+tt} L${m-tt},${s} Z`,top:b[i],height:c};let D=l(a.end??a.start),y=Math.max(2,D-m);return{key:`${i}`,color:x,track:bt({x:m,y:g,width:y,height:G,radius:3}),trackOpacity:a.progress===null?1:Bt,progress:a.progress===null?null:bt({x:m,y:s-G*Ct/2,width:Math.max(0,y*Math.min(1,Math.max(0,a.progress))),height:G*Ct,radius:2,round:"right"}),milestone:null,top:b[i],height:c}}),q=[];r.forEach((a,i)=>{if(a.start!==null)for(let g of a.dependsOn){let s=j.get(g);if(s===void 0||s===i)continue;let x=r[s];if(x.start===null)continue;let m=l(x.end??x.start),D=b[s]+c/2,y=l(a.start),A=b[i]+c/2,_=Math.max(m+Tt,y-Tt);q.push({key:`${g}-${a.id}`,d:`M${m},${D} L${_},${D} L${_},${A} L${y-5},${A}`,head:`M${y},${A} L${y-5},${A-3.5} L${y-5},${A+3.5} Z`})}});let mt=O.map(a=>({value:a,offset:l(a),label:yt(a,R,$)}));return{rendered:ct,arrows:q,categoryPositions:b,categoryCenters:o.categoryCenters,bandwidth:c,categoryTicks:o.categoryTicks,valueTicks:mt,valueScale:l,innerWidth:it,innerHeight:st,margin:o.margin}},[r,P,w,k,R,O,T,p,F,X,Y,$,M]),at=et(o=>{if(S===!1||r.length===0)return;let l=o.currentTarget.getBoundingClientRect(),c=o.clientY-l.top-n.margin.top;L(Et(n.categoryCenters,c))},[S,r.length,n.margin.top,n.categoryCenters]),ot=et(o=>{if(r.length===0)return;let l=r.length-1,c=f??0,b=o.key==="ArrowDown"?Math.min(l,c+1):o.key==="ArrowUp"?Math.max(0,c-1):o.key==="Home"?0:o.key==="End"?l:o.key==="Escape"?null:void 0;b!==void 0&&(o.preventDefault(),L(b))},[r.length,f]),lt=et(()=>{!V||f===null||V(r[f])},[V,f,r]),u=f===null?null:r[f];return h(Yt,{children:[h("svg",{width:T,height:p,role:"img","aria-label":rt??r.map(o=>o.label).join(", "),tabIndex:0,className:`${Ht} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:at,onPointerLeave:()=>L(null),onKeyDown:ot,onBlur:()=>L(null),onClick:lt,children:[h("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[e(Pt,{width:n.innerWidth,height:n.innerHeight,vertical:E?n.valueTicks.map(o=>o.offset):void 0}),f!==null?e("rect",{x:0,y:n.categoryPositions[f],width:n.innerWidth,height:n.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,e(Kt,{tasks:n.rendered,arrows:n.arrows}),N!==null?h("g",{children:[e("line",{x1:n.valueScale(N),y1:0,x2:n.valueScale(N),y2:n.innerHeight,className:"stroke-gray-900 dark:stroke-white",strokeWidth:1,strokeDasharray:"4 4"}),e("text",{x:n.valueScale(N)+4,y:8,className:"fill-gray-500 text-[10px] dark:fill-gray-400",children:nt})]}):null]}),e("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:e(ft,{orientation:"bottom",ticks:n.valueTicks,length:n.innerWidth,size:I})}),e("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:w.hidden?null:e(ft,{orientation:"left",ticks:n.categoryTicks,length:n.innerHeight,showLine:!1,tickSize:0,label:w.label,size:I})})]}),u&&f!==null&&S!==!1?e(Mt,{x:n.margin.left+(u.start===null?n.innerWidth/2:n.valueScale(u.start)),y:n.margin.top+n.categoryCenters[f],containerWidth:T,children:typeof S=="function"?S(u):h("div",{className:"flex flex-col gap-1",children:[e("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:u.label}),h("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e("span",{children:z.chartStart}),e("span",{className:"[font-variant-numeric:tabular-nums] text-gray-900 dark:text-gray-100",children:u.start===null?"\u2014":Z(u.start)})]}),u.milestone?null:h("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e("span",{children:z.chartEnd}),e("span",{className:"[font-variant-numeric:tabular-nums] text-gray-900 dark:text-gray-100",children:u.end===null?"\u2014":Z(u.end)})]}),u.progress===null?null:h("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e("span",{children:z.chartProgress}),e("span",{className:"[font-variant-numeric:tabular-nums] text-gray-900 dark:text-gray-100",children:vt(u.progress,{locale:$,maximumFractionDigits:0})})]})]})}):null]})}function pe({data:T,x:p,start:P,end:r,id:w,progress:k,milestone:R,dependencies:O,group:N,domain:E,today:I,ticks:X=6,barSize:Y,rowSize:F=30,color:S,height:rt,width:nt,size:$="md",grid:Z=!0,legend:M,tooltip:V=!0,tableView:H=!1,title:L,description:f,loading:z=!1,emptyState:n,error:at=!1,errorState:ot,onRetry:lt,actions:u,margin:o,locale:l,plotLabel:c,startLabel:b,endLabel:it,progressLabel:st,todayLabel:G,formatDate:j,onTaskClick:ct,className:q,...mt}){let a=xt(),i=v(()=>p.format??(t=>Ot(t,l)),[p.format,l]),g=v(()=>T.map((t,d)=>{let B=At(t,p.key,d),W=U(t[P]),C=r?U(t[r]):null,K=R?!!t[R]:C===null,pt=O?t[O]:void 0;return{index:d,id:String(w?t[w]??d:d),x:B,label:i(B,d),start:W,end:K?W:C??W,progress:k?Dt(t,k):null,milestone:K,dependsOn:Array.isArray(pt)?pt.map(Nt=>String(Nt)):[],group:N?t[N]??null:null,datum:t}}),[T,p.key,P,r,w,k,R,O,N,i]),s=v(()=>{let t=[];for(let d of g)d.group!==null&&!t.includes(d.group)&&t.push(d.group);return t},[g]),x=et(t=>t.group===null?S??ut(0):ut(s.indexOf(t.group)),[s,S]),m=v(()=>{if(E){let C=U(E[0]),K=U(E[1]);if(C!==null&&K!==null)return[C,K]}let t=g.flatMap(C=>C.start===null?[]:[C.start,C.end??C.start]);if(t.length===0)return[0,1];let d=Math.min(...t),B=Math.max(...t),W=B-d||864e5;return[d-W*kt,B+W*kt]},[E,g]),D=v(()=>It(m[0],m[1],X),[m,X]),y=v(()=>j??(t=>new Intl.DateTimeFormat(l,{day:"numeric",month:"short",year:"numeric"}).format(new Date(t))),[j,l]),A=v(()=>I===!1?null:U(I??Date.now()),[I]),_=v(()=>s.map((t,d)=>({key:t,label:t,color:ut(d),marker:"rect"})),[s]),dt=rt??Math.max(120,g.length*F+48),wt=M===void 0?s.length>=2:M!==!1,ht=typeof M=="string"?M:"bottom";return e(Lt,{title:L,description:f,height:dt,width:nt,size:$,loading:z,empty:g.length===0,emptyState:n,error:at,errorState:ot,onRetry:lt,actions:u,tableView:H,legendPosition:ht,legend:wt&&_.length>0?e(Rt,{items:_,position:ht,marker:"rect",size:$}):void 0,table:H?e("div",{className:"w-full overflow-x-auto",children:h(Wt,{children:[typeof L=="string"?e("caption",{className:"sr-only",children:L}):null,h(Vt,{children:[e(Q,{children:p.label??p.key}),e(Q,{className:"text-right",children:b??a.chartStart}),e(Q,{className:"text-right",children:it??a.chartEnd}),k?e(Q,{className:"text-right",children:st??a.chartProgress}):null]}),e(Xt,{children:g.map(t=>h(zt,{clickable:!1,children:[e(J,{className:"font-medium text-gray-900 dark:text-gray-100",children:t.label}),e(J,{className:gt,children:t.start===null?"\u2014":y(t.start)}),e(J,{className:gt,children:t.milestone||t.end===null?"\u2014":y(t.end)}),k?e(J,{className:gt,children:t.progress===null?"\u2014":vt(t.progress,{locale:l,maximumFractionDigits:0})}):null]},t.index))})]})}):void 0,className:q,...mt,children:({width:t})=>e(Ut,{width:t,height:dt,data:T,tasks:g,x:p,domain:m,unit:D.unit,timeTicks:D.values,today:A,grid:Z,size:$,barSize:Y,colorOf:x,margin:o,tooltip:V,plotLabel:c,todayLabel:G??a.chartToday,locale:l,formatDate:y,formatX:i,onTaskClick:ct})})}export{pe as GanttChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var e=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var f=(a,t)=>{for(var o in t)n(a,o,{get:t[o],enumerable:!0})},m=(a,t,o,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of h(t))!C.call(a,r)&&r!==o&&n(a,r,{get:()=>t[r],enumerable:!(p=e(t,r))||p.enumerable});return a};var s=a=>m(n({},"__esModule",{value:!0}),a);var x={};f(x,{GanttChart:()=>G.GanttChart});module.exports=s(x);var G=require("./GanttChart.cjs");0&&(module.exports={GanttChart});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{GanttChart as r}from"./GanttChart.js";export{r as GanttChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var y=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var ee=(o,a)=>{for(var i in a)y(o,i,{get:a[i],enumerable:!0})},re=(o,a,i,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of Z(a))!$.call(o,l)&&l!==i&&y(o,l,{get:()=>a[l],enumerable:!(d=Y(a,l))||d.enumerable});return o};var ae=o=>re(y({},"__esModule",{value:!0}),o);var ne={};ee(ne,{Header:()=>te});module.exports=ae(ne);var f=require("react"),s=require("../../lib/cn.cjs"),e=require("react/jsx-runtime");function te({logo:o,logoHref:a="/",onLogoClick:i,navItems:d=[],actions:l,rightContent:p,variant:t="default",size:b="md",backgroundColor:g,textColor:S,hoverColor:B,navItemTextColor:R,navItemHoverColor:j,navItemBgHover:D,navItemActiveColor:O,sticky:T=!1,fixed:W=!1,showSearch:k=!1,onSearch:N,searchPlaceholder:u="Search...",className:z,containerClassName:Q}){let[x,_]=(0,f.useState)(!1),[w,q]=(0,f.useState)(null),[m,C]=(0,f.useState)(""),A=()=>{_(!x)},E=r=>{q(w===r?null:r)},L=r=>{r.preventDefault(),N&&N(m)},F=(0,s.cn)(T&&"sticky top-0 z-50",W&&"fixed top-0 left-0 right-0 z-50"),G=(0,s.cn)(t==="default"&&!g&&"bg-neutral text-white",t==="transparent"&&!g&&"bg-transparent",t==="bordered"&&!g&&"bg-white border-b border-gray-200 text-gray-900 dark:bg-gray-900 dark:border-gray-800 dark:text-gray-100",t==="shadow"&&!g&&"bg-white shadow-md text-gray-900 dark:bg-gray-900 dark:text-gray-100"),J=(0,s.cn)(b==="sm"&&"py-2",b==="md"&&"py-4",b==="lg"&&"py-6"),K=g||"",P=S||"",U=B||"",V=(0,s.cn)(F,G,J,K,P,z),M=(r,c,h=!1)=>{let X=r.children&&r.children.length>0,H=w===c,v=(0,s.cn)("px-4 py-2 transition-colors flex items-center gap-2",h?"block w-full text-left":"inline-flex",r.active&&"font-semibold border-b-2",r.active&&(O||"border-current"),R||(t==="default"||t==="transparent"?"text-gray-300":"text-gray-600 dark:text-gray-300"),j||U||(t==="default"||t==="transparent"?"hover:text-white":"hover:text-blue-600 dark:hover:text-blue-400"),D||"");if(X)return(0,e.jsxs)("div",{className:h?"w-full":"relative",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>E(c),className:v,children:[r.icon&&(0,e.jsx)("span",{className:"w-5 h-5",children:r.icon}),(0,e.jsx)("span",{children:r.label}),r.badge&&(0,e.jsx)("span",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded-full",children:r.badge}),(0,e.jsx)("svg",{className:(0,s.cn)("w-4 h-4 transition-transform",H&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),H&&(0,e.jsx)("div",{className:(0,s.cn)("bg-white shadow-lg rounded-lg overflow-hidden dark:bg-gray-800 dark:shadow-black/40",h?"mt-2 mb-2":"absolute top-full left-0 mt-1 min-w-[200px]"),children:r.children?.map(n=>(0,e.jsx)("a",{href:n.href,onClick:n.onClick,target:n.external?"_blank":void 0,rel:n.external?"noopener noreferrer":void 0,className:"block px-4 py-2 text-gray-700 hover:bg-gray-100 transition-colors dark:text-gray-200 dark:hover:bg-gray-700",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[n.icon&&(0,e.jsx)("span",{className:"w-5 h-5",children:n.icon}),(0,e.jsx)("span",{children:n.label}),n.badge&&(0,e.jsx)("span",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded-full ml-auto",children:n.badge}),n.external&&(0,e.jsx)("svg",{className:"w-4 h-4 ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})},n.href??n.label))})]},r.href??r.label);let I=(0,e.jsxs)(e.Fragment,{children:[r.icon&&(0,e.jsx)("span",{className:"w-5 h-5",children:r.icon}),(0,e.jsx)("span",{children:r.label}),r.badge&&(0,e.jsx)("span",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded-full",children:r.badge}),r.external&&(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]});return r.onClick?(0,e.jsx)("button",{type:"button",onClick:r.onClick,className:v,children:I},r.href??r.label):(0,e.jsx)("a",{href:r.href,target:r.external?"_blank":void 0,rel:r.external?"noopener noreferrer":void 0,className:v,children:I},r.href??r.label)};return(0,e.jsxs)("header",{className:V,children:[(0,e.jsxs)("nav",{className:(0,s.cn)("container mx-auto flex items-center justify-between px-4",Q),children:[o&&(0,e.jsx)("div",{className:"flex items-center",children:a?(0,e.jsx)("a",{href:a,onClick:i,className:"flex items-center hover:opacity-80 transition-opacity",children:o}):(0,e.jsx)("div",{className:"flex items-center",children:o})}),k&&(0,e.jsx)("form",{onSubmit:L,className:"hidden md:flex flex-1 max-w-md mx-8",children:(0,e.jsx)("input",{type:"search","aria-label":u,value:m,onChange:r=>C(r.target.value),placeholder:u,className:"w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-500"})}),(0,e.jsx)("div",{className:"hidden md:flex items-center gap-2",children:d.map((r,c)=>M(r,c,!1))}),(l||p)&&(0,e.jsxs)("div",{className:"hidden md:flex items-center gap-2 ml-4",children:[l,p]}),d.length>0&&(0,e.jsx)("div",{className:"md:hidden",children:(0,e.jsx)("button",{type:"button",className:(0,s.cn)("inline-flex rounded-lg border-2 p-2 w-10 h-10 justify-center transition-colors focus:outline-none",t==="default"||t==="transparent"?"text-gray-300 hover:text-white":"text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-gray-100"),onClick:A,"aria-label":"Toggle menu","aria-expanded":x,children:(0,e.jsx)("svg",{className:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 14",children:(0,e.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M1 1h15M1 7h15M1 13h15"})})})})]}),x&&d.length>0&&(0,e.jsx)("div",{className:(0,s.cn)("md:hidden border-t animate-in slide-in-from-top duration-300",t==="default"||t==="transparent"?"border-gray-700":"border-gray-200 dark:border-gray-800"),children:(0,e.jsxs)("div",{className:"flex flex-col py-2 px-4",children:[k&&(0,e.jsx)("form",{onSubmit:L,className:"mb-4",children:(0,e.jsx)("input",{type:"search","aria-label":u,value:m,onChange:r=>C(r.target.value),placeholder:u,className:"w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-500"})}),d.map((r,c)=>M(r,c,!0)),(l||p)&&(0,e.jsxs)("div",{className:"flex flex-col gap-2 mt-4 pt-4 border-t border-gray-700",children:[l,p]})]})})]})}0&&(module.exports={Header});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useState as h}from"react";import{cn as n}from"../../lib/cn.js";import{Fragment as Y,jsx as r,jsxs as o}from"react/jsx-runtime";function ee({logo:p,logoHref:v="/",onLogoClick:I,navItems:d=[],actions:i,rightContent:c,variant:a="default",size:u="md",backgroundColor:l,textColor:S,hoverColor:B,navItemTextColor:R,navItemHoverColor:j,navItemBgHover:D,navItemActiveColor:O,sticky:T=!1,fixed:W=!1,showSearch:y=!1,onSearch:k,searchPlaceholder:g="Search...",className:z,containerClassName:Q}){let[f,_]=h(!1),[N,q]=h(null),[b,w]=h(""),A=()=>{_(!f)},E=e=>{q(N===e?null:e)},C=e=>{e.preventDefault(),k&&k(b)},F=n(T&&"sticky top-0 z-50",W&&"fixed top-0 left-0 right-0 z-50"),G=n(a==="default"&&!l&&"bg-neutral text-white",a==="transparent"&&!l&&"bg-transparent",a==="bordered"&&!l&&"bg-white border-b border-gray-200 text-gray-900 dark:bg-gray-900 dark:border-gray-800 dark:text-gray-100",a==="shadow"&&!l&&"bg-white shadow-md text-gray-900 dark:bg-gray-900 dark:text-gray-100"),J=n(u==="sm"&&"py-2",u==="md"&&"py-4",u==="lg"&&"py-6"),K=l||"",P=S||"",U=B||"",V=n(F,G,J,K,P,z),L=(e,s,x=!1)=>{let X=e.children&&e.children.length>0,M=N===s,m=n("px-4 py-2 transition-colors flex items-center gap-2",x?"block w-full text-left":"inline-flex",e.active&&"font-semibold border-b-2",e.active&&(O||"border-current"),R||(a==="default"||a==="transparent"?"text-gray-300":"text-gray-600 dark:text-gray-300"),j||U||(a==="default"||a==="transparent"?"hover:text-white":"hover:text-blue-600 dark:hover:text-blue-400"),D||"");if(X)return o("div",{className:x?"w-full":"relative",children:[o("button",{type:"button",onClick:()=>E(s),className:m,children:[e.icon&&r("span",{className:"w-5 h-5",children:e.icon}),r("span",{children:e.label}),e.badge&&r("span",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded-full",children:e.badge}),r("svg",{className:n("w-4 h-4 transition-transform",M&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),M&&r("div",{className:n("bg-white shadow-lg rounded-lg overflow-hidden dark:bg-gray-800 dark:shadow-black/40",x?"mt-2 mb-2":"absolute top-full left-0 mt-1 min-w-[200px]"),children:e.children?.map(t=>r("a",{href:t.href,onClick:t.onClick,target:t.external?"_blank":void 0,rel:t.external?"noopener noreferrer":void 0,className:"block px-4 py-2 text-gray-700 hover:bg-gray-100 transition-colors dark:text-gray-200 dark:hover:bg-gray-700",children:o("div",{className:"flex items-center gap-2",children:[t.icon&&r("span",{className:"w-5 h-5",children:t.icon}),r("span",{children:t.label}),t.badge&&r("span",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded-full ml-auto",children:t.badge}),t.external&&r("svg",{className:"w-4 h-4 ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})},t.href??t.label))})]},e.href??e.label);let H=o(Y,{children:[e.icon&&r("span",{className:"w-5 h-5",children:e.icon}),r("span",{children:e.label}),e.badge&&r("span",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded-full",children:e.badge}),e.external&&r("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]});return e.onClick?r("button",{type:"button",onClick:e.onClick,className:m,children:H},e.href??e.label):r("a",{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,className:m,children:H},e.href??e.label)};return o("header",{className:V,children:[o("nav",{className:n("container mx-auto flex items-center justify-between px-4",Q),children:[p&&r("div",{className:"flex items-center",children:v?r("a",{href:v,onClick:I,className:"flex items-center hover:opacity-80 transition-opacity",children:p}):r("div",{className:"flex items-center",children:p})}),y&&r("form",{onSubmit:C,className:"hidden md:flex flex-1 max-w-md mx-8",children:r("input",{type:"search","aria-label":g,value:b,onChange:e=>w(e.target.value),placeholder:g,className:"w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-500"})}),r("div",{className:"hidden md:flex items-center gap-2",children:d.map((e,s)=>L(e,s,!1))}),(i||c)&&o("div",{className:"hidden md:flex items-center gap-2 ml-4",children:[i,c]}),d.length>0&&r("div",{className:"md:hidden",children:r("button",{type:"button",className:n("inline-flex rounded-lg border-2 p-2 w-10 h-10 justify-center transition-colors focus:outline-none",a==="default"||a==="transparent"?"text-gray-300 hover:text-white":"text-gray-600 hover:text-gray-900 dark:text-gray-300 dark:hover:text-gray-100"),onClick:A,"aria-label":"Toggle menu","aria-expanded":f,children:r("svg",{className:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 14",children:r("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M1 1h15M1 7h15M1 13h15"})})})})]}),f&&d.length>0&&r("div",{className:n("md:hidden border-t animate-in slide-in-from-top duration-300",a==="default"||a==="transparent"?"border-gray-700":"border-gray-200 dark:border-gray-800"),children:o("div",{className:"flex flex-col py-2 px-4",children:[y&&r("form",{onSubmit:C,className:"mb-4",children:r("input",{type:"search","aria-label":g,value:b,onChange:e=>w(e.target.value),placeholder:g,className:"w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-500"})}),d.map((e,s)=>L(e,s,!0)),(i||c)&&o("div",{className:"flex flex-col gap-2 mt-4 pt-4 border-t border-gray-700",children:[i,c]})]})})]})}export{ee as Header};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var x=(r,e)=>{for(var a in e)p(r,a,{get:e[a],enumerable:!0})},s=(r,e,a,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of H(e))!f.call(r,o)&&o!==a&&p(r,o,{get:()=>e[o],enumerable:!(t=m(e,o))||t.enumerable});return r};var v=r=>s(p({},"__esModule",{value:!0}),r);var y={};x(y,{Header:()=>d.Header});module.exports=v(y);var d=require("./Header.cjs");0&&(module.exports={Header});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Header as o}from"./Header.js";export{o as Header};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";"use client";var te=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var ke=Object.prototype.hasOwnProperty;var ye=(s,l)=>{for(var t in l)te(s,t,{get:l[t],enumerable:!0})},we=(s,l,t,e)=>{if(l&&typeof l=="object"||typeof l=="function")for(let f of Ce(l))!ke.call(s,f)&&f!==t&&te(s,f,{get:()=>l[f],enumerable:!(e=pe(l,f))||e.enumerable});return s};var ve=s=>we(te({},"__esModule",{value:!0}),s);var $e={};ye($e,{Heatmap:()=>Re,resetHeatmapWarnings:()=>Xe});module.exports=ve($e);var m=require("react"),se=require("../../lib/cn.cjs"),ne=require("../chart/ChartAxis.cjs"),ue=require("../chart/ChartContainer.cjs"),me=require("../chart/ChartScaleLegend.cjs"),ce=require("../chart/ChartTableView.cjs"),he=require("../chart/ChartTooltip.cjs"),N=require("../chart/palette.cjs"),I=require("../chart/utils/data.cjs"),F=require("../chart/utils/format.cjs"),k=require("../chart/utils/scales.cjs"),L=require("../chart/utils/text.cjs"),de=require("../chart/utils/ticks.cjs"),ge=require("../chart/utils/touch.cjs"),r=require("react/jsx-runtime"),Se=2,xe=2,Le=12,Ve=16,oe="cell:",ae=!1,He=(0,m.memo)(function({cells:l,radius:t}){return(0,r.jsx)("g",{children:l.map(e=>(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:t,fill:e.missing?void 0:e.color,className:e.missing?"fill-gray-100 dark:fill-gray-800":void 0}),e.label?(0,r.jsx)("text",{x:e.x+e.width/2,y:e.y+e.height/2,textAnchor:"middle",dominantBaseline:"central",className:(0,se.cn)("text-[10px] [font-variant-numeric:tabular-nums]",e.onDark?"fill-gray-50 dark:fill-gray-900":"fill-gray-900 dark:fill-gray-50"),children:e.label}):null]},e.key))})});function Ee({width:s,height:l,columns:t,rows:e,lookup:f,colorScale:S,x:b,y:p,size:V,cellGap:w,cellRadius:K,showValues:O,tooltip:A,plotLabel:Z,formatValue:_,formatX:P,formatY:z,onCellClick:T}){let[H,D]=(0,m.useState)(null),c=H!==null&&H.column<t.length&&H.row<e.length?H:null,n=(0,m.useMemo)(()=>{let C=t.map((g,i)=>P(g,i)),u=e.map((g,i)=>z(g,i)),o={top:8,right:8,bottom:b.hidden?8:b.height??24+(b.label?16:0),left:p.hidden?8:p.height??(0,L.widestLabel)(u)+Le+(p.label?16:0)},h=Math.max(0,s-o.left-o.right),v=Math.max(0,l-o.top-o.bottom),d=(0,k.createBandScale)(t.map((g,i)=>i),[0,h],{paddingInner:0,paddingOuter:0}),x=(0,k.createBandScale)(e.map((g,i)=>i),[0,v],{paddingInner:0,paddingOuter:0}),G=Math.max(0,d.bandwidth-w),R=Math.max(0,x.bandwidth-w),W=[];e.forEach((g,i)=>{t.forEach((ee,q)=>{let a=f.get(`${(0,k.toKey)(ee)}|${(0,k.toKey)(g)}`)?.value??null,y=null;if(O&&a!==null&&R>=Ve){let $=_(a);(0,L.estimateTextWidth)($,10)+6<=G&&(y=$)}W.push({key:`${q}-${i}`,column:q,row:i,x:d(q)+w/2,y:x(i)+w/2,width:G,height:R,color:a===null?"transparent":S(a),label:y,onDark:a!==null&&S.onDark(a),missing:a===null})})});let X=(0,L.labelStride)(C.length,h,(0,L.widestLabel)(C)),B=(0,L.labelStride)(u.length,v,L.AXIS_FONT_SIZE+4),U=b.hidden?[]:C.map((g,i)=>({value:t[i],offset:d.center(i),label:g})).filter((g,i)=>i%X===0),Y=p.hidden?[]:u.map((g,i)=>({value:e[i],offset:x.center(i),label:g})).filter((g,i)=>i%B===0);return{margin:o,innerWidth:h,innerHeight:v,columnScale:d,rowScale:x,cells:W,columnTicks:U,rowTicks:Y}},[t,e,f,S,b,p,s,l,w,O,_,P,z]),M=(0,m.useCallback)((C,u)=>{let o=t[C],h=e[u],v=f.get(`${(0,k.toKey)(o)}|${(0,k.toKey)(h)}`),d=v?.value??null;return{x:o,y:h,xLabel:P(o,C),yLabel:z(h,u),value:d,formattedValue:d===null?"\u2014":_(d),color:d===null?"transparent":S(d),datum:v?.datum}},[t,e,f,S,_,P,z]),J=(0,m.useCallback)(C=>{if(A===!1||t.length===0||e.length===0)return;let u=C.currentTarget.getBoundingClientRect(),o=C.clientX-u.left-n.margin.left,h=C.clientY-u.top-n.margin.top,v=Math.floor(o/(n.columnScale.step||1)),d=Math.floor(h/(n.rowScale.step||1));if(v<0||v>=t.length||d<0||d>=e.length){D(null);return}D(x=>x?.column===v&&x.row===d?x:{column:v,row:d})},[A,t.length,e.length,n.margin,n.columnScale,n.rowScale]),Q=(0,m.useCallback)(C=>{if(t.length===0||e.length===0)return;let u=c??{column:0,row:0},o;switch(C.key){case"ArrowRight":o={...u,column:Math.min(t.length-1,u.column+1)};break;case"ArrowLeft":o={...u,column:Math.max(0,u.column-1)};break;case"ArrowDown":o={...u,row:Math.min(e.length-1,u.row+1)};break;case"ArrowUp":o={...u,row:Math.max(0,u.row-1)};break;case"Home":o={...u,column:0};break;case"End":o={...u,column:t.length-1};break;case"Escape":o=null;break;default:o=void 0}o!==void 0&&(C.preventDefault(),D(o))},[t.length,e.length,c]),j=(0,m.useCallback)(()=>{!T||!c||T(M(c.column,c.row))},[T,c,M]),E=c?M(c.column,c.row):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{width:s,height:l,role:"img","aria-label":Z??`${b.label??b.key} / ${p.label??p.key}`,tabIndex:0,className:`${ge.CHART_TOUCH} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:J,onPointerLeave:()=>D(null),onKeyDown:Q,onBlur:()=>D(null),onClick:j,children:[(0,r.jsxs)("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[(0,r.jsx)(He,{cells:n.cells,radius:K}),c?(0,r.jsx)("rect",{x:n.columnScale(c.column)+w/2,y:n.rowScale(c.row)+w/2,width:Math.max(0,n.columnScale.bandwidth-w),height:Math.max(0,n.rowScale.bandwidth-w),rx:K,fill:"none",strokeWidth:2,className:"stroke-gray-900 dark:stroke-white","aria-hidden":"true"}):null]}),(0,r.jsx)("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:b.hidden?null:(0,r.jsx)(ne.ChartAxis,{orientation:"bottom",ticks:n.columnTicks,length:n.innerWidth,showLine:!1,tickSize:0,label:b.label,size:V})}),(0,r.jsx)("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:p.hidden?null:(0,r.jsx)(ne.ChartAxis,{orientation:"left",ticks:n.rowTicks,length:n.innerHeight,showLine:!1,tickSize:0,label:p.label,size:V})})]}),c&&E&&A!==!1?(0,r.jsx)(he.ChartTooltip,{x:n.margin.left+n.columnScale.center(c.column),y:n.margin.top+n.rowScale.center(c.row),containerWidth:s,children:typeof A=="function"?A(E):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:[E.yLabel," \xB7 ",E.xLabel]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:E.color},"aria-hidden":"true"}),(0,r.jsx)("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:E.formattedValue})]})]})}):null]})}function ie(s,l,t){if(t)return t;let e=new Map;return s.forEach((f,S)=>{let b=(0,I.readXValue)(f,l,S),p=(0,k.toKey)(b);e.has(p)||e.set(p,b)}),[...e.values()]}function Re({data:s,x:l,y:t,value:e,format:f,domain:S,scale:b="sequential",center:p=0,steps:V,colors:w,xDomain:K,yDomain:O,cellGap:A=Se,cellRadius:Z=xe,showValues:_=!1,height:P=280,width:z,size:T="md",legend:H=!0,legendLabel:D,tooltip:c=!0,tableView:n=!1,title:M,description:J,loading:Q=!1,emptyState:j,error:E=!1,errorState:C,onRetry:u,actions:o,locale:h,plotLabel:v,onCellClick:d,className:x,...G}){V!==void 0&&V>N.CHART_MAX_COLOR_CLASSES&&!ae&&(ae=!0,console.warn(`[@synertech/ui] A Heatmap was cut into ${V} colour classes. Past ${N.CHART_MAX_COLOR_CLASSES} two neighbouring cells stop being tellable apart: leave \`steps\` unset and let the ramp stay continuous.`));let R=(0,m.useMemo)(()=>ie(s,l.key,K),[s,l.key,K]),W=(0,m.useMemo)(()=>ie(s,t.key,O),[s,t.key,O]),X=(0,m.useMemo)(()=>{let a=new Map;return s.forEach((y,$)=>{let le=(0,I.readNumber)(y,e);if(le===null)return;let fe=(0,I.readXValue)(y,l.key,$),be=(0,I.readXValue)(y,t.key,$);a.set(`${(0,k.toKey)(fe)}|${(0,k.toKey)(be)}`,{value:le,datum:y})}),a},[s,l.key,t.key,e]),B=(0,m.useMemo)(()=>f??(a=>(0,F.formatAuto)(a,h)),[f,h]),U=(0,m.useMemo)(()=>l.format??(a=>(0,F.formatXValue)(a,h)),[l.format,h]),Y=(0,m.useMemo)(()=>t.format??(a=>(0,F.formatXValue)(a,h)),[t.format,h]),g=(0,m.useMemo)(()=>{let a=S??(0,de.extent)([...X.values()].map(y=>y.value))??[0,1];return b==="diverging"?(0,N.createDivergingScale)(a,{center:p,steps:V,colors:w}):(0,N.createSequentialScale)(a,{steps:V,colors:w})},[S,X,b,p,V,w]),i=(0,m.useMemo)(()=>W.map(a=>{let y={[t.key]:a};return R.forEach($=>{y[`${oe}${(0,k.toKey)($)}`]=X.get(`${(0,k.toKey)($)}|${(0,k.toKey)(a)}`)?.value??null}),y}),[W,R,X,t.key]),ee=(0,m.useMemo)(()=>R.map((a,y)=>({key:`${oe}${(0,k.toKey)(a)}`,label:U(a,y)})),[R,U]),q=H!==!1,re=typeof H=="string"?H:"bottom";return(0,r.jsx)(ue.ChartContainer,{title:M,description:J,height:P,width:z,size:T,loading:Q,empty:X.size===0,emptyState:j,error:E,errorState:C,onRetry:u,actions:o,tableView:n,legendPosition:re,legend:q?(0,r.jsx)(me.ChartScaleLegend,{scale:g,label:D,format:B,size:T,locale:h}):void 0,table:n?(0,r.jsx)(ce.ChartTableView,{data:i,series:ee,xKey:t.key,xLabel:t.label??t.key,formatX:Y,formatValue:B,caption:typeof M=="string"?M:void 0}):void 0,className:x,...G,children:({width:a})=>(0,r.jsx)(Ee,{width:a,height:P,columns:R,rows:W,lookup:X,colorScale:g,x:l,y:t,size:T,cellGap:A,cellRadius:Z,showValues:_,tooltip:c,plotLabel:v,formatValue:B,formatX:U,formatY:Y,onCellClick:d})})}function Xe(){ae=!1}0&&(module.exports={Heatmap,resetHeatmapWarnings});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{memo as de,useCallback as F,useMemo as S,useState as ge}from"react";import{cn as fe}from"../../lib/cn.js";import{ChartAxis as ae}from"../chart/ChartAxis.js";import{ChartContainer as be}from"../chart/ChartContainer.js";import{ChartScaleLegend as pe}from"../chart/ChartScaleLegend.js";import{ChartTableView as Ce}from"../chart/ChartTableView.js";import{ChartTooltip as ke}from"../chart/ChartTooltip.js";import{CHART_MAX_COLOR_CLASSES as re,createDivergingScale as ye,createSequentialScale as we}from"../chart/palette.js";import{readNumber as ve,readXValue as j}from"../chart/utils/data.js";import{formatAuto as Se,formatXValue as le}from"../chart/utils/format.js";import{createBandScale as oe,toKey as y}from"../chart/utils/scales.js";import{AXIS_FONT_SIZE as xe,estimateTextWidth as Le,labelStride as ie,widestLabel as se}from"../chart/utils/text.js";import{extent as Ve}from"../chart/utils/ticks.js";import{CHART_TOUCH as He}from"../chart/utils/touch.js";import{Fragment as Te,jsx as c,jsxs as M}from"react/jsx-runtime";var Ee=2,Re=2,Xe=12,$e=16,ue="cell:",ee=!1,Ae=de(function({cells:h,radius:t}){return c("g",{children:h.map(e=>M("g",{children:[c("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:t,fill:e.missing?void 0:e.color,className:e.missing?"fill-gray-100 dark:fill-gray-800":void 0}),e.label?c("text",{x:e.x+e.width/2,y:e.y+e.height/2,textAnchor:"middle",dominantBaseline:"central",className:fe("text-[10px] [font-variant-numeric:tabular-nums]",e.onDark?"fill-gray-50 dark:fill-gray-900":"fill-gray-900 dark:fill-gray-50"),children:e.label}):null]},e.key))})});function Pe({width:b,height:h,columns:t,rows:e,lookup:x,colorScale:w,x:d,y:g,size:L,cellGap:C,cellRadius:W,showValues:I,tooltip:$,plotLabel:G,formatValue:N,formatX:A,formatY:_,onCellClick:P}){let[V,T]=ge(null),i=V!==null&&V.column<t.length&&V.row<e.length?V:null,n=S(()=>{let f=t.map((m,l)=>A(m,l)),o=e.map((m,l)=>_(m,l)),r={top:8,right:8,bottom:d.hidden?8:d.height??24+(d.label?16:0),left:g.hidden?8:g.height??se(o)+Xe+(g.label?16:0)},s=Math.max(0,b-r.left-r.right),k=Math.max(0,h-r.top-r.bottom),u=oe(t.map((m,l)=>l),[0,s],{paddingInner:0,paddingOuter:0}),v=oe(e.map((m,l)=>l),[0,k],{paddingInner:0,paddingOuter:0}),U=Math.max(0,u.bandwidth-C),E=Math.max(0,v.bandwidth-C),z=[];e.forEach((m,l)=>{t.forEach((Q,B)=>{let a=x.get(`${y(Q)}|${y(m)}`)?.value??null,p=null;if(I&&a!==null&&E>=$e){let X=N(a);Le(X,10)+6<=U&&(p=X)}z.push({key:`${B}-${l}`,column:B,row:l,x:u(B)+C/2,y:v(l)+C/2,width:U,height:E,color:a===null?"transparent":w(a),label:p,onDark:a!==null&&w.onDark(a),missing:a===null})})});let R=ie(f.length,s,se(f)),K=ie(o.length,k,xe+4),O=d.hidden?[]:f.map((m,l)=>({value:t[l],offset:u.center(l),label:m})).filter((m,l)=>l%R===0),q=g.hidden?[]:o.map((m,l)=>({value:e[l],offset:v.center(l),label:m})).filter((m,l)=>l%K===0);return{margin:r,innerWidth:s,innerHeight:k,columnScale:u,rowScale:v,cells:z,columnTicks:O,rowTicks:q}},[t,e,x,w,d,g,b,h,C,I,N,A,_]),D=F((f,o)=>{let r=t[f],s=e[o],k=x.get(`${y(r)}|${y(s)}`),u=k?.value??null;return{x:r,y:s,xLabel:A(r,f),yLabel:_(s,o),value:u,formattedValue:u===null?"\u2014":N(u),color:u===null?"transparent":w(u),datum:k?.datum}},[t,e,x,w,N,A,_]),Y=F(f=>{if($===!1||t.length===0||e.length===0)return;let o=f.currentTarget.getBoundingClientRect(),r=f.clientX-o.left-n.margin.left,s=f.clientY-o.top-n.margin.top,k=Math.floor(r/(n.columnScale.step||1)),u=Math.floor(s/(n.rowScale.step||1));if(k<0||k>=t.length||u<0||u>=e.length){T(null);return}T(v=>v?.column===k&&v.row===u?v:{column:k,row:u})},[$,t.length,e.length,n.margin,n.columnScale,n.rowScale]),Z=F(f=>{if(t.length===0||e.length===0)return;let o=i??{column:0,row:0},r;switch(f.key){case"ArrowRight":r={...o,column:Math.min(t.length-1,o.column+1)};break;case"ArrowLeft":r={...o,column:Math.max(0,o.column-1)};break;case"ArrowDown":r={...o,row:Math.min(e.length-1,o.row+1)};break;case"ArrowUp":r={...o,row:Math.max(0,o.row-1)};break;case"Home":r={...o,column:0};break;case"End":r={...o,column:t.length-1};break;case"Escape":r=null;break;default:r=void 0}r!==void 0&&(f.preventDefault(),T(r))},[t.length,e.length,i]),J=F(()=>{!P||!i||P(D(i.column,i.row))},[P,i,D]),H=i?D(i.column,i.row):null;return M(Te,{children:[M("svg",{width:b,height:h,role:"img","aria-label":G??`${d.label??d.key} / ${g.label??g.key}`,tabIndex:0,className:`${He} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,onPointerMove:Y,onPointerLeave:()=>T(null),onKeyDown:Z,onBlur:()=>T(null),onClick:J,children:[M("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:[c(Ae,{cells:n.cells,radius:W}),i?c("rect",{x:n.columnScale(i.column)+C/2,y:n.rowScale(i.row)+C/2,width:Math.max(0,n.columnScale.bandwidth-C),height:Math.max(0,n.rowScale.bandwidth-C),rx:W,fill:"none",strokeWidth:2,className:"stroke-gray-900 dark:stroke-white","aria-hidden":"true"}):null]}),c("g",{transform:`translate(${n.margin.left}, ${n.margin.top+n.innerHeight})`,children:d.hidden?null:c(ae,{orientation:"bottom",ticks:n.columnTicks,length:n.innerWidth,showLine:!1,tickSize:0,label:d.label,size:L})}),c("g",{transform:`translate(${n.margin.left}, ${n.margin.top})`,children:g.hidden?null:c(ae,{orientation:"left",ticks:n.rowTicks,length:n.innerHeight,showLine:!1,tickSize:0,label:g.label,size:L})})]}),i&&H&&$!==!1?c(ke,{x:n.margin.left+n.columnScale.center(i.column),y:n.margin.top+n.rowScale.center(i.row),containerWidth:b,children:typeof $=="function"?$(H):M("div",{className:"flex flex-col gap-1",children:[M("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:[H.yLabel," \xB7 ",H.xLabel]}),M("div",{className:"flex items-center gap-2",children:[c("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:H.color},"aria-hidden":"true"}),c("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:H.formattedValue})]})]})}):null]})}function me(b,h,t){if(t)return t;let e=new Map;return b.forEach((x,w)=>{let d=j(x,h,w),g=y(d);e.has(g)||e.set(g,d)}),[...e.values()]}function Ye({data:b,x:h,y:t,value:e,format:x,domain:w,scale:d="sequential",center:g=0,steps:L,colors:C,xDomain:W,yDomain:I,cellGap:$=Ee,cellRadius:G=Re,showValues:N=!1,height:A=280,width:_,size:P="md",legend:V=!0,legendLabel:T,tooltip:i=!0,tableView:n=!1,title:D,description:Y,loading:Z=!1,emptyState:J,error:H=!1,errorState:f,onRetry:o,actions:r,locale:s,plotLabel:k,onCellClick:u,className:v,...U}){L!==void 0&&L>re&&!ee&&(ee=!0,console.warn(`[@synertech/ui] A Heatmap was cut into ${L} colour classes. Past ${re} two neighbouring cells stop being tellable apart: leave \`steps\` unset and let the ramp stay continuous.`));let E=S(()=>me(b,h.key,W),[b,h.key,W]),z=S(()=>me(b,t.key,I),[b,t.key,I]),R=S(()=>{let a=new Map;return b.forEach((p,X)=>{let ne=ve(p,e);if(ne===null)return;let ce=j(p,h.key,X),he=j(p,t.key,X);a.set(`${y(ce)}|${y(he)}`,{value:ne,datum:p})}),a},[b,h.key,t.key,e]),K=S(()=>x??(a=>Se(a,s)),[x,s]),O=S(()=>h.format??(a=>le(a,s)),[h.format,s]),q=S(()=>t.format??(a=>le(a,s)),[t.format,s]),m=S(()=>{let a=w??Ve([...R.values()].map(p=>p.value))??[0,1];return d==="diverging"?ye(a,{center:g,steps:L,colors:C}):we(a,{steps:L,colors:C})},[w,R,d,g,L,C]),l=S(()=>z.map(a=>{let p={[t.key]:a};return E.forEach(X=>{p[`${ue}${y(X)}`]=R.get(`${y(X)}|${y(a)}`)?.value??null}),p}),[z,E,R,t.key]),Q=S(()=>E.map((a,p)=>({key:`${ue}${y(a)}`,label:O(a,p)})),[E,O]),B=V!==!1,te=typeof V=="string"?V:"bottom";return c(be,{title:D,description:Y,height:A,width:_,size:P,loading:Z,empty:R.size===0,emptyState:J,error:H,errorState:f,onRetry:o,actions:r,tableView:n,legendPosition:te,legend:B?c(pe,{scale:m,label:T,format:K,size:P,locale:s}):void 0,table:n?c(Ce,{data:l,series:Q,xKey:t.key,xLabel:t.label??t.key,formatX:q,formatValue:K,caption:typeof D=="string"?D:void 0}):void 0,className:v,...U,children:({width:a})=>c(Pe,{width:a,height:A,columns:E,rows:z,lookup:R,colorScale:m,x:h,y:t,size:P,cellGap:$,cellRadius:G,showValues:N,tooltip:i,plotLabel:k,formatValue:K,formatX:O,formatY:q,onCellClick:u})})}function Ze(){ee=!1}export{Ye as Heatmap,Ze as resetHeatmapWarnings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var x=(e,a)=>{for(var t in a)m(e,t,{get:a[t],enumerable:!0})},s=(e,a,t,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of f(a))!l.call(e,p)&&p!==t&&m(e,p,{get:()=>a[p],enumerable:!(o=H(a,p))||o.enumerable});return e};var y=e=>s(m({},"__esModule",{value:!0}),e);var C={};x(C,{Heatmap:()=>r.Heatmap});module.exports=y(C);var r=require("./Heatmap.cjs");0&&(module.exports={Heatmap});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Heatmap as p}from"./Heatmap.js";export{p as Heatmap};
|