@majapisoftwares/ui 4.3.16 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +17 -0
- package/README.md +71 -0
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/components.json +25 -0
- package/docs/MIGRATION-0.2.md +20 -0
- package/docs/NEXT-STARTER-VALIDATION.md +14 -0
- package/docs/STANDARDS.md +36 -0
- package/docs/VALIDATION.md +11 -0
- package/package.json +69 -2
- package/scripts/check-standards.mjs +39 -0
- package/src/components/ui/alert.tsx +77 -0
- package/src/components/ui/badge.tsx +55 -0
- package/src/components/ui/button.tsx +63 -0
- package/src/components/ui/empty.tsx +105 -0
- package/src/components/ui/field.tsx +238 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/native-select.tsx +66 -0
- package/src/components/ui/separator.tsx +24 -0
- package/src/components/ui/sheet.tsx +137 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/table.tsx +115 -0
- package/src/components/ui/tabs.tsx +81 -0
- package/src/lib/utils.ts +1 -0
- package/src/patterns/app-shell.tsx +70 -0
- package/src/patterns/data-table.tsx +225 -0
- package/src/patterns/details-sheet.tsx +51 -0
- package/src/patterns/page-header.tsx +40 -0
- package/src/patterns/status-badge.tsx +23 -0
- package/src/styles.css +465 -0
- package/src/templates/admin-dashboard.tsx +63 -0
- package/src/templates/auth-layout.tsx +36 -0
- package/src/templates/login-form.tsx +97 -0
- package/src/templates/signup-form.tsx +137 -0
- package/src/vite-env.d.ts +1 -0
- package/base.css +0 -360
- package/bootstrap/AppProps.d.ts +0 -9
- package/bootstrap/AppProps.js +0 -1
- package/bootstrap/index.d.ts +0 -1
- package/bootstrap/index.js +0 -1
- package/bootstrap/modeScript.d.ts +0 -2
- package/bootstrap/modeScript.js +0 -35
- package/bootstrap/nprogress.d.ts +0 -1
- package/bootstrap/nprogress.js +0 -19
- package/bootstrap/scrolledScript.d.ts +0 -2
- package/bootstrap/scrolledScript.js +0 -27
- package/bootstrap/setupFocusManager.d.ts +0 -1
- package/bootstrap/setupFocusManager.js +0 -13
- package/bootstrap/suppressConsoleLog.d.ts +0 -1
- package/bootstrap/suppressConsoleLog.js +0 -8
- package/components/Accordion/Accordion.d.ts +0 -16
- package/components/Accordion/Accordion.jsx +0 -27
- package/components/Accordion/index.d.ts +0 -3
- package/components/Accordion/index.jsx +0 -3
- package/components/Alert/Alert.d.ts +0 -31
- package/components/Alert/Alert.jsx +0 -53
- package/components/Alert/index.d.ts +0 -3
- package/components/Alert/index.jsx +0 -3
- package/components/AntiClickjacking/AntiClickjacking.d.ts +0 -1
- package/components/AntiClickjacking/AntiClickjacking.jsx +0 -17
- package/components/AntiClickjacking/index.d.ts +0 -2
- package/components/AntiClickjacking/index.jsx +0 -2
- package/components/Aurora/Aurora.d.ts +0 -10
- package/components/Aurora/Aurora.jsx +0 -189
- package/components/Aurora/index.d.ts +0 -3
- package/components/Aurora/index.jsx +0 -3
- package/components/Autocomplete/Autocomplete.d.ts +0 -7
- package/components/Autocomplete/Autocomplete.jsx +0 -23
- package/components/Autocomplete/UnstyledAutocomplete.d.ts +0 -36
- package/components/Autocomplete/UnstyledAutocomplete.jsx +0 -72
- package/components/Autocomplete/index.d.ts +0 -5
- package/components/Autocomplete/index.jsx +0 -5
- package/components/BackgroundEffects/BottomBlurryPoint.d.ts +0 -3
- package/components/BackgroundEffects/BottomBlurryPoint.jsx +0 -14
- package/components/BackgroundEffects/TopBlurryPoint.d.ts +0 -3
- package/components/BackgroundEffects/TopBlurryPoint.jsx +0 -14
- package/components/Badge/Badge.d.ts +0 -42
- package/components/Badge/Badge.jsx +0 -51
- package/components/Badge/index.d.ts +0 -3
- package/components/Badge/index.jsx +0 -3
- package/components/Breadcrumbs/Breadcrumbs.d.ts +0 -20
- package/components/Breadcrumbs/Breadcrumbs.jsx +0 -42
- package/components/Breadcrumbs/index.d.ts +0 -3
- package/components/Breadcrumbs/index.jsx +0 -3
- package/components/Button/Button.d.ts +0 -111
- package/components/Button/Button.jsx +0 -129
- package/components/Button/UnstyledButton.d.ts +0 -10
- package/components/Button/UnstyledButton.jsx +0 -13
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.jsx +0 -3
- package/components/Carousel/Carousel.d.ts +0 -19
- package/components/Carousel/Carousel.jsx +0 -55
- package/components/Carousel/index.d.ts +0 -3
- package/components/Carousel/index.jsx +0 -3
- package/components/Checkbox/Checkbox.d.ts +0 -14
- package/components/Checkbox/Checkbox.jsx +0 -45
- package/components/Checkbox/index.d.ts +0 -3
- package/components/Checkbox/index.js +0 -3
- package/components/Code/Code.d.ts +0 -12
- package/components/Code/Code.jsx +0 -25
- package/components/Code/Json.d.ts +0 -5
- package/components/Code/Json.jsx +0 -7
- package/components/Code/index.d.ts +0 -4
- package/components/Code/index.jsx +0 -4
- package/components/ConfirmationButton/ConfirmationButton.d.ts +0 -17
- package/components/ConfirmationButton/ConfirmationButton.jsx +0 -13
- package/components/ConfirmationButton/index.d.ts +0 -3
- package/components/ConfirmationButton/index.jsx +0 -3
- package/components/ContextMenu/ContextMenu.d.ts +0 -28
- package/components/ContextMenu/ContextMenu.jsx +0 -70
- package/components/ContextMenu/index.d.ts +0 -3
- package/components/ContextMenu/index.jsx +0 -3
- package/components/CopyButton/CopyButton.d.ts +0 -7
- package/components/CopyButton/CopyButton.jsx +0 -29
- package/components/CopyButton/index.d.ts +0 -3
- package/components/CopyButton/index.jsx +0 -3
- package/components/DateInput/DateInput.d.ts +0 -6
- package/components/DateInput/DateInput.jsx +0 -19
- package/components/DateInput/DateTimeInput.d.ts +0 -3
- package/components/DateInput/DateTimeInput.jsx +0 -8
- package/components/DateInput/index.d.ts +0 -4
- package/components/DateInput/index.jsx +0 -4
- package/components/DateInput/useRefValue.d.ts +0 -5
- package/components/DateInput/useRefValue.js +0 -48
- package/components/DatePicker/DatePicker.d.ts +0 -19
- package/components/DatePicker/DatePicker.jsx +0 -55
- package/components/DatePicker/index.d.ts +0 -3
- package/components/DatePicker/index.jsx +0 -3
- package/components/DateRangePicker/DateRangePicker.d.ts +0 -16
- package/components/DateRangePicker/DateRangePicker.jsx +0 -56
- package/components/DateRangePicker/index.d.ts +0 -3
- package/components/DateRangePicker/index.jsx +0 -3
- package/components/Dialog/Dialog.d.ts +0 -25
- package/components/Dialog/Dialog.jsx +0 -35
- package/components/Dialog/Dialogs.d.ts +0 -1
- package/components/Dialog/Dialogs.jsx +0 -21
- package/components/Dialog/dialogs.state.d.ts +0 -21
- package/components/Dialog/dialogs.state.js +0 -40
- package/components/Dialog/index.d.ts +0 -6
- package/components/Dialog/index.jsx +0 -7
- package/components/Drawer/Drawer.d.ts +0 -15
- package/components/Drawer/Drawer.jsx +0 -72
- package/components/Drawer/index.d.ts +0 -3
- package/components/Drawer/index.jsx +0 -3
- package/components/DropdownMenu/DropdownMenu.d.ts +0 -33
- package/components/DropdownMenu/DropdownMenu.jsx +0 -74
- package/components/DropdownMenu/index.d.ts +0 -3
- package/components/DropdownMenu/index.jsx +0 -3
- package/components/ErrorBoundary/ErrorBoundary.d.ts +0 -18
- package/components/ErrorBoundary/ErrorBoundary.jsx +0 -32
- package/components/ErrorBoundary/index.d.ts +0 -3
- package/components/ErrorBoundary/index.jsx +0 -3
- package/components/ErrorPage/Error404Page.d.ts +0 -1
- package/components/ErrorPage/Error404Page.jsx +0 -4
- package/components/ErrorPage/Error500Page.d.ts +0 -1
- package/components/ErrorPage/Error500Page.jsx +0 -4
- package/components/ErrorPage/ErrorPage.d.ts +0 -11
- package/components/ErrorPage/ErrorPage.jsx +0 -23
- package/components/FileInput/FileInput.d.ts +0 -53
- package/components/FileInput/FileInput.jsx +0 -141
- package/components/FileInput/PreviewFile.d.ts +0 -18
- package/components/FileInput/PreviewFile.jsx +0 -54
- package/components/FileInput/index.d.ts +0 -3
- package/components/FileInput/index.jsx +0 -3
- package/components/FileInput/isImage.d.ts +0 -1
- package/components/FileInput/isImage.js +0 -10
- package/components/FileInput/isVideo.d.ts +0 -1
- package/components/FileInput/isVideo.js +0 -10
- package/components/FileSelect/FileSelect.d.ts +0 -31
- package/components/FileSelect/FileSelect.jsx +0 -146
- package/components/FileSelect/index.d.ts +0 -3
- package/components/FileSelect/index.jsx +0 -3
- package/components/Footer/Footer.d.ts +0 -19
- package/components/Footer/Footer.jsx +0 -30
- package/components/Footer/index.d.ts +0 -3
- package/components/Footer/index.jsx +0 -3
- package/components/GridPattern/GridPattern.d.ts +0 -2
- package/components/GridPattern/GridPattern.jsx +0 -12
- package/components/GridPattern/index.d.ts +0 -3
- package/components/GridPattern/index.jsx +0 -3
- package/components/Group/Group.d.ts +0 -5
- package/components/Group/Group.jsx +0 -6
- package/components/Group/index.d.ts +0 -3
- package/components/Group/index.jsx +0 -3
- package/components/Header/Header.d.ts +0 -5
- package/components/Header/Header.jsx +0 -19
- package/components/Header/index.d.ts +0 -3
- package/components/Header/index.jsx +0 -3
- package/components/ImageInput/ImageInput.d.ts +0 -4
- package/components/ImageInput/ImageInput.jsx +0 -8
- package/components/ImageInput/index.d.ts +0 -3
- package/components/ImageInput/index.jsx +0 -3
- package/components/Input/Input.d.ts +0 -14
- package/components/Input/Input.jsx +0 -57
- package/components/Input/InputIcon.d.ts +0 -9
- package/components/Input/InputIcon.jsx +0 -7
- package/components/Input/MultiSelectInput.d.ts +0 -16
- package/components/Input/MultiSelectInput.jsx +0 -48
- package/components/Input/NumericInput.d.ts +0 -6
- package/components/Input/NumericInput.jsx +0 -6
- package/components/Input/PatternInput.d.ts +0 -6
- package/components/Input/PatternInput.jsx +0 -6
- package/components/Input/SelectInput.d.ts +0 -12
- package/components/Input/SelectInput.jsx +0 -25
- package/components/Input/UnstyledInput.d.ts +0 -22
- package/components/Input/UnstyledInput.jsx +0 -28
- package/components/Input/index.d.ts +0 -6
- package/components/Input/index.jsx +0 -6
- package/components/Input/useInputRefValue.d.ts +0 -11
- package/components/Input/useInputRefValue.jsx +0 -51
- package/components/Input2/InputWrapper.d.ts +0 -11
- package/components/Input2/InputWrapper.jsx +0 -11
- package/components/Link/Link.d.ts +0 -3
- package/components/Link/Link.jsx +0 -9
- package/components/Link/index.d.ts +0 -3
- package/components/Link/index.jsx +0 -3
- package/components/Loading/Loading.d.ts +0 -5
- package/components/Loading/Loading.jsx +0 -15
- package/components/Loading/index.d.ts +0 -3
- package/components/Loading/index.jsx +0 -3
- package/components/Magnet/Magnet.d.ts +0 -13
- package/components/Magnet/Magnet.jsx +0 -50
- package/components/Magnet/index.d.ts +0 -3
- package/components/Magnet/index.jsx +0 -3
- package/components/Markdown/Markdown.d.ts +0 -8
- package/components/Markdown/Markdown.jsx +0 -11
- package/components/Markdown/index.d.ts +0 -3
- package/components/Markdown/index.jsx +0 -3
- package/components/Menu/Menu.d.ts +0 -28
- package/components/Menu/Menu.jsx +0 -54
- package/components/Modal/Modal.d.ts +0 -45
- package/components/Modal/Modal.jsx +0 -65
- package/components/Modal/index.d.ts +0 -4
- package/components/Modal/index.jsx +0 -4
- package/components/Modal/useModalState.d.ts +0 -6
- package/components/Modal/useModalState.js +0 -16
- package/components/ModeToggle/ModeToggle.d.ts +0 -9
- package/components/ModeToggle/ModeToggle.jsx +0 -12
- package/components/ModeToggle/index.d.ts +0 -4
- package/components/ModeToggle/index.jsx +0 -5
- package/components/ModeToggle/useModeToggle.d.ts +0 -1
- package/components/ModeToggle/useModeToggle.js +0 -21
- package/components/MultiSelect/MultiSelect.d.ts +0 -28
- package/components/MultiSelect/MultiSelect.jsx +0 -116
- package/components/MultiSelect/MultiSelectInput.d.ts +0 -12
- package/components/MultiSelect/MultiSelectInput.jsx +0 -27
- package/components/MultiSelect/index.d.ts +0 -5
- package/components/MultiSelect/index.jsx +0 -5
- package/components/MultiText/MultiText.d.ts +0 -23
- package/components/MultiText/MultiText.jsx +0 -118
- package/components/MultiText/index.d.ts +0 -3
- package/components/MultiText/index.jsx +0 -3
- package/components/NavigationDrawer/NavigationDrawer.d.ts +0 -9
- package/components/NavigationDrawer/NavigationDrawer.jsx +0 -29
- package/components/NavigationDrawer/NavigationItem.d.ts +0 -13
- package/components/NavigationDrawer/NavigationItem.jsx +0 -24
- package/components/NavigationDrawer/index.d.ts +0 -6
- package/components/NavigationDrawer/index.jsx +0 -6
- package/components/NavigationDrawer/navigationDrawer.state.d.ts +0 -9
- package/components/NavigationDrawer/navigationDrawer.state.js +0 -19
- package/components/NoSsr/NoSsr.d.ts +0 -4
- package/components/NoSsr/NoSsr.jsx +0 -8
- package/components/NoSsr/index.d.ts +0 -3
- package/components/NoSsr/index.jsx +0 -3
- package/components/Noise/Noise.d.ts +0 -11
- package/components/Noise/Noise.jsx +0 -69
- package/components/Noise/index.d.ts +0 -3
- package/components/Noise/index.jsx +0 -3
- package/components/Notifications/Notifications.d.ts +0 -3
- package/components/Notifications/Notifications.jsx +0 -60
- package/components/Notifications/index.d.ts +0 -5
- package/components/Notifications/index.jsx +0 -6
- package/components/Notifications/notifications.state.d.ts +0 -24
- package/components/Notifications/notifications.state.js +0 -41
- package/components/Orb/Orb.d.ts +0 -8
- package/components/Orb/Orb.jsx +0 -258
- package/components/Orb/index.d.ts +0 -3
- package/components/Orb/index.jsx +0 -3
- package/components/Pagination/Pagination.d.ts +0 -13
- package/components/Pagination/Pagination.jsx +0 -64
- package/components/Pagination/index.d.ts +0 -3
- package/components/Pagination/index.jsx +0 -3
- package/components/Particles/Particles.d.ts +0 -18
- package/components/Particles/Particles.jsx +0 -205
- package/components/Particles/index.d.ts +0 -3
- package/components/Particles/index.jsx +0 -3
- package/components/PictureCropInput/PictureCropInput.d.ts +0 -20
- package/components/PictureCropInput/PictureCropInput.jsx +0 -174
- package/components/PictureCropInput/canvasPreview.d.ts +0 -2
- package/components/PictureCropInput/canvasPreview.js +0 -37
- package/components/PictureCropInput/index.d.ts +0 -3
- package/components/PictureCropInput/index.js +0 -3
- package/components/Popover/Popover.d.ts +0 -13
- package/components/Popover/Popover.jsx +0 -22
- package/components/Popover/index.d.ts +0 -3
- package/components/Popover/index.jsx +0 -3
- package/components/Resizable/Resizable.d.ts +0 -12
- package/components/Resizable/Resizable.jsx +0 -54
- package/components/Resizable/index.d.ts +0 -3
- package/components/Resizable/index.jsx +0 -3
- package/components/ScrollArea/ScrollArea.d.ts +0 -9
- package/components/ScrollArea/ScrollArea.jsx +0 -16
- package/components/ScrollArea/index.d.ts +0 -3
- package/components/ScrollArea/index.jsx +0 -3
- package/components/Select/Select.d.ts +0 -25
- package/components/Select/Select.jsx +0 -55
- package/components/Select/index.d.ts +0 -3
- package/components/Select/index.jsx +0 -3
- package/components/Skeleton/Skeleton.d.ts +0 -2
- package/components/Skeleton/Skeleton.jsx +0 -8
- package/components/Skeleton/index.d.ts +0 -3
- package/components/Skeleton/index.jsx +0 -3
- package/components/Slider/Slider.d.ts +0 -10
- package/components/Slider/Slider.jsx +0 -21
- package/components/Slider/index.d.ts +0 -3
- package/components/Slider/index.jsx +0 -3
- package/components/Spotlight/Spotlight.d.ts +0 -30
- package/components/Spotlight/Spotlight.jsx +0 -86
- package/components/Spotlight/index.d.ts +0 -3
- package/components/Spotlight/index.jsx +0 -3
- package/components/SpotlightCard/SpotlightCard.d.ts +0 -7
- package/components/SpotlightCard/SpotlightCard.jsx +0 -35
- package/components/SpotlightCard/index.d.ts +0 -3
- package/components/SpotlightCard/index.jsx +0 -3
- package/components/Stack/Stack.d.ts +0 -4
- package/components/Stack/Stack.jsx +0 -5
- package/components/Stack/index.d.ts +0 -3
- package/components/Stack/index.jsx +0 -3
- package/components/StarBorder/StarBorder.d.ts +0 -10
- package/components/StarBorder/StarBorder.jsx +0 -19
- package/components/StarBorder/index.d.ts +0 -3
- package/components/StarBorder/index.jsx +0 -3
- package/components/Switch/Switch.d.ts +0 -16
- package/components/Switch/Switch.jsx +0 -24
- package/components/Switch/index.d.ts +0 -3
- package/components/Switch/index.jsx +0 -3
- package/components/Table/DataTable.d.ts +0 -57
- package/components/Table/DataTable.jsx +0 -155
- package/components/Table/Table.d.ts +0 -27
- package/components/Table/Table.jsx +0 -31
- package/components/Table/TableActionButton.d.ts +0 -6
- package/components/Table/TableActionButton.jsx +0 -20
- package/components/Table/TableBody.d.ts +0 -6
- package/components/Table/TableBody.jsx +0 -10
- package/components/Table/TableCell.d.ts +0 -9
- package/components/Table/TableCell.jsx +0 -18
- package/components/Table/TableFooter.d.ts +0 -5
- package/components/Table/TableFooter.jsx +0 -5
- package/components/Table/TableFooterWithPagination.d.ts +0 -13
- package/components/Table/TableFooterWithPagination.jsx +0 -57
- package/components/Table/TableHead.d.ts +0 -5
- package/components/Table/TableHead.jsx +0 -9
- package/components/Table/TableHeadContext.d.ts +0 -4
- package/components/Table/TableHeadContext.jsx +0 -3
- package/components/Table/TableHeader.d.ts +0 -7
- package/components/Table/TableHeader.jsx +0 -15
- package/components/Table/TableRow.d.ts +0 -8
- package/components/Table/TableRow.jsx +0 -9
- package/components/Table/index.d.ts +0 -3
- package/components/Table/index.jsx +0 -3
- package/components/Tabs/Tabs.d.ts +0 -9
- package/components/Tabs/Tabs.jsx +0 -13
- package/components/Tabs/index.d.ts +0 -3
- package/components/Tabs/index.jsx +0 -3
- package/components/TabsSwitcher/Tab.d.ts +0 -15
- package/components/TabsSwitcher/Tab.jsx +0 -18
- package/components/TabsSwitcher/TabsSwitcher.d.ts +0 -22
- package/components/TabsSwitcher/TabsSwitcher.jsx +0 -31
- package/components/TabsSwitcher/index.d.ts +0 -4
- package/components/TabsSwitcher/index.jsx +0 -4
- package/components/Text/Text.d.ts +0 -24
- package/components/Text/Text.jsx +0 -29
- package/components/Text/index.d.ts +0 -3
- package/components/Text/index.jsx +0 -3
- package/components/Textarea/Textarea.d.ts +0 -5
- package/components/Textarea/Textarea.jsx +0 -6
- package/components/Textarea/index.d.ts +0 -3
- package/components/Textarea/index.js +0 -3
- package/components/Threads/Threads.d.ts +0 -9
- package/components/Threads/Threads.jsx +0 -203
- package/components/Threads/index.d.ts +0 -3
- package/components/Threads/index.jsx +0 -3
- package/components/Tooltip/Tooltip.d.ts +0 -11
- package/components/Tooltip/Tooltip.jsx +0 -21
- package/components/Tooltip/index.d.ts +0 -3
- package/components/Tooltip/index.jsx +0 -3
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.d.ts +0 -7
- package/components/VisibilityActivatedButton/VisibilityActivatedButton.jsx +0 -18
- package/components/VisibilityActivatedButton/index.d.ts +0 -3
- package/components/VisibilityActivatedButton/index.jsx +0 -3
- package/form.d.ts +0 -82
- package/form.js +0 -113
- package/form2.d.ts +0 -15
- package/form2.jsx +0 -30
- package/hooks/useBeforeUnload.d.ts +0 -1
- package/hooks/useBeforeUnload.js +0 -17
- package/hooks/useDebounceEffect.d.ts +0 -2
- package/hooks/useDebounceEffect.js +0 -14
- package/hooks/useDebouncedValue.d.ts +0 -2
- package/hooks/useDebouncedValue.js +0 -14
- package/hooks/useLagRadar.d.ts +0 -1
- package/hooks/useLagRadar.jsx +0 -124
- package/hooks/useMediaQuery.d.ts +0 -1
- package/hooks/useMediaQuery.js +0 -37
- package/hooks/useMutationWindowCloseProtection.d.ts +0 -2
- package/hooks/useMutationWindowCloseProtection.js +0 -13
- package/hooks/useScroll.d.ts +0 -3
- package/hooks/useScroll.js +0 -47
- package/hooks/useTranslation.d.ts +0 -4
- package/hooks/useTranslation.js +0 -11
- package/hooks/useWhyDidYouUpdate.d.ts +0 -3
- package/hooks/useWhyDidYouUpdate.js +0 -44
- package/imgur.d.ts +0 -1
- package/imgur.js +0 -13
- package/styles/DayPicker.classNames.d.ts +0 -29
- package/styles/DayPicker.classNames.js +0 -30
- package/styles/DayPicker.classNames.ts +0 -81
- package/styles/Dropdown.classNames.d.ts +0 -6
- package/styles/Dropdown.classNames.js +0 -7
- package/styles/Dropdown.classNames.ts +0 -38
- package/styles/Input.css +0 -23
- package/styles/Modal.classNames.d.ts +0 -2
- package/styles/Modal.classNames.js +0 -3
- package/styles/Modal.classNames.ts +0 -15
- package/styles/MultiText.css +0 -40
- package/styles/Pagination.css +0 -19
- package/styles/Tabs.css +0 -23
- package/tsconfig.tsbuildinfo +0 -1
- package/types.d.ts +0 -6
- package/types.js +0 -1
- package/utils/UseState.d.ts +0 -2
- package/utils/UseState.js +0 -1
- package/utils/blobToText.d.ts +0 -1
- package/utils/blobToText.js +0 -13
- package/utils/capitalize.d.ts +0 -1
- package/utils/capitalize.js +0 -6
- package/utils/clsx.d.ts +0 -2
- package/utils/clsx.js +0 -5
- package/utils/copy2DToClipboard.d.ts +0 -1
- package/utils/copy2DToClipboard.js +0 -44
- package/utils/cpfCpnjUtils.d.ts +0 -3
- package/utils/cpfCpnjUtils.js +0 -43
- package/utils/createLocalStorageStateHydration.d.ts +0 -1
- package/utils/createLocalStorageStateHydration.js +0 -18
- package/utils/createStateHydration.d.ts +0 -3
- package/utils/createStateHydration.js +0 -49
- package/utils/csvBlobToJson.d.ts +0 -2
- package/utils/csvBlobToJson.js +0 -59
- package/utils/downloadArrayAsCSV.d.ts +0 -1
- package/utils/downloadArrayAsCSV.js +0 -34
- package/utils/emailRegExp.d.ts +0 -2
- package/utils/emailRegExp.js +0 -2
- package/utils/fakeArray.d.ts +0 -1
- package/utils/fakeArray.js +0 -3
- package/utils/filterBoolean.d.ts +0 -1
- package/utils/filterBoolean.js +0 -3
- package/utils/formatClock.d.ts +0 -1
- package/utils/formatClock.js +0 -21
- package/utils/getInitials.d.ts +0 -4
- package/utils/getInitials.js +0 -22
- package/utils/isBrowser.d.ts +0 -12
- package/utils/isBrowser.js +0 -26
- package/utils/ms.d.ts +0 -6
- package/utils/ms.js +0 -31
- package/utils/preventDefault.d.ts +0 -2
- package/utils/preventDefault.js +0 -3
- package/utils/recursiveChildrenMap.d.ts +0 -2
- package/utils/recursiveChildrenMap.js +0 -16
- package/utils/setSelectionRange.d.ts +0 -1
- package/utils/setSelectionRange.js +0 -55
- package/utils/smoothScrollToHref.d.ts +0 -2
- package/utils/smoothScrollToHref.js +0 -14
- package/utils/stopPropagation.d.ts +0 -2
- package/utils/stopPropagation.js +0 -3
- package/utils/stripHtml.d.ts +0 -1
- package/utils/stripHtml.js +0 -4
- package/utils/stripLineBreak.d.ts +0 -1
- package/utils/stripLineBreak.js +0 -4
- package/utils/stripMarkdown.d.ts +0 -1
- package/utils/stripMarkdown.js +0 -28
- package/utils/xlsxBlobToJson.d.ts +0 -2
- package/utils/xlsxBlobToJson.js +0 -62
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useId, } from "react";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
function UnstyledInput({ id, label, className, inputClassName, labelClassName, helpTextClassName, trailingClassName, trailingInputClassName, leadingClassName, leadingInputClassName, helpText, type = "text", leading, trailing, select, children, as, innerClassName, value, ...props }) {
|
|
4
|
-
const innerId = useId();
|
|
5
|
-
id = id || innerId;
|
|
6
|
-
const Component = as || (select ? "select" : "input");
|
|
7
|
-
inputClassName = clsx(inputClassName, leadingInputClassName && {
|
|
8
|
-
[leadingInputClassName]: !!leading,
|
|
9
|
-
}, trailingInputClassName && {
|
|
10
|
-
[trailingInputClassName]: !!trailing,
|
|
11
|
-
});
|
|
12
|
-
return (<div className={className}>
|
|
13
|
-
{label && (<label htmlFor={id} className={labelClassName}>
|
|
14
|
-
{label}
|
|
15
|
-
</label>)}
|
|
16
|
-
<div style={{ position: "relative" }} className={innerClassName}>
|
|
17
|
-
{leading && <div className={leadingClassName}>{leading}</div>}
|
|
18
|
-
<Component
|
|
19
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20
|
-
{...props} className={inputClassName} id={id} type={type} value={value}>
|
|
21
|
-
{children}
|
|
22
|
-
</Component>
|
|
23
|
-
{trailing && <div className={trailingClassName}>{trailing}</div>}
|
|
24
|
-
</div>
|
|
25
|
-
{helpText && <div className={helpTextClassName}>{helpText}</div>}
|
|
26
|
-
</div>);
|
|
27
|
-
}
|
|
28
|
-
export default UnstyledInput;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type ChangeEvent, type Ref } from "react";
|
|
2
|
-
export default function useInputRefValue<T>({ value, ref, name, onChange, }: {
|
|
3
|
-
value?: T;
|
|
4
|
-
ref?: Ref<HTMLInputElement>;
|
|
5
|
-
name?: string;
|
|
6
|
-
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
-
}): {
|
|
8
|
-
innerRef: import("react").RefObject<HTMLInputElement>;
|
|
9
|
-
innerValue: T | undefined;
|
|
10
|
-
setInnerValue: import("react").Dispatch<import("react").SetStateAction<T | undefined>>;
|
|
11
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import { useDeepCompareEffect } from "react-use";
|
|
3
|
-
import { isEqual } from "lodash-es";
|
|
4
|
-
export default function useInputRefValue({ value, ref, name, onChange, }) {
|
|
5
|
-
const [innerValue, setInnerValue] = useState(value);
|
|
6
|
-
useDeepCompareEffect(() => {
|
|
7
|
-
if (value && !isEqual(value, innerValue)) {
|
|
8
|
-
setInnerValue(value);
|
|
9
|
-
}
|
|
10
|
-
}, [{ value }]);
|
|
11
|
-
const innerRef = useRef({
|
|
12
|
-
get value() {
|
|
13
|
-
return innerValue;
|
|
14
|
-
},
|
|
15
|
-
set value(value) {
|
|
16
|
-
setInnerValue(value);
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (ref) {
|
|
21
|
-
if (typeof ref === "function") {
|
|
22
|
-
ref(innerRef.current);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
try {
|
|
26
|
-
ref.current = innerRef.current;
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
-
}
|
|
29
|
-
catch (e) {
|
|
30
|
-
// do nothing
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}, [ref]);
|
|
35
|
-
useDeepCompareEffect(() => {
|
|
36
|
-
if (onChange) {
|
|
37
|
-
onChange({
|
|
38
|
-
target: {
|
|
39
|
-
name,
|
|
40
|
-
value: innerValue,
|
|
41
|
-
},
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}, [{ innerValue }]);
|
|
46
|
-
return {
|
|
47
|
-
innerRef,
|
|
48
|
-
innerValue,
|
|
49
|
-
setInnerValue,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export interface InputWrapperProps {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
id?: string;
|
|
7
|
-
helpText?: string;
|
|
8
|
-
error?: boolean;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export default function InputWrapper({ children, className, label, id, helpText, error, required, }: InputWrapperProps): import("react").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import clsx from "../../utils/clsx";
|
|
2
|
-
export default function InputWrapper({ children, className, label, id, helpText, error, required, }) {
|
|
3
|
-
return (<div className={clsx("ui-input-wrapper", className)} data-error={error ? "" : undefined}>
|
|
4
|
-
{label && (<label htmlFor={id} className="ui-input-wrapper-label">
|
|
5
|
-
{label}
|
|
6
|
-
{required && <span className="text-red-500"> *</span>}
|
|
7
|
-
</label>)}
|
|
8
|
-
{children}
|
|
9
|
-
{helpText && <div className="ui-input-wrapper-help-text">{helpText}</div>}
|
|
10
|
-
</div>);
|
|
11
|
-
}
|
package/components/Link/Link.jsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import NextLink from "next/link";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
export default function Link({ className, href, ...props }) {
|
|
4
|
-
className = clsx("text-primary-500 underline decoration-primary-500/40 decoration-2 transition-colors hover:decoration-primary-500", className);
|
|
5
|
-
if (href) {
|
|
6
|
-
return <NextLink href={href} {...props} className={className}/>;
|
|
7
|
-
}
|
|
8
|
-
return (<button {...props} className={className} type="button"/>);
|
|
9
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { memo } from "react";
|
|
2
|
-
function Loading({ className }) {
|
|
3
|
-
return (<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" className={className}>
|
|
4
|
-
<circle cx="4" cy="12" r="3" fill="currentColor">
|
|
5
|
-
<animate attributeName="opacity" begin="0s" dur="1.5s" repeatCount="indefinite" values="1;0.2;1"/>
|
|
6
|
-
</circle>
|
|
7
|
-
<circle cx="12" cy="12" r="3" fill="currentColor">
|
|
8
|
-
<animate attributeName="opacity" begin="0.3s" dur="1.5s" repeatCount="indefinite" values="1;0.2;1"/>
|
|
9
|
-
</circle>
|
|
10
|
-
<circle cx="20" cy="12" r="3" fill="currentColor">
|
|
11
|
-
<animate attributeName="opacity" begin="0.6s" dur="1.5s" repeatCount="indefinite" values="1;0.2;1"/>
|
|
12
|
-
</circle>
|
|
13
|
-
</svg>);
|
|
14
|
-
}
|
|
15
|
-
export default memo(Loading);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { type ReactNode, type HTMLAttributes } from "react";
|
|
2
|
-
interface MagnetProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
padding?: number;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
magnetStrength?: number;
|
|
7
|
-
activeTransition?: string;
|
|
8
|
-
inactiveTransition?: string;
|
|
9
|
-
wrapperClassName?: string;
|
|
10
|
-
innerClassName?: string;
|
|
11
|
-
}
|
|
12
|
-
declare const Magnet: React.FC<MagnetProps>;
|
|
13
|
-
export default Magnet;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef, } from "react";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
const Magnet = ({ children, padding = 100, disabled = false, magnetStrength = 2, activeTransition = "transform 0.3s ease-out", inactiveTransition = "transform 0.5s ease-in-out", wrapperClassName = "", innerClassName = "", ...props }) => {
|
|
4
|
-
const [isActive, setIsActive] = useState(false);
|
|
5
|
-
const [position, setPosition] = useState({
|
|
6
|
-
x: 0,
|
|
7
|
-
y: 0,
|
|
8
|
-
});
|
|
9
|
-
const magnetRef = useRef(null);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (disabled) {
|
|
12
|
-
setPosition({ x: 0, y: 0 });
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const handleMouseMove = (e) => {
|
|
16
|
-
if (!magnetRef.current)
|
|
17
|
-
return;
|
|
18
|
-
const { left, top, width, height } = magnetRef.current.getBoundingClientRect();
|
|
19
|
-
const centerX = left + width / 2;
|
|
20
|
-
const centerY = top + height / 2;
|
|
21
|
-
const distX = Math.abs(centerX - e.clientX);
|
|
22
|
-
const distY = Math.abs(centerY - e.clientY);
|
|
23
|
-
if (distX < width / 2 + padding && distY < height / 2 + padding) {
|
|
24
|
-
setIsActive(true);
|
|
25
|
-
const offsetX = (e.clientX - centerX) / magnetStrength;
|
|
26
|
-
const offsetY = (e.clientY - centerY) / magnetStrength;
|
|
27
|
-
setPosition({ x: offsetX, y: offsetY });
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
setIsActive(false);
|
|
31
|
-
setPosition({ x: 0, y: 0 });
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
window.addEventListener("mousemove", handleMouseMove);
|
|
35
|
-
return () => {
|
|
36
|
-
window.removeEventListener("mousemove", handleMouseMove);
|
|
37
|
-
};
|
|
38
|
-
}, [padding, disabled, magnetStrength]);
|
|
39
|
-
const transitionStyle = isActive ? activeTransition : inactiveTransition;
|
|
40
|
-
return (<div ref={magnetRef} className={clsx("relative inline-block", wrapperClassName)} {...props}>
|
|
41
|
-
<div className={innerClassName} style={{
|
|
42
|
-
transform: `translate3d(${position.x}px, ${position.y}px, 0)`,
|
|
43
|
-
transition: transitionStyle,
|
|
44
|
-
willChange: "transform",
|
|
45
|
-
}}>
|
|
46
|
-
{children}
|
|
47
|
-
</div>
|
|
48
|
-
</div>);
|
|
49
|
-
};
|
|
50
|
-
export default Magnet;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React, { type ComponentProps } from "react";
|
|
2
|
-
import ReactMarkdown from "react-markdown";
|
|
3
|
-
export type MarkdownProps = {
|
|
4
|
-
children?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
options?: ComponentProps<typeof ReactMarkdown>;
|
|
7
|
-
};
|
|
8
|
-
export default function Markdown({ children, className, options, }: MarkdownProps): React.JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React, {} from "react";
|
|
2
|
-
import ReactMarkdown from "react-markdown";
|
|
3
|
-
import clsx from "../../utils/clsx";
|
|
4
|
-
import remarkGfm from "remark-gfm";
|
|
5
|
-
export default function Markdown({ children, className, options, }) {
|
|
6
|
-
return (<div className={clsx("prose prose-zinc dark:prose-invert max-w-full leading-normal", "[&_.contains-task-list]:list-none [&_.contains-task-list]:pl-0", "[&_.task-list-item_input[type='checkbox']]:-mt-1", "prose-a:break-all", className)}>
|
|
7
|
-
<ReactMarkdown remarkPlugins={[remarkGfm, ...(options?.remarkPlugins || [])]} {...options}>
|
|
8
|
-
{children}
|
|
9
|
-
</ReactMarkdown>
|
|
10
|
-
</div>);
|
|
11
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
|
-
import Button from "../Button/Button";
|
|
3
|
-
import { type UnstyledButtonProps } from "../Button/UnstyledButton";
|
|
4
|
-
import { type TextProps } from "../Text";
|
|
5
|
-
export declare 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 type MenuProps = {
|
|
7
|
-
className?: string;
|
|
8
|
-
position?: "left" | "right" | "bottom-right" | "bottom-left";
|
|
9
|
-
iconClassName?: string;
|
|
10
|
-
menuItemsClassName?: string;
|
|
11
|
-
buttonProps?: ComponentPropsWithoutRef<typeof Button>;
|
|
12
|
-
label?: ReactNode;
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
button?: ReactNode;
|
|
15
|
-
unmount?: boolean;
|
|
16
|
-
ref?: Ref<HTMLDivElement>;
|
|
17
|
-
};
|
|
18
|
-
export type MenuItemProps<T extends HTMLElement = HTMLButtonElement> = UnstyledButtonProps<T> & {
|
|
19
|
-
icon?: ReactElement<{
|
|
20
|
-
className?: string;
|
|
21
|
-
}>;
|
|
22
|
-
};
|
|
23
|
-
export type MenuLabelProps = TextProps;
|
|
24
|
-
declare const _default: (({ className, iconClassName, position, children, label, button, buttonProps, unmount, menuItemsClassName, ...props }: MenuProps) => import("react").JSX.Element) & {
|
|
25
|
-
Label: (props: MenuLabelProps) => import("react").JSX.Element;
|
|
26
|
-
Item: <T extends HTMLElement = HTMLButtonElement>({ className, icon, children, ...props }: MenuItemProps<T>) => import("react").JSX.Element;
|
|
27
|
-
};
|
|
28
|
-
export default _default;
|
package/components/Menu/Menu.jsx
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { cloneElement, Fragment, } from "react";
|
|
2
|
-
import { Menu as HuiMenu, Transition } from "@headlessui/react";
|
|
3
|
-
import { ChevronDownIcon } from "@heroicons/react/20/solid";
|
|
4
|
-
import clsx from "../../utils/clsx";
|
|
5
|
-
import Button from "../Button/Button";
|
|
6
|
-
import UnstyledButton, {} from "../Button/UnstyledButton";
|
|
7
|
-
import Text, {} from "../Text";
|
|
8
|
-
import { useMount } from "react-use";
|
|
9
|
-
export const defaultMenuItemsClassName = "z-10 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden dark:bg-zinc-800";
|
|
10
|
-
const Item = function MenuItem({ className, icon, children, ...props }) {
|
|
11
|
-
return (<HuiMenu.Item>
|
|
12
|
-
{({ active }) => (<UnstyledButton {...props} type="button" className={clsx("flex w-full items-center text-left", active
|
|
13
|
-
? "bg-zinc-100 text-zinc-900 dark:bg-zinc-700/50 dark:text-zinc-100"
|
|
14
|
-
: "text-zinc-700 dark:text-zinc-200", "block px-4 py-2 text-sm", className)}>
|
|
15
|
-
{icon &&
|
|
16
|
-
cloneElement(icon, {
|
|
17
|
-
className: clsx("w-5 mr-2", icon.props.className),
|
|
18
|
-
})}
|
|
19
|
-
{children}
|
|
20
|
-
</UnstyledButton>)}
|
|
21
|
-
</HuiMenu.Item>);
|
|
22
|
-
};
|
|
23
|
-
const Label = function MenuLabel(props) {
|
|
24
|
-
return (<Text {...props} variant="label" className={clsx("w-full text-left", "block px-4 py-2 text-sm", props.className)}/>);
|
|
25
|
-
};
|
|
26
|
-
const Menu = function Menu({ className, iconClassName, position = "right", children, label, button, buttonProps, unmount, menuItemsClassName, ...props }) {
|
|
27
|
-
useMount(() => {
|
|
28
|
-
console.warn("<Menu> was deprecated and should be replaced with <DropdownMenu>");
|
|
29
|
-
});
|
|
30
|
-
return (<HuiMenu as="div" className={clsx("relative inline-block text-left", className)} {...props}>
|
|
31
|
-
<div>
|
|
32
|
-
{button ? (<HuiMenu.Button as={Fragment}>{button}</HuiMenu.Button>) : (<HuiMenu.Button
|
|
33
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
34
|
-
as={Button} className={clsx("flex w-full", buttonProps?.className)} trailing={<ChevronDownIcon className={iconClassName}/>} {...buttonProps}>
|
|
35
|
-
{label}
|
|
36
|
-
</HuiMenu.Button>)}
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<Transition as={Fragment} enter="transition ease-out duration-100" enterFrom="transform opacity-0 scale-95" enterTo="transform opacity-100 scale-100" leave="transition ease-in duration-75" leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95">
|
|
40
|
-
<HuiMenu.Items unmount={unmount} className={clsx(defaultMenuItemsClassName, "absolute mt-2 min-w-[14rem]", {
|
|
41
|
-
"right-0": position.includes("right"),
|
|
42
|
-
"origin-top-right": position.includes("right") && !position.includes("bottom"),
|
|
43
|
-
"origin-top-left": position.includes("left") && !position.includes("bottom"),
|
|
44
|
-
"origin-bottom-right": position.includes("right") && position.includes("bottom"),
|
|
45
|
-
"origin-bottom-left": position.includes("left") && position.includes("bottom"),
|
|
46
|
-
"left-0": position.includes("left"),
|
|
47
|
-
"bottom-0": position.includes("bottom"),
|
|
48
|
-
}, menuItemsClassName)}>
|
|
49
|
-
<div className="py-1">{children}</div>
|
|
50
|
-
</HuiMenu.Items>
|
|
51
|
-
</Transition>
|
|
52
|
-
</HuiMenu>);
|
|
53
|
-
};
|
|
54
|
-
export default Object.assign(Menu, { Label, Item });
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type CSSProperties, type ReactElement, type ReactNode } from "react";
|
|
2
|
-
import Button from "../Button";
|
|
3
|
-
declare function Modal({ open, onClose, children, overlayClassName, panelClassName, dialogClassName, dialogOuterPanelClassName, dialogOverflowClassName, style, }: {
|
|
4
|
-
open?: boolean;
|
|
5
|
-
onClose?: () => void;
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
overlayClassName?: string;
|
|
8
|
-
panelClassName?: string;
|
|
9
|
-
dialogClassName?: string;
|
|
10
|
-
dialogOuterPanelClassName?: string;
|
|
11
|
-
dialogOverflowClassName?: string;
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
}): import("react").JSX.Element;
|
|
14
|
-
declare namespace Modal {
|
|
15
|
-
var Container: typeof ModalContainer;
|
|
16
|
-
var Title: typeof ModalTitle;
|
|
17
|
-
var Content: typeof ModalContent;
|
|
18
|
-
var Actions: typeof ModalActions;
|
|
19
|
-
var Icon: typeof ModalIcon;
|
|
20
|
-
var CloseButton: typeof ModalCloseButton;
|
|
21
|
-
}
|
|
22
|
-
export default Modal;
|
|
23
|
-
declare function ModalContainer({ children, className, }: {
|
|
24
|
-
children?: ReactNode;
|
|
25
|
-
className?: string;
|
|
26
|
-
}): import("react").JSX.Element;
|
|
27
|
-
declare function ModalTitle({ children, className, }: {
|
|
28
|
-
children?: ReactNode;
|
|
29
|
-
className?: string;
|
|
30
|
-
}): import("react").JSX.Element;
|
|
31
|
-
declare function ModalContent({ children, className, }: {
|
|
32
|
-
children?: ReactNode;
|
|
33
|
-
className?: string;
|
|
34
|
-
}): import("react").JSX.Element;
|
|
35
|
-
declare function ModalActions({ children, className, }: {
|
|
36
|
-
children?: ReactNode;
|
|
37
|
-
className?: string;
|
|
38
|
-
}): import("react").JSX.Element;
|
|
39
|
-
declare function ModalIcon({ children, }: {
|
|
40
|
-
children?: ReactElement<{
|
|
41
|
-
className?: string;
|
|
42
|
-
"aria-hidden"?: string;
|
|
43
|
-
}>;
|
|
44
|
-
}): import("react").JSX.Element;
|
|
45
|
-
declare function ModalCloseButton({ className, ...props }: ComponentPropsWithoutRef<typeof Button>): import("react").JSX.Element;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { cloneElement, Fragment, useCallback, } from "react";
|
|
2
|
-
import { Dialog, Transition } from "@headlessui/react";
|
|
3
|
-
import Stack from "../Stack";
|
|
4
|
-
import Group from "../Group";
|
|
5
|
-
import Button from "../Button";
|
|
6
|
-
import { XMarkIcon } from "@heroicons/react/24/solid";
|
|
7
|
-
import clsx from "../../utils/clsx";
|
|
8
|
-
export default function Modal({ open, onClose, children, overlayClassName, panelClassName, dialogClassName, dialogOuterPanelClassName, dialogOverflowClassName, style, }) {
|
|
9
|
-
const handleOnClose = useCallback(() => onClose?.(), [onClose]);
|
|
10
|
-
return (<Transition.Root show={open} as={Fragment}>
|
|
11
|
-
<Dialog as="div" className={clsx("relative z-10", dialogClassName)} onClose={handleOnClose} style={style}>
|
|
12
|
-
<Transition.Child as={Fragment} enter="ease-out duration-300" enterFrom="opacity-0" enterTo="opacity-100" leave="ease-in duration-200" leaveFrom="opacity-100" leaveTo="opacity-0">
|
|
13
|
-
<div className={clsx("fixed inset-0 bg-white/75 transition-opacity dark:bg-black/75", overlayClassName)}/>
|
|
14
|
-
</Transition.Child>
|
|
15
|
-
|
|
16
|
-
<div className={clsx("fixed inset-0 z-10 overflow-y-auto", dialogOverflowClassName)}>
|
|
17
|
-
<div className={clsx("flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0", dialogOuterPanelClassName)}>
|
|
18
|
-
<Transition.Child as={Fragment} enter="ease-out duration-300" enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" enterTo="opacity-100 translate-y-0 sm:scale-100" leave="ease-in duration-200" leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95">
|
|
19
|
-
<Dialog.Panel className={clsx("relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-sm dark:bg-zinc-900 dark:ring-1 dark:ring-white/5", panelClassName)}>
|
|
20
|
-
{children}
|
|
21
|
-
</Dialog.Panel>
|
|
22
|
-
</Transition.Child>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</Dialog>
|
|
26
|
-
</Transition.Root>);
|
|
27
|
-
}
|
|
28
|
-
Modal.Container = ModalContainer;
|
|
29
|
-
function ModalContainer({ children, className, }) {
|
|
30
|
-
return (<Stack className={clsx("gap-4! px-4 pt-5 pb-4 sm:p-6", className)}>
|
|
31
|
-
{children}
|
|
32
|
-
</Stack>);
|
|
33
|
-
}
|
|
34
|
-
Modal.Title = ModalTitle;
|
|
35
|
-
function ModalTitle({ children, className, }) {
|
|
36
|
-
return (<Dialog.Title as="h3" className={clsx("text-center text-lg leading-6 font-medium text-zinc-900 dark:text-zinc-100", className)}>
|
|
37
|
-
{children}
|
|
38
|
-
</Dialog.Title>);
|
|
39
|
-
}
|
|
40
|
-
Modal.Content = ModalContent;
|
|
41
|
-
function ModalContent({ children, className, }) {
|
|
42
|
-
return (<div className={clsx("text-center text-sm text-zinc-500 dark:text-zinc-400", className)}>
|
|
43
|
-
{children}
|
|
44
|
-
</div>);
|
|
45
|
-
}
|
|
46
|
-
Modal.Actions = ModalActions;
|
|
47
|
-
function ModalActions({ children, className, }) {
|
|
48
|
-
return <Group className={className}>{children}</Group>;
|
|
49
|
-
}
|
|
50
|
-
Modal.Icon = ModalIcon;
|
|
51
|
-
function ModalIcon({ children, }) {
|
|
52
|
-
return (<div className="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-800">
|
|
53
|
-
{children &&
|
|
54
|
-
cloneElement(children, {
|
|
55
|
-
className: "h-6 w-6 text-green-600 dark:text-green-400",
|
|
56
|
-
"aria-hidden": "true",
|
|
57
|
-
})}
|
|
58
|
-
</div>);
|
|
59
|
-
}
|
|
60
|
-
Modal.CloseButton = ModalCloseButton;
|
|
61
|
-
function ModalCloseButton({ className, ...props }) {
|
|
62
|
-
return (<Button icon className={clsx("absolute top-2 right-2", className)} variant="text" {...props}>
|
|
63
|
-
<XMarkIcon />
|
|
64
|
-
</Button>);
|
|
65
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from "react";
|
|
2
|
-
export default function useModalState() {
|
|
3
|
-
const [modalOpen, setModalOpen] = useState(false);
|
|
4
|
-
const handleModalToggle = useCallback(() => setModalOpen((open) => !open), []);
|
|
5
|
-
const handleModalOpen = useCallback(() => setModalOpen(true), []);
|
|
6
|
-
const handleModalClose = useCallback(() => setModalOpen(false), []);
|
|
7
|
-
return useMemo(() => [
|
|
8
|
-
modalOpen,
|
|
9
|
-
{
|
|
10
|
-
setModalOpen,
|
|
11
|
-
openModal: handleModalOpen,
|
|
12
|
-
closeModal: handleModalClose,
|
|
13
|
-
toggleModal: handleModalToggle,
|
|
14
|
-
},
|
|
15
|
-
], [handleModalClose, handleModalOpen, handleModalToggle, modalOpen]);
|
|
16
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Ref } from "react";
|
|
2
|
-
export interface ModeToggleProps {
|
|
3
|
-
ariaLabel?: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
iconClassName?: string;
|
|
6
|
-
ref?: Ref<HTMLButtonElement>;
|
|
7
|
-
}
|
|
8
|
-
declare const ModeToggle: ({ ariaLabel, className, iconClassName, ref, }: ModeToggleProps) => import("react").JSX.Element;
|
|
9
|
-
export default ModeToggle;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MoonIcon, SunIcon } from "@heroicons/react/24/outline";
|
|
2
|
-
import Button from "../Button";
|
|
3
|
-
import clsx from "../../utils/clsx";
|
|
4
|
-
import useModeToggle from "./useModeToggle";
|
|
5
|
-
const ModeToggle = function ModeToggle({ ariaLabel = "Toggle dark mode", className, iconClassName, ref, }) {
|
|
6
|
-
const toggleMode = useModeToggle();
|
|
7
|
-
return (<Button ref={ref} icon variant="text" aria-label={ariaLabel} onClick={toggleMode} className={className}>
|
|
8
|
-
<SunIcon className={clsx("dark:hidden", iconClassName)}/>
|
|
9
|
-
<MoonIcon className={clsx("hidden dark:block", iconClassName)}/>
|
|
10
|
-
</Button>);
|
|
11
|
-
};
|
|
12
|
-
export default ModeToggle;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useModeToggle(): () => void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export default function useModeToggle() {
|
|
2
|
-
function disableTransitionsTemporarily() {
|
|
3
|
-
document.documentElement.classList.add("**:transition-none!");
|
|
4
|
-
window.setTimeout(() => {
|
|
5
|
-
document.documentElement.classList.remove("**:transition-none!");
|
|
6
|
-
}, 0);
|
|
7
|
-
}
|
|
8
|
-
function toggleMode() {
|
|
9
|
-
disableTransitionsTemporarily();
|
|
10
|
-
const darkModeMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
11
|
-
const isSystemDarkMode = darkModeMediaQuery.matches;
|
|
12
|
-
const isDarkMode = document.documentElement.classList.toggle("dark");
|
|
13
|
-
if (isDarkMode === isSystemDarkMode) {
|
|
14
|
-
delete window.localStorage.isDarkMode;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
window.localStorage.isDarkMode = isDarkMode;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return toggleMode;
|
|
21
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import Input, { type UnstyledInputProps } from "../Input";
|
|
3
|
-
export interface MultiSelectProps<T extends object | string> extends Omit<UnstyledInputProps<false>, "as" | "onSelect" | "inputClassName" | "innerClassName" | "value" | "onChange"> {
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
emptyText?: string;
|
|
6
|
-
items?: T[];
|
|
7
|
-
filterProperty?: keyof T;
|
|
8
|
-
filterFunction?: (item: T) => boolean;
|
|
9
|
-
onChange?: (items: string[]) => void;
|
|
10
|
-
renderProperty?: keyof T;
|
|
11
|
-
renderFunction?: (item: T) => ReactNode;
|
|
12
|
-
query?: string;
|
|
13
|
-
onChangeQuery?: (query: string) => void;
|
|
14
|
-
loading?: boolean;
|
|
15
|
-
leadingClassName?: string;
|
|
16
|
-
inputInnerClassName?: string;
|
|
17
|
-
inputElementClassName?: string;
|
|
18
|
-
leading?: ReactNode;
|
|
19
|
-
as?: typeof Input;
|
|
20
|
-
static?: boolean;
|
|
21
|
-
displayValue?: (item: T | null) => string;
|
|
22
|
-
value?: string[];
|
|
23
|
-
creatable?: boolean;
|
|
24
|
-
getCreateLabel?: (query: string) => string;
|
|
25
|
-
itemsRenderLimit?: number;
|
|
26
|
-
valueProperty?: string;
|
|
27
|
-
}
|
|
28
|
-
export default function MultiSelect<T extends object | string>({ placeholder, emptyText, items, renderProperty, renderFunction, filterProperty, filterFunction, onChange, query: defaultQuery, onChangeQuery, loading, inputInnerClassName, inputElementClassName, as, trailing, trailingClassName, trailingInputClassName, leadingInputClassName, static: isStatic, displayValue, value, labelClassName, creatable, getCreateLabel, itemsRenderLimit, className, valueProperty, label, required, readOnly, error, ...props }: MultiSelectProps<T>): import("react").JSX.Element;
|