@openedx/paragon 23.0.0 → 23.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/Card/CardFallbackDefaultImage.js +1 -0
- package/dist/Card/CardImageCap.js +1 -1
- package/dist/Card/CardImageCap.js.map +1 -1
- package/dist/core.css +4 -4
- package/dist/core.css.map +1 -1
- package/dist/light.css +4 -4
- package/dist/light.css.map +1 -1
- package/package.json +2 -2
- package/src/Card/CardFallbackDefaultImage.js +1 -0
- package/src/Card/CardImageCap.jsx +1 -1
- package/src/Card/tests/CardImageCap.test.jsx +3 -3
- package/styles/css/core/custom-media-breakpoints.css +2 -2
- package/styles/css/core/variables.css +2 -2
- package/styles/css/themes/light/utility-classes.css +2 -2
- package/styles/css/themes/light/variables.css +2 -2
- package/tokens/style-dictionary.js +2 -2
- package/dist/Card/fallback-default.png +0 -0
- package/src/Card/fallback-default.png +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openedx/paragon",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.1.1",
|
|
4
4
|
"description": "Accessible, responsive UI component library based on Bootstrap.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@babel/preset-env": "^7.16.8",
|
|
116
116
|
"@babel/preset-react": "^7.16.7",
|
|
117
117
|
"@babel/preset-typescript": "^7.16.7",
|
|
118
|
-
"@edx/eslint-config": "^4.
|
|
118
|
+
"@edx/eslint-config": "^4.3.0",
|
|
119
119
|
"@edx/stylelint-config-edx": "^2.3.0",
|
|
120
120
|
"@edx/typescript-config": "^1.1.0",
|
|
121
121
|
"@formatjs/cli": "^5.0.2",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const cardSrcFallbackImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXwAAACMCAYAAAB/AhJnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH6SURBVHgB7dRBEYBADACxwuDf5j0QUXywiYhc7zk7APzd3gNAgvABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIp4BaNpp2Q/3/wfPkGyXOQAAAABJRU5ErkJggg==';
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import Skeleton from 'react-loading-skeleton';
|
|
5
5
|
import CardContext from './CardContext';
|
|
6
|
-
import cardSrcFallbackImg from './
|
|
6
|
+
import { cardSrcFallbackImg } from './CardFallbackDefaultImage';
|
|
7
7
|
|
|
8
8
|
const SKELETON_HEIGHT_VALUE = 140;
|
|
9
9
|
const LOGO_SKELETON_HEIGHT_VALUE = 41;
|
|
@@ -3,6 +3,7 @@ import renderer from 'react-test-renderer';
|
|
|
3
3
|
import { render, fireEvent, screen } from '@testing-library/react';
|
|
4
4
|
import CardImageCap from '../CardImageCap';
|
|
5
5
|
import CardContext from '../CardContext';
|
|
6
|
+
import { cardSrcFallbackImg } from '../CardFallbackDefaultImage';
|
|
6
7
|
|
|
7
8
|
// eslint-disable-next-line react/prop-types
|
|
8
9
|
function CardImageCapWrapper({ orientation = 'vertical', isLoading, ...props }) {
|
|
@@ -119,13 +120,12 @@ describe('<CardImageCap />', () => {
|
|
|
119
120
|
expect(logoImg.className).toEqual('pgn__card-logo-cap');
|
|
120
121
|
});
|
|
121
122
|
|
|
122
|
-
it('
|
|
123
|
+
it('renders the default image if both src and fallbackSrc fail to load', () => {
|
|
123
124
|
render(<CardImageCapWrapper src="fakeURL" fallbackSrc="fakeURL" srcAlt="Src alt text" />);
|
|
124
125
|
|
|
125
126
|
const srcImg = screen.getByAltText('Src alt text');
|
|
126
127
|
fireEvent.load(srcImg);
|
|
127
128
|
fireEvent.error(srcImg);
|
|
128
|
-
|
|
129
|
-
expect(srcImg.src.endsWith('test-file-stub')).toEqual(true);
|
|
129
|
+
expect(srcImg.src).toEqual(cardSrcFallbackImg);
|
|
130
130
|
});
|
|
131
131
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
* See <
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
* See <PARAGON_ROOT>/tokens/README.md for more details.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
@custom-media --pgn-size-breakpoint-min-width-xs (min-width: 0px);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
* See <
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
* See <PARAGON_ROOT>/tokens/README.md for more details.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
:root {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
* See <
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
* See <PARAGON_ROOT>/tokens/README.md for more details.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
.bg-accent-a {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
* See <
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
* See <PARAGON_ROOT>/tokens/README.md for more details.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
:root {
|
|
@@ -410,8 +410,8 @@ const initializeStyleDictionary = async ({ themes }) => {
|
|
|
410
410
|
StyleDictionary.registerFileHeader({
|
|
411
411
|
name: 'customFileHeader',
|
|
412
412
|
fileHeader: (defaultMessage) => [
|
|
413
|
-
`${defaultMessage}
|
|
414
|
-
'See <
|
|
413
|
+
`${defaultMessage}`,
|
|
414
|
+
'See <PARAGON_ROOT>/tokens/README.md for more details.',
|
|
415
415
|
],
|
|
416
416
|
});
|
|
417
417
|
|
|
Binary file
|
|
Binary file
|