Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PPDSC-2779): Improve handling of OrderedList paragraph scenario #612

Merged
merged 2 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ For detailed information on how to run the automated tests, please visit [Testin
* [View NewsKit Design System npm package](https://www.npmjs.com/package/newskit)
* [Github repository](https://github.com/newscorp-ghfb/newskit)
* [Medium](https://medium.com/newskit-design-system)
* [Storybook](https://storybook.newskit.co.uk/)
* [Storybook](https://storybook.newskit.co.uk/)
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ exports[`OrderedList renders with defaults 1`] = `
font-weight: 400;
letter-spacing: 0;
padding: 0.5px 0px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

.emotion-1 svg {
Expand Down Expand Up @@ -112,6 +116,10 @@ exports[`OrderedList renders with invalid nodes 1`] = `
font-weight: 400;
letter-spacing: 0;
padding: 0.5px 0px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

.emotion-1 svg {
Expand Down Expand Up @@ -185,6 +193,10 @@ exports[`OrderedList renders with logical props 1`] = `
font-weight: 400;
letter-spacing: 0;
padding: 0.5px 0px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

.emotion-1 svg {
Expand Down Expand Up @@ -261,6 +273,10 @@ exports[`OrderedList renders with overrides 1`] = `
font-weight: 400;
letter-spacing: 0;
padding: 0.5px 0px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

.emotion-1::before {
Expand Down
5 changes: 4 additions & 1 deletion src/ordered-list/__tests__/ordered-list.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import {StorybookHeading} from '../../test/storybook-comps';
import {ThemeProvider, CreateThemeArgs} from '../../theme';
import {createCustomThemeWithBaseThemeSwitch} from '../../test/theme-select-object';

const listData = [`alpha`, `bravo`, `charlie`, `delta`, `echo`, `foxtrot`];
const sentence =
'A paragraph is a short part of a text, consisting of at least one sentence and beginning on a new line. It usually deals with a single event and is indicated by a new line, indentation or numbering.';
const paragraph = `${sentence} ${sentence} ${sentence}`;
const listData = [`alpha`, `bravo`, `charlie`, `delta`, paragraph, `foxtrot`];

const orderedListCustomThemeObject: CreateThemeArgs = {
name: 'my-custom-ordered-list',
Expand Down
1 change: 1 addition & 0 deletions src/ordered-list/ordered-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const ListItem = styled.li<OrderedListItemProps>`
${getTypographyPreset('orderedList.content', 'content', {
withCrop: true,
})}
display: flex;
&::before {
content: counter(item-counter) '. ';
${getStylePreset('orderedList.counter', 'counter')}
Expand Down