@primer/components 0.0.0-202192817126 → 0.0.0-202192822657
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 +1 -19
- package/dist/browser.esm.js +49 -53
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +46 -50
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Item.d.ts +0 -6
- package/lib/ActionList/Item.js +1 -5
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +4 -2
- package/lib/Autocomplete/Autocomplete.d.ts +8 -6
- package/lib/Autocomplete/AutocompleteInput.d.ts +8 -6
- package/lib/Button/Button.d.ts +5 -5
- package/lib/Button/ButtonBase.d.ts +1 -1
- package/lib/Button/ButtonClose.d.ts +3 -3
- package/lib/Button/ButtonDanger.d.ts +5 -5
- package/lib/Button/ButtonInvisible.d.ts +5 -5
- package/lib/Button/ButtonOutline.d.ts +5 -5
- package/lib/Button/ButtonPrimary.d.ts +5 -5
- package/lib/CircleBadge.d.ts +2 -2
- package/lib/CircleOcticon.d.ts +4 -4
- package/lib/DatePicker/DatePicker.d.ts +48 -0
- package/lib/DatePicker/DatePicker.js +106 -0
- package/lib/DatePicker/DatePickerAnchor.d.ts +5 -0
- package/lib/DatePicker/DatePickerAnchor.js +194 -0
- package/lib/DatePicker/DatePickerOverlay.d.ts +3 -0
- package/lib/DatePicker/DatePickerOverlay.js +48 -0
- package/lib/DatePicker/DatePickerPanel.d.ts +2 -0
- package/lib/DatePicker/DatePickerPanel.js +126 -0
- package/lib/DatePicker/Day.d.ts +14 -0
- package/lib/DatePicker/Day.js +190 -0
- package/lib/DatePicker/Month.d.ts +9 -0
- package/lib/DatePicker/Month.js +120 -0
- package/lib/DatePicker/dateParser.d.ts +11 -0
- package/lib/DatePicker/dateParser.js +188 -0
- package/lib/DatePicker/index.d.ts +2 -0
- package/lib/DatePicker/index.js +13 -0
- package/lib/DatePicker/useDatePicker.d.ts +89 -0
- package/lib/DatePicker/useDatePicker.js +370 -0
- package/lib/Dialog.d.ts +4 -4
- package/lib/Dropdown.d.ts +16 -16
- package/lib/DropdownMenu/DropdownButton.d.ts +6 -6
- package/lib/FilterList.d.ts +3 -3
- package/lib/Flash.d.ts +1 -1
- package/lib/Label.d.ts +1 -1
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.d.ts +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +28 -26
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/TextInputWithTokens.d.ts +8 -10
- package/lib/TextInputWithTokens.js +29 -102
- package/lib/Timeline.d.ts +4 -4
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/Token.js +2 -13
- package/lib/Token/TokenBase.js +4 -0
- package/lib/Token/_RemoveTokenButton.js +2 -15
- package/lib/_TextInputWrapper.d.ts +1 -1
- package/lib/_TextInputWrapper.js +1 -1
- package/lib/hooks/useDebounce.d.ts +2 -0
- package/lib/hooks/useDebounce.js +24 -0
- package/lib/sx.d.ts +2 -8
- package/lib/theme-preval.js +2 -2
- package/lib/theme.d.ts +0 -78
- package/lib/theme.js +1 -3
- package/lib/utils/testing.d.ts +1 -1
- package/lib-esm/ActionList/Item.d.ts +0 -6
- package/lib-esm/ActionList/Item.js +1 -5
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +4 -2
- package/lib-esm/Autocomplete/Autocomplete.d.ts +8 -6
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +8 -6
- package/lib-esm/Button/Button.d.ts +5 -5
- package/lib-esm/Button/ButtonBase.d.ts +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +3 -3
- package/lib-esm/Button/ButtonDanger.d.ts +5 -5
- package/lib-esm/Button/ButtonInvisible.d.ts +5 -5
- package/lib-esm/Button/ButtonOutline.d.ts +5 -5
- package/lib-esm/Button/ButtonPrimary.d.ts +5 -5
- package/lib-esm/CircleBadge.d.ts +2 -2
- package/lib-esm/CircleOcticon.d.ts +4 -4
- package/lib-esm/DatePicker/DatePicker.d.ts +48 -0
- package/lib-esm/DatePicker/DatePicker.js +89 -0
- package/lib-esm/DatePicker/DatePickerAnchor.d.ts +5 -0
- package/lib-esm/DatePicker/DatePickerAnchor.js +167 -0
- package/lib-esm/DatePicker/DatePickerOverlay.d.ts +3 -0
- package/lib-esm/DatePicker/DatePickerOverlay.js +29 -0
- package/lib-esm/DatePicker/DatePickerPanel.d.ts +2 -0
- package/lib-esm/DatePicker/DatePickerPanel.js +100 -0
- package/lib-esm/DatePicker/Day.d.ts +14 -0
- package/lib-esm/DatePicker/Day.js +167 -0
- package/lib-esm/DatePicker/Month.d.ts +9 -0
- package/lib-esm/DatePicker/Month.js +96 -0
- package/lib-esm/DatePicker/dateParser.d.ts +11 -0
- package/lib-esm/DatePicker/dateParser.js +174 -0
- package/lib-esm/DatePicker/index.d.ts +2 -0
- package/lib-esm/DatePicker/index.js +1 -0
- package/lib-esm/DatePicker/useDatePicker.d.ts +89 -0
- package/lib-esm/DatePicker/useDatePicker.js +339 -0
- package/lib-esm/Dialog.d.ts +4 -4
- package/lib-esm/Dropdown.d.ts +16 -16
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +6 -6
- package/lib-esm/FilterList.d.ts +3 -3
- package/lib-esm/Flash.d.ts +1 -1
- package/lib-esm/Label.d.ts +1 -1
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +28 -26
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/TextInputWithTokens.d.ts +8 -10
- package/lib-esm/TextInputWithTokens.js +30 -101
- package/lib-esm/Timeline.d.ts +4 -4
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Token/Token.js +2 -13
- package/lib-esm/Token/TokenBase.js +4 -0
- package/lib-esm/Token/_RemoveTokenButton.js +2 -11
- package/lib-esm/_TextInputWrapper.d.ts +1 -1
- package/lib-esm/_TextInputWrapper.js +1 -1
- package/lib-esm/hooks/useDebounce.d.ts +2 -0
- package/lib-esm/hooks/useDebounce.js +16 -0
- package/lib-esm/sx.d.ts +2 -8
- package/lib-esm/theme-preval.js +2 -2
- package/lib-esm/theme.d.ts +0 -78
- package/lib-esm/theme.js +1 -2
- package/lib-esm/utils/testing.d.ts +1 -1
- package/package.json +14 -14
- package/lib/utils/types/KeyPaths.d.ts +0 -3
- package/lib/utils/types/KeyPaths.js +0 -1
- package/lib-esm/utils/types/KeyPaths.d.ts +0 -3
- package/lib-esm/utils/types/KeyPaths.js +0 -1
@@ -0,0 +1,370 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.isSingleSelection = isSingleSelection;
|
7
|
+
exports.isMultiSelection = isMultiSelection;
|
8
|
+
exports.isRangeSelection = isRangeSelection;
|
9
|
+
exports.isStringRangeSelection = isStringRangeSelection;
|
10
|
+
exports.DatePickerProvider = exports.default = void 0;
|
11
|
+
|
12
|
+
var _octiconsReact = require("@primer/octicons-react");
|
13
|
+
|
14
|
+
var _dateFns = require("date-fns");
|
15
|
+
|
16
|
+
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
17
|
+
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
19
|
+
|
20
|
+
var _ = require("..");
|
21
|
+
|
22
|
+
var _dateParser = require("./dateParser");
|
23
|
+
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
25
|
+
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
|
+
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
|
+
|
30
|
+
const DatePickerContext = /*#__PURE__*/(0, _react.createContext)(null);
|
31
|
+
|
32
|
+
const useDatePicker = date => {
|
33
|
+
const value = (0, _react.useContext)(DatePickerContext);
|
34
|
+
const [selected, setSelected] = (0, _react.useState)(false);
|
35
|
+
const today = date ? (0, _dateFns.isToday)(date) : false;
|
36
|
+
|
37
|
+
if (!value) {
|
38
|
+
throw new Error('useDatePicker must be used inside a DatePickerProvider');
|
39
|
+
}
|
40
|
+
|
41
|
+
(0, _react.useEffect)(() => {
|
42
|
+
if (date) {
|
43
|
+
if (value.hoverRange) {
|
44
|
+
if (isRangeSelection(value.hoverRange)) {
|
45
|
+
if ((0, _dateFns.isEqual)(date, value.hoverRange.from)) {
|
46
|
+
setSelected('start');
|
47
|
+
} else if (value.hoverRange.to && (0, _dateFns.isEqual)(date, value.hoverRange.to)) {
|
48
|
+
setSelected('end');
|
49
|
+
} else if ((0, _dateFns.isAfter)(date, value.hoverRange.from) && value.hoverRange.to && (0, _dateFns.isBefore)(date, value.hoverRange.to)) {
|
50
|
+
setSelected('middle');
|
51
|
+
} else {
|
52
|
+
setSelected(false);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
} else if (value.selection) {
|
56
|
+
if (isMultiSelection(value.selection)) {
|
57
|
+
setSelected(!!value.selection.find(d => (0, _dateFns.isEqual)(d, date)));
|
58
|
+
} else if (isRangeSelection(value.selection)) {
|
59
|
+
if ((0, _dateFns.isEqual)(date, value.selection.from)) {
|
60
|
+
setSelected('start');
|
61
|
+
} else if (value.selection.to && (0, _dateFns.isEqual)(date, value.selection.to)) {
|
62
|
+
setSelected('end');
|
63
|
+
} else if ((0, _dateFns.isAfter)(date, value.selection.from) && value.selection.to && (0, _dateFns.isBefore)(date, value.selection.to)) {
|
64
|
+
setSelected('middle');
|
65
|
+
} else {
|
66
|
+
setSelected(false);
|
67
|
+
}
|
68
|
+
} else {
|
69
|
+
setSelected((0, _dateFns.isEqual)(date, value.selection));
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}, [date, value.hoverRange, value.selection, today]);
|
74
|
+
let blocked,
|
75
|
+
disabled = false;
|
76
|
+
|
77
|
+
if (date) {
|
78
|
+
// Determine if date is blocked out
|
79
|
+
if (value.configuration.blockedDates) {
|
80
|
+
blocked = !!value.configuration.blockedDates.find(d => (0, _dateFns.isEqual)(d, date));
|
81
|
+
} // Determine if date is disabled
|
82
|
+
|
83
|
+
|
84
|
+
if (value.configuration.minDate || value.configuration.maxDate || value.configuration.disableWeekends) {
|
85
|
+
disabled = (value.configuration.minDate ? (0, _dateFns.isBefore)(date, value.configuration.minDate) : false) || (value.configuration.maxDate ? (0, _dateFns.isAfter)(date, value.configuration.maxDate) : false) || (value.configuration.disableWeekends ? (0, _dateFns.isWeekend)(date) : false);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
return { ...value,
|
90
|
+
blocked,
|
91
|
+
disabled,
|
92
|
+
selected,
|
93
|
+
today
|
94
|
+
};
|
95
|
+
};
|
96
|
+
|
97
|
+
var _default = useDatePicker;
|
98
|
+
exports.default = _default;
|
99
|
+
|
100
|
+
function isSingleSelection(selection) {
|
101
|
+
return selection instanceof Date;
|
102
|
+
}
|
103
|
+
|
104
|
+
function isMultiSelection(selection) {
|
105
|
+
return Array.isArray(selection);
|
106
|
+
}
|
107
|
+
|
108
|
+
function isRangeSelection(selection) {
|
109
|
+
return !!selection.from;
|
110
|
+
}
|
111
|
+
|
112
|
+
function isStringRangeSelection(selection) {
|
113
|
+
return !!selection.from;
|
114
|
+
}
|
115
|
+
|
116
|
+
function parseSelection(selection, variant) {
|
117
|
+
if (!selection) return;
|
118
|
+
|
119
|
+
if (variant === 'multi') {
|
120
|
+
if (isMultiSelection(selection)) {
|
121
|
+
const parsedSelection = [];
|
122
|
+
|
123
|
+
for (const d of selection) {
|
124
|
+
parsedSelection.push(new Date(new Date(d).toDateString()));
|
125
|
+
}
|
126
|
+
|
127
|
+
return parsedSelection.sort((a, b) => a.getTime() - b.getTime());
|
128
|
+
} else if (selection instanceof Date) {
|
129
|
+
return [new Date(new Date(selection).toDateString())];
|
130
|
+
} else if (isRangeSelection(selection)) {
|
131
|
+
const parsedSelection = [];
|
132
|
+
parsedSelection.push(new Date(new Date(selection.from).toDateString()));
|
133
|
+
|
134
|
+
if (selection.to) {
|
135
|
+
parsedSelection.push(new Date(new Date(selection.to).toDateString()));
|
136
|
+
}
|
137
|
+
|
138
|
+
return parsedSelection.sort((a, b) => a.getTime() - b.getTime());
|
139
|
+
}
|
140
|
+
} else if (variant === 'range') {
|
141
|
+
if (isRangeSelection(selection)) {
|
142
|
+
return {
|
143
|
+
from: new Date(new Date(selection.from).toDateString()),
|
144
|
+
to: selection.to ? new Date(new Date(selection.to).toDateString()) : null
|
145
|
+
};
|
146
|
+
} else if (isMultiSelection(selection)) {
|
147
|
+
return {
|
148
|
+
from: new Date(new Date(selection[0]).toDateString()),
|
149
|
+
to: selection[1] ? new Date(new Date(selection[1]).toDateString()) : null
|
150
|
+
};
|
151
|
+
} else if (selection instanceof Date) {
|
152
|
+
return {
|
153
|
+
from: new Date(new Date(selection).toDateString()),
|
154
|
+
to: null
|
155
|
+
};
|
156
|
+
}
|
157
|
+
} else {
|
158
|
+
if (selection instanceof Date) {
|
159
|
+
return new Date(new Date(selection).toDateString());
|
160
|
+
} else if (isMultiSelection(selection)) {
|
161
|
+
return new Date(new Date(selection[0]).toDateString());
|
162
|
+
} else if (isRangeSelection(selection)) {
|
163
|
+
return new Date(new Date(selection.from).toDateString());
|
164
|
+
} else {
|
165
|
+
return;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
const defaultConfiguration = {
|
171
|
+
anchorVariant: 'button',
|
172
|
+
confirmation: false,
|
173
|
+
confirmUnsavedClose: false,
|
174
|
+
disableWeekends: false,
|
175
|
+
iconPlacement: 'start',
|
176
|
+
placeholder: 'Select a Date...',
|
177
|
+
showInputPrompt: false,
|
178
|
+
variant: 'single',
|
179
|
+
view: '2-month',
|
180
|
+
weekStartsOn: 'Sunday'
|
181
|
+
};
|
182
|
+
|
183
|
+
const DatePickerProvider = ({
|
184
|
+
configuration: externalConfig = {},
|
185
|
+
children,
|
186
|
+
closePicker,
|
187
|
+
value
|
188
|
+
}) => {
|
189
|
+
const [configuration, setConfiguration] = (0, _react.useState)((0, _deepmerge.default)(defaultConfiguration, externalConfig));
|
190
|
+
const [previousSelection, setPreviousSelection] = (0, _react.useState)(parseSelection(value, configuration.variant));
|
191
|
+
const [isDirty, setIsDirty] = (0, _react.useState)(false);
|
192
|
+
const [selection, setSelection] = (0, _react.useState)(parseSelection(value, configuration.variant));
|
193
|
+
const [hoverRange, setHoverRange] = (0, _react.useState)(null);
|
194
|
+
const [currentViewingDate, setCurrentViewingDate] = (0, _react.useState)(new Date());
|
195
|
+
const confirm = (0, _.useConfirm)();
|
196
|
+
(0, _react.useEffect)(() => {
|
197
|
+
setConfiguration((0, _deepmerge.default)(defaultConfiguration, externalConfig));
|
198
|
+
setSelection(parseSelection(selection, configuration.variant)); // Don't want this to run every time selection gets updated
|
199
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
200
|
+
}, [configuration.variant, externalConfig]);
|
201
|
+
const goToMonth = (0, _react.useCallback)(date => {
|
202
|
+
setCurrentViewingDate(new Date(new Date(date).toDateString()));
|
203
|
+
}, []);
|
204
|
+
const nextMonth = (0, _react.useCallback)(() => {
|
205
|
+
setCurrentViewingDate((0, _dateFns.addMonths)(currentViewingDate, 1));
|
206
|
+
}, [currentViewingDate]);
|
207
|
+
const previousMonth = (0, _react.useCallback)(() => {
|
208
|
+
setCurrentViewingDate((0, _dateFns.subMonths)(currentViewingDate, 1));
|
209
|
+
}, [currentViewingDate]);
|
210
|
+
const getFormattedDate = (0, _react.useMemo)(() => {
|
211
|
+
const {
|
212
|
+
anchorVariant,
|
213
|
+
dateFormat,
|
214
|
+
placeholder,
|
215
|
+
variant
|
216
|
+
} = configuration;
|
217
|
+
return (0, _dateParser.formatDate)({
|
218
|
+
selection,
|
219
|
+
anchorVariant,
|
220
|
+
dateFormat,
|
221
|
+
placeholder,
|
222
|
+
variant
|
223
|
+
});
|
224
|
+
}, [configuration, selection]);
|
225
|
+
const saveValue = (0, _react.useCallback)(updatedSelection => {
|
226
|
+
setPreviousSelection(updatedSelection !== null && updatedSelection !== void 0 ? updatedSelection : selection);
|
227
|
+
setIsDirty(false);
|
228
|
+
closePicker === null || closePicker === void 0 ? void 0 : closePicker();
|
229
|
+
}, [closePicker, selection]);
|
230
|
+
const revertValue = (0, _react.useCallback)(() => {
|
231
|
+
setSelection(previousSelection);
|
232
|
+
setIsDirty(false);
|
233
|
+
}, [previousSelection]);
|
234
|
+
const handleClose = (0, _react.useCallback)(async () => {
|
235
|
+
if (configuration.confirmUnsavedClose) {
|
236
|
+
if (isDirty) {
|
237
|
+
const result = await confirm({
|
238
|
+
title: 'Save Changes?',
|
239
|
+
content: 'You have unsaved changes, would you like to save them?',
|
240
|
+
confirmButtonContent: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_octiconsReact.CheckIcon, null), /*#__PURE__*/_react.default.createElement(_.Text, {
|
241
|
+
sx: {
|
242
|
+
ml: 1
|
243
|
+
}
|
244
|
+
}, "Save")),
|
245
|
+
cancelButtonContent: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_octiconsReact.TrashIcon, null), /*#__PURE__*/_react.default.createElement(_.Text, {
|
246
|
+
sx: {
|
247
|
+
ml: 1
|
248
|
+
}
|
249
|
+
}, "Discard"))
|
250
|
+
});
|
251
|
+
|
252
|
+
if (result) {
|
253
|
+
saveValue();
|
254
|
+
} else {
|
255
|
+
revertValue();
|
256
|
+
}
|
257
|
+
}
|
258
|
+
} else if (isDirty) revertValue();
|
259
|
+
}, [configuration.confirmUnsavedClose, confirm, isDirty, revertValue, saveValue]);
|
260
|
+
const inputHandler = (0, _react.useCallback)(updatedSelection => {
|
261
|
+
// validate date falls within range
|
262
|
+
setSelection(updatedSelection);
|
263
|
+
}, []);
|
264
|
+
const selectionHandler = (0, _react.useCallback)(date => {
|
265
|
+
setIsDirty(true);
|
266
|
+
|
267
|
+
if (configuration.variant === 'multi') {
|
268
|
+
const selections = [...selection];
|
269
|
+
const existingIndex = selections.findIndex(s => (0, _dateFns.isEqual)(s, date));
|
270
|
+
|
271
|
+
if (existingIndex > -1) {
|
272
|
+
selections.splice(existingIndex, 1);
|
273
|
+
setSelection(selections.sort((a, b) => a.getTime() - b.getTime()));
|
274
|
+
} else {
|
275
|
+
if (configuration.maxSelections && selections.length + 1 > configuration.maxSelections) return;
|
276
|
+
setSelection([...selections, date].sort((a, b) => a.getTime() - b.getTime()));
|
277
|
+
}
|
278
|
+
} else if (configuration.variant === 'range') {
|
279
|
+
if (selection && isRangeSelection(selection) && !selection.to) {
|
280
|
+
let toDate = date;
|
281
|
+
|
282
|
+
if (configuration.maxRangeSize && Math.abs((0, _dateFns.differenceInDays)(selection.from, date)) >= configuration.maxRangeSize) {
|
283
|
+
toDate = (0, _dateFns.isBefore)(date, selection.from) ? (0, _dateFns.subDays)(selection.from, configuration.maxRangeSize - 1) : (0, _dateFns.addDays)(selection.from, configuration.maxRangeSize - 1);
|
284
|
+
}
|
285
|
+
|
286
|
+
const updatedSelection = (0, _dateFns.isBefore)(toDate, selection.from) ? {
|
287
|
+
from: toDate,
|
288
|
+
to: selection.from
|
289
|
+
} : {
|
290
|
+
from: selection.from,
|
291
|
+
to: toDate
|
292
|
+
};
|
293
|
+
setSelection(updatedSelection);
|
294
|
+
setHoverRange(null);
|
295
|
+
|
296
|
+
if (!configuration.confirmation) {
|
297
|
+
saveValue(updatedSelection);
|
298
|
+
}
|
299
|
+
} else {
|
300
|
+
setHoverRange({
|
301
|
+
from: date,
|
302
|
+
to: date
|
303
|
+
});
|
304
|
+
setSelection({
|
305
|
+
from: date,
|
306
|
+
to: null
|
307
|
+
});
|
308
|
+
}
|
309
|
+
} else {
|
310
|
+
setSelection(date);
|
311
|
+
|
312
|
+
if (!configuration.confirmation) {
|
313
|
+
saveValue(date);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
}, [configuration.confirmation, configuration.maxRangeSize, configuration.maxSelections, configuration.variant, saveValue, selection]);
|
317
|
+
const focusHnadler = (0, _react.useCallback)(date => {
|
318
|
+
if (!selection) return;
|
319
|
+
const {
|
320
|
+
minDate,
|
321
|
+
maxDate,
|
322
|
+
maxRangeSize,
|
323
|
+
variant
|
324
|
+
} = configuration;
|
325
|
+
|
326
|
+
if (variant === 'range' && isRangeSelection(selection) && hoverRange) {
|
327
|
+
let hoverDate = date;
|
328
|
+
if (minDate) hoverDate = (0, _dateFns.isBefore)(date, minDate) ? minDate : hoverDate;
|
329
|
+
if (maxDate) hoverDate = (0, _dateFns.isAfter)(date, maxDate) ? maxDate : hoverDate;
|
330
|
+
|
331
|
+
if (maxRangeSize && Math.abs((0, _dateFns.differenceInDays)(selection.from, hoverDate)) >= maxRangeSize) {
|
332
|
+
hoverDate = (0, _dateFns.isBefore)(hoverDate, selection.from) ? (0, _dateFns.subDays)(selection.from, configuration.maxRangeSize - 1) : (0, _dateFns.addDays)(selection.from, configuration.maxRangeSize - 1);
|
333
|
+
}
|
334
|
+
|
335
|
+
setHoverRange((0, _dateFns.isBefore)(hoverDate, selection.from) ? {
|
336
|
+
from: hoverDate,
|
337
|
+
to: selection.from
|
338
|
+
} : {
|
339
|
+
from: selection.from,
|
340
|
+
to: hoverDate
|
341
|
+
});
|
342
|
+
}
|
343
|
+
}, [configuration, hoverRange, selection]);
|
344
|
+
const datePickerCtx = (0, _react.useMemo)(() => {
|
345
|
+
return {
|
346
|
+
configuration,
|
347
|
+
currentViewingDate,
|
348
|
+
disabled: false,
|
349
|
+
formattedDate: getFormattedDate,
|
350
|
+
goToMonth,
|
351
|
+
hoverRange,
|
352
|
+
nextMonth,
|
353
|
+
onClose: handleClose,
|
354
|
+
onDateInput: inputHandler,
|
355
|
+
onDayFocus: focusHnadler,
|
356
|
+
onSelection: selectionHandler,
|
357
|
+
previousMonth,
|
358
|
+
revertValue,
|
359
|
+
saveValue,
|
360
|
+
selectionActive: false,
|
361
|
+
selection
|
362
|
+
};
|
363
|
+
}, [configuration, currentViewingDate, focusHnadler, getFormattedDate, goToMonth, handleClose, hoverRange, inputHandler, nextMonth, previousMonth, revertValue, saveValue, selection, selectionHandler]);
|
364
|
+
return /*#__PURE__*/_react.default.createElement(DatePickerContext.Provider, {
|
365
|
+
value: datePickerCtx
|
366
|
+
}, children);
|
367
|
+
};
|
368
|
+
|
369
|
+
exports.DatePickerProvider = DatePickerProvider;
|
370
|
+
DatePickerProvider.displayName = "DatePickerProvider";
|
package/lib/Dialog.d.ts
CHANGED
@@ -15,7 +15,6 @@ declare namespace DialogHeader {
|
|
15
15
|
};
|
16
16
|
var propTypes: {
|
17
17
|
lineHeight?: React.Validator<import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
18
|
-
border?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
19
18
|
alignContent?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.AlignContent, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
20
19
|
alignItems?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.AlignItems, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
21
20
|
alignSelf?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.AlignSelf, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
@@ -91,6 +90,7 @@ declare namespace DialogHeader {
|
|
91
90
|
zIndex?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.ZIndex, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
92
91
|
background?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
93
92
|
backgroundPosition?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.BackgroundPosition<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
93
|
+
border?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
94
94
|
borderBottom?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.BorderBottom<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
95
95
|
borderColor?: React.Validator<import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
96
96
|
borderLeft?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.BorderLeft<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
@@ -153,7 +153,7 @@ declare namespace DialogHeader {
|
|
153
153
|
results?: React.Validator<number | null | undefined> | undefined;
|
154
154
|
security?: React.Validator<string | null | undefined> | undefined;
|
155
155
|
unselectable?: React.Validator<"on" | "off" | null | undefined> | undefined;
|
156
|
-
inputMode?: React.Validator<"
|
156
|
+
inputMode?: React.Validator<"none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | null | undefined> | undefined;
|
157
157
|
is?: React.Validator<string | null | undefined> | undefined;
|
158
158
|
'aria-activedescendant'?: React.Validator<string | null | undefined> | undefined;
|
159
159
|
'aria-atomic'?: React.Validator<boolean | "true" | "false" | null | undefined> | undefined;
|
@@ -168,7 +168,7 @@ declare namespace DialogHeader {
|
|
168
168
|
'aria-describedby'?: React.Validator<string | null | undefined> | undefined;
|
169
169
|
'aria-details'?: React.Validator<string | null | undefined> | undefined;
|
170
170
|
'aria-disabled'?: React.Validator<boolean | "true" | "false" | null | undefined> | undefined;
|
171
|
-
'aria-dropeffect'?: React.Validator<"
|
171
|
+
'aria-dropeffect'?: React.Validator<"none" | "link" | "copy" | "execute" | "move" | "popup" | null | undefined> | undefined;
|
172
172
|
'aria-errormessage'?: React.Validator<string | null | undefined> | undefined;
|
173
173
|
'aria-expanded'?: React.Validator<boolean | "true" | "false" | null | undefined> | undefined;
|
174
174
|
'aria-flowto'?: React.Validator<string | null | undefined> | undefined;
|
@@ -387,7 +387,7 @@ declare namespace DialogHeader {
|
|
387
387
|
size?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
388
388
|
borderX?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
389
389
|
borderY?: React.Validator<import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined> | undefined;
|
390
|
-
sx?: React.Validator<import("
|
390
|
+
sx?: React.Validator<import("@styled-system/css").SystemStyleObject | undefined> | undefined;
|
391
391
|
theme?: React.Validator<any> | undefined;
|
392
392
|
};
|
393
393
|
var displayName: string;
|
package/lib/Dropdown.d.ts
CHANGED
@@ -75,7 +75,7 @@ declare const _default: {
|
|
75
75
|
results?: number | undefined;
|
76
76
|
security?: string | undefined;
|
77
77
|
unselectable?: "on" | "off" | undefined;
|
78
|
-
inputMode?: "
|
78
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
79
79
|
is?: string | undefined;
|
80
80
|
'aria-activedescendant'?: string | undefined;
|
81
81
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -90,7 +90,7 @@ declare const _default: {
|
|
90
90
|
'aria-describedby'?: string | undefined;
|
91
91
|
'aria-details'?: string | undefined;
|
92
92
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
93
|
-
'aria-dropeffect'?: "
|
93
|
+
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
94
94
|
'aria-errormessage'?: string | undefined;
|
95
95
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
96
96
|
'aria-flowto'?: string | undefined;
|
@@ -307,7 +307,7 @@ declare const _default: {
|
|
307
307
|
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
308
308
|
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
309
309
|
open?: boolean | undefined;
|
310
|
-
sx?: import("
|
310
|
+
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
311
311
|
onToggle?: React.ReactEventHandler<HTMLElement> | undefined;
|
312
312
|
} & {
|
313
313
|
theme?: any;
|
@@ -372,7 +372,7 @@ declare const _default: {
|
|
372
372
|
results?: number | undefined;
|
373
373
|
security?: string | undefined;
|
374
374
|
unselectable?: "on" | "off" | undefined;
|
375
|
-
inputMode?: "
|
375
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
376
376
|
is?: string | undefined;
|
377
377
|
'aria-activedescendant'?: string | undefined;
|
378
378
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -387,7 +387,7 @@ declare const _default: {
|
|
387
387
|
'aria-describedby'?: string | undefined;
|
388
388
|
'aria-details'?: string | undefined;
|
389
389
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
390
|
-
'aria-dropeffect'?: "
|
390
|
+
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
391
391
|
'aria-errormessage'?: string | undefined;
|
392
392
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
393
393
|
'aria-flowto'?: string | undefined;
|
@@ -604,7 +604,7 @@ declare const _default: {
|
|
604
604
|
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
605
605
|
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
606
606
|
open?: boolean | undefined;
|
607
|
-
sx?: import("
|
607
|
+
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
608
608
|
onToggle?: React.ReactEventHandler<HTMLElement> | undefined;
|
609
609
|
} & {
|
610
610
|
theme?: any;
|
@@ -691,7 +691,7 @@ declare const _default: {
|
|
691
691
|
results?: number | undefined;
|
692
692
|
security?: string | undefined;
|
693
693
|
unselectable?: "on" | "off" | undefined;
|
694
|
-
inputMode?: "
|
694
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
695
695
|
is?: string | undefined;
|
696
696
|
'aria-activedescendant'?: string | undefined;
|
697
697
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -706,7 +706,7 @@ declare const _default: {
|
|
706
706
|
'aria-describedby'?: string | undefined;
|
707
707
|
'aria-details'?: string | undefined;
|
708
708
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
709
|
-
'aria-dropeffect'?: "
|
709
|
+
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
710
710
|
'aria-errormessage'?: string | undefined;
|
711
711
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
712
712
|
'aria-flowto'?: string | undefined;
|
@@ -923,8 +923,7 @@ declare const _default: {
|
|
923
923
|
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
924
924
|
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
925
925
|
size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
926
|
-
sx?: import("
|
927
|
-
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
926
|
+
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
928
927
|
autoFocus?: boolean | undefined;
|
929
928
|
disabled?: boolean | undefined;
|
930
929
|
formAction?: string | undefined;
|
@@ -932,7 +931,8 @@ declare const _default: {
|
|
932
931
|
formMethod?: string | undefined;
|
933
932
|
formNoValidate?: boolean | undefined;
|
934
933
|
formTarget?: string | undefined;
|
935
|
-
|
934
|
+
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
935
|
+
variant?: "large" | "medium" | "small" | undefined;
|
936
936
|
} & {
|
937
937
|
theme?: any;
|
938
938
|
}): JSX.Element;
|
@@ -1011,7 +1011,7 @@ declare const _default: {
|
|
1011
1011
|
results?: number | undefined;
|
1012
1012
|
security?: string | undefined;
|
1013
1013
|
unselectable?: "on" | "off" | undefined;
|
1014
|
-
inputMode?: "
|
1014
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
1015
1015
|
is?: string | undefined;
|
1016
1016
|
'aria-activedescendant'?: string | undefined;
|
1017
1017
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -1026,7 +1026,7 @@ declare const _default: {
|
|
1026
1026
|
'aria-describedby'?: string | undefined;
|
1027
1027
|
'aria-details'?: string | undefined;
|
1028
1028
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
1029
|
-
'aria-dropeffect'?: "
|
1029
|
+
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
1030
1030
|
'aria-errormessage'?: string | undefined;
|
1031
1031
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
1032
1032
|
'aria-flowto'?: string | undefined;
|
@@ -1243,8 +1243,7 @@ declare const _default: {
|
|
1243
1243
|
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
1244
1244
|
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
1245
1245
|
size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
1246
|
-
sx?: import("
|
1247
|
-
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
1246
|
+
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
1248
1247
|
autoFocus?: boolean | undefined;
|
1249
1248
|
disabled?: boolean | undefined;
|
1250
1249
|
formAction?: string | undefined;
|
@@ -1252,7 +1251,8 @@ declare const _default: {
|
|
1252
1251
|
formMethod?: string | undefined;
|
1253
1252
|
formNoValidate?: boolean | undefined;
|
1254
1253
|
formTarget?: string | undefined;
|
1255
|
-
|
1254
|
+
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
1255
|
+
variant?: "large" | "medium" | "small" | undefined;
|
1256
1256
|
} & {
|
1257
1257
|
theme?: any;
|
1258
1258
|
}> | undefined;
|
@@ -76,7 +76,7 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
76
76
|
results?: number | undefined;
|
77
77
|
security?: string | undefined;
|
78
78
|
unselectable?: "on" | "off" | undefined;
|
79
|
-
inputMode?: "
|
79
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
80
80
|
is?: string | undefined;
|
81
81
|
'aria-activedescendant'?: string | undefined;
|
82
82
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -91,7 +91,7 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
91
91
|
'aria-describedby'?: string | undefined;
|
92
92
|
'aria-details'?: string | undefined;
|
93
93
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
94
|
-
'aria-dropeffect'?: "
|
94
|
+
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
95
95
|
'aria-errormessage'?: string | undefined;
|
96
96
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
97
97
|
'aria-flowto'?: string | undefined;
|
@@ -308,8 +308,7 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
308
308
|
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
309
309
|
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
310
310
|
size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
311
|
-
sx?: import("
|
312
|
-
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
311
|
+
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
313
312
|
autoFocus?: boolean | undefined;
|
314
313
|
disabled?: boolean | undefined;
|
315
314
|
formAction?: string | undefined;
|
@@ -317,7 +316,8 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
317
316
|
formMethod?: string | undefined;
|
318
317
|
formNoValidate?: boolean | undefined;
|
319
318
|
formTarget?: string | undefined;
|
320
|
-
|
319
|
+
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
320
|
+
variant?: "large" | "medium" | "small" | undefined;
|
321
321
|
} & {
|
322
322
|
theme?: any;
|
323
|
-
}>, "backgroundColor" | "color" | "display" | "fontSize" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "verticalAlign" | "width" | "margin" | "overflow" | "padding" | "hidden" | "children" | "theme" | "value" | "form" | "p" | "slot" | "style" | "title" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "sx" | "
|
323
|
+
}>, "backgroundColor" | "color" | "display" | "fontSize" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "verticalAlign" | "width" | "margin" | "overflow" | "padding" | "hidden" | "children" | "theme" | "value" | "form" | "p" | "slot" | "style" | "title" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "sx" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "as" | "variant"> & React.RefAttributes<HTMLElement>>;
|
package/lib/FilterList.d.ts
CHANGED
@@ -76,7 +76,7 @@ declare const _default: {
|
|
76
76
|
results?: number | undefined;
|
77
77
|
security?: string | undefined;
|
78
78
|
unselectable?: "on" | "off" | undefined;
|
79
|
-
inputMode?: "
|
79
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
80
80
|
is?: string | undefined;
|
81
81
|
'aria-activedescendant'?: string | undefined;
|
82
82
|
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
@@ -91,7 +91,7 @@ declare const _default: {
|
|
91
91
|
'aria-describedby'?: string | undefined;
|
92
92
|
'aria-details'?: string | undefined;
|
93
93
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
94
|
-
'aria-dropeffect'?: "
|
94
|
+
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
95
95
|
'aria-errormessage'?: string | undefined;
|
96
96
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
97
97
|
'aria-flowto'?: string | undefined;
|
@@ -307,7 +307,7 @@ declare const _default: {
|
|
307
307
|
paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
308
308
|
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
309
309
|
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
310
|
-
sx?: import("
|
310
|
+
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
311
311
|
} & {
|
312
312
|
theme?: any;
|
313
313
|
}>): JSX.Element;
|