@carbon/react
Version:
React components for the Carbon Design System
50 lines (48 loc) • 1.49 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { usePrefix } from "../../internal/usePrefix.js";
import { FormContext } from "../FluidForm/FormContext.js";
import Select_default from "../Select/index.js";
import classNames from "classnames";
import React from "react";
import PropTypes from "prop-types";
import { jsx } from "react/jsx-runtime";
//#region src/components/FluidSelect/FluidSelect.tsx
/**
* Copyright IBM Corp. 2022, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const FluidSelect = React.forwardRef(({ className, children, ...other }, ref) => {
const classNames$1 = classNames(`${usePrefix()}--select--fluid`, className);
return /* @__PURE__ */ jsx(FormContext.Provider, {
value: { isFluid: true },
children: /* @__PURE__ */ jsx(Select_default, {
ref,
className: classNames$1,
...other,
children
})
});
});
FluidSelect.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
defaultValue: PropTypes.any,
disabled: PropTypes.bool,
id: PropTypes.string.isRequired,
invalid: PropTypes.bool,
invalidText: PropTypes.node,
labelText: PropTypes.node,
onChange: PropTypes.func,
warn: PropTypes.bool,
warnText: PropTypes.node,
readOnly: PropTypes.bool
};
//#endregion
export { FluidSelect as default };