@sprinklrjs/spaceweb 14.16.1 → 14.16.3

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 (118) hide show
  1. package/_hds_internal_deprecations.d.ts +863 -0
  2. package/_hds_internal_deprecations.js +345 -0
  3. package/asyncSelect/hooks/useAsyncSelect.d.ts +3 -3
  4. package/asyncSelect/hooks/useGroupedAsyncSelect.d.ts +3 -3
  5. package/avatar/avatar.js +3 -3
  6. package/avatar/types.d.ts +1 -1
  7. package/banner/types.d.ts +1 -1
  8. package/baseui/datepicker/day.js +21 -8
  9. package/baseui/select/dropdown.d.ts +1 -1
  10. package/baseui/select/select-component.d.ts +1 -1
  11. package/button-group/ButtonGroup.d.ts +2 -2
  12. package/button-group/StatefulButtonGroup.d.ts +2 -2
  13. package/button-group/styled-components.d.ts +2 -2
  14. package/button-group/types.d.ts +6 -4
  15. package/checkbox/types.d.ts +4 -4
  16. package/date-input/DateInput.js +3 -0
  17. package/date-picker/types.d.ts +2 -6
  18. package/esm/_hds_internal_deprecations.d.ts +863 -0
  19. package/esm/_hds_internal_deprecations.js +342 -0
  20. package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +3 -3
  21. package/esm/asyncSelect/hooks/useGroupedAsyncSelect.d.ts +3 -3
  22. package/esm/avatar/avatar.js +3 -3
  23. package/esm/avatar/types.d.ts +1 -1
  24. package/esm/banner/types.d.ts +1 -1
  25. package/esm/baseui/datepicker/day.js +21 -8
  26. package/esm/baseui/select/dropdown.d.ts +1 -1
  27. package/esm/baseui/select/select-component.d.ts +1 -1
  28. package/esm/button-group/ButtonGroup.d.ts +2 -2
  29. package/esm/button-group/StatefulButtonGroup.d.ts +2 -2
  30. package/esm/button-group/styled-components.d.ts +2 -2
  31. package/esm/button-group/types.d.ts +6 -4
  32. package/esm/checkbox/types.d.ts +4 -4
  33. package/esm/date-input/DateInput.js +3 -0
  34. package/esm/date-picker/types.d.ts +2 -6
  35. package/esm/form-control/types.d.ts +1 -1
  36. package/esm/image/types.d.ts +1 -1
  37. package/esm/input/number/base-input.d.ts +1 -1
  38. package/esm/input/types.d.ts +6 -13
  39. package/esm/menu/StatefulSubMenu.d.ts +1 -1
  40. package/esm/menu/SubMenu.d.ts +1 -1
  41. package/esm/menu/menu-item.d.ts +1 -1
  42. package/esm/menu/types.d.ts +1 -3
  43. package/esm/modal/types.d.ts +1 -6
  44. package/esm/popover/popover.d.ts +1 -1
  45. package/esm/progressSteps/types.d.ts +2 -0
  46. package/esm/radio/types.d.ts +8 -8
  47. package/esm/search/types.d.ts +6 -6
  48. package/esm/select/base-select.d.ts +1 -1
  49. package/esm/select/default-props.d.ts +1 -1
  50. package/esm/select/nested-select.d.ts +2 -2
  51. package/esm/select/select.d.ts +1 -1
  52. package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +1 -1
  53. package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +1 -1
  54. package/esm/select/stateful-select.d.ts +1 -1
  55. package/esm/select/types.d.ts +1 -1
  56. package/esm/slider/types.d.ts +2 -2
  57. package/esm/stack/stack.d.ts +5 -5
  58. package/esm/tabs/hooks/useScrollableTabs.d.ts +1 -1
  59. package/esm/tabs/types.d.ts +8 -9
  60. package/esm/tag/types.d.ts +7 -10
  61. package/esm/test-utils/keyboard/focusLock.d.ts +19 -0
  62. package/esm/test-utils/keyboard/focusLock.js +31 -0
  63. package/esm/test-utils/keyboard/index.d.ts +15 -0
  64. package/esm/test-utils/keyboard/index.js +15 -0
  65. package/esm/test-utils/keyboard/patterns.d.ts +63 -0
  66. package/esm/test-utils/keyboard/patterns.js +178 -0
  67. package/esm/test-utils/keyboard/press.d.ts +12 -0
  68. package/esm/test-utils/keyboard/press.js +22 -0
  69. package/esm/textarea/types.d.ts +10 -5
  70. package/esm/tooltip/disabled-tooltip-container.d.ts +1 -1
  71. package/esm/tooltip/stateful-tooltip-container.d.ts +1 -1
  72. package/esm/tooltip/stateful-tooltip.d.ts +1 -1
  73. package/esm/tooltip/types.d.ts +9 -21
  74. package/esm/types.d.ts +4 -1
  75. package/esm/typography/types.d.ts +63 -4
  76. package/form-control/types.d.ts +1 -1
  77. package/image/types.d.ts +1 -1
  78. package/input/number/base-input.d.ts +1 -1
  79. package/input/types.d.ts +6 -13
  80. package/menu/StatefulSubMenu.d.ts +1 -1
  81. package/menu/SubMenu.d.ts +1 -1
  82. package/menu/menu-item.d.ts +1 -1
  83. package/menu/types.d.ts +1 -3
  84. package/modal/types.d.ts +1 -6
  85. package/package.json +12 -2
  86. package/popover/popover.d.ts +1 -1
  87. package/progressSteps/types.d.ts +2 -0
  88. package/radio/types.d.ts +8 -8
  89. package/search/types.d.ts +6 -6
  90. package/select/base-select.d.ts +1 -1
  91. package/select/default-props.d.ts +1 -1
  92. package/select/nested-select.d.ts +2 -2
  93. package/select/select.d.ts +1 -1
  94. package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +1 -1
  95. package/select/selectMenuAdapter/SelectMenuItem.d.ts +1 -1
  96. package/select/stateful-select.d.ts +1 -1
  97. package/select/types.d.ts +1 -1
  98. package/slider/types.d.ts +2 -2
  99. package/stack/stack.d.ts +5 -5
  100. package/tabs/hooks/useScrollableTabs.d.ts +1 -1
  101. package/tabs/types.d.ts +8 -9
  102. package/tag/types.d.ts +7 -10
  103. package/test-utils/keyboard/focusLock.d.ts +19 -0
  104. package/test-utils/keyboard/focusLock.js +35 -0
  105. package/test-utils/keyboard/index.d.ts +15 -0
  106. package/test-utils/keyboard/index.js +27 -0
  107. package/test-utils/keyboard/patterns.d.ts +63 -0
  108. package/test-utils/keyboard/patterns.js +185 -0
  109. package/test-utils/keyboard/press.d.ts +12 -0
  110. package/test-utils/keyboard/press.js +30 -0
  111. package/textarea/types.d.ts +10 -5
  112. package/tooltip/disabled-tooltip-container.d.ts +1 -1
  113. package/tooltip/stateful-tooltip-container.d.ts +1 -1
  114. package/tooltip/stateful-tooltip.d.ts +1 -1
  115. package/tooltip/types.d.ts +9 -21
  116. package/tsconfig.build.tsbuildinfo +1 -1
  117. package/types.d.ts +4 -1
  118. package/typography/types.d.ts +63 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprinklrjs/spaceweb",
