@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/src/lib/i18n.tsx
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, type ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
export const locales = ["en", "pt-BR"] as const;
|
|
6
|
+
export type Locale = (typeof locales)[number];
|
|
7
|
+
export type Messages<T> = Record<Locale, T>;
|
|
8
|
+
|
|
9
|
+
/** Declares a message catalog; every locale must provide every key. */
|
|
10
|
+
export function defineMessages<T>(messages: Messages<T>) {
|
|
11
|
+
return messages;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const LocaleContext = createContext<Locale>("en");
|
|
15
|
+
|
|
16
|
+
export function LocaleProvider({
|
|
17
|
+
locale,
|
|
18
|
+
children,
|
|
19
|
+
}: {
|
|
20
|
+
locale: Locale;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<LocaleContext.Provider value={locale}>{children}</LocaleContext.Provider>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function useLocale() {
|
|
29
|
+
return useContext(LocaleContext);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function useMessages<T>(messages: Messages<T>): T {
|
|
33
|
+
return messages[useLocale()];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Picks the supported locale that best matches a list such as navigator.languages. */
|
|
37
|
+
export function matchLocale(preferred: readonly string[]): Locale {
|
|
38
|
+
for (const tag of preferred) {
|
|
39
|
+
const lower = tag.toLowerCase();
|
|
40
|
+
if (lower.startsWith("pt")) return "pt-BR";
|
|
41
|
+
if (lower.startsWith("en")) return "en";
|
|
42
|
+
}
|
|
43
|
+
return "en";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const uiMessages = defineMessages({
|
|
47
|
+
en: {
|
|
48
|
+
sidebar: "Sidebar",
|
|
49
|
+
toggleSidebar: "Toggle sidebar",
|
|
50
|
+
collapseSidebar: "Collapse sidebar",
|
|
51
|
+
expandSidebar: "Expand sidebar",
|
|
52
|
+
resizeSidebar: "Resize sidebar",
|
|
53
|
+
modeOpen: "Expanded",
|
|
54
|
+
modeCompact: "Compact",
|
|
55
|
+
modeClosed: "Hidden",
|
|
56
|
+
sidebarHint: (shortcut: string) =>
|
|
57
|
+
`Right-click for options · ${shortcut} hides`,
|
|
58
|
+
search: "Search",
|
|
59
|
+
noResults: "No results",
|
|
60
|
+
noData: "Nothing here yet",
|
|
61
|
+
clearSearch: "Clear search",
|
|
62
|
+
retry: "Retry",
|
|
63
|
+
loadFailed: "Couldn't load data",
|
|
64
|
+
staleData: "Showing data from the last successful load",
|
|
65
|
+
previous: "Previous",
|
|
66
|
+
next: "Next",
|
|
67
|
+
open: "Open",
|
|
68
|
+
page: (page: number, total: number) => `Page ${page} of ${total}`,
|
|
69
|
+
rows: (count: number) => `${count} ${count === 1 ? "row" : "rows"}`,
|
|
70
|
+
close: "Close",
|
|
71
|
+
language: "Language",
|
|
72
|
+
toggleTheme: "Toggle theme",
|
|
73
|
+
more: "More",
|
|
74
|
+
loading: "Loading",
|
|
75
|
+
},
|
|
76
|
+
"pt-BR": {
|
|
77
|
+
sidebar: "Barra lateral",
|
|
78
|
+
toggleSidebar: "Alternar barra lateral",
|
|
79
|
+
collapseSidebar: "Recolher barra lateral",
|
|
80
|
+
expandSidebar: "Expandir barra lateral",
|
|
81
|
+
resizeSidebar: "Redimensionar barra lateral",
|
|
82
|
+
modeOpen: "Expandida",
|
|
83
|
+
modeCompact: "Compacta",
|
|
84
|
+
modeClosed: "Escondida",
|
|
85
|
+
sidebarHint: (shortcut: string) =>
|
|
86
|
+
`Clique direito para opções · ${shortcut} esconde`,
|
|
87
|
+
search: "Buscar",
|
|
88
|
+
noResults: "Nenhum resultado",
|
|
89
|
+
noData: "Nada por aqui ainda",
|
|
90
|
+
clearSearch: "Limpar busca",
|
|
91
|
+
retry: "Tentar novamente",
|
|
92
|
+
loadFailed: "Não foi possível carregar os dados",
|
|
93
|
+
staleData: "Exibindo dados do último carregamento",
|
|
94
|
+
previous: "Anterior",
|
|
95
|
+
next: "Próxima",
|
|
96
|
+
open: "Abrir",
|
|
97
|
+
page: (page: number, total: number) => `Página ${page} de ${total}`,
|
|
98
|
+
rows: (count: number) => `${count} ${count === 1 ? "linha" : "linhas"}`,
|
|
99
|
+
close: "Fechar",
|
|
100
|
+
language: "Idioma",
|
|
101
|
+
toggleTheme: "Alternar tema",
|
|
102
|
+
more: "Mais",
|
|
103
|
+
loading: "Carregando",
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export function useUiMessages() {
|
|
108
|
+
return useMessages(uiMessages);
|
|
109
|
+
}
|
package/src/lib/utils.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cn } from "cn";
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import {
|
|
6
|
+
Sidebar,
|
|
7
|
+
SidebarCollapse,
|
|
8
|
+
SidebarContent,
|
|
9
|
+
SidebarFooter,
|
|
10
|
+
SidebarGroup,
|
|
11
|
+
SidebarGroupLabel,
|
|
12
|
+
SidebarHeader,
|
|
13
|
+
SidebarInset,
|
|
14
|
+
SidebarMenu,
|
|
15
|
+
SidebarMenuBadge,
|
|
16
|
+
SidebarMenuButton,
|
|
17
|
+
SidebarMenuItem,
|
|
18
|
+
SidebarProvider,
|
|
19
|
+
SidebarRail,
|
|
20
|
+
SidebarTrigger,
|
|
21
|
+
type SidebarMode,
|
|
22
|
+
} from "../components/ui/sidebar";
|
|
23
|
+
import { Separator } from "../components/ui/separator";
|
|
24
|
+
import { TooltipProvider } from "../components/ui/tooltip";
|
|
25
|
+
|
|
26
|
+
export interface NavigationItem {
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
icon?: ReactNode;
|
|
30
|
+
count?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface NavigationGroup {
|
|
33
|
+
label?: string;
|
|
34
|
+
items: NavigationItem[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AppShellProps {
|
|
38
|
+
/** Square logo; stays in place in every sidebar mode. */
|
|
39
|
+
logo: ReactNode;
|
|
40
|
+
/** App name next to the logo; fades out when the sidebar is compact. */
|
|
41
|
+
name: string;
|
|
42
|
+
navigation: NavigationGroup[];
|
|
43
|
+
activeId: string;
|
|
44
|
+
onNavigate: (id: string) => void;
|
|
45
|
+
/** Rendered in the header next to the sidebar trigger, e.g. breadcrumbs. */
|
|
46
|
+
header?: ReactNode;
|
|
47
|
+
/** Rendered at the end of the header, e.g. locale or theme switchers. */
|
|
48
|
+
actions?: ReactNode;
|
|
49
|
+
/** Sidebar footer, e.g. a user menu. */
|
|
50
|
+
footer?: ReactNode;
|
|
51
|
+
defaultMode?: SidebarMode;
|
|
52
|
+
defaultWidth?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Locks the shell to the viewport height so content (e.g. a `DataTable
|
|
55
|
+
* fillHeight`) fills the remaining space and scrolls internally.
|
|
56
|
+
*/
|
|
57
|
+
fillHeight?: boolean;
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Items without an icon still need something to show in compact mode.
|
|
62
|
+
function ItemIcon({ item }: { item: NavigationItem }) {
|
|
63
|
+
return (
|
|
64
|
+
item.icon ?? (
|
|
65
|
+
<span
|
|
66
|
+
aria-hidden="true"
|
|
67
|
+
className="flex size-4 items-center justify-center text-xs font-semibold"
|
|
68
|
+
>
|
|
69
|
+
{item.label.charAt(0).toUpperCase()}
|
|
70
|
+
</span>
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// The collapse control lives inside the sidebar; reopening needs one outside.
|
|
76
|
+
// Shown on mobile and, on desktop, only while the sidebar is hidden (CSS, so
|
|
77
|
+
// it is right from the first paint).
|
|
78
|
+
function HeaderTrigger() {
|
|
79
|
+
return (
|
|
80
|
+
<div className="flex items-center md:hidden md:group-has-data-[collapsible=offcanvas]/sidebar-wrapper:flex">
|
|
81
|
+
<SidebarTrigger className="-ml-1" />
|
|
82
|
+
<Separator
|
|
83
|
+
orientation="vertical"
|
|
84
|
+
className="mr-2 ml-2 h-4 self-center!"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function AppShell({
|
|
91
|
+
logo,
|
|
92
|
+
name,
|
|
93
|
+
navigation,
|
|
94
|
+
activeId,
|
|
95
|
+
onNavigate,
|
|
96
|
+
header,
|
|
97
|
+
actions,
|
|
98
|
+
footer,
|
|
99
|
+
defaultMode,
|
|
100
|
+
defaultWidth,
|
|
101
|
+
fillHeight = false,
|
|
102
|
+
children,
|
|
103
|
+
}: AppShellProps) {
|
|
104
|
+
return (
|
|
105
|
+
<TooltipProvider delay={600}>
|
|
106
|
+
<SidebarProvider defaultMode={defaultMode} defaultWidth={defaultWidth}>
|
|
107
|
+
<Sidebar>
|
|
108
|
+
{/* Same height as the page header so their controls line up. */}
|
|
109
|
+
<SidebarHeader className="min-h-14 justify-center">
|
|
110
|
+
{/* The logo keeps its position across modes; only the name fades,
|
|
111
|
+
and it is clipped (never squeezed) by the sidebar width. */}
|
|
112
|
+
<div className="flex h-8 items-center gap-2 overflow-hidden">
|
|
113
|
+
<div className="flex size-8 shrink-0 items-center justify-center [&>*]:shrink-0">
|
|
114
|
+
{logo}
|
|
115
|
+
</div>
|
|
116
|
+
<span className="flex-1 truncate font-semibold whitespace-nowrap transition-opacity duration-200 ease-linear group-data-[collapsible=icon]:opacity-0">
|
|
117
|
+
{name}
|
|
118
|
+
</span>
|
|
119
|
+
<SidebarCollapse className="group-data-[collapsible=icon]:hidden" />
|
|
120
|
+
</div>
|
|
121
|
+
<div className="hidden group-data-[collapsible=icon]:block">
|
|
122
|
+
<SidebarCollapse />
|
|
123
|
+
</div>
|
|
124
|
+
</SidebarHeader>
|
|
125
|
+
<SidebarContent>
|
|
126
|
+
{navigation.map((group, index) => (
|
|
127
|
+
<SidebarGroup key={group.label ?? index}>
|
|
128
|
+
{group.label ? (
|
|
129
|
+
<SidebarGroupLabel>{group.label}</SidebarGroupLabel>
|
|
130
|
+
) : null}
|
|
131
|
+
<SidebarMenu>
|
|
132
|
+
{group.items.map((item) => (
|
|
133
|
+
<SidebarMenuItem key={item.id}>
|
|
134
|
+
<SidebarMenuButton
|
|
135
|
+
isActive={item.id === activeId}
|
|
136
|
+
tooltip={item.label}
|
|
137
|
+
aria-current={item.id === activeId ? "page" : undefined}
|
|
138
|
+
onClick={() => onNavigate(item.id)}
|
|
139
|
+
>
|
|
140
|
+
<ItemIcon item={item} />
|
|
141
|
+
<span>{item.label}</span>
|
|
142
|
+
</SidebarMenuButton>
|
|
143
|
+
{item.count !== undefined ? (
|
|
144
|
+
<SidebarMenuBadge>{item.count}</SidebarMenuBadge>
|
|
145
|
+
) : null}
|
|
146
|
+
</SidebarMenuItem>
|
|
147
|
+
))}
|
|
148
|
+
</SidebarMenu>
|
|
149
|
+
</SidebarGroup>
|
|
150
|
+
))}
|
|
151
|
+
</SidebarContent>
|
|
152
|
+
{footer ? <SidebarFooter>{footer}</SidebarFooter> : null}
|
|
153
|
+
<SidebarRail />
|
|
154
|
+
</Sidebar>
|
|
155
|
+
<SidebarInset className={fillHeight ? "h-svh min-h-0" : undefined}>
|
|
156
|
+
<header className="sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4 md:px-6">
|
|
157
|
+
<HeaderTrigger />
|
|
158
|
+
<div className="min-w-0 flex-1">{header}</div>
|
|
159
|
+
{actions ? (
|
|
160
|
+
<div className="flex items-center gap-2">{actions}</div>
|
|
161
|
+
) : null}
|
|
162
|
+
</header>
|
|
163
|
+
<div
|
|
164
|
+
className={cn(
|
|
165
|
+
"flex flex-1 flex-col gap-4 p-4 md:gap-6 md:p-6",
|
|
166
|
+
fillHeight && "min-h-0 overflow-hidden",
|
|
167
|
+
)}
|
|
168
|
+
>
|
|
169
|
+
{children}
|
|
170
|
+
</div>
|
|
171
|
+
</SidebarInset>
|
|
172
|
+
</SidebarProvider>
|
|
173
|
+
</TooltipProvider>
|
|
174
|
+
);
|
|
175
|
+
}
|