diff --git a/packages/common/src/scss/components/_BlockRichTable.scss b/packages/common/src/scss/components/_BlockRichTable.scss index 43160953..cdf51c71 100644 --- a/packages/common/src/scss/components/_BlockRichTable.scss +++ b/packages/common/src/scss/components/_BlockRichTable.scss @@ -1,6 +1,3 @@ -// needed to @extend .BlockText -@import '@explorer-1/common/src/scss/components/BlockText'; - .BlockRichTable { table { @apply border-gray-light-mid border-t border-b border-collapse w-full; @@ -18,41 +15,12 @@ @apply text-gray-dark; } - tbody tr { - @apply table-row bg-white border-t border-gray-light-mid; - } - - .rich_text, - .link { - @extend .BlockText; - } - // Below selectors are extra-specific to ensure they take priority over the @extend-ed .BlockText styles. - td.rich_text p { - @apply mb-4; - } - - td.rich_text ol { - @apply pl-6 mb-4; - } - - td.rich_text ul { - @apply pl-6 mb-4 list-disc; - - li { - @apply p-0; + tbody { + tr { + @apply table-row bg-white border-t border-gray-light-mid; } - - li::before { - @apply hidden; + td { + @apply p-3 lg:p-5 align-top; } } - - td.rich_text ul li, - td.rich_text ol li { - @apply my-1; - } - - td.rich_text hr { - @apply my-4; - } } diff --git a/packages/vue/src/components/BlockRichTable/BlockRichTable.stories.js b/packages/vue/src/components/BlockRichTable/BlockRichTable.stories.js index 2eeeb8d6..c6b85ce3 100644 --- a/packages/vue/src/components/BlockRichTable/BlockRichTable.stories.js +++ b/packages/vue/src/components/BlockRichTable/BlockRichTable.stories.js @@ -1,4 +1,5 @@ import BlockRichTable from './BlockRichTable.vue' +import { BlockImageData } from './../BlockImage/BlockImage.stories' export default { title: 'Components/Blocks/BlockRichTable', @@ -8,63 +9,47 @@ export default { export const BlockRichTableData = { blockType: 'RichTableBlock', - table: `{ "data": { - "page": { - "body": [ - { - "blockType": "RichTableBlock", - "tableCaption": "table caption", - "tableContent": { - "tableHead": [ - [ - { - "text": "1. Learn why we study geology on Earth and other planets" - }, - { - "text": "1. Learn why we study geology on Earth and other planets" - } - ] - ], - "tableBody": [ - [ - { - "blockType": "ImageBlock", - "image": { - "caption": "NASA astronaut Kate Rubins uses a hand lens to observe the minerals present in a rock while taking part in the European Space Agency's PANGAEA geology training. Image credit: ESA–A. Romeo", - "url": "https://imagecache.jpl.nasa.gov/images/edu/activities/ediblerocks_learn_main-640x350.jpg" - } - }, - { - "blockType": "ImageBlock", - "image": { - "caption": "NASA astronaut Kate Rubins uses a hand lens to observe the minerals present in a rock while taking part in the European Space Agency's PANGAEA geology training. Image credit: ESA–A. Romeo", - "url": "https://imagecache.jpl.nasa.gov/images/edu/activities/ediblerocks_learn_main-640x350.jpg" - } - } - ], - [ - { - "blockType": "CharBlock", - "value": "Geologists are scientists who study a planet's solid features, like soil, rocks, and minerals. There are all kinds of rocks and minerals that make up our planet – as well as the Moon, Mars, and other rocky worlds. By studying these features, we can learn more about how rocky worlds form and change over time." - }, - { - "blockType": "CharBlock", - "value": "Geologists are scientists who study a planet's solid features, like soil, rocks, and minerals. There are all kinds of rocks and minerals that make up our planet – as well as the Moon, Mars, and other rocky worlds. By studying these features, we can learn more about how rocky worlds form and change over time." - } - ] - ] - } - } - ], - "breadcrumb": null - } - } - }` + tableCaption: 'table caption', + tableContent: { + tableHead: [ + [ + { + text: '1. Learn why we study geology on Earth and other planets' + }, + { + text: '1. Learn why we study geology on Earth and other planets' + } + ] + ], + tableBody: [ + [ + { + ...BlockImageData, + caption: '

My custom caption.

', + displayCaption: true, + blockType: 'ImageBlock' + }, + { ...BlockImageData, blockType: 'ImageBlock' } + ], + [ + { + blockType: 'CharBlock', + value: + "Geologists are scientists who study a planet's solid features, like soil, rocks, and minerals. There are all kinds of rocks and minerals that make up our planet – as well as the Moon, Mars, and other rocky worlds. By studying these features, we can learn more about how rocky worlds form and change over time." + }, + { + blockType: 'CharBlock', + value: + "Geologists are scientists who study a planet's solid features, like soil, rocks, and minerals. There are all kinds of rocks and minerals that make up our planet – as well as the Moon, Mars, and other rocky worlds. By studying these features, we can learn more about how rocky worlds form and change over time." + } + ] + ] + } } export const BaseStory = { name: 'BlockRichTable', args: { - data: BlockRichTableData + table: BlockRichTableData } } diff --git a/packages/vue/src/components/BlockRichTable/BlockRichTable.vue b/packages/vue/src/components/BlockRichTable/BlockRichTable.vue index 0ef42ff4..40cd07e3 100644 --- a/packages/vue/src/components/BlockRichTable/BlockRichTable.vue +++ b/packages/vue/src/components/BlockRichTable/BlockRichTable.vue @@ -1,40 +1,19 @@ @@ -42,13 +21,13 @@ export default defineComponent({ diff --git a/packages/vue/src/components/BlockStreamfield/BlockStreamfield.vue b/packages/vue/src/components/BlockStreamfield/BlockStreamfield.vue index 472cea4c..a3749340 100644 --- a/packages/vue/src/components/BlockStreamfield/BlockStreamfield.vue +++ b/packages/vue/src/components/BlockStreamfield/BlockStreamfield.vue @@ -188,7 +188,7 @@ indent="col-3" class="lg:mb-18 mb-10" > - +