import { getStyle } from '../../checkbox/style/index.mjs';
import '../../../theme/index.mjs';
import { genTreeStyle } from '../../tree/style/index.mjs';
import { merge } from '../../../theme/token/util/statistic.mjs';
import genComponentStyleHook from '../../../theme/token/util/genComponentStyleHook.mjs';

const genBaseStyle = (token) => {
  const {
    componentCls,
    treePrefixCls,
    colorBgElevated
  } = token;
  const treeCls = `.${treePrefixCls}`;
  return [
    // ======================================================
    // ==                     Dropdown                     ==
    // ======================================================
    {
      [`${componentCls}-dropdown`]: [
        {
          padding: `${token.paddingXS}px ${token.paddingXS / 2}px`
        },
        // ====================== Tree ======================
        genTreeStyle(treePrefixCls, merge(token, {
          colorBgContainer: colorBgElevated
        })),
        {
          [treeCls]: {
            "borderRadius": 0,
            "&-list-holder-inner": {
              alignItems: "stretch",
              [`${treeCls}-treenode`]: {
                [`${treeCls}-node-content-wrapper`]: {
                  flex: "auto"
                }
              }
            }
          }
        },
        // ==================== Checkbox ====================
        getStyle(`${treePrefixCls}-checkbox`, token),
        // ====================== RTL =======================
        {
          "&-rtl": {
            direction: "rtl",
            [`${treeCls}-switcher${treeCls}-switcher_close`]: {
              [`${treeCls}-switcher-icon svg`]: {
                transform: "rotate(90deg)"
              }
            }
          }
        }
      ]
    }
  ];
};
function useTreeSelectStyle(prefixCls, treePrefixCls) {
  return genComponentStyleHook("TreeSelect", (token) => {
    const treeSelectToken = merge(token, {
      treePrefixCls: treePrefixCls.value
    });
    return [genBaseStyle(treeSelectToken)];
  })(prefixCls);
}

export { useTreeSelectStyle as default };
//# sourceMappingURL=index.mjs.map
