kaff-components 1.0.2 → 1.0.3

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.d.mts CHANGED
@@ -28,4 +28,20 @@ interface BadgeProps {
28
28
  }
29
29
  declare const Badge: ({ label, color }: BadgeProps) => HTMLSpanElement;
30
30
 
31
- export { Alert, Badge, Button, Card, Input };
31
+ interface NavbarProps {
32
+ brand: string;
33
+ links: {
34
+ label: string;
35
+ href: string;
36
+ }[];
37
+ }
38
+ declare const Navbar: ({ brand, links }: NavbarProps) => HTMLElement;
39
+
40
+ interface SidebarProps {
41
+ items: string[];
42
+ }
43
+ declare const Sidebar: ({ items }: SidebarProps) => HTMLElement;
44
+
45
+ declare const Container: (children: HTMLElement) => HTMLDivElement;
46
+
47
+ export { Alert, Badge, Button, Card, Container, Input, Navbar, Sidebar };
package/dist/index.d.ts CHANGED
@@ -28,4 +28,20 @@ interface BadgeProps {
28
28
  }
29
29
  declare const Badge: ({ label, color }: BadgeProps) => HTMLSpanElement;
30
30
 
31
- export { Alert, Badge, Button, Card, Input };
31
+ interface NavbarProps {
32
+ brand: string;
33
+ links: {
34
+ label: string;
35
+ href: string;
36
+ }[];
37
+ }
38
+ declare const Navbar: ({ brand, links }: NavbarProps) => HTMLElement;
39
+
40
+ interface SidebarProps {
41
+ items: string[];
42
+ }
43
+ declare const Sidebar: ({ items }: SidebarProps) => HTMLElement;
44
+
45
+ declare const Container: (children: HTMLElement) => HTMLDivElement;
46
+
47
+ export { Alert, Badge, Button, Card, Container, Input, Navbar, Sidebar };
package/dist/index.js CHANGED
@@ -1,4 +1,14 @@
1
- "use strict";var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(o,t)=>{for(var e in t)s(o,e,{get:t[e],enumerable:!0})},d=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of i(t))!a.call(o,n)&&n!==e&&s(o,n,{get:()=>t[n],enumerable:!(r=p(t,n))||r.enumerable});return o};var l=o=>d(s({},"__esModule",{value:!0}),o);var m={};c(m,{Alert:()=>g,Badge:()=>f,Button:()=>x,Card:()=>b,Input:()=>u});module.exports=l(m);var x=({text:o,color:t="blue"})=>{let e=document.createElement("button");return e.innerText=o,Object.assign(e.style,{padding:"12px 24px",borderRadius:"8px",border:"none",cursor:"pointer",fontWeight:"bold",fontSize:"14px",color:"white",backgroundColor:t==="blue"?"#007bff":t,transition:"all 0.3s ease",boxShadow:"0 4px 6px rgba(0,0,0,0.1)"}),e.onmouseover=()=>e.style.transform="translateY(-2px)",e.onmouseout=()=>e.style.transform="translateY(0)",e};var u=({placeholder:o="Type here...",type:t="text"})=>{let e=document.createElement("div"),r=document.createElement("input");return r.type=t,r.placeholder=o,Object.assign(r.style,{width:"100%",padding:"10px 15px",borderRadius:"6px",border:"1px solid #444",backgroundColor:"#333",color:"white",fontSize:"14px",outline:"none",transition:"border-color 0.3s"}),r.onfocus=()=>r.style.borderColor="#007bff",r.onblur=()=>r.style.borderColor="#444",e.appendChild(r),e};var b=({title:o,content:t})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"20px",borderRadius:"12px",backgroundColor:"#2a2a2a",border:"1px solid #333",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",color:"white",maxWidth:"300px"}),e.innerHTML=`
2
- <h4 style="margin: 0 0 10px 0; color: #007bff;">${o}</h4>
1
+ "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,t)=>{for(var e in t)s(r,e,{get:t[e],enumerable:!0})},c=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of a(t))!d.call(r,n)&&n!==e&&s(r,n,{get:()=>t[n],enumerable:!(o=i(t,n))||o.enumerable});return r};var l=r=>c(s({},"__esModule",{value:!0}),r);var v={};p(v,{Alert:()=>g,Badge:()=>m,Button:()=>x,Card:()=>u,Container:()=>y,Input:()=>b,Navbar:()=>f,Sidebar:()=>h});module.exports=l(v);var x=({text:r,color:t="blue"})=>{let e=document.createElement("button");return e.innerText=r,Object.assign(e.style,{padding:"12px 24px",borderRadius:"8px",border:"none",cursor:"pointer",fontWeight:"bold",fontSize:"14px",color:"white",backgroundColor:t==="blue"?"#007bff":t,transition:"all 0.3s ease",boxShadow:"0 4px 6px rgba(0,0,0,0.1)"}),e.onmouseover=()=>e.style.transform="translateY(-2px)",e.onmouseout=()=>e.style.transform="translateY(0)",e};var b=({placeholder:r="Type here...",type:t="text"})=>{let e=document.createElement("div"),o=document.createElement("input");return o.type=t,o.placeholder=r,Object.assign(o.style,{width:"100%",padding:"10px 15px",borderRadius:"6px",border:"1px solid #444",backgroundColor:"#333",color:"white",fontSize:"14px",outline:"none",transition:"border-color 0.3s"}),o.onfocus=()=>o.style.borderColor="#007bff",o.onblur=()=>o.style.borderColor="#444",e.appendChild(o),e};var u=({title:r,content:t})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"20px",borderRadius:"12px",backgroundColor:"#2a2a2a",border:"1px solid #333",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",color:"white",maxWidth:"300px"}),e.innerHTML=`
2
+ <h4 style="margin: 0 0 10px 0; color: #007bff;">${r}</h4>
3
3
  <p style="margin: 0; font-size: 14px; color: #ccc;">${t}</p>
