@dub/ui 0.0.20 → 0.0.21
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-CCOF7YDT.mjs +2 -0
- package/dist/chunk-EFZ7CUHR.mjs +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/link-preview.d.ts +4 -1
- package/dist/link-preview.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import{a as p}from"./chunk-2TGXECZQ.mjs";import{a as y}from"./chunk-IPQLV2SB.mjs";import{e as m,h as g,i as f}from"./chunk-PD5H4BY6.mjs";import{Link2 as b}from"lucide-react";import{useRouter as w,useSearchParams as L}from"next/navigation";import{useEffect as k,useMemo as R,useRef as E}from"react";import P from"swr";import{useDebounce as W}from"use-debounce";import{Fragment as v,jsx as e,jsxs as t}from"react/jsx-runtime";function D({defaultUrl:r}){let h=w(),l=L(),o=r||(l==null?void 0:l.get("url"))||"https://github.com/steven-tey/dub",[a]=W(g(o),500),i=R(()=>f(a||""),[a]),{data:x,isValidating:N}=P(a&&`/api/edge/metatags?url=${a}`,m,{revalidateOnFocus:!1}),{title:n,description:u,image:d}=x||{},s=E(null);return k(()=>{!r&&s.current&&s.current.select()},[r]),t(v,{children:[!r&&t("div",{className:"relative flex items-center",children:[e(b,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-gray-400"}),e("input",{ref:s,name:"url",id:"url",type:"url",autoFocus:!0,className:"block w-full rounded-md border-gray-200 pl-10 text-sm text-gray-900 placeholder-gray-400 shadow-lg focus:border-gray-500 focus:outline-none focus:ring-gray-500",placeholder:"Enter your URL",defaultValue:o,onChange:c=>h.replace(`/tools/metatags${c.target.value.length>0?`?url=${c.target.value}`:""}`),"aria-invalid":"true"})]}),t("div",{className:"relative overflow-hidden rounded-md border border-gray-300 bg-gray-50",children:[N&&e("div",{className:"absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-gray-300 bg-gray-50",children:e(y,{})}),d?e("img",{src:d,alt:"Preview",className:"h-[250px] w-full border-b border-gray-300 object-cover"}):t("div",{className:"flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-gray-300",children:[e(p,{className:"h-8 w-8 text-gray-400"}),e("p",{className:"text-sm text-gray-400",children:"Enter a link to generate a preview."})]}),t("div",{className:"grid gap-1 bg-white p-3 text-left",children:[i?e("p",{className:"text-sm text-[#536471]",children:i}):e("div",{className:"mb-1 h-4 w-24 rounded-md bg-gray-100"}),n?e("h3",{className:"truncate text-sm font-medium text-[#0f1419]",children:n}):e("div",{className:"mb-1 h-4 w-full rounded-md bg-gray-100"}),u?e("p",{className:"line-clamp-2 text-sm text-[#536471]",children:u}):t("div",{className:"grid gap-2",children:[e("div",{className:"h-4 w-full rounded-md bg-gray-100"}),e("div",{className:"h-4 w-48 rounded-md bg-gray-100"})]})]})]})]})}function M({defaultUrl:r}){return e(v,{children:t("div",{className:"relative flex items-center",children:[e(b,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-gray-400"}),e("input",{name:"url",id:"url",type:"url",disabled:!0,className:"block w-full rounded-md border-gray-200 pl-10 text-sm text-gray-900 placeholder-gray-400 shadow-lg focus:border-gray-500 focus:outline-none focus:ring-gray-500",placeholder:"Enter your URL",defaultValue:r||"https://github.com/steven-tey/dub"})]})})}export{D as a,M as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import{a as p}from"./chunk-2TGXECZQ.mjs";import{a as o}from"./chunk-IPQLV2SB.mjs";import{e as g,h as f,i as b}from"./chunk-PD5H4BY6.mjs";import{Link2 as y}from"lucide-react";import{useRouter as w,useSearchParams as L}from"next/navigation";import{useEffect as k,useMemo as R,useRef as E}from"react";import P from"swr";import{useDebounce as W}from"use-debounce";import{Fragment as v,jsx as e,jsxs as r}from"react/jsx-runtime";function D({defaultUrl:t}){let h=w(),l=L(),i=t||(l==null?void 0:l.get("url"))||"https://github.com/steven-tey/dub",[a]=W(f(i),500),d=R(()=>b(a||""),[a]),{data:x,isValidating:N}=P(a&&`/api/edge/metatags?url=${a}`,g,{revalidateOnFocus:!1}),{title:n,description:u,image:c}=x||{},s=E(null);return k(()=>{!t&&s.current&&s.current.select()},[t]),r(v,{children:[!t&&r("div",{className:"relative flex items-center",children:[e(y,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-gray-400"}),e("input",{ref:s,name:"url",id:"url",type:"url",autoFocus:!0,className:"block w-full rounded-md border-gray-200 pl-10 text-sm text-gray-900 placeholder-gray-400 shadow-lg focus:border-gray-500 focus:outline-none focus:ring-gray-500",placeholder:"Enter your URL",defaultValue:i,onChange:m=>h.replace(`/tools/metatags${m.target.value.length>0?`?url=${m.target.value}`:""}`),"aria-invalid":"true"})]}),r("div",{className:"relative overflow-hidden rounded-md border border-gray-300 bg-gray-50",children:[N&&e("div",{className:"absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-gray-300 bg-gray-50",children:e(o,{})}),c?e("img",{src:c,alt:"Preview",className:"h-[250px] w-full border-b border-gray-300 object-cover"}):r("div",{className:"flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-gray-300",children:[e(p,{className:"h-8 w-8 text-gray-400"}),e("p",{className:"text-sm text-gray-400",children:"Enter a link to generate a preview."})]}),r("div",{className:"grid gap-1 bg-white p-3 text-left",children:[d?e("p",{className:"text-sm text-[#536471]",children:d}):e("div",{className:"mb-1 h-4 w-24 rounded-md bg-gray-100"}),n?e("h3",{className:"truncate text-sm font-medium text-[#0f1419]",children:n}):e("div",{className:"mb-1 h-4 w-full rounded-md bg-gray-100"}),u?e("p",{className:"line-clamp-2 text-sm text-[#536471]",children:u}):r("div",{className:"grid gap-2",children:[e("div",{className:"h-4 w-full rounded-md bg-gray-100"}),e("div",{className:"h-4 w-48 rounded-md bg-gray-100"})]})]})]})]})}function M({defaultUrl:t}){return r(v,{children:[r("div",{className:"relative flex items-center",children:[e(y,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-gray-400"}),e("input",{name:"url",id:"url",type:"url",disabled:!0,className:"block w-full rounded-md border-gray-200 pl-10 text-sm text-gray-900 placeholder-gray-400 shadow-lg focus:border-gray-500 focus:outline-none focus:ring-gray-500",placeholder:"Enter your URL",defaultValue:t||"https://github.com/steven-tey/dub"})]}),e("div",{className:"relative overflow-hidden rounded-md border border-gray-300 bg-gray-50",children:e("div",{className:"absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-gray-300 bg-gray-50",children:e(o,{})})})]})}export{D as a,M as b};
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ import * as lucide_react from 'lucide-react';
|
|
|
35
35
|
export { CopyButton } from './copy-button.js';
|
|
36
36
|
export { IconMenu } from './icon-menu.js';
|
|
37
37
|
export { InlineSnippet } from './inline-snippet.js';
|
|
38
|
-
export { LinkPreview } from './link-preview.js';
|
|
38
|
+
export { LinkPreview, LinkPreviewPlaceholder } from './link-preview.js';
|
|
39
39
|
export { TabSelect } from './tab-select.js';
|
|
40
40
|
import '@radix-ui/react-accordion';
|
|
41
41
|
import 'react/jsx-runtime';
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{a as S}from"./chunk-JN4HZKLZ.mjs";import{a as T}from"./chunk-KKWRCZAS.mjs";import{a as
|
|
2
|
+
import{a as S}from"./chunk-JN4HZKLZ.mjs";import{a as T}from"./chunk-KKWRCZAS.mjs";import{a as _}from"./chunk-W5YDWGPP.mjs";import{a as Q}from"./chunk-Z4MSMGYC.mjs";import{a as X}from"./chunk-O5BHK57C.mjs";import{a as Y,b as Z}from"./chunk-EFZ7CUHR.mjs";import{a as R}from"./chunk-S2636RC5.mjs";import{a as W}from"./chunk-V7UWB566.mjs";import{a as U,b as V}from"./chunk-WENIEY7H.mjs";import{a as o,b as r,c as m,d as p}from"./chunk-XGGLJO36.mjs";import{a as t,b as e}from"./chunk-I7BYBLSA.mjs";import{a as f}from"./chunk-QDF6KFCS.mjs";import{a as x,b as i}from"./chunk-SKU7HMMT.mjs";import{a as L}from"./chunk-WPE5QL5T.mjs";import{a as O}from"./chunk-GZZRRD4S.mjs";import{a as M}from"./chunk-CS6Q63Y7.mjs";import{a as N}from"./chunk-MFYEUHDE.mjs";import{a as P}from"./chunk-UGBNXWLD.mjs";import{a as K}from"./chunk-MJJNFCAB.mjs";import{a as F,b as G,c as H,d as I,e as J}from"./chunk-MXF4FFWV.mjs";import{a as z,b as A,c as B,d as C,e as D,f as E}from"./chunk-D6DUNEEU.mjs";import"./chunk-PHU6NRSR.mjs";import{a as c}from"./chunk-YURUGH4S.mjs";import{a as d}from"./chunk-2TGXECZQ.mjs";import{a as g}from"./chunk-EHYVEIOL.mjs";import{a as w}from"./chunk-HE7UMT4J.mjs";import{a as y}from"./chunk-GSQUGPJ2.mjs";import{a as u}from"./chunk-OYEGFR5W.mjs";import{a as v}from"./chunk-5EWSH7PD.mjs";import{a as h}from"./chunk-IPQLV2SB.mjs";import{a as j}from"./chunk-QA2KCGIR.mjs";import{a as k}from"./chunk-2RL4BDFB.mjs";import{a as l}from"./chunk-QPT5ELOV.mjs";import{a as n}from"./chunk-IZL4ULRP.mjs";import{a}from"./chunk-Z5P2KHPP.mjs";import{a as b}from"./chunk-ZZCDP5JJ.mjs";import{a as q}from"./chunk-MURAUI3W.mjs";import{a as s}from"./chunk-T4YFARK5.mjs";import"./chunk-PD5H4BY6.mjs";import"./chunk-AUBFB4SI.mjs";export{o as Accordion,p as AccordionContent,r as AccordionItem,m as AccordionTrigger,t as Avatar,f as Background,i as Badge,K as Button,a as Copy,L as CopyButton,b as ExpandingArrow,M as FEATURES_LIST,q as Facebook,O as Footer,P as Form,s as Github,u as Google,Q as IconMenu,I as InfoTooltip,X as InlineSnippet,Y as LinkPreview,Z as LinkPreviewPlaceholder,v as LinkedIn,h as LoadingCircle,j as LoadingDots,k as LoadingSpinner,l as Logo,n as LogoType,c as Magic,N as MaxWidthWrapper,R as Modal,V as Nav,W as NavMobile,J as NumberTooltip,d as Photo,S as Popover,H as SimpleTooltipContent,T as Switch,_ as TabSelect,g as Tick,e as TokenAvatar,F as Tooltip,G as TooltipContent,w as Twitter,y as Unsplash,x as badgeVariants,U as navItems,z as useCurrentAnchor,A as useIntersectionObserver,B as useLocalStorage,C as useMediaQuery,D as useRouterStuff,E as useScroll};
|
package/dist/link-preview.d.ts
CHANGED
|
@@ -3,5 +3,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
3
3
|
declare function LinkPreview({ defaultUrl }: {
|
|
4
4
|
defaultUrl?: string;
|
|
5
5
|
}): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function LinkPreviewPlaceholder({ defaultUrl, }: {
|
|
7
|
+
defaultUrl?: string;
|
|
8
|
+
}): react_jsx_runtime.JSX.Element;
|
|
6
9
|
|
|
7
|
-
export { LinkPreview };
|
|
10
|
+
export { LinkPreview, LinkPreviewPlaceholder };
|
package/dist/link-preview.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-EFZ7CUHR.mjs";import"./chunk-PHU6NRSR.mjs";import"./chunk-YURUGH4S.mjs";import"./chunk-2TGXECZQ.mjs";import"./chunk-EHYVEIOL.mjs";import"./chunk-HE7UMT4J.mjs";import"./chunk-GSQUGPJ2.mjs";import"./chunk-OYEGFR5W.mjs";import"./chunk-5EWSH7PD.mjs";import"./chunk-IPQLV2SB.mjs";import"./chunk-QA2KCGIR.mjs";import"./chunk-2RL4BDFB.mjs";import"./chunk-QPT5ELOV.mjs";import"./chunk-IZL4ULRP.mjs";import"./chunk-Z5P2KHPP.mjs";import"./chunk-ZZCDP5JJ.mjs";import"./chunk-MURAUI3W.mjs";import"./chunk-T4YFARK5.mjs";import"./chunk-PD5H4BY6.mjs";import"./chunk-AUBFB4SI.mjs";export{a as LinkPreview,b as LinkPreviewPlaceholder};
|