@qualtrics/ui-react 2.64.0 → 2.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/__shared/cjs/{index-9309d5c6.js → index-ca690be8.js} +169 -160
- package/dist/__shared/cjs/{index-13126351.js → index-d94c7702.js} +3 -3
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +2 -7
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/design-tokens/less/typography.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +34 -2
- package/dist/index.es.js +4 -1
- package/dist/index.js +5 -3
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +40 -8
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker.js +2 -1
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +12 -2
- package/dist/next/index.js +84 -52
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Translation/TranslationProvider.js +28 -18
- package/dist/utils/Translation/index.js +2 -2
- package/dist/utils/Translation/useTranslation.js +8 -6
- package/next/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"flyout":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._6wnMC{background-color:#fff;border-radius:4px;border:4px solid transparent;border-right:none;border-left:none;box-shadow:0 0 0 1px #eee,0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;max-width:500px;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._ncY9D{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;cursor:pointer;font-size:14px;color:#32363a;word-break:break-word;outline:none}._ncY9D._6iJyK._ncY9D:hover,._ncY9D._FNWJN{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._ncY9D._Pl-8h{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._ncY9D._Pl-8h._6iJyK._ncY9D._Pl-8h:hover,._ncY9D._Pl-8h._FNWJN{background-color:#e4effa}._ncY9D:active:not(._Pl-8h):not([aria-disabled=true]){background-color:#e8e9e9}._4KcGj ._VRMaY{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;font-size:12px;color:#32363a;font-weight:700;word-break:break-word}._4KcGj ._GSacl{display:none}._4KcGj:not(:first-child) ._GSacl{display:block;margin:3.5px 0}._wn-L8{width:100%;height:40px}";
|
|
4
|
+
var styles = {"flyout":"_6wnMC","flyoutOption":"_ncY9D","highlighted":"_FNWJN","hoverHighlight":"_6iJyK","selected":"_Pl-8h","flyoutHeader":"_4KcGj","headerContent":"_VRMaY","headerDivider":"_GSacl","flyoutSpinner":"_wn-L8"};
|
|
5
|
+
var stylesheet="._6wnMC{background-color:#fff;border-radius:4px;border:4px solid transparent;border-right:none;border-left:none;box-shadow:0 0 0 1px #eee,0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;max-width:500px;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._ncY9D{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;cursor:pointer;font-size:14px;color:#32363a;word-break:break-word;outline:none}._ncY9D._6iJyK._ncY9D:hover,._ncY9D._FNWJN{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._ncY9D._Pl-8h{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._ncY9D._Pl-8h._6iJyK._ncY9D._Pl-8h:hover,._ncY9D._Pl-8h._FNWJN{background-color:#e4effa}._ncY9D:active:not(._Pl-8h):not([aria-disabled=true]){background-color:#e8e9e9}._4KcGj ._VRMaY{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;font-size:12px;color:#32363a;font-weight:700;word-break:break-word}._4KcGj ._GSacl{display:none}._4KcGj:not(:first-child) ._GSacl{display:block;margin:3.5px 0}._wn-L8{width:100%;height:40px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -4,23 +4,33 @@ import '../createContextUtilities/index.js';
|
|
|
4
4
|
import createContextUtilities from '../createContextUtilities/createContextUtilities.js';
|
|
5
5
|
|
|
6
6
|
const fallbackLocalizedText = FALLBACK_LOCALIZED_TEXT;
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
const createTranslationProvider = () => {
|
|
8
|
+
const {
|
|
9
|
+
Provider: TranslationContextProvider,
|
|
10
|
+
useContext: useTranslationContext
|
|
11
|
+
} = createContextUtilities({
|
|
12
|
+
localizedText: {}
|
|
13
|
+
});
|
|
14
|
+
const TranslationProvider = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
localizedText,
|
|
17
|
+
children
|
|
18
|
+
} = _ref;
|
|
19
|
+
const translationContext = useMemo(() => ({
|
|
20
|
+
localizedText
|
|
21
|
+
}), [localizedText]);
|
|
22
|
+
return /*#__PURE__*/React__default.createElement(TranslationContextProvider, {
|
|
23
|
+
value: translationContext
|
|
24
|
+
}, children);
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
TranslationProvider,
|
|
28
|
+
useTranslationContext
|
|
29
|
+
};
|
|
24
30
|
};
|
|
31
|
+
const {
|
|
32
|
+
TranslationProvider,
|
|
33
|
+
useTranslationContext
|
|
34
|
+
} = createTranslationProvider();
|
|
25
35
|
|
|
26
|
-
export { TranslationProvider, fallbackLocalizedText, useTranslationContext };
|
|
36
|
+
export { TranslationProvider, createTranslationProvider, fallbackLocalizedText, useTranslationContext };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { TranslationProvider } from './TranslationProvider.js';
|
|
2
|
-
export { default as useTranslation } from './useTranslation.js';
|
|
1
|
+
export { TranslationProvider, createTranslationProvider } from './TranslationProvider.js';
|
|
2
|
+
export { default as useTranslation, useTranslationFactory } from './useTranslation.js';
|
|
3
3
|
export { default as Translate } from './Translate.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { fallbackLocalizedText, useTranslationContext } from './TranslationProvider.js';
|
|
3
3
|
import insertPlaceholders from './insertPlaceholders.js';
|
|
4
4
|
import containsComponentOrElement from './containsComponentOrElement.js';
|
|
5
5
|
|
|
@@ -13,10 +13,11 @@ const HAS_ERROR_BEEN_LOGGED_FOR_KEY = new Set();
|
|
|
13
13
|
* Returns a translate function.
|
|
14
14
|
* @returns A translate function.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
const useTranslationFactory = (fallback, useTranslationContextHook) => {
|
|
17
18
|
const {
|
|
18
19
|
localizedText
|
|
19
|
-
} =
|
|
20
|
+
} = useTranslationContextHook();
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Returns a translated string given a key and placeholders.
|
|
@@ -26,7 +27,7 @@ const useTranslation = () => {
|
|
|
26
27
|
*/
|
|
27
28
|
const translate = useCallback((key, placeholders) => {
|
|
28
29
|
const translatedText = localizedText === null || localizedText === void 0 ? void 0 : localizedText[key];
|
|
29
|
-
const fallbackText =
|
|
30
|
+
const fallbackText = fallback[key];
|
|
30
31
|
if (!translatedText && !HAS_ERROR_BEEN_LOGGED_FOR_KEY.has(key)) {
|
|
31
32
|
HAS_ERROR_BEEN_LOGGED_FOR_KEY.add(key);
|
|
32
33
|
if (fallbackText) {
|
|
@@ -45,10 +46,11 @@ const useTranslation = () => {
|
|
|
45
46
|
return compiledMessage.join('');
|
|
46
47
|
}
|
|
47
48
|
return text || "##".concat(key, "##");
|
|
48
|
-
}, [localizedText]);
|
|
49
|
+
}, [localizedText, fallback]);
|
|
49
50
|
return {
|
|
50
51
|
translate
|
|
51
52
|
};
|
|
52
53
|
};
|
|
54
|
+
const useTranslation = () => useTranslationFactory(fallbackLocalizedText, useTranslationContext);
|
|
53
55
|
|
|
54
|
-
export { useTranslation as default };
|
|
56
|
+
export { useTranslation as default, useTranslationFactory };
|
package/next/package.json
CHANGED