@eggspot/ui 0.0.2 → 0.0.3
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/components/Badge.d.ts +15 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +29 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Breadcrumb.d.ts +12 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb.js +28 -0
- package/dist/components/Breadcrumb.js.map +1 -0
- package/dist/components/Button.d.ts +53 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +81 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Button.machine.d.ts +9 -0
- package/dist/components/Button.machine.d.ts.map +1 -0
- package/dist/components/Button.machine.js +50 -0
- package/dist/components/Button.machine.js.map +1 -0
- package/dist/components/Button.variants.d.ts +10 -0
- package/dist/components/Button.variants.d.ts.map +1 -0
- package/dist/components/Button.variants.js +214 -0
- package/dist/components/Button.variants.js.map +1 -0
- package/dist/components/ButtonGroup.d.ts +9 -0
- package/dist/components/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup.js +23 -0
- package/dist/components/ButtonGroup.js.map +1 -0
- package/dist/components/Calendar.d.ts +24 -0
- package/dist/components/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar.js +64 -0
- package/dist/components/Calendar.js.map +1 -0
- package/dist/components/Calendar.utils.d.ts +6 -0
- package/dist/components/Calendar.utils.d.ts.map +1 -0
- package/dist/components/Calendar.utils.js +17 -0
- package/dist/components/Calendar.utils.js.map +1 -0
- package/dist/components/Card.d.ts +8 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +19 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Checkbox.d.ts +36 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox.js +55 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/Collapsible.d.ts +20 -0
- package/dist/components/Collapsible.d.ts.map +1 -0
- package/dist/components/Collapsible.js +15 -0
- package/dist/components/Collapsible.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +35 -0
- package/dist/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog.js +81 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/CopyButton.d.ts +67 -0
- package/dist/components/CopyButton.d.ts.map +1 -0
- package/dist/components/CopyButton.js +51 -0
- package/dist/components/CopyButton.js.map +1 -0
- package/dist/components/DashboardLayout/DashboardLayout.d.ts +3 -0
- package/dist/components/DashboardLayout/DashboardLayout.d.ts.map +1 -0
- package/dist/components/DashboardLayout/DashboardLayout.js +38 -0
- package/dist/components/DashboardLayout/DashboardLayout.js.map +1 -0
- package/dist/components/DashboardLayout/DashboardLayoutContent.d.ts +9 -0
- package/dist/components/DashboardLayout/DashboardLayoutContent.d.ts.map +1 -0
- package/dist/components/DashboardLayout/DashboardLayoutContent.js +10 -0
- package/dist/components/DashboardLayout/DashboardLayoutContent.js.map +1 -0
- package/dist/components/DashboardLayout/index.d.ts +4 -0
- package/dist/components/DashboardLayout/index.d.ts.map +1 -0
- package/dist/components/DashboardLayout/index.js +3 -0
- package/dist/components/DashboardLayout/index.js.map +1 -0
- package/dist/components/DashboardLayout/types.d.ts +37 -0
- package/dist/components/DashboardLayout/types.d.ts.map +1 -0
- package/dist/components/DashboardLayout/types.js +2 -0
- package/dist/components/DashboardLayout/types.js.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +9 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +271 -0
- package/dist/components/DataTable/DataTable.js.map +1 -0
- package/dist/components/DataTable/DataTableColumnHeader.d.ts +11 -0
- package/dist/components/DataTable/DataTableColumnHeader.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableColumnHeader.js +26 -0
- package/dist/components/DataTable/DataTableColumnHeader.js.map +1 -0
- package/dist/components/DataTable/DataTableDisplaySettings.d.ts +8 -0
- package/dist/components/DataTable/DataTableDisplaySettings.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableDisplaySettings.js +88 -0
- package/dist/components/DataTable/DataTableDisplaySettings.js.map +1 -0
- package/dist/components/DataTable/DataTableFloatingBar.d.ts +8 -0
- package/dist/components/DataTable/DataTableFloatingBar.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableFloatingBar.js +11 -0
- package/dist/components/DataTable/DataTableFloatingBar.js.map +1 -0
- package/dist/components/DataTable/DataTablePagination.d.ts +11 -0
- package/dist/components/DataTable/DataTablePagination.d.ts.map +1 -0
- package/dist/components/DataTable/DataTablePagination.js +68 -0
- package/dist/components/DataTable/DataTablePagination.js.map +1 -0
- package/dist/components/DataTable/DataTableStates.d.ts +13 -0
- package/dist/components/DataTable/DataTableStates.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableStates.js +17 -0
- package/dist/components/DataTable/DataTableStates.js.map +1 -0
- package/dist/components/DataTable/DataTableToolbarContainer.d.ts +7 -0
- package/dist/components/DataTable/DataTableToolbarContainer.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableToolbarContainer.js +7 -0
- package/dist/components/DataTable/DataTableToolbarContainer.js.map +1 -0
- package/dist/components/DataTable/hooks/use-data-table-settings.d.ts +19 -0
- package/dist/components/DataTable/hooks/use-data-table-settings.d.ts.map +1 -0
- package/dist/components/DataTable/hooks/use-data-table-settings.js +70 -0
- package/dist/components/DataTable/hooks/use-data-table-settings.js.map +1 -0
- package/dist/components/DataTable/index.d.ts +4 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/DataTable/index.js +3 -0
- package/dist/components/DataTable/index.js.map +1 -0
- package/dist/components/DataTable/types/data-table.d.ts +76 -0
- package/dist/components/DataTable/types/data-table.d.ts.map +1 -0
- package/dist/components/DataTable/types/data-table.js +2 -0
- package/dist/components/DataTable/types/data-table.js.map +1 -0
- package/dist/components/DatePicker.d.ts +19 -0
- package/dist/components/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker.js +49 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/DatePicker.utils.d.ts +3 -0
- package/dist/components/DatePicker.utils.d.ts.map +1 -0
- package/dist/components/DatePicker.utils.js +23 -0
- package/dist/components/DatePicker.utils.js.map +1 -0
- package/dist/components/Datefield.d.ts +25 -0
- package/dist/components/Datefield.d.ts.map +1 -0
- package/dist/components/Datefield.js +29 -0
- package/dist/components/Datefield.js.map +1 -0
- package/dist/components/Datefield.utils.d.ts +3 -0
- package/dist/components/Datefield.utils.d.ts.map +1 -0
- package/dist/components/Datefield.utils.js +11 -0
- package/dist/components/Datefield.utils.js.map +1 -0
- package/dist/components/Dialog.d.ts +21 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog.js +23 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/Field.d.ts +10 -0
- package/dist/components/Field.d.ts.map +1 -0
- package/dist/components/Field.js +32 -0
- package/dist/components/Field.js.map +1 -0
- package/dist/components/Filter/Filter.d.ts +4 -0
- package/dist/components/Filter/Filter.d.ts.map +1 -0
- package/dist/components/Filter/Filter.js +8 -0
- package/dist/components/Filter/Filter.js.map +1 -0
- package/dist/components/Filter/Filter.store.d.ts +13 -0
- package/dist/components/Filter/Filter.store.d.ts.map +1 -0
- package/dist/components/Filter/Filter.store.js +61 -0
- package/dist/components/Filter/Filter.store.js.map +1 -0
- package/dist/components/Filter/Filter.types.d.ts +66 -0
- package/dist/components/Filter/Filter.types.d.ts.map +1 -0
- package/dist/components/Filter/Filter.types.js +15 -0
- package/dist/components/Filter/Filter.types.js.map +1 -0
- package/dist/components/Filter/FilterBar.d.ts +7 -0
- package/dist/components/Filter/FilterBar.d.ts.map +1 -0
- package/dist/components/Filter/FilterBar.js +28 -0
- package/dist/components/Filter/FilterBar.js.map +1 -0
- package/dist/components/Filter/FilterBuilder.d.ts +3 -0
- package/dist/components/Filter/FilterBuilder.d.ts.map +1 -0
- package/dist/components/Filter/FilterBuilder.js +47 -0
- package/dist/components/Filter/FilterBuilder.js.map +1 -0
- package/dist/components/Filter/FilterField/DateModeRowValue.d.ts +5 -0
- package/dist/components/Filter/FilterField/DateModeRowValue.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/DateModeRowValue.js +150 -0
- package/dist/components/Filter/FilterField/DateModeRowValue.js.map +1 -0
- package/dist/components/Filter/FilterField/FilterAsyncSelect.d.ts +13 -0
- package/dist/components/Filter/FilterField/FilterAsyncSelect.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/FilterAsyncSelect.js +62 -0
- package/dist/components/Filter/FilterField/FilterAsyncSelect.js.map +1 -0
- package/dist/components/Filter/FilterField/FilterDateMode.d.ts +2 -0
- package/dist/components/Filter/FilterField/FilterDateMode.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/FilterDateMode.js +167 -0
- package/dist/components/Filter/FilterField/FilterDateMode.js.map +1 -0
- package/dist/components/Filter/FilterField/FilterDateRange.d.ts +7 -0
- package/dist/components/Filter/FilterField/FilterDateRange.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/FilterDateRange.js +60 -0
- package/dist/components/Filter/FilterField/FilterDateRange.js.map +1 -0
- package/dist/components/Filter/FilterField/FilterSelect.d.ts +12 -0
- package/dist/components/Filter/FilterField/FilterSelect.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/FilterSelect.js +72 -0
- package/dist/components/Filter/FilterField/FilterSelect.js.map +1 -0
- package/dist/components/Filter/FilterField/FilterSingleDate.d.ts +8 -0
- package/dist/components/Filter/FilterField/FilterSingleDate.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/FilterSingleDate.js +102 -0
- package/dist/components/Filter/FilterField/FilterSingleDate.js.map +1 -0
- package/dist/components/Filter/FilterField/OptionItem.d.ts +10 -0
- package/dist/components/Filter/FilterField/OptionItem.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/OptionItem.js +20 -0
- package/dist/components/Filter/FilterField/OptionItem.js.map +1 -0
- package/dist/components/Filter/FilterField/index.d.ts +7 -0
- package/dist/components/Filter/FilterField/index.d.ts.map +1 -0
- package/dist/components/Filter/FilterField/index.js +7 -0
- package/dist/components/Filter/FilterField/index.js.map +1 -0
- package/dist/components/Filter/FilterRow.d.ts +7 -0
- package/dist/components/Filter/FilterRow.d.ts.map +1 -0
- package/dist/components/Filter/FilterRow.js +152 -0
- package/dist/components/Filter/FilterRow.js.map +1 -0
- package/dist/components/Filter/index.d.ts +7 -0
- package/dist/components/Filter/index.d.ts.map +1 -0
- package/dist/components/Filter/index.js +6 -0
- package/dist/components/Filter/index.js.map +1 -0
- package/dist/components/Form.d.ts +32 -0
- package/dist/components/Form.d.ts.map +1 -0
- package/dist/components/Form.js +82 -0
- package/dist/components/Form.js.map +1 -0
- package/dist/components/Heading.d.ts +10 -0
- package/dist/components/Heading.d.ts.map +1 -0
- package/dist/components/Heading.js +27 -0
- package/dist/components/Heading.js.map +1 -0
- package/dist/components/Input.d.ts +43 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +58 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/InputOTP.d.ts +12 -0
- package/dist/components/InputOTP.d.ts.map +1 -0
- package/dist/components/InputOTP.js +24 -0
- package/dist/components/InputOTP.js.map +1 -0
- package/dist/components/Label.d.ts +9 -0
- package/dist/components/Label.d.ts.map +1 -0
- package/dist/components/Label.js +19 -0
- package/dist/components/Label.js.map +1 -0
- package/dist/components/Layout.d.ts +47 -0
- package/dist/components/Layout.d.ts.map +1 -0
- package/dist/components/Layout.js +78 -0
- package/dist/components/Layout.js.map +1 -0
- package/dist/components/ListBox.d.ts +8 -0
- package/dist/components/ListBox.d.ts.map +1 -0
- package/dist/components/ListBox.js +28 -0
- package/dist/components/ListBox.js.map +1 -0
- package/dist/components/Menu.d.ts +19 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/Menu.js +29 -0
- package/dist/components/Menu.js.map +1 -0
- package/dist/components/NativeSelect.d.ts +10 -0
- package/dist/components/NativeSelect.d.ts.map +1 -0
- package/dist/components/NativeSelect.js +36 -0
- package/dist/components/NativeSelect.js.map +1 -0
- package/dist/components/NumberInput.d.ts +12 -0
- package/dist/components/NumberInput.d.ts.map +1 -0
- package/dist/components/NumberInput.js +25 -0
- package/dist/components/NumberInput.js.map +1 -0
- package/dist/components/Popover.d.ts +9 -0
- package/dist/components/Popover.d.ts.map +1 -0
- package/dist/components/Popover.js +17 -0
- package/dist/components/Popover.js.map +1 -0
- package/dist/components/Provider.d.ts +10 -0
- package/dist/components/Provider.d.ts.map +1 -0
- package/dist/components/Provider.js +11 -0
- package/dist/components/Provider.js.map +1 -0
- package/dist/components/RadioGroup.d.ts +37 -0
- package/dist/components/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup.js +61 -0
- package/dist/components/RadioGroup.js.map +1 -0
- package/dist/components/Resizable.d.ts +25 -0
- package/dist/components/Resizable.d.ts.map +1 -0
- package/dist/components/Resizable.js +19 -0
- package/dist/components/Resizable.js.map +1 -0
- package/dist/components/ScrollArea.d.ts +6 -0
- package/dist/components/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea.js +14 -0
- package/dist/components/ScrollArea.js.map +1 -0
- package/dist/components/Select.d.ts +88 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +174 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/Select.utils.d.ts +13 -0
- package/dist/components/Select.utils.d.ts.map +1 -0
- package/dist/components/Select.utils.js +41 -0
- package/dist/components/Select.utils.js.map +1 -0
- package/dist/components/Separator.d.ts +4 -0
- package/dist/components/Separator.d.ts.map +1 -0
- package/dist/components/Separator.js +7 -0
- package/dist/components/Separator.js.map +1 -0
- package/dist/components/Sheet.d.ts +19 -0
- package/dist/components/Sheet.d.ts.map +1 -0
- package/dist/components/Sheet.js +24 -0
- package/dist/components/Sheet.js.map +1 -0
- package/dist/components/Sidebar/LinkItem.d.ts +34 -0
- package/dist/components/Sidebar/LinkItem.d.ts.map +1 -0
- package/dist/components/Sidebar/LinkItem.js +19 -0
- package/dist/components/Sidebar/LinkItem.js.map +1 -0
- package/dist/components/Sidebar/PageTree.d.ts +46 -0
- package/dist/components/Sidebar/PageTree.d.ts.map +1 -0
- package/dist/components/Sidebar/PageTree.js +46 -0
- package/dist/components/Sidebar/PageTree.js.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +94 -0
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.js +328 -0
- package/dist/components/Sidebar/Sidebar.js.map +1 -0
- package/dist/components/Sidebar/SidebarNavTree.d.ts +26 -0
- package/dist/components/Sidebar/SidebarNavTree.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarNavTree.js +32 -0
- package/dist/components/Sidebar/SidebarNavTree.js.map +1 -0
- package/dist/components/Sidebar/Tabs.d.ts +27 -0
- package/dist/components/Sidebar/Tabs.d.ts.map +1 -0
- package/dist/components/Sidebar/Tabs.js +49 -0
- package/dist/components/Sidebar/Tabs.js.map +1 -0
- package/dist/components/Sidebar/index.d.ts +6 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/Sidebar/index.js +22 -0
- package/dist/components/Sidebar/index.js.map +1 -0
- package/dist/components/Sonner.d.ts +16 -0
- package/dist/components/Sonner.d.ts.map +1 -0
- package/dist/components/Sonner.js +38 -0
- package/dist/components/Sonner.js.map +1 -0
- package/dist/components/Spinner.d.ts +3 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +7 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Switch.d.ts +4 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +19 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/Text.d.ts +10 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/Text.js +22 -0
- package/dist/components/Text.js.map +1 -0
- package/dist/components/Tooltip.d.ts +8 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +24 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/Virtualizer.d.ts +8 -0
- package/dist/components/Virtualizer.d.ts.map +1 -0
- package/dist/components/Virtualizer.js +8 -0
- package/dist/components/Virtualizer.js.map +1 -0
- package/dist/consts/config.d.ts +3 -0
- package/dist/consts/config.d.ts.map +1 -0
- package/dist/consts/config.js +3 -0
- package/dist/consts/config.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +6 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +53 -5
- package/eslint.config.js +0 -41
- package/resolve-catalog.js +0 -61
- package/src/components/Button.machine.tsx +0 -50
- package/src/components/Button.tsx +0 -249
- package/src/components/Button.variants.tsx +0 -186
- package/src/components/ButtonGroup.tsx +0 -56
- package/src/components/Calendar.tsx +0 -275
- package/src/components/Calendar.utils.tsx +0 -22
- package/src/components/Checkbox.tsx +0 -199
- package/src/components/ConfirmDialog.tsx +0 -183
- package/src/components/DashboardLayout/DashboardLayout.tsx +0 -348
- package/src/components/DashboardLayout/SidebarNav.tsx +0 -509
- package/src/components/DashboardLayout/index.ts +0 -33
- package/src/components/DataTable/DataTable.tsx +0 -557
- package/src/components/DataTable/DataTableColumnHeader.tsx +0 -122
- package/src/components/DataTable/DataTableDisplaySettings.tsx +0 -265
- package/src/components/DataTable/DataTableFloatingBar.tsx +0 -44
- package/src/components/DataTable/DataTablePagination.tsx +0 -168
- package/src/components/DataTable/DataTableStates.tsx +0 -69
- package/src/components/DataTable/DataTableToolbarContainer.tsx +0 -47
- package/src/components/DataTable/hooks/use-data-table-settings.ts +0 -101
- package/src/components/DataTable/index.ts +0 -7
- package/src/components/DataTable/types/data-table.ts +0 -97
- package/src/components/DatePicker.tsx +0 -213
- package/src/components/DatePicker.utils.tsx +0 -38
- package/src/components/Datefield.tsx +0 -109
- package/src/components/Datefield.utils.ts +0 -10
- package/src/components/Dialog.tsx +0 -167
- package/src/components/Field.tsx +0 -49
- package/src/components/Filter/Filter.store.tsx +0 -122
- package/src/components/Filter/Filter.tsx +0 -11
- package/src/components/Filter/Filter.types.ts +0 -107
- package/src/components/Filter/FilterBar.tsx +0 -38
- package/src/components/Filter/FilterBuilder.tsx +0 -158
- package/src/components/Filter/FilterField/DateModeRowValue.tsx +0 -250
- package/src/components/Filter/FilterField/FilterAsyncSelect.tsx +0 -191
- package/src/components/Filter/FilterField/FilterDateMode.tsx +0 -241
- package/src/components/Filter/FilterField/FilterDateRange.tsx +0 -169
- package/src/components/Filter/FilterField/FilterSelect.tsx +0 -208
- package/src/components/Filter/FilterField/FilterSingleDate.tsx +0 -277
- package/src/components/Filter/FilterField/OptionItem.tsx +0 -112
- package/src/components/Filter/FilterField/index.ts +0 -6
- package/src/components/Filter/FilterRow.tsx +0 -527
- package/src/components/Filter/index.ts +0 -17
- package/src/components/Form.tsx +0 -195
- package/src/components/Heading.tsx +0 -41
- package/src/components/Input.tsx +0 -221
- package/src/components/InputOTP.tsx +0 -78
- package/src/components/Label.tsx +0 -65
- package/src/components/Layout.tsx +0 -129
- package/src/components/ListBox.tsx +0 -97
- package/src/components/Menu.tsx +0 -152
- package/src/components/NativeSelect.tsx +0 -77
- package/src/components/NumberInput.tsx +0 -114
- package/src/components/Popover.tsx +0 -44
- package/src/components/Provider.tsx +0 -22
- package/src/components/RadioGroup.tsx +0 -191
- package/src/components/Resizable.tsx +0 -71
- package/src/components/ScrollArea.tsx +0 -57
- package/src/components/Select.tsx +0 -626
- package/src/components/Select.utils.tsx +0 -64
- package/src/components/Separator.tsx +0 -25
- package/src/components/Sheet.tsx +0 -147
- package/src/components/Sonner.tsx +0 -96
- package/src/components/Spinner.tsx +0 -30
- package/src/components/Switch.tsx +0 -51
- package/src/components/Text.tsx +0 -35
- package/src/components/Tooltip.tsx +0 -58
- package/src/consts/config.ts +0 -2
- package/src/hooks/.gitkeep +0 -0
- package/src/lib/utils.ts +0 -10
- package/tsconfig.json +0 -27
- package/tsconfig.lint.json +0 -8
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const parse: (date?: Date, granularity?: "day" | "minute") => import("@internationalized/date").CalendarDate | import("@internationalized/date").CalendarDateTime | null;
|
|
2
|
+
export declare const toValidYear: (date: Date) => Date;
|
|
3
|
+
//# sourceMappingURL=DatePicker.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.utils.d.ts","sourceRoot":"","sources":["../../src/components/DatePicker.utils.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,KAAK,GAAI,OAAO,IAAI,EAAE,cAAc,KAAK,GAAG,QAAQ,+GAgBhE,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,KAAG,IAUxC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MAX_YEAR_FROM_NOW, MIN_YEAR } from "@eggspot/ui/consts/config";
|
|
2
|
+
import { parseAbsoluteToLocal, toCalendarDate, toCalendarDateTime, } from "@internationalized/date";
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
|
+
import { clamp } from "lodash";
|
|
5
|
+
export const parse = (date, granularity) => {
|
|
6
|
+
if (!date ||
|
|
7
|
+
!(date instanceof Date) ||
|
|
8
|
+
typeof date.toISOString !== "function") {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const value = parseAbsoluteToLocal(date.toISOString());
|
|
12
|
+
if (granularity === "day") {
|
|
13
|
+
return toCalendarDate(value);
|
|
14
|
+
}
|
|
15
|
+
return toCalendarDateTime(value);
|
|
16
|
+
};
|
|
17
|
+
export const toValidYear = (date) => {
|
|
18
|
+
let newDate = dayjs(date);
|
|
19
|
+
const validYear = clamp(newDate.year(), MIN_YEAR, dayjs().year() + MAX_YEAR_FROM_NOW);
|
|
20
|
+
newDate = newDate.year(validYear);
|
|
21
|
+
return newDate.toDate();
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=DatePicker.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.utils.js","sourceRoot":"","sources":["../../src/components/DatePicker.utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GACnB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAW,EAAE,WAA8B,EAAE,EAAE;IACnE,IACE,CAAC,IAAI;QACL,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC,WAAW,KAAK,UAAU,EACtC,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IAEtD,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;QAC1B,OAAO,cAAc,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAU,EAAQ,EAAE;IAC9C,IAAI,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACzB,MAAM,SAAS,GAAG,KAAK,CACrB,OAAO,CAAC,IAAI,EAAE,EACd,QAAQ,EACR,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,iBAAiB,CACnC,CAAA;IACD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAEjC,OAAO,OAAO,CAAC,MAAM,EAAE,CAAA;AACzB,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { fieldGroupVariants } from "@eggspot/ui/components/Field";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { DateInputProps as AriaDateInputProps, DateSegmentProps as AriaDateSegmentProps } from "react-aria-components";
|
|
5
|
+
declare const DateField: <T extends import("react-aria-components").DateValue>(props: import("react-aria-components").DateFieldProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
6
|
+
declare const TimeField: <T extends import("react-aria-components").TimeValue>(props: import("react-aria-components").TimeFieldProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
7
|
+
declare function DateSegment({ className, ...props }: AriaDateSegmentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface DateInputProps extends AriaDateInputProps, VariantProps<typeof fieldGroupVariants> {
|
|
9
|
+
}
|
|
10
|
+
declare function DateInput({ className, variant, ...props }: Omit<DateInputProps, "children">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/** Accepts values in the format YYYY-MM-DD */
|
|
12
|
+
interface EGDateFieldProps {
|
|
13
|
+
value?: string;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
variant?: "default" | "unstyled";
|
|
18
|
+
minValue?: string;
|
|
19
|
+
maxValue?: string;
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function EGDateField({ value: controlledValue, onChange: controlledOnChange, defaultValue, minValue, maxValue, className, isDisabled, ...props }: EGDateFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export { DateField, DateInput, DateSegment, EGDateField, TimeField };
|
|
24
|
+
export type { DateInputProps, EGDateFieldProps };
|
|
25
|
+
//# sourceMappingURL=Datefield.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Datefield.d.ts","sourceRoot":"","sources":["../../src/components/Datefield.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAGL,cAAc,IAAI,kBAAkB,EAEpC,gBAAgB,IAAI,oBAAoB,EAGzC,MAAM,uBAAuB,CAAA;AAE9B,QAAA,MAAM,SAAS,oLAAgB,CAAA;AAE/B,QAAA,MAAM,SAAS,oLAAgB,CAAA;AAE/B,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,2CAkBjE;AAED,UAAU,cACR,SAAQ,kBAAkB,EACxB,YAAY,CAAC,OAAO,kBAAkB,CAAC;CAAG;AAE9C,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,2CAWlC;AAED,8CAA8C;AAC9C,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,iBAAS,WAAW,CAAC,EACnB,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,kBAAkB,EAC5B,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAsBlB;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,CAAA;AACpE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { fieldGroupVariants } from "@eggspot/ui/components/Field";
|
|
5
|
+
import { cn } from "@eggspot/ui/lib/utils";
|
|
6
|
+
import { parseDate } from "@internationalized/date";
|
|
7
|
+
import { DateField as AriaDateField, DateInput as AriaDateInput, DateSegment as AriaDateSegment, TimeField as AriaTimeField, composeRenderProps, } from "react-aria-components";
|
|
8
|
+
const DateField = AriaDateField;
|
|
9
|
+
const TimeField = AriaTimeField;
|
|
10
|
+
function DateSegment({ className, ...props }) {
|
|
11
|
+
return (_jsx(AriaDateSegment, { className: composeRenderProps(className, (className) => cn("type-literal:px-0 inline rounded-sm px-[1px] caret-transparent outline-0",
|
|
12
|
+
/* Placeholder */
|
|
13
|
+
"data-[placeholder]:text-gray-11",
|
|
14
|
+
/* Disabled */
|
|
15
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",
|
|
16
|
+
/* Focused */
|
|
17
|
+
"data-[focused]:bg-accent-9 data-[focused]:text-accent-contrast data-[focused]:data-[placeholder]:text-accent-contrast", className)), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function DateInput({ className, variant, ...props }) {
|
|
20
|
+
return (_jsx(AriaDateInput, { className: composeRenderProps(className, (className) => cn(fieldGroupVariants({ variant }), "md:text-sm", className)), ...props, children: (segment) => _jsx(DateSegment, { segment: segment }) }));
|
|
21
|
+
}
|
|
22
|
+
function EGDateField({ value: controlledValue, onChange: controlledOnChange, defaultValue, minValue, maxValue, className, isDisabled, ...props }) {
|
|
23
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue);
|
|
24
|
+
const value = controlledValue ?? uncontrolledValue;
|
|
25
|
+
const onChange = controlledOnChange ?? setUncontrolledValue;
|
|
26
|
+
return (_jsx(DateField, { "aria-label": "Date Field", className: cn("w-full", className), value: value ? parseDate(value) : null, onChange: (value) => onChange(value?.toString() ?? ""), minValue: minValue ? parseDate(minValue) : null, maxValue: maxValue ? parseDate(maxValue) : null, isDisabled: isDisabled, ...props, children: _jsx(DateInput, {}) }));
|
|
27
|
+
}
|
|
28
|
+
export { DateField, DateInput, DateSegment, EGDateField, TimeField };
|
|
29
|
+
//# sourceMappingURL=Datefield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Datefield.js","sourceRoot":"","sources":["../../src/components/Datefield.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAE1B,WAAW,IAAI,eAAe,EAE9B,SAAS,IAAI,aAAa,EAC1B,kBAAkB,GACnB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,SAAS,GAAG,aAAa,CAAA;AAE/B,MAAM,SAAS,GAAG,aAAa,CAAA;AAE/B,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwB;IAChE,OAAO,CACL,KAAC,eAAe,IACd,SAAS,EAAE,kBAAkB,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CACrD,EAAE,CACA,0EAA0E;QAC1E,iBAAiB;QACjB,iCAAiC;QACjC,cAAc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QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAC/C,UAAU,EAAE,UAAU,KAClB,KAAK,YAET,KAAC,SAAS,KAAG,GACH,CACb,CAAA;AACH,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Datefield.utils.d.ts","sourceRoot":"","sources":["../../src/components/Datefield.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE9C,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,gBAOrC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Time } from "@internationalized/date";
|
|
2
|
+
export const parseTime = (time) => {
|
|
3
|
+
try {
|
|
4
|
+
const timeArray = time.split(":").map(Number);
|
|
5
|
+
return new Time(...timeArray);
|
|
6
|
+
}
|
|
7
|
+
catch (error) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=Datefield.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Datefield.utils.js","sourceRoot":"","sources":["../../src/components/Datefield.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE9C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE;IACxC,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC7C,OAAO,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,CAAA;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DialogProps as AriaDialogProps, DialogTrigger as AriaDialogTrigger, HeadingProps as AriaHeadingProps, Modal as AriaModal, ModalOverlayProps as AriaModalOverlayProps } from "react-aria-components";
|
|
3
|
+
declare const Dialog: (props: AriaDialogProps & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
|
|
4
|
+
declare const DialogTrigger: typeof AriaDialogTrigger;
|
|
5
|
+
declare const DialogOverlay: ({ className, isDismissable, ...props }: AriaModalOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
interface DialogContentProps extends Omit<React.ComponentProps<typeof AriaModal>, "children"> {
|
|
7
|
+
children?: AriaDialogProps["children"];
|
|
8
|
+
role?: AriaDialogProps["role"];
|
|
9
|
+
/** Whether to show the close button */
|
|
10
|
+
closeButton?: boolean;
|
|
11
|
+
/** Whether to dismiss the dialog when the user clicks outside of it */
|
|
12
|
+
isDismissable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const DialogContent: ({ className, children, role, closeButton, isDismissable, ...props }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const DialogHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const DialogFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare const DialogTitle: ({ className, ...props }: AriaHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const DialogDescription: ({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, };
|
|
20
|
+
export type { DialogContentProps };
|
|
21
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@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Aa,EACb,WAAW,EACX,aAAa,GACd,CAAA;AACD,YAAY,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@eggspot/ui/components/Button";
|
|
4
|
+
import { cn } from "@eggspot/ui/lib/utils";
|
|
5
|
+
import { X } from "lucide-react";
|
|
6
|
+
import { Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Heading as AriaHeading, Modal as AriaModal, ModalOverlay as AriaModalOverlay, composeRenderProps, } from "react-aria-components";
|
|
7
|
+
const Dialog = AriaDialog;
|
|
8
|
+
const DialogTrigger = AriaDialogTrigger;
|
|
9
|
+
const DialogOverlay = ({ className, isDismissable = true, ...props }) => (_jsx(AriaModalOverlay, { isDismissable: isDismissable, className: composeRenderProps(className, (className) => cn("fixed inset-0 z-50 h-[var(--page-height)] bg-black/70",
|
|
10
|
+
/* Exiting */
|
|
11
|
+
"data-[exiting]:animate-out data-[exiting]:fade-out-0 max-md:data-[exiting]:duration-300",
|
|
12
|
+
/* Entering */
|
|
13
|
+
"data-[entering]:animate-in data-[entering]:fade-in-0 max-md:data-[entering]:duration-300", className)), ...props }));
|
|
14
|
+
const DialogContent = ({ className, children, role, closeButton = true, isDismissable = true, ...props }) => (_jsx(DialogOverlay, { isDismissable: isDismissable, children: _jsx(AriaModal, { className: composeRenderProps(className, (className) => cn("bg-gray-1 fixed left-[50vw] z-50 max-h-[var(--visual-viewport-height)] w-full max-w-[calc(100vw-40px)] -translate-x-1/2 -translate-y-1/2 rounded-xl p-5 shadow-2xl md:max-w-lg dark:border", "data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0", "md:data-[entering]:zoom-in-97 md:data-[exiting]:zoom-out-97", "max-md:data-[entering]:slide-in-from-bottom-5 max-md:data-[exiting]:slide-out-to-bottom-5 max-md:data-[exiting]:duration-300", className)), style: {
|
|
15
|
+
// This is an exceptional case where we can't use Tailwind, so we have to apply the style directly
|
|
16
|
+
top: "calc(var(--visual-viewport-height) / 2)",
|
|
17
|
+
}, ...props, children: _jsx(AriaDialog, { role: role, className: cn("flex flex-col gap-4", "h-full outline-none"), children: composeRenderProps(children, (children, renderProps) => (_jsxs(_Fragment, { children: [children, closeButton && (_jsxs(Button, { onClick: renderProps.close, mode: "icon", variant: "ghost", tooltip: "Close", tooltipDelay: 2000, className: "absolute top-2.5 right-2.5", children: [_jsx(X, { className: "text-gray-11 size-4!" }), _jsx("span", { className: "sr-only", children: "Close" })] }))] }))) }) }) }));
|
|
18
|
+
const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props }));
|
|
19
|
+
const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-end", className), ...props }));
|
|
20
|
+
const DialogTitle = ({ className, ...props }) => (_jsx(AriaHeading, { slot: "title", className: cn("text-lg leading-none font-semibold tracking-tight", className), ...props }));
|
|
21
|
+
const DialogDescription = ({ className, ...props }) => (_jsx("p", { className: cn("text-gray-11 flex flex-col space-y-1.5 text-center text-sm sm:text-left", className), ...props }));
|
|
22
|
+
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, };
|
|
23
|
+
//# sourceMappingURL=Dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAChC,OAAO,EACL,MAAM,IAA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W,IAAI,CACd,MAAC,MAAM,IACL,OAAO,EAAE,WAAW,CAAC,KAAK,EAC1B,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,OAAO,EACf,OAAO,EAAC,OAAO,EACf,YAAY,EAAE,IAAI,EAClB,SAAS,EAAC,4BAA4B,aAEtC,KAAC,CAAC,IAAC,SAAS,EAAC,sBAAsB,GAAG,EACtC,eAAM,SAAS,EAAC,SAAS,sBAAa,IAC/B,CACV,IACA,CACJ,CAAC,GACS,GACH,GACE,CACjB,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE,CAAC,CAC1C,cACE,SAAS,EAAE,EAAE,CACX,kDAAkD,EAClD,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE,CAAC,CAC1C,cACE,SAAS,EAAE,EAAE,CACX,wEAAwE,EACxE,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB,EAAE,EAAE,CAAC,CACjE,KAAC,WAAW,IACV,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,EAAE,CACX,mDAAmD,EACnD,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACmC,EAAE,EAAE,CAAC,CAChD,YACE,SAAS,EAAE,EAAE,CACX,yEAAyE,EACzE,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,GACd,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { GroupProps as AriaGroupProps } from "react-aria-components";
|
|
3
|
+
declare const fieldGroupVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "ghost" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
interface GroupProps extends AriaGroupProps, VariantProps<typeof fieldGroupVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function FieldGroup({ className, variant, ...props }: GroupProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { FieldGroup, fieldGroupVariants };
|
|
10
|
+
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/components/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAEL,UAAU,IAAI,cAAc,EAE7B,MAAM,uBAAuB,CAAA;AAE9B,QAAA,MAAM,kBAAkB;;mFAqBtB,CAAA;AAEF,UAAU,UACR,SAAQ,cAAc,EACpB,YAAY,CAAC,OAAO,kBAAkB,CAAC;CAAG;AAE9C,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAS/D;AAED,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@eggspot/ui/lib/utils";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Group as AriaGroup, composeRenderProps, } from "react-aria-components";
|
|
6
|
+
const fieldGroupVariants = cva("", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: [
|
|
10
|
+
"bg-gray-2 relative flex h-8 w-full items-center overflow-hidden rounded-md px-3 py-2 transition-all md:text-sm",
|
|
11
|
+
"border-gray-7 border",
|
|
12
|
+
/* SVGs */
|
|
13
|
+
"[&_svg]:text-gray-11 [&_svg]:pointer-events-none [&_svg]:size-[14px] [&_svg]:shrink-0 [&_svg]:stroke-2",
|
|
14
|
+
/* Focus Within */
|
|
15
|
+
"data-[focus-within]:ring-accent-9 data-[focus-within]:border-accent-9 data-[focus-within]:ring-1",
|
|
16
|
+
/* Disabled */
|
|
17
|
+
"data-[disabled]:opacity-60",
|
|
18
|
+
/* Invalid */
|
|
19
|
+
"data-[invalid]:ring-error-9 aria-invalid:ring-error-9 data-[invalid]:border-error-9",
|
|
20
|
+
],
|
|
21
|
+
ghost: "",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
function FieldGroup({ className, variant, ...props }) {
|
|
29
|
+
return (_jsx(AriaGroup, { className: composeRenderProps(className, (className) => cn(fieldGroupVariants({ variant }), className)), ...props }));
|
|
30
|
+
}
|
|
31
|
+
export { FieldGroup, fieldGroupVariants };
|
|
32
|
+
//# sourceMappingURL=Field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../src/components/Field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACL,KAAK,IAAI,SAAS,EAElB,kBAAkB,GACnB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,kBAAkB,GAAG,GAAG,CAAC,EAAE,EAAE;IACjC,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,gHAAgH;gBAChH,sBAAsB;gBACtB,UAAU;gBACV,wGAAwG;gBACxG,kBAAkB;gBAClB,kGAAkG;gBAClG,cAAc;gBACd,4BAA4B;gBAC5B,aAAa;gBACb,qFAAqF;aACtF;YACD,KAAK,EAAE,EAAE;SACV;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CAAC,CAAA;AAMF,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAc;IAC9D,OAAO,CACL,KAAC,SAAS,IACR,SAAS,EAAE,kBAAkB,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CACrD,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,CAC/C,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAG9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,wBAAgB,MAAM,CAAC,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,2CAG3D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { FilterProvider } from "./Filter.store";
|
|
4
|
+
export function Filter(props) {
|
|
5
|
+
const { children, ...providerProps } = props;
|
|
6
|
+
return _jsx(FilterProvider, { ...providerProps, children: children });
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAIZ,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,MAAM,UAAU,MAAM,CAAC,KAAqC;IAC1D,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,GAAG,KAAK,CAAA;IAC5C,OAAO,KAAC,cAAc,OAAK,aAAa,YAAG,QAAQ,GAAkB,CAAA;AACvE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
import type { FilterBuilderItem, FilterContextValue, FilterProps, FilterRenderMode } from "./Filter.types";
|
|
3
|
+
export declare function useFilterContext(): FilterContextValue;
|
|
4
|
+
export declare function FilterProvider({ value: controlledValue, defaultValue, onChange, children, }: PropsWithChildren<FilterProps>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function FilterItemProvider({ item, mode, onClose, children, }: PropsWithChildren<{
|
|
6
|
+
item: FilterBuilderItem;
|
|
7
|
+
mode: FilterRenderMode;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function useFilterItem(): FilterBuilderItem | undefined;
|
|
11
|
+
export declare function useFilterItemMode(): FilterRenderMode | undefined;
|
|
12
|
+
export declare function useFilterItemClose(): (() => void) | undefined;
|
|
13
|
+
//# sourceMappingURL=Filter.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.store.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/Filter.store.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAElB,WAAW,EACX,gBAAgB,EAEjB,MAAM,gBAAgB,CAAA;AAIvB,wBAAgB,gBAAgB,uBAM/B;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EAAE,eAAe,EACtB,YAAY,EACZ,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,CAAC,WAAW,CAAC,2CA6ChC;AAaD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,GACT,EAAE,iBAAiB,CAAC;IACnB,IAAI,EAAE,iBAAiB,CAAA;IACvB,IAAI,EAAE,gBAAgB,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAC,2CAOD;AAED,wBAAgB,aAAa,kCAG5B;AAED,wBAAgB,iBAAiB,iCAGhC;AAED,wBAAgB,kBAAkB,WAnChB,IAAI,cAsCrB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo, useState, } from "react";
|
|
3
|
+
const FilterContext = createContext(undefined);
|
|
4
|
+
export function useFilterContext() {
|
|
5
|
+
const ctx = useContext(FilterContext);
|
|
6
|
+
if (!ctx) {
|
|
7
|
+
throw new Error("Filter components must be used within <Filter>");
|
|
8
|
+
}
|
|
9
|
+
return ctx;
|
|
10
|
+
}
|
|
11
|
+
export function FilterProvider({ value: controlledValue, defaultValue, onChange, children, }) {
|
|
12
|
+
const isControlled = controlledValue !== undefined;
|
|
13
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue ?? {});
|
|
14
|
+
const value = isControlled ? controlledValue : uncontrolledValue;
|
|
15
|
+
const setValue = (next) => {
|
|
16
|
+
if (!isControlled)
|
|
17
|
+
setUncontrolledValue(next);
|
|
18
|
+
onChange?.(next);
|
|
19
|
+
};
|
|
20
|
+
const setFieldValue = (field, fieldValue) => {
|
|
21
|
+
setValue({
|
|
22
|
+
...value,
|
|
23
|
+
[field]: fieldValue,
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const clearField = (field) => {
|
|
27
|
+
if (!(field in value))
|
|
28
|
+
return;
|
|
29
|
+
const { [field]: _removed, ...rest } = value;
|
|
30
|
+
setValue(rest);
|
|
31
|
+
};
|
|
32
|
+
const reset = () => {
|
|
33
|
+
setValue({});
|
|
34
|
+
};
|
|
35
|
+
const ctxValue = useMemo(() => ({
|
|
36
|
+
value,
|
|
37
|
+
onChange: setValue,
|
|
38
|
+
setFieldValue,
|
|
39
|
+
clearField,
|
|
40
|
+
reset,
|
|
41
|
+
}), [value]);
|
|
42
|
+
return (_jsx(FilterContext.Provider, { value: ctxValue, children: children }));
|
|
43
|
+
}
|
|
44
|
+
const FilterItemContext = createContext(undefined);
|
|
45
|
+
export function FilterItemProvider({ item, mode, onClose, children, }) {
|
|
46
|
+
const value = useMemo(() => ({ item, mode, onClose }), [item, mode, onClose]);
|
|
47
|
+
return (_jsx(FilterItemContext.Provider, { value: value, children: children }));
|
|
48
|
+
}
|
|
49
|
+
export function useFilterItem() {
|
|
50
|
+
const ctx = useContext(FilterItemContext);
|
|
51
|
+
return ctx?.item;
|
|
52
|
+
}
|
|
53
|
+
export function useFilterItemMode() {
|
|
54
|
+
const ctx = useContext(FilterItemContext);
|
|
55
|
+
return ctx?.mode;
|
|
56
|
+
}
|
|
57
|
+
export function useFilterItemClose() {
|
|
58
|
+
const ctx = useContext(FilterItemContext);
|
|
59
|
+
return ctx?.onClose;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=Filter.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.store.js","sourceRoot":"","sources":["../../../src/components/Filter/Filter.store.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,OAAO,EACP,QAAQ,GAET,MAAM,OAAO,CAAA;AAWd,MAAM,aAAa,GAAG,aAAa,CAAiC,SAAS,CAAC,CAAA;AAE9E,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IACrC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;IACnE,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,UAAU,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AE,QAAQ,YAAG,QAAQ,GAA0B,CAC7E,CAAA;AACH,CAAC;AASD,MAAM,iBAAiB,GAAG,aAAa,CACrC,SAAS,CACV,CAAA;AAED,MAAM,UAAU,kBAAkB,CAAC,EACjC,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,GAKR;IACA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IAC7E,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACrC,QAAQ,GACkB,CAC9B,CAAA;AACH,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACzC,OAAO,GAAG,EAAE,IAAI,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACzC,OAAO,GAAG,EAAE,IAAI,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACzC,OAAO,GAAG,EAAE,OAAO,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type FilterPrimitive = string | number | boolean | null | undefined | Date | [Date, Date] | (string | number)[];
|
|
3
|
+
export type SelectOption = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
avatar?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type SerializableSelectOption = Omit<SelectOption, "icon">;
|
|
10
|
+
export type DateFilterMode = "from" | "to" | "range";
|
|
11
|
+
export type DateFilterPreset = "lastWeek" | "thisWeek" | "thisMonth";
|
|
12
|
+
export interface DateModeFilterValue {
|
|
13
|
+
mode: DateFilterMode;
|
|
14
|
+
from?: Date;
|
|
15
|
+
to?: Date;
|
|
16
|
+
preset?: DateFilterPreset;
|
|
17
|
+
}
|
|
18
|
+
export type FilterFieldValue = FilterPrimitive | FilterPrimitive[] | SerializableSelectOption[] | DateModeFilterValue;
|
|
19
|
+
export type FilterValue = Record<string, FilterFieldValue>;
|
|
20
|
+
export interface FilterContextValue {
|
|
21
|
+
value: FilterValue;
|
|
22
|
+
onChange: (value: FilterValue) => void;
|
|
23
|
+
setFieldValue: (field: string, v: FilterFieldValue) => void;
|
|
24
|
+
clearField: (field: string) => void;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
}
|
|
27
|
+
export interface FilterProps {
|
|
28
|
+
value?: FilterValue;
|
|
29
|
+
defaultValue?: FilterValue;
|
|
30
|
+
onChange?: (value: FilterValue) => void;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export interface OptionsLoader {
|
|
34
|
+
hasNextPage: boolean;
|
|
35
|
+
onFetchNextPage: () => void;
|
|
36
|
+
isFetching?: boolean;
|
|
37
|
+
onSearch?: (search: string) => void;
|
|
38
|
+
}
|
|
39
|
+
export type FilterRenderMode = "builder" | "row";
|
|
40
|
+
export interface FilterBuilderItem {
|
|
41
|
+
type?: "filter";
|
|
42
|
+
field: string;
|
|
43
|
+
label: ReactNode;
|
|
44
|
+
icon?: ReactNode;
|
|
45
|
+
description?: ReactNode;
|
|
46
|
+
render: (mode: FilterRenderMode) => ReactNode;
|
|
47
|
+
options?: SelectOption[];
|
|
48
|
+
renderIcon?: (option: SelectOption, isSelected: boolean) => ReactNode;
|
|
49
|
+
multi?: boolean;
|
|
50
|
+
formatValue?: (value: unknown) => string;
|
|
51
|
+
isDisabled?: boolean;
|
|
52
|
+
renderRowValue?: (args: {
|
|
53
|
+
value: unknown;
|
|
54
|
+
field: string;
|
|
55
|
+
}) => React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
export interface FilterBuilderSeparator {
|
|
58
|
+
type: "separator";
|
|
59
|
+
}
|
|
60
|
+
export type FilterBuilderEntry = FilterBuilderItem | FilterBuilderSeparator;
|
|
61
|
+
export interface FilterBuilderProps {
|
|
62
|
+
items: FilterBuilderEntry[];
|
|
63
|
+
}
|
|
64
|
+
export declare function isFilterItem(entry: FilterBuilderEntry): entry is FilterBuilderItem;
|
|
65
|
+
export declare function isSelectOptionArray(value: unknown): value is SerializableSelectOption[];
|
|
66
|
+
//# sourceMappingURL=Filter.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.types.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/Filter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,IAAI,GACJ,CAAC,IAAI,EAAE,IAAI,CAAC,GACZ,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;AAEvB,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;AAEjE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAA;AACpD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAA;AAEpE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,cAAc,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,EAAE,CAAC,EAAE,IAAI,CAAA;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AS,CAAA;IAC7C,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,KAAK,SAAS,CAAA;IACrE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAA;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAA;CAC9E;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,sBAAsB,CAAA;AAE3E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,kBAAkB,EAAE,CAAA;CAC5B;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,kBAAkB,GACxB,KAAK,IAAI,iBAAiB,CAE5B;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,wBAAwB,EAAE,CAUrC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function isFilterItem(entry) {
|
|
2
|
+
return entry.type !== "separator";
|
|
3
|
+
}
|
|
4
|
+
export function isSelectOptionArray(value) {
|
|
5
|
+
if (!Array.isArray(value))
|
|
6
|
+
return false;
|
|
7
|
+
if (value.length === 0)
|
|
8
|
+
return false;
|
|
9
|
+
const first = value[0];
|
|
10
|
+
return (typeof first === "object" &&
|
|
11
|
+
first !== null &&
|
|
12
|
+
"value" in first &&
|
|
13
|
+
"label" in first);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Filter.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.types.js","sourceRoot":"","sources":["../../../src/components/Filter/Filter.types.ts"],"names":[],"mappings":"AAwFA,MAAM,UAAU,YAAY,CAC1B,KAAyB;IAEzB,OAAO,KAAK,CAAC,IAAI,KAAK,WAAW,CAAA;AACnC,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,KAAc;IAEd,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IACvC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IACpC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IACtB,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAO,IAAI,KAAK;QAChB,OAAO,IAAI,KAAK,CACjB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FilterBuilderEntry } from "./Filter.types";
|
|
2
|
+
interface FilterBarProps {
|
|
3
|
+
items: FilterBuilderEntry[];
|
|
4
|
+
}
|
|
5
|
+
export declare function FilterBar({ items }: FilterBarProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=FilterBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBar.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/FilterBar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAItE,UAAU,cAAc;IACtB,KAAK,EAAE,kBAAkB,EAAE,CAAA;CAC5B;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,cAAc,2CAuBlD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { useFilterContext } from "./Filter.store";
|
|
5
|
+
import { isFilterItem } from "./Filter.types";
|
|
6
|
+
import { FilterBuilder } from "./FilterBuilder";
|
|
7
|
+
import { FilterRow } from "./FilterRow";
|
|
8
|
+
export function FilterBar({ items }) {
|
|
9
|
+
const { value, clearField } = useFilterContext();
|
|
10
|
+
// Auto-clear values for disabled filters
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
for (const entry of items) {
|
|
13
|
+
if (!isFilterItem(entry))
|
|
14
|
+
continue;
|
|
15
|
+
if (entry.isDisabled && value[entry.field] != null) {
|
|
16
|
+
clearField(entry.field);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}, [items, value, clearField]);
|
|
20
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [items.map((entry) => {
|
|
21
|
+
if (!isFilterItem(entry))
|
|
22
|
+
return null;
|
|
23
|
+
if (value[entry.field] == null)
|
|
24
|
+
return null;
|
|
25
|
+
return _jsx(FilterRow, { item: entry }, entry.field);
|
|
26
|
+
}), _jsx(FilterBuilder, { items: items })] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=FilterBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../../src/components/Filter/FilterBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,YAAY,EAA2B,MAAM,gBAAgB,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAMvC,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAkB;IACjD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAEhD,yCAAyC;IACzC,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;YAC1B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;gBAAE,SAAQ;YAClC,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;gBACnD,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACzB,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAA;IAE9B,OAAO,CACL,eAAK,SAAS,EAAC,qCAAqC,aACjD,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBACnB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;oBAAE,OAAO,IAAI,CAAA;gBACrC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI;oBAAE,OAAO,IAAI,CAAA;gBAC3C,OAAO,KAAC,SAAS,IAAmB,IAAI,EAAE,KAAK,IAAxB,KAAK,CAAC,KAAK,CAAiB,CAAA;YACrD,CAAC,CAAC,EACF,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,GAAI,IAC3B,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/Filter/FilterBuilder.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAA;AAEvB,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE,kBAAkB,2CAoH1D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useState } from "react";
|
|
4
|
+
import { Button } from "@eggspot/ui/components/Button";
|
|
5
|
+
import { SearchInput } from "@eggspot/ui/components/Input";
|
|
6
|
+
import { Menu, MenuHeader, MenuItem, MenuPopover, MenuSeparator, MenuSubTrigger, MenuTrigger, } from "@eggspot/ui/components/Menu";
|
|
7
|
+
import { ListFilter as FilterIcon } from "lucide-react";
|
|
8
|
+
import { FilterItemProvider, useFilterContext } from "./Filter.store";
|
|
9
|
+
import { isFilterItem, } from "./Filter.types";
|
|
10
|
+
export function FilterBuilder({ items }) {
|
|
11
|
+
const { value: filters } = useFilterContext();
|
|
12
|
+
const [search, setSearch] = useState("");
|
|
13
|
+
const visibleItems = useMemo(() => items.filter((entry) => {
|
|
14
|
+
if (!isFilterItem(entry))
|
|
15
|
+
return !search;
|
|
16
|
+
if (!search)
|
|
17
|
+
return true;
|
|
18
|
+
const text = typeof entry.label === "string"
|
|
19
|
+
? entry.label.toLowerCase()
|
|
20
|
+
: entry.field.toLowerCase();
|
|
21
|
+
return text.includes(search.toLowerCase());
|
|
22
|
+
}), [items, search]);
|
|
23
|
+
const disabledKeys = useMemo(() => visibleItems
|
|
24
|
+
.filter((entry) => isFilterItem(entry) && entry.isDisabled === true)
|
|
25
|
+
.map((entry) => entry.field), [visibleItems]);
|
|
26
|
+
return (_jsxs(MenuTrigger, { onOpenChange: (isOpen) => {
|
|
27
|
+
if (isOpen)
|
|
28
|
+
setSearch("");
|
|
29
|
+
}, children: [_jsx(Button, { size: "sm", variant: "ghost", intent: "secondary", "aria-label": "Filter", tooltip: "Filter", children: _jsx(FilterIcon, { "aria-hidden": true }) }), _jsx(MenuPopover, { placement: "bottom start", className: "p-0", children: _jsxs("div", { className: "flex max-h-[400px] min-w-[200px] flex-col", children: [_jsx("div", { className: "border-gray-6 border-b p-2", children: _jsx(SearchInput, { autoFocus: true, placeholder: "Filter...", className: "placeholder:text-gray-8 h-7 rounded border-0 border-none! bg-transparent px-2 text-xs ring-0!", onChange: (value) => setSearch(value) }) }), visibleItems.length === 0 ? (_jsx("div", { className: "text-gray-11 px-3 py-4 text-center text-xs", children: "No matching filters" })) : (_jsxs(Menu, { className: "flex-1 overflow-auto", disabledKeys: disabledKeys, children: [_jsx(MenuHeader, { inset: false, separator: false, children: _jsx("span", { className: "text-gray-11 text-[11px] tracking-wide uppercase", children: "Filter by" }) }), visibleItems.map((entry, index) => {
|
|
30
|
+
if (!isFilterItem(entry)) {
|
|
31
|
+
return _jsx(MenuSeparator, {}, `separator-${index}`);
|
|
32
|
+
}
|
|
33
|
+
const hasValue = filters[entry.field] != null;
|
|
34
|
+
const isDisabled = entry.isDisabled ?? false;
|
|
35
|
+
return (_jsxs(MenuSubTrigger, { children: [_jsx(MenuItem, { id: entry.field, className: "data-open:bg-gray-3", children: _jsxs("div", { className: "flex items-center gap-2", children: [entry.icon && (_jsx("span", { className: isDisabled
|
|
36
|
+
? "text-gray-11 opacity-50"
|
|
37
|
+
: "text-gray-12", children: entry.icon })), _jsx("span", { className: isDisabled
|
|
38
|
+
? "text-gray-11 opacity-50"
|
|
39
|
+
: hasValue
|
|
40
|
+
? "text-gray-12"
|
|
41
|
+
: "text-gray-11", children: entry.label })] }) }), _jsx(MenuPopover, { className: "p-0", children: _jsx(FilterSubmenu, { item: entry }) })] }, entry.field));
|
|
42
|
+
})] }))] }) })] }));
|
|
43
|
+
}
|
|
44
|
+
function FilterSubmenu({ item }) {
|
|
45
|
+
return (_jsx(FilterItemProvider, { item: item, mode: "builder", children: item.render("builder") }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=FilterBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBuilder.js","sourceRoot":"","sources":["../../../src/components/Filter/FilterBuilder.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,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K,CAAC,IAAI,IAAI,CAAA;oCAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAA;oCAE5C,OAAO,CACL,MAAC,cAAc,eACb,KAAC,QAAQ,IAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAC,qBAAqB,YACxD,eAAK,SAAS,EAAC,yBAAyB,aACrC,KAAK,CAAC,IAAI,IAAI,CACb,eACE,SAAS,EACP,UAAU;gEACR,CAAC,CAAC,yBAAyB;gEAC3B,CAAC,CAAC,cAAc,YAGnB,KAAK,CAAC,IAAI,GACN,CACR,EACD,eACE,SAAS,EACP,UAAU;gEACR,CAAC,CAAC,yBAAyB;gEAC3B,CAAC,CAAC,QAAQ;oEACR,CAAC,CAAC,cAAc;oEAChB,CAAC,CAAC,cAAc,YAGrB,KAAK,CAAC,KAAK,GACP,IACH,GACG,EACX,KAAC,WAAW,IAAC,SAAS,EAAC,KAAK,YAC1B,KAAC,aAAa,IAAC,IAAI,EAAE,KAAK,GAAI,GAClB,KA7BK,KAAK,CAAC,KAAK,CA8Bf,CAClB,CAAA;gCACH,CAAC,CAAC,IACG,CACR,IACG,GACM,IACF,CACf,CAAA;AACH,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,IAAI,EAA+B;IAC1D,OAAO,CACL,KAAC,kBAAkB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,SAAS,YAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GACJ,CACtB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateModeRowValue.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/FilterField/DateModeRowValue.tsx"],"names":[],"mappings":"AAqDA,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd,2CAqIA"}
|