@majapisoftwares/ui 4.3.17 → 6.0.0
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 +27 -0
- package/README.md +79 -0
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/components.json +25 -0
- package/docs/MIGRATION-0.2.md +20 -0
- package/docs/MIGRATION-6.0.md +33 -0
- package/docs/NEXT-STARTER-VALIDATION.md +14 -0
- package/docs/STANDARDS.md +41 -0
- package/docs/VALIDATION.md +11 -0
- package/docs/VERSIONING.md +28 -0
- package/package.json +78 -2
- package/scripts/check-standards.mjs +41 -0
- package/src/components/ui/accordion.tsx +82 -0
- package/src/components/ui/alert-dialog.tsx +187 -0
- package/src/components/ui/alert.tsx +77 -0
- package/src/components/ui/avatar.tsx +108 -0
- package/src/components/ui/badge.tsx +55 -0
- package/src/components/ui/breadcrumb.tsx +125 -0
- package/src/components/ui/button-group.tsx +89 -0
- package/src/components/ui/button.tsx +59 -0
- package/src/components/ui/card.tsx +101 -0
- package/src/components/ui/checkbox.tsx +27 -0
- package/src/components/ui/collapsible.tsx +21 -0
- package/src/components/ui/context-menu.tsx +271 -0
- package/src/components/ui/dialog.tsx +161 -0
- package/src/components/ui/dropdown-menu.tsx +271 -0
- package/src/components/ui/empty.tsx +105 -0
- package/src/components/ui/field.tsx +238 -0
- package/src/components/ui/hover-card.tsx +50 -0
- package/src/components/ui/input-group.tsx +155 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/kbd.tsx +28 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/orb.css +1002 -0
- package/src/components/ui/orb.tsx +752 -0
- package/src/components/ui/popover.tsx +89 -0
- package/src/components/ui/progress.tsx +82 -0
- package/src/components/ui/radio-group.tsx +37 -0
- package/src/components/ui/scroll-area.tsx +54 -0
- package/src/components/ui/select.tsx +204 -0
- package/src/components/ui/separator.tsx +24 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +1035 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +53 -0
- package/src/components/ui/sonner.tsx +44 -0
- package/src/components/ui/spinner.tsx +32 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/table.tsx +121 -0
- package/src/components/ui/tabs.tsx +81 -0
- package/src/components/ui/textarea.tsx +19 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +44 -0
- package/src/components/ui/tooltip.tsx +65 -0
- package/src/hooks/use-mobile.ts +20 -0
- package/src/lib/i18n.tsx +109 -0
- package/src/lib/utils.ts +1 -0
- package/src/patterns/app-shell.tsx +175 -0
- package/src/patterns/data-table.tsx +2486 -0
- package/src/patterns/details-sheet.tsx +53 -0
- package/src/patterns/filter-tabs.tsx +53 -0
- package/src/patterns/majapi-logo.tsx +32 -0
- package/src/patterns/page-header.tsx +62 -0
- package/src/patterns/preferences.tsx +172 -0
- package/src/patterns/status-badge.tsx +24 -0
- package/src/styles.css +165 -0
- package/src/templates/admin-dashboard.tsx +44 -0
- package/src/templates/auth-layout.tsx +30 -0
- package/src/templates/login-form.tsx +129 -0
- package/src/templates/signup-form.tsx +177 -0
- package/base.css +0 -360
- package/bootstrap/AppProps.d.ts +0 -9
- package/bootstrap/AppProps.js +0 -1
- package/bootstrap/index.d.ts +0 -1
- package/bootstrap/index.js +0 -1
- package/bootstrap/modeScript.d.ts +0 -2
- package/bootstrap/modeScript.js +0 -35
- package/bootstrap/nprogress.d.ts +0 -1
- package/bootstrap/nprogress.js +0 -19
- package/bootstrap/scrolledScript.d.ts +0 -2
- package/bootstrap/scrolledScript.js +0 -27
- package/bootstrap/setupFocusManager.d.ts +0 -1
- package/bootstrap/setupFocusManager.js +0 -13
- package/bootstrap/suppressConsoleLog.d.ts +0 -1
- package/bootstrap/suppressConsoleLog.js +0 -8
- package/components/Accordion/Accordion.d.ts +0 -16
- package/components/Accordion/Accordion.jsx +0 -27
- package/components/Accordion/index.d.ts +0 -3
- package/components/Accordion/index.jsx +0 -3
- package/components/Alert/Alert.d.ts +0 -31
- package/components/Alert/Alert.jsx +0 -53
- package/components/Alert/index.d.ts +0 -3
- package/components/Alert/index.jsx +0 -3
- package/components/AntiClickjacking/AntiClickjacking.d.ts +0 -1
- package/components/AntiClickjacking/AntiClickjacking.jsx +0 -17
- package/components/AntiClickjacking/index.d.ts +0 -2
- package/components/AntiClickjacking/index.jsx +0 -2
- package/components/Aurora/Aurora.d.ts +0 -10
- package/components/Aurora/Aurora.jsx +0 -189
- package/components/Aurora/index.d.ts +0 -3
- package/components/Aurora/index.jsx +0 -3
- package/components/Autocomplete/Autocomplete.d.ts +0 -7
- package/components/Autocomplete/Autocomplete.jsx +0 -23
- package/components/Autocomplete/UnstyledAutocomplete.d.ts +0 -36
- package/components/Autocomplete/UnstyledAutocomplete.jsx +0 -72
- package/components/Autocomplete/index.d.ts +0 -5
- package/components/Autocomplete/index.jsx +0 -5
- package/components/BackgroundEffects/BottomBlurryPoint.d.ts +0 -3
- package/components/BackgroundEffects/BottomBlurryPoint.jsx +0 -14
- package/components/BackgroundEffects/TopBlurryPoint.d.ts +0 -3
- package/components/BackgroundEffects/TopBlurryPoint.jsx +0 -14
- package/components/Badge/Badge.d.ts +0 -42
- package/components/Badge/Badge.jsx +0 -51
- package/components/Badge/index.d.ts +0 -3
- package/components/Badge/index.jsx +0 -3
- package/components/Breadcrumbs/Breadcrumbs.d.ts +0 -20
- package/components/Breadcrumbs/Breadcrumbs.jsx +0 -42
- package/components/Breadcrumbs/index.d.ts +0 -3
- package/components/Breadcrumbs/index.jsx +0 -3
- package/components/Button/Button.d.ts +0 -111
- package/components/Button/Button.jsx +0 -129
- package/components/Button/UnstyledButton.d.ts +0 -10
- package/components/Button/UnstyledButton.jsx +0 -13
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.jsx +0 -3
- package/components/Carousel/Carousel.d.ts +0 -19
- package/components/Carousel/Carousel.jsx +0 -55
- package/components/Carousel/index.d.ts +0 -3
- package/components/Carousel/index.jsx +0 -3
- package/components/Checkbox/Checkbox.d.ts +0 -14
- package/components/Checkbox/Checkbox.jsx +0 -45
- package/components/Checkbox/index.d.ts +0 -3
- package/components/Checkbox/index.js +0 -3
- package/components/Code/Code.d.ts +0 -12
- package/components/Code/Code.jsx +0 -25
- package/components/Code/Json.d.ts +0 -5
- package/components/Code/Json.jsx +0 -7
- package/components/Code/index.d.ts +0 -4
- package/components/Code/index.jsx +0 -4
- package/components/ConfirmationButton/ConfirmationButton.d.ts +0 -17
- package/components/ConfirmationButton/ConfirmationButton.jsx +0 -13
- package/components/ConfirmationButton/index.d.ts +0 -3
- package/components/ConfirmationButton/index.jsx +0 -3
- package/components/ContextMenu/ContextMenu.d.ts +0 -28
- package/components/ContextMenu/ContextMenu.jsx +0 -70
- package/components/ContextMenu/index.d.ts +0 -3
- package/components/ContextMenu/index.jsx +0 -3
- package/components/CopyButton/CopyButton.d.ts +0 -7
- package/components/CopyButton/CopyButton.jsx +0 -29
- package/components/CopyButton/index.d.ts +0 -3
- package/components/CopyButton/index.jsx +0 -3
- package/components/DateInput/DateInput.d.ts +0 -6
- package/components/DateInput/DateInput.jsx +0 -19
- package/components/DateInput/DateTimeInput.d.ts +0 -3
- package/components/DateInput/DateTimeInput.jsx +0 -8
- package/components/DateInput/index.d.ts +0 -4
- package/components/DateInput/index.jsx +0 -4
- package/components/DateInput/useRefValue.d.ts +0 -5
- package/components/DateInput/useRefValue.js +0 -48
- package/components/DatePicker/DatePicker.d.ts +0 -19
- package/components/DatePicker/DatePicker.jsx +0 -55
- package/components/DatePicker/index.d.ts +0 -3
- package/components/DatePicker/index.jsx +0 -3
- package/components/DateRangePicker/DateRangePicker.d.ts +0 -16
- package/components/DateRangePicker/DateRangePicker.jsx +0 -56
- package/components/DateRangePicker/index.d.ts +0 -3
- package/components/DateRangePicker/index.jsx +0 -3
- package/components/Dialog/Dialog.d.ts +0 -25
- package/components/Dialog/Dialog.jsx +0 -35
- package/components/Dialog/Dialogs.d.ts +0 -1
- package/components/Dialog/Dialogs.jsx +0 -21
- package/components/Dialog/dialogs.state.d.ts +0 -21
- package/components/Dialog/dialogs.state.js +0 -40
- package/components/Dialog/index.d.ts +0 -6
- package/components/Dialog/index.jsx +0 -7
- package/components/Drawer/Drawer.d.ts +0 -15
- package/components/Drawer/Drawer.jsx +0 -72
- package/components/Drawer/index.d.ts +0 -3
- package/components/Drawer/index.jsx +0 -3
- package/components/DropdownMenu/DropdownMenu.d.ts +0 -33
- package/components/DropdownMenu/DropdownMenu.jsx +0 -74
- package/components/DropdownMenu/index.d.ts +0 -3
- package/components/DropdownMenu/index.jsx +0 -3
- package/components/ErrorBoundary/ErrorBoundary.d.ts +0 -18
- package/components/ErrorBoundary/ErrorBoundary.jsx +0 -32
- package/components/ErrorBoundary/index.d.ts +0 -3
- package/components/ErrorBoundary/index.jsx +0 -3
- package/components/ErrorPage/Error404Page.d.ts +0 -1
- package/components/ErrorPage/Error404Page.jsx +0 -4
- package/components/ErrorPage/Error500Page.d.ts +0 -1
- package/components/ErrorPage/Error500Page.jsx +0 -4
- package/components/ErrorPage/ErrorPage.d.ts +0 -11
- package/components/ErrorPage/ErrorPage.jsx +0 -23
- package/components/FileInput/FileInput.d.ts +0 -53
- package/components/FileInput/FileInput.jsx +0 -141
- package/components/FileInput/PreviewFile.d.ts +0 -18
- package/components/FileInput/PreviewFile.jsx +0 -54
- package/components/FileInput/index.d.ts +0 -3
- package/components/FileInput/index.jsx +0 -3
- package/components/FileInput/isImage.d.ts +0 -1
- package/components/FileInput/isImage.js +0 -10
- package/components/FileInput/isVideo.d.ts +0 -1
- package/components/FileInput/isVideo.js +0 -10
- package/components/FileSelect/FileSelect.d.ts +0 -31
- package/components/FileSelect/FileSelect.jsx +0 -146
- package/components/FileSelect/index.d.ts +0 -3
- package/components/FileSelect/index.jsx +0 -3
- package/components/Footer/Footer.d.ts +0 -19
- package/components/Footer/Footer.jsx +0 -30
- package/components/Footer/index.d.ts +0 -3
- package/components/Footer/index.jsx +0 -3
- package/components/GridPattern/GridPattern.d.ts +0 -2
- package/components/GridPattern/GridPattern.jsx +0 -12
- package/components/GridPattern/index.d.ts +0 -3
- package/components/GridPattern/index.jsx +0 -3
- package/components/Group/Group.d.ts +0 -5
- package/components/Group/Group.jsx +0 -6
- package/components/Group/index.d.ts +0 -3
- package/components/Group/index.jsx +0 -3
- package/components/Header/Header.d.ts +0 -5
- package/components/Header/Header.jsx +0 -19
- package/components/Header/index.d.ts +0 -3
- package/components/Header/index.jsx +0 -3
- package/components/ImageInput/ImageInput.d.ts +0 -4
- package/components/ImageInput/ImageInput.jsx +0 -8
- package/components/ImageInput/index.d.ts +0 -3
- package/components/ImageInput/index.jsx +0 -3
- package/components/Input/Input.d.ts +0 -14
- package/components/Input/Input.jsx +0 -57
- package/components/Input/InputIcon.d.ts +0 -9
- package/components/Input/InputIcon.jsx +0 -7
- package/components/Input/MultiSelectInput.d.ts +0 -16
- package/components/Input/MultiSelectInput.jsx +0 -48
- package/components/Input/NumericInput.d.ts +0 -6
- package/components/Input/NumericInput.jsx +0 -6
- package/components/Input/PatternInput.d.ts +0 -6
- package/components/Input/PatternInput.jsx +0 -6
- package/components/Input/SelectInput.d.ts +0 -12
- package/components/Input/SelectInput.jsx +0 -25
- package/components/Input/UnstyledInput.d.ts +0 -22
- package/components/Input/UnstyledInput.jsx +0 -28
- package/components/Input/index.d.ts +0 -6
- package/components/Input/index.jsx +0 -6
- package/components/Input/useInputRefValue.d.ts +0 -11
- package/components/Input/useInputRefValue.jsx +0 -51
- package/components/Input2/InputWrapper.d.ts +0 -11
- package/components/Input2/InputWrapper.jsx +0 -11
- package/components/Link/Link.d.ts +0 -3
- package/components/Link/Link.jsx +0 -9
- package/components/Link/index.d.ts +0 -3
- package/components/Link/index.jsx +0 -3
- package/components/Loading/Loading.d.ts +0 -5
- package/components/Loading/Loading.jsx +0 -15
- package/components/Loading/index.d.ts +0 -3
- package/components/Loading/index.jsx +0 -3
- package/components/Magnet/Magnet.d.ts +0 -13
- package/components/Magnet/Magnet.jsx +0 -50
- package/components/Magnet/index.d.ts +0 -3
- package/components/Magnet/index.jsx +0 -3
- package/components/Markdown/Markdown.d.ts +0 -8
- package/components/Markdown/Markdown.jsx +0 -11
- package/components/Markdown/index.d.ts +0 -3
- package/components/Markdown/index.jsx +0 -3
- package/components/Menu/Menu.d.ts +0 -28
- package/components/Menu/Menu.jsx +0 -54
- package/components/Modal/Modal.d.ts +0 -45
- package/components/Modal/Modal.jsx +0 -65
- package/components/Modal/index.d.ts +0 -4
- package/components/Modal/index.jsx +0 -4
- package/components/Modal/useModalState.d.ts +0 -6
- package/components/Modal/useModalState.js +0 -16
- package/components/ModeToggle/ModeToggle.d.ts +0 -9
- package/components/ModeToggle/ModeToggle.jsx +0 -12
- package/components/ModeToggle/index.d.ts +0 -4
- package/components/ModeToggle/index.jsx +0 -5
- package/components/ModeToggle/useModeToggle.d.ts +0 -1
- package/components/ModeToggle/useModeToggle.js +0 -21
- package/components/MultiSelect/MultiSelect.d.ts +0 -28
- package/components/MultiSelect/MultiSelect.jsx +0 -116
- package/components/MultiSelect/MultiSelectInput.d.ts +0 -12
- package/components/MultiSelect/MultiSelectInput.jsx +0 -27
- package/components/MultiSelect/index.d.ts +0 -5
- package/components/MultiSelect/index.jsx +0 -5
- package/components/MultiText/MultiText.d.ts +0 -23
- package/components/MultiText/MultiText.jsx +0 -118
- package/components/MultiText/index.d.ts +0 -3
- package/components/MultiText/index.jsx +0 -3
- package/components/NavigationDrawer/NavigationDrawer.d.ts +0 -9
- package/components/NavigationDrawer/NavigationDrawer.jsx +0 -29
- package/components/NavigationDrawer/NavigationItem.d.ts +0 -13
- package/components/NavigationDrawer/NavigationItem.jsx +0 -24
- package/components/NavigationDrawer/index.d.ts +0 -6
- package/components/NavigationDrawer/index.jsx +0 -6
- package/components/NavigationDrawer/navigationDrawer.state.d.ts +0 -9
- package/components/NavigationDrawer/navigationDrawer.state.js +0 -19
- package/components/NoSsr/NoSsr.d.ts +0 -4
- package/components/NoSsr/NoSsr.jsx +0 -8
- package/components/NoSsr/index.d.ts +0 -3
- package/components/NoSsr/index.jsx +0 -3
- package/components/Noise/Noise.d.ts +0 -11
- package/components/Noise/Noise.jsx +0 -69
- package/components/Noise/index.d.ts +0 -3
- package/components/Noise/index.jsx +0 -3
- package/components/Notifications/Notifications.d.ts +0 -3
- package/components/Notifications/Notifications.jsx +0 -60
- package/components/Notifications/index.d.ts +0 -5
- package/components/Notifications/index.jsx +0 -6
- package/components/Notifications/notifications.state.d.ts +0 -24
- package/components/Notifications/notifications.state.js +0 -41
- package/components/Orb/Orb.d.ts +0 -8
- package/components/Orb/Orb.jsx +0 -258
- package/components/Orb/index.d.ts +0 -3
- package/components/Orb/index.jsx +0 -3
- package/components/Pagination/Pagination.d.ts +0 -13
- package/components/Pagination/Pagination.jsx +0 -64
- package/components/Pagination/index.d.ts +0 -3
- package/components/Pagination/index.jsx +0 -3
- package/components/Particles/Particles.d.ts +0 -18
- package/components/Particles/Particles.jsx +0 -205
- package/components/Particles/index.d.ts +0 -3
- package/components/Particles/index.jsx +0 -3
- package/components/PictureCropInput/PictureCropInput.d.ts +0 -20
- package/components/PictureCropInput/PictureCropInput.jsx +0 -174
- package/components/PictureCropInput/canvasPreview.d.ts +0 -2
- package/components/PictureCropInput/canvasPreview.js +0 -37
- package/components/PictureCropInput/index.d.ts +0 -3
- package/components/PictureCropInput/index.js +0 -3
- package/components/Popover/Popover.d.ts +0 -13
- package/components/Popover/Popover.jsx +0 -22
- package/components/Popover/index.d.ts +0 -3
- package/components/Popover/index.jsx +0 -3
- package/components/Resizable/Resizable.d.ts +0 -12
- package/components/Resizable/Resizable.jsx +0 -54
- package/components/Resizable/index.d.ts +0 -3
- package/components/Resizable/index.jsx +0 -3
- package/components/ScrollArea/ScrollArea.d.ts +0 -9
- package/components/ScrollArea/ScrollArea.jsx +0 -16
- package/components/ScrollArea/index.d.ts +0 -3
- package/components/ScrollArea/index.jsx +0 -3
- package/components/Select/Select.d.ts +0 -25
- package/components/Select/Select.jsx +0 -55
- package/components/Select/index.d.ts +0 -3
- package/components/Select/index.jsx +0 -3
- package/components/Skeleton/Skeleton.d.ts +0 -2
- package/components/Skeleton/Skeleton.jsx +0 -8
- package/components/Skeleton/index.d.ts +0 -3
- package/components/Skeleton/index.jsx +0 -3
- package/components/Slider/Slider.d.ts +0 -10
- package/components/Slider/Slider.jsx +0 -21
- package/components/Slider/index.d.ts +0 -3
- package/components/Slider/index.jsx +0 -3
- package/components/Spotlight/Spotlight.d.ts +0 -30
- package/components/Spotlight/Spotlight.jsx +0 -86
- package/components/Spotlight/index.d.ts +0 -3
- package/components/Spotlight/index.jsx +0 -3
- package/components/SpotlightCard/SpotlightCard.d.ts +0 -7
- package/components/SpotlightCard/SpotlightCard.jsx +0 -35
- package/components/SpotlightCard/index.d.ts +0 -3
- package/components/SpotlightCard/index.jsx +0 -3
- package/components/Stack/Stack.d.ts +0 -4
- package/components/Stack/Stack.jsx +0 -5
- package/components/Stack/index.d.ts +0 -3
- package/components/Stack/index.jsx +0 -3
- package/components/StarBorder/StarBorder.d.ts +0 -10
- package/components/StarBorder/StarBorder.jsx +0 -19
- package/components/StarBorder/index.d.ts +0 -3
- package/components/StarBorder/index.jsx +0 -3
- package/components/Switch/Switch.d.ts +0 -16
- package/components/Switch/Switch.jsx +0 -24
- package/components/Switch/index.d.ts +0 -3
- package/components/Switch/index.jsx +0 -3
- package/components/Table/DataTable.d.ts +0 -57
- package/components/Table/DataTable.jsx +0 -155
- package/components/Table/Table.d.ts +0 -27
- package/components/Table/Table.jsx +0 -31
- package/components/Table/TableActionButton.d.ts +0 -6
- package/components/Table/TableActionButton.jsx +0 -20
- package/components/Table/TableBody.d.ts +0 -6
- package/components/Table/TableBody.jsx +0 -10
- package/components/Table/TableCell.d.ts +0 -9
- package/components/Table/TableCell.jsx +0 -18
- package/components/Table/TableFooter.d.ts +0 -5
- package/components/Table/TableFooter.jsx +0 -5
- package/components/Table/TableFooterWithPagination.d.ts +0 -13
- package/components/Table/TableFooterWithPagination.jsx +0 -57
- package/components/Table/TableHead.d.ts +0 -5
- package/components/Table/TableHead.jsx +0 -9
- package/components/Table/TableHeadContext.d.ts +0 -4
- package/components/Table/TableHeadContext.jsx +0 -3
- package/components/Table/TableHeader.d.ts +0 -7
- package/components/Table/TableHeader.jsx +0 -15
- package/components/Table/TableRow.d.ts +0 -8
- package/components/Table/TableRow.jsx +0 -9
- package/components/Table/index.d.ts +0 -3
- package/components/Table/index.jsx +0 -3
- package/components/Tabs/Tabs.d.ts +0 -9
- package/components/Tabs/Tabs.jsx +0 -13
- package/components/Tabs/index.d.ts +0 -3
- package/components/Tabs/index.jsx +0 -3
- package/components/TabsSwitcher/Tab.d.ts +0 -15
- package/components/TabsSwitcher/Tab.jsx +0 -18
- package/components/TabsSwitcher/TabsSwitcher.d.ts +0 -22
- package/components/TabsSwitcher/TabsSwitcher.jsx +0 -31
- package/components/TabsSwitcher/index.d.ts +0 -4
- package/components/TabsSwitcher/index.jsx +0 -4
- package/components/Text/Text.d.ts +0 -24
- package/components/Text/Text.jsx +0 -29
- package/components/Text/index.d.ts +0 -3
- package/components/Text/index.jsx +0 -3
- package/components/Textarea/Textarea.d.ts +0 -5
- package/components/Textarea/Textarea.jsx +0 -6
- package/components/Textarea/index.d.ts +0 -3
- package/components/Textarea/index.js +0 -3
- package/components/Threads/Threads.d.ts +0 -9
- package/components/Threads/Threads.jsx +0 -203
- package/components/Threads/index.d.ts +0 -3
- package/components/Threads/index.jsx +0 -3
- package/components/Tooltip/Tooltip.d.ts +0 -11
- package/components/Tooltip/Tooltip.jsx +0 -21
- package/components/Tooltip/index.d.ts +0 -3
- package/components/Tooltip/index.jsx +0 -3
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +0 -7
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.jsx +0 -18
- package/components/VisibilityActivatedButton/index.d.ts +0 -3
- package/components/VisibilityActivatedButton/index.jsx +0 -3
- package/form.d.ts +0 -82
- package/form.js +0 -113
- package/form2.d.ts +0 -15
- package/form2.jsx +0 -30
- package/hooks/useBeforeUnload.d.ts +0 -1
- package/hooks/useBeforeUnload.js +0 -17
- package/hooks/useDebounceEffect.d.ts +0 -2
- package/hooks/useDebounceEffect.js +0 -14
- package/hooks/useDebouncedValue.d.ts +0 -2
- package/hooks/useDebouncedValue.js +0 -14
- package/hooks/useLagRadar.d.ts +0 -1
- package/hooks/useLagRadar.jsx +0 -124
- package/hooks/useMediaQuery.d.ts +0 -1
- package/hooks/useMediaQuery.js +0 -37
- package/hooks/useMutationWindowCloseProtection.d.ts +0 -2
- package/hooks/useMutationWindowCloseProtection.js +0 -13
- package/hooks/useScroll.d.ts +0 -3
- package/hooks/useScroll.js +0 -47
- package/hooks/useTranslation.d.ts +0 -4
- package/hooks/useTranslation.js +0 -11
- package/hooks/useWhyDidYouUpdate.d.ts +0 -3
- package/hooks/useWhyDidYouUpdate.js +0 -44
- package/imgur.d.ts +0 -1
- package/imgur.js +0 -13
- package/styles/DayPicker.classNames.d.ts +0 -29
- package/styles/DayPicker.classNames.js +0 -30
- package/styles/DayPicker.classNames.ts +0 -81
- package/styles/Dropdown.classNames.d.ts +0 -6
- package/styles/Dropdown.classNames.js +0 -7
- package/styles/Dropdown.classNames.ts +0 -38
- package/styles/Input.css +0 -23
- package/styles/Modal.classNames.d.ts +0 -2
- package/styles/Modal.classNames.js +0 -3
- package/styles/Modal.classNames.ts +0 -15
- package/styles/MultiText.css +0 -40
- package/styles/Pagination.css +0 -19
- package/styles/Tabs.css +0 -23
- package/tsconfig.tsbuildinfo +0 -1
- package/types.d.ts +0 -6
- package/types.js +0 -1
- package/utils/UseState.d.ts +0 -2
- package/utils/UseState.js +0 -1
- package/utils/blobToText.d.ts +0 -1
- package/utils/blobToText.js +0 -13
- package/utils/capitalize.d.ts +0 -1
- package/utils/capitalize.js +0 -6
- package/utils/clsx.d.ts +0 -2
- package/utils/clsx.js +0 -5
- package/utils/copy2DToClipboard.d.ts +0 -1
- package/utils/copy2DToClipboard.js +0 -44
- package/utils/cpfCpnjUtils.d.ts +0 -3
- package/utils/cpfCpnjUtils.js +0 -43
- package/utils/createLocalStorageStateHydration.d.ts +0 -1
- package/utils/createLocalStorageStateHydration.js +0 -18
- package/utils/createStateHydration.d.ts +0 -3
- package/utils/createStateHydration.js +0 -49
- package/utils/csvBlobToJson.d.ts +0 -2
- package/utils/csvBlobToJson.js +0 -59
- package/utils/downloadArrayAsCSV.d.ts +0 -1
- package/utils/downloadArrayAsCSV.js +0 -34
- package/utils/emailRegExp.d.ts +0 -2
- package/utils/emailRegExp.js +0 -2
- package/utils/fakeArray.d.ts +0 -1
- package/utils/fakeArray.js +0 -3
- package/utils/filterBoolean.d.ts +0 -1
- package/utils/filterBoolean.js +0 -3
- package/utils/formatClock.d.ts +0 -1
- package/utils/formatClock.js +0 -21
- package/utils/getInitials.d.ts +0 -4
- package/utils/getInitials.js +0 -22
- package/utils/isBrowser.d.ts +0 -12
- package/utils/isBrowser.js +0 -26
- package/utils/ms.d.ts +0 -6
- package/utils/ms.js +0 -31
- package/utils/preventDefault.d.ts +0 -2
- package/utils/preventDefault.js +0 -3
- package/utils/recursiveChildrenMap.d.ts +0 -2
- package/utils/recursiveChildrenMap.js +0 -16
- package/utils/setSelectionRange.d.ts +0 -1
- package/utils/setSelectionRange.js +0 -55
- package/utils/smoothScrollToHref.d.ts +0 -2
- package/utils/smoothScrollToHref.js +0 -14
- package/utils/stopPropagation.d.ts +0 -2
- package/utils/stopPropagation.js +0 -3
- package/utils/stripHtml.d.ts +0 -1
- package/utils/stripHtml.js +0 -4
- package/utils/stripLineBreak.d.ts +0 -1
- package/utils/stripLineBreak.js +0 -4
- package/utils/stripMarkdown.d.ts +0 -1
- package/utils/stripMarkdown.js +0 -28
- package/utils/xlsxBlobToJson.d.ts +0 -2
- package/utils/xlsxBlobToJson.js +0 -62
package/types.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type Dispatch, type SetStateAction, useState } from "react";
|
|
2
|
-
export type NoUndefinedState<T> = T extends [
|
|
3
|
-
infer S | undefined,
|
|
4
|
-
Dispatch<SetStateAction<infer S | undefined>>
|
|
5
|
-
] ? [S, Dispatch<SetStateAction<S>>] : never;
|
|
6
|
-
export type UseStateTuple<T> = NoUndefinedState<ReturnType<typeof useState<T>>>;
|
package/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
package/utils/UseState.d.ts
DELETED
package/utils/UseState.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/utils/blobToText.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function blobToText(file: Blob, encoding?: string): Promise<string>;
|
package/utils/blobToText.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default function blobToText(file, encoding) {
|
|
2
|
-
const reader = new FileReader();
|
|
3
|
-
return new Promise((resolve, reject) => {
|
|
4
|
-
reader.onload = function (e) {
|
|
5
|
-
const contents = e.target?.result;
|
|
6
|
-
resolve(contents);
|
|
7
|
-
};
|
|
8
|
-
reader.onerror = function (e) {
|
|
9
|
-
reject(e.target?.error);
|
|
10
|
-
};
|
|
11
|
-
reader.readAsText(file, encoding);
|
|
12
|
-
});
|
|
13
|
-
}
|
package/utils/capitalize.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function capitalize<T extends string | undefined>(text: T): T;
|
package/utils/capitalize.js
DELETED
package/utils/clsx.d.ts
DELETED
package/utils/clsx.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function copy2DToClipboard(array: (string | number)[][]): void;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// copied from https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript
|
|
2
|
-
function fallbackCopyTextToClipboard(text) {
|
|
3
|
-
const textArea = document.createElement("textarea");
|
|
4
|
-
textArea.value = text;
|
|
5
|
-
// Avoid scrolling to bottom
|
|
6
|
-
textArea.style.top = "0";
|
|
7
|
-
textArea.style.left = "0";
|
|
8
|
-
textArea.style.position = "fixed";
|
|
9
|
-
document.body.appendChild(textArea);
|
|
10
|
-
textArea.focus();
|
|
11
|
-
textArea.select();
|
|
12
|
-
try {
|
|
13
|
-
// noinspection JSDeprecatedSymbols
|
|
14
|
-
document.execCommand("copy");
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
console.error("Fallback: Oops, unable to copy", err);
|
|
18
|
-
}
|
|
19
|
-
document.body.removeChild(textArea);
|
|
20
|
-
}
|
|
21
|
-
function copyTextToClipboard(text) {
|
|
22
|
-
if (!navigator.clipboard) {
|
|
23
|
-
fallbackCopyTextToClipboard(text);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
navigator.clipboard.writeText(text).then(function () {
|
|
27
|
-
// console.log('Async: Copying to clipboard was successful!');
|
|
28
|
-
}, function (err) {
|
|
29
|
-
console.error("Async: Could not copy text: ", err);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
export default function copy2DToClipboard(array) {
|
|
33
|
-
let csv = "", row, cell;
|
|
34
|
-
for (row = 0; row < array.length; row++) {
|
|
35
|
-
for (cell = 0; cell < array[row].length; cell++) {
|
|
36
|
-
csv += (array[row][cell] + "").replace(/[\n\t]+/g, " ");
|
|
37
|
-
if (cell + 1 < array[row].length)
|
|
38
|
-
csv += "\t";
|
|
39
|
-
}
|
|
40
|
-
if (row + 1 < array.length)
|
|
41
|
-
csv += "\n";
|
|
42
|
-
}
|
|
43
|
-
copyTextToClipboard(csv);
|
|
44
|
-
}
|
package/utils/cpfCpnjUtils.d.ts
DELETED
package/utils/cpfCpnjUtils.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export function formatCpfCnpj(input = "") {
|
|
2
|
-
// Remove any non-digit characters
|
|
3
|
-
const cleanInput = input.replace(/\D/g, "");
|
|
4
|
-
if (cleanInput.length === 11) {
|
|
5
|
-
// Format as CPF (Individual Taxpayer Registry)
|
|
6
|
-
return cleanInput.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, "$1.$2.$3-$4");
|
|
7
|
-
}
|
|
8
|
-
else if (cleanInput.length === 14) {
|
|
9
|
-
// Format as CNPJ (National Registry of Legal Entities)
|
|
10
|
-
return cleanInput.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, "$1.$2.$3/$4-$5");
|
|
11
|
-
}
|
|
12
|
-
return cleanInput;
|
|
13
|
-
}
|
|
14
|
-
export function isCpf(cpf) {
|
|
15
|
-
cpf = cpf.replace(/\D+/g, "");
|
|
16
|
-
if (cpf.length !== 11 || /^(\d)\1{10}$/.test(cpf)) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
let sum = 0;
|
|
20
|
-
let rest;
|
|
21
|
-
// Valida o primeiro dígito verificador
|
|
22
|
-
for (let i = 1; i <= 9; i++) {
|
|
23
|
-
sum += parseInt(cpf.charAt(i - 1)) * (11 - i);
|
|
24
|
-
}
|
|
25
|
-
rest = (sum * 10) % 11;
|
|
26
|
-
if (rest === 10 || rest === 11)
|
|
27
|
-
rest = 0;
|
|
28
|
-
if (rest !== parseInt(cpf.charAt(9))) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
sum = 0;
|
|
32
|
-
// Valida o segundo dígito verificador
|
|
33
|
-
for (let i = 1; i <= 10; i++) {
|
|
34
|
-
sum += parseInt(cpf.charAt(i - 1)) * (12 - i);
|
|
35
|
-
}
|
|
36
|
-
rest = (sum * 10) % 11;
|
|
37
|
-
if (rest === 10 || rest === 11)
|
|
38
|
-
rest = 0;
|
|
39
|
-
return rest === parseInt(cpf.charAt(10));
|
|
40
|
-
}
|
|
41
|
-
export function stripCpfCnpjFormatting(value) {
|
|
42
|
-
return value.replace(/\D+/g, "");
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function createLocalStorageStateHydration<T extends object>(localStorageName: string, state: T, properties?: (keyof T)[]): void;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { snapshot, subscribe } from "valtio";
|
|
2
|
-
import { omit } from "lodash-es";
|
|
3
|
-
export default function createLocalStorageStateHydration(localStorageName, state, properties) {
|
|
4
|
-
const retypedState = state;
|
|
5
|
-
if (!retypedState._hydrated) {
|
|
6
|
-
retypedState._hydrated = true;
|
|
7
|
-
subscribe(state, () => {
|
|
8
|
-
localStorage.setItem(localStorageName, JSON.stringify(omit(snapshot(retypedState), [
|
|
9
|
-
"_hydrated",
|
|
10
|
-
...Object.keys(retypedState).filter((p) => properties && !properties.includes(p)),
|
|
11
|
-
])));
|
|
12
|
-
});
|
|
13
|
-
const hydratedState = localStorage.getItem(localStorageName);
|
|
14
|
-
if (hydratedState) {
|
|
15
|
-
Object.assign(retypedState, JSON.parse(hydratedState));
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { OptionsType } from "cookies-next";
|
|
2
|
-
export default function createStateHydration<T extends object>(cookieName: string, state: T, properties?: (keyof T)[]): (cookies?: object) => void;
|
|
3
|
-
export declare const getCookies: (options?: OptionsType) => Promise<Record<string, string>>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { getCookies as cnGetCookies, setCookie } from "cookies-next";
|
|
2
|
-
import ms from "ms";
|
|
3
|
-
import { snapshot, subscribe } from "valtio";
|
|
4
|
-
import { omit } from "lodash-es";
|
|
5
|
-
export default function createStateHydration(cookieName, state, properties) {
|
|
6
|
-
const retypedState = state;
|
|
7
|
-
if (!retypedState._hydration) {
|
|
8
|
-
subscribe(state, () => {
|
|
9
|
-
setCookie(cookieName, omit(snapshot(retypedState), [
|
|
10
|
-
"_hydration",
|
|
11
|
-
...Object.keys(retypedState).filter((p) => properties && !properties.includes(p)),
|
|
12
|
-
]), {
|
|
13
|
-
maxAge: ms("30d"),
|
|
14
|
-
path: "/",
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return function hydrate(cookies) {
|
|
19
|
-
const retypedCookies = cookies;
|
|
20
|
-
if (!retypedCookies?._lastUpdate ||
|
|
21
|
-
!retypedState._hydration ||
|
|
22
|
-
retypedState._hydration < +retypedCookies._lastUpdate) {
|
|
23
|
-
retypedState._hydration = retypedCookies?._lastUpdate
|
|
24
|
-
? +retypedCookies._lastUpdate
|
|
25
|
-
: Date.now();
|
|
26
|
-
if (cookies?.[cookieName]) {
|
|
27
|
-
try {
|
|
28
|
-
const cookieValueString = cookies[cookieName];
|
|
29
|
-
const cookieValue = JSON.parse(cookieValueString);
|
|
30
|
-
if (typeof cookieValue === "object") {
|
|
31
|
-
for (const property of properties || Object.keys(state)) {
|
|
32
|
-
if (cookieValue[property]) {
|
|
33
|
-
state[property] = cookieValue[property];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
// do nothing
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export const getCookies = async (options) => ({
|
|
47
|
-
...(await cnGetCookies(options)),
|
|
48
|
-
_lastUpdate: Date.now().toString(),
|
|
49
|
-
});
|
package/utils/csvBlobToJson.d.ts
DELETED
package/utils/csvBlobToJson.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { showNotification } from "../components/Notifications";
|
|
2
|
-
import blobToText from "./blobToText";
|
|
3
|
-
export default async function csvBlobToJson(event, encoding) {
|
|
4
|
-
if (!event.target.files?.[0]) {
|
|
5
|
-
showNotification({
|
|
6
|
-
icon: "error",
|
|
7
|
-
message: "Nenhum arquivo foi selecionado",
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
const csv = await blobToText(event.target.files[0], encoding);
|
|
11
|
-
event.target.value = "";
|
|
12
|
-
const rows = csv.trim().split("\r\n");
|
|
13
|
-
const headers = rows
|
|
14
|
-
.shift()
|
|
15
|
-
?.split(";")
|
|
16
|
-
.reduce((acc, header) => {
|
|
17
|
-
// existing header concatenate amount of headers with the same name
|
|
18
|
-
if (acc.includes(header)) {
|
|
19
|
-
const amount = acc.filter((h) => h === header).length;
|
|
20
|
-
acc.push(`${header} ${amount + 1}`);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
acc.push(header);
|
|
24
|
-
}
|
|
25
|
-
return acc;
|
|
26
|
-
}, []);
|
|
27
|
-
if (!headers) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const wrongValues = [];
|
|
31
|
-
const json = [];
|
|
32
|
-
for (const row of rows) {
|
|
33
|
-
const object = {};
|
|
34
|
-
const values = row.split(";");
|
|
35
|
-
if (values.length !== headers.length) {
|
|
36
|
-
wrongValues.push(values);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
for (let i = 0; i < headers.length; i++) {
|
|
40
|
-
object[headers[i]] = values[i];
|
|
41
|
-
}
|
|
42
|
-
json.push(object);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (wrongValues.length) {
|
|
46
|
-
showNotification({
|
|
47
|
-
icon: "error",
|
|
48
|
-
message: `A planilha está sendo importada em segundo plano mas ${wrongValues.length} items foram ignorados por estarem com o formato errado`,
|
|
49
|
-
});
|
|
50
|
-
console.error(wrongValues);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
showNotification({
|
|
54
|
-
icon: "success",
|
|
55
|
-
message: "A planilha está sendo importada em segundo plano",
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return json;
|
|
59
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function downloadArrayAsCSV(data: (string | undefined)[][], filename?: string): void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export default function downloadArrayAsCSV(data, filename = "data.csv") {
|
|
2
|
-
// Function to escape fields with commas or double quotes
|
|
3
|
-
const escapeCSVField = (field) => {
|
|
4
|
-
if (field.includes('"')) {
|
|
5
|
-
field = field.replace(/"/g, '""'); // Escape double quotes
|
|
6
|
-
}
|
|
7
|
-
if (field.includes(",") || field.includes("\n")) {
|
|
8
|
-
field = `"${field}"`; // Enclose in double quotes
|
|
9
|
-
}
|
|
10
|
-
return field;
|
|
11
|
-
};
|
|
12
|
-
// Step 1: Convert the array to a CSV string with proper escaping
|
|
13
|
-
const csvContent = data
|
|
14
|
-
.map((row) => row.filter(Boolean).map(escapeCSVField).join(","))
|
|
15
|
-
.join("\n");
|
|
16
|
-
// Add BOM for UTF-8 encoding
|
|
17
|
-
const bom = "\uFEFF";
|
|
18
|
-
// Step 2: Create a Blob object from the CSV string with BOM
|
|
19
|
-
const blob = new Blob([bom + csvContent], {
|
|
20
|
-
type: "text/csv;charset=utf-8;",
|
|
21
|
-
});
|
|
22
|
-
// Step 3: Create a download link for the Blob and trigger a click event on the link
|
|
23
|
-
const link = document.createElement("a");
|
|
24
|
-
if (link.download !== undefined) {
|
|
25
|
-
// feature detection
|
|
26
|
-
const url = URL.createObjectURL(blob);
|
|
27
|
-
link.setAttribute("href", url);
|
|
28
|
-
link.setAttribute("download", filename);
|
|
29
|
-
link.style.visibility = "hidden";
|
|
30
|
-
document.body.appendChild(link);
|
|
31
|
-
link.click();
|
|
32
|
-
document.body.removeChild(link);
|
|
33
|
-
}
|
|
34
|
-
}
|
package/utils/emailRegExp.d.ts
DELETED
package/utils/emailRegExp.js
DELETED
package/utils/fakeArray.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function fakeArray(n: number): number[];
|
package/utils/fakeArray.js
DELETED
package/utils/filterBoolean.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function filterBoolean<T>(array: (T | null | undefined)[]): T[];
|
package/utils/filterBoolean.js
DELETED
package/utils/formatClock.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function formatClock(time?: number): string;
|
package/utils/formatClock.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export default function formatClock(time) {
|
|
2
|
-
if (time === undefined) {
|
|
3
|
-
return "";
|
|
4
|
-
}
|
|
5
|
-
const totalSeconds = Math.floor(time / 1000);
|
|
6
|
-
const hours = Math.floor(totalSeconds / 3600);
|
|
7
|
-
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
8
|
-
const remainingSeconds = totalSeconds % 60;
|
|
9
|
-
let formattedTime = "";
|
|
10
|
-
if (hours > 0) {
|
|
11
|
-
formattedTime += `${hours.toString().padStart(2, "0")}:`;
|
|
12
|
-
}
|
|
13
|
-
if (minutes > 0) {
|
|
14
|
-
formattedTime += `${minutes.toString().padStart(2, "0")}:`;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
formattedTime += `00:`;
|
|
18
|
-
}
|
|
19
|
-
formattedTime += remainingSeconds.toString().padStart(2, "0");
|
|
20
|
-
return formattedTime.trim();
|
|
21
|
-
}
|
package/utils/getInitials.d.ts
DELETED
package/utils/getInitials.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets all the initials of a name.
|
|
3
|
-
*/
|
|
4
|
-
export default function getInitials(name) {
|
|
5
|
-
if (!name)
|
|
6
|
-
return "";
|
|
7
|
-
// Normalize to decompose diacritics, then remove any non-letter characters.
|
|
8
|
-
const normalizeAndClean = (s) => s
|
|
9
|
-
.normalize("NFD") // decompose combined letters (e.g., é -> e + ´)
|
|
10
|
-
.replace(/\p{M}/gu, "") // remove diacritic marks
|
|
11
|
-
.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g, "") // strip anything that's not a letter (basic Latin + Latin-1 Supplement)
|
|
12
|
-
.trim();
|
|
13
|
-
// Split into words, clean each word, take first letter of up to two words.
|
|
14
|
-
const words = name.split(/\s+/);
|
|
15
|
-
const initials = words
|
|
16
|
-
.map((w) => normalizeAndClean(w))
|
|
17
|
-
.filter(Boolean)
|
|
18
|
-
.slice(0, 2)
|
|
19
|
-
.map((w) => w.charAt(0).toUpperCase())
|
|
20
|
-
.join("");
|
|
21
|
-
return initials;
|
|
22
|
-
}
|
package/utils/isBrowser.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tells if the current scope is a browser.
|
|
3
|
-
*/
|
|
4
|
-
export declare const isBrowser: boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Tells if the current scope is a touch device.
|
|
7
|
-
*/
|
|
8
|
-
export declare const isTouchDevice: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Tells if the current scope is a iOS device.
|
|
11
|
-
*/
|
|
12
|
-
export declare const is_iOS: boolean;
|
package/utils/isBrowser.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
/* istanbul ignore file */
|
|
3
|
-
// noinspection JSUnusedGlobalSymbols
|
|
4
|
-
/**
|
|
5
|
-
* Tells if the current scope is a browser.
|
|
6
|
-
*/
|
|
7
|
-
export const isBrowser = typeof window !== "undefined";
|
|
8
|
-
/**
|
|
9
|
-
* Tells if the current scope is a touch device.
|
|
10
|
-
*/
|
|
11
|
-
export const isTouchDevice = isBrowser &&
|
|
12
|
-
(!!(typeof window !== "undefined" &&
|
|
13
|
-
("ontouchstart" in window ||
|
|
14
|
-
// @ts-ignore: "DocumentTouch" exists on touch devices only
|
|
15
|
-
(window.DocumentTouch &&
|
|
16
|
-
typeof document !== "undefined" &&
|
|
17
|
-
// @ts-ignore: "DocumentTouch" exists on touch devices only
|
|
18
|
-
document instanceof window.DocumentTouch))) ||
|
|
19
|
-
!!(typeof navigator !== "undefined" &&
|
|
20
|
-
// @ts-ignore: "maxTouchPoints" exists on touch devices only
|
|
21
|
-
(navigator.maxTouchPoints || navigator.msMaxTouchPoints)));
|
|
22
|
-
/**
|
|
23
|
-
* Tells if the current scope is a iOS device.
|
|
24
|
-
*/
|
|
25
|
-
export const is_iOS = typeof navigator !== "undefined" &&
|
|
26
|
-
/iPad|iPhone|iPod/.test(navigator.userAgent);
|
package/utils/ms.d.ts
DELETED
package/utils/ms.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import vms, {} from "ms";
|
|
2
|
-
const locale = {
|
|
3
|
-
["en"]: {
|
|
4
|
-
day: "day",
|
|
5
|
-
hour: "hour",
|
|
6
|
-
minute: "minute",
|
|
7
|
-
second: "second",
|
|
8
|
-
},
|
|
9
|
-
["pt-BR"]: {
|
|
10
|
-
day: "dia",
|
|
11
|
-
hour: "hora",
|
|
12
|
-
minute: "minuto",
|
|
13
|
-
second: "segundo",
|
|
14
|
-
},
|
|
15
|
-
["undefined"]: {
|
|
16
|
-
day: "day",
|
|
17
|
-
hour: "hour",
|
|
18
|
-
second: "second",
|
|
19
|
-
minute: "minute",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export function ms(value, options) {
|
|
23
|
-
if (typeof value === "number" && options?.locale) {
|
|
24
|
-
return vms(value, options)
|
|
25
|
-
.replace("day", locale[String(options.locale)].day)
|
|
26
|
-
.replace("hour", locale[String(options.locale)].hour)
|
|
27
|
-
.replace("minute", locale[String(options.locale)].minute)
|
|
28
|
-
.replace("second", locale[String(options.locale)].second);
|
|
29
|
-
}
|
|
30
|
-
return vms(value);
|
|
31
|
-
}
|
package/utils/preventDefault.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Children, cloneElement, isValidElement, } from "react";
|
|
2
|
-
export default function recursiveChildrenMap(children, fn) {
|
|
3
|
-
return Children.map(children, (child) => {
|
|
4
|
-
if (!isValidElement(child)) {
|
|
5
|
-
return child;
|
|
6
|
-
}
|
|
7
|
-
const childProps = child.props;
|
|
8
|
-
if (childProps?.children) {
|
|
9
|
-
child = cloneElement(child, {
|
|
10
|
-
children: recursiveChildrenMap(childProps.children, fn),
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return fn(child);
|
|
15
|
-
});
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function setSelectionRange(el: Element, start: number, end: number): void;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
// noinspection JSUnresolvedReference
|
|
3
|
-
function getTextNodesIn(node) {
|
|
4
|
-
const textNodes = [];
|
|
5
|
-
if (node.nodeType == 3) {
|
|
6
|
-
textNodes.push(node);
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
const children = node.childNodes;
|
|
10
|
-
for (let i = 0, len = children.length; i < len; ++i) {
|
|
11
|
-
textNodes.push(...getTextNodesIn(children[i]));
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return textNodes;
|
|
15
|
-
}
|
|
16
|
-
export default function setSelectionRange(el, start, end) {
|
|
17
|
-
if (document.createRange && window.getSelection) {
|
|
18
|
-
const range = document.createRange();
|
|
19
|
-
range.selectNodeContents(el);
|
|
20
|
-
const textNodes = getTextNodesIn(el);
|
|
21
|
-
let foundStart = false;
|
|
22
|
-
let charCount = 0, endCharCount;
|
|
23
|
-
for (let i = 0, textNode; (textNode = textNodes[i++]);) {
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
endCharCount = charCount + textNode.length;
|
|
26
|
-
if (!foundStart &&
|
|
27
|
-
start >= charCount &&
|
|
28
|
-
(start < endCharCount ||
|
|
29
|
-
(start == endCharCount && i <= textNodes.length))) {
|
|
30
|
-
range.setStart(textNode, start - charCount);
|
|
31
|
-
foundStart = true;
|
|
32
|
-
}
|
|
33
|
-
if (foundStart && end <= endCharCount) {
|
|
34
|
-
range.setEnd(textNode, end - charCount);
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
charCount = endCharCount;
|
|
38
|
-
}
|
|
39
|
-
const sel = window.getSelection();
|
|
40
|
-
sel.removeAllRanges();
|
|
41
|
-
sel.addRange(range);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
if (document.selection && document.body.createTextRange) {
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
const textRange = document.body.createTextRange();
|
|
48
|
-
textRange.moveToElementText(el);
|
|
49
|
-
textRange.collapse(true);
|
|
50
|
-
textRange.moveEnd("character", end);
|
|
51
|
-
textRange.moveStart("character", start);
|
|
52
|
-
textRange.select();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default function smoothScrollToHref(event) {
|
|
2
|
-
event.preventDefault();
|
|
3
|
-
const href = event.currentTarget.getAttribute("href");
|
|
4
|
-
if (href) {
|
|
5
|
-
const targetId = href.split("#")[1];
|
|
6
|
-
if (!targetId)
|
|
7
|
-
return;
|
|
8
|
-
const target = document.getElementById(targetId);
|
|
9
|
-
if (!target) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
target.scrollIntoView({ behavior: "smooth" });
|
|
13
|
-
}
|
|
14
|
-
}
|
package/utils/stopPropagation.js
DELETED
package/utils/stripHtml.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function stripHtml(input?: string): string | undefined;
|
package/utils/stripHtml.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function stripLineBreak(input?: string): string | undefined;
|
package/utils/stripLineBreak.js
DELETED
package/utils/stripMarkdown.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function stripMarkdown<T extends string | undefined>(markdown: T): T;
|