@bergetai/ui 0.11.1 → 0.11.2

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
@@ -465,9 +465,28 @@ function brandVariantClasses(variant) {
465
465
  disabledClasses,
466
466
  "disabled:bg-berget-button-destructive-disabled-bg"
467
467
  );
468
+ case "outline":
469
+ return cn(
470
+ // Transparent fill with a theme-foreground-derived border (25% of the
471
+ // foreground). The state treatment is static: hover, press and
472
+ // keyboard focus render identically to rest — only the shared focus
473
+ // outline and the disabled treatment deviate.
474
+ "bg-transparent border-berget-button-outline-border text-berget-button-outline-fg",
475
+ // Hover: slight brightening (hover bg token); the border and
476
+ // foreground stay at rest. The dark:hover twin also neutralises
477
+ // the primitive ghost's dark:hover:bg-muted/50. Pressed drops the
478
+ // fill back to transparent (a pressed element is still hovered, so
479
+ // an explicit active override is needed in both colour schemes).
480
+ "hover:bg-berget-button-outline-hover dark:hover:bg-berget-button-outline-hover",
481
+ "active:bg-transparent dark:active:bg-transparent",
482
+ // Keep the resting border on focus — the shared outline is the indicator.
483
+ "focus-visible:border-berget-button-outline-border",
484
+ disabledClasses,
485
+ "disabled:bg-transparent disabled:border-berget-button-disabled-border"
486
+ );
468
487
  case "link":
469
488
  return cn(
470
- "h-auto bg-transparent p-0 text-berget-button-link-fg underline-offset-4 shadow-none",
489
+ "h-auto bg-transparent p-0 text-berget-button-link-fg font-medium underline-offset-4 shadow-none",
471
490
  "hover:bg-transparent hover:text-berget-button-link-hover-fg",
472
491
  // On press, return to the resting foreground (hover fg otherwise sticks).
473
492
  "active:text-berget-button-link-fg",
@@ -498,6 +517,7 @@ function primitiveVariant(variant) {
498
517
  switch (variant) {
499
518
  case "primary":
500
519
  case "destructive":
520
+ case "outline":
501
521
  return "ghost";
502
522
  default:
503
523
  return variant;
@@ -526,6 +546,14 @@ function Button2({
526
546
  // larger button text. h-auto drops the primitive's fixed h-* so the
527
547
  // vertical paddings take effect.
528
548
  !isLink && !isIcon && "py-[0.57em] px-[1.14em] h-auto",
549
+ // Text ladder: size = typography scale; the em-based padding above
550
+ // follows automatically, so no per-size paddings are needed. Only
551
+ // default/lg/sm need overrides — xs keeps the primitive's text-xs.
552
+ !isLink && !isIcon && (size === "lg" ? "text-lg" : size === "sm" ? "text-sm" : size === "xs" ? "" : "text-base"),
553
+ // Normal weight for every non-link variant — tailwind-merge strips the
554
+ // primitive's font-medium (font-weight: var(--font-weight-medium)); the
555
+ // link variant keeps medium via its own classes above.
556
+ !isLink && "font-normal",
529
557
  brandVariantClasses(variant),
530
558
  interactionClasses,
531
559
  !isLink && width === "full" && "w-full",