@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
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useEffect, useId, useRef, } from "react";
|
|
2
|
-
import { defaultTextStyles } from "../Text";
|
|
3
|
-
import clsx from "../../utils/clsx";
|
|
4
|
-
import { mergeRefs } from "react-merge-refs";
|
|
5
|
-
const defaultLabelClassName = defaultTextStyles.variant.label;
|
|
6
|
-
const defaultDescriptionClassName = defaultTextStyles.variant.secondary;
|
|
7
|
-
function Checkbox({ id, label, description, className, labelClassName, descriptionClassName, inputClassName, labelOuterClassName, type = "checkbox", error, helpText, indeterminate, ref, ...props }) {
|
|
8
|
-
const innerRef = useRef(null);
|
|
9
|
-
const defaultInputId = useId();
|
|
10
|
-
const descriptionId = useId();
|
|
11
|
-
id = id || defaultInputId;
|
|
12
|
-
labelClassName = labelClassName
|
|
13
|
-
? `${defaultLabelClassName} ${labelClassName}`
|
|
14
|
-
: defaultLabelClassName;
|
|
15
|
-
descriptionClassName = descriptionClassName
|
|
16
|
-
? `${defaultDescriptionClassName} ${descriptionClassName}`
|
|
17
|
-
: defaultDescriptionClassName;
|
|
18
|
-
inputClassName = clsx("ui-checkbox", inputClassName);
|
|
19
|
-
if (error) {
|
|
20
|
-
labelClassName = clsx(labelClassName, "text-error-500 dark:text-error-500");
|
|
21
|
-
description = helpText || description;
|
|
22
|
-
if (description === helpText) {
|
|
23
|
-
descriptionClassName = clsx(descriptionClassName, "text-error-400 dark:text-error-600");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (innerRef.current) {
|
|
28
|
-
innerRef.current.indeterminate = !!indeterminate;
|
|
29
|
-
}
|
|
30
|
-
}, [indeterminate]);
|
|
31
|
-
return (<div className={clsx("relative flex items-start", className)}>
|
|
32
|
-
<div className="flex h-5 items-center">
|
|
33
|
-
<input {...props} id={id} aria-describedby={descriptionId} type={type} className={inputClassName} ref={mergeRefs([ref, innerRef])}/>
|
|
34
|
-
</div>
|
|
35
|
-
{(label || description) && (<div className={clsx("ml-3 text-sm", labelOuterClassName)}>
|
|
36
|
-
{label && (<label htmlFor={id} className={labelClassName}>
|
|
37
|
-
{label}
|
|
38
|
-
</label>)}
|
|
39
|
-
{description && (<p id={descriptionId} className={descriptionClassName}>
|
|
40
|
-
{description}
|
|
41
|
-
</p>)}
|
|
42
|
-
</div>)}
|
|
43
|
-
</div>);
|
|
44
|
-
}
|
|
45
|
-
export default Checkbox;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Language, type PrismTheme } from "prism-react-renderer";
|
|
2
|
-
export type CodeProps = {
|
|
3
|
-
children: string;
|
|
4
|
-
language: Language;
|
|
5
|
-
className?: string;
|
|
6
|
-
copy?: boolean;
|
|
7
|
-
copyText?: string;
|
|
8
|
-
copiedText?: string;
|
|
9
|
-
theme?: PrismTheme;
|
|
10
|
-
copyClassName?: string;
|
|
11
|
-
};
|
|
12
|
-
export default function Code({ children, language, className, copy, copyText, copiedText, theme, copyClassName, }: CodeProps): import("react").JSX.Element;
|
package/components/Code/Code.jsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Fragment } from "react";
|
|
2
|
-
import { Highlight, } from "prism-react-renderer";
|
|
3
|
-
import clsx from "../../utils/clsx";
|
|
4
|
-
import CopyButton from "../CopyButton";
|
|
5
|
-
export default function Code({ children, language, className, copy, copyText, copiedText, theme, copyClassName, }) {
|
|
6
|
-
return (<div className={clsx("group relative", className, {
|
|
7
|
-
dark: !theme,
|
|
8
|
-
})}>
|
|
9
|
-
<div className="prose max-w-none">
|
|
10
|
-
<Highlight code={children.trimEnd()} language={language} theme={theme}>
|
|
11
|
-
{({ className, style, tokens, getTokenProps }) => (<pre className={className} style={style}>
|
|
12
|
-
<code>
|
|
13
|
-
{tokens.map((line, lineIndex) => (<Fragment key={lineIndex}>
|
|
14
|
-
{line
|
|
15
|
-
.filter((token) => !token.empty)
|
|
16
|
-
.map((token, tokenIndex) => (<span key={tokenIndex} {...getTokenProps({ token })}/>))}
|
|
17
|
-
{"\n"}
|
|
18
|
-
</Fragment>))}
|
|
19
|
-
</code>
|
|
20
|
-
</pre>)}
|
|
21
|
-
</Highlight>
|
|
22
|
-
</div>
|
|
23
|
-
{copy && (<CopyButton text={children} copyText={copyText} copiedText={copiedText} className={copyClassName}/>)}
|
|
24
|
-
</div>);
|
|
25
|
-
}
|
package/components/Code/Json.jsx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type MenuProps } from "../Menu/Menu";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
import { type ButtonProps } from "../Button";
|
|
4
|
-
export type ConfirmationButtonProps = {
|
|
5
|
-
confirmation: string;
|
|
6
|
-
label: ReactNode;
|
|
7
|
-
confirm?: string;
|
|
8
|
-
onConfirm: () => void;
|
|
9
|
-
loading?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
cancel?: string;
|
|
12
|
-
position?: MenuProps["position"];
|
|
13
|
-
buttonClassName?: string;
|
|
14
|
-
buttonProps?: Partial<ButtonProps>;
|
|
15
|
-
menuProps?: Partial<MenuProps>;
|
|
16
|
-
};
|
|
17
|
-
export default function ConfirmationButton({ label, confirm, confirmation, onConfirm, loading, className, cancel, position, buttonClassName, buttonProps, menuProps, }: ConfirmationButtonProps): import("react").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Menu, {} from "../Menu/Menu";
|
|
2
|
-
import Button, {} from "../Button";
|
|
3
|
-
export default function ConfirmationButton({ label, confirm, confirmation, onConfirm, loading, className, cancel = "Cancel", position, buttonClassName, buttonProps, menuProps, }) {
|
|
4
|
-
return (<Menu position={position} button={<Button color="error" loading={loading} className={buttonClassName} {...buttonProps}>
|
|
5
|
-
{label}
|
|
6
|
-
</Button>} className={className} {...menuProps}>
|
|
7
|
-
<Menu.Label>{confirmation}</Menu.Label>
|
|
8
|
-
<Menu.Item className="text-red-500!" onClick={onConfirm}>
|
|
9
|
-
{confirm || label}
|
|
10
|
-
</Menu.Item>
|
|
11
|
-
<Menu.Item>{cancel}</Menu.Item>
|
|
12
|
-
</Menu>);
|
|
13
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React, { type ComponentProps } from "react";
|
|
2
|
-
import * as RContextMenu from "@radix-ui/react-context-menu";
|
|
3
|
-
declare function ContextMenuContent({ className, children, ...props }: ComponentProps<typeof RContextMenu.Content>): React.JSX.Element;
|
|
4
|
-
declare function ContextMenuSeparator({ className, ...props }: ComponentProps<typeof RContextMenu.Separator>): React.JSX.Element;
|
|
5
|
-
declare function ContextMenuItem({ className, href, ...props }: ComponentProps<typeof RContextMenu.Item> & {
|
|
6
|
-
href?: string;
|
|
7
|
-
}): React.JSX.Element;
|
|
8
|
-
declare function ContextMenuItemIndicator({ className, ...props }: ComponentProps<typeof RContextMenu.ItemIndicator>): React.JSX.Element;
|
|
9
|
-
declare function ContextMenuCheckboxItem({ className, children, indicatorClassName, ...props }: ComponentProps<typeof RContextMenu.CheckboxItem> & {
|
|
10
|
-
indicatorClassName?: string;
|
|
11
|
-
}): React.JSX.Element;
|
|
12
|
-
declare function ContextMenuSubContent({ className, children, sideOffset, alignOffset, ...props }: ComponentProps<typeof RContextMenu.SubContent>): React.JSX.Element;
|
|
13
|
-
declare function ContextMenuSubTrigger({ className, href, children, ...props }: ComponentProps<typeof RContextMenu.SubTrigger> & {
|
|
14
|
-
href?: string;
|
|
15
|
-
}): React.JSX.Element;
|
|
16
|
-
declare const ContextMenu: {
|
|
17
|
-
Root: React.FC<RContextMenu.ContextMenuProps>;
|
|
18
|
-
Trigger: React.ForwardRefExoticComponent<RContextMenu.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
-
Content: typeof ContextMenuContent;
|
|
20
|
-
Item: typeof ContextMenuItem;
|
|
21
|
-
Separator: typeof ContextMenuSeparator;
|
|
22
|
-
CheckboxItem: typeof ContextMenuCheckboxItem;
|
|
23
|
-
ItemIndicator: typeof ContextMenuItemIndicator;
|
|
24
|
-
Sub: React.FC<RContextMenu.ContextMenuSubProps>;
|
|
25
|
-
SubContent: typeof ContextMenuSubContent;
|
|
26
|
-
SubTrigger: typeof ContextMenuSubTrigger;
|
|
27
|
-
};
|
|
28
|
-
export default ContextMenu;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import * as RContextMenu from "@radix-ui/react-context-menu";
|
|
3
|
-
import { CheckIcon } from "@heroicons/react/16/solid";
|
|
4
|
-
import Link from "next/link";
|
|
5
|
-
import clsx from "../../utils/clsx";
|
|
6
|
-
import { dropdownCheckboxItemClassName, dropdownItemClassName, dropdownItemIndicatorClassName, dropdownSeparatorClassName, dropdownSubTriggerClassName, } from "../../styles/Dropdown.classNames";
|
|
7
|
-
import { modalContentClassName } from "../../styles/Modal.classNames";
|
|
8
|
-
import { ChevronRightIcon } from "@heroicons/react/20/solid";
|
|
9
|
-
function ContextMenuContent({ className, children, ...props }) {
|
|
10
|
-
return (<RContextMenu.Portal>
|
|
11
|
-
<RContextMenu.Content {...props} className={clsx(modalContentClassName, "ui-context-menu-content", className)}>
|
|
12
|
-
{children}
|
|
13
|
-
</RContextMenu.Content>
|
|
14
|
-
</RContextMenu.Portal>);
|
|
15
|
-
}
|
|
16
|
-
function ContextMenuSeparator({ className, ...props }) {
|
|
17
|
-
return (<RContextMenu.Separator {...props} className={clsx(dropdownSeparatorClassName, "ui-context-menu-separator", className)}/>);
|
|
18
|
-
}
|
|
19
|
-
function ContextMenuItem({ className, href, ...props }) {
|
|
20
|
-
const Wrapper = href ? Link : Fragment;
|
|
21
|
-
return (
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
<Wrapper {...(href ? { href } : {})}>
|
|
24
|
-
<RContextMenu.Item {...props} className={clsx(dropdownItemClassName, "ui-context-menu-item", className)}/>
|
|
25
|
-
</Wrapper>);
|
|
26
|
-
}
|
|
27
|
-
function ContextMenuItemIndicator({ className, ...props }) {
|
|
28
|
-
return (<RContextMenu.ItemIndicator className={clsx(dropdownItemIndicatorClassName, "ui-context-menu-checkbox-item-indicator", className)} {...props}/>);
|
|
29
|
-
}
|
|
30
|
-
function ContextMenuCheckboxItem({ className, children, indicatorClassName, ...props }) {
|
|
31
|
-
return (<RContextMenu.CheckboxItem {...props} className={clsx(dropdownCheckboxItemClassName, "ui-context-menu-checkbox-item", className)}>
|
|
32
|
-
<ContextMenuItemIndicator className={clsx("ui-context-menu-checkbox-item-indicator", indicatorClassName)}>
|
|
33
|
-
<CheckIcon />
|
|
34
|
-
</ContextMenuItemIndicator>
|
|
35
|
-
{children}
|
|
36
|
-
</RContextMenu.CheckboxItem>);
|
|
37
|
-
}
|
|
38
|
-
function ContextMenuSubContent({ className, children, sideOffset = 2, alignOffset = -4, ...props }) {
|
|
39
|
-
return (<RContextMenu.Portal>
|
|
40
|
-
<RContextMenu.SubContent sideOffset={sideOffset} alignOffset={alignOffset} {...props} className={clsx(modalContentClassName, "ui-context-menu-sub-content", className)}>
|
|
41
|
-
{children}
|
|
42
|
-
</RContextMenu.SubContent>
|
|
43
|
-
</RContextMenu.Portal>);
|
|
44
|
-
}
|
|
45
|
-
function ContextMenuSubTrigger({ className, href, children, ...props }) {
|
|
46
|
-
const Wrapper = href ? Link : Fragment;
|
|
47
|
-
return (
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
-
<Wrapper {...(href ? { href } : {})}>
|
|
50
|
-
<RContextMenu.SubTrigger {...props} className={clsx(dropdownSubTriggerClassName, "ui-context-menu-sub-trigger", className)}>
|
|
51
|
-
{children}
|
|
52
|
-
<div className={clsx("absolute top-1.5 right-1.5 inline-flex items-center justify-center", "[&>svg]:h-4 [&>svg]:w-4")}>
|
|
53
|
-
<ChevronRightIcon />
|
|
54
|
-
</div>
|
|
55
|
-
</RContextMenu.SubTrigger>
|
|
56
|
-
</Wrapper>);
|
|
57
|
-
}
|
|
58
|
-
const ContextMenu = {
|
|
59
|
-
Root: RContextMenu.Root,
|
|
60
|
-
Trigger: RContextMenu.Trigger,
|
|
61
|
-
Content: ContextMenuContent,
|
|
62
|
-
Item: ContextMenuItem,
|
|
63
|
-
Separator: ContextMenuSeparator,
|
|
64
|
-
CheckboxItem: ContextMenuCheckboxItem,
|
|
65
|
-
ItemIndicator: ContextMenuItemIndicator,
|
|
66
|
-
Sub: RContextMenu.Sub,
|
|
67
|
-
SubContent: ContextMenuSubContent,
|
|
68
|
-
SubTrigger: ContextMenuSubTrigger,
|
|
69
|
-
};
|
|
70
|
-
export default ContextMenu;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
import { ClipboardIcon } from "@heroicons/react/24/outline";
|
|
4
|
-
import Button from "../Button";
|
|
5
|
-
export default function CopyButton({ text, copyText = "Copy", copiedText = "Copied!", className, }) {
|
|
6
|
-
const [copyCount, setCopyCount] = useState(0);
|
|
7
|
-
const copied = copyCount > 0;
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (copyCount > 0) {
|
|
10
|
-
const timeout = setTimeout(() => setCopyCount(0), 1000);
|
|
11
|
-
return () => {
|
|
12
|
-
clearTimeout(timeout);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}, [copyCount]);
|
|
16
|
-
return (<Button type="button" color={copied ? "success" : undefined} size="sm" className={clsx("absolute right-2.5 top-2.5 opacity-0 backdrop-blur-sm focus:opacity-100 group-hover:opacity-100", className)} onClick={() => {
|
|
17
|
-
window.navigator.clipboard.writeText(text).then(() => {
|
|
18
|
-
setCopyCount((count) => count + 1);
|
|
19
|
-
});
|
|
20
|
-
}} rounded>
|
|
21
|
-
<span aria-hidden={copied} className={clsx("pointer-events-none flex items-center gap-0.5 transition-[transform,opacity]", copied && "-translate-y-1.5 opacity-0")}>
|
|
22
|
-
<ClipboardIcon className="mr-2 h-4 w-4"/>
|
|
23
|
-
{copyText}
|
|
24
|
-
</span>
|
|
25
|
-
<span aria-hidden={!copied} className={clsx("pointer-events-none absolute inset-0 flex items-center justify-center transition-[transform,opacity]", !copied && "translate-y-1.5 opacity-0")}>
|
|
26
|
-
{copiedText}
|
|
27
|
-
</span>
|
|
28
|
-
</Button>);
|
|
29
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type InputProps } from "../Input";
|
|
2
|
-
declare function DateInput({ readOnly, value, onValueChange, ref, ...props }: Omit<InputProps<false>, "value"> & {
|
|
3
|
-
value?: string;
|
|
4
|
-
onValueChange?: (value?: string) => void;
|
|
5
|
-
}): import("react").JSX.Element;
|
|
6
|
-
export default DateInput;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import Input, {} from "../Input";
|
|
3
|
-
import { CalendarIcon } from "@heroicons/react/20/solid";
|
|
4
|
-
import { useRefValue } from "./useRefValue";
|
|
5
|
-
import dayjs from "dayjs";
|
|
6
|
-
function DateInput({ readOnly, value, onValueChange, ref, ...props }) {
|
|
7
|
-
const realRef = useRefValue(ref);
|
|
8
|
-
const formattedValue = useMemo(() => (value && value.includes("T") ? value.split("T")[0] : value) || "", [value]);
|
|
9
|
-
return (<Input {...props} onChange={(e) => onValueChange?.(e.target.value
|
|
10
|
-
? `${e.target.value}T${dayjs()
|
|
11
|
-
.set("hour", 0)
|
|
12
|
-
.set("minute", 0)
|
|
13
|
-
.set("second", 0)
|
|
14
|
-
.set("millisecond", 0)
|
|
15
|
-
.toISOString()
|
|
16
|
-
.split("T")[1]}`
|
|
17
|
-
: e.target.value)} ref={realRef} type="date" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" trailing={!readOnly ? <CalendarIcon className="w-5"/> : undefined} inputClassName="pr-3!" readOnly={readOnly} value={formattedValue}/>);
|
|
18
|
-
}
|
|
19
|
-
export default DateInput;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import Input, {} from "../Input";
|
|
2
|
-
import { CalendarIcon } from "@heroicons/react/20/solid";
|
|
3
|
-
import { useRefValue } from "./useRefValue";
|
|
4
|
-
function DateTimeInput({ readOnly, ref, ...props }) {
|
|
5
|
-
const realRef = useRefValue(ref);
|
|
6
|
-
return (<Input {...props} ref={realRef} type="datetime-local" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}" trailing={!readOnly ? <CalendarIcon className="w-5"/> : undefined} inputClassName="pr-3!" readOnly={readOnly}/>);
|
|
7
|
-
}
|
|
8
|
-
export default DateTimeInput;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type Ref } from "react";
|
|
2
|
-
import "dayjs/locale/pt-br";
|
|
3
|
-
export declare function parseDate(value: string): string;
|
|
4
|
-
export declare function formatDate(value: string): string;
|
|
5
|
-
export declare function useRefValue(ref?: Ref<HTMLInputElement>): import("react").RefObject<HTMLInputElement | null>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
2
|
-
import dayjs from "dayjs";
|
|
3
|
-
import "dayjs/locale/pt-br";
|
|
4
|
-
dayjs.locale("pt-br");
|
|
5
|
-
export function parseDate(value) {
|
|
6
|
-
try {
|
|
7
|
-
// noinspection SpellCheckingInspection
|
|
8
|
-
return dayjs(value, "YYYY-MM-DDTHH:mm").toISOString();
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function formatDate(value) {
|
|
16
|
-
try {
|
|
17
|
-
// noinspection SpellCheckingInspection
|
|
18
|
-
return dayjs(value).format("YYYY-MM-DDTHH:mm");
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
return value;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export function useRefValue(ref) {
|
|
26
|
-
const realRef = useRef(null);
|
|
27
|
-
const innerRef = useRef({
|
|
28
|
-
get value() {
|
|
29
|
-
return parseDate(realRef.current?.value || "");
|
|
30
|
-
},
|
|
31
|
-
set value(value) {
|
|
32
|
-
if (realRef.current) {
|
|
33
|
-
realRef.current.value = formatDate(value);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (ref) {
|
|
39
|
-
if (typeof ref === "function") {
|
|
40
|
-
ref(innerRef.current);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
ref.current = innerRef.current;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, [ref]);
|
|
47
|
-
return realRef;
|
|
48
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
2
|
-
import type { DayPickerProps } from "react-day-picker";
|
|
3
|
-
import { type DateRange, type Matcher, type ModifiersClassNames } from "react-day-picker";
|
|
4
|
-
import Button from "../Button";
|
|
5
|
-
export type { DateRange };
|
|
6
|
-
export default function DatePicker({ value, onValueChange, children, buttonProps, fromDate, toDate, footer, monthFooter, modifiers, modifiersClassNames, disabled, defaultMonth, }: {
|
|
7
|
-
value?: Date | string;
|
|
8
|
-
onValueChange?: (value?: Date) => void;
|
|
9
|
-
children?: (value: string) => ReactElement;
|
|
10
|
-
buttonProps?: ComponentProps<typeof Button>;
|
|
11
|
-
fromDate?: Date;
|
|
12
|
-
toDate?: Date;
|
|
13
|
-
footer?: ReactNode;
|
|
14
|
-
monthFooter?: ReactNode;
|
|
15
|
-
modifiers?: DayPickerProps["modifiers"];
|
|
16
|
-
modifiersClassNames?: ModifiersClassNames;
|
|
17
|
-
disabled?: Matcher | Matcher[];
|
|
18
|
-
defaultMonth?: Date;
|
|
19
|
-
}): React.JSX.Element;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useMemo, useState, } from "react";
|
|
2
|
-
import { DayPicker, } from "react-day-picker";
|
|
3
|
-
import dayjs from "dayjs";
|
|
4
|
-
import { CalendarIcon } from "@heroicons/react/20/solid";
|
|
5
|
-
import Button from "../Button";
|
|
6
|
-
import clsx from "../../utils/clsx";
|
|
7
|
-
import { useDeepCompareEffect } from "react-use";
|
|
8
|
-
import Popover from "../Popover";
|
|
9
|
-
import { dayPickerButtonClassName, dayPickerClassNames, } from "../../styles/DayPicker.classNames";
|
|
10
|
-
export default function DatePicker({ value, onValueChange, children, buttonProps, fromDate, toDate, footer, monthFooter, modifiers, modifiersClassNames, disabled, defaultMonth, }) {
|
|
11
|
-
const [open, setOpen] = useState(false);
|
|
12
|
-
const convertedValue = value && typeof value === "string"
|
|
13
|
-
? dayjs(value).toDate()
|
|
14
|
-
: (value || undefined);
|
|
15
|
-
const [date, setDate] = useState(convertedValue);
|
|
16
|
-
useDeepCompareEffect(() => {
|
|
17
|
-
onValueChange?.(date);
|
|
18
|
-
}, [date || {}]);
|
|
19
|
-
useDeepCompareEffect(() => {
|
|
20
|
-
setDate(convertedValue);
|
|
21
|
-
}, [convertedValue || {}]);
|
|
22
|
-
const buttonText = useMemo(() => {
|
|
23
|
-
return date ? dayjs(date).format("ll") : "";
|
|
24
|
-
}, [date]);
|
|
25
|
-
const children2 = children ? (children(buttonText)) : (<Button {...buttonProps} leading={buttonProps?.leading || <CalendarIcon />} className={clsx(dayPickerButtonClassName, buttonProps?.className)}>
|
|
26
|
-
{buttonText}
|
|
27
|
-
</Button>);
|
|
28
|
-
const defaultDisabled = useMemo(() => [
|
|
29
|
-
...(fromDate
|
|
30
|
-
? [
|
|
31
|
-
{
|
|
32
|
-
before: fromDate,
|
|
33
|
-
},
|
|
34
|
-
]
|
|
35
|
-
: []),
|
|
36
|
-
...(toDate
|
|
37
|
-
? [
|
|
38
|
-
{
|
|
39
|
-
after: toDate,
|
|
40
|
-
},
|
|
41
|
-
]
|
|
42
|
-
: []),
|
|
43
|
-
], [fromDate, toDate]);
|
|
44
|
-
const onSelect = useCallback((value) => {
|
|
45
|
-
setOpen(false);
|
|
46
|
-
setDate(value);
|
|
47
|
-
}, []);
|
|
48
|
-
return (<Popover.Root open={open} onOpenChange={setOpen}>
|
|
49
|
-
<Popover.Trigger asChild>{children2}</Popover.Trigger>
|
|
50
|
-
<Popover.Content>
|
|
51
|
-
<DayPicker mode="single" selected={date} onSelect={onSelect} showOutsideDays classNames={dayPickerClassNames} startMonth={fromDate} endMonth={toDate} footer={monthFooter} modifiers={modifiers} modifiersClassNames={modifiersClassNames} disabled={disabled || defaultDisabled} defaultMonth={defaultMonth}/>
|
|
52
|
-
{footer}
|
|
53
|
-
</Popover.Content>
|
|
54
|
-
</Popover.Root>);
|
|
55
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
2
|
-
import { type DateRange } from "react-day-picker";
|
|
3
|
-
import Button from "../Button";
|
|
4
|
-
export type { DateRange };
|
|
5
|
-
export default function DateRangePicker({ value, onValueChange, children, buttonProps, fromDate, toDate, min, max, footer, monthFooter, }: {
|
|
6
|
-
value?: DateRange;
|
|
7
|
-
onValueChange?: (value?: DateRange) => void;
|
|
8
|
-
children?: (value: string) => ReactElement;
|
|
9
|
-
buttonProps?: ComponentProps<typeof Button>;
|
|
10
|
-
fromDate?: Date;
|
|
11
|
-
toDate?: Date;
|
|
12
|
-
min?: number;
|
|
13
|
-
max?: number;
|
|
14
|
-
footer?: ReactNode;
|
|
15
|
-
monthFooter?: ReactNode;
|
|
16
|
-
}): React.JSX.Element;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useState, } from "react";
|
|
2
|
-
import { DayPicker } from "react-day-picker";
|
|
3
|
-
import dayjs from "dayjs";
|
|
4
|
-
import { CalendarIcon } from "@heroicons/react/20/solid";
|
|
5
|
-
import Button from "../Button";
|
|
6
|
-
import clsx from "../../utils/clsx";
|
|
7
|
-
import { useDeepCompareEffect } from "react-use";
|
|
8
|
-
import Popover from "../Popover";
|
|
9
|
-
import { dayPickerButtonClassName, dayPickerClassNames, } from "../../styles/DayPicker.classNames";
|
|
10
|
-
export default function DateRangePicker({ value, onValueChange, children, buttonProps, fromDate, toDate, min, max, footer, monthFooter, }) {
|
|
11
|
-
const [range, setRange] = useState(value);
|
|
12
|
-
useDeepCompareEffect(() => {
|
|
13
|
-
onValueChange?.(range);
|
|
14
|
-
}, [range || {}]);
|
|
15
|
-
useDeepCompareEffect(() => {
|
|
16
|
-
setRange(value);
|
|
17
|
-
}, [value || {}]);
|
|
18
|
-
const buttonText = useMemo(() => {
|
|
19
|
-
let buttonText = "";
|
|
20
|
-
if (range?.from) {
|
|
21
|
-
if (!range.to) {
|
|
22
|
-
buttonText = dayjs(range.from).format("ll");
|
|
23
|
-
}
|
|
24
|
-
else if (range.to) {
|
|
25
|
-
buttonText = `${dayjs(range.from).format("ll")} – ${dayjs(range.to).format("ll")}`;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return buttonText;
|
|
29
|
-
}, [range]);
|
|
30
|
-
const children2 = children ? (children(buttonText)) : (<Button {...buttonProps} leading={buttonProps?.leading || <CalendarIcon />} className={clsx(dayPickerButtonClassName, buttonProps?.className)}>
|
|
31
|
-
{buttonText}
|
|
32
|
-
</Button>);
|
|
33
|
-
const hidden = useMemo(() => [
|
|
34
|
-
...(fromDate
|
|
35
|
-
? [
|
|
36
|
-
{
|
|
37
|
-
before: fromDate,
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
: []),
|
|
41
|
-
...(toDate
|
|
42
|
-
? [
|
|
43
|
-
{
|
|
44
|
-
after: toDate,
|
|
45
|
-
},
|
|
46
|
-
]
|
|
47
|
-
: []),
|
|
48
|
-
], [fromDate, toDate]);
|
|
49
|
-
return (<Popover.Root>
|
|
50
|
-
<Popover.Trigger asChild>{children2}</Popover.Trigger>
|
|
51
|
-
<Popover.Content>
|
|
52
|
-
<DayPicker mode="range" defaultMonth={value?.from} selected={range} onSelect={setRange} numberOfMonths={2} showOutsideDays classNames={dayPickerClassNames} startMonth={fromDate} endMonth={toDate} hidden={hidden} min={min} max={max} footer={monthFooter} excludeDisabled/>
|
|
53
|
-
{footer}
|
|
54
|
-
</Popover.Content>
|
|
55
|
-
</Popover.Root>);
|
|
56
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as RDialog from "@radix-ui/react-dialog";
|
|
2
|
-
import type { DialogContentProps } from "@radix-ui/react-dialog";
|
|
3
|
-
import { type ReactNode } from "react";
|
|
4
|
-
export interface DialogProps {
|
|
5
|
-
title: ReactNode;
|
|
6
|
-
description?: ReactNode;
|
|
7
|
-
contentClassName?: string;
|
|
8
|
-
contentOverflowClassName?: string;
|
|
9
|
-
closeButtonClassName?: string;
|
|
10
|
-
overlayClassName?: string;
|
|
11
|
-
titleClassName?: string;
|
|
12
|
-
descriptionClassName?: string;
|
|
13
|
-
hideTitle?: boolean;
|
|
14
|
-
contentProps?: Omit<DialogContentProps, "children">;
|
|
15
|
-
hideCloseButton?: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare function Dialog({ children, title, description, open, onOpenChange, contentClassName, contentOverflowClassName, closeButtonClassName, overlayClassName, titleClassName, descriptionClassName, hideTitle, contentProps, hideCloseButton, }: {
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
open: boolean;
|
|
20
|
-
onOpenChange: (open: boolean) => void;
|
|
21
|
-
} & DialogProps): import("react").JSX.Element;
|
|
22
|
-
declare namespace Dialog {
|
|
23
|
-
var Close: import("react").ForwardRefExoticComponent<RDialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
24
|
-
}
|
|
25
|
-
export default Dialog;
|