oasis-chat 0.0.1 → 0.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/dist/index.cjs.js CHANGED
@@ -1,2 +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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i({label:n="클릭",className:o="",onClick:t}={}){const e=document.createElement("button");return e.type="button",e.className=["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].filter(Boolean).join(" "),e.textContent=n,e.addEventListener("click",u=>{typeof t=="function"&&t(u)}),e}exports.createButton=i;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/index.js"],"sourcesContent":["export function createButton({ label = '클릭', className = '', onClick } = {}) {\n const button = document.createElement('button');\n button.type = 'button';\n button.className = [\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 .filter(Boolean)\n .join(' ');\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","e"],"mappings":"gFAAO,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,UAAY,CACjB,qDACA,yBACA,gCACA,kFACA,kDACAF,CACJ,EACK,OAAO,OAAO,EACd,KAAK,GAAG,EACXE,EAAO,YAAcH,EACrBG,EAAO,iBAAiB,QAAUC,GAAM,CAClC,OAAOF,GAAY,YACrBA,EAAQE,CAAC,CAEb,CAAC,EACMD,CACT"}
@@ -0,0 +1,7 @@
1
+ export interface CreateButtonOptions {
2
+ label?: string;
3
+ className?: string;
4
+ onClick?: (e: MouseEvent) => void;
5
+ }
6
+
7
+ export function createButton(options?: CreateButtonOptions): HTMLButtonElement;
package/dist/index.es.js CHANGED
@@ -1,18 +1,17 @@
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(
1
+ function i({ label: n = "클릭", className: o = "", onClick: t } = {}) {
2
+ const e = document.createElement("button");
3
+ return e.type = "button", e.className = [
5
4
  "inline-flex items-center justify-center rounded-md",
6
5
  "bg-blue-600 text-white",
7
6
  "px-4 py-2 text-sm font-medium",
8
7
  "shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500",
9
8
  "disabled:opacity-50 disabled:cursor-not-allowed",
10
9
  o
11
- ), t.textContent = n, t.addEventListener("click", (u) => {
12
- typeof e == "function" && e(u);
13
- }), t;
10
+ ].filter(Boolean).join(" "), e.textContent = n, e.addEventListener("click", (u) => {
11
+ typeof t == "function" && t(u);
12
+ }), e;
14
13
  }
15
14
  export {
16
- r as createButton
15
+ i as createButton
17
16
  };
18
17
  //# sourceMappingURL=index.es.js.map
@@ -1 +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;"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/index.js"],"sourcesContent":["export function createButton({ label = '클릭', className = '', onClick } = {}) {\n const button = document.createElement('button');\n button.type = 'button';\n button.className = [\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 .filter(Boolean)\n .join(' ');\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","e"],"mappings":"AAAO,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,YAAY;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAF;AAAA,EACJ,EACK,OAAO,OAAO,EACd,KAAK,GAAG,GACXE,EAAO,cAAcH,GACrBG,EAAO,iBAAiB,SAAS,CAACC,MAAM;AACtC,IAAI,OAAOF,KAAY,cACrBA,EAAQE,CAAC;AAAA,EAEb,CAAC,GACMD;AACT;"}
package/dist/index.umd.js CHANGED
@@ -1,2 +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"})}));
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.OasisButton={}))})(this,(function(e){"use strict";function t({label:i="클릭",className:u="",onClick:o}={}){const n=document.createElement("button");return n.type="button",n.className=["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",u].filter(Boolean).join(" "),n.textContent=i,n.addEventListener("click",s=>{typeof o=="function"&&o(s)}),n}e.createButton=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/index.js"],"sourcesContent":["export function createButton({ label = '클릭', className = '', onClick } = {}) {\n const button = document.createElement('button');\n button.type = 'button';\n button.className = [\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 .filter(Boolean)\n .join(' ');\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","e"],"mappings":"oOAAO,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,UAAY,CACjB,qDACA,yBACA,gCACA,kFACA,kDACAF,CACJ,EACK,OAAO,OAAO,EACd,KAAK,GAAG,EACXE,EAAO,YAAcH,EACrBG,EAAO,iBAAiB,QAAUC,GAAM,CAClC,OAAOF,GAAY,YACrBA,EAAQE,CAAC,CAEb,CAAC,EACMD,CACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-chat",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Vanilla JS button component with no runtime deps.",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -16,6 +16,10 @@
16
16
  "dist",
17
17
  "README.md"
18
18
  ],
19
+ "publishConfig": {
20
+ "access": "public",
21
+ "registry": "https://registry.npmjs.org/"
22
+ },
19
23
  "main": "./dist/index.cjs.js",
20
24
  "module": "./dist/index.es.js",
21
25
  "types": "./dist/index.d.ts",