summaryrefslogtreecommitdiff
path: root/sw-ui/src/main/kotlin/com/palantir
diff options
context:
space:
mode:
Diffstat (limited to 'sw-ui/src/main/kotlin/com/palantir')
-rw-r--r--sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpCallout.kt26
-rw-r--r--sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt16
2 files changed, 42 insertions, 0 deletions
diff --git a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpCallout.kt b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpCallout.kt
new file mode 100644
index 00000000..a812d6e4
--- /dev/null
+++ b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpCallout.kt
@@ -0,0 +1,26 @@
+@file:JsModule("@blueprintjs/core")
+package com.palantir.blueprintjs
+
+import react.PureComponent
+import react.RState
+
+external interface ICalloutProps : IIntentProps, IProps {
+ var icon: dynamic /* IconName | MaybeElement */
+ get() = definedExternally
+ set(value) = definedExternally
+ override var intent: Intent?
+ get() = definedExternally
+ set(value) = definedExternally
+ var title: String?
+ get() = definedExternally
+ set(value) = definedExternally
+}
+
+open external class Callout : PureComponent<ICalloutProps, RState> {
+ override fun render(): react.ReactElement
+ open var getIconName: Any
+
+ companion object {
+ var displayName: String
+ }
+}
diff --git a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt
index d4872ad7..3106630d 100644
--- a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt
+++ b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt
@@ -146,3 +146,19 @@ fun RBuilder.bpOverlay(
}
block()
}
+
+fun RBuilder.bpCallout(
+ intent: Intent? = Intent.NONE,
+ icon: IconName? = null,
+ title: String? = null,
+ block: RHandler<ICalloutProps> = {}
+): ReactElement = child(Callout::class) {
+ attrs {
+ if (icon != null) {
+ this.icon = icon
+ }
+ this.title = title
+ this.intent = intent
+ }
+ block()
+}
bgstack15