Skip to content

Commit

Permalink
feat(fn): introduce fn-table [ci visual] (#3165)
Browse files Browse the repository at this point in the history
* feat(fn): start on fn-table

* feat(fn): fn-table implementation, and some minor fixes on list story

* feat(fn): improve docs and small changes to css for fn-table

* feat(fn): new side nav structure

* feat(fn): allow empty [ci visual]

* feat(fn): pr comments

* feat(fn): remove selected hover

* feat(fn): allow empty [ci visual]
  • Loading branch information
mikerodonnell89 committed Feb 10, 2022
1 parent a2bcab1 commit 65f7a79
Show file tree
Hide file tree
Showing 7 changed files with 2,930 additions and 20 deletions.
3 changes: 3 additions & 0 deletions src/fn/_fn-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,6 @@ $fn-shadow-black-small: 0 0 2px rgba(0, 0, 0, 0.16), 0 4px 8px rgba(0, 0, 0, 0.1
$fn-shadow-black-medium: 0 0 2px rgba(0, 0, 0, 0.16), 0 8px 16px rgba(0, 0, 0, 0.16);
$fn-shadow-black-large: 0 0 2px rgba(0, 0, 0, 0.16), 0 16px 32px rgba(0, 0, 0, 0.16);
$fn-shadow-black-xl: 0 0 2px rgba(0, 0, 0, 0.16), 0 32px 64px rgba(0, 0, 0, 0.16);

// List / Table bottom border/box shadow
$fn-list-table-item-bottom-box-shadow: inset 0 -0.063rem 0;
18 changes: 16 additions & 2 deletions src/fn/fn-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $fn-list-item-box-shadow: 0 0 0 $fn-list-item-focus-margin;
height: 2.75rem;
min-width: 20rem;
background: $fn-color-white;
box-shadow: inset 0 -0.063rem 0 $fn-color-grey-100;
box-shadow: $fn-list-table-item-bottom-box-shadow $fn-color-grey-100;
}

&__group-header {
Expand All @@ -33,6 +33,8 @@ $fn-list-item-box-shadow: 0 0 0 $fn-list-item-focus-margin;

&__item {
@include fn-hover() {
@include fn-transition();

background: $fn-color-grey-50;
}

Expand All @@ -44,6 +46,8 @@ $fn-list-item-box-shadow: 0 0 0 $fn-list-item-focus-margin;

@include fn-not-focus-visible() {
@include fn-hover() {
@include fn-transition();

background: $fn-color-grey-50;
}
}
Expand All @@ -56,7 +60,13 @@ $fn-list-item-box-shadow: 0 0 0 $fn-list-item-focus-margin;

@include fn-selected() {
background: $fn-color-blue-100;
box-shadow: inset 0 -0.063rem 0 #0070f1;
box-shadow: $fn-list-table-item-bottom-box-shadow #0070f1;

@include fn-hover() {
@include fn-transition();

background: $fn-color-blue-2;
}
}

padding: $fn-list-item-margin 0.75rem;
Expand Down Expand Up @@ -96,6 +106,8 @@ $fn-list-item-box-shadow: 0 0 0 $fn-list-item-focus-margin;
box-shadow: none;

@include fn-hover() {
@include fn-transition();

background: $fn-color-teal-50;
}

Expand All @@ -109,6 +121,8 @@ $fn-list-item-box-shadow: 0 0 0 $fn-list-item-focus-margin;

@include fn-not-focus-visible() {
@include fn-hover() {
@include fn-transition();

background: $fn-color-teal-50;
}
}
Expand Down
182 changes: 182 additions & 0 deletions src/fn/fn-table.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
@import "./fn-settings";

$block: #{$fn-namespace}-table;
$fn-table-item-margin: 0.375rem;
$fn-table-item-box-shadow: 0 0 0 $fn-border-radius-2;

.#{$block} {
@include fn-reset();

width: 100%;
max-width: 100%;
border-collapse: collapse;

&__row {
@include fn-reset();

@include fn-selected() {
.#{$block}__cell {
background: $fn-color-blue-2;
box-shadow: $fn-list-table-item-bottom-box-shadow #0070f1;

@include fn-hover() {
@include fn-transition();

background: $fn-color-blue-2;
}
}
}
}

.#{$block}__text {
@include fn-reset();
@include fn-ellipsis();

word-break: break-word;
white-space: normal;

&--no-wrap {
white-space: nowrap;
}
}

&__cell,
&__group-header,
&__header {
@include fn-reset();

box-shadow: $fn-list-table-item-bottom-box-shadow #e4e5e7;
}

&__cell,
&__group-header {
background: $fn-color-white;
height: 2.75rem;
}

&__group-header,
&__header {
text-transform: uppercase;
text-align: start;
font-size: 0.75rem;
line-height: 1.125rem;
font-weight: bold;

.#{$block}__text--end {
@include fn-set-margin-left(auto);
}

.#{$block}__header-checkbox {
@include fn-set-margin-left(-0.25rem);
}
}

