baaz-custom-components 3.1.16 → 3.1.17

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.d.mts CHANGED
@@ -44,6 +44,4 @@ type BreadcrumbProps = {
44
44
  includeFrom?: number;
45
45
  };
46
46
 
47
- declare const CustomBreadcrumb: ({ layoutName, includeFrom }: BreadcrumbProps) => react.JSX.Element;
48
-
49
- export { type BreadcrumbProps, CustomBreadcrumb, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, type RouteTree, type RouterAdapter, type UserData };
47
+ export { type BreadcrumbProps, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, type RouteTree, type RouterAdapter, type UserData };
package/dist/index.d.ts CHANGED
@@ -44,6 +44,4 @@ type BreadcrumbProps = {
44
44
  includeFrom?: number;
45
45
  };
46
46
 
47
- declare const CustomBreadcrumb: ({ layoutName, includeFrom }: BreadcrumbProps) => react.JSX.Element;
48
-
49
- export { type BreadcrumbProps, CustomBreadcrumb, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, type RouteTree, type RouterAdapter, type UserData };
47
+ export { type BreadcrumbProps, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, type RouteTree, type RouterAdapter, type UserData };
package/dist/index.js CHANGED
@@ -59,7 +59,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
59
59
  // src/components/index.ts
60
60
  var index_exports = {};
61
61
  __export(index_exports, {
62
- CustomBreadcrumb: () => breadcrumb_default,
63
62
  Navbar: () => Navbar
64
63
  });
65
64
  module.exports = __toCommonJS(index_exports);
@@ -423,12 +422,6 @@ function MenubarSubContent(_a) {
423
422
  var import_lucide_react4 = require("lucide-react");
424
423
 
425
424
  // src/utils/helper.ts
426
- var buildUrl = (urls, index) => {
427
- return `/${urls.slice(0, index + 1).join("/")}`;
428
- };
429
- var capitalizeFirstLetter = (text, splitter = "-") => {
430
- return text.split(splitter).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
431
- };
432
425
  var formatDateAndTime = (time) => {
433
426
  return `${new Date(time).toDateString()} . ${new Date(time).toTimeString().split(" ")[0]}`;
434
427
  };
@@ -1395,112 +1388,7 @@ function Navbar({
1395
1388
  }
1396
1389
  ) });
1397
1390
  }
