@alexgorbatchev/shadcn 0.0.30 → 0.0.32

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 (93) hide show
  1. package/README.md +26 -22
  2. package/THIRD_PARTY_NOTICES.md +10 -0
  3. package/dist/{chunk-0ewzb2ax.js → chunk-0kyfh857.js} +1 -1
  4. package/dist/chunk-1xncv9gb.js +19 -0
  5. package/dist/chunk-2dxa9enk.js +98 -0
  6. package/dist/{chunk-8wfy03bp.js → chunk-6kwf9644.js} +1 -1
  7. package/dist/{chunk-82e7fbmq.js → chunk-9vyg3854.js} +2 -1
  8. package/dist/chunk-c6g2rbhv.js +3940 -0
  9. package/dist/chunk-dzvsjw59.js +200 -0
  10. package/dist/{chunk-g238nezp.js → chunk-pg9rhbgm.js} +4 -2
  11. package/dist/{chunk-5da3rzn5.js → chunk-s0typ7hv.js} +1 -1
  12. package/dist/chunk-tch86q2w.js +6050 -0
  13. package/dist/{chunk-eehfrrdz.js → chunk-tnnf8ydf.js} +1 -15
  14. package/dist/chunk-yfr9syen.js +363 -0
  15. package/dist/{chunk-53q730zs.js → chunk-zdt8xxzy.js} +3 -0
  16. package/dist/components/Alert.d.ts +1 -1
  17. package/dist/components/Table.d.ts +1 -0
  18. package/dist/components/assistant-ui/elements/Chart.js +2 -2
  19. package/dist/components/assistant-ui/elements/GuardrailNotice.js +2 -2
  20. package/dist/components/assistant-ui/elements/OptionList.js +3 -2
  21. package/dist/components/assistant-ui/elements/QuestionFlow.js +4 -3
  22. package/dist/components/assistant-ui/index.js +8 -7
  23. package/dist/components/assistant-ui/native/Sources.d.ts +1 -1
  24. package/dist/components/carousel/index.js +15 -204
  25. package/dist/components/chart/AnalyticsChart.d.ts +3 -2
  26. package/dist/components/chart/Chart.d.ts +1 -1
  27. package/dist/components/chart/index.js +24 -10
  28. package/dist/components/chart/types.d.ts +1 -0
  29. package/dist/components/data-grid/DataGrid.d.ts +48 -9
  30. package/dist/components/data-grid/DataGridColumnOptions.d.ts +14 -0
  31. package/dist/components/data-grid/DataGridColumnResizer.d.ts +13 -0
  32. package/dist/components/data-grid/getDataGridColumnSizeVariables.d.ts +6 -0
  33. package/dist/components/data-grid/hooks/useDataGridColumnSizes.d.ts +8 -0
  34. package/dist/components/data-grid/index.d.ts +3 -2
  35. package/dist/components/data-grid/index.js +124 -199
  36. package/dist/components/data-grid/moveDataGridColumn.d.ts +5 -0
  37. package/dist/components/event-calendar/index.js +4 -2
  38. package/dist/components/json-render/JsonAccordion.d.ts +3 -0
  39. package/dist/components/json-render/JsonAlert.d.ts +3 -0
  40. package/dist/components/json-render/JsonAvatar.d.ts +3 -0
  41. package/dist/components/json-render/JsonBadge.d.ts +3 -0
  42. package/dist/components/json-render/JsonButton.d.ts +3 -0
  43. package/dist/components/json-render/JsonButtonGroup.d.ts +3 -0
  44. package/dist/components/json-render/JsonCard.d.ts +3 -0
  45. package/dist/components/json-render/JsonCarousel.d.ts +3 -0
  46. package/dist/components/json-render/JsonCheckbox.d.ts +3 -0
  47. package/dist/components/json-render/JsonCollapsible.d.ts +3 -0
  48. package/dist/components/json-render/JsonDialog.d.ts +3 -0
  49. package/dist/components/json-render/JsonDrawer.d.ts +3 -0
  50. package/dist/components/json-render/JsonDropdownMenu.d.ts +3 -0
  51. package/dist/components/json-render/JsonGrid.d.ts +3 -0
  52. package/dist/components/json-render/JsonHeading.d.ts +3 -0
  53. package/dist/components/json-render/JsonImage.d.ts +3 -0
  54. package/dist/components/json-render/JsonInput.d.ts +3 -0
  55. package/dist/components/json-render/JsonLink.d.ts +3 -0
  56. package/dist/components/json-render/JsonPagination.d.ts +3 -0
  57. package/dist/components/json-render/JsonPopover.d.ts +3 -0
  58. package/dist/components/json-render/JsonProgress.d.ts +3 -0
  59. package/dist/components/json-render/JsonRadio.d.ts +3 -0
  60. package/dist/components/json-render/JsonSelect.d.ts +3 -0
  61. package/dist/components/json-render/JsonSeparator.d.ts +3 -0
  62. package/dist/components/json-render/JsonSkeleton.d.ts +3 -0
  63. package/dist/components/json-render/JsonSlider.d.ts +3 -0
  64. package/dist/components/json-render/JsonSpinner.d.ts +3 -0
  65. package/dist/components/json-render/JsonStack.d.ts +3 -0
  66. package/dist/components/json-render/JsonSwitch.d.ts +3 -0
  67. package/dist/components/json-render/JsonTable.d.ts +3 -0
  68. package/dist/components/json-render/JsonTabs.d.ts +3 -0
  69. package/dist/components/json-render/JsonText.d.ts +3 -0
  70. package/dist/components/json-render/JsonTextarea.d.ts +3 -0
  71. package/dist/components/json-render/JsonToggle.d.ts +3 -0
  72. package/dist/components/json-render/JsonToggleGroup.d.ts +3 -0
  73. package/dist/components/json-render/JsonTooltip.d.ts +3 -0
  74. package/dist/components/json-render/catalog.d.ts +548 -0
  75. package/dist/components/json-render/catalog.js +6 -0
  76. package/dist/components/json-render/getPaginationRange.d.ts +1 -0
  77. package/dist/components/json-render/index.d.ts +39 -0
  78. package/dist/components/json-render/index.js +1254 -0
  79. package/dist/components/virtual-data-grid/VirtualDataGrid.d.ts +26 -0
  80. package/dist/components/virtual-data-grid/index.d.ts +2 -0
  81. package/dist/components/virtual-data-grid/index.js +88 -0
  82. package/dist/components/virtual-table/index.js +4 -96
  83. package/dist/index.d.ts +1 -0
  84. package/dist/index.js +569 -4189
  85. package/licenses/json-render-APACHE-2.0.txt +201 -0
  86. package/llms/components/data-display/AnalyticsChart.md +34 -0
  87. package/llms/components/data-display/DataGridColumnOptions.md +22 -0
  88. package/llms/components/data-display/JsonRender.md +476 -0
  89. package/llms/components/data-display/VirtualDataGrid.md +71 -0
  90. package/llms/components/feedback/Alert.md +20 -4
  91. package/llms/setup.md +26 -22
  92. package/llms.txt +3 -0
  93. package/package.json +24 -2
