@qualtrics/ui-react 2.28.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/__shared/cjs/{index-2ad33b44.js → index-30cc916b.js} +601 -391
- package/dist/__shared/cjs/{index-0c005184.js → index-e0e97b93.js} +3 -3
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +54 -10
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown.js +59 -7
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio.js +25 -5
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/Radio/RadioGroup.js +16 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/hooks/useOverlay/useOverlay.js +1 -0
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +54 -78
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox.js +5 -2
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer.js +3 -2
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/FormFieldWrapper.js +36 -0
- package/dist/next/Form/FormFields/InputField.js +8 -0
- package/dist/next/Form/index.js +2 -0
- package/dist/next/Form/useForm.js +298 -0
- package/dist/next/Form/useFormField.js +25 -0
- package/dist/next/Form/utils/createFormInstance.js +32 -0
- package/dist/next/Form/utils/useFormContext.js +9 -0
- package/dist/next/Input/Input.js +47 -7
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuPane.js +2 -2
- package/dist/next/Pagination/Pagination.css.js +9 -0
- package/dist/next/Pagination/Pagination.css.ts.vanilla.js +8 -0
- package/dist/next/Pagination/Pagination.js +166 -0
- package/dist/next/Pagination/RowDisplayCount.js +46 -0
- package/dist/next/Pagination/index.js +2 -0
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/ToggleButton.js +2 -2
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +171 -3
- package/dist/next/index.es.js +29 -23
- package/dist/next/index.js +1968 -1476
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/icons/package.json +1 -1
- package/next/package.json +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import React__default, { useState, useRef } from 'react';
|
|
3
|
+
import { growingInput, hidden, pageNumber, pagination } from './Pagination.css.js';
|
|
4
|
+
import '../../components/index.js';
|
|
5
|
+
import '../index.es.js';
|
|
6
|
+
import '../../icons/index.es.js';
|
|
7
|
+
import '../../utils/index.js';
|
|
8
|
+
import '../../hooks/index.js';
|
|
9
|
+
import useSSRLayoutEffect from '../../hooks/useSSRLayoutEffect/useSSRLayoutEffect.js';
|
|
10
|
+
import Input from '../Input/Input.js';
|
|
11
|
+
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
12
|
+
import Translate from '../../utils/Translation/Translate.js';
|
|
13
|
+
import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
14
|
+
import useScreenReaderAnnouncement from '../../hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js';
|
|
15
|
+
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
16
|
+
import IconButton from '../../components/IconButton/IconButton.js';
|
|
17
|
+
import ChevronSkipBackIcon from '../../icons/components/ChevronSkipBackIcon.js';
|
|
18
|
+
import ChevronLeftIcon from '../../icons/components/ChevronLeftIcon.js';
|
|
19
|
+
import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
|
|
20
|
+
import ChevronSkipForwardIcon from '../../icons/components/ChevronSkipForwardIcon.js';
|
|
21
|
+
|
|
22
|
+
const INVALID_INTEGER_INPUT_CHARS = ['-', '+', 'e', '.'];
|
|
23
|
+
const coalesceIntegerToRange = (value, min, max) => Math.min(Math.max(Math.round(value), min), max);
|
|
24
|
+
const GrowingIntegerInput = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
value,
|
|
27
|
+
onChangeInput,
|
|
28
|
+
max,
|
|
29
|
+
min,
|
|
30
|
+
...rest
|
|
31
|
+
} = _ref;
|
|
32
|
+
const [width, setWidth] = useState(0);
|
|
33
|
+
const [internalValue, setInternalValue] = useState(value);
|
|
34
|
+
const [previousExternalValue, setPreviousExternalValue] = useState(value);
|
|
35
|
+
const span = useRef(null);
|
|
36
|
+
if (value !== previousExternalValue) {
|
|
37
|
+
setPreviousExternalValue(value);
|
|
38
|
+
setInternalValue(value);
|
|
39
|
+
}
|
|
40
|
+
useSSRLayoutEffect(() => {
|
|
41
|
+
var _span$current$offsetW, _span$current;
|
|
42
|
+
setWidth((_span$current$offsetW = (_span$current = span.current) === null || _span$current === void 0 ? void 0 : _span$current.offsetWidth) !== null && _span$current$offsetW !== void 0 ? _span$current$offsetW : 0);
|
|
43
|
+
}, [internalValue]);
|
|
44
|
+
const triggerInternalChange = e => {
|
|
45
|
+
setInternalValue(coalesceIntegerToRange(Number(e.target.value), Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER));
|
|
46
|
+
};
|
|
47
|
+
const triggerExternalChange = e => {
|
|
48
|
+
const maxNumber = Number(max) || Number.MAX_SAFE_INTEGER;
|
|
49
|
+
const minNumber = Number(min) || Number.MIN_SAFE_INTEGER;
|
|
50
|
+
const newValue = coalesceIntegerToRange(Number(e.target.value), minNumber, maxNumber);
|
|
51
|
+
setInternalValue(newValue);
|
|
52
|
+
onChangeInput(newValue);
|
|
53
|
+
};
|
|
54
|
+
const onKeyDownHandler = e => {
|
|
55
|
+
if (e.key === 'Enter') {
|
|
56
|
+
triggerExternalChange(e);
|
|
57
|
+
} else if (INVALID_INTEGER_INPUT_CHARS.includes(e.key)) {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const displayValue = internalValue.toString();
|
|
62
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
|
63
|
+
className: growingInput
|
|
64
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
65
|
+
className: hidden,
|
|
66
|
+
ref: span
|
|
67
|
+
}, displayValue), /*#__PURE__*/React__default.createElement(Input, _extends({
|
|
68
|
+
type: "number",
|
|
69
|
+
value: displayValue,
|
|
70
|
+
style: {
|
|
71
|
+
width,
|
|
72
|
+
minWidth: 1
|
|
73
|
+
},
|
|
74
|
+
onChange: triggerInternalChange,
|
|
75
|
+
onKeyDown: onKeyDownHandler,
|
|
76
|
+
onBlur: triggerExternalChange
|
|
77
|
+
}, rest)));
|
|
78
|
+
};
|
|
79
|
+
const PageInput = _ref2 => {
|
|
80
|
+
let {
|
|
81
|
+
numPages,
|
|
82
|
+
currentPage,
|
|
83
|
+
onChange,
|
|
84
|
+
'aria-label': ariaLabel,
|
|
85
|
+
disabled,
|
|
86
|
+
'data-testid': dataTestId
|
|
87
|
+
} = _ref2;
|
|
88
|
+
const delegatedInput = /*#__PURE__*/React__default.createElement(GrowingIntegerInput, {
|
|
89
|
+
max: numPages !== null && numPages !== void 0 ? numPages : undefined,
|
|
90
|
+
min: 1,
|
|
91
|
+
disabled: disabled,
|
|
92
|
+
key: "currentPage",
|
|
93
|
+
value: currentPage,
|
|
94
|
+
"aria-label": ariaLabel,
|
|
95
|
+
onChangeInput: onChange,
|
|
96
|
+
"data-testid": getSubDataTestId(dataTestId, 'input')
|
|
97
|
+
});
|
|
98
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
99
|
+
className: pageNumber
|
|
100
|
+
}, numPages ? /*#__PURE__*/React__default.createElement(Translate, {
|
|
101
|
+
messageKey: "pagination",
|
|
102
|
+
placeholders: {
|
|
103
|
+
currentPage: delegatedInput,
|
|
104
|
+
numPages
|
|
105
|
+
}
|
|
106
|
+
}) : delegatedInput);
|
|
107
|
+
};
|
|
108
|
+
const Pagination = _ref3 => {
|
|
109
|
+
let {
|
|
110
|
+
hidePageNumber = false,
|
|
111
|
+
hideFirstAndLastButtons = false,
|
|
112
|
+
numPages,
|
|
113
|
+
currentPage,
|
|
114
|
+
onPageChange,
|
|
115
|
+
isDisabled = false,
|
|
116
|
+
'data-testid': dataTestId
|
|
117
|
+
} = _ref3;
|
|
118
|
+
const {
|
|
119
|
+
translate
|
|
120
|
+
} = useTranslation();
|
|
121
|
+
const announceToScreenReader = useScreenReaderAnnouncement('polite');
|
|
122
|
+
useDidUpdate(() => {
|
|
123
|
+
let messageKey = 'currentPageNumber';
|
|
124
|
+
const placeholders = {
|
|
125
|
+
currentPage
|
|
126
|
+
};
|
|
127
|
+
if (numPages) {
|
|
128
|
+
messageKey = 'currentPageNumberOf';
|
|
129
|
+
placeholders.numPages = numPages;
|
|
130
|
+
}
|
|
131
|
+
announceToScreenReader(translate(messageKey, placeholders));
|
|
132
|
+
}, [announceToScreenReader, translate, currentPage, numPages]);
|
|
133
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
134
|
+
className: pagination,
|
|
135
|
+
"data-testid": dataTestId
|
|
136
|
+
}, !hideFirstAndLastButtons && numPages && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
137
|
+
"aria-label": translate('firstPage'),
|
|
138
|
+
onClick: () => onPageChange(1),
|
|
139
|
+
disabled: isDisabled || currentPage <= 1,
|
|
140
|
+
"data-testid": getSubDataTestId(dataTestId, 'first-page')
|
|
141
|
+
}, /*#__PURE__*/React__default.createElement(ChevronSkipBackIcon, null)), /*#__PURE__*/React__default.createElement(IconButton, {
|
|
142
|
+
"aria-label": translate('previousPage'),
|
|
143
|
+
disabled: isDisabled || currentPage <= 1,
|
|
144
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
145
|
+
"data-testid": getSubDataTestId(dataTestId, 'previous-page')
|
|
146
|
+
}, /*#__PURE__*/React__default.createElement(ChevronLeftIcon, null)), !hidePageNumber && /*#__PURE__*/React__default.createElement(PageInput, {
|
|
147
|
+
"aria-label": translate('currentPage'),
|
|
148
|
+
currentPage: currentPage,
|
|
149
|
+
numPages: numPages,
|
|
150
|
+
onChange: onPageChange,
|
|
151
|
+
disabled: isDisabled || numPages === 1,
|
|
152
|
+
"data-testid": getSubDataTestId(dataTestId, 'current-page')
|
|
153
|
+
}), /*#__PURE__*/React__default.createElement(IconButton, {
|
|
154
|
+
"aria-label": translate('nextPage'),
|
|
155
|
+
disabled: isDisabled || numPages !== undefined && currentPage >= numPages,
|
|
156
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
157
|
+
"data-testid": getSubDataTestId(dataTestId, 'next-page')
|
|
158
|
+
}, /*#__PURE__*/React__default.createElement(ChevronRightIcon, null)), !hideFirstAndLastButtons && numPages && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
159
|
+
"aria-label": translate('lastPage'),
|
|
160
|
+
disabled: isDisabled || currentPage >= numPages,
|
|
161
|
+
onClick: () => onPageChange(numPages),
|
|
162
|
+
"data-testid": getSubDataTestId(dataTestId, 'last-page')
|
|
163
|
+
}, /*#__PURE__*/React__default.createElement(ChevronSkipForwardIcon, null)));
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export { Pagination as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import '../Select/index.js';
|
|
3
|
+
import '../../utils/index.js';
|
|
4
|
+
import { rowCount } from './Pagination.css.js';
|
|
5
|
+
import Select from '../Select/Select.js';
|
|
6
|
+
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
7
|
+
import SelectButton from '../Select/SelectButton.js';
|
|
8
|
+
import SelectPane from '../Select/SelectPane.js';
|
|
9
|
+
import SelectItem from '../Select/SelectItem.js';
|
|
10
|
+
import Translate from '../../utils/Translation/Translate.js';
|
|
11
|
+
|
|
12
|
+
const RowDisplayCount = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
'data-testid': dataTestId,
|
|
15
|
+
displayCount,
|
|
16
|
+
displayCountOptions,
|
|
17
|
+
onDisplayCountChange,
|
|
18
|
+
isDisabled = false
|
|
19
|
+
} = _ref;
|
|
20
|
+
const displayCountSelect = /*#__PURE__*/React__default.createElement(Select, {
|
|
21
|
+
"data-testid": getSubDataTestId(dataTestId, 'select'),
|
|
22
|
+
isDisabled: isDisabled,
|
|
23
|
+
value: displayCount,
|
|
24
|
+
onChange: onDisplayCountChange,
|
|
25
|
+
key: "displayCountSelect"
|
|
26
|
+
}, /*#__PURE__*/React__default.createElement(SelectButton, null), /*#__PURE__*/React__default.createElement(SelectPane, {
|
|
27
|
+
style: {
|
|
28
|
+
minWidth: 'var(--radix-dropdown-menu-trigger-width)'
|
|
29
|
+
}
|
|
30
|
+
}, displayCountOptions === null || displayCountOptions === void 0 ? void 0 : displayCountOptions.map(option => /*#__PURE__*/React__default.createElement(SelectItem, {
|
|
31
|
+
value: option,
|
|
32
|
+
label: "".concat(option),
|
|
33
|
+
key: option
|
|
34
|
+
}))));
|
|
35
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
36
|
+
className: rowCount,
|
|
37
|
+
"data-testid": dataTestId
|
|
38
|
+
}, /*#__PURE__*/React__default.createElement(Translate, {
|
|
39
|
+
messageKey: "rowDisplayCount",
|
|
40
|
+
placeholders: {
|
|
41
|
+
select: displayCountSelect
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { RowDisplayCount as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"input":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._7Jk3A input{padding-left:76px!important}._-08BE input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._-08BE input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._-08BE input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._yrkU4{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._yrkU4,._yrkU4._-08BE:hover{background-color:transparent!important}._yrkU4:hover{background-color:rgba(50,54,58,.08)!important}._yrkU4:active{background-color:rgba(50,54,58,.11)!important}._yrkU4 svg{top:2px!important}._yZcqR{position:relative}._el7Ra{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
4
|
+
var styles = {"input":"_7Jk3A","disabled":"_-08BE","dropdown":"_yrkU4","container":"_yZcqR","countryCode":"_el7Ra"};
|
|
5
|
+
var stylesheet="._7Jk3A input{padding-left:76px!important}._-08BE input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._-08BE input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._-08BE input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._yrkU4{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._yrkU4,._yrkU4._-08BE:hover{background-color:transparent!important}._yrkU4:hover{background-color:rgba(50,54,58,.08)!important}._yrkU4:active{background-color:rgba(50,54,58,.11)!important}._yrkU4 svg{top:2px!important}._yZcqR{position:relative}._el7Ra{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"isInvalid":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._gKYCf{box-shadow:inset 0 0 0 1px #b00!important}._m88AW{width:unset!important;min-height:unset!important;padding:0!important;margin-right:7px}._k7-Tv{background-color:rgba(11,110,208,.08);font-weight:500}";
|
|
4
|
+
var styles = {"isInvalid":"_gKYCf","checkbox":"_m88AW","selectedItem":"_k7-Tv"};
|
|
5
|
+
var stylesheet="._gKYCf{box-shadow:inset 0 0 0 1px #b00!important}._m88AW{width:unset!important;min-height:unset!important;padding:0!important;margin-right:7px}._k7-Tv{background-color:rgba(11,110,208,.08);font-weight:500}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._Leube{display:flex}._9r05A{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._9r05A._L3S7p{background-color:#fff}._9r05A._L3S7p._aTjxl:not(._9r05A._L3S7p._s3dro),._9r05A._L3S7p._ypSlZ.focus-visible:not(._T93zj),._9r05A._L3S7p._ypSlZ:focus-visible:not(._T93zj),._9r05A._rSgmZ{background-color:#0b6ed0}._9r05A._rSgmZ._s3dro._aTjxl,._9r05A._rSgmZ._T93zj._s3dro,._9r05A._rSgmZ._T93zj._ypSlZ{opacity:.4}._60YdE{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._60YdE:focus{z-index:1}._cs1tH{border-radius:0 4px 4px 0;transition:border .2s,background .2s,color .2s;border-left:none;min-width:35px!important;padding:0!important;justify-content:center!important}._cs1tH svg{margin-left:1px}._cs1tH._L3S7p{background-color:#0b6ed0;border-color:transparent}._cs1tH._L3S7p svg{fill:#fff!important}._cs1tH._L3S7p:not(._xEgut):hover{background-color:#085caf!important}._cs1tH._L3S7p:not(._xEgut):active{background-color:#0854a1!important}._cs1tH._L3S7p._xEgut{opacity:.4}._cs1tH._L3S7p._xEgut svg{background-color:transparent}._cs1tH._rSgmZ{border-color:#0b6ed0;background-color:#fff}._cs1tH._rSgmZ svg{fill:#0b6ed0!important}._cs1tH._rSgmZ:not(._xEgut):hover{background-color:#eef5fc!important}._cs1tH._rSgmZ:not(._xEgut):active{background-color:#e1edf9!important}._cs1tH._rSgmZ._xEgut{opacity:.4}._cs1tH._rSgmZ._xEgut svg{background-color:transparent}._NbKkk{width:260px}";
|
|
4
|
+
var styles = {"container":"_Leube","divider":"_9r05A","primary":"_L3S7p","mainButtonFocus":"_ypSlZ","mainButtonDisabled":"_T93zj","dropdownButtonFocus":"_aTjxl","dropdownButtonDisabled":"_s3dro","secondary":"_rSgmZ","mainButton":"_60YdE","dropdownButton":"_cs1tH","disabled":"_xEgut","dropdownOption":"_NbKkk"};
|
|
5
|
+
var stylesheet="._Leube{display:flex}._9r05A{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._9r05A._L3S7p{background-color:#fff}._9r05A._L3S7p._aTjxl:not(._9r05A._L3S7p._s3dro),._9r05A._L3S7p._ypSlZ.focus-visible:not(._T93zj),._9r05A._L3S7p._ypSlZ:focus-visible:not(._T93zj),._9r05A._rSgmZ{background-color:#0b6ed0}._9r05A._rSgmZ._s3dro._aTjxl,._9r05A._rSgmZ._T93zj._s3dro,._9r05A._rSgmZ._T93zj._ypSlZ{opacity:.4}._60YdE{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._60YdE:focus{z-index:1}._cs1tH{border-radius:0 4px 4px 0;transition:border .2s,background .2s,color .2s;border-left:none;min-width:35px!important;padding:0!important;justify-content:center!important}._cs1tH svg{margin-left:1px}._cs1tH._L3S7p{background-color:#0b6ed0;border-color:transparent}._cs1tH._L3S7p svg{fill:#fff!important}._cs1tH._L3S7p:not(._xEgut):hover{background-color:#085caf!important}._cs1tH._L3S7p:not(._xEgut):active{background-color:#0854a1!important}._cs1tH._L3S7p._xEgut{opacity:.4}._cs1tH._L3S7p._xEgut svg{background-color:transparent}._cs1tH._rSgmZ{border-color:#0b6ed0;background-color:#fff}._cs1tH._rSgmZ svg{fill:#0b6ed0!important}._cs1tH._rSgmZ:not(._xEgut):hover{background-color:#eef5fc!important}._cs1tH._rSgmZ:not(._xEgut):active{background-color:#e1edf9!important}._cs1tH._rSgmZ._xEgut{opacity:.4}._cs1tH._rSgmZ._xEgut svg{background-color:transparent}._NbKkk{width:260px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"timePickerContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._eYQqf{display:inline-block;position:relative}._eYQqf ._2ZuhM{width:120px}._eYQqf ._2ZuhM ._3IQsv._U-oN0{transform:rotate(-180deg)}._eYQqf ._2ZuhM ._3IQsv._HdHdw{fill:#9d9fa1;opacity:.4}._eYQqf ._eP-H5>input:focus{box-shadow:none!important;border:1px solid #898989!important}._eYQqf ._3IQsv{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._eYQqf ._3IQsv._U-oN0{transform:rotate(-180deg)}._OfbX8{width:120px}._OfbX8 ._FXTTH._UQIzh{background-color:#efefef;border-radius:6px}";
|
|
4
|
+
var styles = {"timePickerContainer":"_eYQqf","input":"_2ZuhM","icon":"_3IQsv","open":"_U-oN0","disabled":"_HdHdw","ignoreFocusStyle":"_eP-H5","timePickerFlyout":"_OfbX8","option":"_FXTTH","exactMatch":"_UQIzh"};
|
|
5
|
+
var stylesheet="._eYQqf{display:inline-block;position:relative}._eYQqf ._2ZuhM{width:120px}._eYQqf ._2ZuhM ._3IQsv._U-oN0{transform:rotate(-180deg)}._eYQqf ._2ZuhM ._3IQsv._HdHdw{fill:#9d9fa1;opacity:.4}._eYQqf ._eP-H5>input:focus{box-shadow:none!important;border:1px solid #898989!important}._eYQqf ._3IQsv{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._eYQqf ._3IQsv._U-oN0{transform:rotate(-180deg)}._OfbX8{width:120px}._OfbX8 ._FXTTH._UQIzh{background-color:#efefef;border-radius:6px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -11,10 +11,10 @@ import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
|
11
11
|
const ToggleButton = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
12
12
|
let {
|
|
13
13
|
children,
|
|
14
|
-
isActivated,
|
|
14
|
+
isActivated = false,
|
|
15
15
|
onChange,
|
|
16
16
|
value,
|
|
17
|
-
isDisabled,
|
|
17
|
+
isDisabled = false,
|
|
18
18
|
kind = 'icon-text',
|
|
19
19
|
'aria-label': ariaLabel,
|
|
20
20
|
'aria-labelledby': ariaLabelledby,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"default":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._tS7BW{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._-AIIi{background-color:rgba(50,54,58,.08)}._3t5JJ{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._gk23V{color:rgba(81,85,89,.4);cursor:not-allowed}._4WXRB{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._v3Xf6{color:#085caf;border-color:#085caf}._mKVc4,._v3Xf6{background:rgba(11,110,208,.11)}._mKVc4{color:#0854a1;border-color:#0854a1}._UuAEZ{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._-8e90{position:relative;display:inline-grid}._-8e90 svg{fill:currentColor}._-8e90 ._tgyer{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._-8e90 ._tgyer+._RZEOs{background-color:transparent;color:#515559;cursor:pointer;border:1px solid transparent;border-radius:4px;grid-column:1;grid-row:1;padding:0;min-width:76px;-webkit-user-select:none;-moz-user-select:none;user-select:none}._-8e90 ._tgyer+._RZEOs._rTqsY{padding:5px;max-width:36px;min-width:36px}._-8e90 ._tgyer+._RZEOs._RNCXo{padding:0 16px}._-8e90 ._tgyer+._RZEOs._cdvrB{padding:0 16px 0 12px}._-8e90 ._tgyer:hover+._RZEOs{background-color:rgba(50,54,58,.08)}._-8e90 ._tgyer:disabled+._RZEOs{color:rgba(81,85,89,.4);cursor:not-allowed}._-8e90 ._tgyer:active+._RZEOs,._-8e90 ._tgyer:focus:active+._RZEOs{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._-8e90 ._tgyer:checked+._RZEOs{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._-8e90 ._tgyer:checked:hover+._RZEOs{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._-8e90 ._tgyer:checked:disabled+._RZEOs{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._-8e90 ._tgyer:checked:active+._RZEOs,._-8e90 ._tgyer:checked:focus:active+._RZEOs{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._mqz8k{display:inline-flex;position:relative}._mqz8k:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._mqz8k>*{flex-shrink:0;flex-grow:0}._ooP7p{border:none;margin:0;padding:0}._ooP7p legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._-8e90 ._tgyer.focus-visible+._RZEOs,._-8e90 ._tgyer:focus-visible+._RZEOs{z-index:20;outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"default":"_tS7BW","hovered":"_-AIIi","pressed":"_3t5JJ","disabled":"_gk23V","selectedDefault":"_4WXRB","selectedHovered":"_v3Xf6","selectedPressed":"_mKVc4","selectedDisabled":"_UuAEZ","toggleContainer":"_-8e90","toggleInput":"_tgyer","toggleButton":"_RZEOs","iconOnly":"_rTqsY","text":"_RNCXo","iconText":"_cdvrB","toggleButtonGroup":"_mqz8k","toggleButtonGroupFieldset":"_ooP7p"};
|
|
5
|
+
var stylesheet="._tS7BW{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._-AIIi{background-color:rgba(50,54,58,.08)}._3t5JJ{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._gk23V{color:rgba(81,85,89,.4);cursor:not-allowed}._4WXRB{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._v3Xf6{color:#085caf;border-color:#085caf}._mKVc4,._v3Xf6{background:rgba(11,110,208,.11)}._mKVc4{color:#0854a1;border-color:#0854a1}._UuAEZ{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._-8e90{position:relative;display:inline-grid}._-8e90 svg{fill:currentColor}._-8e90 ._tgyer{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._-8e90 ._tgyer+._RZEOs{background-color:transparent;color:#515559;cursor:pointer;border:1px solid transparent;border-radius:4px;grid-column:1;grid-row:1;padding:0;min-width:76px;-webkit-user-select:none;-moz-user-select:none;user-select:none}._-8e90 ._tgyer+._RZEOs._rTqsY{padding:5px;max-width:36px;min-width:36px}._-8e90 ._tgyer+._RZEOs._RNCXo{padding:0 16px}._-8e90 ._tgyer+._RZEOs._cdvrB{padding:0 16px 0 12px}._-8e90 ._tgyer:hover+._RZEOs{background-color:rgba(50,54,58,.08)}._-8e90 ._tgyer:disabled+._RZEOs{color:rgba(81,85,89,.4);cursor:not-allowed}._-8e90 ._tgyer:active+._RZEOs,._-8e90 ._tgyer:focus:active+._RZEOs{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._-8e90 ._tgyer:checked+._RZEOs{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._-8e90 ._tgyer:checked:hover+._RZEOs{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._-8e90 ._tgyer:checked:disabled+._RZEOs{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._-8e90 ._tgyer:checked:active+._RZEOs,._-8e90 ._tgyer:checked:focus:active+._RZEOs{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._mqz8k{display:inline-flex;position:relative}._mqz8k:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._mqz8k>*{flex-shrink:0;flex-grow:0}._ooP7p{border:none;margin:0;padding:0}._ooP7p legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._-8e90 ._tgyer.focus-visible+._RZEOs,._-8e90 ._tgyer:focus-visible+._RZEOs{z-index:20;outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
package/dist/next/index.d.ts
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { AllHTMLAttributes } from 'react';
|
|
4
4
|
import type { ChangeEvent } from 'react';
|
|
5
|
+
import { ChangeEventHandler } from 'react';
|
|
5
6
|
import { ComputedPlacement } from '@popperjs/core';
|
|
6
7
|
import { CountryCode } from 'libphonenumber-js';
|
|
7
8
|
import { CSSProperties } from 'react';
|
|
9
|
+
import { DetailedHTMLProps } from 'react';
|
|
8
10
|
import { E164Number } from 'libphonenumber-js';
|
|
11
|
+
import { FocusEventHandler } from 'react';
|
|
12
|
+
import { FormEvent } from 'react';
|
|
13
|
+
import { FormHTMLAttributes } from 'react';
|
|
9
14
|
import { FunctionComponent } from 'react';
|
|
10
15
|
import type { InputHTMLAttributes } from 'react';
|
|
11
16
|
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
@@ -14,6 +19,7 @@ import { MouseEventHandler } from 'react';
|
|
|
14
19
|
import { MutableRefObject } from 'react';
|
|
15
20
|
import { default as React_2 } from 'react';
|
|
16
21
|
import { ReactNode } from 'react';
|
|
22
|
+
import { RefCallback } from 'react';
|
|
17
23
|
|
|
18
24
|
export declare const AdvancedTable: React_2.FunctionComponent<AdvancedTableProps>;
|
|
19
25
|
|
|
@@ -154,6 +160,15 @@ export declare interface AdvancedTableSelectedSortOption {
|
|
|
154
160
|
|
|
155
161
|
declare type Alignment = AdvancedTableColumnConfig['alignment'];
|
|
156
162
|
|
|
163
|
+
declare interface CheckboxRegisterProps<V extends Values> {
|
|
164
|
+
name: keyof V;
|
|
165
|
+
type: 'checkbox';
|
|
166
|
+
checked: boolean;
|
|
167
|
+
onBlur: FocusEventHandler<HTMLInputElement>;
|
|
168
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
169
|
+
ref: RefCallback<HTMLInputElement>;
|
|
170
|
+
}
|
|
171
|
+
|
|
157
172
|
export declare const CollapsibleSearchInput: React_2.ForwardRefExoticComponent<CollapsibleSearchInputProps & React_2.RefAttributes<HTMLSpanElement>>;
|
|
158
173
|
|
|
159
174
|
export declare interface CollapsibleSearchInputProps {
|
|
@@ -191,7 +206,7 @@ export declare interface CollectionGridProps extends CollectionGridItemProps {
|
|
|
191
206
|
rowHeight?: React_2.CSSProperties['gridAutoRows'];
|
|
192
207
|
}
|
|
193
208
|
|
|
194
|
-
export declare function Combobox({ initialValue, value, onChange, onSubmit, isDisabled, isInvalid, isRequired, isLoading, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'data-testid': dataTestId, children, }: ComboboxProps): JSX.Element;
|
|
209
|
+
export declare function Combobox({ initialValue, value, onChange, onSubmit, isDisabled, isInvalid, isRequired, isLoading, isOpen: externalIsOpen, onIsOpenChange: externalOnIsOpenChange, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'data-testid': dataTestId, children, }: ComboboxProps): JSX.Element;
|
|
195
210
|
|
|
196
211
|
export declare const ComboboxFlyout: FunctionComponent<ComboboxFlyoutProps>;
|
|
197
212
|
|
|
@@ -238,12 +253,22 @@ export declare interface ComboboxProps {
|
|
|
238
253
|
isInvalid?: boolean;
|
|
239
254
|
isRequired?: boolean;
|
|
240
255
|
isLoading?: boolean;
|
|
256
|
+
isOpen?: boolean;
|
|
257
|
+
onIsOpenChange?: (shouldOpen: boolean) => void;
|
|
241
258
|
'aria-label'?: string;
|
|
242
259
|
'aria-labelledby'?: string;
|
|
243
260
|
'data-testid'?: string;
|
|
244
261
|
children: ReactNode;
|
|
245
262
|
}
|
|
246
263
|
|
|
264
|
+
declare interface CustomRegisterProps<V extends Values> {
|
|
265
|
+
name: keyof V;
|
|
266
|
+
value: V[keyof V];
|
|
267
|
+
onBlur: OnBlur;
|
|
268
|
+
onChange: OnChange<V>;
|
|
269
|
+
ref: RefCallback<HTMLElement>;
|
|
270
|
+
}
|
|
271
|
+
|
|
247
272
|
export declare const Drawer: ({ id, isOpen: externalIsOpen, onIsOpenChange, title, width, zIndex, elementRefToFocusOnClose, containerRef, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "data-testid": dataTestId, children, }: DrawerProps) => React_2.ReactPortal | null;
|
|
248
273
|
|
|
249
274
|
export declare interface DrawerProps {
|
|
@@ -302,6 +327,8 @@ export declare interface FilterAnchorProps extends Omit<AllHTMLAttributes<HTMLBu
|
|
|
302
327
|
className?: string;
|
|
303
328
|
}
|
|
304
329
|
|
|
330
|
+
declare type HandleSubmit = (onSubmit: OnSubmit) => (event: FormEvent<HTMLFormElement>) => Promise<void>;
|
|
331
|
+
|
|
305
332
|
export declare const HStack: React_2.ForwardRefExoticComponent<HStackProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
306
333
|
|
|
307
334
|
declare type HStackAlignChildrenX = 'left' | 'center' | 'right' | 'spaceAround' | 'spaceBetween' | 'spaceEvenly';
|
|
@@ -316,13 +343,18 @@ export declare interface HStackProps extends ExternalStackProps {
|
|
|
316
343
|
export declare const Input: React_2.ForwardRefExoticComponent<InputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
317
344
|
|
|
318
345
|
export declare interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
346
|
+
name?: string;
|
|
319
347
|
type?: 'email' | 'number' | 'password' | 'tel' | 'text' | 'url';
|
|
320
348
|
initialValue?: string;
|
|
321
349
|
value?: string;
|
|
322
350
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
351
|
+
label?: string;
|
|
323
352
|
leftAddOn?: ReactNode;
|
|
324
353
|
rightAddOn?: ReactNode;
|
|
354
|
+
errorText?: ReactNode;
|
|
355
|
+
helperText?: ReactNode;
|
|
325
356
|
className?: string;
|
|
357
|
+
'data-testid'?: string;
|
|
326
358
|
style?: CSSProperties;
|
|
327
359
|
}
|
|
328
360
|
|
|
@@ -387,6 +419,45 @@ export declare interface MenuProps {
|
|
|
387
419
|
isVirtualizationDisabled?: boolean;
|
|
388
420
|
}
|
|
389
421
|
|
|
422
|
+
declare type OnBlur = () => void;
|
|
423
|
+
|
|
424
|
+
declare type OnChange<V extends Values> = (fieldValue: V[keyof V]) => void;
|
|
425
|
+
|
|
426
|
+
declare type OnSubmit = (values?: Values, event?: FormEvent<HTMLFormElement>) => Promise<void> | void;
|
|
427
|
+
|
|
428
|
+
export declare const Pagination: ({ hidePageNumber, hideFirstAndLastButtons, numPages, currentPage, onPageChange, isDisabled, "data-testid": dataTestId, }: PaginationProps) => JSX.Element;
|
|
429
|
+
|
|
430
|
+
export declare interface PaginationProps {
|
|
431
|
+
/** The current page in pagination. This should be passed in from a controlled state in the parent. */
|
|
432
|
+
currentPage: number;
|
|
433
|
+
/** The function to call when the page number is to change. This should be passed in from a controlled state in the parent. */
|
|
434
|
+
onPageChange: (pageNumber: number) => void;
|
|
435
|
+
/** The total number of pages to paginate through. When left blank the "of ####" label is removed. Also first and last buttons are removed. */
|
|
436
|
+
numPages?: number;
|
|
437
|
+
/** Controls whether or not to show the page number input and "of ####" label.
|
|
438
|
+
* @defaultValue false
|
|
439
|
+
*/
|
|
440
|
+
hidePageNumber?: boolean;
|
|
441
|
+
/** Controls whether or not to show the first and last page buttons.
|
|
442
|
+
* @defaultValue false
|
|
443
|
+
*/
|
|
444
|
+
hideFirstAndLastButtons?: boolean;
|
|
445
|
+
/** Controls if all controls in the pagination component are disabled.
|
|
446
|
+
* @defaultValue false
|
|
447
|
+
*/
|
|
448
|
+
isDisabled?: boolean;
|
|
449
|
+
/** Test ID for use in testing environments. Added to the containing `div`
|
|
450
|
+
* element and to each child component with a suffix:
|
|
451
|
+
*
|
|
452
|
+
* - First Page Button: `-first-page`
|
|
453
|
+
* - Previous Page Button: `-previous-page`
|
|
454
|
+
* - Current Page Input: `-current-page-input`
|
|
455
|
+
* - Next Page Button: `-next-page`
|
|
456
|
+
* - Last Page Button: `-last-page`
|
|
457
|
+
*/
|
|
458
|
+
'data-testid'?: string;
|
|
459
|
+
}
|
|
460
|
+
|
|
390
461
|
export declare const PhoneNumberInput: React_2.ForwardRefExoticComponent<PhoneNumberInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
391
462
|
|
|
392
463
|
export declare interface PhoneNumberInputProps {
|
|
@@ -404,8 +475,53 @@ export declare interface PhoneNumberInputProps {
|
|
|
404
475
|
inputId?: string;
|
|
405
476
|
}
|
|
406
477
|
|
|
478
|
+
declare interface RadioRegisterProps<V extends Values> {
|
|
479
|
+
name: keyof V;
|
|
480
|
+
type: 'radio';
|
|
481
|
+
value: string;
|
|
482
|
+
checked: boolean;
|
|
483
|
+
onBlur: FocusEventHandler<HTMLInputElement>;
|
|
484
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
485
|
+
ref: RefCallback<HTMLInputElement>;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
declare type Register<V extends Values> = {
|
|
489
|
+
(name: keyof V, options: {
|
|
490
|
+
type: 'text' | 'email' | 'password';
|
|
491
|
+
}): TextRegisterProps<V>;
|
|
492
|
+
(name: keyof V, options: {
|
|
493
|
+
type: 'checkbox';
|
|
494
|
+
}): CheckboxRegisterProps<V>;
|
|
495
|
+
(name: keyof V, options: {
|
|
496
|
+
type: 'radio';
|
|
497
|
+
radioValue: string;
|
|
498
|
+
}): RadioRegisterProps<V>;
|
|
499
|
+
(name: keyof V, options: {
|
|
500
|
+
type: 'custom';
|
|
501
|
+
}): CustomRegisterProps<V>;
|
|
502
|
+
};
|
|
503
|
+
|
|
407
504
|
declare type RenderCellContent = AdvancedTableColumnConfig['renderCellContent'];
|
|
408
505
|
|
|
506
|
+
export declare const RowDisplayCount: ({ "data-testid": dataTestId, displayCount, displayCountOptions, onDisplayCountChange, isDisabled, }: RowDisplayCountProps) => JSX.Element;
|
|
507
|
+
|
|
508
|
+
export declare interface RowDisplayCountProps {
|
|
509
|
+
/** The number of rows to show in pagination. */
|
|
510
|
+
displayCount: number;
|
|
511
|
+
/** The options for counts to show in the dropdown. */
|
|
512
|
+
displayCountOptions: Array<number>;
|
|
513
|
+
/** The function called when a the display count is changed. */
|
|
514
|
+
onDisplayCountChange: (newDisplayCount: number) => void;
|
|
515
|
+
/** Controls whether the dropdown is disabled.
|
|
516
|
+
* @defaultValue false
|
|
517
|
+
*/
|
|
518
|
+
isDisabled?: boolean;
|
|
519
|
+
/** Test ID for use in testing environments. Added to the containing `div`
|
|
520
|
+
* element and to the `Select` child with the suffix `-select`.
|
|
521
|
+
*/
|
|
522
|
+
'data-testid'?: string;
|
|
523
|
+
}
|
|
524
|
+
|
|
409
525
|
export declare const Select: ({ multiselect, children, isDisabled, onChange, isOpen, onIsOpenChange, value, isInvalid, "data-testid": dataTestId, isVirtualizationDisabled, }: SelectProps) => JSX.Element;
|
|
410
526
|
|
|
411
527
|
export declare const SelectButton: React_2.ForwardRefExoticComponent<SelectButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
@@ -511,6 +627,15 @@ export declare interface SubSelectProps extends Omit<SelectPaneProps, 'label' |
|
|
|
511
627
|
onIsOpenChange?: (isOpen: boolean) => void;
|
|
512
628
|
}
|
|
513
629
|
|
|
630
|
+
declare interface TextRegisterProps<V extends Values> {
|
|
631
|
+
name: keyof V;
|
|
632
|
+
type: 'text' | 'email' | 'password';
|
|
633
|
+
value: string;
|
|
634
|
+
onBlur: FocusEventHandler<HTMLInputElement>;
|
|
635
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
636
|
+
ref: RefCallback<HTMLInputElement>;
|
|
637
|
+
}
|
|
638
|
+
|
|
514
639
|
declare interface Time {
|
|
515
640
|
hour: number;
|
|
516
641
|
minute: number;
|
|
@@ -538,7 +663,7 @@ export declare const ToggleButtonGroup: React_2.ForwardRefExoticComponent<Toggle
|
|
|
538
663
|
export declare interface ToggleButtonGroupProps {
|
|
539
664
|
children: React_2.ReactNode;
|
|
540
665
|
value: string | null;
|
|
541
|
-
onChange: () => void;
|
|
666
|
+
onChange: (value: string) => void;
|
|
542
667
|
name?: string;
|
|
543
668
|
label?: string;
|
|
544
669
|
isDisabled?: boolean;
|
|
@@ -549,7 +674,7 @@ export declare interface ToggleButtonGroupProps {
|
|
|
549
674
|
export declare interface ToggleButtonProps {
|
|
550
675
|
children: React_2.ReactNode;
|
|
551
676
|
isActivated?: boolean;
|
|
552
|
-
onChange?: (
|
|
677
|
+
onChange?: (isActivated: boolean) => void;
|
|
553
678
|
value?: string;
|
|
554
679
|
isDisabled?: boolean;
|
|
555
680
|
kind?: 'icon' | 'icon-text' | 'text';
|
|
@@ -559,6 +684,49 @@ export declare interface ToggleButtonProps {
|
|
|
559
684
|
dataTestId?: string;
|
|
560
685
|
}
|
|
561
686
|
|
|
687
|
+
export declare function useForm<V extends Values>({ initialValues, validateField, }: UseFormOptions<V>): {
|
|
688
|
+
Form: (props: Omit<DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref">) => JSX.Element;
|
|
689
|
+
register: {
|
|
690
|
+
(name: keyof V, options: {
|
|
691
|
+
type: 'text' | 'email' | 'password';
|
|
692
|
+
}): TextRegisterProps<V>;
|
|
693
|
+
(name: keyof V, options: {
|
|
694
|
+
type: 'checkbox';
|
|
695
|
+
}): CheckboxRegisterProps<V>;
|
|
696
|
+
(name: keyof V, options: {
|
|
697
|
+
type: 'radio';
|
|
698
|
+
radioValue: string;
|
|
699
|
+
}): RadioRegisterProps<V>;
|
|
700
|
+
(name: keyof V, options: {
|
|
701
|
+
type: 'custom';
|
|
702
|
+
}): CustomRegisterProps<V>;
|
|
703
|
+
};
|
|
704
|
+
formValues: V;
|
|
705
|
+
fieldErrors: Partial<Record<keyof V, string>>;
|
|
706
|
+
formError: string;
|
|
707
|
+
formTouched: Partial<Record<keyof V, boolean>>;
|
|
708
|
+
isSubmitting: boolean;
|
|
709
|
+
handleSubmit: HandleSubmit;
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
export declare function useFormField(): {
|
|
713
|
+
register: Register<Partial<Record<string, string | boolean | string[]>>> | undefined;
|
|
714
|
+
formValues: Partial<Record<string, string | boolean | string[]>> | undefined;
|
|
715
|
+
formTouched: Partial<Record<string, boolean>> | undefined;
|
|
716
|
+
fieldErrors: Partial<Record<string, string>> | undefined;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
declare interface UseFormOptions<V extends Values> {
|
|
720
|
+
initialValues: V;
|
|
721
|
+
validateField?: ValidateField<V>;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare type ValidateField<V extends Values> = (fieldName: keyof V, fieldValue: V[keyof V], formValues?: V) => string;
|
|
725
|
+
|
|
726
|
+
declare type Value = string | string[] | boolean;
|
|
727
|
+
|
|
728
|
+
declare type Values = Partial<Record<string, Value>>;
|
|
729
|
+
|
|
562
730
|
export declare const VStack: React_2.ForwardRefExoticComponent<VStackProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
563
731
|
|
|
564
732
|
declare type VStackAlignChildrenX = 'left' | 'center' | 'right' | 'stretch';
|