@qualtrics/ui-react 2.28.0 → 2.29.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 +11 -0
- package/dist/__shared/cjs/{index-2ad33b44.js → index-c2d2f188.js} +601 -391
- package/dist/__shared/cjs/{index-0c005184.js → index-c9e48360.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/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/Combobox2.js +3 -3
- 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 +168 -2
- package/dist/next/index.es.js +29 -23
- package/dist/next/index.js +1962 -1474
- 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 = "._ex4kH input{padding-left:76px!important}._XLcmY input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._XLcmY input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._XLcmY input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._CEWCL{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._CEWCL,._CEWCL._XLcmY:hover{background-color:transparent!important}._CEWCL:hover{background-color:rgba(50,54,58,.08)!important}._CEWCL:active{background-color:rgba(50,54,58,.11)!important}._CEWCL svg{top:2px!important}._e48CZ{position:relative}._Hpw0X{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
4
|
+
var styles = {"input":"_ex4kH","disabled":"_XLcmY","dropdown":"_CEWCL","container":"_e48CZ","countryCode":"_Hpw0X"};
|
|
5
|
+
var stylesheet="._ex4kH input{padding-left:76px!important}._XLcmY input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._XLcmY input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._XLcmY input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._CEWCL{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._CEWCL,._CEWCL._XLcmY:hover{background-color:transparent!important}._CEWCL:hover{background-color:rgba(50,54,58,.08)!important}._CEWCL:active{background-color:rgba(50,54,58,.11)!important}._CEWCL svg{top:2px!important}._e48CZ{position:relative}._Hpw0X{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 = "._CJ6cu{box-shadow:inset 0 0 0 1px #b00!important}._ao75N{width:unset!important;min-height:unset!important;padding:0!important;margin-right:7px}._LF5DX{background-color:rgba(11,110,208,.08);font-weight:500}";
|
|
4
|
+
var styles = {"isInvalid":"_CJ6cu","checkbox":"_ao75N","selectedItem":"_LF5DX"};
|
|
5
|
+
var stylesheet="._CJ6cu{box-shadow:inset 0 0 0 1px #b00!important}._ao75N{width:unset!important;min-height:unset!important;padding:0!important;margin-right:7px}._LF5DX{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 = "._MyQMX{display:flex}._9-3-D{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._9-3-D._Y5ey6{background-color:#fff}._9-3-D._W6uBO,._9-3-D._Y5ey6._9EbiJ.focus-visible:not(._xu2tf),._9-3-D._Y5ey6._9EbiJ:focus-visible:not(._xu2tf),._9-3-D._Y5ey6._WZahD:not(._9-3-D._Y5ey6._iexVS){background-color:#0b6ed0}._9-3-D._W6uBO._iexVS._WZahD,._9-3-D._W6uBO._xu2tf._9EbiJ,._9-3-D._W6uBO._xu2tf._iexVS{opacity:.4}._HRQJK{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._HRQJK:focus{z-index:1}._jn-hg{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}._jn-hg svg{margin-left:1px}._jn-hg._Y5ey6{background-color:#0b6ed0;border-color:transparent}._jn-hg._Y5ey6 svg{fill:#fff!important}._jn-hg._Y5ey6:not(._mhzDX):hover{background-color:#085caf!important}._jn-hg._Y5ey6:not(._mhzDX):active{background-color:#0854a1!important}._jn-hg._Y5ey6._mhzDX{opacity:.4}._jn-hg._Y5ey6._mhzDX svg{background-color:transparent}._jn-hg._W6uBO{border-color:#0b6ed0;background-color:#fff}._jn-hg._W6uBO svg{fill:#0b6ed0!important}._jn-hg._W6uBO:not(._mhzDX):hover{background-color:#eef5fc!important}._jn-hg._W6uBO:not(._mhzDX):active{background-color:#e1edf9!important}._jn-hg._W6uBO._mhzDX{opacity:.4}._jn-hg._W6uBO._mhzDX svg{background-color:transparent}._YG-2t{width:260px}";
|
|
4
|
+
var styles = {"container":"_MyQMX","divider":"_9-3-D","primary":"_Y5ey6","mainButtonFocus":"_9EbiJ","mainButtonDisabled":"_xu2tf","dropdownButtonFocus":"_WZahD","dropdownButtonDisabled":"_iexVS","secondary":"_W6uBO","mainButton":"_HRQJK","dropdownButton":"_jn-hg","disabled":"_mhzDX","dropdownOption":"_YG-2t"};
|
|
5
|
+
var stylesheet="._MyQMX{display:flex}._9-3-D{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._9-3-D._Y5ey6{background-color:#fff}._9-3-D._W6uBO,._9-3-D._Y5ey6._9EbiJ.focus-visible:not(._xu2tf),._9-3-D._Y5ey6._9EbiJ:focus-visible:not(._xu2tf),._9-3-D._Y5ey6._WZahD:not(._9-3-D._Y5ey6._iexVS){background-color:#0b6ed0}._9-3-D._W6uBO._iexVS._WZahD,._9-3-D._W6uBO._xu2tf._9EbiJ,._9-3-D._W6uBO._xu2tf._iexVS{opacity:.4}._HRQJK{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._HRQJK:focus{z-index:1}._jn-hg{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}._jn-hg svg{margin-left:1px}._jn-hg._Y5ey6{background-color:#0b6ed0;border-color:transparent}._jn-hg._Y5ey6 svg{fill:#fff!important}._jn-hg._Y5ey6:not(._mhzDX):hover{background-color:#085caf!important}._jn-hg._Y5ey6:not(._mhzDX):active{background-color:#0854a1!important}._jn-hg._Y5ey6._mhzDX{opacity:.4}._jn-hg._Y5ey6._mhzDX svg{background-color:transparent}._jn-hg._W6uBO{border-color:#0b6ed0;background-color:#fff}._jn-hg._W6uBO svg{fill:#0b6ed0!important}._jn-hg._W6uBO:not(._mhzDX):hover{background-color:#eef5fc!important}._jn-hg._W6uBO:not(._mhzDX):active{background-color:#e1edf9!important}._jn-hg._W6uBO._mhzDX{opacity:.4}._jn-hg._W6uBO._mhzDX svg{background-color:transparent}._YG-2t{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 = "._M911N{display:inline-block;position:relative}._M911N ._n6-Um{width:120px}._M911N ._n6-Um ._CaEZh._Hwm-A{transform:rotate(-180deg)}._M911N ._n6-Um ._CaEZh._aop6-{fill:#9d9fa1;opacity:.4}._M911N ._bw1Xx>input:focus{box-shadow:none!important;border:1px solid #898989!important}._M911N ._CaEZh{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._M911N ._CaEZh._Hwm-A{transform:rotate(-180deg)}._zpdVv{width:120px}._zpdVv ._p5dVy._oQwaO{background-color:#efefef;border-radius:6px}";
|
|
4
|
+
var styles = {"timePickerContainer":"_M911N","input":"_n6-Um","icon":"_CaEZh","open":"_Hwm-A","disabled":"_aop6-","ignoreFocusStyle":"_bw1Xx","timePickerFlyout":"_zpdVv","option":"_p5dVy","exactMatch":"_oQwaO"};
|
|
5
|
+
var stylesheet="._M911N{display:inline-block;position:relative}._M911N ._n6-Um{width:120px}._M911N ._n6-Um ._CaEZh._Hwm-A{transform:rotate(-180deg)}._M911N ._n6-Um ._CaEZh._aop6-{fill:#9d9fa1;opacity:.4}._M911N ._bw1Xx>input:focus{box-shadow:none!important;border:1px solid #898989!important}._M911N ._CaEZh{position:absolute;right:4px;bottom:4px;height:28px;width:28px}._M911N ._CaEZh._Hwm-A{transform:rotate(-180deg)}._zpdVv{width:120px}._zpdVv ._p5dVy._oQwaO{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 = "._I3Wby{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._f5cIL{background-color:rgba(50,54,58,.08)}._QcHKu{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._1Y5xs{color:rgba(81,85,89,.4);cursor:not-allowed}._5YR9F{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._bZvc2{color:#085caf;border-color:#085caf}._808KD,._bZvc2{background:rgba(11,110,208,.11)}._808KD{color:#0854a1;border-color:#0854a1}._zh73S{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._wGU4f{position:relative;display:inline-grid}._wGU4f svg{fill:currentColor}._wGU4f ._9rTIm{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._wGU4f ._9rTIm+._B6PXc{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}._wGU4f ._9rTIm+._B6PXc._6nXow{padding:5px;max-width:36px;min-width:36px}._wGU4f ._9rTIm+._B6PXc._znJ-v{padding:0 16px}._wGU4f ._9rTIm+._B6PXc._AZPJR{padding:0 16px 0 12px}._wGU4f ._9rTIm:hover+._B6PXc{background-color:rgba(50,54,58,.08)}._wGU4f ._9rTIm:disabled+._B6PXc{color:rgba(81,85,89,.4);cursor:not-allowed}._wGU4f ._9rTIm:active+._B6PXc,._wGU4f ._9rTIm:focus:active+._B6PXc{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._wGU4f ._9rTIm:checked+._B6PXc{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._wGU4f ._9rTIm:checked:hover+._B6PXc{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._wGU4f ._9rTIm:checked:disabled+._B6PXc{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._wGU4f ._9rTIm:checked:active+._B6PXc,._wGU4f ._9rTIm:checked:focus:active+._B6PXc{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._N4WjV{display:inline-flex;position:relative}._N4WjV:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._N4WjV>*{flex-shrink:0;flex-grow:0}._e0yg8{border:none;margin:0;padding:0}._e0yg8 legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._wGU4f ._9rTIm.focus-visible+._B6PXc,._wGU4f ._9rTIm:focus-visible+._B6PXc{z-index:20;outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"default":"_I3Wby","hovered":"_f5cIL","pressed":"_QcHKu","disabled":"_1Y5xs","selectedDefault":"_5YR9F","selectedHovered":"_bZvc2","selectedPressed":"_808KD","selectedDisabled":"_zh73S","toggleContainer":"_wGU4f","toggleInput":"_9rTIm","toggleButton":"_B6PXc","iconOnly":"_6nXow","text":"_znJ-v","iconText":"_AZPJR","toggleButtonGroup":"_N4WjV","toggleButtonGroupFieldset":"_e0yg8"};
|
|
5
|
+
var stylesheet="._I3Wby{border-color:transparent;background-color:transparent;color:#515559;cursor:pointer}._f5cIL{background-color:rgba(50,54,58,.08)}._QcHKu{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._1Y5xs{color:rgba(81,85,89,.4);cursor:not-allowed}._5YR9F{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._bZvc2{color:#085caf;border-color:#085caf}._808KD,._bZvc2{background:rgba(11,110,208,.11)}._808KD{color:#0854a1;border-color:#0854a1}._zh73S{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._wGU4f{position:relative;display:inline-grid}._wGU4f svg{fill:currentColor}._wGU4f ._9rTIm{-webkit-appearance:none;-moz-appearance:none;appearance:none;grid-column:1;grid-row:1}._wGU4f ._9rTIm+._B6PXc{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}._wGU4f ._9rTIm+._B6PXc._6nXow{padding:5px;max-width:36px;min-width:36px}._wGU4f ._9rTIm+._B6PXc._znJ-v{padding:0 16px}._wGU4f ._9rTIm+._B6PXc._AZPJR{padding:0 16px 0 12px}._wGU4f ._9rTIm:hover+._B6PXc{background-color:rgba(50,54,58,.08)}._wGU4f ._9rTIm:disabled+._B6PXc{color:rgba(81,85,89,.4);cursor:not-allowed}._wGU4f ._9rTIm:active+._B6PXc,._wGU4f ._9rTIm:focus:active+._B6PXc{color:#0b6ed0;background-color:rgba(11,110,208,.08)}._wGU4f ._9rTIm:checked+._B6PXc{background:rgba(11,110,208,.08);color:#0b6ed0;border-color:#0b6ed0}._wGU4f ._9rTIm:checked:hover+._B6PXc{background:rgba(11,110,208,.11);color:#085caf;border-color:#085caf}._wGU4f ._9rTIm:checked:disabled+._B6PXc{background:rgba(11,110,208,.032);color:rgba(11,110,208,.4);border-color:rgba(11,110,208,.4)}._wGU4f ._9rTIm:checked:active+._B6PXc,._wGU4f ._9rTIm:checked:focus:active+._B6PXc{background:rgba(11,110,208,.11);color:#0854a1;border-color:#0854a1}._N4WjV{display:inline-flex;position:relative}._N4WjV:before{content:\"\";border:1px solid #d9d9d9;border-radius:4px;position:absolute;top:0;bottom:0;right:0;left:0}._N4WjV>*{flex-shrink:0;flex-grow:0}._e0yg8{border:none;margin:0;padding:0}._e0yg8 legend{padding:0;display:block;font-size:14px;margin-bottom:6px;color:#515559}._wGU4f ._9rTIm.focus-visible+._B6PXc,._wGU4f ._9rTIm:focus-visible+._B6PXc{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 {
|
|
@@ -244,6 +259,14 @@ export declare interface ComboboxProps {
|
|
|
244
259
|
children: ReactNode;
|
|
245
260
|
}
|
|
246
261
|
|
|
262
|
+
declare interface CustomRegisterProps<V extends Values> {
|
|
263
|
+
name: keyof V;
|
|
264
|
+
value: V[keyof V];
|
|
265
|
+
onBlur: OnBlur;
|
|
266
|
+
onChange: OnChange<V>;
|
|
267
|
+
ref: RefCallback<HTMLElement>;
|
|
268
|
+
}
|
|
269
|
+
|
|
247
270
|
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
271
|
|
|
249
272
|
export declare interface DrawerProps {
|
|
@@ -302,6 +325,8 @@ export declare interface FilterAnchorProps extends Omit<AllHTMLAttributes<HTMLBu
|
|
|
302
325
|
className?: string;
|
|
303
326
|
}
|
|
304
327
|
|
|
328
|
+
declare type HandleSubmit = (onSubmit: OnSubmit) => (event: FormEvent<HTMLFormElement>) => Promise<void>;
|
|
329
|
+
|
|
305
330
|
export declare const HStack: React_2.ForwardRefExoticComponent<HStackProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
306
331
|
|
|
307
332
|
declare type HStackAlignChildrenX = 'left' | 'center' | 'right' | 'spaceAround' | 'spaceBetween' | 'spaceEvenly';
|
|
@@ -316,13 +341,18 @@ export declare interface HStackProps extends ExternalStackProps {
|
|
|
316
341
|
export declare const Input: React_2.ForwardRefExoticComponent<InputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
317
342
|
|
|
318
343
|
export declare interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
344
|
+
name?: string;
|
|
319
345
|
type?: 'email' | 'number' | 'password' | 'tel' | 'text' | 'url';
|
|
320
346
|
initialValue?: string;
|
|
321
347
|
value?: string;
|
|
322
348
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
349
|
+
label?: string;
|
|
323
350
|
leftAddOn?: ReactNode;
|
|
324
351
|
rightAddOn?: ReactNode;
|
|
352
|
+
errorText?: ReactNode;
|
|
353
|
+
helperText?: ReactNode;
|
|
325
354
|
className?: string;
|
|
355
|
+
'data-testid'?: string;
|
|
326
356
|
style?: CSSProperties;
|
|
327
357
|
}
|
|
328
358
|
|
|
@@ -387,6 +417,45 @@ export declare interface MenuProps {
|
|
|
387
417
|
isVirtualizationDisabled?: boolean;
|
|
388
418
|
}
|
|
389
419
|
|
|
420
|
+
declare type OnBlur = () => void;
|
|
421
|
+
|
|
422
|
+
declare type OnChange<V extends Values> = (fieldValue: V[keyof V]) => void;
|
|
423
|
+
|
|
424
|
+
declare type OnSubmit = (values?: Values, event?: FormEvent<HTMLFormElement>) => Promise<void> | void;
|
|
425
|
+
|
|
426
|
+
export declare const Pagination: ({ hidePageNumber, hideFirstAndLastButtons, numPages, currentPage, onPageChange, isDisabled, "data-testid": dataTestId, }: PaginationProps) => JSX.Element;
|
|
427
|
+
|
|
428
|
+
export declare interface PaginationProps {
|
|
429
|
+
/** The current page in pagination. This should be passed in from a controlled state in the parent. */
|
|
430
|
+
currentPage: number;
|
|
431
|
+
/** The function to call when the page number is to change. This should be passed in from a controlled state in the parent. */
|
|
432
|
+
onPageChange: (pageNumber: number) => void;
|
|
433
|
+
/** The total number of pages to paginate through. When left blank the "of ####" label is removed. Also first and last buttons are removed. */
|
|
434
|
+
numPages?: number;
|
|
435
|
+
/** Controls whether or not to show the page number input and "of ####" label.
|
|
436
|
+
* @defaultValue false
|
|
437
|
+
*/
|
|
438
|
+
hidePageNumber?: boolean;
|
|
439
|
+
/** Controls whether or not to show the first and last page buttons.
|
|
440
|
+
* @defaultValue false
|
|
441
|
+
*/
|
|
442
|
+
hideFirstAndLastButtons?: boolean;
|
|
443
|
+
/** Controls if all controls in the pagination component are disabled.
|
|
444
|
+
* @defaultValue false
|
|
445
|
+
*/
|
|
446
|
+
isDisabled?: boolean;
|
|
447
|
+
/** Test ID for use in testing environments. Added to the containing `div`
|
|
448
|
+
* element and to each child component with a suffix:
|
|
449
|
+
*
|
|
450
|
+
* - First Page Button: `-first-page`
|
|
451
|
+
* - Previous Page Button: `-previous-page`
|
|
452
|
+
* - Current Page Input: `-current-page-input`
|
|
453
|
+
* - Next Page Button: `-next-page`
|
|
454
|
+
* - Last Page Button: `-last-page`
|
|
455
|
+
*/
|
|
456
|
+
'data-testid'?: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
390
459
|
export declare const PhoneNumberInput: React_2.ForwardRefExoticComponent<PhoneNumberInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
391
460
|
|
|
392
461
|
export declare interface PhoneNumberInputProps {
|
|
@@ -404,8 +473,53 @@ export declare interface PhoneNumberInputProps {
|
|
|
404
473
|
inputId?: string;
|
|
405
474
|
}
|
|
406
475
|
|
|
476
|
+
declare interface RadioRegisterProps<V extends Values> {
|
|
477
|
+
name: keyof V;
|
|
478
|
+
type: 'radio';
|
|
479
|
+
value: string;
|
|
480
|
+
checked: boolean;
|
|
481
|
+
onBlur: FocusEventHandler<HTMLInputElement>;
|
|
482
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
483
|
+
ref: RefCallback<HTMLInputElement>;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
declare type Register<V extends Values> = {
|
|
487
|
+
(name: keyof V, options: {
|
|
488
|
+
type: 'text' | 'email' | 'password';
|
|
489
|
+
}): TextRegisterProps<V>;
|
|
490
|
+
(name: keyof V, options: {
|
|
491
|
+
type: 'checkbox';
|
|
492
|
+
}): CheckboxRegisterProps<V>;
|
|
493
|
+
(name: keyof V, options: {
|
|
494
|
+
type: 'radio';
|
|
495
|
+
radioValue: string;
|
|
496
|
+
}): RadioRegisterProps<V>;
|
|
497
|
+
(name: keyof V, options: {
|
|
498
|
+
type: 'custom';
|
|
499
|
+
}): CustomRegisterProps<V>;
|
|
500
|
+
};
|
|
501
|
+
|
|
407
502
|
declare type RenderCellContent = AdvancedTableColumnConfig['renderCellContent'];
|
|
408
503
|
|
|
504
|
+
export declare const RowDisplayCount: ({ "data-testid": dataTestId, displayCount, displayCountOptions, onDisplayCountChange, isDisabled, }: RowDisplayCountProps) => JSX.Element;
|
|
505
|
+
|
|
506
|
+
export declare interface RowDisplayCountProps {
|
|
507
|
+
/** The number of rows to show in pagination. */
|
|
508
|
+
displayCount: number;
|
|
509
|
+
/** The options for counts to show in the dropdown. */
|
|
510
|
+
displayCountOptions: Array<number>;
|
|
511
|
+
/** The function called when a the display count is changed. */
|
|
512
|
+
onDisplayCountChange: (newDisplayCount: number) => void;
|
|
513
|
+
/** Controls whether the dropdown is disabled.
|
|
514
|
+
* @defaultValue false
|
|
515
|
+
*/
|
|
516
|
+
isDisabled?: boolean;
|
|
517
|
+
/** Test ID for use in testing environments. Added to the containing `div`
|
|
518
|
+
* element and to the `Select` child with the suffix `-select`.
|
|
519
|
+
*/
|
|
520
|
+
'data-testid'?: string;
|
|
521
|
+
}
|
|
522
|
+
|
|
409
523
|
export declare const Select: ({ multiselect, children, isDisabled, onChange, isOpen, onIsOpenChange, value, isInvalid, "data-testid": dataTestId, isVirtualizationDisabled, }: SelectProps) => JSX.Element;
|
|
410
524
|
|
|
411
525
|
export declare const SelectButton: React_2.ForwardRefExoticComponent<SelectButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
@@ -511,6 +625,15 @@ export declare interface SubSelectProps extends Omit<SelectPaneProps, 'label' |
|
|
|
511
625
|
onIsOpenChange?: (isOpen: boolean) => void;
|
|
512
626
|
}
|
|
513
627
|
|
|
628
|
+
declare interface TextRegisterProps<V extends Values> {
|
|
629
|
+
name: keyof V;
|
|
630
|
+
type: 'text' | 'email' | 'password';
|
|
631
|
+
value: string;
|
|
632
|
+
onBlur: FocusEventHandler<HTMLInputElement>;
|
|
633
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
634
|
+
ref: RefCallback<HTMLInputElement>;
|
|
635
|
+
}
|
|
636
|
+
|
|
514
637
|
declare interface Time {
|
|
515
638
|
hour: number;
|
|
516
639
|
minute: number;
|
|
@@ -538,7 +661,7 @@ export declare const ToggleButtonGroup: React_2.ForwardRefExoticComponent<Toggle
|
|
|
538
661
|
export declare interface ToggleButtonGroupProps {
|
|
539
662
|
children: React_2.ReactNode;
|
|
540
663
|
value: string | null;
|
|
541
|
-
onChange: () => void;
|
|
664
|
+
onChange: (value: string) => void;
|
|
542
665
|
name?: string;
|
|
543
666
|
label?: string;
|
|
544
667
|
isDisabled?: boolean;
|
|
@@ -549,7 +672,7 @@ export declare interface ToggleButtonGroupProps {
|
|
|
549
672
|
export declare interface ToggleButtonProps {
|
|
550
673
|
children: React_2.ReactNode;
|
|
551
674
|
isActivated?: boolean;
|
|
552
|
-
onChange?: (
|
|
675
|
+
onChange?: (isActivated: boolean) => void;
|
|
553
676
|
value?: string;
|
|
554
677
|
isDisabled?: boolean;
|
|
555
678
|
kind?: 'icon' | 'icon-text' | 'text';
|
|
@@ -559,6 +682,49 @@ export declare interface ToggleButtonProps {
|
|
|
559
682
|
dataTestId?: string;
|
|
560
683
|
}
|
|
561
684
|
|
|
685
|
+
export declare function useForm<V extends Values>({ initialValues, validateField, }: UseFormOptions<V>): {
|
|
686
|
+
Form: (props: Omit<DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref">) => JSX.Element;
|
|
687
|
+
register: {
|
|
688
|
+
(name: keyof V, options: {
|
|
689
|
+
type: 'text' | 'email' | 'password';
|
|
690
|
+
}): TextRegisterProps<V>;
|
|
691
|
+
(name: keyof V, options: {
|
|
692
|
+
type: 'checkbox';
|
|
693
|
+
}): CheckboxRegisterProps<V>;
|
|
694
|
+
(name: keyof V, options: {
|
|
695
|
+
type: 'radio';
|
|
696
|
+
radioValue: string;
|
|
697
|
+
}): RadioRegisterProps<V>;
|
|
698
|
+
(name: keyof V, options: {
|
|
699
|
+
type: 'custom';
|
|
700
|
+
}): CustomRegisterProps<V>;
|
|
701
|
+
};
|
|
702
|
+
formValues: V;
|
|
703
|
+
fieldErrors: Partial<Record<keyof V, string>>;
|
|
704
|
+
formError: string;
|
|
705
|
+
formTouched: Partial<Record<keyof V, boolean>>;
|
|
706
|
+
isSubmitting: boolean;
|
|
707
|
+
handleSubmit: HandleSubmit;
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
export declare function useFormField(): {
|
|
711
|
+
register: Register<Partial<Record<string, string | boolean | string[]>>> | undefined;
|
|
712
|
+
formValues: Partial<Record<string, string | boolean | string[]>> | undefined;
|
|
713
|
+
formTouched: Partial<Record<string, boolean>> | undefined;
|
|
714
|
+
fieldErrors: Partial<Record<string, string>> | undefined;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
declare interface UseFormOptions<V extends Values> {
|
|
718
|
+
initialValues: V;
|
|
719
|
+
validateField?: ValidateField<V>;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
declare type ValidateField<V extends Values> = (fieldName: keyof V, fieldValue: V[keyof V], formValues?: V) => string;
|
|
723
|
+
|
|
724
|
+
declare type Value = string | string[] | boolean;
|
|
725
|
+
|
|
726
|
+
declare type Values = Partial<Record<string, Value>>;
|
|
727
|
+
|
|
562
728
|
export declare const VStack: React_2.ForwardRefExoticComponent<VStackProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
563
729
|
|
|
564
730
|
declare type VStackAlignChildrenX = 'left' | 'center' | 'right' | 'stretch';
|