@bubo-squared/ui-framework 0.2.31 → 0.2.32

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.cjs CHANGED
@@ -785,26 +785,25 @@ var import_react_slot4 = require("@radix-ui/react-slot");
785
785
  var import_class_variance_authority8 = require("class-variance-authority");
786
786
  var import_jsx_runtime12 = require("react/jsx-runtime");
787
787
  var badgeVariants = (0, import_class_variance_authority8.cva)(
788
- "inline-flex items-center justify-center rounded-4 leading-none whitespace-nowrap gap-1 py-0",
788
+ "inline-flex items-center justify-center rounded-full leading-none whitespace-nowrap gap-1 py-0 font-normal",
789
789
  {
790
790
  variants: {
791
791
  size: {
792
- sm: "px-1.5 paragraph-sm",
793
- md: "px-2 paragraph-md",
794
- lg: "px-2 subtitle",
795
- xl: "px-2.5 h6-title"
792
+ sm: "px-2.5 paragraph-sm",
793
+ md: "px-3 paragraph-md",
794
+ lg: "px-3.5 subtitle",
795
+ xl: "px-4 h6-title"
796
796
  },
797
797
  variant: {
798
- primary: "bg-(--background-secondary) text-primary",
799
- secondary: "bg-(--background-primary) border-1 border-primary text-primary",
798
+ primary: "bg-(--color-primary) text-(--color-primary-inverse)",
799
+ secondary: "bg-(--background-secondary) text-primary",
800
+ outline: "bg-(--background-primary) text-primary shadow-[inset_0_0_0_1px_var(--border-secondary)]",
800
801
  active: "bg-ac-lilac text-badge-black",
801
802
  informal: "bg-ac-neon-blue text-badge-black",
802
803
  success: "bg-ac-neon-green text-badge-black",
803
804
  warning: "bg-ac-light-orange text-badge-black",
804
- error: "bg-s-error-300 text-badge-black",
805
- disabled: "bg-(--background-primary-disabled) border-1 border-primary-disabled text-primary-disabled",
806
- "double-default": "bg-(--background-secondary) text-primary",
807
- "double-current": "bg-color-ac-lilac text-badge-black"
805
+ error: "bg-(--color-s-error-500)/15 text-error",
806
+ disabled: "bg-(--background-primary-disabled) shadow-[inset_0_0_0_1px_var(--color-primary-disabled)] text-primary-disabled"
808
807
  }
809
808
  },
810
809
  defaultVariants: {
@@ -818,25 +817,20 @@ var Badge = React10.forwardRef(
818
817
  const {
819
818
  asChild = false,
820
819
  label,
821
- value,
822
820
  size = "sm",
823
821
  variant = "primary",
824
822
  className,
825
823
  ...rest
826
824
  } = props;
827
- const Comp = asChild ? import_react_slot4.Slot : "div";
828
- const hasValue = typeof value === "string" ? value.trim() !== "" : value != null;
825
+ const Comp = asChild ? import_react_slot4.Slot : "span";
829
826
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
830
827
  Comp,
831
828
  {
829
+ "data-slot": "badge",
832
830
  ref,
833
831
  className: cn(badgeVariants({ size, variant }), className),
834
832
  ...rest,
835
- children: hasValue ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
836
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-normal", children: label }),
837
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-normal", children: ":" }),
838
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-medium", children: value })
839
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-normal", children: label })
833
+ children: label
840
834
  }
841
835
  );
842
836
  }
@@ -1333,21 +1327,75 @@ var import_react_slot5 = require("@radix-ui/react-slot");
1333
1327
  var import_class_variance_authority12 = require("class-variance-authority");
1334
1328
  var import_jsx_runtime20 = require("react/jsx-runtime");
1335
1329
  var tagVariants = (0, import_class_variance_authority12.cva)(
1336
- "inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-secondary bg-(--background-neutral) focus:border-brand focus-ring-primary ",
1330
+ "inline-flex flex-row items-center justify-center gap-1.5 overflow-hidden border border-secondary bg-tag focus:border-brand focus-ring-primary ",
1337
1331
  {
1338
1332
  variants: {
1339
1333
  size: {
1340
- sm: "py-0.5",
1341
- md: "py-1.5"
1334
+ sm: "h-6",
1335
+ md: "h-7",
1336
+ lg: "h-8",
1337
+ xl: "h-9"
1338
+ },
1339
+ rounded: {
1340
+ true: "rounded-full",
1341
+ false: "rounded-8"
1342
1342
  }
1343
1343
  },
1344
1344
  defaultVariants: {
1345
- size: "sm"
1345
+ size: "sm",
1346
+ rounded: false
1346
1347
  }
1347
1348
  }
1348
1349
  );
1349
- var disabledTag = "pointer-events-none border-secondary-disabled bg-(--background-neutral-disabled) text-primary-disabled";
1350
- var iconClasses = "flex items-center justify-center w-5 h-5 [&>*]:w-5 [&>*]:h-5 shrink-0 text-primary";
1350
+ var calculateXPadding = (size, hasTrailing, hasLeading) => {
1351
+ if (!hasTrailing && !hasLeading) {
1352
+ return size === "sm" ? "px-2.5" : "px-3";
1353
+ } else if (hasTrailing && !hasLeading) {
1354
+ return size === "sm" ? "pl-2.5 pr-1.25" : "pl-3 pr-1.5";
1355
+ } else if (!hasTrailing && hasLeading) {
1356
+ return size === "sm" ? "pl-1.25 pr-2.5" : "pl-1.5 pr-3";
1357
+ } else {
1358
+ return size === "sm" ? "px-1.25" : "px-1.5";
1359
+ }
1360
+ };
1361
+ var disabledTag = "pointer-events-none border-secondary-disabled bg-tag-disabled text-primary-disabled";
1362
+ var calculateIconClasses = (size) => {
1363
+ switch (size) {
1364
+ case "sm":
1365
+ return "flex items-center justify-center size-4 [&>*]:size-4 shrink-0";
1366
+ case "md":
1367
+ return "flex items-center justify-center size-5 [&>*]:size-5 shrink-0";
1368
+ case "lg":
1369
+ return "flex items-center justify-center size-5 [&>*]:size-5 shrink-0";
1370
+ case "xl":
1371
+ return "flex items-center justify-center size-6 [&>*]:size-6 shrink-0";
1372
+ }
1373
+ };
1374
+ var keyTextClassBySize = {
1375
+ sm: "paragraph-sm cursor-default",
1376
+ md: "paragraph-md cursor-default",
1377
+ lg: "paragraph-lg cursor-default",
1378
+ xl: "subtitle cursor-default"
1379
+ };
1380
+ var valueTextClassBySize = {
1381
+ sm: "paragraph-sm-medium cursor-default",
1382
+ md: "paragraph-md-medium cursor-default",
1383
+ lg: "paragraph-lg-medium cursor-default",
1384
+ xl: "subtitle-medium cursor-default"
1385
+ };
1386
+ var labelTextClassBySize = {
1387
+ sm: "paragraph-sm cursor-default",
1388
+ md: "paragraph-md cursor-default",
1389
+ lg: "paragraph-lg cursor-default",
1390
+ xl: "subtitle cursor-default"
1391
+ };
1392
+ var getTextColor = (type, disabled) => {
1393
+ if (disabled) return "";
1394
+ else if (type === "key") return "text-secondary";
1395
+ else if (type === "value") return "text-primary";
1396
+ else if (type === "label") return "text-primary";
1397
+ return "text-primary";
1398
+ };
1351
1399
  var Tag = React18.forwardRef(
1352
1400
  (props, ref) => {
1353
1401
  const {
@@ -1366,17 +1414,18 @@ var Tag = React18.forwardRef(
1366
1414
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1367
1415
  Comp,
1368
1416
  {
1369
- className: cn(tagVariants({ size }), disabled && disabledTag, className),
1417
+ className: cn(tagVariants({ size, rounded: props.rounded }), calculateXPadding(size, !!trailing, !!leading), disabled && disabledTag, className),
1418
+ "data-slot": "tag",
1370
1419
  ref,
1371
1420
  ...rest,
1372
1421
  children: [
1373
- leading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: iconClasses, children: leading }),
1374
- hasValue ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row gap-1 items-center", children: [
1375
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: label }),
1376
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: ":" }),
1377
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-primary paragraph-lg-medium mb-0! cursor-default font-medium", children: value })
1378
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-primary paragraph-lg mb-0! cursor-default", children: label }),
1379
- trailing && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: iconClasses, children: trailing })
1422
+ leading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn(disabled ? "text-primary-disabled" : "text-primary", calculateIconClasses(size)), children: leading }),
1423
+ hasValue ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
1424
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn(keyTextClassBySize[size], getTextColor("key", disabled)), children: label }),
1425
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn(keyTextClassBySize[size], getTextColor("key", disabled)), children: ":" }),
1426
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn(valueTextClassBySize[size], getTextColor("value", disabled)), children: value })
1427
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn(labelTextClassBySize[size], getTextColor("label", disabled)), children: label }),
1428
+ trailing && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn(disabled ? "text-primary-disabled" : "text-primary", calculateIconClasses(size)), children: trailing })
1380
1429
  ]
