@pega/cosmos-react-core 9.0.0-build.9.1 → 9.0.0-build.9.11

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.
Files changed (84) hide show
  1. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppHeader.js +4 -1
  3. package/lib/components/AppShell/AppHeader.js.map +1 -1
  4. package/lib/components/AppShell/ThemeSwitcher.d.ts +9 -0
  5. package/lib/components/AppShell/ThemeSwitcher.d.ts.map +1 -0
  6. package/lib/components/AppShell/ThemeSwitcher.js +58 -0
  7. package/lib/components/AppShell/ThemeSwitcher.js.map +1 -0
  8. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts +2 -0
  9. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts.map +1 -0
  10. package/lib/components/AppShell/ThemeSwitcher.test-ids.js +3 -0
  11. package/lib/components/AppShell/ThemeSwitcher.test-ids.js.map +1 -0
  12. package/lib/components/Configuration/Configuration.d.ts +6 -0
  13. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  14. package/lib/components/Configuration/Configuration.js +5 -1
  15. package/lib/components/Configuration/Configuration.js.map +1 -1
  16. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  17. package/lib/components/DateTime/Input/DateInput.js +6 -4
  18. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  19. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  20. package/lib/components/DateTime/Input/DateTimeInput.js +5 -3
  21. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  22. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  23. package/lib/components/DateTime/Input/WeekInput.js +6 -4
  24. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  25. package/lib/components/Dialog/InfoDialog.js +1 -1
  26. package/lib/components/Dialog/InfoDialog.js.map +1 -1
  27. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  28. package/lib/components/FieldGroup/FieldGroupList.js +4 -2
  29. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  30. package/lib/components/FieldGroup/FieldGroupList.utils.d.ts +1 -1
  31. package/lib/components/FieldGroup/FieldGroupList.utils.js +2 -2
  32. package/lib/components/FieldGroup/FieldGroupList.utils.js.map +1 -1
  33. package/lib/components/Icon/streamline-icons/mobius.icon.d.ts +5 -0
  34. package/lib/components/Icon/streamline-icons/mobius.icon.d.ts.map +1 -0
  35. package/lib/components/Icon/streamline-icons/mobius.icon.js +7 -0
  36. package/lib/components/Icon/streamline-icons/mobius.icon.js.map +1 -0
  37. package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
  38. package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
  39. package/lib/components/Icon/streamlineIconNames.js +1 -0
  40. package/lib/components/Icon/streamlineIconNames.js.map +1 -1
  41. package/lib/components/MetaList/MetaList.js +1 -1
  42. package/lib/components/MetaList/MetaList.js.map +1 -1
  43. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  44. package/lib/components/Popover/Popover.styles.js +18 -1
  45. package/lib/components/Popover/Popover.styles.js.map +1 -1
  46. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  47. package/lib/components/Popover/modifiers.js +10 -0
  48. package/lib/components/Popover/modifiers.js.map +1 -1
  49. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  50. package/lib/components/Tooltip/Tooltip.js +3 -1
  51. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  52. package/lib/hooks/useI18n.d.ts +40 -0
  53. package/lib/hooks/useI18n.d.ts.map +1 -1
  54. package/lib/hooks/useItemIntersection.d.ts +2 -1
  55. package/lib/hooks/useItemIntersection.d.ts.map +1 -1
  56. package/lib/hooks/useItemIntersection.js +10 -6
  57. package/lib/hooks/useItemIntersection.js.map +1 -1
  58. package/lib/hooks/useThemeMode.d.ts +10 -0
  59. package/lib/hooks/useThemeMode.d.ts.map +1 -0
  60. package/lib/hooks/useThemeMode.js +11 -0
  61. package/lib/hooks/useThemeMode.js.map +1 -0
  62. package/lib/i18n/default.d.ts +41 -0
  63. package/lib/i18n/default.d.ts.map +1 -1
  64. package/lib/i18n/default.js +44 -0
  65. package/lib/i18n/default.js.map +1 -1
  66. package/lib/i18n/i18n.d.ts +40 -0
  67. package/lib/i18n/i18n.d.ts.map +1 -1
  68. package/lib/styles/animations.d.ts +9 -0
  69. package/lib/styles/animations.d.ts.map +1 -0
  70. package/lib/styles/animations.js +78 -0
  71. package/lib/styles/animations.js.map +1 -0
  72. package/lib/styles/index.d.ts +1 -0
  73. package/lib/styles/index.d.ts.map +1 -1
  74. package/lib/styles/index.js +1 -0
  75. package/lib/styles/index.js.map +1 -1
  76. package/lib/utils/getFocusables.d.ts +4 -2
  77. package/lib/utils/getFocusables.d.ts.map +1 -1
  78. package/lib/utils/getFocusables.js +9 -7
  79. package/lib/utils/getFocusables.js.map +1 -1
  80. package/lib/utils/isInstance.d.ts +4 -4
  81. package/lib/utils/isInstance.d.ts.map +1 -1
  82. package/lib/utils/isInstance.js +20 -8
  83. package/lib/utils/isInstance.js.map +1 -1
  84. package/package.json +1 -1
