virtual-ui-lib 1.0.40 → 1.0.41
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.js +48 -0
- package/dist/index.mjs +47 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var index_exports = {};
|
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
CodeBlock: () => CodeBlock,
|
|
33
33
|
OtpInput: () => OtpInput,
|
|
34
|
+
SmartButton: () => SmartButton,
|
|
34
35
|
StatCard: () => StatCard,
|
|
35
36
|
ToastNotification: () => ToastNotification
|
|
36
37
|
});
|
|
@@ -260,10 +261,57 @@ var CodeBlock = ({
|
|
|
260
261
|
};
|
|
261
262
|
return /* @__PURE__ */ import_react4.default.createElement("div", { style: { background: bg, borderRadius: "8px", padding: "16px", fontFamily: "monospace", position: "relative" } }, filename && /* @__PURE__ */ import_react4.default.createElement("div", { style: { color: textColor, fontWeight: "bold", marginBottom: "8px" } }, filename), /* @__PURE__ */ import_react4.default.createElement("div", { style: { overflowX: wrapWords ? "auto" : "hidden", whiteSpace: wrapWords ? "normal" : "pre" } }, formatCode()), /* @__PURE__ */ import_react4.default.createElement("button", { onClick: handleCopy, style: { position: "absolute", top: "10px", right: "10px", background: copied ? "#28a745" : "#58a6ff", color: "white", border: "none", borderRadius: "4px", padding: "8px 12px", cursor: "pointer", fontSize: "14px", marginLeft: "10px" } }, copied ? "\u2713 Copied" : "Copy"), /* @__PURE__ */ import_react4.default.createElement("button", { onClick: () => wrapWords = !wrapWords, style: { position: "absolute", top: "10px", right: "90px", background: "#58a6ff", color: "white", border: "none", borderRadius: "4px", padding: "8px 12px", cursor: "pointer", fontSize: "14px" } }, wrapWords ? "Wrap Off" : "Wrap On"));
|
|
262
263
|
};
|
|
264
|
+
|
|
265
|
+
// src/components/SmartButton/SmartButton.jsx
|
|
266
|
+
var import_react5 = __toESM(require("react"));
|
|
267
|
+
var SmartButton = ({
|
|
268
|
+
buttonText = "Submit",
|
|
269
|
+
isLoading = false,
|
|
270
|
+
isDisabled = false,
|
|
271
|
+
icon = null,
|
|
272
|
+
success = false,
|
|
273
|
+
error = false,
|
|
274
|
+
bg = "#7c3aed",
|
|
275
|
+
textColor = "#fff",
|
|
276
|
+
padding = "12px 20px",
|
|
277
|
+
radius = "8px",
|
|
278
|
+
onClick = () => {
|
|
279
|
+
}
|
|
280
|
+
}) => {
|
|
281
|
+
const bgColor = success ? "#059669" : error ? "#ef4444" : bg;
|
|
282
|
+
const cursorStyle = isDisabled ? "not-allowed" : "pointer";
|
|
283
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
284
|
+
"button",
|
|
285
|
+
{
|
|
286
|
+
onClick: !isDisabled && !isLoading ? onClick : () => {
|
|
287
|
+
},
|
|
288
|
+
disabled: isDisabled,
|
|
289
|
+
style: {
|
|
290
|
+
background: bgColor,
|
|
291
|
+
color: textColor,
|
|
292
|
+
padding,
|
|
293
|
+
borderRadius: radius,
|
|
294
|
+
border: "none",
|
|
295
|
+
cursor: cursorStyle,
|
|
296
|
+
transition: "background 0.3s ease"
|
|
297
|
+
},
|
|
298
|
+
onMouseEnter: (e) => {
|
|
299
|
+
if (!isDisabled && !isLoading) {
|
|
300
|
+
e.currentTarget.style.background = "#6d28d9";
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
onMouseLeave: (e) => {
|
|
304
|
+
e.currentTarget.style.background = bgColor;
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
isLoading ? /* @__PURE__ */ import_react5.default.createElement("span", null, "Loading...") : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, icon && /* @__PURE__ */ import_react5.default.createElement("span", { style: { marginRight: "8px" } }, icon), buttonText)
|
|
308
|
+
);
|
|
309
|
+
};
|
|
263
310
|
// Annotate the CommonJS export names for ESM import in node:
|
|
264
311
|
0 && (module.exports = {
|
|
265
312
|
CodeBlock,
|
|
266
313
|
OtpInput,
|
|
314
|
+
SmartButton,
|
|
267
315
|
StatCard,
|
|
268
316
|
ToastNotification
|
|
269
317
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -222,9 +222,56 @@ var CodeBlock = ({
|
|
|
222
222
|
};
|
|
223
223
|
return /* @__PURE__ */ React4.createElement("div", { style: { background: bg, borderRadius: "8px", padding: "16px", fontFamily: "monospace", position: "relative" } }, filename && /* @__PURE__ */ React4.createElement("div", { style: { color: textColor, fontWeight: "bold", marginBottom: "8px" } }, filename), /* @__PURE__ */ React4.createElement("div", { style: { overflowX: wrapWords ? "auto" : "hidden", whiteSpace: wrapWords ? "normal" : "pre" } }, formatCode()), /* @__PURE__ */ React4.createElement("button", { onClick: handleCopy, style: { position: "absolute", top: "10px", right: "10px", background: copied ? "#28a745" : "#58a6ff", color: "white", border: "none", borderRadius: "4px", padding: "8px 12px", cursor: "pointer", fontSize: "14px", marginLeft: "10px" } }, copied ? "\u2713 Copied" : "Copy"), /* @__PURE__ */ React4.createElement("button", { onClick: () => wrapWords = !wrapWords, style: { position: "absolute", top: "10px", right: "90px", background: "#58a6ff", color: "white", border: "none", borderRadius: "4px", padding: "8px 12px", cursor: "pointer", fontSize: "14px" } }, wrapWords ? "Wrap Off" : "Wrap On"));
|
|
224
224
|
};
|
|
225
|
+
|
|
226
|
+
// src/components/SmartButton/SmartButton.jsx
|
|
227
|
+
import React5 from "react";
|
|
228
|
+
var SmartButton = ({
|
|
229
|
+
buttonText = "Submit",
|
|
230
|
+
isLoading = false,
|
|
231
|
+
isDisabled = false,
|
|
232
|
+
icon = null,
|
|
233
|
+
success = false,
|
|
234
|
+
error = false,
|
|
235
|
+
bg = "#7c3aed",
|
|
236
|
+
textColor = "#fff",
|
|
237
|
+
padding = "12px 20px",
|
|
238
|
+
radius = "8px",
|
|
239
|
+
onClick = () => {
|
|
240
|
+
}
|
|
241
|
+
}) => {
|
|
242
|
+
const bgColor = success ? "#059669" : error ? "#ef4444" : bg;
|
|
243
|
+
const cursorStyle = isDisabled ? "not-allowed" : "pointer";
|
|
244
|
+
return /* @__PURE__ */ React5.createElement(
|
|
245
|
+
"button",
|
|
246
|
+
{
|
|
247
|
+
onClick: !isDisabled && !isLoading ? onClick : () => {
|
|
248
|
+
},
|
|
249
|
+
disabled: isDisabled,
|
|
250
|
+
style: {
|
|
251
|
+
background: bgColor,
|
|
252
|
+
color: textColor,
|
|
253
|
+
padding,
|
|
254
|
+
borderRadius: radius,
|
|
255
|
+
border: "none",
|
|
256
|
+
cursor: cursorStyle,
|
|
257
|
+
transition: "background 0.3s ease"
|
|
258
|
+
},
|
|
259
|
+
onMouseEnter: (e) => {
|
|
260
|
+
if (!isDisabled && !isLoading) {
|
|
261
|
+
e.currentTarget.style.background = "#6d28d9";
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
onMouseLeave: (e) => {
|
|
265
|
+
e.currentTarget.style.background = bgColor;
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
isLoading ? /* @__PURE__ */ React5.createElement("span", null, "Loading...") : /* @__PURE__ */ React5.createElement(React5.Fragment, null, icon && /* @__PURE__ */ React5.createElement("span", { style: { marginRight: "8px" } }, icon), buttonText)
|
|
269
|
+
);
|
|
270
|
+
};
|
|
225
271
|
export {
|
|
226
272
|
CodeBlock,
|
|
227
273
|
OtpInput,
|
|
274
|
+
SmartButton,
|
|
228
275
|
StatCard,
|
|
229
276
|
ToastNotification
|
|
230
277
|
};
|