@openedx/paragon 23.0.0-alpha.4 → 23.0.0-alpha.5
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/index.scss +2 -0
- package/dist/Container/index.d.ts +16 -0
- package/dist/Container/index.js +15 -13
- package/dist/Container/index.js.map +1 -1
- package/dist/IconButton/index.js +1 -1
- package/dist/IconButton/index.js.map +1 -1
- package/dist/Menu/SelectMenu.js +9 -4
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Modal/ModalContext.d.ts +15 -0
- package/dist/Modal/ModalContext.js +7 -14
- package/dist/Modal/ModalContext.js.map +1 -1
- package/dist/Modal/ModalDialog.d.ts +110 -0
- package/dist/Modal/ModalDialog.js +23 -21
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogHeader.d.ts +10 -0
- package/dist/Modal/ModalDialogHeader.js +6 -7
- package/dist/Modal/ModalDialogHeader.js.map +1 -1
- package/dist/Modal/ModalLayer.d.ts +53 -0
- package/dist/Modal/ModalLayer.js +5 -14
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/Portal.d.ts +11 -0
- package/dist/Modal/Portal.js +5 -6
- package/dist/Modal/Portal.js.map +1 -1
- package/dist/core.css +2 -0
- package/dist/core.css.map +1 -1
- package/dist/core.min.css +1 -1
- package/dist/hooks/useArrowKeyNavigation.js +2 -3
- package/dist/hooks/useArrowKeyNavigation.js.map +1 -1
- package/dist/index.d.ts +19 -5
- package/dist/index.js +5 -5
- package/icons/es5/Newsstand.js +15 -0
- package/icons/es5/index.js +1 -0
- package/icons/es5/index.ts +1 -0
- package/icons/jsx/Newsstand.jsx +17 -0
- package/icons/jsx/index.jsx +1 -0
- package/icons/svg/newsstand.svg +1 -0
- package/package.json +2 -2
- package/src/Card/index.scss +2 -0
- package/src/Container/{Container.test.jsx → Container.test.tsx} +14 -8
- package/src/Container/README.md +4 -0
- package/src/Container/index.tsx +64 -0
- package/src/DataTable/selection/tests/ControlledSelectHeader.test.jsx +7 -7
- package/src/IconButton/index.tsx +1 -1
- package/src/Menu/SelectMenu.jsx +5 -0
- package/src/Menu/SelectMenu.test.jsx +6 -0
- package/src/Menu/select-menu.md +8 -0
- package/src/Modal/{ModalContext.jsx → ModalContext.tsx} +19 -16
- package/src/Modal/{ModalDialog.jsx → ModalDialog.tsx} +50 -23
- package/src/Modal/{ModalDialogHeader.jsx → ModalDialogHeader.tsx} +17 -11
- package/src/Modal/{ModalLayer.jsx → ModalLayer.tsx} +17 -17
- package/src/Modal/{Portal.jsx → Portal.tsx} +10 -7
- package/src/Modal/tests/{ModalDialog.test.jsx → ModalDialog.test.tsx} +16 -10
- package/src/Modal/tests/{ModalLayer.test.jsx → ModalLayer.test.tsx} +5 -5
- package/src/Modal/tests/{Portal.test.jsx → Portal.test.tsx} +3 -3
- package/src/hooks/useArrowKeyNavigation.jsx +1 -2
- package/src/index.d.ts +19 -5
- package/src/index.js +5 -5
- package/src/Container/index.jsx +0 -49
- /package/src/Truncate/{Truncate.test.js → utils.test.js} +0 -0
|
@@ -21,6 +21,7 @@ function handleEnter(_ref) {
|
|
|
21
21
|
event.preventDefault();
|
|
22
22
|
}
|
|
23
23
|
function handleArrowKey(_ref2) {
|
|
24
|
+
var _nextElement;
|
|
24
25
|
var event = _ref2.event,
|
|
25
26
|
currentIndex = _ref2.currentIndex,
|
|
26
27
|
availableElements = _ref2.availableElements;
|
|
@@ -44,9 +45,7 @@ function handleArrowKey(_ref2) {
|
|
|
44
45
|
var _availableElements = _slicedToArray(availableElements, 1);
|
|
45
46
|
nextElement = _availableElements[0];
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
// eslint-disable-next-line no-unused-expressions
|
|
49
|
-
nextElement && nextElement.focus();
|
|
48
|
+
(_nextElement = nextElement) === null || _nextElement === void 0 ? void 0 : _nextElement.focus();
|
|
50
49
|
event.preventDefault();
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArrowKeyNavigation.js","names":["useRef","useEffect","handleEnter","_ref","event","currentIndex","activeElement","click","preventDefault","handleArrowKey","_ref2","availableElements","focus","nextElement","key","length","_availableElements","_slicedToArray","handleEvents","_ref3","_ref3$ignoredKeys","ignoredKeys","parentNode","_ref3$selectors","selectors","includes","_document","document","contains","querySelectorAll","Array","from","findIndex","availableElement","useArrowKeyNavigation","props","_ref4","eventHandler","current","addEventListener","removeEventListener"],"sources":["../../src/hooks/useArrowKeyNavigation.jsx"],"sourcesContent":["import { useRef, useEffect } from 'react';\n\n/**\n * A React hook to enable arrow key navigation on a component.\n */\n\nfunction handleEnter({ event, currentIndex, activeElement }) {\n if (currentIndex === -1) { return; }\n activeElement.click();\n event.preventDefault();\n}\n\nfunction handleArrowKey({ event, currentIndex, availableElements }) {\n // If the focus isn't in the container, focus on the first thing\n if (currentIndex === -1) { availableElements[0].focus(); }\n\n // Move the focus up or down. Wrap around ends of list.\n let nextElement;\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {\n nextElement = availableElements[(currentIndex + 1) % availableElements.length];\n }\n if (event.key === 'ArrowUp' || event.key === 'ArrowLeft') {\n nextElement = currentIndex - 1 < 0\n ? availableElements[currentIndex - 1 + availableElements.length]\n : availableElements[currentIndex - 1];\n }\n if (event.key === 'End') {\n nextElement = availableElements[availableElements.length - 1];\n }\n if (event.key === 'Home') {\n [nextElement] = availableElements;\n }\n\n
|
|
1
|
+
{"version":3,"file":"useArrowKeyNavigation.js","names":["useRef","useEffect","handleEnter","_ref","event","currentIndex","activeElement","click","preventDefault","handleArrowKey","_ref2","_nextElement","availableElements","focus","nextElement","key","length","_availableElements","_slicedToArray","handleEvents","_ref3","_ref3$ignoredKeys","ignoredKeys","parentNode","_ref3$selectors","selectors","includes","_document","document","contains","querySelectorAll","Array","from","findIndex","availableElement","useArrowKeyNavigation","props","_ref4","eventHandler","current","addEventListener","removeEventListener"],"sources":["../../src/hooks/useArrowKeyNavigation.jsx"],"sourcesContent":["import { useRef, useEffect } from 'react';\n\n/**\n * A React hook to enable arrow key navigation on a component.\n */\n\nfunction handleEnter({ event, currentIndex, activeElement }) {\n if (currentIndex === -1) { return; }\n activeElement.click();\n event.preventDefault();\n}\n\nfunction handleArrowKey({ event, currentIndex, availableElements }) {\n // If the focus isn't in the container, focus on the first thing\n if (currentIndex === -1) { availableElements[0].focus(); }\n\n // Move the focus up or down. Wrap around ends of list.\n let nextElement;\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {\n nextElement = availableElements[(currentIndex + 1) % availableElements.length];\n }\n if (event.key === 'ArrowUp' || event.key === 'ArrowLeft') {\n nextElement = currentIndex - 1 < 0\n ? availableElements[currentIndex - 1 + availableElements.length]\n : availableElements[currentIndex - 1];\n }\n if (event.key === 'End') {\n nextElement = availableElements[availableElements.length - 1];\n }\n if (event.key === 'Home') {\n [nextElement] = availableElements;\n }\n\n nextElement?.focus();\n event.preventDefault();\n}\n\n/**\n * Implement arrow key navigation for the given parentNode\n */\nfunction handleEvents({\n event,\n ignoredKeys = [],\n parentNode,\n selectors = 'a,button,input',\n}) {\n if (!parentNode) { return; }\n\n const { key } = event;\n\n if (!['ArrowUp', 'ArrowDown', 'ArrowRight', 'ArrowLeft', 'Enter', 'Home', 'End'].includes(key)\n || ignoredKeys.includes(key)) {\n return;\n }\n\n const { activeElement } = document;\n\n // If we're not inside the container, don't do anything\n if (!parentNode.contains(activeElement)) { return; }\n\n // Get the list of elements we're allowed to scroll through\n const availableElements = parentNode.querySelectorAll(selectors);\n\n // No elements are available to loop through.\n if (!availableElements.length) { return; }\n\n // Which index is currently selected\n const currentIndex = Array.from(availableElements).findIndex(\n (availableElement) => availableElement === activeElement,\n );\n\n if (key === 'Enter') {\n handleEnter({ event, currentIndex, activeElement });\n }\n handleArrowKey({ event, currentIndex, availableElements });\n}\n\nexport default function useArrowKeyNavigation(props) {\n const { selectors, ignoredKeys } = props || {};\n const parentNode = useRef();\n\n useEffect(() => {\n const eventHandler = (event) => {\n handleEvents({\n event, ignoredKeys, parentNode: parentNode.current, selectors,\n });\n };\n\n document.addEventListener('keydown', eventHandler);\n\n return () => document.removeEventListener('keydown', eventHandler);\n }, [ignoredKeys, selectors]);\n\n return parentNode;\n}\n"],"mappings":";;;;;;AAAA,SAASA,MAAM,EAAEC,SAAS,QAAQ,OAAO;;AAEzC;AACA;AACA;;AAEA,SAASC,WAAWA,CAAAC,IAAA,EAAyC;EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,aAAa,GAAAH,IAAA,CAAbG,aAAa;EACvD,IAAID,YAAY,KAAK,CAAC,CAAC,EAAE;IAAE;EAAQ;EACnCC,aAAa,CAACC,KAAK,CAAC,CAAC;EACrBH,KAAK,CAACI,cAAc,CAAC,CAAC;AACxB;AAEA,SAASC,cAAcA,CAAAC,KAAA,EAA6C;EAAA,IAAAC,YAAA;EAAA,IAA1CP,KAAK,GAAAM,KAAA,CAALN,KAAK;IAAEC,YAAY,GAAAK,KAAA,CAAZL,YAAY;IAAEO,iBAAiB,GAAAF,KAAA,CAAjBE,iBAAiB;EAC9D;EACA,IAAIP,YAAY,KAAK,CAAC,CAAC,EAAE;IAAEO,iBAAiB,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC;EAAE;;EAEzD;EACA,IAAIC,WAAW;EAEf,IAAIV,KAAK,CAACW,GAAG,KAAK,WAAW,IAAIX,KAAK,CAACW,GAAG,KAAK,YAAY,EAAE;IAC3DD,WAAW,GAAGF,iBAAiB,CAAC,CAACP,YAAY,GAAG,CAAC,IAAIO,iBAAiB,CAACI,MAAM,CAAC;EAChF;EACA,IAAIZ,KAAK,CAACW,GAAG,KAAK,SAAS,IAAIX,KAAK,CAACW,GAAG,KAAK,WAAW,EAAE;IACxDD,WAAW,GAAGT,YAAY,GAAG,CAAC,GAAG,CAAC,GAC9BO,iBAAiB,CAACP,YAAY,GAAG,CAAC,GAAGO,iBAAiB,CAACI,MAAM,CAAC,GAC9DJ,iBAAiB,CAACP,YAAY,GAAG,CAAC,CAAC;EACzC;EACA,IAAID,KAAK,CAACW,GAAG,KAAK,KAAK,EAAE;IACvBD,WAAW,GAAGF,iBAAiB,CAACA,iBAAiB,CAACI,MAAM,GAAG,CAAC,CAAC;EAC/D;EACA,IAAIZ,KAAK,CAACW,GAAG,KAAK,MAAM,EAAE;IAAA,IAAAE,kBAAA,GAAAC,cAAA,CACRN,iBAAiB;IAAhCE,WAAW,GAAAG,kBAAA;EACd;EAEA,CAAAN,YAAA,GAAAG,WAAW,cAAAH,YAAA,uBAAXA,YAAA,CAAaE,KAAK,CAAC,CAAC;EACpBT,KAAK,CAACI,cAAc,CAAC,CAAC;AACxB;;AAEA;AACA;AACA;AACA,SAASW,YAAYA,CAAAC,KAAA,EAKlB;EAAA,IAJDhB,KAAK,GAAAgB,KAAA,CAALhB,KAAK;IAAAiB,iBAAA,GAAAD,KAAA,CACLE,WAAW;IAAXA,WAAW,GAAAD,iBAAA,cAAG,EAAE,GAAAA,iBAAA;IAChBE,UAAU,GAAAH,KAAA,CAAVG,UAAU;IAAAC,eAAA,GAAAJ,KAAA,CACVK,SAAS;IAATA,SAAS,GAAAD,eAAA,cAAG,gBAAgB,GAAAA,eAAA;EAE5B,IAAI,CAACD,UAAU,EAAE;IAAE;EAAQ;EAE3B,IAAQR,GAAG,GAAKX,KAAK,CAAbW,GAAG;EAEX,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAACW,QAAQ,CAACX,GAAG,CAAC,IACvFO,WAAW,CAACI,QAAQ,CAACX,GAAG,CAAC,EAAE;IAChC;EACF;EAEA,IAAAY,SAAA,GAA0BC,QAAQ;IAA1BtB,aAAa,GAAAqB,SAAA,CAAbrB,aAAa;;EAErB;EACA,IAAI,CAACiB,UAAU,CAACM,QAAQ,CAACvB,aAAa,CAAC,EAAE;IAAE;EAAQ;;EAEnD;EACA,IAAMM,iBAAiB,GAAGW,UAAU,CAACO,gBAAgB,CAACL,SAAS,CAAC;;EAEhE;EACA,IAAI,CAACb,iBAAiB,CAACI,MAAM,EAAE;IAAE;EAAQ;;EAEzC;EACA,IAAMX,YAAY,GAAG0B,KAAK,CAACC,IAAI,CAACpB,iBAAiB,CAAC,CAACqB,SAAS,CAC1D,UAACC,gBAAgB;IAAA,OAAKA,gBAAgB,KAAK5B,aAAa;EAAA,CAC1D,CAAC;EAED,IAAIS,GAAG,KAAK,OAAO,EAAE;IACnBb,WAAW,CAAC;MAAEE,KAAK,EAALA,KAAK;MAAEC,YAAY,EAAZA,YAAY;MAAEC,aAAa,EAAbA;IAAc,CAAC,CAAC;EACrD;EACAG,cAAc,CAAC;IAAEL,KAAK,EAALA,KAAK;IAAEC,YAAY,EAAZA,YAAY;IAAEO,iBAAiB,EAAjBA;EAAkB,CAAC,CAAC;AAC5D;AAEA,eAAe,SAASuB,qBAAqBA,CAACC,KAAK,EAAE;EACnD,IAAAC,KAAA,GAAmCD,KAAK,IAAI,CAAC,CAAC;IAAtCX,SAAS,GAAAY,KAAA,CAATZ,SAAS;IAAEH,WAAW,GAAAe,KAAA,CAAXf,WAAW;EAC9B,IAAMC,UAAU,GAAGvB,MAAM,CAAC,CAAC;EAE3BC,SAAS,CAAC,YAAM;IACd,IAAMqC,YAAY,GAAG,SAAfA,YAAYA,CAAIlC,KAAK,EAAK;MAC9Be,YAAY,CAAC;QACXf,KAAK,EAALA,KAAK;QAAEkB,WAAW,EAAXA,WAAW;QAAEC,UAAU,EAAEA,UAAU,CAACgB,OAAO;QAAEd,SAAS,EAATA;MACtD,CAAC,CAAC;IACJ,CAAC;IAEDG,QAAQ,CAACY,gBAAgB,CAAC,SAAS,EAAEF,YAAY,CAAC;IAElD,OAAO;MAAA,OAAMV,QAAQ,CAACa,mBAAmB,CAAC,SAAS,EAAEH,YAAY,CAAC;IAAA;EACpE,CAAC,EAAE,CAAChB,WAAW,EAAEG,SAAS,CAAC,CAAC;EAE5B,OAAOF,UAAU;AACnB","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,10 +8,15 @@ export { default as Bubble } from './Bubble';
|
|
|
8
8
|
export { default as Button, ButtonGroup, ButtonToolbar } from './Button';
|
|
9
9
|
export { default as Chip, CHIP_PGN_CLASS } from './Chip';
|
|
10
10
|
export { default as ChipCarousel } from './ChipCarousel';
|
|
11
|
+
export { default as Container, ContainerSize } from './Container';
|
|
11
12
|
export { default as Hyperlink, HYPER_LINK_EXTERNAL_LINK_ALT_TEXT, HYPER_LINK_EXTERNAL_LINK_TITLE } from './Hyperlink';
|
|
12
13
|
export { default as Icon } from './Icon';
|
|
13
14
|
export { default as IconButton, IconButtonWithTooltip } from './IconButton';
|
|
15
|
+
export { default as ModalContext } from './Modal/ModalContext';
|
|
16
|
+
export { default as ModalDialog, MODAL_DIALOG_CLOSE_LABEL } from './Modal/ModalDialog';
|
|
17
|
+
export { default as ModalLayer } from './Modal/ModalLayer';
|
|
14
18
|
export { default as Overlay, OverlayTrigger } from './Overlay';
|
|
19
|
+
export { default as Portal } from './Modal/Portal';
|
|
15
20
|
export { default as Tooltip } from './Tooltip';
|
|
16
21
|
|
|
17
22
|
// // // // // // // // // // // // // // // // // // // // // // // // // // //
|
|
@@ -38,10 +43,11 @@ export const
|
|
|
38
43
|
export const
|
|
39
44
|
Carousel: any, CarouselItem: any, CAROUSEL_NEXT_LABEL_TEXT: any, CAROUSEL_PREV_LABEL_TEXT: any;
|
|
40
45
|
// from './Carousel';
|
|
46
|
+
/** @deprecated Replaced by `Form.Checkbox`. */
|
|
41
47
|
export const CheckBox: any; // from './CheckBox';
|
|
48
|
+
/** @deprecated Replaced by `Form.Checkbox` and `Form.CheckboxSet`. */
|
|
42
49
|
export const CheckBoxGroup: any; // from './CheckBoxGroup';
|
|
43
50
|
export const CloseButton: any; // from './CloseButton';
|
|
44
|
-
export const Container: any; // from './Container';
|
|
45
51
|
export const Layout: any, Col: any, Row: any; // from './Layout';
|
|
46
52
|
export const Collapse: any; // from './Collapse';
|
|
47
53
|
export const Collapsible: any; // from './Collapsible';
|
|
@@ -53,6 +59,7 @@ export const
|
|
|
53
59
|
SplitButton: any;
|
|
54
60
|
// from './Dropdown';
|
|
55
61
|
export const Fade: any; // from './Fade';
|
|
62
|
+
/** @deprecated */
|
|
56
63
|
export const Fieldset: any; // from './Fieldset';
|
|
57
64
|
export const
|
|
58
65
|
Form: any,
|
|
@@ -77,28 +84,30 @@ export const
|
|
|
77
84
|
InputGroup: any;
|
|
78
85
|
// from './Form';
|
|
79
86
|
export const IconButtonToggle: any; // from './IconButtonToggle';
|
|
87
|
+
/** @deprecated Replaced by `Form.Control`. */
|
|
80
88
|
export const Input: any; // from './Input';
|
|
89
|
+
/** @deprecated Replaced by `Form.Control`. */
|
|
81
90
|
export const InputSelect: any; // from './InputSelect';
|
|
91
|
+
/** @deprecated Replaced by `Form.Control`. */
|
|
82
92
|
export const InputText: any; // from './InputText';
|
|
83
93
|
export const Image: any, Figure; // from './Image';
|
|
94
|
+
/** @deprecated */
|
|
84
95
|
export const ListBox: any; // from './ListBox';
|
|
96
|
+
/** @deprecated */
|
|
85
97
|
export const ListBoxOption: any; // from './ListBoxOption';
|
|
86
98
|
export const MailtoLink: any, MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT: string, MAIL_TO_LINK_EXTERNAL_LINK_TITLE: string; // from './MailtoLink';
|
|
87
99
|
export const Media: any; // from './Media';
|
|
88
100
|
export const Menu: any; // from './Menu';
|
|
89
101
|
export const MenuItem: any; // from './Menu/MenuItem';
|
|
90
102
|
export const SelectMenu: any, SELECT_MENU_DEFAULT_MESSAGE: string; // from './Menu/SelectMenu';
|
|
103
|
+
/** @deprecated Use `ModalDialog` instead. */
|
|
91
104
|
export const Modal: any; // from './Modal';
|
|
92
105
|
export const ModalCloseButton: any; // from './Modal/ModalCloseButton';
|
|
93
106
|
export const FullscreenModal: any, FULLSCREEN_MODAL_CLOSE_LABEL: string; // from './Modal/FullscreenModal';
|
|
94
107
|
export const MarketingModal: any; // from './Modal/MarketingModal';
|
|
95
108
|
export const StandardModal: any, STANDARD_MODAL_CLOSE_LABEL: string; // from './Modal/StandardModal';
|
|
96
109
|
export const AlertModal: any; // from './Modal/AlertModal';
|
|
97
|
-
export const ModalLayer: any; // from './Modal/ModalLayer';
|
|
98
|
-
export const ModalDialog: any, MODAL_DIALOG_CLOSE_LABEL: string; // from './Modal/ModalDialog';
|
|
99
110
|
export const ModalPopup: any; // from './Modal/ModalPopup';
|
|
100
|
-
export const ModalContext: any; // from './Modal/ModalContext';
|
|
101
|
-
export const Portal: any; // from './Modal/Portal';
|
|
102
111
|
export const PopperElement: any; // from './Modal/PopperElement';
|
|
103
112
|
|
|
104
113
|
export const
|
|
@@ -122,6 +131,7 @@ export const
|
|
|
122
131
|
export const Popover: any, PopoverTitle: any, PopoverContent: any; // from './Popover';
|
|
123
132
|
export const ProgressBar: any; // from './ProgressBar';
|
|
124
133
|
export const ProductTour: any; // from './ProductTour';
|
|
134
|
+
/** @deprecated Replaced by `Form.Radio` and `Form.RadioSet`. */
|
|
125
135
|
export const RadioButtonGroup: any, RadioButton: any; // from './RadioButtonGroup';
|
|
126
136
|
export const ResponsiveEmbed: any; // from './ResponsiveEmbed';
|
|
127
137
|
export const
|
|
@@ -135,7 +145,9 @@ export const Sheet: any; // from './Sheet';
|
|
|
135
145
|
export const Spinner: any; // from './Spinner';
|
|
136
146
|
export const Stepper: any; // from './Stepper';
|
|
137
147
|
export const StatefulButton: any; // from './StatefulButton';
|
|
148
|
+
/** @deprecated Replaced by `Alert`. */
|
|
138
149
|
export const StatusAlert: any; // from './StatusAlert';
|
|
150
|
+
/** @deprecated Replaced by `DataTable`. */
|
|
139
151
|
export const Table: any; // from './Table';
|
|
140
152
|
export const
|
|
141
153
|
Tabs: any,
|
|
@@ -144,8 +156,10 @@ export const
|
|
|
144
156
|
TabContent: any,
|
|
145
157
|
TabPane: any;
|
|
146
158
|
// from './Tabs';
|
|
159
|
+
/** @deprecated Replaced by `Form.Control`. */
|
|
147
160
|
export const TextArea: any; // from './TextArea';
|
|
148
161
|
export const Toast: any, TOAST_CLOSE_LABEL_TEXT: string, TOAST_DELAY: number; // from './Toast';
|
|
162
|
+
/** @deprecated Replaced by `Form.Group`. */
|
|
149
163
|
export const ValidationFormGroup: any; // from './ValidationFormGroup';
|
|
150
164
|
export const TransitionReplace: any; // from './TransitionReplace';
|
|
151
165
|
export const ValidationMessage: any; // from './ValidationMessage';
|
package/dist/index.js
CHANGED
|
@@ -8,10 +8,15 @@ export { default as Bubble } from './Bubble';
|
|
|
8
8
|
export { default as Button, ButtonGroup, ButtonToolbar } from './Button';
|
|
9
9
|
export { default as Chip, CHIP_PGN_CLASS } from './Chip';
|
|
10
10
|
export { default as ChipCarousel } from './ChipCarousel';
|
|
11
|
+
export { default as Container } from './Container';
|
|
11
12
|
export { default as Hyperlink, HYPER_LINK_EXTERNAL_LINK_ALT_TEXT, HYPER_LINK_EXTERNAL_LINK_TITLE } from './Hyperlink';
|
|
12
13
|
export { default as Icon } from './Icon';
|
|
13
14
|
export { default as IconButton, IconButtonWithTooltip } from './IconButton';
|
|
15
|
+
export { default as ModalContext } from './Modal/ModalContext';
|
|
16
|
+
export { default as ModalDialog, MODAL_DIALOG_CLOSE_LABEL } from './Modal/ModalDialog';
|
|
17
|
+
export { default as ModalLayer } from './Modal/ModalLayer';
|
|
14
18
|
export { default as Overlay, OverlayTrigger } from './Overlay';
|
|
19
|
+
export { default as Portal } from './Modal/Portal';
|
|
15
20
|
export { default as Tooltip } from './Tooltip';
|
|
16
21
|
|
|
17
22
|
// // // // // // // // // // // // // // // // // // // // // // // // // // //
|
|
@@ -39,7 +44,6 @@ export {
|
|
|
39
44
|
default as Carousel, CarouselItem, CAROUSEL_NEXT_LABEL_TEXT, CAROUSEL_PREV_LABEL_TEXT,
|
|
40
45
|
} from './Carousel';
|
|
41
46
|
export { default as CloseButton } from './CloseButton';
|
|
42
|
-
export { default as Container } from './Container';
|
|
43
47
|
export { default as Layout, Col, Row } from './Layout';
|
|
44
48
|
export { default as Collapse } from './Collapse';
|
|
45
49
|
export { default as Collapsible } from './Collapsible';
|
|
@@ -85,11 +89,7 @@ export { default as FullscreenModal, FULLSCREEN_MODAL_CLOSE_LABEL } from './Moda
|
|
|
85
89
|
export { default as MarketingModal } from './Modal/MarketingModal';
|
|
86
90
|
export { default as StandardModal, STANDARD_MODAL_CLOSE_LABEL } from './Modal/StandardModal';
|
|
87
91
|
export { default as AlertModal } from './Modal/AlertModal';
|
|
88
|
-
export { default as ModalLayer } from './Modal/ModalLayer';
|
|
89
|
-
export { default as ModalDialog, MODAL_DIALOG_CLOSE_LABEL } from './Modal/ModalDialog';
|
|
90
92
|
export { default as ModalPopup } from './Modal/ModalPopup';
|
|
91
|
-
export { default as ModalContext } from './Modal/ModalContext';
|
|
92
|
-
export { default as Portal } from './Modal/Portal';
|
|
93
93
|
export { default as PopperElement } from './Modal/PopperElement';
|
|
94
94
|
|
|
95
95
|
export {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
var SvgNewsstand = function SvgNewsstand(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
height: 24,
|
|
7
|
+
viewBox: "0 -960 960 960",
|
|
8
|
+
width: 24,
|
|
9
|
+
fill: "none"
|
|
10
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M80-160v-80h800v80H80Zm80-160v-320h80v320h-80Zm160 0v-480h80v480h-80Zm160 0v-480h80v480h-80Zm280 0L600-600l70-40 160 280-70 40Z",
|
|
12
|
+
fill: "currentColor"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgNewsstand;
|
package/icons/es5/index.js
CHANGED
|
@@ -1381,6 +1381,7 @@ export { default as NetworkWifi3Bar } from "./NetworkWifi3Bar";
|
|
|
1381
1381
|
export { default as NewLabel } from "./NewLabel";
|
|
1382
1382
|
export { default as NewReleases } from "./NewReleases";
|
|
1383
1383
|
export { default as Newspaper } from "./Newspaper";
|
|
1384
|
+
export { default as Newsstand } from "./Newsstand";
|
|
1384
1385
|
export { default as NextPlan } from "./NextPlan";
|
|
1385
1386
|
export { default as NextWeek } from "./NextWeek";
|
|
1386
1387
|
export { default as Nfc } from "./Nfc";
|
package/icons/es5/index.ts
CHANGED
|
@@ -1382,6 +1382,7 @@ export { default as NetworkWifi3Bar } from "./NetworkWifi3Bar";
|
|
|
1382
1382
|
export { default as NewLabel } from "./NewLabel";
|
|
1383
1383
|
export { default as NewReleases } from "./NewReleases";
|
|
1384
1384
|
export { default as Newspaper } from "./Newspaper";
|
|
1385
|
+
export { default as Newsstand } from "./Newsstand";
|
|
1385
1386
|
export { default as NextPlan } from "./NextPlan";
|
|
1386
1387
|
export { default as NextWeek } from "./NextWeek";
|
|
1387
1388
|
export { default as Nfc } from "./Nfc";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgNewsstand = (props) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
height={24}
|
|
6
|
+
viewBox="0 -960 960 960"
|
|
7
|
+
width={24}
|
|
8
|
+
fill="none"
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
d="M80-160v-80h800v80H80Zm80-160v-320h80v320h-80Zm160 0v-480h80v480h-80Zm160 0v-480h80v480h-80Zm280 0L600-600l70-40 160 280-70 40Z"
|
|
13
|
+
fill="currentColor"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
export default SvgNewsstand;
|
package/icons/jsx/index.jsx
CHANGED
|
@@ -1381,6 +1381,7 @@ export { default as NetworkWifi3Bar } from "./NetworkWifi3Bar";
|
|
|
1381
1381
|
export { default as NewLabel } from "./NewLabel";
|
|
1382
1382
|
export { default as NewReleases } from "./NewReleases";
|
|
1383
1383
|
export { default as Newspaper } from "./Newspaper";
|
|
1384
|
+
export { default as Newsstand } from "./Newsstand";
|
|
1384
1385
|
export { default as NextPlan } from "./NextPlan";
|
|
1385
1386
|
export { default as NextWeek } from "./NextWeek";
|
|
1386
1387
|
export { default as Nfc } from "./Nfc";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M80-160v-80h800v80H80Zm80-160v-320h80v320h-80Zm160 0v-480h80v480h-80Zm160 0v-480h80v480h-80Zm280 0L600-600l70-40 160 280-70 40Z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openedx/paragon",
|
|
3
|
-
"version": "23.0.0-alpha.
|
|
3
|
+
"version": "23.0.0-alpha.5",
|
|
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": "^
|
|
118
|
+
"@edx/eslint-config": "^4.2.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",
|
package/src/Card/index.scss
CHANGED
|
@@ -352,6 +352,8 @@ a.pgn__card {
|
|
|
352
352
|
bottom: calc(-1 * var(--pgn-spacing-card-logo-bottom-offset-base));
|
|
353
353
|
width: var(--pgn-size-card-logo-width);
|
|
354
354
|
height: var(--pgn-size-card-logo-height);
|
|
355
|
+
object-fit: scale-down;
|
|
356
|
+
object-position: center center;
|
|
355
357
|
border-radius: var(--pgn-size-card-border-radius-logo);
|
|
356
358
|
box-shadow: var(--pgn-elevation-box-shadow-level-1);
|
|
357
359
|
padding: map_get($spacers, 2);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import Container from '.';
|
|
3
|
+
import Container, { type ContainerSize } from '.';
|
|
4
4
|
|
|
5
|
-
const getClassNames = (container) => container.className.split(' ');
|
|
5
|
+
const getClassNames = (container: HTMLElement) => container.className.split(' ');
|
|
6
6
|
|
|
7
7
|
describe('<Container />', () => {
|
|
8
8
|
it('displays children', () => {
|
|
@@ -12,32 +12,38 @@ describe('<Container />', () => {
|
|
|
12
12
|
|
|
13
13
|
it('adds the .container-fluid class', () => {
|
|
14
14
|
const { container } = render(<Container>Content</Container>);
|
|
15
|
-
const containerElement = container.firstChild;
|
|
15
|
+
const containerElement = container.firstChild as HTMLElement;
|
|
16
16
|
expect(getClassNames(containerElement)).toContain('container-fluid');
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
it('adds the .container class', () => {
|
|
20
20
|
const { container } = render(<Container fluid={false}>Content</Container>);
|
|
21
|
-
const containerElement = container.firstChild;
|
|
22
|
-
expect(getClassNames(containerElement)).toContain('container');
|
|
21
|
+
const containerElement = container.firstChild as HTMLElement;
|
|
22
|
+
expect(getClassNames(containerElement!)).toContain('container');
|
|
23
23
|
expect(getClassNames(containerElement)).not.toContain('container-fluid');
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
['xs', 'sm', 'md', 'lg', 'xl'].forEach((size) => {
|
|
26
|
+
['xs', 'sm', 'md', 'lg', 'xl'].forEach((size: ContainerSize) => {
|
|
27
27
|
it(`adds the .container-mw-${size} class`, () => {
|
|
28
28
|
const { container } = render(<Container size={size}>Content</Container>);
|
|
29
|
-
const containerElement = container.firstChild;
|
|
29
|
+
const containerElement = container.firstChild as HTMLElement;
|
|
30
30
|
expect(getClassNames(containerElement)).toContain(`container-mw-${size}`);
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
+
it('does not add a size class when size is not specified', () => {
|
|
35
|
+
const { container } = render(<Container>Content</Container>);
|
|
36
|
+
const containerElement = container.firstChild as HTMLElement;
|
|
37
|
+
expect(getClassNames(containerElement)).toEqual(['container-fluid']);
|
|
38
|
+
});
|
|
39
|
+
|
|
34
40
|
it('preserves custom class names', () => {
|
|
35
41
|
const { container } = render(
|
|
36
42
|
<Container className="custom-class" size="md">
|
|
37
43
|
Content
|
|
38
44
|
</Container>,
|
|
39
45
|
);
|
|
40
|
-
const containerElement = container.firstChild;
|
|
46
|
+
const containerElement = container.firstChild as HTMLElement;
|
|
41
47
|
expect(getClassNames(containerElement)).toContain('container-mw-md');
|
|
42
48
|
expect(getClassNames(containerElement)).toContain('container-fluid');
|
|
43
49
|
expect(getClassNames(containerElement)).toContain('custom-class');
|
package/src/Container/README.md
CHANGED
|
@@ -19,6 +19,10 @@ The base container to contain, pad, and center content in the viewport. This com
|
|
|
19
19
|
```jsx live
|
|
20
20
|
<div style={{ overflowX: 'auto' }}>
|
|
21
21
|
<div style={{ width: '1500px', border: 'solid 3px red' }}>
|
|
22
|
+
<Container className="bg-danger-300 my-4">
|
|
23
|
+
The content in this container doesn't have a max width
|
|
24
|
+
</Container>
|
|
25
|
+
|
|
22
26
|
<Container size="xl" className="bg-danger-300 my-4">
|
|
23
27
|
The content in this container won't exceed the extra large width.
|
|
24
28
|
</Container>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable react/require-default-props */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import RBContainer, { type ContainerProps as RBContainerProps } from 'react-bootstrap/Container';
|
|
6
|
+
|
|
7
|
+
import type { ComponentWithAsProp } from '../utils/types/bootstrap';
|
|
8
|
+
|
|
9
|
+
enum ContainerSizeClass {
|
|
10
|
+
xs = 'container-mw-xs',
|
|
11
|
+
sm = 'container-mw-sm',
|
|
12
|
+
md = 'container-mw-md',
|
|
13
|
+
lg = 'container-mw-lg',
|
|
14
|
+
xl = 'container-mw-xl',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type ContainerSize = keyof typeof ContainerSizeClass;
|
|
18
|
+
|
|
19
|
+
interface ContainerProps extends RBContainerProps {
|
|
20
|
+
size?: ContainerSize;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type ContainerType = ComponentWithAsProp<'div', ContainerProps>;
|
|
24
|
+
|
|
25
|
+
const Container: ContainerType = React.forwardRef<Element, ContainerProps>(({
|
|
26
|
+
size,
|
|
27
|
+
children,
|
|
28
|
+
...props
|
|
29
|
+
}, ref) => (
|
|
30
|
+
<RBContainer
|
|
31
|
+
{...props}
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={classNames(
|
|
34
|
+
props.className,
|
|
35
|
+
size && ContainerSizeClass[size],
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</RBContainer>
|
|
40
|
+
));
|
|
41
|
+
|
|
42
|
+
Container.propTypes = {
|
|
43
|
+
...RBContainer.propTypes,
|
|
44
|
+
/** Override the base element */
|
|
45
|
+
as: PropTypes.elementType,
|
|
46
|
+
/** Specifies the contents of the container */
|
|
47
|
+
children: PropTypes.node,
|
|
48
|
+
/** Fill all available space at any breakpoint */
|
|
49
|
+
fluid: PropTypes.bool,
|
|
50
|
+
/** Set the maximum width for the container. Omiting the prop will remove the max-width */
|
|
51
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
|
|
52
|
+
/** Overrides underlying component base CSS class name */
|
|
53
|
+
bsPrefix: PropTypes.string,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
Container.defaultProps = {
|
|
57
|
+
as: 'div',
|
|
58
|
+
children: undefined,
|
|
59
|
+
fluid: true,
|
|
60
|
+
size: undefined,
|
|
61
|
+
bsPrefix: 'container',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default Container;
|
|
@@ -8,6 +8,13 @@ import DataTableContext from '../../DataTableContext';
|
|
|
8
8
|
import * as selectActions from '../data/actions';
|
|
9
9
|
import { getRowIds } from '../data/helpers';
|
|
10
10
|
|
|
11
|
+
function DataTableContextChild() {
|
|
12
|
+
const contextValue = useContext(DataTableContext);
|
|
13
|
+
return (
|
|
14
|
+
<div className="context-value" data-contextvalue={contextValue} />
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
11
18
|
// eslint-disable-next-line react/prop-types
|
|
12
19
|
function ControlledSelectHeaderWrapper({ tableProps, selectProps, ...rest }) {
|
|
13
20
|
return (
|
|
@@ -18,13 +25,6 @@ function ControlledSelectHeaderWrapper({ tableProps, selectProps, ...rest }) {
|
|
|
18
25
|
);
|
|
19
26
|
}
|
|
20
27
|
|
|
21
|
-
function DataTableContextChild() {
|
|
22
|
-
const contextValue = useContext(DataTableContext);
|
|
23
|
-
return (
|
|
24
|
-
<div className="context-value" data-contextvalue={contextValue} />
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
28
|
const mockToggleAllPageRowsSelectedProps = jest.fn();
|
|
29
29
|
const rows = [{ id: 1 }, { id: 2 }];
|
|
30
30
|
const tableProps = {
|
package/src/IconButton/index.tsx
CHANGED
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { type Placement } from 'react-bootstrap/Overlay';
|
|
5
|
-
import Icon from '../Icon';
|
|
6
5
|
import { OverlayTrigger } from '../Overlay';
|
|
7
6
|
import Tooltip from '../Tooltip';
|
|
7
|
+
import Icon from '../Icon';
|
|
8
8
|
|
|
9
9
|
interface Props extends React.HTMLAttributes<HTMLButtonElement> {
|
|
10
10
|
iconAs?: React.ComponentType<any>,
|
package/src/Menu/SelectMenu.jsx
CHANGED
|
@@ -15,6 +15,7 @@ function SelectMenu({
|
|
|
15
15
|
children,
|
|
16
16
|
className,
|
|
17
17
|
variant,
|
|
18
|
+
disabled,
|
|
18
19
|
...props
|
|
19
20
|
}) {
|
|
20
21
|
const [triggerTarget, setTriggerTarget] = useState(null);
|
|
@@ -89,6 +90,7 @@ function SelectMenu({
|
|
|
89
90
|
variant={variant}
|
|
90
91
|
iconAfter={ExpandMore}
|
|
91
92
|
onClick={open}
|
|
93
|
+
disabled={disabled}
|
|
92
94
|
>
|
|
93
95
|
{selected !== undefined && children[selected] ? children[selected].props.children : defaultMessage}
|
|
94
96
|
</Button>
|
|
@@ -131,12 +133,15 @@ SelectMenu.propTypes = {
|
|
|
131
133
|
className: PropTypes.string,
|
|
132
134
|
/** Specifies variant to use. */
|
|
133
135
|
variant: PropTypes.string,
|
|
136
|
+
/** Specifies if the `SelectMenu` is disabled. */
|
|
137
|
+
disabled: PropTypes.bool,
|
|
134
138
|
};
|
|
135
139
|
|
|
136
140
|
SelectMenu.defaultProps = {
|
|
137
141
|
defaultMessage: SELECT_MENU_DEFAULT_MESSAGE,
|
|
138
142
|
className: undefined,
|
|
139
143
|
variant: 'outline-primary',
|
|
144
|
+
disabled: false,
|
|
140
145
|
};
|
|
141
146
|
|
|
142
147
|
const SelectMenuWithDeprecatedProp = withDeprecatedProps(SelectMenu, 'SelectMenu', {
|
|
@@ -58,6 +58,12 @@ describe('correct rendering', () => {
|
|
|
58
58
|
const button = screen.getByRole('button');
|
|
59
59
|
expect(button).toHaveClass('btn-brand');
|
|
60
60
|
});
|
|
61
|
+
|
|
62
|
+
it('renders as disabled', () => {
|
|
63
|
+
render(DefaultSelectMenu({ disabled: true }));
|
|
64
|
+
const button = screen.getByRole('button');
|
|
65
|
+
expect(button).toBeDisabled();
|
|
66
|
+
});
|
|
61
67
|
});
|
|
62
68
|
|
|
63
69
|
describe('mouse behavior & keyboard behavior', () => {
|
package/src/Menu/select-menu.md
CHANGED
|
@@ -56,3 +56,11 @@ The ``Modal`` brings focus to the first menu element upon the click of the trigg
|
|
|
56
56
|
<MenuItem>M. Hortens</MenuItem>
|
|
57
57
|
</SelectMenu>
|
|
58
58
|
```
|
|
59
|
+
|
|
60
|
+
## Disabled
|
|
61
|
+
|
|
62
|
+
```jsx live
|
|
63
|
+
<SelectMenu disabled>
|
|
64
|
+
<MenuItem>A Menu Item</MenuItem>
|
|
65
|
+
</SelectMenu>
|
|
66
|
+
```
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
interface ContextData {
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
isBlocking: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ModalContext = React.createContext<ContextData>({
|
|
5
10
|
onClose: () => {},
|
|
11
|
+
isOpen: false,
|
|
12
|
+
isBlocking: false,
|
|
6
13
|
});
|
|
7
14
|
|
|
8
15
|
function ModalContextProvider({
|
|
9
|
-
onClose,
|
|
16
|
+
onClose,
|
|
17
|
+
isOpen,
|
|
18
|
+
isBlocking = false,
|
|
19
|
+
children = null,
|
|
20
|
+
}: {
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
isOpen: boolean;
|
|
23
|
+
isBlocking?: boolean;
|
|
24
|
+
children?: React.ReactNode;
|
|
10
25
|
}) {
|
|
11
|
-
const modalContextValue = useMemo(
|
|
26
|
+
const modalContextValue = useMemo<ContextData>(
|
|
12
27
|
() => ({ onClose, isOpen, isBlocking }),
|
|
13
28
|
[onClose, isOpen, isBlocking],
|
|
14
29
|
);
|
|
@@ -20,17 +35,5 @@ function ModalContextProvider({
|
|
|
20
35
|
);
|
|
21
36
|
}
|
|
22
37
|
|
|
23
|
-
ModalContextProvider.propTypes = {
|
|
24
|
-
children: PropTypes.node,
|
|
25
|
-
onClose: PropTypes.func.isRequired,
|
|
26
|
-
isBlocking: PropTypes.bool,
|
|
27
|
-
isOpen: PropTypes.bool.isRequired,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
ModalContextProvider.defaultProps = {
|
|
31
|
-
children: null,
|
|
32
|
-
isBlocking: false,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
38
|
export { ModalContextProvider };
|
|
36
39
|
export default ModalContext;
|