&__group-header {
padding: 1.25rem 0.75rem 0.375rem;
}

&__header {
background: $fn-color-grey-2;
height: 2rem;

@include fn-set-padding-left(1rem);

&:not(:first-of-type) {
@include fn-set-padding-left(0.75rem);
}
}

&__cell {
&:not(.fn-table__cell--no-hover) {
@include fn-hover() {
@include fn-transition();

background: $fn-color-grey-1;
}
}

@include fn-focus-visible() {
outline: none;
border-radius: $fn-border-radius-2;
position: relative;
}

@include fn-not-focus-visible() {
@include fn-hover() {
@include fn-transition();

background: $fn-color-grey-1;
}
}

@include fn-selected() {
background: $fn-color-blue-2;
box-shadow: $fn-list-table-item-bottom-box-shadow #0070f1;

@include fn-hover() {
@include fn-transition();

background: $fn-color-blue-2;
}
}

padding: $fn-table-item-margin 0.75rem;

@include fn-disabled() {
pointer-events: none;
opacity: $fn-disabled-opacity;
}

.fn-table__start-container:not(:first-child) {
@include fn-set-margin-left($fn-table-item-margin);
}

.#{$block}__text {
@include fn-reset();
@include fn-flex-vertical-center();

display: block;
color: $fn-color-grey-9;
}

&--byline {
@include fn-flex-vertical-center();

min-height: 3.75rem;

.#{$block}__start-container {
@include fn-reset();
@include fn-flex(column);

.#{$block}__byline-text, .#{$block}__byline-title {
@include fn-reset();
@include fn-ellipsis();

color: $fn-color-grey-9;
}

.#{$block}__byline-title {
font-weight: bold;
}

.#{$block}__byline-text {
font-size: 0.75rem;
line-height: 1rem;
}
}
}
}

&__end-container {
@include fn-reset();
@include fn-flex-vertical-center();

:not(:last-child) {
@include fn-set-margin-right($fn-table-item-margin);
}

button:first-child {
@include fn-set-margin-left(auto);
}
}
}
18 changes: 9 additions & 9 deletions stories/fn-list/__snapshots__/fn-list.stories.storyshot
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ exports[`Storyshots FN Components/List Byline List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--ghost"
class="fn-button fn-button--icon-only fn-button--secondary"
>


Expand All @@ -179,7 +179,7 @@ exports[`Storyshots FN Components/List Byline List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--ghost"
class="fn-button fn-button--icon-only fn-button--secondary"
>


Expand Down Expand Up @@ -236,7 +236,7 @@ exports[`Storyshots FN Components/List Byline List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--transparent"
class="fn-button fn-button--icon-only fn-button--layout"
>


Expand Down Expand Up @@ -288,7 +288,7 @@ exports[`Storyshots FN Components/List Byline List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--transparent"
class="fn-button fn-button--icon-only fn-button--layout"
>


Expand Down Expand Up @@ -570,7 +570,7 @@ exports[`Storyshots FN Components/List List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--ghost"
class="fn-button fn-button--icon-only fn-button--secondary"
>


Expand All @@ -583,7 +583,7 @@ exports[`Storyshots FN Components/List List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--ghost"
class="fn-button fn-button--icon-only fn-button--secondary"
>


Expand Down Expand Up @@ -620,7 +620,7 @@ exports[`Storyshots FN Components/List List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--transparent"
class="fn-button fn-button--icon-only fn-button--layout"
>


Expand Down Expand Up @@ -715,7 +715,7 @@ exports[`Storyshots FN Components/List List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--transparent"
class="fn-button fn-button--icon-only fn-button--layout"
>


Expand Down Expand Up @@ -827,7 +827,7 @@ exports[`Storyshots FN Components/List List 1`] = `


<button
class="fn-button fn-button--icon-only fn-button--transparent"
class="fn-button fn-button--icon-only fn-button--layout"
>


Expand Down

0 comments on commit 65f7a79

Please sign in to comment.