1398
-
1399
- // src/components/custom/breadcrumb/index.tsx
1400
- var import_lucide_react10 = require("lucide-react");
1401
- var import_navigation = require("next/navigation");
1402
-
1403
- // src/components/ui/breadcrumb.tsx
1404
- var import_react_slot3 = require("@radix-ui/react-slot");
1405
- var import_lucide_react9 = require("lucide-react");
1406
- var import_jsx_runtime18 = require("react/jsx-runtime");
1407
- function Breadcrumb(_a) {
1408
- var props = __objRest(_a, []);
1409
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("nav", __spreadValues({ "aria-label": "breadcrumb", "data-slot": "breadcrumb" }, props));
1410
- }
1411
- function BreadcrumbList(_a) {
1412
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1413
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1414
- "ol",
1415
- __spreadValues({
1416
- "data-slot": "breadcrumb-list",
1417
- className: cn(
1418
- "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
1419
- className
1420
- )
1421
- }, props)
1422
- );
1423
- }
1424
- function BreadcrumbItem(_a) {
1425
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1426
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1427
- "li",
1428
- __spreadValues({
1429
- "data-slot": "breadcrumb-item",
1430
- className: cn("inline-flex items-center gap-1.5", className)
1431
- }, props)
1432
- );
1433
- }
1434
- function BreadcrumbLink(_a) {
1435
- var _b = _a, {
1436
- asChild,
1437
- className
1438
- } = _b, props = __objRest(_b, [
1439
- "asChild",
1440
- "className"
1441
- ]);
1442
- const Comp = asChild ? import_react_slot3.Slot : "a";
1443
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1444
- Comp,
1445
- __spreadValues({
1446
- "data-slot": "breadcrumb-link",
1447
- className: cn("hover:text-foreground transition-colors", className)
1448
- }, props)
1449
- );
1450
- }
1451
- function BreadcrumbSeparator(_a) {
1452
- var _b = _a, {
1453
- children,
1454
- className
1455
- } = _b, props = __objRest(_b, [
1456
- "children",
1457
- "className"
1458
- ]);
1459
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1460
- "li",
1461
- __spreadProps(__spreadValues({
1462
- "data-slot": "breadcrumb-separator",
1463
- role: "presentation",
1464
- "aria-hidden": "true",
1465
- className: cn("[&>svg]:size-3.5", className)
1466
- }, props), {
1467
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react9.ChevronRight, {})
1468
- })
1469
- );
1470
- }
1471
-
1472
- // src/components/custom/breadcrumb/index.tsx
1473
- var import_jsx_runtime19 = require("react/jsx-runtime");
1474
- var CustomBreadcrumb = ({ layoutName, includeFrom = 0 }) => {
1475
- const pathname = (0, import_navigation.usePathname)();
1476
- const completeUrl = pathname.split("/").filter(Boolean);
1477
- const urls = pathname.split("/").filter(Boolean).slice(includeFrom);
1478
- const activeClassName = "text-primary";
1479
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Breadcrumb, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(BreadcrumbList, { children: [
1480
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BreadcrumbItem, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "text-base", children: capitalizeFirstLetter(layoutName) }) }),
1481
- urls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BreadcrumbSeparator, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.Slash, { className: "!h-md !w-md" }) }),
1482
- urls.map((url, index) => {
1483
- const href = buildUrl(
1484
- completeUrl,
1485
- index + includeFrom
1486
- );
1487
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(BreadcrumbItem, { children: [
1488
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1489
- BreadcrumbLink,
1490
- {
1491
- href,
1492
- className: `!font-light !text-md !text-off-white ${index >= urls.length - 1 && activeClassName}`,
1493
- children: capitalizeFirstLetter(url)
1494
- }
1495
- ),
1496
- index < urls.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BreadcrumbSeparator, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.Slash, { className: "!h-md !w-md" }) })
1497
- ] }, index);
1498
- })
1499
- ] }) });
1500
- };
1501
- var breadcrumb_default = CustomBreadcrumb;
1502
1391
  // Annotate the CommonJS export names for ESM import in node:
1503
1392
  0 && (module.exports = {
1504
- CustomBreadcrumb,
1505
1393
  Navbar
1506
1394
  });
package/dist/index.mjs CHANGED
@@ -389,12 +389,6 @@ function MenubarSubContent(_a) {
389
389
  import { ChevronDown, ChevronUp } from "lucide-react";
390
390
 
391
391
  // src/utils/helper.ts
392
- var buildUrl = (urls, index) => {
393
- return `/${urls.slice(0, index + 1).join("/")}`;
394
- };
395
- var capitalizeFirstLetter = (text, splitter = "-") => {
396
- return text.split(splitter).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
397
- };
398
392
  var formatDateAndTime = (time) => {
399
393
  return `${new Date(time).toDateString()} . ${new Date(time).toTimeString().split(" ")[0]}`;
400
394
  };
@@ -1361,111 +1355,6 @@ function Navbar({
1361
1355
  }
1362
1356
  ) });
1363
1357
  }
