<commit_before>import { VNode, a, div } from "@cycle/dom";
import { Size,  VerticalAlignment, Float } from "../../enums";
import { DOMContent, ContentObj, StyleAndContentArgs, ComponentSources, ComponentSinks } from "../../types";
import { renderPropsAndContent, runPropsAndContent, makeIsArgs } from "../../common";
import { getScope} from "../../utils";

export namespace List {
  export interface Props {
    bulleted: boolean;
    ordered: boolean;
    horizontal: boolean;
    inverted: boolean;
    selection: boolean;
    animated: boolean;
    relaxed: boolean;
    divided: boolean;
    celled: boolean;
    size: Size | string;
    alignment: VerticalAlignment | string;
    float: Float | string;
  }
  export interface ListItem {
    left: DOMContent;
    main: DOMContent;
    icon: DOMContent;
    right: DOMContent;
    header: DOMContent;
    description: DOMContent;
    href: string;
  }

  export type Content = Array<Partial<ListItem>>;
  export type ListArgs = StyleAndContentArgs<Props, Content, ContentObj<Content>>;
  export type ListSources = ComponentSources<Props, Content, ContentObj<Content>>;
 
  export function render(arg1?: ListArgs | Partial<Props> | Content, arg2?: Content) : VNode {
    return renderPropsAndContent(list, makeIsArgs(isContent), isContent, arg1, arg2);
  }

  export function run(sources: ListSources, scope: string = getScope()): ComponentSinks {
    return runPropsAndContent(sources, list, ".list", scope);
  }

  export function list(args: ListArgs): VNode {
    let props = args.props ? args.props : {};
    let content = args.content ? isContent(args.content) ? args.content : args.content.main : [];
    return div({ props: { className: getClassname(props) } },
      content.map(({header, icon, main, description, href, left, right}) => {
        let l = left ? div({ props: { className: "left floated content" } }, left) : [];
        let r = right ? div({ props: { className: "right floated content" } }, right) : [];
        let h = header ? div({ props: { className: "header" } }, header) : [];
        let d = description ? div({ props: { className: "description" } }, description) : [];
        let i = icon ? icon : [];
        let c = (header || description) ? div({ props: { className: "content" } }, [].concat(h, d, main)) : main;
        let children = [].concat(l, i, c, r);
        return href
          ? a({ props: { className: "item", href: href } }, children)
          : div({ props: { className: "item" } }, children);
      })
    );
  }

  function getClassname(props: Partial<Props>): string {
    let className = "ui";
    if (props.bulleted) {
      className += " bulleted";
    }
    if (props.ordered) {<commit_msg>fix(List): Fixed html output for right floated content<commit_after>import { VNode, a, div } from "@cycle/dom";
import { Size,  VerticalAlignment, Float } from "../../enums";
import { DOMContent, ContentObj, StyleAndContentArgs, ComponentSources, ComponentSinks } from "../../types";
import { renderPropsAndContent, runPropsAndContent, makeIsArgs } from "../../common";
import { getScope} from "../../utils";

export namespace List {
  export interface Props {
    bulleted: boolean;
    ordered: boolean;
    horizontal: boolean;
    inverted: boolean;
    selection: boolean;
    animated: boolean;
    relaxed: boolean;
    divided: boolean;
    celled: boolean;
    size: Size | string;
    alignment: VerticalAlignment | string;
    float: Float | string;
  }
  export interface ListItem {
    left: DOMContent;
    main: DOMContent;
    icon: DOMContent;
    right: DOMContent;
    header: DOMContent;
    description: DOMContent;
    href: string;
  }

  export type Content = Array<Partial<ListItem>>;
  export type ListArgs = StyleAndContentArgs<Props, Content, ContentObj<Content>>;
  export type ListSources = ComponentSources<Props, Content, ContentObj<Content>>;
 
  export function render(arg1?: ListArgs | Partial<Props> | Content, arg2?: Content) : VNode {
    return renderPropsAndContent(list, makeIsArgs(isContent), isContent, arg1, arg2);
  }

  export function run(sources: ListSources, scope: string = getScope()): ComponentSinks {
    return runPropsAndContent(sources, list, ".list", scope);
  }

  export function list(args: ListArgs): VNode {
    let props = args.props ? args.props : {};
    let content = args.content ? isContent(args.content) ? args.content : args.content.main : [];
    return div({ props: { className: getClassname(props) } },
      content.map(({header, icon, main, description, href, left, right}) => {
        let l = left ? div({ props: { className: "left floated content" } }, left) : [];
        let r = right ? div({ props: { className: "right floated content" } }, right) : [];
        let h = header ? div({ props: { className: "header" } }, header) : [];
        let d = description ? div({ props: { className: "description" } }, description) : [];
        let i = icon ? icon : [];
        let c = (header || description) ? div({ props: { className: "content" } }, [].concat(h, d, main)) : main;
        let children = [].concat(l, r, i, c);
        return href
          ? a({ props: { className: "item", href: href } }, children)
          : div({ props: { className: "item" } }, children);
      })
    );
  }

  function getClassname(props: Partial<Props>): string {
    let className = "ui";
    if (props.bulleted) {
      className += " bulleted";
    }
    if (props.ordered) {
{'fraction_non_alphanumeric': 0.14558472553699284, 'fraction_numerical': 0.0014686983660730677, 'mean_word_length': 3.3033175355450237, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '634205', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1558, 'n_words': 479}