Skip to content

Commit

Permalink
Update all docs
Browse files Browse the repository at this point in the history
  • Loading branch information
carson-katri committed Aug 22, 2023
1 parent 0ae9e6a commit a795702
Show file tree
Hide file tree
Showing 195 changed files with 320 additions and 357 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Enables/disables antialiasing.
///
/// ```html
/// <Image system-name="heart.fill" modifiers={antialiased(@native, is_active: true)} />
/// <Image system-name="heart.fill" modifiers={antialiased(true)} />
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import SwiftUI
/// ```html
/// <Image
/// name="dot_green"
/// modifiers={@native |> resizable() |> interpolation(interpolation: :none)}
/// modifiers={resizable([]) |> interpolation(:none)}
/// />
/// <Image
/// name="dot_green"
/// modifiers={@native |> resizable() |> interpolation(interpolation: :medium)}
/// modifiers={resizable([]) |> interpolation(:medium)}
/// />
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import SwiftUI
/// The `template` mode renders nontransparent pixels as the foreground color.
///
/// ```html
/// <Image name="dot_green" modifiers={rendering_mode(@native, mode: :original)} />
/// <Image name="dot_green" modifiers={rendering_mode(@native, mode: :template)} />
/// <Image name="dot_green" modifiers={rendering_mode(:original)} />
/// <Image name="dot_green" modifiers={rendering_mode(:template)} />
/// ```
///
/// This modifier can also be used to render multicolor SF Symbols.
Expand All @@ -23,7 +23,7 @@ import SwiftUI
/// ```html
/// <Image
/// system-name="person.crop.circle.badge.plus"
/// modifiers={rendering_mode(@native, mode: :original)}
/// modifiers={rendering_mode(:original)}
/// />
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import SwiftUI
/// Enables an image to fill the available space.
///
/// ```html
/// <Image system-name="heart.fill" modifiers={resizable(@native)} />
/// <Image system-name="heart.fill" modifiers={resizable(@native, resizing_mode: :tile)} />
/// <Image system-name="heart.fill" modifiers={resizable([])} />
/// <Image system-name="heart.fill" modifiers={resizable(resizing_mode: :tile)} />
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import SwiftUI
///
/// ```html
/// <Rectangle
/// modifiers={animation(@native, value: @color)}
/// fill-color={@color}
/// modifiers={animation(value: @color)}
/// fill-color={@color}
/// />
/// ```
///
Expand All @@ -27,8 +27,8 @@ import SwiftUI
///
/// ```html
/// <Rectangle
/// modifiers={animation(@native, animation: :ease_out, value: @color)}
/// fill-color={@color}
/// modifiers={animation(animation: :ease_out, value: @color)}
/// fill-color={@color}
/// />
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import SwiftUI
///
/// ```html
/// <Text
/// modifiers={
/// @native
/// |> content_transition(transition: :numeric_text)
/// |> animation(value: @count)
/// }
/// modifiers={
/// content_transition(:numeric_text)
/// |> animation(value: @count)
/// }
/// >
/// <%= @count %>
/// <%= @count %>
/// </Text>
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import SwiftUI
/// <Image
/// system-name="heart.fill"
/// modifiers={
/// @native |> keyframe_animator(
/// keyframe_animator(
/// initial_value: 1.0,
/// trigger: "#{@liked}",
/// keyframes: [
/// {:linear, 1.0, [duration: 0.36]},
/// {:spring, 1.5, [duration: 0.8, spring: :bouncy]},
/// {:spring, 1.0, [spring: :bouncy]}
/// ],
/// modifiers: @native |> scale_effect(x: 1.0, y: 1.0),
/// modifiers: scale_effect(x: 1.0, y: 1.0),
/// properties: [scale_effect: [:x, :y]]
/// )
/// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import SwiftUI
/// Use the same `id` argument for elements that should be paired.
///
/// ```html
/// <VStack modifiers={@native |> animation(value: Atom.to_string(@is_flipped))}>
/// <VStack modifiers={animation(value: Atom.to_string(@is_flipped))}>
/// <%= if @is_flipped do %>
/// <Text id="a" modifiers={@native |> matched_geometry_effect(id: "a", namespace: :animation)}>A</Text>
/// <Text id="b" modifiers={@native |> matched_geometry_effect(id: "b", namespace: :animation)}>B</Text>
/// <Text id="a" modifiers={matched_geometry_effect(id: "a", namespace: :animation)}>A</Text>
/// <Text id="b" modifiers={matched_geometry_effect(id: "b", namespace: :animation)}>B</Text>
/// <% else %>
/// <Text id="b" modifiers={@native |> matched_geometry_effect(id: "b", namespace: :animation)}>B</Text>
/// <Text id="a" modifiers={@native |> matched_geometry_effect(id: "a", namespace: :animation)}>A</Text>
/// <Text id="b" modifiers={matched_geometry_effect(id: "b", namespace: :animation)}>B</Text>
/// <Text id="a" modifiers={matched_geometry_effect(id: "a", namespace: :animation)}>A</Text>
/// <% end %>
/// <Button phx-click="flip">Flip</Button>
/// </VStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import SwiftUI
///
/// ```html
/// <%= if @show do %>
/// <Text modifiers={transition(@native, transition: :scale)}>Scaled</Text>
/// <Text modifiers={transition(:scale)}>Scaled</Text>
/// <% end %>
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import SwiftUI
/// Alters the shape of any bordered buttons' borders.
///
/// ```html
/// <Button modifiers={button_style(@native, style: :bordered) |> button_border_shape(shape: :capsule)}>
/// <Button modifiers={button_style(:bordered) |> button_border_shape(:capsule)}>
/// Capsule
/// </Button>
/// <Button modifiers={button_style(@native, style: :bordered) |> button_border_shape(shape: :rounded_rectangle, radius: 15)}>
/// <Button modifiers={button_style(:bordered) |> button_border_shape(shape: :rounded_rectangle, radius: 15)}>
/// Rounded rectangle
/// </Button>
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import SwiftUI
/// Sets the size of controls within this view.
///
/// ```html
/// <Button modifiers={control_size(@native, size: :mini) |> button_style(style: :bordered_prominent)}>Mini</Button>
/// <Button modifiers={control_size(@native, size: :large) |> button_style(style: :bordered_prominent)}>Regular</Button>
/// <Button modifiers={control_size(:mini) |> button_style(:bordered_prominent)}>Mini</Button>
/// <Button modifiers={control_size(:large) |> button_style(:bordered_prominent)}>Regular</Button>
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Changes radio-group style ``Picker``s to lay out horizontally.
///
/// ```html
/// <Picker modifiers={picker_style(@native, style: :radio_group) |> horizontal_radio_group_layout()}>
/// <Picker modifiers={picker_style(:radio_group) |> horizontal_radio_group_layout()}>
/// ...
/// </Picker>
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import SwiftUI
/// Activates this view as the source of a drag and drop operation.
///
/// ```html
/// <Text modifiers={draggable(@native, payload: "ABC")}>ABC</Text>
/// <Text modifiers={draggable(@native, payload: "ABC", preview: :my_preview)}>
/// <Text modifiers={draggable("ABC")}>ABC</Text>
/// <Text modifiers={draggable("ABC", preview: :my_preview)}>
/// ABC
/// <Image system-name="heart.fill" template={:my_preview}>
/// </Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import SwiftUI
/// Defines the destination of a drag and drop operation that handles the dropped content with an event that you specify.
///
/// ```html
/// <Text modifiers={draggable(@native, payload: "ABC")}>ABC</Text>
/// <Text modifiers={drop_destination(@native, action: "drop")}>
/// <Text modifiers={draggable("ABC")}>ABC</Text>
/// <Text modifiers={drop_destination(action: "drop")}>
/// Drop Here
/// </Text>
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import SwiftUI
///
/// ```html
/// <HStack>
/// <Color name="system-yellow" modifiers={@native |> frame(width: 50, height: 50, alignment: :center)} />
/// <Color name="system-yellow" modifiers={frame(width: 50, height: 50, alignment: :center)} />
/// <Color name="system-red"
/// modifiers={
/// @native
/// |> frame(width: 50, height: 50, alignment: :center)
/// |> rotation_effect(angle: {:degrees, 45})
/// |> padding(all: -20)
/// |> blend_mode(blend_mode: :color_burn)
/// frame(width: 50, height: 50, alignment: :center)
/// |> rotation_effect({:degrees, 45})
/// |> padding(-20)
/// |> blend_mode(:color_burn)
/// }
/// />
/// </HStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftUI
/// Set the ``radius`` to control the strength of the blur.
///
/// ```html
/// <Text modifiers={blur(@native, radius: 2)}>Hello, world!</Text>
/// <Text modifiers={blur(radius: 2)}>Hello, world!</Text>
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Applies a border to any element.
///
/// ```html
/// <Text modifiers={border(@native, content: {:color, :purple}, width: 4)}>
/// <Text modifiers={border({:color, :purple}, width: 4)}>
/// Purple border inside the view bounds.
/// </Text>
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Brighten the intensity of the colors in a view.
///
/// ```html
/// <Color name="system-red" modifiers={@native |> brightness(amount: 0.5)} />
/// <Color name="system-red" modifiers={brightness(0.5)} />
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftUI
/// Provide a ``ShapeReference`` to clip the element with.
///
/// ```html
/// <Text modifiers={clip_shape(@native, shape: :circle)}>
/// <Text modifiers={clip_shape(:circle)}>
/// Hello,
/// world!
/// </Text>
Expand All @@ -22,10 +22,10 @@ import SwiftUI
/// This lets you apply modifiers to the clip shape.
///
/// ```html
/// <Text modifiers={clip_shape(@native, shape: :my_shape)}>
/// <Text modifiers={clip_shape(:my_shape)}>
/// Hello,
/// world!
/// <Rectangle template={:my_shape} modifiers={@native |> rotation(angle: {:degrees, 45})} />
/// <Rectangle template={:my_shape} modifiers={rotation({:degrees, 45})} />
/// </Text>
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import SwiftUI
/// ```html
/// <Circle
/// modifiers={
/// @native
/// |> foreground_color(color: :mint)
/// foreground_color(:mint)
/// |> frame(width: 20, height: 20)
/// |> clipped(antialiased: true)
/// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Inverts the colors in this view.
///
/// ```html
/// <Circle modifiers={@native |> foreground_style(primary: {:color, :red}) |> color_invert()} />
/// <Circle modifiers={foreground_style({:color, :red}) |> color_invert()} />
/// ```
#if swift(>=5.8)
@_documentation(visibility: public)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Adds a color multiplication effect to this view.
///
/// ```html
/// <Label modifiers={foreground_style(@native, primary: {:color, :mint}) |> color_multiply(color: :blue)}>Color Text</Label>
/// <Label modifiers={foreground_style({:color, :mint}) |> color_multiply(:blue)}>Color Text</Label>
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ import SwiftUI
/// <HStack>
/// <ZStack
/// modifiers={
/// @native
/// |> compositing_group()
/// |> opacity(opacity: 0.5)
/// compositing_group([])
/// |> opacity(0.5)
/// }
/// >
/// <Text>Hello, world!</Text>
/// <Text modifiers={blur(@native, radius: 2)}>Hello, world!</Text>
/// <Text modifiers={blur(radius: 2)}>Hello, world!</Text>
/// </ZStack>
/// </HStack>
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Sets the contrast and separation between similar colors in this view.
///
/// ```html
/// <Circle modifiers={@native |> foreground_style(primary: {:color, :red}) |> contrast(amount: 0.5)} />
/// <Circle modifiers={foreground_style({:color, :red}) |> contrast(0.5)} />
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
/// Clips this view to its bounding frame, with the specified corner ``radius``.
///
/// ```html
/// <Image name="MyCustomImage" modifiers={@native |> corner_radius(radius: 8)} />
/// <Image name="MyCustomImage" modifiers={corner_radius(8)} />
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ import SwiftUI
///
/// ```html
/// <HStack>
/// <ZStack
/// modifier={
/// @native
/// |> drawing_group(opaque: false, color_mode: :non_linear)
/// |> opacity(opacity: 0.5)
/// }
/// >
/// <Text>Hello, world!</Text>
/// <Text modifiers={blur(@native, radius: 2)}>Hello, world!</Text>
/// </ZStack>
/// <ZStack
/// modifier={
/// drawing_group(opaque: false, color_mode: :non_linear)
/// |> opacity(opacity: 0.5)
/// }
/// >
/// <Text>Hello, world!</Text>
/// <Text modifiers={blur(radius: 2)}>Hello, world!</Text>
/// </ZStack>
/// </HStack>
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SwiftUI

