@jobber/components 6.101.4 → 6.101.5-JOB-140604-4487daa.55
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/dist/Autocomplete/Autocomplete.types.d.ts +11 -51
- package/dist/Autocomplete/components/MenuList.d.ts +3 -2
- package/dist/Autocomplete/components/PersistentRegion.d.ts +3 -2
- package/dist/Autocomplete/hooks/useAutocompleteListNav.d.ts +3 -2
- package/dist/Autocomplete/index.cjs +95 -51
- package/dist/Autocomplete/index.mjs +97 -53
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +14 -1
- package/dist/Autocomplete/useAutocomplete.d.ts +4 -3
- package/dist/Autocomplete/utils/interactionUtils.d.ts +14 -0
- package/dist/Card-cjs.js +1 -1
- package/dist/Card-es.js +1 -1
- package/dist/Checkbox/Checkbox.rebuilt.d.ts +2 -2
- package/dist/Checkbox/Checkbox.types.d.ts +24 -18
- package/dist/Checkbox/index.cjs +9 -2
- package/dist/Checkbox/index.mjs +9 -2
- package/dist/Chip/Chip.d.ts +1 -2
- package/dist/Chip/hooks/useChildComponent.d.ts +4 -3
- package/dist/Chip/index.cjs +1 -1
- package/dist/Chip-cjs.js +5 -4
- package/dist/Chip-es.js +5 -4
- package/dist/ChipDismissible-cjs.js +4 -4
- package/dist/ChipDismissible-es.js +5 -5
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
- package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
- package/dist/Chips/index.cjs +2 -2
- package/dist/Chips/index.mjs +2 -2
- package/dist/Combobox/Combobox.d.ts +2 -1
- package/dist/Combobox/Combobox.types.d.ts +2 -2
- package/dist/Combobox/ComboboxProvider.d.ts +3 -3
- package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +1 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +2 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/ComboboxContentHeader.d.ts +2 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/ComboboxContentList.d.ts +2 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/ComboboxContentSearch.d.ts +2 -1
- package/dist/Combobox/hooks/useCombobox.d.ts +1 -1
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +2 -2
- package/dist/Combobox/hooks/useComboboxContent.d.ts +2 -1
- package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +1 -1
- package/dist/ComboboxActivator-cjs.js +2 -2
- package/dist/ComboboxActivator-es.js +3 -3
- package/dist/ComboboxTrigger-cjs.js +1 -1
- package/dist/ComboboxTrigger-es.js +2 -2
- package/dist/DataList/DataList.types.d.ts +2 -2
- package/dist/DataList/DataList.utils.d.ts +2 -2
- package/dist/DataList/components/DataListHeader/index.cjs +1 -0
- package/dist/DataList/components/DataListHeader/index.mjs +1 -0
- package/dist/DataList/components/DataListHeaderTile/components/DataListSortingOptions.d.ts +2 -2
- package/dist/DataList/components/DataListItem/DataListItemInternal.d.ts +2 -2
- package/dist/DataList/components/DataListItem/index.cjs +1 -0
- package/dist/DataList/components/DataListItem/index.mjs +1 -0
- package/dist/DataList/components/DataListItems/index.cjs +1 -0
- package/dist/DataList/components/DataListItems/index.mjs +1 -0
- package/dist/DataList/components/DataListLayout/index.cjs +1 -0
- package/dist/DataList/components/DataListLayout/index.mjs +1 -0
- package/dist/DataList/components/DataListSearch/index.cjs +2 -12
- package/dist/DataList/components/DataListSearch/index.mjs +2 -12
- package/dist/DataList/hooks/useGetItemActions.d.ts +1 -1
- package/dist/DataList/index.cjs +1 -8
- package/dist/DataList/index.mjs +1 -8
- package/dist/DataListActions-cjs.js +4 -2
- package/dist/DataListActions-es.js +4 -2
- package/dist/DataListItem-cjs.js +8 -7
- package/dist/DataListItem-es.js +9 -8
- package/dist/DataListSort-cjs.js +1 -1
- package/dist/DataListSort-es.js +2 -2
- package/dist/DataTable/SortIcon.d.ts +2 -1
- package/dist/DataTable/components/DataTableSortableHeader.d.ts +1 -1
- package/dist/DataTable/index.cjs +3 -2
- package/dist/DataTable/index.mjs +3 -2
- package/dist/DatePicker/DatePicker.d.ts +5 -1
- package/dist/DatePicker/index.cjs +2 -2
- package/dist/DatePicker/index.mjs +2 -2
- package/dist/DatePicker/useFocusOnSelectedDate.d.ts +1 -2
- package/dist/DatePicker-cjs.js +4 -2
- package/dist/DatePicker-es.js +5 -3
- package/dist/FormField/FormFieldAffix.d.ts +2 -2
- package/dist/FormField/FormFieldTypes.d.ts +3 -5
- package/dist/FormField/FormFieldWrapper.d.ts +5 -1
- package/dist/FormField/hooks/useFormFieldFocus.d.ts +1 -1
- package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +9 -4
- package/dist/FormField-cjs.js +35 -31
- package/dist/FormField-es.js +35 -31
- package/dist/InputDate/InputDate.types.d.ts +12 -7
- package/dist/InputDate/index.cjs +35 -12
- package/dist/InputDate/index.mjs +35 -12
- package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
- package/dist/InputEmail/InputEmail.types.d.ts +10 -20
- package/dist/InputEmail/hooks/useInputEmailActions.d.ts +10 -4
- package/dist/InputEmail/index.cjs +43 -60
- package/dist/InputEmail/index.mjs +44 -61
- package/dist/InputFile-cjs.js +5 -2
- package/dist/InputFile-es.js +5 -2
- package/dist/InputGroup-cjs.js +5 -2
- package/dist/InputGroup-es.js +5 -2
- package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +7 -15
- package/dist/InputNumber/index.cjs +7 -5
- package/dist/InputNumber/index.mjs +7 -5
- package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +12 -28
- package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +9 -4
- package/dist/InputPhoneNumber/index.cjs +37 -36
- package/dist/InputPhoneNumber/index.mjs +38 -37
- package/dist/InputText/InputText.d.ts +2 -2
- package/dist/InputText/InputText.types.d.ts +30 -25
- package/dist/InputText/index.cjs +54 -62
- package/dist/InputText/index.mjs +55 -63
- package/dist/InputText/useInputTextActions.d.ts +11 -5
- package/dist/InputText/useTextAreaResize.d.ts +2 -2
- package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
- package/dist/InputTime/InputTime.types.d.ts +13 -4
- package/dist/InputTime/hooks/useInputTimeActions.d.ts +21 -0
- package/dist/InputTime/index.cjs +90 -30
- package/dist/InputTime/index.mjs +93 -33
- package/dist/InternalChipDismissible-cjs.js +3 -3
- package/dist/InternalChipDismissible-es.js +4 -4
- package/dist/List/index.cjs +2 -2
- package/dist/List/index.mjs +2 -2
- package/dist/Menu/Menu.d.ts +2 -4
- package/dist/Menu/Menu.types.d.ts +21 -5
- package/dist/Menu-cjs.js +9 -9
- package/dist/Menu-es.js +9 -9
- package/dist/Modal/Modal.types.d.ts +3 -3
- package/dist/Modal/ModalContext.rebuilt.d.ts +2 -2
- package/dist/MultiSelect/DropDownMenu.d.ts +1 -1
- package/dist/MultiSelect/index.cjs +1 -0
- package/dist/MultiSelect/index.mjs +1 -0
- package/dist/MultiSelect-cjs.js +13 -7
- package/dist/MultiSelect-es.js +13 -7
- package/dist/RadioGroup/RadioGroup.d.ts +2 -1
- package/dist/RadioGroup/RadioOption.d.ts +1 -1
- package/dist/RecurringSelect/index.cjs +3 -2
- package/dist/RecurringSelect/index.mjs +3 -2
- package/dist/Select/Select.types.d.ts +7 -3
- package/dist/Select/hooks/useSelectActions.d.ts +5 -5
- package/dist/Select/index.cjs +27 -42
- package/dist/Select/index.mjs +29 -44
- package/dist/StatusLabel/StatusLabel.d.ts +2 -1
- package/dist/Tabs/hooks/useTabsOverflow.d.ts +2 -2
- package/dist/Tabs-cjs.js +4 -2
- package/dist/Tabs-es.js +5 -3
- package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
- package/dist/_baseEach-cjs.js +12 -12
- package/dist/_baseEach-es.js +1 -1
- package/dist/_baseFlatten-cjs.js +2 -2
- package/dist/_baseFlatten-es.js +1 -1
- package/dist/{_baseGet-cjs.js → _getAllKeys-cjs.js} +181 -181
- package/dist/{_baseGet-es.js → _getAllKeys-es.js} +182 -182
- package/dist/debounce-es.js +1 -1
- package/dist/filterDataAttributes-cjs.js +26 -0
- package/dist/filterDataAttributes-es.js +24 -0
- package/dist/floating-ui.react-cjs.js +115 -0
- package/dist/floating-ui.react-es.js +115 -1
- package/dist/helpers-cjs.js +1 -1
- package/dist/helpers-es.js +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.mjs +3 -2
- package/dist/omit-cjs.js +14 -14
- package/dist/omit-es.js +1 -1
- package/dist/sharedHelpers/filterDataAttributes.d.ts +17 -0
- package/dist/sharedHelpers/types.d.ts +231 -0
- package/dist/showToast-cjs.js +2 -2
- package/dist/showToast-es.js +2 -2
- package/dist/styles.css +32 -23
- package/dist/useChildComponent-cjs.js +1 -1
- package/dist/useChildComponent-es.js +1 -1
- package/dist/useScrollToActive-cjs.js +3 -3
- package/dist/useScrollToActive-es.js +2 -2
- package/dist/utils/mergeRefs.d.ts +2 -2
- package/package.json +2 -2
- package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +0 -32
- package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +0 -71
- package/dist/InputText/useInputTextFormField.d.ts +0 -352
- package/dist/Select/hooks/useSelectFormField.d.ts +0 -34
|
@@ -8,13 +8,13 @@ import { F as FloatingPortal } from './floating-ui.react-es.js';
|
|
|
8
8
|
import { T as Text } from './Text-es.js';
|
|
9
9
|
import { B as Button } from './Button-es.js';
|
|
10
10
|
import { S as Spinner } from './Spinner-es.js';
|
|
11
|
-
import { C as
|
|
11
|
+
import { C as Chip, I as InternalChipButton } from './Chip-es.js';
|
|
12
12
|
import './tslib.es6-es.js';
|
|
13
13
|
|
|
14
14
|
function InternalChip({ label, active = false, disabled = false, invalid = false, prefix, suffix, tabIndex, ariaLabel, onClick, onKeyDown, }) {
|
|
15
|
-
return (React__default.createElement(
|
|
16
|
-
prefix && React__default.createElement(
|
|
17
|
-
suffix && React__default.createElement(
|
|
15
|
+
return (React__default.createElement(Chip, { disabled: disabled, invalid: invalid, onKeyDown: onKeyDown, testID: "ATL-InternalChip", ariaLabel: ariaLabel, tabIndex: tabIndex, variation: active ? "base" : "subtle", role: tabIndex !== undefined ? "option" : undefined, onClick: onClick ? (_, ev) => onClick(ev) : undefined, label: label },
|
|
16
|
+
prefix && React__default.createElement(Chip.Prefix, null, prefix),
|
|
17
|
+
suffix && React__default.createElement(Chip.Suffix, null, suffix)));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
var styles = {"wrapper":"XRnU90M2-fs-","input":"Dq-yFHd1zK0-","menu":"F7CpurjKzBI-","menuListOption":"_9SAK31TqNDY-","loadingIndicator":"s5vFJVv0t0Q-","activeOption":"_8d0w-JzgzS4-","spinning":"hDJGLX6kE-U-"};
|
package/dist/List/index.cjs
CHANGED
|
@@ -8,9 +8,9 @@ require('../identity-cjs.js');
|
|
|
8
8
|
require('../isTypedArray-cjs.js');
|
|
9
9
|
require('../isObjectLike-cjs.js');
|
|
10
10
|
require('../_commonjsHelpers-cjs.js');
|
|
11
|
-
require('../
|
|
12
|
-
require('../_getTag-cjs.js');
|
|
11
|
+
require('../_getAllKeys-cjs.js');
|
|
13
12
|
require('../isSymbol-cjs.js');
|
|
13
|
+
require('../_getTag-cjs.js');
|
|
14
14
|
require('../_baseFor-cjs.js');
|
|
15
15
|
require('../_baseAssignValue-cjs.js');
|
|
16
16
|
require('../Typography-cjs.js');
|
package/dist/List/index.mjs
CHANGED
|
@@ -6,9 +6,9 @@ import '../identity-es.js';
|
|
|
6
6
|
import '../isTypedArray-es.js';
|
|
7
7
|
import '../isObjectLike-es.js';
|
|
8
8
|
import '../_commonjsHelpers-es.js';
|
|
9
|
-
import '../
|
|
10
|
-
import '../_getTag-es.js';
|
|
9
|
+
import '../_getAllKeys-es.js';
|
|
11
10
|
import '../isSymbol-es.js';
|
|
11
|
+
import '../_getTag-es.js';
|
|
12
12
|
import '../_baseFor-es.js';
|
|
13
13
|
import '../_baseAssignValue-es.js';
|
|
14
14
|
import '../Typography-es.js';
|
package/dist/Menu/Menu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import type { MenuComposableProps, MenuContentComposableProps, MenuHeaderComposableProps, MenuItemComposableProps, MenuItemIconComposableProps, MenuLegacyProps, MenuSectionComposableProps, MenuSeparatorComposableProps, MenuTriggerComposableProps } from "./Menu.types";
|
|
3
|
+
import type { MenuComposableProps, MenuContentComposableProps, MenuHeaderComposableProps, MenuItemComposableProps, MenuItemIconComposableProps, MenuItemLabelComposableProps, MenuLegacyProps, MenuSectionComposableProps, MenuSeparatorComposableProps, MenuTriggerComposableProps } from "./Menu.types";
|
|
4
4
|
export declare function Menu(props: MenuLegacyProps): ReactElement;
|
|
5
5
|
export declare function Menu(props: MenuComposableProps): ReactElement;
|
|
6
6
|
export declare namespace Menu {
|
|
@@ -20,9 +20,7 @@ declare function MenuSeparatorComposable({ UNSAFE_style, UNSAFE_className, }: Me
|
|
|
20
20
|
declare function MenuSectionComposable({ children, UNSAFE_style, UNSAFE_className, ariaLabel, }: MenuSectionComposableProps): React.JSX.Element;
|
|
21
21
|
declare function MenuHeaderComposable(props: MenuHeaderComposableProps): React.JSX.Element;
|
|
22
22
|
declare function MenuItemIconComposable(props: MenuItemIconComposableProps): React.JSX.Element;
|
|
23
|
-
declare function MenuItemLabelComposable(props:
|
|
24
|
-
readonly children: string;
|
|
25
|
-
}): React.JSX.Element;
|
|
23
|
+
declare function MenuItemLabelComposable(props: MenuItemLabelComposableProps): React.JSX.Element;
|
|
26
24
|
declare function MenuHeaderLabel(props: {
|
|
27
25
|
readonly children: React.ReactNode;
|
|
28
26
|
}): React.JSX.Element;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { IconColorNames, IconNames } from "@jobber/design";
|
|
2
2
|
import type React from "react";
|
|
3
|
-
import type { CSSProperties, ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { CSSProperties, ComponentProps, ReactElement, ReactNode } from "react";
|
|
4
|
+
import type { Pressable as AriaPressable } from "react-aria-components";
|
|
4
5
|
import type { IconProps } from "../Icon";
|
|
6
|
+
type PressableChild = ComponentProps<typeof AriaPressable>["children"];
|
|
5
7
|
export interface MenuLegacyProps extends MenuBaseProps {
|
|
6
8
|
/**
|
|
7
9
|
* Custom menu activator. If this is not provided a default [… More] will be used.
|
|
8
10
|
*/
|
|
9
|
-
readonly activator?: ReactElement
|
|
11
|
+
readonly activator?: ReactElement<{
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
onClick?: (event?: React.MouseEvent) => void;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}>;
|
|
10
16
|
/**
|
|
11
17
|
* Collection of action items.
|
|
12
18
|
*/
|
|
@@ -128,11 +134,12 @@ export interface MenuSectionComposableProps extends UnsafeProps {
|
|
|
128
134
|
export interface MenuHeaderComposableProps extends UnsafeProps {
|
|
129
135
|
readonly children: ReactNode;
|
|
130
136
|
}
|
|
137
|
+
type MenuItemVariants = "destructive";
|
|
131
138
|
export interface MenuItemComposableProps extends UnsafeProps {
|
|
132
139
|
/**
|
|
133
|
-
*
|
|
140
|
+
* Visual style variations for the MenuItem default content.
|
|
134
141
|
*/
|
|
135
|
-
readonly
|
|
142
|
+
readonly variation?: MenuItemVariants;
|
|
136
143
|
/**
|
|
137
144
|
* Item content.
|
|
138
145
|
*/
|
|
@@ -172,7 +179,7 @@ export interface MenuTriggerComposableProps {
|
|
|
172
179
|
* If you want to access the open event, use the onOpenChange on the Menu component.
|
|
173
180
|
* If it does not have an interactive role, or a focus style it will have issues.
|
|
174
181
|
*/
|
|
175
|
-
readonly children:
|
|
182
|
+
readonly children: PressableChild;
|
|
176
183
|
}
|
|
177
184
|
export interface MenuSeparatorComposableProps extends UnsafeProps {
|
|
178
185
|
}
|
|
@@ -180,4 +187,13 @@ export type AnimationState = "unmounted" | "hidden" | "visible";
|
|
|
180
187
|
export interface MenuMobileUnderlayProps {
|
|
181
188
|
readonly animation: AnimationState;
|
|
182
189
|
}
|
|
190
|
+
export interface MenuItemLabelComposableProps {
|
|
191
|
+
/**
|
|
192
|
+
* Item label content.
|
|
193
|
+
* This is rendered inside a Typography (span) component, so you MUST supply either
|
|
194
|
+
* a string or a fragment/utility component that renders down to a raw string (e.g.
|
|
195
|
+
* translation helpers).
|
|
196
|
+
*/
|
|
197
|
+
readonly children: React.ReactNode;
|
|
198
|
+
}
|
|
183
199
|
export {};
|
package/dist/Menu-cjs.js
CHANGED
|
@@ -87,7 +87,7 @@ const composeOverlayVariation = {
|
|
|
87
87
|
hidden: { opacity: 0 },
|
|
88
88
|
visible: { opacity: 1 },
|
|
89
89
|
};
|
|
90
|
-
const
|
|
90
|
+
const animationVariation = {
|
|
91
91
|
overlayStartStop: { opacity: 0 },
|
|
92
92
|
startOrStop: (placement) => {
|
|
93
93
|
let y = Y_TRANSLATION_DESKTOP;
|
|
@@ -206,14 +206,14 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
|
|
|
206
206
|
})),
|
|
207
207
|
React.createElement(MenuPortal, null,
|
|
208
208
|
React.createElement(framerMotion.AnimatePresence, null, visible && (React.createElement(React.Fragment, null,
|
|
209
|
-
React.createElement(framerMotion.motion.div, { className: styles.overlay, onClick: toggle(), variants:
|
|
209
|
+
React.createElement(framerMotion.motion.div, { className: styles.overlay, onClick: toggle(), variants: animationVariation, initial: "overlayStartStop", animate: "done", exit: "overlayStartStop", transition: Object.assign({}, OVERLAY_ANIMATION_CONFIG) }),
|
|
210
210
|
React.createElement("div", Object.assign({ ref: refs.setFloating, className: styles.floatingContainer }, getFloatingProps({
|
|
211
211
|
onKeyDown: event => {
|
|
212
212
|
if (event.key === "Tab") {
|
|
213
213
|
event.preventDefault();
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
|
-
}), positionAttributes, useFormFieldFocus.formFieldFocusAttribute), items.length > 0 && (React.createElement(framerMotion.motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants:
|
|
216
|
+
}), positionAttributes, useFormFieldFocus.formFieldFocusAttribute), items.length > 0 && (React.createElement(framerMotion.motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants: animationVariation, initial: "startOrStop", animate: "done", exit: "startOrStop", custom: context === null || context === void 0 ? void 0 : context.placement, transition: Object.assign({}, MENU_ANIMATION_CONFIG), style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.menu }, renderedSections)))))))));
|
|
217
217
|
function toggle(callbackPassthrough) {
|
|
218
218
|
return (event) => {
|
|
219
219
|
setVisible(!visible);
|
|
@@ -348,14 +348,14 @@ const MenuItemComposable = React.forwardRef(function MenuItemComposable(props, r
|
|
|
348
348
|
if (props.href) {
|
|
349
349
|
const { href, target, rel, onClick } = props;
|
|
350
350
|
return (React.createElement(Tree.$3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, href: href, target: target, rel: rel, onClick: onClick },
|
|
351
|
-
React.createElement(MenuItemContext.Provider, { value: {
|
|
351
|
+
React.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
|
|
352
352
|
}
|
|
353
353
|
return (React.createElement(Tree.$3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, onAction: () => {
|
|
354
354
|
var _a;
|
|
355
355
|
// Zero-arg activation for non-link items
|
|
356
356
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
357
357
|
} },
|
|
358
|
-
React.createElement(MenuItemContext.Provider, { value: {
|
|
358
|
+
React.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
|
|
359
359
|
});
|
|
360
360
|
const MenuItemContext = React.createContext(null);
|
|
361
361
|
function useMenuItemContext() {
|
|
@@ -363,14 +363,14 @@ function useMenuItemContext() {
|
|
|
363
363
|
return ctx !== null && ctx !== void 0 ? ctx : {};
|
|
364
364
|
}
|
|
365
365
|
function MenuItemIconComposable(props) {
|
|
366
|
-
const {
|
|
366
|
+
const { variation } = useMenuItemContext();
|
|
367
367
|
return (React.createElement("div", { "data-menu-slot": "icon" },
|
|
368
|
-
React.createElement(Icon.Icon, Object.assign({}, props, { color: destructive ? "destructive" : props.color }))));
|
|
368
|
+
React.createElement(Icon.Icon, Object.assign({}, props, { color: variation === "destructive" ? "destructive" : props.color }))));
|
|
369
369
|
}
|
|
370
370
|
function MenuItemLabelComposable(props) {
|
|
371
|
-
const {
|
|
371
|
+
const { variation } = useMenuItemContext();
|
|
372
372
|
return (React.createElement("div", { "data-menu-slot": "label" },
|
|
373
|
-
React.createElement(Typography.Typography, { element: "span", fontWeight: "semiBold", textColor: destructive ? "destructive" : "text" }, props.children)));
|
|
373
|
+
React.createElement(Typography.Typography, { element: "span", fontWeight: "semiBold", textColor: variation === "destructive" ? "destructive" : "text" }, props.children)));
|
|
374
374
|
}
|
|
375
375
|
function MenuHeaderLabel(props) {
|
|
376
376
|
return React.createElement(DefaultHeaderContent, null, props.children);
|
package/dist/Menu-es.js
CHANGED
|
@@ -85,7 +85,7 @@ const composeOverlayVariation = {
|
|
|
85
85
|
hidden: { opacity: 0 },
|
|
86
86
|
visible: { opacity: 1 },
|
|
87
87
|
};
|
|
88
|
-
const
|
|
88
|
+
const animationVariation = {
|
|
89
89
|
overlayStartStop: { opacity: 0 },
|
|
90
90
|
startOrStop: (placement) => {
|
|
91
91
|
let y = Y_TRANSLATION_DESKTOP;
|
|
@@ -204,14 +204,14 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
|
|
|
204
204
|
})),
|
|
205
205
|
React__default.createElement(MenuPortal, null,
|
|
206
206
|
React__default.createElement(AnimatePresence, null, visible && (React__default.createElement(React__default.Fragment, null,
|
|
207
|
-
React__default.createElement(motion.div, { className: styles.overlay, onClick: toggle(), variants:
|
|
207
|
+
React__default.createElement(motion.div, { className: styles.overlay, onClick: toggle(), variants: animationVariation, initial: "overlayStartStop", animate: "done", exit: "overlayStartStop", transition: Object.assign({}, OVERLAY_ANIMATION_CONFIG) }),
|
|
208
208
|
React__default.createElement("div", Object.assign({ ref: refs.setFloating, className: styles.floatingContainer }, getFloatingProps({
|
|
209
209
|
onKeyDown: event => {
|
|
210
210
|
if (event.key === "Tab") {
|
|
211
211
|
event.preventDefault();
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
|
-
}), positionAttributes, formFieldFocusAttribute), items.length > 0 && (React__default.createElement(motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants:
|
|
214
|
+
}), positionAttributes, formFieldFocusAttribute), items.length > 0 && (React__default.createElement(motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants: animationVariation, initial: "startOrStop", animate: "done", exit: "startOrStop", custom: context === null || context === void 0 ? void 0 : context.placement, transition: Object.assign({}, MENU_ANIMATION_CONFIG), style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.menu }, renderedSections)))))))));
|
|
215
215
|
function toggle(callbackPassthrough) {
|
|
216
216
|
return (event) => {
|
|
217
217
|
setVisible(!visible);
|
|
@@ -346,14 +346,14 @@ const MenuItemComposable = React__default.forwardRef(function MenuItemComposable
|
|
|
346
346
|
if (props.href) {
|
|
347
347
|
const { href, target, rel, onClick } = props;
|
|
348
348
|
return (React__default.createElement($3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, href: href, target: target, rel: rel, onClick: onClick },
|
|
349
|
-
React__default.createElement(MenuItemContext.Provider, { value: {
|
|
349
|
+
React__default.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
|
|
350
350
|
}
|
|
351
351
|
return (React__default.createElement($3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, onAction: () => {
|
|
352
352
|
var _a;
|
|
353
353
|
// Zero-arg activation for non-link items
|
|
354
354
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
355
355
|
} },
|
|
356
|
-
React__default.createElement(MenuItemContext.Provider, { value: {
|
|
356
|
+
React__default.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
|
|
357
357
|
});
|
|
358
358
|
const MenuItemContext = createContext(null);
|
|
359
359
|
function useMenuItemContext() {
|
|
@@ -361,14 +361,14 @@ function useMenuItemContext() {
|
|
|
361
361
|
return ctx !== null && ctx !== void 0 ? ctx : {};
|
|
362
362
|
}
|
|
363
363
|
function MenuItemIconComposable(props) {
|
|
364
|
-
const {
|
|
364
|
+
const { variation } = useMenuItemContext();
|
|
365
365
|
return (React__default.createElement("div", { "data-menu-slot": "icon" },
|
|
366
|
-
React__default.createElement(Icon, Object.assign({}, props, { color: destructive ? "destructive" : props.color }))));
|
|
366
|
+
React__default.createElement(Icon, Object.assign({}, props, { color: variation === "destructive" ? "destructive" : props.color }))));
|
|
367
367
|
}
|
|
368
368
|
function MenuItemLabelComposable(props) {
|
|
369
|
-
const {
|
|
369
|
+
const { variation } = useMenuItemContext();
|
|
370
370
|
return (React__default.createElement("div", { "data-menu-slot": "label" },
|
|
371
|
-
React__default.createElement(Typography, { element: "span", fontWeight: "semiBold", textColor: destructive ? "destructive" : "text" }, props.children)));
|
|
371
|
+
React__default.createElement(Typography, { element: "span", fontWeight: "semiBold", textColor: variation === "destructive" ? "destructive" : "text" }, props.children)));
|
|
372
372
|
}
|
|
373
373
|
function MenuHeaderLabel(props) {
|
|
374
374
|
return React__default.createElement(DefaultHeaderContent, null, props.children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsWithChildren, ReactNode, RefObject } from "react";
|
|
2
2
|
import type { ExtendedRefs, FloatingContext, ReferenceType, UseInteractionsReturn } from "@floating-ui/react";
|
|
3
3
|
import type { XOR } from "ts-xor";
|
|
4
4
|
import type sizes from "./ModalSizes.module.css";
|
|
@@ -18,7 +18,7 @@ export interface ModalContextType {
|
|
|
18
18
|
* Ref to specify the activator element. Useful if the activator can unmount
|
|
19
19
|
* and needs to be re-mounted.
|
|
20
20
|
*/
|
|
21
|
-
readonly activatorRef?:
|
|
21
|
+
readonly activatorRef?: RefObject<HTMLElement | null>;
|
|
22
22
|
/**
|
|
23
23
|
* Refs used by floating-ui to position the modal.
|
|
24
24
|
*/
|
|
@@ -57,7 +57,7 @@ export interface ModalContextType {
|
|
|
57
57
|
* Tracks whether the current pointer interaction began inside the dialog.
|
|
58
58
|
* Used to disambiguate outsidePress after nested overlay closes.
|
|
59
59
|
*/
|
|
60
|
-
readonly startedInsideRef?:
|
|
60
|
+
readonly startedInsideRef?: RefObject<boolean>;
|
|
61
61
|
}
|
|
62
62
|
export interface ModalActionsProps {
|
|
63
63
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type sizes from "./ModalSizes.module.css";
|
|
4
4
|
import type { ModalContextType } from "./Modal.types";
|
|
@@ -8,7 +8,7 @@ export interface ModalProviderProps {
|
|
|
8
8
|
readonly size?: keyof typeof sizes;
|
|
9
9
|
readonly open?: boolean;
|
|
10
10
|
readonly onRequestClose?: () => void;
|
|
11
|
-
readonly activatorRef?:
|
|
11
|
+
readonly activatorRef?: RefObject<HTMLElement | null>;
|
|
12
12
|
readonly dismissible?: boolean;
|
|
13
13
|
readonly modalLabelledBy?: string;
|
|
14
14
|
readonly ariaLabel?: string;
|
package/dist/MultiSelect-cjs.js
CHANGED
|
@@ -12,7 +12,7 @@ var styles = {"dropDownMenuContainer":"zossMHCpMPU-","option":"poS49c-LqiU-","ac
|
|
|
12
12
|
|
|
13
13
|
function DropDownMenu({ options, setOptions }) {
|
|
14
14
|
const [highlightedIndex, setHighlightedIndex] = React.useState(0);
|
|
15
|
-
const menuDiv = React.useRef();
|
|
15
|
+
const menuDiv = React.useRef(null);
|
|
16
16
|
const handleOptionClick = React.useCallback((clickedOption) => {
|
|
17
17
|
setOptions(current => current.map(option => {
|
|
18
18
|
if (option.label == clickedOption.label) {
|
|
@@ -87,13 +87,17 @@ function DropDownMenu({ options, setOptions }) {
|
|
|
87
87
|
event.preventDefault();
|
|
88
88
|
const newIndex = Math.max(0, highlightedIndex - 1);
|
|
89
89
|
handleOptionFocus(newIndex);
|
|
90
|
-
|
|
90
|
+
if (menuDiv.current) {
|
|
91
|
+
scrollMenuIfItemNotInView(menuDiv.current, "up");
|
|
92
|
+
}
|
|
91
93
|
}
|
|
92
94
|
function handlePressDown(event) {
|
|
93
95
|
event.preventDefault();
|
|
94
96
|
const newIndex = Math.min(options.length - 1, highlightedIndex + 1);
|
|
95
97
|
handleOptionFocus(newIndex);
|
|
96
|
-
|
|
98
|
+
if (menuDiv.current) {
|
|
99
|
+
scrollMenuIfItemNotInView(menuDiv.current, "down");
|
|
100
|
+
}
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
|
|
@@ -101,15 +105,16 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
101
105
|
const [label, setLabel] = React.useState(defaultLabel);
|
|
102
106
|
const [menuVisible, setMenuVisible] = React.useState(false);
|
|
103
107
|
const [focused, setFocused] = React.useState(false);
|
|
104
|
-
const multiSelectContainer = React.useRef();
|
|
105
|
-
const multiSelectRef = React.useRef();
|
|
108
|
+
const multiSelectContainer = React.useRef(null);
|
|
109
|
+
const multiSelectRef = React.useRef(null);
|
|
106
110
|
const multiSelectClass = classnames(styles$1.multiSelect, {
|
|
107
111
|
[styles$1.active]: menuVisible,
|
|
108
112
|
[styles$1.large]: size === "large",
|
|
109
113
|
[styles$1.small]: size === "small",
|
|
110
114
|
});
|
|
111
115
|
function handleMenuVisibility() {
|
|
112
|
-
|
|
116
|
+
var _a;
|
|
117
|
+
(_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
113
118
|
setMenuVisible(!menuVisible);
|
|
114
119
|
}
|
|
115
120
|
const handleClickOutside = (e) => {
|
|
@@ -119,6 +124,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
119
124
|
}
|
|
120
125
|
};
|
|
121
126
|
function handleKeydown(event) {
|
|
127
|
+
var _a;
|
|
122
128
|
const { key, metaKey, ctrlKey } = event;
|
|
123
129
|
if (metaKey || ctrlKey)
|
|
124
130
|
return;
|
|
@@ -131,7 +137,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
131
137
|
break;
|
|
132
138
|
}
|
|
133
139
|
case "Escape": {
|
|
134
|
-
multiSelectRef.current.focus();
|
|
140
|
+
(_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
135
141
|
setMenuVisible(false);
|
|
136
142
|
break;
|
|
137
143
|
}
|
package/dist/MultiSelect-es.js
CHANGED
|
@@ -10,7 +10,7 @@ var styles = {"dropDownMenuContainer":"zossMHCpMPU-","option":"poS49c-LqiU-","ac
|
|
|
10
10
|
|
|
11
11
|
function DropDownMenu({ options, setOptions }) {
|
|
12
12
|
const [highlightedIndex, setHighlightedIndex] = useState(0);
|
|
13
|
-
const menuDiv = useRef();
|
|
13
|
+
const menuDiv = useRef(null);
|
|
14
14
|
const handleOptionClick = useCallback((clickedOption) => {
|
|
15
15
|
setOptions(current => current.map(option => {
|
|
16
16
|
if (option.label == clickedOption.label) {
|
|
@@ -85,13 +85,17 @@ function DropDownMenu({ options, setOptions }) {
|
|
|
85
85
|
event.preventDefault();
|
|
86
86
|
const newIndex = Math.max(0, highlightedIndex - 1);
|
|
87
87
|
handleOptionFocus(newIndex);
|
|
88
|
-
|
|
88
|
+
if (menuDiv.current) {
|
|
89
|
+
scrollMenuIfItemNotInView(menuDiv.current, "up");
|
|
90
|
+
}
|
|
89
91
|
}
|
|
90
92
|
function handlePressDown(event) {
|
|
91
93
|
event.preventDefault();
|
|
92
94
|
const newIndex = Math.min(options.length - 1, highlightedIndex + 1);
|
|
93
95
|
handleOptionFocus(newIndex);
|
|
94
|
-
|
|
96
|
+
if (menuDiv.current) {
|
|
97
|
+
scrollMenuIfItemNotInView(menuDiv.current, "down");
|
|
98
|
+
}
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
|
|
@@ -99,15 +103,16 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
99
103
|
const [label, setLabel] = useState(defaultLabel);
|
|
100
104
|
const [menuVisible, setMenuVisible] = useState(false);
|
|
101
105
|
const [focused, setFocused] = useState(false);
|
|
102
|
-
const multiSelectContainer = useRef();
|
|
103
|
-
const multiSelectRef = useRef();
|
|
106
|
+
const multiSelectContainer = useRef(null);
|
|
107
|
+
const multiSelectRef = useRef(null);
|
|
104
108
|
const multiSelectClass = classnames(styles$1.multiSelect, {
|
|
105
109
|
[styles$1.active]: menuVisible,
|
|
106
110
|
[styles$1.large]: size === "large",
|
|
107
111
|
[styles$1.small]: size === "small",
|
|
108
112
|
});
|
|
109
113
|
function handleMenuVisibility() {
|
|
110
|
-
|
|
114
|
+
var _a;
|
|
115
|
+
(_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
111
116
|
setMenuVisible(!menuVisible);
|
|
112
117
|
}
|
|
113
118
|
const handleClickOutside = (e) => {
|
|
@@ -117,6 +122,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
117
122
|
}
|
|
118
123
|
};
|
|
119
124
|
function handleKeydown(event) {
|
|
125
|
+
var _a;
|
|
120
126
|
const { key, metaKey, ctrlKey } = event;
|
|
121
127
|
if (metaKey || ctrlKey)
|
|
122
128
|
return;
|
|
@@ -129,7 +135,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
|
|
|
129
135
|
break;
|
|
130
136
|
}
|
|
131
137
|
case "Escape": {
|
|
132
|
-
multiSelectRef.current.focus();
|
|
138
|
+
(_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
133
139
|
setMenuVisible(false);
|
|
134
140
|
break;
|
|
135
141
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import type { RadioOptionProps } from "./RadioOption";
|
|
3
4
|
export interface RadioGroupProps {
|
|
4
|
-
readonly children: ReactElement | ReactElement[];
|
|
5
|
+
readonly children: ReactElement<RadioOptionProps> | ReactElement<RadioOptionProps>[];
|
|
5
6
|
/**
|
|
6
7
|
* Defines the default value that will be pre-selected in the radio group.
|
|
7
8
|
*/
|
|
@@ -33,7 +33,7 @@ interface WithRequiredChildren extends BaseRadioOptionProps {
|
|
|
33
33
|
interface WithRequiredLabel extends BaseRadioOptionProps {
|
|
34
34
|
readonly label: string;
|
|
35
35
|
}
|
|
36
|
-
type RadioOptionProps = XOR<WithRequiredChildren, WithRequiredLabel>;
|
|
36
|
+
export type RadioOptionProps = XOR<WithRequiredChildren, WithRequiredLabel>;
|
|
37
37
|
/**
|
|
38
38
|
* For rendering props only. To make updates to
|
|
39
39
|
* the real RadioOption, look at InternalRadioOption
|
|
@@ -9,12 +9,12 @@ require('classnames');
|
|
|
9
9
|
require('../Select/index.cjs');
|
|
10
10
|
require('../omit-cjs.js');
|
|
11
11
|
require('../_commonjsHelpers-cjs.js');
|
|
12
|
-
require('../
|
|
12
|
+
require('../_getAllKeys-cjs.js');
|
|
13
13
|
require('../isTypedArray-cjs.js');
|
|
14
14
|
require('../isObjectLike-cjs.js');
|
|
15
|
+
require('../isSymbol-cjs.js');
|
|
15
16
|
require('../identity-cjs.js');
|
|
16
17
|
require('../_getTag-cjs.js');
|
|
17
|
-
require('../isSymbol-cjs.js');
|
|
18
18
|
require('../keysIn-cjs.js');
|
|
19
19
|
require('../_baseAssignValue-cjs.js');
|
|
20
20
|
require('../_baseFlatten-cjs.js');
|
|
@@ -31,6 +31,7 @@ require('../useFormFieldFocus-cjs.js');
|
|
|
31
31
|
require('../InputValidation-cjs.js');
|
|
32
32
|
require('../Spinner-cjs.js');
|
|
33
33
|
require('react-hook-form');
|
|
34
|
+
require('../filterDataAttributes-cjs.js');
|
|
34
35
|
require('../InputNumber/index.cjs');
|
|
35
36
|
require('../Tree-cjs.js');
|
|
36
37
|
require('react-dom');
|
|
@@ -7,12 +7,12 @@ import 'classnames';
|
|
|
7
7
|
import '../Select/index.mjs';
|
|
8
8
|
import '../omit-es.js';
|
|
9
9
|
import '../_commonjsHelpers-es.js';
|
|
10
|
-
import '../
|
|
10
|
+
import '../_getAllKeys-es.js';
|
|
11
11
|
import '../isTypedArray-es.js';
|
|
12
12
|
import '../isObjectLike-es.js';
|
|
13
|
+
import '../isSymbol-es.js';
|
|
13
14
|
import '../identity-es.js';
|
|
14
15
|
import '../_getTag-es.js';
|
|
15
|
-
import '../isSymbol-es.js';
|
|
16
16
|
import '../keysIn-es.js';
|
|
17
17
|
import '../_baseAssignValue-es.js';
|
|
18
18
|
import '../_baseFlatten-es.js';
|
|
@@ -29,6 +29,7 @@ import '../useFormFieldFocus-es.js';
|
|
|
29
29
|
import '../InputValidation-es.js';
|
|
30
30
|
import '../Spinner-es.js';
|
|
31
31
|
import 'react-hook-form';
|
|
32
|
+
import '../filterDataAttributes-es.js';
|
|
32
33
|
import '../InputNumber/index.mjs';
|
|
33
34
|
import '../Tree-es.js';
|
|
34
35
|
import 'react-dom';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
|
|
2
|
+
import type { FocusEvents, HTMLInputBaseProps, RebuiltInputCommonProps } from "../sharedHelpers/types";
|
|
2
3
|
export interface SelectLegacyProps extends Pick<CommonFormFieldProps, "id" | "align" | "description" | "disabled" | "invalid" | "inline" | "name" | "onValidation" | "placeholder" | "size" | "value" | "onChange">, Pick<FormFieldProps, "autofocus" | "onEnter" | "onBlur" | "onFocus" | "inputRef" | "wrapperRef" | "validations" | "children" | "prefix" | "suffix" | "defaultValue" | "version"> {
|
|
3
4
|
/**
|
|
4
5
|
* Changes the width to roughly the same size as the maximum character length
|
|
@@ -8,12 +9,15 @@ export interface SelectLegacyProps extends Pick<CommonFormFieldProps, "id" | "al
|
|
|
8
9
|
/**
|
|
9
10
|
* Rebuilt version of the Select component without React Hook Form dependency.
|
|
10
11
|
*/
|
|
11
|
-
export interface SelectRebuiltProps extends Omit<
|
|
12
|
+
export interface SelectRebuiltProps extends Omit<HTMLInputBaseProps, "readOnly">, FocusEvents<HTMLSelectElement>, Omit<RebuiltInputCommonProps, "clearable" | "prefix" | "suffix" | "align">, Pick<SelectLegacyProps, "prefix" | "suffix" | "align" | "children"> {
|
|
12
13
|
defaultValue?: never;
|
|
13
14
|
readonly value?: string | number;
|
|
14
15
|
onChange?(newValue?: string | number): void;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
readonly inputRef?: FormFieldProps["inputRef"];
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `onKeyDown` or `onKeyUp` instead.
|
|
19
|
+
*/
|
|
20
|
+
readonly onEnter?: FormFieldProps["onEnter"];
|
|
17
21
|
/**
|
|
18
22
|
* Opt-in to the customizable select UI (Chromium 123+).
|
|
19
23
|
* When true, the component will apply the custom select styles
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ChangeEvent } from "react";
|
|
1
|
+
import type { ChangeEvent, FocusEvent } from "react";
|
|
2
2
|
interface UseSelectActionsProps {
|
|
3
3
|
readonly onChange?: (newValue: string | number, event?: ChangeEvent<HTMLSelectElement>) => void;
|
|
4
|
-
readonly onBlur?: () => void;
|
|
5
|
-
readonly onFocus?: () => void;
|
|
4
|
+
readonly onBlur?: (event: FocusEvent<HTMLSelectElement>) => void;
|
|
5
|
+
readonly onFocus?: (event: FocusEvent<HTMLSelectElement>) => void;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Hook with actions on the Select component.
|
|
9
9
|
*/
|
|
10
10
|
export declare function useSelectActions({ onChange, onBlur, onFocus, }: UseSelectActionsProps): {
|
|
11
11
|
handleChange: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
12
|
-
handleBlur: () => void;
|
|
13
|
-
handleFocus: () => void;
|
|
12
|
+
handleBlur: (event: FocusEvent<HTMLSelectElement>) => void;
|
|
13
|
+
handleFocus: (event: FocusEvent<HTMLSelectElement>) => void;
|
|
14
14
|
};
|
|
15
15
|
export {};
|