Skip to content

Commit fa1a95d

Browse files
committed
Migrate shapes to new shape design tokens
1 parent 1cd19fe commit fa1a95d

File tree

9 files changed

+42
-27
lines changed

9 files changed

+42
-27
lines changed

library-compose/src/main/java/com/spendesk/grapes/compose/actionmenu/ActionMenuItem.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fun ActionMenuItem(
6666
top = verticalInnerPadding,
6767
bottom = verticalInnerPadding,
6868
),
69-
shape = GrapesTheme.shapes.small,
69+
shape = GrapesTheme.shapes.borderRadius2,
7070
modifier = modifier,
7171
) {
7272
Row(

library-compose/src/main/java/com/spendesk/grapes/compose/bucket/GrapesBucketContainer.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ fun GrapesBucketContainer(
3232
) {
3333
Box(
3434
modifier = modifier
35-
.background(GrapesTheme.colors.mainWhite, GrapesTheme.shapes.small)
36-
.border(GrapesBucketBorderWidth, GrapesTheme.colors.mainNeutralNormal, GrapesTheme.shapes.small)
37-
.clip(GrapesTheme.shapes.small)
35+
.background(GrapesTheme.colors.mainWhite, GrapesTheme.shapes.borderRadius2)
36+
.border(GrapesBucketBorderWidth, GrapesTheme.colors.mainNeutralNormal, GrapesTheme.shapes.borderRadius2)
37+
.clip(GrapesTheme.shapes.borderRadius2)
3838
) {
3939
content()
4040
}

library-compose/src/main/java/com/spendesk/grapes/compose/button/GrapesButtonStyleDefaults.kt

+14-14
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object GrapesButtonStyleDefaults {
3232
height = GrapesButtonDefaults.MinHeight.value
3333
),
3434
iconSize = GrapesButtonDefaults.iconSize,
35-
shape = GrapesTheme.shapes.small,
35+
shape = GrapesTheme.shapes.borderRadius2,
3636
rippleColor = GrapesTheme.colors.mainPrimaryDark,
3737
colors = ButtonColorDefaults.primary,
3838
contentPadding = GrapesButtonDefaults.PaddingValues,
@@ -50,7 +50,7 @@ object GrapesButtonStyleDefaults {
5050
height = GrapesButtonDefaults.MinHeightSmall.value
5151
),
5252
iconSize = GrapesButtonDefaults.iconSizeSmall,
53-
shape = GrapesTheme.shapes.small,
53+
shape = GrapesTheme.shapes.borderRadius2,
5454
rippleColor = GrapesTheme.colors.mainPrimaryDark,
5555
colors = ButtonColorDefaults.primary,
5656
contentPadding = GrapesButtonDefaults.PaddingValuesSmall,
@@ -68,7 +68,7 @@ object GrapesButtonStyleDefaults {
6868
height = GrapesButtonDefaults.MinHeight.value
6969
),
7070
iconSize = GrapesButtonDefaults.iconSize,
71-
shape = GrapesTheme.shapes.small,
71+
shape = GrapesTheme.shapes.borderRadius2,
7272
rippleColor = GrapesTheme.colors.mainNeutralNormal,
7373
colors = ButtonColorDefaults.secondary,
7474
contentPadding = GrapesButtonDefaults.PaddingValues,
@@ -86,7 +86,7 @@ object GrapesButtonStyleDefaults {
8686
height = GrapesButtonDefaults.MinHeightSmall.value
8787
),
8888
iconSize = GrapesButtonDefaults.iconSizeSmall,
89-
shape = GrapesTheme.shapes.small,
89+
shape = GrapesTheme.shapes.borderRadius2,
9090
rippleColor = GrapesTheme.colors.mainNeutralNormal,
9191
colors = ButtonColorDefaults.secondary,
9292
contentPadding = GrapesButtonDefaults.PaddingValuesSmall,
@@ -104,7 +104,7 @@ object GrapesButtonStyleDefaults {
104104
height = GrapesButtonDefaults.MinHeight.value
105105
),
106106
iconSize = GrapesButtonDefaults.iconSize,
107-
shape = GrapesTheme.shapes.small,
107+
shape = GrapesTheme.shapes.borderRadius2,
108108
rippleColor = GrapesTheme.colors.mainPrimaryLight,
109109
colors = ButtonColorDefaults.text,
110110
contentPadding = GrapesButtonDefaults.PaddingValues,
@@ -122,7 +122,7 @@ object GrapesButtonStyleDefaults {
122122
height = GrapesButtonDefaults.MinHeightSmall.value
123123
),
124124
iconSize = GrapesButtonDefaults.iconSizeSmall,
125-
shape = GrapesTheme.shapes.small,
125+
shape = GrapesTheme.shapes.borderRadius2,
126126
rippleColor = GrapesTheme.colors.mainPrimaryLight,
127127
colors = ButtonColorDefaults.text,
128128
contentPadding = GrapesButtonDefaults.PaddingValuesSmall,
@@ -140,7 +140,7 @@ object GrapesButtonStyleDefaults {
140140
height = GrapesButtonDefaults.MinHeight.value
141141
),
142142
iconSize = GrapesButtonDefaults.iconSize,
143-
shape = GrapesTheme.shapes.small,
143+
shape = GrapesTheme.shapes.borderRadius2,
144144
rippleColor = GrapesTheme.colors.mainAlertDark,
145145
colors = ButtonColorDefaults.alert,
146146
contentPadding = GrapesButtonDefaults.PaddingValues,
@@ -158,7 +158,7 @@ object GrapesButtonStyleDefaults {
158158
height = GrapesButtonDefaults.MinHeight.value
159159
),
160160
iconSize = GrapesButtonDefaults.iconSize,
161-
shape = GrapesTheme.shapes.small,
161+
shape = GrapesTheme.shapes.borderRadius2,
162162
rippleColor = GrapesTheme.colors.mainAlertDark,
163163
colors = ButtonColorDefaults.alertOutlined,
164164
contentPadding = GrapesButtonDefaults.PaddingValues,
@@ -176,7 +176,7 @@ object GrapesButtonStyleDefaults {
176176
height = GrapesButtonDefaults.MinHeight.value
177177
),
178178
iconSize = GrapesButtonDefaults.iconSize,
179-
shape = GrapesTheme.shapes.small,
179+
shape = GrapesTheme.shapes.borderRadius2,
180180
rippleColor = GrapesTheme.colors.mainWarningDark,
181181
colors = ButtonColorDefaults.warning,
182182
contentPadding = GrapesButtonDefaults.PaddingValues,
@@ -194,7 +194,7 @@ object GrapesButtonStyleDefaults {
194194
height = GrapesButtonDefaults.MinHeightSmall.value
195195
),
196196
iconSize = GrapesButtonDefaults.iconSizeSmall,
197-
shape = GrapesTheme.shapes.small,
197+
shape = GrapesTheme.shapes.borderRadius2,
198198
rippleColor = GrapesTheme.colors.mainNeutralLight,
199199
colors = ButtonColorDefaults.linkPrimary,
200200
contentPadding = GrapesButtonDefaults.PaddingValuesSmall,
@@ -212,7 +212,7 @@ object GrapesButtonStyleDefaults {
212212
height = GrapesButtonDefaults.MinHeightSmall.value
213213
),
214214
iconSize = GrapesButtonDefaults.iconSizeSmall,
215-
shape = GrapesTheme.shapes.small,
215+
shape = GrapesTheme.shapes.borderRadius2,
216216
rippleColor = GrapesTheme.colors.mainNeutralLighter,
217217
colors = ButtonColorDefaults.linkSecondary,
218218
contentPadding = GrapesButtonDefaults.PaddingValuesSmall,
@@ -230,7 +230,7 @@ object GrapesButtonStyleDefaults {
230230
height = GrapesButtonDefaults.MinHeightSmall.value
231231
),
232232
iconSize = 40.dp,
233-
shape = GrapesTheme.shapes.small,
233+
shape = GrapesTheme.shapes.borderRadius2,
234234
rippleColor = GrapesTheme.colors.mainNeutralLighter,
235235
colors = ButtonColorDefaults.google,
236236
contentPadding = GrapesButtonDefaults.PaddingValuesBrand,
@@ -248,7 +248,7 @@ object GrapesButtonStyleDefaults {
248248
height = GrapesButtonDefaults.MinHeightSmall.value
249249
),
250250
iconSize = 40.dp,
251-
shape = GrapesTheme.shapes.small,
251+
shape = GrapesTheme.shapes.borderRadius2,
252252
rippleColor = GrapesTheme.colors.mainNeutralLighter,
253253
colors = ButtonColorDefaults.secondary,
254254
contentPadding = GrapesButtonDefaults.PaddingValuesBrand,
@@ -266,7 +266,7 @@ object GrapesButtonStyleDefaults {
266266
height = GrapesButtonDefaults.MinHeightSmall.value
267267
),
268268
iconSize = 40.dp,
269-
shape = GrapesTheme.shapes.small,
269+
shape = GrapesTheme.shapes.borderRadius2,
270270
rippleColor = GrapesTheme.colors.mainNeutralLighter,
271271
colors = ButtonColorDefaults.secondary,
272272
contentPadding = GrapesButtonDefaults.PaddingValuesBrand,

library-compose/src/main/java/com/spendesk/grapes/compose/callout/GrapesCoreCallout.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fun GrapesCoreCallout(
3232
) {
3333
Surface(
3434
modifier = modifier.fillMaxWidth(),
35-
shape = GrapesTheme.shapes.small,
35+
shape = GrapesTheme.shapes.borderRadius2,
3636
color = colors.containerColor().value,
3737
contentColor = colors.contentColor().value,
3838
border = BorderStroke(GrapesCalloutDefaults.borderThickness, colors.borderStrokeColor().value),

library-compose/src/main/java/com/spendesk/grapes/compose/listitem/SectionItem.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private fun Preview() {
6161
icon = { modifier ->
6262
Box(
6363
modifier
64-
.clip(GrapesTheme.shapes.small)
64+
.clip(GrapesTheme.shapes.borderRadius2)
6565
.background(Color.Blue))
6666
},
6767
description = "85.99€ per month",

library-compose/src/main/java/com/spendesk/grapes/compose/message/Message.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fun GrapesMessage(
4949
GrapesSurface(
5050
modifier = modifier.width(IntrinsicSize.Max),
5151
configuration = configuration,
52-
shape = GrapesTheme.shapes.small,
52+
shape = GrapesTheme.shapes.borderRadius2,
5353
) {
5454
Column(modifier = Modifier.padding(contentPadding)) {
5555
Row(verticalAlignment = Alignment.CenterVertically) {

library-compose/src/main/java/com/spendesk/grapes/compose/selectors/GrapesSelectBlockContainer.kt

+18-3
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,30 @@ fun GrapesSelectBlockContainer(
2626
content: @Composable () -> Unit,
2727
modifier: Modifier = Modifier
2828
) {
29-
val borderModifier = if (isSelected) Modifier.border(GrapesTheme.dimensions.borderLarge, GrapesSelectBlockContainerDefaultColors.selectedBorderColor, GrapesTheme.shapes.small) else Modifier
30-
val backgroundModifier = if (isSelected) Modifier.background(color = GrapesSelectBlockContainerDefaultColors.selectedBackgroundColor, GrapesTheme.shapes.small) else Modifier
29+
val borderModifier = if (isSelected) {
30+
Modifier.border(
31+
width = GrapesTheme.dimensions.borderLarge,
32+
color = GrapesSelectBlockContainerDefaultColors.selectedBorderColor,
33+
shape = GrapesTheme.shapes.borderRadius2
34+
)
35+
} else {
36+
Modifier
37+
}
38+
val backgroundModifier = if (isSelected) {
39+
Modifier.background(
40+
color = GrapesSelectBlockContainerDefaultColors.selectedBackgroundColor,
41+
GrapesTheme.shapes.borderRadius2
42+
)
43+
} else {
44+
Modifier
45+
}
3146

3247
Box(
3348
modifier = modifier
3449
.fillMaxWidth()
3550
.then(borderModifier)
3651
.then(backgroundModifier)
37-
.clip(GrapesTheme.shapes.small)
52+
.clip(GrapesTheme.shapes.borderRadius2)
3853
) {
3954
content()
4055
}

library-compose/src/main/java/com/spendesk/grapes/compose/textfield/GrapesPinTextFieldDecorationBox.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ private fun PinText(
6868
modifier = modifier
6969
.width(GrapesPinTextFieldDefaults.PinCharWidth)
7070
.height(GrapesPinTextFieldDefaults.PinCharHeight)
71-
.background(GrapesTheme.colors.mainWhite, shape = GrapesTheme.shapes.small)
71+
.background(GrapesTheme.colors.mainWhite, shape = GrapesTheme.shapes.borderRadius2)
7272
.border(
7373
width = GrapesPinTextFieldDefaults.PinCharBorderWidth,
7474
color = GrapesPinTextFieldDefaults
7575
.pinFieldColors()
7676
.borderColor(isEnabled = isEnabled, isError = isError, isSelected = isFocused),
77-
shape = GrapesTheme.shapes.small
77+
shape = GrapesTheme.shapes.borderRadius2
7878
)
7979
.pointerInput(Unit) {
8080
detectTapGestures(

library-compose/src/main/java/com/spendesk/grapes/compose/textfield/GrapesTextFieldDefaults.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object GrapesTextFieldDefaults {
4444
val TextFieldShape: Shape
4545
@Composable
4646
@ReadOnlyComposable
47-
get() = GrapesTheme.shapes.small
47+
get() = GrapesTheme.shapes.borderRadius2
4848

4949

5050
fun textFieldPadding(

0 commit comments

Comments
 (0)