@bergetai/ui 0.11.2 → 0.11.3

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
@@ -3907,97 +3907,33 @@ Box.displayName = "Box";
3907
3907
 
3908
3908
  // src/components/language-select/LanguageSelect.tsx
3909
3909
  var React27 = __toESM(require("react"), 1);
3910
- var import_select3 = require("@base-ui/react/select");
3911
3910
  var import_lucide_react13 = require("lucide-react");
3912
3911
  var import_jsx_runtime42 = require("react/jsx-runtime");
3913
3912
  var LanguageSelect = React27.forwardRef(
3914
3913
  ({ 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,
3914
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(DropdownMenu, { children: [
3915
+ /* @__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: [
3916
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "sr-only", children: "Select language" }),
3917
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { icon: import_lucide_react13.Globe, size: 16, "aria-hidden": true })
3918
+ ] }) }),
3919
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DropdownMenuContent, { align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3920
+ DropdownMenuRadioGroup,
3921
+ {
3922
+ value,
3923
+ onValueChange: onValueChange ? (v) => onValueChange(v) : void 0,
3924
+ children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3925
+ DropdownMenuRadioItem,
3951
3926
  {
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
- );
3927
+ value: option.value,
3928
+ disabled: option.disabled,
3929
+ closeOnClick: true,
3930
+ children: option.label
3931
+ },
3932
+ option.value
3933
+ ))
3934
+ }
3935
+ ) })
3936
+ ] });
4001
3937
  }
4002
3938
  );
4003
3939
  LanguageSelect.displayName = "LanguageSelect";