@pega/cosmos-react-core 4.0.0-dev.14.2 → 4.0.0-dev.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +42 -3
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/utils.d.ts +2 -0
- package/lib/components/AppShell/utils.d.ts.map +1 -0
- package/lib/components/AppShell/utils.js +15 -0
- package/lib/components/AppShell/utils.js.map +1 -0
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +10 -5
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.js +10 -0
- package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +10 -40
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +2 -5
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +0 -2
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +1 -1
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +3 -2
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +3 -2
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +2 -2
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/ShortcutManager/Context.d.ts +8 -0
- package/lib/components/ShortcutManager/Context.d.ts.map +1 -0
- package/lib/components/ShortcutManager/Context.js +6 -0
- package/lib/components/ShortcutManager/Context.js.map +1 -0
- package/lib/components/ShortcutManager/ShortcutManager.d.ts +17 -0
- package/lib/components/ShortcutManager/ShortcutManager.d.ts.map +1 -0
- package/lib/components/ShortcutManager/ShortcutManager.js +88 -0
- package/lib/components/ShortcutManager/ShortcutManager.js.map +1 -0
- package/lib/components/ShortcutManager/ShortcutManager.types.d.ts +30 -0
- package/lib/components/ShortcutManager/ShortcutManager.types.d.ts.map +1 -0
- package/lib/components/ShortcutManager/ShortcutManager.types.js +2 -0
- package/lib/components/ShortcutManager/ShortcutManager.types.js.map +1 -0
- package/lib/components/ShortcutManager/index.d.ts +4 -0
- package/lib/components/ShortcutManager/index.d.ts.map +1 -0
- package/lib/components/ShortcutManager/index.js +3 -0
- package/lib/components/ShortcutManager/index.js.map +1 -0
- package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
- package/lib/components/SkipLinks/SkipLinks.js +53 -13
- package/lib/components/SkipLinks/SkipLinks.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +1 -1
- package/lib/components/TextArea/TextArea.js +2 -2
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.js +10 -4
- package/lib/hooks/useAutoResize.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +32 -5
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useShortcut.d.ts +12 -0
- package/lib/hooks/useShortcut.d.ts.map +1 -0
- package/lib/hooks/useShortcut.js +23 -0
- package/lib/hooks/useShortcut.js.map +1 -0
- package/lib/hooks/useShortcutManager.d.ts +4 -0
- package/lib/hooks/useShortcutManager.d.ts.map +1 -0
- package/lib/hooks/useShortcutManager.js +12 -0
- package/lib/hooks/useShortcutManager.js.map +1 -0
- package/lib/i18n/default.d.ts +32 -5
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +40 -11
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +32 -5
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/register-contexts.js +2 -0
- package/lib/register-contexts.js.map +1 -1
- package/lib/theme/theme.d.ts +4 -4
- package/lib/theme/themeDefinition.json +4 -4
- package/lib/utils/focusHeadingOrContainer.d.ts +1 -1
- package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -1
- package/lib/utils/focusHeadingOrContainer.js +2 -1
- package/lib/utils/focusHeadingOrContainer.js.map +1 -1
- package/package.json +2 -1
|
@@ -319,14 +319,14 @@
|
|
|
319
319
|
"$type": "literal",
|
|
320
320
|
"$value": 4000
|
|
321
321
|
},
|
|
322
|
-
"toast": {
|
|
323
|
-
"$type": "literal",
|
|
324
|
-
"$value": 5000
|
|
325
|
-
},
|
|
326
322
|
"backdrop": {
|
|
327
323
|
"$type": "literal",
|
|
328
324
|
"$value": 7000
|
|
329
325
|
},
|
|
326
|
+
"toast": {
|
|
327
|
+
"$type": "literal",
|
|
328
|
+
"$value": 8000
|
|
329
|
+
},
|
|
330
330
|
"tooltip": {
|
|
331
331
|
"$type": "literal",
|
|
332
332
|
"$value": 9000
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* @param container Node to query for a heading.
|
|
4
4
|
* @param label Fallback label to apply to the container if focused.
|
|
5
5
|
*/
|
|
6
|
-
declare const focusHeadingOrContainer: (container: ParentNode, label: string) =>
|
|
6
|
+
declare const focusHeadingOrContainer: (container: ParentNode, label: string) => boolean;
|
|
7
7
|
export default focusHeadingOrContainer;
|
|
8
8
|
//# sourceMappingURL=focusHeadingOrContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusHeadingOrContainer.d.ts","sourceRoot":"","sources":["../../src/utils/focusHeadingOrContainer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,cAAe,UAAU,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"focusHeadingOrContainer.d.ts","sourceRoot":"","sources":["../../src/utils/focusHeadingOrContainer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,cAAe,UAAU,SAAS,MAAM,KAAG,OAmCvE,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -7,7 +7,7 @@ const focusHeadingOrContainer = (container, label) => {
|
|
|
7
7
|
const heading = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].reduce((el, tag) => el ?? container.querySelector(tag), null);
|
|
8
8
|
const target = heading ?? container;
|
|
9
9
|
if (!(target instanceof HTMLElement || target instanceof SVGElement))
|
|
10
|
-
return;
|
|
10
|
+
return false;
|
|
11
11
|
if (target === container && !target.hasAttribute('aria-label')) {
|
|
12
12
|
target.setAttribute('aria-label', label);
|
|
13
13
|
target.addEventListener('focusout', () => {
|
|
@@ -24,6 +24,7 @@ const focusHeadingOrContainer = (container, label) => {
|
|
|
24
24
|
target.removeAttribute('tabindex');
|
|
25
25
|
}, { once: true });
|
|
26
26
|
}
|
|
27
|
+
return document.activeElement === target;
|
|
27
28
|
};
|
|
28
29
|
export default focusHeadingOrContainer;
|
|
29
30
|
//# sourceMappingURL=focusHeadingOrContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusHeadingOrContainer.js","sourceRoot":"","sources":["../../src/utils/focusHeadingOrContainer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,CA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AE,CACf,CAAC;KACH;IACD,OAAO,QAAQ,CAAC,aAAa,KAAK,MAAM,CAAC;AAC3C,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["/**\n * Focuses the highest level heading element in a container, or the container itself if there are no headings.\n * @param container Node to query for a heading.\n * @param label Fallback label to apply to the container if focused.\n */\nconst focusHeadingOrContainer = (container: ParentNode, label: string): boolean => {\n const heading = (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const).reduce<HTMLHeadingElement | null>(\n (el, tag) => el ?? container.querySelector(tag),\n null\n );\n\n const target = heading ?? container;\n\n if (!(target instanceof HTMLElement || target instanceof SVGElement)) return false;\n\n if (target === container && !target.hasAttribute('aria-label')) {\n target.setAttribute('aria-label', label);\n target.addEventListener(\n 'focusout',\n () => {\n target.removeAttribute('aria-label');\n },\n { once: true }\n );\n }\n\n if (target.hasAttribute('tabindex')) {\n target.focus();\n } else {\n target.setAttribute('tabindex', '-1');\n target.focus();\n target.addEventListener(\n 'focusout',\n () => {\n target.removeAttribute('tabindex');\n },\n { once: true }\n );\n }\n return document.activeElement === target;\n};\n\nexport default focusHeadingOrContainer;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-core",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.15.0",
|
|
4
4
|
"description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"react-color": "^2.19.3",
|
|
48
48
|
"react-dom": "^16.14.0 || ^17.0.0",
|
|
49
49
|
"react-popper": "^2.2.5",
|
|
50
|
+
"shortcuts": "^2.0.3",
|
|
50
51
|
"styled-components": "^5.2.0"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|