diff --git a/packages/visualizations-react/stories/Table/Table.stories.tsx b/packages/visualizations-react/stories/Table/Table.stories.tsx index 8c4e82c0..19979409 100644 --- a/packages/visualizations-react/stories/Table/Table.stories.tsx +++ b/packages/visualizations-react/stories/Table/Table.stories.tsx @@ -92,3 +92,9 @@ CustomStyle.args = { data, options, }; + +export const Unstyled = Template.bind({}); +Unstyled.args = { + data, + options: { ...options, unstyled: true }, +}; diff --git a/packages/visualizations/src/components/Table/Body.svelte b/packages/visualizations/src/components/Table/Body.svelte index f059eb98..859d3489 100644 --- a/packages/visualizations/src/components/Table/Body.svelte +++ b/packages/visualizations/src/components/Table/Body.svelte @@ -19,3 +19,16 @@ {/each} + + diff --git a/packages/visualizations/src/components/Table/Cell.svelte b/packages/visualizations/src/components/Table/Cell.svelte index 5ba1ab4e..1a9a3ce3 100644 --- a/packages/visualizations/src/components/Table/Cell.svelte +++ b/packages/visualizations/src/components/Table/Cell.svelte @@ -3,3 +3,13 @@ {value} + + diff --git a/packages/visualizations/src/components/Table/Header.svelte b/packages/visualizations/src/components/Table/Header.svelte index 50d4a2bf..c7088191 100644 --- a/packages/visualizations/src/components/Table/Header.svelte +++ b/packages/visualizations/src/components/Table/Header.svelte @@ -13,3 +13,18 @@ {/each} + + diff --git a/packages/visualizations/src/components/Table/Table.svelte b/packages/visualizations/src/components/Table/Table.svelte index b555c9f2..dd63d270 100644 --- a/packages/visualizations/src/components/Table/Table.svelte +++ b/packages/visualizations/src/components/Table/Table.svelte @@ -14,18 +14,23 @@ const tableId = `table-${generateId()}`; $: ({ value: records } = data); - $: ({ columns, title, subtitle, description, source } = options); + // FIXME: Eslint is in conflict with prettier + // eslint-disable-next-line object-curly-newline + $: ({ columns, title, subtitle, description, source, unstyled } = options); + $: defaultStyle = !unstyled; -
-
- {#if title} -

{title}

- {/if} - {#if subtitle} -

{subtitle}

- {/if} -
+
+ {#if title || subtitle} +
+ {#if title} +

{title}

+ {/if} + {#if subtitle} +

{subtitle}

+ {/if} +
+ {/if}
@@ -42,8 +47,8 @@ {/if} - diff --git a/packages/visualizations/src/components/Table/types.ts b/packages/visualizations/src/components/Table/types.ts index 5eb2b00e..85ac5d31 100644 --- a/packages/visualizations/src/components/Table/types.ts +++ b/packages/visualizations/src/components/Table/types.ts @@ -13,4 +13,9 @@ export type TableOptions = { subtitle?: string; description?: string; source?: Source; + /** + * Removes all the presentational styles. + * Default is `false`. + */ + unstyled?: boolean; };