<commit_before>import { indicators, indicatorPositions } from "./constants";

export default function stylesheet(props = {}, themeData = {}, themeMeta = {}) {
  const {
    hasHover,
    indicator,
    indicatorPosition,
    collapsed,
    disabled,
    stylesheet: customStylesheet
  } = props;

  const transitionDuration = "0.3s";

  const styles = {
    wrapper: {
      height: "auto",
      width: "auto",
      display: "flex",
      flexDirection: "column",
      alignItems: "stretch"
    },
    contentTransitionWrapper: {
      transitionProperty: "height",
      transitionDuration: ".3s",
      transitionTimingFunction: "ease-in-out"
    },
    header: {
      display: "flex",
      alignItems: "center",
      backgroundColor: themeData["accordion.header.backgroundColor"],
      border: 0,
      outline: 0,
      padding: `${themeData["accordion.header.verticalPadding"]} ${
        themeData["accordion.header.horizontalPadding"]
      }`,
      ...(indicatorPosition === indicatorPositions.RIGHT && {
        paddingLeft: themeData["accordion.header.indicatorOnRight.paddingLeft"],
        paddingRight:
          themeData["accordion.header.indicatorOnRight.paddingRight"]
      }),
      fontFamily: themeData["accordion.header.fontFamily"],
      fontSize: themeData["accordion.header.fontSize"],
      fontWeight: themeData["accordion.header.fontWeight"],
      lineHeight: themeData["accordion.header.lineHeight"],
      color: themeData["accordion.header.color"],
      width: "100%",
      opacity: disabled ? themeData["component.disabled.opacity"] : "1"
    },
    indicator: {
      order: indicatorPosition === indicatorPositions.LEFT ? -1 : 1,
      flexGrow: 0,
      flexShrink: 0,
      width: themeData["accordion.header.indicator.size"],
      textAlign: "center",
      "> path": {
        fill:
          !disabled && hasHover
            ? themeData["accordion.header.hover.indicator.color"]
            : themeData["accordion.header.indicator.color"]
      },
      marginRight:
        indicatorPosition === indicatorPositions.LEFT
          ? themeData["accordion.header.indicator.gutter"]
          : 0,
      marginLeft:
        indicatorPosition === indicatorPositions.LEFT
          ? 0
          : themeData["accordion.header.indicator.gutter"],
      transitionDuration,
      transform:
        indicator === indicators.CARET && !collapsed ? "rotate(90deg)" : "none"
    },
    label: {
      order: 0,
      flexGrow: 1,
      textAlign: "left",
      whiteSpace: "nowrap",
      textOverflow: "ellipsis",
      overflow: "hidden"
    }
  };

  if (customStylesheet) {
    return customStylesheet(styles, props, themeData, themeMeta);
  }
  return styles;
}
<commit_msg>refactor: use updated theme-data role names<commit_after>import { indicators, indicatorPositions } from "./constants";

export default function stylesheet(props = {}, themeData = {}, themeMeta = {}) {
  const {
    hasHover,
    indicator,
    indicatorPosition,
    collapsed,
    disabled,
    stylesheet: customStylesheet
  } = props;

  const transitionDuration = "0.3s";

  const styles = {
    wrapper: {
      height: "auto",
      width: "auto",
      display: "flex",
      flexDirection: "column",
      alignItems: "stretch"
    },
    contentTransitionWrapper: {
      transitionProperty: "height",
      transitionDuration: ".3s",
      transitionTimingFunction: "ease-in-out"
    },
    header: {
      display: "flex",
      alignItems: "center",
      backgroundColor: themeData["accordion.header.backgroundColor"],
      border: 0,
      outline: 0,
      padding: `${themeData["accordion.header.paddingVertical"]} ${
        themeData["accordion.header.paddingHorizontal"]
      }`,
      ...(indicatorPosition === indicatorPositions.RIGHT && {
        paddingLeft: themeData["accordion.header.indicatorRight.paddingLeft"],
        paddingRight:
          themeData["accordion.header.indicatorRight.paddingRight"]
      }),
      fontFamily: themeData["accordion.header.fontFamily"],
      fontSize: themeData["accordion.header.fontSize"],
      fontWeight: themeData["accordion.header.fontWeight"],
      lineHeight: themeData["accordion.header.lineHeight"],
      color: themeData["accordion.header.fontColor"],
      width: "100%",
      opacity: disabled ? themeData["component.disabled.opacity"] : "1"
    },
    indicator: {
      order: indicatorPosition === indicatorPositions.LEFT ? -1 : 1,
      flexGrow: 0,
      flexShrink: 0,
      width: themeData["accordion.header.indicatorSize"],
      textAlign: "center",
      "> path": {
        fill:
          !disabled && hasHover
            ? themeData["accordion.header.hover.indicatorColor"]
            : themeData["accordion.header.indicatorColor"]
      },
      marginRight:
        indicatorPosition === indicatorPositions.LEFT
          ? themeData["accordion.header.indicatorGutter"]
          : 0,
      marginLeft:
        indicatorPosition === indicatorPositions.LEFT
          ? 0
          : themeData["accordion.header.indicatorGutter"],
      transitionDuration,
      transform:
        indicator === indicators.CARET && !collapsed ? "rotate(90deg)" : "none"
    },
    label: {
      order: 0,
      flexGrow: 1,
      textAlign: "left",
      whiteSpace: "nowrap",
      textOverflow: "ellipsis",
      overflow: "hidden"
    }
  };

  if (customStylesheet) {
    return customStylesheet(styles, props, themeData, themeMeta);
  }
  return styles;
}

{'fraction_non_alphanumeric': 0.1300530455460033, 'fraction_numerical': 0.00695079568319005, 'mean_word_length': 2.776243093922652, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1670919', 'n_tokens_mistral': 1598, 'n_tokens_neox': 1557, 'n_words': 281}