1381
1430
  }
1382
1431
  );
@@ -2595,14 +2644,6 @@ var createLucideIcon = (iconName, iconNode) => {
2595
2644
  var __iconNode = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
2596
2645
  var ChevronRight = createLucideIcon("chevron-right", __iconNode);
2597
2646
 
2598
- // ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/ellipsis.js
2599
- var __iconNode2 = [
2600
- ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
2601
- ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
2602
- ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
2603
- ];
2604
- var Ellipsis = createLucideIcon("ellipsis", __iconNode2);
2605
-
2606
2647
  // src/components/ui/dialog.tsx
2607
2648
  var import_jsx_runtime29 = require("react/jsx-runtime");
2608
2649
 
@@ -4446,7 +4487,7 @@ var React43 = __toESM(require("react"), 1);
4446
4487
  var React42 = require("react");
4447
4488
  var import_react_slot6 = require("@radix-ui/react-slot");
4448
4489
  var import_jsx_runtime44 = require("react/jsx-runtime");
4449
- var breadcrumbItemClasses = "h6-title inline-flex items-center gap-1.5 text-(--color-secondary) hover:text-(--color-primary-hover) focus-within:text-(--color-secondary-focus) [&_[aria-current=page]]:font-medium [&_[aria-current=page]]:text-primary";
4490
+ var breadcrumbItemClasses = "inline-flex items-center gap-1.5 text-(--color-secondary) hover:text-(--color-primary-hover) focus-within:text-(--color-secondary-focus) [&_[aria-current=page]]:font-medium [&_[aria-current=page]]:text-primary";
4450
4491
  var disabledItemClasses = "text-primary-disabled cursor-default pointer-events-none";
4451
4492
  function Breadcrumb({ ...props }) {
4452
4493
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
@@ -4470,7 +4511,6 @@ function BreadcrumbItem({ className, disabled, ...props }) {
4470
4511
  {
4471
4512
  "data-slot": "breadcrumb-item",
4472
4513
  className: cn(breadcrumbItemClasses, disabled && disabledItemClasses, className),
4473
- style: { marginBottom: "7px" },
4474
4514
  ...props
4475
4515
  }
4476
4516
  );
@@ -4499,36 +4539,16 @@ function BreadcrumbSeparator({
4499
4539
  "data-slot": "breadcrumb-separator",
4500
4540
  role: "presentation",
4501
4541
  "aria-hidden": "true",
4502
- className: cn("[&>svg]:size-6 [&>svg]:text-(--color-secondary)", className),
4542
+ className: cn("text-secondary", className),
4503
4543
  ...props,
4504
4544
  children: children ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChevronRight, {})
4505
4545
  }
4506
4546
  );
4507
4547
  }
