rockin 0.0.34 → 0.0.35
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/chunk-3CZ2LLUN.js +198 -0
- package/dist/{chunk-7ZCRGTLA.js → chunk-54ZJAEO5.js} +5 -5
- package/dist/chunk-5GM3YR42.js +228 -0
- package/dist/chunk-6XUTSMTJ.js +183 -0
- package/dist/chunk-7JJBATB2.js +35 -0
- package/dist/chunk-BITCJZQZ.js +31 -0
- package/dist/chunk-COPQJFDI.js +158 -0
- package/dist/chunk-D6TULSM6.js +785 -0
- package/dist/chunk-DVNTJNDP.js +55 -0
- package/dist/chunk-EKDBYSMI.js +87 -0
- package/dist/chunk-FGWWRPMR.js +71 -0
- package/dist/chunk-G233W3IR.js +17 -0
- package/dist/chunk-G4NDAZTB.js +13 -0
- package/dist/chunk-GY2BX5SK.js +26 -0
- package/dist/chunk-MZBLIA6C.js +20 -0
- package/dist/chunk-OSVLAX37.js +101 -0
- package/dist/chunk-PRGKTXJU.js +20 -0
- package/dist/chunk-RUKQ532H.js +253 -0
- package/dist/chunk-S4H2HENE.js +113 -0
- package/dist/chunk-UHZTEDHK.js +61 -0
- package/dist/chunk-VFDNWPOI.js +293 -0
- package/dist/chunk-W4EIJWHF.js +150 -0
- package/dist/hooks/index.js +18 -9
- package/dist/index.js +4 -4
- package/dist/provider.js +3 -3
- package/dist/ui/accordion.js +95 -0
- package/dist/ui/alert-dialog.js +178 -0
- package/dist/ui/apple/english.js +7 -0
- package/dist/ui/apple/hindi.js +7 -0
- package/dist/ui/apple/index.js +52 -0
- package/dist/ui/apple/spanish.js +7 -0
- package/dist/ui/ariakit.js +7 -0
- package/dist/ui/autocomplete.js +296 -0
- package/dist/ui/avatar.js +106 -0
- package/dist/ui/badge.js +50 -0
- package/dist/ui/bridge.js +109 -0
- package/dist/ui/bubble.js +118 -0
- package/dist/ui/button-group.js +14 -0
- package/dist/ui/button.js +9 -0
- package/dist/ui/card.js +102 -0
- package/dist/ui/carousel.js +205 -0
- package/dist/ui/chart.js +253 -0
- package/dist/ui/checkbox.js +34 -0
- package/dist/ui/code-block.js +128 -0
- package/dist/ui/combobox.js +41 -0
- package/dist/ui/command.js +199 -0
- package/dist/ui/dashed.js +57 -0
- package/dist/ui/data-table/index.js +233 -0
- package/dist/ui/dialog.js +26 -0
- package/dist/ui/dock.js +86 -0
- package/dist/ui/drawer.js +216 -0
- package/dist/ui/dropdown-menu.js +35 -0
- package/dist/ui/empty.js +17 -0
- package/dist/ui/farmer/div.js +38 -0
- package/dist/ui/farmer/variants.js +314 -0
- package/dist/ui/field.js +224 -0
- package/dist/ui/filters.js +1524 -0
- package/dist/ui/image.js +88 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +57 -8502
- package/dist/ui/input-group.js +20 -0
- package/dist/ui/input-otp.js +83 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/item.js +200 -0
- package/dist/ui/jelly.js +30 -0
- package/dist/ui/kbd.js +9 -0
- package/dist/ui/label.js +7 -0
- package/dist/ui/message-scroller.js +122 -0
- package/dist/ui/message.js +93 -0
- package/dist/ui/numberstepper.js +416 -0
- package/dist/ui/otp.js +403 -0
- package/dist/ui/popover.js +83 -0
- package/dist/ui/qr-code.js +124 -0
- package/dist/ui/quantity.js +48 -0
- package/dist/ui/radio-group.js +42 -0
- package/dist/ui/resizable.js +52 -0
- package/dist/ui/scroll-area.js +9 -0
- package/dist/ui/select.js +194 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/skeleton.js +25 -0
- package/dist/ui/sonner.js +22 -0
- package/dist/ui/sortable.js +503 -0
- package/dist/ui/swipe-actions.js +45 -0
- package/dist/ui/switch.js +34 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/theme-toggle.js +141 -0
- package/dist/ui/tooltip.js +13 -0
- package/package.json +1 -1
- package/dist/chunk-4KFB6AJH.js +0 -1330
- /package/dist/{chunk-FYFBWCMJ.js → chunk-GBVAFFZR.js} +0 -0
package/dist/ui/image.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
JellyMini
|
|
4
|
+
} from "../chunk-5GM3YR42.js";
|
|
5
|
+
import {
|
|
6
|
+
Skeleton
|
|
7
|
+
} from "../chunk-3CZ2LLUN.js";
|
|
8
|
+
import "../chunk-OSVLAX37.js";
|
|
9
|
+
import "../chunk-G4NDAZTB.js";
|
|
10
|
+
import "../chunk-DVNTJNDP.js";
|
|
11
|
+
|
|
12
|
+
// src/ui/image.tsx
|
|
13
|
+
import NextImage from "next/image";
|
|
14
|
+
import { useCallback, useState } from "react";
|
|
15
|
+
import { cn } from "cn";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function srcValue(src) {
|
|
18
|
+
if (!src) return null;
|
|
19
|
+
if (typeof src === "string") return src;
|
|
20
|
+
if ("src" in src) return src.src;
|
|
21
|
+
return src.default.src;
|
|
22
|
+
}
|
|
23
|
+
function Image({
|
|
24
|
+
wrapper,
|
|
25
|
+
showSkeleton = true,
|
|
26
|
+
className,
|
|
27
|
+
loading = "lazy",
|
|
28
|
+
fetchPriority,
|
|
29
|
+
preload,
|
|
30
|
+
quality = 90,
|
|
31
|
+
src,
|
|
32
|
+
alt,
|
|
33
|
+
onLoad,
|
|
34
|
+
onError,
|
|
35
|
+
children,
|
|
36
|
+
fallback = /* @__PURE__ */ jsx(JellyMini, { mood: "curious", className: "size-full p-[12%]" }),
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
const currentSrc = srcValue(src);
|
|
40
|
+
const [loadedSrc, setLoadedSrc] = useState(null);
|
|
41
|
+
const [failedSrc, setFailedSrc] = useState(null);
|
|
42
|
+
const hasSource = Boolean(currentSrc);
|
|
43
|
+
const failed = hasSource && failedSrc === currentSrc;
|
|
44
|
+
const loaded = hasSource && loadedSrc === currentSrc && !failed;
|
|
45
|
+
const shouldPreload = preload ?? loading === "eager";
|
|
46
|
+
const imageLoading = shouldPreload ? "eager" : loading;
|
|
47
|
+
const markLoaded = useCallback(() => {
|
|
48
|
+
if (!currentSrc) return;
|
|
49
|
+
setFailedSrc(null);
|
|
50
|
+
setLoadedSrc(currentSrc);
|
|
51
|
+
}, [currentSrc]);
|
|
52
|
+
const markFailed = useCallback(() => {
|
|
53
|
+
if (!currentSrc) return;
|
|
54
|
+
setFailedSrc(currentSrc);
|
|
55
|
+
}, [currentSrc]);
|
|
56
|
+
return /* @__PURE__ */ jsxs("section", { className: cn("relative block overflow-hidden", wrapper), children: [
|
|
57
|
+
showSkeleton && !loaded && !failed && hasSource && /* @__PURE__ */ jsx(Skeleton, { className: "absolute inset-0 size-full" }),
|
|
58
|
+
hasSource && !failed ? /* @__PURE__ */ jsx(
|
|
59
|
+
NextImage,
|
|
60
|
+
{
|
|
61
|
+
...props,
|
|
62
|
+
src: src ?? "",
|
|
63
|
+
alt,
|
|
64
|
+
quality,
|
|
65
|
+
loading: imageLoading,
|
|
66
|
+
preload: shouldPreload,
|
|
67
|
+
fetchPriority: fetchPriority ?? (imageLoading === "eager" ? "high" : void 0),
|
|
68
|
+
className: cn(
|
|
69
|
+
"transition-opacity duration-200",
|
|
70
|
+
loaded ? "opacity-100" : "opacity-0",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
onLoad: (event) => {
|
|
74
|
+
markLoaded();
|
|
75
|
+
onLoad?.(event);
|
|
76
|
+
},
|
|
77
|
+
onError: (event) => {
|
|
78
|
+
markFailed();
|
|
79
|
+
onError?.(event);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
) : fallback,
|
|
83
|
+
children
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
Image
|
|
88
|
+
};
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -672,7 +672,7 @@ declare function Input({ className, type, inputMode, onWheel, ...props }: React$
|
|
|
672
672
|
|
|
673
673
|
declare function InputGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
674
674
|
declare const inputGroupAddonVariants: (props?: ({
|
|
675
|
-
align?: "inline-
|
|
675
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
676
676
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
677
677
|
declare function InputGroupAddon({ className, align, focusInput, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants> & {
|
|
678
678
|
focusInput?: boolean;
|