@erxes/ui 4.0.0-v2.0 → 4.0.0-v2.10
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/AGENTS.md +58 -0
- package/CATALOG.md +251 -0
- package/README.md +31 -8
- package/dist/base.css +17 -4
- package/dist/components/accordion.d.ts +7 -7
- package/dist/components/accordion.js +9 -13
- package/dist/components/alert-dialog.d.ts +16 -11
- package/dist/components/alert-dialog.js +30 -29
- package/dist/components/alert.d.ts +1 -0
- package/dist/components/alert.js +3 -2
- package/dist/components/avatar.d.ts +9 -5
- package/dist/components/avatar.js +31 -19
- package/dist/components/background-gradient-animation.d.ts +5 -11
- package/dist/components/background-gradient-animation.js +24 -50
- package/dist/components/badge.d.ts +6 -2
- package/dist/components/badge.js +38 -21
- package/dist/components/breadcrumb.d.ts +7 -4
- package/dist/components/breadcrumb.js +19 -14
- package/dist/components/button.d.ts +20 -7
- package/dist/components/button.js +50 -23
- package/dist/components/calendar.d.ts +5 -0
- package/dist/components/calendar.js +5 -1
- package/dist/components/card.d.ts +1 -0
- package/dist/components/card.js +2 -1
- package/dist/components/chart-config.d.ts +7 -18
- package/dist/components/chart-config.js +1 -6
- package/dist/components/charts.d.ts +7 -1
- package/dist/components/charts.js +31 -30
- package/dist/components/checkbox.d.ts +3 -3
- package/dist/components/checkbox.js +5 -6
- package/dist/components/choicebox-group.d.ts +2 -1
- package/dist/components/choicebox-group.js +6 -9
- package/dist/components/collapsible.d.ts +6 -9
- package/dist/components/collapsible.js +9 -25
- package/dist/components/color-picker.d.ts +1 -0
- package/dist/components/color-picker.js +21 -13
- package/dist/components/combobox.d.ts +11 -6
- package/dist/components/combobox.js +27 -18
- package/dist/components/command-bar.d.ts +4 -0
- package/dist/components/command-bar.js +26 -19
- package/dist/components/command.d.ts +22 -8
- package/dist/components/command.js +66 -26
- package/dist/components/context-menu.d.ts +18 -29
- package/dist/components/context-menu.js +21 -66
- package/dist/components/copy-text.d.ts +1 -0
- package/dist/components/copy-text.js +8 -11
- package/dist/components/date-picker-value.d.ts +5 -9
- package/dist/components/date-picker-value.js +15 -34
- package/dist/components/date-picker.d.ts +4 -4
- package/dist/components/date-picker.js +30 -25
- package/dist/components/date-text-input.d.ts +2 -4
- package/dist/components/date-text-input.js +14 -12
- package/dist/components/date-time-input.d.ts +12 -0
- package/dist/components/date-time-input.js +21 -0
- package/dist/components/dialog.d.ts +21 -12
- package/dist/components/dialog.js +40 -32
- package/dist/components/drag-handle.d.ts +3 -2
- package/dist/components/drag-handle.js +1 -1
- package/dist/components/dropdown-menu.d.ts +36 -16
- package/dist/components/dropdown-menu.js +79 -37
- package/dist/components/empty.d.ts +6 -1
- package/dist/components/empty.js +26 -3
- package/dist/components/form.d.ts +21 -8
- package/dist/components/form.js +42 -19
- package/dist/components/hover-card.d.ts +7 -5
- package/dist/components/hover-card.js +19 -9
- package/dist/components/icon-tip.d.ts +7 -0
- package/dist/components/icon-tip.js +16 -0
- package/dist/components/info-card.d.ts +4 -0
- package/dist/components/info-card.js +9 -6
- package/dist/components/input-group.d.ts +23 -0
- package/dist/components/input-group.js +43 -0
- package/dist/components/input.d.ts +12 -2
- package/dist/components/input.js +22 -8
- package/dist/components/kbd.d.ts +2 -1
- package/dist/components/kbd.js +4 -3
- package/dist/components/label.d.ts +3 -3
- package/dist/components/label.js +9 -6
- package/dist/components/multiselect.d.ts +22 -6
- package/dist/components/multiselect.js +82 -127
- package/dist/components/on-demand.d.ts +23 -0
- package/dist/components/on-demand.js +48 -0
- package/dist/components/popover.d.ts +22 -9
- package/dist/components/popover.js +42 -13
- package/dist/components/radio-group.d.ts +6 -5
- package/dist/components/radio-group.js +24 -29
- package/dist/components/resizable.d.ts +8 -21
- package/dist/components/resizable.js +5 -10
- package/dist/components/scroll-area.d.ts +13 -7
- package/dist/components/scroll-area.js +19 -18
- package/dist/components/select.d.ts +26 -14
- package/dist/components/select.js +96 -51
- package/dist/components/separator.d.ts +7 -3
- package/dist/components/separator.js +12 -12
- package/dist/components/sheet.d.ts +19 -11
- package/dist/components/sheet.js +70 -50
- package/dist/components/sidebar/context.js +4 -4
- package/dist/components/sidebar/group.d.ts +9 -8
- package/dist/components/sidebar/group.js +18 -13
- package/dist/components/sidebar/layout.d.ts +7 -2
- package/dist/components/sidebar/layout.js +11 -3
- package/dist/components/sidebar/menu-sub.d.ts +4 -3
- package/dist/components/sidebar/menu-sub.js +13 -13
- package/dist/components/sidebar/menu.d.ts +6 -6
- package/dist/components/sidebar/menu.js +28 -40
- package/dist/components/sidebar/panel.js +38 -21
- package/dist/components/sidebar/root.d.ts +1 -2
- package/dist/components/sidebar/root.js +7 -8
- package/dist/components/sidebar/trigger.js +1 -1
- package/dist/components/sidebar-tree-indicator.js +4 -4
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +1 -0
- package/dist/components/skeleton.d.ts +8 -1
- package/dist/components/skeleton.js +19 -2
- package/dist/components/slider.d.ts +5 -5
- package/dist/components/slider.js +20 -11
- package/dist/components/spinner.d.ts +3 -2
- package/dist/components/spinner.js +25 -188
- package/dist/components/string-array.js +3 -2
- package/dist/components/switch.d.ts +3 -3
- package/dist/components/switch.js +7 -8
- package/dist/components/table.d.ts +18 -3
- package/dist/components/table.js +37 -9
- package/dist/components/tabs.d.ts +41 -8
- package/dist/components/tabs.js +103 -23
- package/dist/components/text-overflow.d.ts +11 -10
- package/dist/components/text-overflow.js +36 -39
- package/dist/components/textarea.d.ts +9 -1
- package/dist/components/textarea.js +25 -3
- package/dist/components/toaster.d.ts +4 -0
- package/dist/components/toaster.js +44 -20
- package/dist/components/toggle-group.d.ts +10 -3
- package/dist/components/toggle-group.js +28 -21
- package/dist/components/toggle.d.ts +4 -4
- package/dist/components/toggle.js +7 -6
- package/dist/components/tooltip.d.ts +11 -6
- package/dist/components/tooltip.js +22 -8
- package/dist/components/upload.d.ts +11 -2
- package/dist/components/upload.js +47 -17
- package/dist/components.css +325 -0
- package/dist/constants/CountryPhoneCodes.d.ts +1 -1
- package/dist/constants/CountryPhoneCodes.js +2 -2
- package/dist/federation.d.ts +17 -0
- package/dist/federation.js +34 -0
- package/dist/fonts.css +1 -1
- package/dist/hooks/use-confirm.js +17 -19
- package/dist/hooks/use-item-keys.d.ts +11 -0
- package/dist/hooks/use-item-keys.js +24 -0
- package/dist/hooks/use-page-hotkey.d.ts +12 -0
- package/dist/hooks/use-page-hotkey.js +22 -0
- package/dist/hooks/use-toast.d.ts +19 -16
- package/dist/hooks/use-toast.js +18 -108
- package/dist/index.d.ts +41 -13
- package/dist/index.js +37 -10
- package/dist/lib/cn-tables.d.ts +27 -0
- package/dist/lib/cn-tables.js +128 -0
- package/dist/lib/format.d.ts +60 -0
- package/dist/lib/format.js +86 -0
- package/dist/lib/money.d.ts +13 -0
- package/dist/lib/money.js +21 -0
- package/dist/lib/stored.d.ts +13 -0
- package/dist/lib/stored.js +41 -0
- package/dist/lib/text.d.ts +11 -0
- package/dist/lib/text.js +18 -0
- package/dist/lib/utils.d.ts +14 -2
- package/dist/lib/utils.js +14 -6
- package/dist/modules/attachments/attachment-media.js +56 -56
- package/dist/modules/attachments/use-carousel.js +5 -10
- package/dist/modules/blocks/components/BarcodeAttribute.js +11 -8
- package/dist/modules/blocks/components/BarcodeSizeSettings.js +5 -6
- package/dist/modules/blocks/components/BlockEditor.js +14 -4
- package/dist/modules/blocks/components/BlockEditorInlineContent.d.ts +26 -36
- package/dist/modules/blocks/components/BlockEditorInlineContent.js +2 -2
- package/dist/modules/blocks/components/BlockToolbar.d.ts +6 -0
- package/dist/modules/blocks/components/BlockToolbar.js +19 -4
- package/dist/modules/blocks/components/CustomFileBlock.d.ts +13 -39
- package/dist/modules/blocks/components/CustomFileBlock.js +8 -9
- package/dist/modules/blocks/components/CustomImageBlock.d.ts +28 -78
- package/dist/modules/blocks/components/CustomImageBlock.js +20 -99
- package/dist/modules/blocks/components/CustomVideoBlock.d.ts +26 -63
- package/dist/modules/blocks/components/CustomVideoBlock.js +10 -8
- package/dist/modules/blocks/components/DocumentPlaceholderBlock.d.ts +13 -39
- package/dist/modules/blocks/components/DocumentPlaceholderBlock.js +1 -2
- package/dist/modules/blocks/components/Editor.d.ts +1 -1
- package/dist/modules/blocks/components/Editor.js +5 -4
- package/dist/modules/blocks/components/FontFamilyButton.js +25 -21
- package/dist/modules/blocks/components/FontSizeButton.js +26 -22
- package/dist/modules/blocks/components/GalleryBlock.d.ts +7 -25
- package/dist/modules/blocks/components/GalleryBlock.js +2 -35
- package/dist/modules/blocks/components/GalleryBlockContent.js +8 -3
- package/dist/modules/blocks/components/GalleryBlockParts.js +23 -21
- package/dist/modules/blocks/components/GalleryExternalHtml.d.ts +2 -0
- package/dist/modules/blocks/components/GalleryExternalHtml.js +36 -0
- package/dist/modules/blocks/components/ImageExternalHtml.d.ts +2 -0
- package/dist/modules/blocks/components/ImageExternalHtml.js +51 -0
- package/dist/modules/blocks/components/ImageStyleButton.js +22 -18
- package/dist/modules/blocks/components/LazyEditor.d.ts +9 -0
- package/dist/modules/blocks/components/LazyEditor.js +14 -0
- package/dist/modules/blocks/components/MediaBlockWrapper.d.ts +24 -0
- package/dist/modules/blocks/components/MediaBlockWrapper.js +98 -0
- package/dist/modules/blocks/components/SlashMenu.js +2 -2
- package/dist/modules/blocks/components/SuggestionMenu.js +5 -6
- package/dist/modules/blocks/components/TableColorPicker.d.ts +1 -1
- package/dist/modules/blocks/components/TableColorPicker.js +20 -27
- package/dist/modules/blocks/components/TableHandleWithRemove.js +34 -50
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.js +3 -4
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.js +3 -4
- package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.d.ts +3 -0
- package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.js +8 -0
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuDropdown.js +1 -1
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.js +5 -16
- package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.d.ts +1 -1
- package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.js +24 -20
- package/dist/modules/blocks/constant/blockEditorSchema.d.ts +268 -653
- package/dist/modules/blocks/constant/blockEditorSchema.js +33 -41
- package/dist/modules/blocks/constant/galleryBlockConfig.d.ts +1 -2
- package/dist/modules/blocks/constant/imageBlockConfig.d.ts +46 -0
- package/dist/modules/blocks/constant/imageBlockConfig.js +39 -0
- package/dist/modules/blocks/constant/toolbar/editorUIComponents.d.ts +2 -3
- package/dist/modules/blocks/constant/toolbar/editorUIComponents.js +7 -9
- package/dist/modules/blocks/hooks/toolbar/useCodeActive.js +5 -7
- package/dist/modules/blocks/hooks/toolbar/useStringStyle.d.ts +9 -0
- package/dist/modules/blocks/hooks/toolbar/useStringStyle.js +27 -0
- package/dist/modules/blocks/hooks/useBarcodeSizeForm.d.ts +1 -1
- package/dist/modules/blocks/hooks/useBlockEditor.d.ts +2 -0
- package/dist/modules/blocks/hooks/useBlockEditor.js +9 -3
- package/dist/modules/blocks/hooks/useEditorValue.d.ts +2 -1
- package/dist/modules/blocks/hooks/useEditorValue.js +8 -19
- package/dist/modules/blocks/types/TextEditor.d.ts +3 -1
- package/dist/modules/blocks/types/toolbar/ImageStyleOption.d.ts +1 -1
- package/dist/modules/blocks/utils/getSlashMenuItems.js +0 -15
- package/dist/modules/blocks/utils/parseBlocks.d.ts +3 -1
- package/dist/modules/blocks/utils/parseBlocks.js +14 -1
- package/dist/modules/conditions/ConditionValueInput.d.ts +10 -0
- package/dist/modules/conditions/ConditionValueInput.js +166 -0
- package/dist/modules/conditions/ConditionsEditor.d.ts +11 -0
- package/dist/modules/conditions/ConditionsEditor.js +209 -0
- package/dist/modules/conditions/LazyConditionsEditor.d.ts +10 -0
- package/dist/modules/conditions/LazyConditionsEditor.js +11 -0
- package/dist/modules/conditions/PathPicker.d.ts +8 -0
- package/dist/modules/conditions/PathPicker.js +51 -0
- package/dist/modules/conditions/conditions.d.ts +66 -0
- package/dist/modules/conditions/conditions.js +136 -0
- package/dist/modules/display/components/EmailDisplay.d.ts +4 -0
- package/dist/modules/display/components/EmailDisplay.js +29 -27
- package/dist/modules/display/components/PhoneDisplay.d.ts +4 -0
- package/dist/modules/display/components/PhoneDisplay.js +6 -2
- package/dist/modules/display/components/RelativeDateDisplay.d.ts +8 -6
- package/dist/modules/display/components/RelativeDateDisplay.js +16 -17
- package/dist/modules/display/components/SexDisplay.d.ts +1 -0
- package/dist/modules/display/components/SexDisplay.js +1 -0
- package/dist/modules/filter/components/Filter.d.ts +4 -0
- package/dist/modules/filter/components/Filter.js +4 -0
- package/dist/modules/filter/components/FilterBar.js +11 -13
- package/dist/modules/filter/components/FilterDialog.js +17 -25
- package/dist/modules/filter/components/FilterPopover.js +21 -29
- package/dist/modules/filter/components/FilterProvider.d.ts +1 -2
- package/dist/modules/filter/components/FilterProvider.js +22 -16
- package/dist/modules/filter/hooks/useFilterContext.d.ts +1 -0
- package/dist/modules/filter/hooks/useFilterContext.js +1 -0
- package/dist/modules/filter/types/filter.d.ts +0 -1
- package/dist/modules/hotkey/components/PopoverScoped.d.ts +10 -4
- package/dist/modules/hotkey/components/PopoverScoped.js +10 -5
- package/dist/modules/hotkey/hooks/usePreviousHotkeyScope.d.ts +1 -0
- package/dist/modules/hotkey/hooks/usePreviousHotkeyScope.js +1 -0
- package/dist/modules/hotkey/hooks/useScopedHotkeys.d.ts +7 -3
- package/dist/modules/hotkey/hooks/useScopedHotkeys.js +19 -24
- package/dist/modules/icons/components/IconComponent.d.ts +5 -1
- package/dist/modules/icons/components/IconComponent.js +4 -0
- package/dist/modules/icons/components/IconPicker.d.ts +4 -0
- package/dist/modules/icons/components/IconPicker.js +20 -17
- package/dist/modules/icons/providers/IconsProvider.d.ts +1 -0
- package/dist/modules/icons/providers/IconsProvider.js +1 -0
- package/dist/modules/inputs/components/ContactFieldParts.js +13 -14
- package/dist/modules/inputs/components/EmailField.d.ts +4 -1
- package/dist/modules/inputs/components/EmailField.js +4 -1
- package/dist/modules/inputs/components/EmailFieldForm.js +2 -3
- package/dist/modules/inputs/components/FullNameField.d.ts +6 -0
- package/dist/modules/inputs/components/FullNameField.js +25 -11
- package/dist/modules/inputs/components/PhoneField.d.ts +4 -1
- package/dist/modules/inputs/components/PhoneField.js +4 -1
- package/dist/modules/inputs/components/PhoneFieldForm.js +2 -1
- package/dist/modules/inputs/components/SexField.d.ts +1 -0
- package/dist/modules/inputs/components/SexField.js +1 -0
- package/dist/modules/layout/components/AppLayout.d.ts +6 -6
- package/dist/modules/layout/components/AppLayout.js +29 -32
- package/dist/modules/layout/components/AppLayoutPageSlot.js +1 -1
- package/dist/modules/layout/components/AppLayoutResizeHandle.d.ts +5 -12
- package/dist/modules/layout/components/AppLayoutResizeHandle.js +16 -19
- package/dist/modules/layout/components/Page.d.ts +11 -1
- package/dist/modules/layout/components/Page.js +16 -3
- package/dist/modules/layout/components/PageHeader.d.ts +14 -4
- package/dist/modules/layout/components/PageHeader.js +27 -6
- package/dist/modules/list/DisplayMenu.d.ts +24 -0
- package/dist/modules/list/DisplayMenu.js +87 -0
- package/dist/modules/list/ListFilter.d.ts +63 -0
- package/dist/modules/list/ListFilter.js +44 -0
- package/dist/modules/list/ViewBar.d.ts +13 -0
- package/dist/modules/list/ViewBar.js +30 -0
- package/dist/modules/list/filter/AdvancedFilterDialog.d.ts +5 -0
- package/dist/modules/list/filter/AdvancedFilterDialog.js +52 -0
- package/dist/modules/list/filter/FieldMenus.d.ts +5 -0
- package/dist/modules/list/filter/FieldMenus.js +184 -0
- package/dist/modules/list/filter/ListFilterBar.d.ts +6 -0
- package/dist/modules/list/filter/ListFilterBar.js +246 -0
- package/dist/modules/list/filter/RecordCount.d.ts +7 -0
- package/dist/modules/list/filter/RecordCount.js +22 -0
- package/dist/modules/list/filter/RuleChips.d.ts +2 -0
- package/dist/modules/list/filter/RuleChips.js +157 -0
- package/dist/modules/list/filter/fieldIcons.d.ts +7 -0
- package/dist/modules/list/filter/fieldIcons.js +16 -0
- package/dist/modules/list/filter/filterRules.d.ts +46 -0
- package/dist/modules/list/filter/filterRules.js +166 -0
- package/dist/modules/list/filter/listFilterContext.d.ts +29 -0
- package/dist/modules/list/filter/listFilterContext.js +34 -0
- package/dist/modules/list/filter/listFilterQuery.d.ts +16 -0
- package/dist/modules/list/filter/listFilterQuery.js +22 -0
- package/dist/modules/navigation-menu/components/NavigationMenu.d.ts +4 -3
- package/dist/modules/navigation-menu/components/NavigationMenu.js +18 -21
- package/dist/modules/pickers/EntityPicker.d.ts +37 -0
- package/dist/modules/pickers/EntityPicker.js +67 -0
- package/dist/modules/pickers/LookupPicker.d.ts +51 -0
- package/dist/modules/pickers/LookupPicker.js +84 -0
- package/dist/modules/pickers/SelectMember.d.ts +41 -0
- package/dist/modules/pickers/SelectMember.js +122 -0
- package/dist/modules/pickers/members.d.ts +30 -0
- package/dist/modules/pickers/members.js +18 -0
- package/dist/modules/record-field/components/NumberField.d.ts +7 -2
- package/dist/modules/record-field/components/NumberField.js +33 -29
- package/dist/modules/record-field/components/TextField.d.ts +7 -3
- package/dist/modules/record-field/components/TextField.js +38 -30
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.d.ts +8 -1
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.js +23 -12
- package/dist/modules/record-list/RecordList.d.ts +18 -0
- package/dist/modules/record-list/RecordList.js +23 -0
- package/dist/modules/record-list/RecordListProvider.d.ts +30 -0
- package/dist/modules/record-list/RecordListProvider.js +57 -0
- package/dist/modules/record-list/RecordListRoot.d.ts +28 -0
- package/dist/modules/record-list/RecordListRoot.js +124 -0
- package/dist/modules/record-list/selection.d.ts +22 -0
- package/dist/modules/record-list/selection.js +54 -0
- package/dist/modules/record-panel/PanelDescriptionEditor.d.ts +9 -0
- package/dist/modules/record-panel/PanelDescriptionEditor.js +39 -0
- package/dist/modules/record-panel/PanelDescriptionField.d.ts +13 -0
- package/dist/modules/record-panel/PanelDescriptionField.js +39 -0
- package/dist/modules/record-panel/PanelField.d.ts +17 -0
- package/dist/modules/record-panel/PanelField.js +47 -0
- package/dist/modules/record-panel/PanelForm.d.ts +22 -0
- package/dist/modules/record-panel/PanelForm.js +81 -0
- package/dist/modules/record-panel/PanelLabel.d.ts +10 -0
- package/dist/modules/record-panel/PanelLabel.js +55 -0
- package/dist/modules/record-panel/PanelSection.d.ts +12 -0
- package/dist/modules/record-panel/PanelSection.js +24 -0
- package/dist/modules/record-panel/panelExpansion.d.ts +10 -0
- package/dist/modules/record-panel/panelExpansion.js +7 -0
- package/dist/modules/record-panel/useSaveOnLeave.d.ts +14 -0
- package/dist/modules/record-panel/useSaveOnLeave.js +42 -0
- package/dist/modules/record-table/components/CheckboxColumn.d.ts +4 -3
- package/dist/modules/record-table/components/CheckboxColumn.js +52 -35
- package/dist/modules/record-table/components/MoreColumn.js +4 -3
- package/dist/modules/record-table/components/RecordTable.d.ts +9 -2
- package/dist/modules/record-table/components/RecordTable.js +8 -1
- package/dist/modules/record-table/components/RecordTableCell.d.ts +15 -3
- package/dist/modules/record-table/components/RecordTableCell.js +31 -11
- package/dist/modules/record-table/components/RecordTableCellInline.d.ts +20 -4
- package/dist/modules/record-table/components/RecordTableCellInline.js +49 -24
- package/dist/modules/record-table/components/RecordTableColumnSelector.d.ts +1 -2
- package/dist/modules/record-table/components/RecordTableColumnSelector.js +48 -45
- package/dist/modules/record-table/components/RecordTableContainer.d.ts +8 -3
- package/dist/modules/record-table/components/RecordTableContainer.js +28 -16
- package/dist/modules/record-table/components/RecordTableCursor.js +33 -31
- package/dist/modules/record-table/components/RecordTableHead.d.ts +9 -4
- package/dist/modules/record-table/components/RecordTableHead.js +40 -34
- package/dist/modules/record-table/components/RecordTableHeader.js +24 -15
- package/dist/modules/record-table/components/RecordTableProvider.d.ts +30 -7
- package/dist/modules/record-table/components/RecordTableProvider.js +41 -26
- package/dist/modules/record-table/components/RecordTableRoot.d.ts +2 -1
- package/dist/modules/record-table/components/RecordTableRoot.js +7 -12
- package/dist/modules/record-table/components/RecordTableRow.d.ts +8 -1
- package/dist/modules/record-table/components/RecordTableRow.js +13 -12
- package/dist/modules/record-table/components/RecordTableRowList.d.ts +6 -1
- package/dist/modules/record-table/components/RecordTableRowList.js +28 -20
- package/dist/modules/record-table/components/RecordTableRowSkeleton.js +8 -12
- package/dist/modules/record-table/hooks/useColumnLayout.d.ts +2 -2
- package/dist/modules/record-table/hooks/useColumnLayout.js +8 -5
- package/dist/modules/record-table/hooks/useTablePreferences.d.ts +6 -6
- package/dist/modules/record-table/hooks/useTablePreferences.js +21 -34
- package/dist/modules/record-table/states/RecordTableCursorState.d.ts +21 -1
- package/dist/modules/record-table/states/RecordTableCursorState.js +21 -3
- package/dist/modules/record-table/types/RecordTableCursorTypes.d.ts +1 -0
- package/dist/modules/record-table/types/RecordTableCursorTypes.js +1 -0
- package/dist/modules/record-table/utils/columnLayout.d.ts +4 -4
- package/dist/modules/record-table/utils/columnLayout.js +7 -7
- package/dist/modules/record-table/utils/columnUtils.d.ts +3 -2
- package/dist/modules/record-table/utils/rowFields.d.ts +1 -0
- package/dist/modules/record-table/utils/rowFields.js +10 -9
- package/dist/modules/records/ContactLink.d.ts +13 -0
- package/dist/modules/records/ContactLink.js +77 -0
- package/dist/modules/records/contacts.d.ts +35 -0
- package/dist/modules/records/contacts.js +10 -0
- package/dist/modules/records/openRecord.d.ts +44 -0
- package/dist/modules/records/openRecord.js +48 -0
- package/dist/state/sidebarPanelState.d.ts +5 -1
- package/dist/state/sidebarPanelState.js +11 -3
- package/dist/state/themeState.d.ts +13 -2
- package/dist/state/themeState.js +18 -4
- package/dist/styles.css +3 -0
- package/dist/theme.css +106 -70
- package/dist/types/SexCode.d.ts +1 -0
- package/dist/types/SexCode.js +1 -0
- package/dist/types/UIConfig.d.ts +131 -3
- package/dist/utils/IsUndefinedOrNull.d.ts +1 -0
- package/dist/utils/IsUndefinedOrNull.js +1 -0
- package/dist/utils/file-storage.d.ts +2 -1
- package/dist/utils/file-storage.js +1 -0
- package/dist/utils/format/formatPhoneNumber.d.ts +4 -0
- package/dist/utils/format/formatPhoneNumber.js +4 -0
- package/dist/utils/getPluginAssetsUrl.d.ts +5 -0
- package/dist/utils/getPluginAssetsUrl.js +5 -0
- package/dist/utils/host-component.d.ts +10 -0
- package/dist/utils/host-component.js +34 -0
- package/dist/utils/json.d.ts +3 -2
- package/dist/utils/json.js +3 -2
- package/dist/utils/plugin-runtime.d.ts +21 -17
- package/dist/utils/plugin-runtime.js +59 -12
- package/dist/utils/plugin-styles.d.ts +7 -0
- package/dist/utils/plugin-styles.js +54 -0
- package/dist/utils/record-timeline.d.ts +10 -9
- package/dist/utils/record-timeline.js +12 -17
- package/exports.txt +226 -0
- package/package.json +37 -24
- package/dist/components/multiselect-options.d.ts +0 -16
- package/dist/components/multiselect-options.js +0 -13
- package/dist/components/multiselect-parts.d.ts +0 -23
- package/dist/components/multiselect-parts.js +0 -62
- package/dist/components/multiselect-state.d.ts +0 -66
- package/dist/components/multiselect-state.js +0 -131
- package/dist/components/time-picker.d.ts +0 -10
- package/dist/components/time-picker.js +0 -33
- package/dist/components/toasts.d.ts +0 -21
- package/dist/components/toasts.js +0 -69
- package/dist/constants/IntlLanguages.d.ts +0 -74
- package/dist/constants/IntlLanguages.js +0 -76
- package/dist/hooks/use-query-state.d.ts +0 -16
- package/dist/hooks/use-query-state.js +0 -122
- package/dist/modules/blocks/hooks/toolbar/useFontFamily.d.ts +0 -2
- package/dist/modules/blocks/hooks/toolbar/useFontFamily.js +0 -24
- package/dist/modules/blocks/hooks/toolbar/useFontSize.d.ts +0 -2
- package/dist/modules/blocks/hooks/toolbar/useFontSize.js +0 -24
- package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.d.ts +0 -6
- package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.js +0 -0
- package/dist/modules/blocks/types/toolbar/FontFamily.d.ts +0 -5
- package/dist/modules/blocks/types/toolbar/FontFamily.js +0 -0
- package/dist/modules/blocks/types/toolbar/FontSize.d.ts +0 -5
- package/dist/modules/blocks/types/toolbar/FontSize.js +0 -0
- package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.d.ts +0 -4
- package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.js +0 -0
- package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.d.ts +0 -3
- package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.js +0 -0
- package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.d.ts +0 -2
- package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.js +0 -30
- package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.d.ts +0 -2
- package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.js +0 -41
- package/dist/modules/filter/hooks/useFilterQueryState.d.ts +0 -4
- package/dist/modules/filter/hooks/useFilterQueryState.js +0 -14
- package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.d.ts +0 -9
- package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.js +0 -15
- package/dist/modules/hotkey/states/internal/pendingHotkeyState.d.ts +0 -4
- package/dist/modules/hotkey/states/internal/pendingHotkeyState.js +0 -4
- package/dist/types/Theme.d.ts +0 -1
- package/dist/types/Theme.js +0 -0
- package/dist/utils/localization/formatDateISOStringToRelativeDate.d.ts +0 -2
- package/dist/utils/localization/formatDateISOStringToRelativeDate.js +0 -16
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
import { toggleVariants } from "./toggle.js";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { ToggleGroup as ToggleGroup$1 } from "radix-ui";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
6
|
+
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
6
7
|
// src/components/toggle-group.tsx
|
|
7
8
|
const ToggleGroupContext = React.createContext({
|
|
8
9
|
size: "default",
|
|
9
10
|
variant: "default"
|
|
10
11
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
children
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
/** The value is an array: one item for a single choice, empty when nothing is pressed. */
|
|
13
|
+
const ToggleGroupRoot = ({ className, variant, size, children, ...props }) => {
|
|
14
|
+
const look = React.useMemo(() => ({
|
|
15
|
+
variant,
|
|
16
|
+
size
|
|
17
|
+
}), [variant, size]);
|
|
18
|
+
return /* @__PURE__ */ jsx(ToggleGroup$1, {
|
|
19
|
+
className: cn("flex items-center justify-center gap-1 isolate", variant === "outline" && "gap-0 bg-muted rounded", className),
|
|
20
|
+
...props,
|
|
21
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext, {
|
|
22
|
+
value: look,
|
|
23
|
+
children
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const ToggleGroupItem = ({ className, variant, size, ...props }) => {
|
|
28
|
+
const context = React.use(ToggleGroupContext);
|
|
29
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
27
30
|
className: cn(toggleVariants({
|
|
28
31
|
variant: context.variant || variant,
|
|
29
32
|
size: context.size || size,
|
|
30
|
-
className: context.variant === "outline" && "shadow-none bg-transparent data-
|
|
33
|
+
className: context.variant === "outline" && "shadow-none bg-transparent data-pressed:bg-background data-pressed:shadow-xs relative data-pressed:z-10 hover:text-foreground"
|
|
31
34
|
}), className),
|
|
32
|
-
...props
|
|
33
|
-
children
|
|
35
|
+
...props
|
|
34
36
|
});
|
|
35
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* A row of toggle buttons where one or several stay pressed.
|
|
40
|
+
* The value is an array: one item for a single choice, empty when nothing is pressed. A list's
|
|
41
|
+
* table or board switch is `DisplayMenu`, not this.
|
|
42
|
+
*/
|
|
36
43
|
const ToggleGroup = Object.assign(ToggleGroupRoot, { Item: ToggleGroupItem });
|
|
37
44
|
export { ToggleGroup };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Toggle as Toggle$1 } from "radix-ui";
|
|
3
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
4
3
|
export declare const toggleVariants: (props?: ({
|
|
5
4
|
variant?: "default" | "outline" | null | undefined;
|
|
6
|
-
size?: "default" | "lg" | "sm" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "icon-sm" | "lg" | "sm" | null | undefined;
|
|
7
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
|
|
7
|
+
/** A button that stays pressed or not, such as bold in a toolbar. */
|
|
8
|
+
export declare const Toggle: <Value extends string>({ className, variant, size, ...props }: Toggle$1.Props<Value> & VariantProps<typeof toggleVariants>) => import("react").JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Toggle as Toggle$1 } from "radix-ui";
|
|
4
2
|
import { jsx } from "react/jsx-runtime";
|
|
5
3
|
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
6
5
|
// src/components/toggle.tsx
|
|
7
|
-
const toggleVariants = cva("inline-flex items-center justify-center rounded text-sm font-medium text-muted-foreground ring-offset-background transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-
|
|
6
|
+
const toggleVariants = cva("inline-flex items-center justify-center rounded text-sm font-medium text-muted-foreground ring-offset-background transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-pressed:bg-border data-pressed:text-foreground [&>svg]:pointer-events-none [&>svg]:size-4 [&>svg]:shrink-0 gap-2", {
|
|
8
7
|
variants: {
|
|
9
8
|
variant: {
|
|
10
9
|
default: "bg-transparent",
|
|
@@ -13,7 +12,9 @@ const toggleVariants = cva("inline-flex items-center justify-center rounded text
|
|
|
13
12
|
size: {
|
|
14
13
|
default: "h-7 px-3 min-w-10",
|
|
15
14
|
sm: "h-6 px-3 min-w-9 font-normal text-xs",
|
|
16
|
-
lg: "h-8 px-5 min-w-11"
|
|
15
|
+
lg: "h-8 px-5 min-w-11",
|
|
16
|
+
icon: "size-7 min-w-7 px-0",
|
|
17
|
+
"icon-sm": "size-6 min-w-6 px-0"
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
defaultVariants: {
|
|
@@ -21,8 +22,8 @@ const toggleVariants = cva("inline-flex items-center justify-center rounded text
|
|
|
21
22
|
size: "default"
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
/** A button that stays pressed or not, such as bold in a toolbar. */
|
|
26
|
+
const Toggle = ({ className, variant, size, ...props }) => /* @__PURE__ */ jsx(Toggle$1, {
|
|
26
27
|
className: cn(toggleVariants({
|
|
27
28
|
variant,
|
|
28
29
|
size,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
2
|
+
/** Opens after 700ms and skips the delay for 300ms after one closes, the timings the app had under Radix. */
|
|
3
|
+
declare const TooltipProvider: ({ delay, timeout, ...props }: Tooltip$1.Provider.Props) => import("react").JSX.Element;
|
|
4
|
+
declare const TooltipContent: ({ className, side, sideOffset, align, alignOffset, ...props }: Tooltip$1.Popup.Props & Pick<Tooltip$1.Positioner.Props, 'side' | 'sideOffset' | 'align' | 'alignOffset'>) => import("react").JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* A short label that shows on hover or focus of its trigger.
|
|
7
|
+
* Wrap it in `Tooltip.Provider`. For an icon button's label, use `IconTip`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Tooltip: (<Payload>(props: Tooltip$1.Root.Props<Payload>) => React.JSX.Element) & {
|
|
10
|
+
Provider: typeof TooltipProvider;
|
|
11
|
+
Trigger: Tooltip$1.Trigger;
|
|
7
12
|
Content: typeof TooltipContent;
|
|
8
13
|
};
|
|
9
14
|
export {};
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Tooltip as Tooltip$1 } from "radix-ui";
|
|
4
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
5
4
|
// src/components/tooltip.tsx
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/** Opens after 700ms and skips the delay for 300ms after one closes, the timings the app had under Radix. */
|
|
6
|
+
const TooltipProvider = ({ delay = 700, timeout = 300, ...props }) => /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
7
|
+
delay,
|
|
8
|
+
timeout,
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
const TooltipContent = ({ className, side = "top", sideOffset = 8, align = "center", alignOffset = 0, ...props }) => /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
|
|
12
|
+
className: "isolate z-50",
|
|
13
|
+
side,
|
|
8
14
|
sideOffset,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
align,
|
|
16
|
+
alignOffset,
|
|
17
|
+
collisionPadding: 0,
|
|
18
|
+
children: /* @__PURE__ */ jsx(Tooltip$1.Popup, {
|
|
19
|
+
className: cn("overflow-hidden rounded-md bg-foreground px-3 py-1.5 text-xs text-background animate-in fade-in-0 zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
|
|
20
|
+
...props
|
|
21
|
+
})
|
|
12
22
|
}) });
|
|
23
|
+
/**
|
|
24
|
+
* A short label that shows on hover or focus of its trigger.
|
|
25
|
+
* Wrap it in `Tooltip.Provider`. For an icon button's label, use `IconTip`.
|
|
26
|
+
*/
|
|
13
27
|
const Tooltip = Object.assign(Tooltip$1.Root, {
|
|
14
|
-
Provider:
|
|
28
|
+
Provider: TooltipProvider,
|
|
15
29
|
Trigger: Tooltip$1.Trigger,
|
|
16
30
|
Content: TooltipContent
|
|
17
31
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonProps } from "./button.js";
|
|
2
2
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
4
|
/** The stored address, with what is known about the file; `url` is empty after a removal. */
|
|
4
5
|
type UploadValue = {
|
|
5
6
|
url: string;
|
|
@@ -14,19 +15,27 @@ type UploadRootProps = {
|
|
|
14
15
|
multiple?: boolean;
|
|
15
16
|
} & Omit<ComponentPropsWithoutRef<'div'>, 'onChange'>;
|
|
16
17
|
declare const UploadRoot: ({ ref, className, value, onChange, multiple, ...rest }: UploadRootProps & React.RefAttributes<HTMLDivElement>) => import("react").JSX.Element;
|
|
17
|
-
|
|
18
|
+
declare const uploadPreviewVariants: (props?: ({
|
|
19
|
+
variant?: "avatar" | "default" | null | undefined;
|
|
20
|
+
size?: "default" | "sm" | null | undefined;
|
|
21
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
|
+
type UploadPreviewProps = VariantProps<typeof uploadPreviewVariants> & {
|
|
18
23
|
className?: string;
|
|
19
24
|
onUploadStart?: (fileCount?: number) => void;
|
|
20
25
|
onUploadProgress?: () => void;
|
|
21
26
|
onAllUploadsComplete?: () => void;
|
|
22
27
|
};
|
|
23
|
-
declare const UploadPreview: ({ className, ...callbacks }: UploadPreviewProps) => import("react").JSX.Element;
|
|
28
|
+
declare const UploadPreview: ({ className, variant, size, ...callbacks }: UploadPreviewProps) => import("react").JSX.Element;
|
|
24
29
|
declare const UploadButton: ({ ref, children, className, ...props }: ButtonProps & {
|
|
25
30
|
children?: ReactNode;
|
|
26
31
|
} & React.RefAttributes<HTMLButtonElement>) => import("react").JSX.Element;
|
|
27
32
|
declare const RemoveButton: ({ ref, children, className, ...props }: ButtonProps & {
|
|
28
33
|
children?: ReactNode;
|
|
29
34
|
} & React.RefAttributes<HTMLButtonElement>) => import("react").JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* An image upload: a preview tile, an upload button and a remove button.
|
|
37
|
+
* `Upload.Root` takes the stored `value` and gets the new address, empty after a removal.
|
|
38
|
+
*/
|
|
30
39
|
export declare const Upload: {
|
|
31
40
|
Root: typeof UploadRoot;
|
|
32
41
|
Preview: typeof UploadPreview;
|
|
@@ -5,9 +5,10 @@ import { useToast } from "../hooks/use-toast.js";
|
|
|
5
5
|
import { useUpload } from "../hooks/use-upload.js";
|
|
6
6
|
import { cn } from "../lib/utils.js";
|
|
7
7
|
import { readImage } from "../utils/core.js";
|
|
8
|
-
import { createContext, useContext, useRef, useState } from "react";
|
|
9
8
|
import { IconTrash, IconUpload, IconUserCircle } from "@tabler/icons-react";
|
|
10
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { createContext, useContext, useMemo, useRef, useState } from "react";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
11
12
|
import { useTranslation } from "react-i18next";
|
|
12
13
|
// src/components/upload.tsx
|
|
13
14
|
const UploadContext = createContext(null);
|
|
@@ -22,28 +23,34 @@ const UploadRoot = ({ ref, className, value, onChange, multiple, ...rest }) => {
|
|
|
22
23
|
const [previewUrl, setPreviewUrl] = useState();
|
|
23
24
|
const [isImageFocused, setIsImageFocused] = useState(false);
|
|
24
25
|
const url = previewUrl ?? value;
|
|
26
|
+
const upload = useMemo(() => ({
|
|
27
|
+
url,
|
|
28
|
+
multiple,
|
|
29
|
+
onChange,
|
|
30
|
+
fileInputRef,
|
|
31
|
+
previewRef,
|
|
32
|
+
setPreviewUrl,
|
|
33
|
+
chooseFile: () => fileInputRef.current?.click(),
|
|
34
|
+
setIsImageFocused
|
|
35
|
+
}), [
|
|
36
|
+
url,
|
|
37
|
+
multiple,
|
|
38
|
+
onChange
|
|
39
|
+
]);
|
|
25
40
|
return /* @__PURE__ */ jsxs(UploadContext.Provider, {
|
|
26
|
-
value:
|
|
27
|
-
url,
|
|
28
|
-
multiple,
|
|
29
|
-
onChange,
|
|
30
|
-
fileInputRef,
|
|
31
|
-
previewRef,
|
|
32
|
-
setPreviewUrl,
|
|
33
|
-
chooseFile: () => fileInputRef.current?.click(),
|
|
34
|
-
setIsImageFocused
|
|
35
|
-
},
|
|
41
|
+
value: upload,
|
|
36
42
|
children: [/* @__PURE__ */ jsx(Dialog, {
|
|
37
43
|
open: isImageFocused,
|
|
38
44
|
onOpenChange: setIsImageFocused,
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
|
|
45
|
+
children: /* @__PURE__ */ jsx(Dialog.Content, {
|
|
46
|
+
variant: "bare",
|
|
47
|
+
className: "max-w-none w-auto",
|
|
41
48
|
children: /* @__PURE__ */ jsx("img", {
|
|
42
49
|
src: readImage(url),
|
|
43
50
|
alt: "Focused view",
|
|
44
|
-
className: "max-h-
|
|
51
|
+
className: "max-h-lightbox max-w-lightbox object-contain"
|
|
45
52
|
})
|
|
46
|
-
})
|
|
53
|
+
})
|
|
47
54
|
}), /* @__PURE__ */ jsx("div", {
|
|
48
55
|
ref,
|
|
49
56
|
className: cn("flex gap-4", className),
|
|
@@ -51,6 +58,22 @@ const UploadRoot = ({ ref, className, value, onChange, multiple, ...rest }) => {
|
|
|
51
58
|
})]
|
|
52
59
|
});
|
|
53
60
|
};
|
|
61
|
+
const uploadPreviewVariants = cva("relative overflow-hidden", {
|
|
62
|
+
variants: {
|
|
63
|
+
variant: {
|
|
64
|
+
default: "",
|
|
65
|
+
avatar: "rounded-full border border-border p-0 shadow-none"
|
|
66
|
+
},
|
|
67
|
+
size: {
|
|
68
|
+
default: "size-16",
|
|
69
|
+
sm: "size-8"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
variant: "default",
|
|
74
|
+
size: "default"
|
|
75
|
+
}
|
|
76
|
+
});
|
|
54
77
|
/** Uploads the chosen files, reporting each one and the end of the batch. */
|
|
55
78
|
const useUploadChosenFiles = ({ onUploadStart, onUploadProgress, onAllUploadsComplete }) => {
|
|
56
79
|
const { isLoading, upload } = useUpload();
|
|
@@ -83,7 +106,7 @@ const useUploadChosenFiles = ({ onUploadStart, onUploadProgress, onAllUploadsCom
|
|
|
83
106
|
handleFileChange
|
|
84
107
|
};
|
|
85
108
|
};
|
|
86
|
-
const UploadPreview = ({ className, ...callbacks }) => {
|
|
109
|
+
const UploadPreview = ({ className, variant, size, ...callbacks }) => {
|
|
87
110
|
const { url, multiple, fileInputRef, chooseFile, setIsImageFocused } = useUploadContext();
|
|
88
111
|
const { isLoading, handleFileChange } = useUploadChosenFiles(callbacks);
|
|
89
112
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -91,7 +114,10 @@ const UploadPreview = ({ className, ...callbacks }) => {
|
|
|
91
114
|
children: [/* @__PURE__ */ jsxs(Button, {
|
|
92
115
|
type: "button",
|
|
93
116
|
variant: "outline",
|
|
94
|
-
className:
|
|
117
|
+
className: uploadPreviewVariants({
|
|
118
|
+
variant,
|
|
119
|
+
size
|
|
120
|
+
}),
|
|
95
121
|
onClick: url ? () => setIsImageFocused(true) : chooseFile,
|
|
96
122
|
"aria-label": url ? "Change image" : "Upload image",
|
|
97
123
|
children: [
|
|
@@ -170,6 +196,10 @@ const RemoveButton = ({ ref, children, className, ...props }) => {
|
|
|
170
196
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconTrash, {}), " Remove"] })
|
|
171
197
|
});
|
|
172
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* An image upload: a preview tile, an upload button and a remove button.
|
|
201
|
+
* `Upload.Root` takes the stored `value` and gets the new address, empty after a removal.
|
|
202
|
+
*/
|
|
173
203
|
const Upload = {
|
|
174
204
|
Root: UploadRoot,
|
|
175
205
|
Preview: UploadPreview,
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Styles utilities can't reach: the BlockNote editor's own markup (slash menu, toolbar, drag
|
|
3
|
+
* handle, headings, theme variables) and the sidebar menu's nested selectors.
|
|
4
|
+
*/
|
|
5
|
+
.bn-shadcn {
|
|
6
|
+
--background: 0 0% 100%;
|
|
7
|
+
--foreground: 0 0% 3.9%;
|
|
8
|
+
--card: 0 0% 100%;
|
|
9
|
+
--card-foreground: 0 0% 3.9%;
|
|
10
|
+
--popover: 0 0% 100%;
|
|
11
|
+
--popover-foreground: 240 10% 3.9%;
|
|
12
|
+
--primary: 243 75% 59%;
|
|
13
|
+
--primary-foreground: 0 0% 98%;
|
|
14
|
+
--secondary: 0 0% 96.1%;
|
|
15
|
+
--secondary-foreground: 0 0% 9%;
|
|
16
|
+
--muted: 0 0% 96.1%;
|
|
17
|
+
--muted-foreground: 0 0% 45.1%;
|
|
18
|
+
--accent: 0 0% 96.1%;
|
|
19
|
+
--accent-foreground: 0 0% 9%;
|
|
20
|
+
--destructive: 0 84.2% 60.2%;
|
|
21
|
+
--destructive-foreground: 0 0% 98%;
|
|
22
|
+
--border: 240 5.9% 90%;
|
|
23
|
+
--input: 240 5.9% 90%;
|
|
24
|
+
--ring: 243 75% 59%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.bn-shadcn.dark {
|
|
28
|
+
--background: 240 10% 3.9%;
|
|
29
|
+
--foreground: 0 0% 98%;
|
|
30
|
+
--card: 240 10% 3.9%;
|
|
31
|
+
--card-foreground: 0 0% 98%;
|
|
32
|
+
--popover: 240 10% 3.9%;
|
|
33
|
+
--popover-foreground: 0 0% 98%;
|
|
34
|
+
--secondary: 240 3.7% 15.9%;
|
|
35
|
+
--secondary-foreground: 0 0% 98%;
|
|
36
|
+
--muted: 240 3.7% 15.9%;
|
|
37
|
+
--muted-foreground: 240 5% 64.9%;
|
|
38
|
+
--accent: 240 3.7% 15.9%;
|
|
39
|
+
--accent-foreground: 0 0% 98%;
|
|
40
|
+
--destructive: 0 62.8% 30.6%;
|
|
41
|
+
--destructive-foreground: 0 0% 98%;
|
|
42
|
+
--border: 240 3.7% 15.9%;
|
|
43
|
+
--input: 240 3.7% 15.9%;
|
|
44
|
+
--ring: 234.5 89.5% 73.9%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* The empty-line placeholder and the drag handle take BlockNote's side-menu colour,
|
|
48
|
+
#cfcfcf by default (1.6:1 on white). */
|
|
49
|
+
.bn-shadcn,
|
|
50
|
+
.bn-shadcn.dark {
|
|
51
|
+
--bn-colors-side-menu: hsl(var(--muted-foreground));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before {
|
|
55
|
+
font-style: normal;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bn-editor {
|
|
59
|
+
padding-inline: 36px;
|
|
60
|
+
min-height: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.bn-shadcn .bn-editor {
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bn-default-styles {
|
|
69
|
+
font-size: inherit;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.bn-editor [class^='_inlineContent']:before {
|
|
73
|
+
color: var(--muted-foreground);
|
|
74
|
+
font-style: normal !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.bn-editor .bn-inline-content:has(> .ProseMirror-trailingBreak):before {
|
|
78
|
+
font-style: normal;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.bn-editor .bn-container .bn-drag-handle {
|
|
82
|
+
width: 20px;
|
|
83
|
+
height: 20px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.bn-editor .bn-block-content[data-content-type='checkListItem'] > div > div {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.bn-editor .bn-drag-handle-menu {
|
|
92
|
+
background: var(--background);
|
|
93
|
+
backdrop-filter: var(--blur-medium);
|
|
94
|
+
box-shadow: var(--shadow-medium);
|
|
95
|
+
min-width: 160px;
|
|
96
|
+
min-height: 96px;
|
|
97
|
+
padding: 4px;
|
|
98
|
+
border: 1px solid var(--border);
|
|
99
|
+
left: 26px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.bn-editor .bn-inline-content,
|
|
103
|
+
.bn-editor .ProseMirror,
|
|
104
|
+
.bn-editor [contenteditable='true'] {
|
|
105
|
+
min-width: 0;
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
overflow-wrap: anywhere;
|
|
108
|
+
}
|
|
109
|
+
.bn-editor .bn-container .bn-suggestion-menu-item:hover {
|
|
110
|
+
background-color: var(--primary);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.bn-editor .bn-container .bn-suggestion-menu {
|
|
114
|
+
padding: 4px;
|
|
115
|
+
border-radius: 8px;
|
|
116
|
+
border: 1px solid var(--border);
|
|
117
|
+
background: var(--background);
|
|
118
|
+
backdrop-filter: var(--blur-medium);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.bn-editor .bn-color-picker-dropdown {
|
|
122
|
+
margin-left: 8px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.bn-editor .bn-inline-content code {
|
|
126
|
+
font-family: monospace;
|
|
127
|
+
color: var(--font-color-danger);
|
|
128
|
+
padding: 2px 4px;
|
|
129
|
+
border-radius: 4px;
|
|
130
|
+
border: 1px solid var(--font-color-extra-light);
|
|
131
|
+
font-size: 0.9rem;
|
|
132
|
+
background-color: var(--background-transparent-light);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.bn-toolbar.bn-formatting-toolbar {
|
|
136
|
+
padding: 2px;
|
|
137
|
+
gap: 2px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.bn-toolbar.bn-formatting-toolbar button {
|
|
141
|
+
height: 28px;
|
|
142
|
+
padding: 4px 7px;
|
|
143
|
+
font-size: 13px;
|
|
144
|
+
outline: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.read-only.bn-shadcn .bn-editor {
|
|
148
|
+
background-color: transparent;
|
|
149
|
+
padding-inline: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.bn-side-menu {
|
|
153
|
+
height: 26px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[data-content-type='heading'] {
|
|
157
|
+
--level: 24px;
|
|
158
|
+
}
|
|
159
|
+
[data-content-type='heading'][data-level='2'] {
|
|
160
|
+
--level: 20px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-content-type='heading'][data-level='3'] {
|
|
164
|
+
--level: 16px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.erxes-blocknote {
|
|
168
|
+
--erxes-block-background: var(--background);
|
|
169
|
+
--erxes-block-foreground: var(--foreground);
|
|
170
|
+
--erxes-block-card: var(--background);
|
|
171
|
+
--erxes-block-card-foreground: var(--foreground);
|
|
172
|
+
--erxes-block-primary: var(--primary);
|
|
173
|
+
--erxes-block-primary-foreground: var(--primary-foreground);
|
|
174
|
+
--erxes-block-accent: var(--accent);
|
|
175
|
+
--erxes-block-accent-foreground: var(--accent-foreground);
|
|
176
|
+
--erxes-block-muted: var(--muted);
|
|
177
|
+
--erxes-block-muted-foreground: var(--muted-foreground);
|
|
178
|
+
--erxes-block-destructive: var(--destructive);
|
|
179
|
+
--erxes-block-destructive-foreground: var(--destructive-foreground);
|
|
180
|
+
--erxes-block-border: var(--border);
|
|
181
|
+
--erxes-block-input: var(--input);
|
|
182
|
+
--erxes-block-ring: var(--ring);
|
|
183
|
+
}
|
|
184
|
+
.erxes-block-controls {
|
|
185
|
+
--background: var(--erxes-block-background);
|
|
186
|
+
--foreground: var(--erxes-block-foreground);
|
|
187
|
+
--card: var(--erxes-block-card);
|
|
188
|
+
--card-foreground: var(--erxes-block-card-foreground);
|
|
189
|
+
--primary: var(--erxes-block-primary);
|
|
190
|
+
--primary-foreground: var(--erxes-block-primary-foreground);
|
|
191
|
+
--accent: var(--erxes-block-accent);
|
|
192
|
+
--accent-foreground: var(--erxes-block-accent-foreground);
|
|
193
|
+
--muted: var(--erxes-block-muted);
|
|
194
|
+
--muted-foreground: var(--erxes-block-muted-foreground);
|
|
195
|
+
--destructive: var(--erxes-block-destructive);
|
|
196
|
+
--destructive-foreground: var(--erxes-block-destructive-foreground);
|
|
197
|
+
--border: var(--erxes-block-border);
|
|
198
|
+
--input: var(--erxes-block-input);
|
|
199
|
+
--ring: var(--erxes-block-ring);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* Sidebar body (plugin ./sidebar remotes, core modules): top-level groups use
|
|
203
|
+
0.5rem padding on all sides; nested groups (like sales board rows) keep theirs */
|
|
204
|
+
[data-navigation-context]
|
|
205
|
+
[data-sidebar='group']:not([data-sidebar='group'] [data-sidebar='group']) {
|
|
206
|
+
padding: 0.5rem;
|
|
207
|
+
}
|
|
208
|
+
/* Sidebar body: the first group starts flush with the switcher, however deeply it is wrapped */
|
|
209
|
+
[data-navigation-context] > [data-sidebar='group']:first-child,
|
|
210
|
+
[data-navigation-context] > :first-child [data-sidebar='group']:first-child,
|
|
211
|
+
[data-navigation-context]
|
|
212
|
+
> [data-sidebar='separator']:first-child
|
|
213
|
+
+ *
|
|
214
|
+
[data-sidebar='group']:first-child,
|
|
215
|
+
[data-navigation-context] > [data-sidebar='separator']:first-child + [data-sidebar='group'] {
|
|
216
|
+
padding-top: 0;
|
|
217
|
+
}
|
|
218
|
+
/* All sidebar menus: muted icons, sharper labels */
|
|
219
|
+
:is([data-sidebar='menu-button'], [data-sidebar='menu-sub-button'], [data-nav-row]) {
|
|
220
|
+
transition: color 0.15s ease-out;
|
|
221
|
+
}
|
|
222
|
+
:is([data-sidebar='menu-button'], [data-sidebar='menu-sub-button'], [data-nav-row]) svg {
|
|
223
|
+
color: inherit;
|
|
224
|
+
transition: color 0.15s ease-out;
|
|
225
|
+
}
|
|
226
|
+
:is([data-sidebar='menu-button'], [data-sidebar='menu-sub-button'], [data-nav-row]):not(
|
|
227
|
+
[data-active='true'],
|
|
228
|
+
[data-state='active'],
|
|
229
|
+
.text-primary-text
|
|
230
|
+
) {
|
|
231
|
+
color: color-mix(in oklab, var(--foreground) 85%, transparent);
|
|
232
|
+
}
|
|
233
|
+
:is([data-sidebar='menu-button'], [data-sidebar='menu-sub-button'], [data-nav-row]):not(
|
|
234
|
+
[data-active='true'],
|
|
235
|
+
[data-state='active'],
|
|
236
|
+
.text-primary-text
|
|
237
|
+
)
|
|
238
|
+
svg {
|
|
239
|
+
color: var(--muted-foreground);
|
|
240
|
+
}
|
|
241
|
+
:is([data-sidebar='menu-button'], [data-sidebar='menu-sub-button'], [data-nav-row]):not(
|
|
242
|
+
[data-active='true'],
|
|
243
|
+
[data-state='active'],
|
|
244
|
+
.text-primary-text
|
|
245
|
+
):hover,
|
|
246
|
+
:is([data-sidebar='menu-button'], [data-sidebar='menu-sub-button'], [data-nav-row]):not(
|
|
247
|
+
[data-active='true'],
|
|
248
|
+
[data-state='active'],
|
|
249
|
+
.text-primary-text
|
|
250
|
+
):hover
|
|
251
|
+
svg {
|
|
252
|
+
color: var(--foreground);
|
|
253
|
+
}
|
|
254
|
+
[data-navigation-context]
|
|
255
|
+
[data-sidebar='menu-item']:has([data-nav-actions])
|
|
256
|
+
[data-sidebar='menu-button']:not(:has([data-nav-chevron])) {
|
|
257
|
+
padding-right: 3.75rem;
|
|
258
|
+
}
|
|
259
|
+
[data-navigation-context] [data-sidebar='menu-item']:has([data-nav-actions]) [data-nav-chevron] {
|
|
260
|
+
margin-left: 3.25rem;
|
|
261
|
+
}
|
|
262
|
+
[data-navigation-context] [data-sidebar='menu-item']:has([data-nav-chevron]) [data-nav-actions] {
|
|
263
|
+
right: 1.75rem;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Inside the editor BlockNote redefines --background/--border as HSL parts, so
|
|
267
|
+
erxes-ui's bg-background/border resolve to nothing: give the slash menu
|
|
268
|
+
solid colours the way BlockNote's own components read them. */
|
|
269
|
+
.bn-shadcn .erxes-suggestion-menu {
|
|
270
|
+
background-color: hsl(var(--background));
|
|
271
|
+
border-color: hsl(var(--border));
|
|
272
|
+
color: hsl(var(--foreground));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* BackgroundGradientAnimation: five colour blobs orbit over a violet to navy backdrop. They
|
|
276
|
+
fill the middle 80%, blend in hard light, and goo merges them through the component's
|
|
277
|
+
#blurMe SVG filter. */
|
|
278
|
+
@utility gradient-backdrop {
|
|
279
|
+
background-image: linear-gradient(40deg, rgb(108 0 162), rgb(0 17 82));
|
|
280
|
+
}
|
|
281
|
+
@utility gradient-blob {
|
|
282
|
+
position: absolute;
|
|
283
|
+
inset: 10%;
|
|
284
|
+
mix-blend-mode: hard-light;
|
|
285
|
+
background-repeat: no-repeat;
|
|
286
|
+
}
|
|
287
|
+
@utility gradient-blob-1 {
|
|
288
|
+
background-image: radial-gradient(circle at center, rgb(18 113 255) 0, rgb(18 113 255) 50%);
|
|
289
|
+
transform-origin: center;
|
|
290
|
+
}
|
|
291
|
+
@utility gradient-blob-2 {
|
|
292
|
+
background-image: radial-gradient(
|
|
293
|
+
circle at center,
|
|
294
|
+
rgb(221 74 255 / 0.8) 0,
|
|
295
|
+
rgb(221 74 255 / 0) 50%
|
|
296
|
+
);
|
|
297
|
+
transform-origin: calc(50% - 400px);
|
|
298
|
+
}
|
|
299
|
+
@utility gradient-blob-3 {
|
|
300
|
+
background-image: radial-gradient(
|
|
301
|
+
circle at center,
|
|
302
|
+
rgb(100 220 255 / 0.8) 0,
|
|
303
|
+
rgb(100 220 255 / 0) 50%
|
|
304
|
+
);
|
|
305
|
+
transform-origin: calc(50% + 400px);
|
|
306
|
+
}
|
|
307
|
+
@utility gradient-blob-4 {
|
|
308
|
+
background-image: radial-gradient(
|
|
309
|
+
circle at center,
|
|
310
|
+
rgb(200 50 50 / 0.8) 0,
|
|
311
|
+
rgb(200 50 50 / 0) 50%
|
|
312
|
+
);
|
|
313
|
+
transform-origin: calc(50% - 200px);
|
|
314
|
+
}
|
|
315
|
+
@utility gradient-blob-5 {
|
|
316
|
+
background-image: radial-gradient(
|
|
317
|
+
circle at center,
|
|
318
|
+
rgb(180 180 50 / 0.8) 0,
|
|
319
|
+
rgb(180 180 50 / 0) 50%
|
|
320
|
+
);
|
|
321
|
+
transform-origin: calc(50% - 800px) calc(50% + 800px);
|
|
322
|
+
}
|
|
323
|
+
@utility goo {
|
|
324
|
+
filter: url(#blurMe) blur(40px);
|
|
325
|
+
}
|
|
@@ -3,5 +3,5 @@ import { CountryCode } from "libphonenumber-js";
|
|
|
3
3
|
export type PhoneCountry = TCountryCode & {
|
|
4
4
|
code: CountryCode;
|
|
5
5
|
};
|
|
6
|
-
/** Every country libphonenumber-js knows, with its English name and calling code, by name. */
|
|
6
|
+
/** Every country libphonenumber-js knows, with its English name and calling code: Mongolia first, then by name. */
|
|
7
7
|
export declare const CountryPhoneCodes: PhoneCountry[];
|