Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Button/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public struct OversizeButtonStyle: ButtonStyle {
.background(background(for: configuration.role))
.overlay(loadingView(for: configuration.role))
.scaleEffect(configuration.isPressed ? 0.95 : 1)
.shadowElevaton(isEnabled ? elevation : .z0)
.shadowElevation(isEnabled ? elevation : .z0)
}

@ViewBuilder
Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Button/IconButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public struct IconButtonStyle: ButtonStyle {
.background(background(for: configuration.role))
.overlay(loadingView(for: configuration.role))
.scaleEffect(configuration.isPressed ? 0.95 : 1)
.shadowElevaton(isEnabled ? elevation : .z0)
.shadowElevation(isEnabled ? elevation : .z0)
}

@ViewBuilder
Expand Down
6 changes: 3 additions & 3 deletions Sources/OversizeUI/Controls/GridSelect/GridSelect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public struct GridSelect<Element: Equatable, Content, Selection>: View
lineWidth: CGFloat(theme.borderSize)
)
)
.shadowElevaton(.z2)
.shadowElevation(.z2)
case .graySurface:
RoundedRectangle(
cornerRadius: radius,
Expand Down Expand Up @@ -183,7 +183,7 @@ public struct GridSelect<Element: Equatable, Content, Selection>: View
ZStack {
Circle()
.foregroundColor(Color.surfacePrimary)
.shadowElevaton(.z2)
.shadowElevation(.z2)
IconDeprecated(.checkMini, color: .onSurfacePrimary)
}.frame(width: Space.large.rawValue, height: Space.large.rawValue)
.padding(.small)
Expand All @@ -195,7 +195,7 @@ public struct GridSelect<Element: Equatable, Content, Selection>: View
ZStack {
Circle()
.foregroundColor(Color.accent)
.shadowElevaton(.z2)
.shadowElevation(.z2)
Circle()
.frame(width: Space.small.rawValue, height: Space.small.rawValue)
}.frame(width: Space.large.rawValue, height: Space.large.rawValue)
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/HUD/HUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public struct HUD<Title, Icon>: View where Title: View, Icon: View {
.background(
RoundedRectangle(cornerRadius: .small, style: .continuous)
.foregroundColor(Color.onBackgroundPrimary)
.shadowElevaton(.z2)
.shadowElevation(.z2)
)
#else
.background(
Capsule()
.foregroundColor(Color.surfacePrimary)
.shadowElevaton(.z2)
.shadowElevation(.z2)
)
#endif
.padding(.small)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public struct KeyboardToolbar<A>: View where A: View {
.padding(.horizontal, .small)
.padding(.vertical, .xxSmall)
.background(Color.surfacePrimary)
.shadowElevaton(.z1)
.shadowElevation(.z1)
}
}
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Menu/BarButtonMenuStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct BarButtonMenuStyle: MenuStyle {
.foregroundColor(Color.onPrimary)
.padding(.xxSmall)
.background(background)
.shadowElevaton(.z2)
.shadowElevation(.z2)
}

private var background: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public struct SegmentedPickerSelector<Element: Equatable, Content, Selection>: V
lineWidth: CGFloat(theme.borderSize)
)
)
.shadowElevaton(platform == .macOS ? .z0 : .z2)
.shadowElevation(platform == .macOS ? .z0 : .z2)

case .graySurface:
if style.unseletionStyle == .clean {
Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Controls/Surface/MaterialSurface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public struct MaterialSurface<Label: View>: View {
in: RoundedRectangle(cornerRadius: controlRadius, style: .continuous)
)
.overlay(overlayView)
.shadowElevaton(elevation)
.shadowElevation(elevation)
}

@ViewBuilder
Expand Down
4 changes: 2 additions & 2 deletions Sources/OversizeUI/Controls/Surface/Surface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public struct Surface<Label: View>: View {
style: .continuous
)
.fill(surfaceBackgroundColor)
.shadowElevaton(elevation)
.shadowElevation(elevation)

if isHover {
RoundedRectangle(
Expand All @@ -100,7 +100,7 @@ public struct Surface<Label: View>: View {
style: .continuous
)
.fill(surfaceBackgroundColor)
.shadowElevaton(elevation)
.shadowElevation(elevation)
#endif
}
.overlay(
Expand Down
10 changes: 10 additions & 0 deletions Sources/OversizeUI/Core/Shadow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@ public struct Shadow: ViewModifier {
}

public extension View {
@available(*, deprecated, renamed: "shadowElevation")
func shadowElevaton(_ elevation: Elevation) -> some View {
modifier(Shadow(elevation: elevation))
}

@available(*, deprecated, renamed: "shadowElevation")
func shadowElevaton(_ elevation: Elevation, color: Color) -> some View {
modifier(Shadow(elevation: elevation, color: color))
}

func shadowElevation(_ elevation: Elevation) -> some View {
modifier(Shadow(elevation: elevation))
}

func shadowElevation(_ elevation: Elevation, color: Color) -> some View {
modifier(Shadow(elevation: elevation, color: color))
}
}
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Deprecated/PageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public struct PageView<Content, LeadingBar, TrailingBar, TopToolbar, TitleLabel>
bottomToolbar()
Spacer()
}
.background(Color.surfacePrimary.shadowElevaton(style == .shadow ? .z2 : .z0))
.background(Color.surfacePrimary.shadowElevation(style == .shadow ? .z2 : .z0))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeUI/Deprecated/PageView/Page.swift
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public struct Page<Content, Header, LeadingBar, TrailingBar, TopToolbar, TitleLa
bottomToolbar()
Spacer()
}
.background(Color.surfacePrimary.shadowElevaton(style == .shadow ? .z2 : .z0))
.background(Color.surfacePrimary.shadowElevation(style == .shadow ? .z2 : .z0))
}
}
}
Expand Down