File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 11<script >
2+ /**
3+ * @prop {boolean}
4+ * @description Whether the cell contains numeric data.
5+ */
26export let numeric = false
7+ /**
8+ * @prop {number}
9+ * @description The number of columns the cell spans.
10+ */
311export let colspan = 1
12+ /**
13+ * @prop {boolean}
14+ * @description Whether the cell has low contrast.
15+ */
16+ export let lowContrast = false
417 </script >
518
6- <td class ="mdc-data-table__cell {$$props .class || ' ' }" class:mdc-data-table __cell--numeric ={numeric } {colspan }
7- ><slot /></td
19+ <style >
20+ .lowContrast {
21+ color : var (--mdc-theme-text-secondary-on-light );
22+ }
23+ </style >
24+
25+ <td
26+ class ="mdc-data-table__cell {$$props .class || ' ' }"
27+ class:lowContrast
28+ class:mdc-data-table __cell--numeric ={numeric }
29+ {colspan }
830>
31+ <slot />
32+ </td >
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ declare module '@silintl/ui-components' {
8484 numeric ?: boolean
8585 colspan ?: number
8686 class ?: string
87+ lowContrast ?: boolean
8788 }
8889 export class Item extends SvelteComponentTyped < ItemProps > { }
8990 }
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ import { copyAndModifyArgs } from './helpers.js'
55
66const args = {
77 class: ' ' , // only works for global classes
8+ numeric: false ,
9+ colspan: 1 ,
10+ lowContrast: false ,
811}
912 </script >
1013
@@ -16,6 +19,8 @@ const args = {
1619
1720<Story name ="Default" {args } />
1821
19- <Story name ="Numberic" args ={copyAndModifyArgs (args , { numeric: ' true' })} />
22+ <Story name ="Numeric" args ={copyAndModifyArgs (args , { numeric: ' true' })} />
23+
24+ <Story name ="LowContrast" args ={copyAndModifyArgs (args , { lowContrast: ' true' })} />
2025
2126<Story name ="Colspan 1" args ={copyAndModifyArgs (args , { colspan: 1 })} />
You can’t perform that action at this time.
0 commit comments