@hanzo/ui 5.3.28 → 5.3.30
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/3d/button.js +298 -0
- package/dist/3d/button.mjs +273 -0
- package/dist/3d/card.js +234 -0
- package/dist/3d/card.mjs +207 -0
- package/dist/3d/carousel.js +371 -0
- package/dist/3d/carousel.mjs +344 -0
- package/dist/3d/grid.js +362 -0
- package/dist/3d/grid.mjs +337 -0
- package/dist/3d/index.js +1518 -0
- package/dist/3d/index.mjs +1472 -0
- package/dist/3d/marquee.js +352 -0
- package/dist/3d/marquee.mjs +327 -0
- package/dist/3d/pin.js +46 -0
- package/dist/3d/pin.mjs +24 -0
- package/dist/accordion.js +80 -0
- package/dist/accordion.mjs +55 -0
- package/dist/alert-dialog.js +220 -0
- package/dist/alert-dialog.mjs +187 -0
- package/dist/alert.js +68 -0
- package/dist/alert.mjs +64 -0
- package/dist/animation/animated-background.js +424 -0
- package/dist/animation/animated-background.mjs +418 -0
- package/dist/animation/animated-beam.js +119 -0
- package/dist/animation/animated-beam.mjs +97 -0
- package/dist/animation/animated-cursor.js +275 -0
- package/dist/animation/animated-cursor.mjs +270 -0
- package/dist/animation/animated-icon.js +357 -0
- package/dist/animation/animated-icon.mjs +351 -0
- package/dist/animation/animated-list.js +339 -0
- package/dist/animation/animated-list.mjs +333 -0
- package/dist/animation/animated-number.js +283 -0
- package/dist/animation/animated-number.mjs +277 -0
- package/dist/animation/animated-testimonials.js +97 -0
- package/dist/animation/animated-testimonials.mjs +75 -0
- package/dist/animation/animated-tooltip.js +67 -0
- package/dist/animation/animated-tooltip.mjs +45 -0
- package/dist/animation/apple-cards-carousel.js +308 -0
- package/dist/animation/apple-cards-carousel.mjs +285 -0
- package/dist/animation/apple-hello-effect.js +60 -0
- package/dist/animation/apple-hello-effect.mjs +38 -0
- package/dist/animation/index.js +1952 -0
- package/dist/animation/index.mjs +1921 -0
- package/dist/avatar.js +71 -0
- package/dist/avatar.mjs +47 -0
- package/dist/badge.js +66 -0
- package/dist/badge.mjs +40 -0
- package/dist/blocks/index.js +1665 -0
- package/dist/blocks/index.mjs +1626 -0
- package/dist/breadcrumb.js +107 -0
- package/dist/breadcrumb.mjs +99 -0
- package/dist/calendar.js +189 -0
- package/dist/calendar.mjs +164 -0
- package/dist/carousel.js +278 -0
- package/dist/carousel.mjs +249 -0
- package/dist/checkbox.js +60 -0
- package/dist/checkbox.mjs +35 -0
- package/dist/code/block.js +226 -0
- package/dist/code/block.mjs +203 -0
- package/dist/code/compare.js +446 -0
- package/dist/code/compare.mjs +423 -0
- package/dist/code/diff.js +430 -0
- package/dist/code/diff.mjs +407 -0
- package/dist/code/editor.js +243 -0
- package/dist/code/editor.mjs +218 -0
- package/dist/code/explorer.js +291 -0
- package/dist/code/explorer.mjs +268 -0
- package/dist/code/index.js +2551 -0
- package/dist/code/index.mjs +2510 -0
- package/dist/code/preview.js +400 -0
- package/dist/code/preview.mjs +377 -0
- package/dist/code/snippet.js +274 -0
- package/dist/code/snippet.mjs +250 -0
- package/dist/code/tabs.js +75 -0
- package/dist/code/tabs.mjs +53 -0
- package/dist/code/terminal.js +437 -0
- package/dist/code/terminal.mjs +414 -0
- package/dist/collapsible.js +33 -0
- package/dist/collapsible.mjs +9 -0
- package/dist/command.js +262 -0
- package/dist/command.mjs +232 -0
- package/dist/context-menu.js +207 -0
- package/dist/context-menu.mjs +171 -0
- package/dist/device/index.js +3 -0
- package/dist/device/index.mjs +2 -0
- package/dist/dialog.js +151 -0
- package/dist/dialog.mjs +121 -0
- package/dist/dock/basic.js +174 -0
- package/dist/dock/basic.mjs +151 -0
- package/dist/dock/index.js +628 -0
- package/dist/dock/index.mjs +601 -0
- package/dist/dock/limelight-nav.js +295 -0
- package/dist/dock/limelight-nav.mjs +274 -0
- package/dist/dock/macos.js +141 -0
- package/dist/dock/macos.mjs +118 -0
- package/dist/dock/menu.js +70 -0
- package/dist/dock/menu.mjs +48 -0
- package/dist/dock/message.js +144 -0
- package/dist/dock/message.mjs +122 -0
- package/dist/drawer.js +115 -0
- package/dist/drawer.mjs +103 -0
- package/dist/dropdown-menu.js +202 -0
- package/dist/dropdown-menu.mjs +166 -0
- package/dist/finance/AdvancedChart.js +48 -0
- package/dist/finance/AdvancedChart.mjs +46 -0
- package/dist/finance/CompanyProfile.js +48 -0
- package/dist/finance/CompanyProfile.mjs +46 -0
- package/dist/finance/CryptoScreener.js +45 -0
- package/dist/finance/CryptoScreener.mjs +43 -0
- package/dist/finance/Financials.js +52 -0
- package/dist/finance/Financials.mjs +50 -0
- package/dist/finance/ForexScreener.js +46 -0
- package/dist/finance/ForexScreener.mjs +44 -0
- package/dist/finance/MarketOverview.js +104 -0
- package/dist/finance/MarketOverview.mjs +102 -0
- package/dist/finance/NewsTimeline.js +44 -0
- package/dist/finance/NewsTimeline.mjs +42 -0
- package/dist/finance/OrderEntry.js +131 -0
- package/dist/finance/OrderEntry.mjs +129 -0
- package/dist/finance/OrdersHistory.js +64 -0
- package/dist/finance/OrdersHistory.mjs +62 -0
- package/dist/finance/PositionsList.js +80 -0
- package/dist/finance/PositionsList.mjs +78 -0
- package/dist/finance/StockScreener.js +46 -0
- package/dist/finance/StockScreener.mjs +44 -0
- package/dist/finance/SymbolInfo.js +46 -0
- package/dist/finance/SymbolInfo.mjs +44 -0
- package/dist/finance/TechnicalAnalysis.js +54 -0
- package/dist/finance/TechnicalAnalysis.mjs +52 -0
- package/dist/finance/TickerTape.js +56 -0
- package/dist/finance/TickerTape.mjs +54 -0
- package/dist/finance/TradingPanel.js +191 -0
- package/dist/finance/TradingPanel.mjs +189 -0
- package/dist/finance/index.js +930 -0
- package/dist/finance/index.mjs +914 -0
- package/dist/form/index.js +155 -0
- package/dist/form/index.mjs +125 -0
- package/dist/form.js +172 -0
- package/dist/form.mjs +142 -0
- package/dist/hover-card.js +58 -0
- package/dist/hover-card.mjs +34 -0
- package/dist/index.js +8467 -0
- package/dist/index.mjs +8087 -0
- package/dist/input-otp.js +79 -0
- package/dist/input-otp.mjs +54 -0
- package/dist/lib/utils.js +28 -0
- package/dist/lib/utils.mjs +24 -0
- package/dist/navigation/index.js +98 -0
- package/dist/navigation/index.mjs +79 -0
- package/dist/navigation-menu.js +149 -0
- package/dist/navigation-menu.mjs +116 -0
- package/dist/pattern/grid-pattern.js +333 -0
- package/dist/pattern/grid-pattern.mjs +310 -0
- package/dist/pattern/index.js +333 -0
- package/dist/pattern/index.mjs +310 -0
- package/dist/popover.js +63 -0
- package/dist/popover.mjs +37 -0
- package/dist/primitives/index.js +8467 -0
- package/dist/primitives/index.mjs +8087 -0
- package/dist/primitives-export.js +8467 -0
- package/dist/primitives-export.mjs +8087 -0
- package/dist/progress.js +62 -0
- package/dist/progress.mjs +37 -0
- package/dist/project/gantt.js +65 -0
- package/dist/project/gantt.mjs +43 -0
- package/dist/project/index.js +636 -0
- package/dist/project/index.mjs +611 -0
- package/dist/project/kanban.js +597 -0
- package/dist/project/kanban.mjs +572 -0
- package/dist/project/list.js +35 -0
- package/dist/project/list.mjs +12 -0
- package/dist/radio-group.js +68 -0
- package/dist/radio-group.mjs +45 -0
- package/dist/resizable.js +72 -0
- package/dist/resizable.mjs +48 -0
- package/dist/scroll-area.js +89 -0
- package/dist/scroll-area.mjs +66 -0
- package/dist/select.js +140 -0
- package/dist/select.mjs +111 -0
- package/dist/separator.js +59 -0
- package/dist/separator.mjs +34 -0
- package/dist/sheet.js +148 -0
- package/dist/sheet.mjs +117 -0
- package/dist/skeleton.js +32 -0
- package/dist/skeleton.mjs +27 -0
- package/dist/slider.js +99 -0
- package/dist/slider.mjs +73 -0
- package/dist/sonner.js +34 -0
- package/dist/sonner.mjs +29 -0
- package/dist/switch.js +62 -0
- package/dist/switch.mjs +37 -0
- package/dist/table.js +110 -0
- package/dist/table.mjs +101 -0
- package/dist/tabs.js +82 -0
- package/dist/tabs.mjs +57 -0
- package/dist/tailwind/index.js +2023 -0
- package/dist/tailwind/index.mjs +2011 -0
- package/dist/textarea.js +78 -0
- package/dist/textarea.mjs +56 -0
- package/dist/toggle-group.js +118 -0
- package/dist/toggle-group.mjs +93 -0
- package/dist/toggle.js +71 -0
- package/dist/toggle.mjs +48 -0
- package/dist/tooltip.js +67 -0
- package/dist/tooltip.mjs +40 -0
- package/dist/types/index.js +57 -0
- package/dist/types/index.mjs +51 -0
- package/dist/ui/announcement.js +129 -0
- package/dist/ui/announcement.mjs +107 -0
- package/dist/ui/avatar-group.js +88 -0
- package/dist/ui/avatar-group.mjs +65 -0
- package/dist/ui/banner.js +85 -0
- package/dist/ui/banner.mjs +62 -0
- package/dist/ui/cursor.js +78 -0
- package/dist/ui/cursor.mjs +56 -0
- package/dist/ui/index.js +475 -0
- package/dist/ui/index.mjs +442 -0
- package/dist/ui/marquee.js +74 -0
- package/dist/ui/marquee.mjs +52 -0
- package/dist/ui/pill.js +85 -0
- package/dist/ui/pill.mjs +62 -0
- package/dist/ui/spinner.js +28 -0
- package/dist/ui/spinner.mjs +26 -0
- package/dist/ui/tags.js +101 -0
- package/dist/ui/tags.mjs +79 -0
- package/dist/ui/ticker.js +73 -0
- package/dist/ui/ticker.mjs +51 -0
- package/dist/util/index.js +463 -0
- package/dist/util/index.mjs +404 -0
- package/package.json +1 -1
package/dist/carousel.js
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React2 = require('react');
|
|
5
|
+
var useEmblaCarousel = require('embla-carousel-react');
|
|
6
|
+
var lucideReact = require('lucide-react');
|
|
7
|
+
var clsx = require('clsx');
|
|
8
|
+
var tailwindMerge = require('tailwind-merge');
|
|
9
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
10
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n.default = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
34
|
+
var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
|
|
35
|
+
|
|
36
|
+
var __defProp = Object.defineProperty;
|
|
37
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
38
|
+
function cn(...inputs) {
|
|
39
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
40
|
+
}
|
|
41
|
+
__name(cn, "cn");
|
|
42
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
43
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
44
|
+
{
|
|
45
|
+
variants: {
|
|
46
|
+
variant: {
|
|
47
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
48
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
49
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
50
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
51
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
52
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
53
|
+
// Keep the additional Hanzo variants for backward compatibility
|
|
54
|
+
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
55
|
+
linkFG: "text-primary underline-offset-4 hover:underline",
|
|
56
|
+
linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
|
|
57
|
+
},
|
|
58
|
+
size: {
|
|
59
|
+
default: "h-9 px-4 py-2",
|
|
60
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
61
|
+
lg: "h-10 rounded-md px-8",
|
|
62
|
+
icon: "h-9 w-9"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
variant: "default",
|
|
67
|
+
size: "default"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
var Button = React2__namespace.forwardRef(
|
|
72
|
+
({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
73
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
74
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
75
|
+
Comp,
|
|
76
|
+
{
|
|
77
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
78
|
+
ref,
|
|
79
|
+
...props,
|
|
80
|
+
children: [
|
|
81
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
lucideReact.Loader2,
|
|
83
|
+
{
|
|
84
|
+
className: cn("h-4 w-4 animate-spin", size !== "icon" && "mr-2")
|
|
85
|
+
}
|
|
86
|
+
) : null,
|
|
87
|
+
isLoading && size === "icon" ? null : children
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
Button.displayName = "Button";
|
|
94
|
+
var button_default = Button;
|
|
95
|
+
var CarouselContext = React2__namespace.createContext(null);
|
|
96
|
+
var useCarousel = /* @__PURE__ */ __name(() => {
|
|
97
|
+
const service = React2__namespace.useContext(CarouselContext);
|
|
98
|
+
if (!service) {
|
|
99
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
100
|
+
}
|
|
101
|
+
return service;
|
|
102
|
+
}, "useCarousel");
|
|
103
|
+
var Carousel = React2__namespace.forwardRef(
|
|
104
|
+
({
|
|
105
|
+
orientation = "horizontal",
|
|
106
|
+
options,
|
|
107
|
+
setApi,
|
|
108
|
+
plugins,
|
|
109
|
+
className,
|
|
110
|
+
children,
|
|
111
|
+
onCarouselSelect,
|
|
112
|
+
...props
|
|
113
|
+
}, ref) => {
|
|
114
|
+
const [carouselRef, api] = useEmblaCarousel__default.default({ ...options, axis: orientation === "horizontal" ? "x" : "y" }, plugins);
|
|
115
|
+
const [canScrollPrev, setCanScrollPrev] = React2__namespace.useState(false);
|
|
116
|
+
const [canScrollNext, setCanScrollNext] = React2__namespace.useState(false);
|
|
117
|
+
const onSelect = React2__namespace.useCallback((api2) => {
|
|
118
|
+
if (!api2) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
122
|
+
setCanScrollNext(api2.canScrollNext());
|
|
123
|
+
if (onCarouselSelect) {
|
|
124
|
+
onCarouselSelect(api2);
|
|
125
|
+
}
|
|
126
|
+
}, []);
|
|
127
|
+
const scrollPrev = React2__namespace.useCallback(() => {
|
|
128
|
+
api?.scrollPrev();
|
|
129
|
+
}, [api]);
|
|
130
|
+
const scrollNext = React2__namespace.useCallback(() => {
|
|
131
|
+
api?.scrollNext();
|
|
132
|
+
}, [api]);
|
|
133
|
+
const handleKeyDown = React2__namespace.useCallback((event) => {
|
|
134
|
+
if (event.key === "ArrowLeft") {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
scrollPrev();
|
|
137
|
+
} else if (event.key === "ArrowRight") {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
scrollNext();
|
|
140
|
+
}
|
|
141
|
+
}, [scrollPrev, scrollNext]);
|
|
142
|
+
React2__namespace.useEffect(() => {
|
|
143
|
+
if (!api || !setApi) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
setApi(api);
|
|
147
|
+
}, [api, setApi]);
|
|
148
|
+
React2__namespace.useEffect(() => {
|
|
149
|
+
if (!api) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
onSelect(api);
|
|
153
|
+
api.on("reInit", onSelect);
|
|
154
|
+
api.on("select", onSelect);
|
|
155
|
+
return () => {
|
|
156
|
+
api?.off("select", onSelect);
|
|
157
|
+
};
|
|
158
|
+
}, [api, onSelect]);
|
|
159
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
160
|
+
CarouselContext.Provider,
|
|
161
|
+
{
|
|
162
|
+
value: {
|
|
163
|
+
carouselRef,
|
|
164
|
+
api,
|
|
165
|
+
options,
|
|
166
|
+
orientation: orientation || (options?.axis === "y" ? "vertical" : "horizontal"),
|
|
167
|
+
scrollPrev,
|
|
168
|
+
scrollNext,
|
|
169
|
+
canScrollPrev,
|
|
170
|
+
canScrollNext
|
|
171
|
+
},
|
|
172
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
ref,
|
|
176
|
+
onKeyDownCapture: handleKeyDown,
|
|
177
|
+
className: cn("relative", className),
|
|
178
|
+
role: "region",
|
|
179
|
+
"aria-roledescription": "carousel",
|
|
180
|
+
"data-vaul-no-drag": true,
|
|
181
|
+
...props,
|
|
182
|
+
children
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
Carousel.displayName = "Carousel";
|
|
190
|
+
var CarouselContent = React2__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
191
|
+
const { carouselRef, orientation } = useCarousel();
|
|
192
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-vaul-no-drag": true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
ref,
|
|
196
|
+
className: cn(
|
|
197
|
+
"flex",
|
|
198
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
199
|
+
className
|
|
200
|
+
),
|
|
201
|
+
...props
|
|
202
|
+
}
|
|
203
|
+
) });
|
|
204
|
+
});
|
|
205
|
+
CarouselContent.displayName = "CarouselContent";
|
|
206
|
+
var CarouselItem = React2__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
207
|
+
const { orientation } = useCarousel();
|
|
208
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
ref,
|
|
212
|
+
role: "group",
|
|
213
|
+
"aria-roledescription": "slide",
|
|
214
|
+
"data-vaul-no-drag": true,
|
|
215
|
+
className: cn(
|
|
216
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
217
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
218
|
+
className
|
|
219
|
+
),
|
|
220
|
+
...props
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
});
|
|
224
|
+
CarouselItem.displayName = "CarouselItem";
|
|
225
|
+
var CarouselPrevious = React2__namespace.forwardRef(({ className, variant = "ghost", size = "icon", ...props }, ref) => {
|
|
226
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
227
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
228
|
+
button_default,
|
|
229
|
+
{
|
|
230
|
+
ref,
|
|
231
|
+
variant,
|
|
232
|
+
size,
|
|
233
|
+
className: cn(
|
|
234
|
+
"absolute h-8 w-8 rounded-full",
|
|
235
|
+
orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
236
|
+
className
|
|
237
|
+
),
|
|
238
|
+
disabled: !canScrollPrev,
|
|
239
|
+
onClick: scrollPrev,
|
|
240
|
+
...props,
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "h-4 w-4" }),
|
|
243
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
});
|
|
248
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
249
|
+
var CarouselNext = React2__namespace.forwardRef(({ className, variant = "ghost", size = "icon", ...props }, ref) => {
|
|
250
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
251
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
252
|
+
button_default,
|
|
253
|
+
{
|
|
254
|
+
ref,
|
|
255
|
+
variant,
|
|
256
|
+
size,
|
|
257
|
+
className: cn(
|
|
258
|
+
"absolute h-8 w-8 rounded-full",
|
|
259
|
+
orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
260
|
+
className
|
|
261
|
+
),
|
|
262
|
+
disabled: !canScrollNext,
|
|
263
|
+
onClick: scrollNext,
|
|
264
|
+
...props,
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "h-4 w-4" }),
|
|
267
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Next slide" })
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
});
|
|
272
|
+
CarouselNext.displayName = "CarouselNext";
|
|
273
|
+
|
|
274
|
+
exports.Carousel = Carousel;
|
|
275
|
+
exports.CarouselContent = CarouselContent;
|
|
276
|
+
exports.CarouselItem = CarouselItem;
|
|
277
|
+
exports.CarouselNext = CarouselNext;
|
|
278
|
+
exports.CarouselPrevious = CarouselPrevious;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React2 from 'react';
|
|
3
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
4
|
+
import { Loader2, ArrowLeft, ArrowRight } from 'lucide-react';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
+
import { cva } from 'class-variance-authority';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
function cn(...inputs) {
|
|
14
|
+
return twMerge(clsx(inputs));
|
|
15
|
+
}
|
|
16
|
+
__name(cn, "cn");
|
|
17
|
+
var buttonVariants = cva(
|
|
18
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
23
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
24
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
25
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
26
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
27
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
28
|
+
// Keep the additional Hanzo variants for backward compatibility
|
|
29
|
+
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
30
|
+
linkFG: "text-primary underline-offset-4 hover:underline",
|
|
31
|
+
linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
default: "h-9 px-4 py-2",
|
|
35
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
36
|
+
lg: "h-10 rounded-md px-8",
|
|
37
|
+
icon: "h-9 w-9"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "default",
|
|
42
|
+
size: "default"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
var Button = React2.forwardRef(
|
|
47
|
+
({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
48
|
+
const Comp = asChild ? Slot : "button";
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
50
|
+
Comp,
|
|
51
|
+
{
|
|
52
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
53
|
+
ref,
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
isLoading ? /* @__PURE__ */ jsx(
|
|
57
|
+
Loader2,
|
|
58
|
+
{
|
|
59
|
+
className: cn("h-4 w-4 animate-spin", size !== "icon" && "mr-2")
|
|
60
|
+
}
|
|
61
|
+
) : null,
|
|
62
|
+
isLoading && size === "icon" ? null : children
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
Button.displayName = "Button";
|
|
69
|
+
var button_default = Button;
|
|
70
|
+
var CarouselContext = React2.createContext(null);
|
|
71
|
+
var useCarousel = /* @__PURE__ */ __name(() => {
|
|
72
|
+
const service = React2.useContext(CarouselContext);
|
|
73
|
+
if (!service) {
|
|
74
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
75
|
+
}
|
|
76
|
+
return service;
|
|
77
|
+
}, "useCarousel");
|
|
78
|
+
var Carousel = React2.forwardRef(
|
|
79
|
+
({
|
|
80
|
+
orientation = "horizontal",
|
|
81
|
+
options,
|
|
82
|
+
setApi,
|
|
83
|
+
plugins,
|
|
84
|
+
className,
|
|
85
|
+
children,
|
|
86
|
+
onCarouselSelect,
|
|
87
|
+
...props
|
|
88
|
+
}, ref) => {
|
|
89
|
+
const [carouselRef, api] = useEmblaCarousel({ ...options, axis: orientation === "horizontal" ? "x" : "y" }, plugins);
|
|
90
|
+
const [canScrollPrev, setCanScrollPrev] = React2.useState(false);
|
|
91
|
+
const [canScrollNext, setCanScrollNext] = React2.useState(false);
|
|
92
|
+
const onSelect = React2.useCallback((api2) => {
|
|
93
|
+
if (!api2) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
97
|
+
setCanScrollNext(api2.canScrollNext());
|
|
98
|
+
if (onCarouselSelect) {
|
|
99
|
+
onCarouselSelect(api2);
|
|
100
|
+
}
|
|
101
|
+
}, []);
|
|
102
|
+
const scrollPrev = React2.useCallback(() => {
|
|
103
|
+
api?.scrollPrev();
|
|
104
|
+
}, [api]);
|
|
105
|
+
const scrollNext = React2.useCallback(() => {
|
|
106
|
+
api?.scrollNext();
|
|
107
|
+
}, [api]);
|
|
108
|
+
const handleKeyDown = React2.useCallback((event) => {
|
|
109
|
+
if (event.key === "ArrowLeft") {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
scrollPrev();
|
|
112
|
+
} else if (event.key === "ArrowRight") {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
scrollNext();
|
|
115
|
+
}
|
|
116
|
+
}, [scrollPrev, scrollNext]);
|
|
117
|
+
React2.useEffect(() => {
|
|
118
|
+
if (!api || !setApi) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
setApi(api);
|
|
122
|
+
}, [api, setApi]);
|
|
123
|
+
React2.useEffect(() => {
|
|
124
|
+
if (!api) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
onSelect(api);
|
|
128
|
+
api.on("reInit", onSelect);
|
|
129
|
+
api.on("select", onSelect);
|
|
130
|
+
return () => {
|
|
131
|
+
api?.off("select", onSelect);
|
|
132
|
+
};
|
|
133
|
+
}, [api, onSelect]);
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
CarouselContext.Provider,
|
|
136
|
+
{
|
|
137
|
+
value: {
|
|
138
|
+
carouselRef,
|
|
139
|
+
api,
|
|
140
|
+
options,
|
|
141
|
+
orientation: orientation || (options?.axis === "y" ? "vertical" : "horizontal"),
|
|
142
|
+
scrollPrev,
|
|
143
|
+
scrollNext,
|
|
144
|
+
canScrollPrev,
|
|
145
|
+
canScrollNext
|
|
146
|
+
},
|
|
147
|
+
children: /* @__PURE__ */ jsx(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
ref,
|
|
151
|
+
onKeyDownCapture: handleKeyDown,
|
|
152
|
+
className: cn("relative", className),
|
|
153
|
+
role: "region",
|
|
154
|
+
"aria-roledescription": "carousel",
|
|
155
|
+
"data-vaul-no-drag": true,
|
|
156
|
+
...props,
|
|
157
|
+
children
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
Carousel.displayName = "Carousel";
|
|
165
|
+
var CarouselContent = React2.forwardRef(({ className, ...props }, ref) => {
|
|
166
|
+
const { carouselRef, orientation } = useCarousel();
|
|
167
|
+
return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-vaul-no-drag": true, children: /* @__PURE__ */ jsx(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
ref,
|
|
171
|
+
className: cn(
|
|
172
|
+
"flex",
|
|
173
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
174
|
+
className
|
|
175
|
+
),
|
|
176
|
+
...props
|
|
177
|
+
}
|
|
178
|
+
) });
|
|
179
|
+
});
|
|
180
|
+
CarouselContent.displayName = "CarouselContent";
|
|
181
|
+
var CarouselItem = React2.forwardRef(({ className, ...props }, ref) => {
|
|
182
|
+
const { orientation } = useCarousel();
|
|
183
|
+
return /* @__PURE__ */ jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
ref,
|
|
187
|
+
role: "group",
|
|
188
|
+
"aria-roledescription": "slide",
|
|
189
|
+
"data-vaul-no-drag": true,
|
|
190
|
+
className: cn(
|
|
191
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
192
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
193
|
+
className
|
|
194
|
+
),
|
|
195
|
+
...props
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
CarouselItem.displayName = "CarouselItem";
|
|
200
|
+
var CarouselPrevious = React2.forwardRef(({ className, variant = "ghost", size = "icon", ...props }, ref) => {
|
|
201
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
202
|
+
return /* @__PURE__ */ jsxs(
|
|
203
|
+
button_default,
|
|
204
|
+
{
|
|
205
|
+
ref,
|
|
206
|
+
variant,
|
|
207
|
+
size,
|
|
208
|
+
className: cn(
|
|
209
|
+
"absolute h-8 w-8 rounded-full",
|
|
210
|
+
orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
211
|
+
className
|
|
212
|
+
),
|
|
213
|
+
disabled: !canScrollPrev,
|
|
214
|
+
onClick: scrollPrev,
|
|
215
|
+
...props,
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4" }),
|
|
218
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
224
|
+
var CarouselNext = React2.forwardRef(({ className, variant = "ghost", size = "icon", ...props }, ref) => {
|
|
225
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
226
|
+
return /* @__PURE__ */ jsxs(
|
|
227
|
+
button_default,
|
|
228
|
+
{
|
|
229
|
+
ref,
|
|
230
|
+
variant,
|
|
231
|
+
size,
|
|
232
|
+
className: cn(
|
|
233
|
+
"absolute h-8 w-8 rounded-full",
|
|
234
|
+
orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
235
|
+
className
|
|
236
|
+
),
|
|
237
|
+
disabled: !canScrollNext,
|
|
238
|
+
onClick: scrollNext,
|
|
239
|
+
...props,
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4" }),
|
|
242
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
});
|
|
247
|
+
CarouselNext.displayName = "CarouselNext";
|
|
248
|
+
|
|
249
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
7
|
+
var reactIcons = require('@radix-ui/react-icons');
|
|
8
|
+
var clsx = require('clsx');
|
|
9
|
+
var tailwindMerge = require('tailwind-merge');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
31
|
+
|
|
32
|
+
var __defProp = Object.defineProperty;
|
|
33
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
34
|
+
function cn(...inputs) {
|
|
35
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
36
|
+
}
|
|
37
|
+
__name(cn, "cn");
|
|
38
|
+
var Checkbox = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
CheckboxPrimitive__namespace.Root,
|
|
40
|
+
{
|
|
41
|
+
className: cn(
|
|
42
|
+
"focus-visible:ring-ring data-[state=checked]:bg-brand data-[state=checked]:border-brand peer h-4 w-4 shrink-0 rounded-xs border border-gray-400 shadow-sm focus-visible:ring-1 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-black",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
ref,
|
|
46
|
+
...props,
|
|
47
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
+
CheckboxPrimitive__namespace.Indicator,
|
|
49
|
+
{
|
|
50
|
+
className: cn("flex items-center justify-center text-current"),
|
|
51
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, { className: "h-3.5 w-3.5" })
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
), "Checkbox");
|
|
56
|
+
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
57
|
+
var checkbox_default = Checkbox;
|
|
58
|
+
|
|
59
|
+
exports.Checkbox = Checkbox;
|
|
60
|
+
exports.default = checkbox_default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
import { CheckIcon } from '@radix-ui/react-icons';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
function cn(...inputs) {
|
|
11
|
+
return twMerge(clsx(inputs));
|
|
12
|
+
}
|
|
13
|
+
__name(cn, "cn");
|
|
14
|
+
var Checkbox = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsx(
|
|
15
|
+
CheckboxPrimitive.Root,
|
|
16
|
+
{
|
|
17
|
+
className: cn(
|
|
18
|
+
"focus-visible:ring-ring data-[state=checked]:bg-brand data-[state=checked]:border-brand peer h-4 w-4 shrink-0 rounded-xs border border-gray-400 shadow-sm focus-visible:ring-1 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-black",
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
ref,
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ jsx(
|
|
24
|
+
CheckboxPrimitive.Indicator,
|
|
25
|
+
{
|
|
26
|
+
className: cn("flex items-center justify-center text-current"),
|
|
27
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "h-3.5 w-3.5" })
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
), "Checkbox");
|
|
32
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
33
|
+
var checkbox_default = Checkbox;
|
|
34
|
+
|
|
35
|
+
export { Checkbox, checkbox_default as default };
|