kaff-components 1.0.0 → 1.0.2
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/README.md +11 -0
- package/dist/index.d.mts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.js +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Kaff Components - Modern UI Library
|
|
2
|
+
|
|
3
|
+
Kaff Components adalah sebuah Design System Library berbasis JavaScript yang dibangun menggunakan **Tsup** sebagai build tool dan didistribusikan melalui **npm**. [cite_start]Proyek ini dikembangkan untuk memenuhi tugas Design System di **STIKOM PGRI Banyuwangi**[cite: 11, 18, 40].
|
|
4
|
+
|
|
5
|
+
## 🎨 Tema Visual
|
|
6
|
+
[cite_start]**Minimalis & Konsisten**: Berfokus pada kejelasan antarmuka dengan penerapan prinsip *styled design* pada warna, spacing, dan typography[cite: 18, 28, 31].
|
|
7
|
+
|
|
8
|
+
## 📦 Instalasi
|
|
9
|
+
Gunakan npm untuk menginstal library ini ke dalam proyek Anda:
|
|
10
|
+
```bash
|
|
11
|
+
npm install kaff-components
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
interface ButtonProps {
|
|
2
|
+
text: string;
|
|
3
|
+
color?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const Button: ({ text, color }: ButtonProps) => HTMLButtonElement;
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
interface InputProps {
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Input: ({ placeholder, type }: InputProps) => HTMLDivElement;
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
interface CardProps {
|
|
14
|
+
title: string;
|
|
15
|
+
content: string;
|
|
16
|
+
}
|
|
17
|
+
declare const Card: ({ title, content }: CardProps) => HTMLDivElement;
|
|
6
18
|
|
|
7
|
-
|
|
19
|
+
interface AlertProps {
|
|
20
|
+
message: string;
|
|
21
|
+
type?: 'success' | 'error';
|
|
22
|
+
}
|
|
23
|
+
declare const Alert: ({ message, type }: AlertProps) => HTMLDivElement;
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
interface BadgeProps {
|
|
26
|
+
label: string;
|
|
27
|
+
color?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const Badge: ({ label, color }: BadgeProps) => HTMLSpanElement;
|
|
10
30
|
|
|
11
31
|
export { Alert, Badge, Button, Card, Input };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
interface ButtonProps {
|
|
2
|
+
text: string;
|
|
3
|
+
color?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const Button: ({ text, color }: ButtonProps) => HTMLButtonElement;
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
interface InputProps {
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Input: ({ placeholder, type }: InputProps) => HTMLDivElement;
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
interface CardProps {
|
|
14
|
+
title: string;
|
|
15
|
+
content: string;
|
|
16
|
+
}
|
|
17
|
+
declare const Card: ({ title, content }: CardProps) => HTMLDivElement;
|
|
6
18
|
|
|
7
|
-
|
|
19
|
+
interface AlertProps {
|
|
20
|
+
message: string;
|
|
21
|
+
type?: 'success' | 'error';
|
|
22
|
+
}
|
|
23
|
+
declare const Alert: ({ message, type }: AlertProps) => HTMLDivElement;
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
interface BadgeProps {
|
|
26
|
+
label: string;
|
|
27
|
+
color?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const Badge: ({ label, color }: BadgeProps) => HTMLSpanElement;
|
|
10
30
|
|
|
11
31
|
export { Alert, Badge, Button, Card, Input };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
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>
|
|
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});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
var
|
|
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>
|
|
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};
|