@moontra/moonui 6.15.0 → 6.16.0
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/hooks/index.global.js +1 -6
- package/dist/hooks/index.global.js.map +1 -1
- package/dist/index.global.js +9 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +35 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/select-trigger-name.test.tsx +65 -0
- package/src/components/ui/select.tsx +22 -3
package/dist/index.js
CHANGED
|
@@ -6087,36 +6087,41 @@ var selectTriggerVariants = classVarianceAuthority.cva(
|
|
|
6087
6087
|
}
|
|
6088
6088
|
}
|
|
6089
6089
|
);
|
|
6090
|
-
var SelectTrigger = React12__namespace.forwardRef(({ className, children, variant, size, error, success, loading, leftIcon, rightIcon, ...props }, ref) =>
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
)
|
|
6090
|
+
var SelectTrigger = React12__namespace.forwardRef(({ className, children, variant, size, error, success, loading, leftIcon, rightIcon, ...props }, ref) => {
|
|
6091
|
+
const icerikId = React12__namespace.useId();
|
|
6092
|
+
const adVerilmis = props["aria-label"] != null || props["aria-labelledby"] != null;
|
|
6093
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6094
|
+
SelectPrimitive__namespace.Trigger,
|
|
6095
|
+
{
|
|
6096
|
+
ref,
|
|
6097
|
+
className: cn(
|
|
6098
|
+
selectTriggerVariants({
|
|
6099
|
+
variant,
|
|
6100
|
+
size,
|
|
6101
|
+
state: error ? "error" : success ? "success" : "none"
|
|
6102
|
+
}),
|
|
6103
|
+
className
|
|
6104
|
+
),
|
|
6105
|
+
...props,
|
|
6106
|
+
disabled: props.disabled || loading,
|
|
6107
|
+
"aria-invalid": error ? true : void 0,
|
|
6108
|
+
"data-error": error ? true : void 0,
|
|
6109
|
+
"data-success": success ? true : void 0,
|
|
6110
|
+
"data-loading": loading ? true : void 0,
|
|
6111
|
+
"aria-labelledby": adVerilmis ? props["aria-labelledby"] : icerikId,
|
|
6112
|
+
children: [
|
|
6113
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { id: icerikId, className: "flex items-center flex-1 gap-2", children: [
|
|
6114
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center text-muted-foreground", children: leftIcon }),
|
|
6115
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6116
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }),
|
|
6117
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Loading..." })
|
|
6118
|
+
] }) : children
|
|
6119
|
+
] }),
|
|
6120
|
+
!loading && /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: rightIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: rightIcon }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180" }) })
|
|
6121
|
+
]
|
|
6122
|
+
}
|
|
6123
|
+
);
|
|
6124
|
+
});
|
|
6120
6125
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
6121
6126
|
var SelectScrollUpButton = React12__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6122
6127
|
SelectPrimitive__namespace.ScrollUpButton,
|