@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,13 +0,0 @@
|
|
|
1
|
-
export interface TableFooterWithPaginationProps {
|
|
2
|
-
itemsPerPage: number;
|
|
3
|
-
totalItems?: number;
|
|
4
|
-
currentPage: number;
|
|
5
|
-
onChangePage?: (page: number) => void;
|
|
6
|
-
previousText?: string;
|
|
7
|
-
nextText?: string;
|
|
8
|
-
showingText?: string;
|
|
9
|
-
toText?: string;
|
|
10
|
-
ofText?: string;
|
|
11
|
-
resultsText?: string;
|
|
12
|
-
}
|
|
13
|
-
export default function TableFooterWithPagination({ itemsPerPage, totalItems, currentPage, onChangePage, previousText, nextText, showingText, toText, ofText, resultsText, }: TableFooterWithPaginationProps): import("react").JSX.Element;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import TableFooter from "./TableFooter";
|
|
2
|
-
import Pagination from "../Pagination/Pagination";
|
|
3
|
-
import { useCallback, useEffect, useState } from "react";
|
|
4
|
-
import Button from "../Button/Button";
|
|
5
|
-
export default function TableFooterWithPagination({ itemsPerPage, totalItems, currentPage, onChangePage, previousText = "Previous", nextText = "Next", showingText = "Showing", toText = "to", ofText = "of", resultsText = "results", }) {
|
|
6
|
-
const pageCount = totalItems !== undefined && itemsPerPage !== undefined
|
|
7
|
-
? Math.floor(totalItems / itemsPerPage)
|
|
8
|
-
: 0;
|
|
9
|
-
const [page, setPage] = useState(currentPage);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (page !== currentPage) {
|
|
12
|
-
setPage(currentPage);
|
|
13
|
-
}
|
|
14
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15
|
-
}, [currentPage]);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (onChangePage) {
|
|
18
|
-
onChangePage(page);
|
|
19
|
-
}
|
|
20
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
-
}, [page]);
|
|
22
|
-
const handlePageClick = useCallback((page) => () => setPage(page), []);
|
|
23
|
-
let start = (page - 1) * itemsPerPage + 1;
|
|
24
|
-
let end = page * itemsPerPage;
|
|
25
|
-
if (totalItems !== undefined) {
|
|
26
|
-
end = end > totalItems ? totalItems : end;
|
|
27
|
-
}
|
|
28
|
-
if (end === 0) {
|
|
29
|
-
start = 0;
|
|
30
|
-
}
|
|
31
|
-
return (<TableFooter>
|
|
32
|
-
<div className="flex flex-1 justify-between sm:hidden">
|
|
33
|
-
<Button disabled={page === 1} onClick={handlePageClick(page - 1)}>
|
|
34
|
-
{previousText}
|
|
35
|
-
</Button>
|
|
36
|
-
<Button disabled={page === pageCount - 1} onClick={handlePageClick(page + 1)}>
|
|
37
|
-
{nextText}
|
|
38
|
-
</Button>
|
|
39
|
-
</div>
|
|
40
|
-
<div className="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
|
|
41
|
-
<div>
|
|
42
|
-
<p className="text-sm text-zinc-700 dark:text-zinc-100">
|
|
43
|
-
{showingText} <span className="font-medium">{start}</span> {toText}{" "}
|
|
44
|
-
<span className="font-medium">{end}</span>
|
|
45
|
-
{totalItems !== undefined && itemsPerPage !== undefined && (<>
|
|
46
|
-
{" "}
|
|
47
|
-
{ofText} <span className="font-medium">{totalItems}</span>{" "}
|
|
48
|
-
{resultsText}
|
|
49
|
-
</>)}
|
|
50
|
-
</p>
|
|
51
|
-
</div>
|
|
52
|
-
<div>
|
|
53
|
-
<Pagination itemsPerPage={itemsPerPage} totalItems={totalItems} currentPage={currentPage} onChangePage={onChangePage}/>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</TableFooter>);
|
|
57
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import TableHeadContext from "./TableHeadContext";
|
|
3
|
-
export default function TableHead({ children }) {
|
|
4
|
-
return (<TableHeadContext.Provider value={useMemo(() => ({ isHead: true }), [])}>
|
|
5
|
-
<thead className="sticky top-0 bg-zinc-50 dark:bg-zinc-900">
|
|
6
|
-
{children}
|
|
7
|
-
</thead>
|
|
8
|
-
</TableHeadContext.Provider>);
|
|
9
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Text from "../Text";
|
|
2
|
-
import Stack from "../Stack";
|
|
3
|
-
export default function TableHeader({ title, subtitle, children, }) {
|
|
4
|
-
return (<div className="px-4 md:px-0">
|
|
5
|
-
<div className="sm:flex sm:items-center">
|
|
6
|
-
{(title || subtitle) && (<Stack className="sm:flex-auto">
|
|
7
|
-
{title && (<Text variant="label" size="lg">
|
|
8
|
-
{title}
|
|
9
|
-
</Text>)}
|
|
10
|
-
{subtitle && <Text variant="secondary">{subtitle}</Text>}
|
|
11
|
-
</Stack>)}
|
|
12
|
-
{children && (<div className="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">{children}</div>)}
|
|
13
|
-
</div>
|
|
14
|
-
</div>);
|
|
15
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MouseEventHandler, ReactNode } from "react";
|
|
2
|
-
export type TableRowProps = {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
onClick?: MouseEventHandler<HTMLTableRowElement>;
|
|
5
|
-
className?: string;
|
|
6
|
-
};
|
|
7
|
-
declare function TableRow({ children, onClick, className, ...props }: TableRowProps): import("react").JSX.Element;
|
|
8
|
-
export default TableRow;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import clsx from "../../utils/clsx";
|
|
2
|
-
function TableRow({ children, onClick, className, ...props }) {
|
|
3
|
-
return (<tr onClick={onClick} className={clsx({
|
|
4
|
-
"group/row cursor-pointer hover:bg-black/5 dark:hover:bg-white/5": !!onClick,
|
|
5
|
-
}, className)} {...props}>
|
|
6
|
-
{children}
|
|
7
|
-
</tr>);
|
|
8
|
-
}
|
|
9
|
-
export default TableRow;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { type ButtonProps } from "../Button";
|
|
3
|
-
export default function Tabs({ children, className, }: {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
}): import("react").JSX.Element;
|
|
7
|
-
export declare function Tab({ children, selected, onClick, className, ...props }: Omit<ButtonProps, "variant"> & {
|
|
8
|
-
selected?: boolean;
|
|
9
|
-
}): import("react").JSX.Element;
|
package/components/Tabs/Tabs.jsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import clsx from "../../utils/clsx";
|
|
2
|
-
import Button, {} from "../Button";
|
|
3
|
-
export default function Tabs({ children, className, }) {
|
|
4
|
-
return <div className={clsx("ui-tabs", className)}>{children}</div>;
|
|
5
|
-
}
|
|
6
|
-
export function Tab({ children, selected, onClick, className, ...props }) {
|
|
7
|
-
return (<div className="relative">
|
|
8
|
-
<Button className={clsx("ui-tabs-tab", className)} data-selected={selected ? "" : undefined} onClick={onClick} variant="custom" {...props}>
|
|
9
|
-
{children}
|
|
10
|
-
</Button>
|
|
11
|
-
{selected && <div className="ui-tabs-indicator"/>}
|
|
12
|
-
</div>);
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Tab represents an individual tab. When active,
|
|
4
|
-
* it renders an animated rounded background using the latest motion package.
|
|
5
|
-
*/
|
|
6
|
-
export default function Tab({ active, onClick, children, className, id, variant, cursorClassName, }: {
|
|
7
|
-
value: string;
|
|
8
|
-
active?: boolean;
|
|
9
|
-
onClick?: () => void;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
className?: string;
|
|
12
|
-
id?: string;
|
|
13
|
-
variant?: "filled" | "outlined";
|
|
14
|
-
cursorClassName?: string;
|
|
15
|
-
}): import("react").JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { motion } from "motion/react";
|
|
2
|
-
import Button from "../Button";
|
|
3
|
-
import clsx from "../../utils/clsx";
|
|
4
|
-
/**
|
|
5
|
-
* Tab represents an individual tab. When active,
|
|
6
|
-
* it renders an animated rounded background using the latest motion package.
|
|
7
|
-
*/
|
|
8
|
-
export default function Tab({ active, onClick, children, className, id, variant, cursorClassName, }) {
|
|
9
|
-
return (<Button onClick={onClick} className={clsx("relative", {
|
|
10
|
-
"text-white": active && variant === "filled",
|
|
11
|
-
}, className)} variant="text" rounded={variant === "filled"}>
|
|
12
|
-
{active && (<motion.div layoutId={id} className={clsx("bg-primary-500 absolute", {
|
|
13
|
-
"inset-0 rounded-full": variant === "filled",
|
|
14
|
-
"right-0 bottom-0 left-0 h-0.5": variant === "outlined",
|
|
15
|
-
}, cursorClassName)} transition={{ type: "spring", stiffness: 500, damping: 30 }}/>)}
|
|
16
|
-
<span className="relative z-10">{children}</span>
|
|
17
|
-
</Button>);
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
2
|
-
type TabElement = ReactElement<{
|
|
3
|
-
value: string;
|
|
4
|
-
active?: boolean;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
id?: string;
|
|
7
|
-
variant?: "filled" | "outlined";
|
|
8
|
-
className?: string;
|
|
9
|
-
cursorClassName?: string;
|
|
10
|
-
}>;
|
|
11
|
-
export default function TabsSwitcher({ value, onChange, children, overflowHidden, className, variant, tabClassName, cursorClassName, tabsClassName, }: {
|
|
12
|
-
value?: string;
|
|
13
|
-
onChange?: (value: string) => void;
|
|
14
|
-
children: TabElement | TabElement[];
|
|
15
|
-
overflowHidden?: boolean;
|
|
16
|
-
className?: string;
|
|
17
|
-
variant?: "filled" | "outlined";
|
|
18
|
-
tabClassName?: string;
|
|
19
|
-
cursorClassName?: string;
|
|
20
|
-
tabsClassName?: string;
|
|
21
|
-
}): import("react").JSX.Element;
|
|
22
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Children, cloneElement, isValidElement, useId, } from "react";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
export default function TabsSwitcher({ value, onChange, children, overflowHidden, className, variant = "filled", tabClassName, cursorClassName, tabsClassName, }) {
|
|
4
|
-
const id = useId();
|
|
5
|
-
return (<div className={clsx({
|
|
6
|
-
"rounded-full bg-zinc-200 p-1 dark:bg-zinc-900": variant === "filled",
|
|
7
|
-
}, className)}>
|
|
8
|
-
<div className={clsx({
|
|
9
|
-
"rounded-full": variant === "filled",
|
|
10
|
-
"overflow-hidden": overflowHidden,
|
|
11
|
-
})}>
|
|
12
|
-
<div className={clsx("relative flex", tabsClassName)}>
|
|
13
|
-
{Children.map(children, (child) => {
|
|
14
|
-
if (isValidElement(child)) {
|
|
15
|
-
const childValue = child.props.value;
|
|
16
|
-
const isActive = childValue === value;
|
|
17
|
-
return cloneElement(child, {
|
|
18
|
-
active: isActive,
|
|
19
|
-
onClick: () => onChange?.(childValue),
|
|
20
|
-
id,
|
|
21
|
-
variant,
|
|
22
|
-
className: tabClassName,
|
|
23
|
-
cursorClassName,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return child;
|
|
27
|
-
})}
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>);
|
|
31
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, DetailedHTMLProps, HTMLAttributes } from "react";
|
|
2
|
-
import NextLink from "next/link";
|
|
3
|
-
export declare const defaultTextStyles: {
|
|
4
|
-
variant: {
|
|
5
|
-
default: string;
|
|
6
|
-
label: string;
|
|
7
|
-
secondary: string;
|
|
8
|
-
};
|
|
9
|
-
size: {
|
|
10
|
-
xs: string;
|
|
11
|
-
sm: string;
|
|
12
|
-
base: string;
|
|
13
|
-
lg: string;
|
|
14
|
-
xl: string;
|
|
15
|
-
"2xl": string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type TextProps = {
|
|
19
|
-
variant?: keyof (typeof defaultTextStyles)["variant"] | "link";
|
|
20
|
-
size?: keyof (typeof defaultTextStyles)["size"];
|
|
21
|
-
inline?: boolean;
|
|
22
|
-
} & Partial<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> & ComponentProps<typeof NextLink>>;
|
|
23
|
-
declare function Text({ inline, variant, className, href, target, size, ...props }: TextProps): import("react").JSX.Element;
|
|
24
|
-
export default Text;
|
package/components/Text/Text.jsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import clsx from "../../utils/clsx";
|
|
2
|
-
import NextLink from "next/link";
|
|
3
|
-
import Link from "../Link";
|
|
4
|
-
export const defaultTextStyles = {
|
|
5
|
-
variant: {
|
|
6
|
-
default: "text-zinc-700 dark:text-zinc-200",
|
|
7
|
-
label: "text-zinc-800 font-medium dark:text-zinc-100",
|
|
8
|
-
secondary: "text-sm text-zinc-500 dark:text-zinc-400",
|
|
9
|
-
},
|
|
10
|
-
size: {
|
|
11
|
-
xs: "text-xs",
|
|
12
|
-
sm: "text-sm",
|
|
13
|
-
base: "text-base",
|
|
14
|
-
lg: "text-lg",
|
|
15
|
-
xl: "text-xl",
|
|
16
|
-
"2xl": "text-2xl",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
function Text({ inline, variant = "default", className, href, target, size = variant !== "label" ? "base" : "sm", ...props }) {
|
|
20
|
-
if (href || variant === "link") {
|
|
21
|
-
return (<Link href={href} target={target} {...props} className={className}/>);
|
|
22
|
-
}
|
|
23
|
-
className = clsx(defaultTextStyles.variant[variant], defaultTextStyles.size[size], className);
|
|
24
|
-
if (inline) {
|
|
25
|
-
return <span {...props} className={className}/>;
|
|
26
|
-
}
|
|
27
|
-
return <div {...props} className={className}/>;
|
|
28
|
-
}
|
|
29
|
-
export default Text;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type InputProps } from "../Input";
|
|
2
|
-
import type { TextareaAutosizeProps } from "react-textarea-autosize";
|
|
3
|
-
export type TextareaProps = InputProps<false> & Partial<Pick<TextareaAutosizeProps, "maxRows" | "minRows" | "onHeightChange" | "cacheMeasurements">>;
|
|
4
|
-
declare function Textarea(props: TextareaProps): import("react").JSX.Element;
|
|
5
|
-
export default Textarea;
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import { Renderer, Program, Mesh, Triangle, Color } from "ogl";
|
|
3
|
-
const vertexShader = `
|
|
4
|
-
attribute vec2 position;
|
|
5
|
-
attribute vec2 uv;
|
|
6
|
-
varying vec2 vUv;
|
|
7
|
-
void main() {
|
|
8
|
-
vUv = uv;
|
|
9
|
-
gl_Position = vec4(position, 0.0, 1.0);
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
const fragmentShader = `
|
|
13
|
-
precision highp float;
|
|
14
|
-
|
|
15
|
-
uniform float iTime;
|
|
16
|
-
uniform vec3 iResolution;
|
|
17
|
-
uniform vec3 uColor;
|
|
18
|
-
uniform float uAmplitude;
|
|
19
|
-
uniform float uDistance;
|
|
20
|
-
uniform vec2 uMouse;
|
|
21
|
-
|
|
22
|
-
#define PI 3.1415926538
|
|
23
|
-
|
|
24
|
-
const int u_line_count = 40;
|
|
25
|
-
const float u_line_width = 7.0;
|
|
26
|
-
const float u_line_blur = 10.0;
|
|
27
|
-
|
|
28
|
-
float Perlin2D(vec2 P) {
|
|
29
|
-
vec2 Pi = floor(P);
|
|
30
|
-
vec4 Pf_Pfmin1 = P.xyxy - vec4(Pi, Pi + 1.0);
|
|
31
|
-
vec4 Pt = vec4(Pi.xy, Pi.xy + 1.0);
|
|
32
|
-
Pt = Pt - floor(Pt * (1.0 / 71.0)) * 71.0;
|
|
33
|
-
Pt += vec2(26.0, 161.0).xyxy;
|
|
34
|
-
Pt *= Pt;
|
|
35
|
-
Pt = Pt.xzxz * Pt.yyww;
|
|
36
|
-
vec4 hash_x = fract(Pt * (1.0 / 951.135664));
|
|
37
|
-
vec4 hash_y = fract(Pt * (1.0 / 642.949883));
|
|
38
|
-
vec4 grad_x = hash_x - 0.49999;
|
|
39
|
-
vec4 grad_y = hash_y - 0.49999;
|
|
40
|
-
vec4 grad_results = inversesqrt(grad_x * grad_x + grad_y * grad_y)
|
|
41
|
-
* (grad_x * Pf_Pfmin1.xzxz + grad_y * Pf_Pfmin1.yyww);
|
|
42
|
-
grad_results *= 1.4142135623730950;
|
|
43
|
-
vec2 blend = Pf_Pfmin1.xy * Pf_Pfmin1.xy * Pf_Pfmin1.xy
|
|
44
|
-
* (Pf_Pfmin1.xy * (Pf_Pfmin1.xy * 6.0 - 15.0) + 10.0);
|
|
45
|
-
vec4 blend2 = vec4(blend, vec2(1.0 - blend));
|
|
46
|
-
return dot(grad_results, blend2.zxzx * blend2.wwyy);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
float pixel(float count, vec2 resolution) {
|
|
50
|
-
return (1.0 / max(resolution.x, resolution.y)) * count;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
float lineFn(vec2 st, float width, float perc, float offset, vec2 mouse, float time, float amplitude, float distance) {
|
|
54
|
-
float split_offset = (perc * 0.4);
|
|
55
|
-
float split_point = 0.1 + split_offset;
|
|
56
|
-
|
|
57
|
-
float amplitude_normal = smoothstep(split_point, 0.7, st.x);
|
|
58
|
-
float amplitude_strength = 0.5;
|
|
59
|
-
float finalAmplitude = amplitude_normal * amplitude_strength
|
|
60
|
-
* amplitude * (1.0 + (mouse.y - 0.5) * 0.2);
|
|
61
|
-
|
|
62
|
-
float time_scaled = time / 10.0 + (mouse.x - 0.5) * 1.0;
|
|
63
|
-
float blur = smoothstep(split_point, split_point + 0.05, st.x) * perc;
|
|
64
|
-
|
|
65
|
-
float xnoise = mix(
|
|
66
|
-
Perlin2D(vec2(time_scaled, st.x + perc) * 2.5),
|
|
67
|
-
Perlin2D(vec2(time_scaled, st.x + time_scaled) * 3.5) / 1.5,
|
|
68
|
-
st.x * 0.3
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
float y = 0.5 + (perc - 0.5) * distance + xnoise / 2.0 * finalAmplitude;
|
|
72
|
-
|
|
73
|
-
float line_start = smoothstep(
|
|
74
|
-
y + (width / 2.0) + (u_line_blur * pixel(1.0, iResolution.xy) * blur),
|
|
75
|
-
y,
|
|
76
|
-
st.y
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
float line_end = smoothstep(
|
|
80
|
-
y,
|
|
81
|
-
y - (width / 2.0) - (u_line_blur * pixel(1.0, iResolution.xy) * blur),
|
|
82
|
-
st.y
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
return clamp(
|
|
86
|
-
(line_start - line_end) * (1.0 - smoothstep(0.0, 1.0, pow(perc, 0.3))),
|
|
87
|
-
0.0,
|
|
88
|
-
1.0
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
93
|
-
vec2 uv = fragCoord / iResolution.xy;
|
|
94
|
-
|
|
95
|
-
float line_strength = 1.0;
|
|
96
|
-
for (int i = 0; i < u_line_count; i++) {
|
|
97
|
-
float p = float(i) / float(u_line_count);
|
|
98
|
-
line_strength *= (1.0 - lineFn(
|
|
99
|
-
uv,
|
|
100
|
-
u_line_width * pixel(1.0, iResolution.xy) * (1.0 - p),
|
|
101
|
-
p,
|
|
102
|
-
(PI * 1.0) * p,
|
|
103
|
-
uMouse,
|
|
104
|
-
iTime,
|
|
105
|
-
uAmplitude,
|
|
106
|
-
uDistance
|
|
107
|
-
));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
float colorVal = 1.0 - line_strength;
|
|
111
|
-
fragColor = vec4(uColor * colorVal, colorVal);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
void main() {
|
|
115
|
-
mainImage(gl_FragColor, gl_FragCoord.xy);
|
|
116
|
-
}
|
|
117
|
-
`;
|
|
118
|
-
const Threads = ({ color = [1, 1, 1], amplitude = 1, distance = 0, enableMouseInteraction = false, ...rest }) => {
|
|
119
|
-
const containerRef = useRef(null);
|
|
120
|
-
const animationFrameId = useRef(undefined);
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
if (!containerRef.current)
|
|
123
|
-
return;
|
|
124
|
-
const container = containerRef.current;
|
|
125
|
-
const renderer = new Renderer({ alpha: true });
|
|
126
|
-
const gl = renderer.gl;
|
|
127
|
-
gl.clearColor(0, 0, 0, 0);
|
|
128
|
-
gl.enable(gl.BLEND);
|
|
129
|
-
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
130
|
-
container.appendChild(gl.canvas);
|
|
131
|
-
const geometry = new Triangle(gl);
|
|
132
|
-
const program = new Program(gl, {
|
|
133
|
-
vertex: vertexShader,
|
|
134
|
-
fragment: fragmentShader,
|
|
135
|
-
uniforms: {
|
|
136
|
-
iTime: { value: 0 },
|
|
137
|
-
iResolution: {
|
|
138
|
-
value: new Color(gl.canvas.width, gl.canvas.height, gl.canvas.width / gl.canvas.height),
|
|
139
|
-
},
|
|
140
|
-
uColor: { value: new Color(...color) },
|
|
141
|
-
uAmplitude: { value: amplitude },
|
|
142
|
-
uDistance: { value: distance },
|
|
143
|
-
uMouse: { value: new Float32Array([0.5, 0.5]) },
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
const mesh = new Mesh(gl, { geometry, program });
|
|
147
|
-
function resize() {
|
|
148
|
-
const { clientWidth, clientHeight } = container;
|
|
149
|
-
renderer.setSize(clientWidth, clientHeight);
|
|
150
|
-
program.uniforms.iResolution.value.r = clientWidth;
|
|
151
|
-
program.uniforms.iResolution.value.g = clientHeight;
|
|
152
|
-
program.uniforms.iResolution.value.b = clientWidth / clientHeight;
|
|
153
|
-
}
|
|
154
|
-
window.addEventListener("resize", resize);
|
|
155
|
-
resize();
|
|
156
|
-
const currentMouse = [0.5, 0.5];
|
|
157
|
-
let targetMouse = [0.5, 0.5];
|
|
158
|
-
function handleMouseMove(e) {
|
|
159
|
-
const rect = container.getBoundingClientRect();
|
|
160
|
-
const x = (e.clientX - rect.left) / rect.width;
|
|
161
|
-
const y = 1.0 - (e.clientY - rect.top) / rect.height;
|
|
162
|
-
targetMouse = [x, y];
|
|
163
|
-
}
|
|
164
|
-
function handleMouseLeave() {
|
|
165
|
-
targetMouse = [0.5, 0.5];
|
|
166
|
-
}
|
|
167
|
-
if (enableMouseInteraction) {
|
|
168
|
-
container.addEventListener("mousemove", handleMouseMove);
|
|
169
|
-
container.addEventListener("mouseleave", handleMouseLeave);
|
|
170
|
-
}
|
|
171
|
-
function update(t) {
|
|
172
|
-
if (enableMouseInteraction) {
|
|
173
|
-
const smoothing = 0.05;
|
|
174
|
-
currentMouse[0] += smoothing * (targetMouse[0] - currentMouse[0]);
|
|
175
|
-
currentMouse[1] += smoothing * (targetMouse[1] - currentMouse[1]);
|
|
176
|
-
program.uniforms.uMouse.value[0] = currentMouse[0];
|
|
177
|
-
program.uniforms.uMouse.value[1] = currentMouse[1];
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
program.uniforms.uMouse.value[0] = 0.5;
|
|
181
|
-
program.uniforms.uMouse.value[1] = 0.5;
|
|
182
|
-
}
|
|
183
|
-
program.uniforms.iTime.value = t * 0.001;
|
|
184
|
-
renderer.render({ scene: mesh });
|
|
185
|
-
animationFrameId.current = requestAnimationFrame(update);
|
|
186
|
-
}
|
|
187
|
-
animationFrameId.current = requestAnimationFrame(update);
|
|
188
|
-
return () => {
|
|
189
|
-
if (animationFrameId.current)
|
|
190
|
-
cancelAnimationFrame(animationFrameId.current);
|
|
191
|
-
window.removeEventListener("resize", resize);
|
|
192
|
-
if (enableMouseInteraction) {
|
|
193
|
-
container.removeEventListener("mousemove", handleMouseMove);
|
|
194
|
-
container.removeEventListener("mouseleave", handleMouseLeave);
|
|
195
|
-
}
|
|
196
|
-
if (container.contains(gl.canvas))
|
|
197
|
-
container.removeChild(gl.canvas);
|
|
198
|
-
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
|
199
|
-
};
|
|
200
|
-
}, [color, amplitude, distance, enableMouseInteraction]);
|
|
201
|
-
return (<div ref={containerRef} className="relative h-full w-full" {...rest}/>);
|
|
202
|
-
};
|
|
203
|
-
export default Threads;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, Ref } from "react";
|
|
2
|
-
declare function Tooltip({ children, content, side, delayDuration, className, arrowClassName, ref, }: {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
content?: ReactNode;
|
|
5
|
-
side?: "top" | "bottom" | "left" | "right";
|
|
6
|
-
delayDuration?: number;
|
|
7
|
-
className?: string;
|
|
8
|
-
arrowClassName?: string;
|
|
9
|
-
ref?: Ref<HTMLButtonElement>;
|
|
10
|
-
}): import("react").JSX.Element;
|
|
11
|
-
export default Tooltip;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as RTooltip from "@radix-ui/react-tooltip";
|
|
2
|
-
import clsx from "../../utils/clsx";
|
|
3
|
-
function Tooltip({ children, content, side, delayDuration, className, arrowClassName, ref, }) {
|
|
4
|
-
if (!content) {
|
|
5
|
-
return <>{children}</>;
|
|
6
|
-
}
|
|
7
|
-
return (<RTooltip.Provider>
|
|
8
|
-
<RTooltip.Root delayDuration={delayDuration}>
|
|
9
|
-
<RTooltip.Trigger asChild ref={ref}>
|
|
10
|
-
{children}
|
|
11
|
-
</RTooltip.Trigger>
|
|
12
|
-
<RTooltip.Portal>
|
|
13
|
-
<RTooltip.Content className={clsx("z-20 rounded-sm bg-zinc-950 px-2 py-1 text-center text-sm text-zinc-50 shadow-sm", "dark:bg-zinc-50 dark:text-zinc-950", "data-[state=closed]:animate-fade-out data-[state=delayed-open]:data-[side=bottom]:animate-elastic-slide-up-and-fade data-[state=delayed-open]:data-[side=left]:animate-elastic-slide-right-and-fade data-[state=delayed-open]:data-[side=right]:animate-elastic-slide-left-and-fade data-[state=delayed-open]:data-[side=top]:animate-elastic-slide-down-and-fade will-change-[transform,opacity]", className)} sideOffset={5} side={side}>
|
|
14
|
-
{content}
|
|
15
|
-
<RTooltip.Arrow className={clsx("fill-zinc-950 dark:fill-zinc-50", arrowClassName)}/>
|
|
16
|
-
</RTooltip.Content>
|
|
17
|
-
</RTooltip.Portal>
|
|
18
|
-
</RTooltip.Root>
|
|
19
|
-
</RTooltip.Provider>);
|
|
20
|
-
}
|
|
21
|
-
export default Tooltip;
|