Skip to content

Commit d22b934

Browse files
authored
Fix width of table columns and fix some mistakes in Storybook (Netlify) (#1206)
* Allow wrapping of inline code in table cells and fix line-height * Fix mistakes and column width of tables * Fix typo for onChangePage and onChangeRowsPerPage * Remove generated class name, use !important The !important keyword is necessary because the generated class name that applies overriding styles has a higher specificity than the element tag selector.
1 parent 2b252c1 commit d22b934

File tree

4 files changed

+74
-69
lines changed

4 files changed

+74
-69
lines changed

.storybook/base.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ body {
77
table {
88
width: 100%;
99
}
10+
11+
code {
12+
line-height: unset !important;
13+
white-space: normal !important;
14+
}

stories/columns.stories.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ import { Meta } from '@storybook/addon-docs';
3535

3636
When the breakpoint is reached the column will be hidden. These are the built-in media breakpoint presets when hiding columns:
3737

38-
| Value | Breakpoint | Description |
39-
| ----- | ---------- | ------------------------- |
40-
| sm | 599px | small (phones) |
41-
| md | 959px | medium(landscape tablets) |
42-
| lg | 1280px | large(laptops/desktops) |
38+
| Value | Breakpoint | Description |
39+
| ----- | ---------- | -------------------------- |
40+
| `sm` | `599px` | small (phones) |
41+
| `md` | `959px` | medium (landscape tablets) |
42+
| `lg` | `1280px` | large (laptops/desktops) |
4343

4444
# Columns Example
4545

stories/conditionalFormatting.stories.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Meta } from '@storybook/addon-docs';
88
| ---------- | ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
99
| when | function: `row => row.<yourfield>` | yes | `when` accepts a callback that gives you access to your data. The `when` callback must return a boolean to determine if the style will be applied. <br />e.g. `row => row.status === 'completed'` will apply the style when the `row.status` field is `completed` |
1010
| style | `object` or `(row) => object` | no | Accepts a css-in-js [style object](https://www.styled-components.com/docs/advanced#style-objects). Alternativly, you can also specify callback that has access to the row props. e.g. `(row) => ({ backgroundColor: row.isSpecial ? 'pink' : inherit })` |
11-
| classNames | `string[]` | no | In some cases you may want to apply conditional classNames. Accepts an array of classes: e.g. ['class1', 'class2']. |
11+
| classNames | `string[]` | no | In some cases you may want to apply conditional classNames. Accepts an array of classes: e.g. `['class1', 'class2']`. |
1212

1313
A Conditional Style Object allows you to apply a specific `style` object based on you data:
1414

@@ -46,7 +46,7 @@ RDT allows you to override styling based on your data. Currently, you can apply
4646

4747
| Property | Type | Required | Default | Description |
4848
| -------------------- | ----- | -------- | ------- | ------------------------------------------------------------------------- |
49-
| conditionalRowStyles | array | no | [] | Allows an array of [conditional style objects](#conditional-style-object) |
49+
| conditionalRowStyles | array | no | `[]` | Allows an array of [conditional style objects](#conditional-style-object) |
5050

5151
## Example `style` Object
5252

0 commit comments

Comments
 (0)