Skip to content

Commit

Permalink
Merge pull request #467 from JPToroDev/020525j
Browse files Browse the repository at this point in the history
Rename `DropdownElement` to `DropdownItem`
  • Loading branch information
twostraws authored Feb 11, 2025
2 parents 7467e50 + 7ef43d5 commit 34adc31
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/Ignite/Elements/Divider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/// A horizontal divider for your page, that can also be used to divide elements
/// in a dropdown.
public struct Divider: BlockHTML, DropdownElement {
public struct Divider: BlockHTML, DropdownItem {
/// The content and behavior of this HTML.
public var body: some HTML { self }

Expand Down
6 changes: 3 additions & 3 deletions Sources/Ignite/Elements/Dropdown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/// Elements that conform to `DropdownElement` can be shown inside
/// Dropdown objects.
public protocol DropdownElement: InlineHTML {}
public protocol DropdownItem: InlineHTML {}

/// Renders a button that presents a menu of information when pressed.
/// Can be used as a free-floating element on your page, or in
Expand All @@ -29,7 +29,7 @@ public struct Dropdown: BlockHTML, NavigationItem {
var title: any InlineHTML

/// The array of items to shown in this `Dropdown`.
var items: [any DropdownElement]
var items: [any DropdownItem]

/// How large this dropdown should be drawn. Defaults to `.medium`.
var size = Button.Size.medium
Expand All @@ -48,7 +48,7 @@ public struct Dropdown: BlockHTML, NavigationItem {
/// - items: The elements to place inside the dropdown menu.
public init(
_ title: any InlineHTML,
@ElementBuilder<any DropdownElement> items: () -> [any DropdownElement]
@ElementBuilder<any DropdownItem> items: () -> [any DropdownItem]
) {
self.title = title
self.items = items()
Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Elements/Link.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/// A hyperlink to another resource on this site or elsewhere.
public struct Link: BlockHTML, InlineHTML, NavigationItem, DropdownElement {
public struct Link: BlockHTML, InlineHTML, NavigationItem, DropdownItem {
/// The content and behavior of this HTML.
public var body: some HTML { self }

Expand Down
2 changes: 1 addition & 1 deletion Sources/Ignite/Elements/Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// just use a simple string. Using `Text` is required if you want a specific paragraph
/// of text with some styling, or a header of a particular size.
@MainActor
public struct Text: BlockHTML, DropdownElement {
public struct Text: BlockHTML, DropdownItem {
/// The content and behavior of this HTML.
public var body: some HTML { self }

Expand Down

0 comments on commit 34adc31

Please sign in to comment.