virtual-ui-lib 1.0.18 → 1.0.19

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
@@ -34,7 +34,8 @@ __export(index_exports, {
34
34
  Card: () => Card,
35
35
  Dropdown: () => Dropdown,
36
36
  EmptyState: () => EmptyState,
37
- FormInput: () => FormInput
37
+ FormInput: () => FormInput,
38
+ GridLayout: () => GridLayout
38
39
  });
39
40
  module.exports = __toCommonJS(index_exports);
40
41
 
@@ -360,6 +361,44 @@ var FormInput = ({
360
361
  }
361
362
  ), isError && /* @__PURE__ */ import_react6.default.createElement("p", { style: { marginTop: "8px", color: "#ef4444", fontSize: "12px", opacity: 0, animation: "fadeIn 0.3s forwards" } }, errorMessage), isSuccess && /* @__PURE__ */ import_react6.default.createElement("p", { style: { marginTop: "8px", color: "#22c55e", fontSize: "12px" } }, "Input is valid!"), /* @__PURE__ */ import_react6.default.createElement("style", null, `@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }`));
362
363
  };
364
+
365
+ // src/components/GridLayout/GridLayout.jsx
366
+ var import_react7 = __toESM(require("react"));
367
+ var GridLayout = ({
368
+ items = [],
369
+ cols = 3,
370
+ loading = false,
371
+ emptyMessage = "No items available",
372
+ itemBg = "#1f2937",
373
+ itemColor = "#f1f5f9",
374
+ spacing = "16px",
375
+ radius = "8px"
376
+ }) => {
377
+ const renderItem = (item, index) => /* @__PURE__ */ import_react7.default.createElement("div", { key: index, style: {
378
+ background: itemBg,
379
+ color: itemColor,
380
+ borderRadius: radius,
381
+ padding: "16px",
382
+ margin: spacing,
383
+ transition: "transform 0.3s, box-shadow 0.3s",
384
+ boxShadow: "0 2px 10px rgba(0, 0, 0, 0.15)",
385
+ display: "flex",
386
+ justifyContent: "center",
387
+ alignItems: "center",
388
+ cursor: "pointer"
389
+ }, onMouseEnter: (e) => {
390
+ e.currentTarget.style.transform = "scale(1.05)";
391
+ }, onMouseLeave: (e) => {
392
+ e.currentTarget.style.transform = "scale(1)";
393
+ } }, item);
394
+ if (loading) {
395
+ return /* @__PURE__ */ import_react7.default.createElement("div", { style: { display: "grid", gridTemplateColumns: `repeat(${cols}, 1fr)`, gap: spacing } }, Array.from({ length: cols * 3 }).map((_, index) => /* @__PURE__ */ import_react7.default.createElement("div", { key: index, style: { background: "#334155", height: "100px", borderRadius: radius } })));
396
+ }
397
+ if (items.length === 0) {
398
+ return /* @__PURE__ */ import_react7.default.createElement("div", { style: { color: itemColor, textAlign: "center", padding: "20px" } }, emptyMessage);
399
+ }
400
+ return /* @__PURE__ */ import_react7.default.createElement("div", { style: { display: "grid", gridTemplateColumns: `repeat(${cols}, 1fr)`, gap: spacing } }, items.map(renderItem));
401
+ };
363
402
  // Annotate the CommonJS export names for ESM import in node:
364
403
  0 && (module.exports = {
365
404
  AlertBanner,
@@ -367,5 +406,6 @@ var FormInput = ({
367
406
  Card,
368
407
  Dropdown,
369
408
  EmptyState,
370
- FormInput
409
+ FormInput,
410
+ GridLayout
371
411
  });
package/dist/index.mjs CHANGED
@@ -320,11 +320,50 @@ var FormInput = ({
320
320
  }
321
321
  ), isError && /* @__PURE__ */ React6.createElement("p", { style: { marginTop: "8px", color: "#ef4444", fontSize: "12px", opacity: 0, animation: "fadeIn 0.3s forwards" } }, errorMessage), isSuccess && /* @__PURE__ */ React6.createElement("p", { style: { marginTop: "8px", color: "#22c55e", fontSize: "12px" } }, "Input is valid!"), /* @__PURE__ */ React6.createElement("style", null, `@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }`));
322
322
  };
323
+
324
+ // src/components/GridLayout/GridLayout.jsx
325
+ import React7 from "react";
326
+ var GridLayout = ({
327
+ items = [],
328
+ cols = 3,
329
+ loading = false,
330
+ emptyMessage = "No items available",
331
+ itemBg = "#1f2937",
332
+ itemColor = "#f1f5f9",
333
+ spacing = "16px",
334
+ radius = "8px"
335
+ }) => {
336
+ const renderItem = (item, index) => /* @__PURE__ */ React7.createElement("div", { key: index, style: {
337
+ background: itemBg,
338
+ color: itemColor,
339
+ borderRadius: radius,
340
+ padding: "16px",
341
+ margin: spacing,
342
+ transition: "transform 0.3s, box-shadow 0.3s",
343
+ boxShadow: "0 2px 10px rgba(0, 0, 0, 0.15)",
344
+ display: "flex",
345
+ justifyContent: "center",
346
+ alignItems: "center",
347
+ cursor: "pointer"
348
+ }, onMouseEnter: (e) => {
349
+ e.currentTarget.style.transform = "scale(1.05)";
350
+ }, onMouseLeave: (e) => {
351
+ e.currentTarget.style.transform = "scale(1)";
352
+ } }, item);
353
+ if (loading) {
354
+ return /* @__PURE__ */ React7.createElement("div", { style: { display: "grid", gridTemplateColumns: `repeat(${cols}, 1fr)`, gap: spacing } }, Array.from({ length: cols * 3 }).map((_, index) => /* @__PURE__ */ React7.createElement("div", { key: index, style: { background: "#334155", height: "100px", borderRadius: radius } })));
355
+ }
356
+ if (items.length === 0) {
357
+ return /* @__PURE__ */ React7.createElement("div", { style: { color: itemColor, textAlign: "center", padding: "20px" } }, emptyMessage);
358
+ }
359
+ return /* @__PURE__ */ React7.createElement("div", { style: { display: "grid", gridTemplateColumns: `repeat(${cols}, 1fr)`, gap: spacing } }, items.map(renderItem));
360
+ };
323
361
  export {
324
362
  AlertBanner,
325
363
  Button,
326
364
  Card,
327
365
  Dropdown,
328
366
  EmptyState,
329
- FormInput
367
+ FormInput,
368
+ GridLayout
330
369
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",