This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Man 278 pjs card footer indicators (#332)
* Add indicator element * Add card footer * Add aria-label * Lint * Radius round utility
- Loading branch information
1 parent
ff676d2
commit 74b21d9
Showing
12 changed files
with
130 additions
and
18 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
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,9 @@ | ||
<ul class="sage-indicator-list" aria-label="<%= "Showing #{label} #{current_item} of #{num_items}"%>"> | ||
<% for i in 1...(num_items + 1) %> | ||
<li class="sage-indicator<%= " sage-indicator--current" if current_item == i %>"> | ||
<span class="visually-hidden"> | ||
<%= "#{label} #{i}" %> | ||
</span> | ||
</li> | ||
<% end %> | ||
</ul> |
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,6 @@ | ||
<h4>Default</h4> | ||
<%= render "examples/elements/indicator/markup", | ||
label: "Page", | ||
num_items: 5, | ||
current_item: 2 | ||
%> |
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,18 @@ | ||
<tr> | ||
<td>label</td> | ||
<td>The label to prepend in front of the number for the indicator in visually-hidden text.</td> | ||
<td>String</td> | ||
<td></td> | ||
</tr> | ||
<tr> | ||
<td>num_items</td> | ||
<td>The total number of items to display.</td> | ||
<td>Number</td> | ||
<td></td> | ||
</tr> | ||
<tr> | ||
<td>current_item</td> | ||
<td>The item that is "selected" in the indicator list.</td> | ||
<td>Number</td> | ||
<td></td> | ||
</tr> |
Empty file.
Empty file.
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<nav class="sage-pagination" aria-label="pagination"> | ||
<span class="sage-pagination__count"><strong><%= total_count %></strong> Records</span> | ||
<ul class="sage-pagination__pages"> | ||
<% pagination_items.each do |item| %> | ||
<li class="sage-pagination__item"> | ||
<%- if item[:is_link] -%> | ||
<a href="<%= item[:link_url] %>" class="sage-pagination__page<%= item[:is_disabled] ? " sage-pagination__page--disabled" : "" %><%= item[:is_current] ? " sage-pagination__page--current" : "" %>"<% if item[:is_disabled] %> aria-disabled="true"<% end %><% if item[:is_current] %> aria-current="page"<% end %>> | ||
<% if item[:is_prev] %> | ||
Back | ||
<% elsif item[:is_next] %> | ||
Next <span class="visually-hidden">Page</span> | ||
<% else %> | ||
<span class="visually-hidden">Page</span> <%= item[:page_number] %> | ||
<% end %> | ||
</a> | ||
<% pagination_items.each do |item| %> | ||
<li class="sage-pagination__item"> | ||
<%- if item[:is_link] -%> | ||
<a href="<%= item[:link_url] %>" class="sage-pagination__page<%= item[:is_disabled] ? " sage-pagination__page--disabled" : "" %><%= item[:is_current] ? " sage-pagination__page--current" : "" %>"<% if item[:is_disabled] %> aria-disabled="true"<% end %><% if item[:is_current] %> aria-current="page"<% end %>> | ||
<% if item[:is_prev] %> | ||
Back | ||
<% elsif item[:is_next] %> | ||
Next <span class="visually-hidden">Page</span> | ||
<% else %> | ||
<span class="visually-hidden">Page</span> <%= item[:page_number] %> | ||
<% end %> | ||
</a> | ||
<% end %> | ||
<%- if item[:is_gap] -%> | ||
<span class="sage-pagination__gap">…</span> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
<%- if item[:is_gap] -%> | ||
<span class="sage-pagination__gap">…</span> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</nav> |
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 |
---|---|---|
|
@@ -198,6 +198,7 @@ body { | |
@extend %t-sage-heading-6; | ||
} | ||
|
||
li:not([class]), | ||
p:not([class]) { | ||
@extend %t-sage-body; | ||
} | ||
|
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
27 changes: 27 additions & 0 deletions
27
lib/sage-frontend/stylesheets/system/patterns/elements/_indicator.scss
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,27 @@ | ||
|
||
$-indicator-size: rem(7px); | ||
|
||
.sage-indicator-list { | ||
display: flex; | ||
align-items: center; | ||
padding-left: 0; | ||
} | ||
|
||
.sage-indicator { | ||
overflow: hidden; | ||
width: $-indicator-size; | ||
height: $-indicator-size; | ||
border-radius: sage-border(radius-round); | ||
|
||
&:not(.sage-indicator--current) { | ||
background-color: sage-color(grey, 300); | ||
} | ||
|
||
&:not(:last-child) { | ||
margin-right: 8px; | ||
} | ||
} | ||
|
||
.sage-indicator--current { | ||
background-color: sage-color(grey, 500); | ||
} |
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