Skip to content

Commit e2bb7dc

Browse files
committed
WIP
1 parent 662934a commit e2bb7dc

File tree

14 files changed

+114
-16
lines changed

14 files changed

+114
-16
lines changed

app/components/primer/beta/border_box.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ def initialize(padding: DEFAULT_PADDING, **system_arguments)
8989
end
9090

9191
def render?
92+
puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~@@@@@@@@@@@@#############&@(^(&#*@&#(@*&(#*~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
93+
puts rows.any?
94+
puts body.present?
95+
puts footer.present?
9296
rows.any? || header.present? || body.present? || footer.present?
9397
end
9498

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<%= render(@border_box) %>
2+
<span>HELLO</span>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* CSS for CollapsibleBorderBox */
2+
3+
.CollapsibleBorderBox {
4+
5+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# frozen_string_literal: true
2+
3+
module Primer
4+
module OpenProject
5+
# Add a general description of component here
6+
# Add additional usage considerations or best practices that may aid the user to use the component correctly.
7+
# @accessibility Add any accessibility considerations
8+
class CollapsibleBorderBox < Primer::Component
9+
status :open_project
10+
11+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
12+
def initialize(**system_arguments)
13+
@system_arguments = system_arguments
14+
15+
@border_box = Primer::Beta::BorderBox.new(**@system_arguments)
16+
end
17+
18+
delegate :body?, :body, :with_body, :with_body_content,
19+
:footer?, :footer, :with_footer, :with_footer_content,
20+
:rows?, :rows, :with_row, :with_row_content,
21+
to: :@border_box
22+
end
23+
24+
private
25+
26+
def before_render
27+
content
28+
end
29+
30+
def render?
31+
puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
32+
puts body.present?
33+
true
34+
end
35+
end
36+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@github/catalyst'

app/components/primer/primer.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@
4949
@import "./open_project/input_group.pcss";
5050
@import "./open_project/sub_header.pcss";
5151
@import "./open_project/side_panel/section.pcss";
52+
@import "./open_project/collapsible_border_box.pcss";

app/components/primer/primer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ import './open_project/page_header_element'
3030
import './open_project/zen_mode_button'
3131
import './open_project/sub_header_element'
3232
import './open_project/danger_dialog_form_helper'
33+
import './open_project/collapsible_border_box'

demo/Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ GEM
9696
faraday-patron (1.0.0)
9797
faraday-rack (1.0.0)
9898
faraday-retry (1.0.3)
99-
ffi (1.17.0-arm64-darwin)
100-
ffi (1.17.0-x86_64-darwin)
101-
ffi (1.17.0-x86_64-linux-gnu)
99+
ffi (1.17.1-arm64-darwin)
100+
ffi (1.17.1-x86_64-darwin)
101+
ffi (1.17.1-x86_64-linux-gnu)
102102
ffi-compiler (1.3.2)
103103
ffi (>= 1.15.5)
104104
rake
@@ -236,11 +236,11 @@ GEM
236236
mutex_m (0.2.0)
237237
netrc (0.11.0)
238238
nio4r (2.7.4)
239-
nokogiri (1.16.7-arm64-darwin)
239+
nokogiri (1.18.6-arm64-darwin)
240240
racc (~> 1.4)
241-
nokogiri (1.16.7-x86_64-darwin)
241+
nokogiri (1.18.6-x86_64-darwin)
242242
racc (~> 1.4)
243-
nokogiri (1.16.7-x86_64-linux)
243+
nokogiri (1.18.6-x86_64-linux-gnu)
244244
racc (~> 1.4)
245245
oj (3.16.3)
246246
bigdecimal (>= 3.0)

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@
4545
"dependencies": {
4646
"@github/auto-check-element": "^5.2.0",
4747
"@github/auto-complete-element": "^3.6.2",
48-
"@github/catalyst": "^1.6.0",
48+
"@github/catalyst": "^1.7.0",
4949
"@github/clipboard-copy-element": "^1.3.0",
5050
"@github/details-menu-element": "^1.0.12",
5151
"@github/image-crop-element": "^5.0.0",
5252
"@github/include-fragment-element": "^6.1.1",
5353
"@github/relative-time-element": "^4.0.0",
5454
"@github/remote-input-element": "^0.4.0",
5555
"@github/tab-container-element": "^3.1.2",
56-
"@primer/live-region-element": "^0.7.1",
5756
"@oddbird/popover-polyfill": "^0.5.2",
58-
"@primer/behaviors": "^1.3.4"
57+
"@primer/behaviors": "^1.3.4",
58+
"@primer/live-region-element": "^0.7.1"
5959
},
6060
"peerDependencies": {
6161
"@primer/primitives": "9.x || 10.x"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
# Setup Playground to use all available component props
4+
# Setup Features to use individual component props and combinations
5+
6+
module Primer
7+
module OpenProject
8+
# @label CollapsibleBorderBox
9+
class CollapsibleBorderBoxPreview < ViewComponent::Preview
10+
# @label Playground
11+
# def playground(string_example: "Some value", boolean_example: false, select_example: :one)
12+
# render(Primer::OpenProject::CollapsibleBorderBox.new(string_example: string_example, boolean_example: boolean_example, select_example: select_example))
13+
# end
14+
15+
def default
16+
render(Primer::OpenProject::CollapsibleBorderBox.new) do |component|
17+
component.with_body { "Body" }
18+
end
19+
end
20+
end
21+
end
22+
end

test/components/component_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class PrimerComponentTest < Minitest::Test
88

99
# Components with any arguments necessary to make them render
1010
COMPONENTS_WITH_ARGS = [
11+
[Primer::OpenProject::CollapsibleBorderBox, {}],
1112
[Primer::OpenProject::Heading, { tag: :h2 }],
1213
[Primer::OpenProject::DangerDialog, { title: "Danger action" }, proc { |component|
1314
component.with_confirmation_message do |confirmation|
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
require "components/test_helper"
4+
5+
class PrimerOpenProjectCollapsibleBorderBoxTest < Minitest::Test
6+
include Primer::ComponentTestHelpers
7+
8+
def test_renders
9+
render_inline(Primer::CollapsibleBorderBox.new)
10+
11+
assert_text("Add a test here")
12+
end
13+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
require "system/test_case"
4+
5+
class IntegrationOpenProjectCollapsibleBorderBoxTest < System::TestCase
6+
def test_renders_component
7+
visit_preview(:default)
8+
9+
assert_selector(".collapsible-border-box")
10+
end
11+
end

0 commit comments

Comments
 (0)