@alexgorbatchev/shadcn 0.0.0-stage → 0.0.12
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/LICENSE +21 -0
- package/README.md +349 -2
- package/THIRD_PARTY_NOTICES.md +105 -0
- package/dist/chunk-1j2hz3w9.js +16 -0
- package/dist/chunk-5wvvqege.js +259 -0
- package/dist/chunk-8a7dn9ps.js +93 -0
- package/dist/chunk-cp2m7y7v.js +26 -0
- package/dist/chunk-jpvw9xqy.js +4 -0
- package/dist/chunk-rajgnfbr.js +24 -0
- package/dist/chunk-rjjwytbx.js +12 -0
- package/dist/chunk-tnktkgvp.js +63 -0
- package/dist/chunk-z1fy613d.js +64 -0
- package/dist/components/Accordion.d.ts +12 -0
- package/dist/components/Alert.d.ts +15 -0
- package/dist/components/AlertDialog.d.ts +28 -0
- package/dist/components/AspectRatio.d.ts +5 -0
- package/dist/components/Attachment.d.ts +36 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Badge.d.ts +15 -0
- package/dist/components/Breadcrumb.d.ts +18 -0
- package/dist/components/Bubble.d.ts +25 -0
- package/dist/components/Button.d.ts +13 -0
- package/dist/components/ButtonGroup.d.ts +14 -0
- package/dist/components/Card.d.ts +19 -0
- package/dist/components/Checkbox.d.ts +6 -0
- package/dist/components/Collapsible.d.ts +6 -0
- package/dist/components/Combobox.d.ts +39 -0
- package/dist/components/ConfirmationDialog.d.ts +11 -0
- package/dist/components/ContextMenu.d.ts +24 -0
- package/dist/components/DensityProvider.d.ts +7 -0
- package/dist/components/Dialog.d.ts +25 -0
- package/dist/components/DirectionProvider.d.ts +1 -0
- package/dist/components/DragDropPreview.d.ts +7 -0
- package/dist/components/DragDropProvider.d.ts +6 -0
- package/dist/components/DragSource.d.ts +10 -0
- package/dist/components/Drawer.d.ts +25 -0
- package/dist/components/DropTarget.d.ts +11 -0
- package/dist/components/DropdownMenu.d.ts +26 -0
- package/dist/components/Empty.d.ts +19 -0
- package/dist/components/EmptyState.d.ts +8 -0
- package/dist/components/Field.d.ts +36 -0
- package/dist/components/HoverCard.d.ts +8 -0
- package/dist/components/ImagePicker.d.ts +11 -0
- package/dist/components/InlineEdit.d.ts +14 -0
- package/dist/components/Input.d.ts +6 -0
- package/dist/components/InputGroup.d.ts +26 -0
- package/dist/components/Item.d.ts +32 -0
- package/dist/components/JsonViewer.d.ts +8 -0
- package/dist/components/Kbd.d.ts +7 -0
- package/dist/components/Label.d.ts +5 -0
- package/dist/components/Marker.d.ts +19 -0
- package/dist/components/Menubar.d.ts +29 -0
- package/dist/components/Message.d.ts +17 -0
- package/dist/components/NativeSelect.d.ts +11 -0
- package/dist/components/NavigationMenu.d.ts +21 -0
- package/dist/components/Pagination.d.ts +21 -0
- package/dist/components/Popover.d.ts +14 -0
- package/dist/components/Progress.d.ts +14 -0
- package/dist/components/RadioGroup.d.ts +9 -0
- package/dist/components/ScrollArea.d.ts +10 -0
- package/dist/components/Select.d.ts +25 -0
- package/dist/components/Separator.d.ts +8 -0
- package/dist/components/Sheet.d.ts +20 -0
- package/dist/components/Sidebar.d.ts +60 -0
- package/dist/components/Skeleton.d.ts +5 -0
- package/dist/components/Slider.d.ts +6 -0
- package/dist/components/Spinner.d.ts +5 -0
- package/dist/components/StarRating.d.ts +10 -0
- package/dist/components/Switch.d.ts +8 -0
- package/dist/components/Table.d.ts +28 -0
- package/dist/components/Tabs.d.ts +16 -0
- package/dist/components/Textarea.d.ts +5 -0
- package/dist/components/ThemeProvider.d.ts +9 -0
- package/dist/components/Toast.d.ts +18 -0
- package/dist/components/Toggle.d.ts +11 -0
- package/dist/components/ToggleGroup.d.ts +12 -0
- package/dist/components/Tooltip.d.ts +9 -0
- package/dist/components/calendar/Calendar.d.ts +6 -0
- package/dist/components/calendar/getCalendarClassNames.d.ts +3 -0
- package/dist/components/calendar/index.d.ts +1 -0
- package/dist/components/calendar/index.js +10 -0
- package/dist/components/calendar/types.d.ts +9 -0
- package/dist/components/carousel/Carousel.d.ts +9 -0
- package/dist/components/carousel/CarouselContext.d.ts +2 -0
- package/dist/components/carousel/hooks/useCarousel.d.ts +2 -0
- package/dist/components/carousel/index.d.ts +3 -0
- package/dist/components/carousel/index.js +207 -0
- package/dist/components/carousel/types.d.ts +23 -0
- package/dist/components/chart/Chart.d.ts +10 -0
- package/dist/components/chart/ChartContext.d.ts +2 -0
- package/dist/components/chart/ChartStyle.d.ts +3 -0
- package/dist/components/chart/getPayloadConfigFromPayload.d.ts +2 -0
- package/dist/components/chart/hooks/useChart.d.ts +2 -0
- package/dist/components/chart/index.d.ts +3 -0
- package/dist/components/chart/index.js +284 -0
- package/dist/components/chart/types.d.ts +50 -0
- package/dist/components/command/Command.d.ts +21 -0
- package/dist/components/command/index.d.ts +1 -0
- package/dist/components/command/index.js +142 -0
- package/dist/components/input-otp/InputOTP.d.ts +12 -0
- package/dist/components/input-otp/index.d.ts +1 -0
- package/dist/components/input-otp/index.js +303 -0
- package/dist/components/message-scroller/MessageScroller.d.ts +16 -0
- package/dist/components/message-scroller/hooks/useMessageScroller.d.ts +1 -0
- package/dist/components/message-scroller/hooks/useMessageScrollerScrollable.d.ts +1 -0
- package/dist/components/message-scroller/hooks/useMessageScrollerVisibility.d.ts +1 -0
- package/dist/components/message-scroller/index.d.ts +5 -0
- package/dist/components/message-scroller/index.js +600 -0
- package/dist/components/persian-calendar/PersianCalendar.d.ts +6 -0
- package/dist/components/persian-calendar/index.d.ts +1 -0
- package/dist/components/persian-calendar/index.js +36 -0
- package/dist/components/questionnaire/Questionnaire.d.ts +20 -0
- package/dist/components/questionnaire/index.d.ts +2 -0
- package/dist/components/questionnaire/index.js +747 -0
- package/dist/components/resizable/Resizable.d.ts +10 -0
- package/dist/components/resizable/SplitView.d.ts +12 -0
- package/dist/components/resizable/index.d.ts +2 -0
- package/dist/components/resizable/index.js +147 -0
- package/dist/components/sonner/Sonner.d.ts +7 -0
- package/dist/components/sonner/hooks/useSonner.d.ts +1 -0
- package/dist/components/sonner/index.d.ts +2 -0
- package/dist/components/sonner/index.js +1273 -0
- package/dist/density/DensityContext.d.ts +2 -0
- package/dist/density/types.d.ts +4 -0
- package/dist/drag-drop/DragDropContext.d.ts +2 -0
- package/dist/drag-drop/types.d.ts +45 -0
- package/dist/drawer/DrawerContext.d.ts +2 -0
- package/dist/drawer/types.d.ts +7 -0
- package/dist/fonts.css +1 -0
- package/dist/hooks/useComboboxAnchor.d.ts +2 -0
- package/dist/hooks/useDensity.d.ts +2 -0
- package/dist/hooks/useDragDrop.d.ts +2 -0
- package/dist/hooks/useDragSource.d.ts +2 -0
- package/dist/hooks/useDrawer.d.ts +2 -0
- package/dist/hooks/useDropTarget.d.ts +2 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useObjectURL.d.ts +1 -0
- package/dist/hooks/useSidebar.d.ts +2 -0
- package/dist/hooks/useTheme.d.ts +2 -0
- package/dist/hooks/useToastManager.d.ts +2 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.js +4908 -0
- package/dist/menu/types.d.ts +14 -0
- package/dist/message/MessageContext.d.ts +2 -0
- package/dist/message/types.d.ts +7 -0
- package/dist/sidebar/SidebarContext.d.ts +2 -0
- package/dist/sidebar/types.d.ts +32 -0
- package/dist/theme/ThemeContext.d.ts +2 -0
- package/dist/theme/types.d.ts +8 -0
- package/dist/theme.css +454 -0
- package/dist/toggle-group/ToggleGroupContext.d.ts +2 -0
- package/dist/toggle-group/types.d.ts +5 -0
- package/dist/typeset.css +444 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +193 -4
- package/patches/@shadcn%2Freact@0.3.1.patch +35 -0
- package/patches/input-otp@1.5.0.patch +20 -0
- package/patches/sonner@2.0.8.patch +87 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { GroupProps, PanelProps, SeparatorProps } from "react-resizable-panels";
|
|
3
|
+
declare function Resizable({ className, ...props }: GroupProps): ReactElement;
|
|
4
|
+
declare function ResizablePanel(props: PanelProps): ReactElement;
|
|
5
|
+
type ResizableHandleProps = SeparatorProps & {
|
|
6
|
+
withHandle?: boolean;
|
|
7
|
+
thickness?: "default" | "strong";
|
|
8
|
+
};
|
|
9
|
+
declare function ResizableHandle({ withHandle, thickness, className, children, ...props }: ResizableHandleProps): ReactElement;
|
|
10
|
+
export { Resizable, Resizable as ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
interface ISplitViewProps {
|
|
3
|
+
sidebar: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
storageKey: string;
|
|
6
|
+
sidebarLabel: string;
|
|
7
|
+
contentLabel: string;
|
|
8
|
+
resizeLabel: string;
|
|
9
|
+
defaultSidebarSize?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function SplitView({ sidebar, children, storageKey, sidebarLabel, contentLabel, resizeLabel, defaultSidebarSize, }: ISplitViewProps): ReactElement;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn2
|
|
3
|
+
} from "../../chunk-cp2m7y7v.js";
|
|
4
|
+
import {
|
|
5
|
+
Separator2
|
|
6
|
+
} from "../../chunk-rajgnfbr.js";
|
|
7
|
+
|
|
8
|
+
// src/components/resizable/Resizable.tsx
|
|
9
|
+
import { Group, Panel, Separator } from "react-resizable-panels";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
function Resizable({ className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
13
|
+
"data-slot": "resizable-panel-group",
|
|
14
|
+
className: cn2("size-full", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function ResizablePanel(props) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Panel, {
|
|
20
|
+
"data-slot": "resizable-panel",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function ResizableHandle({
|
|
25
|
+
withHandle,
|
|
26
|
+
thickness = "default",
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsxs(Separator, {
|
|
32
|
+
"data-slot": "resizable-handle",
|
|
33
|
+
className: cn2("relative flex items-center justify-center bg-border outline-none focus-visible:ring-1 focus-visible:ring-ring aria-[orientation=horizontal]:w-full [&[aria-orientation=horizontal]>div]:rotate-90", thickness === "strong" ? "w-0.5 aria-[orientation=horizontal]:h-0.5" : "w-px aria-[orientation=horizontal]:h-px", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
withHandle && /* @__PURE__ */ jsx("div", {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: "flex h-control-sm w-1 shrink-0 bg-border"
|
|
39
|
+
}),
|
|
40
|
+
children
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
// src/components/resizable/SplitView.tsx
|
|
45
|
+
import { useDefaultLayout } from "react-resizable-panels";
|
|
46
|
+
|
|
47
|
+
// src/hooks/useMediaQuery.ts
|
|
48
|
+
import { useMemo, useSyncExternalStore } from "react";
|
|
49
|
+
function useMediaQuery(query) {
|
|
50
|
+
const media = useMemo(() => typeof window === "undefined" ? undefined : window.matchMedia(query), [query]);
|
|
51
|
+
return useSyncExternalStore((listener) => {
|
|
52
|
+
media?.addEventListener("change", listener);
|
|
53
|
+
return () => media?.removeEventListener("change", listener);
|
|
54
|
+
}, () => media?.matches ?? false, () => false);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/components/resizable/SplitView.tsx
|
|
58
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
59
|
+
var layoutStorage = {
|
|
60
|
+
getItem(key) {
|
|
61
|
+
try {
|
|
62
|
+
const raw = localStorage.getItem(key);
|
|
63
|
+
if (!raw)
|
|
64
|
+
return null;
|
|
65
|
+
const value = JSON.parse(raw);
|
|
66
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
67
|
+
return null;
|
|
68
|
+
return Object.values(value).every((size) => typeof size === "number" && Number.isFinite(size) && size >= 0 && size <= 100) ? raw : null;
|
|
69
|
+
} catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
setItem(key, value) {
|
|
74
|
+
try {
|
|
75
|
+
localStorage.setItem(key, value);
|
|
76
|
+
} catch {}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
function SplitView({
|
|
80
|
+
sidebar,
|
|
81
|
+
children,
|
|
82
|
+
storageKey,
|
|
83
|
+
sidebarLabel,
|
|
84
|
+
contentLabel,
|
|
85
|
+
resizeLabel,
|
|
86
|
+
defaultSidebarSize = 325
|
|
87
|
+
}) {
|
|
88
|
+
const isWide = useMediaQuery("(min-width: 1024px)");
|
|
89
|
+
const layout = useDefaultLayout({ id: storageKey, storage: layoutStorage, onlySaveAfterUserInteractions: true });
|
|
90
|
+
if (!isWide)
|
|
91
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
92
|
+
className: "flex min-w-0 flex-col bg-card",
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx2("aside", {
|
|
95
|
+
"aria-label": sidebarLabel,
|
|
96
|
+
className: "min-w-0 p-4",
|
|
97
|
+
children: sidebar
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ jsx2(Separator2, {
|
|
100
|
+
thickness: "strong"
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ jsx2("section", {
|
|
103
|
+
"aria-label": contentLabel,
|
|
104
|
+
className: "min-w-0 p-4",
|
|
105
|
+
children
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
});
|
|
109
|
+
return /* @__PURE__ */ jsxs2(Resizable, {
|
|
110
|
+
orientation: "horizontal",
|
|
111
|
+
defaultLayout: layout.defaultLayout,
|
|
112
|
+
onLayoutChanged: layout.onLayoutChanged,
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx2(ResizablePanel, {
|
|
115
|
+
id: "sidebar",
|
|
116
|
+
defaultSize: defaultSidebarSize,
|
|
117
|
+
minSize: 200,
|
|
118
|
+
maxSize: "50%",
|
|
119
|
+
children: /* @__PURE__ */ jsx2("aside", {
|
|
120
|
+
"aria-label": sidebarLabel,
|
|
121
|
+
className: "h-full min-w-0 bg-card p-4",
|
|
122
|
+
children: sidebar
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsx2(ResizableHandle, {
|
|
126
|
+
thickness: "strong",
|
|
127
|
+
"aria-label": resizeLabel
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ jsx2(ResizablePanel, {
|
|
130
|
+
id: "content",
|
|
131
|
+
minSize: "35%",
|
|
132
|
+
children: /* @__PURE__ */ jsx2("section", {
|
|
133
|
+
"aria-label": contentLabel,
|
|
134
|
+
className: "h-full min-w-0 bg-card p-4",
|
|
135
|
+
children
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
export {
|
|
142
|
+
Resizable,
|
|
143
|
+
ResizableHandle,
|
|
144
|
+
ResizablePanel,
|
|
145
|
+
Resizable as ResizablePanelGroup,
|
|
146
|
+
SplitView
|
|
147
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { ToasterProps } from "sonner";
|
|
3
|
+
import type { IDensityProps } from "../../density/types.js";
|
|
4
|
+
type SonnerProps = ToasterProps & IDensityProps;
|
|
5
|
+
declare function Sonner({ density, className, toastOptions, icons, theme, dir, expand, ...props }: SonnerProps): ReactElement;
|
|
6
|
+
export { Sonner, Sonner as SonnerToaster, Sonner as Toaster };
|
|
7
|
+
export { toast } from "sonner";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useSonner } from "sonner";
|