@bizapps/ui 1.2.3 → 1.3.4

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/main.cjs CHANGED
@@ -2126,9 +2126,10 @@ function PopoverContent({
2126
2126
  className,
2127
2127
  align = "center",
2128
2128
  sideOffset = 4,
2129
+ container,
2129
2130
  ...props
2130
2131
  }) {
2131
- return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
2132
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Popover.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(
2132
2133
  radixUi.Popover.Content,
2133
2134
  {
2134
2135
  "data-slot": "popover-content",
@@ -2641,7 +2642,8 @@ function Combobox({
2641
2642
  searchPlaceholder = "Search...",
2642
2643
  emptyMessage = "No results found.",
2643
2644
  disabled = false,
2644
- className
2645
+ className,
2646
+ container
2645
2647
  }) {
2646
2648
  const [open, setOpen] = react.useState(false);
2647
2649
  const selected = options.find((opt) => opt.value === value);
@@ -2664,7 +2666,7 @@ function Combobox({
2664
2666
  ]
2665
2667
  }
2666
2668
  ) }),
2667
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 rounded-lg p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(cmdk.Command, { className: "rounded-lg", children: [
2669
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 rounded-lg p-0", align: "start", container, children: /* @__PURE__ */ jsxRuntime.jsxs(cmdk.Command, { className: "rounded-lg", children: [
2668
2670
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border flex items-center gap-2 border-b px-3", children: [
2669
2671
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { size: 14, className: "text-muted-foreground shrink-0" }),
2670
2672
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -8374,6 +8376,161 @@ function DataTableSearch({
8374
8376
  )
8375
8377
  ] });
8376
8378
  }