3
- "version": "14.16.1",
3
+ "version": "14.16.3",
4
4
  "description": "Components for SpaceWeb",
5
5
  "main": "index.js",
6
6
  "module": "./esm/index.js",
@@ -100,8 +100,18 @@
100
100
  "typescript": "~5.0.0"
101
101
  },
102
102
  "peerDependencies": {
103
- "@sprinklrjs/spaceweb-themes": "14.16.1",
103
+ "@sprinklrjs/spaceweb-themes": "14.16.3",
104
+ "@testing-library/react": "^14.0.0",
105
+ "@testing-library/user-event": "^13.2.1",
104
106
  "react": ">=17.0.2 <19.0.0",
105
107
  "react-dom": ">=17.0.2 <19.0.0"
108
+ },
109
+ "peerDependenciesMeta": {
110
+ "@testing-library/react": {
111
+ "optional": true
112
+ },
113
+ "@testing-library/user-event": {
114
+ "optional": true
115
+ }
106
116
  }
107
117
  }
@@ -13,7 +13,7 @@ declare const Popover: React.ForwardRefExoticComponent<Omit<import("../baseui/po
13
13
  }) => React.ReactNode);
14
14
  targetElement?: HTMLElement | null | undefined;
15
15
  triggerType?: import("./types").TriggerType | undefined;