@@ -0,0 +1,200 @@
1
+ import {
2
+ cn2
3
+ } from "./chunk-cp2m7y7v.js";
4
+ import {
5
+ Button2
6
+ } from "./chunk-q7p28b89.js";
7
+
8
+ // src/components/carousel/Carousel.tsx
9
+ import { useCallback, useEffect, useState } from "react";
10
+ import useEmblaCarousel from "embla-carousel-react";
11
+ import { useDirection } from "@base-ui/react/direction-provider";
12
+ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from "lucide-react";
13
+
14
+ // src/components/carousel/CarouselContext.ts
15
+ import { createContext } from "react";
16
+ var CarouselContext = createContext(null);
17
+
18
+ // src/components/carousel/hooks/useCarousel.ts
19
+ import { useContext } from "react";
20
+ function useCarousel2() {
21
+ const context = useContext(CarouselContext);
22
+ if (!context)
23
+ throw new Error("useCarousel must be used within Carousel.");
24
+ return context;
25
+ }
26
+
27
+ // src/components/carousel/Carousel.tsx
28
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
29
+ function Carousel2({
30
+ density,
31
+ orientation = "horizontal",
32
+ opts,
33
+ setApi,
34
+ plugins,
35
+ className,
36
+ children,
37
+ onKeyDown,
38
+ ...props
39
+ }) {
40
+ const inheritedDirection = useDirection();
41
+ const direction = opts?.direction ?? inheritedDirection;
42
+ const [carouselRef, api] = useEmblaCarousel({
43
+ ...opts,
44
+ direction,
45
+ axis: orientation === "horizontal" ? "x" : "y",
46
+ breakpoints: {
47
+ ...opts?.breakpoints,
48
+ "(prefers-reduced-motion: reduce)": {
49
+ ...opts?.breakpoints?.["(prefers-reduced-motion: reduce)"],
50
+ duration: 0
51
+ }
52
+ }
53
+ }, plugins);
54
+ const [canScrollPrev, setCanScrollPrev] = useState(false);
55
+ const [canScrollNext, setCanScrollNext] = useState(false);
56
+ const scrollPrev = useCallback(() => api?.scrollPrev(), [api]);
57
+ const scrollNext = useCallback(() => api?.scrollNext(), [api]);
58
+ useEffect(() => {
59
+ if (!api)
60
+ return;
61
+ const update = () => {
62
+ setCanScrollPrev(api.canScrollPrev());
63
+ setCanScrollNext(api.canScrollNext());
64
+ };
65
+ update();
66
+ api.on("reInit", update);
67
+ api.on("select", update);
68
+ return () => {
69
+ api.off("reInit", update);
70
+ api.off("select", update);
71
+ };
72
+ }, [api]);
73
+ useEffect(() => {
74
+ if (api)
75
+ setApi?.(api);
76
+ }, [api, setApi]);
77
+ const handleKeyDown = (event) => {
78
+ onKeyDown?.(event);
79
+ if (event.defaultPrevented || event.target !== event.currentTarget)
80
+ return;
81
+ const previousKey = orientation === "vertical" ? "ArrowUp" : direction === "rtl" ? "ArrowRight" : "ArrowLeft";
82
+ const nextKey = orientation === "vertical" ? "ArrowDown" : direction === "rtl" ? "ArrowLeft" : "ArrowRight";
83
+ if (event.key === previousKey) {
84
+ event.preventDefault();
85
+ scrollPrev();
86
+ }
87
+ if (event.key === nextKey) {
88
+ event.preventDefault();
89
+ scrollNext();
90
+ }
91
+ };
92
+ return /* @__PURE__ */ jsx(CarouselContext.Provider, {
93
+ value: { carouselRef, api, orientation, direction, scrollPrev, scrollNext, canScrollPrev, canScrollNext },
94
+ children: /* @__PURE__ */ jsx("div", {
95
+ "data-slot": "carousel",
96
+ "data-density": density,
97
+ dir: direction,
98
+ role: "region",
99
+ "aria-roledescription": "carousel",
100
+ tabIndex: 0,
101
+ className: cn2("relative outline-none focus-visible:ring-1 focus-visible:ring-ring", className),
102
+ ...props,
103
+ onKeyDown: handleKeyDown,
104
+ children
105
+ })
106
+ });
107
+ }
108
+ function CarouselContent2({ className, ...props }) {
109
+ const { carouselRef, orientation } = useCarousel2();
110
+ return /* @__PURE__ */ jsx("div", {
111
+ ref: carouselRef,
112
+ "data-slot": "carousel-content",
113
+ className: "overflow-hidden",
114
+ children: /* @__PURE__ */ jsx("div", {
115
+ className: cn2("flex", orientation === "horizontal" ? "-ms-panel touch-pan-y touch-pinch-zoom" : "-mt-panel flex-col touch-pan-x touch-pinch-zoom", className),
116
+ ...props
117
+ })
118
+ });
119
+ }
120
+ function CarouselItem2({ className, ...props }) {
121
+ const { orientation } = useCarousel2();
122
+ return /* @__PURE__ */ jsx("div", {
123
+ role: "group",
124
+ "aria-roledescription": "slide",
125
+ "data-slot": "carousel-item",
126
+ className: cn2("min-h-0 min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "ps-panel" : "pt-panel", className),
127
+ ...props
128
+ });
129
+ }
130
+ function CarouselPrevious2({
131
+ className,
132
+ variant = "outline",
133
+ size = "icon-sm",
134
+ disabled,
135
+ onClick,
136
+ children,
137
+ ...props
138
+ }) {
139
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel2();
140
+ return /* @__PURE__ */ jsx(Button2, {
141
+ "data-slot": "carousel-previous",
142
+ variant,
143
+ size,
144
+ className: (state) => cn2("absolute touch-manipulation", orientation === "horizontal" ? "inset-y-0 -start-10 my-auto" : "-top-10 left-1/2 -translate-x-1/2", typeof className === "function" ? className(state) : className),
145
+ disabled: disabled || !canScrollPrev,
146
+ onClick: (event) => {
147
+ onClick?.(event);
148
+ if (!event.defaultPrevented)
149
+ scrollPrev();
150
+ },
151
+ ...props,
152
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, {
153
+ children: [
154
+ orientation === "horizontal" ? /* @__PURE__ */ jsx(ChevronLeftIcon, {
155
+ className: "rtl:rotate-180"
156
+ }) : /* @__PURE__ */ jsx(ChevronUpIcon, {}),
157
+ /* @__PURE__ */ jsx("span", {
158
+ className: "sr-only",
159
+ children: "Previous slide"
160
+ })
161
+ ]
162
+ })
163
+ });
164
+ }
165
+ function CarouselNext2({
166
+ className,
167
+ variant = "outline",
168
+ size = "icon-sm",
169
+ disabled,
170
+ onClick,
171
+ children,
172
+ ...props
173
+ }) {
174
+ const { orientation, scrollNext, canScrollNext } = useCarousel2();
175
+ return /* @__PURE__ */ jsx(Button2, {
176
+ "data-slot": "carousel-next",
177
+ variant,
178
+ size,
179
+ className: (state) => cn2("absolute touch-manipulation", orientation === "horizontal" ? "inset-y-0 -end-10 my-auto" : "-bottom-10 left-1/2 -translate-x-1/2", typeof className === "function" ? className(state) : className),
180
+ disabled: disabled || !canScrollNext,
181
+ onClick: (event) => {
182
+ onClick?.(event);
183
+ if (!event.defaultPrevented)
184
+ scrollNext();
185
+ },
186
+ ...props,
187
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, {
188
+ children: [
189
+ orientation === "horizontal" ? /* @__PURE__ */ jsx(ChevronRightIcon, {
190
+ className: "rtl:rotate-180"
191
+ }) : /* @__PURE__ */ jsx(ChevronDownIcon, {}),
192
+ /* @__PURE__ */ jsx("span", {
193
+ className: "sr-only",
194
+ children: "Next slide"
195
+ })
196
+ ]
197
+ })
198
+ });
199
+ }
200
+ export { useCarousel2, Carousel2, CarouselContent2, CarouselItem2, CarouselPrevious2, CarouselNext2 };
@@ -5,9 +5,11 @@ import {
5
5
  Button2
6
6
  } from "./chunk-q7p28b89.js";
7
7
  import {
8
- Checkbox2,
9
8
  Spinner2
10
- } from "./chunk-eehfrrdz.js";
9
+ } from "./chunk-1xncv9gb.js";
10
+ import {
11
+ Checkbox2
12
+ } from "./chunk-tnnf8ydf.js";
11
13
  import {
12
14
  useReceiptFocus
13
15
  } from "./chunk-vxvaaptq.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-vxvaaptq.js";
7
7
  import {
8
8
  OptionList2
9
- } from "./chunk-g238nezp.js";
9
+ } from "./chunk-pg9rhbgm.js";
10
10
 
11
11
  // src/components/assistant-ui/elements/QuestionFlow.tsx
12
12
  import { useCallback, useId, useLayoutEffect, useRef, useState } from "react";