@px-ui/ui 1.0.10 → 1.1.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/dist/{avatar-CbuG-kqF.d.ts → avatar-DTxH_yTY.d.ts} +6 -6
- package/dist/{avatar-CbuG-kqF.d.ts.map → avatar-DTxH_yTY.d.ts.map} +1 -1
- package/dist/{avatar-Bb0tx0Hn.js → avatar-DnDnGmSj.js} +3 -3
- package/dist/{avatar-Bb0tx0Hn.js.map → avatar-DnDnGmSj.js.map} +1 -1
- package/dist/{button-BkzvdmIX.d.ts → button-Cfd9X6pX.d.ts} +7 -7
- package/dist/{button-BkzvdmIX.d.ts.map → button-Cfd9X6pX.d.ts.map} +1 -1
- package/dist/{button-hBUFMmsZ.js → button-DnHwqwy0.js} +2 -2
- package/dist/{button-hBUFMmsZ.js.map → button-DnHwqwy0.js.map} +1 -1
- package/dist/checkbox-CwkX29tL.js +22 -0
- package/dist/checkbox-CwkX29tL.js.map +1 -0
- package/dist/collapsible-DsrYXIW5.js +28 -0
- package/dist/collapsible-DsrYXIW5.js.map +1 -0
- package/dist/{combobox-CHkmVNZ2.js → combobox-5IAivvXw.js} +8 -8
- package/dist/{combobox-CHkmVNZ2.js.map → combobox-5IAivvXw.js.map} +1 -1
- package/dist/{combobox-C5txQ2La.d.ts → combobox-BBMYGrI2.d.ts} +19 -19
- package/dist/{combobox-C5txQ2La.d.ts.map → combobox-BBMYGrI2.d.ts.map} +1 -1
- package/dist/components/accordion.d.ts +5 -5
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +14 -14
- package/dist/components/alert-dialog.js +2 -2
- package/dist/components/alert.d.ts +7 -7
- package/dist/components/alert.js +1 -1
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/aspect-ratio.d.ts.map +1 -1
- package/dist/components/aspect-ratio.js +1 -1
- package/dist/components/attachment.d.ts +64 -0
- package/dist/components/attachment.d.ts.map +1 -0
- package/dist/components/attachment.js +107 -0
- package/dist/components/attachment.js.map +1 -0
- package/dist/components/avatar-group.d.ts +4 -4
- package/dist/components/avatar-group.d.ts.map +1 -1
- package/dist/components/avatar-group.js +4 -4
- package/dist/components/avatar.d.ts +1 -1
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.d.ts +7 -7
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/bubble.d.ts +39 -0
- package/dist/components/bubble.d.ts.map +1 -0
- package/dist/components/bubble.js +76 -0
- package/dist/components/bubble.js.map +1 -0
- package/dist/components/button-group.d.ts +6 -6
- package/dist/components/button-group.js +2 -2
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +2 -2
- package/dist/components/calendar.d.ts +4 -4
- package/dist/components/calendar.js +2 -2
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.d.ts +7 -7
- package/dist/components/carousel.js +2 -2
- package/dist/components/chart.d.ts +5 -5
- package/dist/components/chart.js +1 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +3 -21
- package/dist/components/collapsible.d.ts +4 -4
- package/dist/components/collapsible.js +3 -27
- package/dist/components/combobox.d.ts +2 -2
- package/dist/components/combobox.js +11 -11
- package/dist/components/command.d.ts +11 -11
- package/dist/components/command.js +6 -6
- package/dist/components/context-menu.d.ts +16 -16
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +1 -1
- package/dist/components/currency-select-field.d.ts +4 -4
- package/dist/components/currency-select-field.js +11 -11
- package/dist/components/dialog.d.ts +11 -11
- package/dist/components/dialog.js +3 -3
- package/dist/components/direction.js +1 -1
- package/dist/components/drawer.d.ts +11 -11
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/editor-output.d.ts +87 -0
- package/dist/components/editor-output.d.ts.map +1 -0
- package/dist/components/editor-output.js +158 -0
- package/dist/components/editor-output.js.map +1 -0
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +3 -61
- package/dist/components/field.d.ts +15 -15
- package/dist/components/field.js +3 -3
- package/dist/components/file-upload-field.d.ts +3 -3
- package/dist/components/file-upload-field.js +5 -5
- package/dist/components/file-upload.d.ts +3 -3
- package/dist/components/file-upload.js +4 -4
- package/dist/components/hover-card.d.ts +4 -4
- package/dist/components/hover-card.js +1 -1
- package/dist/components/icon.d.ts +83 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +188 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/input-group.d.ts +9 -9
- package/dist/components/input-group.js +5 -5
- package/dist/components/input-otp.d.ts +5 -5
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +2 -2
- package/dist/components/item.d.ts +14 -14
- package/dist/components/item.d.ts.map +1 -1
- package/dist/components/item.js +2 -2
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +2 -2
- package/dist/components/marker.d.ts +27 -0
- package/dist/components/marker.d.ts.map +1 -0
- package/dist/components/marker.js +46 -0
- package/dist/components/marker.js.map +1 -0
- package/dist/components/menubar.d.ts +18 -18
- package/dist/components/menubar.d.ts.map +1 -1
- package/dist/components/menubar.js +7 -7
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/message-scroller.d.ts +36 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +63 -0
- package/dist/components/message-scroller.js.map +1 -0
- package/dist/components/message.d.ts +34 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +52 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +1 -1
- package/dist/components/navigation-menu.d.ts +11 -11
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/pagination.d.ts +9 -9
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/phone-input.d.ts +2 -2
- package/dist/components/phone-input.js +1 -1
- package/dist/components/popover.d.ts +7 -7
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +2 -2
- package/dist/components/progress.d.ts +6 -6
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +3 -3
- package/dist/components/radio-group.js +1 -1
- package/dist/components/resizable.d.ts +4 -4
- package/dist/components/resizable.js +1 -1
- package/dist/components/rich-text-editor.d.ts +204 -0
- package/dist/components/rich-text-editor.d.ts.map +1 -0
- package/dist/components/rich-text-editor.js +359 -0
- package/dist/components/rich-text-editor.js.map +1 -0
- package/dist/components/scroll-area.d.ts +13 -3
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +3 -38
- package/dist/components/select.d.ts +10 -10
- package/dist/components/select.js +1 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +2 -2
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +3 -3
- package/dist/components/sidebar.d.ts +26 -26
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +8 -8
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +2 -2
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +1 -1
- package/dist/components/sortable-list.d.ts +153 -0
- package/dist/components/sortable-list.d.ts.map +1 -0
- package/dist/components/sortable-list.js +191 -0
- package/dist/components/sortable-list.js.map +1 -0
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +2 -2
- package/dist/components/stepper.d.ts +171 -0
- package/dist/components/stepper.d.ts.map +1 -0
- package/dist/components/stepper.js +281 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.d.ts +8 -8
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +2 -2
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +2 -2
- package/dist/components/toggle.d.ts +1 -1
- package/dist/components/toggle.js +2 -2
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +2 -2
- package/dist/components/tree-select.d.ts +192 -0
- package/dist/components/tree-select.d.ts.map +1 -0
- package/dist/components/tree-select.js +421 -0
- package/dist/components/tree-select.js.map +1 -0
- package/dist/{dialog-DrdXva1a.js → dialog-DuGJUPQl.js} +3 -3
- package/dist/{dialog-DrdXva1a.js.map → dialog-DuGJUPQl.js.map} +1 -1
- package/dist/{dropdown-menu-CcumvwhM.js → dropdown-menu-BWEfcvmP.js} +19 -19
- package/dist/{dropdown-menu-CcumvwhM.js.map → dropdown-menu-BWEfcvmP.js.map} +1 -1
- package/dist/{dropdown-menu-BC7zFA2L.d.ts → dropdown-menu-DGgfWYrK.d.ts} +17 -17
- package/dist/{dropdown-menu-BC7zFA2L.d.ts.map → dropdown-menu-DGgfWYrK.d.ts.map} +1 -1
- package/dist/empty-U4zrLmFU.js +62 -0
- package/dist/empty-U4zrLmFU.js.map +1 -0
- package/dist/{file-upload-DoGu67Bu.d.ts → file-upload-BvAtAxLc.d.ts} +10 -10
- package/dist/{file-upload-DoGu67Bu.d.ts.map → file-upload-BvAtAxLc.d.ts.map} +1 -1
- package/dist/{file-upload-DeCIv13t.js → file-upload-DU5FAkHm.js} +4 -4
- package/dist/{file-upload-DeCIv13t.js.map → file-upload-DU5FAkHm.js.map} +1 -1
- package/dist/hooks/use-async-options.d.ts +1 -1
- package/dist/hooks/use-async-options.js +1 -1
- package/dist/hooks/use-debounce.js +1 -1
- package/dist/hooks/use-file-upload.d.ts +1 -1
- package/dist/hooks/use-file-upload.js +1 -1
- package/dist/hooks/use-infinite-scroll.d.ts +1 -1
- package/dist/hooks/use-infinite-scroll.js +2 -2
- package/dist/hooks/use-intersection-observer.d.ts +1 -1
- package/dist/hooks/use-intersection-observer.js +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/{input-CoP6CeA5.d.ts → input-BExbcSu4.d.ts} +3 -3
- package/dist/input-BExbcSu4.d.ts.map +1 -0
- package/dist/{input-group-DqEkmpXW.js → input-group-B5PMRYld.js} +5 -5
- package/dist/{input-group-DqEkmpXW.js.map → input-group-B5PMRYld.js.map} +1 -1
- package/dist/{input-8jqdnUZl.js → input-jIoNIdLQ.js} +2 -2
- package/dist/{input-8jqdnUZl.js.map → input-jIoNIdLQ.js.map} +1 -1
- package/dist/label-BFg2hxuL.d.ts +11 -0
- package/dist/label-BFg2hxuL.d.ts.map +1 -0
- package/dist/{label-AaH9ZYCZ.js → label-DsRhOKY_.js} +2 -2
- package/dist/{label-AaH9ZYCZ.js.map → label-DsRhOKY_.js.map} +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/{popover-C9D43EuT.js → popover-BGkU46G7.js} +2 -2
- package/dist/{popover-C9D43EuT.js.map → popover-BGkU46G7.js.map} +1 -1
- package/dist/providers/px-ui-provider.d.ts +4 -4
- package/dist/providers/px-ui-provider.d.ts.map +1 -1
- package/dist/providers/px-ui-provider.js +4 -4
- package/dist/scroll-area-mNVMQ0Of.js +40 -0
- package/dist/scroll-area-mNVMQ0Of.js.map +1 -0
- package/dist/{separator-BS3ilczC.js → separator-D0bew2D_.js} +2 -2
- package/dist/{separator-BS3ilczC.js.map → separator-D0bew2D_.js.map} +1 -1
- package/dist/{separator-D0hWdzUT.d.ts → separator-Df76guaT.d.ts} +3 -3
- package/dist/{separator-D0hWdzUT.d.ts.map → separator-Df76guaT.d.ts.map} +1 -1
- package/dist/{sheet-CLjNDrfL.js → sheet-BB23q6wd.js} +3 -3
- package/dist/{sheet-CLjNDrfL.js.map → sheet-BB23q6wd.js.map} +1 -1
- package/dist/{skeleton-BcIxI5Wq.js → skeleton-knxLhbA5.js} +2 -2
- package/dist/{skeleton-BcIxI5Wq.js.map → skeleton-knxLhbA5.js.map} +1 -1
- package/dist/{spinner-Bo0sUZEg.js → spinner-9MdgLDTZ.js} +2 -2
- package/dist/{spinner-Bo0sUZEg.js.map → spinner-9MdgLDTZ.js.map} +1 -1
- package/dist/styles.css +665 -1
- package/dist/{textarea-Cq0o323P.js → textarea-hZg0gA8u.js} +2 -2
- package/dist/{textarea-Cq0o323P.js.map → textarea-hZg0gA8u.js.map} +1 -1
- package/dist/{toast-COWAQbIk.js → toast-BdxoP8vz.js} +2 -2
- package/dist/{toast-COWAQbIk.js.map → toast-BdxoP8vz.js.map} +1 -1
- package/dist/{toast-DkzzdXGU.d.ts → toast-C5FRpq1P.d.ts} +4 -4
- package/dist/{toast-DkzzdXGU.d.ts.map → toast-C5FRpq1P.d.ts.map} +1 -1
- package/dist/{toggle-lqIyJptS.js → toggle-BZXrLBLK.js} +2 -2
- package/dist/{toggle-lqIyJptS.js.map → toggle-BZXrLBLK.js.map} +1 -1
- package/dist/{toggle-Dq3ftPFj.d.ts → toggle-CyTngkhT.d.ts} +6 -6
- package/dist/{toggle-Dq3ftPFj.d.ts.map → toggle-CyTngkhT.d.ts.map} +1 -1
- package/dist/{tooltip-DBoqfN9z.d.ts → tooltip-CkX3CD71.d.ts} +6 -6
- package/dist/{tooltip-DBoqfN9z.d.ts.map → tooltip-CkX3CD71.d.ts.map} +1 -1
- package/dist/{tooltip-DkPxCJIL.js → tooltip-Dsfn_zZD.js} +2 -2
- package/dist/{tooltip-DkPxCJIL.js.map → tooltip-Dsfn_zZD.js.map} +1 -1
- package/dist/{use-async-options-Cu5T43vj.d.ts → use-async-options-DdyHJxHh.d.ts} +1 -1
- package/dist/{use-async-options-Cu5T43vj.d.ts.map → use-async-options-DdyHJxHh.d.ts.map} +1 -1
- package/dist/{use-async-options-CcsImGX4.js → use-async-options-tueAuVs_.js} +1 -1
- package/dist/{use-async-options-CcsImGX4.js.map → use-async-options-tueAuVs_.js.map} +1 -1
- package/dist/{use-debounce-_qaEZqtt.js → use-debounce-7gIeOwla.js} +1 -1
- package/dist/{use-debounce-_qaEZqtt.js.map → use-debounce-7gIeOwla.js.map} +1 -1
- package/dist/{use-file-upload-yy-xLBtn.d.ts → use-file-upload-Bc7CyQ7O.d.ts} +1 -1
- package/dist/{use-file-upload-yy-xLBtn.d.ts.map → use-file-upload-Bc7CyQ7O.d.ts.map} +1 -1
- package/dist/{use-file-upload-Dxrej28u.js → use-file-upload-DQD1vY_Z.js} +1 -1
- package/dist/{use-file-upload-Dxrej28u.js.map → use-file-upload-DQD1vY_Z.js.map} +1 -1
- package/dist/{use-infinite-scroll-CpbhGGT5.js → use-infinite-scroll-HpeMA2MK.js} +2 -2
- package/dist/{use-infinite-scroll-CpbhGGT5.js.map → use-infinite-scroll-HpeMA2MK.js.map} +1 -1
- package/dist/{use-intersection-observer-C2xDq2SW.d.ts → use-intersection-observer-DNPextJs.d.ts} +1 -1
- package/dist/{use-intersection-observer-C2xDq2SW.d.ts.map → use-intersection-observer-DNPextJs.d.ts.map} +1 -1
- package/dist/{use-intersection-observer-CZfnep4z.js → use-intersection-observer-rlKEjyL1.js} +1 -1
- package/dist/{use-intersection-observer-CZfnep4z.js.map → use-intersection-observer-rlKEjyL1.js.map} +1 -1
- package/dist/{use-mobile-l5ebOdQl.js → use-mobile-DUqQzj2D.js} +1 -1
- package/dist/{use-mobile-l5ebOdQl.js.map → use-mobile-DUqQzj2D.js.map} +1 -1
- package/dist/{utils-mWJR2N24.js → utils-DUlptRpf.js} +1 -1
- package/dist/{utils-mWJR2N24.js.map → utils-DUlptRpf.js.map} +1 -1
- package/package.json +81 -1
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/collapsible.js.map +0 -1
- package/dist/components/empty.js.map +0 -1
- package/dist/components/scroll-area.js.map +0 -1
- package/dist/input-CoP6CeA5.d.ts.map +0 -1
- package/dist/label-Dw4Hcz5k.d.ts +0 -11
- package/dist/label-Dw4Hcz5k.d.ts.map +0 -1
- /package/dist/{direction-BKSh6e6q.js → direction-DFPbwDSF.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as Button } from "../button-
|
|
2
|
-
import { t as Separator } from "../separator-
|
|
3
|
-
import { t as Input } from "../input-
|
|
4
|
-
import { n as TooltipContent } from "../tooltip-
|
|
5
|
-
import * as
|
|
1
|
+
import { t as Button } from "../button-Cfd9X6pX.js";
|
|
2
|
+
import { t as Separator } from "../separator-Df76guaT.js";
|
|
3
|
+
import { t as Input } from "../input-BExbcSu4.js";
|
|
4
|
+
import { n as TooltipContent } from "../tooltip-CkX3CD71.js";
|
|
5
|
+
import * as react_jsx_runtime243 from "react/jsx-runtime";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
7
|
import { VariantProps } from "class-variance-authority";
|
|
8
8
|
import { useRender } from "@base-ui/react/use-render";
|
|
9
|
-
import * as
|
|
9
|
+
import * as class_variance_authority_types14 from "class-variance-authority/types";
|
|
10
10
|
|
|
11
11
|
//#region src/components/sidebar.d.ts
|
|
12
12
|
type SidebarContextProps = {
|
|
@@ -31,7 +31,7 @@ declare function SidebarProvider({
|
|
|
31
31
|
defaultOpen?: boolean;
|
|
32
32
|
open?: boolean;
|
|
33
33
|
onOpenChange?: (open: boolean) => void;
|
|
34
|
-
}):
|
|
34
|
+
}): react_jsx_runtime243.JSX.Element;
|
|
35
35
|
declare function Sidebar({
|
|
36
36
|
side,
|
|
37
37
|
variant,
|
|
@@ -44,44 +44,44 @@ declare function Sidebar({
|
|
|
44
44
|
side?: "left" | "right";
|
|
45
45
|
variant?: "sidebar" | "floating" | "inset";
|
|
46
46
|
collapsible?: "offcanvas" | "icon" | "none";
|
|
47
|
-
}):
|
|
47
|
+
}): react_jsx_runtime243.JSX.Element;
|
|
48
48
|
declare function SidebarTrigger({
|
|
49
49
|
className,
|
|
50
50
|
onClick,
|
|
51
51
|
...props
|
|
52
|
-
}: React$1.ComponentProps<typeof Button>):
|
|
52
|
+
}: React$1.ComponentProps<typeof Button>): react_jsx_runtime243.JSX.Element;
|
|
53
53
|
declare function SidebarRail({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React$1.ComponentProps<"button">):
|
|
56
|
+
}: React$1.ComponentProps<"button">): react_jsx_runtime243.JSX.Element;
|
|
57
57
|
declare function SidebarInset({
|
|
58
58
|
className,
|
|
59
59
|
...props
|
|
60
|
-
}: React$1.ComponentProps<"main">):
|
|
60
|
+
}: React$1.ComponentProps<"main">): react_jsx_runtime243.JSX.Element;
|
|
61
61
|
declare function SidebarInput({
|
|
62
62
|
className,
|
|
63
63
|
...props
|
|
64
|
-
}: React$1.ComponentProps<typeof Input>):
|
|
64
|
+
}: React$1.ComponentProps<typeof Input>): react_jsx_runtime243.JSX.Element;
|
|
65
65
|
declare function SidebarHeader({
|
|
66
66
|
className,
|
|
67
67
|
...props
|
|
68
|
-
}: React$1.ComponentProps<"div">):
|
|
68
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime243.JSX.Element;
|
|
69
69
|
declare function SidebarFooter({
|
|
70
70
|
className,
|
|
71
71
|
...props
|
|
72
|
-
}: React$1.ComponentProps<"div">):
|
|
72
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime243.JSX.Element;
|
|
73
73
|
declare function SidebarSeparator({
|
|
74
74
|
className,
|
|
75
75
|
...props
|
|
76
|
-
}: React$1.ComponentProps<typeof Separator>):
|
|
76
|
+
}: React$1.ComponentProps<typeof Separator>): react_jsx_runtime243.JSX.Element;
|
|
77
77
|
declare function SidebarContent({
|
|
78
78
|
className,
|
|
79
79
|
...props
|
|
80
|
-
}: React$1.ComponentProps<"div">):
|
|
80
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime243.JSX.Element;
|
|
81
81
|
declare function SidebarGroup({
|
|
82
82
|
className,
|
|
83
83
|
...props
|
|
84
|
-
}: React$1.ComponentProps<"div">):
|
|
84
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime243.JSX.Element;
|
|
85
85
|
declare function SidebarGroupLabel({
|
|
86
86
|
className,
|
|
87
87
|
render,
|
|
@@ -95,19 +95,19 @@ declare function SidebarGroupAction({
|
|
|
95
95
|
declare function SidebarGroupContent({
|
|
96
96
|
className,
|
|
97
97
|
...props
|
|
98
|
-
}: React$1.ComponentProps<"div">):
|
|
98
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime243.JSX.Element;
|
|
99
99
|
declare function SidebarMenu({
|
|
100
100
|
className,
|
|
101
101
|
...props
|
|
102
|
-
}: React$1.ComponentProps<"ul">):
|
|
102
|
+
}: React$1.ComponentProps<"ul">): react_jsx_runtime243.JSX.Element;
|
|
103
103
|
declare function SidebarMenuItem({
|
|
104
104
|
className,
|
|
105
105
|
...props
|
|
106
|
-
}: React$1.ComponentProps<"li">):
|
|
106
|
+
}: React$1.ComponentProps<"li">): react_jsx_runtime243.JSX.Element;
|
|
107
107
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
108
108
|
variant?: "default" | "outline" | null | undefined;
|
|
109
109
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
110
|
-
} &
|
|
110
|
+
} & class_variance_authority_types14.ClassProp) | undefined) => string;
|
|
111
111
|
declare function SidebarMenuButton({
|
|
112
112
|
render,
|
|
113
113
|
isActive,
|
|
@@ -119,7 +119,7 @@ declare function SidebarMenuButton({
|
|
|
119
119
|
}: useRender.ComponentProps<"button"> & React$1.ComponentProps<"button"> & {
|
|
120
120
|
isActive?: boolean;
|
|
121
121
|
tooltip?: string | React$1.ComponentProps<typeof TooltipContent>;
|
|
122
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
122
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime243.JSX.Element;
|
|
123
123
|
declare function SidebarMenuAction({
|
|
124
124
|
className,
|
|
125
125
|
render,
|
|
@@ -131,22 +131,22 @@ declare function SidebarMenuAction({
|
|
|
131
131
|
declare function SidebarMenuBadge({
|
|
132
132
|
className,
|
|
133
133
|
...props
|
|
134
|
-
}: React$1.ComponentProps<"div">):
|
|
134
|
+
}: React$1.ComponentProps<"div">): react_jsx_runtime243.JSX.Element;
|
|
135
135
|
declare function SidebarMenuSkeleton({
|
|
136
136
|
className,
|
|
137
137
|
showIcon,
|
|
138
138
|
...props
|
|
139
139
|
}: React$1.ComponentProps<"div"> & {
|
|
140
140
|
showIcon?: boolean;
|
|
141
|
-
}):
|
|
141
|
+
}): react_jsx_runtime243.JSX.Element;
|
|
142
142
|
declare function SidebarMenuSub({
|
|
143
143
|
className,
|
|
144
144
|
...props
|
|
145
|
-
}: React$1.ComponentProps<"ul">):
|
|
145
|
+
}: React$1.ComponentProps<"ul">): react_jsx_runtime243.JSX.Element;
|
|
146
146
|
declare function SidebarMenuSubItem({
|
|
147
147
|
className,
|
|
148
148
|
...props
|
|
149
|
-
}: React$1.ComponentProps<"li">):
|
|
149
|
+
}: React$1.ComponentProps<"li">): react_jsx_runtime243.JSX.Element;
|
|
150
150
|
declare function SidebarMenuSubButton({
|
|
151
151
|
render,
|
|
152
152
|
size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","names":[],"sources":["../../src/components/sidebar.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAkCK,mBAAA;;;;EAAA,UAAA,EAAA,OAAA;EAYI,aAAU,EAAA,CAAA,IAAA,EAAA,OAAA,EAAA,GAAA,IAAA;EASV,QAAA,EAAA,OAAA;EACP,aAAA,EAAA,GAAA,GAAA,IAAA;CACM;iBAXC,UAAA,CAAA,CAYO,EAZG,mBAYH;iBAHP,eAAA,CAIP;EAAA,WAAA;EAAA,IAAA,EAFM,QAEN;EAAA,YAAA,EADc,WACd;EAAA,SAAA;EAAA,KAAA;EAAA,QAAA;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,IAAA,CAAA,EAAA,IAAA,GAAA,IAAA;EAAA,QAAA,CAAA,EAAA,OAAA;AAAA,CAAA,CAAA,EAwVxE,OAAA,CAAA,YA7UmB,CAAA,OAAA,EAAA,MAAA,GA6UnB,OAAA,CAAA,qBA7UmB,CAAA,GAAA,CAAA,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { t as cn } from "../utils-
|
|
4
|
-
import { t as Button } from "../button-
|
|
5
|
-
import { i as TooltipTrigger, n as TooltipContent, t as Tooltip } from "../tooltip-
|
|
6
|
-
import { t as Separator } from "../separator-
|
|
7
|
-
import { t as Input } from "../input-
|
|
8
|
-
import { i as SheetDescription, o as SheetHeader, r as SheetContent, s as SheetTitle, t as Sheet } from "../sheet-
|
|
9
|
-
import { t as Skeleton } from "../skeleton-
|
|
10
|
-
import { t as useIsMobile } from "../use-mobile-
|
|
3
|
+
import { t as cn } from "../utils-DUlptRpf.js";
|
|
4
|
+
import { t as Button } from "../button-DnHwqwy0.js";
|
|
5
|
+
import { i as TooltipTrigger, n as TooltipContent, t as Tooltip } from "../tooltip-Dsfn_zZD.js";
|
|
6
|
+
import { t as Separator } from "../separator-D0bew2D_.js";
|
|
7
|
+
import { t as Input } from "../input-jIoNIdLQ.js";
|
|
8
|
+
import { i as SheetDescription, o as SheetHeader, r as SheetContent, s as SheetTitle, t as Sheet } from "../sheet-BB23q6wd.js";
|
|
9
|
+
import { t as Skeleton } from "../skeleton-knxLhbA5.js";
|
|
10
|
+
import { t as useIsMobile } from "../use-mobile-DUqQzj2D.js";
|
|
11
11
|
import { PanelLeftIcon } from "lucide-react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React$1 from "react";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime332 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/skeleton.d.ts
|
|
4
4
|
declare function Skeleton({
|
|
5
5
|
className,
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<"div">):
|
|
7
|
+
}: React.ComponentProps<"div">): react_jsx_runtime332.JSX.Element;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Skeleton };
|
|
10
10
|
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime335 from "react/jsx-runtime";
|
|
2
2
|
import { Slider as Slider$1 } from "@base-ui/react/slider";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider.d.ts
|
|
@@ -9,7 +9,7 @@ declare function Slider({
|
|
|
9
9
|
min,
|
|
10
10
|
max,
|
|
11
11
|
...props
|
|
12
|
-
}: Slider$1.Root.Props):
|
|
12
|
+
}: Slider$1.Root.Props): react_jsx_runtime335.JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { Slider };
|
|
15
15
|
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { t as Button } from "../button-Cfd9X6pX.js";
|
|
2
|
+
import * as react_jsx_runtime228 from "react/jsx-runtime";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { DndContextProps, UniqueIdentifier } from "@dnd-kit/core";
|
|
5
|
+
import { SortingStrategy } from "@dnd-kit/sortable";
|
|
6
|
+
|
|
7
|
+
//#region src/components/sortable-list.d.ts
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Minimal shape every sortable item must satisfy: a stable, unique `id`.
|
|
11
|
+
* Items may carry any additional fields — `SortableList` only reads `id`.
|
|
12
|
+
*/
|
|
13
|
+
interface SortableListItem {
|
|
14
|
+
/** Stable unique identifier used for drag tracking and reordering. */
|
|
15
|
+
id: UniqueIdentifier;
|
|
16
|
+
}
|
|
17
|
+
interface SortableListProps<TItem extends SortableListItem> {
|
|
18
|
+
/**
|
|
19
|
+
* The ordered list of items to render. The order of this array is the
|
|
20
|
+
* source of truth for the rendered order.
|
|
21
|
+
*/
|
|
22
|
+
items: ReadonlyArray<TItem>;
|
|
23
|
+
/**
|
|
24
|
+
* Called when the user finishes a drag (or keyboard reorder) that changes
|
|
25
|
+
* the order. Receives the full re-ordered array — wire this to your state.
|
|
26
|
+
*/
|
|
27
|
+
onReorder: (newOrder: TItem[]) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Render a single item. The returned node is expected to render a
|
|
30
|
+
* {@link SortableItem} (directly or nested) keyed/identified by `item.id`.
|
|
31
|
+
*/
|
|
32
|
+
renderItem: (item: TItem, index: number) => React$1.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Sorting strategy passed to the underlying `SortableContext`.
|
|
35
|
+
* @default verticalListSortingStrategy
|
|
36
|
+
*/
|
|
37
|
+
strategy?: SortingStrategy;
|
|
38
|
+
/**
|
|
39
|
+
* Disable all dragging for the whole list.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Additional props forwarded to the underlying dnd-kit `DndContext`
|
|
45
|
+
* (e.g. accessibility announcements). Providing `modifiers` *replaces* the
|
|
46
|
+
* default vertical-axis restriction — pass your own (e.g.
|
|
47
|
+
* `restrictToHorizontalAxis`, alongside a matching `strategy`) for
|
|
48
|
+
* non-vertical layouts, or `[]` to remove axis locking entirely.
|
|
49
|
+
*/
|
|
50
|
+
dndContextProps?: Omit<DndContextProps, "sensors" | "collisionDetection" | "onDragEnd">;
|
|
51
|
+
/** Additional className for the list container. */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Props forwarded to the list container element. */
|
|
54
|
+
containerProps?: React$1.ComponentProps<"div">;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Drag-and-drop sortable list. Wraps dnd-kit's `DndContext` +
|
|
58
|
+
* `SortableContext`, wires pointer and keyboard sensors, and restricts
|
|
59
|
+
* movement to the vertical axis. Fully keyboard-operable.
|
|
60
|
+
*
|
|
61
|
+
* This is a generic foundation primitive: it owns ordering/DnD plumbing and
|
|
62
|
+
* delegates the visual rendering of each row to `renderItem`, which should
|
|
63
|
+
* render a {@link SortableItem} (with an optional {@link SortableDragHandle}).
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* const [items, setItems] = React.useState([
|
|
68
|
+
* { id: "1", label: "First" },
|
|
69
|
+
* { id: "2", label: "Second" },
|
|
70
|
+
* { id: "3", label: "Third" },
|
|
71
|
+
* ]);
|
|
72
|
+
*
|
|
73
|
+
* <SortableList
|
|
74
|
+
* items={items}
|
|
75
|
+
* onReorder={setItems}
|
|
76
|
+
* renderItem={(item) => (
|
|
77
|
+
* <SortableItem id={item.id} className="rounded-md border p-3">
|
|
78
|
+
* <SortableDragHandle />
|
|
79
|
+
* <span>{item.label}</span>
|
|
80
|
+
* </SortableItem>
|
|
81
|
+
* )}
|
|
82
|
+
* />
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare function SortableList<TItem extends SortableListItem>({
|
|
86
|
+
items,
|
|
87
|
+
onReorder,
|
|
88
|
+
renderItem,
|
|
89
|
+
strategy,
|
|
90
|
+
disabled,
|
|
91
|
+
dndContextProps,
|
|
92
|
+
className,
|
|
93
|
+
containerProps
|
|
94
|
+
}: SortableListProps<TItem>): react_jsx_runtime228.JSX.Element;
|
|
95
|
+
interface SortableItemProps extends Omit<React$1.ComponentProps<"div">, "id"> {
|
|
96
|
+
/** Must match the `id` of the corresponding entry in `SortableList.items`. */
|
|
97
|
+
id: UniqueIdentifier;
|
|
98
|
+
/**
|
|
99
|
+
* When `true`, the entire item becomes the drag activator (the whole row is
|
|
100
|
+
* draggable). When `false` (the default), provide a {@link SortableDragHandle}
|
|
101
|
+
* inside to control dragging — better for items with interactive content.
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
dragOnItem?: boolean;
|
|
105
|
+
/** Disable dragging for just this item. */
|
|
106
|
+
disabled?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A single sortable row. Wraps `useSortable`, applies the live transform /
|
|
110
|
+
* transition, and exposes the drag attributes + listeners to a nested
|
|
111
|
+
* {@link SortableDragHandle} via context.
|
|
112
|
+
*
|
|
113
|
+
* Render exactly one `SortableItem` per `renderItem` call, with an `id`
|
|
114
|
+
* matching the data item.
|
|
115
|
+
*/
|
|
116
|
+
declare function SortableItem({
|
|
117
|
+
id,
|
|
118
|
+
dragOnItem,
|
|
119
|
+
disabled,
|
|
120
|
+
className,
|
|
121
|
+
style,
|
|
122
|
+
children,
|
|
123
|
+
...props
|
|
124
|
+
}: SortableItemProps): react_jsx_runtime228.JSX.Element;
|
|
125
|
+
interface SortableDragHandleProps extends React$1.ComponentProps<typeof Button> {
|
|
126
|
+
/** Accessible label for the handle. @default "Drag to reorder" */
|
|
127
|
+
label?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A grip button wired to its parent {@link SortableItem}'s drag listeners and
|
|
131
|
+
* activator ref. Use this when item content is interactive and you want only
|
|
132
|
+
* the handle to initiate a drag. Keyboard-operable: focus the handle and use
|
|
133
|
+
* Space/Enter then arrow keys to reorder.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* <SortableItem id={item.id}>
|
|
138
|
+
* <SortableDragHandle />
|
|
139
|
+
* <span>{item.label}</span>
|
|
140
|
+
* </SortableItem>
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
declare function SortableDragHandle({
|
|
144
|
+
label,
|
|
145
|
+
variant,
|
|
146
|
+
size,
|
|
147
|
+
className,
|
|
148
|
+
children,
|
|
149
|
+
...props
|
|
150
|
+
}: SortableDragHandleProps): react_jsx_runtime228.JSX.Element;
|
|
151
|
+
//#endregion
|
|
152
|
+
export { SortableDragHandle, SortableDragHandleProps, SortableItem, SortableItemProps, SortableList, SortableListItem, SortableListProps };
|
|
153
|
+
//# sourceMappingURL=sortable-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortable-list.d.ts","names":[],"sources":["../../src/components/sortable-list.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAoCA;AAKiB,UALA,gBAAA,CAKiB;EAAe;EAK1B,EAAA,EARjB,gBAQiB;;AAMC,UAXP,iBAWO,CAAA,cAXyB,gBAWzB,CAAA,CAAA;EAMH;;;;EAqBD,KAAA,EAjCX,aAiCW,CAjCG,KAiCH,CAAA;EASD;;AA8EnB;;EACE,SAAA,EAAA,CAAA,QAAA,EAnHsB,KAmHtB,EAAA,EAAA,GAAA,IAAA;EACA;;;;EAIA,UAAA,EAAA,CAAA,IAAA,EAlHmB,KAkHnB,EAAA,KAAA,EAAA,MAAA,EAAA,GAlH4C,OAAA,CAAM,SAkHlD;EACA;;;;EAEyB,QAAA,CAAA,EA/Gd,eA+Gc;EAAA;AA+E3B;;;EACU,QAAA,CAAA,EAAA,OAAA;EAAI;AAwBd;;;;;;EAME,eAAA,CAAA,EA9MkB,IA8MlB,CA7ME,eA6MF,EAAA,SAAA,GAAA,oBAAA,GAAA,WAAA,CAAA;EAEC;EAAiB,SAAA,CAAA,EAAA,MAAA;EAAA;EA6EH,cAAA,CAAA,EApRE,OAAA,CAAM,cAqRvB,CAAA,KAAoC,CAAA;AAmBtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA1NgB,2BAA2B;;;;;;;;;GASxC,kBAAkB,SAAM,oBAAA,CAAA,GAAA,CAAA;UA+EV,iBAAA,SACP,KAAK,OAAA,CAAM;;MAEf;;;;;;;;;;;;;;;;;;;iBAsBU,YAAA;;;;;;;;GAQb,oBAAiB,oBAAA,CAAA,GAAA,CAAA;UA6EH,uBAAA,SACP,OAAA,CAAM,sBAAsB;;;;;;;;;;;;;;;;;;iBAmBtB,kBAAA;;;;;;;GAOb,0BAAuB,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { t as cn } from "../utils-DUlptRpf.js";
|
|
4
|
+
import { t as Button } from "../button-DnHwqwy0.js";
|
|
5
|
+
import { GripVertical } from "lucide-react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
9
|
+
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
|
10
|
+
import { SortableContext, arrayMove, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
11
|
+
|
|
12
|
+
//#region src/components/sortable-list.tsx
|
|
13
|
+
const SortableItemContext = React$1.createContext(null);
|
|
14
|
+
function useSortableItemContext(component) {
|
|
15
|
+
const ctx = React$1.useContext(SortableItemContext);
|
|
16
|
+
if (!ctx) throw new Error(`<${component}> must be rendered inside a <SortableItem>.`);
|
|
17
|
+
return ctx;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Merge multiple refs (callback or object) into a single callback ref so the
|
|
21
|
+
* same node can be handed to several consumers. Used to apply both dnd-kit's
|
|
22
|
+
* sortable node ref and the activator node ref to one element.
|
|
23
|
+
*/
|
|
24
|
+
function mergeRefs(...refs) {
|
|
25
|
+
return (node) => {
|
|
26
|
+
for (const ref of refs) if (typeof ref === "function") ref(node);
|
|
27
|
+
else if (ref != null) ref.current = node;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Drag-and-drop sortable list. Wraps dnd-kit's `DndContext` +
|
|
32
|
+
* `SortableContext`, wires pointer and keyboard sensors, and restricts
|
|
33
|
+
* movement to the vertical axis. Fully keyboard-operable.
|
|
34
|
+
*
|
|
35
|
+
* This is a generic foundation primitive: it owns ordering/DnD plumbing and
|
|
36
|
+
* delegates the visual rendering of each row to `renderItem`, which should
|
|
37
|
+
* render a {@link SortableItem} (with an optional {@link SortableDragHandle}).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* const [items, setItems] = React.useState([
|
|
42
|
+
* { id: "1", label: "First" },
|
|
43
|
+
* { id: "2", label: "Second" },
|
|
44
|
+
* { id: "3", label: "Third" },
|
|
45
|
+
* ]);
|
|
46
|
+
*
|
|
47
|
+
* <SortableList
|
|
48
|
+
* items={items}
|
|
49
|
+
* onReorder={setItems}
|
|
50
|
+
* renderItem={(item) => (
|
|
51
|
+
* <SortableItem id={item.id} className="rounded-md border p-3">
|
|
52
|
+
* <SortableDragHandle />
|
|
53
|
+
* <span>{item.label}</span>
|
|
54
|
+
* </SortableItem>
|
|
55
|
+
* )}
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
function SortableList({ items, onReorder, renderItem, strategy = verticalListSortingStrategy, disabled = false, dndContextProps, className, containerProps }) {
|
|
60
|
+
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 8 } }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
61
|
+
const itemIds = React$1.useMemo(() => items.map((item) => item.id), [items]);
|
|
62
|
+
const handleDragEnd = React$1.useCallback((event) => {
|
|
63
|
+
const { active, over } = event;
|
|
64
|
+
if (!over || active.id === over.id) return;
|
|
65
|
+
const oldIndex = items.findIndex((item) => item.id === active.id);
|
|
66
|
+
const newIndex = items.findIndex((item) => item.id === over.id);
|
|
67
|
+
if (oldIndex === -1 || newIndex === -1) return;
|
|
68
|
+
onReorder(arrayMove(items.slice(), oldIndex, newIndex));
|
|
69
|
+
}, [items, onReorder]);
|
|
70
|
+
const { modifiers: customModifiers, ...restDndProps } = dndContextProps ?? {};
|
|
71
|
+
return /* @__PURE__ */ jsx(DndContext, {
|
|
72
|
+
sensors,
|
|
73
|
+
collisionDetection: closestCenter,
|
|
74
|
+
modifiers: customModifiers ?? [restrictToVerticalAxis],
|
|
75
|
+
onDragEnd: handleDragEnd,
|
|
76
|
+
...restDndProps,
|
|
77
|
+
children: /* @__PURE__ */ jsx(SortableContext, {
|
|
78
|
+
items: itemIds,
|
|
79
|
+
strategy,
|
|
80
|
+
disabled,
|
|
81
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
82
|
+
"data-slot": "sortable-list",
|
|
83
|
+
className: cn("flex w-full flex-col gap-2", className),
|
|
84
|
+
...containerProps,
|
|
85
|
+
children: /* @__PURE__ */ jsx(DisabledProvider, {
|
|
86
|
+
value: disabled,
|
|
87
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx(React$1.Fragment, { children: renderItem(item, index) }, item.id))
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const ListDisabledContext = React$1.createContext(false);
|
|
94
|
+
function DisabledProvider({ value, children }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(ListDisabledContext.Provider, {
|
|
96
|
+
value,
|
|
97
|
+
children
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A single sortable row. Wraps `useSortable`, applies the live transform /
|
|
102
|
+
* transition, and exposes the drag attributes + listeners to a nested
|
|
103
|
+
* {@link SortableDragHandle} via context.
|
|
104
|
+
*
|
|
105
|
+
* Render exactly one `SortableItem` per `renderItem` call, with an `id`
|
|
106
|
+
* matching the data item.
|
|
107
|
+
*/
|
|
108
|
+
function SortableItem({ id, dragOnItem = false, disabled, className, style, children, ...props }) {
|
|
109
|
+
const listDisabled = React$1.useContext(ListDisabledContext);
|
|
110
|
+
const isDisabled = disabled ?? listDisabled;
|
|
111
|
+
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable({
|
|
112
|
+
id,
|
|
113
|
+
disabled: isDisabled
|
|
114
|
+
});
|
|
115
|
+
const itemStyle = {
|
|
116
|
+
transform: transform ? `translate3d(${Math.round(transform.x)}px, ${Math.round(transform.y)}px, 0) scaleX(${transform.scaleX}) scaleY(${transform.scaleY})` : void 0,
|
|
117
|
+
transition,
|
|
118
|
+
...style
|
|
119
|
+
};
|
|
120
|
+
const contextValue = React$1.useMemo(() => ({
|
|
121
|
+
attributes,
|
|
122
|
+
listeners,
|
|
123
|
+
setActivatorNodeRef,
|
|
124
|
+
isDragging,
|
|
125
|
+
disabled: isDisabled
|
|
126
|
+
}), [
|
|
127
|
+
attributes,
|
|
128
|
+
listeners,
|
|
129
|
+
setActivatorNodeRef,
|
|
130
|
+
isDragging,
|
|
131
|
+
isDisabled
|
|
132
|
+
]);
|
|
133
|
+
const itemRef = React$1.useMemo(() => dragOnItem ? mergeRefs(setNodeRef, setActivatorNodeRef) : setNodeRef, [
|
|
134
|
+
dragOnItem,
|
|
135
|
+
setNodeRef,
|
|
136
|
+
setActivatorNodeRef
|
|
137
|
+
]);
|
|
138
|
+
const activatorProps = dragOnItem ? {
|
|
139
|
+
...attributes,
|
|
140
|
+
...listeners
|
|
141
|
+
} : {};
|
|
142
|
+
return /* @__PURE__ */ jsx(SortableItemContext.Provider, {
|
|
143
|
+
value: contextValue,
|
|
144
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
145
|
+
ref: itemRef,
|
|
146
|
+
"data-slot": "sortable-item",
|
|
147
|
+
"data-dragging": isDragging || void 0,
|
|
148
|
+
"data-disabled": isDisabled || void 0,
|
|
149
|
+
style: itemStyle,
|
|
150
|
+
className: cn("flex items-center gap-2 bg-background outline-none", isDragging && "z-10 opacity-80 shadow-md", dragOnItem && !isDisabled && "cursor-grab touch-none active:cursor-grabbing", className),
|
|
151
|
+
...activatorProps,
|
|
152
|
+
...props,
|
|
153
|
+
children
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A grip button wired to its parent {@link SortableItem}'s drag listeners and
|
|
159
|
+
* activator ref. Use this when item content is interactive and you want only
|
|
160
|
+
* the handle to initiate a drag. Keyboard-operable: focus the handle and use
|
|
161
|
+
* Space/Enter then arrow keys to reorder.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```tsx
|
|
165
|
+
* <SortableItem id={item.id}>
|
|
166
|
+
* <SortableDragHandle />
|
|
167
|
+
* <span>{item.label}</span>
|
|
168
|
+
* </SortableItem>
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
function SortableDragHandle({ label = "Drag to reorder", variant = "ghost", size = "icon-sm", className, children, ...props }) {
|
|
172
|
+
const { attributes, listeners, setActivatorNodeRef, disabled } = useSortableItemContext("SortableDragHandle");
|
|
173
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
174
|
+
ref: setActivatorNodeRef,
|
|
175
|
+
type: "button",
|
|
176
|
+
variant,
|
|
177
|
+
size,
|
|
178
|
+
"data-slot": "sortable-drag-handle",
|
|
179
|
+
"aria-label": label,
|
|
180
|
+
disabled,
|
|
181
|
+
className: cn("shrink-0 cursor-grab touch-none text-muted-foreground active:cursor-grabbing", className),
|
|
182
|
+
...attributes,
|
|
183
|
+
...listeners,
|
|
184
|
+
...props,
|
|
185
|
+
children: children ?? /* @__PURE__ */ jsx(GripVertical, { "aria-hidden": "true" })
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
export { SortableDragHandle, SortableItem, SortableList };
|
|
191
|
+
//# sourceMappingURL=sortable-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortable-list.js","names":["React","itemStyle: React.CSSProperties"],"sources":["../../src/components/sortable-list.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n DndContext,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DndContextProps,\n type DragEndEvent,\n type UniqueIdentifier,\n} from \"@dnd-kit/core\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n type SortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { GripVertical } from \"lucide-react\";\n\nimport { cn } from \"@px-ui/ui/lib/utils\";\nimport { Button } from \"@px-ui/ui/components/button\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Minimal shape every sortable item must satisfy: a stable, unique `id`.\n * Items may carry any additional fields — `SortableList` only reads `id`.\n */\nexport interface SortableListItem {\n /** Stable unique identifier used for drag tracking and reordering. */\n id: UniqueIdentifier;\n}\n\nexport interface SortableListProps<TItem extends SortableListItem> {\n /**\n * The ordered list of items to render. The order of this array is the\n * source of truth for the rendered order.\n */\n items: ReadonlyArray<TItem>;\n\n /**\n * Called when the user finishes a drag (or keyboard reorder) that changes\n * the order. Receives the full re-ordered array — wire this to your state.\n */\n onReorder: (newOrder: TItem[]) => void;\n\n /**\n * Render a single item. The returned node is expected to render a\n * {@link SortableItem} (directly or nested) keyed/identified by `item.id`.\n */\n renderItem: (item: TItem, index: number) => React.ReactNode;\n\n /**\n * Sorting strategy passed to the underlying `SortableContext`.\n * @default verticalListSortingStrategy\n */\n strategy?: SortingStrategy;\n\n /**\n * Disable all dragging for the whole list.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional props forwarded to the underlying dnd-kit `DndContext`\n * (e.g. accessibility announcements). Providing `modifiers` *replaces* the\n * default vertical-axis restriction — pass your own (e.g.\n * `restrictToHorizontalAxis`, alongside a matching `strategy`) for\n * non-vertical layouts, or `[]` to remove axis locking entirely.\n */\n dndContextProps?: Omit<\n DndContextProps,\n \"sensors\" | \"collisionDetection\" | \"onDragEnd\"\n >;\n\n /** Additional className for the list container. */\n className?: string;\n\n /** Props forwarded to the list container element. */\n containerProps?: React.ComponentProps<\"div\">;\n}\n\n// ============================================================================\n// Per-item context\n// ============================================================================\n\ntype SortableItemContextValue = {\n attributes: ReturnType<typeof useSortable>[\"attributes\"];\n listeners: ReturnType<typeof useSortable>[\"listeners\"];\n setActivatorNodeRef: ReturnType<typeof useSortable>[\"setActivatorNodeRef\"];\n isDragging: boolean;\n disabled: boolean;\n};\n\nconst SortableItemContext =\n React.createContext<SortableItemContextValue | null>(null);\n\nfunction useSortableItemContext(component: string): SortableItemContextValue {\n const ctx = React.useContext(SortableItemContext);\n if (!ctx) {\n throw new Error(`<${component}> must be rendered inside a <SortableItem>.`);\n }\n return ctx;\n}\n\n/**\n * Merge multiple refs (callback or object) into a single callback ref so the\n * same node can be handed to several consumers. Used to apply both dnd-kit's\n * sortable node ref and the activator node ref to one element.\n */\nfunction mergeRefs<T>(\n ...refs: Array<React.Ref<T> | undefined>\n): React.RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref != null) {\n (ref as React.MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n\n// ============================================================================\n// SortableList\n// ============================================================================\n\n/**\n * Drag-and-drop sortable list. Wraps dnd-kit's `DndContext` +\n * `SortableContext`, wires pointer and keyboard sensors, and restricts\n * movement to the vertical axis. Fully keyboard-operable.\n *\n * This is a generic foundation primitive: it owns ordering/DnD plumbing and\n * delegates the visual rendering of each row to `renderItem`, which should\n * render a {@link SortableItem} (with an optional {@link SortableDragHandle}).\n *\n * @example\n * ```tsx\n * const [items, setItems] = React.useState([\n * { id: \"1\", label: \"First\" },\n * { id: \"2\", label: \"Second\" },\n * { id: \"3\", label: \"Third\" },\n * ]);\n *\n * <SortableList\n * items={items}\n * onReorder={setItems}\n * renderItem={(item) => (\n * <SortableItem id={item.id} className=\"rounded-md border p-3\">\n * <SortableDragHandle />\n * <span>{item.label}</span>\n * </SortableItem>\n * )}\n * />\n * ```\n */\nexport function SortableList<TItem extends SortableListItem>({\n items,\n onReorder,\n renderItem,\n strategy = verticalListSortingStrategy,\n disabled = false,\n dndContextProps,\n className,\n containerProps,\n}: SortableListProps<TItem>) {\n const sensors = useSensors(\n useSensor(PointerSensor, {\n // Require a small drag distance before activating so clicks on\n // interactive content (and taps on `dragOnItem` rows) aren't swallowed.\n activationConstraint: { distance: 8 },\n }),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const itemIds = React.useMemo(() => items.map((item) => item.id), [items]);\n\n const handleDragEnd = React.useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n\n const oldIndex = items.findIndex((item) => item.id === active.id);\n const newIndex = items.findIndex((item) => item.id === over.id);\n if (oldIndex === -1 || newIndex === -1) return;\n\n onReorder(arrayMove(items.slice(), oldIndex, newIndex));\n },\n [items, onReorder],\n );\n\n const { modifiers: customModifiers, ...restDndProps } = dndContextProps ?? {};\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={customModifiers ?? [restrictToVerticalAxis]}\n onDragEnd={handleDragEnd}\n {...restDndProps}\n >\n <SortableContext items={itemIds} strategy={strategy} disabled={disabled}>\n <div\n data-slot=\"sortable-list\"\n className={cn(\"flex w-full flex-col gap-2\", className)}\n {...containerProps}\n >\n <DisabledProvider value={disabled}>\n {items.map((item, index) => (\n <React.Fragment key={item.id}>\n {renderItem(item, index)}\n </React.Fragment>\n ))}\n </DisabledProvider>\n </div>\n </SortableContext>\n </DndContext>\n );\n}\n\n// Propagates the list-level `disabled` to each SortableItem without forcing\n// the consumer to thread it through `renderItem`.\nconst ListDisabledContext = React.createContext<boolean>(false);\n\nfunction DisabledProvider({\n value,\n children,\n}: {\n value: boolean;\n children: React.ReactNode;\n}) {\n return (\n <ListDisabledContext.Provider value={value}>\n {children}\n </ListDisabledContext.Provider>\n );\n}\n\n// ============================================================================\n// SortableItem\n// ============================================================================\n\nexport interface SortableItemProps\n extends Omit<React.ComponentProps<\"div\">, \"id\"> {\n /** Must match the `id` of the corresponding entry in `SortableList.items`. */\n id: UniqueIdentifier;\n\n /**\n * When `true`, the entire item becomes the drag activator (the whole row is\n * draggable). When `false` (the default), provide a {@link SortableDragHandle}\n * inside to control dragging — better for items with interactive content.\n * @default false\n */\n dragOnItem?: boolean;\n\n /** Disable dragging for just this item. */\n disabled?: boolean;\n}\n\n/**\n * A single sortable row. Wraps `useSortable`, applies the live transform /\n * transition, and exposes the drag attributes + listeners to a nested\n * {@link SortableDragHandle} via context.\n *\n * Render exactly one `SortableItem` per `renderItem` call, with an `id`\n * matching the data item.\n */\nexport function SortableItem({\n id,\n dragOnItem = false,\n disabled,\n className,\n style,\n children,\n ...props\n}: SortableItemProps) {\n const listDisabled = React.useContext(ListDisabledContext);\n const isDisabled = disabled ?? listDisabled;\n\n const {\n attributes,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id, disabled: isDisabled });\n\n // Build the transform string locally (mirrors `CSS.Transform.toString` from\n // `@dnd-kit/utilities`) so we don't depend on that transitive package.\n const itemStyle: React.CSSProperties = {\n transform: transform\n ? `translate3d(${Math.round(transform.x)}px, ${Math.round(\n transform.y,\n )}px, 0) scaleX(${transform.scaleX}) scaleY(${transform.scaleY})`\n : undefined,\n transition,\n ...style,\n };\n\n const contextValue = React.useMemo<SortableItemContextValue>(\n () => ({\n attributes,\n listeners,\n setActivatorNodeRef,\n isDragging,\n disabled: isDisabled,\n }),\n [attributes, listeners, setActivatorNodeRef, isDragging, isDisabled],\n );\n\n // The sortable node ref must always be applied. When the whole item is the\n // activator, also wire the activator node ref (merged with the sortable ref)\n // plus the drag listeners/attributes onto the root element. Memoize the\n // merged ref so we don't detach/reattach the dnd-kit node on every render.\n const itemRef = React.useMemo(\n () =>\n dragOnItem ? mergeRefs(setNodeRef, setActivatorNodeRef) : setNodeRef,\n [dragOnItem, setNodeRef, setActivatorNodeRef],\n );\n const activatorProps = dragOnItem ? { ...attributes, ...listeners } : {};\n\n return (\n <SortableItemContext.Provider value={contextValue}>\n <div\n ref={itemRef}\n data-slot=\"sortable-item\"\n data-dragging={isDragging || undefined}\n data-disabled={isDisabled || undefined}\n style={itemStyle}\n className={cn(\n \"flex items-center gap-2 bg-background outline-none\",\n isDragging && \"z-10 opacity-80 shadow-md\",\n dragOnItem &&\n !isDisabled &&\n \"cursor-grab touch-none active:cursor-grabbing\",\n className,\n )}\n {...activatorProps}\n {...props}\n >\n {children}\n </div>\n </SortableItemContext.Provider>\n );\n}\n\n// ============================================================================\n// SortableDragHandle\n// ============================================================================\n\nexport interface SortableDragHandleProps\n extends React.ComponentProps<typeof Button> {\n /** Accessible label for the handle. @default \"Drag to reorder\" */\n label?: string;\n}\n\n/**\n * A grip button wired to its parent {@link SortableItem}'s drag listeners and\n * activator ref. Use this when item content is interactive and you want only\n * the handle to initiate a drag. Keyboard-operable: focus the handle and use\n * Space/Enter then arrow keys to reorder.\n *\n * @example\n * ```tsx\n * <SortableItem id={item.id}>\n * <SortableDragHandle />\n * <span>{item.label}</span>\n * </SortableItem>\n * ```\n */\nexport function SortableDragHandle({\n label = \"Drag to reorder\",\n variant = \"ghost\",\n size = \"icon-sm\",\n className,\n children,\n ...props\n}: SortableDragHandleProps) {\n const { attributes, listeners, setActivatorNodeRef, disabled } =\n useSortableItemContext(\"SortableDragHandle\");\n\n return (\n <Button\n ref={setActivatorNodeRef}\n type=\"button\"\n variant={variant}\n size={size}\n data-slot=\"sortable-drag-handle\"\n aria-label={label}\n disabled={disabled}\n className={cn(\n \"shrink-0 cursor-grab touch-none text-muted-foreground active:cursor-grabbing\",\n className,\n )}\n {...attributes}\n {...listeners}\n {...props}\n >\n {children ?? <GripVertical aria-hidden=\"true\" />}\n </Button>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAuGA,MAAM,sBACJA,QAAM,cAA+C,KAAK;AAE5D,SAAS,uBAAuB,WAA6C;CAC3E,MAAM,MAAMA,QAAM,WAAW,oBAAoB;AACjD,KAAI,CAAC,IACH,OAAM,IAAI,MAAM,IAAI,UAAU,6CAA6C;AAE7E,QAAO;;;;;;;AAQT,SAAS,UACP,GAAG,MACmB;AACtB,SAAQ,SA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ACC,KAAK;EACL,MAAK;EACI;EACH;EACN,aAAU;EACV,cAAY;EACF;EACV,WAAW,GACT,gFACA,UACD;EACD,GAAI;EACJ,GAAI;EACJ,GAAI;YAEH,YAAY,oBAAC,gBAAa,eAAY,SAAS;GACzC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Loader2Icon } from "lucide-react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime271 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/spinner.d.ts
|
|
5
5
|
declare function Spinner({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof Loader2Icon>):
|
|
8
|
+
}: React.ComponentProps<typeof Loader2Icon>): react_jsx_runtime271.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Spinner };
|
|
11
11
|
//# sourceMappingURL=spinner.d.ts.map
|