@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 +22 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -86
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3743,97 +3743,33 @@ Box.displayName = "Box";
|
|
|
3743
3743
|
|
|
3744
3744
|
// src/components/language-select/LanguageSelect.tsx
|
|
3745
3745
|
import * as React27 from "react";
|
|
3746
|
-
import { Select as SelectPrimitive2 } from "@base-ui/react/select";
|
|
3747
3746
|
import { Globe as Globe2 } from "lucide-react";
|
|
3748
3747
|
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3749
3748
|
var LanguageSelect = React27.forwardRef(
|
|
3750
3749
|
({ className, options, value, onValueChange }, ref) => {
|
|
3751
|
-
return /* @__PURE__ */ jsxs22(
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
// Base styles
|
|
3764
|
-
"h-8 w-8 p-0 rounded-full",
|
|
3765
|
-
"flex items-center justify-center",
|
|
3766
|
-
// Border and background
|
|
3767
|
-
"border border-berget-border-subtle",
|
|
3768
|
-
"bg-transparent",
|
|
3769
|
-
// Hover effect
|
|
3770
|
-
"hover:bg-berget-surface-hover",
|
|
3771
|
-
// Transitions
|
|
3772
|
-
"transition-all duration-200",
|
|
3773
|
-
// Focus styles - remove all focus rings
|
|
3774
|
-
"focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
3775
|
-
// Disabled state
|
|
3776
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
3777
|
-
className
|
|
3778
|
-
),
|
|
3779
|
-
children: [
|
|
3780
|
-
/* @__PURE__ */ jsx42("span", { className: "sr-only", children: "Select language" }),
|
|
3781
|
-
/* @__PURE__ */ jsx42(Icon, { icon: Globe2, size: 16, "aria-hidden": true })
|
|
3782
|
-
]
|
|
3783
|
-
}
|
|
3784
|
-
),
|
|
3785
|
-
/* @__PURE__ */ jsx42(SelectPrimitive2.Portal, { children: /* @__PURE__ */ jsx42(SelectPrimitive2.Positioner, { alignItemWithTrigger: false, className: "isolate z-50", children: /* @__PURE__ */ jsx42(
|
|
3786
|
-
SelectPrimitive2.Popup,
|
|
3750
|
+
return /* @__PURE__ */ jsxs22(DropdownMenu, { children: [
|
|
3751
|
+
/* @__PURE__ */ jsx42(DropdownMenuTrigger, { ref, asChild: true, children: /* @__PURE__ */ jsxs22(Button2, { variant: "outline", size: "icon", className, "aria-label": "Select language", children: [
|
|
3752
|
+
/* @__PURE__ */ jsx42("span", { className: "sr-only", children: "Select language" }),
|
|
3753
|
+
/* @__PURE__ */ jsx42(Icon, { icon: Globe2, size: 16, "aria-hidden": true })
|
|
3754
|
+
] }) }),
|
|
3755
|
+
/* @__PURE__ */ jsx42(DropdownMenuContent, { align: "start", children: /* @__PURE__ */ jsx42(
|
|
3756
|
+
DropdownMenuRadioGroup,
|
|
3757
|
+
{
|
|
3758
|
+
value,
|
|
3759
|
+
onValueChange: onValueChange ? (v) => onValueChange(v) : void 0,
|
|
3760
|
+
children: options.map((option) => /* @__PURE__ */ jsx42(
|
|
3761
|
+
DropdownMenuRadioItem,
|
|
3787
3762
|
{
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
// Rounded corners
|
|
3799
|
-
"rounded-berget-xs",
|
|
3800
|
-
// Animations
|
|
3801
|
-
"transition-[opacity,transform]",
|
|
3802
|
-
"data-starting-style:opacity-0 data-starting-style:scale-95 data-ending-style:opacity-0 data-ending-style:scale-95",
|
|
3803
|
-
// Position-based animations
|
|
3804
|
-
"data-[side=bottom]:slide-in-from-top-2",
|
|
3805
|
-
"data-[side=left]:slide-in-from-right-2",
|
|
3806
|
-
"data-[side=right]:slide-in-from-left-2",
|
|
3807
|
-
"data-[side=top]:slide-in-from-bottom-2",
|
|
3808
|
-
// Origin for transforms
|
|
3809
|
-
"origin-[--transform-origin]"
|
|
3810
|
-
),
|
|
3811
|
-
children: /* @__PURE__ */ jsx42(SelectPrimitive2.List, { className: "p-1", children: options.map((option) => /* @__PURE__ */ jsx42(
|
|
3812
|
-
SelectPrimitive2.Item,
|
|
3813
|
-
{
|
|
3814
|
-
value: option.value,
|
|
3815
|
-
disabled: option.disabled,
|
|
3816
|
-
className: cn(
|
|
3817
|
-
// Layout
|
|
3818
|
-
"relative flex w-full cursor-default",
|
|
3819
|
-
"select-none items-center rounded-sm py-2 px-3",
|
|
3820
|
-
// Text
|
|
3821
|
-
"text-sm outline-none",
|
|
3822
|
-
// Focus/hover styles
|
|
3823
|
-
"focus:bg-berget-primary-tint focus:text-berget-foreground",
|
|
3824
|
-
"hover:bg-berget-primary-tint",
|
|
3825
|
-
// Disabled state
|
|
3826
|
-
"data-disabled:pointer-events-none data-disabled:opacity-50"
|
|
3827
|
-
),
|
|
3828
|
-
children: /* @__PURE__ */ jsx42(SelectPrimitive2.ItemText, { children: option.label })
|
|
3829
|
-
},
|
|
3830
|
-
option.value
|
|
3831
|
-
)) })
|
|
3832
|
-
}
|
|
3833
|
-
) }) })
|
|
3834
|
-
]
|
|
3835
|
-
}
|
|
3836
|
-
);
|
|
3763
|
+
value: option.value,
|
|
3764
|
+
disabled: option.disabled,
|
|
3765
|
+
closeOnClick: true,
|
|
3766
|
+
children: option.label
|
|
3767
|
+
},
|
|
3768
|
+
option.value
|
|
3769
|
+
))
|
|
3770
|
+
}
|
|
3771
|
+
) })
|
|
3772
|
+
] });
|
|
3837
3773
|
}
|
|
3838
3774
|
);
|
|
3839
3775
|
LanguageSelect.displayName = "LanguageSelect";
|