@majapisoftwares/ui 4.0.2
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/base.css +359 -0
- package/bootstrap/AppProps.d.ts +10 -0
- package/bootstrap/AppProps.js +1 -0
- package/bootstrap/index.d.ts +1 -0
- package/bootstrap/index.js +1 -0
- package/bootstrap/modeScript.d.ts +2 -0
- package/bootstrap/modeScript.js +35 -0
- package/bootstrap/nprogress.d.ts +1 -0
- package/bootstrap/nprogress.js +19 -0
- package/bootstrap/scrolledScript.d.ts +2 -0
- package/bootstrap/scrolledScript.js +27 -0
- package/bootstrap/setupFocusManager.d.ts +1 -0
- package/bootstrap/setupFocusManager.js +13 -0
- package/bootstrap/suppressConsoleLog.d.ts +1 -0
- package/bootstrap/suppressConsoleLog.js +8 -0
- package/components/Accordion/Accordion.d.ts +19 -0
- package/components/Accordion/Accordion.jsx +27 -0
- package/components/Accordion/index.d.ts +3 -0
- package/components/Accordion/index.jsx +3 -0
- package/components/Alert/Alert.d.ts +31 -0
- package/components/Alert/Alert.jsx +53 -0
- package/components/Alert/index.d.ts +3 -0
- package/components/Alert/index.jsx +3 -0
- package/components/Aurora/Aurora.d.ts +10 -0
- package/components/Aurora/Aurora.jsx +189 -0
- package/components/Aurora/index.d.ts +3 -0
- package/components/Aurora/index.jsx +3 -0
- package/components/Autocomplete/Autocomplete.d.ts +7 -0
- package/components/Autocomplete/Autocomplete.jsx +23 -0
- package/components/Autocomplete/UnstyledAutocomplete.d.ts +36 -0
- package/components/Autocomplete/UnstyledAutocomplete.jsx +73 -0
- package/components/Autocomplete/index.d.ts +5 -0
- package/components/Autocomplete/index.jsx +5 -0
- package/components/BackgroundEffects/BottomBlurryPoint.d.ts +3 -0
- package/components/BackgroundEffects/BottomBlurryPoint.jsx +14 -0
- package/components/BackgroundEffects/TopBlurryPoint.d.ts +3 -0
- package/components/BackgroundEffects/TopBlurryPoint.jsx +14 -0
- package/components/Badge/Badge.d.ts +42 -0
- package/components/Badge/Badge.jsx +50 -0
- package/components/Badge/index.d.ts +3 -0
- package/components/Badge/index.jsx +3 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +11 -0
- package/components/Breadcrumbs/Breadcrumbs.jsx +42 -0
- package/components/Breadcrumbs/index.d.ts +3 -0
- package/components/Breadcrumbs/index.jsx +3 -0
- package/components/Button/Button.d.ts +111 -0
- package/components/Button/Button.jsx +129 -0
- package/components/Button/UnstyledButton.d.ts +10 -0
- package/components/Button/UnstyledButton.jsx +13 -0
- package/components/Button/index.d.ts +3 -0
- package/components/Button/index.jsx +3 -0
- package/components/Carousel/Carousel.d.ts +19 -0
- package/components/Carousel/Carousel.jsx +55 -0
- package/components/Carousel/index.d.ts +3 -0
- package/components/Carousel/index.jsx +3 -0
- package/components/Checkbox/Checkbox.d.ts +14 -0
- package/components/Checkbox/Checkbox.jsx +45 -0
- package/components/Checkbox/index.d.ts +3 -0
- package/components/Checkbox/index.js +3 -0
- package/components/Code/Code.d.ts +12 -0
- package/components/Code/Code.jsx +25 -0
- package/components/Code/Json.d.ts +5 -0
- package/components/Code/Json.jsx +7 -0
- package/components/Code/index.d.ts +4 -0
- package/components/Code/index.jsx +4 -0
- package/components/ConfirmationButton/ConfirmationButton.d.ts +17 -0
- package/components/ConfirmationButton/ConfirmationButton.jsx +13 -0
- package/components/ConfirmationButton/index.d.ts +3 -0
- package/components/ConfirmationButton/index.jsx +3 -0
- package/components/ContextMenu/ContextMenu.d.ts +28 -0
- package/components/ContextMenu/ContextMenu.jsx +70 -0
- package/components/ContextMenu/index.d.ts +3 -0
- package/components/ContextMenu/index.jsx +3 -0
- package/components/CopyButton/CopyButton.d.ts +7 -0
- package/components/CopyButton/CopyButton.jsx +29 -0
- package/components/CopyButton/index.d.ts +3 -0
- package/components/CopyButton/index.jsx +3 -0
- package/components/DateInput/DateInput.d.ts +6 -0
- package/components/DateInput/DateInput.jsx +19 -0
- package/components/DateInput/DateTimeInput.d.ts +3 -0
- package/components/DateInput/DateTimeInput.jsx +8 -0
- package/components/DateInput/index.d.ts +4 -0
- package/components/DateInput/index.jsx +4 -0
- package/components/DateInput/useRefValue.d.ts +5 -0
- package/components/DateInput/useRefValue.js +48 -0
- package/components/DatePicker/DatePicker.d.ts +19 -0
- package/components/DatePicker/DatePicker.jsx +55 -0
- package/components/DatePicker/index.d.ts +3 -0
- package/components/DatePicker/index.jsx +3 -0
- package/components/DateRangePicker/DateRangePicker.d.ts +16 -0
- package/components/DateRangePicker/DateRangePicker.jsx +56 -0
- package/components/DateRangePicker/index.d.ts +3 -0
- package/components/DateRangePicker/index.jsx +3 -0
- package/components/Dialog/Dialog.d.ts +25 -0
- package/components/Dialog/Dialog.jsx +35 -0
- package/components/Dialog/Dialogs.d.ts +1 -0
- package/components/Dialog/Dialogs.jsx +21 -0
- package/components/Dialog/dialogs.state.d.ts +21 -0
- package/components/Dialog/dialogs.state.js +40 -0
- package/components/Dialog/index.d.ts +6 -0
- package/components/Dialog/index.jsx +7 -0
- package/components/Drawer/Drawer.d.ts +15 -0
- package/components/Drawer/Drawer.jsx +72 -0
- package/components/Drawer/index.d.ts +3 -0
- package/components/Drawer/index.jsx +3 -0
- package/components/DropdownMenu/DropdownMenu.d.ts +33 -0
- package/components/DropdownMenu/DropdownMenu.jsx +74 -0
- package/components/DropdownMenu/index.d.ts +3 -0
- package/components/DropdownMenu/index.jsx +3 -0
- package/components/ErrorBoundary/ErrorBoundary.d.ts +18 -0
- package/components/ErrorBoundary/ErrorBoundary.jsx +32 -0
- package/components/ErrorBoundary/index.d.ts +3 -0
- package/components/ErrorBoundary/index.jsx +3 -0
- package/components/ErrorPage/Error404Page.d.ts +1 -0
- package/components/ErrorPage/Error404Page.jsx +4 -0
- package/components/ErrorPage/Error500Page.d.ts +1 -0
- package/components/ErrorPage/Error500Page.jsx +4 -0
- package/components/ErrorPage/ErrorPage.d.ts +11 -0
- package/components/ErrorPage/ErrorPage.jsx +23 -0
- package/components/FileInput/FileInput.d.ts +47 -0
- package/components/FileInput/FileInput.jsx +144 -0
- package/components/FileInput/PreviewFile.d.ts +13 -0
- package/components/FileInput/PreviewFile.jsx +55 -0
- package/components/FileInput/index.d.ts +3 -0
- package/components/FileInput/index.jsx +3 -0
- package/components/FileSelect/FileSelect.d.ts +31 -0
- package/components/FileSelect/FileSelect.jsx +143 -0
- package/components/FileSelect/index.d.ts +3 -0
- package/components/FileSelect/index.jsx +3 -0
- package/components/Footer/Footer.d.ts +19 -0
- package/components/Footer/Footer.jsx +30 -0
- package/components/Footer/index.d.ts +3 -0
- package/components/Footer/index.jsx +3 -0
- package/components/GridPattern/GridPattern.d.ts +2 -0
- package/components/GridPattern/GridPattern.jsx +12 -0
- package/components/GridPattern/index.d.ts +3 -0
- package/components/GridPattern/index.jsx +3 -0
- package/components/Group/Group.d.ts +5 -0
- package/components/Group/Group.jsx +6 -0
- package/components/Group/index.d.ts +3 -0
- package/components/Group/index.jsx +3 -0
- package/components/Header/Header.d.ts +5 -0
- package/components/Header/Header.jsx +19 -0
- package/components/Header/index.d.ts +3 -0
- package/components/Header/index.jsx +3 -0
- package/components/ImageInput/ImageInput.d.ts +4 -0
- package/components/ImageInput/ImageInput.jsx +8 -0
- package/components/ImageInput/index.d.ts +3 -0
- package/components/ImageInput/index.jsx +3 -0
- package/components/Input/Input.d.ts +14 -0
- package/components/Input/Input.jsx +57 -0
- package/components/Input/InputIcon.d.ts +9 -0
- package/components/Input/InputIcon.jsx +7 -0
- package/components/Input/MultiSelectInput.d.ts +13 -0
- package/components/Input/MultiSelectInput.jsx +28 -0
- package/components/Input/NumericInput.d.ts +6 -0
- package/components/Input/NumericInput.jsx +6 -0
- package/components/Input/PatternInput.d.ts +6 -0
- package/components/Input/PatternInput.jsx +6 -0
- package/components/Input/UnstyledInput.d.ts +22 -0
- package/components/Input/UnstyledInput.jsx +28 -0
- package/components/Input/index.d.ts +6 -0
- package/components/Input/index.jsx +6 -0
- package/components/Input2/InputWrapper.d.ts +11 -0
- package/components/Input2/InputWrapper.jsx +11 -0
- package/components/Link/Link.d.ts +3 -0
- package/components/Link/Link.jsx +9 -0
- package/components/Link/index.d.ts +3 -0
- package/components/Link/index.jsx +3 -0
- package/components/Loading/Loading.d.ts +3 -0
- package/components/Loading/Loading.jsx +13 -0
- package/components/Loading/index.d.ts +3 -0
- package/components/Loading/index.jsx +3 -0
- package/components/Magnet/Magnet.d.ts +13 -0
- package/components/Magnet/Magnet.jsx +50 -0
- package/components/Magnet/index.d.ts +3 -0
- package/components/Magnet/index.jsx +3 -0
- package/components/Markdown/Markdown.d.ts +8 -0
- package/components/Markdown/Markdown.jsx +13 -0
- package/components/Markdown/index.d.ts +3 -0
- package/components/Markdown/index.jsx +3 -0
- package/components/Menu/Menu.d.ts +28 -0
- package/components/Menu/Menu.jsx +54 -0
- package/components/Modal/Modal.d.ts +45 -0
- package/components/Modal/Modal.jsx +65 -0
- package/components/Modal/index.d.ts +4 -0
- package/components/Modal/index.jsx +4 -0
- package/components/Modal/useModalState.d.ts +6 -0
- package/components/Modal/useModalState.js +16 -0
- package/components/ModeToggle/ModeToggle.d.ts +9 -0
- package/components/ModeToggle/ModeToggle.jsx +12 -0
- package/components/ModeToggle/index.d.ts +4 -0
- package/components/ModeToggle/index.jsx +5 -0
- package/components/ModeToggle/useModeToggle.d.ts +1 -0
- package/components/ModeToggle/useModeToggle.js +21 -0
- package/components/MultiSelect/MultiSelect.d.ts +28 -0
- package/components/MultiSelect/MultiSelect.jsx +130 -0
- package/components/MultiSelect/index.d.ts +3 -0
- package/components/MultiSelect/index.jsx +3 -0
- package/components/MultiText/MultiText.d.ts +23 -0
- package/components/MultiText/MultiText.jsx +119 -0
- package/components/MultiText/index.d.ts +3 -0
- package/components/MultiText/index.jsx +3 -0
- package/components/NavigationDrawer/NavigationDrawer.d.ts +9 -0
- package/components/NavigationDrawer/NavigationDrawer.jsx +29 -0
- package/components/NavigationDrawer/NavigationItem.d.ts +13 -0
- package/components/NavigationDrawer/NavigationItem.jsx +24 -0
- package/components/NavigationDrawer/index.d.ts +6 -0
- package/components/NavigationDrawer/index.jsx +6 -0
- package/components/NavigationDrawer/navigationDrawer.state.d.ts +9 -0
- package/components/NavigationDrawer/navigationDrawer.state.js +19 -0
- package/components/NoSsr/NoSsr.d.ts +4 -0
- package/components/NoSsr/NoSsr.jsx +8 -0
- package/components/NoSsr/index.d.ts +3 -0
- package/components/NoSsr/index.jsx +3 -0
- package/components/Noise/Noise.d.ts +11 -0
- package/components/Noise/Noise.jsx +69 -0
- package/components/Noise/index.d.ts +3 -0
- package/components/Noise/index.jsx +3 -0
- package/components/Notifications/Notifications.d.ts +3 -0
- package/components/Notifications/Notifications.jsx +60 -0
- package/components/Notifications/index.d.ts +5 -0
- package/components/Notifications/index.jsx +6 -0
- package/components/Notifications/notifications.state.d.ts +24 -0
- package/components/Notifications/notifications.state.js +41 -0
- package/components/Orb/Orb.d.ts +8 -0
- package/components/Orb/Orb.jsx +258 -0
- package/components/Orb/index.d.ts +3 -0
- package/components/Orb/index.jsx +3 -0
- package/components/Pagination/Pagination.d.ts +13 -0
- package/components/Pagination/Pagination.jsx +64 -0
- package/components/Pagination/index.d.ts +3 -0
- package/components/Pagination/index.jsx +3 -0
- package/components/Particles/Particles.d.ts +18 -0
- package/components/Particles/Particles.jsx +205 -0
- package/components/Particles/index.d.ts +3 -0
- package/components/Particles/index.jsx +3 -0
- package/components/PictureCropInput/PictureCropInput.d.ts +17 -0
- package/components/PictureCropInput/PictureCropInput.jsx +153 -0
- package/components/PictureCropInput/canvasPreview.d.ts +2 -0
- package/components/PictureCropInput/canvasPreview.js +37 -0
- package/components/PictureCropInput/index.d.ts +3 -0
- package/components/PictureCropInput/index.js +3 -0
- package/components/Popover/Popover.d.ts +13 -0
- package/components/Popover/Popover.jsx +22 -0
- package/components/Popover/index.d.ts +3 -0
- package/components/Popover/index.jsx +3 -0
- package/components/Resizable/Resizable.d.ts +12 -0
- package/components/Resizable/Resizable.jsx +54 -0
- package/components/Resizable/index.d.ts +3 -0
- package/components/Resizable/index.jsx +3 -0
- package/components/ScrollArea/ScrollArea.d.ts +9 -0
- package/components/ScrollArea/ScrollArea.jsx +16 -0
- package/components/ScrollArea/index.d.ts +3 -0
- package/components/ScrollArea/index.jsx +3 -0
- package/components/Select/Select.d.ts +24 -0
- package/components/Select/Select.jsx +55 -0
- package/components/Select/index.d.ts +3 -0
- package/components/Select/index.jsx +3 -0
- package/components/Skeleton/Skeleton.d.ts +2 -0
- package/components/Skeleton/Skeleton.jsx +8 -0
- package/components/Skeleton/index.d.ts +3 -0
- package/components/Skeleton/index.jsx +3 -0
- package/components/Slider/Slider.d.ts +10 -0
- package/components/Slider/Slider.jsx +21 -0
- package/components/Slider/index.d.ts +3 -0
- package/components/Slider/index.jsx +3 -0
- package/components/Spotlight/Spotlight.d.ts +30 -0
- package/components/Spotlight/Spotlight.jsx +77 -0
- package/components/Spotlight/index.d.ts +3 -0
- package/components/Spotlight/index.jsx +3 -0
- package/components/SpotlightCard/SpotlightCard.d.ts +7 -0
- package/components/SpotlightCard/SpotlightCard.jsx +35 -0
- package/components/SpotlightCard/index.d.ts +3 -0
- package/components/SpotlightCard/index.jsx +3 -0
- package/components/Stack/Stack.d.ts +4 -0
- package/components/Stack/Stack.jsx +5 -0
- package/components/Stack/index.d.ts +3 -0
- package/components/Stack/index.jsx +3 -0
- package/components/StarBorder/StarBorder.d.ts +11 -0
- package/components/StarBorder/StarBorder.jsx +19 -0
- package/components/StarBorder/index.d.ts +3 -0
- package/components/StarBorder/index.jsx +3 -0
- package/components/Switch/Switch.d.ts +16 -0
- package/components/Switch/Switch.jsx +24 -0
- package/components/Switch/index.d.ts +3 -0
- package/components/Switch/index.jsx +3 -0
- package/components/Table/DataTable.d.ts +57 -0
- package/components/Table/DataTable.jsx +155 -0
- package/components/Table/Table.d.ts +27 -0
- package/components/Table/Table.jsx +31 -0
- package/components/Table/TableActionButton.d.ts +6 -0
- package/components/Table/TableActionButton.jsx +20 -0
- package/components/Table/TableBody.d.ts +6 -0
- package/components/Table/TableBody.jsx +10 -0
- package/components/Table/TableCell.d.ts +9 -0
- package/components/Table/TableCell.jsx +18 -0
- package/components/Table/TableFooter.d.ts +5 -0
- package/components/Table/TableFooter.jsx +5 -0
- package/components/Table/TableFooterWithPagination.d.ts +13 -0
- package/components/Table/TableFooterWithPagination.jsx +57 -0
- package/components/Table/TableHead.d.ts +5 -0
- package/components/Table/TableHead.jsx +9 -0
- package/components/Table/TableHeadContext.d.ts +4 -0
- package/components/Table/TableHeadContext.jsx +3 -0
- package/components/Table/TableHeader.d.ts +7 -0
- package/components/Table/TableHeader.jsx +15 -0
- package/components/Table/TableRow.d.ts +8 -0
- package/components/Table/TableRow.jsx +9 -0
- package/components/Table/index.d.ts +3 -0
- package/components/Table/index.jsx +3 -0
- package/components/Tabs/Tabs.d.ts +9 -0
- package/components/Tabs/Tabs.jsx +13 -0
- package/components/Tabs/index.d.ts +3 -0
- package/components/Tabs/index.jsx +3 -0
- package/components/TabsSwitcher/Tab.d.ts +15 -0
- package/components/TabsSwitcher/Tab.jsx +18 -0
- package/components/TabsSwitcher/TabsSwitcher.d.ts +22 -0
- package/components/TabsSwitcher/TabsSwitcher.jsx +31 -0
- package/components/TabsSwitcher/index.d.ts +4 -0
- package/components/TabsSwitcher/index.jsx +4 -0
- package/components/Text/Text.d.ts +24 -0
- package/components/Text/Text.jsx +28 -0
- package/components/Text/index.d.ts +3 -0
- package/components/Text/index.jsx +3 -0
- package/components/Textarea/Textarea.d.ts +5 -0
- package/components/Textarea/Textarea.jsx +6 -0
- package/components/Textarea/index.d.ts +3 -0
- package/components/Textarea/index.js +3 -0
- package/components/Threads/Threads.d.ts +9 -0
- package/components/Threads/Threads.jsx +203 -0
- package/components/Threads/index.d.ts +3 -0
- package/components/Threads/index.jsx +3 -0
- package/components/Tooltip/Tooltip.d.ts +11 -0
- package/components/Tooltip/Tooltip.jsx +21 -0
- package/components/Tooltip/index.d.ts +3 -0
- package/components/Tooltip/index.jsx +3 -0
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +7 -0
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.jsx +18 -0
- package/components/VisibilityActivatedButton/index.d.ts +3 -0
- package/components/VisibilityActivatedButton/index.jsx +3 -0
- package/form.d.ts +82 -0
- package/form.js +113 -0
- package/form2.d.ts +15 -0
- package/form2.jsx +29 -0
- package/hooks/useBeforeUnload.d.ts +1 -0
- package/hooks/useBeforeUnload.js +17 -0
- package/hooks/useDebounceEffect.d.ts +2 -0
- package/hooks/useDebounceEffect.js +14 -0
- package/hooks/useDebouncedValue.d.ts +2 -0
- package/hooks/useDebouncedValue.js +14 -0
- package/hooks/useLagRadar.d.ts +1 -0
- package/hooks/useLagRadar.jsx +124 -0
- package/hooks/useMediaQuery.d.ts +1 -0
- package/hooks/useMediaQuery.js +37 -0
- package/hooks/useMutationWindowCloseProtection.d.ts +2 -0
- package/hooks/useMutationWindowCloseProtection.js +13 -0
- package/hooks/useScroll.d.ts +3 -0
- package/hooks/useScroll.js +47 -0
- package/hooks/useTranslation.d.ts +4 -0
- package/hooks/useTranslation.js +11 -0
- package/hooks/useWhyDidYouUpdate.d.ts +3 -0
- package/hooks/useWhyDidYouUpdate.js +44 -0
- package/imgur.d.ts +1 -0
- package/imgur.js +13 -0
- package/package.json +9 -0
- package/styles/DayPicker.classNames.d.ts +29 -0
- package/styles/DayPicker.classNames.js +30 -0
- package/styles/DayPicker.classNames.ts +81 -0
- package/styles/Dropdown.classNames.d.ts +6 -0
- package/styles/Dropdown.classNames.js +7 -0
- package/styles/Dropdown.classNames.ts +38 -0
- package/styles/Input.css +23 -0
- package/styles/Modal.classNames.d.ts +2 -0
- package/styles/Modal.classNames.js +3 -0
- package/styles/Modal.classNames.ts +15 -0
- package/styles/MultiText.css +40 -0
- package/styles/Pagination.css +19 -0
- package/styles/Tabs.css +23 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/types.d.ts +6 -0
- package/types.js +1 -0
- package/utils/UseState.d.ts +3 -0
- package/utils/UseState.js +1 -0
- package/utils/blobToText.d.ts +1 -0
- package/utils/blobToText.js +13 -0
- package/utils/capitalize.d.ts +1 -0
- package/utils/capitalize.js +6 -0
- package/utils/clsx.d.ts +2 -0
- package/utils/clsx.js +5 -0
- package/utils/copy2DToClipboard.d.ts +1 -0
- package/utils/copy2DToClipboard.js +44 -0
- package/utils/cpfCpnjUtils.d.ts +3 -0
- package/utils/cpfCpnjUtils.js +43 -0
- package/utils/createLocalStorageStateHydration.d.ts +1 -0
- package/utils/createLocalStorageStateHydration.js +18 -0
- package/utils/createStateHydration.d.ts +3 -0
- package/utils/createStateHydration.js +49 -0
- package/utils/csvBlobToJson.d.ts +2 -0
- package/utils/csvBlobToJson.js +60 -0
- package/utils/downloadArrayAsCSV.d.ts +1 -0
- package/utils/downloadArrayAsCSV.js +34 -0
- package/utils/emailRegExp.d.ts +2 -0
- package/utils/emailRegExp.js +3 -0
- package/utils/fakeArray.d.ts +1 -0
- package/utils/fakeArray.js +3 -0
- package/utils/filterBoolean.d.ts +1 -0
- package/utils/filterBoolean.js +3 -0
- package/utils/formatClock.d.ts +1 -0
- package/utils/formatClock.js +21 -0
- package/utils/formatTime.d.ts +2 -0
- package/utils/formatTime.js +40 -0
- package/utils/getInitials.d.ts +4 -0
- package/utils/getInitials.js +8 -0
- package/utils/isBrowser.d.ts +12 -0
- package/utils/isBrowser.js +26 -0
- package/utils/ms.d.ts +6 -0
- package/utils/ms.js +31 -0
- package/utils/preventDefault.d.ts +1 -0
- package/utils/preventDefault.js +3 -0
- package/utils/recursiveChildrenMap.d.ts +2 -0
- package/utils/recursiveChildrenMap.js +16 -0
- package/utils/setSelectionRange.d.ts +1 -0
- package/utils/setSelectionRange.js +55 -0
- package/utils/smoothScrollToHref.d.ts +2 -0
- package/utils/smoothScrollToHref.js +10 -0
- package/utils/stopPropagation.d.ts +2 -0
- package/utils/stopPropagation.js +3 -0
- package/utils/stripHtml.d.ts +1 -0
- package/utils/stripHtml.js +4 -0
- package/utils/stripLineBreak.d.ts +1 -0
- package/utils/stripLineBreak.js +4 -0
- package/utils/stripMarkdown.d.ts +1 -0
- package/utils/stripMarkdown.js +28 -0
- package/utils/xlsxBlobToJson.d.ts +2 -0
- package/utils/xlsxBlobToJson.js +59 -0
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { 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;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import Input, { 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;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Combobox } from "@headlessui/react";
|
|
2
|
+
import Loading from "../Loading";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { 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
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
}, [selectedItem]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (selectedItem !== value) {
|
|
45
|
+
setSelectedItem(value || null);
|
|
46
|
+
}
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
}, [value]);
|
|
49
|
+
return (<Combobox onChange={setSelectedItem} value={selectedItem} nullable>
|
|
50
|
+
{({ open }) => (<div>
|
|
51
|
+
<div className="relative">
|
|
52
|
+
<ComponentInput
|
|
53
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
54
|
+
{...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}/>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
{filteredItems.length > 0 && !readOnly && (<Combobox.Options static={isStatic} className={optionsClassName}>
|
|
58
|
+
{(itemsRenderLimit
|
|
59
|
+
? take(filteredItems, itemsRenderLimit)
|
|
60
|
+
: 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}>
|
|
61
|
+
{({ selected, active }) => (<>
|
|
62
|
+
{selected ? (<span className={clsx("flex items-center", active ? "text-white" : "text-primary-500")}>
|
|
63
|
+
<CheckIcon className="h-5 w-5" aria-hidden="true"/>
|
|
64
|
+
</span>) : null}
|
|
65
|
+
{doRender(item)}
|
|
66
|
+
</>)}
|
|
67
|
+
</Combobox.Option>))}
|
|
68
|
+
</Combobox.Options>)}
|
|
69
|
+
|
|
70
|
+
{open && emptyText && query !== "" && filteredItems.length === 0 && (<p className={emptyTextClassName}>{emptyText}</p>)}
|
|
71
|
+
</div>)}
|
|
72
|
+
</Combobox>);
|
|
73
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { 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;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import clsx from "../../utils/clsx";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
const colorMap = {
|
|
5
|
+
default: {
|
|
6
|
+
badge: "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-100",
|
|
7
|
+
button: "text-zinc-400 hover:bg-zinc-300 dark:hover:bg-zinc-600 hover:text-zinc-500 dark:hover:text-zinc-300 dark:focus:bg-zinc-500 focus:bg-zinc-500",
|
|
8
|
+
},
|
|
9
|
+
primary: {
|
|
10
|
+
badge: "bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-100",
|
|
11
|
+
button: "text-primary-400 hover:bg-primary-200 dark:hover:bg-primary-800 hover:text-primary-500 dark:hover:text-primary-300 focus:bg-primary-500",
|
|
12
|
+
},
|
|
13
|
+
success: {
|
|
14
|
+
badge: "bg-success-100 dark:bg-success-900 text-success-700 dark:text-success-100",
|
|
15
|
+
button: "text-success-400 hover:bg-success-200 dark:hover:bg-success-800 hover:text-success-500 dark:hover:text-success-300 focus:bg-success-500",
|
|
16
|
+
},
|
|
17
|
+
error: {
|
|
18
|
+
badge: "bg-error-100 dark:bg-error-900 text-error-700 dark:text-error-100",
|
|
19
|
+
button: "text-error-400 hover:bg-error-200 dark:hover:bg-error-800 hover:text-error-500 dark:hover:text-error-300 focus:bg-error-500",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const sizeMap = {
|
|
23
|
+
badge: {
|
|
24
|
+
sm: "py-0.5 px-2 text-xs rounded-xl",
|
|
25
|
+
md: "py-0.5 px-2.5 text-sm rounded-xl",
|
|
26
|
+
lg: "py-0.5 px-3 text-md rounded-2xl",
|
|
27
|
+
},
|
|
28
|
+
button: {
|
|
29
|
+
sm: "-mr-1",
|
|
30
|
+
md: "-mr-1.5",
|
|
31
|
+
lg: "-mr-1.5",
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
function Badge({ color = "default", size = "md", className, children, onActionClick, href, shallow, onClick, ...props }) {
|
|
35
|
+
const Component = href ? Link : "span";
|
|
36
|
+
const handleActionClick = useCallback((e) => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
onActionClick?.();
|
|
39
|
+
}, [onActionClick]);
|
|
40
|
+
return (<Component className={clsx("inline-flex items-center py-0.5 font-medium", sizeMap.badge[size], colorMap[color].badge, className)} href={href} shallow={shallow} onClick={onClick} {...props}>
|
|
41
|
+
{children}
|
|
42
|
+
{onActionClick && (<button type="button" className={clsx("ml-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full focus:text-white focus:outline-hidden", sizeMap.button[size], colorMap[color].button)} onClick={handleActionClick}>
|
|
43
|
+
<span className="sr-only">Delete</span>
|
|
44
|
+
<svg className="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8">
|
|
45
|
+
<path strokeLinecap="round" strokeWidth="1.5" d="M1 1l6 6m0-6L1 7"/>
|
|
46
|
+
</svg>
|
|
47
|
+
</button>)}
|
|
48
|
+
</Component>);
|
|
49
|
+
}
|
|
50
|
+
export default Badge;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type BreadcrumbsProps = {
|
|
2
|
+
pages?: {
|
|
3
|
+
title: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
}[];
|
|
7
|
+
homeHref?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export default function Breadcrumbs({ pages, homeHref, className, loading, }: BreadcrumbsProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { HomeIcon } from "@heroicons/react/20/solid";
|
|
2
|
+
import clsx from "../../utils/clsx";
|
|
3
|
+
import Text from "../Text";
|
|
4
|
+
import NextLink from "next/link";
|
|
5
|
+
import Loading from "../Loading";
|
|
6
|
+
import Skeleton from "../Skeleton";
|
|
7
|
+
export default function Breadcrumbs({ pages, homeHref = "/", className, loading, }) {
|
|
8
|
+
if (!pages?.length) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (<nav className={clsx("flex", className)} aria-label="Breadcrumb">
|
|
12
|
+
<ol role="list" className="flex w-full space-x-4 bg-white px-6 shadow-sm dark:border-y dark:border-zinc-800 dark:bg-zinc-900 md:w-auto md:rounded-md md:dark:border-x">
|
|
13
|
+
<li className="flex">
|
|
14
|
+
<div className="flex items-center">
|
|
15
|
+
<NextLink href={homeHref} className="text-zinc-400 hover:text-zinc-500 dark:hover:text-zinc-200">
|
|
16
|
+
<HomeIcon className="h-5 w-5 shrink-0" aria-hidden="true"/>
|
|
17
|
+
<span className="sr-only">Home</span>
|
|
18
|
+
</NextLink>
|
|
19
|
+
</div>
|
|
20
|
+
</li>
|
|
21
|
+
{pages.map((page, i) => {
|
|
22
|
+
const isLast = i === pages.length - 1;
|
|
23
|
+
return (<li key={page.title} className="flex">
|
|
24
|
+
<div className="flex items-center">
|
|
25
|
+
<svg className="h-full w-6 shrink-0 text-zinc-200 dark:text-zinc-800" viewBox="0 0 24 44" preserveAspectRatio="none" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
26
|
+
<path d="M.293 0l22 22-22 22h1.414l22-22-22-22H.293z"/>
|
|
27
|
+
</svg>
|
|
28
|
+
<Text href={page.href} className={clsx("ml-4 text-sm font-medium text-zinc-500! dark:text-zinc-400!", {
|
|
29
|
+
"cursor-default": !page.href,
|
|
30
|
+
"hover:text-zinc-700! dark:hover:text-zinc-200!": !!page.href,
|
|
31
|
+
})} aria-current={isLast ? "page" : undefined}>
|
|
32
|
+
{page.loading ? (<Skeleton className="h-3 w-10"/>) : (page.title)}
|
|
33
|
+
</Text>
|
|
34
|
+
</div>
|
|
35
|
+
</li>);
|
|
36
|
+
})}
|
|
37
|
+
{loading && (<li className="ml-auto! flex items-center">
|
|
38
|
+
<Loading className="-mr-3 ml-4"/>
|
|
39
|
+
</li>)}
|
|
40
|
+
</ol>
|
|
41
|
+
</nav>);
|
|
42
|
+
}
|