16
- placement?: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
16
+ placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
17
17
  innerRef?: React.Ref<HTMLElement> | undefined;
18
18
  viewportAsBoundary?: boolean | undefined;
19
19
  } & React.RefAttributes<HTMLElement>>;
@@ -25,6 +25,7 @@ export type ProgressStepsProps = Omit<SpacewebComponentProps, 'onClick'> & {
25
25
  alwaysShowDescription?: boolean;
26
26
  orientation?: Orientation;
27
27
  onClick?: (event: MouseEvent<HTMLElement>, step?: number) => void;
28
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
28
29
  variant?: Variants;
29
30
  intent?: Intent;
30
31
  role?: AriaRole;
@@ -61,6 +62,7 @@ export type StepProps = Omit<SpacewebComponentProps, 'title'> & {
61
62
  orientation?: Orientation;
62
63
  childrenCount?: number;
63
64
  intent?: 'default' | 'error' | 'ai';
65
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
64
66
  variant?: Variants;
65
67
  role?: AriaRole;
66
68
  /** The step number (1-indexed) */
package/radio/types.d.ts CHANGED
@@ -6,10 +6,10 @@ import type { OutlineProps } from '../helpers/commonStyles';
6
6
  export type Alignment = 'horizontal' | 'vertical';
7
7
  export type LabelPlacement = 'top' | 'right' | 'bottom' | 'left';
8
8
  export type Align = keyof typeof ALIGN;
9
- /** @deprecated */
9
+ /** @deprecated Use 'medium' or 'large' instead. */
10
10
  type DeprecatedSize = 'sm' | 'md' | 'lg';
11
11
  export type Size = 'medium' | 'large' | DeprecatedSize;
12
- /** @deprecated */
12
+ /** @deprecated Use 'default' or 'error' instead. */
13
13
  type DeprecatedRadioIntent = 'success' | 'warning' | 'ai';
14
14
  export type RadioIntent = Exclude<Intent, DeprecatedRadioIntent> | DeprecatedRadioIntent;
15
15
  export type Variant = 'default' | 'checked';
@@ -26,7 +26,7 @@ export type StatelessState = {
26
26
  focusedRadioIndex: number;
27
27
  };
28
28
  export type SharedProps = {
29
- /** @deprecated */
29
+ /** @deprecated Not supported in Hyperspace. Defaults to 'vertical'. */
30
30
  $align?: Alignment;
31
31
  $checked?: boolean;
32
32
  $disabled?: boolean;
@@ -36,7 +36,7 @@ export type SharedProps = {
36
36
  $isFocused?: boolean;
37
37
  $isFocusVisible?: boolean;
38
38
  $isHovered?: boolean;
39
- /** @deprecated */
39
+ /** @deprecated Not supported in Hyperspace. Defaults to 'right'. */
40
40
  $labelPlacement?: string;
41
41
  $required?: boolean;
42
42
  $value?: string;
@@ -56,7 +56,7 @@ export type RadioGroupOverrides = {
56
56
  };
57
57
  export type BaseRadioProps = {
58
58
  autoFocus?: boolean;
59
- /** @deprecated */
59
+ /** @deprecated Not supported in Hyperspace. Defaults to 'vertical'. */
60
60
  align?: Align;
61
61
  checked?: boolean;
62
62
  children?: React.ReactNode;
@@ -69,7 +69,7 @@ export type BaseRadioProps = {
69
69
  error?: boolean;
70
70
  isFocused?: boolean;
71
71
  isFocusVisible?: boolean;
72
- /** @deprecated */
72
+ /** @deprecated Not supported in Hyperspace. Defaults to 'right'. */
73
73
  labelPlacement?: 'top' | 'right' | 'bottom' | 'left';
74
74
  name?: string;
75
75
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
@@ -98,10 +98,10 @@ export type BaseRadioGroupProps = {
98
98
  required?: boolean;
99
99
  error?: boolean;
100
100
  autoFocus?: boolean;
101
- /** @deprecated */
101
+ /** @deprecated Not supported in Hyperspace. Defaults to 'vertical'. */
102
102
  align?: Align;
103
103
  name?: string;
104
- /** @deprecated */
104
+ /** @deprecated Not supported in Hyperspace. Defaults to 'right'. */
105
105
  labelPlacement?: LabelPlacement;
106
106
  id?: string;
107
107
  size?: Size;
package/search/types.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import type { InputOverrides, InputProps, SharedProps as InputSharedProps } from '../input/types';
2
2
  import type { Override } from '../overrides';
3
- /** @deprecated */
3
+ /** @deprecated Use 'small', 'medium', 'large' or 'x-large' instead. */
4
4
  type DeprecatedSize = 'xxxs' | 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
5
5
  export type Size = DeprecatedSize | 'small' | 'medium' | 'large' | 'x-large';
6
- /** @deprecated */
7
- export type Variant = 'default' | 'light';
8
- export type Intent = 'default'
9
- /** @deprecated Use 'default' instead. */
10
- | 'ai';
6
+ export type Variant = 'light'
7
+ /** @deprecated Use 'light' instead. */
8
+ | 'default';
9
+ export type Intent = 'default' | 'ai';
11
10
  export type Shape = 'default' | 'pill';
12
11
  export type SearchProps = Omit<InputProps, 'size' | 'type' | 'required' | 'variant' | 'intent' | 'startEnhancer' | 'endEnhancer' | 'overrides'> & {
13
12
  size?: Size;
@@ -15,6 +14,7 @@ export type SearchProps = Omit<InputProps, 'size' | 'type' | 'required' | 'varia
15
14
  debounceInterval?: number;
16
15
  debouncedOnChange?: InputProps['onChange'];
17
16
  variant?: Variant;
17
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
18
18
  intent?: Intent;
19
19
  shape?: Shape;
20
20
  overrides?: {
@@ -44,7 +44,7 @@ declare class BaseSelect extends Component<BaseSelectProps & typeof defaultProps
44
44
  type: "overlay" | import("./types").Type | "mobile";
45
45
  value: Value;
46
46
  valueKey: string;
47
- placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
47
+ placement: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
48
48
  virtual: boolean;
49
49
  popoverMinWidth: string;
50
50
  expandLimitTagsOnFocus: boolean;
@@ -35,7 +35,7 @@ declare const defaultProps: {
35
35
  type: "overlay" | Type | "mobile";
36
36
  value: Value;
37
37
  valueKey: string;
38
- placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
38
+ placement: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
39
39
  virtual: boolean;
40
40
  popoverMinWidth: string;
41
41
  expandLimitTagsOnFocus: boolean;
@@ -39,7 +39,7 @@ declare const NestedSelect: {
39
39
  type: "overlay" | import("./types").Type | "mobile";
40
40
  value: import("./types").Value;
41
41
  valueKey: string;
42
- placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
42
+ placement: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
43
43
  virtual: boolean;
44
44
  popoverMinWidth: string;
45
45
  expandLimitTagsOnFocus: boolean;
@@ -83,7 +83,7 @@ declare const NestedSelect: {
83
83
  type: "overlay" | import("./types").Type | "mobile";
84
84
  value: import("./types").Value;
85
85
  valueKey: string;
86
- placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
86
+ placement: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
87
87
  virtual: boolean;
88
88
  popoverMinWidth: string;
89
89
  expandLimitTagsOnFocus: boolean;
@@ -38,7 +38,7 @@ declare const Select: {
38
38
  type: "overlay" | import("./types").Type | "mobile";
39
39
  value: import("./types").Value;
40
40
  valueKey: string;
41
- placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
41
+ placement: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
42
42
  virtual: boolean;
43
43
  popoverMinWidth: string;
44
44
  expandLimitTagsOnFocus: boolean;
@@ -83,7 +83,7 @@ export declare const CollapsibleSelectMenu: ({ overrides, value, items: groupedI
83
83
  }) => ReactNode);
84
84
  targetElement?: HTMLElement | null | undefined;
85
85
  triggerType?: import("../../popover").TriggerType | undefined;
86
- placement?: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
86
+ placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
87
87
  innerRef?: import("react").Ref<HTMLElement> | undefined;
88
88
  viewportAsBoundary?: boolean | undefined;
89
89
  } & Record<string, any>> | undefined;
@@ -54,7 +54,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
54
54
  }) => React.ReactNode);
55
55
  targetElement?: HTMLElement | null | undefined;
56
56
  triggerType?: import("../../tooltip").TriggerType | undefined;
57
- placement?: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
57
+ placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
58
58
  innerRef?: React.Ref<HTMLElement> | undefined;
59
59
  viewportAsBoundary?: boolean | undefined;
60
60
  } & Record<string, any>> | undefined;
@@ -38,7 +38,7 @@ declare namespace StatefulSelect {
38
38
  type: "overlay" | import("./types").Type | "mobile";
39
39
  value: import("./types").Value;
40
40
  valueKey: string;
41
- placement: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
41
+ placement: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
42
42
  virtual: boolean;
43
43
  popoverMinWidth: string;
44
44
  expandLimitTagsOnFocus: boolean;
package/select/types.d.ts CHANGED
@@ -12,7 +12,7 @@ import type { Merge, SimpleUnionOmit } from '../type-utils';
12
12
  import type { ButtonProps } from '../button';
13
13
  import type { SubMenuItem, MenuItemActions } from '../menu/types';
14
14
  import type { NoResultsMessageProps } from './no-results-message';
15
- /** @deprecated */
15
+ /** @deprecated Use 'small' or 'medium' instead. */
16
16
  type DeprecatedSize = 'xxxs' | 'xs' | 'sm' | 'md' | 'lg';
17
17
  export type Size = 'small' | 'medium' | DeprecatedSize;
18
18
  export type Type = 'select' | 'search';
package/slider/types.d.ts CHANGED
@@ -17,7 +17,7 @@ type CommonSliderProps = {
17
17
  'aria-label'?: string;
18
18
  'aria-labelledby'?: string;
19
19
  'aria-describedby'?: string;
20
- /** @deprecated */
20
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
21
21
  intent?: Intent;
22
22
  markLabel?: boolean;
23
23
  min?: number;
@@ -44,7 +44,7 @@ type CommonSliderProps = {
44
44
  onFinalChange?: (a: Params) => unknown;
45
45
  };
46
46
  export type SharedProps = {
47
- /** @deprecated */
47
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
48
48
  $intent?: Intent;
49
49
  $step: number;
50
50
  $disabled?: boolean;
package/stack/stack.d.ts CHANGED
@@ -5,23 +5,23 @@ declare const Stack: React.ForwardRefExoticComponent<Omit<React.AllHTMLAttribute
5
5
  className?: ClassName;
6
6
  style?: import("../types").Styles;
7
7
  } & {
8
- direction?: ("horizontal" | "vertical") | undefined;
8
+ direction?: ("vertical" | "horizontal") | undefined;
9
9
  gap: number;
10
10
  } & Partial<{
11
11
  sm: {
12
- direction?: ("horizontal" | "vertical") | undefined;
12
+ direction?: ("vertical" | "horizontal") | undefined;
13
13
  gap: number;
14
14
  };
15
15
  md: {
16
- direction?: ("horizontal" | "vertical") | undefined;
16
+ direction?: ("vertical" | "horizontal") | undefined;
17
17
  gap: number;
18
18
  };
19
19
  lg: {
20
- direction?: ("horizontal" | "vertical") | undefined;
20
+ direction?: ("vertical" | "horizontal") | undefined;
21
21
  gap: number;
22
22
  };
23
23
  xl: {
24
- direction?: ("horizontal" | "vertical") | undefined;
24
+ direction?: ("vertical" | "horizontal") | undefined;
25
25
  gap: number;
26
26
  };
27
27
  overrides: {
@@ -10,5 +10,5 @@ export interface UseScrollableTabsReturn {
10
10
  }
11
11
  export declare const useScrollableTabs: ({ onScroll, layout, }: {
12
12
  onScroll?: UIEventHandler<HTMLDivElement> | undefined;
13
- layout?: "horizontal" | "vertical" | undefined;
13
+ layout?: "vertical" | "horizontal" | undefined;
14
14
  }) => UseScrollableTabsReturn;
package/tabs/types.d.ts CHANGED
@@ -10,18 +10,17 @@ export type ChangEventHandler = (args: {
10
10
  }) => void;
11
11
  export type SharedPropsTab = {
12
12
  $selected?: boolean;
13
- /** @deprecated */
13
+ /** @deprecated Not supported in Hyperspace. Defaults to 'top'. */
14
14
  $position?: position;
15
- /** @deprecated */
15
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
16
16
  $variant?: variant;
17
17
  $disabled?: boolean;
18
18
  };
19
19
  export type SharedPropsTabs = {
20
- /** @deprecated */
20
+ /** @deprecated Not supported in Hyperspace. Defaults to 'top'. */
21
21
  $position?: position;
22
- /** @deprecated */
22
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
23
23
  $variant?: variant;
24
- /** @deprecated - derived from position */
25
24
  $layout?: 'vertical' | 'horizontal';
26
25
  };
27
26
  export type TabOverrides = {
@@ -42,9 +41,9 @@ export type TabListProps = Omit<SpacewebComponentProps, 'onChange'> & {
42
41
  activeTabId?: React.Key;
43
42
  children: React.ReactNode;
44
43
  onChange?: ChangEventHandler;
45
- /** @deprecated */
44
+ /** @deprecated Not supported in Hyperspace. Defaults to 'top'. */
46
45
  position?: position;
47
- /** @deprecated */
46
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
48
47
  variant?: variant;
49
48
  activateOnFocus?: boolean;
50
49
  overrides?: TabsOverrides;
@@ -58,9 +57,9 @@ export type TabsPanelProps = SpacewebComponentProps & {
58
57
  };
59
58
  export type TabProps = TabsPanelProps & {
60
59
  id?: React.Key;
61
- /** @deprecated */
60
+ /** @deprecated Not supported in Hyperspace. Defaults to 'top'. */
62
61
  position?: position;
63
- /** @deprecated */
62
+ /** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
64
63
  variant?: variant;
65
64
  overrides?: TabOverrides;
66
65
  onClick?: (e: React.MouseEvent) => void;
package/tag/types.d.ts CHANGED
@@ -5,7 +5,9 @@ import type { ClassName, SpacewebComponentProps } from '../types';
5
5
  export type Intent = 'success' | 'error' | 'warning' | 'info' | 'default' | 'ai';
6
6
  export type Appearance = 'gray' | 'white' | 'outline';
7
7
  export type Variant = 'solid' | 'light';
8
- export type Size = 'xxxs' | 'sm' | 'lg' | 'small' | 'medium' | 'large';
8
+ /** @deprecated Use 'small', 'medium' or 'large' instead. */
9
+ type DeprecatedSize = 'xxxs' | 'sm' | 'lg';
10
+ export type Size = DeprecatedSize | 'small' | 'medium' | 'large';
9
11
  export type Shape = 'default' | 'pill';
10
12
  export type TagOverrides = {
11
13
  Root?: Override<SharedProps & Record<string, any>>;
@@ -33,16 +35,12 @@ export type TagProps = SpacewebComponentProps<{
33
35
  $size: Size;
34
36
  $intent: Intent;
35
37
  $appearance: Appearance;
36
- /**
37
- * @deprecated: Check designs for HDS 2.0
38
- */
38
+ /** @deprecated Not supported in Hyperspace. Defaults to 'light'. */
39
39
  $variant: Variant;
40
40
  }) => React.ReactNode);
41
41
  intent?: Intent;
42
42
  appearance?: Appearance;
43
- /**
44
- * @deprecated: Check designs for HDS 2.0
45
- */
43
+ /** @deprecated Not supported in Hyperspace. Defaults to 'light'. */
46
44
  variant?: Variant;
47
45
  size?: Size;
48
46
  shape?: Shape;
@@ -64,11 +62,10 @@ export type SharedProps = {
64
62
  $withChildren: boolean;
65
63
  $intent?: Intent;
66
64
  $appearance?: Appearance;
67
- /**
68
- * @deprecated: Check designs for HDS 2.0
69
- */
65
+ /** @deprecated Not supported in Hyperspace. Defaults to 'light'. */
70
66
  $variant?: Variant;
71
67
  $size?: Size;
72
68
  $shape?: Shape;
73
69
  $addHoverStyles?: boolean;
74
70
  };
71
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Detects a focus trap between two controls.
3
+ *
4
+ * Moves focus. Tab from `last` must land on `first`, and Shift+Tab from `first`
5
+ * must land on `last`. Render the dialog or popover first, then pass the
6
+ * focusable ends inside it.
7
+ *
8
+ * ```ts
9
+ * import { isFocusLocked } from '@sprinklrjs/spaceweb/test-utils/keyboard';
10
+ *
11
+ * expect(isFocusLocked({ first, last })).toBe(true);
12
+ * ```
13
+ *
14
+ * Test-only. Requires `@testing-library/user-event` v13 and `@testing-library/react`.
15
+ */
16
+ export declare function isFocusLocked(ends: {
17
+ first: HTMLElement;
18
+ last: HTMLElement;
19
+ }): boolean;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFocusLocked = void 0;
4
+ var react_1 = require("@testing-library/react");
5
+ var press_1 = require("./press");
6
+ /**
7
+ * Detects a focus trap between two controls.
8
+ *
9
+ * Moves focus. Tab from `last` must land on `first`, and Shift+Tab from `first`
10
+ * must land on `last`. Render the dialog or popover first, then pass the
11
+ * focusable ends inside it.
12
+ *
13
+ * ```ts
14
+ * import { isFocusLocked } from '@sprinklrjs/spaceweb/test-utils/keyboard';
15
+ *
16
+ * expect(isFocusLocked({ first, last })).toBe(true);
17
+ * ```
18
+ *
19
+ * Test-only. Requires `@testing-library/user-event` v13 and `@testing-library/react`.
20
+ */
21
+ function isFocusLocked(ends) {
22
+ var first = ends.first, last = ends.last;
23
+ (0, react_1.act)(function () {
24
+ last.focus();
25
+ });
26
+ (0, press_1.tab)();
27
+ var wrapsForward = document.activeElement === first;
28
+ (0, react_1.act)(function () {
29
+ first.focus();
30
+ });
31
+ (0, press_1.shiftTab)();
32
+ var wrapsBackward = document.activeElement === last;
33
+ return wrapsForward && wrapsBackward;
34
+ }
35
+ exports.isFocusLocked = isFocusLocked;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Test-only keyboard helpers for Jest.
3
+ *
4
+ * ```ts
5
+ * import { isFocusLocked, press, tab } from '@sprinklrjs/spaceweb/test-utils/keyboard';
6
+ * ```
7
+ *
8
+ * Requires `@testing-library/user-event` v13 and `@testing-library/react`.
9
+ * The `describe*` suites also need `@testing-library/jest-dom` (`toHaveFocus`, `toBeChecked`).
10
+ * Dialog and radio suites assume the fixture names in their JSDoc (a button named
11
+ * `Second`, a button named `After`). Do not import this from application code.
12
+ */
13
+ export { isFocusLocked } from './focusLock';
14
+ export { press, shiftTab, tab, type, type KeyboardKey } from './press';
15
+ export { describeDialogKeyboard, describeRadioGroupKeyboard, describeRovingKeyboard, describeToggleKeyboard, } from './patterns';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.describeToggleKeyboard = exports.describeRovingKeyboard = exports.describeRadioGroupKeyboard = exports.describeDialogKeyboard = exports.type = exports.tab = exports.shiftTab = exports.press = exports.isFocusLocked = void 0;
4
+ /**
5
+ * Test-only keyboard helpers for Jest.
6
+ *
7
+ * ```ts
8
+ * import { isFocusLocked, press, tab } from '@sprinklrjs/spaceweb/test-utils/keyboard';
9
+ * ```
10
+ *
11
+ * Requires `@testing-library/user-event` v13 and `@testing-library/react`.
12
+ * The `describe*` suites also need `@testing-library/jest-dom` (`toHaveFocus`, `toBeChecked`).
13
+ * Dialog and radio suites assume the fixture names in their JSDoc (a button named
14
+ * `Second`, a button named `After`). Do not import this from application code.
15
+ */
16
+ var focusLock_1 = require("./focusLock");
17
+ Object.defineProperty(exports, "isFocusLocked", { enumerable: true, get: function () { return focusLock_1.isFocusLocked; } });
18
+ var press_1 = require("./press");
19
+ Object.defineProperty(exports, "press", { enumerable: true, get: function () { return press_1.press; } });
20
+ Object.defineProperty(exports, "shiftTab", { enumerable: true, get: function () { return press_1.shiftTab; } });
21
+ Object.defineProperty(exports, "tab", { enumerable: true, get: function () { return press_1.tab; } });
22
+ Object.defineProperty(exports, "type", { enumerable: true, get: function () { return press_1.type; } });
23
+ var patterns_1 = require("./patterns");
24
+ Object.defineProperty(exports, "describeDialogKeyboard", { enumerable: true, get: function () { return patterns_1.describeDialogKeyboard; } });
25
+ Object.defineProperty(exports, "describeRadioGroupKeyboard", { enumerable: true, get: function () { return patterns_1.describeRadioGroupKeyboard; } });
26
+ Object.defineProperty(exports, "describeRovingKeyboard", { enumerable: true, get: function () { return patterns_1.describeRovingKeyboard; } });
27
+ Object.defineProperty(exports, "describeToggleKeyboard", { enumerable: true, get: function () { return patterns_1.describeToggleKeyboard; } });
@@ -0,0 +1,63 @@
1
+ import { type KeyboardKey } from './press';
2
+ /**
3
+ * Shared keyboard contracts for Spaceweb.
4
+ *
5
+ * Add a `describe*` function when a new interactive component shares a contract
6
+ * other components will reuse (menu, listbox, combobox, slider). Call it from
7
+ * that component's spec, inside `describe('keyboard interaction')`. Keep one-off branches in the component file.
8
+ * These tests press keys only — no click or hover.
9
+ *
10
+ * | Pattern | Keys | Components |
11
+ * | toggle | Tab, Space, Enter does not toggle | Checkbox, Switch |
12
+ * | radio | Tab lands on the active radio, Space selects, arrows move within the group | RadioGroup |
13
+ * | roving | next/previous, wrap, Home, End | Tabs. ButtonGroup uses the same hook |
14
+ * | dialog | Escape, Tab trap, focus return | Modal |
15
+ */
16
+ type RenderFn = () => void;
17
+ export declare function describeToggleKeyboard(options: {
18
+ role: 'checkbox' | 'switch';
19
+ /** Renders one unchecked, enabled control. Space must check it. */
20
+ renderEnabled: RenderFn;
21
+ /** Renders one unchecked, disabled control. Space must not check it. */
22
+ renderDisabled: RenderFn;
23
+ }): void;
24
+ export declare function describeRadioGroupKeyboard(options: {
25
+ /** Renders Apple and Pear. `value` selects one. Include a button named After after the group. */
26
+ renderGroup: (props?: {
27
+ value?: string;
28
+ disabled?: boolean;
29
+ }) => void;
30
+ }): void;
31
+ /**
32
+ * Roving focus across `setup()` stops. The first stop is the tab entry.
33
+ * `setup` must return at least three stops in keyboard order.
34
+ */
35
+ export declare function describeRovingKeyboard(options: {
36
+ name: string;
37
+ setup: () => HTMLElement[];
38
+ nextKey: KeyboardKey;
39
+ previousKey: KeyboardKey;
40
+ ignoredKeys?: KeyboardKey[];
41
+ }): void;
42
+ export declare function describeDialogKeyboard(options: {
43
+ /**
44
+ * Renders one dialog. `onClose` must unmount it. `first` and `last` are the
45
+ * focusable ends inside the dialog. Include a button named Second between them
46
+ * when the dialog is closeable.
47
+ */
48
+ mount: (props?: {
49
+ closeable?: boolean;
50
+ focusLock?: boolean;
51
+ autoFocus?: boolean;
52
+ }) => {
53
+ dialog: HTMLElement;
54
+ first: HTMLElement;
55
+ last: HTMLElement;
56
+ };
57
+ /**
58
+ * Renders a closed dialog and a trigger. Enter on the trigger opens the dialog.
59
+ * Escape must close it and return focus to the trigger.
60
+ */
61
+ openFromTrigger: () => HTMLElement;
62
+ }): void;
63
+ export {};