From 14dc6ec9297c09aea54c0fa906423cf534a9b429 Mon Sep 17 00:00:00 2001 From: Ola Date: Fri, 28 Aug 2020 10:12:39 +0200 Subject: [PATCH 1/8] move table, table-row & table-cell components to src --- {_src => src}/atoms/table-cell/TableCell.html | 0 {_src => src}/atoms/table-cell/TableCell.js | 0 {_src => src}/atoms/table-cell/TableCell.scss | 0 {_src => src}/atoms/table-cell/TableCell.vue | 0 {_src => src}/atoms/table-row/TableRow.html | 0 {_src => src}/atoms/table-row/TableRow.js | 0 {_src => src}/atoms/table-row/TableRow.scss | 0 {_src => src}/atoms/table-row/TableRow.vue | 0 {_src => src}/atoms/table/Table.html | 0 {_src => src}/atoms/table/Table.js | 0 {_src => src}/atoms/table/Table.scss | 0 {_src => src}/atoms/table/Table.selectors.json | 0 {_src => src}/atoms/table/Table.stories.js | 0 {_src => src}/atoms/table/Table.vue | 0 {_src => src}/atoms/table/mocks/bodyRows.json | 0 {_src => src}/atoms/table/mocks/footCells.json | 0 {_src => src}/atoms/table/mocks/headCells.json | 0 17 files changed, 0 insertions(+), 0 deletions(-) rename {_src => src}/atoms/table-cell/TableCell.html (100%) rename {_src => src}/atoms/table-cell/TableCell.js (100%) rename {_src => src}/atoms/table-cell/TableCell.scss (100%) rename {_src => src}/atoms/table-cell/TableCell.vue (100%) rename {_src => src}/atoms/table-row/TableRow.html (100%) rename {_src => src}/atoms/table-row/TableRow.js (100%) rename {_src => src}/atoms/table-row/TableRow.scss (100%) rename {_src => src}/atoms/table-row/TableRow.vue (100%) rename {_src => src}/atoms/table/Table.html (100%) rename {_src => src}/atoms/table/Table.js (100%) rename {_src => src}/atoms/table/Table.scss (100%) rename {_src => src}/atoms/table/Table.selectors.json (100%) rename {_src => src}/atoms/table/Table.stories.js (100%) rename {_src => src}/atoms/table/Table.vue (100%) rename {_src => src}/atoms/table/mocks/bodyRows.json (100%) rename {_src => src}/atoms/table/mocks/footCells.json (100%) rename {_src => src}/atoms/table/mocks/headCells.json (100%) diff --git a/_src /atoms/table-cell/TableCell.html b/src/atoms/table-cell/TableCell.html similarity index 100% rename from _src /atoms/table-cell/TableCell.html rename to src/atoms/table-cell/TableCell.html diff --git a/_src /atoms/table-cell/TableCell.js b/src/atoms/table-cell/TableCell.js similarity index 100% rename from _src /atoms/table-cell/TableCell.js rename to src/atoms/table-cell/TableCell.js diff --git a/_src /atoms/table-cell/TableCell.scss b/src/atoms/table-cell/TableCell.scss similarity index 100% rename from _src /atoms/table-cell/TableCell.scss rename to src/atoms/table-cell/TableCell.scss diff --git a/_src /atoms/table-cell/TableCell.vue b/src/atoms/table-cell/TableCell.vue similarity index 100% rename from _src /atoms/table-cell/TableCell.vue rename to src/atoms/table-cell/TableCell.vue diff --git a/_src /atoms/table-row/TableRow.html b/src/atoms/table-row/TableRow.html similarity index 100% rename from _src /atoms/table-row/TableRow.html rename to src/atoms/table-row/TableRow.html diff --git a/_src /atoms/table-row/TableRow.js b/src/atoms/table-row/TableRow.js similarity index 100% rename from _src /atoms/table-row/TableRow.js rename to src/atoms/table-row/TableRow.js diff --git a/_src /atoms/table-row/TableRow.scss b/src/atoms/table-row/TableRow.scss similarity index 100% rename from _src /atoms/table-row/TableRow.scss rename to src/atoms/table-row/TableRow.scss diff --git a/_src /atoms/table-row/TableRow.vue b/src/atoms/table-row/TableRow.vue similarity index 100% rename from _src /atoms/table-row/TableRow.vue rename to src/atoms/table-row/TableRow.vue diff --git a/_src /atoms/table/Table.html b/src/atoms/table/Table.html similarity index 100% rename from _src /atoms/table/Table.html rename to src/atoms/table/Table.html diff --git a/_src /atoms/table/Table.js b/src/atoms/table/Table.js similarity index 100% rename from _src /atoms/table/Table.js rename to src/atoms/table/Table.js diff --git a/_src /atoms/table/Table.scss b/src/atoms/table/Table.scss similarity index 100% rename from _src /atoms/table/Table.scss rename to src/atoms/table/Table.scss diff --git a/_src /atoms/table/Table.selectors.json b/src/atoms/table/Table.selectors.json similarity index 100% rename from _src /atoms/table/Table.selectors.json rename to src/atoms/table/Table.selectors.json diff --git a/_src /atoms/table/Table.stories.js b/src/atoms/table/Table.stories.js similarity index 100% rename from _src /atoms/table/Table.stories.js rename to src/atoms/table/Table.stories.js diff --git a/_src /atoms/table/Table.vue b/src/atoms/table/Table.vue similarity index 100% rename from _src /atoms/table/Table.vue rename to src/atoms/table/Table.vue diff --git a/_src /atoms/table/mocks/bodyRows.json b/src/atoms/table/mocks/bodyRows.json similarity index 100% rename from _src /atoms/table/mocks/bodyRows.json rename to src/atoms/table/mocks/bodyRows.json diff --git a/_src /atoms/table/mocks/footCells.json b/src/atoms/table/mocks/footCells.json similarity index 100% rename from _src /atoms/table/mocks/footCells.json rename to src/atoms/table/mocks/footCells.json diff --git a/_src /atoms/table/mocks/headCells.json b/src/atoms/table/mocks/headCells.json similarity index 100% rename from _src /atoms/table/mocks/headCells.json rename to src/atoms/table/mocks/headCells.json From 79fc1751da58c5169d2f06260532e8948b3aedad Mon Sep 17 00:00:00 2001 From: Ola Date: Fri, 28 Aug 2020 18:40:24 +0200 Subject: [PATCH 2/8] update table, table-row & table-cell components --- src/atoms/table-cell/TableCell.css | 72 ++++++++++++++++ src/atoms/table-cell/TableCell.scss | 109 ------------------------ src/atoms/table-cell/TableCell.vue | 3 +- src/atoms/table-row/TableRow.css | 38 +++++++++ src/atoms/table-row/TableRow.scss | 75 ----------------- src/atoms/table-row/TableRow.vue | 2 +- src/atoms/table/Table.css | 20 +++++ src/atoms/table/Table.scss | 22 ----- src/atoms/table/Table.stories.js | 126 ++++++++++++++-------------- src/atoms/table/Table.vue | 3 +- tailwind.config.js | 9 +- 11 files changed, 202 insertions(+), 277 deletions(-) create mode 100644 src/atoms/table-cell/TableCell.css delete mode 100644 src/atoms/table-cell/TableCell.scss create mode 100644 src/atoms/table-row/TableRow.css delete mode 100644 src/atoms/table-row/TableRow.scss create mode 100644 src/atoms/table/Table.css delete mode 100644 src/atoms/table/Table.scss diff --git a/src/atoms/table-cell/TableCell.css b/src/atoms/table-cell/TableCell.css new file mode 100644 index 000000000..80132f937 --- /dev/null +++ b/src/atoms/table-cell/TableCell.css @@ -0,0 +1,72 @@ +.table th { + @apply hidden; +} + +@screen md { + .table th { + @apply table-cell; + @apply p-4; + @apply bg-gray-100; + @apply border-r border-b border-solid border-light; + @apply text-left; + } + + .table th:last-child { + @apply border-r-0; + } +} + +.table td { + @apply flex; + @apply py-2 px-4; + @apply bg-white; +} + +@screen md { + .table td { + @apply table-cell; + @apply p-4; + @apply border-r border-b border-solid border-light; + } + + .table td:last-child { + @apply border-r-0; + } +} + +.table td::before { + content: attr(data-th); + + @apply block; + @apply max-w-1/4 mr-2; + @apply w-1/4; + @apply font-bold; +} + +@screen md { + .table td::before { + @apply hidden; + } +} + +.table tr:last-child td { + @apply border-b-0; +} + +.table tfoot td { + @apply block; + @apply py-2 px-4; + @apply bg-white; +} + +.table--odd-even tbody td { + @apply bg-transparent; +} + +@screen md { + .table tfoot td { + @apply table-cell; + @apply p-4; + @apply border-t border-r border-b-0 border-solid border-light; + } +} diff --git a/src/atoms/table-cell/TableCell.scss b/src/atoms/table-cell/TableCell.scss deleted file mode 100644 index fab60c456..000000000 --- a/src/atoms/table-cell/TableCell.scss +++ /dev/null @@ -1,109 +0,0 @@ -@import '../../../assets/styles/globals'; - -$table__padding : $spacer--medium !default; -$table__cell__padding: $spacer $table__padding !default; -$table__background : $white !default; -$table__th-background: $gray-lightest !default; -$table__border : 1px solid $gray-light !default; -$table__border-bottom: none !default; -$table__border-radius: $border-radius !default; - -.table { - th { - display: none; - - &:last-child { - @include mq($screen-m) { - border-right: 0; - } - } - - @include mq($screen-m) { - display: table-cell; - padding: $table__padding; - background: $table__th-background; - border-right: $table__border; - border-bottom: $table__border; - } - } - - tr { - &:last-child { - border-bottom: $table__border-bottom; - - td { - @include mq($screen-m) { - border-bottom: $table__border-bottom; - } - - &:first-child { - @include mq($screen-m) { - border-bottom-left-radius: $table__border-radius; - } - } - - &:last-child { - @include mq($screen-m) { - border-bottom-right-radius: $table__border-radius; - } - } - } - } - } - - td { - display: flex; - padding: $table__cell__padding; - background: $table__background; - - &::before { - display: block; - width: 25%; - max-width: 25%; - margin-right: 10px; - font-weight: bold; - content: attr(data-th); - - @include mq($screen-m) { - display: none; - } - } - - &:last-child { - @include mq($screen-m) { - border-right: 0; - } - } - - @include mq($screen-m) { - display: table-cell; - padding: $table__padding; - background: $table__background; - border-right: $table__border; - border-bottom: $table__border; - } - } - - tfoot { - tr { - td { - display: block; - padding: $table__cell__padding; - background: $table__background; - border-bottom: $table__border-bottom; - - @include mq($screen-m) { - display: table-cell; - padding: $table__padding; - background: $table__th-background; - border-top: $table__border; - border-right: $table__border; - } - } - - &:first-child { - border-top: $table__border; - } - } - } -} diff --git a/src/atoms/table-cell/TableCell.vue b/src/atoms/table-cell/TableCell.vue index f1f8fd4bd..c62912bcd 100644 --- a/src/atoms/table-cell/TableCell.vue +++ b/src/atoms/table-cell/TableCell.vue @@ -5,9 +5,8 @@ import ATableCell from './TableCell.js' export default { name: 'AlpacaTableCell', - mixins: [ATableCell] } -