<commit_before>package com.palantir.blueprintjs

import org.w3c.dom.events.Event
import org.w3c.dom.events.MouseEvent
import react.RBuilder
import react.RHandler
import react.ReactElement

typealias IconName = String

fun RBuilder.bpIcon(
    name: IconName,
    size: Int = Icon.SIZE_STANDARD,
    intent: Intent = Intent.NONE,
    title: String? = null,
    alt: String? = null,
    className: String? = null,
    block: RHandler<IIconProps> = {}
): ReactElement = child(Icon::class) {
    attrs {
        this.icon = name
        this.iconSize = size
        this.htmlTitle = title
        this.intent = intent
        this.title = alt
        this.className = className
    }
    block()
}

fun RBuilder.bpButton(
    minimal: Boolean = false,
    large: Boolean = false,
    disabled: Boolean = false,
    title: String? = null,
    icon: IconName? = null,
    rightIcon: IconName? = null,
    intent: Intent = Intent.NONE,
    onClick: ((event: MouseEvent) -> Unit)?,
    block: RHandler<IButtonProps> = {}
): ReactElement = child(Button::class) {
    attrs {
        this.title = title
        this.minimal = minimal
        this.large = large
        this.disabled = disabled
        this.icon = icon
        this.rightIcon = rightIcon
        this.intent = intent
        this.onClick = onClick
    }
    block()
}

fun RBuilder.bpButtonGroup(
    block: RHandler<IButtonGroupProps> = {}
): ReactElement = child(ButtonGroup::class) {
    block()
}

fun RBuilder.bpInputGroup(
    large: Boolean = false,
    placeholder: String = "",
    rightElement: ReactElement? = null,
    onChange: (Event) -> Unit
): ReactElement = child(InputGroup::class) {<commit_msg>Improve blueprint helpers<commit_after>package com.palantir.blueprintjs

import org.w3c.dom.events.Event
import org.w3c.dom.events.MouseEvent
import react.RBuilder
import react.RHandler
import react.ReactElement

typealias IconName = String

fun RBuilder.bpIcon(
    name: IconName,
    size: Int = Icon.SIZE_STANDARD,
    intent: Intent = Intent.NONE,
    title: String? = null,
    alt: String? = null,
    className: String? = null,
    block: RHandler<IIconProps> = {}
): ReactElement = child(Icon::class) {
    attrs {
        this.icon = name
        this.iconSize = size
        this.htmlTitle = title
        this.intent = intent
        this.title = alt
        this.className = className
    }
    block()
}

fun RBuilder.bpButton(
    minimal: Boolean = false,
    large: Boolean = false,
    disabled: Boolean = false,
    title: String? = null,
    icon: IconName? = null,
    rightIcon: IconName? = null,
    intent: Intent = Intent.NONE,
    onClick: ((event: MouseEvent) -> Unit)? = {},
    block: RHandler<IButtonProps> = {}
): ReactElement = child(Button::class) {
    attrs {
        this.title = title
        this.minimal = minimal
        this.large = large
        this.disabled = disabled
        this.icon = icon
        this.rightIcon = rightIcon
        this.intent = intent
        this.onClick = onClick
    }
    block()
}

fun RBuilder.bpButtonGroup(
    large: Boolean = false,
    minimal: Boolean = false,
    block: RHandler<IButtonGroupProps> = {}
): ReactElement = child(ButtonGroup::class) {
    attrs {
        this.large = large
        this.minimal = minimal
    }
    block()
}

fun RBuilder.bpInputGroup(
    large: Boolean = false,
    placeholder: String = "",
    rightElement: ReactElement? = null,
    onChange: (Event) -> Unit
): ReactElement = child(InputGroup::class) {
{'fraction_non_alphanumeric': 0.11321295500143308, 'fraction_numerical': 0.0011464603038119805, 'mean_word_length': 2.681434599156118, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '4324461', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1059, 'n_words': 259}