@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
30 lines (29 loc) • 1.17 kB
JavaScript
"use client";
import { jsxs } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Input/InputClearSection/InputClearSection.tsx
const clearSectionOffset = {
xs: 7,
sm: 8,
md: 10,
lg: 12,
xl: 15
};
function InputClearSection({ __clearable, __clearSection, rightSection, __defaultRightSection, size = "sm", __clearSectionMode = "both" }) {
const clearSection = __clearable && __clearSection;
if (__clearSectionMode === "rightSection") return rightSection === null ? null : rightSection || __defaultRightSection;
if (__clearSectionMode === "clear") return rightSection === null ? null : clearSection || __defaultRightSection;
if (clearSection && (rightSection || __defaultRightSection)) return /* @__PURE__ */ jsxs("div", {
"data-combined-clear-section": true,
style: {
display: "flex",
gap: 2,
alignItems: "center",
paddingInlineEnd: clearSectionOffset[size]
},
children: [clearSection, rightSection || __defaultRightSection]
});
return rightSection === null ? null : rightSection || clearSection || __defaultRightSection;
}
//#endregion
export { InputClearSection };
//# sourceMappingURL=InputClearSection.mjs.map