@haiilo/catalyst 10.31.0 → 10.31.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.
@@ -14,6 +14,12 @@ export declare class CatDropdown {
14
14
  private content;
15
15
  private trap?;
16
16
  private isOpen;
17
+ /**
18
+ * Tracking the origin of opening the dropdown and specify if initial focus should be set.
19
+ * Currently we set it only when the origin is keyboard.
20
+ * We might not need to track this in future when focus-visible support is improved across browsers
21
+ */
22
+ private hasInitialFocus;
17
23
  /**
18
24
  * The placement of the dropdown.
19
25
  */
@@ -38,6 +44,10 @@ export declare class CatDropdown {
38
44
  /**
39
45
  * No element in dropdown will receive focus when dropdown is open.
40
46
  * By default, the first element in tab order will receive a focus.
47
+ * @deprecated
48
+ * Using noInitialFocus property would be a bad practice from a11y perspective.
49
+ * We always want visible focus to jump inside the dropdown when user uses keyboard and noInitialFocus allows to turn it off which might introduce a bug.
50
+ * hasInitialFocus should resolve the cause of the original problem instead.
41
51
  */
42
52
  noInitialFocus: boolean;
43
53
  /**
@@ -59,8 +69,9 @@ export declare class CatDropdown {
59
69
  toggle(): Promise<void>;
60
70
  /**
61
71
  * Opens the dropdown.
72
+ * @param isFocusVisible is dropdown should receive visible focus when it's opened.
62
73
  */
63
- open(): Promise<void>;
74
+ open(isFocusVisible?: boolean): Promise<void>;
64
75
  /**
65
76
  * Closes the dropdown.
66
77
  */
@@ -69,6 +80,7 @@ export declare class CatDropdown {
69
80
  componentDidLoad(): void;
70
81
  private get contentId();
71
82
  private initTrigger;
83
+ private isEventOriginFromKeyboard;
72
84
  private initAnchor;
73
85
  private findTrigger;
74
86
  private update;
@@ -699,6 +699,7 @@ export namespace Components {
699
699
  "noAutoClose": boolean;
700
700
  /**
701
701
  * No element in dropdown will receive focus when dropdown is open. By default, the first element in tab order will receive a focus.
702
+ * @deprecated Using noInitialFocus property would be a bad practice from a11y perspective. We always want visible focus to jump inside the dropdown when user uses keyboard and noInitialFocus allows to turn it off which might introduce a bug. hasInitialFocus should resolve the cause of the original problem instead.
702
703
  */
703
704
  "noInitialFocus": boolean;
704
705
  /**
@@ -711,8 +712,9 @@ export namespace Components {
711
712
  "noReturnFocus": boolean;
712
713
  /**
713
714
  * Opens the dropdown.
715
+ * @param isFocusVisible is dropdown should receive visible focus when it's opened.
714
716
  */
715
- "open": () => Promise<void>;
717
+ "open": (isFocusVisible?: boolean) => Promise<void>;
716
718
  /**
717
719
  * Allow overflow when dropdown is open.
718
720
  */
@@ -3032,6 +3034,7 @@ declare namespace LocalJSX {
3032
3034
  "noAutoClose"?: boolean;
3033
3035
  /**
3034
3036
  * No element in dropdown will receive focus when dropdown is open. By default, the first element in tab order will receive a focus.
3037
+ * @deprecated Using noInitialFocus property would be a bad practice from a11y perspective. We always want visible focus to jump inside the dropdown when user uses keyboard and noInitialFocus allows to turn it off which might introduce a bug. hasInitialFocus should resolve the cause of the original problem instead.
3035
3038
  */
3036
3039
  "noInitialFocus"?: boolean;
3037
3040
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haiilo/catalyst",
3
- "version": "10.31.0",
3
+ "version": "10.31.1",
4
4
  "description": "Catalyst Design System",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "sanitize.css": "13.0.0",
40
40
  "tabbable": "6.2.0",
41
41
  "toastify-js": "1.12.0",
42
- "@haiilo/catalyst-tokens": "10.31.0"
42
+ "@haiilo/catalyst-tokens": "10.31.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@babel/core": "^7.24.7",