1364
-
1365
- // src/components/custom/breadcrumb/index.tsx
1366
- import { Slash } from "lucide-react";
1367
- import { usePathname } from "next/navigation";
1368
-
1369
- // src/components/ui/breadcrumb.tsx
1370
- import { Slot as Slot3 } from "@radix-ui/react-slot";
1371
- import { ChevronRight as ChevronRight2, MoreHorizontal } from "lucide-react";
1372
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
1373
- function Breadcrumb(_a) {
1374
- var props = __objRest(_a, []);
1375
- return /* @__PURE__ */ jsx18("nav", __spreadValues({ "aria-label": "breadcrumb", "data-slot": "breadcrumb" }, props));
1376
- }
1377
- function BreadcrumbList(_a) {
1378
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1379
- return /* @__PURE__ */ jsx18(
1380
- "ol",
1381
- __spreadValues({
1382
- "data-slot": "breadcrumb-list",
1383
- className: cn(
1384
- "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
1385
- className
1386
- )
1387
- }, props)
1388
- );
1389
- }
1390
- function BreadcrumbItem(_a) {
1391
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1392
- return /* @__PURE__ */ jsx18(
1393
- "li",
1394
- __spreadValues({
1395
- "data-slot": "breadcrumb-item",
1396
- className: cn("inline-flex items-center gap-1.5", className)
1397
- }, props)
1398
- );
1399
- }
1400
- function BreadcrumbLink(_a) {
1401
- var _b = _a, {
1402
- asChild,
1403
- className
1404
- } = _b, props = __objRest(_b, [
1405
- "asChild",
1406
- "className"
1407
- ]);
1408
- const Comp = asChild ? Slot3 : "a";
1409
- return /* @__PURE__ */ jsx18(
1410
- Comp,
1411
- __spreadValues({
1412
- "data-slot": "breadcrumb-link",
1413
- className: cn("hover:text-foreground transition-colors", className)
1414
- }, props)
1415
- );
1416
- }
1417
- function BreadcrumbSeparator(_a) {
1418
- var _b = _a, {
1419
- children,
1420
- className
1421
- } = _b, props = __objRest(_b, [
1422
- "children",
1423
- "className"
1424
- ]);
1425
- return /* @__PURE__ */ jsx18(
1426
- "li",
1427
- __spreadProps(__spreadValues({
1428
- "data-slot": "breadcrumb-separator",
1429
- role: "presentation",
1430
- "aria-hidden": "true",
1431
- className: cn("[&>svg]:size-3.5", className)
1432
- }, props), {
1433
- children: children != null ? children : /* @__PURE__ */ jsx18(ChevronRight2, {})
1434
- })
1435
- );
1436
- }
1437
-
1438
- // src/components/custom/breadcrumb/index.tsx
1439
- import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1440
- var CustomBreadcrumb = ({ layoutName, includeFrom = 0 }) => {
1441
- const pathname = usePathname();
1442
- const completeUrl = pathname.split("/").filter(Boolean);
1443
- const urls = pathname.split("/").filter(Boolean).slice(includeFrom);
1444
- const activeClassName = "text-primary";
1445
- return /* @__PURE__ */ jsx19(Breadcrumb, { children: /* @__PURE__ */ jsxs14(BreadcrumbList, { children: [
1446
- /* @__PURE__ */ jsx19(BreadcrumbItem, { children: /* @__PURE__ */ jsx19("h2", { className: "text-base", children: capitalizeFirstLetter(layoutName) }) }),
1447
- urls.length > 0 && /* @__PURE__ */ jsx19(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx19(Slash, { className: "!h-md !w-md" }) }),
1448
- urls.map((url, index) => {
1449
- const href = buildUrl(
1450
- completeUrl,
1451
- index + includeFrom
1452
- );
1453
- return /* @__PURE__ */ jsxs14(BreadcrumbItem, { children: [
1454
- /* @__PURE__ */ jsx19(
1455
- BreadcrumbLink,
1456
- {
1457
- href,
1458
- className: `!font-light !text-md !text-off-white ${index >= urls.length - 1 && activeClassName}`,
1459
- children: capitalizeFirstLetter(url)
1460
- }
1461
- ),
1462
- index < urls.length - 1 && /* @__PURE__ */ jsx19(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx19(Slash, { className: "!h-md !w-md" }) })
1463
- ] }, index);
1464
- })
1465
- ] }) });
1466
- };
1467
- var breadcrumb_default = CustomBreadcrumb;
1468
1358
  export {
1469
- breadcrumb_default as CustomBreadcrumb,
1470
1359
  Navbar
1471
1360
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baaz-custom-components",
3
- "version": "3.1.16",
3
+ "version": "3.1.17",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",