-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate Primer::BoxComponent to Primer::Box (#1266)
* don't seem to have .to_sentence available * initial rename of BoxComponent to Box * changing all references, and adding deprecated BoxComponent * correcting tests * rebuild static files w/ deprecated box component * correcting migration list * docs: build docs * corrected deprecated box component * deprecating box component correctly Co-authored-by: Actions Auto Build <[email protected]>
- Loading branch information
1 parent
7dfef05
commit 7d2949d
Showing
19 changed files
with
79 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/view-components': patch | ||
--- | ||
|
||
moving Primer::BoxComponent to Primer::Box and creating deprecated Primer::BoxComponent for backward compatibility |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Primer | ||
# `Box` is a basic wrapper component for most layout related needs. | ||
class Box < Primer::Component | ||
status :stable | ||
|
||
# @example Default | ||
# <%= render(Primer::Box.new) { "Your content here" } %> | ||
# | ||
# @example Color and padding | ||
# <%= render(Primer::Box.new(bg: :subtle, p: 3)) { "Hello world" } %> | ||
# | ||
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %> | ||
def initialize(**system_arguments) | ||
@system_arguments = deny_tag_argument(**system_arguments) | ||
|
||
@system_arguments[:tag] = :div | ||
end | ||
|
||
def call | ||
render(Primer::BaseComponent.new(**@system_arguments)) { content } | ||
end | ||
end | ||
end |
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,25 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module Primer | ||
# `Box` is a basic wrapper component for most layout related needs. | ||
class BoxComponent < Primer::Component | ||
status :stable | ||
|
||
# @example Default | ||
# <%= render(Primer::BoxComponent.new) { "Your content here" } %> | ||
# | ||
# @example Color and padding | ||
# <%= render(Primer::BoxComponent.new(bg: :subtle, p: 3)) { "Hello world" } %> | ||
# | ||
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %> | ||
def initialize(**system_arguments) | ||
@system_arguments = deny_tag_argument(**system_arguments) | ||
|
||
@system_arguments[:tag] = :div | ||
end | ||
|
||
def call | ||
render(Primer::BaseComponent.new(**@system_arguments)) { content } | ||
end | ||
class BoxComponent < Primer::Box | ||
status :deprecated | ||
end | ||
end |
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
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
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
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
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
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
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
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
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
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
4 changes: 3 additions & 1 deletion
4
stories/primer/box_component_stories.rb → stories/primer/box_stories.rb
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
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
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
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
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
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