4508
- function BreadcrumbEllipsis({
4509
- className,
4510
- ...props
4511
- }) {
4512
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4513
- "span",
4514
- {
4515
- "data-slot": "breadcrumb-ellipsis",
4516
- role: "presentation",
4517
- "aria-hidden": "true",
4518
- className: cn("flex size-9 items-center justify-center", className),
4519
- ...props,
4520
- children: [
4521
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Ellipsis, { className: "size-4" }),
4522
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "sr-only", children: "More" })
4523
- ]
4524
- }
4525
- );
4526
- }
4527
4548
 
4528
4549
  // src/components/Navigation/Breadcrumbs.tsx
4550
+ var import_icons14 = require("@bubo-squared/icons");
4529
4551
  var import_jsx_runtime45 = require("react/jsx-runtime");
4530
- var breadcrumbSeparatorVariants = "size-5 relative bottom-1 [&>svg]:text-secondary group-disabled:text-secondary";
4531
- var breadcrumbItemBase = "h6-title text-secondary hover:text-primary-hover";
4532
4552
  var Breadcrumbs = React43.forwardRef(
4533
4553
  (props, ref) => {
4534
4554
  const {
@@ -4539,40 +4559,53 @@ var Breadcrumbs = React43.forwardRef(
4539
4559
  breadcrumbItemClassName,
4540
4560
  breadcrumbPageClassName,
4541
4561
  separatorClassName,
4562
+ breadcrumbListClassName,
4563
+ ellipsisItemClassName,
4564
+ ellipsisTriggerClassName,
4565
+ ellipsisContentClassName,
4566
+ ellipsisGroupClassName,
4567
+ ellipsisMenuItemClassName,
4568
+ ellipsisAriaLabel = "Open breadcrumb menu",
4542
4569
  ...rest
4543
4570
  } = props;
4544
4571
  const items = React43.Children.toArray(children).filter(Boolean);
4545
4572
  const shouldCollapse = Boolean(ellipsis) && items.length >= 5;
4546
4573
  const hiddenItems = shouldCollapse ? items.slice(1, -2) : [];
4547
4574
  const displayItems = shouldCollapse ? [items[0], "__ELLIPSIS__", items[items.length - 2], items[items.length - 1]] : items;
4548
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Breadcrumb, { ref, className, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbList, { children: displayItems.map((child, index) => {
4575
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Breadcrumb, { ref, className: cn("mb-1.75", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbList, { className: breadcrumbListClassName, children: displayItems.map((child, index) => {
4549
4576
  const isEllipsis = child === "__ELLIPSIS__";
4550
4577
  const key = isEllipsis ? "__ellipsis" : React43.isValidElement(child) && child.key != null ? String(child.key) : String(index);
4551
4578
  const isLast = index === displayItems.length - 1;
4552
4579
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(React43.Fragment, { children: [
4553
- isEllipsis ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbItem, { className: cn(breadcrumbItemBase, breadcrumbItemClassName), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DropdownMenu, { children: [
4580
+ isEllipsis ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbItem, { className: cn(breadcrumbItemClassName, ellipsisItemClassName), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DropdownMenu, { children: [
4554
4581
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4555
- "button",
4582
+ Button,
4556
4583
  {
4557
- type: "button",
4558
- className: "inline-flex size-8 items-center justify-center rounded-4 hover:bg-(--background-secondary) focus-ring-primary text-secondary",
4559
- "aria-label": "Open breadcrumb menu",
4560
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbEllipsis, {})
4584
+ variant: "ghost",
4585
+ className: cn(
4586
+ "inline-flex text-secondary hover:text-primary &[aria-expanded=true]:text-primary-focus items-center justify-center",
4587
+ ellipsisTriggerClassName
4588
+ ),
4589
+ "aria-label": ellipsisAriaLabel,
4590
+ "data-slot": "breadcrumb-ellipsis",
4591
+ role: "presentation",
4592
+ "aria-hidden": "true",
4593
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_icons14.MoreHorizFullIcon, {})
4561
4594
  }
4562
4595
  ) }),
4563
4596
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4564
4597
  DropdownMenuContent,
4565
4598
  {
4566
4599
  align: "start",
4567
- className: "bg-(--background-neutral) border-secondary-hover shadow-card-md rounded-4",
4568
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DropdownMenuGroup, { children: hiddenItems.map((hidden, hiddenIndex) => {
4600
+ className: ellipsisContentClassName,
4601
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DropdownMenuGroup, { className: ellipsisGroupClassName, children: hiddenItems.map((hidden, hiddenIndex) => {
4569
4602
  const hiddenKey = React43.isValidElement(hidden) && hidden.key != null ? String(hidden.key) : `hidden-${hiddenIndex}`;
4570
4603
  if (React43.isValidElement(hidden)) {
4571
4604
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4572
4605
  DropdownMenuItem,
4573
4606
  {
4574
4607
  asChild: true,
4575
- className: "cursor-pointer paragraph-md text-primary focus:bg-(--background-secondary)",
4608
+ className: ellipsisMenuItemClassName,
4576
4609
  children: hidden
4577
4610
  },
4578
4611
  hiddenKey
@@ -4581,7 +4614,7 @@ var Breadcrumbs = React43.forwardRef(
4581
4614
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4582
4615
  DropdownMenuItem,
4583
4616
  {
4584
- className: "cursor-pointer paragraph-md text-primary focus:bg-(--background-secondary)",
4617
+ className: ellipsisMenuItemClassName,
4585
4618
  children: String(hidden)
4586
4619
  },
4587
4620
  hiddenKey
@@ -4589,14 +4622,8 @@ var Breadcrumbs = React43.forwardRef(
4589
4622
  }) })
4590
4623
  }
4591
4624
  )
4592
- ] }) }) : isLast ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbItem, { className: cn(breadcrumbItemBase, breadcrumbItemClassName), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4593
- BreadcrumbPage,
4594
- {
4595
- className: cn("h6-title-medium cursor-pointer", breadcrumbPageClassName),
4596
- children: child
4597
- }
4598
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbItem, { className: cn(breadcrumbItemBase, breadcrumbItemClassName), children: child }),
4599
- !isLast && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbSeparator, { className: cn(breadcrumbSeparatorVariants, separatorClassName), children: separator })
4625
+ ] }) }) : isLast ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbItem, { className: breadcrumbItemClassName, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbPage, { className: breadcrumbPageClassName, children: child }) }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbItem, { className: breadcrumbItemClassName, children: child }),
4626
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BreadcrumbSeparator, { className: separatorClassName, children: separator })
4600
4627
  ] }, key);
4601
4628
  }) }) });
4602
4629
  }
@@ -4759,7 +4786,6 @@ lucide-react/dist/esm/defaultAttributes.js:
4759
4786
  lucide-react/dist/esm/Icon.js:
4760
4787
  lucide-react/dist/esm/createLucideIcon.js:
4761
4788
  lucide-react/dist/esm/icons/chevron-right.js:
4762
- lucide-react/dist/esm/icons/ellipsis.js:
4763
4789
  lucide-react/dist/esm/lucide-react.js:
4764
4790
  (**
4765
4791
  * @license lucide-react v0.555.0 - ISC