@@ -144,6 +144,7 @@ export declare const DefaultTranslation: Readonly<Readonly<{
144
144
  select_noun: string;
145
145
  actions_for: string;
146
146
  edited: string;
147
+ deleted: string;
147
148
  done: string;
148
149
  uploading: string;
149
150
  loading: string;
@@ -271,6 +272,7 @@ export declare const DefaultTranslation: Readonly<Readonly<{
271
272
  app_shell_pin: string;
272
273
  app_shell_unpin: string;
273
274
  application_logo: string;
275
+ theme_mode: string;
274
276
  combobox_open_close: string;
275
277
  combobox_search_instructions: string;
276
278
  combobox_open_list_button_a11y: string;
@@ -317,6 +319,7 @@ export declare const DefaultTranslation: Readonly<Readonly<{
317
319
  choose_week: string;
318
320
  set_current_week_ally: string;
319
321
  auto_focus_next_input_description: string;
322
+ year_input_description: string;
320
323
  boolean_display_true_label: string;
321
324
  boolean_display_false_label: string;
322
325
  step_changed_to_name: string;
@@ -448,6 +451,11 @@ export declare const DefaultTranslation: Readonly<Readonly<{
448
451
  drag_handle_vertical_description: string;
449
452
  drag_handle_horizontal_description: string;
450
453
  drag_handle_tab_description: string;
454
+ add_button_description: string;
455
+ configure_button_description: string;
456
+ remove_button_description: string;
457
+ list_item_control_instructions: string;
458
+ list_item_nav_instructions: string;
451
459
  assignments: string;
452
460
  case: string;
453
461
  assignment: string;
@@ -605,12 +613,15 @@ export declare const DefaultTranslation: Readonly<Readonly<{
605
613
  rte_edit_image: string;
606
614
  rte_delete_image: string;
607
615
  rte_image_key_command: string;
616
+ important: string;
608
617
  expand_trail: string;
609
618
  collapse_trail: string;
610
619
  copy_to: string;
611
620
  subject_label: string;
612
621
  search_results: string;
613
622
  get_next_email: string;
623
+ mark_email_as_important: string;
624
+ email_attachment: string;
614
625
  feed_post_type: string;
615
626
  feed_new_post: string;
616
627
  feed_new_post_submit: string;
@@ -1347,6 +1358,26 @@ export declare const DefaultTranslation: Readonly<Readonly<{
1347
1358
  download_app: string;
1348
1359
  qr_code_not_available: string;
1349
1360
  qr_code: string;
1361
+ expand_all: string;
1362
+ collapse_all: string;
1363
+ expand_steps: string;
1364
+ collapse_steps: string;
1365
+ expand_step: string;
1366
+ collapse_step: string;
1367
+ expanded_step: string;
1368
+ collapsed_step: string;
1369
+ add_step: string;
1370
+ generate_comments: string;
1371
+ action_set: string;
1372
+ action_when: string;
1373
+ action_append: string;
1374
+ action_call: string;
1375
+ action_create: string;
1376
+ action_for_each: string;
1377
+ action_exit: string;
1378
+ action_return: string;
1379
+ action_remove: string;
1380
+ action_error_handler: string;
1350
1381
  app_header_notifications_empty: string;
1351
1382
  app_header_notifications_loading: string;
1352
1383
  open_app_header_notifications: string;
@@ -1514,6 +1545,9 @@ export declare const DefaultTranslation: Readonly<Readonly<{
1514
1545
  aggregation_average: string;
1515
1546
  aggregation_minimum: string;
1516
1547
  aggregation_maximum: string;
1548
+ select_chart_data_view: string;
1549
+ toggle_chart_element_visibility: string;
1550
+ chart_legend_items: string;
1517
1551
  add_to: string;
1518
1552
  namespace: string;
1519
1553
  decision_rule: string;
@@ -1531,6 +1565,12 @@ export declare const DefaultTranslation: Readonly<Readonly<{
1531
1565
  expression_datapage_general_error: string;
1532
1566
  expression_allowed_rules_error: string;
1533
1567
  expression_empty_error: string;
1568
+ cb_invalid_leaf_condition: string;
1569
+ cb_invalid_operand: string;
1570
+ cb_expression_node_null: string;
1571
+ cb_expression_node_missing: string;
1572
+ cb_invalid_unary_expression: string;
1573
+ cb_invalid_group_expression: string;
1534
1574
  ui_inspector: string;
1535
1575
  ui_inspector_iframe_title: string;
1536
1576
  ui_inspector_metadata: string;
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D,QAAA,MAAM,MAAM,GAAI,eAAe,WAAW,KAAG,QAAQ,CAAC,eAAe,CAEpE,CAAC;AACF,eAAe,MAAM,CAAC;AAEtB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAW,CAAC;AAiB3C,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,KAAG,KAAK,GAAG,KAErD,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const reveal: import("styled-components").Keyframes;
2
+ export declare const slideInXStart: import("styled-components").Keyframes;
3
+ export declare const slideInXEnd: import("styled-components").Keyframes;
4
+ export declare const slideInYStart: import("styled-components").Keyframes;
5
+ export declare const slideInYEnd: import("styled-components").Keyframes;
6
+ export declare const scaleIn: import("styled-components").Keyframes;
7
+ export declare const scaleOut: import("styled-components").Keyframes;
8
+ export declare const subProperties: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
9
+ //# sourceMappingURL=animations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/styles/animations.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,uCAQlB,CAAC;AAEF,eAAO,MAAM,aAAa,uCAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,uCAQvB,CAAC;AAEF,eAAO,MAAM,aAAa,uCAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,uCAQvB,CAAC;AAEF,eAAO,MAAM,OAAO,uCAQnB,CAAC;AAEF,eAAO,MAAM,QAAQ,uCAQpB,CAAC;AAEF,eAAO,MAAM,aAAa,oIAYzB,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { css, keyframes } from 'styled-components';
2
+ export const reveal = keyframes `
3
+ from {
4
+ opacity: 0;
5
+ }
6
+
7
+ to {
8
+ opacity: 1;
9
+ }
10
+ `;
11
+ export const slideInXStart = keyframes `
12
+ from {
13
+ translate: var(--slide-in-x-start-offset, -1rem) 0;
14
+ }
15
+
16
+ to {
17
+ translate: 0 0;
18
+ }
19
+ `;
20
+ export const slideInXEnd = keyframes `
21
+ from {
22
+ translate: var(--slide-in-x-end-offset, 1rem) 0;
23
+ }
24
+
25
+ to {
26
+ translate: 0 0;
27
+ }
28
+ `;
29
+ export const slideInYStart = keyframes `
30
+ from {
31
+ translate: 0 var(--slide-in-y-start-offset, -1rem);
32
+ }
33
+
34
+ to {
35
+ translate: 0 0;
36
+ }
37
+ `;
38
+ export const slideInYEnd = keyframes `
39
+ from {
40
+ translate: 0 var(--slide-in-y-end-offset, 1rem);
41
+ }
42
+
43
+ to {
44
+ translate: 0 0;
45
+ }
46
+ `;
47
+ export const scaleIn = keyframes `
48
+ from {
49
+ scale: var(--scale-in-size, 0);
50
+ }
51
+
52
+ to {
53
+ scale: 1;
54
+ }
55
+ `;
56
+ export const scaleOut = keyframes `
57
+ from {
58
+ scale: 1;
59
+ }
60
+
61
+ to {
62
+ scale: var(--scale-out-size, 0);
63
+ }
64
+ `;
65
+ export const subProperties = css `
66
+ ${({ theme }) => {
67
+ return css `
68
+ animation-duration: var(--animation-duration, ${theme.base.animation.speed});
69
+ animation-delay: var(--animation-delay, 0);
70
+ animation-fill-mode: var(--animation-fill-mode, both);
71
+ animation-timing-function: var(
72
+ --animation-timing-function,
73
+ ${theme.base.animation.timing.ease}
74
+ );
75
+ `;
76
+ }}
77
+ `;
78
+ //# sourceMappingURL=animations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animations.js","sourceRoot":"","sources":["../../src/styles/animations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAA;;;;;;;;CAQ9B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAA;;;;;;;;CAQnC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAA;;;;;;;;CAQnC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAA;;;;;;;;CAQ/B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAA;;;;;;;;CAQhC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;IAC5B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACd,OAAO,GAAG,CAAA;sDACwC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;;;;;UAKtE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;KAErC,CAAC;AACJ,CAAC;CACF,CAAC","sourcesContent":["import { css, keyframes } from 'styled-components';\n\nexport const reveal = keyframes`\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n`;\n\nexport const slideInXStart = keyframes`\n from {\n translate: var(--slide-in-x-start-offset, -1rem) 0;\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const slideInXEnd = keyframes`\n from {\n translate: var(--slide-in-x-end-offset, 1rem) 0;\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const slideInYStart = keyframes`\n from {\n translate: 0 var(--slide-in-y-start-offset, -1rem);\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const slideInYEnd = keyframes`\n from {\n translate: 0 var(--slide-in-y-end-offset, 1rem);\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const scaleIn = keyframes`\n from {\n scale: var(--scale-in-size, 0);\n }\n\n to {\n scale: 1;\n }\n`;\n\nexport const scaleOut = keyframes`\n from {\n scale: 1;\n }\n\n to {\n scale: var(--scale-out-size, 0);\n }\n`;\n\nexport const subProperties = css`\n ${({ theme }) => {\n return css`\n animation-duration: var(--animation-duration, ${theme.base.animation.speed});\n animation-delay: var(--animation-delay, 0);\n animation-fill-mode: var(--animation-fill-mode, both);\n animation-timing-function: var(\n --animation-timing-function,\n ${theme.base.animation.timing.ease}\n );\n `;\n }}\n`;\n"]}
@@ -1,4 +1,5 @@
1
1
  export * from './utils';
2
2
  export * from './gradients';
3
3
  export { default as GlobalStyle } from './GlobalStyle';
4
+ export * as animations from './animations';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './utils';
2
2
  export * from './gradients';
3
3
  export { default as GlobalStyle } from './GlobalStyle';
4
+ export * as animations from './animations';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export * from './utils';\nexport * from './gradients';\nexport { default as GlobalStyle } from './GlobalStyle';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC","sourcesContent":["export * from './utils';\nexport * from './gradients';\nexport { default as GlobalStyle } from './GlobalStyle';\nexport * as animations from './animations';\n"]}
@@ -1,14 +1,16 @@
1
1
  import type { RefObject } from 'react';
2
- export declare const focusableSelector = "a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]:not([tabindex=\"-1\"])";
2
+ export declare const focusableSelector = "a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]";
3
3
  /**
4
4
  * Returns all valid focusable elements within a given ref.
5
5
  * @param container The container element, or reference to the container element, to search for focusable elements within.
6
6
  * @param options
7
7
  * @param options.includeActiveEl If true, the active element will be included in the list, even if it does not match focusable criteria.
8
+ * @param options.includeNegativeTabIndex If true, elements with negative tabindex will be included in the list.
8
9
  * @returns A list of valid focusable elements within the given ref.
9
10
  */
10
- declare const getFocusables: (container: RefObject<ParentNode> | ParentNode, { includeActiveEl }?: {
11
+ declare const getFocusables: (container: RefObject<ParentNode> | ParentNode, { includeActiveEl, includeNegativeTabIndex }?: {
11
12
  includeActiveEl?: boolean;
13
+ includeNegativeTabIndex?: boolean;
12
14
  }) => HTMLElement[];
13
15
  export default getFocusables;
14
16
  //# sourceMappingURL=getFocusables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFocusables.d.ts","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,eAAO,MAAM,iBAAiB,2HAC0F,CAAC;AAEzH;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,GACjB,WAAW,SAAS,CAAC,UAAU,CAAC,GAAG,UAAU,EAC7C,sBAEG;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;CACtB,KACL,WAAW,EAiCb,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"getFocusables.d.ts","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,eAAO,MAAM,iBAAiB,oGACqE,CAAC;AAEpG;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,GACjB,WAAW,SAAS,CAAC,UAAU,CAAC,GAAG,UAAU,EAC7C,+CAGG;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC9B,KACL,WAAW,EAmCb,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,15 +1,16 @@
1
1
  import hasProp from './hasProp';
2
2
  import getActiveElement from './getActiveElement';
3
3
  import createUID from './createUID';
4
- export const focusableSelector = 'a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]:not([tabindex="-1"])';
4
+ export const focusableSelector = 'a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]';
5
5
  /**
6
6
  * Returns all valid focusable elements within a given ref.
7
7
  * @param container The container element, or reference to the container element, to search for focusable elements within.
8
8
  * @param options
9
9
  * @param options.includeActiveEl If true, the active element will be included in the list, even if it does not match focusable criteria.
10
+ * @param options.includeNegativeTabIndex If true, elements with negative tabindex will be included in the list.
10
11
  * @returns A list of valid focusable elements within the given ref.
11
12
  */
12
- const getFocusables = (container, { includeActiveEl = false } = {}) => {
13
+ const getFocusables = (container, { includeActiveEl = false, includeNegativeTabIndex = false } = {}) => {
13
14
  const uid = createUID();
14
15
  let activeId = uid;
15
16
  let activeEl = null;
@@ -25,11 +26,12 @@ const getFocusables = (container, { includeActiveEl = false } = {}) => {
25
26
  selector = `${selector}, [id="${activeId}"]`;
26
27
  }
27
28
  }
28
- const focusableElements = [...containerEl.querySelectorAll(selector)].filter(el => el instanceof HTMLElement &&
29
- (el.id === activeId ||
30
- (!el.hasAttribute('disabled') &&
31
- el.getAttribute('tabindex') !== '-1' &&
32
- !el.closest('[inert]'))));
29
+ const focusableElements = [...containerEl.querySelectorAll(selector)].filter(el => {
30
+ const passesTabIndex = includeNegativeTabIndex || el.getAttribute('tabindex') !== '-1';
31
+ return (el instanceof HTMLElement &&
32
+ (el.id === activeId ||
33
+ (!el.hasAttribute('disabled') && !el.closest('[inert]') && passesTabIndex)));
34
+ });
33
35
  if (activeEl?.id === uid) {
34
36
  activeEl.removeAttribute('id');
35
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getFocusables.js","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,sHAAsH,CAAC;AAEzH;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,CACpB,SAA6C,EAC7C,EACE,eAAe,GAAG,KAAK,KAGrB,EAAE,EACS,EAAE;IACjB,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,IAAI,QAAQ,GAAG,GAAG,CAAC;IACnB,IAAI,QAAQ,GAAwC,IAAI,CAAC;IAEzD,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAE5B,IAAI,QAAQ,GAAG,iBAAiB,CAAC;IAEjC,IAAI,eAAe,EAAE,CAAC;QACpB,QAAQ,GAAG,gBAAgB,EAAE,CAAC;QAC9B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,GAAG,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC;YAC9B,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC;YACvB,QAAQ,GAAG,GAAG,QAAQ,UAAU,QAAQ,IAAI,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,MAAM,iBAAiB,GAAI,CAAC,GAAG,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAmB,CAAC,MAAM,CAC7F,EAAE,CAAC,EAAE,CACH,EAAE,YAAY,WAAW;QACzB,CAAC,EAAE,CAAC,EAAE,KAAK,QAAQ;YACjB,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC;gBAC3B,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI;gBACpC,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAC/B,CAAC;IAEF,IAAI,QAAQ,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC;QACzB,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\nimport hasProp from './hasProp';\nimport getActiveElement from './getActiveElement';\nimport createUID from './createUID';\n\nexport const focusableSelector =\n 'a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Returns all valid focusable elements within a given ref.\n * @param container The container element, or reference to the container element, to search for focusable elements within.\n * @param options\n * @param options.includeActiveEl If true, the active element will be included in the list, even if it does not match focusable criteria.\n * @returns A list of valid focusable elements within the given ref.\n */\nconst getFocusables = (\n container: RefObject<ParentNode> | ParentNode,\n {\n includeActiveEl = false\n }: {\n includeActiveEl?: boolean;\n } = {}\n): HTMLElement[] => {\n const uid = createUID();\n let activeId = uid;\n let activeEl: ReturnType<typeof getActiveElement> = null;\n\n const containerEl = hasProp(container, 'current') ? container.current : container;\n if (!containerEl) return [];\n\n let selector = focusableSelector;\n\n if (includeActiveEl) {\n activeEl = getActiveElement();\n if (activeEl) {\n activeId = activeEl.id || uid;\n activeEl.id = activeId;\n selector = `${selector}, [id=\"${activeId}\"]`;\n }\n }\n\n const focusableElements = ([...containerEl.querySelectorAll(selector)] as HTMLElement[]).filter(\n el =>\n el instanceof HTMLElement &&\n (el.id === activeId ||\n (!el.hasAttribute('disabled') &&\n el.getAttribute('tabindex') !== '-1' &&\n !el.closest('[inert]')))\n );\n\n if (activeEl?.id === uid) {\n activeEl.removeAttribute('id');\n }\n\n return focusableElements;\n};\n\nexport default getFocusables;\n"]}
1
+ {"version":3,"file":"getFocusables.js","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,iGAAiG,CAAC;AAEpG;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,CACpB,SAA6C,EAC7C,EACE,eAAe,GAAG,KAAK,EACvB,uBAAuB,GAAG,KAAK,KAI7B,EAAE,EACS,EAAE;IACjB,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,IAAI,QAAQ,GAAG,GAAG,CAAC;IACnB,IAAI,QAAQ,GAAwC,IAAI,CAAC;IAEzD,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAE5B,IAAI,QAAQ,GAAG,iBAAiB,CAAC;IAEjC,IAAI,eAAe,EAAE,CAAC;QACpB,QAAQ,GAAG,gBAAgB,EAAE,CAAC;QAC9B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,GAAG,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC;YAC9B,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC;YACvB,QAAQ,GAAG,GAAG,QAAQ,UAAU,QAAQ,IAAI,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,MAAM,iBAAiB,GAAI,CAAC,GAAG,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAmB,CAAC,MAAM,CAC7F,EAAE,CAAC,EAAE;QACH,MAAM,cAAc,GAAG,uBAAuB,IAAI,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;QACvF,OAAO,CACL,EAAE,YAAY,WAAW;YACzB,CAAC,EAAE,CAAC,EAAE,KAAK,QAAQ;gBACjB,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,cAAc,CAAC,CAAC,CAC9E,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,IAAI,QAAQ,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC;QACzB,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\nimport hasProp from './hasProp';\nimport getActiveElement from './getActiveElement';\nimport createUID from './createUID';\n\nexport const focusableSelector =\n 'a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]';\n\n/**\n * Returns all valid focusable elements within a given ref.\n * @param container The container element, or reference to the container element, to search for focusable elements within.\n * @param options\n * @param options.includeActiveEl If true, the active element will be included in the list, even if it does not match focusable criteria.\n * @param options.includeNegativeTabIndex If true, elements with negative tabindex will be included in the list.\n * @returns A list of valid focusable elements within the given ref.\n */\nconst getFocusables = (\n container: RefObject<ParentNode> | ParentNode,\n {\n includeActiveEl = false,\n includeNegativeTabIndex = false\n }: {\n includeActiveEl?: boolean;\n includeNegativeTabIndex?: boolean;\n } = {}\n): HTMLElement[] => {\n const uid = createUID();\n let activeId = uid;\n let activeEl: ReturnType<typeof getActiveElement> = null;\n\n const containerEl = hasProp(container, 'current') ? container.current : container;\n if (!containerEl) return [];\n\n let selector = focusableSelector;\n\n if (includeActiveEl) {\n activeEl = getActiveElement();\n if (activeEl) {\n activeId = activeEl.id || uid;\n activeEl.id = activeId;\n selector = `${selector}, [id=\"${activeId}\"]`;\n }\n }\n\n const focusableElements = ([...containerEl.querySelectorAll(selector)] as HTMLElement[]).filter(\n el => {\n const passesTabIndex = includeNegativeTabIndex || el.getAttribute('tabindex') !== '-1';\n return (\n el instanceof HTMLElement &&\n (el.id === activeId ||\n (!el.hasAttribute('disabled') && !el.closest('[inert]') && passesTabIndex))\n );\n }\n );\n\n if (activeEl?.id === uid) {\n activeEl.removeAttribute('id');\n }\n\n return focusableElements;\n};\n\nexport default getFocusables;\n"]}
@@ -1,11 +1,11 @@
1
1
  /**
2
- * This function checks if an object is an instance of a given type.
2
+ * This function checks if an object is an instance of one of the given types.
3
3
  * It works similarly to the `instanceof` operator, but works across frame boundaries.
4
4
  *
5
5
  * @param obj The object to check.
6
- * @param type The constructor function or class to check against.
7
- * @returns True if the object is an instance of the given type, false otherwise.
6
+ * @param types The constructor functions or classes to check against.
7
+ * @returns True if the object is an instance of one of the given types, false otherwise.
8
8
  */
9
- declare const isInstance: <T>(obj: unknown, type: new (...args: never[]) => T) => obj is T;
9
+ declare const isInstance: <T extends (abstract new (...args: never[]) => unknown)[]>(obj: unknown, ...types: T) => obj is InstanceType<T[number]>;
10
10
  export default isInstance;
11
11
  //# sourceMappingURL=isInstance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isInstance.d.ts","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,QAAA,MAAM,UAAU,GAAI,CAAC,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAG,GAAG,IAAI,CAiB/E,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"isInstance.d.ts","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,QAAA,MAAM,UAAU,GAAI,CAAC,SAAS,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,EAAE,EAC1E,KAAK,OAAO,EACZ,GAAG,OAAO,CAAC,KACV,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAgC/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,20 +1,32 @@
1
+ const objTargetString = Object.prototype.toString();
1
2
  /**
2
- * This function checks if an object is an instance of a given type.
3
+ * This function checks if an object is an instance of one of the given types.
3
4
  * It works similarly to the `instanceof` operator, but works across frame boundaries.
4
5
  *
5
6
  * @param obj The object to check.
6
- * @param type The constructor function or class to check against.
7
- * @returns True if the object is an instance of the given type, false otherwise.
7
+ * @param types The constructor functions or classes to check against.
8
+ * @returns True if the object is an instance of one of the given types, false otherwise.
8
9
  */
9
- const isInstance = (obj, type) => {
10
- if (typeof obj !== 'object' || !obj)
10
+ const isInstance = (obj, ...types) => {
11
+ if (types.length === 0)
11
12
  return false;
12
- if (obj instanceof type)
13
+ if (!obj || (typeof obj !== 'object' && typeof obj !== 'function'))
14
+ return false;
15
+ if (types.some(type => obj instanceof type))
13
16
  return true;
14
- const targetString = Object.prototype.toString.call(type.prototype);
17
+ const targetStrings = new Set(types.flatMap(type => {
18
+ const str = Object.prototype.toString.call(type.prototype);
19
+ // If str is '[object Object]', but type.prototype is not Object.prototype bail to avoid false positives.
20
+ if (str === objTargetString && type.prototype !== Object.prototype) {
21
+ return [];
22
+ }
23
+ return str;
24
+ }));
25
+ if (targetStrings.size === 0)
26
+ return false;
15
27
  let current = obj;
16
28
  while (current) {
17
- if (Object.prototype.toString.call(current) === targetString) {
29
+ if (targetStrings.has(Object.prototype.toString.call(current))) {
18
30
  return true;
19
31
  }
20
32
  current = Object.getPrototypeOf(current);
@@ -1 +1 @@
1
- {"version":3,"file":"isInstance.js","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CAAI,GAAY,EAAE,IAAiC,EAAY,EAAE;IAClF,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IAElD,IAAI,GAAG,YAAY,IAAI;QAAE,OAAO,IAAI,CAAC;IAErC,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEpE,IAAI,OAAO,GAAkB,GAAG,CAAC;IACjC,OAAO,OAAO,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,YAAY,EAAE,CAAC;YAC7D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["/**\n * This function checks if an object is an instance of a given type.\n * It works similarly to the `instanceof` operator, but works across frame boundaries.\n *\n * @param obj The object to check.\n * @param type The constructor function or class to check against.\n * @returns True if the object is an instance of the given type, false otherwise.\n */\nconst isInstance = <T>(obj: unknown, type: new (...args: never[]) => T): obj is T => {\n if (typeof obj !== 'object' || !obj) return false;\n\n if (obj instanceof type) return true;\n\n const targetString = Object.prototype.toString.call(type.prototype);\n\n let current: object | null = obj;\n while (current) {\n if (Object.prototype.toString.call(current) === targetString) {\n return true;\n }\n\n current = Object.getPrototypeOf(current);\n }\n\n return false;\n};\n\nexport default isInstance;\n"]}
1
+ {"version":3,"file":"isInstance.js","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,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.toString();\n\n/**\n * This function checks if an object is an instance of one of the given types.\n * It works similarly to the `instanceof` operator, but works across frame boundaries.\n *\n * @param obj The object to check.\n * @param types The constructor functions or classes to check against.\n * @returns True if the object is an instance of one of the given types, false otherwise.\n */\nconst isInstance = <T extends (abstract new (...args: never[]) => unknown)[]>(\n obj: unknown,\n ...types: T\n): obj is InstanceType<T[number]> => {\n if (types.length === 0) return false;\n\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) return false;\n\n if (types.some(type => obj instanceof type)) return true;\n\n const targetStrings = new Set(\n types.flatMap(type => {\n const str = Object.prototype.toString.call(type.prototype);\n\n // If str is '[object Object]', but type.prototype is not Object.prototype bail to avoid false positives.\n if (str === objTargetString && type.prototype !== Object.prototype) {\n return [];\n }\n\n return str;\n })\n );\n\n if (targetStrings.size === 0) return false;\n\n let current: object | null = obj;\n while (current) {\n if (targetStrings.has(Object.prototype.toString.call(current))) {\n return true;\n }\n\n current = Object.getPrototypeOf(current);\n }\n\n return false;\n};\n\nexport default isInstance;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-core",
3
- "version": "9.0.0-build.9.1",
3
+ "version": "9.0.0-build.9.11",
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
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Pegasystems",