4
- `,e};var g=({message:o,type:t="success"})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"12px 20px",borderRadius:"8px",fontSize:"14px",fontWeight:"500",color:"white",backgroundColor:t==="success"?"#28a745":"#dc3545",borderLeft:`5px solid ${t==="success"?"#1e7e34":"#bd2130"}`,marginBottom:"10px"}),e.innerText=o,e};var f=({label:o,color:t="#6c757d"})=>{let e=document.createElement("span");return Object.assign(e.style,{padding:"4px 10px",borderRadius:"20px",fontSize:"12px",fontWeight:"bold",color:"white",backgroundColor:t,display:"inline-block"}),e.innerText=o,e};0&&(module.exports={Alert,Badge,Button,Card,Input});
4
+ `,e};var g=({message:r,type:t="success"})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"12px 20px",borderRadius:"8px",fontSize:"14px",fontWeight:"500",color:"white",backgroundColor:t==="success"?"#28a745":"#dc3545",borderLeft:`5px solid ${t==="success"?"#1e7e34":"#bd2130"}`,marginBottom:"10px"}),e.innerText=r,e};var m=({label:r,color:t="#6c757d"})=>{let e=document.createElement("span");return Object.assign(e.style,{padding:"4px 10px",borderRadius:"20px",fontSize:"12px",fontWeight:"bold",color:"white",backgroundColor:t,display:"inline-block"}),e.innerText=r,e};var f=({brand:r,links:t})=>{let e=document.createElement("nav");return Object.assign(e.style,{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1rem 2rem",backgroundColor:"#333",color:"white",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}),e.innerHTML=`
5
+ <div style="font-weight: bold; font-size: 1.5rem;">${r}</div>
6
+ <div style="display: flex; gap: 1.5rem;">
7
+ ${t.map(o=>`<a href="${o.href}" style="color: white; text-decoration: none; font-size: 0.9rem;">${o.label}</a>`).join("")}
8
+ </div>
9
+ `,e};var h=({items:r})=>{let t=document.createElement("aside");return Object.assign(t.style,{width:"250px",height:"100vh",backgroundColor:"#222",color:"white",padding:"2rem 1rem",display:"flex",flexDirection:"column",gap:"1rem"}),t.innerHTML=r.map(e=>`
10
+ <div style="padding: 0.75rem 1rem; border-radius: 4px; cursor: pointer; transition: background 0.3s;"
11
+ onmouseover="this.style.background='#444'" onmouseout="this.style.background='transparent'">
12
+ ${e}
13
+ </div>
14
+ `).join(""),t};var y=r=>{let t=document.createElement("div");return Object.assign(t.style,{maxWidth:"1200px",margin:"0 auto",padding:"2rem",width:"100%"}),t.appendChild(r),t};0&&(module.exports={Alert,Badge,Button,Card,Container,Input,Navbar,Sidebar});
package/dist/index.mjs CHANGED
@@ -1,4 +1,14 @@
1
- var n=({text:o,color:t="blue"})=>{let e=document.createElement("button");return e.innerText=o,Object.assign(e.style,{padding:"12px 24px",borderRadius:"8px",border:"none",cursor:"pointer",fontWeight:"bold",fontSize:"14px",color:"white",backgroundColor:t==="blue"?"#007bff":t,transition:"all 0.3s ease",boxShadow:"0 4px 6px rgba(0,0,0,0.1)"}),e.onmouseover=()=>e.style.transform="translateY(-2px)",e.onmouseout=()=>e.style.transform="translateY(0)",e};var p=({placeholder:o="Type here...",type:t="text"})=>{let e=document.createElement("div"),r=document.createElement("input");return r.type=t,r.placeholder=o,Object.assign(r.style,{width:"100%",padding:"10px 15px",borderRadius:"6px",border:"1px solid #444",backgroundColor:"#333",color:"white",fontSize:"14px",outline:"none",transition:"border-color 0.3s"}),r.onfocus=()=>r.style.borderColor="#007bff",r.onblur=()=>r.style.borderColor="#444",e.appendChild(r),e};var a=({title:o,content:t})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"20px",borderRadius:"12px",backgroundColor:"#2a2a2a",border:"1px solid #333",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",color:"white",maxWidth:"300px"}),e.innerHTML=`
2
- <h4 style="margin: 0 0 10px 0; color: #007bff;">${o}</h4>
1
+ var n=({text:r,color:t="blue"})=>{let e=document.createElement("button");return e.innerText=r,Object.assign(e.style,{padding:"12px 24px",borderRadius:"8px",border:"none",cursor:"pointer",fontWeight:"bold",fontSize:"14px",color:"white",backgroundColor:t==="blue"?"#007bff":t,transition:"all 0.3s ease",boxShadow:"0 4px 6px rgba(0,0,0,0.1)"}),e.onmouseover=()=>e.style.transform="translateY(-2px)",e.onmouseout=()=>e.style.transform="translateY(0)",e};var i=({placeholder:r="Type here...",type:t="text"})=>{let e=document.createElement("div"),o=document.createElement("input");return o.type=t,o.placeholder=r,Object.assign(o.style,{width:"100%",padding:"10px 15px",borderRadius:"6px",border:"1px solid #444",backgroundColor:"#333",color:"white",fontSize:"14px",outline:"none",transition:"border-color 0.3s"}),o.onfocus=()=>o.style.borderColor="#007bff",o.onblur=()=>o.style.borderColor="#444",e.appendChild(o),e};var d=({title:r,content:t})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"20px",borderRadius:"12px",backgroundColor:"#2a2a2a",border:"1px solid #333",boxShadow:"0 4px 12px rgba(0,0,0,0.2)",color:"white",maxWidth:"300px"}),e.innerHTML=`
2
+ <h4 style="margin: 0 0 10px 0; color: #007bff;">${r}</h4>
3
3
  <p style="margin: 0; font-size: 14px; color: #ccc;">${t}</p>
4
- `,e};var d=({message:o,type:t="success"})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"12px 20px",borderRadius:"8px",fontSize:"14px",fontWeight:"500",color:"white",backgroundColor:t==="success"?"#28a745":"#dc3545",borderLeft:`5px solid ${t==="success"?"#1e7e34":"#bd2130"}`,marginBottom:"10px"}),e.innerText=o,e};var x=({label:o,color:t="#6c757d"})=>{let e=document.createElement("span");return Object.assign(e.style,{padding:"4px 10px",borderRadius:"20px",fontSize:"12px",fontWeight:"bold",color:"white",backgroundColor:t,display:"inline-block"}),e.innerText=o,e};export{d as Alert,x as Badge,n as Button,a as Card,p as Input};
4
+ `,e};var c=({message:r,type:t="success"})=>{let e=document.createElement("div");return Object.assign(e.style,{padding:"12px 20px",borderRadius:"8px",fontSize:"14px",fontWeight:"500",color:"white",backgroundColor:t==="success"?"#28a745":"#dc3545",borderLeft:`5px solid ${t==="success"?"#1e7e34":"#bd2130"}`,marginBottom:"10px"}),e.innerText=r,e};var x=({label:r,color:t="#6c757d"})=>{let e=document.createElement("span");return Object.assign(e.style,{padding:"4px 10px",borderRadius:"20px",fontSize:"12px",fontWeight:"bold",color:"white",backgroundColor:t,display:"inline-block"}),e.innerText=r,e};var u=({brand:r,links:t})=>{let e=document.createElement("nav");return Object.assign(e.style,{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1rem 2rem",backgroundColor:"#333",color:"white",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}),e.innerHTML=`
5
+ <div style="font-weight: bold; font-size: 1.5rem;">${r}</div>
6
+ <div style="display: flex; gap: 1.5rem;">
7
+ ${t.map(o=>`<a href="${o.href}" style="color: white; text-decoration: none; font-size: 0.9rem;">${o.label}</a>`).join("")}
8
+ </div>
9
+ `,e};var m=({items:r})=>{let t=document.createElement("aside");return Object.assign(t.style,{width:"250px",height:"100vh",backgroundColor:"#222",color:"white",padding:"2rem 1rem",display:"flex",flexDirection:"column",gap:"1rem"}),t.innerHTML=r.map(e=>`
10
+ <div style="padding: 0.75rem 1rem; border-radius: 4px; cursor: pointer; transition: background 0.3s;"
11
+ onmouseover="this.style.background='#444'" onmouseout="this.style.background='transparent'">
12
+ ${e}
13
+ </div>
14
+ `).join(""),t};var h=r=>{let t=document.createElement("div");return Object.assign(t.style,{maxWidth:"1200px",margin:"0 auto",padding:"2rem",width:"100%"}),t.appendChild(r),t};export{c as Alert,x as Badge,n as Button,d as Card,h as Container,i as Input,u as Navbar,m as Sidebar};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaff-components",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Design System Library berbasis JavaScript menggunakan Tsup",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",