@oneplatformdev/ui 0.0.1-beta.99 → 0.1.2-1
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/README.md +4 -30
- package/package.json +35 -92
- package/src/globals.css +123 -0
- package/Accordion/Accordion.d.ts +0 -9
- package/Accordion/Accordion.mjs +0 -49
- package/Accordion/index.d.ts +0 -1
- package/Accordion/index.mjs +0 -7
- package/Accordion/package.json +0 -7
- package/Alert/Alert.d.ts +0 -7
- package/Alert/Alert.mjs +0 -37
- package/Alert/alertVariants.d.ts +0 -4
- package/Alert/alertVariants.mjs +0 -19
- package/Alert/index.d.ts +0 -1
- package/Alert/index.mjs +0 -6
- package/Alert/package.json +0 -7
- package/AlertDialog/AlertDialog.d.ts +0 -65
- package/AlertDialog/AlertDialog.mjs +0 -97
- package/AlertDialog/AlertDialog.types.d.ts +0 -53
- package/AlertDialog/AlertDialogRoot.d.ts +0 -21
- package/AlertDialog/AlertDialogRoot.mjs +0 -114
- package/AlertDialog/index.d.ts +0 -3
- package/AlertDialog/index.mjs +0 -16
- package/AlertDialog/package.json +0 -7
- package/AreaChart/AreaChart.d.ts +0 -4
- package/AreaChart/AreaChart.mjs +0 -27
- package/AreaChart/AreaChart.types.d.ts +0 -15
- package/AreaChart/index.d.ts +0 -2
- package/AreaChart/index.mjs +0 -4
- package/AreaChart/package.json +0 -7
- package/Aside/Aside.d.ts +0 -4
- package/Aside/Aside.mjs +0 -23
- package/Aside/Aside.types.d.ts +0 -18
- package/Aside/AsideSidebar.d.ts +0 -3
- package/Aside/AsideSidebar.mjs +0 -37
- package/Aside/index.d.ts +0 -3
- package/Aside/index.mjs +0 -7
- package/Aside/package.json +0 -7
- package/AspectRatio/AspectRatio.d.ts +0 -2
- package/AspectRatio/AspectRatio.mjs +0 -5
- package/AspectRatio/index.d.ts +0 -1
- package/AspectRatio/index.mjs +0 -5
- package/AspectRatio/package.json +0 -7
- package/Avatar/Avatar.d.ts +0 -5
- package/Avatar/Avatar.mjs +0 -42
- package/Avatar/index.d.ts +0 -1
- package/Avatar/index.mjs +0 -6
- package/Avatar/package.json +0 -7
- package/Badge/Badge.d.ts +0 -5
- package/Badge/Badge.mjs +0 -10
- package/Badge/Badge.types.d.ts +0 -5
- package/Badge/badgeVariants.d.ts +0 -3
- package/Badge/badgeVariants.mjs +0 -20
- package/Badge/index.d.ts +0 -3
- package/Badge/index.mjs +0 -6
- package/Badge/package.json +0 -7
- package/Breadcrumb/Breadcrumb.d.ts +0 -19
- package/Breadcrumb/Breadcrumb.mjs +0 -90
- package/Breadcrumb/index.d.ts +0 -1
- package/Breadcrumb/index.mjs +0 -10
- package/Breadcrumb/package.json +0 -7
- package/Button/Button.d.ts +0 -4
- package/Button/Button.mjs +0 -32
- package/Button/Button.types.d.ts +0 -8
- package/Button/buttonVariants.d.ts +0 -4
- package/Button/buttonVariants.mjs +0 -29
- package/Button/index.d.ts +0 -3
- package/Button/index.mjs +0 -7
- package/Button/package.json +0 -7
- package/ButtonIcon/ButtonIcon.d.ts +0 -3
- package/ButtonIcon/ButtonIcon.mjs +0 -29
- package/ButtonIcon/ButtonIcon.types.d.ts +0 -7
- package/ButtonIcon/buttonIconVariants.d.ts +0 -7
- package/ButtonIcon/buttonIconVariants.mjs +0 -139
- package/ButtonIcon/index.d.ts +0 -3
- package/ButtonIcon/index.mjs +0 -7
- package/ButtonIcon/package.json +0 -7
- package/Calendar/Calendar.d.ts +0 -8
- package/Calendar/Calendar.mjs +0 -64
- package/Calendar/index.d.ts +0 -1
- package/Calendar/index.mjs +0 -4
- package/Calendar/package.json +0 -7
- package/Card/Card.d.ts +0 -8
- package/Card/Card.mjs +0 -61
- package/Card/index.d.ts +0 -1
- package/Card/index.mjs +0 -9
- package/Card/package.json +0 -7
- package/Carousel/Carousel.d.ts +0 -18
- package/Carousel/Carousel.mjs +0 -168
- package/Carousel/index.d.ts +0 -1
- package/Carousel/index.mjs +0 -8
- package/Carousel/package.json +0 -7
- package/Chart/Chart.d.ts +0 -62
- package/Chart/Chart.mjs +0 -210
- package/Chart/index.d.ts +0 -1
- package/Chart/index.mjs +0 -9
- package/Chart/package.json +0 -7
- package/Checkbox/Checkbox.d.ts +0 -5
- package/Checkbox/Checkbox.mjs +0 -54
- package/Checkbox/Checkbox.types.d.ts +0 -10
- package/Checkbox/index.d.ts +0 -2
- package/Checkbox/index.mjs +0 -5
- package/Checkbox/package.json +0 -7
- package/Collapsible/Collapsible.d.ts +0 -5
- package/Collapsible/Collapsible.mjs +0 -7
- package/Collapsible/index.d.ts +0 -1
- package/Collapsible/index.mjs +0 -6
- package/Collapsible/package.json +0 -7
- package/Combobox/Combobox.d.ts +0 -4
- package/Combobox/Combobox.mjs +0 -15
- package/Combobox/Combobox.types.d.ts +0 -38
- package/Combobox/ComboboxOptionItem.d.ts +0 -5
- package/Combobox/ComboboxOptionItem.mjs +0 -67
- package/Combobox/ComboboxOptions.d.ts +0 -4
- package/Combobox/ComboboxOptions.mjs +0 -12
- package/Combobox/index.d.ts +0 -2
- package/Combobox/index.mjs +0 -4
- package/Combobox/package.json +0 -7
- package/Combobox-Dfbnw0oF.js +0 -303
- package/Command/Command.d.ts +0 -80
- package/Command/Command.mjs +0 -116
- package/Command/index.d.ts +0 -1
- package/Command/index.mjs +0 -12
- package/Command/package.json +0 -7
- package/DataTable/DataTable.d.ts +0 -11
- package/DataTable/DataTable.mjs +0 -64
- package/DataTable/DataTable.types.d.ts +0 -11
- package/DataTable/DataTableColumnFilter.d.ts +0 -4
- package/DataTable/DataTableColumnFilter.mjs +0 -31
- package/DataTable/index.d.ts +0 -2
- package/DataTable/index.mjs +0 -4
- package/DataTable/package.json +0 -7
- package/DataTable/useDataTable.d.ts +0 -3
- package/DataTable/useDataTable.mjs +0 -30
- package/DatePicker/DatePicker.d.ts +0 -3
- package/DatePicker/DatePicker.mjs +0 -699
- package/DatePicker/DatePicker.types.d.ts +0 -5
- package/DatePicker/index.d.ts +0 -3
- package/DatePicker/index.mjs +0 -5
- package/DatePicker/package.json +0 -7
- package/Dialog/Dialog.d.ts +0 -21
- package/Dialog/Dialog.mjs +0 -117
- package/Dialog/index.d.ts +0 -1
- package/Dialog/index.mjs +0 -13
- package/Dialog/package.json +0 -7
- package/Drawer/Drawer.d.ts +0 -22
- package/Drawer/Drawer.mjs +0 -98
- package/Drawer/index.d.ts +0 -1
- package/Drawer/index.mjs +0 -13
- package/Drawer/package.json +0 -7
- package/DropdownMenu/DropdownMenu.d.ts +0 -27
- package/DropdownMenu/DropdownMenu.mjs +0 -148
- package/DropdownMenu/index.d.ts +0 -1
- package/DropdownMenu/index.mjs +0 -18
- package/DropdownMenu/package.json +0 -7
- package/Dropzone/Dropzone.d.ts +0 -22
- package/Dropzone/Dropzone.mjs +0 -152
- package/Dropzone/Dropzone.types.d.ts +0 -42
- package/Dropzone/DropzoneFilePreview.d.ts +0 -4
- package/Dropzone/DropzoneFilePreview.mjs +0 -9
- package/Dropzone/DropzoneSinglePickPreview.d.ts +0 -10
- package/Dropzone/DropzoneSinglePickPreview.mjs +0 -41
- package/Dropzone/DropzoneUtils.d.ts +0 -5
- package/Dropzone/DropzoneUtils.mjs +0 -24
- package/Dropzone/index.d.ts +0 -2
- package/Dropzone/index.mjs +0 -7
- package/Dropzone/package.json +0 -7
- package/DropzoneFilePreview-Dhtv8F4u.js +0 -67
- package/Form/Form.d.ts +0 -23
- package/Form/Form.mjs +0 -98
- package/Form/FormRenderControl.d.ts +0 -4
- package/Form/FormRenderControl.mjs +0 -21
- package/Form/FormRenderControl.types.d.ts +0 -16
- package/Form/index.d.ts +0 -3
- package/Form/index.mjs +0 -13
- package/Form/package.json +0 -7
- package/FormCheckbox/FormCheckbox.d.ts +0 -4
- package/FormCheckbox/FormCheckbox.mjs +0 -30
- package/FormCheckbox/FormCheckbox.types.d.ts +0 -7
- package/FormCheckbox/index.d.ts +0 -2
- package/FormCheckbox/index.mjs +0 -4
- package/FormCheckbox/package.json +0 -7
- package/FormCombobox/FormCombobox.d.ts +0 -4
- package/FormCombobox/FormCombobox.mjs +0 -26
- package/FormCombobox/FormCombobox.types.d.ts +0 -6
- package/FormCombobox/index.d.ts +0 -2
- package/FormCombobox/index.mjs +0 -4
- package/FormCombobox/package.json +0 -7
- package/FormDatePicker/FormDatePicker.d.ts +0 -4
- package/FormDatePicker/FormDatePicker.mjs +0 -29
- package/FormDatePicker/FormDatePicker.types.d.ts +0 -6
- package/FormDatePicker/index.d.ts +0 -3
- package/FormDatePicker/index.mjs +0 -5
- package/FormDatePicker/package.json +0 -7
- package/FormDropzone/FormDropzone.d.ts +0 -4
- package/FormDropzone/FormDropzone.mjs +0 -19
- package/FormDropzone/FormDropzone.types.d.ts +0 -6
- package/FormDropzone/index.d.ts +0 -2
- package/FormDropzone/index.mjs +0 -4
- package/FormDropzone/package.json +0 -7
- package/FormInput/FormInput.d.ts +0 -7
- package/FormInput/FormInput.mjs +0 -40
- package/FormInput/FormInput.types.d.ts +0 -6
- package/FormInput/index.d.ts +0 -2
- package/FormInput/index.mjs +0 -4
- package/FormInput/package.json +0 -7
- package/FormRadio/FormRadio.d.ts +0 -4
- package/FormRadio/FormRadio.mjs +0 -40
- package/FormRadio/FormRadio.types.d.ts +0 -6
- package/FormRadio/index.d.ts +0 -2
- package/FormRadio/index.mjs +0 -4
- package/FormRadio/package.json +0 -7
- package/FormSelect/FormSelect.d.ts +0 -4
- package/FormSelect/FormSelect.mjs +0 -40
- package/FormSelect/FormSelect.types.d.ts +0 -6
- package/FormSelect/index.d.ts +0 -2
- package/FormSelect/index.mjs +0 -4
- package/FormSelect/package.json +0 -7
- package/FormTextarea/FormTextarea.d.ts +0 -4
- package/FormTextarea/FormTextarea.mjs +0 -27
- package/FormTextarea/FormTextarea.types.d.ts +0 -6
- package/FormTextarea/index.d.ts +0 -2
- package/FormTextarea/index.mjs +0 -4
- package/FormTextarea/package.json +0 -7
- package/Header/Header.d.ts +0 -4
- package/Header/Header.mjs +0 -26
- package/Header/Header.types.d.ts +0 -3
- package/Header/index.d.ts +0 -2
- package/Header/index.mjs +0 -5
- package/Header/package.json +0 -7
- package/HoverCard/HoverCard.d.ts +0 -6
- package/HoverCard/HoverCard.mjs +0 -23
- package/HoverCard/index.d.ts +0 -1
- package/HoverCard/index.mjs +0 -6
- package/HoverCard/package.json +0 -7
- package/Input/Input.d.ts +0 -6
- package/Input/Input.mjs +0 -73
- package/Input/Input.types.d.ts +0 -17
- package/Input/index.d.ts +0 -3
- package/Input/index.mjs +0 -7
- package/Input/inputVariants.d.ts +0 -3
- package/Input/inputVariants.mjs +0 -24
- package/Input/package.json +0 -7
- package/InputOTP/InputOTP.d.ts +0 -34
- package/InputOTP/InputOTP.mjs +0 -48
- package/InputOTP/index.d.ts +0 -1
- package/InputOTP/index.mjs +0 -7
- package/InputOTP/package.json +0 -7
- package/Label/Label.d.ts +0 -5
- package/Label/Label.mjs +0 -17
- package/Label/index.d.ts +0 -2
- package/Label/index.mjs +0 -6
- package/Label/labelVariants.d.ts +0 -1
- package/Label/labelVariants.mjs +0 -10
- package/Label/package.json +0 -7
- package/LazyLoader/LazyLoader.d.ts +0 -20
- package/LazyLoader/LazyLoader.mjs +0 -8
- package/LazyLoader/index.d.ts +0 -1
- package/LazyLoader/index.mjs +0 -5
- package/LazyLoader/package.json +0 -7
- package/LoadingMask/LoadingMask.d.ts +0 -4
- package/LoadingMask/LoadingMask.mjs +0 -21
- package/LoadingMask/LoadingMask.types.d.ts +0 -5
- package/LoadingMask/RenderLoadingMask.d.ts +0 -3
- package/LoadingMask/RenderLoadingMask.mjs +0 -108
- package/LoadingMask/index.d.ts +0 -3
- package/LoadingMask/index.mjs +0 -6
- package/LoadingMask/package.json +0 -7
- package/LoadingProgress/LoadingProgress.d.ts +0 -4
- package/LoadingProgress/LoadingProgress.mjs +0 -37
- package/LoadingProgress/LoadingProgress.types.d.ts +0 -8
- package/LoadingProgress/index.d.ts +0 -3
- package/LoadingProgress/index.mjs +0 -6
- package/LoadingProgress/loadingProgressVariants.d.ts +0 -4
- package/LoadingProgress/loadingProgressVariants.mjs +0 -24
- package/LoadingProgress/package.json +0 -7
- package/Menubar/Menubar.d.ts +0 -28
- package/Menubar/Menubar.mjs +0 -175
- package/Menubar/index.d.ts +0 -1
- package/Menubar/index.mjs +0 -19
- package/Menubar/package.json +0 -7
- package/NavigationMenu/NavigationMenu.d.ts +0 -11
- package/NavigationMenu/NavigationMenu.mjs +0 -101
- package/NavigationMenu/index.d.ts +0 -2
- package/NavigationMenu/index.mjs +0 -13
- package/NavigationMenu/navigationMenuVariants.d.ts +0 -1
- package/NavigationMenu/navigationMenuVariants.mjs +0 -7
- package/NavigationMenu/package.json +0 -7
- package/Pagination/Pagination.d.ts +0 -28
- package/Pagination/Pagination.mjs +0 -106
- package/Pagination/index.d.ts +0 -1
- package/Pagination/index.mjs +0 -10
- package/Pagination/package.json +0 -7
- package/Popover/Popover.d.ts +0 -7
- package/Popover/Popover.mjs +0 -28
- package/Popover/index.d.ts +0 -1
- package/Popover/index.mjs +0 -7
- package/Popover/package.json +0 -7
- package/Progress/Progress.d.ts +0 -4
- package/Progress/Progress.mjs +0 -26
- package/Progress/index.d.ts +0 -1
- package/Progress/index.mjs +0 -4
- package/Progress/package.json +0 -7
- package/Radio/Radio.d.ts +0 -4
- package/Radio/Radio.mjs +0 -12
- package/Radio/Radio.types.d.ts +0 -11
- package/Radio/index.d.ts +0 -2
- package/Radio/index.mjs +0 -4
- package/Radio/package.json +0 -7
- package/RadioGroup/RadioGroup.d.ts +0 -11
- package/RadioGroup/RadioGroup.mjs +0 -49
- package/RadioGroup/index.d.ts +0 -1
- package/RadioGroup/index.mjs +0 -6
- package/RadioGroup/package.json +0 -7
- package/Resizable/Resizable.d.ts +0 -23
- package/Resizable/Resizable.mjs +0 -36
- package/Resizable/index.d.ts +0 -1
- package/Resizable/index.mjs +0 -6
- package/Resizable/package.json +0 -7
- package/ScrollArea/ScrollArea.d.ts +0 -5
- package/ScrollArea/ScrollArea.mjs +0 -51
- package/ScrollArea/index.d.ts +0 -1
- package/ScrollArea/index.mjs +0 -5
- package/ScrollArea/package.json +0 -7
- package/Search/Search.d.ts +0 -4
- package/Search/Search.mjs +0 -30
- package/Search/Search.types.d.ts +0 -6
- package/Search/index.d.ts +0 -3
- package/Search/index.mjs +0 -5
- package/Search/package.json +0 -7
- package/Select/Select.d.ts +0 -3
- package/Select/Select.mjs +0 -103
- package/Select/Select.types.d.ts +0 -37
- package/Select/SelectRoot.d.ts +0 -13
- package/Select/SelectRoot.mjs +0 -126
- package/Select/index.d.ts +0 -3
- package/Select/index.mjs +0 -15
- package/Select/package.json +0 -7
- package/Separator/Separator.d.ts +0 -4
- package/Separator/Separator.mjs +0 -24
- package/Separator/index.d.ts +0 -1
- package/Separator/index.mjs +0 -4
- package/Separator/package.json +0 -7
- package/Sheet/Sheet.d.ts +0 -28
- package/Sheet/Sheet.mjs +0 -110
- package/Sheet/index.d.ts +0 -1
- package/Sheet/index.mjs +0 -13
- package/Sheet/package.json +0 -7
- package/Sidebar/Sidebar.d.ts +0 -66
- package/Sidebar/Sidebar.mjs +0 -543
- package/Sidebar/index.d.ts +0 -1
- package/Sidebar/index.mjs +0 -27
- package/Sidebar/package.json +0 -7
- package/Skeleton/Skeleton.d.ts +0 -4
- package/Skeleton/Skeleton.mjs +0 -17
- package/Skeleton/index.d.ts +0 -1
- package/Skeleton/index.mjs +0 -4
- package/Skeleton/package.json +0 -7
- package/Slider/Slider.d.ts +0 -4
- package/Slider/Slider.mjs +0 -23
- package/Slider/index.d.ts +0 -1
- package/Slider/index.mjs +0 -4
- package/Slider/package.json +0 -7
- package/Sonner/Sonner.d.ts +0 -5
- package/Sonner/Sonner.mjs +0 -25
- package/Sonner/index.d.ts +0 -1
- package/Sonner/index.mjs +0 -4
- package/Sonner/package.json +0 -7
- package/Switch/Switch.d.ts +0 -4
- package/Switch/Switch.mjs +0 -27
- package/Switch/index.d.ts +0 -1
- package/Switch/index.mjs +0 -4
- package/Switch/package.json +0 -7
- package/Table/Table.d.ts +0 -10
- package/Table/Table.mjs +0 -90
- package/Table/index.d.ts +0 -1
- package/Table/index.mjs +0 -11
- package/Table/package.json +0 -7
- package/TablePagination/TablePagination.d.ts +0 -16
- package/TablePagination/TablePagination.mjs +0 -74
- package/TablePagination/index.d.ts +0 -1
- package/TablePagination/index.mjs +0 -4
- package/TablePagination/package.json +0 -7
- package/Tabs/Tabs.d.ts +0 -5
- package/Tabs/Tabs.mjs +0 -23
- package/Tabs/Tabs.types.d.ts +0 -12
- package/Tabs/TabsRoot.d.ts +0 -7
- package/Tabs/TabsRoot.mjs +0 -46
- package/Tabs/index.d.ts +0 -2
- package/Tabs/index.mjs +0 -10
- package/Tabs/package.json +0 -7
- package/Textarea/Textarea.d.ts +0 -4
- package/Textarea/Textarea.mjs +0 -75
- package/Textarea/Textarea.types.d.ts +0 -18
- package/Textarea/index.d.ts +0 -2
- package/Textarea/index.mjs +0 -4
- package/Textarea/package.json +0 -7
- package/Textarea/useAutosizeTextArea.d.ts +0 -3
- package/Textarea/useAutosizeTextArea.mjs +0 -20
- package/Theme/ThemeModeToggle.d.ts +0 -8
- package/Theme/ThemeModeToggle.mjs +0 -48
- package/Theme/ThemeProvider.d.ts +0 -4
- package/Theme/ThemeProvider.mjs +0 -27
- package/Theme/index.d.ts +0 -2
- package/Theme/index.mjs +0 -6
- package/Theme/package.json +0 -7
- package/Toast/Toast.d.ts +0 -13
- package/Toast/Toast.mjs +0 -80
- package/Toast/Toast.types.d.ts +0 -34
- package/Toast/index.d.ts +0 -3
- package/Toast/index.mjs +0 -15
- package/Toast/package.json +0 -7
- package/Toast/toast.constants.d.ts +0 -6
- package/Toast/toast.constants.mjs +0 -9
- package/Toast/toastVariants.d.ts +0 -3
- package/Toast/toastVariants.mjs +0 -21
- package/Toast/useToast.d.ts +0 -16
- package/Toast/useToast.mjs +0 -101
- package/Toaster/Toaster.d.ts +0 -1
- package/Toaster/Toaster.mjs +0 -22
- package/Toaster/index.d.ts +0 -1
- package/Toaster/index.mjs +0 -4
- package/Toaster/package.json +0 -7
- package/Toggle/Toggle.d.ts +0 -12
- package/Toggle/Toggle.mjs +0 -37
- package/Toggle/index.d.ts +0 -1
- package/Toggle/index.mjs +0 -5
- package/Toggle/package.json +0 -7
- package/ToggleGroup/ToggleGroup.d.ts +0 -12
- package/ToggleGroup/ToggleGroup.mjs +0 -41
- package/ToggleGroup/index.d.ts +0 -1
- package/ToggleGroup/index.mjs +0 -5
- package/ToggleGroup/package.json +0 -7
- package/Tooltip/Tooltip.d.ts +0 -4
- package/Tooltip/Tooltip.mjs +0 -12
- package/Tooltip/Tooltip.types.d.ts +0 -8
- package/Tooltip/TooltipRoot.d.ts +0 -7
- package/Tooltip/TooltipRoot.mjs +0 -23
- package/Tooltip/index.d.ts +0 -3
- package/Tooltip/index.mjs +0 -9
- package/Tooltip/package.json +0 -7
- package/index.css +0 -1
- package/index.d.ts +0 -68
- package/index.mjs +0 -367
- package/tailwind.config.mjs +0 -148
package/Dropzone/Dropzone.mjs
DELETED
@@ -1,152 +0,0 @@
|
|
1
|
-
import { jsxs as r, jsx as i, Fragment as U } from "react/jsx-runtime";
|
2
|
-
import { X as j } from "lucide-react";
|
3
|
-
import { forwardRef as H, useState as w, useImperativeHandle as O } from "react";
|
4
|
-
import { useDropzone as X } from "react-dropzone";
|
5
|
-
import { cn as f } from "@oneplatformdev/utils";
|
6
|
-
import { Card as Y } from "../Card/Card.mjs";
|
7
|
-
import { F as q, D as G } from "../DropzoneFilePreview-Dhtv8F4u.js";
|
8
|
-
import { DropzoneSinglePickPreview as J } from "./DropzoneSinglePickPreview.mjs";
|
9
|
-
import { DefaultFileIcon as K, isFile as g, extractName as Q } from "./DropzoneUtils.mjs";
|
10
|
-
const R = H(
|
11
|
-
({
|
12
|
-
acceptTypes: y = G,
|
13
|
-
maxSizeMB: F,
|
14
|
-
maxFiles: v = 1,
|
15
|
-
onErrors: a,
|
16
|
-
hideErrors: D = !1,
|
17
|
-
disabled: p = !1,
|
18
|
-
classNames: o,
|
19
|
-
value: z = [],
|
20
|
-
onChangeValue: s,
|
21
|
-
className: I,
|
22
|
-
labelDropzonePrompt: E = "Drop files here or click to select",
|
23
|
-
labelDropzoneSubPrompt: b = "",
|
24
|
-
labelOrClickToSelect: Z = "Click to select files",
|
25
|
-
labelSelectedFiles: S = "Selected Files",
|
26
|
-
labelUploadErrors: N = "Upload Errors",
|
27
|
-
labelFileTooLarge: W = "File is too large",
|
28
|
-
labelInvalidFileType: k = "Invalid file type",
|
29
|
-
singlePick: c = !1,
|
30
|
-
...B
|
31
|
-
}, T) => {
|
32
|
-
const [n, x] = w(z), [m, _] = w([]), A = (e, l) => {
|
33
|
-
_(l), a == null || a(l);
|
34
|
-
const t = c ? e.slice(0, 1) : [...n, ...e].slice(0, v);
|
35
|
-
x(t), s == null || s(t);
|
36
|
-
}, u = (e, l) => {
|
37
|
-
if (p) return;
|
38
|
-
e.stopPropagation();
|
39
|
-
const t = n.filter((d, h) => h !== l);
|
40
|
-
x(t), s == null || s(t);
|
41
|
-
}, { getRootProps: L, getInputProps: M, isDragActive: P } = X({
|
42
|
-
onDrop: A,
|
43
|
-
accept: y.reduce((e, l) => (e[l] = [], e), {}),
|
44
|
-
maxSize: F * 1024 * 1024,
|
45
|
-
maxFiles: c ? 1 : v,
|
46
|
-
disabled: p
|
47
|
-
});
|
48
|
-
return O(T, () => ({
|
49
|
-
setItems: x
|
50
|
-
}), []), /* @__PURE__ */ r(
|
51
|
-
Y,
|
52
|
-
{
|
53
|
-
...L(),
|
54
|
-
...B,
|
55
|
-
className: f(
|
56
|
-
"border-dashed p-2 text-center flex flex-col items-center justify-center cursor-pointer",
|
57
|
-
p && "border-[#E4E4E7] pointer-events-none",
|
58
|
-
m.length > 0 ? "border-red-500" : "!border-[#E4E4E7]",
|
59
|
-
P && "bg-gray-100",
|
60
|
-
c && "!shadow-none",
|
61
|
-
c && n.length > 0 && "!p-0 !shadow-none",
|
62
|
-
I
|
63
|
-
),
|
64
|
-
children: [
|
65
|
-
/* @__PURE__ */ i("input", { ...M() }),
|
66
|
-
n.length === 0 && m.length === 0 && /* @__PURE__ */ r(
|
67
|
-
"div",
|
68
|
-
{
|
69
|
-
className: f(
|
70
|
-
"flex flex-col items-center gap-1",
|
71
|
-
o == null ? void 0 : o.idleWrapper
|
72
|
-
),
|
73
|
-
children: [
|
74
|
-
/* @__PURE__ */ i(K, {}),
|
75
|
-
!p && /* @__PURE__ */ r(U, { children: [
|
76
|
-
/* @__PURE__ */ i("span", { className: "font-medium text-md text-foreground max-w-[200px]", children: E }),
|
77
|
-
/* @__PURE__ */ i("span", { className: "font-normal text-xs text-foreground max-w-[250px]", children: b })
|
78
|
-
] })
|
79
|
-
]
|
80
|
-
}
|
81
|
-
),
|
82
|
-
m.length > 0 && /* @__PURE__ */ r("div", { className: f("w-full mt-4", o == null ? void 0 : o.errorWrapper), children: [
|
83
|
-
/* @__PURE__ */ r("span", { className: "font-semibold text-red-500", children: [
|
84
|
-
N,
|
85
|
-
":"
|
86
|
-
] }),
|
87
|
-
/* @__PURE__ */ i("ul", { className: "mt-2 text-sm text-red-500 list-disc list-inside", children: m.map((e, l) => /* @__PURE__ */ r("li", { children: [
|
88
|
-
e.file.name,
|
89
|
-
" (",
|
90
|
-
(e.file.size / (1024 * 1024)).toFixed(2),
|
91
|
-
" MB)",
|
92
|
-
!D && /* @__PURE__ */ i("ul", { className: "ml-4 list-disc list-inside", children: e.errors.map((t, d) => /* @__PURE__ */ r("li", { children: [
|
93
|
-
t.code === "file-too-large" && W,
|
94
|
-
t.code === "file-invalid-type" && k,
|
95
|
-
t.code !== "file-too-large" && t.code !== "file-invalid-type" && t.message
|
96
|
-
] }, d)) })
|
97
|
-
] }, l)) })
|
98
|
-
] }),
|
99
|
-
!!(c && n.length) && /* @__PURE__ */ i(
|
100
|
-
J,
|
101
|
-
{
|
102
|
-
item: n[0],
|
103
|
-
onRemoveClick: (e) => u(e, 0),
|
104
|
-
disabled: p
|
105
|
-
}
|
106
|
-
),
|
107
|
-
!c && n.length > 0 && /* @__PURE__ */ r("div", { className: f("w-full mt-2", o == null ? void 0 : o.previewWrapper), children: [
|
108
|
-
/* @__PURE__ */ r("pre", { className: "font-semibold text-gray-600", children: [
|
109
|
-
S,
|
110
|
-
":"
|
111
|
-
] }),
|
112
|
-
/* @__PURE__ */ i("ul", { className: "mt-2 text-sm text-gray-500 flex flex-wrap gap-4 items-start justify-center", children: n.map((e, l) => {
|
113
|
-
const t = g(e) ? e.name : Q(e), d = g(e) ? (e.size / (1024 * 1024)).toFixed(2) + " MB" : "";
|
114
|
-
return /* @__PURE__ */ r(
|
115
|
-
"li",
|
116
|
-
{
|
117
|
-
className: "flex flex-col items-center gap-2 relative",
|
118
|
-
children: [
|
119
|
-
/* @__PURE__ */ r("div", { className: "relative", children: [
|
120
|
-
/* @__PURE__ */ i(q, { item: e, styles: o }),
|
121
|
-
/* @__PURE__ */ i(
|
122
|
-
"div",
|
123
|
-
{
|
124
|
-
className: "absolute top-0 right-0 cursor-pointer bg-gray-300 rounded-sm",
|
125
|
-
onClick: (h) => u(h, l),
|
126
|
-
children: /* @__PURE__ */ i(j, { size: 16, strokeWidth: 1, color: "black" })
|
127
|
-
}
|
128
|
-
)
|
129
|
-
] }),
|
130
|
-
/* @__PURE__ */ r("span", { className: "inline-flex flex-col items-center", children: [
|
131
|
-
/* @__PURE__ */ i("span", { className: "max-w-[80px] text-ellipsis overflow-hidden whitespace-nowrap", children: t }),
|
132
|
-
d && /* @__PURE__ */ r("span", { children: [
|
133
|
-
"(",
|
134
|
-
d,
|
135
|
-
")"
|
136
|
-
] })
|
137
|
-
] })
|
138
|
-
]
|
139
|
-
},
|
140
|
-
l
|
141
|
-
);
|
142
|
-
}) })
|
143
|
-
] })
|
144
|
-
]
|
145
|
-
}
|
146
|
-
);
|
147
|
-
}
|
148
|
-
);
|
149
|
-
R.displayName = "Dropzone";
|
150
|
-
export {
|
151
|
-
R as Dropzone
|
152
|
-
};
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
2
|
-
import { FileRejection } from 'react-dropzone';
|
3
|
-
|
4
|
-
export type DropzoneValueItem = File | string;
|
5
|
-
export interface FilePreviewProps {
|
6
|
-
item: DropzoneValueItem;
|
7
|
-
styles?: Pick<DropzoneStyles, 'previewWraper' | 'previewImage' | 'previewFile'>;
|
8
|
-
}
|
9
|
-
export interface DropzoneTranslations {
|
10
|
-
labelDropzonePrompt?: string;
|
11
|
-
labelDropzoneSubPrompt?: string;
|
12
|
-
labelOrClickToSelect?: string;
|
13
|
-
labelSelectedFiles?: string;
|
14
|
-
labelUploadErrors?: string;
|
15
|
-
labelFileTooLarge?: string;
|
16
|
-
labelInvalidFileType?: string;
|
17
|
-
}
|
18
|
-
export interface DropzoneProps extends DropzoneTranslations, React.HTMLAttributes<HTMLDivElement> {
|
19
|
-
acceptTypes?: string[];
|
20
|
-
maxSizeMB: number;
|
21
|
-
maxFiles?: number;
|
22
|
-
onErrors?: (errors: FileRejection[]) => void;
|
23
|
-
hideErrors?: boolean;
|
24
|
-
disabled?: boolean;
|
25
|
-
classNames?: DropzoneStyles;
|
26
|
-
value?: DropzoneValueItem[];
|
27
|
-
onChangeValue?: (items: DropzoneValueItem[]) => void;
|
28
|
-
singlePick?: boolean;
|
29
|
-
}
|
30
|
-
export interface DropzoneStyles {
|
31
|
-
idleWrapper?: string;
|
32
|
-
previewWrapper?: string;
|
33
|
-
errorWrapper?: string;
|
34
|
-
previewWraper?: string;
|
35
|
-
previewImage?: string;
|
36
|
-
previewFile?: string;
|
37
|
-
}
|
38
|
-
export declare const DEFAULT_FILE_TYPES: string[];
|
39
|
-
export declare const DEFAULT_IMAGES_TYPES: string[];
|
40
|
-
export interface DropzoneControl {
|
41
|
-
setItems: Dispatch<SetStateAction<DropzoneValueItem[]>>;
|
42
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { DropzoneValueItem } from './Dropzone.types';
|
2
|
-
|
3
|
-
export declare const transformImageToSrc: (preview?: string | File | null) => string;
|
4
|
-
interface SinglePickPreviewProps {
|
5
|
-
item: DropzoneValueItem;
|
6
|
-
disabled?: boolean;
|
7
|
-
onRemoveClick: (e: React.MouseEvent<HTMLDivElement>) => void;
|
8
|
-
}
|
9
|
-
export declare const DropzoneSinglePickPreview: ({ item, disabled, onRemoveClick, }: SinglePickPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
10
|
-
export {};
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
2
|
-
import { useMemo as c } from "react";
|
3
|
-
import { isFile as i } from "./DropzoneUtils.mjs";
|
4
|
-
import { X as a, FileIcon as u } from "lucide-react";
|
5
|
-
const d = (t) => {
|
6
|
-
if (!t) return "";
|
7
|
-
switch (!0) {
|
8
|
-
case (typeof t == "string" && !!t.trim() && t !== "null"):
|
9
|
-
return t;
|
10
|
-
case t instanceof File:
|
11
|
-
return URL.createObjectURL(t);
|
12
|
-
case t instanceof FileList:
|
13
|
-
return t[0] ? URL.createObjectURL(t[0]) : "";
|
14
|
-
default:
|
15
|
-
return "";
|
16
|
-
}
|
17
|
-
}, p = ({
|
18
|
-
item: t,
|
19
|
-
disabled: l,
|
20
|
-
onRemoveClick: n
|
21
|
-
}) => {
|
22
|
-
const e = i(t) ? t.name : t, o = c(() => d(t), [t]);
|
23
|
-
return /* @__PURE__ */ s("div", { className: "relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-[2px] outline-dashed outline-offset-[-1px] rounded-lg", children: [
|
24
|
-
!l && /* @__PURE__ */ r("div", { className: "absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow", onClick: n, children: /* @__PURE__ */ r(a, { size: 16, strokeWidth: 2, color: "black" }) }),
|
25
|
-
o ? /* @__PURE__ */ r(
|
26
|
-
"img",
|
27
|
-
{
|
28
|
-
src: o,
|
29
|
-
alt: e == null ? void 0 : e.toString(),
|
30
|
-
className: "w-full h-full object-cover rounded-lg "
|
31
|
-
}
|
32
|
-
) : /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col items-center justify-center text-gray-600", children: [
|
33
|
-
/* @__PURE__ */ r(u, { size: 28 }),
|
34
|
-
/* @__PURE__ */ r("span", { className: "text-sm mt-2 break-all px-2 text-center", children: e == null ? void 0 : e.toString() })
|
35
|
-
] })
|
36
|
-
] });
|
37
|
-
};
|
38
|
-
export {
|
39
|
-
p as DropzoneSinglePickPreview,
|
40
|
-
d as transformImageToSrc
|
41
|
-
};
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { DropzoneValueItem } from './Dropzone.types';
|
2
|
-
|
3
|
-
export declare function isFile(item: DropzoneValueItem): item is File;
|
4
|
-
export declare function extractName(url: string): string;
|
5
|
-
export declare const DefaultFileIcon: () => import("react/jsx-runtime").JSX.Element;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { jsxs as t, jsx as l } from "react/jsx-runtime";
|
2
|
-
function d(e) {
|
3
|
-
return e instanceof File;
|
4
|
-
}
|
5
|
-
function r(e) {
|
6
|
-
try {
|
7
|
-
const i = e.split("?")[0].split("#")[0].split("/");
|
8
|
-
return i[i.length - 1] || e;
|
9
|
-
} catch {
|
10
|
-
return e;
|
11
|
-
}
|
12
|
-
}
|
13
|
-
const o = () => /* @__PURE__ */ t("svg", { width: "55", height: "55", viewBox: "0 0 55 55", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
14
|
-
/* @__PURE__ */ l("mask", { id: "mask0_2430_114601", maskUnits: "userSpaceOnUse", x: "7", y: "4", width: "39", height: "46", children: /* @__PURE__ */ l("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.25 4.68359H45.6174V49.354H7.25V4.68359Z", fill: "white" }) }),
|
15
|
-
/* @__PURE__ */ l("g", { mask: "url(#mask0_2430_114601)", children: /* @__PURE__ */ l("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M17.5386 8.05859C13.8103 8.05859 10.7143 11.0781 10.6266 14.8018V38.9196C10.5456 42.7468 13.5606 45.8968 17.3518 45.9801H35.5386C39.2938 45.8451 42.2661 42.7468 42.2413 38.9308V18.9216L31.8148 8.05859H17.5656H17.5386ZM17.5664 49.3551H17.2829C11.6309 49.2336 7.1309 44.5356 7.2524 38.8836V14.7613C7.38515 9.17909 11.9932 4.68359 17.5327 4.68359H17.5732H32.5334C32.9924 4.68359 33.4312 4.87034 33.7507 5.20109L45.1492 17.0743C45.4484 17.3871 45.6172 17.8078 45.6172 18.2421V38.9196C45.6532 44.5648 41.2522 49.1526 35.5979 49.3551H17.5664Z", fill: "#0D0E2B", "fill-opacity": "0.7" }) }),
|
16
|
-
/* @__PURE__ */ l("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M43.9198 20.3703H37.7233C33.6036 20.359 30.2578 17.002 30.2578 12.889V6.34375C30.2578 5.41225 31.0138 4.65625 31.9453 4.65625C32.8768 4.65625 33.6328 5.41225 33.6328 6.34375V12.889C33.6328 15.148 35.4688 16.9885 37.7278 16.9953H43.9198C44.8513 16.9953 45.6073 17.7513 45.6073 18.6828C45.6073 19.6143 44.8513 20.3703 43.9198 20.3703Z", fill: "#0D0E2B", "fill-opacity": "0.7" }),
|
17
|
-
/* @__PURE__ */ l("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M25.5708 37.729C24.6393 37.729 23.8833 36.973 23.8833 36.0415V22.4492C23.8833 21.5177 24.6393 20.7617 25.5708 20.7617C26.5023 20.7617 27.2583 21.5177 27.2583 22.4492V36.0415C27.2583 36.973 26.5023 37.729 25.5708 37.729Z", fill: "#0D0E2B", "fill-opacity": "0.7" }),
|
18
|
-
/* @__PURE__ */ l("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M25.5678 37.7279C25.1201 37.7279 24.6881 37.5501 24.3731 37.2306L19.0968 31.9341C18.4398 31.2726 18.4421 30.2039 19.1013 29.5469C19.7628 28.8899 20.8316 28.8899 21.4886 29.5514L25.5678 33.6509L29.6471 29.5514C30.3041 28.8899 31.3728 28.8899 32.0343 29.5469C32.6936 30.2039 32.6958 31.2726 32.0388 31.9341L26.7626 37.2306C26.4476 37.5501 26.0156 37.7279 25.5678 37.7279Z", fill: "#0D0E2B", "fill-opacity": "0.7" })
|
19
|
-
] });
|
20
|
-
export {
|
21
|
-
o as DefaultFileIcon,
|
22
|
-
r as extractName,
|
23
|
-
d as isFile
|
24
|
-
};
|
package/Dropzone/index.d.ts
DELETED
package/Dropzone/index.mjs
DELETED
package/Dropzone/package.json
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
2
|
-
import { useState as m, useEffect as f } from "react";
|
3
|
-
import { File as s } from "lucide-react";
|
4
|
-
import { isFile as o } from "./Dropzone/DropzoneUtils.mjs";
|
5
|
-
import { cn as c } from "@oneplatformdev/utils";
|
6
|
-
const h = [
|
7
|
-
"application/msword",
|
8
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
9
|
-
"text/csv",
|
10
|
-
"text/plain",
|
11
|
-
"application/pdf"
|
12
|
-
], u = [
|
13
|
-
"image/png",
|
14
|
-
"image/jpeg",
|
15
|
-
"image/jpg",
|
16
|
-
"image/webp",
|
17
|
-
"image/gif"
|
18
|
-
], j = ({ item: e, styles: r }) => {
|
19
|
-
const [t, a] = m(null), p = o(e) && u.includes(e.type);
|
20
|
-
return f(() => {
|
21
|
-
let n = null;
|
22
|
-
if (o(e) && p) {
|
23
|
-
const i = new FileReader();
|
24
|
-
return i.onloadend = () => a(i.result), i.readAsDataURL(e), () => a(null);
|
25
|
-
} else {
|
26
|
-
if (typeof e == "string")
|
27
|
-
return n = new Image(), n.src = e, n.onload = () => a(e), n.onerror = () => a(null), () => {
|
28
|
-
n.onload = null, n.onerror = null;
|
29
|
-
};
|
30
|
-
a(null);
|
31
|
-
}
|
32
|
-
return () => a(null);
|
33
|
-
}, [e, p]), /* @__PURE__ */ l(
|
34
|
-
"div",
|
35
|
-
{
|
36
|
-
className: c(
|
37
|
-
"w-32 h-32 border border-gray-300 rounded-md overflow-hidden flex items-center justify-center",
|
38
|
-
r == null ? void 0 : r.previewWraper
|
39
|
-
),
|
40
|
-
children: t ? /* @__PURE__ */ l(
|
41
|
-
"img",
|
42
|
-
{
|
43
|
-
src: t,
|
44
|
-
alt: o(e) ? e.name : "external-image",
|
45
|
-
className: c("w-full h-full object-cover", r == null ? void 0 : r.previewImage)
|
46
|
-
}
|
47
|
-
) : /* @__PURE__ */ d(
|
48
|
-
"div",
|
49
|
-
{
|
50
|
-
className: c(
|
51
|
-
"flex flex-col items-center justify-center text-gray-500 text-sm p-2 text-center",
|
52
|
-
r == null ? void 0 : r.previewFile
|
53
|
-
),
|
54
|
-
children: [
|
55
|
-
/* @__PURE__ */ l(s, { className: "w-6 h-6" }),
|
56
|
-
o(e) ? /* @__PURE__ */ l("span", { className: "text-xs break-all", children: e.name }) : /* @__PURE__ */ l("span", { className: "text-xs break-all", children: e })
|
57
|
-
]
|
58
|
-
}
|
59
|
-
)
|
60
|
-
}
|
61
|
-
);
|
62
|
-
};
|
63
|
-
export {
|
64
|
-
h as D,
|
65
|
-
j as F,
|
66
|
-
u as a
|
67
|
-
};
|
package/Form/Form.d.ts
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
|
2
|
-
import * as React from 'react';
|
3
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
4
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
5
|
-
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
6
|
-
declare const useFormField: () => {
|
7
|
-
invalid: boolean;
|
8
|
-
isDirty: boolean;
|
9
|
-
isTouched: boolean;
|
10
|
-
isValidating: boolean;
|
11
|
-
error?: import('react-hook-form').FieldError;
|
12
|
-
id: string;
|
13
|
-
name: string;
|
14
|
-
formItemId: string;
|
15
|
-
formDescriptionId: string;
|
16
|
-
formMessageId: string;
|
17
|
-
};
|
18
|
-
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
19
|
-
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
20
|
-
declare const FormControl: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-slot').SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
21
|
-
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
22
|
-
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
23
|
-
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
package/Form/Form.mjs
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
2
|
-
import * as s from "react";
|
3
|
-
import { Slot as F } from "@radix-ui/react-slot";
|
4
|
-
import { FormProvider as u, Controller as p, useFormContext as x } from "react-hook-form";
|
5
|
-
import { cn as a } from "@oneplatformdev/utils";
|
6
|
-
import { Label as I } from "../Label/Label.mjs";
|
7
|
-
import "../Label/labelVariants.mjs";
|
8
|
-
const M = u, l = s.createContext(
|
9
|
-
{}
|
10
|
-
), S = ({
|
11
|
-
...e
|
12
|
-
}) => /* @__PURE__ */ n(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ n(p, { ...e }) }), c = () => {
|
13
|
-
const e = s.useContext(l), t = s.useContext(f), { getFieldState: o, formState: r } = x(), m = o(e.name, r);
|
14
|
-
if (!e)
|
15
|
-
throw new Error("useFormField should be used within <FormField>");
|
16
|
-
const { id: i } = t;
|
17
|
-
return {
|
18
|
-
id: i,
|
19
|
-
name: e.name,
|
20
|
-
formItemId: `${i}-form-item`,
|
21
|
-
formDescriptionId: `${i}-form-item-description`,
|
22
|
-
formMessageId: `${i}-form-item-message`,
|
23
|
-
...m
|
24
|
-
};
|
25
|
-
}, f = s.createContext(
|
26
|
-
{}
|
27
|
-
), v = s.forwardRef(({ className: e, ...t }, o) => {
|
28
|
-
const r = s.useId();
|
29
|
-
return /* @__PURE__ */ n(f.Provider, { value: { id: r }, children: /* @__PURE__ */ n("div", { ref: o, className: a("space-y-1", e), ...t }) });
|
30
|
-
});
|
31
|
-
v.displayName = "FormItem";
|
32
|
-
const C = s.forwardRef(({ className: e, ...t }, o) => {
|
33
|
-
const { error: r, formItemId: m } = c();
|
34
|
-
return /* @__PURE__ */ n(
|
35
|
-
I,
|
36
|
-
{
|
37
|
-
ref: o,
|
38
|
-
"data-state": r ? "invalid" : "valid",
|
39
|
-
className: a(r && "text-destructive", e),
|
40
|
-
htmlFor: m,
|
41
|
-
...t
|
42
|
-
}
|
43
|
-
);
|
44
|
-
});
|
45
|
-
C.displayName = "FormLabel";
|
46
|
-
const g = s.forwardRef(({ className: e, ...t }, o) => {
|
47
|
-
const { error: r, formItemId: m, formDescriptionId: i, formMessageId: d } = c();
|
48
|
-
return /* @__PURE__ */ n(
|
49
|
-
F,
|
50
|
-
{
|
51
|
-
ref: o,
|
52
|
-
id: m,
|
53
|
-
"data-state": r ? "invalid" : "valid",
|
54
|
-
"aria-describedby": r ? `${i} ${d}` : `${i}`,
|
55
|
-
"aria-invalid": !!r,
|
56
|
-
className: a("group/form-control", e),
|
57
|
-
...t
|
58
|
-
}
|
59
|
-
);
|
60
|
-
});
|
61
|
-
g.displayName = "FormControl";
|
62
|
-
const N = s.forwardRef(({ className: e, ...t }, o) => {
|
63
|
-
const { formDescriptionId: r } = c();
|
64
|
-
return /* @__PURE__ */ n(
|
65
|
-
"p",
|
66
|
-
{
|
67
|
-
ref: o,
|
68
|
-
id: r,
|
69
|
-
className: a("text-[0.8rem] text-muted-foreground", e),
|
70
|
-
...t
|
71
|
-
}
|
72
|
-
);
|
73
|
-
});
|
74
|
-
N.displayName = "FormDescription";
|
75
|
-
const w = s.forwardRef(({ className: e, children: t, ...o }, r) => {
|
76
|
-
const { error: m, formMessageId: i } = c(), d = m ? String(m == null ? void 0 : m.message) : t;
|
77
|
-
return d ? /* @__PURE__ */ n(
|
78
|
-
"p",
|
79
|
-
{
|
80
|
-
ref: r,
|
81
|
-
id: i,
|
82
|
-
className: a("text-[0.8rem] font-medium text-destructive", e),
|
83
|
-
...o,
|
84
|
-
children: d
|
85
|
-
}
|
86
|
-
) : null;
|
87
|
-
});
|
88
|
-
w.displayName = "FormMessage";
|
89
|
-
export {
|
90
|
-
M as Form,
|
91
|
-
g as FormControl,
|
92
|
-
N as FormDescription,
|
93
|
-
S as FormField,
|
94
|
-
v as FormItem,
|
95
|
-
C as FormLabel,
|
96
|
-
w as FormMessage,
|
97
|
-
c as useFormField
|
98
|
-
};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
2
|
-
import { FormField as d, FormItem as i, FormLabel as F, FormMessage as p } from "./Form.mjs";
|
3
|
-
const b = (e) => {
|
4
|
-
const { form: n, name: m, label: o, render: t, containerProps: l = {}, ...s } = e;
|
5
|
-
return /* @__PURE__ */ r(
|
6
|
-
d,
|
7
|
-
{
|
8
|
-
control: n.control,
|
9
|
-
name: m,
|
10
|
-
render: (c) => /* @__PURE__ */ a(i, { ...l, children: [
|
11
|
-
!!o && /* @__PURE__ */ r(F, { children: o }),
|
12
|
-
t(c),
|
13
|
-
/* @__PURE__ */ r(p, {})
|
14
|
-
] }),
|
15
|
-
...s
|
16
|
-
}
|
17
|
-
);
|
18
|
-
};
|
19
|
-
export {
|
20
|
-
b as FormRenderControl
|
21
|
-
};
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { ControllerFieldState, ControllerRenderProps, FieldPath, FieldValues, UseFormReturn, UseFormStateReturn } from 'react-hook-form';
|
2
|
-
import { default as React } from 'react';
|
3
|
-
|
4
|
-
export type FormRenderProps<Data extends FieldValues> = ({ field, fieldState, formState, }: {
|
5
|
-
field: ControllerRenderProps<Data, FieldPath<Data>>;
|
6
|
-
fieldState: ControllerFieldState;
|
7
|
-
formState: UseFormStateReturn<Data>;
|
8
|
-
}) => React.ReactElement;
|
9
|
-
export interface FormRenderControlProps<Data extends FieldValues> {
|
10
|
-
form: UseFormReturn<Data>;
|
11
|
-
name: FieldPath<Data>;
|
12
|
-
label?: string;
|
13
|
-
render: FormRenderProps<Data>;
|
14
|
-
containerProps?: React.HTMLAttributes<HTMLDivElement>;
|
15
|
-
}
|
16
|
-
export type FormRenderControlExtendProps<Data extends FieldValues> = Omit<FormRenderControlProps<Data>, 'render'>;
|
package/Form/index.d.ts
DELETED
package/Form/index.mjs
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import { Form as e, FormControl as m, FormDescription as F, FormField as t, FormItem as l, FormLabel as i, FormMessage as n, useFormField as s } from "./Form.mjs";
|
2
|
-
import { FormRenderControl as p } from "./FormRenderControl.mjs";
|
3
|
-
export {
|
4
|
-
e as Form,
|
5
|
-
m as FormControl,
|
6
|
-
F as FormDescription,
|
7
|
-
t as FormField,
|
8
|
-
l as FormItem,
|
9
|
-
i as FormLabel,
|
10
|
-
n as FormMessage,
|
11
|
-
p as FormRenderControl,
|
12
|
-
s as useFormField
|
13
|
-
};
|
package/Form/package.json
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
import { FormControl as h } from "../Form/Form.mjs";
|
3
|
-
import { FormRenderControl as p } from "../Form/FormRenderControl.mjs";
|
4
|
-
import { CheckboxLabel as s } from "../Checkbox/Checkbox.mjs";
|
5
|
-
const i = (t) => {
|
6
|
-
const { form: c, label: a, name: l, onCheckedChange: o, ...m } = t;
|
7
|
-
return /* @__PURE__ */ e(
|
8
|
-
p,
|
9
|
-
{
|
10
|
-
form: c,
|
11
|
-
name: l,
|
12
|
-
render: ({ field: r }) => /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(
|
13
|
-
s,
|
14
|
-
{
|
15
|
-
...r,
|
16
|
-
...m,
|
17
|
-
label: a,
|
18
|
-
checked: r.value || !1,
|
19
|
-
onCheckedChange: (n) => {
|
20
|
-
r.onChange(n), o == null || o(n);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
) }),
|
24
|
-
...m
|
25
|
-
}
|
26
|
-
);
|
27
|
-
};
|
28
|
-
export {
|
29
|
-
i as FormCheckbox
|
30
|
-
};
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { FormRenderControlExtendProps } from '../Form';
|
2
|
-
import { FieldValues } from 'react-hook-form';
|
3
|
-
import { CheckboxProps } from '../Checkbox';
|
4
|
-
|
5
|
-
export interface FormCheckboxProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<CheckboxProps, 'form' | 'name' | 'label'> {
|
6
|
-
disabled?: boolean;
|
7
|
-
}
|
package/FormCheckbox/index.d.ts
DELETED
package/FormCheckbox/index.mjs
DELETED