-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add banners standalone icon, tweak sample UI
- Loading branch information
Showing
5 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 16 additions & 8 deletions
24
...andalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/component/Banners.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
samples/standalone/src/main/resources/icons/components/banners.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions
8
samples/standalone/src/main/resources/icons/components/banners_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.