/// Applies a foreground color to a view.
/// ```html
/// <Text modifiers={foreground_color(@native, color: :mint)}>
/// <Text modifiers={foreground_color(:mint)}>
/// Minty fresh text.
/// </Text>
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftUI
/// A grayscale effect reduces the intensity of colors in this view.
///
/// ```html
/// <Label modifiers={@native |> foreground_color(color: :red) |> grayscale(amount: 0.5)}>Color Text</Label>
/// <Label modifiers={foreground_color(:red) |> grayscale(0.5)}>Color Text</Label>
/// ```
///
/// ## Arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import SwiftUI
/// <Rectangle
/// id={Integer.to_string(item)}
/// modifiers={
/// @native
/// |> foreground_style(primary: {:linear_gradient, %{ :gradient => {:colors, [:blue, :red, :green]}, :start_point => {0.5, 0}, :end_point => {0.5, 1} }})
/// |> hue_rotation(angle: {:degrees, item * 36})
/// foreground_style({:linear_gradient, %{ :gradient => {:colors, [:blue, :red, :green]}, :start_point => {0.5, 0}, :end_point => {0.5, 1} }})
/// |> hue_rotation({:degrees, item * 36})
/// |> frame(width: 60, height: 60, alignment: :center)
/// }
/// />
Expand Down
Loading

0 comments on commit a795702

Please sign in to comment.