@basic-ui/core 0.0.40 → 0.0.41
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/build/cjs/index.js.map +1 -1
- package/build/esm/Accordion/Accordion.d.ts +7 -7
- package/build/esm/Accordion/Accordion.js +0 -1
- package/build/esm/Accordion/Accordion.js.map +1 -1
- package/build/esm/Accordion/AccordionBody.d.ts +5 -5
- package/build/esm/Accordion/AccordionBody.js +0 -1
- package/build/esm/Accordion/AccordionBody.js.map +1 -1
- package/build/esm/Accordion/AccordionHeader.d.ts +6 -6
- package/build/esm/Accordion/AccordionHeader.js +0 -1
- package/build/esm/Accordion/AccordionHeader.js.map +1 -1
- package/build/esm/Accordion/AccordionItem.d.ts +7 -7
- package/build/esm/Accordion/AccordionItem.js +0 -1
- package/build/esm/Accordion/AccordionItem.js.map +1 -1
- package/build/esm/Accordion/context.d.ts +3 -3
- package/build/esm/Accordion/context.js +0 -0
- package/build/esm/Accordion/context.js.map +1 -1
- package/build/esm/Accordion/index.js +0 -0
- package/build/esm/Accordion/scopeQuery.js +0 -0
- package/build/esm/CheckBox/CheckBox.d.ts +6 -6
- package/build/esm/CheckBox/CheckBox.js +0 -1
- package/build/esm/CheckBox/CheckBox.js.map +1 -1
- package/build/esm/CheckBox/index.js +0 -0
- package/build/esm/ComboBox/Combobox.d.ts +10 -10
- package/build/esm/ComboBox/Combobox.js +0 -1
- package/build/esm/ComboBox/Combobox.js.map +1 -1
- package/build/esm/ComboBox/ComboboxButton.d.ts +8 -8
- package/build/esm/ComboBox/ComboboxButton.js +0 -1
- package/build/esm/ComboBox/ComboboxButton.js.map +1 -1
- package/build/esm/ComboBox/ComboboxInput.d.ts +10 -10
- package/build/esm/ComboBox/ComboboxInput.js +0 -1
- package/build/esm/ComboBox/ComboboxInput.js.map +1 -1
- package/build/esm/ComboBox/ComboboxLabel.d.ts +5 -5
- package/build/esm/ComboBox/ComboboxLabel.js +0 -1
- package/build/esm/ComboBox/ComboboxLabel.js.map +1 -1
- package/build/esm/ComboBox/ComboboxList.d.ts +6 -6
- package/build/esm/ComboBox/ComboboxList.js +0 -1
- package/build/esm/ComboBox/ComboboxList.js.map +1 -1
- package/build/esm/ComboBox/ComboboxOption.d.ts +7 -7
- package/build/esm/ComboBox/ComboboxOption.js +0 -1
- package/build/esm/ComboBox/ComboboxOption.js.map +1 -1
- package/build/esm/ComboBox/ComboboxPopover.d.ts +8 -8
- package/build/esm/ComboBox/ComboboxPopover.js +0 -1
- package/build/esm/ComboBox/ComboboxPopover.js.map +1 -1
- package/build/esm/ComboBox/cities.js +0 -0
- package/build/esm/ComboBox/context.d.ts +10 -10
- package/build/esm/ComboBox/context.js +0 -0
- package/build/esm/ComboBox/context.js.map +1 -1
- package/build/esm/ComboBox/hooks.d.ts +3 -3
- package/build/esm/ComboBox/hooks.js +0 -0
- package/build/esm/ComboBox/hooks.js.map +1 -1
- package/build/esm/ComboBox/index.js +0 -0
- package/build/esm/ComboBox/makeHash.js +0 -0
- package/build/esm/ComboBox/scopeQuery.js +0 -0
- package/build/esm/FocusLock/FocusLock.d.ts +7 -7
- package/build/esm/FocusLock/FocusLock.js +0 -1
- package/build/esm/FocusLock/FocusLock.js.map +1 -1
- package/build/esm/FocusLock/index.js +0 -0
- package/build/esm/FocusLock/tabUtils.js +0 -0
- package/build/esm/FocusLock/useFocusLock.d.ts +4 -4
- package/build/esm/FocusLock/useFocusLock.js +0 -0
- package/build/esm/FocusLock/useFocusLock.js.map +1 -1
- package/build/esm/List/List.d.ts +6 -6
- package/build/esm/List/List.js +0 -1
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/List/ListItem.d.ts +6 -6
- package/build/esm/List/ListItem.js +0 -1
- package/build/esm/List/ListItem.js.map +1 -1
- package/build/esm/List/context.js +0 -0
- package/build/esm/List/index.js +0 -0
- package/build/esm/Menu/Menu.d.ts +6 -6
- package/build/esm/Menu/Menu.js +0 -1
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/Menu/MenuButton.d.ts +10 -10
- package/build/esm/Menu/MenuButton.js +0 -1
- package/build/esm/Menu/MenuButton.js.map +1 -1
- package/build/esm/Menu/MenuItem.d.ts +6 -6
- package/build/esm/Menu/MenuItem.js +0 -1
- package/build/esm/Menu/MenuItem.js.map +1 -1
- package/build/esm/Menu/MenuList.d.ts +5 -5
- package/build/esm/Menu/MenuList.js +0 -1
- package/build/esm/Menu/MenuList.js.map +1 -1
- package/build/esm/Menu/MenuPopover.d.ts +5 -5
- package/build/esm/Menu/MenuPopover.js +0 -1
- package/build/esm/Menu/MenuPopover.js.map +1 -1
- package/build/esm/Menu/context.d.ts +2 -2
- package/build/esm/Menu/context.js +0 -0
- package/build/esm/Menu/context.js.map +1 -1
- package/build/esm/Menu/index.js +0 -0
- package/build/esm/Menu/scope.js +0 -0
- package/build/esm/Modal/Modal.d.ts +6 -7
- package/build/esm/Modal/Modal.js +0 -1
- package/build/esm/Modal/Modal.js.map +1 -1
- package/build/esm/Modal/ModalBackdrop.d.ts +6 -6
- package/build/esm/Modal/ModalBackdrop.js +0 -1
- package/build/esm/Modal/ModalBackdrop.js.map +1 -1
- package/build/esm/Modal/index.js +0 -0
- package/build/esm/Popper/Popper.d.ts +7 -7
- package/build/esm/Popper/Popper.js +0 -1
- package/build/esm/Popper/Popper.js.map +1 -1
- package/build/esm/Popper/PopperArrow.d.ts +5 -5
- package/build/esm/Popper/PopperArrow.js +0 -1
- package/build/esm/Popper/PopperArrow.js.map +1 -1
- package/build/esm/Popper/context.js +0 -0
- package/build/esm/Popper/index.js +0 -0
- package/build/esm/Portal/Portal.js +0 -0
- package/build/esm/Portal/index.js +0 -0
- package/build/esm/RadioButton/RadioButton.d.ts +6 -6
- package/build/esm/RadioButton/RadioButton.js +0 -1
- package/build/esm/RadioButton/RadioButton.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +7 -7
- package/build/esm/RadioButton/RadioGroup.js +0 -1
- package/build/esm/RadioButton/RadioGroup.js.map +1 -1
- package/build/esm/RadioButton/context.d.ts +2 -2
- package/build/esm/RadioButton/context.js +0 -0
- package/build/esm/RadioButton/context.js.map +1 -1
- package/build/esm/RadioButton/index.js +0 -0
- package/build/esm/SkipNav/SkipNav.d.ts +6 -6
- package/build/esm/SkipNav/SkipNav.js +0 -1
- package/build/esm/SkipNav/SkipNav.js.map +1 -1
- package/build/esm/SkipNav/index.js +0 -0
- package/build/esm/Spinner/Spinner.d.ts +7 -7
- package/build/esm/Spinner/Spinner.js +0 -1
- package/build/esm/Spinner/Spinner.js.map +1 -1
- package/build/esm/Spinner/SpinnerButton.d.ts +6 -6
- package/build/esm/Spinner/SpinnerButton.js +0 -1
- package/build/esm/Spinner/SpinnerButton.js.map +1 -1
- package/build/esm/Spinner/context.d.ts +2 -2
- package/build/esm/Spinner/context.js +0 -0
- package/build/esm/Spinner/context.js.map +1 -1
- package/build/esm/Spinner/index.js +0 -0
- package/build/esm/Tabs/Tab.d.ts +6 -6
- package/build/esm/Tabs/Tab.js +0 -1
- package/build/esm/Tabs/Tab.js.map +1 -1
- package/build/esm/Tabs/TabList.d.ts +6 -6
- package/build/esm/Tabs/TabList.js +0 -1
- package/build/esm/Tabs/TabList.js.map +1 -1
- package/build/esm/Tabs/TabPanel.d.ts +6 -6
- package/build/esm/Tabs/TabPanel.js +0 -1
- package/build/esm/Tabs/TabPanel.js.map +1 -1
- package/build/esm/Tabs/TabPanels.d.ts +5 -5
- package/build/esm/Tabs/TabPanels.js +0 -1
- package/build/esm/Tabs/TabPanels.js.map +1 -1
- package/build/esm/Tabs/Tabs.d.ts +6 -6
- package/build/esm/Tabs/Tabs.js +0 -1
- package/build/esm/Tabs/Tabs.js.map +1 -1
- package/build/esm/Tabs/context.d.ts +2 -2
- package/build/esm/Tabs/context.js +0 -0
- package/build/esm/Tabs/context.js.map +1 -1
- package/build/esm/Tabs/index.js +0 -0
- package/build/esm/Tabs/scopeQuery.js +0 -0
- package/build/esm/Tooltip/Tooltip.d.ts +7 -8
- package/build/esm/Tooltip/Tooltip.js +1 -1
- package/build/esm/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/Tooltip/index.js +0 -0
- package/build/esm/Tooltip/stateMachine.js +0 -0
- package/build/esm/Tooltip/useTooltip.d.ts +7 -7
- package/build/esm/Tooltip/useTooltip.js +0 -0
- package/build/esm/Tooltip/useTooltip.js.map +1 -1
- package/build/esm/hooks/index.js +0 -0
- package/build/esm/hooks/useAutoFocus.d.ts +2 -2
- package/build/esm/hooks/useAutoFocus.js +0 -0
- package/build/esm/hooks/useAutoFocus.js.map +1 -1
- package/build/esm/hooks/useChildrenCounter.js +0 -0
- package/build/esm/hooks/useControlledState.d.ts +2 -6
- package/build/esm/hooks/useControlledState.js +0 -0
- package/build/esm/hooks/useControlledState.js.map +1 -1
- package/build/esm/hooks/useFocusReturn.js +0 -0
- package/build/esm/hooks/useFocusState.d.ts +3 -3
- package/build/esm/hooks/useFocusState.js +0 -0
- package/build/esm/hooks/useFocusState.js.map +1 -1
- package/build/esm/hooks/useGestureHandlers.d.ts +5 -5
- package/build/esm/hooks/useGestureHandlers.js +0 -0
- package/build/esm/hooks/useGestureHandlers.js.map +1 -1
- package/build/esm/hooks/useMeasure.d.ts +2 -2
- package/build/esm/hooks/useMeasure.js +0 -0
- package/build/esm/hooks/useMeasure.js.map +1 -1
- package/build/esm/hooks/useOnClickOutside.d.ts +2 -2
- package/build/esm/hooks/useOnClickOutside.js +0 -0
- package/build/esm/hooks/useOnClickOutside.js.map +1 -1
- package/build/esm/hooks/useOnKeyDown.js +0 -0
- package/build/esm/hooks/useReducerMachine.js +0 -0
- package/build/esm/hooks/useRemoveBodyScroll.js +0 -0
- package/build/esm/hooks/useScope.js +0 -0
- package/build/esm/hooks/useThrottle.js +0 -0
- package/build/esm/index.js +0 -0
- package/build/esm/utils/assignRef.js +0 -0
- package/build/esm/utils/clamp.js +0 -0
- package/build/esm/utils/createSubscription.js +0 -0
- package/build/esm/utils/getCircularIndex.js +0 -0
- package/build/esm/utils/index.js +0 -0
- package/build/esm/utils/rubberBandClamp.js +0 -0
- package/build/esm/utils/wrapEvent.d.ts +3 -3
- package/build/esm/utils/wrapEvent.js +0 -0
- package/build/esm/utils/wrapEvent.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Accordion/Accordion.tsx +12 -6
- package/src/Accordion/AccordionBody.tsx +4 -5
- package/src/Accordion/AccordionHeader.tsx +30 -27
- package/src/Accordion/AccordionItem.tsx +12 -6
- package/src/Accordion/context.ts +3 -2
- package/src/CheckBox/CheckBox.tsx +5 -6
- package/src/ComboBox/ComboBox.story.tsx +3 -3
- package/src/ComboBox/Combobox.tsx +5 -8
- package/src/ComboBox/ComboboxButton.tsx +13 -7
- package/src/ComboBox/ComboboxInput.tsx +18 -10
- package/src/ComboBox/ComboboxLabel.tsx +4 -4
- package/src/ComboBox/ComboboxList.tsx +5 -6
- package/src/ComboBox/ComboboxOption.tsx +11 -7
- package/src/ComboBox/ComboboxPopover.tsx +13 -8
- package/src/ComboBox/context.ts +10 -9
- package/src/ComboBox/hooks.tsx +3 -2
- package/src/FocusLock/FocusLock.tsx +13 -7
- package/src/FocusLock/useFocusLock.ts +4 -3
- package/src/List/List.tsx +5 -5
- package/src/List/ListItem.tsx +5 -5
- package/src/Menu/Menu.story.tsx +2 -2
- package/src/Menu/Menu.tsx +13 -7
- package/src/Menu/MenuButton.tsx +12 -9
- package/src/Menu/MenuItem.tsx +14 -10
- package/src/Menu/MenuList.tsx +5 -5
- package/src/Menu/MenuPopover.tsx +4 -4
- package/src/Menu/context.ts +9 -4
- package/src/Modal/Modal.tsx +10 -6
- package/src/Modal/ModalBackdrop.tsx +14 -9
- package/src/Popper/Popper.tsx +6 -6
- package/src/Popper/PopperArrow.tsx +4 -4
- package/src/RadioButton/RadioButton.tsx +11 -6
- package/src/RadioButton/RadioGroup.tsx +11 -9
- package/src/RadioButton/context.ts +2 -4
- package/src/SkipNav/SkipNav.tsx +5 -5
- package/src/Spinner/Spinner.tsx +13 -9
- package/src/Spinner/SpinnerButton.tsx +11 -6
- package/src/Spinner/context.ts +2 -3
- package/src/Tabs/Tab.tsx +13 -8
- package/src/Tabs/TabList.tsx +5 -5
- package/src/Tabs/TabPanel.tsx +5 -5
- package/src/Tabs/TabPanels.tsx +4 -4
- package/src/Tabs/Tabs.tsx +5 -7
- package/src/Tabs/context.ts +2 -3
- package/src/Tooltip/Tooltip.story.tsx +1 -1
- package/src/Tooltip/Tooltip.tsx +13 -7
- package/src/Tooltip/useTooltip.ts +15 -9
- package/src/hooks/useAutoFocus.ts +2 -1
- package/src/hooks/useControlledState.ts +4 -7
- package/src/hooks/useFocusState.ts +3 -2
- package/src/hooks/useGestureHandlers.ts +11 -7
- package/src/hooks/useMeasure.ts +2 -1
- package/src/hooks/useOnClickOutside.ts +2 -2
- package/src/utils/wrapEvent.ts +4 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode, ElementType } from 'react';
|
|
1
2
|
import { forwardRef, useRef, useMemo, useId } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ActionTypes } from './hooks';
|
|
5
5
|
import { stateChart, comboboxReducer, isVisible, INIT } from './hooks';
|
|
@@ -15,16 +15,13 @@ export type SelectEventHandler = (
|
|
|
15
15
|
obj: any
|
|
16
16
|
) => void;
|
|
17
17
|
|
|
18
|
-
export type ComboboxProps = Omit<
|
|
19
|
-
React.HTMLAttributes<HTMLDivElement>,
|
|
20
|
-
'onSelect'
|
|
21
|
-
> & {
|
|
18
|
+
export type ComboboxProps = Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> & {
|
|
22
19
|
onSelect?: SelectEventHandler;
|
|
23
20
|
openOnFocus?: boolean;
|
|
24
21
|
selectOnBlur?: boolean;
|
|
25
|
-
children?:
|
|
26
|
-
as?:
|
|
27
|
-
innerAs?:
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
as?: ElementType<any>;
|
|
24
|
+
innerAs?: ElementType<any>;
|
|
28
25
|
};
|
|
29
26
|
|
|
30
27
|
export const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ButtonHTMLAttributes,
|
|
3
|
+
ElementType,
|
|
4
|
+
KeyboardEventHandler,
|
|
5
|
+
MouseEventHandler,
|
|
6
|
+
ReactNode,
|
|
7
|
+
} from 'react';
|
|
1
8
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
9
|
|
|
4
10
|
import { useComboBoxContext } from './context';
|
|
5
11
|
import { useKeyDown, IDLE, OPEN_WITH_BUTTON, CLOSE_WITH_BUTTON } from './hooks';
|
|
@@ -7,12 +13,12 @@ import { wrapEvent } from '../utils/wrapEvent';
|
|
|
7
13
|
import { assignMultipleRefs } from '../utils/assignRef';
|
|
8
14
|
|
|
9
15
|
export interface ComboboxButtonProps
|
|
10
|
-
extends
|
|
11
|
-
as?:
|
|
12
|
-
innerAs?:
|
|
13
|
-
onClick?:
|
|
14
|
-
onKeyDown?:
|
|
15
|
-
children?:
|
|
16
|
+
extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
+
as?: ElementType<any>;
|
|
18
|
+
innerAs?: ElementType<any>;
|
|
19
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
20
|
+
onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
|
|
21
|
+
children?: ReactNode;
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export const ComboboxButton = forwardRef<
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ChangeEvent,
|
|
3
|
+
ChangeEventHandler,
|
|
4
|
+
ElementType,
|
|
5
|
+
FocusEventHandler,
|
|
6
|
+
InputHTMLAttributes,
|
|
7
|
+
KeyboardEventHandler,
|
|
8
|
+
MouseEventHandler,
|
|
9
|
+
} from 'react';
|
|
1
10
|
import { forwardRef, useEffect, useRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
11
|
|
|
4
12
|
import {
|
|
5
13
|
useBlur,
|
|
@@ -16,7 +24,7 @@ import { assignMultipleRefs, wrapEvent } from '../utils';
|
|
|
16
24
|
import { useComboBoxContext } from './context';
|
|
17
25
|
|
|
18
26
|
export interface ComboboxInputProps
|
|
19
|
-
extends
|
|
27
|
+
extends InputHTMLAttributes<HTMLInputElement> {
|
|
20
28
|
// clear on ESC
|
|
21
29
|
clearOnEscape?: boolean;
|
|
22
30
|
// highlights all the text in the box on click when true
|
|
@@ -27,13 +35,13 @@ export interface ComboboxInputProps
|
|
|
27
35
|
defaultValue?: string;
|
|
28
36
|
// value for controlled mode
|
|
29
37
|
value?: string;
|
|
30
|
-
onClick?:
|
|
31
|
-
onChange?:
|
|
32
|
-
onKeyDown?:
|
|
33
|
-
onBlur?:
|
|
34
|
-
onFocus?:
|
|
35
|
-
as?:
|
|
36
|
-
innerAs?:
|
|
38
|
+
onClick?: MouseEventHandler<HTMLInputElement>;
|
|
39
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
40
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
41
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
42
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
43
|
+
as?: ElementType<any>;
|
|
44
|
+
innerAs?: ElementType<any>;
|
|
37
45
|
id?: string;
|
|
38
46
|
}
|
|
39
47
|
|
|
@@ -96,7 +104,7 @@ export const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(
|
|
|
96
104
|
// [*]... and when controlled, we don't trigger handleValueChange as the user
|
|
97
105
|
// types, instead the developer controls it with the normal input onChange
|
|
98
106
|
// prop
|
|
99
|
-
const handleChange = (e:
|
|
107
|
+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
100
108
|
// After the user started typing, lets forget the defaultValue
|
|
101
109
|
hasStartedInteracting.current = true;
|
|
102
110
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { ElementType, LabelHTMLAttributes } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import { useComboBoxContext } from './context';
|
|
5
5
|
|
|
6
6
|
export interface ComboboxLabelProps
|
|
7
|
-
extends
|
|
8
|
-
as?:
|
|
9
|
-
innerAs?:
|
|
7
|
+
extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
8
|
+
as?: ElementType<any>;
|
|
9
|
+
innerAs?: ElementType<any>;
|
|
10
10
|
id?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes, ElementType, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef, useRef, useEffect } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import { useComboBoxContext } from './context';
|
|
5
5
|
import { getScope } from '../hooks';
|
|
6
6
|
import { assignMultipleRefs } from '../utils';
|
|
7
7
|
|
|
8
|
-
export interface ComboboxListProps
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
innerAs?: React.ElementType<any>;
|
|
8
|
+
export interface ComboboxListProps extends HTMLAttributes<HTMLUListElement> {
|
|
9
|
+
as?: ElementType<any>;
|
|
10
|
+
innerAs?: ElementType<any>;
|
|
12
11
|
persistSelection?: boolean;
|
|
13
|
-
children?:
|
|
12
|
+
children?: ReactNode;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export const ComboboxList = forwardRef<HTMLUListElement, ComboboxListProps>(
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
|
+
import type {
|
|
3
|
+
ElementType,
|
|
4
|
+
LiHTMLAttributes,
|
|
5
|
+
MouseEventHandler,
|
|
6
|
+
ReactNode,
|
|
7
|
+
} from 'react';
|
|
2
8
|
import { forwardRef, useEffect, useRef } from 'react';
|
|
3
|
-
import * as React from 'react';
|
|
4
9
|
|
|
5
10
|
import { SELECT_WITH_CLICK, CLEAR_SELECTION } from './hooks';
|
|
6
11
|
import { wrapEvent } from '../utils/wrapEvent';
|
|
7
12
|
import { useComboBoxContext } from './context';
|
|
8
13
|
import { makeHash } from './makeHash';
|
|
9
14
|
|
|
10
|
-
export interface ComboboxOptionProps
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
innerAs?: React.ElementType<any>;
|
|
15
|
+
export interface ComboboxOptionProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
16
|
+
as?: ElementType<any>;
|
|
17
|
+
innerAs?: ElementType<any>;
|
|
14
18
|
id: string;
|
|
15
19
|
value: any;
|
|
16
20
|
text?: string;
|
|
17
|
-
onClick?:
|
|
18
|
-
children?:
|
|
21
|
+
onClick?: MouseEventHandler<HTMLLIElement>;
|
|
22
|
+
children?: ReactNode;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
export const ComboboxOption = forwardRef<HTMLLIElement, ComboboxOptionProps>(
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ElementType,
|
|
3
|
+
FocusEventHandler,
|
|
4
|
+
HTMLAttributes,
|
|
5
|
+
KeyboardEventHandler,
|
|
6
|
+
ReactNode,
|
|
7
|
+
} from 'react';
|
|
1
8
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
9
|
|
|
4
10
|
import { useKeyDown, useBlur } from './hooks';
|
|
5
11
|
import { wrapEvent } from '../utils/wrapEvent';
|
|
6
12
|
import { assignMultipleRefs } from '../utils/assignRef';
|
|
7
13
|
import { useComboBoxContext } from './context';
|
|
8
14
|
|
|
9
|
-
export interface ComboboxPopoverProps
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
children?: React.ReactNode;
|
|
15
|
+
export interface ComboboxPopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
as?: ElementType<any>;
|
|
17
|
+
innerAs?: ElementType<any>;
|
|
18
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
19
|
+
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
20
|
+
children?: ReactNode;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
export const ComboboxPopover = forwardRef<HTMLDivElement, ComboboxPopoverProps>(
|
package/src/ComboBox/context.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
1
2
|
import { createContext, useContext } from 'react';
|
|
2
3
|
|
|
3
4
|
import type { ActionTypes, StateTypes, ReducerState } from './hooks';
|
|
@@ -6,11 +7,11 @@ import type { Scope } from '../hooks';
|
|
|
6
7
|
|
|
7
8
|
export interface ComboBoxContextProps {
|
|
8
9
|
data: Omit<ReducerState, 'state'>;
|
|
9
|
-
inputRef:
|
|
10
|
-
popoverRef:
|
|
11
|
-
buttonRef:
|
|
10
|
+
inputRef: MutableRefObject<HTMLInputElement | null>;
|
|
11
|
+
popoverRef: MutableRefObject<HTMLDivElement | null>;
|
|
12
|
+
buttonRef: MutableRefObject<HTMLButtonElement | null>;
|
|
12
13
|
onSelect?: SelectEventHandler;
|
|
13
|
-
optionsRef:
|
|
14
|
+
optionsRef: MutableRefObject<{
|
|
14
15
|
[itemId: string]: {
|
|
15
16
|
value: string | unknown;
|
|
16
17
|
text: string;
|
|
@@ -19,11 +20,11 @@ export interface ComboBoxContextProps {
|
|
|
19
20
|
listScope: Scope<HTMLElement>;
|
|
20
21
|
state: StateTypes;
|
|
21
22
|
transition: (action: ActionTypes, payload?: any) => void;
|
|
22
|
-
listboxIdRef:
|
|
23
|
-
labelIdRef:
|
|
24
|
-
autocompletePropRef:
|
|
25
|
-
persistSelectionRef:
|
|
26
|
-
clearOnEscapeRef:
|
|
23
|
+
listboxIdRef: MutableRefObject<string | undefined>;
|
|
24
|
+
labelIdRef: MutableRefObject<string | undefined>;
|
|
25
|
+
autocompletePropRef: MutableRefObject<boolean>;
|
|
26
|
+
persistSelectionRef: MutableRefObject<boolean>;
|
|
27
|
+
clearOnEscapeRef: MutableRefObject<boolean>;
|
|
27
28
|
isVisible: boolean;
|
|
28
29
|
openOnFocus: boolean;
|
|
29
30
|
selectOnBlur: boolean;
|
package/src/ComboBox/hooks.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
2
|
/* eslint-disable default-case */
|
|
3
|
+
import type { KeyboardEvent, MutableRefObject } from 'react';
|
|
3
4
|
import { useEffect } from 'react';
|
|
4
5
|
|
|
5
6
|
import type {
|
|
@@ -221,7 +222,7 @@ export const isVisible = (state: any) => visibleStates.indexOf(state) >= 0;
|
|
|
221
222
|
// the popup.
|
|
222
223
|
export function useFocusManagement(
|
|
223
224
|
lastActionType: ActionTypes,
|
|
224
|
-
inputRef:
|
|
225
|
+
inputRef: MutableRefObject<HTMLInputElement | null>
|
|
225
226
|
) {
|
|
226
227
|
// useEffect so that the cursor goes to the end of the input instead
|
|
227
228
|
// of awkwardly at the beginning, unclear to me why ...
|
|
@@ -289,7 +290,7 @@ export function useKeyDown() {
|
|
|
289
290
|
listScope,
|
|
290
291
|
} = useComboBoxContext();
|
|
291
292
|
|
|
292
|
-
return function handleKeyDown(event:
|
|
293
|
+
return function handleKeyDown(event: KeyboardEvent<any>) {
|
|
293
294
|
const optionNodes = listScope.current.queryAllNodes(scopeQuery);
|
|
294
295
|
|
|
295
296
|
switch (event.key) {
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ElementType,
|
|
3
|
+
FC,
|
|
4
|
+
HTMLAttributes,
|
|
5
|
+
MutableRefObject,
|
|
6
|
+
ReactNode,
|
|
7
|
+
} from 'react';
|
|
1
8
|
import { useRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
9
|
|
|
4
10
|
import { useFocusLock } from './useFocusLock';
|
|
5
11
|
|
|
6
|
-
export interface FocusLockProps extends
|
|
7
|
-
as?:
|
|
8
|
-
innerAs?:
|
|
9
|
-
children?:
|
|
10
|
-
childRef:
|
|
12
|
+
export interface FocusLockProps extends HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
as?: ElementType<any>;
|
|
14
|
+
innerAs?: ElementType<any>;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
childRef: MutableRefObject<HTMLElement | null>;
|
|
11
17
|
enabled?: boolean;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
|
-
export const FocusLock:
|
|
20
|
+
export const FocusLock: FC<FocusLockProps> = function FocusLock(props) {
|
|
15
21
|
const {
|
|
16
22
|
as: Comp = 'div',
|
|
17
23
|
childRef,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
1
2
|
import { useEffect } from 'react';
|
|
2
3
|
|
|
3
4
|
import { focusOnChildNode } from './tabUtils';
|
|
4
5
|
|
|
5
6
|
export interface FocusLockOptions {
|
|
6
7
|
enabled: boolean;
|
|
7
|
-
lockStartRef:
|
|
8
|
-
lockEndRef:
|
|
8
|
+
lockStartRef: MutableRefObject<HTMLElement | null>;
|
|
9
|
+
lockEndRef: MutableRefObject<HTMLElement | null>;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const focusLockStack: HTMLElement[] = [];
|
|
12
13
|
export function useFocusLock(
|
|
13
|
-
ref:
|
|
14
|
+
ref: MutableRefObject<HTMLElement | null>,
|
|
14
15
|
opts: FocusLockOptions
|
|
15
16
|
) {
|
|
16
17
|
const { enabled = true, lockStartRef, lockEndRef } = opts;
|
package/src/List/List.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
export interface ListProps extends
|
|
5
|
-
as?:
|
|
6
|
-
innerAs?:
|
|
7
|
-
children?:
|
|
4
|
+
export interface ListProps extends HTMLAttributes<HTMLUListElement> {
|
|
5
|
+
as?: ElementType<any>;
|
|
6
|
+
innerAs?: ElementType<any>;
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const List = forwardRef<HTMLUListElement, ListProps>(function List(
|
package/src/List/ListItem.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
export interface ListItemProps extends
|
|
5
|
-
as?:
|
|
6
|
-
innerAs?:
|
|
7
|
-
children?:
|
|
4
|
+
export interface ListItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
5
|
+
as?: ElementType<any>;
|
|
6
|
+
innerAs?: ElementType<any>;
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const ListItem = forwardRef<HTMLLIElement, ListItemProps>(
|
package/src/Menu/Menu.story.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { MouseEvent } from 'react';
|
|
1
2
|
import { useState } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { animated, useSpring } from 'react-spring';
|
|
4
4
|
|
|
5
5
|
import { Menu, MenuButton, MenuItem, MenuList, MenuPopover } from './';
|
|
@@ -14,7 +14,7 @@ const noop = () => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const Wrapper = ({ children }) => {
|
|
17
|
-
const handleLinkClick = (e:
|
|
17
|
+
const handleLinkClick = (e: MouseEvent<HTMLAnchorElement>) => {
|
|
18
18
|
console.log('Clicked ' + e.currentTarget.innerText);
|
|
19
19
|
e.preventDefault();
|
|
20
20
|
};
|
package/src/Menu/Menu.tsx
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
KeyboardEvent,
|
|
3
|
+
MouseEvent,
|
|
4
|
+
PointerEvent,
|
|
5
|
+
ReactNode,
|
|
6
|
+
ElementType,
|
|
7
|
+
} from 'react';
|
|
1
8
|
import { forwardRef, useRef, Fragment, useId } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
9
|
|
|
4
10
|
import type { MenuContextProps } from './context';
|
|
5
11
|
import { MenuProvider } from './context';
|
|
6
12
|
import { useControlledState } from '../hooks';
|
|
7
13
|
|
|
8
14
|
export interface MenuProps {
|
|
9
|
-
as?:
|
|
10
|
-
innerAs?:
|
|
11
|
-
children?:
|
|
15
|
+
as?: ElementType<any>;
|
|
16
|
+
innerAs?: ElementType<any>;
|
|
17
|
+
children?: ReactNode;
|
|
12
18
|
onChange?: (
|
|
13
19
|
e:
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
20
|
+
| KeyboardEvent<HTMLElement>
|
|
21
|
+
| MouseEvent<HTMLElement>
|
|
22
|
+
| PointerEvent<HTMLElement>,
|
|
17
23
|
isOpen: boolean
|
|
18
24
|
) => void;
|
|
19
25
|
open?: boolean;
|
package/src/Menu/MenuButton.tsx
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ButtonHTMLAttributes,
|
|
3
|
+
ElementType,
|
|
4
|
+
KeyboardEvent,
|
|
5
|
+
MouseEvent,
|
|
6
|
+
} from 'react';
|
|
1
7
|
import { forwardRef, useId } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
8
|
|
|
4
9
|
import { useMenuContext } from './context';
|
|
5
10
|
import { wrapEvent } from '../utils/wrapEvent';
|
|
6
11
|
|
|
7
|
-
export type MenuButtonProps =
|
|
8
|
-
as?:
|
|
9
|
-
innerAs?:
|
|
12
|
+
export type MenuButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
13
|
+
as?: ElementType<any>;
|
|
14
|
+
innerAs?: ElementType<any>;
|
|
10
15
|
onClick?: (
|
|
11
|
-
e:
|
|
12
|
-
| React.MouseEvent<HTMLButtonElement>
|
|
13
|
-
| React.KeyboardEvent<HTMLButtonElement>
|
|
16
|
+
e: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>
|
|
14
17
|
) => void;
|
|
15
18
|
};
|
|
16
19
|
|
|
@@ -30,7 +33,7 @@ export const MenuButton = forwardRef<HTMLButtonElement, MenuButtonProps>(
|
|
|
30
33
|
const buttonIdGenerated = useId();
|
|
31
34
|
const buttonId = preferredId || buttonIdGenerated;
|
|
32
35
|
|
|
33
|
-
const handleKeyDown = (e:
|
|
36
|
+
const handleKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {
|
|
34
37
|
if (disabled) {
|
|
35
38
|
return;
|
|
36
39
|
}
|
|
@@ -50,7 +53,7 @@ export const MenuButton = forwardRef<HTMLButtonElement, MenuButtonProps>(
|
|
|
50
53
|
}
|
|
51
54
|
};
|
|
52
55
|
|
|
53
|
-
const handleClick = (e:
|
|
56
|
+
const handleClick = (e: MouseEvent<HTMLButtonElement>) => {
|
|
54
57
|
if (disabled) {
|
|
55
58
|
return;
|
|
56
59
|
}
|
package/src/Menu/MenuItem.tsx
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
LiHTMLAttributes,
|
|
3
|
+
ElementType,
|
|
4
|
+
MouseEvent,
|
|
5
|
+
KeyboardEvent,
|
|
6
|
+
KeyboardEventHandler,
|
|
7
|
+
} from 'react';
|
|
1
8
|
import { forwardRef, useRef, useId } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
9
|
|
|
4
10
|
import { useMenuContext, useMenuListContext } from './context';
|
|
5
11
|
import { assignMultipleRefs } from '../utils/assignRef';
|
|
6
12
|
import { wrapEvent } from '../utils';
|
|
7
13
|
|
|
8
|
-
export interface MenuItemProps extends
|
|
9
|
-
as?:
|
|
10
|
-
innerAs?:
|
|
14
|
+
export interface MenuItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
15
|
+
as?: ElementType<any>;
|
|
16
|
+
innerAs?: ElementType<any>;
|
|
11
17
|
onSelect?: (
|
|
12
|
-
e:
|
|
18
|
+
e: MouseEvent<HTMLLIElement> | KeyboardEvent<HTMLLIElement>
|
|
13
19
|
) => void;
|
|
14
20
|
disabled?: boolean;
|
|
15
21
|
}
|
|
@@ -35,16 +41,14 @@ export const MenuItem = forwardRef<any, MenuItemProps>(function MenuItem(
|
|
|
35
41
|
|
|
36
42
|
const handleSelect = wrapEvent(
|
|
37
43
|
onSelect,
|
|
38
|
-
(
|
|
39
|
-
e: React.KeyboardEvent<HTMLLIElement> | React.MouseEvent<HTMLLIElement>
|
|
40
|
-
) => {
|
|
44
|
+
(e: KeyboardEvent<HTMLLIElement> | MouseEvent<HTMLLIElement>) => {
|
|
41
45
|
onChange && onChange(e, false);
|
|
42
46
|
buttonRef.current?.focus();
|
|
43
47
|
e.preventDefault();
|
|
44
48
|
}
|
|
45
49
|
);
|
|
46
50
|
|
|
47
|
-
const handleClick = (e:
|
|
51
|
+
const handleClick = (e: MouseEvent<HTMLLIElement>) => {
|
|
48
52
|
if (!disabled) {
|
|
49
53
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
50
54
|
onNavigate && onNavigate(ref.current!);
|
|
@@ -52,7 +56,7 @@ export const MenuItem = forwardRef<any, MenuItemProps>(function MenuItem(
|
|
|
52
56
|
}
|
|
53
57
|
};
|
|
54
58
|
|
|
55
|
-
const handleKeyDown:
|
|
59
|
+
const handleKeyDown: KeyboardEventHandler<HTMLLIElement> = (e) => {
|
|
56
60
|
switch (e.key) {
|
|
57
61
|
case 'Enter':
|
|
58
62
|
case ' ':
|
package/src/Menu/MenuList.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes, ElementType, KeyboardEvent } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
forwardRef,
|
|
3
4
|
useEffect,
|
|
@@ -5,7 +6,6 @@ import {
|
|
|
5
6
|
useState,
|
|
6
7
|
useLayoutEffect,
|
|
7
8
|
} from 'react';
|
|
8
|
-
import * as React from 'react';
|
|
9
9
|
|
|
10
10
|
import { useMenuContext, MenuListProvider } from './context';
|
|
11
11
|
import { assignMultipleRefs } from '../utils/assignRef';
|
|
@@ -17,9 +17,9 @@ import { getCircularIndex, wrapEvent } from '../utils';
|
|
|
17
17
|
const useEnhancedEffect =
|
|
18
18
|
typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
19
19
|
|
|
20
|
-
export interface MenuListProps extends
|
|
21
|
-
as?:
|
|
22
|
-
innerAs?:
|
|
20
|
+
export interface MenuListProps extends HTMLAttributes<HTMLUListElement> {
|
|
21
|
+
as?: ElementType<any>;
|
|
22
|
+
innerAs?: ElementType<any>;
|
|
23
23
|
defaultActiveItemValue?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -101,7 +101,7 @@ export const MenuList = forwardRef<HTMLUListElement, MenuListProps>(
|
|
|
101
101
|
true
|
|
102
102
|
);
|
|
103
103
|
|
|
104
|
-
function handleKeyDown(e:
|
|
104
|
+
function handleKeyDown(e: KeyboardEvent<HTMLUListElement>) {
|
|
105
105
|
switch (e.key) {
|
|
106
106
|
case 'Escape':
|
|
107
107
|
case 'Tab': {
|
package/src/Menu/MenuPopover.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import type { ElementType, ReactNode } from 'react';
|
|
1
2
|
import { forwardRef } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { PopperProps } from '../Popper';
|
|
5
5
|
import { Popper } from '../Popper';
|
|
6
6
|
import { useMenuContext } from './context';
|
|
7
7
|
|
|
8
8
|
export interface MenuPopoverProps extends Omit<PopperProps, 'anchorEl'> {
|
|
9
|
-
as?:
|
|
10
|
-
innerAs?:
|
|
11
|
-
children?:
|
|
9
|
+
as?: ElementType<any>;
|
|
10
|
+
innerAs?: ElementType<any>;
|
|
11
|
+
children?: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const MenuPopover = forwardRef<HTMLDivElement, MenuPopoverProps>(
|
package/src/Menu/context.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
KeyboardEvent,
|
|
3
|
+
MouseEvent,
|
|
4
|
+
MutableRefObject,
|
|
5
|
+
PointerEvent,
|
|
6
|
+
} from 'react';
|
|
2
7
|
import { createContext, useContext } from 'react';
|
|
3
8
|
|
|
4
9
|
export type ItemObject = { text: string; value: any; id: string | undefined };
|
|
@@ -10,9 +15,9 @@ export interface MenuContextProps {
|
|
|
10
15
|
openWithArrowKeyRef: MutableRefObject<string | null>;
|
|
11
16
|
onChange?: (
|
|
12
17
|
e:
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
18
|
+
| KeyboardEvent<HTMLElement>
|
|
19
|
+
| MouseEvent<HTMLElement>
|
|
20
|
+
| PointerEvent<HTMLElement>,
|
|
16
21
|
isOpen: boolean
|
|
17
22
|
) => void;
|
|
18
23
|
open: boolean;
|
package/src/Modal/Modal.tsx
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CSSProperties,
|
|
3
|
+
ElementType,
|
|
4
|
+
HTMLAttributes,
|
|
5
|
+
ReactNode,
|
|
6
|
+
} from 'react';
|
|
2
7
|
import { forwardRef, useRef } from 'react';
|
|
3
|
-
import * as React from 'react';
|
|
4
8
|
|
|
5
9
|
import { useAutoFocus, useFocusReturn, useRemoveBodyScroll } from '../hooks';
|
|
6
10
|
import { FocusLock } from '../FocusLock';
|
|
7
11
|
import { assignMultipleRefs } from '../utils';
|
|
8
12
|
|
|
9
|
-
export interface ModalProps extends
|
|
10
|
-
as?:
|
|
11
|
-
innerAs?:
|
|
13
|
+
export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
as?: ElementType<any>;
|
|
15
|
+
innerAs?: ElementType<any>;
|
|
12
16
|
children?: ReactNode;
|
|
13
|
-
style?:
|
|
17
|
+
style?: CSSProperties;
|
|
14
18
|
trapFocus?: boolean;
|
|
15
19
|
}
|
|
16
20
|
|