Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#551 Add support for Fieldset in Sheet #552

Merged
merged 2 commits into from
Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/clay/src/content/sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h3 class="autofit-row sheet-subtitle">
</span>
<span class="autofit-col">
<span class="heading-end">
<button class="btn btn-secondary btn-sm">Add</button>
<button class="btn btn-secondary btn-sm" type="button">Add</button>
</span>
</span>
</h3>
Expand All @@ -48,8 +48,8 @@ <h3 class="autofit-row autofit-float sheet-subtitle">
</span>
<span class="autofit-col autofit-col-end">
<span class="heading-end">
<button class="btn btn-secondary btn-sm">Add</button>
<button class="btn btn-secondary btn-sm">Remove</button>
<button class="btn btn-secondary btn-sm" type="button">Add</button>
<button class="btn btn-secondary btn-sm" type="button">Remove</button>
</span>
</span>
</h3>
Expand Down
120 changes: 120 additions & 0 deletions packages/clay/src/content/test_form_hierarchy.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,126 @@ <h4 class="sheet-tertiary-title">Second Level Section</h4>
</div>
</div>
</div>
<div class="sheet-section">
<h3 class="autofit-row sheet-subtitle">
<span class="autofit-col autofit-col-expand">
<span class="heading-text">Configuration Entries</span>
</span>
<span class="autofit-col">
<span class="heading-end">
<button class="btn btn-secondary btn-sm" type="button">Add</button>
</span>
</span>
</h3>
<div class="table-responsive">
<table class="table table-autofit table-nowrap">
<thead>
<tr>
<th class="table-cell-expand">Form Navigator Id</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td class="table-cell-expand">
<div class="table-title">
<span class="text-truncate-inline">
<a class="text-truncate" href="#1">Form Navigator Entry 1</a>
</span>
</div>
</td>
<td>
<div class="dropdown dropdown-action">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#1" id="dropdownAction1" role="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-ellipsis-v">
<use xlink:href="{{rootPath}}/images/icons/icons.svg#ellipsis-v" />
</svg>
</a>
<ul aria-labelledby="dropdownAction1" class="dropdown-menu dropdown-menu-right">
<li><a class="dropdown-item" href="#1" role="button">Remove</a></li>
<li><a class="dropdown-item" href="#1" role="button">Edit</a></li>
<li><a class="dropdown-item" href="#1" role="button">Move</a></li>
<li><a class="dropdown-item" href="#1" role="button">Checkout</a></li>
</ul>
</div>
</td>
</tr>
<tr>
<td class="table-cell-expand">
<div class="table-title">
<a href="#1">Form Navigator Entry 2</a>
</div>
</td>
<td>
<div class="dropdown dropdown-action">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#1" id="dropdownAction2" role="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-ellipsis-v">
<use xlink:href="{{rootPath}}/images/icons/icons.svg#ellipsis-v" />
</svg>
</a>
<ul aria-labelledby="dropdownAction2" class="dropdown-menu dropdown-menu-right">
<li><a class="dropdown-item" href="#1" role="button">Remove</a></li>
<li><a class="dropdown-item" href="#1" role="button">Edit</a></li>
<li><a class="dropdown-item" href="#1" role="button">Move</a></li>
<li><a class="dropdown-item" href="#1" role="button">Checkout</a></li>
</ul>
</div>
</td>
</tr>
<tr>
<td class="table-cell-expand">
<div class="table-title">
<a href="#1">Form Navigator Entry 3</a>
</div>
</td>
<td>
<div class="dropdown dropdown-action">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#1" id="dropdownAction3" role="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-ellipsis-v">
<use xlink:href="{{rootPath}}/images/icons/icons.svg#ellipsis-v" />
</svg>
</a>
<ul aria-labelledby="dropdownAction3" class="dropdown-menu dropdown-menu-right">
<li><a class="dropdown-item" href="#1" role="button">Remove</a></li>
<li><a class="dropdown-item" href="#1" role="button">Edit</a></li>
<li><a class="dropdown-item" href="#1" role="button">Move</a></li>
<li><a class="dropdown-item" href="#1" role="button">Checkout</a></li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sheet-section">
<fieldset>
<div class="sheet-section">
<h3 class="sheet-subtitle">Fieldset Nested in Sheet Section</h3>
<div class="form-group-autofit">
<div class="form-group-item">
<label for="inputLabel9">
Input Label 9
</label>
<input class="form-control" id="inputLabel9" type="text">
</div>
</div>
</div>
</fieldset>
</div>
<fieldset>
<div class="sheet-section">
<h3 class="sheet-subtitle">Sheet Section Nested in Fieldset</h3>
<div class="form-group-autofit">
<div class="form-group-item">
<label for="inputLabel10">
Input Label 10
</label>
<input class="form-control" id="inputLabel10" type="text">
</div>
</div>
</div>
</fieldset>
<div class="sheet-footer">
<button class="btn btn-primary" type="submit">Save changes</button>
<button class="btn btn-secondary" type="button">Cancel</button>
Expand Down
2 changes: 2 additions & 0 deletions packages/clay/src/scss/atlas/variables/_sheets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ $sheet-header-margin-bottom-mobile: 2rem !default; // 32px

$sheet-section-margin-bottom-mobile: 2rem !default; // 32px

$sheet-panel-group-margin-bottom-mobile: 1rem !default; // 16px

$sheet-footer-margin-bottom-mobile: 1rem !default; // 16px
$sheet-footer-margin-top-mobile: 1rem !default; // 16px

Expand Down
33 changes: 29 additions & 4 deletions packages/clay/src/scss/components/_sheets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,22 @@
padding-right: $sheet-padding-right;
padding-top: $sheet-padding-top;

.panel-group-flush .panel-body {
margin-bottom: $sheet-section-margin-bottom;
.panel-group {
&,
.panel:last-child .panel-body {
margin-bottom: $sheet-panel-group-margin-bottom;

@include clay-scale-component {
margin-bottom: $sheet-panel-group-margin-bottom-mobile;
}
}

@include clay-scale-component {
margin-bottom: $sheet-section-margin-bottom-mobile;
.panel-body {
margin-bottom: $sheet-section-margin-bottom;

@include clay-scale-component {
margin-bottom: $sheet-section-margin-bottom-mobile;
}
}
}
}
Expand All @@ -38,6 +49,20 @@
@include clay-scale-component {
margin-bottom: $sheet-section-margin-bottom-mobile;
}

> fieldset {
margin-bottom: -$sheet-section-margin-bottom;

@include clay-scale-component {
margin-bottom: -$sheet-section-margin-bottom-mobile;
}
}
}

fieldset {
+ .sheet-footer {
margin-top: 0;
}
}

.sheet-footer {
Expand Down
9 changes: 5 additions & 4 deletions packages/clay/src/scss/variables/_sheets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ $sheet-padding-top: 1.5rem !default; // 24px

// Sheet Header

$sheet-header-margin-bottom: 3rem !default; // 24px

$sheet-header-margin-bottom: 3rem !default; // 48px
$sheet-header-margin-bottom-mobile: null !default;

// Sheet Section

$sheet-section-margin-bottom: 3rem !default; // 24px

$sheet-section-margin-bottom: 3rem !default; // 48px
$sheet-section-margin-bottom-mobile: null !default;

$sheet-panel-group-margin-bottom: 1.5rem !default; // 24px
$sheet-panel-group-margin-bottom-mobile: null !default;

// Sheet Footer

$sheet-footer-margin-bottom: 1.5rem !default; // 24px
Expand Down