braid-design-system
Version: 
Themeable design system for the SEEK Group
31 lines (30 loc) • 655 B
JavaScript
import { jsx } from "react/jsx-runtime";
import { useFallbackState } from "../../playroom/playroomState.mjs";
import { validTabIndexes } from "../private/validateTabIndex.mjs";
import { Dropdown as Dropdown$1 } from "./Dropdown.mjs";
const Dropdown = ({
  stateName,
  value,
  onChange,
  tabIndex,
  ...restProps
}) => {
  const [state, handleChange] = useFallbackState(
    stateName,
    value,
    onChange,
    ""
  );
  return /* @__PURE__ */ jsx(
    Dropdown$1,
    {
      value: state,
      onChange: handleChange,
      tabIndex: validTabIndexes.includes(tabIndex) ? tabIndex : void 0,
      ...restProps
    }
  );
};
export {
  Dropdown
};