virtual-ui-lib 1.0.40 → 1.0.42

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 CHANGED
@@ -30,7 +30,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
32
  CodeBlock: () => CodeBlock,
33
+ CustomInputField: () => CustomInputField,
33
34
  OtpInput: () => OtpInput,
35
+ SmartButton: () => SmartButton,
34
36
  StatCard: () => StatCard,
35
37
  ToastNotification: () => ToastNotification
36
38
  });
@@ -260,10 +262,97 @@ var CodeBlock = ({
260
262
  };
261
263
  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
264
  };
265
+
266
+ // src/components/SmartButton/SmartButton.jsx
267
+ var import_react5 = __toESM(require("react"));
268
+ var SmartButton = ({
269
+ buttonText = "Submit",
270
+ isLoading = false,
271
+ isDisabled = false,
272
+ icon = null,
273
+ success = false,
274
+ error = false,
275
+ bg = "#7c3aed",
276
+ textColor = "#fff",
277
+ padding = "12px 20px",
278
+ radius = "8px",
279
+ onClick = () => {
280
+ }
281
+ }) => {
282
+ const bgColor = success ? "#059669" : error ? "#ef4444" : bg;
283
+ const cursorStyle = isDisabled ? "not-allowed" : "pointer";
284
+ return /* @__PURE__ */ import_react5.default.createElement(
285
+ "button",
286
+ {
287
+ onClick: !isDisabled && !isLoading ? onClick : () => {
288
+ },
289
+ disabled: isDisabled,
290
+ style: {
291
+ background: bgColor,
292
+ color: textColor,
293
+ padding,
294
+ borderRadius: radius,
295
+ border: "none",
296
+ cursor: cursorStyle,
297
+ transition: "background 0.3s ease"
298
+ },
299
+ onMouseEnter: (e) => {
300
+ if (!isDisabled && !isLoading) {
301
+ e.currentTarget.style.background = "#6d28d9";
302
+ }
303
+ },
304
+ onMouseLeave: (e) => {
305
+ e.currentTarget.style.background = bgColor;
306
+ }
307
+ },
308
+ 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)
309
+ );
310
+ };
311
+
312
+ // src/components/CustomInputField/CustomInputField.jsx
313
+ var import_react6 = __toESM(require("react"));
314
+ var CustomInputField = ({
315
+ label = "Label",
316
+ placeholder = "Enter text...",
317
+ errorMessage = "",
318
+ helperText = "",
319
+ value = "",
320
+ bg = "#1e293b",
321
+ textColor = "#f1f5f9",
322
+ accent = "#7c3aed",
323
+ padding = "10px",
324
+ radius = "8px",
325
+ onChange = () => {
326
+ }
327
+ }) => {
328
+ const [isFocused, setIsFocused] = (0, import_react6.useState)(false);
329
+ return /* @__PURE__ */ import_react6.default.createElement("div", { style: { margin: "16px 0" } }, /* @__PURE__ */ import_react6.default.createElement("label", { style: { color: textColor, marginBottom: "4px", display: "block" } }, label), /* @__PURE__ */ import_react6.default.createElement(
330
+ "input",
331
+ {
332
+ type: "text",
333
+ value,
334
+ placeholder,
335
+ onFocus: () => setIsFocused(true),
336
+ onBlur: () => setIsFocused(false),
337
+ onChange: (e) => onChange(e.target.value),
338
+ style: {
339
+ background: bg,
340
+ color: textColor,
341
+ padding,
342
+ borderRadius: radius,
343
+ border: isFocused ? `2px solid ${accent}` : "2px solid transparent",
344
+ transition: "border-color 0.3s ease",
345
+ width: "100%"
346
+ }
347
+ }
348
+ ), errorMessage && /* @__PURE__ */ import_react6.default.createElement("p", { style: { color: "red", margin: "4px 0 0 0" } }, errorMessage), helperText && /* @__PURE__ */ import_react6.default.createElement("p", { style: { color: textColor, margin: "4px 0 0 0" } }, helperText));
349
+ };
263
350
  // Annotate the CommonJS export names for ESM import in node:
264
351
  0 && (module.exports = {
265
352
  CodeBlock,
353
+ CustomInputField,
266
354
  OtpInput,
355
+ SmartButton,
267
356
  StatCard,
268
357
  ToastNotification
269
358
  });
package/dist/index.mjs CHANGED
@@ -222,9 +222,96 @@ 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
+ };
271
+
272
+ // src/components/CustomInputField/CustomInputField.jsx
273
+ import React6, { useState as useState5 } from "react";
274
+ var CustomInputField = ({
275
+ label = "Label",
276
+ placeholder = "Enter text...",
277
+ errorMessage = "",
278
+ helperText = "",
279
+ value = "",
280
+ bg = "#1e293b",
281
+ textColor = "#f1f5f9",
282
+ accent = "#7c3aed",
283
+ padding = "10px",
284
+ radius = "8px",
285
+ onChange = () => {
286
+ }
287
+ }) => {
288
+ const [isFocused, setIsFocused] = useState5(false);
289
+ return /* @__PURE__ */ React6.createElement("div", { style: { margin: "16px 0" } }, /* @__PURE__ */ React6.createElement("label", { style: { color: textColor, marginBottom: "4px", display: "block" } }, label), /* @__PURE__ */ React6.createElement(
290
+ "input",
291
+ {
292
+ type: "text",
293
+ value,
294
+ placeholder,
295
+ onFocus: () => setIsFocused(true),
296
+ onBlur: () => setIsFocused(false),
297
+ onChange: (e) => onChange(e.target.value),
298
+ style: {
299
+ background: bg,
300
+ color: textColor,
301
+ padding,
302
+ borderRadius: radius,
303
+ border: isFocused ? `2px solid ${accent}` : "2px solid transparent",
304
+ transition: "border-color 0.3s ease",
305
+ width: "100%"
306
+ }
307
+ }
308
+ ), errorMessage && /* @__PURE__ */ React6.createElement("p", { style: { color: "red", margin: "4px 0 0 0" } }, errorMessage), helperText && /* @__PURE__ */ React6.createElement("p", { style: { color: textColor, margin: "4px 0 0 0" } }, helperText));
309
+ };
225
310
  export {
226
311
  CodeBlock,
312
+ CustomInputField,
227
313
  OtpInput,
314
+ SmartButton,
228
315
  StatCard,
229
316
  ToastNotification
230
317
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",