8379
+ function BottomNav({ items, className }) {
8380
+ return /* @__PURE__ */ jsxRuntime.jsx(
8381
+ "nav",
8382
+ {
8383
+ "data-slot": "bottom-nav",
8384
+ className: cn(
8385
+ "fixed bottom-0 left-0 right-0 z-50 mx-4 mb-4 rounded-2xl bg-background shadow-[0_-4px_20px_rgba(0,0,0,0.08)]",
8386
+ className
8387
+ ),
8388
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-20 items-center justify-around px-4", children: items.map(({ label, href, icon, isActive, onClick }) => /* @__PURE__ */ jsxRuntime.jsxs(
8389
+ "a",
8390
+ {
8391
+ href,
8392
+ onClick,
8393
+ "data-slot": "bottom-nav-item",
8394
+ className: cn(
8395
+ "group flex flex-col items-center gap-0 transition-colors",
8396
+ isActive ? "text-primary" : "text-muted-foreground"
8397
+ ),
8398
+ children: [
8399
+ /* @__PURE__ */ jsxRuntime.jsxs(
8400
+ "span",
8401
+ {
8402
+ className: cn(
8403
+ "flex h-12 items-center justify-center rounded-2xl transition-all",
8404
+ isActive ? "flex-col gap-0.5 bg-primary/10 px-4" : "w-12 group-hover:bg-muted group-active:bg-primary/10"
8405
+ ),
8406
+ children: [
8407
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-6 w-6 shrink-0", children: icon }),
8408
+ isActive && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-semibold leading-none", children: label })
8409
+ ]
8410
+ }
8411
+ ),
8412
+ /* @__PURE__ */ jsxRuntime.jsx(
8413
+ "span",
8414
+ {
8415
+ className: cn(
8416
+ "text-[10px] font-medium",
8417
+ isActive ? "invisible" : "visible"
8418
+ ),
8419
+ children: label
8420
+ }
8421
+ ),
8422
+ /* @__PURE__ */ jsxRuntime.jsx(
8423
+ "span",
8424
+ {
8425
+ className: cn(
8426
+ "h-1 w-5 rounded-full transition-all",
8427
+ isActive ? "bg-primary" : "bg-transparent"
8428
+ )
8429
+ }
8430
+ )
8431
+ ]
8432
+ },
8433
+ href
8434
+ )) })
8435
+ }
8436
+ );
8437
+ }
8438
+ var BottomNavTabsContext = react.createContext(null);
8439
+ function useBottomNavTabsContext() {
8440
+ const ctx = react.useContext(BottomNavTabsContext);
8441
+ if (!ctx) throw new Error("BottomNavTabsList must be inside BottomNavTabs");
8442
+ return ctx;
8443
+ }
8444
+ function BottomNavTabs({
8445
+ defaultValue,
8446
+ value: controlledValue,
8447
+ onValueChange,
8448
+ ...props
8449
+ }) {
8450
+ const [internalValue, setInternalValue] = react.useState(controlledValue ?? defaultValue ?? "");
8451
+ const activeValue = controlledValue ?? internalValue;
8452
+ const listId = react.useId();
8453
+ const handleValueChange = (v) => {
8454
+ if (controlledValue === void 0) setInternalValue(v);
8455
+ onValueChange?.(v);
8456
+ };
8457
+ return /* @__PURE__ */ jsxRuntime.jsx(BottomNavTabsContext.Provider, { value: { activeValue, listId }, children: /* @__PURE__ */ jsxRuntime.jsx(
8458
+ radixUi.Tabs.Root,
8459
+ {
8460
+ "data-slot": "bottom-nav-tabs",
8461
+ value: activeValue,
8462
+ onValueChange: handleValueChange,
8463
+ ...props
8464
+ }
8465
+ ) });
8466
+ }
8467
+ function BottomNavTabsContent({
8468
+ className,
8469
+ ...props
8470
+ }) {
8471
+ return /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { className: cn("pb-28", className), ...props });
8472
+ }
8473
+ function BottomNavTabsList({ items, className }) {
8474
+ const { activeValue, listId } = useBottomNavTabsContext();
8475
+ return /* @__PURE__ */ jsxRuntime.jsx(
8476
+ "nav",
8477
+ {
8478
+ "data-slot": "bottom-nav-tabs-list",
8479
+ className: cn(
8480
+ "fixed bottom-0 left-0 right-0 z-50 mx-4 mb-4 rounded-2xl bg-background shadow-[0_-4px_20px_rgba(0,0,0,0.08)]",
8481
+ className
8482
+ ),
8483
+ children: /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tabs.List, { className: "flex h-20 items-center justify-around px-4", children: items.map(({ value, label, icon, activeIcon }) => {
8484
+ const isActive = value === activeValue;
8485
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8486
+ radixUi.Tabs.Trigger,
8487
+ {
8488
+ value,
8489
+ "data-slot": "bottom-nav-tabs-trigger",
8490
+ className: cn(
8491
+ "group flex flex-col items-center gap-0.5 transition-colors",
8492
+ "data-[state=active]:text-primary data-[state=inactive]:text-muted-foreground",
8493
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-2xl"
8494
+ ),
8495
+ children: [
8496
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex h-12 w-12 items-center justify-center", children: [
8497
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { initial: false, children: isActive && /* @__PURE__ */ jsxRuntime.jsx(
8498
+ react$1.motion.span,
8499
+ {
8500
+ layoutId: `${listId}-pill`,
8501
+ className: "absolute inset-0 rounded-2xl bg-primary/10",
8502
+ transition: spring.snappy
8503
+ }
8504
+ ) }),
8505
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 h-6 w-6", children: isActive ? activeIcon ?? icon : icon })
8506
+ ] }),
8507
+ /* @__PURE__ */ jsxRuntime.jsx(
8508
+ "span",
8509
+ {
8510
+ className: cn(
8511
+ "text-[10px] font-medium",
8512
+ isActive && "font-semibold"
8513
+ ),
8514
+ children: label
8515
+ }
8516
+ ),
8517
+ /* @__PURE__ */ jsxRuntime.jsx(
8518
+ "span",
8519
+ {
8520
+ className: cn(
8521
+ "h-1 w-5 rounded-full transition-colors",
8522
+ isActive ? "bg-primary" : "bg-transparent"
8523
+ )
8524
+ }
8525
+ )
8526
+ ]
8527
+ },
8528
+ value
8529
+ );
8530
+ }) })
8531
+ }
8532
+ );
8533
+ }
8377
8534
  var DrawerContext = react.createContext({ isOpen: false, modal: true });
8378
8535
  function Drawer({ children, open, onOpenChange, modal = true, ...props }) {
8379
8536
  const [internalOpen, setInternalOpen] = react.useState(props.defaultOpen ?? false);
@@ -8646,6 +8803,10 @@ exports.AvatarGroup = AvatarGroup;
8646
8803
  exports.AvatarGroupCount = AvatarGroupCount;
8647
8804
  exports.AvatarImage = AvatarImage;
8648
8805
  exports.Badge = Badge2;
8806
+ exports.BottomNav = BottomNav;
8807
+ exports.BottomNavTabs = BottomNavTabs;
8808
+ exports.BottomNavTabsContent = BottomNavTabsContent;
8809
+ exports.BottomNavTabsList = BottomNavTabsList;
8649
8810
  exports.Breadcrumb = Breadcrumb;
8650
8811
  exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
8651
8812
  exports.BreadcrumbItem = BreadcrumbItem;