oasis-chat 0.0.1
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 +36 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +18 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Oasis Button (Vanilla JS)
|
|
2
|
+
|
|
3
|
+
`createButton`을 제공하는 가벼운 바닐라 JS 버튼 컴포넌트입니다.
|
|
4
|
+
|
|
5
|
+
## 설치
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install oasis-chatting
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 사용 예시
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { createButton } from 'oasis-chatting';
|
|
15
|
+
|
|
16
|
+
const btn = createButton({
|
|
17
|
+
label: 'Hello 버튼',
|
|
18
|
+
onClick: () => alert('hello'),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
document.body.appendChild(btn);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- Tailwind CSS를 사용하지 않아도 동작합니다. (클래스는 붙지만 스타일은 선택)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 개발/빌드
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run dev # 데모 앱 실행 (Vite)
|
|
31
|
+
npm run build:lib # 라이브러리 빌드 (dist 생성)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 라이선스
|
|
35
|
+
|
|
36
|
+
MIT
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("clsx");function i({label:n="클릭",className:o="",onClick:t}={}){const e=document.createElement("button");return e.type="button",e.className=c("inline-flex items-center justify-center rounded-md","bg-blue-600 text-white","px-4 py-2 text-sm font-medium","shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500","disabled:opacity-50 disabled:cursor-not-allowed",o),e.textContent=n,e.addEventListener("click",u=>{typeof t=="function"&&t(u)}),e}exports.createButton=i;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/components/Button.js"],"sourcesContent":["import clsx from \"clsx\";\n\nexport function createButton({ label = \"클릭\", className = \"\", onClick } = {}) {\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className = clsx(\n \"inline-flex items-center justify-center rounded-md\",\n \"bg-blue-600 text-white\",\n \"px-4 py-2 text-sm font-medium\",\n \"shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className\n );\n button.textContent = label;\n button.addEventListener(\"click\", (e) => {\n if (typeof onClick === \"function\") {\n onClick(e);\n }\n });\n return button;\n}\n"],"names":["createButton","label","className","onClick","button","clsx","e"],"mappings":"wGAEO,SAASA,EAAa,CAAE,MAAAC,EAAQ,KAAM,UAAAC,EAAY,GAAI,QAAAC,CAAO,EAAK,GAAI,CAC3E,MAAMC,EAAS,SAAS,cAAc,QAAQ,EAC9C,OAAAA,EAAO,KAAO,SACdA,EAAO,UAAYC,EACjB,qDACA,yBACA,gCACA,kFACA,kDACAH,CACJ,EACEE,EAAO,YAAcH,EACrBG,EAAO,iBAAiB,QAAUE,GAAM,CAClC,OAAOH,GAAY,YACrBA,EAAQG,CAAC,CAEb,CAAC,EACMF,CACT"}
|
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import i from "clsx";
|
|
2
|
+
function r({ label: n = "클릭", className: o = "", onClick: e } = {}) {
|
|
3
|
+
const t = document.createElement("button");
|
|
4
|
+
return t.type = "button", t.className = i(
|
|
5
|
+
"inline-flex items-center justify-center rounded-md",
|
|
6
|
+
"bg-blue-600 text-white",
|
|
7
|
+
"px-4 py-2 text-sm font-medium",
|
|
8
|
+
"shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
9
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
10
|
+
o
|
|
11
|
+
), t.textContent = n, t.addEventListener("click", (u) => {
|
|
12
|
+
typeof e == "function" && e(u);
|
|
13
|
+
}), t;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
r as createButton
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/components/Button.js"],"sourcesContent":["import clsx from \"clsx\";\n\nexport function createButton({ label = \"클릭\", className = \"\", onClick } = {}) {\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className = clsx(\n \"inline-flex items-center justify-center rounded-md\",\n \"bg-blue-600 text-white\",\n \"px-4 py-2 text-sm font-medium\",\n \"shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className\n );\n button.textContent = label;\n button.addEventListener(\"click\", (e) => {\n if (typeof onClick === \"function\") {\n onClick(e);\n }\n });\n return button;\n}\n"],"names":["createButton","label","className","onClick","button","clsx","e"],"mappings":";AAEO,SAASA,EAAa,EAAE,OAAAC,IAAQ,MAAM,WAAAC,IAAY,IAAI,SAAAC,EAAO,IAAK,IAAI;AAC3E,QAAMC,IAAS,SAAS,cAAc,QAAQ;AAC9C,SAAAA,EAAO,OAAO,UACdA,EAAO,YAAYC;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAH;AAAA,EACJ,GACEE,EAAO,cAAcH,GACrBG,EAAO,iBAAiB,SAAS,CAACE,MAAM;AACtC,IAAI,OAAOH,KAAY,cACrBA,EAAQG,CAAC;AAAA,EAEb,CAAC,GACMF;AACT;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("clsx")):typeof define=="function"&&define.amd?define(["exports","clsx"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.OasisButton={},e.clsx))})(this,(function(e,t){"use strict";function i({label:u="클릭",className:s="",onClick:o}={}){const n=document.createElement("button");return n.type="button",n.className=t("inline-flex items-center justify-center rounded-md","bg-blue-600 text-white","px-4 py-2 text-sm font-medium","shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500","disabled:opacity-50 disabled:cursor-not-allowed",s),n.textContent=u,n.addEventListener("click",d=>{typeof o=="function"&&o(d)}),n}e.createButton=i,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/components/Button.js"],"sourcesContent":["import clsx from \"clsx\";\n\nexport function createButton({ label = \"클릭\", className = \"\", onClick } = {}) {\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className = clsx(\n \"inline-flex items-center justify-center rounded-md\",\n \"bg-blue-600 text-white\",\n \"px-4 py-2 text-sm font-medium\",\n \"shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className\n );\n button.textContent = label;\n button.addEventListener(\"click\", (e) => {\n if (typeof onClick === \"function\") {\n onClick(e);\n }\n });\n return button;\n}\n"],"names":["createButton","label","className","onClick","button","clsx","e"],"mappings":"oQAEO,SAASA,EAAa,CAAE,MAAAC,EAAQ,KAAM,UAAAC,EAAY,GAAI,QAAAC,CAAO,EAAK,GAAI,CAC3E,MAAMC,EAAS,SAAS,cAAc,QAAQ,EAC9C,OAAAA,EAAO,KAAO,SACdA,EAAO,UAAYC,EACjB,qDACA,yBACA,gCACA,kFACA,kDACAH,CACJ,EACEE,EAAO,YAAcH,EACrBG,EAAO,iBAAiB,QAAUE,GAAM,CAClC,OAAOH,GAAY,YACrBA,EAAQG,CAAC,CAEb,CAAC,EACMF,CACT"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oasis-chat",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Vanilla JS button component with no runtime deps.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"build:lib": "vite build --config vite.lib.config.js && cp src/index.d.ts dist/index.d.ts",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"format": "prettier --write ."
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"main": "./dist/index.cjs.js",
|
|
20
|
+
"module": "./dist/index.es.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"unpkg": "./dist/index.umd.js",
|
|
23
|
+
"jsdelivr": "./dist/index.umd.js",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": "./dist/index.es.js",
|
|
27
|
+
"require": "./dist/index.cjs.js",
|
|
28
|
+
"default": "./dist/index.es.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@tailwindcss/vite": "^4.1.16",
|
|
34
|
+
"prettier": "^3.6.2",
|
|
35
|
+
"prettier-plugin-tailwindcss": "^0.7.1",
|
|
36
|
+
"tailwindcss": "^4.1.16",
|
|
37
|
+
"vite": "^7.1.12"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {},
|
|
40
|
+
"type": "module"
|
|
41
|
+
}
|