@openedx/paragon 22.0.0-alpha.23 → 22.0.0-alpha.25
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/bin/paragon-scripts.js +1 -1
- package/dist/Button/index.js +2 -2
- package/dist/Button/index.js.map +1 -1
- package/dist/Button/index.scss +3 -3
- package/dist/ColorPicker/index.js +48 -18
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/Container/index.js +6 -2
- package/dist/Container/index.js.map +1 -1
- package/dist/DataTable/index.js +2 -1
- package/dist/DataTable/index.js.map +1 -1
- package/dist/DataTable/selection/BaseSelectionStatus.js +3 -2
- package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropzone/index.js +2 -3
- package/dist/Dropzone/index.js.map +1 -1
- package/dist/Form/FormAutosuggest.js +9 -4
- package/dist/Form/FormAutosuggest.js.map +1 -1
- package/dist/Form/FormSwitch.js +3 -0
- package/dist/Form/FormSwitch.js.map +1 -1
- package/dist/Hyperlink/index.js +7 -6
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Icon/index.js +18 -11
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.js +1 -1
- package/dist/IconButton/index.js.map +1 -1
- package/dist/Layout/index.js.map +1 -1
- package/dist/Menu/MenuItem.js +2 -2
- package/dist/Menu/MenuItem.js.map +1 -1
- package/dist/Modal/ModalDialog.js +3 -0
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Popover/index.js +8 -8
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.js +10 -8
- package/dist/ProductTour/Checkpoint.js.map +1 -1
- package/dist/ProductTour/messages.js +16 -0
- package/dist/SearchField/SearchFieldAdvanced.js +12 -7
- package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
- package/dist/SearchField/SearchFieldLabel.js +3 -3
- package/dist/SearchField/SearchFieldLabel.js.map +1 -1
- package/dist/SearchField/index.js +0 -1
- package/dist/SearchField/index.js.map +1 -1
- package/dist/Tabs/index.js +13 -13
- package/dist/Tabs/index.js.map +1 -1
- package/dist/core.css +8 -6
- package/dist/core.css.map +1 -1
- package/dist/core.min.css +1 -1
- package/dist/hooks/useIndexOfLastVisibleChild.js +33 -38
- package/dist/hooks/useIndexOfLastVisibleChild.js.map +1 -1
- package/dist/i18n/messages/ar.json +2 -1
- package/dist/i18n/messages/ca.json +2 -1
- package/dist/i18n/messages/es_419.json +2 -1
- package/dist/i18n/messages/es_AR.json +2 -1
- package/dist/i18n/messages/es_ES.json +2 -1
- package/dist/i18n/messages/fr.json +2 -1
- package/dist/i18n/messages/he.json +2 -1
- package/dist/i18n/messages/id.json +2 -1
- package/dist/i18n/messages/it_IT.json +2 -1
- package/dist/i18n/messages/ko_KR.json +2 -1
- package/dist/i18n/messages/pl.json +2 -1
- package/dist/i18n/messages/pt_BR.json +2 -1
- package/dist/i18n/messages/pt_PT.json +2 -1
- package/dist/i18n/messages/ru.json +2 -1
- package/dist/i18n/messages/th.json +2 -1
- package/dist/i18n/messages/tr_TR.json +2 -1
- package/dist/i18n/messages/uk.json +2 -1
- package/dist/i18n/messages/zh_CN.json +2 -1
- package/dist/light.css +11 -11
- package/dist/light.css.map +1 -1
- package/dist/light.min.css +1 -1
- package/icons/es5/RightSidebarFilled.js +15 -0
- package/icons/es5/RightSidebarOutlined.js +15 -0
- package/icons/es5/index.js +2 -0
- package/icons/jsx/RightSidebarFilled.jsx +19 -0
- package/icons/jsx/RightSidebarOutlined.jsx +19 -0
- package/icons/jsx/index.jsx +2 -0
- package/icons/svg/right_sidebar_filled.svg +3 -0
- package/icons/svg/right_sidebar_outlined.svg +3 -0
- package/lib/utils.js +23 -2
- package/package.json +3 -3
- package/src/Button/README.md +94 -68
- package/src/Button/index.jsx +2 -2
- package/src/Button/index.scss +3 -3
- package/src/ColorPicker/ColorPicker.test.jsx +24 -2
- package/src/ColorPicker/index.jsx +56 -16
- package/src/Container/index.jsx +4 -0
- package/src/DataTable/README.md +3 -3
- package/src/DataTable/index.jsx +2 -1
- package/src/DataTable/selection/BaseSelectionStatus.jsx +2 -2
- package/src/DataTable/tablefilters.mdx +3 -3
- package/src/DataTable/tests/DataTable.test.jsx +31 -0
- package/src/Dropdown/index.jsx +4 -0
- package/src/Dropzone/index.jsx +2 -3
- package/src/Form/FormAutosuggest.jsx +11 -5
- package/src/Form/FormSwitch.jsx +3 -0
- package/src/Form/form-autosuggest.mdx +80 -72
- package/src/Form/tests/FormAutosuggest.test.jsx +21 -0
- package/src/Hyperlink/index.jsx +7 -6
- package/src/Icon/index.jsx +18 -11
- package/src/IconButton/index.jsx +1 -1
- package/src/Layout/index.jsx +1 -4
- package/src/Menu/MenuItem.jsx +2 -2
- package/src/Modal/ModalDialog.jsx +3 -0
- package/src/Overlay/README.md +1 -1
- package/src/Popover/README.md +0 -1
- package/src/Popover/index.jsx +11 -11
- package/src/ProductTour/Checkpoint.jsx +9 -6
- package/src/ProductTour/messages.js +16 -0
- package/src/SearchField/SearchFieldAdvanced.jsx +12 -7
- package/src/SearchField/SearchFieldLabel.jsx +3 -3
- package/src/SearchField/index.jsx +0 -1
- package/src/SelectableBox/tests/SelectableBoxSet.test.jsx +1 -1
- package/src/Tabs/index.jsx +19 -13
- package/src/hooks/tests/useIndexOfLastVisibleChild.test.jsx +3 -3
- package/src/hooks/useIndexOfLastVisibleChild.jsx +36 -38
- package/src/hooks/useIndexOfLastVisibleChild.mdx +3 -3
- package/src/i18n/messages/ar.json +2 -1
- package/src/i18n/messages/ca.json +2 -1
- package/src/i18n/messages/es_419.json +2 -1
- package/src/i18n/messages/es_AR.json +2 -1
- package/src/i18n/messages/es_ES.json +2 -1
- package/src/i18n/messages/fr.json +2 -1
- package/src/i18n/messages/he.json +2 -1
- package/src/i18n/messages/id.json +2 -1
- package/src/i18n/messages/it_IT.json +2 -1
- package/src/i18n/messages/ko_KR.json +2 -1
- package/src/i18n/messages/pl.json +2 -1
- package/src/i18n/messages/pt_BR.json +2 -1
- package/src/i18n/messages/pt_PT.json +2 -1
- package/src/i18n/messages/ru.json +2 -1
- package/src/i18n/messages/th.json +2 -1
- package/src/i18n/messages/tr_TR.json +2 -1
- package/src/i18n/messages/uk.json +2 -1
- package/src/i18n/messages/zh_CN.json +2 -1
- package/styles/css/core/variables.css +5 -3
- package/styles/css/themes/light/variables.css +11 -11
- package/tokens/src/core/components/Button/core.json +8 -4
- package/tokens/src/themes/light/alias/color.json +10 -10
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
const messages = defineMessages({
|
|
4
|
+
topPositionText: {
|
|
5
|
+
id: 'pgn.ProductTour.Checkpoint.top-position-text',
|
|
6
|
+
defaultMessage: 'Top of step {step}',
|
|
7
|
+
description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.',
|
|
8
|
+
},
|
|
9
|
+
bottomPositionText: {
|
|
10
|
+
id: 'pgn.ProductTour.Checkpoint.bottom-position-text',
|
|
11
|
+
defaultMessage: 'Bottom of step {step}',
|
|
12
|
+
description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export default messages;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
import React, {
|
|
3
2
|
useRef, createContext, useState, useEffect,
|
|
4
3
|
} from 'react';
|
|
@@ -138,27 +137,32 @@ SearchFieldAdvanced.propTypes = {
|
|
|
138
137
|
onSubmit: PropTypes.func.isRequired,
|
|
139
138
|
/** specifies a custom class name. */
|
|
140
139
|
className: PropTypes.string,
|
|
141
|
-
/** specifies a callback function for when the user loses focus in the `SearchField` component.
|
|
140
|
+
/** specifies a callback function for when the user loses focus in the `SearchField` component.
|
|
141
|
+
* The default is an empty function. For example:
|
|
142
142
|
```jsx
|
|
143
143
|
<SearchField onBlur={event => console.log(event)} />
|
|
144
144
|
``` */
|
|
145
145
|
onBlur: PropTypes.func,
|
|
146
|
-
/** specifies a callback function for when the value in `SearchField` is changed by the user.
|
|
146
|
+
/** specifies a callback function for when the value in `SearchField` is changed by the user.
|
|
147
|
+
* The default is an empty function. For example:
|
|
147
148
|
```jsx
|
|
148
149
|
<SearchField onChange={value => console.log(value)} />
|
|
149
150
|
``` */
|
|
150
151
|
onChange: PropTypes.func,
|
|
151
|
-
/** specifies a callback function for when the value in `SearchField` is cleared by the user.
|
|
152
|
+
/** specifies a callback function for when the value in `SearchField` is cleared by the user.
|
|
153
|
+
* The default is an empty function. For example:
|
|
152
154
|
```jsx
|
|
153
155
|
<SearchField onClear={() => console.log('search cleared')} />
|
|
154
156
|
``` */
|
|
155
157
|
onClear: PropTypes.func,
|
|
156
|
-
/** specifies a callback function for when the user focuses in the `SearchField` component.
|
|
158
|
+
/** specifies a callback function for when the user focuses in the `SearchField` component.
|
|
159
|
+
* The default is an empty function. For example:
|
|
157
160
|
```jsx
|
|
158
161
|
<SearchField onFocus={event => console.log(event)} />
|
|
159
162
|
``` */
|
|
160
163
|
onFocus: PropTypes.func,
|
|
161
|
-
/** specifies the screenreader text for both the clear and submit buttons (e.g., for i18n translations).
|
|
164
|
+
/** specifies the screenreader text for both the clear and submit buttons (e.g., for i18n translations).
|
|
165
|
+
* The default is `{ label: 'search', clearButton: 'clear search', searchButton: 'submit search' }`. */
|
|
162
166
|
screenReaderText: PropTypes.shape({
|
|
163
167
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
|
164
168
|
submitButton: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
|
@@ -171,7 +175,8 @@ SearchFieldAdvanced.propTypes = {
|
|
|
171
175
|
submit: PropTypes.element.isRequired,
|
|
172
176
|
clear: PropTypes.element,
|
|
173
177
|
}),
|
|
174
|
-
/** specifies the aria-label attribute on the form element. This is useful if you use the `SearchField` component
|
|
178
|
+
/** specifies the aria-label attribute on the form element. This is useful if you use the `SearchField` component
|
|
179
|
+
* more than once on a page. */
|
|
175
180
|
formAriaLabel: PropTypes.string,
|
|
176
181
|
/** Specifies whether the `SearchField` is disabled. */
|
|
177
182
|
disabled: PropTypes.bool,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
import React, { useContext } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import classNames from 'classnames';
|
|
@@ -21,8 +20,9 @@ function SearchFieldLabel({ children, ...props }) {
|
|
|
21
20
|
|
|
22
21
|
SearchFieldLabel.propTypes = {
|
|
23
22
|
/**
|
|
24
|
-
* specifies the label to use for the input field (e.g., for i18n translations).
|
|
25
|
-
* a screenreader-only label will be used in
|
|
23
|
+
* specifies the label to use for the input field (e.g., for i18n translations).
|
|
24
|
+
* Note: if `children` is not provided, a screenreader-only label will be used in
|
|
25
|
+
* its placed based on the `screenReaderText.label` prop for `SearchField.Advanced`.
|
|
26
26
|
*/
|
|
27
27
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
28
28
|
};
|
package/src/Tabs/index.jsx
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
useEffect,
|
|
3
|
+
useMemo,
|
|
4
|
+
useRef,
|
|
5
|
+
useState,
|
|
6
|
+
useCallback,
|
|
7
|
+
} from 'react';
|
|
2
8
|
import classNames from 'classnames';
|
|
3
9
|
import PropTypes from 'prop-types';
|
|
4
10
|
import BaseTabs from 'react-bootstrap/Tabs';
|
|
@@ -17,15 +23,15 @@ function Tabs({
|
|
|
17
23
|
activeKey,
|
|
18
24
|
...props
|
|
19
25
|
}) {
|
|
20
|
-
const containerElementRef =
|
|
26
|
+
const [containerElementRef, setContainerElementRef] = useState(null);
|
|
21
27
|
const overflowElementRef = useRef(null);
|
|
22
28
|
const indexOfLastVisibleChild = useIndexOfLastVisibleChild(
|
|
23
|
-
containerElementRef
|
|
29
|
+
containerElementRef?.firstChild,
|
|
24
30
|
overflowElementRef.current?.parentNode,
|
|
25
31
|
);
|
|
26
32
|
|
|
27
33
|
useEffect(() => {
|
|
28
|
-
if (containerElementRef
|
|
34
|
+
if (containerElementRef) {
|
|
29
35
|
const observer = new MutationObserver((mutations => {
|
|
30
36
|
mutations.forEach(mutation => {
|
|
31
37
|
// React-Bootstrap attribute 'data-rb-event-key' is responsible for the tab identification
|
|
@@ -34,8 +40,8 @@ function Tabs({
|
|
|
34
40
|
const isActive = mutation.target.getAttribute('aria-selected') === 'true';
|
|
35
41
|
// datakey attribute is added manually to the dropdown
|
|
36
42
|
// elements so that they correspond to the native tabs' eventKey
|
|
37
|
-
const element = containerElementRef.
|
|
38
|
-
const moreTab = containerElementRef.
|
|
43
|
+
const element = containerElementRef.querySelector(`[datakey='${eventKey}']`);
|
|
44
|
+
const moreTab = containerElementRef.querySelector('.pgn__tab_more');
|
|
39
45
|
if (isActive) {
|
|
40
46
|
element?.classList.add('active');
|
|
41
47
|
// Here we add active class to the 'More Tab' if element exists in the dropdown
|
|
@@ -49,13 +55,13 @@ function Tabs({
|
|
|
49
55
|
}
|
|
50
56
|
});
|
|
51
57
|
}));
|
|
52
|
-
observer.observe(containerElementRef
|
|
58
|
+
observer.observe(containerElementRef, {
|
|
53
59
|
attributes: true, subtree: true, attributeFilter: ['aria-selected'],
|
|
54
60
|
});
|
|
55
61
|
return () => observer.disconnect();
|
|
56
62
|
}
|
|
57
63
|
return undefined;
|
|
58
|
-
}, []);
|
|
64
|
+
}, [containerElementRef]);
|
|
59
65
|
|
|
60
66
|
useEffect(() => {
|
|
61
67
|
if (overflowElementRef.current?.parentNode) {
|
|
@@ -63,10 +69,10 @@ function Tabs({
|
|
|
63
69
|
}
|
|
64
70
|
}, [overflowElementRef.current?.parentNode]);
|
|
65
71
|
|
|
66
|
-
const handleDropdownTabClick = (eventKey) => {
|
|
67
|
-
const hiddenTab = containerElementRef.
|
|
72
|
+
const handleDropdownTabClick = useCallback((eventKey) => {
|
|
73
|
+
const hiddenTab = containerElementRef.querySelector(`[data-rb-event-key='${eventKey}']`);
|
|
68
74
|
hiddenTab.click();
|
|
69
|
-
};
|
|
75
|
+
}, [containerElementRef]);
|
|
70
76
|
|
|
71
77
|
const tabsChildren = useMemo(() => {
|
|
72
78
|
const indexOfOverflowStart = indexOfLastVisibleChild + 1;
|
|
@@ -164,10 +170,10 @@ function Tabs({
|
|
|
164
170
|
/>
|
|
165
171
|
));
|
|
166
172
|
return childrenList;
|
|
167
|
-
}, [activeKey, children, defaultActiveKey, indexOfLastVisibleChild, moreTabText]);
|
|
173
|
+
}, [activeKey, children, defaultActiveKey, indexOfLastVisibleChild, moreTabText, handleDropdownTabClick]);
|
|
168
174
|
|
|
169
175
|
return (
|
|
170
|
-
<div ref={
|
|
176
|
+
<div ref={setContainerElementRef}>
|
|
171
177
|
<BaseTabs
|
|
172
178
|
defaultActiveKey={defaultActiveKey}
|
|
173
179
|
activeKey={activeKey}
|
|
@@ -12,12 +12,12 @@ window.ResizeObserver = window.ResizeObserver
|
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
14
|
function TestComponent() {
|
|
15
|
-
const containerElementRef = React.
|
|
15
|
+
const [containerElementRef, setContainerElementRef] = React.useState(null);
|
|
16
16
|
const overflowElementRef = React.useRef(null);
|
|
17
|
-
const indexOfLastVisibleChild = useIndexOfLastVisibleChild(containerElementRef
|
|
17
|
+
const indexOfLastVisibleChild = useIndexOfLastVisibleChild(containerElementRef, overflowElementRef.current);
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<div ref={
|
|
20
|
+
<div ref={setContainerElementRef} style={{ display: 'flex' }}>
|
|
21
21
|
<div style={{ width: '250px' }} className="element">Element 1</div>
|
|
22
22
|
<div style={{ width: '250px' }} className="element">Element 2</div>
|
|
23
23
|
<div style={{ width: '250px' }} className="element">Element 3</div>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import useWindowSize from './useWindowSize';
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* This hook will find the index of the last child of a containing element
|
|
7
5
|
* that fits within its bounding rectangle. This is done by summing the widths
|
|
@@ -10,48 +8,48 @@ import useWindowSize from './useWindowSize';
|
|
|
10
8
|
* @param {Element} containerElementRef - container element
|
|
11
9
|
* @param {Element} overflowElementRef - overflow element
|
|
12
10
|
*
|
|
13
|
-
* The hook returns
|
|
14
|
-
* [indexOfLastVisibleChild, containerElementRef, overflowElementRef]
|
|
15
|
-
*
|
|
16
|
-
* indexOfLastVisibleChild - the index of the last visible child
|
|
17
|
-
* containerElementRef - a ref to be added to the containing html node
|
|
18
|
-
* overflowElementRef - a ref to be added to an html node inside the container
|
|
19
|
-
* that is likely to be used to contain a "More" type dropdown or other
|
|
20
|
-
* mechanism to reveal hidden children. The width of this element is always
|
|
21
|
-
* included when determining which children will fit or not. Usage of this ref
|
|
22
|
-
* is optional.
|
|
11
|
+
* The hook returns the index of the last visible child.
|
|
23
12
|
*/
|
|
24
13
|
const useIndexOfLastVisibleChild = (containerElementRef, overflowElementRef) => {
|
|
25
14
|
const [indexOfLastVisibleChild, setIndexOfLastVisibleChild] = useState(-1);
|
|
26
|
-
const windowSize = useWindowSize();
|
|
27
15
|
|
|
28
16
|
useLayoutEffect(() => {
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
function updateLastVisibleChildIndex() {
|
|
18
|
+
// Get array of child nodes from NodeList form
|
|
19
|
+
const childNodesArr = Array.prototype.slice.call(containerElementRef.children);
|
|
20
|
+
const { nextIndexOfLastVisibleChild } = childNodesArr
|
|
21
|
+
// filter out the overflow element
|
|
22
|
+
.filter(childNode => childNode !== overflowElementRef)
|
|
23
|
+
// sum the widths to find the last visible element's index
|
|
24
|
+
.reduce((acc, childNode, index) => {
|
|
25
|
+
acc.sumWidth += childNode.getBoundingClientRect().width;
|
|
26
|
+
if (acc.sumWidth <= containerElementRef.getBoundingClientRect().width) {
|
|
27
|
+
acc.nextIndexOfLastVisibleChild = index;
|
|
28
|
+
}
|
|
29
|
+
return acc;
|
|
30
|
+
}, {
|
|
31
|
+
// Include the overflow element's width to begin with. Doing this means
|
|
32
|
+
// sometimes we'll show a dropdown with one item in it when it would fit,
|
|
33
|
+
// but allowing this case dramatically simplifies the calculations we need
|
|
34
|
+
// to do above.
|
|
35
|
+
sumWidth: overflowElementRef ? overflowElementRef.getBoundingClientRect().width : 0,
|
|
36
|
+
nextIndexOfLastVisibleChild: -1,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
setIndexOfLastVisibleChild(nextIndexOfLastVisibleChild);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (containerElementRef) {
|
|
43
|
+
updateLastVisibleChildIndex();
|
|
44
|
+
|
|
45
|
+
const resizeObserver = new ResizeObserver(() => updateLastVisibleChildIndex());
|
|
46
|
+
resizeObserver.observe(containerElementRef);
|
|
47
|
+
|
|
48
|
+
return () => resizeObserver.disconnect();
|
|
31
49
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// filter out the overflow element
|
|
36
|
-
.filter(childNode => childNode !== overflowElementRef)
|
|
37
|
-
// sum the widths to find the last visible element's index
|
|
38
|
-
.reduce((acc, childNode, index) => {
|
|
39
|
-
acc.sumWidth += childNode.getBoundingClientRect().width;
|
|
40
|
-
if (acc.sumWidth <= containerElementRef.getBoundingClientRect().width) {
|
|
41
|
-
acc.nextIndexOfLastVisibleChild = index;
|
|
42
|
-
}
|
|
43
|
-
return acc;
|
|
44
|
-
}, {
|
|
45
|
-
// Include the overflow element's width to begin with. Doing this means
|
|
46
|
-
// sometimes we'll show a dropdown with one item in it when it would fit,
|
|
47
|
-
// but allowing this case dramatically simplifies the calculations we need
|
|
48
|
-
// to do above.
|
|
49
|
-
sumWidth: overflowElementRef ? overflowElementRef.getBoundingClientRect().width : 0,
|
|
50
|
-
nextIndexOfLastVisibleChild: -1,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
setIndexOfLastVisibleChild(nextIndexOfLastVisibleChild);
|
|
54
|
-
}, [windowSize, containerElementRef, overflowElementRef]);
|
|
50
|
+
|
|
51
|
+
return undefined;
|
|
52
|
+
}, [containerElementRef, overflowElementRef]);
|
|
55
53
|
|
|
56
54
|
return indexOfLastVisibleChild;
|
|
57
55
|
};
|
|
@@ -25,10 +25,10 @@ of the children until they exceed the width of the container.
|
|
|
25
25
|
pointerEvents: 'none',
|
|
26
26
|
visibility: 'hidden',
|
|
27
27
|
};
|
|
28
|
-
const containerElementRef = React.
|
|
28
|
+
const [containerElementRef, setContainerElementRef] = React.useState(null);
|
|
29
29
|
const overflowElementRef = React.useRef(null);
|
|
30
30
|
const indexOfLastVisibleChild = useIndexOfLastVisibleChild(
|
|
31
|
-
containerElementRef
|
|
31
|
+
containerElementRef,
|
|
32
32
|
overflowElementRef.current,
|
|
33
33
|
);
|
|
34
34
|
const elements = ['Element 1', 'Element 2', 'Element 3', 'Element 4', 'Element 5', 'Element 6', 'Element 7'];
|
|
@@ -71,7 +71,7 @@ of the children until they exceed the width of the container.
|
|
|
71
71
|
}, [indexOfLastVisibleChild]);
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
|
-
<div className="d-flex" ref={
|
|
74
|
+
<div className="d-flex" ref={setContainerElementRef}>
|
|
75
75
|
{children}
|
|
76
76
|
</div>
|
|
77
77
|
)
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "إغلاق قائمة الخيارات",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "فتح قائمة الخيارات",
|
|
30
30
|
"pgn.Toast.closeLabel": "إغلاق ",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Cerrar el menú de opciones",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Abre el menú de opciones",
|
|
30
30
|
"pgn.Toast.closeLabel": "Cerrar",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Cerrar el menú de opciones",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Abre el menú de opciones",
|
|
30
30
|
"pgn.Toast.closeLabel": "Cerrar",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Cerrar el menú de opciones",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Abre el menú de opciones",
|
|
30
30
|
"pgn.Toast.closeLabel": "Cerrar",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Chiudi",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Zamknij",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Fechar o menu de opções",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Abrir o menu de opções",
|
|
30
30
|
"pgn.Toast.closeLabel": "Fechar",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Seçenekler menüsünü kapat",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Seçenekler menüsünü aç",
|
|
30
30
|
"pgn.Toast.closeLabel": "Kapat",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"pgn.FormAutosuggest.iconButtonClosed": "Close the options menu",
|
|
29
29
|
"pgn.FormAutosuggest.iconButtonOpened": "Open the options menu",
|
|
30
30
|
"pgn.Toast.closeLabel": "Close",
|
|
31
|
-
"pgn.ProductTour.Checkpoint.position-text": "Top of step {step}"
|
|
31
|
+
"pgn.ProductTour.Checkpoint.top-position-text": "Top of step {step}",
|
|
32
|
+
"pgn.ProductTour.Checkpoint.bottom-position-text": "Bottom of step {step}"
|
|
32
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* IMPORTANT: This file is the result of assembling design tokens
|
|
3
3
|
* Do not edit directly
|
|
4
|
-
* Generated on
|
|
4
|
+
* Generated on Tue, 26 Dec 2023 14:13:40 GMT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
:root {
|
|
@@ -236,7 +236,6 @@
|
|
|
236
236
|
--pgn-spacing-card-margin-group: 12px;
|
|
237
237
|
--pgn-spacing-card-spacer-y: .75rem;
|
|
238
238
|
--pgn-spacing-card-spacer-x: 1.25rem;
|
|
239
|
-
--pgn-spacing-btn-focus-gap: 1px;
|
|
240
239
|
--pgn-spacing-btn-block-spacing-y: .5rem;
|
|
241
240
|
--pgn-spacing-bubble-expandable-padding-x: .25rem;
|
|
242
241
|
--pgn-spacing-bubble-expandable-padding-y: 0;
|
|
@@ -493,6 +492,7 @@
|
|
|
493
492
|
--pgn-spacing-card-margin-grid: var(--pgn-spacing-card-margin-group);
|
|
494
493
|
--pgn-spacing-card-margin-deck: var(--pgn-spacing-card-margin-group);
|
|
495
494
|
--pgn-spacing-btn-focus-border-gap: calc(var(--pgn-size-btn-focus-width) + var(--pgn-spacing-btn-focus-gap));
|
|
495
|
+
--pgn-spacing-btn-focus-gap: var(--pgn-size-btn-focus-width);
|
|
496
496
|
--pgn-spacing-btn-padding-x-sm: var(--pgn-spacing-input-btn-padding-sm-x);
|
|
497
497
|
--pgn-spacing-btn-padding-x-lg: var(--pgn-spacing-input-btn-padding-lg-x);
|
|
498
498
|
--pgn-spacing-btn-padding-x-base: var(--pgn-spacing-input-btn-padding-x);
|
|
@@ -584,7 +584,8 @@
|
|
|
584
584
|
--pgn-size-form-input-height-base: calc(var(--pgn-typography-form-input-line-height-base) * 1em + var(--pgn-spacing-form-input-padding-y-base) * 2 + var(--pgn-size-form-input-height-border));
|
|
585
585
|
--pgn-size-dropdown-border-radius-inner: calc(var(--pgn-size-dropdown-border-radius-base) - var(--pgn-size-dropdown-border-width));
|
|
586
586
|
--pgn-size-card-image-border-radius: var(--pgn-size-card-border-radius-base);
|
|
587
|
-
--pgn-size-btn-focus-border-radius:
|
|
587
|
+
--pgn-size-btn-focus-border-radius-sm: var(--pgn-size-btn-border-radius-base);
|
|
588
|
+
--pgn-size-btn-focus-border-radius-base: calc(var(--pgn-size-btn-border-radius-base) + var(--pgn-spacing-btn-focus-border-gap));
|
|
588
589
|
--pgn-size-btn-border-width: var(--pgn-size-input-btn-border-width);
|
|
589
590
|
--pgn-typography-form-control-file-font-weight: var(--pgn-typography-form-input-font-weight);
|
|
590
591
|
--pgn-typography-form-control-select-font-weight: var(--pgn-typography-form-input-font-weight);
|
|
@@ -600,5 +601,6 @@
|
|
|
600
601
|
--pgn-size-form-control-select-height-base: var(--pgn-size-form-input-height-base);
|
|
601
602
|
--pgn-size-form-input-height-border: calc(var(--pgn-size-form-input-width-border) * 2);
|
|
602
603
|
--pgn-size-form-input-height-lg: calc(var(--pgn-typography-form-input-line-height-lg) * 1em + var(--pgn-spacing-input-btn-padding-lg-y) * 2 + var(--pgn-size-form-input-height-border));
|
|
604
|
+
--pgn-size-btn-focus-border-radius-lg: var(--pgn-size-btn-focus-border-radius-base);
|
|
603
605
|
--pgn-size-form-control-select-height-lg: var(--pgn-size-form-input-height-lg);
|
|
604
606
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* IMPORTANT: This file is the result of assembling design tokens
|
|
3
3
|
* Do not edit directly
|
|
4
|
-
* Generated on
|
|
4
|
+
* Generated on Tue, 26 Dec 2023 14:13:40 GMT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
:root {
|
|
@@ -580,7 +580,6 @@
|
|
|
580
580
|
--pgn-color-alert-title: var(--pgn-color-black);
|
|
581
581
|
--pgn-color-theme-active-gray: var(--pgn-color-gray-900);
|
|
582
582
|
--pgn-color-theme-hover-gray: var(--pgn-color-gray-700);
|
|
583
|
-
--pgn-color-theme-focus-gray: var(--pgn-color-gray-300);
|
|
584
583
|
--pgn-color-theme-border-gray: var(--pgn-color-gray-200);
|
|
585
584
|
--pgn-color-theme-bg-gray: var(--pgn-color-gray-100);
|
|
586
585
|
--pgn-color-border: var(--pgn-color-gray-200);
|
|
@@ -1112,10 +1111,11 @@
|
|
|
1112
1111
|
--pgn-color-theme-default-light: var(--pgn-color-light-500);
|
|
1113
1112
|
--pgn-color-theme-default-brand: var(--pgn-color-brand-500);
|
|
1114
1113
|
--pgn-color-theme-default-primary: var(--pgn-color-primary-500);
|
|
1115
|
-
--pgn-color-theme-focus-
|
|
1116
|
-
--pgn-color-theme-focus-
|
|
1117
|
-
--pgn-color-theme-focus-
|
|
1118
|
-
--pgn-color-theme-focus-
|
|
1114
|
+
--pgn-color-theme-focus-gray: var(--pgn-color-gray-500);
|
|
1115
|
+
--pgn-color-theme-focus-dark: var(--pgn-color-dark-500);
|
|
1116
|
+
--pgn-color-theme-focus-light: var(--pgn-color-light-500);
|
|
1117
|
+
--pgn-color-theme-focus-brand: var(--pgn-color-brand-500);
|
|
1118
|
+
--pgn-color-theme-focus-primary: var(--pgn-color-primary-500);
|
|
1119
1119
|
--pgn-color-theme-border-dark: var(--pgn-color-dark-200);
|
|
1120
1120
|
--pgn-color-theme-border-light: var(--pgn-color-light-200);
|
|
1121
1121
|
--pgn-color-theme-border-brand: var(--pgn-color-brand-200);
|
|
@@ -1444,11 +1444,11 @@
|
|
|
1444
1444
|
--pgn-color-theme-default-info: var(--pgn-color-info-500);
|
|
1445
1445
|
--pgn-color-theme-default-success: var(--pgn-color-success-500);
|
|
1446
1446
|
--pgn-color-theme-default-secondary: var(--pgn-color-secondary-500);
|
|
1447
|
-
--pgn-color-theme-focus-danger: var(--pgn-color-danger-
|
|
1448
|
-
--pgn-color-theme-focus-warning: var(--pgn-color-warning-
|
|
1449
|
-
--pgn-color-theme-focus-info: var(--pgn-color-info-
|
|
1450
|
-
--pgn-color-theme-focus-success: var(--pgn-color-success-
|
|
1451
|
-
--pgn-color-theme-focus-secondary: var(--pgn-color-secondary-
|
|
1447
|
+
--pgn-color-theme-focus-danger: var(--pgn-color-danger-500);
|
|
1448
|
+
--pgn-color-theme-focus-warning: var(--pgn-color-warning-500);
|
|
1449
|
+
--pgn-color-theme-focus-info: var(--pgn-color-info-500);
|
|
1450
|
+
--pgn-color-theme-focus-success: var(--pgn-color-success-500);
|
|
1451
|
+
--pgn-color-theme-focus-secondary: var(--pgn-color-secondary-500);
|
|
1452
1452
|
--pgn-color-theme-border-danger: var(--pgn-color-danger-200);
|
|
1453
1453
|
--pgn-color-theme-border-warning: var(--pgn-color-warning-200);
|
|
1454
1454
|
--pgn-color-theme-border-info: var(--pgn-color-info-200);
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"spacing-y": { "value": ".5rem", "type": "dimension", "source": "$btn-block-spacing-y" }
|
|
28
28
|
},
|
|
29
29
|
"focus": {
|
|
30
|
-
"gap": { "value": "
|
|
30
|
+
"gap": { "value": "{size.btn.focus.width}", "type": "dimension", "source": "$btn-focus-gap" },
|
|
31
31
|
"border-gap": {
|
|
32
32
|
"value": "calc({size.btn.focus.width} + {spacing.btn.focus.gap})",
|
|
33
33
|
"type": "dimension",
|
|
@@ -88,9 +88,13 @@
|
|
|
88
88
|
"focus": {
|
|
89
89
|
"width": { "value": "2px", "type": "dimension", "source": "$btn-focus-width" },
|
|
90
90
|
"border-radius": {
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
"base": {
|
|
92
|
+
"value": "calc({size.btn.border.radius.base} + {spacing.btn.focus.border-gap})",
|
|
93
|
+
"type": "dimension",
|
|
94
|
+
"source": "$btn-focus-border-radius"
|
|
95
|
+
},
|
|
96
|
+
"lg": { "value": "{size.btn.focus.border-radius.base}", "type": "dimension", "source": "$btn-focus-border-radius-lg" },
|
|
97
|
+
"sm": { "value": "{size.btn.border.radius.base}", "type": "dimension", "source": "$btn-focus-border-radius-sm" }
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
}
|