@majapisoftwares/ui 4.3.16 → 5.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 +17 -0
- package/README.md +71 -0
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/components.json +25 -0
- package/docs/MIGRATION-0.2.md +20 -0
- package/docs/NEXT-STARTER-VALIDATION.md +14 -0
- package/docs/STANDARDS.md +36 -0
- package/docs/VALIDATION.md +11 -0
- package/package.json +69 -2
- package/scripts/check-standards.mjs +39 -0
- package/src/components/ui/alert.tsx +77 -0
- package/src/components/ui/badge.tsx +55 -0
- package/src/components/ui/button.tsx +63 -0
- package/src/components/ui/empty.tsx +105 -0
- package/src/components/ui/field.tsx +238 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/native-select.tsx +66 -0
- package/src/components/ui/separator.tsx +24 -0
- package/src/components/ui/sheet.tsx +137 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/table.tsx +115 -0
- package/src/components/ui/tabs.tsx +81 -0
- package/src/lib/utils.ts +1 -0
- package/src/patterns/app-shell.tsx +70 -0
- package/src/patterns/data-table.tsx +225 -0
- package/src/patterns/details-sheet.tsx +51 -0
- package/src/patterns/page-header.tsx +40 -0
- package/src/patterns/status-badge.tsx +23 -0
- package/src/styles.css +465 -0
- package/src/templates/admin-dashboard.tsx +63 -0
- package/src/templates/auth-layout.tsx +36 -0
- package/src/templates/login-form.tsx +97 -0
- package/src/templates/signup-form.tsx +137 -0
- package/src/vite-env.d.ts +1 -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,10 +0,0 @@
|
|
|
1
|
-
const videoExtensions = [".mp4"];
|
|
2
|
-
export default function isVideo(file) {
|
|
3
|
-
if (typeof file === "string") {
|
|
4
|
-
return videoExtensions.some((ext) => file.endsWith(ext));
|
|
5
|
-
}
|
|
6
|
-
if (file instanceof File) {
|
|
7
|
-
return videoExtensions.some((ext) => file.name.endsWith(ext));
|
|
8
|
-
}
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
|
-
export interface FileSelectProps {
|
|
3
|
-
uploadAFileText?: string;
|
|
4
|
-
orDragAndDropText?: string;
|
|
5
|
-
upToText?: string;
|
|
6
|
-
anyFileText?: string;
|
|
7
|
-
dropFilesHereText?: string;
|
|
8
|
-
uploadingText?: string;
|
|
9
|
-
maxFileSize?: number | string;
|
|
10
|
-
allowedFileTypes?: string[];
|
|
11
|
-
id?: string;
|
|
12
|
-
limit?: number;
|
|
13
|
-
onAcceptFiles: (files: File[]) => void;
|
|
14
|
-
onRejectFiles?: (files: File[], reason: "type" | "size") => void;
|
|
15
|
-
helperText?: string;
|
|
16
|
-
className?: string;
|
|
17
|
-
error?: boolean;
|
|
18
|
-
icon?: ReactElement<{
|
|
19
|
-
className?: string;
|
|
20
|
-
}>;
|
|
21
|
-
uploading?: boolean;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
additionalBottomInfo?: ReactNode;
|
|
24
|
-
ref?: Ref<HTMLInputElement>;
|
|
25
|
-
innerClassName?: string;
|
|
26
|
-
}
|
|
27
|
-
declare function FileSelect({ maxFileSize, allowedFileTypes, id, limit, onAcceptFiles, className, uploadAFileText, orDragAndDropText, upToText, anyFileText, dropFilesHereText, uploadingText, icon, uploading, disabled, additionalBottomInfo, onRejectFiles, error, ref, innerClassName, }: FileSelectProps): import("react").JSX.Element;
|
|
28
|
-
export default FileSelect;
|
|
29
|
-
export declare function FileSelectProvider({ children }: {
|
|
30
|
-
children: ReactNode;
|
|
31
|
-
}): import("react").JSX.Element;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { cloneElement, useCallback, useEffect, useId, useState, } from "react";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
import { DndProvider, useDrop } from "react-dnd";
|
|
4
|
-
import { HTML5Backend, NativeTypes } from "react-dnd-html5-backend";
|
|
5
|
-
import numeral from "numeral";
|
|
6
|
-
import { ArrowUpTrayIcon } from "@heroicons/react/24/solid";
|
|
7
|
-
import { DocumentIcon } from "@heroicons/react/24/outline";
|
|
8
|
-
import Loading from "../Loading";
|
|
9
|
-
import { uniq } from "lodash-es";
|
|
10
|
-
const translateAllowedType = (type) => ({
|
|
11
|
-
"image/png": "PNG",
|
|
12
|
-
".png": "PNG",
|
|
13
|
-
"image/jpeg": "JPG",
|
|
14
|
-
".jpg": "JPG",
|
|
15
|
-
".jpeg": "JPG",
|
|
16
|
-
".gif": "GIF",
|
|
17
|
-
"image/gif": "GIF",
|
|
18
|
-
"video/mp4": "MP4",
|
|
19
|
-
".mp4": "MP4",
|
|
20
|
-
".csv": "CSV",
|
|
21
|
-
"audio/mpeg": "MP3",
|
|
22
|
-
"application/pdf": "PDF",
|
|
23
|
-
"text/csv": "CSV",
|
|
24
|
-
"application/msword": "DOC",
|
|
25
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "DOCX",
|
|
26
|
-
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "PPTX",
|
|
27
|
-
".webp": "WEBP",
|
|
28
|
-
"image/webp": "WEBP",
|
|
29
|
-
})[type] || type;
|
|
30
|
-
const defaultIcon = <DocumentIcon />;
|
|
31
|
-
function checkAllowedFileTypesFn(file, allowedFileTypes) {
|
|
32
|
-
return (!allowedFileTypes ||
|
|
33
|
-
allowedFileTypes.includes(file.type) ||
|
|
34
|
-
allowedFileTypes.some((t) => file.name.endsWith(t)));
|
|
35
|
-
}
|
|
36
|
-
function FileSelect({ maxFileSize, allowedFileTypes, id, limit, onAcceptFiles, className, uploadAFileText = "Upload a file", orDragAndDropText = "or drag and drop", upToText = "up to", anyFileText = "Any file", dropFilesHereText = "Drop files here", uploadingText = "Uploading...", icon = defaultIcon, uploading, disabled, additionalBottomInfo, onRejectFiles, error, ref, innerClassName, }) {
|
|
37
|
-
const innerId = useId();
|
|
38
|
-
id = id || innerId;
|
|
39
|
-
maxFileSize =
|
|
40
|
-
typeof maxFileSize === "string"
|
|
41
|
-
? numeral(maxFileSize).value() || undefined
|
|
42
|
-
: maxFileSize;
|
|
43
|
-
maxFileSize = maxFileSize || numeral("10MB").value() || undefined;
|
|
44
|
-
const checkAllowedFileTypes = useCallback((file) => checkAllowedFileTypesFn(file, allowedFileTypes), [allowedFileTypes]);
|
|
45
|
-
const handleFileBrowse = (event) => {
|
|
46
|
-
if (!event.target.files) {
|
|
47
|
-
throw Error("Files is falsy");
|
|
48
|
-
}
|
|
49
|
-
const files = Array.from(event.target.files);
|
|
50
|
-
const acceptedFiles = files.filter((file) => checkAllowedFileTypes(file) && file.size <= maxFileSize);
|
|
51
|
-
if (onRejectFiles) {
|
|
52
|
-
const rejectedFilesType = files.filter((file) => !checkAllowedFileTypes(file));
|
|
53
|
-
if (rejectedFilesType.length) {
|
|
54
|
-
onRejectFiles(rejectedFilesType, "type");
|
|
55
|
-
}
|
|
56
|
-
const rejectedFilesSize = files.filter((file) => file.size > maxFileSize);
|
|
57
|
-
if (rejectedFilesSize.length) {
|
|
58
|
-
onRejectFiles(rejectedFilesSize, "size");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
onAcceptFiles(acceptedFiles);
|
|
62
|
-
event.target.value = "";
|
|
63
|
-
};
|
|
64
|
-
const [pasteEnabled, setPasteEnabled] = useState(false);
|
|
65
|
-
useOnPasteFiles(pasteEnabled, onAcceptFiles, allowedFileTypes);
|
|
66
|
-
const [{ canDrop, isOver }, drop] = useDrop(() => ({
|
|
67
|
-
accept: [NativeTypes.FILE],
|
|
68
|
-
drop(item) {
|
|
69
|
-
if (!disabled) {
|
|
70
|
-
let files = item.files;
|
|
71
|
-
files = files.filter(checkAllowedFileTypes);
|
|
72
|
-
onAcceptFiles(files);
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
collect: (monitor) => ({
|
|
76
|
-
isOver: monitor.isOver(),
|
|
77
|
-
canDrop: monitor.canDrop(),
|
|
78
|
-
}),
|
|
79
|
-
}));
|
|
80
|
-
return (<div ref={(ref) => {
|
|
81
|
-
drop(ref);
|
|
82
|
-
}} className={clsx("flex justify-center rounded-md border-2 border-dashed px-6 pt-5 pb-6", "border-zinc-300 hover:border-zinc-400 dark:border-zinc-700 dark:hover:border-zinc-600", "data-is-over:border-primary-300 data-is-over:dark:border-primary-700", "data-disabled:cursor-not-allowed data-disabled:border-zinc-200", "data-error:border-error-500", className)} data-is-over={isOver || undefined} data-error={error || undefined} data-disabled={disabled || undefined} onMouseMove={!disabled ? () => setPasteEnabled(true) : undefined} onMouseOut={!disabled ? () => setPasteEnabled(false) : undefined}>
|
|
83
|
-
{uploading ? (<div className={clsx("flex flex-col items-center justify-center gap-2 text-center", innerClassName)}>
|
|
84
|
-
<Loading className={clsx("h-10 w-10", {
|
|
85
|
-
"text-primary-500": isOver,
|
|
86
|
-
})}/>
|
|
87
|
-
<div>{uploadingText}</div>
|
|
88
|
-
</div>) : !canDrop || disabled ? (<div className={clsx("relative flex flex-col items-center justify-center gap-2 text-center", innerClassName)}>
|
|
89
|
-
<div className="relative flex flex-col items-center justify-center gap-2 text-center">
|
|
90
|
-
{cloneElement(icon, {
|
|
91
|
-
className: clsx("mx-auto h-12 w-12 text-zinc-400", icon.props.className),
|
|
92
|
-
})}
|
|
93
|
-
<div className="text-sm">
|
|
94
|
-
<label htmlFor={id} className={clsx("text-primary-600 focus-within:ring-primary-500 hover:text-primary-500 relative rounded-md font-medium focus-within:ring-2 focus-within:ring-offset-2 focus-within:outline-hidden dark:ring-offset-slate-900", {
|
|
95
|
-
"cursor-pointer": !disabled,
|
|
96
|
-
"cursor-not-allowed": disabled,
|
|
97
|
-
})}>
|
|
98
|
-
<span>{uploadAFileText}</span>
|
|
99
|
-
{!disabled && (<input id={id} name={id} type="file" className="sr-only" accept={allowedFileTypes?.join(",")} onChange={handleFileBrowse} multiple={limit !== 1} ref={ref}/>)}
|
|
100
|
-
</label>
|
|
101
|
-
<span className="pl-1">{orDragAndDropText}</span>
|
|
102
|
-
</div>
|
|
103
|
-
<p className="text-xs text-zinc-500">
|
|
104
|
-
{allowedFileTypes
|
|
105
|
-
? uniq(allowedFileTypes.map(translateAllowedType)).join(", ")
|
|
106
|
-
: anyFileText}{" "}
|
|
107
|
-
{upToText} {numeral(maxFileSize).format("0b")}
|
|
108
|
-
</p>
|
|
109
|
-
</div>
|
|
110
|
-
{additionalBottomInfo}
|
|
111
|
-
</div>) : (<div className={clsx("flex flex-col items-center justify-center gap-2 text-center", innerClassName)}>
|
|
112
|
-
<ArrowUpTrayIcon className={clsx("w-10 text-7xl", {
|
|
113
|
-
"text-primary-500": isOver,
|
|
114
|
-
})}/>
|
|
115
|
-
<div>{dropFilesHereText}</div>
|
|
116
|
-
</div>)}
|
|
117
|
-
</div>);
|
|
118
|
-
}
|
|
119
|
-
export default FileSelect;
|
|
120
|
-
const useOnPasteFiles = (enabled, onAcceptFiles, allowedFileTypes) => {
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
if (enabled) {
|
|
123
|
-
document.onpaste = function (event) {
|
|
124
|
-
const items =
|
|
125
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
-
(event.clipboardData || event.originalEvent.clipboardData)
|
|
127
|
-
.items;
|
|
128
|
-
for (const index in items) {
|
|
129
|
-
const item = items[index];
|
|
130
|
-
if (item.kind === "file") {
|
|
131
|
-
const file = item.getAsFile();
|
|
132
|
-
if (checkAllowedFileTypesFn(file, allowedFileTypes)) {
|
|
133
|
-
onAcceptFiles([file]);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
return () => {
|
|
139
|
-
document.onpaste = null;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}, [allowedFileTypes, enabled, onAcceptFiles]);
|
|
143
|
-
};
|
|
144
|
-
export function FileSelectProvider({ children }) {
|
|
145
|
-
return <DndProvider backend={HTML5Backend}>{children}</DndProvider>;
|
|
146
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
-
export type FooterProps = {
|
|
3
|
-
main?: {
|
|
4
|
-
name: string;
|
|
5
|
-
href: string;
|
|
6
|
-
}[];
|
|
7
|
-
social?: {
|
|
8
|
-
name: string;
|
|
9
|
-
href: string;
|
|
10
|
-
icon: ReactElement<{
|
|
11
|
-
className: string;
|
|
12
|
-
"aria-hidden": string;
|
|
13
|
-
}>;
|
|
14
|
-
}[];
|
|
15
|
-
companyName: ReactNode;
|
|
16
|
-
allRightsReserved?: string;
|
|
17
|
-
children: ReactNode;
|
|
18
|
-
};
|
|
19
|
-
export default function Footer({ main, social, companyName, allRightsReserved, children, }: FooterProps): import("react").JSX.Element;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { cloneElement } from "react";
|
|
2
|
-
const CURRENT_YEAR = new Date().getFullYear();
|
|
3
|
-
export default function Footer({ main, social, companyName, allRightsReserved = "All rights reserved", children, }) {
|
|
4
|
-
return (<>
|
|
5
|
-
<div className="flex min-h-screen flex-col">{children}</div>
|
|
6
|
-
<footer className="border-t border-slate-900/5 bg-white dark:border-slate-50/5 dark:bg-zinc-900">
|
|
7
|
-
<div className="mx-auto max-w-7xl overflow-hidden px-4 py-12 sm:px-6 lg:px-8">
|
|
8
|
-
{main && (<nav className="-mx-5 -my-2 mb-8 flex flex-wrap justify-center" aria-label="Footer">
|
|
9
|
-
{main.map((item) => (<div key={item.name} className="px-5 py-2">
|
|
10
|
-
<a href={item.href} className="text-base text-zinc-500 hover:text-zinc-900">
|
|
11
|
-
{item.name}
|
|
12
|
-
</a>
|
|
13
|
-
</div>))}
|
|
14
|
-
</nav>)}
|
|
15
|
-
{social && (<div className="mb-8 flex justify-center space-x-6">
|
|
16
|
-
{social.map((item) => (<a key={item.name} href={item.href} className="text-zinc-400 hover:text-zinc-500">
|
|
17
|
-
<span className="sr-only">{item.name}</span>
|
|
18
|
-
{cloneElement(item.icon, {
|
|
19
|
-
className: "h-6 w-6",
|
|
20
|
-
"aria-hidden": "true",
|
|
21
|
-
})}
|
|
22
|
-
</a>))}
|
|
23
|
-
</div>)}
|
|
24
|
-
<p className="text-center text-base text-zinc-400">
|
|
25
|
-
{companyName} © {CURRENT_YEAR}. {allRightsReserved}.
|
|
26
|
-
</p>
|
|
27
|
-
</div>
|
|
28
|
-
</footer>
|
|
29
|
-
</>);
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useId } from "react";
|
|
2
|
-
export default function GridPattern(props) {
|
|
3
|
-
const patternId = useId();
|
|
4
|
-
return (<svg aria-hidden="true" className="absolute inset-0 h-full w-full">
|
|
5
|
-
<defs>
|
|
6
|
-
<pattern id={patternId} width="32" height="32" patternUnits="userSpaceOnUse" {...props}>
|
|
7
|
-
<path d="M0 32V.5H32" fill="none" stroke="currentColor"/>
|
|
8
|
-
</pattern>
|
|
9
|
-
</defs>
|
|
10
|
-
<rect width="100%" height="100%" fill={`url(#${patternId})`}/>
|
|
11
|
-
</svg>);
|
|
12
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DetailedHTMLProps, HTMLAttributes } from "react";
|
|
2
|
-
export type GroupProps = {
|
|
3
|
-
wrap?: boolean;
|
|
4
|
-
} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
5
|
-
export default function Group({ wrap, className, ...props }: GroupProps): import("react").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type DetailedHTMLProps, type HTMLAttributes } from "react";
|
|
2
|
-
export type HeaderProps = {
|
|
3
|
-
hideOnScroll?: boolean;
|
|
4
|
-
} & DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
5
|
-
export default function Header({ className, hideOnScroll, ...props }: HeaderProps): import("react").JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import clsx from "../../utils/clsx";
|
|
2
|
-
import { useScrollYMovement } from "../../hooks/useScroll";
|
|
3
|
-
import { useEffect, useRef, } from "react";
|
|
4
|
-
import useMediaQuery from "../../hooks/useMediaQuery";
|
|
5
|
-
export default function Header({ className, hideOnScroll, ...props }) {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const isMobile = useMediaQuery(`(max-width: 768px)`);
|
|
8
|
-
useScrollYMovement(74, (scrollYMovement) => {
|
|
9
|
-
if (ref.current) {
|
|
10
|
-
ref.current.style.transform = `translateY(-${scrollYMovement}px)`;
|
|
11
|
-
}
|
|
12
|
-
}, !hideOnScroll && !isMobile);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (ref.current) {
|
|
15
|
-
ref.current.style.transform = "";
|
|
16
|
-
}
|
|
17
|
-
}, [isMobile]);
|
|
18
|
-
return (<header ref={ref} {...props} className={clsx("scrolled:shadow-md fixed top-0 z-20 flex h-16 w-full items-center px-2.5 shadow-none shadow-slate-900/5 ring-offset-zinc-100 transition-colors duration-500 sm:px-4 md:px-6", "bg-white/95 backdrop-blur-sm [@supports(backdrop-filter:blur(0))]:bg-white/75", "dark:bg-zinc-900/95 dark:[@supports(backdrop-filter:blur(0))]:bg-zinc-900/75", "not-scrolled:bg-transparent!", className)}/>);
|
|
19
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import FileInput from "../FileInput";
|
|
3
|
-
declare function ImageInput<PFP extends object>({ icon, uploadAFileText, allowedFileTypes, fileDisplay, ...props }: ComponentProps<typeof FileInput<PFP>>): import("react").JSX.Element;
|
|
4
|
-
export default ImageInput;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import FileInput from "../FileInput";
|
|
2
|
-
const defaultIcon = (<svg stroke="currentColor" fill="none" viewBox="0 0 48 48" aria-hidden="true">
|
|
3
|
-
<path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round"/>
|
|
4
|
-
</svg>);
|
|
5
|
-
function ImageInput({ icon = defaultIcon, uploadAFileText = "Upload an image", allowedFileTypes = [".png", ".jpg", ".jpeg", ".webp"], fileDisplay = "preview", ...props }) {
|
|
6
|
-
return (<FileInput {...props} icon={icon} uploadAFileText={uploadAFileText} allowedFileTypes={allowedFileTypes} fileDisplay={fileDisplay}/>);
|
|
7
|
-
}
|
|
8
|
-
export default ImageInput;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type UnstyledInputProps } from "../Input/UnstyledInput";
|
|
2
|
-
export type InputProps<Select extends boolean | undefined> = {
|
|
3
|
-
loading?: boolean;
|
|
4
|
-
} & UnstyledInputProps<Select>;
|
|
5
|
-
export declare const defaultLabelClassName: string;
|
|
6
|
-
export declare const defaultInputClassNameUncolored = "block w-full rounded-md shadow-xs sm:text-sm data-disabled:cursor-not-allowed dark:bg-zinc-800 dark:placeholder:text-zinc-500 px-2.5";
|
|
7
|
-
export declare const defaultInputClassName: string;
|
|
8
|
-
export declare const defaultHelpTextClassName: string;
|
|
9
|
-
export declare const defaultTrailingClassName = "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2.5 text-zinc-500 text-sm";
|
|
10
|
-
export declare const defaultLeadingClassName = "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2.5 text-zinc-500 text-sm";
|
|
11
|
-
export declare const defaultLeadingInputClassName = "pl-10";
|
|
12
|
-
export declare const defaultTrailingInputClassName = "pr-10";
|
|
13
|
-
declare function Input<Select extends boolean | undefined>({ error, trailing, labelClassName, inputClassName, helpTextClassName, trailingClassName, leadingClassName, leadingInputClassName, trailingInputClassName, required, label, loading, readOnly, children, disabled, helpText, ref, ...props }: InputProps<Select>): import("react").JSX.Element;
|
|
14
|
-
export default Input;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import UnstyledInput, {} from "../Input/UnstyledInput";
|
|
2
|
-
import { defaultTextStyles } from "../Text";
|
|
3
|
-
import { ExclamationCircleIcon } from "@heroicons/react/20/solid";
|
|
4
|
-
import InputIcon from "./InputIcon";
|
|
5
|
-
import { cloneElement, Fragment } from "react";
|
|
6
|
-
import recursiveChildrenMap from "../../utils/recursiveChildrenMap";
|
|
7
|
-
import clsx from "../../utils/clsx";
|
|
8
|
-
export const defaultLabelClassName = `ui-input-label block ${defaultTextStyles.variant.label} mb-1`;
|
|
9
|
-
export const defaultInputClassNameUncolored = "block w-full rounded-md shadow-xs sm:text-sm data-disabled:cursor-not-allowed dark:bg-zinc-800 dark:placeholder:text-zinc-500 px-2.5";
|
|
10
|
-
export const defaultInputClassName = clsx("ui-input-input", defaultInputClassNameUncolored, "border-zinc-300 focus:border-primary-500 focus:ring-primary-500 data-disabled:border-zinc-200 data-disabled:bg-zinc-50", "dark:border-zinc-700 dark:focus:border-primary-500 dark:data-disabled:border-zinc-800 dark:data-disabled:bg-zinc-900/90 data-disabled:text-zinc-500");
|
|
11
|
-
export const defaultHelpTextClassName = `mt-2 ${defaultTextStyles.variant.secondary}`;
|
|
12
|
-
export const defaultTrailingClassName = "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2.5 text-zinc-500 text-sm";
|
|
13
|
-
export const defaultLeadingClassName = "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2.5 text-zinc-500 text-sm";
|
|
14
|
-
export const defaultLeadingInputClassName = "pl-10";
|
|
15
|
-
export const defaultTrailingInputClassName = "pr-10";
|
|
16
|
-
function Input({ error, trailing, labelClassName, inputClassName, helpTextClassName, trailingClassName, leadingClassName, leadingInputClassName, trailingInputClassName, required, label, loading, readOnly, children, disabled, helpText, ref, ...props }) {
|
|
17
|
-
trailing =
|
|
18
|
-
trailing ||
|
|
19
|
-
(error ? (<InputIcon className="text-error-500">
|
|
20
|
-
<ExclamationCircleIcon aria-hidden="true"/>
|
|
21
|
-
</InputIcon>) : undefined);
|
|
22
|
-
labelClassName = clsx(defaultLabelClassName, labelClassName);
|
|
23
|
-
inputClassName = clsx(error ? defaultInputClassNameUncolored : defaultInputClassName, inputClassName, {
|
|
24
|
-
"animate-pulse": loading,
|
|
25
|
-
});
|
|
26
|
-
helpTextClassName = clsx(defaultHelpTextClassName, helpTextClassName);
|
|
27
|
-
trailingClassName = clsx(defaultTrailingClassName, trailingClassName);
|
|
28
|
-
leadingClassName = clsx(defaultLeadingClassName, leadingClassName);
|
|
29
|
-
leadingInputClassName = clsx(defaultLeadingInputClassName, leadingInputClassName);
|
|
30
|
-
trailingInputClassName = clsx(defaultTrailingInputClassName, trailingInputClassName);
|
|
31
|
-
if (typeof error === "string") {
|
|
32
|
-
helpText = error;
|
|
33
|
-
error = true;
|
|
34
|
-
}
|
|
35
|
-
if (error) {
|
|
36
|
-
inputClassName = `${inputClassName} border-error-300 dark:border-error-500 text-error-900 dark:text-error-500 placeholder-error-300 focus:border-error-500 dark:focus:border-error-500 focus:ring-error-500`;
|
|
37
|
-
helpTextClassName = `${helpTextClassName} text-error-600! dark:text-error-500!`;
|
|
38
|
-
}
|
|
39
|
-
if (readOnly) {
|
|
40
|
-
inputClassName = `${inputClassName} border-dashed`;
|
|
41
|
-
}
|
|
42
|
-
if (label && required) {
|
|
43
|
-
label = (<>
|
|
44
|
-
{label} <span className="text-red-500">*</span>
|
|
45
|
-
</>);
|
|
46
|
-
}
|
|
47
|
-
return (<UnstyledInput
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
-
{...props} trailing={trailing} labelClassName={labelClassName} inputClassName={inputClassName} helpTextClassName={helpTextClassName} trailingClassName={trailingClassName} leadingClassName={leadingClassName} leadingInputClassName={leadingInputClassName} trailingInputClassName={trailingInputClassName} ref={ref} required={required} label={label} readOnly={readOnly} disabled={disabled} data-disabled={disabled || undefined} helpText={helpText}>
|
|
50
|
-
{recursiveChildrenMap(children, (child) => cloneElement(child, child.type !== Fragment
|
|
51
|
-
? {
|
|
52
|
-
disabled: readOnly || disabled || child.props.disabled,
|
|
53
|
-
}
|
|
54
|
-
: undefined))}
|
|
55
|
-
</UnstyledInput>);
|
|
56
|
-
}
|
|
57
|
-
export default Input;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
|
-
export default function InputIcon({ className, children, }: {
|
|
3
|
-
className?: string;
|
|
4
|
-
children: ReactElement<{
|
|
5
|
-
className?: string;
|
|
6
|
-
}>;
|
|
7
|
-
}): ReactElement<{
|
|
8
|
-
className?: string;
|
|
9
|
-
}, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import { type InputProps } from "./Input";
|
|
3
|
-
declare function MultiSelectInput({ options, value, onChange, emptyLabel, ref, badgeClassName, name, onValueChange, inputClassName, emptyClassName, noneLabel, ...props }: Omit<InputProps<undefined>, "value"> & {
|
|
4
|
-
options: {
|
|
5
|
-
value: string;
|
|
6
|
-
name: string;
|
|
7
|
-
}[];
|
|
8
|
-
value?: string[];
|
|
9
|
-
onValueChange?: (value: string[]) => void;
|
|
10
|
-
emptyLabel?: string;
|
|
11
|
-
badgeClassName?: string;
|
|
12
|
-
emptyClassName?: string;
|
|
13
|
-
noneLabel?: string;
|
|
14
|
-
}): import("react").JSX.Element;
|
|
15
|
-
export type MultiSelectInputProps = ComponentProps<typeof MultiSelectInput>;
|
|
16
|
-
export default MultiSelectInput;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import Input, {} from "./Input";
|
|
2
|
-
import DropdownMenu from "../DropdownMenu";
|
|
3
|
-
import Button from "../Button";
|
|
4
|
-
import { ChevronDownIcon } from "@heroicons/react/16/solid";
|
|
5
|
-
import { xor } from "lodash-es";
|
|
6
|
-
import clsx from "../../utils/clsx";
|
|
7
|
-
import Badge from "../Badge";
|
|
8
|
-
import useInputRefValue from "./useInputRefValue";
|
|
9
|
-
import { useDeepCompareEffect } from "react-use";
|
|
10
|
-
function MultiSelectInput({ options, value, onChange, emptyLabel = "None", ref, badgeClassName, name, onValueChange, inputClassName, emptyClassName, noneLabel = "None", ...props }) {
|
|
11
|
-
const { innerRef, innerValue, setInnerValue } = useInputRefValue({
|
|
12
|
-
value,
|
|
13
|
-
ref,
|
|
14
|
-
name,
|
|
15
|
-
onChange,
|
|
16
|
-
});
|
|
17
|
-
const isEmpty = !innerValue?.length;
|
|
18
|
-
useDeepCompareEffect(() => {
|
|
19
|
-
if (onValueChange) {
|
|
20
|
-
onValueChange(innerValue || []);
|
|
21
|
-
}
|
|
22
|
-
}, [{ innerValue }]);
|
|
23
|
-
emptyClassName = isEmpty
|
|
24
|
-
? clsx("text-zinc-500 dark:text-zinc-500", emptyClassName)
|
|
25
|
-
: "p-1.5";
|
|
26
|
-
return (<DropdownMenu.Root>
|
|
27
|
-
<DropdownMenu.Trigger asChild>
|
|
28
|
-
<Input as={Button} {...props} name={name} ref={innerRef} trailing={<ChevronDownIcon className="h-5 w-5 shrink-0"/>} inputClassName={clsx("text-left dark:hover:bg-zinc-700/70 bg-white gap-1.5 flex justify-start flex-wrap", emptyClassName, inputClassName)}>
|
|
29
|
-
{isEmpty
|
|
30
|
-
? emptyLabel
|
|
31
|
-
: options
|
|
32
|
-
.filter((option) => innerValue.includes(option.value))
|
|
33
|
-
.map((option, index) => (<Badge key={index} className={badgeClassName} onActionClick={() => setInnerValue(xor(innerValue, [option.value]))}>
|
|
34
|
-
{option.name}
|
|
35
|
-
</Badge>))}
|
|
36
|
-
</Input>
|
|
37
|
-
</DropdownMenu.Trigger>
|
|
38
|
-
<DropdownMenu.Content>
|
|
39
|
-
<DropdownMenu.Item onClick={() => setInnerValue([])}>
|
|
40
|
-
{noneLabel}
|
|
41
|
-
</DropdownMenu.Item>
|
|
42
|
-
{options.map((option) => (<DropdownMenu.CheckboxItem key={option.name} checked={innerValue?.includes(option.value)} onClick={() => setInnerValue(xor(innerValue, [option.value]))}>
|
|
43
|
-
{option.name}
|
|
44
|
-
</DropdownMenu.CheckboxItem>))}
|
|
45
|
-
</DropdownMenu.Content>
|
|
46
|
-
</DropdownMenu.Root>);
|
|
47
|
-
}
|
|
48
|
-
export default MultiSelectInput;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import { type InputProps } from "./Input";
|
|
3
|
-
import { type NumericFormatProps } from "react-number-format";
|
|
4
|
-
declare function NumericInput({ ref, ...props }: Omit<NumericFormatProps, "customInput"> & InputProps<undefined>): import("react").JSX.Element;
|
|
5
|
-
export type NumericInputProps = ComponentProps<typeof NumericInput>;
|
|
6
|
-
export default NumericInput;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import { type InputProps } from "./Input";
|
|
3
|
-
import { type PatternFormatProps } from "react-number-format";
|
|
4
|
-
declare function PatternInput(props: Omit<PatternFormatProps, "customInput"> & InputProps<undefined>): import("react").JSX.Element;
|
|
5
|
-
export type PatternInputProps = ComponentProps<typeof PatternInput>;
|
|
6
|
-
export default PatternInput;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
-
import { type InputProps } from "./index";
|
|
3
|
-
declare function SelectInput({ options, onChange, ref, placeholder, inputClassName, value, name, ...props }: InputProps<false> & {
|
|
4
|
-
options: {
|
|
5
|
-
value: string;
|
|
6
|
-
name: ReactNode;
|
|
7
|
-
}[];
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
}): import("react").JSX.Element;
|
|
11
|
-
export type SelectInputProps = ComponentProps<typeof SelectInput>;
|
|
12
|
-
export default SelectInput;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {} from "react";
|
|
2
|
-
import Input, {} from "./index";
|
|
3
|
-
import Select from "../Select/Select";
|
|
4
|
-
import clsx from "../../utils/clsx";
|
|
5
|
-
import useInputRefValue from "./useInputRefValue";
|
|
6
|
-
function SelectInput({ options, onChange, ref, placeholder, inputClassName, value, name, ...props }) {
|
|
7
|
-
const { innerRef, innerValue, setInnerValue } = useInputRefValue({
|
|
8
|
-
value,
|
|
9
|
-
ref,
|
|
10
|
-
name,
|
|
11
|
-
onChange,
|
|
12
|
-
});
|
|
13
|
-
return (<Input as={Select.Root} {...props} ref={innerRef} {...{
|
|
14
|
-
value: innerValue ?? "",
|
|
15
|
-
onValueChange: setInnerValue,
|
|
16
|
-
}}>
|
|
17
|
-
<Select.Trigger placeholder={placeholder} buttonClassName={clsx("bg-white dark:hover:bg-zinc-700/70 dark:bg-zinc-800 w-full justify-between min-h-[38px]", inputClassName)}/>
|
|
18
|
-
<Select.Content>
|
|
19
|
-
{options?.map((option) => (<Select.Item key={option.value} value={option.value}>
|
|
20
|
-
{option.name}
|
|
21
|
-
</Select.Item>))}
|
|
22
|
-
</Select.Content>
|
|
23
|
-
</Input>);
|
|
24
|
-
}
|
|
25
|
-
export default SelectInput;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ComponentType, type DetailedHTMLProps, type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
-
export type UnstyledInputCommonProps = {
|
|
3
|
-
label?: ReactNode;
|
|
4
|
-
inputClassName?: string;
|
|
5
|
-
labelClassName?: string;
|
|
6
|
-
helpTextClassName?: string;
|
|
7
|
-
trailingClassName?: string;
|
|
8
|
-
trailingInputClassName?: string;
|
|
9
|
-
leadingClassName?: string;
|
|
10
|
-
leadingInputClassName?: string;
|
|
11
|
-
helpText?: ReactNode;
|
|
12
|
-
trailing?: ReactNode;
|
|
13
|
-
leading?: ReactNode;
|
|
14
|
-
as?: ComponentType;
|
|
15
|
-
innerClassName?: string;
|
|
16
|
-
error?: boolean | string;
|
|
17
|
-
};
|
|
18
|
-
export type UnstyledInputProps<Select extends boolean | undefined> = UnstyledInputCommonProps & {
|
|
19
|
-
select?: Select;
|
|
20
|
-
} & (Select extends string ? DetailedHTMLProps<InputHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> : DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>);
|
|
21
|
-
declare function UnstyledInput<Select extends boolean | undefined>({ id, label, className, inputClassName, labelClassName, helpTextClassName, trailingClassName, trailingInputClassName, leadingClassName, leadingInputClassName, helpText, type, leading, trailing, select, children, as, innerClassName, value, ...props }: UnstyledInputProps<Select>): import("react").JSX.Element;
|
|
22
|
-
export default UnstyledInput;
|