@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,111 @@
|
|
|
1
|
+
import { UnstyledButtonProps } from "./UnstyledButton";
|
|
2
|
+
import { ReactElement, Ref } from "react";
|
|
3
|
+
declare const styles: {
|
|
4
|
+
root: string;
|
|
5
|
+
variant: {
|
|
6
|
+
filled: string;
|
|
7
|
+
light: string;
|
|
8
|
+
outlined: string;
|
|
9
|
+
text: string;
|
|
10
|
+
custom: string;
|
|
11
|
+
};
|
|
12
|
+
color: {
|
|
13
|
+
primary: string;
|
|
14
|
+
success: string;
|
|
15
|
+
error: string;
|
|
16
|
+
gray: string;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
variantColor: {
|
|
20
|
+
"filled-primary": string;
|
|
21
|
+
"filled-success": string;
|
|
22
|
+
"filled-error": string;
|
|
23
|
+
"filled-gray": string;
|
|
24
|
+
"filled-default": string;
|
|
25
|
+
"light-primary": string;
|
|
26
|
+
"light-success": string;
|
|
27
|
+
"light-error": string;
|
|
28
|
+
"light-gray": string;
|
|
29
|
+
"light-default": string;
|
|
30
|
+
"outlined-primary": string;
|
|
31
|
+
"outlined-success": string;
|
|
32
|
+
"outlined-error": string;
|
|
33
|
+
"outlined-gray": string;
|
|
34
|
+
"outlined-default": string;
|
|
35
|
+
"text-primary": string;
|
|
36
|
+
"text-success": string;
|
|
37
|
+
"text-error": string;
|
|
38
|
+
"text-gray": string;
|
|
39
|
+
"text-default": string;
|
|
40
|
+
};
|
|
41
|
+
disabled: string;
|
|
42
|
+
size: {
|
|
43
|
+
xs: {
|
|
44
|
+
button: string;
|
|
45
|
+
};
|
|
46
|
+
sm: {
|
|
47
|
+
button: string;
|
|
48
|
+
};
|
|
49
|
+
md: {
|
|
50
|
+
button: string;
|
|
51
|
+
};
|
|
52
|
+
lg: {
|
|
53
|
+
button: string;
|
|
54
|
+
};
|
|
55
|
+
xl: {
|
|
56
|
+
button: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
icon: {
|
|
60
|
+
xs: {
|
|
61
|
+
button: string;
|
|
62
|
+
icon: string;
|
|
63
|
+
leading: string;
|
|
64
|
+
trailing: string;
|
|
65
|
+
};
|
|
66
|
+
sm: {
|
|
67
|
+
button: string;
|
|
68
|
+
icon: string;
|
|
69
|
+
leading: string;
|
|
70
|
+
trailing: string;
|
|
71
|
+
};
|
|
72
|
+
md: {
|
|
73
|
+
button: string;
|
|
74
|
+
icon: string;
|
|
75
|
+
leading: string;
|
|
76
|
+
trailing: string;
|
|
77
|
+
};
|
|
78
|
+
lg: {
|
|
79
|
+
button: string;
|
|
80
|
+
icon: string;
|
|
81
|
+
leading: string;
|
|
82
|
+
trailing: string;
|
|
83
|
+
};
|
|
84
|
+
xl: {
|
|
85
|
+
button: string;
|
|
86
|
+
icon: string;
|
|
87
|
+
leading: string;
|
|
88
|
+
trailing: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export type ButtonProps<T extends HTMLElement = HTMLButtonElement> = Omit<UnstyledButtonProps<T>, "size"> & {
|
|
93
|
+
variant?: keyof (typeof styles)["variant"];
|
|
94
|
+
color?: keyof (typeof styles)["color"];
|
|
95
|
+
size?: keyof (typeof styles)["size"];
|
|
96
|
+
icon?: boolean;
|
|
97
|
+
leading?: ReactElement<{
|
|
98
|
+
className?: string;
|
|
99
|
+
}>;
|
|
100
|
+
trailing?: ReactElement<{
|
|
101
|
+
className?: string;
|
|
102
|
+
}>;
|
|
103
|
+
loading?: boolean;
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
rounded?: boolean;
|
|
106
|
+
trailingClassName?: string;
|
|
107
|
+
leadingClassName?: string;
|
|
108
|
+
ref?: Ref<T>;
|
|
109
|
+
};
|
|
110
|
+
declare const Button: <T extends HTMLElement = HTMLButtonElement>({ variant, color, size, className, trailingClassName, leadingClassName, icon, type, leading, trailing, children, loading, disabled, rounded, ...props }: ButtonProps<T>) => import("react").JSX.Element;
|
|
111
|
+
export default Button;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import UnstyledButton from "./UnstyledButton";
|
|
2
|
+
import clsx from "../../utils/clsx";
|
|
3
|
+
import { cloneElement } from "react";
|
|
4
|
+
import Loading from "../Loading";
|
|
5
|
+
const styles = {
|
|
6
|
+
root: clsx("appearance-none select-none border transition-colors inline-flex items-center justify-center font-medium leading-4 focus:outline-hidden cursor-pointer", "ring-offset-zinc-100 focus-visible:ring-2 focus:ring-primary-500 focus:ring-offset-2", "dark:ring-offset-zinc-900"),
|
|
7
|
+
variant: {
|
|
8
|
+
filled: "shadow-xs",
|
|
9
|
+
light: "shadow-xs",
|
|
10
|
+
outlined: "shadow-xs",
|
|
11
|
+
text: "",
|
|
12
|
+
custom: "",
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
primary: "",
|
|
16
|
+
success: "",
|
|
17
|
+
error: "",
|
|
18
|
+
gray: "",
|
|
19
|
+
default: "",
|
|
20
|
+
},
|
|
21
|
+
variantColor: {
|
|
22
|
+
"filled-primary": "bg-primary-500 hover:bg-primary-500/80 text-on-primary border-transparent active:border-primary-700 dark:active:border-primary-300",
|
|
23
|
+
"filled-success": "bg-success-500 hover:bg-success-500/80 text-white border-transparent active:border-success-700 dark:active:border-success-300",
|
|
24
|
+
"filled-error": "bg-red-500 hover:bg-red-500/80 text-white border-transparent active:border-red-700 dark:active:border-red-300",
|
|
25
|
+
"filled-gray": "bg-zinc-500 hover:bg-zinc-500/80 text-white border-transparent active:border-zinc-500 dark:active:border-zinc-400",
|
|
26
|
+
"filled-default": "bg-zinc-200 hover:bg-zinc-300 dark:bg-zinc-300 dark:hover:bg-zinc-400 text-zinc-900 border-transparent active:border-zinc-400 dark:active:border-zinc-300",
|
|
27
|
+
"light-primary": "border-transparent text-primary-500 bg-primary-500/20 hover:bg-primary-500/30 active:border-primary-700",
|
|
28
|
+
"light-success": "border-transparent text-success-500 bg-success-500/20 hover:bg-success-500/30 active:border-success-700",
|
|
29
|
+
"light-error": "border-transparent text-error-500 bg-error-500/20 hover:bg-error-500/30 active:border-error-700",
|
|
30
|
+
"light-gray": "border-transparent text-zinc-500 dark:text-zinc-300 bg-zinc-500/20 hover:bg-zinc-500/30 dark:hover:bg-zinc-400/30 active:border-zinc-700 dark:active:border-zinc-500",
|
|
31
|
+
"light-default": "border-transparent dark:text-white bg-zinc-300/30 dark:bg-white/20 hover:bg-zinc-300/70 dark:hover:bg-white/30 active:border-zinc-400",
|
|
32
|
+
"outlined-primary": "border-primary-500 text-primary-500 hover:bg-primary-500/10 active:border-primary-700",
|
|
33
|
+
"outlined-success": "border-success-500 text-success-500 hover:bg-success-500/10 active:border-success-700",
|
|
34
|
+
"outlined-error": "border-error-500 text-error-500 hover:bg-error-500/10 active:border-error-700",
|
|
35
|
+
"outlined-gray": "border-zinc-400 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-500/10 active:border-zinc-700",
|
|
36
|
+
"outlined-default": clsx("border-zinc-300 hover:bg-zinc-500/5 active:border-zinc-400", "dark:text-white dark:border-zinc-700 dark:hover:bg-zinc-500/5 dark:active:border-zinc-500"),
|
|
37
|
+
"text-primary": "text-primary-500 hover:bg-primary-500/5 border-transparent active:border-primary-500",
|
|
38
|
+
"text-success": "text-success-500 hover:bg-success-500/5 border-transparent active:border-success-500",
|
|
39
|
+
"text-error": "text-error-500 hover:bg-error-500/5 border-transparent active:border-error-500",
|
|
40
|
+
"text-gray": "text-zinc-500 dark:text-zinc-400 hover:bg-zinc-500/5 border-transparent active:border-zinc-500",
|
|
41
|
+
"text-default": "hover:bg-zinc-500/5 dark:hover:bg-white/5 border-transparent active:border-zinc-500/50 dark:active:border-white/50",
|
|
42
|
+
},
|
|
43
|
+
disabled: "opacity-50 pointer-events-none",
|
|
44
|
+
size: {
|
|
45
|
+
xs: {
|
|
46
|
+
button: "px-2 py-1 text-xs",
|
|
47
|
+
},
|
|
48
|
+
sm: {
|
|
49
|
+
button: "px-2 py-1.5 text-sm",
|
|
50
|
+
},
|
|
51
|
+
md: {
|
|
52
|
+
button: "px-3 py-2 text-sm",
|
|
53
|
+
},
|
|
54
|
+
lg: {
|
|
55
|
+
button: "px-5 py-3 text-md",
|
|
56
|
+
},
|
|
57
|
+
xl: {
|
|
58
|
+
button: "px-6 py-4 text-lg",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
icon: {
|
|
62
|
+
xs: {
|
|
63
|
+
button: "p-1.5",
|
|
64
|
+
icon: "w-3 h-3",
|
|
65
|
+
leading: "mr-1.5 -ml-0.5",
|
|
66
|
+
trailing: "ml-1.5 -mr-0.5",
|
|
67
|
+
},
|
|
68
|
+
sm: {
|
|
69
|
+
button: "p-2",
|
|
70
|
+
icon: "w-4 h-4",
|
|
71
|
+
leading: "mr-1.5",
|
|
72
|
+
trailing: "ml-1.5",
|
|
73
|
+
},
|
|
74
|
+
md: {
|
|
75
|
+
button: "p-2",
|
|
76
|
+
icon: "w-5 h-5",
|
|
77
|
+
leading: "-my-0.5 mr-2 -ml-1",
|
|
78
|
+
trailing: "-my-0.5 ml-2 -mr-1",
|
|
79
|
+
},
|
|
80
|
+
lg: {
|
|
81
|
+
button: "p-3",
|
|
82
|
+
icon: "w-6 h-6",
|
|
83
|
+
leading: "-my-1 mr-3 -ml-2",
|
|
84
|
+
trailing: "-my-1 ml-3 -mr-2",
|
|
85
|
+
},
|
|
86
|
+
xl: {
|
|
87
|
+
button: "p-4",
|
|
88
|
+
icon: "w-7 h-7",
|
|
89
|
+
leading: "-my-2 mr-4 -ml-2",
|
|
90
|
+
trailing: "-my-2 ml-4 -mr-2",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
const Button = ({ variant = "outlined", color = "default", size = "md", className, trailingClassName, leadingClassName, icon, type = "button", leading, trailing, children, loading, disabled, rounded, ...props }) => {
|
|
95
|
+
if (loading) {
|
|
96
|
+
if (icon) {
|
|
97
|
+
children = <Loading className="my-auto"/>;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
trailing = <Loading className="mr-0 h-auto w-auto"/>;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return (<UnstyledButton {...props} className={clsx(styles.root, styles.variant[variant], variant !== "custom" && styles.color[color], variant !== "custom" && styles.variantColor[`${variant}-${color}`], icon ? styles.icon[size].button : styles.size[size].button, rounded ? "rounded-full" : "rounded-sm", {
|
|
104
|
+
[styles.disabled]: disabled,
|
|
105
|
+
}, className)} type={type} disabled={disabled}>
|
|
106
|
+
{leading &&
|
|
107
|
+
cloneElement(leading, {
|
|
108
|
+
className: clsx(styles.icon[size].icon, styles.icon[size].leading, leading?.props?.className, leadingClassName),
|
|
109
|
+
})}
|
|
110
|
+
{!icon
|
|
111
|
+
? children
|
|
112
|
+
: Array.isArray(children)
|
|
113
|
+
? children.map((child, key) => cloneElement(child, {
|
|
114
|
+
key,
|
|
115
|
+
className: clsx(styles.icon[size].icon, child?.props?.className),
|
|
116
|
+
}))
|
|
117
|
+
: (() => {
|
|
118
|
+
const child = children;
|
|
119
|
+
return cloneElement(child, {
|
|
120
|
+
className: clsx(styles.icon[size].icon, child?.props?.className),
|
|
121
|
+
});
|
|
122
|
+
})()}
|
|
123
|
+
{trailing &&
|
|
124
|
+
cloneElement(trailing, {
|
|
125
|
+
className: clsx(styles.icon[size].icon, styles.icon[size].trailing, trailing?.props?.className, trailingClassName),
|
|
126
|
+
})}
|
|
127
|
+
</UnstyledButton>);
|
|
128
|
+
};
|
|
129
|
+
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLProps } from "react";
|
|
2
|
+
export type UnstyledButtonProps<T extends HTMLElement = HTMLButtonElement> = {
|
|
3
|
+
href?: string | null;
|
|
4
|
+
target?: string;
|
|
5
|
+
rel?: string;
|
|
6
|
+
download?: string;
|
|
7
|
+
as?: string;
|
|
8
|
+
} & Omit<HTMLProps<T>, "ref" | "href">;
|
|
9
|
+
declare const UnstyledButton: <T extends HTMLElement = HTMLButtonElement>({ href, as, ...props }: UnstyledButtonProps<T>) => import("react").JSX.Element;
|
|
10
|
+
export default UnstyledButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import NextLink from "next/link";
|
|
2
|
+
const UnstyledButton = ({ href, as, ...props }) => {
|
|
3
|
+
if (as) {
|
|
4
|
+
const Component = as;
|
|
5
|
+
return <Component {...props}/>;
|
|
6
|
+
}
|
|
7
|
+
if (href) {
|
|
8
|
+
const props2 = props;
|
|
9
|
+
return (<NextLink {...props2} href={href} tabIndex={props2.disabled ? -1 : undefined}/>);
|
|
10
|
+
}
|
|
11
|
+
return (<button {...props}/>);
|
|
12
|
+
};
|
|
13
|
+
export default UnstyledButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { EmblaOptionsType, EmblaPluginType } from "embla-carousel";
|
|
3
|
+
export type CarouselProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
carouselClassName?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
navigation?: boolean;
|
|
8
|
+
plugins?: EmblaPluginType[];
|
|
9
|
+
} & EmblaOptionsType;
|
|
10
|
+
declare function Carousel({ children, className, carouselClassName, navigation, plugins, ...options }: CarouselProps): import("react").JSX.Element;
|
|
11
|
+
declare namespace Carousel {
|
|
12
|
+
var Slide: typeof CarouselSlide;
|
|
13
|
+
}
|
|
14
|
+
export default Carousel;
|
|
15
|
+
export interface CarouselSlideProps {
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
declare function CarouselSlide({ children, className }: CarouselSlideProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/20/solid";
|
|
2
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
3
|
+
import clsx from "../../utils/clsx";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import Button from "../Button";
|
|
6
|
+
import { useMeasure } from "react-use";
|
|
7
|
+
import { mergeRefs } from "react-merge-refs";
|
|
8
|
+
export default function Carousel({ children, className, carouselClassName, navigation, plugins, ...options }) {
|
|
9
|
+
const [emblaRef, embla] = useEmblaCarousel(options, plugins);
|
|
10
|
+
const [canScrollPrev, setCanScrollPrev] = useState(false);
|
|
11
|
+
const [canScrollNext, setCanScrollNext] = useState(false);
|
|
12
|
+
const [ref, { width, height }] = useMeasure();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
function updateCanScroll() {
|
|
15
|
+
if (embla) {
|
|
16
|
+
setCanScrollPrev(embla.canScrollPrev());
|
|
17
|
+
setCanScrollNext(embla.canScrollNext());
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (embla) {
|
|
21
|
+
embla.reInit();
|
|
22
|
+
updateCanScroll();
|
|
23
|
+
embla.on("select", updateCanScroll);
|
|
24
|
+
embla.on("reInit", updateCanScroll);
|
|
25
|
+
}
|
|
26
|
+
return () => {
|
|
27
|
+
if (embla) {
|
|
28
|
+
embla.off("select", updateCanScroll);
|
|
29
|
+
embla.off("reInit", updateCanScroll);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}, [embla, width, height]);
|
|
33
|
+
return (<div data-axis={options.axis}>
|
|
34
|
+
<div className={clsx("overflow-hidden", className)} ref={mergeRefs([ref, emblaRef])}>
|
|
35
|
+
<div className={clsx("flex", carouselClassName)}>{children}</div>
|
|
36
|
+
{navigation && (<div className="flex h-full">
|
|
37
|
+
<Button icon variant="text" className={clsx({
|
|
38
|
+
hidden: !canScrollPrev,
|
|
39
|
+
})} disabled={!canScrollPrev} onClick={() => embla?.scrollPrev()}>
|
|
40
|
+
<ChevronLeftIcon />
|
|
41
|
+
</Button>
|
|
42
|
+
<div className="grow"/>
|
|
43
|
+
<Button icon variant="text" className={clsx({
|
|
44
|
+
hidden: !canScrollNext,
|
|
45
|
+
})} disabled={!canScrollNext} onClick={() => embla?.scrollNext()}>
|
|
46
|
+
<ChevronRightIcon />
|
|
47
|
+
</Button>
|
|
48
|
+
</div>)}
|
|
49
|
+
</div>
|
|
50
|
+
</div>);
|
|
51
|
+
}
|
|
52
|
+
Carousel.Slide = CarouselSlide;
|
|
53
|
+
function CarouselSlide({ children, className }) {
|
|
54
|
+
return (<div className={clsx("min-w-0 flex-[0_0_auto]", className)}>{children}</div>);
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DetailedHTMLProps, InputHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type CheckboxProps = {
|
|
3
|
+
label?: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
labelClassName?: string;
|
|
6
|
+
descriptionClassName?: string;
|
|
7
|
+
inputClassName?: string;
|
|
8
|
+
labelOuterClassName?: string;
|
|
9
|
+
error?: boolean;
|
|
10
|
+
helpText?: ReactNode;
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
} & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
13
|
+
declare function Checkbox({ id, label, description, className, labelClassName, descriptionClassName, inputClassName, labelOuterClassName, type, error, helpText, indeterminate, ref, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
14
|
+
export default Checkbox;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect, useId, useRef, } from "react";
|
|
2
|
+
import { defaultTextStyles } from "../Text";
|
|
3
|
+
import clsx from "../../utils/clsx";
|
|
4
|
+
import { mergeRefs } from "react-merge-refs";
|
|
5
|
+
const defaultLabelClassName = defaultTextStyles.variant.label;
|
|
6
|
+
const defaultDescriptionClassName = defaultTextStyles.variant.secondary;
|
|
7
|
+
function Checkbox({ id, label, description, className, labelClassName, descriptionClassName, inputClassName, labelOuterClassName, type = "checkbox", error, helpText, indeterminate, ref, ...props }) {
|
|
8
|
+
const innerRef = useRef(null);
|
|
9
|
+
const defaultInputId = useId();
|
|
10
|
+
const descriptionId = useId();
|
|
11
|
+
id = id || defaultInputId;
|
|
12
|
+
labelClassName = labelClassName
|
|
13
|
+
? `${defaultLabelClassName} ${labelClassName}`
|
|
14
|
+
: defaultLabelClassName;
|
|
15
|
+
descriptionClassName = descriptionClassName
|
|
16
|
+
? `${defaultDescriptionClassName} ${descriptionClassName}`
|
|
17
|
+
: defaultDescriptionClassName;
|
|
18
|
+
inputClassName = clsx("ui-checkbox", inputClassName);
|
|
19
|
+
if (error) {
|
|
20
|
+
labelClassName = clsx(labelClassName, "text-error-500 dark:text-error-500");
|
|
21
|
+
description = helpText || description;
|
|
22
|
+
if (description === helpText) {
|
|
23
|
+
descriptionClassName = clsx(descriptionClassName, "text-error-400 dark:text-error-600");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (innerRef.current) {
|
|
28
|
+
innerRef.current.indeterminate = !!indeterminate;
|
|
29
|
+
}
|
|
30
|
+
}, [indeterminate]);
|
|
31
|
+
return (<div className={clsx("relative flex items-start", className)}>
|
|
32
|
+
<div className="flex h-5 items-center">
|
|
33
|
+
<input {...props} id={id} aria-describedby={descriptionId} type={type} className={inputClassName} ref={mergeRefs([ref, innerRef])}/>
|
|
34
|
+
</div>
|
|
35
|
+
{(label || description) && (<div className={clsx("ml-3 text-sm", labelOuterClassName)}>
|
|
36
|
+
{label && (<label htmlFor={id} className={labelClassName}>
|
|
37
|
+
{label}
|
|
38
|
+
</label>)}
|
|
39
|
+
{description && (<p id={descriptionId} className={descriptionClassName}>
|
|
40
|
+
{description}
|
|
41
|
+
</p>)}
|
|
42
|
+
</div>)}
|
|
43
|
+
</div>);
|
|
44
|
+
}
|
|
45
|
+
export default Checkbox;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Language, PrismTheme } from "prism-react-renderer";
|
|
2
|
+
export type CodeProps = {
|
|
3
|
+
children: string;
|
|
4
|
+
language: Language;
|
|
5
|
+
className?: string;
|
|
6
|
+
copy?: boolean;
|
|
7
|
+
copyText?: string;
|
|
8
|
+
copiedText?: string;
|
|
9
|
+
theme?: PrismTheme;
|
|
10
|
+
copyClassName?: string;
|
|
11
|
+
};
|
|
12
|
+
export default function Code({ children, language, className, copy, copyText, copiedText, theme, copyClassName, }: CodeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Fragment } from "react";
|
|
2
|
+
import { Highlight } from "prism-react-renderer";
|
|
3
|
+
import clsx from "../../utils/clsx";
|
|
4
|
+
import CopyButton from "../CopyButton";
|
|
5
|
+
export default function Code({ children, language, className, copy, copyText, copiedText, theme, copyClassName, }) {
|
|
6
|
+
return (<div className={clsx("group relative", className, {
|
|
7
|
+
dark: !theme,
|
|
8
|
+
})}>
|
|
9
|
+
<div className="prose max-w-none">
|
|
10
|
+
<Highlight code={children.trimEnd()} language={language} theme={theme}>
|
|
11
|
+
{({ className, style, tokens, getTokenProps }) => (<pre className={className} style={style}>
|
|
12
|
+
<code>
|
|
13
|
+
{tokens.map((line, lineIndex) => (<Fragment key={lineIndex}>
|
|
14
|
+
{line
|
|
15
|
+
.filter((token) => !token.empty)
|
|
16
|
+
.map((token, tokenIndex) => (<span key={tokenIndex} {...getTokenProps({ token })}/>))}
|
|
17
|
+
{"\n"}
|
|
18
|
+
</Fragment>))}
|
|
19
|
+
</code>
|
|
20
|
+
</pre>)}
|
|
21
|
+
</Highlight>
|
|
22
|
+
</div>
|
|
23
|
+
{copy && (<CopyButton text={children} copyText={copyText} copiedText={copiedText} className={copyClassName}/>)}
|
|
24
|
+
</div>);
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MenuProps } from "../Menu/Menu";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { ButtonProps } from "../Button";
|
|
4
|
+
export type ConfirmationButtonProps = {
|
|
5
|
+
confirmation: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
confirm?: string;
|
|
8
|
+
onConfirm: () => void;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
cancel?: string;
|
|
12
|
+
position?: MenuProps["position"];
|
|
13
|
+
buttonClassName?: string;
|
|
14
|
+
buttonProps?: Partial<ButtonProps>;
|
|
15
|
+
menuProps?: Partial<MenuProps>;
|
|
16
|
+
};
|
|
17
|
+
export default function ConfirmationButton({ label, confirm, confirmation, onConfirm, loading, className, cancel, position, buttonClassName, buttonProps, menuProps, }: ConfirmationButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Menu from "../Menu/Menu";
|
|
2
|
+
import Button from "../Button";
|
|
3
|
+
export default function ConfirmationButton({ label, confirm, confirmation, onConfirm, loading, className, cancel = "Cancel", position, buttonClassName, buttonProps, menuProps, }) {
|
|
4
|
+
return (<Menu position={position} button={<Button color="error" loading={loading} className={buttonClassName} {...buttonProps}>
|
|
5
|
+
{label}
|
|
6
|
+
</Button>} className={className} {...menuProps}>
|
|
7
|
+
<Menu.Label>{confirmation}</Menu.Label>
|
|
8
|
+
<Menu.Item className="text-red-500!" onClick={onConfirm}>
|
|
9
|
+
{confirm || label}
|
|
10
|
+
</Menu.Item>
|
|
11
|
+
<Menu.Item>{cancel}</Menu.Item>
|
|
12
|
+
</Menu>);
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
|
+
import * as RContextMenu from "@radix-ui/react-context-menu";
|
|
3
|
+
declare function ContextMenuContent({ className, children, ...props }: ComponentProps<typeof RContextMenu.Content>): React.JSX.Element;
|
|
4
|
+
declare function ContextMenuSeparator({ className, ...props }: ComponentProps<typeof RContextMenu.Separator>): React.JSX.Element;
|
|
5
|
+
declare function ContextMenuItem({ className, href, ...props }: ComponentProps<typeof RContextMenu.Item> & {
|
|
6
|
+
href?: string;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function ContextMenuItemIndicator({ className, ...props }: ComponentProps<typeof RContextMenu.ItemIndicator>): React.JSX.Element;
|
|
9
|
+
declare function ContextMenuCheckboxItem({ className, children, indicatorClassName, ...props }: ComponentProps<typeof RContextMenu.CheckboxItem> & {
|
|
10
|
+
indicatorClassName?: string;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function ContextMenuSubContent({ className, children, sideOffset, alignOffset, ...props }: ComponentProps<typeof RContextMenu.SubContent>): React.JSX.Element;
|
|
13
|
+
declare function ContextMenuSubTrigger({ className, href, children, ...props }: ComponentProps<typeof RContextMenu.SubTrigger> & {
|
|
14
|
+
href?: string;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
declare const ContextMenu: {
|
|
17
|
+
Root: React.FC<RContextMenu.ContextMenuProps>;
|
|
18
|
+
Trigger: React.ForwardRefExoticComponent<RContextMenu.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
Content: typeof ContextMenuContent;
|
|
20
|
+
Item: typeof ContextMenuItem;
|
|
21
|
+
Separator: typeof ContextMenuSeparator;
|
|
22
|
+
CheckboxItem: typeof ContextMenuCheckboxItem;
|
|
23
|
+
ItemIndicator: typeof ContextMenuItemIndicator;
|
|
24
|
+
Sub: React.FC<RContextMenu.ContextMenuSubProps>;
|
|
25
|
+
SubContent: typeof ContextMenuSubContent;
|
|
26
|
+
SubTrigger: typeof ContextMenuSubTrigger;
|
|
27
|
+
};
|
|
28
|
+
export default ContextMenu;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { Fragment } from "react";
|
|
2
|
+
import * as RContextMenu from "@radix-ui/react-context-menu";
|
|
3
|
+
import { CheckIcon } from "@heroicons/react/16/solid";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import clsx from "../../utils/clsx";
|
|
6
|
+
import { dropdownCheckboxItemClassName, dropdownItemClassName, dropdownItemIndicatorClassName, dropdownSeparatorClassName, dropdownSubTriggerClassName, } from "../../styles/Dropdown.classNames";
|
|
7
|
+
import { modalContentClassName } from "../../styles/Modal.classNames";
|
|
8
|
+
import { ChevronRightIcon } from "@heroicons/react/20/solid";
|
|
9
|
+
function ContextMenuContent({ className, children, ...props }) {
|
|
10
|
+
return (<RContextMenu.Portal>
|
|
11
|
+
<RContextMenu.Content {...props} className={clsx(modalContentClassName, "ui-context-menu-content", className)}>
|
|
12
|
+
{children}
|
|
13
|
+
</RContextMenu.Content>
|
|
14
|
+
</RContextMenu.Portal>);
|
|
15
|
+
}
|
|
16
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
17
|
+
return (<RContextMenu.Separator {...props} className={clsx(dropdownSeparatorClassName, "ui-context-menu-separator", className)}/>);
|
|
18
|
+
}
|
|
19
|
+
function ContextMenuItem({ className, href, ...props }) {
|
|
20
|
+
const Wrapper = href ? Link : Fragment;
|
|
21
|
+
return (
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
<Wrapper {...(href ? { href } : {})}>
|
|
24
|
+
<RContextMenu.Item {...props} className={clsx(dropdownItemClassName, "ui-context-menu-item", className)}/>
|
|
25
|
+
</Wrapper>);
|
|
26
|
+
}
|
|
27
|
+
function ContextMenuItemIndicator({ className, ...props }) {
|
|
28
|
+
return (<RContextMenu.ItemIndicator className={clsx(dropdownItemIndicatorClassName, "ui-context-menu-checkbox-item-indicator", className)} {...props}/>);
|
|
29
|
+
}
|
|
30
|
+
function ContextMenuCheckboxItem({ className, children, indicatorClassName, ...props }) {
|
|
31
|
+
return (<RContextMenu.CheckboxItem {...props} className={clsx(dropdownCheckboxItemClassName, "ui-context-menu-checkbox-item", className)}>
|
|
32
|
+
<ContextMenuItemIndicator className={clsx("ui-context-menu-checkbox-item-indicator", indicatorClassName)}>
|
|
33
|
+
<CheckIcon />
|
|
34
|
+
</ContextMenuItemIndicator>
|
|
35
|
+
{children}
|
|
36
|
+
</RContextMenu.CheckboxItem>);
|
|
37
|
+
}
|
|
38
|
+
function ContextMenuSubContent({ className, children, sideOffset = 2, alignOffset = -4, ...props }) {
|
|
39
|
+
return (<RContextMenu.Portal>
|
|
40
|
+
<RContextMenu.SubContent sideOffset={sideOffset} alignOffset={alignOffset} {...props} className={clsx(modalContentClassName, "ui-context-menu-sub-content", className)}>
|
|
41
|
+
{children}
|
|
42
|
+
</RContextMenu.SubContent>
|
|
43
|
+
</RContextMenu.Portal>);
|
|
44
|
+
}
|
|
45
|
+
function ContextMenuSubTrigger({ className, href, children, ...props }) {
|
|
46
|
+
const Wrapper = href ? Link : Fragment;
|
|
47
|
+
return (
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
<Wrapper {...(href ? { href } : {})}>
|
|
50
|
+
<RContextMenu.SubTrigger {...props} className={clsx(dropdownSubTriggerClassName, "ui-context-menu-sub-trigger", className)}>
|
|
51
|
+
{children}
|
|
52
|
+
<div className={clsx("absolute right-1.5 top-1.5 inline-flex items-center justify-center", "[&>svg]:h-4 [&>svg]:w-4")}>
|
|
53
|
+
<ChevronRightIcon />
|
|
54
|
+
</div>
|
|
55
|
+
</RContextMenu.SubTrigger>
|
|
56
|
+
</Wrapper>);
|
|
57
|
+
}
|
|
58
|
+
const ContextMenu = {
|
|
59
|
+
Root: RContextMenu.Root,
|
|
60
|
+
Trigger: RContextMenu.Trigger,
|
|
61
|
+
Content: ContextMenuContent,
|
|
62
|
+
Item: ContextMenuItem,
|
|
63
|
+
Separator: ContextMenuSeparator,
|
|
64
|
+
CheckboxItem: ContextMenuCheckboxItem,
|
|
65
|
+
ItemIndicator: ContextMenuItemIndicator,
|
|
66
|
+
Sub: RContextMenu.Sub,
|
|
67
|
+
SubContent: ContextMenuSubContent,
|
|
68
|
+
SubTrigger: ContextMenuSubTrigger,
|
|
69
|
+
};
|
|
70
|
+
export default ContextMenu;
|