Skip to content

Commit

Permalink
feat(table): agent - add the table component with its pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
JLou committed Mar 12, 2024
1 parent a46eb01 commit be058d7
Show file tree
Hide file tree
Showing 24 changed files with 1,468 additions and 3 deletions.
148 changes: 148 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/css/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { addons } from '@storybook/addons';
import logo from './css3.svg'
import logo from './css3.svg';

addons.setConfig({
theme: {
Expand Down
1 change: 1 addition & 0 deletions packages/css/src/Form/Select/Select.agent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
position: absolute;
top: 50%;
right: 1em;
height: 0.7em; /* when using pure svgs */
font-size: 0.7em;
transform: translateY(-50%);
}
Expand Down
78 changes: 78 additions & 0 deletions packages/css/src/Table/Pager.agent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@use "../common/common.agent.scss" as common;

/* stylelint-disable no-descending-specificity */
.af-pager {
&__pagination {
display: flex;
margin: 0;
padding: 0;
flex-wrap: wrap;
align-items: center;
justify-content: center;
list-style: none;
}

&__item {
border-radius: common.rem(25px);
font-size: 0.9375rem;

&--active {
min-width: 1.9rem;
height: 1.9rem;
text-align: center;
color: common.$white;
background: common.$color-axa;

&:hover {
background: common.$color-azur;
}

.af-pager__item-link {
color: common.$white;
}
}

&-link,
&-nolink {
display: inline-flex;
padding: 0.3em 0.5rem;
color: common.$color-pager-link;
}

&-text {
text-decoration: underline;
}

&-icon {
margin: 0 0.5rem;

&:hover {
text-decoration: none;
}
}
}
}

@include common.media-breakpoint-down(xs) {
.af-paging__pager {
margin-top: 2rem;
}

.af-paging__limit {
width: 100%;
margin: 1rem auto;
text-align: center;

[class^="col"] {
width: inherit;
padding: inherit;
flex-basis: inherit;
flex-grow: inherit;
}

.af-form__group {
justify-content: space-evenly;
}
}
}
/* stylelint-enable no-descending-specificity */
61 changes: 61 additions & 0 deletions packages/css/src/Table/Paging.agent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@use "../common/common.agent.scss" as common;
@use "../Form/Select/Select.agent.scss";

.af-paging {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-start;

&__limit {
margin-top: 2rem;
order: 2;
color: common.$color-pager-link;

.af-form__group {
margin: 0;
font-size: 0.9375rem;

&-label {
font-weight: normal;
}

.af-form__input-select {
padding: 2px 29px 2px 14px;
}
}
}

&__pager {
flex-basis: 100%;
order: 1;
}
}

@include common.media-breakpoint-up(md) {
.af-paging {
&__limit {
margin: 0;
flex-basis: 40%;
order: 1;
}

&__pager {
flex-basis: 60%;
order: 2;
}
}
}
@include common.media-breakpoint-up(xl) {
.af-paging {
&__limit {
flex-basis: 30%;
order: 1;
}

&__pager {
flex-basis: 70%;
order: 2;
}
}
}
72 changes: 72 additions & 0 deletions packages/css/src/Table/Table.agent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@use "../common/common.agent.scss" as common;

/* stylelint-disable no-descending-specificity */

.af-table {
width: 100%;
margin-bottom: 2rem;
border-spacing: 0;
border-collapse: collapse;
background: common.$white;
box-shadow: 0 0 20px rgba(0, 0, 0, 20%);

&-th {
font-weight: common.$table-head-font-weight;
}

&__th {
position: relative;
height: 100%;
padding: 1rem;
font-size: 1rem;
font-weight: common.$table-head-font-weight;
text-align: left;
color: common.$white;
background: common.$color-azur;
box-shadow: 0 0 1px 1px common.$white;

&--sortable {
padding: 0;
}

.af-link {
color: common.$white;

&:hover {
color: common.$white;
}
}

.glyphicon {
position: relative;
inset: 0;
font-size: 0.7rem;
transform: none;
}
}

&__tr {
height: 100%;

&:nth-child(2n + 1) {
.af-table {
&__cell {
background-color: common.$color-wild-sand;
}
}
}
}

&__cell {
padding: 0.5rem 1rem;
border: 1px solid transparent;
border-right-color: common.$color-silver;
font-size: 0.9375rem;
text-align: left;

&:nth-last-child(1) {
border-right: 0;
}
}
}
/* stylelint-enable no-descending-specificity */
Loading

0 comments on commit be058d7

Please sign in to comment.