@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
31 lines (30 loc) • 1.27 kB
JavaScript
"use client";
require("../../../_virtual/_rolldown/runtime.cjs");
let react_jsx_runtime = require("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__ */ (0, react_jsx_runtime.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
exports.InputClearSection = InputClearSection;
//# sourceMappingURL=InputClearSection.cjs.map