@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.
- package/_hds_internal_deprecations.d.ts +863 -0
- package/_hds_internal_deprecations.js +345 -0
- package/asyncSelect/hooks/useAsyncSelect.d.ts +3 -3
- package/asyncSelect/hooks/useGroupedAsyncSelect.d.ts +3 -3
- package/avatar/avatar.js +3 -3
- package/avatar/types.d.ts +1 -1
- package/banner/types.d.ts +1 -1
- package/baseui/datepicker/day.js +21 -8
- package/baseui/select/dropdown.d.ts +1 -1
- package/baseui/select/select-component.d.ts +1 -1
- package/button-group/ButtonGroup.d.ts +2 -2
- package/button-group/StatefulButtonGroup.d.ts +2 -2
- package/button-group/styled-components.d.ts +2 -2
- package/button-group/types.d.ts +6 -4
- package/checkbox/types.d.ts +4 -4
- package/date-input/DateInput.js +3 -0
- package/date-picker/types.d.ts +2 -6
- package/esm/_hds_internal_deprecations.d.ts +863 -0
- package/esm/_hds_internal_deprecations.js +342 -0
- package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +3 -3
- package/esm/asyncSelect/hooks/useGroupedAsyncSelect.d.ts +3 -3
- package/esm/avatar/avatar.js +3 -3
- package/esm/avatar/types.d.ts +1 -1
- package/esm/banner/types.d.ts +1 -1
- package/esm/baseui/datepicker/day.js +21 -8
- package/esm/baseui/select/dropdown.d.ts +1 -1
- package/esm/baseui/select/select-component.d.ts +1 -1
- package/esm/button-group/ButtonGroup.d.ts +2 -2
- package/esm/button-group/StatefulButtonGroup.d.ts +2 -2
- package/esm/button-group/styled-components.d.ts +2 -2
- package/esm/button-group/types.d.ts +6 -4
- package/esm/checkbox/types.d.ts +4 -4
- package/esm/date-input/DateInput.js +3 -0
- package/esm/date-picker/types.d.ts +2 -6
- package/esm/form-control/types.d.ts +1 -1
- package/esm/image/types.d.ts +1 -1
- package/esm/input/number/base-input.d.ts +1 -1
- package/esm/input/types.d.ts +6 -13
- package/esm/menu/StatefulSubMenu.d.ts +1 -1
- package/esm/menu/SubMenu.d.ts +1 -1
- package/esm/menu/menu-item.d.ts +1 -1
- package/esm/menu/types.d.ts +1 -3
- package/esm/modal/types.d.ts +1 -6
- package/esm/popover/popover.d.ts +1 -1
- package/esm/progressSteps/types.d.ts +2 -0
- package/esm/radio/types.d.ts +8 -8
- package/esm/search/types.d.ts +6 -6
- package/esm/select/base-select.d.ts +1 -1
- package/esm/select/default-props.d.ts +1 -1
- package/esm/select/nested-select.d.ts +2 -2
- package/esm/select/select.d.ts +1 -1
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +1 -1
- package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +1 -1
- package/esm/select/stateful-select.d.ts +1 -1
- package/esm/select/types.d.ts +1 -1
- package/esm/slider/types.d.ts +2 -2
- package/esm/stack/stack.d.ts +5 -5
- package/esm/tabs/hooks/useScrollableTabs.d.ts +1 -1
- package/esm/tabs/types.d.ts +8 -9
- package/esm/tag/types.d.ts +7 -10
- package/esm/test-utils/keyboard/focusLock.d.ts +19 -0
- package/esm/test-utils/keyboard/focusLock.js +31 -0
- package/esm/test-utils/keyboard/index.d.ts +15 -0
- package/esm/test-utils/keyboard/index.js +15 -0
- package/esm/test-utils/keyboard/patterns.d.ts +63 -0
- package/esm/test-utils/keyboard/patterns.js +178 -0
- package/esm/test-utils/keyboard/press.d.ts +12 -0
- package/esm/test-utils/keyboard/press.js +22 -0
- package/esm/textarea/types.d.ts +10 -5
- package/esm/tooltip/disabled-tooltip-container.d.ts +1 -1
- package/esm/tooltip/stateful-tooltip-container.d.ts +1 -1
- package/esm/tooltip/stateful-tooltip.d.ts +1 -1
- package/esm/tooltip/types.d.ts +9 -21
- package/esm/types.d.ts +4 -1
- package/esm/typography/types.d.ts +63 -4
- package/form-control/types.d.ts +1 -1
- package/image/types.d.ts +1 -1
- package/input/number/base-input.d.ts +1 -1
- package/input/types.d.ts +6 -13
- package/menu/StatefulSubMenu.d.ts +1 -1
- package/menu/SubMenu.d.ts +1 -1
- package/menu/menu-item.d.ts +1 -1
- package/menu/types.d.ts +1 -3
- package/modal/types.d.ts +1 -6
- package/package.json +12 -2
- package/popover/popover.d.ts +1 -1
- package/progressSteps/types.d.ts +2 -0
- package/radio/types.d.ts +8 -8
- package/search/types.d.ts +6 -6
- package/select/base-select.d.ts +1 -1
- package/select/default-props.d.ts +1 -1
- package/select/nested-select.d.ts +2 -2
- package/select/select.d.ts +1 -1
- package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +1 -1
- package/select/selectMenuAdapter/SelectMenuItem.d.ts +1 -1
- package/select/stateful-select.d.ts +1 -1
- package/select/types.d.ts +1 -1
- package/slider/types.d.ts +2 -2
- package/stack/stack.d.ts +5 -5
- package/tabs/hooks/useScrollableTabs.d.ts +1 -1
- package/tabs/types.d.ts +8 -9
- package/tag/types.d.ts +7 -10
- package/test-utils/keyboard/focusLock.d.ts +19 -0
- package/test-utils/keyboard/focusLock.js +35 -0
- package/test-utils/keyboard/index.d.ts +15 -0
- package/test-utils/keyboard/index.js +27 -0
- package/test-utils/keyboard/patterns.d.ts +63 -0
- package/test-utils/keyboard/patterns.js +185 -0
- package/test-utils/keyboard/press.d.ts +12 -0
- package/test-utils/keyboard/press.js +30 -0
- package/textarea/types.d.ts +10 -5
- package/tooltip/disabled-tooltip-container.d.ts +1 -1
- package/tooltip/stateful-tooltip-container.d.ts +1 -1
- package/tooltip/stateful-tooltip.d.ts +1 -1
- package/tooltip/types.d.ts +9 -21
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types.d.ts +4 -1
- package/typography/types.d.ts +63 -4
|
@@ -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 {};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { __awaiter, __generator, __read } from "tslib";
|
|
2
|
+
import { act, screen, waitFor } from '@testing-library/react';
|
|
3
|
+
import { isFocusLocked } from './focusLock';
|
|
4
|
+
import { press, tab } from './press';
|
|
5
|
+
export function describeToggleKeyboard(options) {
|
|
6
|
+
var role = options.role, renderEnabled = options.renderEnabled, renderDisabled = options.renderDisabled;
|
|
7
|
+
test('Tab moves focus onto the control', function () {
|
|
8
|
+
renderEnabled();
|
|
9
|
+
var control = screen.getByRole(role);
|
|
10
|
+
tab();
|
|
11
|
+
expect(control).toHaveFocus();
|
|
12
|
+
});
|
|
13
|
+
test('Space checks the control', function () {
|
|
14
|
+
renderEnabled();
|
|
15
|
+
var control = screen.getByRole(role);
|
|
16
|
+
tab();
|
|
17
|
+
press('Space');
|
|
18
|
+
expect(control).toBeChecked();
|
|
19
|
+
});
|
|
20
|
+
test('Enter does not check the control', function () {
|
|
21
|
+
renderEnabled();
|
|
22
|
+
var control = screen.getByRole(role);
|
|
23
|
+
tab();
|
|
24
|
+
press('Enter');
|
|
25
|
+
expect(control).not.toBeChecked();
|
|
26
|
+
});
|
|
27
|
+
test('Space does not check a disabled control', function () {
|
|
28
|
+
renderDisabled();
|
|
29
|
+
var control = screen.getByRole(role);
|
|
30
|
+
act(function () {
|
|
31
|
+
control.focus();
|
|
32
|
+
});
|
|
33
|
+
press('Space');
|
|
34
|
+
expect(control).not.toBeChecked();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export function describeRadioGroupKeyboard(options) {
|
|
38
|
+
test('Tab focuses the first radio when none is selected', function () {
|
|
39
|
+
options.renderGroup();
|
|
40
|
+
var _a = __read(screen.getAllByRole('radio'), 2), first = _a[0], second = _a[1];
|
|
41
|
+
tab();
|
|
42
|
+
expect(first).toHaveFocus();
|
|
43
|
+
expect(second).toHaveAttribute('tabindex', '-1');
|
|
44
|
+
});
|
|
45
|
+
test('Tab focuses the selected radio', function () {
|
|
46
|
+
options.renderGroup({ value: 'pear' });
|
|
47
|
+
var _a = __read(screen.getAllByRole('radio'), 2), first = _a[0], second = _a[1];
|
|
48
|
+
tab();
|
|
49
|
+
expect(second).toHaveFocus();
|
|
50
|
+
expect(first).toHaveAttribute('tabindex', '-1');
|
|
51
|
+
});
|
|
52
|
+
test('Tab leaves the group from the active radio', function () {
|
|
53
|
+
options.renderGroup({ value: 'pear' });
|
|
54
|
+
var second = screen.getAllByRole('radio')[1];
|
|
55
|
+
tab();
|
|
56
|
+
expect(second).toHaveFocus();
|
|
57
|
+
tab();
|
|
58
|
+
expect(screen.getByRole('button', { name: 'After' })).toHaveFocus();
|
|
59
|
+
});
|
|
60
|
+
test('Space selects the active radio', function () {
|
|
61
|
+
options.renderGroup();
|
|
62
|
+
var first = screen.getAllByRole('radio')[0];
|
|
63
|
+
tab();
|
|
64
|
+
press('Space');
|
|
65
|
+
expect(first).toBeChecked();
|
|
66
|
+
});
|
|
67
|
+
test('Space does not select a radio in a disabled group', function () {
|
|
68
|
+
options.renderGroup({ disabled: true });
|
|
69
|
+
var first = screen.getAllByRole('radio')[0];
|
|
70
|
+
act(function () {
|
|
71
|
+
first.focus();
|
|
72
|
+
});
|
|
73
|
+
press('Space');
|
|
74
|
+
expect(first).not.toBeChecked();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Roving focus across `setup()` stops. The first stop is the tab entry.
|
|
79
|
+
* `setup` must return at least three stops in keyboard order.
|
|
80
|
+
*/
|
|
81
|
+
export function describeRovingKeyboard(options) {
|
|
82
|
+
var name = options.name, setup = options.setup, nextKey = options.nextKey, previousKey = options.previousKey, _a = options.ignoredKeys, ignoredKeys = _a === void 0 ? [] : _a;
|
|
83
|
+
describe(name, function () {
|
|
84
|
+
test("".concat(nextKey, " moves to the next stop and wraps to the first"), function () {
|
|
85
|
+
var stops = setup();
|
|
86
|
+
tab();
|
|
87
|
+
expect(stops[0]).toHaveFocus();
|
|
88
|
+
press(nextKey);
|
|
89
|
+
expect(stops[1]).toHaveFocus();
|
|
90
|
+
press(nextKey);
|
|
91
|
+
expect(stops[2]).toHaveFocus();
|
|
92
|
+
press(nextKey);
|
|
93
|
+
expect(stops[0]).toHaveFocus();
|
|
94
|
+
});
|
|
95
|
+
test("".concat(previousKey, " wraps from the first stop to the last"), function () {
|
|
96
|
+
var stops = setup();
|
|
97
|
+
tab();
|
|
98
|
+
press(previousKey);
|
|
99
|
+
expect(stops[stops.length - 1]).toHaveFocus();
|
|
100
|
+
});
|
|
101
|
+
test('Home moves to the first stop and End moves to the last', function () {
|
|
102
|
+
var stops = setup();
|
|
103
|
+
tab();
|
|
104
|
+
press('End');
|
|
105
|
+
expect(stops[stops.length - 1]).toHaveFocus();
|
|
106
|
+
press('Home');
|
|
107
|
+
expect(stops[0]).toHaveFocus();
|
|
108
|
+
});
|
|
109
|
+
if (ignoredKeys.length > 0) {
|
|
110
|
+
test("".concat(ignoredKeys.join(', '), " do not move focus"), function () {
|
|
111
|
+
var stops = setup();
|
|
112
|
+
tab();
|
|
113
|
+
ignoredKeys.forEach(function (key) {
|
|
114
|
+
press(key);
|
|
115
|
+
expect(stops[0]).toHaveFocus();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
export function describeDialogKeyboard(options) {
|
|
122
|
+
var _this = this;
|
|
123
|
+
test('Escape closes a closeable dialog', function () {
|
|
124
|
+
options.mount();
|
|
125
|
+
press('Escape');
|
|
126
|
+
expect(screen.queryByRole('dialog')).toBeNull();
|
|
127
|
+
});
|
|
128
|
+
test('Escape does not close a dialog that is not closeable', function () {
|
|
129
|
+
options.mount({ closeable: false });
|
|
130
|
+
press('Escape');
|
|
131
|
+
screen.getByRole('dialog');
|
|
132
|
+
});
|
|
133
|
+
test('autoFocus moves focus to the first control inside the dialog', function () {
|
|
134
|
+
var first = options.mount().first;
|
|
135
|
+
expect(first).toHaveFocus();
|
|
136
|
+
});
|
|
137
|
+
test('autoFocus false leaves the first control unfocused', function () {
|
|
138
|
+
var first = options.mount({ autoFocus: false }).first;
|
|
139
|
+
expect(first).not.toHaveFocus();
|
|
140
|
+
});
|
|
141
|
+
test('Tab moves through the dialog controls', function () {
|
|
142
|
+
var _a = options.mount(), first = _a.first, last = _a.last;
|
|
143
|
+
expect(first).toHaveFocus();
|
|
144
|
+
tab();
|
|
145
|
+
expect(screen.getByRole('button', { name: 'Second' })).toHaveFocus();
|
|
146
|
+
tab();
|
|
147
|
+
expect(last).toHaveFocus();
|
|
148
|
+
});
|
|
149
|
+
test('focus stays locked inside the dialog', function () {
|
|
150
|
+
var _a = options.mount(), first = _a.first, last = _a.last;
|
|
151
|
+
expect(isFocusLocked({ first: first, last: last })).toBe(true);
|
|
152
|
+
});
|
|
153
|
+
test('Tab does not wrap inside the dialog when focus is not locked', function () {
|
|
154
|
+
var _a = options.mount({ focusLock: false }), first = _a.first, last = _a.last;
|
|
155
|
+
expect(isFocusLocked({ first: first, last: last })).toBe(false);
|
|
156
|
+
});
|
|
157
|
+
test('Escape returns focus to the trigger', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
158
|
+
var trigger;
|
|
159
|
+
return __generator(this, function (_a) {
|
|
160
|
+
switch (_a.label) {
|
|
161
|
+
case 0:
|
|
162
|
+
trigger = options.openFromTrigger();
|
|
163
|
+
tab();
|
|
164
|
+
expect(trigger).toHaveFocus();
|
|
165
|
+
press('Enter');
|
|
166
|
+
expect(screen.getByRole('dialog')).toBeTruthy();
|
|
167
|
+
press('Escape');
|
|
168
|
+
return [4 /*yield*/, waitFor(function () {
|
|
169
|
+
expect(screen.queryByRole('dialog')).toBeNull();
|
|
170
|
+
expect(trigger).toHaveFocus();
|
|
171
|
+
})];
|
|
172
|
+
case 1:
|
|
173
|
+
_a.sent();
|
|
174
|
+
return [2 /*return*/];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}); });
|
|
178
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keys the keyboard harness can press. Add a key here when a new pattern needs it.
|
|
3
|
+
* Tab uses `userEvent.tab()` — `{Tab}` is not a substitute.
|
|
4
|
+
*/
|
|
5
|
+
export type KeyboardKey = 'Enter' | 'Space' | 'Escape' | 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End';
|
|
6
|
+
export declare function press(key: KeyboardKey, modifiers?: {
|
|
7
|
+
shift?: boolean;
|
|
8
|
+
}): void;
|
|
9
|
+
/** Types into the focused element. Does not click or move focus. */
|
|
10
|
+
export declare function type(text: string): void;
|
|
11
|
+
export declare function tab(): void;
|
|
12
|
+
export declare function shiftTab(): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import userEvent from '@testing-library/user-event';
|
|
2
|
+
function keyToken(key) {
|
|
3
|
+
return key === 'Space' ? '{space}' : "{".concat(key, "}");
|
|
4
|
+
}
|
|
5
|
+
export function press(key, modifiers) {
|
|
6
|
+
var token = keyToken(key);
|
|
7
|
+
if (modifiers === null || modifiers === void 0 ? void 0 : modifiers.shift) {
|
|
8
|
+
userEvent.keyboard("{Shift>}".concat(token, "{/Shift}"));
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
userEvent.keyboard(token);
|
|
12
|
+
}
|
|
13
|
+
/** Types into the focused element. Does not click or move focus. */
|
|
14
|
+
export function type(text) {
|
|
15
|
+
userEvent.keyboard(text);
|
|
16
|
+
}
|
|
17
|
+
export function tab() {
|
|
18
|
+
userEvent.tab();
|
|
19
|
+
}
|
|
20
|
+
export function shiftTab() {
|
|
21
|
+
userEvent.tab({ shift: true });
|
|
22
|
+
}
|
package/esm/textarea/types.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FocusPosition, BaseInputProps, StatefulContainerProps, ENHANCER_POSITION, Adjoined } from '../input';
|
|
3
3
|
import type { Intent, SpacewebComponentProps } from '../types';
|
|
4
4
|
import type { Override } from '../overrides';
|
|
5
5
|
import type { Properties } from 'csstype';
|
|
6
6
|
export type BaseTextareaProps = BaseInputProps<HTMLTextAreaElement>;
|
|
7
|
-
|
|
7
|
+
/** @deprecated Use 'medium' instead. */
|
|
8
|
+
type DeprecatedTextareaSize = 'xxxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
9
|
+
type TextareaSize = DeprecatedTextareaSize | 'medium';
|
|
10
|
+
type TextareaVariant = 'default' | 'line';
|
|
11
|
+
export type TextareaProps = SpacewebComponentProps<Omit<BaseTextareaProps, 'size' | 'overrides' | 'autoFocus' | 'inputRef' | 'variant'>> & {
|
|
8
12
|
resize?: Properties['resize'];
|
|
9
|
-
size?:
|
|
10
|
-
variant?:
|
|
13
|
+
size?: TextareaSize;
|
|
14
|
+
variant?: TextareaVariant;
|
|
11
15
|
rows?: number;
|
|
12
16
|
overrides?: {
|
|
13
17
|
[key in keyof Required<BaseTextareaProps>['overrides']]?: Override<any>;
|
|
@@ -34,7 +38,7 @@ export type SharedProps = {
|
|
|
34
38
|
/** Defines styles for inputs that are grouped with other controls. */
|
|
35
39
|
$adjoined: Adjoined;
|
|
36
40
|
/** Renders UI in provided size. */
|
|
37
|
-
$size:
|
|
41
|
+
$size: TextareaSize;
|
|
38
42
|
/** Renders UI in 'required' state */
|
|
39
43
|
$required?: boolean;
|
|
40
44
|
$resize?: Properties['resize'];
|
|
@@ -42,3 +46,4 @@ export type SharedProps = {
|
|
|
42
46
|
/** Defines if has a clearable or MaskToggleButton at the end */
|
|
43
47
|
$hasIconTrailing?: boolean;
|
|
44
48
|
};
|
|
49
|
+
export {};
|
|
@@ -41,7 +41,7 @@ declare const DisabledTooltipContainer: {
|
|
|
41
41
|
}) => React.ReactNode);
|
|
42
42
|
targetElement?: HTMLElement | null | undefined;
|
|
43
43
|
triggerType?: import("./types").TriggerType | undefined;
|
|
44
|
-
placement?: "
|
|
44
|
+
placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
45
45
|
viewportAsBoundary?: boolean | undefined;
|
|
46
46
|
autoFocus?: boolean | undefined;
|
|
47
47
|
returnFocus?: boolean | FocusOptions | ((returnTo: Element) => boolean | FocusOptions) | undefined;
|
|
@@ -41,7 +41,7 @@ declare const StatefulContainer: {
|
|
|
41
41
|
}) => React.ReactNode);
|
|
42
42
|
targetElement?: HTMLElement | null | undefined;
|
|
43
43
|
triggerType?: import("./types").TriggerType | undefined;
|
|
44
|
-
placement?: "
|
|
44
|
+
placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
45
45
|
viewportAsBoundary?: boolean | undefined;
|
|
46
46
|
autoFocus?: boolean | undefined;
|
|
47
47
|
returnFocus?: boolean | FocusOptions | ((returnTo: Element) => boolean | FocusOptions) | undefined;
|
|
@@ -44,7 +44,7 @@ declare const StatefulTooltip: {
|
|
|
44
44
|
}) => React.ReactNode);
|
|
45
45
|
targetElement?: HTMLElement | null | undefined;
|
|
46
46
|
triggerType?: import("./types").TriggerType | undefined;
|
|
47
|
-
placement?: "
|
|
47
|
+
placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
48
48
|
viewportAsBoundary?: boolean | undefined;
|
|
49
49
|
autoFocus?: boolean | undefined;
|
|
50
50
|
size?: import("./types").Size | undefined;
|
package/esm/tooltip/types.d.ts
CHANGED
|
@@ -5,39 +5,27 @@ import type { Override } from '../overrides';
|
|
|
5
5
|
import type { TriggerType } from '../popover';
|
|
6
6
|
import type { Action, Intent } from '../types';
|
|
7
7
|
type SpacewebSharedProps = {
|
|
8
|
-
/** @deprecated */
|
|
8
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'sm'. */
|
|
9
9
|
$size: Size;
|
|
10
|
-
/** @deprecated */
|
|
10
|
+
/** @deprecated Not supported in Hyperspace. */
|
|
11
11
|
$label: boolean;
|
|
12
|
-
/** @deprecated */
|
|
12
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
|
|
13
13
|
$intent: Intent;
|
|
14
14
|
};
|
|
15
15
|
export type Size = 'sm' | 'md' | 'lg' | '50vw';
|
|
16
16
|
export type SharedProps = SharedStylePropsArg & SpacewebSharedProps;
|
|
17
17
|
interface DeprecatedProps {
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated
|
|
20
|
-
*/
|
|
18
|
+
/** @deprecated Not supported in Hyperspace. */
|
|
21
19
|
autoFocus?: BaseTooltipProps['autoFocus'];
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated
|
|
24
|
-
*/
|
|
20
|
+
/** @deprecated Not supported in Hyperspace. */
|
|
25
21
|
returnFocus?: BaseTooltipProps['returnFocus'];
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated
|
|
28
|
-
*/
|
|
22
|
+
/** @deprecated Not supported in Hyperspace. */
|
|
29
23
|
focusLock?: BaseTooltipProps['focusLock'];
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated
|
|
32
|
-
*/
|
|
24
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'sm'. */
|
|
33
25
|
size?: Size;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
26
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
|
|
37
27
|
intent?: Intent;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated
|
|
40
|
-
*/
|
|
28
|
+
/** @deprecated Not supported in Hyperspace. */
|
|
41
29
|
label?: React.ReactNode;
|
|
42
30
|
}
|
|
43
31
|
export type StatefulTooltipProps = Omit<BaseStatefulTooltipProps, 'overrides' | 'children' | 'autoFocus' | 'focusLock' | 'returnFocus' | 'dismissOnEsc' | 'dismissOnClickOutside' | 'triggerType' | 'placement'> & {
|
package/esm/types.d.ts
CHANGED
|
@@ -63,10 +63,12 @@ export type BrowserFeaturesContext = {
|
|
|
63
63
|
* Variant Options
|
|
64
64
|
*/
|
|
65
65
|
export type Variant = 'primary' | 'secondary' | 'tertiary' | 'minimal';
|
|
66
|
+
/** @deprecated Use 'small', 'medium' or 'large' instead. */
|
|
67
|
+
type DeprecatedSize = 'xxxxs' | 'xxxs' | 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
66
68
|
/**
|
|
67
69
|
* Size Options
|
|
68
70
|
*/
|
|
69
|
-
export type Size =
|
|
71
|
+
export type Size = DeprecatedSize | 'small' | 'medium' | 'large' | 'x-large';
|
|
70
72
|
/**
|
|
71
73
|
* Intent Options
|
|
72
74
|
*/
|
|
@@ -112,3 +114,4 @@ export type Action = {
|
|
|
112
114
|
onClick: () => void;
|
|
113
115
|
startEnhancer?: ReactNode;
|
|
114
116
|
};
|
|
117
|
+
export {};
|
|
@@ -5,13 +5,72 @@ import type { TruncateWithTooltipProps } from '../truncateWithTooltip';
|
|
|
5
5
|
type TypographyBodyHeaderVariants = 'display' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' | 'heading-6' | 'heading-7' | 'body-lg' | 'body-md' | 'body-sm' | 'body-xs';
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Prefer TypographyBodyHeaderVariants
|
|
8
|
+
* Deprecated variants are mapped to a variant of the same family. Line height and weight are ignored.
|
|
8
9
|
*/
|
|
9
|
-
type DeprecatedTypographyVariant =
|
|
10
|
+
type DeprecatedTypographyVariant =
|
|
11
|
+
/** @deprecated No matching variant exists. Use suitable heading variant. */
|
|
12
|
+
'h1'
|
|
13
|
+
/** @deprecated Use 'heading-4' instead. */
|
|
14
|
+
| 'h2'
|
|
15
|
+
/** @deprecated Use 'heading-5' instead. */
|
|
16
|
+
| 'h3'
|
|
17
|
+
/** @deprecated Use 'heading-7' instead. */
|
|
18
|
+
| 'h4'
|
|
19
|
+
/** @deprecated Use 'heading-7' instead. */
|
|
20
|
+
| 'h5'
|
|
21
|
+
/** @deprecated No matching variant exists. Use suitable heading variant. */
|
|
22
|
+
| 'h6'
|
|
23
|
+
/** @deprecated No matching variant exists. Use suitable heading variant. */
|
|
24
|
+
| 'h7'
|
|
25
|
+
/** @deprecated Use 'body-sm' instead. */
|
|
26
|
+
| 'bl1'
|
|
27
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
28
|
+
| 'bl2'
|
|
29
|
+
/** @deprecated Use 'body-xs' instead. */
|
|
30
|
+
| 'bl3'
|
|
31
|
+
/** @deprecated Use 'body-sm' instead. */
|
|
32
|
+
| 'bs1'
|
|
33
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
34
|
+
| 'bs2'
|
|
35
|
+
/** @deprecated Use 'body-xs' instead. */
|
|
36
|
+
| 'bs3'
|
|
37
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
38
|
+
| 'l1'
|
|
39
|
+
/** @deprecated Use 'body-xs' instead. */
|
|
40
|
+
| 'l2'
|
|
41
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
42
|
+
| 'l3'
|
|
43
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
44
|
+
| 'l4'
|
|
45
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
46
|
+
| 'body-8'
|
|
47
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
48
|
+
| 'body-10'
|
|
49
|
+
/** @deprecated Use 'body-xs' instead. */
|
|
50
|
+
| 'body-12'
|
|
51
|
+
/** @deprecated No matching variant exists. Use suitable body variant. */
|
|
52
|
+
| 'body-13'
|
|
53
|
+
/** @deprecated Use 'body-sm' instead. */
|
|
54
|
+
| 'body-14'
|
|
55
|
+
/** @deprecated Use 'body-md' instead. */
|
|
56
|
+
| 'body-16'
|
|
57
|
+
/** @deprecated Use 'heading-6' instead. */
|
|
58
|
+
| 'display-18'
|
|
59
|
+
/** @deprecated Use 'heading-5' instead. */
|
|
60
|
+
| 'display-20'
|
|
61
|
+
/** @deprecated Use 'heading-4' instead. */
|
|
62
|
+
| 'display-24'
|
|
63
|
+
/** @deprecated Use 'heading-3' instead. */
|
|
64
|
+
| 'display-28'
|
|
65
|
+
/** @deprecated Use 'heading-2' instead. */
|
|
66
|
+
| 'display-32'
|
|
67
|
+
/** @deprecated Use 'heading-1' instead. */
|
|
68
|
+
| 'display-40'
|
|
69
|
+
/** @deprecated No matching variant exists. Use suitable heading variant. */
|
|
70
|
+
| 'display-42';
|
|
10
71
|
export type TypographyVariant = TypographyBodyHeaderVariants | DeprecatedTypographyVariant;
|
|
11
72
|
export type FontWeight = 'regular' | 'semibold' | 'bold'
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Prefer regular or semibold
|
|
14
|
-
*/
|
|
73
|
+
/** @deprecated Use 'regular' or 'semibold' instead. */
|
|
15
74
|
| 'medium';
|
|
16
75
|
export type Intent = 'default' | 'ai';
|
|
17
76
|
export type TypographyProps = PropsWithChildren<SpacewebComponentProps> & {
|
package/form-control/types.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type FormControlProps = {
|
|
|
33
33
|
error?: React.ReactNode;
|
|
34
34
|
positive?: React.ReactNode;
|
|
35
35
|
htmlFor?: string;
|
|
36
|
-
/** @deprecated
|
|
36
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'vertical'. */
|
|
37
37
|
layout?: layout;
|
|
38
38
|
overrides?: FormControlOverrides;
|
|
39
39
|
required?: boolean;
|
package/image/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type DefaultFallbackProps = SpacewebComponentProps & {
|
|
|
19
19
|
height?: number;
|
|
20
20
|
width?: number;
|
|
21
21
|
isValidVideo?: boolean;
|
|
22
|
-
/** @deprecated */
|
|
22
|
+
/** @deprecated Not supported in Hyperspace. */
|
|
23
23
|
iconSize?: number;
|
|
24
24
|
overrides?: {
|
|
25
25
|
Root?: Override<{}>;
|
|
@@ -9,7 +9,7 @@ export declare const BaseNumberInput: import("react").ForwardRefExoticComponent<
|
|
|
9
9
|
'aria-label'?: string | undefined;
|
|
10
10
|
'aria-labelledby'?: string | undefined;
|
|
11
11
|
'aria-describedby'?: string | undefined;
|
|
12
|
-
adjoined?: "
|
|
12
|
+
adjoined?: "right" | "none" | "left" | "both" | undefined;
|
|
13
13
|
autoComplete?: string | undefined;
|
|
14
14
|
disabled?: boolean | undefined;
|
|
15
15
|
pattern?: string | undefined;
|
package/input/types.d.ts
CHANGED
|
@@ -4,20 +4,10 @@ import type { SpacewebComponentProps, Intent } from '../types';
|
|
|
4
4
|
import type { Override } from '../overrides';
|
|
5
5
|
import type { Properties } from 'csstype';
|
|
6
6
|
import type { STATE_CHANGE_TYPE, ADJOINED, ENHANCER_POSITION } from './constants';
|
|
7
|
-
export type InputSize =
|
|
8
7
|
/** @deprecated Use 'small' or 'medium' instead. */
|
|
9
|
-
'xxxs'
|
|
10
|
-
|
|
11
|
-
| '
|
|
12
|
-
/** @deprecated Use 'small' or 'medium' instead. */
|
|
13
|
-
| 'sm'
|
|
14
|
-
/** @deprecated Use 'small' or 'medium' instead. */
|
|
15
|
-
| 'md'
|
|
16
|
-
/** @deprecated Use 'small' or 'medium' instead. */
|
|
17
|
-
| 'lg' | 'small' | 'medium';
|
|
18
|
-
export type InputVariant = 'default'
|
|
19
|
-
/** @deprecated Use 'default' instead. */
|
|
20
|
-
| 'line';
|
|
8
|
+
type DeprecatedInputSize = 'xxxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
9
|
+
export type InputSize = DeprecatedInputSize | 'small' | 'medium';
|
|
10
|
+
export type InputVariant = 'default' | 'line';
|
|
21
11
|
/**
|
|
22
12
|
* Position of the cursor when input element is focussed
|
|
23
13
|
* 1. 'start' - beginning of input value
|
|
@@ -35,6 +25,7 @@ export type State = {
|
|
|
35
25
|
export type StateReducer = (stateType: StateType, nextState: State, currentState: State) => State;
|
|
36
26
|
export type SharedProps = {
|
|
37
27
|
$size: InputSize;
|
|
28
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
|
|
38
29
|
$variant: InputVariant;
|
|
39
30
|
$intent: Intent;
|
|
40
31
|
$type?: string;
|
|
@@ -82,6 +73,7 @@ export type BaseInputProps<T> = SpacewebComponentProps<{
|
|
|
82
73
|
disabled?: boolean;
|
|
83
74
|
pattern?: string;
|
|
84
75
|
id?: string;
|
|
76
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'default'. */
|
|
85
77
|
variant?: InputVariant;
|
|
86
78
|
intent?: Intent;
|
|
87
79
|
inputMode?: string;
|
|
@@ -154,3 +146,4 @@ export interface MaskedInputProps extends InputProps {
|
|
|
154
146
|
mask?: string;
|
|
155
147
|
maskChar?: string;
|
|
156
148
|
}
|
|
149
|
+
export {};
|
|
@@ -97,7 +97,7 @@ declare const StatefulSubMenu: import("react").ForwardRefExoticComponent<Omit<Me
|
|
|
97
97
|
}) => ReactNode);
|
|
98
98
|
targetElement?: HTMLElement | null | undefined;
|
|
99
99
|
triggerType?: import("../popover").TriggerType | undefined;
|
|
100
|
-
placement?: "
|
|
100
|
+
placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
101
101
|
innerRef?: import("react").Ref<HTMLElement> | undefined;
|
|
102
102
|
viewportAsBoundary?: boolean | undefined;
|
|
103
103
|
} & Record<string, any>> | undefined;
|
package/menu/SubMenu.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ declare const SubMenu: import("react").ForwardRefExoticComponent<Omit<MenuProps,
|
|
|
98
98
|
}) => ReactNode);
|
|
99
99
|
targetElement?: HTMLElement | null | undefined;
|
|
100
100
|
triggerType?: import("../popover").TriggerType | undefined;
|
|
101
|
-
placement?: "
|
|
101
|
+
placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
102
102
|
innerRef?: import("react").Ref<HTMLElement> | undefined;
|
|
103
103
|
viewportAsBoundary?: boolean | undefined;
|
|
104
104
|
} & Record<string, any>> | undefined;
|
package/menu/menu-item.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
46
46
|
}) => React.ReactNode);
|
|
47
47
|
targetElement?: HTMLElement | null | undefined;
|
|
48
48
|
triggerType?: import("../popover").TriggerType | undefined;
|
|
49
|
-
placement?: "
|
|
49
|
+
placement?: "right" | "top" | "auto" | "bottom" | "left" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
50
50
|
innerRef?: React.Ref<HTMLElement> | undefined;
|
|
51
51
|
viewportAsBoundary?: boolean | undefined;
|
|
52
52
|
} & Record<string, any>> | undefined;
|
package/menu/types.d.ts
CHANGED
|
@@ -73,9 +73,7 @@ export type MenuProps = Omit<ListProps, 'overrides'> & {
|
|
|
73
73
|
* If true, none of the MenuItem will be highlighted when mouse leaves the Menu.
|
|
74
74
|
*/
|
|
75
75
|
resetMenuHighlightOnMouseLeave?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* @deprecated This prop will be removed. use resetMenuHighlightOnMouseLeave
|
|
78
|
-
*/
|
|
76
|
+
/** @deprecated Use resetMenuHighlightOnMouseLeave instead. */
|
|
79
77
|
resetMenuOnMouseLeave?: boolean;
|
|
80
78
|
reducer?: Reducer;
|
|
81
79
|
captureScroll?: boolean;
|
package/modal/types.d.ts
CHANGED
|
@@ -2,9 +2,6 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { ModalOverrides, ModalProps as BaseModalProps, SharedStylePropsArg } from '../baseui/modal';
|
|
3
3
|
import type { Override } from '../overrides';
|
|
4
4
|
import type { Intent as BaseIntent, SpacewebComponentProps } from '../types';
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Only 'medium' is supported as a new default size.
|
|
7
|
-
*/
|
|
8
5
|
export type Size = 'medium' | 'sm' | 'md' | 'lg' | 'fullPage';
|
|
9
6
|
export type Role = 'dialog' | 'alertdialog';
|
|
10
7
|
export type SharedProps = Omit<SharedStylePropsArg, '$size'> & {
|
|
@@ -19,9 +16,7 @@ export type ModalProps = Omit<BaseModalProps, 'overrides' | 'size' | 'role'> & {
|
|
|
19
16
|
overrides?: {
|
|
20
17
|
[key in keyof ModalOverrides]?: Override<SharedProps & Record<string, any>>;
|
|
21
18
|
};
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated 'size' is deprecated and the 'md' sizing is the new default.
|
|
24
|
-
*/
|
|
19
|
+
/** @deprecated Not supported in Hyperspace. Defaults to 'medium'. */
|
|
25
20
|
size?: Size;
|
|
26
21
|
role?: Role;
|
|
27
22
|
/** Explicit accessible label for the dialog. Defaults to "dialog" when no labelled-by target is available. */
|