@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,27 +0,0 @@
|
|
|
1
|
-
import { ChevronUpIcon } from "@heroicons/react/20/solid";
|
|
2
|
-
import { useId } from "react";
|
|
3
|
-
import * as RAccordion from "@radix-ui/react-accordion";
|
|
4
|
-
import clsx from "../../utils/clsx";
|
|
5
|
-
export default function Accordion({ children, className, ...props }) {
|
|
6
|
-
return (<RAccordion.Root {...props} className={clsx("flex flex-col gap-2", className)} {...(props.type === "single" ? { collapsible: true } : {})}>
|
|
7
|
-
{children}
|
|
8
|
-
</RAccordion.Root>);
|
|
9
|
-
}
|
|
10
|
-
Accordion.Item = AccordionItem;
|
|
11
|
-
function AccordionItem({ children, title, value, className, triggerClassName, contentClassName, contentInnerClassName, }) {
|
|
12
|
-
const id = useId();
|
|
13
|
-
value = value || id;
|
|
14
|
-
return (<RAccordion.Item value={value} className={className}>
|
|
15
|
-
<RAccordion.Header>
|
|
16
|
-
<RAccordion.Trigger className={clsx("group focus-visible:ring-opacity-75 flex w-full justify-between rounded-lg bg-zinc-200 px-4 py-2 text-left text-sm font-medium transition hover:bg-zinc-300 focus:outline-hidden focus-visible:ring-3 focus-visible:ring-purple-500 dark:bg-zinc-800 dark:hover:bg-zinc-700", triggerClassName)}>
|
|
17
|
-
{title}
|
|
18
|
-
<ChevronUpIcon className="h-5 w-5 transition-transform duration-300 ease-[cubic-bezier(0.87,_0,_0.13,_1)] group-data-[state=open]:rotate-180"/>
|
|
19
|
-
</RAccordion.Trigger>
|
|
20
|
-
</RAccordion.Header>
|
|
21
|
-
<RAccordion.Content className={clsx("data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down overflow-hidden", contentClassName)}>
|
|
22
|
-
<div className={clsx("px-4 pt-2 pb-2", contentInnerClassName)}>
|
|
23
|
-
{children}
|
|
24
|
-
</div>
|
|
25
|
-
</RAccordion.Content>
|
|
26
|
-
</RAccordion.Item>);
|
|
27
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { DetailedHTMLProps, HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
declare const styles: {
|
|
3
|
-
variants: {
|
|
4
|
-
default: {
|
|
5
|
-
root: string;
|
|
6
|
-
icon: string;
|
|
7
|
-
title: string;
|
|
8
|
-
content: string;
|
|
9
|
-
};
|
|
10
|
-
error: {
|
|
11
|
-
root: string;
|
|
12
|
-
icon: string;
|
|
13
|
-
title: string;
|
|
14
|
-
content: string;
|
|
15
|
-
};
|
|
16
|
-
success: {
|
|
17
|
-
root: string;
|
|
18
|
-
icon: string;
|
|
19
|
-
title: string;
|
|
20
|
-
content: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export type AlertProps = {
|
|
25
|
-
title: ReactNode;
|
|
26
|
-
variant?: keyof (typeof styles)["variants"];
|
|
27
|
-
children?: ReactNode;
|
|
28
|
-
actions?: ReactNode;
|
|
29
|
-
} & Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title">;
|
|
30
|
-
export default function Alert({ variant, title, children, className, actions, ...props }: AlertProps): import("react").JSX.Element;
|
|
31
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { CheckCircleIcon, ExclamationTriangleIcon, XCircleIcon, } from "@heroicons/react/20/solid";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
import Group from "../Group";
|
|
4
|
-
const styles = {
|
|
5
|
-
variants: {
|
|
6
|
-
default: {
|
|
7
|
-
root: "bg-warn-100 dark:bg-warn-900",
|
|
8
|
-
icon: "text-warn-400",
|
|
9
|
-
title: "text-warn-800 dark:text-warn-400",
|
|
10
|
-
content: "text-warn-700 dark:text-warn-200",
|
|
11
|
-
},
|
|
12
|
-
error: {
|
|
13
|
-
root: "bg-error-100 dark:bg-error-900",
|
|
14
|
-
icon: "text-error-400 dark:text-error-300",
|
|
15
|
-
title: "text-error-800 dark:text-error-300",
|
|
16
|
-
content: "text-error-700 dark:text-error-200",
|
|
17
|
-
},
|
|
18
|
-
success: {
|
|
19
|
-
root: "bg-success-100 dark:bg-success-900",
|
|
20
|
-
icon: "text-success-400",
|
|
21
|
-
title: "text-success-800 dark:text-success-400",
|
|
22
|
-
content: "text-success-700 dark:text-success-200",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
const icons = {
|
|
27
|
-
default: ExclamationTriangleIcon,
|
|
28
|
-
error: XCircleIcon,
|
|
29
|
-
success: CheckCircleIcon,
|
|
30
|
-
};
|
|
31
|
-
export default function Alert({ variant = "default", title, children, className, actions, ...props }) {
|
|
32
|
-
const Icon = icons[variant];
|
|
33
|
-
return (<div className={clsx("rounded-md p-4", styles.variants[variant].root, className)} {...props}>
|
|
34
|
-
<div className="flex">
|
|
35
|
-
<div className="shrink-0">
|
|
36
|
-
<Icon className={clsx("h-5 w-5", styles.variants[variant].icon)} aria-hidden="true"/>
|
|
37
|
-
</div>
|
|
38
|
-
<div className="ml-3 flex w-full flex-col items-start justify-between sm:flex-row">
|
|
39
|
-
<div>
|
|
40
|
-
<h3 className={clsx("text-sm font-medium", styles.variants[variant].title)}>
|
|
41
|
-
{title}
|
|
42
|
-
</h3>
|
|
43
|
-
{children && (<div className={clsx("mt-2 text-sm", styles.variants[variant].content)}>
|
|
44
|
-
{children}
|
|
45
|
-
</div>)}
|
|
46
|
-
</div>
|
|
47
|
-
{actions && (<Group className={clsx("-mx-4 mt-1 -mb-2 sm:-mx-2 sm:-my-2", styles.variants[variant].content)}>
|
|
48
|
-
{actions}
|
|
49
|
-
</Group>)}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>);
|
|
53
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function AntiClickjacking(): import("react").JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default function AntiClickjacking() {
|
|
2
|
-
return (<>
|
|
3
|
-
<style id="antiClickjack">{`
|
|
4
|
-
body { display: none !important; }
|
|
5
|
-
`}</style>
|
|
6
|
-
<script dangerouslySetInnerHTML={{
|
|
7
|
-
__html: `
|
|
8
|
-
if (self === top) {
|
|
9
|
-
var antiClickjack = document.getElementById("antiClickjack");
|
|
10
|
-
antiClickjack.parentNode.removeChild(antiClickjack);
|
|
11
|
-
} else {
|
|
12
|
-
top.location = self.location;
|
|
13
|
-
}
|
|
14
|
-
`,
|
|
15
|
-
}}/>
|
|
16
|
-
</>);
|
|
17
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
2
|
-
import { Color, Mesh, Program, Renderer, Triangle } from "ogl";
|
|
3
|
-
import clsx from "../../utils/clsx";
|
|
4
|
-
const VERT = `#version 300 es
|
|
5
|
-
in vec2 position;
|
|
6
|
-
void main() {
|
|
7
|
-
gl_Position = vec4(position, 0.0, 1.0);
|
|
8
|
-
}
|
|
9
|
-
`;
|
|
10
|
-
const FRAG = `#version 300 es
|
|
11
|
-
precision highp float;
|
|
12
|
-
|
|
13
|
-
uniform float uTime;
|
|
14
|
-
uniform float uAmplitude;
|
|
15
|
-
uniform vec3 uColorStops[3];
|
|
16
|
-
uniform vec2 uResolution;
|
|
17
|
-
uniform float uBlend;
|
|
18
|
-
|
|
19
|
-
out vec4 fragColor;
|
|
20
|
-
|
|
21
|
-
vec3 permute(vec3 x) {
|
|
22
|
-
return mod(((x * 34.0) + 1.0) * x, 289.0);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
float snoise(vec2 v){
|
|
26
|
-
const vec4 C = vec4(
|
|
27
|
-
0.211324865405187, 0.366025403784439,
|
|
28
|
-
-0.577350269189626, 0.024390243902439
|
|
29
|
-
);
|
|
30
|
-
vec2 i = floor(v + dot(v, C.yy));
|
|
31
|
-
vec2 x0 = v - i + dot(i, C.xx);
|
|
32
|
-
vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
|
|
33
|
-
vec4 x12 = x0.xyxy + C.xxzz;
|
|
34
|
-
x12.xy -= i1;
|
|
35
|
-
i = mod(i, 289.0);
|
|
36
|
-
|
|
37
|
-
vec3 p = permute(
|
|
38
|
-
permute(i.y + vec3(0.0, i1.y, 1.0))
|
|
39
|
-
+ i.x + vec3(0.0, i1.x, 1.0)
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
vec3 m = max(
|
|
43
|
-
0.5 - vec3(
|
|
44
|
-
dot(x0, x0),
|
|
45
|
-
dot(x12.xy, x12.xy),
|
|
46
|
-
dot(x12.zw, x12.zw)
|
|
47
|
-
),
|
|
48
|
-
0.0
|
|
49
|
-
);
|
|
50
|
-
m = m * m;
|
|
51
|
-
m = m * m;
|
|
52
|
-
|
|
53
|
-
vec3 x = 2.0 * fract(p * C.www) - 1.0;
|
|
54
|
-
vec3 h = abs(x) - 0.5;
|
|
55
|
-
vec3 ox = floor(x + 0.5);
|
|
56
|
-
vec3 a0 = x - ox;
|
|
57
|
-
m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);
|
|
58
|
-
|
|
59
|
-
vec3 g;
|
|
60
|
-
g.x = a0.x * x0.x + h.x * x0.y;
|
|
61
|
-
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
|
62
|
-
return 130.0 * dot(m, g);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
struct ColorStop {
|
|
66
|
-
vec3 color;
|
|
67
|
-
float position;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
#define COLOR_RAMP(colors, factor, finalColor) { \
|
|
71
|
-
int index = 0; \
|
|
72
|
-
for (int i = 0; i < 2; i++) { \
|
|
73
|
-
ColorStop currentColor = colors[i]; \
|
|
74
|
-
bool isInBetween = currentColor.position <= factor; \
|
|
75
|
-
index = int(mix(float(index), float(i), float(isInBetween))); \
|
|
76
|
-
} \
|
|
77
|
-
ColorStop currentColor = colors[index]; \
|
|
78
|
-
ColorStop nextColor = colors[index + 1]; \
|
|
79
|
-
float range = nextColor.position - currentColor.position; \
|
|
80
|
-
float lerpFactor = (factor - currentColor.position) / range; \
|
|
81
|
-
finalColor = mix(currentColor.color, nextColor.color, lerpFactor); \
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
void main() {
|
|
85
|
-
vec2 uv = gl_FragCoord.xy / uResolution;
|
|
86
|
-
|
|
87
|
-
ColorStop colors[3];
|
|
88
|
-
colors[0] = ColorStop(uColorStops[0], 0.0);
|
|
89
|
-
colors[1] = ColorStop(uColorStops[1], 0.5);
|
|
90
|
-
colors[2] = ColorStop(uColorStops[2], 1.0);
|
|
91
|
-
|
|
92
|
-
vec3 rampColor;
|
|
93
|
-
COLOR_RAMP(colors, uv.x, rampColor);
|
|
94
|
-
|
|
95
|
-
float height = snoise(vec2(uv.x * 2.0 + uTime * 0.1, uTime * 0.25)) * 0.5 * uAmplitude;
|
|
96
|
-
height = exp(height);
|
|
97
|
-
height = (uv.y * 2.0 - height + 0.2);
|
|
98
|
-
float intensity = 0.6 * height;
|
|
99
|
-
|
|
100
|
-
float midPoint = 0.20;
|
|
101
|
-
float auroraAlpha = smoothstep(midPoint - uBlend * 0.5, midPoint + uBlend * 0.5, intensity);
|
|
102
|
-
|
|
103
|
-
vec3 auroraColor = intensity * rampColor;
|
|
104
|
-
|
|
105
|
-
fragColor = vec4(auroraColor * auroraAlpha, auroraAlpha);
|
|
106
|
-
}
|
|
107
|
-
`;
|
|
108
|
-
export default function Aurora(props) {
|
|
109
|
-
const { colorStops = ["#00d8ff", "#7cff67", "#00d8ff"], amplitude = 1.0, blend = 0.5, className, } = props;
|
|
110
|
-
const propsRef = useRef(props);
|
|
111
|
-
propsRef.current = props;
|
|
112
|
-
const ctnDom = useRef(null);
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
const ctn = ctnDom.current;
|
|
115
|
-
if (!ctn)
|
|
116
|
-
return;
|
|
117
|
-
const renderer = new Renderer({
|
|
118
|
-
alpha: true,
|
|
119
|
-
premultipliedAlpha: true,
|
|
120
|
-
antialias: true,
|
|
121
|
-
});
|
|
122
|
-
const gl = renderer.gl;
|
|
123
|
-
gl.clearColor(0, 0, 0, 0);
|
|
124
|
-
gl.enable(gl.BLEND);
|
|
125
|
-
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
126
|
-
gl.canvas.style.backgroundColor = "transparent";
|
|
127
|
-
let program = undefined;
|
|
128
|
-
function resize() {
|
|
129
|
-
if (!ctn)
|
|
130
|
-
return;
|
|
131
|
-
const width = ctn.offsetWidth;
|
|
132
|
-
const height = ctn.offsetHeight;
|
|
133
|
-
renderer.setSize(width, height);
|
|
134
|
-
if (program) {
|
|
135
|
-
program.uniforms.uResolution.value = [width, height];
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
window.addEventListener("resize", resize);
|
|
139
|
-
const geometry = new Triangle(gl);
|
|
140
|
-
if (geometry.attributes.uv) {
|
|
141
|
-
delete geometry.attributes.uv;
|
|
142
|
-
}
|
|
143
|
-
const colorStopsArray = colorStops.map((hex) => {
|
|
144
|
-
const c = new Color(hex);
|
|
145
|
-
return [c.r, c.g, c.b];
|
|
146
|
-
});
|
|
147
|
-
program = new Program(gl, {
|
|
148
|
-
vertex: VERT,
|
|
149
|
-
fragment: FRAG,
|
|
150
|
-
uniforms: {
|
|
151
|
-
uTime: { value: 0 },
|
|
152
|
-
uAmplitude: { value: amplitude },
|
|
153
|
-
uColorStops: { value: colorStopsArray },
|
|
154
|
-
uResolution: { value: [ctn.offsetWidth, ctn.offsetHeight] },
|
|
155
|
-
uBlend: { value: blend },
|
|
156
|
-
},
|
|
157
|
-
});
|
|
158
|
-
const mesh = new Mesh(gl, { geometry, program });
|
|
159
|
-
ctn.appendChild(gl.canvas);
|
|
160
|
-
let animateId = 0;
|
|
161
|
-
const update = (t) => {
|
|
162
|
-
animateId = requestAnimationFrame(update);
|
|
163
|
-
const { time = t * 0.01, speed = 1.0 } = propsRef.current;
|
|
164
|
-
if (program) {
|
|
165
|
-
program.uniforms.uTime.value = time * speed * 0.1;
|
|
166
|
-
program.uniforms.uAmplitude.value = propsRef.current.amplitude ?? 1.0;
|
|
167
|
-
program.uniforms.uBlend.value = propsRef.current.blend ?? blend;
|
|
168
|
-
const stops = propsRef.current.colorStops ?? colorStops;
|
|
169
|
-
program.uniforms.uColorStops.value = stops.map((hex) => {
|
|
170
|
-
const c = new Color(hex);
|
|
171
|
-
return [c.r, c.g, c.b];
|
|
172
|
-
});
|
|
173
|
-
renderer.render({ scene: mesh });
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
animateId = requestAnimationFrame(update);
|
|
177
|
-
resize();
|
|
178
|
-
return () => {
|
|
179
|
-
cancelAnimationFrame(animateId);
|
|
180
|
-
window.removeEventListener("resize", resize);
|
|
181
|
-
if (ctn && gl.canvas.parentNode === ctn) {
|
|
182
|
-
ctn.removeChild(gl.canvas);
|
|
183
|
-
}
|
|
184
|
-
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
|
185
|
-
};
|
|
186
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
187
|
-
}, [amplitude]);
|
|
188
|
-
return <div ref={ctnDom} className={clsx("h-full w-full", className)}/>;
|
|
189
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type UnstyledAutocompleteProps } from "../Autocomplete/UnstyledAutocomplete";
|
|
2
|
-
export type AutocompleteProps<T extends {
|
|
3
|
-
_id: string;
|
|
4
|
-
}> = UnstyledAutocompleteProps<T>;
|
|
5
|
-
export default function Autocomplete<T extends {
|
|
6
|
-
_id: string;
|
|
7
|
-
}>({ query: defaultQuery, onChangeQuery, emptyText, className, ...props }: AutocompleteProps<T>): import("react").JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
import UnstyledAutocomplete, {} from "../Autocomplete/UnstyledAutocomplete";
|
|
4
|
-
import Input from "../Input";
|
|
5
|
-
const defaultMenuItemsClassName = "z-10 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden dark:bg-zinc-800";
|
|
6
|
-
export default function Autocomplete({ query: defaultQuery = "", onChangeQuery, emptyText = "No item found.", className, ...props }) {
|
|
7
|
-
const [query, setQuery] = useState(defaultQuery);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (query !== defaultQuery) {
|
|
10
|
-
setQuery(defaultQuery);
|
|
11
|
-
}
|
|
12
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
-
}, [defaultQuery]);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (onChangeQuery && query !== defaultQuery) {
|
|
16
|
-
onChangeQuery(query);
|
|
17
|
-
}
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
}, [onChangeQuery, query]);
|
|
20
|
-
return (<div className={clsx("relative", className)}>
|
|
21
|
-
<UnstyledAutocomplete {...props} as={Input} query={query} onChangeQuery={setQuery} emptyTextClassName={clsx(defaultMenuItemsClassName, "p-4 text-sm text-zinc-500 dark:text-zinc-400 mt-1 absolute w-full")} optionsClassName={clsx(defaultMenuItemsClassName, "max-h-72 scroll-py-2 overflow-y-auto py-2 text-sm text-zinc-800 dark:text-zinc-200 absolute z-10 mt-1 w-full")} optionClassName={({ active }) => clsx("cursor-default select-none px-4 py-2 data-disabled:cursor-not-allowed data-disabled:opacity-50", active && "bg-primary-600 text-white")} emptyText={emptyText}/>
|
|
22
|
-
</div>);
|
|
23
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import Input, { type UnstyledInputProps } from "../Input";
|
|
3
|
-
export interface UnstyledAutocompleteProps<T extends {
|
|
4
|
-
_id: string;
|
|
5
|
-
}> extends Omit<UnstyledInputProps<false>, "as" | "onSelect" | "inputClassName" | "innerClassName" | "value"> {
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
emptyText?: string;
|
|
8
|
-
items?: T[];
|
|
9
|
-
filterProperty?: keyof T;
|
|
10
|
-
filterFunction?: (item: T) => boolean;
|
|
11
|
-
onSelect?: (item: T | null) => void;
|
|
12
|
-
renderProperty?: keyof T;
|
|
13
|
-
renderFunction?: (item: T) => ReactNode;
|
|
14
|
-
query?: string;
|
|
15
|
-
onChangeQuery?: (query: string) => void;
|
|
16
|
-
loading?: boolean;
|
|
17
|
-
emptyTextClassName?: string;
|
|
18
|
-
leadingClassName?: string;
|
|
19
|
-
optionsClassName?: string;
|
|
20
|
-
optionClassName?: ({ active, selected, }: {
|
|
21
|
-
active: boolean;
|
|
22
|
-
selected: boolean;
|
|
23
|
-
}) => string;
|
|
24
|
-
inputInnerClassName?: string;
|
|
25
|
-
inputElementClassName?: string;
|
|
26
|
-
leading?: ReactNode;
|
|
27
|
-
as?: typeof Input;
|
|
28
|
-
static?: boolean;
|
|
29
|
-
displayValue?: (item: T | null) => string;
|
|
30
|
-
value?: T | null;
|
|
31
|
-
itemsRenderLimit?: number;
|
|
32
|
-
disabledItems?: string[];
|
|
33
|
-
}
|
|
34
|
-
export default function UnstyledAutocomplete<T extends {
|
|
35
|
-
_id: string;
|
|
36
|
-
}>({ placeholder, emptyText, items, renderProperty, renderFunction, filterProperty, filterFunction, onSelect, query: defaultQuery, onChangeQuery, loading, emptyTextClassName, optionsClassName, optionClassName, inputInnerClassName, inputElementClassName, as, trailing, trailingClassName, trailingInputClassName, leadingInputClassName, static: isStatic, displayValue, value, readOnly, itemsRenderLimit, disabledItems, ...props }: UnstyledAutocompleteProps<T>): import("react").JSX.Element;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Combobox } from "@headlessui/react";
|
|
2
|
-
import Loading from "../Loading";
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState, } from "react";
|
|
4
|
-
import Input, { defaultInputClassName, defaultLeadingInputClassName, defaultTrailingClassName, defaultTrailingInputClassName, UnstyledInput, } from "../Input";
|
|
5
|
-
import clsx from "../../utils/clsx";
|
|
6
|
-
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/react/20/solid";
|
|
7
|
-
import { useUpdateEffect } from "react-use";
|
|
8
|
-
import { take } from "lodash-es";
|
|
9
|
-
export default function UnstyledAutocomplete({ placeholder, emptyText, items = [], renderProperty = "title", renderFunction, filterProperty = "title", filterFunction, onSelect, query: defaultQuery = "", onChangeQuery, loading, emptyTextClassName, optionsClassName, optionClassName, inputInnerClassName, inputElementClassName, as, trailing, trailingClassName, trailingInputClassName, leadingInputClassName, static: isStatic, displayValue, value, readOnly, itemsRenderLimit, disabledItems, ...props }) {
|
|
10
|
-
displayValue =
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
displayValue || ((item) => item?.[renderProperty] || "");
|
|
13
|
-
const [query, setQuery] = useState(defaultQuery);
|
|
14
|
-
const [selectedItem, setSelectedItem] = useState(null);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (query !== defaultQuery) {
|
|
17
|
-
setQuery(defaultQuery);
|
|
18
|
-
}
|
|
19
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
-
}, [defaultQuery]);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (onChangeQuery && query !== defaultQuery) {
|
|
23
|
-
onChangeQuery(query);
|
|
24
|
-
}
|
|
25
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
-
}, [onChangeQuery, query]);
|
|
27
|
-
const filteredItems = useMemo(() => query === ""
|
|
28
|
-
? items
|
|
29
|
-
: items.filter(filterFunction ||
|
|
30
|
-
((item) => item[filterProperty]
|
|
31
|
-
.toLowerCase()
|
|
32
|
-
.includes(query.toLowerCase()))), [filterFunction, filterProperty, items, query]);
|
|
33
|
-
trailing = loading ? (<Loading />) : (trailing ||
|
|
34
|
-
(!readOnly ? (<Combobox.Button className="pointer-events-auto -mr-1 flex items-center">
|
|
35
|
-
<ChevronUpDownIcon className="h-5 w-5 text-zinc-400" aria-hidden="true"/>
|
|
36
|
-
</Combobox.Button>) : undefined));
|
|
37
|
-
const ComponentInput = as || UnstyledInput;
|
|
38
|
-
const doRender = useCallback((item) => renderFunction ? renderFunction(item) : item[renderProperty], [renderFunction, renderProperty]);
|
|
39
|
-
useUpdateEffect(() => {
|
|
40
|
-
onSelect?.(selectedItem);
|
|
41
|
-
}, [selectedItem]);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (selectedItem !== value) {
|
|
44
|
-
setSelectedItem(value || null);
|
|
45
|
-
}
|
|
46
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
-
}, [value]);
|
|
48
|
-
return (<Combobox onChange={setSelectedItem} value={selectedItem} nullable>
|
|
49
|
-
{({ open }) => (<div>
|
|
50
|
-
<div className="relative">
|
|
51
|
-
<ComponentInput
|
|
52
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
53
|
-
{...props} as={Combobox.Input} placeholder={placeholder} onChange={(event) => setQuery(event.target.value)} trailing={trailing} trailingClassName={clsx(defaultTrailingClassName, trailingClassName)} inputClassName={clsx(defaultInputClassName, inputElementClassName)} innerClassName={inputInnerClassName} trailingInputClassName={clsx(defaultTrailingInputClassName, trailingInputClassName)} leadingInputClassName={clsx(defaultLeadingInputClassName, leadingInputClassName)} displayValue={displayValue} readOnly={readOnly}/>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
{filteredItems.length > 0 && !readOnly && (<Combobox.Options static={isStatic} className={optionsClassName}>
|
|
57
|
-
{(itemsRenderLimit
|
|
58
|
-
? take(filteredItems, itemsRenderLimit)
|
|
59
|
-
: filteredItems).map((item) => (<Combobox.Option key={item._id} value={item} className={({ active, selected }) => clsx("flex gap-2", optionClassName && optionClassName({ active, selected }))} disabled={disabledItems?.includes(item._id)} data-disabled={disabledItems?.includes(item._id) ? "" : undefined}>
|
|
60
|
-
{({ selected, active }) => (<>
|
|
61
|
-
{selected ? (<span className={clsx("flex items-center", active ? "text-white" : "text-primary-500")}>
|
|
62
|
-
<CheckIcon className="h-5 w-5" aria-hidden="true"/>
|
|
63
|
-
</span>) : null}
|
|
64
|
-
{doRender(item)}
|
|
65
|
-
</>)}
|
|
66
|
-
</Combobox.Option>))}
|
|
67
|
-
</Combobox.Options>)}
|
|
68
|
-
|
|
69
|
-
{open && emptyText && query !== "" && filteredItems.length === 0 && (<p className={emptyTextClassName}>{emptyText}</p>)}
|
|
70
|
-
</div>)}
|
|
71
|
-
</Combobox>);
|
|
72
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import clsx from "../../utils/clsx";
|
|
2
|
-
export default function BottomBlurryPoint({ className, }) {
|
|
3
|
-
return (<div className={clsx("pointer-events-none absolute inset-x-0 top-[calc(100%-22rem)] transform-gpu overflow-hidden blur-3xl sm:top-[calc(100%-43rem)]", className)}>
|
|
4
|
-
<svg className="relative left-[calc(50%+3rem)] h-[21.1875rem] max-w-none -translate-x-1/2 sm:left-[calc(50%+36rem)] sm:h-[42.375rem]" viewBox="0 0 1155 678" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
-
<path fill="url(#ecb5b0c9-546c-4772-8c71-4d3f06d544bc)" fillOpacity=".3" d="M317.219 518.975L203.852 678 0 438.341l317.219 80.634 204.172-286.402c1.307 132.337 45.083 346.658 209.733 145.248C936.936 126.058 882.053-94.234 1031.02 41.331c119.18 108.451 130.68 295.337 121.53 375.223L855 299l21.173 362.054-558.954-142.079z"/>
|
|
6
|
-
<defs>
|
|
7
|
-
<linearGradient id="ecb5b0c9-546c-4772-8c71-4d3f06d544bc" x1="1155.49" x2="-78.208" y1=".177" y2="474.645" gradientUnits="userSpaceOnUse">
|
|
8
|
-
<stop stopColor="#9089FC"/>
|
|
9
|
-
<stop offset={1} stopColor="#FF80B5"/>
|
|
10
|
-
</linearGradient>
|
|
11
|
-
</defs>
|
|
12
|
-
</svg>
|
|
13
|
-
</div>);
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import clsx from "../../utils/clsx";
|
|
2
|
-
export default function TopBlurryPoint({ className }) {
|
|
3
|
-
return (<div className={clsx("pointer-events-none absolute inset-x-0 top-[-10rem] z-10 transform-gpu overflow-hidden blur-3xl sm:top-[-20rem]", className)}>
|
|
4
|
-
<svg className="relative left-[calc(50%-11rem)] z-10 h-[21.1875rem] max-w-none -translate-x-1/2 rotate-[30deg] sm:left-[calc(50%-30rem)] sm:h-[42.375rem]" viewBox="0 0 1155 678" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
-
<path fill="url(#45de2b6b-92d5-4d68-a6a0-9b9b2abad533)" fillOpacity=".3" d="M317.219 518.975L203.852 678 0 438.341l317.219 80.634 204.172-286.402c1.307 132.337 45.083 346.658 209.733 145.248C936.936 126.058 882.053-94.234 1031.02 41.331c119.18 108.451 130.68 295.337 121.53 375.223L855 299l21.173 362.054-558.954-142.079z"/>
|
|
6
|
-
<defs>
|
|
7
|
-
<linearGradient id="45de2b6b-92d5-4d68-a6a0-9b9b2abad533" x1="1155.49" x2="-78.208" y1=".177" y2="474.645" gradientUnits="userSpaceOnUse">
|
|
8
|
-
<stop stopColor="#9089FC"/>
|
|
9
|
-
<stop offset={1} stopColor="#FF80B5"/>
|
|
10
|
-
</linearGradient>
|
|
11
|
-
</defs>
|
|
12
|
-
</svg>
|
|
13
|
-
</div>);
|
|
14
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
declare const colorMap: {
|
|
3
|
-
default: {
|
|
4
|
-
badge: string;
|
|
5
|
-
button: string;
|
|
6
|
-
};
|
|
7
|
-
primary: {
|
|
8
|
-
badge: string;
|
|
9
|
-
button: string;
|
|
10
|
-
};
|
|
11
|
-
success: {
|
|
12
|
-
badge: string;
|
|
13
|
-
button: string;
|
|
14
|
-
};
|
|
15
|
-
error: {
|
|
16
|
-
badge: string;
|
|
17
|
-
button: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
declare const sizeMap: {
|
|
21
|
-
badge: {
|
|
22
|
-
sm: string;
|
|
23
|
-
md: string;
|
|
24
|
-
lg: string;
|
|
25
|
-
};
|
|
26
|
-
button: {
|
|
27
|
-
sm: string;
|
|
28
|
-
md: string;
|
|
29
|
-
lg: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
declare function Badge({ color, size, className, children, onActionClick, href, shallow, onClick, ...props }: {
|
|
33
|
-
color?: keyof typeof colorMap;
|
|
34
|
-
size?: keyof (typeof sizeMap)["badge"];
|
|
35
|
-
className?: string;
|
|
36
|
-
children: ReactNode;
|
|
37
|
-
onActionClick?: () => void;
|
|
38
|
-
href?: string;
|
|
39
|
-
shallow?: boolean;
|
|
40
|
-
onClick?: () => void;
|
|
41
|
-
}): import("react").JSX.Element;
|
|
42
|
-
export default Badge;
|