function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
/*
 * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { Select as BaseUISelect } from "@base-ui/react/select";
import { CaretDown } from "@blueprintjs/icons";
import classnames from "classnames";
import React from "react";
import styles from "./Select.module.css.js";
function SelectRoot({
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUISelect.Root, rest, children);
}
function SelectTrigger({
  className,
  placeholder,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUISelect.Trigger, _extends({
    className: classnames(styles.osdkSelectTrigger, className)
  }, rest), children ?? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: styles.osdkSelectValueContainer
  }, /*#__PURE__*/React.createElement(BaseUISelect.Value, {
    className: styles.osdkSelectValue
  }), placeholder != null && /*#__PURE__*/React.createElement("span", {
    className: styles.osdkSelectPlaceholder
  }, placeholder)), /*#__PURE__*/React.createElement(BaseUISelect.Icon, {
    className: styles.osdkSelectIcon
  }, /*#__PURE__*/React.createElement(CaretDown, null))));
}
function SelectValue(props) {
  const {
    className,
    ...rest
  } = props;
  return /*#__PURE__*/React.createElement(BaseUISelect.Value, _extends({
    className: classnames(styles.osdkSelectValue, className)
  }, rest));
}
function SelectPositioner({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUISelect.Positioner, _extends({
    className: classnames(styles.osdkSelectPositioner, className),
    sideOffset: 4
    /* Disable Base UI's default behavior of aligning the selected item in
       the popup with the trigger. This causes layout jumps when the popup
       opens because the list scrolls to center the selected item. A static
       dropdown position below the trigger is more predictable. */,
    alignItemWithTrigger: false
  }, rest), children);
}
function SelectPopup({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUISelect.Popup, _extends({
    className: classnames(styles.osdkSelectPopup, className)
  }, rest), children);
}
function SelectItem({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUISelect.Item, _extends({
    className: classnames(styles.osdkSelectItem, className)
  }, rest), /*#__PURE__*/React.createElement(BaseUISelect.ItemText, null, children));
}
export const Select = {
  Root: SelectRoot,
  Trigger: SelectTrigger,
  Value: SelectValue,
  Portal: BaseUISelect.Portal,
  Positioner: SelectPositioner,
  Popup: SelectPopup,
  Item: SelectItem
};
//# sourceMappingURL=Select.js.map