@openedx/paragon 23.14.9 → 23.15.0
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/dist/Card/CardBody.d.ts +9 -0
- package/dist/Card/CardBody.js +0 -11
- package/dist/Card/CardBody.js.map +1 -1
- package/dist/Card/CardContext.d.ts +17 -0
- package/dist/Card/CardContext.js +8 -21
- package/dist/Card/CardContext.js.map +1 -1
- package/dist/Card/CardDivider.d.ts +7 -0
- package/dist/Card/CardDivider.js +2 -10
- package/dist/Card/CardDivider.js.map +1 -1
- package/dist/Card/CardFallbackDefaultImage.d.ts +1 -0
- package/dist/Card/CardFallbackDefaultImage.js +1 -0
- package/dist/Card/CardFallbackDefaultImage.js.map +1 -0
- package/dist/Card/CardGrid.d.ts +22 -0
- package/dist/Card/CardGrid.js +6 -31
- package/dist/Card/CardGrid.js.map +1 -1
- package/dist/DataTable/DataTableContext.d.ts +3 -0
- package/dist/DataTable/DataTableContext.js.map +1 -1
- package/dist/DataTable/TableCell.d.ts +14 -0
- package/dist/DataTable/TableCell.js +0 -12
- package/dist/DataTable/TableCell.js.map +1 -1
- package/dist/DataTable/TableHeaderCell.d.ts +26 -0
- package/dist/DataTable/TableHeaderCell.js +4 -32
- package/dist/DataTable/TableHeaderCell.js.map +1 -1
- package/dist/Menu/MenuItem.d.ts +17 -0
- package/dist/Menu/MenuItem.js +5 -27
- package/dist/Menu/MenuItem.js.map +1 -1
- package/dist/Menu/index.d.ts +16 -0
- package/dist/Menu/index.js +4 -24
- package/dist/Menu/index.js.map +1 -1
- package/dist/OverflowScroll/data/constants.d.ts +1 -0
- package/dist/OverflowScroll/data/constants.js +1 -0
- package/dist/OverflowScroll/data/constants.js.map +1 -0
- package/dist/PageBanner/index.d.ts +27 -0
- package/dist/PageBanner/index.js +5 -28
- package/dist/PageBanner/index.js.map +1 -1
- package/dist/Sheet/SheetContainer.js +30 -8
- package/dist/Sheet/SheetContainer.js.map +1 -1
- package/dist/Sheet/index.js +15 -5
- package/dist/Sheet/index.js.map +1 -1
- package/dist/Stack/index.d.ts +20 -0
- package/dist/Stack/index.js +3 -28
- package/dist/Stack/index.js.map +1 -1
- package/dist/Tabs/Tab.d.ts +19 -0
- package/dist/Tabs/Tab.js +0 -23
- package/dist/Tabs/Tab.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Card/CardBody.tsx +19 -0
- package/src/Card/{CardContext.jsx → CardContext.tsx} +24 -25
- package/src/Card/CardDivider.tsx +13 -0
- package/src/Card/{CardGrid.jsx → CardGrid.tsx} +28 -35
- package/src/DataTable/{TableCell.jsx → TableCell.tsx} +13 -15
- package/src/DataTable/{TableHeaderCell.jsx → TableHeaderCell.tsx} +32 -33
- package/src/Menu/MenuItem.tsx +49 -0
- package/src/Menu/{index.jsx → index.tsx} +18 -27
- package/src/PageBanner/{index.jsx → index.tsx} +27 -29
- package/src/Sheet/Sheet.test.jsx +63 -3
- package/src/Sheet/SheetContainer.jsx +34 -7
- package/src/Sheet/SheetContainer.test.jsx +34 -1
- package/src/Sheet/__snapshots__/Sheet.test.jsx.snap +15 -6
- package/src/Sheet/index.jsx +12 -2
- package/src/Stack/{index.jsx → index.tsx} +22 -35
- package/src/Tabs/{Tab.jsx → Tab.tsx} +10 -18
- package/src/index.ts +1 -2
- package/src/Card/CardBody.jsx +0 -23
- package/src/Card/CardDivider.jsx +0 -18
- package/src/Menu/MenuItem.jsx +0 -57
- /package/src/Card/{CardFallbackDefaultImage.js → CardFallbackDefaultImage.ts} +0 -0
- /package/src/DataTable/{DataTableContext.jsx → DataTableContext.tsx} +0 -0
- /package/src/OverflowScroll/data/{constants.js → constants.ts} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<Sheet /> snapshots blocking, left snapshot 1`] = `
|
|
4
|
-
<
|
|
4
|
+
<div
|
|
5
|
+
className="sheet-container"
|
|
6
|
+
data-testid="sheet-container"
|
|
7
|
+
>
|
|
5
8
|
<div
|
|
6
9
|
className="pgn__sheet-skrim"
|
|
7
10
|
role="presentation"
|
|
@@ -28,11 +31,14 @@ exports[`<Sheet /> snapshots blocking, left snapshot 1`] = `
|
|
|
28
31
|
/>
|
|
29
32
|
</div>
|
|
30
33
|
</focus-on>
|
|
31
|
-
</
|
|
34
|
+
</div>
|
|
32
35
|
`;
|
|
33
36
|
|
|
34
37
|
exports[`<Sheet /> snapshots dark, right snapshot 1`] = `
|
|
35
|
-
<
|
|
38
|
+
<div
|
|
39
|
+
className="sheet-container"
|
|
40
|
+
data-testid="sheet-container"
|
|
41
|
+
>
|
|
36
42
|
<div
|
|
37
43
|
className="pgn__sheet-skrim hidden"
|
|
38
44
|
role="presentation"
|
|
@@ -59,11 +65,14 @@ exports[`<Sheet /> snapshots dark, right snapshot 1`] = `
|
|
|
59
65
|
/>
|
|
60
66
|
</div>
|
|
61
67
|
</focus-on>
|
|
62
|
-
</
|
|
68
|
+
</div>
|
|
63
69
|
`;
|
|
64
70
|
|
|
65
71
|
exports[`<Sheet /> snapshots default args snapshot: bottom, show, light 1`] = `
|
|
66
|
-
<
|
|
72
|
+
<div
|
|
73
|
+
className="sheet-container"
|
|
74
|
+
data-testid="sheet-container"
|
|
75
|
+
>
|
|
67
76
|
<div
|
|
68
77
|
className="pgn__sheet-skrim hidden"
|
|
69
78
|
role="presentation"
|
|
@@ -96,5 +105,5 @@ exports[`<Sheet /> snapshots default args snapshot: bottom, show, light 1`] = `
|
|
|
96
105
|
</div>
|
|
97
106
|
</div>
|
|
98
107
|
</focus-on>
|
|
99
|
-
</
|
|
108
|
+
</div>
|
|
100
109
|
`;
|
package/src/Sheet/index.jsx
CHANGED
|
@@ -26,13 +26,16 @@ class Sheet extends React.Component {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
renderSheet() {
|
|
29
|
-
const {
|
|
29
|
+
const {
|
|
30
|
+
children, position, variant, className,
|
|
31
|
+
} = this.props;
|
|
30
32
|
return (
|
|
31
33
|
<div
|
|
32
34
|
className={classNames(
|
|
33
35
|
'pgn__sheet-component',
|
|
34
36
|
`pgn__sheet__${variant}`,
|
|
35
37
|
position,
|
|
38
|
+
className,
|
|
36
39
|
)}
|
|
37
40
|
role="alert"
|
|
38
41
|
aria-live="polite"
|
|
@@ -50,12 +53,13 @@ class Sheet extends React.Component {
|
|
|
50
53
|
blocking,
|
|
51
54
|
show,
|
|
52
55
|
onClose,
|
|
56
|
+
containerClassName,
|
|
53
57
|
} = this.props;
|
|
54
58
|
if (!show) {
|
|
55
59
|
return null;
|
|
56
60
|
}
|
|
57
61
|
return (
|
|
58
|
-
<SheetContainer>
|
|
62
|
+
<SheetContainer className={classNames(containerClassName)}>
|
|
59
63
|
<div
|
|
60
64
|
className={classNames(
|
|
61
65
|
'pgn__sheet-skrim',
|
|
@@ -80,6 +84,10 @@ Sheet.propTypes = {
|
|
|
80
84
|
blocking: PropTypes.bool,
|
|
81
85
|
/** an element rendered inside the sheet */
|
|
82
86
|
children: PropTypes.node,
|
|
87
|
+
/** A class that is appended to the sheet container element. */
|
|
88
|
+
containerClassName: PropTypes.string,
|
|
89
|
+
/** A class that is appended to the sheet element. */
|
|
90
|
+
className: PropTypes.string,
|
|
83
91
|
/** a string designating the sheet's position on the window */
|
|
84
92
|
position: PropTypes.oneOf([
|
|
85
93
|
POSITIONS.left,
|
|
@@ -102,6 +110,8 @@ Sheet.defaultProps = {
|
|
|
102
110
|
show: true,
|
|
103
111
|
onClose: () => {},
|
|
104
112
|
variant: VARIANTS.light,
|
|
113
|
+
containerClassName: undefined,
|
|
114
|
+
className: undefined,
|
|
105
115
|
};
|
|
106
116
|
|
|
107
117
|
export default Sheet;
|
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { forwardRef, ForwardedRef } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
interface StackProps {
|
|
5
|
+
/** Specifies the content of the `Stack`. */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** Specifies direction of the children blocks (column/row). */
|
|
8
|
+
direction?: 'horizontal' | 'vertical';
|
|
9
|
+
/**
|
|
10
|
+
* Specifies inner space between children blocks.
|
|
11
|
+
*
|
|
12
|
+
* Valid values are based on `the spacing classes`:
|
|
13
|
+
* `0, 0.5, ... 6`.
|
|
14
|
+
*/
|
|
15
|
+
gap?: number;
|
|
16
|
+
/** Specifies the order of the children. */
|
|
17
|
+
reversed?: boolean;
|
|
18
|
+
/** Specifies an additional `className` to add to the base element. */
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
9
21
|
|
|
10
22
|
const Stack = forwardRef(({
|
|
11
|
-
direction,
|
|
12
|
-
gap,
|
|
13
|
-
reversed,
|
|
23
|
+
direction = 'vertical',
|
|
24
|
+
gap = 0,
|
|
25
|
+
reversed = false,
|
|
14
26
|
children,
|
|
15
27
|
className,
|
|
16
28
|
...rest
|
|
17
|
-
}, ref) => (
|
|
29
|
+
}: StackProps, ref: ForwardedRef<HTMLDivElement>) => (
|
|
18
30
|
<div
|
|
19
31
|
ref={ref}
|
|
20
32
|
className={classNames(
|
|
@@ -29,29 +41,4 @@ const Stack = forwardRef(({
|
|
|
29
41
|
</div>
|
|
30
42
|
));
|
|
31
43
|
|
|
32
|
-
Stack.propTypes = {
|
|
33
|
-
/** Specifies the content of the `Stack`. */
|
|
34
|
-
children: PropTypes.node.isRequired,
|
|
35
|
-
/** Specifies direction of the children blocks (column/row). */
|
|
36
|
-
direction: PropTypes.oneOf(DIRECTION_VARIANTS),
|
|
37
|
-
/**
|
|
38
|
-
* Specifies inner space between children blocks.
|
|
39
|
-
*
|
|
40
|
-
* Valid values are based on `the spacing classes`:
|
|
41
|
-
* `0, 0.5, ... 6`.
|
|
42
|
-
*/
|
|
43
|
-
gap: PropTypes.number,
|
|
44
|
-
/** Specifies the order of the children. */
|
|
45
|
-
reversed: PropTypes.bool,
|
|
46
|
-
/** Specifies an additional `className` to add to the base element. */
|
|
47
|
-
className: PropTypes.string,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
Stack.defaultProps = {
|
|
51
|
-
direction: 'vertical',
|
|
52
|
-
gap: 0,
|
|
53
|
-
className: undefined,
|
|
54
|
-
reversed: false,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
44
|
export default Stack;
|
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import BaseTab from 'react-bootstrap/Tab';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
return <BaseTab {...props} />;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
Tab.propTypes = {
|
|
4
|
+
interface TabProps {
|
|
10
5
|
/** Specifies the `Tab` navigation title. */
|
|
11
|
-
title:
|
|
6
|
+
title: React.ReactNode;
|
|
12
7
|
/** Specifies notification bubble content. It appears on the top right of the `Tab`. */
|
|
13
|
-
notification
|
|
8
|
+
notification?: React.ReactNode;
|
|
14
9
|
/** Specifies whether `Tab` is disabled. */
|
|
15
|
-
disabled
|
|
10
|
+
disabled?: boolean;
|
|
16
11
|
/**
|
|
17
12
|
* A unique identifier for the Component, the `eventKey` makes it distinguishable
|
|
18
13
|
* from others in a set. Similar to React's `key` prop, in that it only needs to be
|
|
19
14
|
* unique amongst the Components siblings, not globally.
|
|
20
15
|
*/
|
|
21
|
-
eventKey
|
|
16
|
+
eventKey?: string | number;
|
|
22
17
|
/** Specifies class name to append to the base element. */
|
|
23
|
-
tabClassName
|
|
24
|
-
}
|
|
18
|
+
tabClassName?: string;
|
|
19
|
+
}
|
|
25
20
|
|
|
26
|
-
Tab
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
eventKey: undefined,
|
|
30
|
-
tabClassName: undefined,
|
|
31
|
-
};
|
|
21
|
+
function Tab(props: TabProps) {
|
|
22
|
+
return <BaseTab {...props} />;
|
|
23
|
+
}
|
|
32
24
|
|
|
33
25
|
export default Tab;
|
package/src/index.ts
CHANGED
|
@@ -42,6 +42,7 @@ export { default as ModalLayer } from './Modal/ModalLayer';
|
|
|
42
42
|
export { default as Overlay, OverlayTrigger } from './Overlay';
|
|
43
43
|
export { default as Portal } from './Modal/Portal';
|
|
44
44
|
export { default as Spinner } from './Spinner';
|
|
45
|
+
export { default as Stack } from './Stack';
|
|
45
46
|
export { default as Toast, TOAST_CLOSE_LABEL_TEXT, TOAST_DELAY } from './Toast';
|
|
46
47
|
export { default as Tooltip } from './Tooltip';
|
|
47
48
|
export { default as useWindowSize, type WindowSizeData } from './hooks/useWindowSizeHook';
|
|
@@ -217,8 +218,6 @@ export { default as CardView } from './DataTable/CardView';
|
|
|
217
218
|
// @ts-ignore: has yet to be converted to TypeScript
|
|
218
219
|
export { default as Skeleton, SkeletonTheme } from './Skeleton/index';
|
|
219
220
|
// @ts-ignore: has yet to be converted to TypeScript
|
|
220
|
-
export { default as Stack } from './Stack';
|
|
221
|
-
// @ts-ignore: has yet to be converted to TypeScript
|
|
222
221
|
export { default as ToggleButton, ToggleButtonGroup } from './ToggleButton';
|
|
223
222
|
// @ts-ignore: has yet to be converted to TypeScript
|
|
224
223
|
export { default as Sticky } from './Sticky';
|
package/src/Card/CardBody.jsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
const CardBody = React.forwardRef(({ className, children, ...rest }, ref) => (
|
|
6
|
-
<div className={classNames('pgn__card-body', className)} ref={ref} {...rest}>
|
|
7
|
-
{children}
|
|
8
|
-
</div>
|
|
9
|
-
));
|
|
10
|
-
|
|
11
|
-
CardBody.propTypes = {
|
|
12
|
-
/** Specifies the content of the component. */
|
|
13
|
-
children: PropTypes.node,
|
|
14
|
-
/** The class to append to the base element. */
|
|
15
|
-
className: PropTypes.string,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
CardBody.defaultProps = {
|
|
19
|
-
children: undefined,
|
|
20
|
-
className: undefined,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default CardBody;
|
package/src/Card/CardDivider.jsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
const CardDivider = React.forwardRef(({ className, ...props }, ref) => (
|
|
6
|
-
<div className={classNames('pgn__card-divider', className)} ref={ref} {...props} />
|
|
7
|
-
));
|
|
8
|
-
|
|
9
|
-
CardDivider.propTypes = {
|
|
10
|
-
/** Specifies class name to append to the base element. */
|
|
11
|
-
className: PropTypes.string,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
CardDivider.defaultProps = {
|
|
15
|
-
className: undefined,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default CardDivider;
|
package/src/Menu/MenuItem.jsx
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import Icon from '../Icon';
|
|
5
|
-
|
|
6
|
-
function MenuItem({
|
|
7
|
-
as,
|
|
8
|
-
children,
|
|
9
|
-
defaultSelected,
|
|
10
|
-
iconAfter,
|
|
11
|
-
iconBefore,
|
|
12
|
-
...props
|
|
13
|
-
}) {
|
|
14
|
-
const className = classNames(props.className, 'pgn__menu-item');
|
|
15
|
-
|
|
16
|
-
return React.createElement(
|
|
17
|
-
as,
|
|
18
|
-
{
|
|
19
|
-
...props,
|
|
20
|
-
className,
|
|
21
|
-
},
|
|
22
|
-
(
|
|
23
|
-
<>
|
|
24
|
-
{iconBefore && <Icon className="btn-icon-before" src={iconBefore} />}
|
|
25
|
-
<span className="pgn__menu-item-text">{children}</span>
|
|
26
|
-
<span className="pgn__menu-item-content-spacer" />
|
|
27
|
-
{iconAfter && <Icon className="btn-icon-after" src={iconAfter} />}
|
|
28
|
-
</>
|
|
29
|
-
),
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
MenuItem.propTypes = {
|
|
34
|
-
/** Specifies that this ``MenuItem`` is selected inside the ``SelectMenu`` */
|
|
35
|
-
defaultSelected: PropTypes.bool,
|
|
36
|
-
/** Specifies class name to append to the base element */
|
|
37
|
-
className: PropTypes.string,
|
|
38
|
-
/** Specifies the content of the ``MenuItem`` */
|
|
39
|
-
children: PropTypes.node,
|
|
40
|
-
/** Specifies the base element */
|
|
41
|
-
as: PropTypes.elementType,
|
|
42
|
-
/** Specifies the jsx before the content of the ``MenuItem`` */
|
|
43
|
-
iconBefore: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),
|
|
44
|
-
/** Specifies the jsx after the content of the ``MenuItem`` */
|
|
45
|
-
iconAfter: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
MenuItem.defaultProps = {
|
|
49
|
-
defaultSelected: false,
|
|
50
|
-
as: 'button',
|
|
51
|
-
className: undefined,
|
|
52
|
-
children: null,
|
|
53
|
-
iconBefore: undefined,
|
|
54
|
-
iconAfter: undefined,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default MenuItem;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|