booary 1.0.5 → 2.0.0
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/index.cjs +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/dist/styles.cjs +0 -3
- package/dist/styles.d.cts +0 -2
- package/dist/styles.d.ts +0 -2
- package/dist/styles.js +0 -3
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var p=Object.defineProperty;var
|
|
2
|
+
"use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var x=(r,a)=>{for(var t in a)p(r,t,{get:a[t],enumerable:!0})},y=(r,a,t,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of f(a))!h.call(r,n)&&n!==t&&p(r,n,{get:()=>a[n],enumerable:!(s=u(a,n))||s.enumerable});return r};var v=r=>y(p({},"__esModule",{value:!0}),r);var w={};x(w,{LibraryCard:()=>N});module.exports=v(w);var d=require("react");function m(r,{insertAt:a}={}){if(!r||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",a==="top"&&t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s),s.styleSheet?s.styleSheet.cssText=r:s.appendChild(document.createTextNode(r))}m(`@import"tailwindcss";
|
|
3
|
+
`);var e=require("react/jsx-runtime"),N=({cardUrl:r,friends:a=[]})=>{let[t,s]=(0,d.useState)(null),[n,b]=(0,d.useState)([]);return(0,d.useEffect)(()=>{fetch(r).then(i=>i.json()).then(s).catch(i=>console.error("Booary Error:",i)),a.length>0&&Promise.all(a.map(i=>fetch(i).then(l=>l.json()).then(l=>({...l,url:i})))).then(b).catch(i=>console.error("Friend Sync Error:",i))},[r,a]),t?(0,e.jsx)("div",{className:"relative max-w-sm border-2 border-gray-800 bg-white p-6 font-mono shadow-sm",children:(0,e.jsxs)("div",{className:"-rotate-1",children:[(0,e.jsxs)("div",{className:"flex justify-between border-b-2 border-gray-800 pb-2 mb-4",children:[(0,e.jsx)("span",{className:"text-xs uppercase font-bold",children:"20"}),(0,e.jsx)("span",{className:"text-xs uppercase font-bold",children:"26"})]}),(0,e.jsx)("div",{className:"flex justify-between items-center border-b-2 border-gray-800 pb-2 mb-4",children:(0,e.jsx)("h2",{className:"text-xl font-black tracking-widest uppercase italic",children:t.library.name})}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-lg leading-tight",children:t.borrower}),(0,e.jsx)("label",{className:"block text-[10px] uppercase text-gray-500 underline decoration-dotted",children:"Borrower's Name"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-2xl",children:t.library.signature}),(0,e.jsx)("label",{className:"block text-[10px] uppercase text-gray-500 underline decoration-dotted",children:"Librarian's Signature"})]}),(0,e.jsxs)("div",{className:"border-t-2 border-gray-800 pt-2",children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 text-[10px] uppercase font-bold mb-2 text-gray-400",children:[(0,e.jsx)("span",{children:"Book Name"}),(0,e.jsx)("span",{className:"text-right",children:"Due Date"})]}),(0,e.jsx)("ul",{className:"space-y-2",children:t.books.map((i,l)=>{let g=n.filter(o=>o.books.some(c=>c.isbn===i.isbn));return(0,e.jsxs)("li",{className:"relative group grid grid-cols-2 items-end border-b border-gray-100 pb-1",children:[(0,e.jsx)("span",{className:"text-sm font-medium leading-none truncate pr-2",children:i.name}),(0,e.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,e.jsx)("span",{className:"text-[10px] text-right text-gray-400 italic",children:i.borrowDate}),(0,e.jsx)("div",{className:"absolute -right-8 flex -space-x-2",children:g.map((o,c)=>(0,e.jsx)("a",{href:o.url?new URL(o.url).origin:void 0,target:"_blank",rel:"noopener noreferrer",title:`${o.borrower} has also read this`,className:"text-lg hover:scale-125 hover:z-10 transition-transform cursor-pointer drop-shadow-sm",children:o.library.signature},c))})]})]},l)})})]})]})]})}):(0,e.jsx)("div",{className:"p-4 italic font-mono",children:"Loading library card..."})};0&&(module.exports={LibraryCard});
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{useState as
|
|
2
|
+
import{useState as p,useEffect as u}from"react";function c(i,{insertAt:o}={}){if(!i||typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o==="top"&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i))}c(`@import"tailwindcss";
|
|
3
|
+
`);import{jsx as e,jsxs as s}from"react/jsx-runtime";var v=({cardUrl:i,friends:o=[]})=>{let[a,r]=p(null),[m,b]=p([]);return u(()=>{fetch(i).then(t=>t.json()).then(r).catch(t=>console.error("Booary Error:",t)),o.length>0&&Promise.all(o.map(t=>fetch(t).then(l=>l.json()).then(l=>({...l,url:t})))).then(b).catch(t=>console.error("Friend Sync Error:",t))},[i,o]),a?e("div",{className:"relative max-w-sm border-2 border-gray-800 bg-white p-6 font-mono shadow-sm",children:s("div",{className:"-rotate-1",children:[s("div",{className:"flex justify-between border-b-2 border-gray-800 pb-2 mb-4",children:[e("span",{className:"text-xs uppercase font-bold",children:"20"}),e("span",{className:"text-xs uppercase font-bold",children:"26"})]}),e("div",{className:"flex justify-between items-center border-b-2 border-gray-800 pb-2 mb-4",children:e("h2",{className:"text-xl font-black tracking-widest uppercase italic",children:a.library.name})}),s("div",{className:"space-y-4",children:[s("div",{children:[e("p",{className:"text-lg leading-tight",children:a.borrower}),e("label",{className:"block text-[10px] uppercase text-gray-500 underline decoration-dotted",children:"Borrower's Name"})]}),s("div",{children:[e("p",{className:"text-2xl",children:a.library.signature}),e("label",{className:"block text-[10px] uppercase text-gray-500 underline decoration-dotted",children:"Librarian's Signature"})]}),s("div",{className:"border-t-2 border-gray-800 pt-2",children:[s("div",{className:"grid grid-cols-2 text-[10px] uppercase font-bold mb-2 text-gray-400",children:[e("span",{children:"Book Name"}),e("span",{className:"text-right",children:"Due Date"})]}),e("ul",{className:"space-y-2",children:a.books.map((t,l)=>{let g=m.filter(n=>n.books.some(d=>d.isbn===t.isbn));return s("li",{className:"relative group grid grid-cols-2 items-end border-b border-gray-100 pb-1",children:[e("span",{className:"text-sm font-medium leading-none truncate pr-2",children:t.name}),s("div",{className:"flex justify-end items-center gap-2",children:[e("span",{className:"text-[10px] text-right text-gray-400 italic",children:t.borrowDate}),e("div",{className:"absolute -right-8 flex -space-x-2",children:g.map((n,d)=>e("a",{href:n.url?new URL(n.url).origin:void 0,target:"_blank",rel:"noopener noreferrer",title:`${n.borrower} has also read this`,className:"text-lg hover:scale-125 hover:z-10 transition-transform cursor-pointer drop-shadow-sm",children:n.library.signature},d))})]})]},l)})})]})]})]})}):e("div",{className:"p-4 italic font-mono",children:"Loading library card..."})};export{v as LibraryCard};
|
package/package.json
CHANGED
package/dist/styles.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";function d(n,{insertAt:i}={}){if(!n||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",i==="top"&&t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}d(`@import"tailwindcss";
|
|
3
|
-
`);
|
package/dist/styles.d.cts
DELETED
package/dist/styles.d.ts
DELETED
package/dist/styles.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
function d(n,{insertAt:i}={}){if(!n||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",i==="top"&&t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}d(`@import"tailwindcss";
|
|
3
|
-
`);
|