@openedx/paragon 23.22.1 → 23.23.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/README.md +25 -54
- package/dist/Alert/index.js +0 -1
- package/dist/Alert/index.js.map +1 -1
- package/dist/Card/BaseCard.d.ts +7 -0
- package/dist/Card/BaseCard.js +0 -21
- package/dist/Card/BaseCard.js.map +1 -1
- package/dist/Chip/ChipIcon.d.ts +7 -18
- package/dist/Chip/ChipIcon.js +2 -17
- package/dist/Chip/ChipIcon.js.map +1 -1
- package/dist/Chip/index.js +6 -2
- package/dist/Chip/index.js.map +1 -1
- package/dist/Modal/ModalDialogHeader.d.ts +3 -0
- package/dist/Modal/ModalDialogHeader.js +0 -13
- package/dist/Modal/ModalDialogHeader.js.map +1 -1
- package/dist/Overlay/index.d.ts +86 -123
- package/dist/Overlay/index.js +25 -123
- package/dist/Overlay/index.js.map +1 -1
- package/dist/Tooltip/index.d.ts +16 -0
- package/dist/Tooltip/index.js +4 -48
- package/dist/Tooltip/index.js.map +1 -1
- package/lib/__tests__/build-scss.test.js +1 -1
- package/lib/__tests__/install-theme.test.js +2 -2
- package/lib/install-theme.js +1 -1
- package/package.json +4 -4
- package/src/Alert/index.tsx +0 -1
- package/src/Card/BaseCard.tsx +7 -21
- package/src/Chip/ChipIcon.tsx +16 -24
- package/src/Chip/index.tsx +8 -4
- package/src/Modal/ModalDialogHeader.tsx +5 -17
- package/src/Overlay/index.tsx +88 -120
- package/src/Tooltip/index.tsx +21 -69
package/dist/Overlay/index.d.ts
CHANGED
|
@@ -1,128 +1,91 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type OverlayProps } from 'react-bootstrap/Overlay';
|
|
1
|
+
import { type OverlayProps, type OverlayChildren, type Placement } from 'react-bootstrap/Overlay';
|
|
3
2
|
import { type OverlayTriggerProps, type OverlayTriggerType } from 'react-bootstrap/OverlayTrigger';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
transition: PropTypes.Requireable<NonNullable<boolean | object | null | undefined>>;
|
|
56
|
-
};
|
|
57
|
-
var defaultProps: {
|
|
58
|
-
container: undefined;
|
|
59
|
-
onEnter: undefined;
|
|
60
|
-
onEntered: undefined;
|
|
61
|
-
onEntering: undefined;
|
|
62
|
-
onExit: undefined;
|
|
63
|
-
onExited: undefined;
|
|
64
|
-
onExiting: undefined;
|
|
65
|
-
onHide: undefined;
|
|
66
|
-
placement: string;
|
|
67
|
-
popperConfig: {};
|
|
68
|
-
rootClose: boolean;
|
|
69
|
-
rootCloseEvent: undefined;
|
|
70
|
-
show: boolean;
|
|
71
|
-
target: undefined;
|
|
72
|
-
transition: React.ForwardRefExoticComponent<import("react-bootstrap/Fade").FadeProps & React.RefAttributes<import("react-transition-group/Transition").default<any>>>;
|
|
73
|
-
};
|
|
3
|
+
export interface ParagonOverlayProps extends Omit<OverlayProps, 'target'> {
|
|
4
|
+
/** Specifies the content of the `Overlay`. */
|
|
5
|
+
children: OverlayChildren;
|
|
6
|
+
/**
|
|
7
|
+
* A component instance, DOM node, or function that returns either.
|
|
8
|
+
* The overlay will be positioned in relation to the target.
|
|
9
|
+
*/
|
|
10
|
+
container?: OverlayProps['container'];
|
|
11
|
+
/** Callback fired before the `Overlay` transitions in. */
|
|
12
|
+
onEnter?: (node: HTMLElement, isAppearing: boolean) => any;
|
|
13
|
+
/** Callback fired after the `Overlay` finishes transitioning in. */
|
|
14
|
+
onEntered?: (node: HTMLElement, isAppearing: boolean) => any;
|
|
15
|
+
/** Callback fired as the `Overlay` begins to transition in. */
|
|
16
|
+
onEntering?: (node: HTMLElement, isAppearing: boolean) => any;
|
|
17
|
+
/** Callback fired right before the `Overlay` transitions out. */
|
|
18
|
+
onExit?: (node: HTMLElement) => any;
|
|
19
|
+
/** Callback fired after the `Overlay` finishes transitioning out. */
|
|
20
|
+
onExited?: (node: HTMLElement) => any;
|
|
21
|
+
/** Callback fired as the Overlay begins to transition out. */
|
|
22
|
+
onExiting?: (node: HTMLElement) => any;
|
|
23
|
+
/**
|
|
24
|
+
* A callback invoked by the overlay when it wishes to be hidden.
|
|
25
|
+
* Required if `rootClose` is specified.
|
|
26
|
+
*/
|
|
27
|
+
onHide?: (e: Event) => void;
|
|
28
|
+
/**
|
|
29
|
+
* The placement of the `Overlay` in relation to its target.
|
|
30
|
+
*
|
|
31
|
+
* Valid values are: `auto`, `auto-start`, `auto-end`, `top`, `bottom`, `right`, `left`,
|
|
32
|
+
* `top-start`, `top-end`, `bottom-start`, `bottom-end`, `right-start`, `right-end`, `left-start`, `left-end`.
|
|
33
|
+
*/
|
|
34
|
+
placement?: Placement;
|
|
35
|
+
/** A set of popper options and props passed directly to `Popper`. */
|
|
36
|
+
popperConfig?: OverlayProps['popperConfig'];
|
|
37
|
+
/** Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay. */
|
|
38
|
+
rootClose?: boolean;
|
|
39
|
+
/** Specify event for triggering a "root close" toggle. */
|
|
40
|
+
rootCloseEvent?: OverlayProps['rootCloseEvent'];
|
|
41
|
+
/** Set the visibility of the `Overlay`. */
|
|
42
|
+
show?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The target element the `Overlay` is positioned in relation to.
|
|
45
|
+
* Note: this is marked optional for backwards compatibility, but it is required for the overlay to work,
|
|
46
|
+
* and the upstream types mark it as required.
|
|
47
|
+
*/
|
|
48
|
+
target?: OverlayProps['target'];
|
|
49
|
+
/**
|
|
50
|
+
* Animate the entering and exiting of the Overlay. `true` will use the `<Fade>` transition,
|
|
51
|
+
* or a custom react-transition-group `<Transition>` component can be provided.
|
|
52
|
+
*/
|
|
53
|
+
transition?: OverlayProps['transition'];
|
|
74
54
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* Controls `onToggle`.
|
|
108
|
-
*/
|
|
109
|
-
show: PropTypes.Requireable<boolean>;
|
|
110
|
-
target: PropTypes.Requireable<EventTarget>;
|
|
111
|
-
/** Specify which action or actions trigger `Overlay` visibility. */
|
|
112
|
-
trigger: PropTypes.Requireable<NonNullable<OverlayTriggerType | (OverlayTriggerType | null | undefined)[] | null | undefined>>;
|
|
113
|
-
};
|
|
114
|
-
var defaultProps: {
|
|
115
|
-
defaultShow: boolean;
|
|
116
|
-
delay: undefined;
|
|
117
|
-
flip: undefined;
|
|
118
|
-
onHide: undefined;
|
|
119
|
-
onToggle: undefined;
|
|
120
|
-
placement: undefined;
|
|
121
|
-
popperConfig: {};
|
|
122
|
-
show: undefined;
|
|
123
|
-
target: undefined;
|
|
124
|
-
trigger: string[];
|
|
125
|
-
};
|
|
55
|
+
export interface ParagonOverlayTriggerProps extends OverlayTriggerProps {
|
|
56
|
+
/** Specifies the content of the `OverlayTrigger`. */
|
|
57
|
+
children: OverlayTriggerProps['children'];
|
|
58
|
+
/** An element or text to overlay next to the target. */
|
|
59
|
+
overlay: OverlayTriggerProps['overlay'];
|
|
60
|
+
/** The initial visibility state of the `Overlay`. */
|
|
61
|
+
defaultShow?: boolean;
|
|
62
|
+
/** A millisecond delay amount to show and hide the `Overlay` once triggered. */
|
|
63
|
+
delay?: OverlayTriggerProps['delay'];
|
|
64
|
+
/** The initial flip state of the `Overlay`. */
|
|
65
|
+
flip?: boolean;
|
|
66
|
+
/** Callback fired when the visibility of the overlay changes. */
|
|
67
|
+
onHide?: OverlayTriggerProps['onHide'];
|
|
68
|
+
/**
|
|
69
|
+
* A callback that fires when the user triggers a change in tooltip visibility.
|
|
70
|
+
* `onToggle` is called with the desired next show, and generally should be
|
|
71
|
+
* passed back to the `show` prop. `onToggle` fires after the configured `delay`.
|
|
72
|
+
*/
|
|
73
|
+
onToggle?: OverlayTriggerProps['onToggle'];
|
|
74
|
+
/** The placement of the `Overlay` in relation to its target. */
|
|
75
|
+
placement?: Placement;
|
|
76
|
+
/** A `Popper.js` config object passed to the underlying popper instance. */
|
|
77
|
+
popperConfig?: OverlayTriggerProps['popperConfig'];
|
|
78
|
+
/**
|
|
79
|
+
* The visibility of the `Overlay`. `show` is a controlled prop so should be
|
|
80
|
+
* paired with `onToggle` to avoid breaking user interactions.
|
|
81
|
+
*/
|
|
82
|
+
show?: boolean;
|
|
83
|
+
/** The target element the `Overlay` is positioned in relation to. */
|
|
84
|
+
target?: OverlayTriggerProps['target'];
|
|
85
|
+
/** Specify which action or actions trigger `Overlay` visibility. */
|
|
86
|
+
trigger?: OverlayTriggerType | OverlayTriggerType[];
|
|
126
87
|
}
|
|
88
|
+
declare function Overlay({ placement, popperConfig, rootClose, show, transition, ...props }: ParagonOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
declare function OverlayTrigger({ defaultShow, popperConfig, trigger, ...props }: ParagonOverlayTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
127
90
|
export { OverlayTrigger };
|
|
128
91
|
export default Overlay;
|
package/dist/Overlay/index.js
CHANGED
|
@@ -2,141 +2,43 @@ import React from 'react';
|
|
|
2
2
|
import BaseOverlay from 'react-bootstrap/Overlay';
|
|
3
3
|
import BaseOverlayTrigger from 'react-bootstrap/OverlayTrigger';
|
|
4
4
|
import Fade from 'react-bootstrap/Fade';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
5
|
|
|
7
|
-
// Note: The only thing this file adds to the base
|
|
6
|
+
// Note: The only thing this file adds to the base components is default prop values.
|
|
8
7
|
// As more Paragon consumers adopt TypeScript, we could consider removing almost all of this code
|
|
9
8
|
// and just re-export the Overlay and OverlayTrigger components from react-bootstrap unmodified.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function Overlay({
|
|
11
|
+
placement = 'top',
|
|
12
|
+
popperConfig = {},
|
|
13
|
+
rootClose = false,
|
|
14
|
+
show = false,
|
|
15
|
+
transition = Fade,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
14
18
|
return /*#__PURE__*/React.createElement(BaseOverlay, {
|
|
19
|
+
placement: placement,
|
|
20
|
+
popperConfig: popperConfig,
|
|
21
|
+
rootClose: rootClose,
|
|
22
|
+
show: show,
|
|
23
|
+
transition: transition
|
|
24
|
+
// `target` is currently optional for Paragon consumers, but react-bootstrap types it as required.
|
|
25
|
+
,
|
|
15
26
|
...props
|
|
16
27
|
});
|
|
17
28
|
}
|
|
18
|
-
function OverlayTrigger(
|
|
29
|
+
function OverlayTrigger({
|
|
30
|
+
defaultShow = false,
|
|
31
|
+
popperConfig = {},
|
|
32
|
+
trigger = ['hover', 'focus'],
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
19
35
|
return /*#__PURE__*/React.createElement(BaseOverlayTrigger, {
|
|
36
|
+
defaultShow: defaultShow,
|
|
37
|
+
popperConfig: popperConfig,
|
|
38
|
+
trigger: trigger,
|
|
20
39
|
...props
|
|
21
40
|
}, props.children);
|
|
22
41
|
}
|
|
23
|
-
const triggerType = PropTypes.oneOf(TRIGGER_VARIANTS);
|
|
24
|
-
Overlay.propTypes = {
|
|
25
|
-
/** Specifies the content of the `Overlay`. */
|
|
26
|
-
children: PropTypes.node.isRequired,
|
|
27
|
-
/**
|
|
28
|
-
* A component instance, DOM node, or function that returns either.
|
|
29
|
-
* The overlay will be positioned in relation to the target.
|
|
30
|
-
*/
|
|
31
|
-
container: PropTypes.oneOfType([PropTypes.elementType, PropTypes.func]),
|
|
32
|
-
/** Callback fired before the `Overlay` transitions in. */
|
|
33
|
-
onEnter: PropTypes.func,
|
|
34
|
-
/** Callback fired after the `Overlay` finishes transitioning in. */
|
|
35
|
-
onEntered: PropTypes.func,
|
|
36
|
-
/** Callback fired as the `Overlay` begins to transition in. */
|
|
37
|
-
onEntering: PropTypes.func,
|
|
38
|
-
/** Callback fired right before the `Overlay` transitions out */
|
|
39
|
-
onExit: PropTypes.func,
|
|
40
|
-
/** Callback fired after the `Overlay` finishes transitioning out. */
|
|
41
|
-
onExited: PropTypes.func,
|
|
42
|
-
/** Callback fired as the Overlay begins to transition out. */
|
|
43
|
-
onExiting: PropTypes.func,
|
|
44
|
-
/**
|
|
45
|
-
* A callback invoked by the overlay when it wishes to be hidden.
|
|
46
|
-
* Required if `rootClose` is specified.
|
|
47
|
-
*/
|
|
48
|
-
onHide: PropTypes.func,
|
|
49
|
-
/** The placement of the `Overlay` in relation to it's target. */
|
|
50
|
-
placement: PropTypes.oneOf(PLACEMENT_VARIANTS),
|
|
51
|
-
/** A set of popper options and props passed directly to `Popper`. */
|
|
52
|
-
popperConfig: PropTypes.shape({}),
|
|
53
|
-
/** Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay. */
|
|
54
|
-
rootClose: PropTypes.bool,
|
|
55
|
-
/** Specify event for triggering a “root close” toggle. */
|
|
56
|
-
rootCloseEvent: PropTypes.oneOf(['click', 'mousedown']),
|
|
57
|
-
/** Set the visibility of the `Overlay`. */
|
|
58
|
-
show: PropTypes.bool,
|
|
59
|
-
/**
|
|
60
|
-
* The visibility of the `Overlay`. `show` is a controlled prop so should
|
|
61
|
-
* be paired with `onToggle` to avoid breaking user interactions.
|
|
62
|
-
*
|
|
63
|
-
* Manually toggling show does not wait for delay to change the visibility.
|
|
64
|
-
*
|
|
65
|
-
* Controls `onToggle`.
|
|
66
|
-
*/
|
|
67
|
-
target: PropTypes.oneOfType([PropTypes.elementType, PropTypes.func]),
|
|
68
|
-
/**
|
|
69
|
-
* Animate the entering and exiting of the Overlay. `true` will use the `<Fade>` transition,
|
|
70
|
-
* or a custom react-transition-group `<Transition>` component can be provided.
|
|
71
|
-
*/
|
|
72
|
-
transition: PropTypes.oneOfType([PropTypes.object, PropTypes.bool])
|
|
73
|
-
};
|
|
74
|
-
OverlayTrigger.propTypes = {
|
|
75
|
-
/** Specifies the content of the `OverlayTrigger`. */
|
|
76
|
-
children: PropTypes.oneOfType([PropTypes.element, PropTypes.func]).isRequired,
|
|
77
|
-
/** An element or text to overlay next to the target. */
|
|
78
|
-
overlay: PropTypes.oneOfType([PropTypes.element, PropTypes.func]).isRequired,
|
|
79
|
-
/** The initial visibility state of the `Overlay`. */
|
|
80
|
-
defaultShow: PropTypes.bool,
|
|
81
|
-
/** A millisecond delay amount to show and hide the `Overlay` once triggered. */
|
|
82
|
-
delay: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({})]),
|
|
83
|
-
/** The initial flip state of the `Overlay`. */
|
|
84
|
-
flip: PropTypes.bool,
|
|
85
|
-
onHide: PropTypes.func,
|
|
86
|
-
/**
|
|
87
|
-
* A callback that fires when the user triggers a change in tooltip visibility.
|
|
88
|
-
* `onToggle` is called with the desired next show, and generally should be
|
|
89
|
-
* passed back to the `show` prop. `onToggle` fires after the configured `delay`.
|
|
90
|
-
*
|
|
91
|
-
* Controls `show`.
|
|
92
|
-
*/
|
|
93
|
-
onToggle: PropTypes.func,
|
|
94
|
-
/** The placement of the `Overlay` in relation to it's target. */
|
|
95
|
-
placement: PropTypes.oneOf(PLACEMENT_VARIANTS),
|
|
96
|
-
/** A `Popper.js` config object passed to the the underlying popper instance. */
|
|
97
|
-
popperConfig: PropTypes.shape({}),
|
|
98
|
-
/**
|
|
99
|
-
* The visibility of the `Overlay`. `show` is a controlled prop so should
|
|
100
|
-
* be paired with `onToggle` to avoid breaking user interactions.
|
|
101
|
-
*
|
|
102
|
-
* Manually toggling show does not wait for delay to change the visibility.
|
|
103
|
-
*
|
|
104
|
-
* Controls `onToggle`.
|
|
105
|
-
*/
|
|
106
|
-
show: PropTypes.bool,
|
|
107
|
-
target: PropTypes.instanceOf(EventTarget),
|
|
108
|
-
/** Specify which action or actions trigger `Overlay` visibility. */
|
|
109
|
-
trigger: PropTypes.oneOfType([triggerType, PropTypes.arrayOf(triggerType)])
|
|
110
|
-
};
|
|
111
|
-
Overlay.defaultProps = {
|
|
112
|
-
container: undefined,
|
|
113
|
-
onEnter: undefined,
|
|
114
|
-
onEntered: undefined,
|
|
115
|
-
onEntering: undefined,
|
|
116
|
-
onExit: undefined,
|
|
117
|
-
onExited: undefined,
|
|
118
|
-
onExiting: undefined,
|
|
119
|
-
onHide: undefined,
|
|
120
|
-
placement: 'top',
|
|
121
|
-
popperConfig: {},
|
|
122
|
-
rootClose: false,
|
|
123
|
-
rootCloseEvent: undefined,
|
|
124
|
-
show: false,
|
|
125
|
-
target: undefined,
|
|
126
|
-
transition: Fade
|
|
127
|
-
};
|
|
128
|
-
OverlayTrigger.defaultProps = {
|
|
129
|
-
defaultShow: false,
|
|
130
|
-
delay: undefined,
|
|
131
|
-
flip: undefined,
|
|
132
|
-
onHide: undefined,
|
|
133
|
-
onToggle: undefined,
|
|
134
|
-
placement: undefined,
|
|
135
|
-
popperConfig: {},
|
|
136
|
-
show: undefined,
|
|
137
|
-
target: undefined,
|
|
138
|
-
trigger: ['hover', 'focus']
|
|
139
|
-
};
|
|
140
42
|
export { OverlayTrigger };
|
|
141
43
|
export default Overlay;
|
|
142
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","BaseOverlay","BaseOverlayTrigger","Fade","PropTypes","PLACEMENT_VARIANTS","TRIGGER_VARIANTS","Overlay","props","createElement","OverlayTrigger","children","triggerType","oneOf","propTypes","node","isRequired","container","oneOfType","elementType","func","onEnter","onEntered","onEntering","onExit","onExited","onExiting","onHide","placement","popperConfig","shape","rootClose","bool","rootCloseEvent","show","target","transition","object","element","overlay","defaultShow","delay","number","flip","onToggle","instanceOf","EventTarget","trigger","arrayOf","defaultProps","undefined"],"sources":["../../src/Overlay/index.tsx"],"sourcesContent":["import React from 'react';\nimport BaseOverlay, { type OverlayProps, type Placement } from 'react-bootstrap/Overlay';\nimport BaseOverlayTrigger, { type OverlayTriggerProps, type OverlayTriggerType } from 'react-bootstrap/OverlayTrigger';\nimport Fade from 'react-bootstrap/Fade';\nimport PropTypes from 'prop-types';\n\n// Note: The only thing this file adds to the base component is propTypes validation.\n// As more Paragon consumers adopt TypeScript, we could consider removing almost all of this code\n// and just re-export the Overlay and OverlayTrigger components from react-bootstrap unmodified.\n\nconst PLACEMENT_VARIANTS: Placement[] = [\n 'auto-start',\n 'auto',\n 'auto-end',\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n\nconst TRIGGER_VARIANTS: OverlayTriggerType[] = [\n 'hover',\n 'click',\n 'focus',\n];\n\nfunction Overlay(props: OverlayProps) {\n return <BaseOverlay {...props} />;\n}\nfunction OverlayTrigger(props: OverlayTriggerProps) {\n return (\n <BaseOverlayTrigger {...props}>\n {props.children}\n </BaseOverlayTrigger>\n );\n}\n\nconst triggerType = PropTypes.oneOf(TRIGGER_VARIANTS);\n\nOverlay.propTypes = {\n /** Specifies the content of the `Overlay`. */\n children: PropTypes.node.isRequired,\n /**\n * A component instance, DOM node, or function that returns either.\n * The overlay will be positioned in relation to the target.\n */\n container: PropTypes.oneOfType([PropTypes.elementType, PropTypes.func]),\n /** Callback fired before the `Overlay` transitions in. */\n onEnter: PropTypes.func,\n /** Callback fired after the `Overlay` finishes transitioning in. */\n onEntered: PropTypes.func,\n /** Callback fired as the `Overlay` begins to transition in. */\n onEntering: PropTypes.func,\n /** Callback fired right before the `Overlay` transitions out */\n onExit: PropTypes.func,\n /** Callback fired after the `Overlay` finishes transitioning out. */\n onExited: PropTypes.func,\n /** Callback fired as the Overlay begins to transition out. */\n onExiting: PropTypes.func,\n /**\n * A callback invoked by the overlay when it wishes to be hidden.\n * Required if `rootClose` is specified.\n */\n onHide: PropTypes.func,\n /** The placement of the `Overlay` in relation to it's target. */\n placement: PropTypes.oneOf(PLACEMENT_VARIANTS),\n /** A set of popper options and props passed directly to `Popper`. */\n popperConfig: PropTypes.shape({}),\n /** Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay. */\n rootClose: PropTypes.bool,\n /** Specify event for triggering a “root close” toggle. */\n rootCloseEvent: PropTypes.oneOf(['click', 'mousedown']),\n /** Set the visibility of the `Overlay`. */\n show: PropTypes.bool,\n /**\n * The visibility of the `Overlay`. `show` is a controlled prop so should\n * be paired with `onToggle` to avoid breaking user interactions.\n *\n * Manually toggling show does not wait for delay to change the visibility.\n *\n * Controls `onToggle`.\n */\n target: PropTypes.oneOfType([PropTypes.elementType, PropTypes.func]),\n /**\n * Animate the entering and exiting of the Overlay. `true` will use the `<Fade>` transition,\n * or a custom react-transition-group `<Transition>` component can be provided.\n */\n transition: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),\n};\n\nOverlayTrigger.propTypes = {\n /** Specifies the content of the `OverlayTrigger`. */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.func]).isRequired,\n /** An element or text to overlay next to the target. */\n overlay: PropTypes.oneOfType([PropTypes.element, PropTypes.func]).isRequired,\n /** The initial visibility state of the `Overlay`. */\n defaultShow: PropTypes.bool,\n /** A millisecond delay amount to show and hide the `Overlay` once triggered. */\n delay: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({})]),\n /** The initial flip state of the `Overlay`. */\n flip: PropTypes.bool,\n onHide: PropTypes.func,\n /**\n * A callback that fires when the user triggers a change in tooltip visibility.\n * `onToggle` is called with the desired next show, and generally should be\n * passed back to the `show` prop. `onToggle` fires after the configured `delay`.\n *\n * Controls `show`.\n */\n onToggle: PropTypes.func,\n /** The placement of the `Overlay` in relation to it's target. */\n placement: PropTypes.oneOf(PLACEMENT_VARIANTS),\n /** A `Popper.js` config object passed to the the underlying popper instance. */\n popperConfig: PropTypes.shape({}),\n /**\n * The visibility of the `Overlay`. `show` is a controlled prop so should\n * be paired with `onToggle` to avoid breaking user interactions.\n *\n * Manually toggling show does not wait for delay to change the visibility.\n *\n * Controls `onToggle`.\n */\n show: PropTypes.bool,\n target: PropTypes.instanceOf(EventTarget),\n /** Specify which action or actions trigger `Overlay` visibility. */\n trigger: PropTypes.oneOfType([triggerType, PropTypes.arrayOf(triggerType)]),\n};\n\nOverlay.defaultProps = {\n container: undefined,\n onEnter: undefined,\n onEntered: undefined,\n onEntering: undefined,\n onExit: undefined,\n onExited: undefined,\n onExiting: undefined,\n onHide: undefined,\n placement: 'top',\n popperConfig: {},\n rootClose: false,\n rootCloseEvent: undefined,\n show: false,\n target: undefined,\n transition: Fade,\n};\n\nOverlayTrigger.defaultProps = {\n defaultShow: false,\n delay: undefined,\n flip: undefined,\n onHide: undefined,\n onToggle: undefined,\n placement: undefined,\n popperConfig: {},\n show: undefined,\n target: undefined,\n trigger: ['hover', 'focus'],\n};\n\nexport { OverlayTrigger };\nexport default Overlay;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAA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AE,CAAC,OAAO,EAAE,OAAO;AAC5B,CAAC;AAED,SAASrC,cAAc;AACvB,eAAeH,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","BaseOverlay","BaseOverlayTrigger","Fade","Overlay","placement","popperConfig","rootClose","show","transition","props","createElement","OverlayTrigger","defaultShow","trigger","children"],"sources":["../../src/Overlay/index.tsx"],"sourcesContent":["import React from 'react';\nimport BaseOverlay, { type OverlayProps, type OverlayChildren, type Placement } from 'react-bootstrap/Overlay';\nimport BaseOverlayTrigger, { type OverlayTriggerProps, type OverlayTriggerType } from 'react-bootstrap/OverlayTrigger';\nimport Fade from 'react-bootstrap/Fade';\n\n// Note: The only thing this file adds to the base components is default prop values.\n// As more Paragon consumers adopt TypeScript, we could consider removing almost all of this code\n// and just re-export the Overlay and OverlayTrigger components from react-bootstrap unmodified.\n\nexport interface ParagonOverlayProps extends Omit<OverlayProps, 'target'> {\n /** Specifies the content of the `Overlay`. */\n children: OverlayChildren;\n /**\n * A component instance, DOM node, or function that returns either.\n * The overlay will be positioned in relation to the target.\n */\n container?: OverlayProps['container'];\n /** Callback fired before the `Overlay` transitions in. */\n onEnter?: (node: HTMLElement, isAppearing: boolean) => any;\n /** Callback fired after the `Overlay` finishes transitioning in. */\n onEntered?: (node: HTMLElement, isAppearing: boolean) => any;\n /** Callback fired as the `Overlay` begins to transition in. */\n onEntering?: (node: HTMLElement, isAppearing: boolean) => any;\n /** Callback fired right before the `Overlay` transitions out. */\n onExit?: (node: HTMLElement) => any;\n /** Callback fired after the `Overlay` finishes transitioning out. */\n onExited?: (node: HTMLElement) => any;\n /** Callback fired as the Overlay begins to transition out. */\n onExiting?: (node: HTMLElement) => any;\n /**\n * A callback invoked by the overlay when it wishes to be hidden.\n * Required if `rootClose` is specified.\n */\n onHide?: (e: Event) => void;\n /**\n * The placement of the `Overlay` in relation to its target.\n *\n * Valid values are: `auto`, `auto-start`, `auto-end`, `top`, `bottom`, `right`, `left`,\n * `top-start`, `top-end`, `bottom-start`, `bottom-end`, `right-start`, `right-end`, `left-start`, `left-end`.\n */\n placement?: Placement;\n /** A set of popper options and props passed directly to `Popper`. */\n popperConfig?: OverlayProps['popperConfig'];\n /** Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay. */\n rootClose?: boolean;\n /** Specify event for triggering a \"root close\" toggle. */\n rootCloseEvent?: OverlayProps['rootCloseEvent'];\n /** Set the visibility of the `Overlay`. */\n show?: boolean;\n /**\n * The target element the `Overlay` is positioned in relation to.\n * Note: this is marked optional for backwards compatibility, but it is required for the overlay to work,\n * and the upstream types mark it as required.\n */\n target?: OverlayProps['target'];\n /**\n * Animate the entering and exiting of the Overlay. `true` will use the `<Fade>` transition,\n * or a custom react-transition-group `<Transition>` component can be provided.\n */\n transition?: OverlayProps['transition'];\n}\n\nexport interface ParagonOverlayTriggerProps extends OverlayTriggerProps {\n /** Specifies the content of the `OverlayTrigger`. */\n children: OverlayTriggerProps['children'];\n /** An element or text to overlay next to the target. */\n overlay: OverlayTriggerProps['overlay'];\n /** The initial visibility state of the `Overlay`. */\n defaultShow?: boolean;\n /** A millisecond delay amount to show and hide the `Overlay` once triggered. */\n delay?: OverlayTriggerProps['delay'];\n /** The initial flip state of the `Overlay`. */\n flip?: boolean;\n /** Callback fired when the visibility of the overlay changes. */\n onHide?: OverlayTriggerProps['onHide'];\n /**\n * A callback that fires when the user triggers a change in tooltip visibility.\n * `onToggle` is called with the desired next show, and generally should be\n * passed back to the `show` prop. `onToggle` fires after the configured `delay`.\n */\n onToggle?: OverlayTriggerProps['onToggle'];\n /** The placement of the `Overlay` in relation to its target. */\n placement?: Placement;\n /** A `Popper.js` config object passed to the underlying popper instance. */\n popperConfig?: OverlayTriggerProps['popperConfig'];\n /**\n * The visibility of the `Overlay`. `show` is a controlled prop so should be\n * paired with `onToggle` to avoid breaking user interactions.\n */\n show?: boolean;\n /** The target element the `Overlay` is positioned in relation to. */\n target?: OverlayTriggerProps['target'];\n /** Specify which action or actions trigger `Overlay` visibility. */\n trigger?: OverlayTriggerType | OverlayTriggerType[];\n}\n\nfunction Overlay({\n placement = 'top',\n popperConfig = {},\n rootClose = false,\n show = false,\n transition = Fade,\n ...props\n}: ParagonOverlayProps) {\n return (\n <BaseOverlay\n placement={placement}\n popperConfig={popperConfig}\n rootClose={rootClose}\n show={show}\n transition={transition}\n // `target` is currently optional for Paragon consumers, but react-bootstrap types it as required.\n {...props as (typeof props & Pick<OverlayProps, 'target'>)}\n />\n );\n}\n\nfunction OverlayTrigger({\n defaultShow = false,\n popperConfig = {},\n trigger = ['hover', 'focus'],\n ...props\n}: ParagonOverlayTriggerProps) {\n return (\n <BaseOverlayTrigger\n defaultShow={defaultShow}\n popperConfig={popperConfig}\n trigger={trigger}\n {...props}\n >\n {props.children}\n </BaseOverlayTrigger>\n );\n}\n\nexport { OverlayTrigger };\nexport default Overlay;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,WAAW,MAAmE,yBAAyB;AAC9G,OAAOC,kBAAkB,MAA6D,gCAAgC;AACtH,OAAOC,IAAI,MAAM,sBAAsB;;AAEvC;AACA;AACA;;AAyFA,SAASC,OAAOA,CAAC;EACfC,SAAS,GAAG,KAAK;EACjBC,YAAY,GAAG,CAAC,CAAC;EACjBC,SAAS,GAAG,KAAK;EACjBC,IAAI,GAAG,KAAK;EACZC,UAAU,GAAGN,IAAI;EACjB,GAAGO;AACgB,CAAC,EAAE;EACtB,oBACEV,KAAA,CAAAW,aAAA,CAACV,WAAW;IACVI,SAAS,EAAEA,SAAU;IACrBC,YAAY,EAAEA,YAAa;IAC3BC,SAAS,EAAEA,SAAU;IACrBC,IAAI,EAAEA,IAAK;IACXC,UAAU,EAAEA;IACZ;IAAA;IAAA,GACIC;EAAK,CACV,CAAC;AAEN;AAEA,SAASE,cAAcA,CAAC;EACtBC,WAAW,GAAG,KAAK;EACnBP,YAAY,GAAG,CAAC,CAAC;EACjBQ,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC;EAC5B,GAAGJ;AACuB,CAAC,EAAE;EAC7B,oBACEV,KAAA,CAAAW,aAAA,CAACT,kBAAkB;IACjBW,WAAW,EAAEA,WAAY;IACzBP,YAAY,EAAEA,YAAa;IAC3BQ,OAAO,EAAEA,OAAQ;IAAA,GACbJ;EAAK,GAERA,KAAK,CAACK,QACW,CAAC;AAEzB;AAEA,SAASH,cAAc;AACvB,eAAeR,OAAO","ignoreList":[]}
|
package/dist/Tooltip/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { type TooltipProps as BaseTooltipProps } from 'react-bootstrap/Tooltip';
|
|
2
|
+
import { type Placement } from 'react-bootstrap/Overlay';
|
|
2
3
|
import type { ComponentWithAsProp } from '../utils/types/bootstrap';
|
|
3
4
|
interface TooltipProps extends BaseTooltipProps {
|
|
5
|
+
/** An html `id` attribute, necessary for accessibility. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** The visual style variant of the `Tooltip`. Use `'light'` for a light-themed tooltip. */
|
|
4
8
|
variant?: 'light';
|
|
9
|
+
/** Whether the tooltip is currently visible. */
|
|
10
|
+
show?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the direction the Tooltip is positioned towards.
|
|
13
|
+
*
|
|
14
|
+
* This is generally provided by the Overlay component positioning the tooltip.
|
|
15
|
+
*/
|
|
16
|
+
placement?: Placement;
|
|
17
|
+
/** Additional CSS class(es) to put on the tooltip element. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** A Popper.js config object passed to the the underlying popper instance. */
|
|
20
|
+
popper?: any;
|
|
5
21
|
}
|
|
6
22
|
declare const Tooltip: ComponentWithAsProp<'div', TooltipProps>;
|
|
7
23
|
export default Tooltip;
|
package/dist/Tooltip/index.js
CHANGED
|
@@ -1,64 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import BaseTooltip from 'react-bootstrap/Tooltip';
|
|
5
|
-
const PLACEMENT_VARIANTS = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
|
6
4
|
const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
7
5
|
children,
|
|
8
6
|
variant,
|
|
7
|
+
placement = 'right',
|
|
8
|
+
bsPrefix = 'tooltip',
|
|
9
9
|
...props
|
|
10
10
|
}, ref) => /*#__PURE__*/React.createElement(BaseTooltip, {
|
|
11
11
|
...props,
|
|
12
|
+
placement: placement,
|
|
13
|
+
bsPrefix: bsPrefix,
|
|
12
14
|
className: classNames({
|
|
13
15
|
'tooltip-light': variant === 'light'
|
|
14
16
|
}, props.className),
|
|
15
17
|
ref: ref
|
|
16
18
|
}, children));
|
|
17
|
-
Tooltip.propTypes = {
|
|
18
|
-
...BaseTooltip.propTypes,
|
|
19
|
-
/** An html id attribute, necessary for accessibility. */
|
|
20
|
-
id: PropTypes.string.isRequired,
|
|
21
|
-
/**
|
|
22
|
-
* Sets the direction the `Tooltip` is positioned towards.
|
|
23
|
-
*
|
|
24
|
-
* This is generally provided by the `Overlay` component positioning the tooltip.
|
|
25
|
-
*/
|
|
26
|
-
placement: PropTypes.oneOf(PLACEMENT_VARIANTS),
|
|
27
|
-
/**
|
|
28
|
-
* An `Overlay` injected set of props for positioning the `Tooltip` arrow.
|
|
29
|
-
*
|
|
30
|
-
* This is generally provided by the `Overlay` component positioning the tooltip.
|
|
31
|
-
*/
|
|
32
|
-
arrowProps: PropTypes.shape({
|
|
33
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
34
|
-
current: PropTypes.element
|
|
35
|
-
})]),
|
|
36
|
-
style: PropTypes.shape({})
|
|
37
|
-
}),
|
|
38
|
-
/** Whether the `Overlay` is shown. */
|
|
39
|
-
show: PropTypes.bool,
|
|
40
|
-
/** A `Popper.js` config object passed to the the underlying popper instance. */
|
|
41
|
-
popper: PropTypes.shape({}),
|
|
42
|
-
/** Overrides underlying component base CSS class name */
|
|
43
|
-
bsPrefix: PropTypes.string,
|
|
44
|
-
/** Specifies the content of the `Tooltip` */
|
|
45
|
-
children: PropTypes.node,
|
|
46
|
-
/** Specifies class name to append to the base element */
|
|
47
|
-
className: PropTypes.string,
|
|
48
|
-
/** The visual style of the `Tooltip` */
|
|
49
|
-
variant: PropTypes.string
|
|
50
|
-
};
|
|
51
|
-
Tooltip.defaultProps = {
|
|
52
|
-
...Tooltip.defaultProps,
|
|
53
|
-
id: undefined,
|
|
54
|
-
placement: 'right',
|
|
55
|
-
arrowProps: undefined,
|
|
56
|
-
show: undefined,
|
|
57
|
-
popper: undefined,
|
|
58
|
-
children: undefined,
|
|
59
|
-
className: undefined,
|
|
60
|
-
variant: undefined,
|
|
61
|
-
bsPrefix: 'tooltip'
|
|
62
|
-
};
|
|
63
19
|
export default Tooltip;
|
|
64
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classNames","BaseTooltip","Tooltip","forwardRef","children","variant","placement","bsPrefix","props","ref","createElement","className"],"sources":["../../src/Tooltip/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport BaseTooltip, { type TooltipProps as BaseTooltipProps } from 'react-bootstrap/Tooltip';\nimport { type Placement } from 'react-bootstrap/Overlay';\nimport type { ComponentWithAsProp } from '../utils/types/bootstrap';\n\ninterface TooltipProps extends BaseTooltipProps {\n // NOTE: we have to re-declare many inherited props so that they show up in the auto-generated docs.\n /** An html `id` attribute, necessary for accessibility. */\n id: string;\n /** The visual style variant of the `Tooltip`. Use `'light'` for a light-themed tooltip. */\n variant?: 'light';\n /** Whether the tooltip is currently visible. */\n show?: boolean;\n /**\n * Sets the direction the Tooltip is positioned towards.\n *\n * This is generally provided by the Overlay component positioning the tooltip.\n */\n placement?: Placement;\n /** Additional CSS class(es) to put on the tooltip element. */\n className?: string;\n /** A Popper.js config object passed to the the underlying popper instance. */\n popper?: any;\n}\n\nconst Tooltip: ComponentWithAsProp<'div', TooltipProps> = React.forwardRef(({\n children,\n variant,\n placement = 'right',\n bsPrefix = 'tooltip',\n ...props\n}: TooltipProps, ref: React.ForwardedRef<HTMLDivElement>) => (\n <BaseTooltip\n {...props}\n placement={placement}\n bsPrefix={bsPrefix}\n className={classNames({ 'tooltip-light': variant === 'light' }, props.className)}\n ref={ref}\n >\n {children}\n </BaseTooltip>\n));\n\nexport default Tooltip;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAiD,yBAAyB;AAwB5F,MAAMC,OAAiD,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAC;EAC1EC,QAAQ;EACRC,OAAO;EACPC,SAAS,GAAG,OAAO;EACnBC,QAAQ,GAAG,SAAS;EACpB,GAAGC;AACS,CAAC,EAAEC,GAAuC,kBACtDV,KAAA,CAAAW,aAAA,CAACT,WAAW;EAAA,GACNO,KAAK;EACTF,SAAS,EAAEA,SAAU;EACrBC,QAAQ,EAAEA,QAAS;EACnBI,SAAS,EAAEX,UAAU,CAAC;IAAE,eAAe,EAAEK,OAAO,KAAK;EAAQ,CAAC,EAAEG,KAAK,CAACG,SAAS,CAAE;EACjFF,GAAG,EAAEA;AAAI,GAERL,QACU,CACd,CAAC;AAEF,eAAeF,OAAO","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const inquirer = require('inquirer');
|
|
2
|
-
const childProcess = require('child_process');
|
|
2
|
+
const childProcess = require('node:child_process');
|
|
3
3
|
|
|
4
4
|
const themeCommand = require('../install-theme');
|
|
5
5
|
|
|
6
6
|
jest.mock('inquirer');
|
|
7
|
-
jest.mock('child_process');
|
|
7
|
+
jest.mock('node:child_process');
|
|
8
8
|
|
|
9
9
|
describe('install-theme', () => {
|
|
10
10
|
beforeEach(() => {
|
package/lib/install-theme.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openedx/paragon",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.23.0",
|
|
4
4
|
"description": "Accessible, responsive UI component library based on Bootstrap.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"axios": "^1.0.0",
|
|
68
68
|
"bootstrap": "^4.6.2",
|
|
69
69
|
"chalk": "^4.1.2",
|
|
70
|
-
"child_process": "^1.0.2",
|
|
71
70
|
"chroma-js": "^3.0.0",
|
|
72
71
|
"classnames": "^2.3.1",
|
|
73
72
|
"cli-progress": "^3.12.0",
|
|
@@ -110,7 +109,7 @@
|
|
|
110
109
|
"peerDependencies": {
|
|
111
110
|
"react": "^16.8.6 || ^17 || ^18",
|
|
112
111
|
"react-dom": "^16.8.6 || ^17 || ^18",
|
|
113
|
-
"react-intl": "^5.25.1 || ^6.4.0"
|
|
112
|
+
"react-intl": "^5.25.1 || ^6.4.0 || ^10.1.20"
|
|
114
113
|
},
|
|
115
114
|
"devDependencies": {
|
|
116
115
|
"@babel/cli": "^7.16.8",
|
|
@@ -156,6 +155,7 @@
|
|
|
156
155
|
"jest-environment-jsdom": "^29.7.0",
|
|
157
156
|
"markdown-loader-jest": "^0.1.1",
|
|
158
157
|
"react": "^18",
|
|
158
|
+
"react-intl": "^10.1.20",
|
|
159
159
|
"react-test-renderer": "^18",
|
|
160
160
|
"regenerator-runtime": "^0.14.0",
|
|
161
161
|
"semantic-release": "^25.0.0",
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"/component-generator/"
|
|
198
198
|
],
|
|
199
199
|
"transformIgnorePatterns": [
|
|
200
|
-
"/node_modules/(?!(@openedx/paragon)/).*/"
|
|
200
|
+
"/node_modules/(?!(@openedx/paragon|react-intl|@formatjs|intl-messageformat)/).*/"
|
|
201
201
|
]
|
|
202
202
|
},
|
|
203
203
|
"browserslist": [
|
package/src/Alert/index.tsx
CHANGED