-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17a75d5
commit 99f13e4
Showing
31 changed files
with
308 additions
and
310 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ponents/lookbook/ui/app/layout/layout.css → app/components/lookbook/ui/app/app.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<%= render component_tag(x: {data: "app", bind: "bindings.root"}, data: {status_bar: status_bar?.to_json}) do %> | ||
<div id="app-header"> | ||
<%= header %> | ||
</div> | ||
|
||
<% if pages.any? || previews.any? %> | ||
<%= | ||
lb_pane_group("app-body", tag: :div, opts: body_split) do |body| | ||
body.with_pane do | ||
sidebar | ||
end | ||
body.with_pane { main } | ||
end | ||
%> | ||
<% else %> | ||
<%= main %> | ||
<% end %> | ||
<% if status_bar? %> | ||
<footer id="app-status-bar"> | ||
<%= status_bar %> | ||
</footer> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Lookbook | ||
module UI | ||
class App < BaseComponent | ||
with_slot :header, Lookbook::UI::Header | ||
with_slot :sidebar, Lookbook::UI::Sidebar | ||
with_slot :main | ||
with_slot :status_bar, Lookbook::UI::StatusBar | ||
|
||
def body_split | ||
{ | ||
orientation: :vertical, | ||
sizes: ["280px", "auto"], | ||
min_sizes: [200, 200] | ||
} | ||
end | ||
|
||
def pages | ||
Lookbook::Pages | ||
end | ||
|
||
def previews | ||
Lookbook::Previews | ||
end | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
[data-component="sidebar"] { | ||
display: contents; | ||
} |
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,41 @@ | ||
<%= | ||
render component_tag do | ||
lb_pane_group("app-sidebar", opts: sidebar_split) do |sidebar| | ||
nav_panels.each do |name| | ||
if name.to_sym == :previews | ||
sidebar.with_pane("previews-nav") do |pane| | ||
pane.with_toolbar do |toolbar| | ||
toolbar.with_label { config.previews_nav_label } | ||
if previews.any? | ||
toolbar.with_button_group do |group| | ||
group.with_button( | ||
icon: :copy_minus, | ||
tooltip: "Collapse all", | ||
click: "$dispatch('nav:collapse-all', {id: 'previews-nav-tree'})") | ||
end | ||
end | ||
end | ||
previews_nav | ||
end | ||
end | ||
|
||
if name.to_sym == :pages && pages_nav? | ||
sidebar.with_pane("pages-nav") do |pane| | ||
pane.with_toolbar do |toolbar| | ||
toolbar.with_label { config.pages_nav_label } | ||
if pages.any? | ||
toolbar.with_button_group do |group| | ||
group.with_button( | ||
icon: :copy_minus, | ||
tooltip: "Collapse all", | ||
click: "$dispatch('nav:collapse-all', {id: 'pages-nav-tree'})") | ||
end | ||
end | ||
end | ||
pages_nav | ||
end | ||
end | ||
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
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
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
app/components/lookbook/ui/elements/metadata_table/metadata_table.html.erb
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,19 @@ | ||
<%= render component_tag do %> | ||
<%= lb_table do |table| %> | ||
<% table.with_header do |header| %> | ||
<% header.with_cell("Name", collapse: true) %> | ||
<% header.with_cell("Value") %> | ||
<% end %> | ||
<% entries.each do |entry| %> | ||
<% table.with_row do |row| %> | ||
<% row.with_cell(collapse: true) do %> | ||
<strong><%= entry.name %></strong> | ||
<% end %> | ||
<% row.with_cell do %> | ||
<code><%= entry.value %></code> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
15 changes: 15 additions & 0 deletions
15
app/components/lookbook/ui/elements/metadata_table/metadata_table.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Lookbook | ||
module UI | ||
class MetadataTable < BaseComponent | ||
attr_reader :entries | ||
|
||
def initialize(**kwargs) | ||
@entries = [] | ||
end | ||
|
||
def with_entry(name, value) | ||
@entries << DataObject.new({name: name, value: value}) | ||
end | ||
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
35 changes: 0 additions & 35 deletions
35
app/components/lookbook/ui/pages/page_metadata/page_metadata.html.erb
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
app/components/lookbook/ui/pages/page_metadata/page_metadata.rb
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.