@bergetai/ui 0.11.2 → 0.11.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/index.cjs CHANGED
@@ -484,6 +484,21 @@ function brandVariantClasses(variant) {
484
484
  disabledClasses,
485
485
  "disabled:bg-transparent disabled:border-berget-button-disabled-border"
486
486
  );
487
+ case "ghost":
488
+ return cn(
489
+ "bg-transparent text-berget-button-ghost-fg",
490
+ // Pin the foreground on hover — the underlying primitive ghost adds
491
+ // hover:text-foreground, which is the same value here but pinned
492
+ // explicitly for parity with the other fg-token variants.
493
+ "hover:bg-berget-button-ghost-hover hover:text-berget-button-ghost-fg",
494
+ // The dark:hover twin neutralises the primitive ghost's
495
+ // dark:hover:bg-muted/50 so only the token fill applies.
496
+ "dark:hover:bg-berget-button-ghost-hover",
497
+ "active:bg-berget-button-ghost-active dark:active:bg-berget-button-ghost-active",
498
+ "focus-visible:border-transparent",
499
+ disabledClasses,
500
+ "disabled:bg-transparent"
501
+ );
487
502
  case "link":
488
503
  return cn(
489
504
  "h-auto bg-transparent p-0 text-berget-button-link-fg font-medium underline-offset-4 shadow-none",
@@ -518,6 +533,7 @@ function primitiveVariant(variant) {
518
533
  case "primary":
519
534
  case "destructive":
520
535
  case "outline":
536
+ case "ghost":
521
537
  return "ghost";
522
538
  default:
523
539
  return variant;
@@ -3907,97 +3923,33 @@ Box.displayName = "Box";
3907
3923
 
3908
3924
  // src/components/language-select/LanguageSelect.tsx
3909
3925
  var React27 = __toESM(require("react"), 1);
3910
- var import_select3 = require("@base-ui/react/select");
3911
3926
  var import_lucide_react13 = require("lucide-react");
3912
3927
  var import_jsx_runtime42 = require("react/jsx-runtime");
3913
3928
  var LanguageSelect = React27.forwardRef(
3914
3929
  ({ className, options, value, onValueChange }, ref) => {
3915
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
3916
- import_select3.Select.Root,
3917
- {
3918
- value,
3919
- onValueChange: onValueChange ? (v) => onValueChange(v ?? "") : void 0,
3920
- children: [
3921
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
3922
- import_select3.Select.Trigger,
3923
- {
3924
- ref,
3925
- "aria-label": "Select language",
3926
- className: cn(
3927
- // Base styles
3928
- "h-8 w-8 p-0 rounded-full",
3929
- "flex items-center justify-center",
3930
- // Border and background
3931
- "border border-berget-border-subtle",
3932
- "bg-transparent",
3933
- // Hover effect
3934
- "hover:bg-berget-surface-hover",
3935
- // Transitions
3936
- "transition-all duration-200",
3937
- // Focus styles - remove all focus rings
3938
- "focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
3939
- // Disabled state
3940
- "disabled:cursor-not-allowed disabled:opacity-50",
3941
- className
3942
- ),
3943
- children: [
3944
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "sr-only", children: "Select language" }),
3945
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { icon: import_lucide_react13.Globe, size: 16, "aria-hidden": true })
3946
- ]
3947
- }
3948
- ),
3949
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_select3.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_select3.Select.Positioner, { alignItemWithTrigger: false, className: "isolate z-50", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3950
- import_select3.Select.Popup,
3930
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(DropdownMenu, { children: [
3931
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DropdownMenuTrigger, { ref, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Button2, { variant: "outline", size: "icon", className, "aria-label": "Select language", children: [
3932
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "sr-only", children: "Select language" }),
3933
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { icon: import_lucide_react13.Globe, size: 16, "aria-hidden": true })
3934
+ ] }) }),
3935
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DropdownMenuContent, { align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3936
+ DropdownMenuRadioGroup,
3937
+ {
3938
+ value,
3939
+ onValueChange: onValueChange ? (v) => onValueChange(v) : void 0,
3940
+ children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3941
+ DropdownMenuRadioItem,
3951
3942
  {
3952
- className: cn(
3953
- // Positioning and z-index
3954
- "z-50 min-w-[8rem]",
3955
- // Overflow handling
3956
- "overflow-y-auto overflow-x-hidden",
3957
- // Border and background
3958
- "border border-berget-border bg-berget-background",
3959
- "text-berget-foreground",
3960
- // Shadow
3961
- "shadow-berget-lg",
3962
- // Rounded corners
3963
- "rounded-berget-xs",
3964
- // Animations
3965
- "transition-[opacity,transform]",
3966
- "data-starting-style:opacity-0 data-starting-style:scale-95 data-ending-style:opacity-0 data-ending-style:scale-95",
3967
- // Position-based animations
3968
- "data-[side=bottom]:slide-in-from-top-2",
3969
- "data-[side=left]:slide-in-from-right-2",
3970
- "data-[side=right]:slide-in-from-left-2",
3971
- "data-[side=top]:slide-in-from-bottom-2",
3972
- // Origin for transforms
3973
- "origin-[--transform-origin]"
3974
- ),
3975
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_select3.Select.List, { className: "p-1", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3976
- import_select3.Select.Item,
3977
- {
3978
- value: option.value,
3979
- disabled: option.disabled,
3980
- className: cn(
3981
- // Layout
3982
- "relative flex w-full cursor-default",
3983
- "select-none items-center rounded-sm py-2 px-3",
3984
- // Text
3985
- "text-sm outline-none",
3986
- // Focus/hover styles
3987
- "focus:bg-berget-primary-tint focus:text-berget-foreground",
3988
- "hover:bg-berget-primary-tint",
3989
- // Disabled state
3990
- "data-disabled:pointer-events-none data-disabled:opacity-50"
3991
- ),
3992
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_select3.Select.ItemText, { children: option.label })
3993
- },
3994
- option.value
3995
- )) })
3996
- }
3997
- ) }) })
3998
- ]
3999
- }
4000
- );
3943
+ value: option.value,
3944
+ disabled: option.disabled,
3945
+ closeOnClick: true,
3946
+ children: option.label
3947
+ },
3948
+ option.value
3949
+ ))
3950
+ }
3951
+ ) })
3952
+ ] });
4001
3953
  }
4002
3954
  );
4003
3955
  LanguageSelect.displayName = "LanguageSelect";