@ayasofyazilim/ui 0.0.0 → 0.0.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/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 +68 -68
- package/src/components/calendar.tsx +219 -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 +130 -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 +291 -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 +48 -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 +229 -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 +368 -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 +90 -90
- package/src/custom/master-data-grid/components/filters/server-filter.tsx +264 -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 +486 -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 +432 -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 +66 -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 +76 -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 +200 -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,249 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronDown, XCircle, XIcon } from "lucide-react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Badge } from "@repo/ayasofyazilim-ui/components/badge";
|
|
6
|
+
import { Button } from "@repo/ayasofyazilim-ui/components/button";
|
|
7
|
+
import {
|
|
8
|
+
Command as Cmd,
|
|
9
|
+
CommandGroup,
|
|
10
|
+
CommandInput,
|
|
11
|
+
CommandItem,
|
|
12
|
+
CommandList
|
|
13
|
+
} from "@repo/ayasofyazilim-ui/components/command";
|
|
14
|
+
import {
|
|
15
|
+
Popover,
|
|
16
|
+
PopoverContent,
|
|
17
|
+
PopoverTrigger
|
|
18
|
+
} from "@repo/ayasofyazilim-ui/components/popover";
|
|
19
|
+
import { Separator } from "@repo/ayasofyazilim-ui/components/separator";
|
|
20
|
+
import { Skeleton } from "@repo/ayasofyazilim-ui/components/skeleton";
|
|
21
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
22
|
+
import { useDebounce } from "../hooks/use-debounce";
|
|
23
|
+
function CommandGroupItem({
|
|
24
|
+
items,
|
|
25
|
+
id,
|
|
26
|
+
title,
|
|
27
|
+
onChange,
|
|
28
|
+
value,
|
|
29
|
+
multiple
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsx(CommandGroup, { heading: title, children: items?.map((currentItem, index) => /* @__PURE__ */ jsxs(
|
|
32
|
+
CommandItem,
|
|
33
|
+
{
|
|
34
|
+
id: `${id}_${index}`,
|
|
35
|
+
onSelect: () => {
|
|
36
|
+
if (value.find((i) => i.id === currentItem.id)) {
|
|
37
|
+
return onChange(value.filter((i) => i.id !== currentItem.id));
|
|
38
|
+
}
|
|
39
|
+
if (multiple) {
|
|
40
|
+
return onChange([...value, currentItem]);
|
|
41
|
+
}
|
|
42
|
+
return onChange([currentItem]);
|
|
43
|
+
},
|
|
44
|
+
value: `${currentItem.id}__${currentItem.name}`,
|
|
45
|
+
children: [
|
|
46
|
+
currentItem.name,
|
|
47
|
+
value.find((i) => i.id === currentItem.id) && /* @__PURE__ */ jsx(CheckIcon, { className: cn("ml-auto h-4 w-4") })
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
currentItem.id
|
|
51
|
+
)) });
|
|
52
|
+
}
|
|
53
|
+
function AsyncSelectBase({
|
|
54
|
+
suggestions = [],
|
|
55
|
+
data,
|
|
56
|
+
value,
|
|
57
|
+
fetchAction,
|
|
58
|
+
onChange,
|
|
59
|
+
resultText = "Results",
|
|
60
|
+
searchText = "Search",
|
|
61
|
+
noResultText = "No result",
|
|
62
|
+
disabled = false,
|
|
63
|
+
multiple = true,
|
|
64
|
+
closeOnSelect = false,
|
|
65
|
+
id,
|
|
66
|
+
setIsPopoverOpen
|
|
67
|
+
}) {
|
|
68
|
+
const [loading, setLoading] = useState(false);
|
|
69
|
+
const [searchInput, setSearchInput] = useState("");
|
|
70
|
+
const searchValue = useDebounce(searchInput, 500);
|
|
71
|
+
const [items, setItems] = useState(data || []);
|
|
72
|
+
const showableItems = items.filter(
|
|
73
|
+
(item) => !value.find((i) => i.id === item.id)
|
|
74
|
+
);
|
|
75
|
+
const showableSuggestions = suggestions.filter(
|
|
76
|
+
(item) => !value.find((i) => i.id === item.id)
|
|
77
|
+
);
|
|
78
|
+
function onSearch(search) {
|
|
79
|
+
setSearchInput(search);
|
|
80
|
+
setLoading(true);
|
|
81
|
+
setItems([]);
|
|
82
|
+
}
|
|
83
|
+
function handleOnChange(value2) {
|
|
84
|
+
if (disabled) return;
|
|
85
|
+
onChange(value2);
|
|
86
|
+
}
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (searchValue === "" && searchInput === "") {
|
|
89
|
+
setLoading(true);
|
|
90
|
+
fetchAction("").then((res) => {
|
|
91
|
+
setItems(res);
|
|
92
|
+
setLoading(false);
|
|
93
|
+
});
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (searchValue !== searchInput) return;
|
|
97
|
+
fetchAction(searchValue).then((res) => {
|
|
98
|
+
setItems(res);
|
|
99
|
+
setLoading(false);
|
|
100
|
+
});
|
|
101
|
+
}, [searchValue, searchInput, fetchAction]);
|
|
102
|
+
return /* @__PURE__ */ jsxs(Cmd, { "aria-disabled": disabled, children: [
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
CommandInput,
|
|
105
|
+
{
|
|
106
|
+
id: `${id}_input`,
|
|
107
|
+
"data-testid": `${id}_input`,
|
|
108
|
+
placeholder: searchText,
|
|
109
|
+
onValueChange: (search) => onSearch(search),
|
|
110
|
+
disabled
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ jsxs(CommandList, { className: "overflow-y-auto max-h-48", children: [
|
|
114
|
+
loading && /* @__PURE__ */ jsx("div", { className: "p-1 text-sm", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-full mb-1" }) }),
|
|
115
|
+
!loading && items.length === 0 && searchValue.length > 0 && /* @__PURE__ */ jsx("div", { className: "text-sm p-2", children: noResultText }),
|
|
116
|
+
value.length > 0 && /* @__PURE__ */ jsx(
|
|
117
|
+
CommandGroupItem,
|
|
118
|
+
{
|
|
119
|
+
items: value,
|
|
120
|
+
id: `${id}_selected`,
|
|
121
|
+
"data-testid": `${id}_selected`,
|
|
122
|
+
value,
|
|
123
|
+
title: "Selected",
|
|
124
|
+
onChange: (value2) => {
|
|
125
|
+
handleOnChange(value2);
|
|
126
|
+
if (closeOnSelect) setIsPopoverOpen(false);
|
|
127
|
+
},
|
|
128
|
+
multiple
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
!loading && searchValue.length === 0 && showableSuggestions?.length > 0 && /* @__PURE__ */ jsx(
|
|
132
|
+
CommandGroupItem,
|
|
133
|
+
{
|
|
134
|
+
id: `${id}_item`,
|
|
135
|
+
items: showableSuggestions,
|
|
136
|
+
value,
|
|
137
|
+
title: "Suggestions",
|
|
138
|
+
onChange: (value2) => {
|
|
139
|
+
handleOnChange(value2);
|
|
140
|
+
if (closeOnSelect) setIsPopoverOpen(false);
|
|
141
|
+
},
|
|
142
|
+
multiple
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
!loading && showableItems.length > 0 && /* @__PURE__ */ jsx(
|
|
146
|
+
CommandGroupItem,
|
|
147
|
+
{
|
|
148
|
+
id: `${id}_item`,
|
|
149
|
+
items: showableItems,
|
|
150
|
+
value,
|
|
151
|
+
title: resultText,
|
|
152
|
+
onChange: (value2) => {
|
|
153
|
+
handleOnChange(value2);
|
|
154
|
+
if (closeOnSelect) setIsPopoverOpen(false);
|
|
155
|
+
},
|
|
156
|
+
multiple
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] })
|
|
160
|
+
] });
|
|
161
|
+
}
|
|
162
|
+
function AsyncSelect(props) {
|
|
163
|
+
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
164
|
+
return /* @__PURE__ */ jsxs(Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, children: [
|
|
165
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, className: "w-full", children: /* @__PURE__ */ jsx(
|
|
166
|
+
Button,
|
|
167
|
+
{
|
|
168
|
+
id: props.id,
|
|
169
|
+
"data-testid": props.id,
|
|
170
|
+
disabled: props.disabled,
|
|
171
|
+
type: "button",
|
|
172
|
+
onClick: () => setIsPopoverOpen(true),
|
|
173
|
+
className: cn(
|
|
174
|
+
"flex w-full p-1 rounded-md border items-center justify-between bg-inherit hover:bg-inherit",
|
|
175
|
+
props.classNames?.trigger
|
|
176
|
+
),
|
|
177
|
+
children: props.value.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center w-full", children: [
|
|
178
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center", children: [
|
|
179
|
+
props.value.slice(0, 3).map((value) => /* @__PURE__ */ jsxs(
|
|
180
|
+
Badge,
|
|
181
|
+
{
|
|
182
|
+
"data-testid": `${props.id}_badge_${value.name}`,
|
|
183
|
+
className: "m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 border-foreground/10 text-foreground bg-card hover:bg-card/80",
|
|
184
|
+
onClick: () => {
|
|
185
|
+
props.onChange(
|
|
186
|
+
props.value.filter((i) => i.id !== value.id)
|
|
187
|
+
);
|
|
188
|
+
},
|
|
189
|
+
children: [
|
|
190
|
+
value.name,
|
|
191
|
+
/* @__PURE__ */ jsx(XCircle, { className: "ml-2 h-4 w-4 cursor-pointer" })
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
value.id
|
|
195
|
+
)),
|
|
196
|
+
props.value.length > 3 && /* @__PURE__ */ jsxs(
|
|
197
|
+
Badge,
|
|
198
|
+
{
|
|
199
|
+
className: cn(
|
|
200
|
+
"bg-transparent text-foreground border-foreground/1 hover:bg-transparent"
|
|
201
|
+
),
|
|
202
|
+
children: [
|
|
203
|
+
props.value.length - 3,
|
|
204
|
+
" more"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
] }),
|
|
209
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
210
|
+
/* @__PURE__ */ jsx(
|
|
211
|
+
XIcon,
|
|
212
|
+
{
|
|
213
|
+
className: "h-4 mx-2 cursor-pointer text-muted-foreground",
|
|
214
|
+
onClick: () => {
|
|
215
|
+
props.onChange([]);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsx(
|
|
220
|
+
Separator,
|
|
221
|
+
{
|
|
222
|
+
orientation: "vertical",
|
|
223
|
+
className: "flex min-h-6 h-full"
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 mx-2 cursor-pointer text-muted-foreground" })
|
|
227
|
+
] })
|
|
228
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full mx-auto", children: [
|
|
229
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-black mx-3 font-normal", children: props.searchText }),
|
|
230
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 cursor-pointer text-muted-foreground mx-2" })
|
|
231
|
+
] })
|
|
232
|
+
}
|
|
233
|
+
) }),
|
|
234
|
+
/* @__PURE__ */ jsx(
|
|
235
|
+
PopoverContent,
|
|
236
|
+
{
|
|
237
|
+
className: "p-0",
|
|
238
|
+
align: "start",
|
|
239
|
+
onEscapeKeyDown: () => setIsPopoverOpen(false),
|
|
240
|
+
children: /* @__PURE__ */ jsx(AsyncSelectBase, { ...props, setIsPopoverOpen })
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
] });
|
|
244
|
+
}
|
|
245
|
+
export {
|
|
246
|
+
AsyncSelectBase,
|
|
247
|
+
AsyncSelect as default
|
|
248
|
+
};
|
|
249
|
+
//# sourceMappingURL=async-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/custom/async-select.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { CheckIcon, ChevronDown, XCircle, XIcon } from \"lucide-react\";\r\nimport { Dispatch, SetStateAction, useEffect, useState } from \"react\";\r\nimport { Badge } from \"@repo/ayasofyazilim-ui/components/badge\";\r\nimport { Button } from \"@repo/ayasofyazilim-ui/components/button\";\r\nimport {\r\n Command as Cmd,\r\n CommandGroup,\r\n CommandInput,\r\n CommandItem,\r\n CommandList,\r\n} from \"@repo/ayasofyazilim-ui/components/command\";\r\nimport {\r\n Popover,\r\n PopoverContent,\r\n PopoverTrigger,\r\n} from \"@repo/ayasofyazilim-ui/components/popover\";\r\nimport { Separator } from \"@repo/ayasofyazilim-ui/components/separator\";\r\nimport { Skeleton } from \"@repo/ayasofyazilim-ui/components/skeleton\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport { useDebounce } from \"../hooks/use-debounce\";\r\n\r\ntype SearchItem = { id: string; name: string };\r\n\r\nfunction CommandGroupItem({\r\n items,\r\n id,\r\n title,\r\n onChange,\r\n value,\r\n multiple,\r\n}: {\r\n title: string;\r\n id: string;\r\n items: SearchItem[];\r\n value: SearchItem[];\r\n onChange: (value: SearchItem[]) => void;\r\n multiple: boolean;\r\n}) {\r\n return (\r\n <CommandGroup heading={title}>\r\n {items?.map((currentItem, index) => (\r\n <CommandItem\r\n id={`${id}_${index}`}\r\n key={currentItem.id}\r\n onSelect={() => {\r\n if (value.find((i) => i.id === currentItem.id)) {\r\n return onChange(value.filter((i) => i.id !== currentItem.id));\r\n }\r\n if (multiple) {\r\n return onChange([...value, currentItem]);\r\n }\r\n return onChange([currentItem]);\r\n }}\r\n value={`${currentItem.id}__${currentItem.name}`}\r\n >\r\n {currentItem.name}\r\n {value.find((i) => i.id === currentItem.id) && (\r\n <CheckIcon className={cn(\"ml-auto h-4 w-4\")} />\r\n )}\r\n </CommandItem>\r\n ))}\r\n </CommandGroup>\r\n );\r\n}\r\n\r\nexport type AsyncSelectType = {\r\n suggestions?: SearchItem[];\r\n data?: SearchItem[];\r\n value: SearchItem[];\r\n onChange: (value: SearchItem[]) => void;\r\n fetchAction: (search: string) => Promise<SearchItem[]>;\r\n resultText?: string;\r\n searchText?: string;\r\n noResultText?: string;\r\n disabled?: boolean;\r\n closeOnSelect?: boolean;\r\n multiple?: boolean;\r\n id: string;\r\n classNames?: {\r\n trigger?: string;\r\n };\r\n};\r\n\r\nexport function AsyncSelectBase({\r\n suggestions = [],\r\n data,\r\n value,\r\n fetchAction,\r\n onChange,\r\n resultText = \"Results\",\r\n searchText = \"Search\",\r\n noResultText = \"No result\",\r\n disabled = false,\r\n multiple = true,\r\n closeOnSelect = false,\r\n id,\r\n setIsPopoverOpen,\r\n}: Omit<AsyncSelectType, \"classNames\"> & {\r\n setIsPopoverOpen: Dispatch<SetStateAction<boolean>>;\r\n}) {\r\n const [loading, setLoading] = useState(false);\r\n const [searchInput, setSearchInput] = useState(\"\");\r\n const searchValue = useDebounce(searchInput, 500);\r\n\r\n const [items, setItems] = useState<SearchItem[]>(data || []);\r\n const showableItems = items.filter(\r\n (item) => !value.find((i) => i.id === item.id)\r\n );\r\n const showableSuggestions = suggestions.filter(\r\n (item) => !value.find((i) => i.id === item.id)\r\n );\r\n function onSearch(search: string) {\r\n setSearchInput(search);\r\n setLoading(true);\r\n setItems([]);\r\n }\r\n function handleOnChange(value: SearchItem[]) {\r\n if (disabled) return;\r\n onChange(value);\r\n }\r\n\r\n useEffect(() => {\r\n if (searchValue === \"\" && searchInput === \"\") {\r\n setLoading(true);\r\n fetchAction(\"\").then((res) => {\r\n setItems(res);\r\n setLoading(false);\r\n });\r\n return;\r\n }\r\n if (searchValue !== searchInput) return;\r\n\r\n fetchAction(searchValue).then((res) => {\r\n setItems(res);\r\n setLoading(false);\r\n });\r\n }, [searchValue, searchInput, fetchAction]);\r\n\r\n return (\r\n <Cmd aria-disabled={disabled}>\r\n <CommandInput\r\n id={`${id}_input`}\r\n data-testid={`${id}_input`}\r\n placeholder={searchText}\r\n onValueChange={(search) => onSearch(search)}\r\n disabled={disabled}\r\n />\r\n\r\n <CommandList className=\"overflow-y-auto max-h-48\">\r\n {loading && (\r\n <div className=\"p-1 text-sm\">\r\n <Skeleton className=\"h-7 w-full mb-1\" />\r\n </div>\r\n )}\r\n\r\n {!loading && items.length === 0 && searchValue.length > 0 && (\r\n <div className=\"text-sm p-2\">{noResultText}</div>\r\n )}\r\n\r\n {value.length > 0 && (\r\n <CommandGroupItem\r\n items={value}\r\n id={`${id}_selected`}\r\n data-testid={`${id}_selected`}\r\n value={value}\r\n title=\"Selected\"\r\n onChange={(value) => {\r\n handleOnChange(value);\r\n if (closeOnSelect) setIsPopoverOpen(false);\r\n }}\r\n multiple={multiple}\r\n />\r\n )}\r\n\r\n {!loading &&\r\n searchValue.length === 0 &&\r\n showableSuggestions?.length > 0 && (\r\n <CommandGroupItem\r\n id={`${id}_item`}\r\n items={showableSuggestions}\r\n value={value}\r\n title=\"Suggestions\"\r\n onChange={(value) => {\r\n handleOnChange(value);\r\n if (closeOnSelect) setIsPopoverOpen(false);\r\n }}\r\n multiple={multiple}\r\n />\r\n )}\r\n\r\n {!loading && showableItems.length > 0 && (\r\n <CommandGroupItem\r\n id={`${id}_item`}\r\n items={showableItems}\r\n value={value}\r\n title={resultText}\r\n onChange={(value) => {\r\n handleOnChange(value);\r\n if (closeOnSelect) setIsPopoverOpen(false);\r\n }}\r\n multiple={multiple}\r\n />\r\n )}\r\n </CommandList>\r\n </Cmd>\r\n );\r\n}\r\nexport default function AsyncSelect(props: AsyncSelectType) {\r\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\r\n return (\r\n <Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>\r\n <PopoverTrigger asChild className=\"w-full\">\r\n <Button\r\n id={props.id}\r\n data-testid={props.id}\r\n disabled={props.disabled}\r\n type=\"button\"\r\n onClick={() => setIsPopoverOpen(true)}\r\n className={cn(\r\n \"flex w-full p-1 rounded-md border items-center justify-between bg-inherit hover:bg-inherit\",\r\n props.classNames?.trigger\r\n )}\r\n >\r\n {props.value.length > 0 ? (\r\n <div className=\"flex justify-between items-center w-full\">\r\n <div className=\"flex flex-wrap items-center\">\r\n {props.value.slice(0, 3).map((value) => (\r\n <Badge\r\n key={value.id}\r\n data-testid={`${props.id}_badge_${value.name}`}\r\n className=\"m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 border-foreground/10 text-foreground bg-card hover:bg-card/80\"\r\n onClick={() => {\r\n props.onChange(\r\n props.value.filter((i) => i.id !== value.id)\r\n );\r\n }}\r\n >\r\n {value.name}\r\n <XCircle className=\"ml-2 h-4 w-4 cursor-pointer\" />\r\n </Badge>\r\n ))}\r\n {props.value.length > 3 && (\r\n <Badge\r\n className={cn(\r\n \"bg-transparent text-foreground border-foreground/1 hover:bg-transparent\"\r\n )}\r\n >\r\n {props.value.length - 3} more\r\n </Badge>\r\n )}\r\n </div>\r\n <div className=\"flex items-center justify-between\">\r\n <XIcon\r\n className=\"h-4 mx-2 cursor-pointer text-muted-foreground\"\r\n onClick={() => {\r\n props.onChange([]);\r\n }}\r\n />\r\n <Separator\r\n orientation=\"vertical\"\r\n className=\"flex min-h-6 h-full\"\r\n />\r\n <ChevronDown className=\"h-4 mx-2 cursor-pointer text-muted-foreground\" />\r\n </div>\r\n </div>\r\n ) : (\r\n <div className=\"flex items-center justify-between w-full mx-auto\">\r\n <span className=\"text-sm text-black mx-3 font-normal\">\r\n {props.searchText}\r\n </span>\r\n <ChevronDown className=\"h-4 cursor-pointer text-muted-foreground mx-2\" />\r\n </div>\r\n )}\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent\r\n className=\"p-0\"\r\n align=\"start\"\r\n onEscapeKeyDown={() => setIsPopoverOpen(false)}\r\n >\r\n <AsyncSelectBase {...props} setIsPopoverOpen={setIsPopoverOpen} />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n}\r\n"],"mappings":";AA2CQ,SAgBI,KAhBJ;AAzCR,SAAS,WAAW,aAAa,SAAS,aAAa;AACvD,SAAmC,WAAW,gBAAgB;AAC9D,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB;AAAA,EACE,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAI5B,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOG;AACD,SACE,oBAAC,gBAAa,SAAS,OACpB,iBAAO,IAAI,CAAC,aAAa,UACxB;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,GAAG,EAAE,IAAI,KAAK;AAAA,MAElB,UAAU,MAAM;AACd,YAAI,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,YAAY,EAAE,GAAG;AAC9C,iBAAO,SAAS,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,YAAY,EAAE,CAAC;AAAA,QAC9D;AACA,YAAI,UAAU;AACZ,iBAAO,SAAS,CAAC,GAAG,OAAO,WAAW,CAAC;AAAA,QACzC;AACA,eAAO,SAAS,CAAC,WAAW,CAAC;AAAA,MAC/B;AAAA,MACA,OAAO,GAAG,YAAY,EAAE,KAAK,YAAY,IAAI;AAAA,MAE5C;AAAA,oBAAY;AAAA,QACZ,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,YAAY,EAAE,KACxC,oB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,gBACV,SAAS,MAAM;AACb,wBAAM,SAAS,CAAC,CAAC;AAAA,gBACnB;AAAA;AAAA,YACF;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,aAAY;AAAA,gBACZ,WAAU;AAAA;AAAA,YACZ;AAAA,YACA,oBAAC,eAAY,WAAU,iDAAgD;AAAA,aACzE;AAAA,WACF,IAEA,qBAAC,SAAI,WAAU,oDACb;AAAA,8BAAC,UAAK,WAAU,uCACb,gBAAM,YACT;AAAA,UACA,oBAAC,eAAY,WAAU,iDAAgD;AAAA,WACzE;AAAA;AAAA,IAEJ,GACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAM;AAAA,QACN,iBAAiB,MAAM,iBAAiB,KAAK;AAAA,QAE7C,8BAAC,mBAAiB,GAAG,OAAO,kBAAoC;AAAA;AAAA,IAClE;AAAA,KACF;AAEJ;","names":["value"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
buttonVariants
|
|
5
|
+
} from "@repo/ayasofyazilim-ui/components/button";
|
|
6
|
+
import {
|
|
7
|
+
Empty,
|
|
8
|
+
EmptyContent,
|
|
9
|
+
EmptyDescription,
|
|
10
|
+
EmptyHeader,
|
|
11
|
+
EmptyTitle
|
|
12
|
+
} from "@repo/ayasofyazilim-ui/components/empty";
|
|
13
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
14
|
+
import { motion } from "motion/react";
|
|
15
|
+
import Link from "next/link";
|
|
16
|
+
const PRIMARY_ORB_HORIZONTAL_OFFSET = 40;
|
|
17
|
+
const PRIMARY_ORB_VERTICAL_OFFSET = 20;
|
|
18
|
+
function AwesomeNotFound({
|
|
19
|
+
title = "404",
|
|
20
|
+
description = "The page you are looking for does not exist.",
|
|
21
|
+
actions = []
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-screen w-full items-center justify-center overflow-hidden bg-[radial-gradient(circle_at_center,rgba(99,102,241,0.1),transparent_70%)] text-foreground", children: [
|
|
24
|
+
/* @__PURE__ */ jsxs(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
"aria-hidden": true,
|
|
28
|
+
className: "-z-10 absolute inset-0 overflow-hidden",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
motion.div,
|
|
32
|
+
{
|
|
33
|
+
animate: {
|
|
34
|
+
x: [
|
|
35
|
+
0,
|
|
36
|
+
PRIMARY_ORB_HORIZONTAL_OFFSET,
|
|
37
|
+
-PRIMARY_ORB_HORIZONTAL_OFFSET,
|
|
38
|
+
0
|
|
39
|
+
],
|
|
40
|
+
y: [
|
|
41
|
+
0,
|
|
42
|
+
PRIMARY_ORB_VERTICAL_OFFSET,
|
|
43
|
+
-PRIMARY_ORB_VERTICAL_OFFSET,
|
|
44
|
+
0
|
|
45
|
+
],
|
|
46
|
+
rotate: [0, 10, -10, 0]
|
|
47
|
+
},
|
|
48
|
+
className: "absolute top-1/2 left-1/3 size-90 rounded-full bg-linear-to-tr from-purple-500/20 to-blue-500/20 blur-3xl",
|
|
49
|
+
transition: {
|
|
50
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
51
|
+
duration: 4,
|
|
52
|
+
ease: "easeInOut"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
motion.div,
|
|
58
|
+
{
|
|
59
|
+
animate: {
|
|
60
|
+
x: [
|
|
61
|
+
0,
|
|
62
|
+
-PRIMARY_ORB_HORIZONTAL_OFFSET,
|
|
63
|
+
PRIMARY_ORB_HORIZONTAL_OFFSET,
|
|
64
|
+
0
|
|
65
|
+
],
|
|
66
|
+
y: [
|
|
67
|
+
0,
|
|
68
|
+
-PRIMARY_ORB_VERTICAL_OFFSET,
|
|
69
|
+
PRIMARY_ORB_VERTICAL_OFFSET,
|
|
70
|
+
0
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
className: "absolute right-1/4 bottom-1/3 size-120 rounded-full bg-linear-to-br from-indigo-400/10 to-pink-400/10 blur-3xl",
|
|
74
|
+
transition: {
|
|
75
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
76
|
+
duration: 4,
|
|
77
|
+
ease: "easeInOut"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsxs(Empty, { children: [
|
|
85
|
+
/* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
86
|
+
/* @__PURE__ */ jsx(EmptyTitle, { className: "font-extrabold text-8xl", children: title }),
|
|
87
|
+
/* @__PURE__ */ jsx(EmptyDescription, { className: "text-nowrap", children: description })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsx(EmptyContent, { children: /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: actions.map((action) => /* @__PURE__ */ jsxs(
|
|
90
|
+
Link,
|
|
91
|
+
{
|
|
92
|
+
href: action.href,
|
|
93
|
+
className: cn(
|
|
94
|
+
buttonVariants({
|
|
95
|
+
variant: action.variant || "default",
|
|
96
|
+
size: action.size || "default"
|
|
97
|
+
})
|
|
98
|
+
),
|
|
99
|
+
children: [
|
|
100
|
+
action.icon && /* @__PURE__ */ jsx(action.icon, {}),
|
|
101
|
+
" ",
|
|
102
|
+
action.label
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
action.label
|
|
106
|
+
)) }) })
|
|
107
|
+
] })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
AwesomeNotFound
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=awesome-not-found.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/custom/awesome-not-found.tsx"],"sourcesContent":["\"use client\";\r\nimport {\r\n ButtonProps,\r\n buttonVariants,\r\n} from \"@repo/ayasofyazilim-ui/components/button\";\r\nimport {\r\n Empty,\r\n EmptyContent,\r\n EmptyDescription,\r\n EmptyHeader,\r\n EmptyTitle,\r\n} from \"@repo/ayasofyazilim-ui/components/empty\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport { motion } from \"motion/react\";\r\nimport Link from \"next/link\";\r\n\r\nconst PRIMARY_ORB_HORIZONTAL_OFFSET = 40;\r\nconst PRIMARY_ORB_VERTICAL_OFFSET = 20;\r\n\r\nexport function AwesomeNotFound({\r\n title = \"404\",\r\n description = \"The page you are looking for does not exist.\",\r\n actions = [],\r\n}: {\r\n title?: string;\r\n description?: string;\r\n actions?: {\r\n label: string;\r\n href: string;\r\n variant?: ButtonProps[\"variant\"];\r\n size?: ButtonProps[\"size\"];\r\n icon?: React.ComponentType;\r\n }[];\r\n}) {\r\n return (\r\n <div className=\"relative flex min-h-screen w-full items-center justify-center overflow-hidden bg-[radial-gradient(circle_at_center,rgba(99,102,241,0.1),transparent_70%)] text-foreground\">\r\n <div\r\n aria-hidden={true}\r\n className=\"-z-10 absolute inset-0 overflow-hidden\"\r\n >\r\n <motion.div\r\n animate={{\r\n x: [\r\n 0,\r\n PRIMARY_ORB_HORIZONTAL_OFFSET,\r\n -PRIMARY_ORB_HORIZONTAL_OFFSET,\r\n 0,\r\n ],\r\n y: [\r\n 0,\r\n PRIMARY_ORB_VERTICAL_OFFSET,\r\n -PRIMARY_ORB_VERTICAL_OFFSET,\r\n 0,\r\n ],\r\n rotate: [0, 10, -10, 0],\r\n }}\r\n className=\"absolute top-1/2 left-1/3 size-90 rounded-full bg-linear-to-tr from-purple-500/20 to-blue-500/20 blur-3xl\"\r\n transition={{\r\n repeat: Number.POSITIVE_INFINITY,\r\n duration: 4,\r\n ease: \"easeInOut\",\r\n }}\r\n />\r\n <motion.div\r\n animate={{\r\n x: [\r\n 0,\r\n -PRIMARY_ORB_HORIZONTAL_OFFSET,\r\n PRIMARY_ORB_HORIZONTAL_OFFSET,\r\n 0,\r\n ],\r\n y: [\r\n 0,\r\n -PRIMARY_ORB_VERTICAL_OFFSET,\r\n PRIMARY_ORB_VERTICAL_OFFSET,\r\n 0,\r\n ],\r\n }}\r\n className=\"absolute right-1/4 bottom-1/3 size-120 rounded-full bg-linear-to-br from-indigo-400/10 to-pink-400/10 blur-3xl\"\r\n transition={{\r\n repeat: Number.POSITIVE_INFINITY,\r\n duration: 4,\r\n ease: \"easeInOut\",\r\n }}\r\n />\r\n </div>\r\n\r\n <Empty>\r\n <EmptyHeader>\r\n <EmptyTitle className=\"font-extrabold text-8xl\">{title}</EmptyTitle>\r\n <EmptyDescription className=\"text-nowrap\">\r\n {description}\r\n </EmptyDescription>\r\n </EmptyHeader>\r\n <EmptyContent>\r\n <div className=\"flex gap-2\">\r\n {actions.map((action) => (\r\n <Link\r\n href={action.href}\r\n className={cn(\r\n buttonVariants({\r\n variant: action.variant || \"default\",\r\n size: action.size || \"default\",\r\n })\r\n )}\r\n key={action.label}\r\n >\r\n {action.icon && <action.icon />} {action.label}\r\n </Link>\r\n ))}\r\n </div>\r\n </EmptyContent>\r\n </Empty>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";AAoCM,SAIE,KAJF;AAnCN;AAAA,EAEE;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,OAAO,UAAU;AAEjB,MAAM,gCAAgC;AACtC,MAAM,8BAA8B;AAE7B,SAAS,gBAAgB;AAAA,EAC9B,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU,CAAC;AACb,GAUG;AACD,SACE,qBAAC,SAAI,WAAU,6KACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,WAAU;AAAA,QAEV;AAAA;AA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AA,YAAE,OAAO;AAAA;AAAA;AAAA,QAFpC,OAAO;AAAA,MAGd,CACD,GACH,GACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
Area,
|
|
5
|
+
CartesianGrid,
|
|
6
|
+
AreaChart as RechartsAreaChart,
|
|
7
|
+
XAxis,
|
|
8
|
+
YAxis
|
|
9
|
+
} from "recharts";
|
|
10
|
+
import {
|
|
11
|
+
ChartContainer,
|
|
12
|
+
ChartLegend,
|
|
13
|
+
ChartLegendContent,
|
|
14
|
+
ChartTooltip,
|
|
15
|
+
ChartTooltipContent
|
|
16
|
+
} from "@repo/ayasofyazilim-ui/components/chart";
|
|
17
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
18
|
+
import { ChartCard } from "./chart-card";
|
|
19
|
+
const description = "An area chart with a legend";
|
|
20
|
+
function AreaChart({
|
|
21
|
+
data,
|
|
22
|
+
title,
|
|
23
|
+
config,
|
|
24
|
+
description: description2,
|
|
25
|
+
period,
|
|
26
|
+
footer,
|
|
27
|
+
trendText,
|
|
28
|
+
trendIcon,
|
|
29
|
+
showLegend,
|
|
30
|
+
xAxisTickFormatter = (value) => value,
|
|
31
|
+
classNames,
|
|
32
|
+
valuePrefix,
|
|
33
|
+
valueSuffix,
|
|
34
|
+
emptyState
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
ChartCard,
|
|
38
|
+
{
|
|
39
|
+
title,
|
|
40
|
+
description: description2,
|
|
41
|
+
period,
|
|
42
|
+
trendText,
|
|
43
|
+
trendIcon,
|
|
44
|
+
footer,
|
|
45
|
+
classNames: classNames?.card,
|
|
46
|
+
emptyState: data.length === 0 ? emptyState : void 0,
|
|
47
|
+
children: /* @__PURE__ */ jsx(
|
|
48
|
+
ChartContainer,
|
|
49
|
+
{
|
|
50
|
+
config,
|
|
51
|
+
className: cn("mx-auto max-h-full", classNames?.chart?.container),
|
|
52
|
+
children: /* @__PURE__ */ jsxs(
|
|
53
|
+
RechartsAreaChart,
|
|
54
|
+
{
|
|
55
|
+
accessibilityLayer: true,
|
|
56
|
+
data,
|
|
57
|
+
className: cn("flex flex-col pb-2", classNames?.chart?.area),
|
|
58
|
+
margin: { top: 0, bottom: 0, left: 0, right: 0 },
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
XAxis,
|
|
63
|
+
{
|
|
64
|
+
dataKey: "label",
|
|
65
|
+
tickMargin: 2,
|
|
66
|
+
minTickGap: 2,
|
|
67
|
+
tickFormatter: xAxisTickFormatter
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(YAxis, {}),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
ChartTooltip,
|
|
73
|
+
{
|
|
74
|
+
cursor: false,
|
|
75
|
+
content: /* @__PURE__ */ jsx(
|
|
76
|
+
ChartTooltipContent,
|
|
77
|
+
{
|
|
78
|
+
indicator: "line",
|
|
79
|
+
valuePrefix,
|
|
80
|
+
valueSuffix
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
Object.keys(config).map((key) => /* @__PURE__ */ jsx(
|
|
86
|
+
Area,
|
|
87
|
+
{
|
|
88
|
+
dataKey: key,
|
|
89
|
+
type: config[key]?.type || "monotoneX",
|
|
90
|
+
fill: config[key]?.color || `var(--color-${key})`,
|
|
91
|
+
fillOpacity: 0.4,
|
|
92
|
+
stroke: config[key]?.color || `var(--color-${key})`,
|
|
93
|
+
stackId: "a"
|
|
94
|
+
},
|
|
95
|
+
key
|
|
96
|
+
)),
|
|
97
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
98
|
+
ChartLegend,
|
|
99
|
+
{
|
|
100
|
+
wrapperStyle: {
|
|
101
|
+
position: "relative",
|
|
102
|
+
top: "unset",
|
|
103
|
+
left: "unset",
|
|
104
|
+
bottom: "unset",
|
|
105
|
+
right: "unset",
|
|
106
|
+
width: "100%",
|
|
107
|
+
textAlign: "center"
|
|
108
|
+
},
|
|
109
|
+
className: cn("p-0", classNames?.chart?.legend),
|
|
110
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent, {})
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
AreaChart,
|
|
123
|
+
description
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=area-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/custom/charts/area-chart.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {\r\n Area,\r\n CartesianGrid,\r\n AreaChart as RechartsAreaChart,\r\n XAxis,\r\n YAxis,\r\n} from \"recharts\";\r\n\r\nimport {\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 { ReactNode } from \"react\";\r\nimport { CurveType } from \"recharts/types/shape/Curve\";\r\nimport { BaseAxisProps } from \"recharts/types/util/types\";\r\nimport { CardClassNames, ChartCard } from \"./chart-card\";\r\nimport { EmptyConfig } from \".\";\r\n\r\nexport const description = \"An area chart with a legend\";\r\n\r\ntype ChartData = Array<{\r\n [key: string]: number | string;\r\n}>;\r\n\r\ntype ChartConfig = {\r\n [key: string]: {\r\n label: string;\r\n type?: CurveType;\r\n color: string;\r\n };\r\n};\r\n\r\nexport type AreaChartProps = {\r\n data: ChartData;\r\n config: ChartConfig;\r\n title?: ReactNode;\r\n description?: ReactNode;\r\n period?: ReactNode;\r\n footer?: ReactNode;\r\n trendText?: ReactNode;\r\n trendIcon?: ReactNode;\r\n showLegend?: boolean;\r\n xAxisTickFormatter?: BaseAxisProps[\"tickFormatter\"];\r\n classNames?: {\r\n chart?: {\r\n container?: string;\r\n area?: string;\r\n legend?: string;\r\n };\r\n card?: CardClassNames;\r\n };\r\n valuePrefix?: string;\r\n valueSuffix?: string;\r\n} & EmptyConfig;\r\n\r\nexport function AreaChart({\r\n data,\r\n title,\r\n config,\r\n description,\r\n period,\r\n footer,\r\n trendText,\r\n trendIcon,\r\n showLegend,\r\n xAxisTickFormatter = (value) => value,\r\n classNames,\r\n valuePrefix,\r\n valueSuffix,\r\n emptyState,\r\n}: AreaChartProps) {\r\n return (\r\n <ChartCard\r\n title={title}\r\n description={description}\r\n period={period}\r\n trendText={trendText}\r\n trendIcon={trendIcon}\r\n footer={footer}\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 <RechartsAreaChart\r\n accessibilityLayer\r\n data={data}\r\n className={cn(\"flex flex-col pb-2\", classNames?.chart?.area)}\r\n margin={{ top: 0, bottom: 0, left: 0, right: 0 }}\r\n >\r\n <CartesianGrid vertical={false} />\r\n <XAxis\r\n dataKey=\"label\"\r\n tickMargin={2}\r\n minTickGap={2}\r\n tickFormatter={xAxisTickFormatter}\r\n />\r\n <YAxis />\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 {Object.keys(config).map((key) => (\r\n <Area\r\n key={key}\r\n dataKey={key}\r\n type={config[key]?.type || \"monotoneX\"}\r\n fill={config[key]?.color || `var(--color-${key})`}\r\n fillOpacity={0.4}\r\n stroke={config[key]?.color || `var(--color-${key})`}\r\n stackId=\"a\"\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 </RechartsAreaChart>\r\n </ChartContainer>\r\n </ChartCard>\r\n );\r\n}\r\n"],"mappings":";AA4FQ,SAME,KANF;AA1FR;AAAA,EACE;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AAInB,SAAyB,iBAAiB;AAGnC,MAAM,cAAc;AAqCpB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAqB,CAAC,UAAU;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAaA;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,YAAY;AAAA,MACxB,YAAY,KAAK,WAAW,IAAI,aAAa;AAAA,MAE7C;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAG,sBAAsB,YAAY,OAAO,SAAS;AAAA,UAEhE;AAAA,YAAC;AAAA;AAAA,cACC,oBAAkB;AAAA,cAClB;AAAA,cACA,WAAW,GAAG,sBAAsB,YAAY,OAAO,IAAI;AAAA,cAC3D,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAA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