@ayasofyazilim/ui 0.0.0 → 0.0.2
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/dist/aria/index.js +2 -0
- package/dist/aria/index.js.map +1 -0
- package/dist/aria/number-field.js +46 -0
- package/dist/aria/number-field.js.map +1 -0
- package/dist/components/accordion.js +66 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.js +148 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.js +69 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.js +12 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.js +55 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.js +62 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.js +104 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.js +77 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.js +56 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.js +196 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.js +91 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.js +200 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.js +250 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.js +33 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.js +36 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.js +178 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.js +225 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.js +139 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.js +130 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.js +234 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.js +100 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.js +231 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/form.js +124 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/hover-card.js +40 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.js +156 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.js +68 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.js +22 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.js +188 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.js +32 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.js +24 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.js +253 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/navigation-menu.js +171 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.js +125 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.js +82 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.js +33 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.js +47 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.js +50 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.js +62 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.js +173 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.js +28 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.js +129 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.js +759 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.js +16 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.js +65 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.js +40 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.js +18 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stepper.js +220 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.js +33 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.js +131 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.js +69 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.js +19 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.js +70 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.js +45 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.js +65 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/custom/action-button.js +38 -0
- package/dist/custom/action-button.js.map +1 -0
- package/dist/custom/async-select.js +249 -0
- package/dist/custom/async-select.js.map +1 -0
- package/dist/custom/awesome-not-found.js +113 -0
- package/dist/custom/awesome-not-found.js.map +1 -0
- package/dist/custom/charts/area-chart.js +125 -0
- package/dist/custom/charts/area-chart.js.map +1 -0
- package/dist/custom/charts/bar-chart.js +232 -0
- package/dist/custom/charts/bar-chart.js.map +1 -0
- package/dist/custom/charts/chart-card.js +71 -0
- package/dist/custom/charts/chart-card.js.map +1 -0
- package/dist/custom/charts/index.js +5 -0
- package/dist/custom/charts/index.js.map +1 -0
- package/dist/custom/charts/pie-chart.js +153 -0
- package/dist/custom/charts/pie-chart.js.map +1 -0
- package/dist/custom/charts/radar-chart.js +112 -0
- package/dist/custom/charts/radar-chart.js.map +1 -0
- package/dist/custom/checkbox-tree.js +70 -0
- package/dist/custom/checkbox-tree.js.map +1 -0
- package/dist/custom/combobox.js +233 -0
- package/dist/custom/combobox.js.map +1 -0
- package/dist/custom/confirm-dialog.js +90 -0
- package/dist/custom/confirm-dialog.js.map +1 -0
- package/dist/custom/country-selector.js +151 -0
- package/dist/custom/country-selector.js.map +1 -0
- package/dist/custom/date-picker/calendar-rac.js +91 -0
- package/dist/custom/date-picker/calendar-rac.js.map +1 -0
- package/dist/custom/date-picker/datefield-rac.js +77 -0
- package/dist/custom/date-picker/datefield-rac.js.map +1 -0
- package/dist/custom/date-picker/index.js +251 -0
- package/dist/custom/date-picker/index.js.map +1 -0
- package/dist/custom/date-picker/types/index.js +1 -0
- package/dist/custom/date-picker/types/index.js.map +1 -0
- package/dist/custom/date-picker/utils/index.js +30 -0
- package/dist/custom/date-picker/utils/index.js.map +1 -0
- package/dist/custom/date-picker-old.js +46 -0
- package/dist/custom/date-picker-old.js.map +1 -0
- package/dist/custom/date-tooltip.js +89 -0
- package/dist/custom/date-tooltip.js.map +1 -0
- package/dist/custom/document-scanner/consts.js +13 -0
- package/dist/custom/document-scanner/consts.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/action-buttons.js +24 -0
- package/dist/custom/document-scanner/corner-adjustment/action-buttons.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/corner-handle.js +44 -0
- package/dist/custom/document-scanner/corner-adjustment/corner-handle.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/hooks/use-corner-drag.js +60 -0
- package/dist/custom/document-scanner/corner-adjustment/hooks/use-corner-drag.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/index.js +124 -0
- package/dist/custom/document-scanner/corner-adjustment/index.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/types.js +1 -0
- package/dist/custom/document-scanner/corner-adjustment/types.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/utils/clip-path.js +16 -0
- package/dist/custom/document-scanner/corner-adjustment/utils/clip-path.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/zoom-magnifier.js +85 -0
- package/dist/custom/document-scanner/corner-adjustment/zoom-magnifier.js.map +1 -0
- package/dist/custom/document-scanner/hooks/use-document-capture.js +61 -0
- package/dist/custom/document-scanner/hooks/use-document-capture.js.map +1 -0
- package/dist/custom/document-scanner/hooks/use-document-scanner.js +59 -0
- package/dist/custom/document-scanner/hooks/use-document-scanner.js.map +1 -0
- package/dist/custom/document-scanner/hooks/use-perspective-crop.js +31 -0
- package/dist/custom/document-scanner/hooks/use-perspective-crop.js.map +1 -0
- package/dist/custom/document-scanner/index.js +229 -0
- package/dist/custom/document-scanner/index.js.map +1 -0
- package/dist/custom/document-scanner/lib.js +289 -0
- package/dist/custom/document-scanner/lib.js.map +1 -0
- package/dist/custom/document-scanner/types.js +1 -0
- package/dist/custom/document-scanner/types.js.map +1 -0
- package/dist/custom/document-scanner/utils/perspective-correction.js +100 -0
- package/dist/custom/document-scanner/utils/perspective-correction.js.map +1 -0
- package/dist/custom/document-viewer/controllers.js +76 -0
- package/dist/custom/document-viewer/controllers.js.map +1 -0
- package/dist/custom/document-viewer/index.js +36 -0
- package/dist/custom/document-viewer/index.js.map +1 -0
- package/dist/custom/document-viewer/renderers/image.js +40 -0
- package/dist/custom/document-viewer/renderers/image.js.map +1 -0
- package/dist/custom/document-viewer/renderers/index.js +3 -0
- package/dist/custom/document-viewer/renderers/index.js.map +1 -0
- package/dist/custom/document-viewer/renderers/pdf.js +95 -0
- package/dist/custom/document-viewer/renderers/pdf.js.map +1 -0
- package/dist/custom/email-input/email.js +184 -0
- package/dist/custom/email-input/email.js.map +1 -0
- package/dist/custom/email-input/index.js +8 -0
- package/dist/custom/email-input/index.js.map +1 -0
- package/dist/custom/email-input/types.js +13 -0
- package/dist/custom/email-input/types.js.map +1 -0
- package/dist/custom/file-uploader.js +389 -0
- package/dist/custom/file-uploader.js.map +1 -0
- package/dist/custom/filter-component/fields/async-select.js +31 -0
- package/dist/custom/filter-component/fields/async-select.js.map +1 -0
- package/dist/custom/filter-component/fields/date.js +56 -0
- package/dist/custom/filter-component/fields/date.js.map +1 -0
- package/dist/custom/filter-component/fields/multi-select.js +28 -0
- package/dist/custom/filter-component/fields/multi-select.js.map +1 -0
- package/dist/custom/filter-component/index.js +149 -0
- package/dist/custom/filter-component/index.js.map +1 -0
- package/dist/custom/image-canvas.js +193 -0
- package/dist/custom/image-canvas.js.map +1 -0
- package/dist/custom/json-editor.js +30 -0
- package/dist/custom/json-editor.js.map +1 -0
- package/dist/custom/master-data-grid/components/dialogs/column-settings-dialog.js +84 -0
- package/dist/custom/master-data-grid/components/dialogs/column-settings-dialog.js.map +1 -0
- package/dist/custom/master-data-grid/components/dialogs/index.js +5 -0
- package/dist/custom/master-data-grid/components/dialogs/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/client-filter.js +310 -0
- package/dist/custom/master-data-grid/components/filters/client-filter.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/filter-input.js +209 -0
- package/dist/custom/master-data-grid/components/filters/filter-input.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/index.js +9 -0
- package/dist/custom/master-data-grid/components/filters/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/inline-column-filter.js +188 -0
- package/dist/custom/master-data-grid/components/filters/inline-column-filter.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/multi-filter-dialog.js +65 -0
- package/dist/custom/master-data-grid/components/filters/multi-filter-dialog.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/server-filter.js +213 -0
- package/dist/custom/master-data-grid/components/filters/server-filter.js.map +1 -0
- package/dist/custom/master-data-grid/components/master-data-grid.js +421 -0
- package/dist/custom/master-data-grid/components/master-data-grid.js.map +1 -0
- package/dist/custom/master-data-grid/components/pagination/index.js +5 -0
- package/dist/custom/master-data-grid/components/pagination/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/pagination/pagination.js +159 -0
- package/dist/custom/master-data-grid/components/pagination/pagination.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/cell-renderer.js +442 -0
- package/dist/custom/master-data-grid/components/table/cell-renderer.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/header-cell.js +116 -0
- package/dist/custom/master-data-grid/components/table/header-cell.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/index.js +5 -0
- package/dist/custom/master-data-grid/components/table/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/table-body-renderer.js +79 -0
- package/dist/custom/master-data-grid/components/table/table-body-renderer.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/virtual-body.js +86 -0
- package/dist/custom/master-data-grid/components/table/virtual-body.js.map +1 -0
- package/dist/custom/master-data-grid/components/toolbar/index.js +5 -0
- package/dist/custom/master-data-grid/components/toolbar/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/toolbar/toolbar.js +238 -0
- package/dist/custom/master-data-grid/components/toolbar/toolbar.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/index.js +7 -0
- package/dist/custom/master-data-grid/hooks/index.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-columns.js +278 -0
- package/dist/custom/master-data-grid/hooks/use-columns.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-editing.js +75 -0
- package/dist/custom/master-data-grid/hooks/use-editing.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-table-state-reducer.js +96 -0
- package/dist/custom/master-data-grid/hooks/use-table-state-reducer.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-table-state.js +25 -0
- package/dist/custom/master-data-grid/hooks/use-table-state.js.map +1 -0
- package/dist/custom/master-data-grid/index.js +5 -0
- package/dist/custom/master-data-grid/index.js.map +1 -0
- package/dist/custom/master-data-grid/types.js +1 -0
- package/dist/custom/master-data-grid/types.js.map +1 -0
- package/dist/custom/master-data-grid/utils/column-generator.js +203 -0
- package/dist/custom/master-data-grid/utils/column-generator.js.map +1 -0
- package/dist/custom/master-data-grid/utils/export-utils.js +46 -0
- package/dist/custom/master-data-grid/utils/export-utils.js.map +1 -0
- package/dist/custom/master-data-grid/utils/filter-fns.js +218 -0
- package/dist/custom/master-data-grid/utils/filter-fns.js.map +1 -0
- package/dist/custom/master-data-grid/utils/index.js +16 -0
- package/dist/custom/master-data-grid/utils/index.js.map +1 -0
- package/dist/custom/master-data-grid/utils/pinning-utils.js +70 -0
- package/dist/custom/master-data-grid/utils/pinning-utils.js.map +1 -0
- package/dist/custom/master-data-grid/utils/translation-utils.js +33 -0
- package/dist/custom/master-data-grid/utils/translation-utils.js.map +1 -0
- package/dist/custom/multi-select.js +339 -0
- package/dist/custom/multi-select.js.map +1 -0
- package/dist/custom/password-input.js +158 -0
- package/dist/custom/password-input.js.map +1 -0
- package/dist/custom/phone-input.js +127 -0
- package/dist/custom/phone-input.js.map +1 -0
- package/dist/custom/schema-form/custom/index.js +2 -0
- package/dist/custom/schema-form/custom/index.js.map +1 -0
- package/dist/custom/schema-form/custom/label.js +39 -0
- package/dist/custom/schema-form/custom/label.js.map +1 -0
- package/dist/custom/schema-form/fields/base-input-field.js +73 -0
- package/dist/custom/schema-form/fields/base-input-field.js.map +1 -0
- package/dist/custom/schema-form/fields/field.js +72 -0
- package/dist/custom/schema-form/fields/field.js.map +1 -0
- package/dist/custom/schema-form/fields/index.js +6 -0
- package/dist/custom/schema-form/fields/index.js.map +1 -0
- package/dist/custom/schema-form/fields/object.js +9 -0
- package/dist/custom/schema-form/fields/object.js.map +1 -0
- package/dist/custom/schema-form/fields/table-array/array-field-item.js +58 -0
- package/dist/custom/schema-form/fields/table-array/array-field-item.js.map +1 -0
- package/dist/custom/schema-form/fields/table-array/array-field-template.js +104 -0
- package/dist/custom/schema-form/fields/table-array/array-field-template.js.map +1 -0
- package/dist/custom/schema-form/index.js +219 -0
- package/dist/custom/schema-form/index.js.map +1 -0
- package/dist/custom/schema-form/templates/description.js +19 -0
- package/dist/custom/schema-form/templates/description.js.map +1 -0
- package/dist/custom/schema-form/templates/index.js +3 -0
- package/dist/custom/schema-form/templates/index.js.map +1 -0
- package/dist/custom/schema-form/templates/submit.js +31 -0
- package/dist/custom/schema-form/templates/submit.js.map +1 -0
- package/dist/custom/schema-form/types.js +1 -0
- package/dist/custom/schema-form/types.js.map +1 -0
- package/dist/custom/schema-form/utils/index.js +10 -0
- package/dist/custom/schema-form/utils/index.js.map +1 -0
- package/dist/custom/schema-form/utils/schema-dependency.js +349 -0
- package/dist/custom/schema-form/utils/schema-dependency.js.map +1 -0
- package/dist/custom/schema-form/utils/schemas.js +190 -0
- package/dist/custom/schema-form/utils/schemas.js.map +1 -0
- package/dist/custom/schema-form/utils/validation.js +19 -0
- package/dist/custom/schema-form/utils/validation.js.map +1 -0
- package/dist/custom/schema-form/widgets/boolean.js +73 -0
- package/dist/custom/schema-form/widgets/boolean.js.map +1 -0
- package/dist/custom/schema-form/widgets/combobox.js +222 -0
- package/dist/custom/schema-form/widgets/combobox.js.map +1 -0
- package/dist/custom/schema-form/widgets/date.js +56 -0
- package/dist/custom/schema-form/widgets/date.js.map +1 -0
- package/dist/custom/schema-form/widgets/email.js +37 -0
- package/dist/custom/schema-form/widgets/email.js.map +1 -0
- package/dist/custom/schema-form/widgets/index.js +11 -0
- package/dist/custom/schema-form/widgets/index.js.map +1 -0
- package/dist/custom/schema-form/widgets/password.js +42 -0
- package/dist/custom/schema-form/widgets/password.js.map +1 -0
- package/dist/custom/schema-form/widgets/phone.js +39 -0
- package/dist/custom/schema-form/widgets/phone.js.map +1 -0
- package/dist/custom/schema-form/widgets/select.js +78 -0
- package/dist/custom/schema-form/widgets/select.js.map +1 -0
- package/dist/custom/schema-form/widgets/selectable.js +25 -0
- package/dist/custom/schema-form/widgets/selectable.js.map +1 -0
- package/dist/custom/schema-form/widgets/string-array.js +237 -0
- package/dist/custom/schema-form/widgets/string-array.js.map +1 -0
- package/dist/custom/schema-form/widgets/url.js +53 -0
- package/dist/custom/schema-form/widgets/url.js.map +1 -0
- package/dist/custom/section-layout-v2.js +150 -0
- package/dist/custom/section-layout-v2.js.map +1 -0
- package/dist/custom/select-tabs.js +66 -0
- package/dist/custom/select-tabs.js.map +1 -0
- package/dist/custom/selectable.js +231 -0
- package/dist/custom/selectable.js.map +1 -0
- package/dist/custom/stepper.js +166 -0
- package/dist/custom/stepper.js.map +1 -0
- package/dist/custom/tab-layout.js +182 -0
- package/dist/custom/tab-layout.js.map +1 -0
- package/dist/custom/tanstack-table/fields/index.js +13 -0
- package/dist/custom/tanstack-table/fields/index.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-action-dialogs.js +76 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-action-dialogs.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-column-header.js +47 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-column-header.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-date.js +132 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-date.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-faceted.js +131 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-faceted.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-text.js +64 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-text.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-pagination.js +135 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-pagination.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-plain-table.js +111 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-plain-table.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-confirmation.js +65 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-confirmation.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-custom-dialog.js +69 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-custom-dialog.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions.js +119 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-custom-dialog.js +75 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-custom-dialog.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-schemaform-dialog.js +41 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-schemaform-dialog.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-toolbar.js +106 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-toolbar.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-view-options.js +132 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-view-options.js.map +1 -0
- package/dist/custom/tanstack-table/index.js +217 -0
- package/dist/custom/tanstack-table/index.js.map +1 -0
- package/dist/custom/tanstack-table/types/index.js +1 -0
- package/dist/custom/tanstack-table/types/index.js.map +1 -0
- package/dist/custom/tanstack-table/utils/cell-with-actions.js +16 -0
- package/dist/custom/tanstack-table/utils/cell-with-actions.js.map +1 -0
- package/dist/custom/tanstack-table/utils/column-names.js +15 -0
- package/dist/custom/tanstack-table/utils/column-names.js.map +1 -0
- package/dist/custom/tanstack-table/utils/columns-by-row-data.js +246 -0
- package/dist/custom/tanstack-table/utils/columns-by-row-data.js.map +1 -0
- package/dist/custom/tanstack-table/utils/editable-columns-by-row-data.js +187 -0
- package/dist/custom/tanstack-table/utils/editable-columns-by-row-data.js.map +1 -0
- package/dist/custom/tanstack-table/utils/faceted-boolean-options.js +25 -0
- package/dist/custom/tanstack-table/utils/faceted-boolean-options.js.map +1 -0
- package/dist/custom/tanstack-table/utils/index.js +10 -0
- package/dist/custom/tanstack-table/utils/index.js.map +1 -0
- package/dist/custom/tanstack-table/utils/pinning-styles.js +38 -0
- package/dist/custom/tanstack-table/utils/pinning-styles.js.map +1 -0
- package/dist/custom/tanstack-table/utils/table.js +66 -0
- package/dist/custom/tanstack-table/utils/table.js.map +1 -0
- package/dist/custom/tanstack-table/utils/test-conditions.js +10 -0
- package/dist/custom/tanstack-table/utils/test-conditions.js.map +1 -0
- package/dist/custom/timeline.js +165 -0
- package/dist/custom/timeline.js.map +1 -0
- package/dist/custom/tree.js +130 -0
- package/dist/custom/tree.js.map +1 -0
- package/dist/custom/tscanify/browser.js +36 -0
- package/dist/custom/tscanify/browser.js.map +1 -0
- package/dist/custom/tscanify/index.js +34 -0
- package/dist/custom/tscanify/index.js.map +1 -0
- package/dist/custom/tscanify/tscanify-browser.js +363 -0
- package/dist/custom/tscanify/tscanify-browser.js.map +1 -0
- package/dist/custom/tscanify/tscanify.js +197 -0
- package/dist/custom/tscanify/tscanify.js.map +1 -0
- package/dist/custom/tscanify/types.js +1 -0
- package/dist/custom/tscanify/types.js.map +1 -0
- package/dist/custom/webcam.js +519 -0
- package/dist/custom/webcam.js.map +1 -0
- package/dist/hooks/use-callback-ref.js +15 -0
- package/dist/hooks/use-callback-ref.js.map +1 -0
- package/dist/hooks/use-controllable-state.js +49 -0
- package/dist/hooks/use-controllable-state.js.map +1 -0
- package/dist/hooks/use-debounce.js +18 -0
- package/dist/hooks/use-debounce.js.map +1 -0
- package/dist/hooks/use-is-visible.js +22 -0
- package/dist/hooks/use-is-visible.js.map +1 -0
- package/dist/hooks/use-media-query.js +19 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-on-window-resize.js +15 -0
- package/dist/hooks/use-on-window-resize.js.map +1 -0
- package/dist/hooks/use-scroll.js +20 -0
- package/dist/hooks/use-scroll.js.map +1 -0
- package/dist/lib/utils.js +48 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/zod.js +7 -0
- package/dist/lib/zod.js.map +1 -0
- package/package.json +34 -8
- package/src/aria/index.tsx +1 -1
- package/src/aria/number-field.tsx +41 -41
- package/src/components/accordion.tsx +66 -66
- package/src/components/alert-dialog.tsx +157 -157
- package/src/components/alert.tsx +70 -70
- package/src/components/aspect-ratio.tsx +11 -11
- package/src/components/avatar.tsx +53 -53
- package/src/components/badge.tsx +74 -67
- package/src/components/breadcrumb.tsx +109 -109
- package/src/components/button-group.tsx +83 -83
- package/src/components/button.tsx +69 -68
- package/src/components/calendar.tsx +216 -219
- package/src/components/card.tsx +92 -92
- package/src/components/carousel.tsx +241 -241
- package/src/components/chart.tsx +363 -363
- package/src/components/checkbox.tsx +32 -32
- package/src/components/collapsible.tsx +33 -33
- package/src/components/command.tsx +184 -184
- package/src/components/context-menu.tsx +252 -252
- package/src/components/dialog.tsx +144 -144
- package/src/components/drawer.tsx +135 -135
- package/src/components/dropdown-menu.tsx +258 -258
- package/src/components/empty.tsx +100 -100
- package/src/components/field.tsx +248 -248
- package/src/components/form.tsx +169 -169
- package/src/components/hover-card.tsx +44 -44
- package/src/components/input-group.tsx +170 -170
- package/src/components/input-otp.tsx +77 -77
- package/src/components/input.tsx +21 -21
- package/src/components/item.tsx +193 -193
- package/src/components/kbd.tsx +28 -28
- package/src/components/label.tsx +24 -24
- package/src/components/menubar.tsx +276 -276
- package/src/components/navigation-menu.tsx +168 -168
- package/src/components/pagination.tsx +127 -130
- package/src/components/popover.tsx +88 -88
- package/src/components/progress.tsx +31 -31
- package/src/components/radio-group.tsx +45 -45
- package/src/components/resizable.tsx +56 -56
- package/src/components/scroll-area.tsx +58 -58
- package/src/components/select.tsx +189 -189
- package/src/components/separator.tsx +28 -28
- package/src/components/sheet.tsx +140 -140
- package/src/components/sidebar.tsx +862 -862
- package/src/components/skeleton.tsx +13 -13
- package/src/components/slider.tsx +63 -63
- package/src/components/sonner.tsx +40 -40
- package/src/components/spinner.tsx +16 -16
- package/src/components/stepper.tsx +290 -291
- package/src/components/switch.tsx +31 -31
- package/src/components/table.tsx +133 -133
- package/src/components/tabs.tsx +66 -66
- package/src/components/textarea.tsx +18 -18
- package/src/components/toggle-group.tsx +83 -83
- package/src/components/toggle.tsx +47 -47
- package/src/components/tooltip.tsx +66 -66
- package/src/custom/action-button.tsx +45 -48
- package/src/custom/async-select.tsx +287 -287
- package/src/custom/awesome-not-found.tsx +116 -116
- package/src/custom/charts/area-chart.tsx +147 -147
- package/src/custom/charts/bar-chart.tsx +233 -233
- package/src/custom/charts/chart-card.tsx +103 -103
- package/src/custom/charts/index.tsx +16 -16
- package/src/custom/charts/pie-chart.tsx +168 -168
- package/src/custom/charts/radar-chart.tsx +126 -126
- package/src/custom/checkbox-tree.tsx +100 -100
- package/src/custom/combobox.tsx +296 -296
- package/src/custom/confirm-dialog.tsx +114 -102
- package/src/custom/country-selector.tsx +204 -204
- package/src/custom/date-picker/calendar-rac.tsx +109 -109
- package/src/custom/date-picker/datefield-rac.tsx +84 -84
- package/src/custom/date-picker/index.tsx +273 -273
- package/src/custom/date-picker/types/index.ts +4 -4
- package/src/custom/date-picker/utils/index.ts +42 -42
- package/src/custom/date-picker-old.tsx +50 -50
- package/src/custom/date-tooltip.tsx +98 -98
- package/src/custom/document-scanner/consts.ts +5 -5
- package/src/custom/document-scanner/corner-adjustment/action-buttons.tsx +33 -33
- package/src/custom/document-scanner/corner-adjustment/corner-handle.tsx +43 -43
- package/src/custom/document-scanner/corner-adjustment/hooks/use-corner-drag.ts +85 -85
- package/src/custom/document-scanner/corner-adjustment/index.tsx +125 -125
- package/src/custom/document-scanner/corner-adjustment/types.ts +53 -53
- package/src/custom/document-scanner/corner-adjustment/utils/clip-path.ts +22 -22
- package/src/custom/document-scanner/corner-adjustment/zoom-magnifier.tsx +115 -115
- package/src/custom/document-scanner/hooks/use-document-capture.ts +81 -81
- package/src/custom/document-scanner/hooks/use-document-scanner.ts +80 -80
- package/src/custom/document-scanner/hooks/use-perspective-crop.ts +38 -38
- package/src/custom/document-scanner/index.tsx +255 -255
- package/src/custom/document-scanner/lib.ts +407 -407
- package/src/custom/document-scanner/types.ts +205 -205
- package/src/custom/document-scanner/utils/perspective-correction.ts +139 -139
- package/src/custom/document-viewer/controllers.tsx +98 -98
- package/src/custom/document-viewer/index.tsx +43 -43
- package/src/custom/document-viewer/renderers/image.tsx +37 -37
- package/src/custom/document-viewer/renderers/index.tsx +2 -2
- package/src/custom/document-viewer/renderers/pdf.tsx +105 -105
- package/src/custom/email-input/domains.json +159 -159
- package/src/custom/email-input/email.tsx +231 -229
- package/src/custom/email-input/index.tsx +4 -4
- package/src/custom/email-input/types.ts +104 -104
- package/src/custom/file-uploader.tsx +541 -541
- package/src/custom/filter-component/fields/async-select.tsx +33 -33
- package/src/custom/filter-component/fields/date.tsx +60 -60
- package/src/custom/filter-component/fields/multi-select.tsx +30 -30
- package/src/custom/filter-component/index.tsx +217 -217
- package/src/custom/image-canvas.tsx +260 -260
- package/src/custom/json-editor.tsx +22 -22
- package/src/custom/master-data-grid/components/dialogs/column-settings-dialog.tsx +100 -100
- package/src/custom/master-data-grid/components/dialogs/index.ts +1 -1
- package/src/custom/master-data-grid/components/filters/client-filter.tsx +369 -368
- package/src/custom/master-data-grid/components/filters/filter-input.tsx +256 -256
- package/src/custom/master-data-grid/components/filters/index.ts +3 -3
- package/src/custom/master-data-grid/components/filters/inline-column-filter.tsx +233 -233
- package/src/custom/master-data-grid/components/filters/multi-filter-dialog.tsx +91 -90
- package/src/custom/master-data-grid/components/filters/server-filter.tsx +265 -255
- package/src/custom/master-data-grid/components/master-data-grid.tsx +472 -472
- package/src/custom/master-data-grid/components/pagination/index.ts +1 -1
- package/src/custom/master-data-grid/components/pagination/pagination.tsx +178 -178
- package/src/custom/master-data-grid/components/table/cell-renderer.tsx +621 -634
- package/src/custom/master-data-grid/components/table/header-cell.tsx +162 -162
- package/src/custom/master-data-grid/components/table/index.ts +4 -4
- package/src/custom/master-data-grid/components/table/table-body-renderer.tsx +113 -113
- package/src/custom/master-data-grid/components/table/virtual-body.tsx +138 -138
- package/src/custom/master-data-grid/components/toolbar/index.ts +1 -1
- package/src/custom/master-data-grid/components/toolbar/toolbar.tsx +314 -314
- package/src/custom/master-data-grid/hooks/index.ts +3 -3
- package/src/custom/master-data-grid/hooks/use-columns.tsx +353 -332
- package/src/custom/master-data-grid/hooks/use-editing.ts +106 -106
- package/src/custom/master-data-grid/hooks/use-table-state-reducer.ts +157 -157
- package/src/custom/master-data-grid/hooks/use-table-state.ts +31 -31
- package/src/custom/master-data-grid/index.ts +16 -16
- package/src/custom/master-data-grid/types.ts +487 -466
- package/src/custom/master-data-grid/utils/column-generator.tsx +324 -306
- package/src/custom/master-data-grid/utils/export-utils.ts +67 -67
- package/src/custom/master-data-grid/utils/filter-fns.ts +310 -290
- package/src/custom/master-data-grid/utils/index.ts +8 -8
- package/src/custom/master-data-grid/utils/pinning-utils.ts +88 -88
- package/src/custom/master-data-grid/utils/translation-utils.ts +42 -42
- package/src/custom/multi-select.tsx +434 -432
- package/src/custom/password-input.tsx +194 -194
- package/src/custom/phone-input.tsx +172 -172
- package/src/custom/schema-form/custom/index.tsx +1 -1
- package/src/custom/schema-form/custom/label.tsx +53 -53
- package/src/custom/schema-form/fields/base-input-field.tsx +82 -82
- package/src/custom/schema-form/fields/field.tsx +67 -67
- package/src/custom/schema-form/fields/index.tsx +5 -5
- package/src/custom/schema-form/fields/object.tsx +12 -12
- package/src/custom/schema-form/fields/table-array/array-field-item.tsx +90 -90
- package/src/custom/schema-form/fields/table-array/array-field-template.tsx +115 -115
- package/src/custom/schema-form/index.tsx +259 -259
- package/src/custom/schema-form/templates/description.tsx +20 -20
- package/src/custom/schema-form/templates/index.tsx +2 -2
- package/src/custom/schema-form/templates/submit.tsx +32 -32
- package/src/custom/schema-form/types.ts +64 -64
- package/src/custom/schema-form/utils/index.ts +4 -4
- package/src/custom/schema-form/utils/schema-dependency.ts +655 -655
- package/src/custom/schema-form/utils/schemas.ts +289 -289
- package/src/custom/schema-form/utils/validation.ts +23 -23
- package/src/custom/schema-form/widgets/boolean.tsx +77 -77
- package/src/custom/schema-form/widgets/combobox.tsx +274 -274
- package/src/custom/schema-form/widgets/date.tsx +59 -59
- package/src/custom/schema-form/widgets/email.tsx +34 -34
- package/src/custom/schema-form/widgets/index.tsx +10 -10
- package/src/custom/schema-form/widgets/password.tsx +40 -40
- package/src/custom/schema-form/widgets/phone.tsx +40 -40
- package/src/custom/schema-form/widgets/select.tsx +105 -105
- package/src/custom/schema-form/widgets/selectable.tsx +25 -25
- package/src/custom/schema-form/widgets/string-array.tsx +296 -296
- package/src/custom/schema-form/widgets/url.tsx +56 -56
- package/src/custom/section-layout-v2.tsx +212 -212
- package/src/custom/select-tabs.tsx +109 -109
- package/src/custom/selectable.tsx +316 -316
- package/src/custom/stepper.tsx +236 -236
- package/src/custom/tab-layout.tsx +213 -213
- package/src/custom/tanstack-table/fields/index.tsx +12 -12
- package/src/custom/tanstack-table/fields/tanstack-table-action-dialogs.tsx +89 -89
- package/src/custom/tanstack-table/fields/tanstack-table-column-header.tsx +68 -66
- package/src/custom/tanstack-table/fields/tanstack-table-filter-date.tsx +180 -180
- package/src/custom/tanstack-table/fields/tanstack-table-filter-faceted.tsx +158 -158
- package/src/custom/tanstack-table/fields/tanstack-table-filter-text.tsx +73 -76
- package/src/custom/tanstack-table/fields/tanstack-table-pagination.tsx +136 -136
- package/src/custom/tanstack-table/fields/tanstack-table-plain-table.tsx +142 -142
- package/src/custom/tanstack-table/fields/tanstack-table-row-actions-confirmation.tsx +77 -77
- package/src/custom/tanstack-table/fields/tanstack-table-row-actions-custom-dialog.tsx +87 -87
- package/src/custom/tanstack-table/fields/tanstack-table-row-actions.tsx +151 -151
- package/src/custom/tanstack-table/fields/tanstack-table-table-actions-custom-dialog.tsx +88 -88
- package/src/custom/tanstack-table/fields/tanstack-table-table-actions-schemaform-dialog.tsx +47 -47
- package/src/custom/tanstack-table/fields/tanstack-table-toolbar.tsx +143 -143
- package/src/custom/tanstack-table/fields/tanstack-table-view-options.tsx +171 -171
- package/src/custom/tanstack-table/index.tsx +244 -244
- package/src/custom/tanstack-table/types/index.ts +328 -328
- package/src/custom/tanstack-table/utils/cell-with-actions.tsx +21 -21
- package/src/custom/tanstack-table/utils/column-names.ts +26 -26
- package/src/custom/tanstack-table/utils/columns-by-row-data.tsx +312 -312
- package/src/custom/tanstack-table/utils/editable-columns-by-row-data.tsx +219 -219
- package/src/custom/tanstack-table/utils/faceted-boolean-options.tsx +22 -22
- package/src/custom/tanstack-table/utils/index.tsx +10 -10
- package/src/custom/tanstack-table/utils/pinning-styles.ts +57 -57
- package/src/custom/tanstack-table/utils/table.tsx +83 -83
- package/src/custom/tanstack-table/utils/test-conditions.ts +17 -17
- package/src/custom/timeline.tsx +208 -208
- package/src/custom/tree.tsx +202 -200
- package/src/custom/tscanify/browser.ts +66 -66
- package/src/custom/tscanify/index.ts +51 -51
- package/src/custom/tscanify/tscanify-browser.ts +522 -522
- package/src/custom/tscanify/tscanify.ts +262 -262
- package/src/custom/tscanify/types.ts +22 -22
- package/src/custom/webcam.tsx +737 -737
- package/src/hooks/use-callback-ref.ts +27 -27
- package/src/hooks/use-controllable-state.ts +67 -67
- package/src/hooks/use-debounce.ts +19 -19
- package/src/hooks/use-is-visible.ts +23 -23
- package/src/hooks/use-media-query.ts +21 -21
- package/src/hooks/use-mobile.ts +21 -21
- package/src/hooks/use-on-window-resize.ts +15 -15
- package/src/hooks/use-scroll.tsx +22 -22
- package/src/lib/utils.ts +61 -61
- package/src/lib/zod.ts +2 -2
- package/src/styles/core.css +57 -57
- package/src/test/email-input.test.tsx +217 -217
- package/src/test/password-input.test.tsx +92 -92
- package/src/test/select-tabs.test.tsx +302 -302
- package/src/test/selectable.test.tsx +1093 -1093
- package/__mocks__/canvas.ts +0 -8
- package/components.json +0 -21
- package/eslint.config.js +0 -4
- package/jest-environment.js +0 -37
- package/jest.config.ts +0 -47
- package/jest.setup.ts +0 -69
- package/postcss.config.mjs +0 -6
- package/tsconfig.json +0 -13
- package/tsconfig.lint.json +0 -8
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
ChartContainer,
|
|
5
|
+
ChartLegend,
|
|
6
|
+
ChartLegendContent,
|
|
7
|
+
ChartTooltip,
|
|
8
|
+
ChartTooltipContent
|
|
9
|
+
} from "@repo/ayasofyazilim-ui/components/chart";
|
|
10
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
11
|
+
import {
|
|
12
|
+
Bar,
|
|
13
|
+
CartesianGrid,
|
|
14
|
+
BarChart as RechartsBarChart,
|
|
15
|
+
XAxis,
|
|
16
|
+
YAxis
|
|
17
|
+
} from "recharts";
|
|
18
|
+
import { ChartCard } from "./chart-card";
|
|
19
|
+
function BarChart({ layout = "vertical", ...props }) {
|
|
20
|
+
if (layout === "horizontal") {
|
|
21
|
+
return /* @__PURE__ */ jsx(HorizontalBarChart, { ...props });
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsx(VerticalBarChart, { ...props });
|
|
24
|
+
}
|
|
25
|
+
function HorizontalBarChart({
|
|
26
|
+
data,
|
|
27
|
+
config,
|
|
28
|
+
xAxisKey,
|
|
29
|
+
title,
|
|
30
|
+
description,
|
|
31
|
+
period,
|
|
32
|
+
footer,
|
|
33
|
+
trendText,
|
|
34
|
+
trendIcon,
|
|
35
|
+
xAxisTickFormatter = (value) => value,
|
|
36
|
+
yAxisTickFormatter = (value) => value,
|
|
37
|
+
classNames,
|
|
38
|
+
showLegend,
|
|
39
|
+
valuePrefix,
|
|
40
|
+
valueSuffix,
|
|
41
|
+
emptyState
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
ChartCard,
|
|
45
|
+
{
|
|
46
|
+
title,
|
|
47
|
+
description,
|
|
48
|
+
period,
|
|
49
|
+
footer,
|
|
50
|
+
trendText,
|
|
51
|
+
trendIcon,
|
|
52
|
+
classNames: classNames?.card,
|
|
53
|
+
emptyState: data.length === 0 ? emptyState : void 0,
|
|
54
|
+
children: /* @__PURE__ */ jsx(
|
|
55
|
+
ChartContainer,
|
|
56
|
+
{
|
|
57
|
+
config,
|
|
58
|
+
className: cn("mx-auto max-h-full", classNames?.chart?.container),
|
|
59
|
+
children: /* @__PURE__ */ jsxs(
|
|
60
|
+
RechartsBarChart,
|
|
61
|
+
{
|
|
62
|
+
accessibilityLayer: true,
|
|
63
|
+
data,
|
|
64
|
+
layout: "vertical",
|
|
65
|
+
className: cn("flex flex-col pb-2", classNames?.chart?.bar),
|
|
66
|
+
margin: { top: 0, bottom: 0, left: 0, right: 0 },
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
69
|
+
Object.keys(config).map((key) => /* @__PURE__ */ jsx(XAxis, { type: "number", dataKey: key }, key)),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
YAxis,
|
|
72
|
+
{
|
|
73
|
+
dataKey: xAxisKey,
|
|
74
|
+
type: "category",
|
|
75
|
+
tickLine: false,
|
|
76
|
+
tickMargin: 10,
|
|
77
|
+
axisLine: false,
|
|
78
|
+
tickFormatter: yAxisTickFormatter
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
ChartTooltip,
|
|
83
|
+
{
|
|
84
|
+
cursor: false,
|
|
85
|
+
content: /* @__PURE__ */ jsx(
|
|
86
|
+
ChartTooltipContent,
|
|
87
|
+
{
|
|
88
|
+
hideLabel: true,
|
|
89
|
+
valuePrefix,
|
|
90
|
+
valueSuffix
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
Object.keys(config).map((key) => /* @__PURE__ */ jsx(
|
|
96
|
+
Bar,
|
|
97
|
+
{
|
|
98
|
+
dataKey: key,
|
|
99
|
+
fill: config[key]?.color || "var(--chart-1)",
|
|
100
|
+
radius: 5
|
|
101
|
+
},
|
|
102
|
+
key
|
|
103
|
+
)),
|
|
104
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
105
|
+
ChartLegend,
|
|
106
|
+
{
|
|
107
|
+
wrapperStyle: {
|
|
108
|
+
position: "relative",
|
|
109
|
+
top: "unset",
|
|
110
|
+
left: "unset",
|
|
111
|
+
bottom: "unset",
|
|
112
|
+
right: "unset",
|
|
113
|
+
width: "100%",
|
|
114
|
+
textAlign: "center"
|
|
115
|
+
},
|
|
116
|
+
className: cn("p-0", classNames?.chart?.legend),
|
|
117
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent, {})
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function VerticalBarChart({
|
|
129
|
+
data,
|
|
130
|
+
config,
|
|
131
|
+
xAxisKey,
|
|
132
|
+
title,
|
|
133
|
+
description,
|
|
134
|
+
period,
|
|
135
|
+
footer,
|
|
136
|
+
trendText,
|
|
137
|
+
trendIcon,
|
|
138
|
+
xAxisTickFormatter = (value) => value,
|
|
139
|
+
classNames,
|
|
140
|
+
showLegend,
|
|
141
|
+
valuePrefix,
|
|
142
|
+
valueSuffix,
|
|
143
|
+
emptyState
|
|
144
|
+
}) {
|
|
145
|
+
return /* @__PURE__ */ jsx(
|
|
146
|
+
ChartCard,
|
|
147
|
+
{
|
|
148
|
+
title,
|
|
149
|
+
description,
|
|
150
|
+
period,
|
|
151
|
+
footer,
|
|
152
|
+
trendText,
|
|
153
|
+
trendIcon,
|
|
154
|
+
classNames: classNames?.card,
|
|
155
|
+
emptyState: data.length === 0 ? emptyState : void 0,
|
|
156
|
+
children: /* @__PURE__ */ jsx(
|
|
157
|
+
ChartContainer,
|
|
158
|
+
{
|
|
159
|
+
config,
|
|
160
|
+
className: cn("mx-auto max-h-full", classNames?.chart?.container),
|
|
161
|
+
children: /* @__PURE__ */ jsxs(
|
|
162
|
+
RechartsBarChart,
|
|
163
|
+
{
|
|
164
|
+
accessibilityLayer: true,
|
|
165
|
+
data,
|
|
166
|
+
layout: "horizontal",
|
|
167
|
+
className: cn("flex flex-col pb-2", classNames?.chart?.bar),
|
|
168
|
+
margin: { top: 0, bottom: 0, left: 0, right: 0 },
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
171
|
+
/* @__PURE__ */ jsx(
|
|
172
|
+
XAxis,
|
|
173
|
+
{
|
|
174
|
+
dataKey: xAxisKey,
|
|
175
|
+
tickLine: false,
|
|
176
|
+
axisLine: false,
|
|
177
|
+
tickMargin: 8,
|
|
178
|
+
minTickGap: 32,
|
|
179
|
+
tickFormatter: xAxisTickFormatter
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
ChartTooltip,
|
|
185
|
+
{
|
|
186
|
+
cursor: false,
|
|
187
|
+
content: /* @__PURE__ */ jsx(
|
|
188
|
+
ChartTooltipContent,
|
|
189
|
+
{
|
|
190
|
+
valuePrefix,
|
|
191
|
+
valueSuffix
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
Object.keys(config).map((key) => /* @__PURE__ */ jsx(
|
|
197
|
+
Bar,
|
|
198
|
+
{
|
|
199
|
+
dataKey: key,
|
|
200
|
+
fill: config[key]?.color || "var(--chart-1)",
|
|
201
|
+
radius: 0
|
|
202
|
+
},
|
|
203
|
+
key
|
|
204
|
+
)),
|
|
205
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
206
|
+
ChartLegend,
|
|
207
|
+
{
|
|
208
|
+
wrapperStyle: {
|
|
209
|
+
position: "relative",
|
|
210
|
+
top: "unset",
|
|
211
|
+
left: "unset",
|
|
212
|
+
bottom: "unset",
|
|
213
|
+
right: "unset",
|
|
214
|
+
width: "100%",
|
|
215
|
+
textAlign: "center"
|
|
216
|
+
},
|
|
217
|
+
className: cn("p-0", classNames?.chart?.legend),
|
|
218
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent, {})
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
export {
|
|
230
|
+
BarChart
|
|
231
|
+
};
|
|
232
|
+
//# sourceMappingURL=bar-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/custom/charts/bar-chart.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {\r\n ChartConfig,\r\n ChartContainer,\r\n ChartLegend,\r\n ChartLegendContent,\r\n ChartTooltip,\r\n ChartTooltipContent,\r\n} from \"@repo/ayasofyazilim-ui/components/chart\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport * as React from \"react\";\r\nimport {\r\n Bar,\r\n CartesianGrid,\r\n BarChart as RechartsBarChart,\r\n XAxis,\r\n YAxis,\r\n} from \"recharts\";\r\nimport { BaseAxisProps } from \"recharts/types/util/types\";\r\nimport { ChartData, EmptyConfig } from \".\";\r\nimport { CardClassNames, ChartCard } from \"./chart-card\";\r\n\r\nexport type BarChartProps = {\r\n data: ChartData;\r\n config: ChartConfig;\r\n xAxisKey: string;\r\n layout?: \"vertical\" | \"horizontal\";\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n period?: React.ReactNode;\r\n footer?: React.ReactNode;\r\n trendText?: React.ReactNode;\r\n showLegend?: boolean;\r\n trendIcon?: React.ReactNode;\r\n xAxisTickFormatter?: BaseAxisProps[\"tickFormatter\"];\r\n yAxisTickFormatter?: BaseAxisProps[\"tickFormatter\"];\r\n valuePrefix?: string;\r\n valueSuffix?: string;\r\n classNames?: {\r\n chart?: {\r\n container?: string;\r\n bar?: string;\r\n legend?: string;\r\n };\r\n card?: CardClassNames;\r\n };\r\n} & EmptyConfig;\r\n\r\nexport function BarChart({ layout = \"vertical\", ...props }: BarChartProps) {\r\n if (layout === \"horizontal\") {\r\n return <HorizontalBarChart {...props} />;\r\n }\r\n return <VerticalBarChart {...props} />;\r\n}\r\n\r\nfunction HorizontalBarChart({\r\n data,\r\n config,\r\n xAxisKey,\r\n title,\r\n description,\r\n period,\r\n footer,\r\n trendText,\r\n trendIcon,\r\n xAxisTickFormatter = (value) => value,\r\n yAxisTickFormatter = (value) => value,\r\n classNames,\r\n showLegend,\r\n valuePrefix,\r\n valueSuffix,\r\n emptyState,\r\n}: BarChartProps) {\r\n return (\r\n <ChartCard\r\n title={title}\r\n description={description}\r\n period={period}\r\n footer={footer}\r\n trendText={trendText}\r\n trendIcon={trendIcon}\r\n classNames={classNames?.card}\r\n emptyState={data.length === 0 ? emptyState : undefined}\r\n >\r\n <ChartContainer\r\n config={config}\r\n className={cn(\"mx-auto max-h-full\", classNames?.chart?.container)}\r\n >\r\n <RechartsBarChart\r\n accessibilityLayer\r\n data={data}\r\n layout=\"vertical\"\r\n className={cn(\"flex flex-col pb-2\", classNames?.chart?.bar)}\r\n margin={{ top: 0, bottom: 0, left: 0, right: 0 }}\r\n >\r\n <CartesianGrid vertical={false} />\r\n {Object.keys(config).map((key) => (\r\n <XAxis type=\"number\" dataKey={key} key={key} />\r\n ))}\r\n <YAxis\r\n dataKey={xAxisKey}\r\n type=\"category\"\r\n tickLine={false}\r\n tickMargin={10}\r\n axisLine={false}\r\n tickFormatter={yAxisTickFormatter}\r\n />\r\n <ChartTooltip\r\n cursor={false}\r\n content={\r\n <ChartTooltipContent\r\n hideLabel\r\n valuePrefix={valuePrefix}\r\n valueSuffix={valueSuffix}\r\n />\r\n }\r\n />\r\n {Object.keys(config).map((key) => (\r\n <Bar\r\n key={key}\r\n dataKey={key}\r\n fill={config[key]?.color || \"var(--chart-1)\"}\r\n radius={5}\r\n />\r\n ))}\r\n {showLegend && (\r\n <ChartLegend\r\n wrapperStyle={{\r\n position: \"relative\",\r\n top: \"unset\",\r\n left: \"unset\",\r\n bottom: \"unset\",\r\n right: \"unset\",\r\n width: \"100%\",\r\n textAlign: \"center\",\r\n }}\r\n className={cn(\"p-0\", classNames?.chart?.legend)}\r\n content={<ChartLegendContent />}\r\n />\r\n )}\r\n </RechartsBarChart>\r\n </ChartContainer>\r\n </ChartCard>\r\n );\r\n}\r\n\r\nfunction VerticalBarChart({\r\n data,\r\n config,\r\n xAxisKey,\r\n title,\r\n description,\r\n period,\r\n footer,\r\n trendText,\r\n trendIcon,\r\n xAxisTickFormatter = (value) => value,\r\n classNames,\r\n showLegend,\r\n valuePrefix,\r\n valueSuffix,\r\n emptyState,\r\n}: BarChartProps) {\r\n return (\r\n <ChartCard\r\n title={title}\r\n description={description}\r\n period={period}\r\n footer={footer}\r\n trendText={trendText}\r\n trendIcon={trendIcon}\r\n classNames={classNames?.card}\r\n emptyState={data.length === 0 ? emptyState : undefined}\r\n >\r\n <ChartContainer\r\n config={config}\r\n className={cn(\"mx-auto max-h-full\", classNames?.chart?.container)}\r\n >\r\n <RechartsBarChart\r\n accessibilityLayer\r\n data={data}\r\n layout=\"horizontal\"\r\n className={cn(\"flex flex-col pb-2\", classNames?.chart?.bar)}\r\n margin={{ top: 0, bottom: 0, left: 0, right: 0 }}\r\n >\r\n <CartesianGrid vertical={false} />\r\n <XAxis\r\n dataKey={xAxisKey}\r\n tickLine={false}\r\n axisLine={false}\r\n tickMargin={8}\r\n minTickGap={32}\r\n tickFormatter={xAxisTickFormatter}\r\n />\r\n <YAxis />\r\n <ChartTooltip\r\n cursor={false}\r\n content={\r\n <ChartTooltipContent\r\n valuePrefix={valuePrefix}\r\n valueSuffix={valueSuffix}\r\n />\r\n }\r\n />\r\n {Object.keys(config).map((key) => (\r\n <Bar\r\n key={key}\r\n dataKey={key}\r\n fill={config[key]?.color || \"var(--chart-1)\"}\r\n radius={0}\r\n />\r\n ))}\r\n {showLegend && (\r\n <ChartLegend\r\n wrapperStyle={{\r\n position: \"relative\",\r\n top: \"unset\",\r\n left: \"unset\",\r\n bottom: \"unset\",\r\n right: \"unset\",\r\n width: \"100%\",\r\n textAlign: \"center\",\r\n }}\r\n className={cn(\"p-0\", classNames?.chart?.legend)}\r\n content={<ChartLegendContent />}\r\n />\r\n )}\r\n </RechartsBarChart>\r\n </ChartContainer>\r\n </ChartCard>\r\n );\r\n}\r\n"],"mappings":";AAmDW,cAsCH,YAtCG;AAjDX;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AAEnB;A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/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardFooter,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle
|
|
9
|
+
} from "@repo/ayasofyazilim-ui/components/card";
|
|
10
|
+
import {
|
|
11
|
+
Empty,
|
|
12
|
+
EmptyDescription,
|
|
13
|
+
EmptyHeader,
|
|
14
|
+
EmptyMedia,
|
|
15
|
+
EmptyTitle
|
|
16
|
+
} from "@repo/ayasofyazilim-ui/components/empty";
|
|
17
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
18
|
+
function ChartCard({
|
|
19
|
+
title,
|
|
20
|
+
description,
|
|
21
|
+
period,
|
|
22
|
+
header,
|
|
23
|
+
footer,
|
|
24
|
+
trendText,
|
|
25
|
+
trendIcon,
|
|
26
|
+
children,
|
|
27
|
+
classNames,
|
|
28
|
+
emptyState
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsxs(Card, { className: cn(classNames?.container), children: [
|
|
31
|
+
/* @__PURE__ */ jsxs(
|
|
32
|
+
CardHeader,
|
|
33
|
+
{
|
|
34
|
+
className: cn("items-center pb-4! grid-rows-1", classNames?.header),
|
|
35
|
+
children: [
|
|
36
|
+
title && /* @__PURE__ */ jsx(CardTitle, { className: cn("my-auto", classNames?.title), children: title }),
|
|
37
|
+
period && /* @__PURE__ */ jsx(CardDescription, { className: cn(classNames?.description), children: period }),
|
|
38
|
+
description && /* @__PURE__ */ jsx(CardDescription, { className: cn(classNames?.description), children: description }),
|
|
39
|
+
header
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsxs(CardContent, { className: cn("pb-0 relative", classNames?.content), children: [
|
|
44
|
+
emptyState && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-white/50 z-2", children: /* @__PURE__ */ jsx(Empty, { children: /* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(EmptyMedia, { variant: "icon", children: emptyState.icon }),
|
|
46
|
+
/* @__PURE__ */ jsx(EmptyTitle, { children: emptyState.title }),
|
|
47
|
+
/* @__PURE__ */ jsx(EmptyDescription, { children: emptyState.description })
|
|
48
|
+
] }) }) }),
|
|
49
|
+
children
|
|
50
|
+
] }),
|
|
51
|
+
(trendText || trendIcon) && /* @__PURE__ */ jsxs(
|
|
52
|
+
CardFooter,
|
|
53
|
+
{
|
|
54
|
+
className: cn(
|
|
55
|
+
"flex items-center gap-2 leading-none font-medium",
|
|
56
|
+
classNames?.footer
|
|
57
|
+
),
|
|
58
|
+
children: [
|
|
59
|
+
trendText,
|
|
60
|
+
" ",
|
|
61
|
+
trendIcon
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
footer && /* @__PURE__ */ jsx(CardFooter, { className: cn(classNames?.footer), children: footer })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
ChartCard
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=chart-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/custom/charts/chart-card.tsx"],"sourcesContent":["import {\r\n Card,\r\n CardContent,\r\n CardDescription,\r\n CardFooter,\r\n CardHeader,\r\n CardTitle,\r\n} from \"@repo/ayasofyazilim-ui/components/card\";\r\nimport {\r\n Empty,\r\n EmptyDescription,\r\n EmptyHeader,\r\n EmptyMedia,\r\n EmptyTitle,\r\n} from \"@repo/ayasofyazilim-ui/components/empty\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport { ReactNode } from \"react\";\r\nimport { EmptyConfig } from \".\";\r\n\r\nexport type CardClassNames = {\r\n container?: string;\r\n header?: string;\r\n content?: string;\r\n title?: string;\r\n description?: string;\r\n footer?: string;\r\n isEmpty?: string;\r\n};\r\n\r\nexport function ChartCard({\r\n title,\r\n description,\r\n period,\r\n header,\r\n footer,\r\n trendText,\r\n trendIcon,\r\n children,\r\n classNames,\r\n emptyState,\r\n}: {\r\n title?: ReactNode;\r\n description?: ReactNode;\r\n period?: ReactNode;\r\n header?: ReactNode;\r\n footer?: ReactNode;\r\n trendText?: ReactNode;\r\n trendIcon?: ReactNode;\r\n children: ReactNode;\r\n classNames?: CardClassNames;\r\n} & Partial<EmptyConfig>) {\r\n return (\r\n <Card className={cn(classNames?.container)}>\r\n <CardHeader\r\n className={cn(\"items-center pb-4! grid-rows-1\", classNames?.header)}\r\n >\r\n {title && (\r\n <CardTitle className={cn(\"my-auto\", classNames?.title)}>\r\n {title}\r\n </CardTitle>\r\n )}\r\n {period && (\r\n <CardDescription className={cn(classNames?.description)}>\r\n {period}\r\n </CardDescription>\r\n )}\r\n {description && (\r\n <CardDescription className={cn(classNames?.description)}>\r\n {description}\r\n </CardDescription>\r\n )}\r\n {header}\r\n </CardHeader>\r\n <CardContent className={cn(\"pb-0 relative\", classNames?.content)}>\r\n {emptyState && (\r\n <div className=\"absolute inset-0 bg-white/50 z-2\">\r\n <Empty>\r\n <EmptyHeader>\r\n <EmptyMedia variant=\"icon\">{emptyState.icon}</EmptyMedia>\r\n <EmptyTitle>{emptyState.title}</EmptyTitle>\r\n <EmptyDescription>{emptyState.description}</EmptyDescription>\r\n </EmptyHeader>\r\n </Empty>\r\n </div>\r\n )}\r\n {children}\r\n </CardContent>\r\n {(trendText || trendIcon) && (\r\n <CardFooter\r\n className={cn(\r\n \"flex items-center gap-2 leading-none font-medium\",\r\n classNames?.footer\r\n )}\r\n >\r\n {trendText} {trendIcon}\r\n </CardFooter>\r\n )}\r\n {footer && (\r\n <CardFooter className={cn(classNames?.footer)}>{footer}</CardFooter>\r\n )}\r\n </Card>\r\n );\r\n}\r\n"],"mappings":"AAqDM,SAII,KAJJ;AArDN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK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":["export * from \"./pie-chart\";\r\nexport * from \"./area-chart\";\r\nexport * from \"./radar-chart\";\r\nexport * from \"./bar-chart\";\r\n\r\nexport type ChartData = Array<{\r\n [key: string]: number | string;\r\n}>;\r\n\r\nexport type EmptyConfig = {\r\n emptyState: {\r\n icon: React.ReactNode;\r\n title: string;\r\n description: string;\r\n };\r\n};\r\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Label, Pie, PieChart as RechartsPieChart } from "recharts";
|
|
4
|
+
import {
|
|
5
|
+
ChartContainer,
|
|
6
|
+
ChartLegend,
|
|
7
|
+
ChartLegendContent,
|
|
8
|
+
ChartTooltip,
|
|
9
|
+
ChartTooltipContent
|
|
10
|
+
} from "@repo/ayasofyazilim-ui/components/chart";
|
|
11
|
+
import { ChartCard } from "./chart-card";
|
|
12
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
13
|
+
function PieChart({
|
|
14
|
+
data,
|
|
15
|
+
config,
|
|
16
|
+
valueKey,
|
|
17
|
+
nameKey,
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
period,
|
|
21
|
+
trendText,
|
|
22
|
+
trendIcon,
|
|
23
|
+
footer,
|
|
24
|
+
totalLabel,
|
|
25
|
+
chartStyle,
|
|
26
|
+
classNames,
|
|
27
|
+
innerRadius,
|
|
28
|
+
strokeWidth,
|
|
29
|
+
valuePrefix,
|
|
30
|
+
valueSuffix,
|
|
31
|
+
showLegend = true,
|
|
32
|
+
emptyState
|
|
33
|
+
}) {
|
|
34
|
+
const totalCount = useMemo(
|
|
35
|
+
() => data.reduce((acc, curr) => acc + (Number(curr[valueKey]) || 0), 0),
|
|
36
|
+
[data, valueKey]
|
|
37
|
+
);
|
|
38
|
+
const renderLabelContent = ({
|
|
39
|
+
viewBox
|
|
40
|
+
}) => {
|
|
41
|
+
if (viewBox && "cx" in viewBox && "cy" in viewBox) {
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
"text",
|
|
44
|
+
{
|
|
45
|
+
x: viewBox.cx,
|
|
46
|
+
y: viewBox.cy,
|
|
47
|
+
textAnchor: "middle",
|
|
48
|
+
dominantBaseline: "middle",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsxs(
|
|
51
|
+
"tspan",
|
|
52
|
+
{
|
|
53
|
+
x: viewBox.cx,
|
|
54
|
+
y: viewBox.cy,
|
|
55
|
+
className: "fill-foreground text-3xl font-bold",
|
|
56
|
+
children: [
|
|
57
|
+
valuePrefix,
|
|
58
|
+
" ",
|
|
59
|
+
totalCount.toLocaleString(),
|
|
60
|
+
" ",
|
|
61
|
+
valueSuffix
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
"tspan",
|
|
67
|
+
{
|
|
68
|
+
x: viewBox.cx,
|
|
69
|
+
y: (viewBox.cy || 0) + 24,
|
|
70
|
+
className: "fill-muted-foreground",
|
|
71
|
+
children: totalLabel
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
ChartCard,
|
|
82
|
+
{
|
|
83
|
+
title,
|
|
84
|
+
description,
|
|
85
|
+
period,
|
|
86
|
+
footer,
|
|
87
|
+
trendText,
|
|
88
|
+
trendIcon,
|
|
89
|
+
classNames: classNames?.card,
|
|
90
|
+
emptyState: data.length === 0 ? emptyState : void 0,
|
|
91
|
+
children: /* @__PURE__ */ jsx(
|
|
92
|
+
ChartContainer,
|
|
93
|
+
{
|
|
94
|
+
config,
|
|
95
|
+
className: cn("max-h-[300px]", classNames?.chart?.container),
|
|
96
|
+
children: /* @__PURE__ */ jsxs(RechartsPieChart, { className: cn("relative", classNames?.chart?.pie), children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
ChartTooltip,
|
|
99
|
+
{
|
|
100
|
+
cursor: false,
|
|
101
|
+
content: /* @__PURE__ */ jsx(
|
|
102
|
+
ChartTooltipContent,
|
|
103
|
+
{
|
|
104
|
+
valuePrefix,
|
|
105
|
+
valueSuffix
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ jsx(
|
|
111
|
+
Pie,
|
|
112
|
+
{
|
|
113
|
+
data: data.map((item, index) => ({
|
|
114
|
+
...item,
|
|
115
|
+
fill: config[String(item[nameKey])]?.color || `var(--chart-${index + 1})`
|
|
116
|
+
})),
|
|
117
|
+
className: "fixed",
|
|
118
|
+
dataKey: valueKey,
|
|
119
|
+
nameKey,
|
|
120
|
+
innerRadius: innerRadius || (chartStyle === "donut" ? 60 : 0),
|
|
121
|
+
strokeWidth: strokeWidth || (chartStyle === "donut" ? 0 : void 0),
|
|
122
|
+
children: /* @__PURE__ */ jsx(Label, { content: renderLabelContent })
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
126
|
+
ChartLegend,
|
|
127
|
+
{
|
|
128
|
+
wrapperStyle: {
|
|
129
|
+
width: "100%",
|
|
130
|
+
height: 0,
|
|
131
|
+
bottom: 0
|
|
132
|
+
},
|
|
133
|
+
content: /* @__PURE__ */ jsx(
|
|
134
|
+
ChartLegendContent,
|
|
135
|
+
{
|
|
136
|
+
className: cn(
|
|
137
|
+
"flex-col absolute size-full inset-0 items-start justify-end w-full text-nowrap gap-1 p-0",
|
|
138
|
+
classNames?.chart?.legend
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] })
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
export {
|
|
151
|
+
PieChart
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=pie-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/custom/charts/pie-chart.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport { useMemo } from \"react\";\r\nimport { Label, LabelProps, Pie, PieChart as RechartsPieChart } from \"recharts\";\r\nimport {\r\n ChartConfig,\r\n ChartContainer,\r\n ChartLegend,\r\n ChartLegendContent,\r\n ChartTooltip,\r\n ChartTooltipContent,\r\n} from \"@repo/ayasofyazilim-ui/components/chart\";\r\nimport { CardClassNames, ChartCard } from \"./chart-card\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport { ChartData, EmptyConfig } from \".\";\r\n\r\nexport type PieChartProps = {\r\n data: ChartData;\r\n config: ChartConfig;\r\n valueKey: string;\r\n nameKey: string;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n period?: React.ReactNode;\r\n trendText?: React.ReactNode;\r\n trendIcon?: React.ReactNode;\r\n footer?: React.ReactNode;\r\n totalLabel?: string;\r\n chartStyle: \"donut\" | \"pie\";\r\n innerRadius?: number;\r\n strokeWidth?: number;\r\n valuePrefix?: string;\r\n valueSuffix?: string;\r\n showLegend?: boolean;\r\n classNames?: {\r\n chart?: {\r\n container?: string;\r\n tooltip?: string;\r\n legend?: string;\r\n pie?: string;\r\n };\r\n card?: CardClassNames;\r\n };\r\n} & EmptyConfig;\r\n\r\nexport function PieChart({\r\n data,\r\n config,\r\n valueKey,\r\n nameKey,\r\n title,\r\n description,\r\n period,\r\n trendText,\r\n trendIcon,\r\n footer,\r\n totalLabel,\r\n chartStyle,\r\n classNames,\r\n innerRadius,\r\n strokeWidth,\r\n valuePrefix,\r\n valueSuffix,\r\n showLegend = true,\r\n emptyState,\r\n}: PieChartProps) {\r\n const totalCount = useMemo(\r\n () => data.reduce((acc, curr) => acc + (Number(curr[valueKey]) || 0), 0),\r\n [data, valueKey]\r\n );\r\n\r\n // Transform data to ChartConfig shape for ChartContainer\r\n const renderLabelContent = ({\r\n viewBox,\r\n }: {\r\n viewBox?: LabelProps[\"viewBox\"] | null;\r\n }) => {\r\n if (viewBox && \"cx\" in viewBox && \"cy\" in viewBox) {\r\n return (\r\n <text\r\n x={viewBox.cx}\r\n y={viewBox.cy}\r\n textAnchor=\"middle\"\r\n dominantBaseline=\"middle\"\r\n >\r\n <tspan\r\n x={viewBox.cx}\r\n y={viewBox.cy}\r\n className=\"fill-foreground text-3xl font-bold\"\r\n >\r\n {valuePrefix} {totalCount.toLocaleString()} {valueSuffix}\r\n </tspan>\r\n <tspan\r\n x={viewBox.cx}\r\n y={(viewBox.cy || 0) + 24}\r\n className=\"fill-muted-foreground\"\r\n >\r\n {totalLabel}\r\n </tspan>\r\n </text>\r\n );\r\n }\r\n return null;\r\n };\r\n\r\n return (\r\n <ChartCard\r\n title={title}\r\n description={description}\r\n period={period}\r\n footer={footer}\r\n trendText={trendText}\r\n trendIcon={trendIcon}\r\n classNames={classNames?.card}\r\n emptyState={data.length === 0 ? emptyState : undefined}\r\n >\r\n <ChartContainer\r\n config={config}\r\n className={cn(\"max-h-[300px]\", classNames?.chart?.container)}\r\n >\r\n <RechartsPieChart className={cn(\"relative\", classNames?.chart?.pie)}>\r\n <ChartTooltip\r\n cursor={false}\r\n content={\r\n <ChartTooltipContent\r\n valuePrefix={valuePrefix}\r\n valueSuffix={valueSuffix}\r\n />\r\n }\r\n />\r\n <Pie\r\n data={data.map((item, index) => ({\r\n ...item,\r\n fill:\r\n config[String(item[nameKey])]?.color ||\r\n `var(--chart-${index + 1})`,\r\n }))}\r\n className=\"fixed\"\r\n dataKey={valueKey}\r\n nameKey={nameKey}\r\n innerRadius={innerRadius || (chartStyle === \"donut\" ? 60 : 0)}\r\n strokeWidth={\r\n strokeWidth || (chartStyle === \"donut\" ? 0 : undefined)\r\n }\r\n >\r\n <Label content={renderLabelContent} />\r\n </Pie>\r\n {showLegend && (\r\n <ChartLegend\r\n wrapperStyle={{\r\n width: \"100%\",\r\n height: 0,\r\n bottom: 0,\r\n }}\r\n content={\r\n <ChartLegendContent\r\n className={cn(\r\n \"flex-col absolute size-full inset-0 items-start justify-end w-full text-nowrap gap-1 p-0\",\r\n classNames?.chart?.legend\r\n )}\r\n />\r\n }\r\n />\r\n )}\r\n </RechartsPieChart>\r\n </ChartContainer>\r\n </ChartCard>\r\n );\r\n}\r\n"],"mappings":"AAoFU,SAOA,KAPA;AAnFV,SAAS,eAAe;AACxB,SAAS,OAAmB,KAAK,YAAY,wBAAwB;AACrE;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAyB,iBAAiB;AAC1C,SAAS,UAAU;AAgCZ,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AACF,GAAkB;AAChB,QAAM,aAAa;AAAA,IACjB,MAAM,KAAK,OAAO,CAAC,KAAK,SAAS,OAAO,OAAO,KAAK,QAAQ,CAAC,KAAK,IAAI,CAAC;AAAA,IACvE,CAAC,MAAM,QAAQ;AAAA,EACjB;AAGA,QAAM,qBAAqB,CAAC;AAAA,IAC1B;AAAA,EACF,MAEM;AACJ,QAAI,WAAW,QAAQ,WAAW,QAAQ,SAAS;AACjD,aACE;AAAA,QAAC;AAAA;AAAA,UACC,GAAG,QAAQ;AAAA,UACX,GAAG,QAAQ;AAAA,UACX,YAAW;AAAA,UACX,kBAAiB;AAAA,UAEjB;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,GAAG,QAAQ;AAAA,gBAC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AAA;AAAA,gBACC,cAAc;AAAA,kBACZ,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,QAAQ;AAAA,gBACV;AAAA,gBACA,SACE;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW;AAAA,sBACT;AAAA,sBACA,YAAY,OAAO;AAAA,oBACrB;AAAA;AAAA,gBACF;AAAA;AAAA,YAEJ;AAAA,aAEJ;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
PolarAngleAxis,
|
|
5
|
+
PolarGrid,
|
|
6
|
+
Radar,
|
|
7
|
+
RadarChart as RechartsRadarChart
|
|
8
|
+
} from "recharts";
|
|
9
|
+
import {
|
|
10
|
+
ChartContainer,
|
|
11
|
+
ChartLegend,
|
|
12
|
+
ChartLegendContent,
|
|
13
|
+
ChartTooltip,
|
|
14
|
+
ChartTooltipContent
|
|
15
|
+
} from "@repo/ayasofyazilim-ui/components/chart";
|
|
16
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
17
|
+
import { ChartCard } from "./chart-card";
|
|
18
|
+
function RadarChart({
|
|
19
|
+
data,
|
|
20
|
+
config,
|
|
21
|
+
polarKey,
|
|
22
|
+
title,
|
|
23
|
+
description,
|
|
24
|
+
period,
|
|
25
|
+
footer,
|
|
26
|
+
trendText,
|
|
27
|
+
trendIcon,
|
|
28
|
+
showLegend = true,
|
|
29
|
+
linesOnly = false,
|
|
30
|
+
classNames,
|
|
31
|
+
valuePrefix,
|
|
32
|
+
valueSuffix,
|
|
33
|
+
emptyState
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
ChartCard,
|
|
37
|
+
{
|
|
38
|
+
title,
|
|
39
|
+
description,
|
|
40
|
+
period,
|
|
41
|
+
footer,
|
|
42
|
+
trendText,
|
|
43
|
+
trendIcon,
|
|
44
|
+
classNames: classNames?.card,
|
|
45
|
+
emptyState: data.length === 0 ? emptyState : void 0,
|
|
46
|
+
children: /* @__PURE__ */ jsx(
|
|
47
|
+
ChartContainer,
|
|
48
|
+
{
|
|
49
|
+
config,
|
|
50
|
+
className: cn("mx-auto max-h-full", classNames?.chart?.container),
|
|
51
|
+
children: /* @__PURE__ */ jsxs(
|
|
52
|
+
RechartsRadarChart,
|
|
53
|
+
{
|
|
54
|
+
data,
|
|
55
|
+
className: cn("flex flex-col pb-2", classNames?.chart?.radar),
|
|
56
|
+
margin: { top: 0, bottom: 0, left: 0, right: 0 },
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
ChartTooltip,
|
|
60
|
+
{
|
|
61
|
+
cursor: false,
|
|
62
|
+
content: /* @__PURE__ */ jsx(
|
|
63
|
+
ChartTooltipContent,
|
|
64
|
+
{
|
|
65
|
+
indicator: "line",
|
|
66
|
+
valuePrefix,
|
|
67
|
+
valueSuffix
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(PolarAngleAxis, { dataKey: polarKey }),
|
|
73
|
+
/* @__PURE__ */ jsx(PolarGrid, { radialLines: !linesOnly }),
|
|
74
|
+
Object.keys(config).map((key, idx) => /* @__PURE__ */ jsx(
|
|
75
|
+
Radar,
|
|
76
|
+
{
|
|
77
|
+
dataKey: key,
|
|
78
|
+
fill: config[key]?.color || `var(--color-${idx})`,
|
|
79
|
+
fillOpacity: linesOnly ? 0 : idx === 0 ? 0.6 : 0.4,
|
|
80
|
+
stroke: config[key]?.color || `var(--color-${idx})`,
|
|
81
|
+
strokeWidth: linesOnly ? 2 : 1
|
|
82
|
+
},
|
|
83
|
+
key
|
|
84
|
+
)),
|
|
85
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
86
|
+
ChartLegend,
|
|
87
|
+
{
|
|
88
|
+
wrapperStyle: {
|
|
89
|
+
position: "relative",
|
|
90
|
+
top: "unset",
|
|
91
|
+
left: "unset",
|
|
92
|
+
bottom: "unset",
|
|
93
|
+
right: "unset",
|
|
94
|
+
width: "100%",
|
|
95
|
+
textAlign: "center"
|
|
96
|
+
},
|
|
97
|
+
className: cn("p-0", classNames?.chart?.legend),
|
|
98
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent, {})
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
RadarChart
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=radar-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/custom/charts/radar-chart.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport {\r\n PolarAngleAxis,\r\n PolarGrid,\r\n Radar,\r\n RadarChart as RechartsRadarChart,\r\n} from \"recharts\";\r\n\r\nimport {\r\n ChartConfig,\r\n ChartContainer,\r\n ChartLegend,\r\n ChartLegendContent,\r\n ChartTooltip,\r\n ChartTooltipContent,\r\n} from \"@repo/ayasofyazilim-ui/components/chart\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport { ChartCard, CardClassNames } from \"./chart-card\";\r\nimport { ChartData, EmptyConfig } from \".\";\r\n\r\nexport type RadarChartProps = {\r\n data: ChartData;\r\n config: ChartConfig;\r\n polarKey: string;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n period?: React.ReactNode;\r\n footer?: React.ReactNode;\r\n trendText?: React.ReactNode;\r\n trendIcon?: React.ReactNode;\r\n showLegend?: boolean;\r\n linesOnly?: boolean;\r\n valuePrefix?: string;\r\n valueSuffix?: string;\r\n classNames?: {\r\n chart?: {\r\n container?: string;\r\n tooltip?: string;\r\n legend?: string;\r\n radar?: string;\r\n };\r\n card?: CardClassNames;\r\n };\r\n} & EmptyConfig;\r\n\r\nexport function RadarChart({\r\n data,\r\n config,\r\n polarKey,\r\n title,\r\n description,\r\n period,\r\n footer,\r\n trendText,\r\n trendIcon,\r\n showLegend = true,\r\n linesOnly = false,\r\n classNames,\r\n valuePrefix,\r\n valueSuffix,\r\n emptyState,\r\n}: RadarChartProps) {\r\n return (\r\n <ChartCard\r\n title={title}\r\n description={description}\r\n period={period}\r\n footer={footer}\r\n trendText={trendText}\r\n trendIcon={trendIcon}\r\n classNames={classNames?.card}\r\n emptyState={data.length === 0 ? emptyState : undefined}\r\n >\r\n <ChartContainer\r\n config={config}\r\n className={cn(\"mx-auto max-h-full\", classNames?.chart?.container)}\r\n >\r\n <RechartsRadarChart\r\n data={data}\r\n className={cn(\"flex flex-col pb-2\", classNames?.chart?.radar)}\r\n margin={{ top: 0, bottom: 0, left: 0, right: 0 }}\r\n >\r\n <ChartTooltip\r\n cursor={false}\r\n content={\r\n <ChartTooltipContent\r\n indicator=\"line\"\r\n valuePrefix={valuePrefix}\r\n valueSuffix={valueSuffix}\r\n />\r\n }\r\n />\r\n <PolarAngleAxis dataKey={polarKey} />\r\n <PolarGrid radialLines={!linesOnly} />\r\n {Object.keys(config).map((key, idx) => (\r\n <Radar\r\n key={key}\r\n dataKey={key}\r\n fill={config[key]?.color || `var(--color-${idx})`}\r\n fillOpacity={linesOnly ? 0 : idx === 0 ? 0.6 : 0.4}\r\n stroke={config[key]?.color || `var(--color-${idx})`}\r\n strokeWidth={linesOnly ? 2 : 1}\r\n />\r\n ))}\r\n {showLegend && (\r\n <ChartLegend\r\n wrapperStyle={{\r\n position: \"relative\",\r\n top: \"unset\",\r\n left: \"unset\",\r\n bottom: \"unset\",\r\n right: \"unset\",\r\n width: \"100%\",\r\n textAlign: \"center\",\r\n }}\r\n className={cn(\"p-0\", classNames?.chart?.legend)}\r\n content={<ChartLegendContent />}\r\n />\r\n )}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