@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.
Files changed (158) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +349 -2
  3. package/THIRD_PARTY_NOTICES.md +105 -0
  4. package/dist/chunk-1j2hz3w9.js +16 -0
  5. package/dist/chunk-5wvvqege.js +259 -0
  6. package/dist/chunk-8a7dn9ps.js +93 -0
  7. package/dist/chunk-cp2m7y7v.js +26 -0
  8. package/dist/chunk-jpvw9xqy.js +4 -0
  9. package/dist/chunk-rajgnfbr.js +24 -0
  10. package/dist/chunk-rjjwytbx.js +12 -0
  11. package/dist/chunk-tnktkgvp.js +63 -0
  12. package/dist/chunk-z1fy613d.js +64 -0
  13. package/dist/components/Accordion.d.ts +12 -0
  14. package/dist/components/Alert.d.ts +15 -0
  15. package/dist/components/AlertDialog.d.ts +28 -0
  16. package/dist/components/AspectRatio.d.ts +5 -0
  17. package/dist/components/Attachment.d.ts +36 -0
  18. package/dist/components/Avatar.d.ts +19 -0
  19. package/dist/components/Badge.d.ts +15 -0
  20. package/dist/components/Breadcrumb.d.ts +18 -0
  21. package/dist/components/Bubble.d.ts +25 -0
  22. package/dist/components/Button.d.ts +13 -0
  23. package/dist/components/ButtonGroup.d.ts +14 -0
  24. package/dist/components/Card.d.ts +19 -0
  25. package/dist/components/Checkbox.d.ts +6 -0
  26. package/dist/components/Collapsible.d.ts +6 -0
  27. package/dist/components/Combobox.d.ts +39 -0
  28. package/dist/components/ConfirmationDialog.d.ts +11 -0
  29. package/dist/components/ContextMenu.d.ts +24 -0
  30. package/dist/components/DensityProvider.d.ts +7 -0
  31. package/dist/components/Dialog.d.ts +25 -0
  32. package/dist/components/DirectionProvider.d.ts +1 -0
  33. package/dist/components/DragDropPreview.d.ts +7 -0
  34. package/dist/components/DragDropProvider.d.ts +6 -0
  35. package/dist/components/DragSource.d.ts +10 -0
  36. package/dist/components/Drawer.d.ts +25 -0
  37. package/dist/components/DropTarget.d.ts +11 -0
  38. package/dist/components/DropdownMenu.d.ts +26 -0
  39. package/dist/components/Empty.d.ts +19 -0
  40. package/dist/components/EmptyState.d.ts +8 -0
  41. package/dist/components/Field.d.ts +36 -0
  42. package/dist/components/HoverCard.d.ts +8 -0
  43. package/dist/components/ImagePicker.d.ts +11 -0
  44. package/dist/components/InlineEdit.d.ts +14 -0
  45. package/dist/components/Input.d.ts +6 -0
  46. package/dist/components/InputGroup.d.ts +26 -0
  47. package/dist/components/Item.d.ts +32 -0
  48. package/dist/components/JsonViewer.d.ts +8 -0
  49. package/dist/components/Kbd.d.ts +7 -0
  50. package/dist/components/Label.d.ts +5 -0
  51. package/dist/components/Marker.d.ts +19 -0
  52. package/dist/components/Menubar.d.ts +29 -0
  53. package/dist/components/Message.d.ts +17 -0
  54. package/dist/components/NativeSelect.d.ts +11 -0
  55. package/dist/components/NavigationMenu.d.ts +21 -0
  56. package/dist/components/Pagination.d.ts +21 -0
  57. package/dist/components/Popover.d.ts +14 -0
  58. package/dist/components/Progress.d.ts +14 -0
  59. package/dist/components/RadioGroup.d.ts +9 -0
  60. package/dist/components/ScrollArea.d.ts +10 -0
  61. package/dist/components/Select.d.ts +25 -0
  62. package/dist/components/Separator.d.ts +8 -0
  63. package/dist/components/Sheet.d.ts +20 -0
  64. package/dist/components/Sidebar.d.ts +60 -0
  65. package/dist/components/Skeleton.d.ts +5 -0
  66. package/dist/components/Slider.d.ts +6 -0
  67. package/dist/components/Spinner.d.ts +5 -0
  68. package/dist/components/StarRating.d.ts +10 -0
  69. package/dist/components/Switch.d.ts +8 -0
  70. package/dist/components/Table.d.ts +28 -0
  71. package/dist/components/Tabs.d.ts +16 -0
  72. package/dist/components/Textarea.d.ts +5 -0
  73. package/dist/components/ThemeProvider.d.ts +9 -0
  74. package/dist/components/Toast.d.ts +18 -0
  75. package/dist/components/Toggle.d.ts +11 -0
  76. package/dist/components/ToggleGroup.d.ts +12 -0
  77. package/dist/components/Tooltip.d.ts +9 -0
  78. package/dist/components/calendar/Calendar.d.ts +6 -0
  79. package/dist/components/calendar/getCalendarClassNames.d.ts +3 -0
  80. package/dist/components/calendar/index.d.ts +1 -0
  81. package/dist/components/calendar/index.js +10 -0
  82. package/dist/components/calendar/types.d.ts +9 -0
  83. package/dist/components/carousel/Carousel.d.ts +9 -0
  84. package/dist/components/carousel/CarouselContext.d.ts +2 -0
  85. package/dist/components/carousel/hooks/useCarousel.d.ts +2 -0
  86. package/dist/components/carousel/index.d.ts +3 -0
  87. package/dist/components/carousel/index.js +207 -0
  88. package/dist/components/carousel/types.d.ts +23 -0
  89. package/dist/components/chart/Chart.d.ts +10 -0
  90. package/dist/components/chart/ChartContext.d.ts +2 -0
  91. package/dist/components/chart/ChartStyle.d.ts +3 -0
  92. package/dist/components/chart/getPayloadConfigFromPayload.d.ts +2 -0
  93. package/dist/components/chart/hooks/useChart.d.ts +2 -0
  94. package/dist/components/chart/index.d.ts +3 -0
  95. package/dist/components/chart/index.js +284 -0
  96. package/dist/components/chart/types.d.ts +50 -0
  97. package/dist/components/command/Command.d.ts +21 -0
  98. package/dist/components/command/index.d.ts +1 -0
  99. package/dist/components/command/index.js +142 -0
  100. package/dist/components/input-otp/InputOTP.d.ts +12 -0
  101. package/dist/components/input-otp/index.d.ts +1 -0
  102. package/dist/components/input-otp/index.js +303 -0
  103. package/dist/components/message-scroller/MessageScroller.d.ts +16 -0
  104. package/dist/components/message-scroller/hooks/useMessageScroller.d.ts +1 -0
  105. package/dist/components/message-scroller/hooks/useMessageScrollerScrollable.d.ts +1 -0
  106. package/dist/components/message-scroller/hooks/useMessageScrollerVisibility.d.ts +1 -0
  107. package/dist/components/message-scroller/index.d.ts +5 -0
  108. package/dist/components/message-scroller/index.js +600 -0
  109. package/dist/components/persian-calendar/PersianCalendar.d.ts +6 -0
  110. package/dist/components/persian-calendar/index.d.ts +1 -0
  111. package/dist/components/persian-calendar/index.js +36 -0
  112. package/dist/components/questionnaire/Questionnaire.d.ts +20 -0
  113. package/dist/components/questionnaire/index.d.ts +2 -0
  114. package/dist/components/questionnaire/index.js +747 -0
  115. package/dist/components/resizable/Resizable.d.ts +10 -0
  116. package/dist/components/resizable/SplitView.d.ts +12 -0
  117. package/dist/components/resizable/index.d.ts +2 -0
  118. package/dist/components/resizable/index.js +147 -0
  119. package/dist/components/sonner/Sonner.d.ts +7 -0
  120. package/dist/components/sonner/hooks/useSonner.d.ts +1 -0
  121. package/dist/components/sonner/index.d.ts +2 -0
  122. package/dist/components/sonner/index.js +1273 -0
  123. package/dist/density/DensityContext.d.ts +2 -0
  124. package/dist/density/types.d.ts +4 -0
  125. package/dist/drag-drop/DragDropContext.d.ts +2 -0
  126. package/dist/drag-drop/types.d.ts +45 -0
  127. package/dist/drawer/DrawerContext.d.ts +2 -0
  128. package/dist/drawer/types.d.ts +7 -0
  129. package/dist/fonts.css +1 -0
  130. package/dist/hooks/useComboboxAnchor.d.ts +2 -0
  131. package/dist/hooks/useDensity.d.ts +2 -0
  132. package/dist/hooks/useDragDrop.d.ts +2 -0
  133. package/dist/hooks/useDragSource.d.ts +2 -0
  134. package/dist/hooks/useDrawer.d.ts +2 -0
  135. package/dist/hooks/useDropTarget.d.ts +2 -0
  136. package/dist/hooks/useMediaQuery.d.ts +1 -0
  137. package/dist/hooks/useObjectURL.d.ts +1 -0
  138. package/dist/hooks/useSidebar.d.ts +2 -0
  139. package/dist/hooks/useTheme.d.ts +2 -0
  140. package/dist/hooks/useToastManager.d.ts +2 -0
  141. package/dist/index.d.ts +82 -0
  142. package/dist/index.js +4908 -0
  143. package/dist/menu/types.d.ts +14 -0
  144. package/dist/message/MessageContext.d.ts +2 -0
  145. package/dist/message/types.d.ts +7 -0
  146. package/dist/sidebar/SidebarContext.d.ts +2 -0
  147. package/dist/sidebar/types.d.ts +32 -0
  148. package/dist/theme/ThemeContext.d.ts +2 -0
  149. package/dist/theme/types.d.ts +8 -0
  150. package/dist/theme.css +454 -0
  151. package/dist/toggle-group/ToggleGroupContext.d.ts +2 -0
  152. package/dist/toggle-group/types.d.ts +5 -0
  153. package/dist/typeset.css +444 -0
  154. package/dist/utils/cn.d.ts +2 -0
  155. package/package.json +193 -4
  156. package/patches/@shadcn%2Freact@0.3.1.patch +35 -0
  157. package/patches/input-otp@1.5.0.patch +20 -0
  158. 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,2 @@
1
+ export { Resizable, ResizablePanelGroup, ResizablePanel, ResizableHandle } from "./Resizable.js";
2
+ export { SplitView } from "./SplitView.js";
@@ -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";
@@ -0,0 +1,2 @@
1
+ export { Sonner, SonnerToaster, Toaster, toast } from "./Sonner.js";
2
+ export { useSonner } from "./hooks/useSonner.js";