diff --git a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/StandaloneSampleIcons.kt b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/StandaloneSampleIcons.kt
index 4381ec699b..848012f60b 100644
--- a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/StandaloneSampleIcons.kt
+++ b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/StandaloneSampleIcons.kt
@@ -15,6 +15,7 @@ object StandaloneSampleIcons {
val welcome = PathIconKey("icons/meetNewUi.svg", StandaloneSampleIcons::class.java)
object Components {
+ val banners = PathIconKey("icons/components/banners.svg", StandaloneSampleIcons::class.java)
val borders = PathIconKey("icons/components/borders.svg", StandaloneSampleIcons::class.java)
val button = PathIconKey("icons/components/button.svg", StandaloneSampleIcons::class.java)
val checkbox = PathIconKey("icons/components/checkBox.svg", StandaloneSampleIcons::class.java)
diff --git a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/component/Banners.kt b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/component/Banners.kt
index b68f65dd38..f649c01a71 100644
--- a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/component/Banners.kt
+++ b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/component/Banners.kt
@@ -1,43 +1,51 @@
package org.jetbrains.jewel.samples.standalone.view.component
-import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
-import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
-import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
-import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.foundation.theme.JewelTheme
import org.jetbrains.jewel.ui.component.ErrorBanner
+import org.jetbrains.jewel.ui.component.GroupHeader
import org.jetbrains.jewel.ui.component.InformationBanner
import org.jetbrains.jewel.ui.component.SuccessBanner
+import org.jetbrains.jewel.ui.component.Text
import org.jetbrains.jewel.ui.component.WarningBanner
import org.jetbrains.jewel.ui.theme.defaultBannerStyle
@Composable
internal fun Banners() {
- Column(Modifier.fillMaxSize().background(Color.White).padding(16.dp)) {
+ Column(Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
+ GroupHeader("Default banner (aka editor banners)")
+
InformationBanner(
style = JewelTheme.defaultBannerStyle.information,
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
)
- Spacer(modifier = Modifier.height(8.dp))
+
SuccessBanner(
style = JewelTheme.defaultBannerStyle.success,
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
)
- Spacer(modifier = Modifier.height(8.dp))
+
WarningBanner(
style = JewelTheme.defaultBannerStyle.warning,
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
)
- Spacer(modifier = Modifier.height(8.dp))
+
ErrorBanner(
style = JewelTheme.defaultBannerStyle.error,
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
)
+
+ Spacer(Modifier.height(0.dp)) // The column's arrangement will add 8+8 dps of spacing
+
+ GroupHeader("Inline banner")
+
+ Text("Coming soon...", color = JewelTheme.globalColors.text.disabled)
}
}
diff --git a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/viewmodel/ComponentsViewModel.kt b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/viewmodel/ComponentsViewModel.kt
index 070f4151f1..733d43c4ad 100644
--- a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/viewmodel/ComponentsViewModel.kt
+++ b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/viewmodel/ComponentsViewModel.kt
@@ -96,7 +96,7 @@ object ComponentsViewModel {
}
},
),
- ViewInfo(title = "Banners", iconKey = StandaloneSampleIcons.jewelLogo, content = { Banners() }),
+ ViewInfo(title = "Banners", iconKey = StandaloneSampleIcons.Components.banners, content = { Banners() }),
)
var currentView by mutableStateOf(views.first())
}
diff --git a/samples/standalone/src/main/resources/icons/components/banners.svg b/samples/standalone/src/main/resources/icons/components/banners.svg
new file mode 100644
index 0000000000..817c80b12e
--- /dev/null
+++ b/samples/standalone/src/main/resources/icons/components/banners.svg
@@ -0,0 +1,8 @@
+
diff --git a/samples/standalone/src/main/resources/icons/components/banners_dark.svg b/samples/standalone/src/main/resources/icons/components/banners_dark.svg
new file mode 100644
index 0000000000..7635abf8f8
--- /dev/null
+++ b/samples/standalone/src/main/resources/icons/components/banners_dark.svg
@@ -0,0 +1,8 @@
+