@react-md/core 6.2.1 → 6.3.1
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/_base.scss +1 -1
- package/dist/app-bar/styles.d.ts +0 -2
- package/dist/app-bar/styles.js.map +1 -1
- package/dist/autocomplete/types.d.ts +12 -0
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/avatar/Avatar.d.ts +0 -10
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/styles.d.ts +10 -0
- package/dist/avatar/styles.js.map +1 -1
- package/dist/badge/Badge.d.ts +11 -0
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/styles.d.ts +0 -8
- package/dist/badge/styles.js.map +1 -1
- package/dist/box/_box.scss +8 -8
- package/dist/box/styles.d.ts +9 -0
- package/dist/box/styles.js.map +1 -1
- package/dist/button/_button.scss +4 -0
- package/dist/button/styles.d.ts +5 -1
- package/dist/button/styles.js.map +1 -1
- package/dist/card/Card.d.ts +0 -7
- package/dist/card/Card.js.map +1 -1
- package/dist/card/styles.d.ts +6 -0
- package/dist/card/styles.js +8 -8
- package/dist/card/styles.js.map +1 -1
- package/dist/chip/Chip.d.ts +6 -13
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/styles.d.ts +26 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/datetime/NativeDateField.d.ts +24 -0
- package/dist/datetime/NativeDateField.js +63 -0
- package/dist/datetime/NativeDateField.js.map +1 -0
- package/dist/datetime/NativeTimeField.d.ts +26 -0
- package/dist/datetime/NativeTimeField.js +63 -0
- package/dist/datetime/NativeTimeField.js.map +1 -0
- package/dist/datetime/useDateField.d.ts +120 -0
- package/dist/datetime/useDateField.js +35 -0
- package/dist/datetime/useDateField.js.map +1 -0
- package/dist/datetime/useTimeField.d.ts +124 -0
- package/dist/datetime/useTimeField.js +65 -0
- package/dist/datetime/useTimeField.js.map +1 -0
- package/dist/datetime/utils.d.ts +34 -0
- package/dist/datetime/utils.js +27 -0
- package/dist/datetime/utils.js.map +1 -0
- package/dist/dialog/styles.d.ts +5 -2
- package/dist/dialog/styles.js.map +1 -1
- package/dist/divider/styles.d.ts +1 -1
- package/dist/divider/styles.js.map +1 -1
- package/dist/draggable/utils.d.ts +3 -6
- package/dist/draggable/utils.js.map +1 -1
- package/dist/error-boundary/ErrorBoundary.js.map +1 -1
- package/dist/expansion-panel/ExpansionList.js +1 -1
- package/dist/expansion-panel/ExpansionList.js.map +1 -1
- package/dist/expansion-panel/useExpansionList.d.ts +2 -7
- package/dist/expansion-panel/useExpansionList.js.map +1 -1
- package/dist/files/validation.js.map +1 -1
- package/dist/form/FormMessage.js +3 -1
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.d.ts +2 -1
- package/dist/form/FormMessageContainer.js +3 -2
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.d.ts +3 -2
- package/dist/form/FormMessageCounter.js +5 -2
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/Label.d.ts +0 -10
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Listbox.d.ts +3 -10
- package/dist/form/Listbox.js +8 -27
- package/dist/form/Listbox.js.map +1 -1
- package/dist/form/ListboxProvider.d.ts +17 -0
- package/dist/form/ListboxProvider.js +33 -1
- package/dist/form/ListboxProvider.js.map +1 -1
- package/dist/form/NativeSelect.js +1 -0
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/Slider.d.ts +4 -0
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/TextArea.js +1 -0
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.js +1 -0
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldContainer.d.ts +0 -13
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/_form-message.scss +13 -0
- package/dist/form/_select.scss +5 -1
- package/dist/form/_text-area.scss +2 -1
- package/dist/form/_text-field.scss +13 -3
- package/dist/form/formMessageContainerStyles.d.ts +7 -0
- package/dist/form/formMessageContainerStyles.js +4 -2
- package/dist/form/formMessageContainerStyles.js.map +1 -1
- package/dist/form/sliderUtils.d.ts +3 -7
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/types.d.ts +33 -0
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCombobox.d.ts +6 -2
- package/dist/form/useCombobox.js +8 -9
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useFormReset.d.ts +4 -1
- package/dist/form/useFormReset.js +9 -4
- package/dist/form/useFormReset.js.map +1 -1
- package/dist/form/useNumberField.d.ts +5 -5
- package/dist/form/useNumberField.js +10 -2
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useSelectCombobox.js +2 -2
- package/dist/form/useSelectCombobox.js.map +1 -1
- package/dist/form/useTextField.d.ts +76 -59
- package/dist/form/useTextField.js +7 -1
- package/dist/form/useTextField.js.map +1 -1
- package/dist/interaction/types.d.ts +5 -1
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/utils.d.ts +14 -0
- package/dist/interaction/utils.js +23 -12
- package/dist/interaction/utils.js.map +1 -1
- package/dist/link/Link.d.ts +0 -7
- package/dist/link/Link.js.map +1 -1
- package/dist/link/styles.d.ts +7 -0
- package/dist/link/styles.js.map +1 -1
- package/dist/list/List.d.ts +5 -20
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.d.ts +4 -38
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/listItemStyles.d.ts +24 -2
- package/dist/list/listItemStyles.js.map +1 -1
- package/dist/list/listStyles.d.ts +17 -2
- package/dist/list/listStyles.js.map +1 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.js +1 -1
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuItemTextField.d.ts +1 -2
- package/dist/menu/MenuItemTextField.js.map +1 -1
- package/dist/menu/MenuWidget.js +3 -2
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/movement/constants.d.ts +10 -0
- package/dist/movement/constants.js +20 -4
- package/dist/movement/constants.js.map +1 -1
- package/dist/movement/types.d.ts +59 -10
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.d.ts +5 -1
- package/dist/movement/useKeyboardMovementProvider.js +171 -73
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/navigation/NavItem.d.ts +4 -1
- package/dist/navigation/NavItem.js.map +1 -1
- package/dist/navigation/navItemStyles.d.ts +7 -0
- package/dist/navigation/navItemStyles.js.map +1 -1
- package/dist/overlay/Overlay.d.ts +4 -23
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/overlay/styles.d.ts +26 -8
- package/dist/overlay/styles.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +4 -9
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/circularProgressStyles.d.ts +6 -0
- package/dist/progress/circularProgressStyles.js.map +1 -1
- package/dist/progress/linearProgressStyles.d.ts +20 -5
- package/dist/progress/linearProgressStyles.js.map +1 -1
- package/dist/progress/types.d.ts +0 -9
- package/dist/progress/types.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.d.ts +7 -12
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/segmentedButtonStyles.d.ts +26 -3
- package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
- package/dist/sheet/Sheet.d.ts +0 -12
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/sheet/styles.d.ts +12 -0
- package/dist/sheet/styles.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +2 -13
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/toastStyles.d.ts +17 -2
- package/dist/snackbar/toastStyles.js.map +1 -1
- package/dist/tabs/Tab.d.ts +2 -41
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/tabStyles.d.ts +45 -4
- package/dist/tabs/tabStyles.js.map +1 -1
- package/dist/tabs/useTabList.js +1 -1
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/test-utils/drag.d.ts +6 -9
- package/dist/test-utils/mocks/IntersectionObserver.js.map +1 -1
- package/dist/test-utils/mocks/ResizeObserver.js.map +1 -1
- package/dist/test-utils/utils/createFileList.js.map +1 -1
- package/dist/theme/_theme.scss +0 -1
- package/dist/theme/getDerivedTheme.d.ts +0 -24
- package/dist/theme/getDerivedTheme.js.map +1 -1
- package/dist/theme/types.d.ts +25 -0
- package/dist/theme/types.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +4 -32
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/styles.d.ts +38 -1
- package/dist/tooltip/styles.js +1 -1
- package/dist/tooltip/styles.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.d.ts +0 -7
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/skeletonPlaceholderUtils.d.ts +7 -0
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
- package/dist/transition/useCarousel.d.ts +2 -2
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useMaxWidthTransition.d.ts +14 -2
- package/dist/transition/useMaxWidthTransition.js.map +1 -1
- package/dist/transition/useSlideTransition.d.ts +5 -0
- package/dist/transition/useSlideTransition.js.map +1 -1
- package/dist/tree/Tree.d.ts +5 -9
- package/dist/tree/Tree.js +1 -1
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/styles.d.ts +9 -1
- package/dist/tree/styles.js.map +1 -1
- package/dist/tree/useTreeMovement.d.ts +2 -1
- package/dist/tree/useTreeMovement.js +2 -1
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.js.map +1 -1
- package/dist/typography/Mark.d.ts +4 -1
- package/dist/typography/Mark.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +0 -6
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/markStyles.d.ts +5 -0
- package/dist/typography/markStyles.js.map +1 -1
- package/dist/typography/textContainerStyles.d.ts +6 -0
- package/dist/typography/textContainerStyles.js.map +1 -1
- package/dist/typography/typographyStyles.d.ts +9 -0
- package/dist/typography/typographyStyles.js.map +1 -1
- package/dist/useResizeObserver.js.map +1 -1
- package/dist/utils/getMiddleOfRange.d.ts +2 -3
- package/dist/utils/getMiddleOfRange.js.map +1 -1
- package/dist/utils/getPercentage.d.ts +2 -9
- package/dist/utils/getPercentage.js +1 -1
- package/dist/utils/getPercentage.js.map +1 -1
- package/dist/utils/getRangeSteps.d.ts +2 -3
- package/dist/utils/getRangeSteps.js +0 -3
- package/dist/utils/getRangeSteps.js.map +1 -1
- package/dist/utils/nearest.d.ts +2 -3
- package/dist/utils/nearest.js +0 -3
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/trigonometry.d.ts +31 -0
- package/dist/utils/trigonometry.js +25 -0
- package/dist/utils/trigonometry.js.map +1 -0
- package/dist/window-splitter/WindowSplitter.d.ts +5 -19
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/styles.d.ts +27 -3
- package/dist/window-splitter/styles.js.map +1 -1
- package/dist/window-splitter/useWindowSplitter.d.ts +1 -1
- package/dist/window-splitter/useWindowSplitter.js.map +1 -1
- package/package.json +8 -8
- package/src/app-bar/styles.ts +0 -2
- package/src/autocomplete/types.ts +17 -0
- package/src/avatar/Avatar.tsx +0 -11
- package/src/avatar/styles.ts +11 -0
- package/src/badge/Badge.tsx +12 -0
- package/src/badge/styles.ts +0 -9
- package/src/box/styles.ts +9 -0
- package/src/button/styles.ts +5 -1
- package/src/card/Card.tsx +0 -8
- package/src/card/styles.ts +15 -8
- package/src/chip/Chip.tsx +9 -15
- package/src/chip/styles.ts +29 -1
- package/src/datetime/NativeDateField.tsx +92 -0
- package/src/datetime/NativeTimeField.tsx +94 -0
- package/src/datetime/useDateField.ts +193 -0
- package/src/datetime/useTimeField.ts +233 -0
- package/src/datetime/utils.ts +48 -0
- package/src/dialog/styles.ts +5 -2
- package/src/divider/styles.ts +1 -1
- package/src/draggable/utils.ts +3 -6
- package/src/expansion-panel/ExpansionList.tsx +2 -1
- package/src/expansion-panel/useExpansionList.ts +6 -12
- package/src/form/FormMessage.tsx +4 -0
- package/src/form/FormMessageContainer.tsx +8 -4
- package/src/form/FormMessageCounter.tsx +17 -6
- package/src/form/InputToggle.tsx +2 -0
- package/src/form/Label.tsx +0 -11
- package/src/form/Listbox.tsx +18 -46
- package/src/form/ListboxProvider.ts +61 -1
- package/src/form/NativeSelect.tsx +1 -0
- package/src/form/Slider.tsx +6 -0
- package/src/form/Switch.tsx +2 -0
- package/src/form/TextArea.tsx +3 -0
- package/src/form/TextField.tsx +1 -0
- package/src/form/TextFieldContainer.tsx +0 -14
- package/src/form/formMessageContainerStyles.ts +10 -2
- package/src/form/sliderUtils.ts +3 -7
- package/src/form/types.ts +44 -0
- package/src/form/useCombobox.ts +15 -10
- package/src/form/useFormReset.ts +12 -5
- package/src/form/useNumberField.ts +17 -14
- package/src/form/useSelectCombobox.ts +2 -2
- package/src/form/useTextField.ts +102 -69
- package/src/interaction/types.ts +5 -1
- package/src/interaction/utils.ts +18 -20
- package/src/link/Link.tsx +0 -8
- package/src/link/styles.ts +8 -0
- package/src/list/List.tsx +7 -24
- package/src/list/ListItem.tsx +7 -43
- package/src/list/listItemStyles.ts +26 -2
- package/src/list/listStyles.ts +18 -2
- package/src/menu/Menu.tsx +2 -0
- package/src/menu/MenuBar.tsx +1 -1
- package/src/menu/MenuItemTextField.tsx +1 -3
- package/src/menu/MenuWidget.tsx +4 -2
- package/src/movement/constants.ts +26 -4
- package/src/movement/types.ts +84 -19
- package/src/movement/useKeyboardMovementProvider.ts +209 -95
- package/src/navigation/NavItem.tsx +6 -2
- package/src/navigation/navItemStyles.ts +8 -0
- package/src/overlay/Overlay.tsx +4 -26
- package/src/overlay/styles.ts +29 -10
- package/src/progress/LinearProgress.tsx +8 -10
- package/src/progress/circularProgressStyles.ts +7 -0
- package/src/progress/linearProgressStyles.ts +22 -5
- package/src/progress/types.ts +0 -10
- package/src/segmented-button/SegmentedButton.tsx +14 -15
- package/src/segmented-button/segmentedButtonStyles.ts +28 -3
- package/src/sheet/Sheet.tsx +0 -13
- package/src/sheet/styles.ts +13 -0
- package/src/snackbar/Toast.tsx +2 -15
- package/src/snackbar/toastStyles.ts +20 -2
- package/src/tabs/Tab.tsx +4 -49
- package/src/tabs/tabStyles.ts +52 -4
- package/src/tabs/useTabList.ts +1 -1
- package/src/test-utils/drag.ts +8 -12
- package/src/theme/getDerivedTheme.ts +0 -26
- package/src/theme/types.ts +26 -0
- package/src/tooltip/Tooltip.tsx +4 -36
- package/src/tooltip/styles.ts +43 -2
- package/src/transition/SkeletonPlaceholder.tsx +0 -8
- package/src/transition/Slide.tsx +2 -0
- package/src/transition/skeletonPlaceholderUtils.ts +8 -0
- package/src/transition/useCarousel.ts +2 -2
- package/src/transition/useMaxWidthTransition.ts +17 -2
- package/src/transition/useSlideTransition.ts +8 -0
- package/src/tree/Tree.tsx +6 -11
- package/src/tree/styles.ts +10 -1
- package/src/tree/useTreeMovement.ts +4 -0
- package/src/types.ts +16 -0
- package/src/typography/Mark.tsx +6 -2
- package/src/typography/TextContainer.tsx +0 -7
- package/src/typography/markStyles.ts +6 -0
- package/src/typography/textContainerStyles.ts +7 -0
- package/src/typography/typographyStyles.ts +10 -0
- package/src/utils/getMiddleOfRange.ts +2 -3
- package/src/utils/getPercentage.ts +3 -11
- package/src/utils/getRangeSteps.ts +3 -3
- package/src/utils/nearest.ts +3 -3
- package/src/utils/trigonometry.ts +46 -0
- package/src/window-splitter/WindowSplitter.tsx +9 -22
- package/src/window-splitter/styles.ts +31 -3
- package/src/window-splitter/useWindowSplitter.ts +3 -2
package/src/tooltip/Tooltip.tsx
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { type HTMLAttributes, forwardRef } from "react";
|
|
4
4
|
|
|
5
|
-
import { type TextOverflow } from "../cssUtils.js";
|
|
6
5
|
import { Portal } from "../portal/Portal.js";
|
|
7
|
-
import { type SimplePosition } from "../positioning/types.js";
|
|
8
6
|
import {
|
|
9
7
|
type CSSTransitionClassNames,
|
|
10
8
|
type CSSTransitionComponentProps,
|
|
@@ -19,15 +17,7 @@ import {
|
|
|
19
17
|
DEFAULT_TOOLTIP_POSITION,
|
|
20
18
|
DEFAULT_TOOLTIP_TIMEOUT,
|
|
21
19
|
} from "./constants.js";
|
|
22
|
-
import { tooltip } from "./styles.js";
|
|
23
|
-
|
|
24
|
-
declare module "react" {
|
|
25
|
-
interface CSSProperties {
|
|
26
|
-
"--rmd-tooltip-background-color"?: string;
|
|
27
|
-
"--rmd-tooltip-color"?: string;
|
|
28
|
-
"--rmd-tooltip-spacing"?: string | number;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
20
|
+
import { type TooltipClassNameOptions, tooltip } from "./styles.js";
|
|
31
21
|
|
|
32
22
|
/**
|
|
33
23
|
* The base props for the `Tooltip` component. This can be extended when
|
|
@@ -38,45 +28,23 @@ declare module "react" {
|
|
|
38
28
|
* @since 6.0.0 Removed `lineWrap` for `textOverflow`
|
|
39
29
|
* @since 6.0.0 No longer supports the `RenderConditionalPortalProps` other than
|
|
40
30
|
* `portal` with the `disablePortal` prop.
|
|
31
|
+
* @since 6.3.1 Extends TooltipClassNameOptions for CSSProperties module
|
|
32
|
+
* augmentation.
|
|
41
33
|
*/
|
|
42
34
|
export interface TooltipProps
|
|
43
35
|
extends HTMLAttributes<HTMLSpanElement>,
|
|
36
|
+
TooltipClassNameOptions,
|
|
44
37
|
CSSTransitionComponentProps,
|
|
45
38
|
SSRTransitionOptions,
|
|
46
39
|
TransitionActions {
|
|
47
40
|
visible: boolean;
|
|
48
41
|
|
|
49
|
-
/**
|
|
50
|
-
* Set this to `true` to use a smaller font size and padding on the tooltip
|
|
51
|
-
* and a smaller gap between the tooltip and tooltipped element.
|
|
52
|
-
*
|
|
53
|
-
* @defaultValue `false`
|
|
54
|
-
*/
|
|
55
|
-
dense?: boolean;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @defaultValue `"below"`
|
|
59
|
-
*/
|
|
60
|
-
position?: SimplePosition;
|
|
61
|
-
|
|
62
42
|
/**
|
|
63
43
|
* @see {@link CSSTransitionComponentProps.temporary}
|
|
64
44
|
* @defaultValue `true`
|
|
65
45
|
*/
|
|
66
46
|
temporary?: boolean;
|
|
67
47
|
|
|
68
|
-
/**
|
|
69
|
-
* Set this to `"nowrap"` for tooltips that are positioned near the edge of
|
|
70
|
-
* the viewport that have a position of `"above"` or `"below"` so that the
|
|
71
|
-
* tooltip no longer aligns to the center of the tooltipped element.
|
|
72
|
-
*
|
|
73
|
-
* Set this to `"ellipsis"` if the tooltip should only show a single line of
|
|
74
|
-
* text and ellipsis once it has reached the max tooltip width.
|
|
75
|
-
*
|
|
76
|
-
* @defaultValue `"allow"`
|
|
77
|
-
*/
|
|
78
|
-
textOverflow?: TextOverflow;
|
|
79
|
-
|
|
80
48
|
/**
|
|
81
49
|
* @see {@link CSSTransitionComponentProps.timeout}
|
|
82
50
|
* @defaultValue `DEFAULT_TOOLTIP_TIMEOUT`
|
package/src/tooltip/styles.ts
CHANGED
|
@@ -6,13 +6,54 @@ import { bem } from "../utils/bem.js";
|
|
|
6
6
|
|
|
7
7
|
const styles = bem("rmd-tooltip");
|
|
8
8
|
|
|
9
|
+
declare module "react" {
|
|
10
|
+
interface CSSProperties {
|
|
11
|
+
"--rmd-tooltip-background-color"?: string;
|
|
12
|
+
"--rmd-tooltip-border-radius"?: string | number;
|
|
13
|
+
"--rmd-tooltip-color"?: string;
|
|
14
|
+
"--rmd-tooltip-spacing"?: string | number;
|
|
15
|
+
"--rmd-tooltip-z-index"?: string | number;
|
|
16
|
+
"--rmd-tooltip-horizontal-padding"?: string | number;
|
|
17
|
+
"--rmd-tooltip-vertical-padding"?: string | number;
|
|
18
|
+
"--rmd-tooltip-min-height"?: string | number;
|
|
19
|
+
"--rmd-tooltip-max-width"?: string | number;
|
|
20
|
+
"--rmd-tooltip-dense-horizontal-padding"?: string | number;
|
|
21
|
+
"--rmd-tooltip-dense-vertical-padding"?: string | number;
|
|
22
|
+
"--rmd-tooltip-dense-min-height"?: string | number;
|
|
23
|
+
"--rmd-tooltip-transition-distance"?: string | number;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
9
27
|
/**
|
|
10
28
|
* @since 6.0.0
|
|
29
|
+
* @since 6.3.1 Allow `position` to be optional
|
|
11
30
|
*/
|
|
12
31
|
export interface TooltipClassNameOptions {
|
|
13
32
|
className?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Set this to `true` to use a smaller font size and padding on the tooltip
|
|
36
|
+
* and a smaller gap between the tooltip and tooltipped element.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue `false`
|
|
39
|
+
*/
|
|
14
40
|
dense?: boolean;
|
|
15
|
-
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @defaultValue `"below"`
|
|
44
|
+
*/
|
|
45
|
+
position?: SimplePosition;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Set this to `"nowrap"` for tooltips that are positioned near the edge of
|
|
49
|
+
* the viewport that have a position of `"above"` or `"below"` so that the
|
|
50
|
+
* tooltip no longer aligns to the center of the tooltipped element.
|
|
51
|
+
*
|
|
52
|
+
* Set this to `"ellipsis"` if the tooltip should only show a single line of
|
|
53
|
+
* text and ellipsis once it has reached the max tooltip width.
|
|
54
|
+
*
|
|
55
|
+
* @defaultValue `"allow"`
|
|
56
|
+
*/
|
|
16
57
|
textOverflow?: TextOverflow;
|
|
17
58
|
}
|
|
18
59
|
|
|
@@ -20,7 +61,7 @@ export interface TooltipClassNameOptions {
|
|
|
20
61
|
* @since 6.0.0
|
|
21
62
|
*/
|
|
22
63
|
export function tooltip(options: TooltipClassNameOptions): string {
|
|
23
|
-
const { dense, position, className, textOverflow } = options;
|
|
64
|
+
const { dense, position = "below", className, textOverflow } = options;
|
|
24
65
|
|
|
25
66
|
return cnb(
|
|
26
67
|
styles({
|
|
@@ -12,14 +12,6 @@ import {
|
|
|
12
12
|
useSkeletonPlaceholder,
|
|
13
13
|
} from "./useSkeletonPlaceholder.js";
|
|
14
14
|
|
|
15
|
-
declare module "react" {
|
|
16
|
-
interface CSSProperties {
|
|
17
|
-
"--rmd-skeleton-placeholder-background-color"?: string;
|
|
18
|
-
"--rmd-skeleton-placeholder-height"?: string | number;
|
|
19
|
-
"--rmd-skeleton-placeholder-width"?: string | number;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
15
|
/** @since 6.0.0 */
|
|
24
16
|
export interface SkeletonPlaceholderProps
|
|
25
17
|
extends HTMLAttributes<HTMLDivElement>,
|
package/src/transition/Slide.tsx
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
useSlideTransition,
|
|
13
13
|
} from "./useSlideTransition.js";
|
|
14
14
|
|
|
15
|
+
// NOTE: Tis is in both `useSlideTransition` and `Slide` since there are no
|
|
16
|
+
// reusable types between these two files.
|
|
15
17
|
declare module "react" {
|
|
16
18
|
interface CSSProperties {
|
|
17
19
|
"--rmd-slide-duration"?: string | number;
|
|
@@ -3,6 +3,14 @@ import { type CSSProperties } from "react";
|
|
|
3
3
|
import { bem } from "../utils/bem.js";
|
|
4
4
|
import { randomInt } from "../utils/randomInt.js";
|
|
5
5
|
|
|
6
|
+
declare module "react" {
|
|
7
|
+
interface CSSProperties {
|
|
8
|
+
"--rmd-skeleton-placeholder-background-color"?: string;
|
|
9
|
+
"--rmd-skeleton-placeholder-height"?: string | number;
|
|
10
|
+
"--rmd-skeleton-placeholder-width"?: string | number;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
/**
|
|
7
15
|
* @since 6.0.0
|
|
8
16
|
*/
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
|
|
5
|
-
import type
|
|
5
|
+
import { type UseStateSetter } from "../types.js";
|
|
6
6
|
import { useToggle } from "../useToggle.js";
|
|
7
7
|
import { loop } from "../utils/loop.js";
|
|
8
|
-
import type
|
|
8
|
+
import { type SlideDirection } from "./SlideContainer.js";
|
|
9
9
|
|
|
10
10
|
/** @since 6.0.0 */
|
|
11
11
|
export interface CarouselSlideState {
|
|
@@ -6,14 +6,29 @@ import { Children, cloneElement, isValidElement } from "react";
|
|
|
6
6
|
|
|
7
7
|
import { maxWidthTransition } from "./maxWidthTransition.js";
|
|
8
8
|
|
|
9
|
+
declare module "react" {
|
|
10
|
+
interface CSSProperites {
|
|
11
|
+
"--rmd-max-width"?: string | number;
|
|
12
|
+
"--rmd-max-width-gap"?: string | number;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 6.3.1
|
|
18
|
+
*/
|
|
19
|
+
export interface BaseMaxWidthTransitionOptions {
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
9
23
|
/**
|
|
10
24
|
* @since 6.0.0
|
|
25
|
+
* @since 6.3.1 Extends BaseMaxWidthTransitionOptions
|
|
11
26
|
*/
|
|
12
|
-
export interface MaxWidthTransitionOptions
|
|
27
|
+
export interface MaxWidthTransitionOptions
|
|
28
|
+
extends BaseMaxWidthTransitionOptions {
|
|
13
29
|
element: ReactNode;
|
|
14
30
|
transitionIn: boolean;
|
|
15
31
|
|
|
16
|
-
className?: string;
|
|
17
32
|
disabled?: boolean;
|
|
18
33
|
disableTransition?: boolean;
|
|
19
34
|
}
|
|
@@ -10,6 +10,14 @@ import {
|
|
|
10
10
|
} from "./types.js";
|
|
11
11
|
import { useCSSTransition } from "./useCSSTransition.js";
|
|
12
12
|
|
|
13
|
+
// NOTE: Tis is in both `useSlideTransition` and `Slide` since there are no
|
|
14
|
+
// reusable types between these two files.
|
|
15
|
+
declare module "react" {
|
|
16
|
+
interface CSSProperties {
|
|
17
|
+
"--rmd-slide-duration"?: string | number;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
/** @since 6.0.0 */
|
|
14
22
|
export const DEFAULT_SLIDE_TRANSITION_TIMEOUT =
|
|
15
23
|
150 as const satisfies TransitionTimeout;
|
package/src/tree/Tree.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import { RenderRecursively } from "../utils/RenderRecursively.js";
|
|
|
17
17
|
import { identity } from "../utils/identity.js";
|
|
18
18
|
import { DefaultTreeItemRenderer } from "./DefaultTreeItemRenderer.js";
|
|
19
19
|
import { type TreeExpansionMode, TreeProvider } from "./TreeProvider.js";
|
|
20
|
-
import { tree } from "./styles.js";
|
|
20
|
+
import { type TreeClassNameOptions, tree } from "./styles.js";
|
|
21
21
|
import {
|
|
22
22
|
type TreeData,
|
|
23
23
|
type TreeItemNode,
|
|
@@ -29,15 +29,6 @@ import { useTreeItems } from "./useTreeItems.js";
|
|
|
29
29
|
import { useTreeMovement } from "./useTreeMovement.js";
|
|
30
30
|
import { type TreeSelection } from "./useTreeSelection.js";
|
|
31
31
|
|
|
32
|
-
declare module "react" {
|
|
33
|
-
interface CSSProperties {
|
|
34
|
-
"--rmd-tree-depth"?: number;
|
|
35
|
-
"--rmd-tree-item-padding"?: string | number;
|
|
36
|
-
"--rmd-tree-item-padding-base"?: string | number;
|
|
37
|
-
"--rmd-tree-item-padding-incrementor"?: string | number;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
32
|
/**
|
|
42
33
|
* @since 6.0.0
|
|
43
34
|
*/
|
|
@@ -55,9 +46,13 @@ export type TreeHTMLAttributes = Omit<
|
|
|
55
46
|
* - `getItemLabel`
|
|
56
47
|
* - `getItemValue`
|
|
57
48
|
* - `getItemProps`
|
|
49
|
+
*
|
|
50
|
+
* @since 6.3.1 Extends TreeClassNameOptions for CSSProperties module
|
|
51
|
+
* augmentation.
|
|
58
52
|
*/
|
|
59
53
|
export interface TreeProps<T extends TreeItemNode>
|
|
60
54
|
extends TreeHTMLAttributes,
|
|
55
|
+
TreeClassNameOptions,
|
|
61
56
|
TreeExpansion,
|
|
62
57
|
TreeSelection {
|
|
63
58
|
/** @see {@link TreeData} */
|
|
@@ -270,6 +265,7 @@ export function Tree<T extends TreeItemNode>(
|
|
|
270
265
|
});
|
|
271
266
|
|
|
272
267
|
const { metadataLookup, movementContext, movementProps } = useTreeMovement({
|
|
268
|
+
ref: treeRef,
|
|
273
269
|
onClick,
|
|
274
270
|
onFocus,
|
|
275
271
|
onKeyDown,
|
|
@@ -305,7 +301,6 @@ export function Tree<T extends TreeItemNode>(
|
|
|
305
301
|
{...remaining}
|
|
306
302
|
{...movementProps}
|
|
307
303
|
id={treeId}
|
|
308
|
-
ref={treeRef}
|
|
309
304
|
role="tree"
|
|
310
305
|
tabIndex={0}
|
|
311
306
|
className={tree({ className })}
|
package/src/tree/styles.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cnb } from "cnbuilder";
|
|
2
2
|
|
|
3
|
-
import type
|
|
3
|
+
import { type InternalListItemClassNameOptions } from "../list/listItemStyles.js";
|
|
4
4
|
import { listItem } from "../list/listItemStyles.js";
|
|
5
5
|
import { bem } from "../utils/bem.js";
|
|
6
6
|
|
|
@@ -8,6 +8,15 @@ const treeStyles = bem("rmd-tree");
|
|
|
8
8
|
const treeItemStyles = bem("rmd-tree-item");
|
|
9
9
|
const treeGroupStyles = bem("rmd-tree-group");
|
|
10
10
|
|
|
11
|
+
declare module "react" {
|
|
12
|
+
interface CSSProperties {
|
|
13
|
+
"--rmd-tree-depth"?: number;
|
|
14
|
+
"--rmd-tree-item-padding"?: string | number;
|
|
15
|
+
"--rmd-tree-item-padding-base"?: string | number;
|
|
16
|
+
"--rmd-tree-item-padding-incrementor"?: string | number;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
/** @since 6.0.0 */
|
|
12
21
|
export interface TreeClassNameOptions {
|
|
13
22
|
className?: string;
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
FocusEventHandler,
|
|
5
5
|
KeyboardEventHandler,
|
|
6
6
|
MouseEventHandler,
|
|
7
|
+
Ref,
|
|
7
8
|
} from "react";
|
|
8
9
|
import { useRef } from "react";
|
|
9
10
|
|
|
@@ -59,6 +60,7 @@ const getVisibleTreeItems = (
|
|
|
59
60
|
* @internal
|
|
60
61
|
*/
|
|
61
62
|
interface TreeMovementOptions<T extends TreeItemNode> extends TreeExpansion {
|
|
63
|
+
ref?: Ref<HTMLUListElement>;
|
|
62
64
|
data: TreeData<T>;
|
|
63
65
|
onClick: MouseEventHandler<HTMLUListElement> | undefined;
|
|
64
66
|
onFocus: FocusEventHandler<HTMLUListElement> | undefined;
|
|
@@ -88,6 +90,7 @@ export function useTreeMovement<T extends TreeItemNode>(
|
|
|
88
90
|
options: TreeMovementOptions<T>
|
|
89
91
|
): TreeMovement {
|
|
90
92
|
const {
|
|
93
|
+
ref,
|
|
91
94
|
onClick,
|
|
92
95
|
onFocus,
|
|
93
96
|
onKeyDown,
|
|
@@ -106,6 +109,7 @@ export function useTreeMovement<T extends TreeItemNode>(
|
|
|
106
109
|
itemToElement: {},
|
|
107
110
|
});
|
|
108
111
|
const movement = useKeyboardMovementProvider({
|
|
112
|
+
ref,
|
|
109
113
|
onClick,
|
|
110
114
|
onFocus,
|
|
111
115
|
onKeyDown,
|
package/src/types.ts
CHANGED
|
@@ -227,6 +227,22 @@ export interface ElementSize {
|
|
|
227
227
|
width: number;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
/**
|
|
231
|
+
* @since 6.3.0
|
|
232
|
+
*/
|
|
233
|
+
export interface Point {
|
|
234
|
+
x: number;
|
|
235
|
+
y: number;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @since 6.3.0
|
|
240
|
+
*/
|
|
241
|
+
export interface MinMaxRange {
|
|
242
|
+
min: number;
|
|
243
|
+
max: number;
|
|
244
|
+
}
|
|
245
|
+
|
|
230
246
|
/**
|
|
231
247
|
* @since 6.2.0
|
|
232
248
|
*/
|
package/src/typography/Mark.tsx
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode, forwardRef } from "react";
|
|
2
2
|
|
|
3
|
-
import { mark } from "./markStyles.js";
|
|
3
|
+
import { type MarkClassNameOptions, mark } from "./markStyles.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @since 6.0.0
|
|
7
|
+
* @since 6.3.1 Extends MarkClassNameOptions for CSSProperties module
|
|
8
|
+
* augmentation.
|
|
7
9
|
*/
|
|
8
|
-
export interface MarkProps
|
|
10
|
+
export interface MarkProps
|
|
11
|
+
extends HTMLAttributes<HTMLElement>,
|
|
12
|
+
MarkClassNameOptions {
|
|
9
13
|
children: ReactNode;
|
|
10
14
|
}
|
|
11
15
|
|
|
@@ -5,13 +5,6 @@ import {
|
|
|
5
5
|
textContainer,
|
|
6
6
|
} from "./textContainerStyles.js";
|
|
7
7
|
|
|
8
|
-
declare module "react" {
|
|
9
|
-
interface CSSProperties {
|
|
10
|
-
"--rmd-line-length"?: string | number;
|
|
11
|
-
"--rmd-text-container-padding"?: string | number;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
8
|
/**
|
|
16
9
|
* @since 6.0.0 Removed the `size` option since there is no longer a
|
|
17
10
|
* different line-length for mobile and desktop.
|
|
@@ -4,6 +4,13 @@ import { bem } from "../utils/bem.js";
|
|
|
4
4
|
|
|
5
5
|
const styles = bem("rmd-text-container");
|
|
6
6
|
|
|
7
|
+
declare module "react" {
|
|
8
|
+
interface CSSProperties {
|
|
9
|
+
"--rmd-line-length"?: string | number;
|
|
10
|
+
"--rmd-text-container-padding"?: string | number;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
/**
|
|
8
15
|
* @since 6.0.0
|
|
9
16
|
*/
|
|
@@ -2,6 +2,16 @@ import { cnb } from "cnbuilder";
|
|
|
2
2
|
|
|
3
3
|
import { type TextCssUtilsOptions, cssUtils } from "../cssUtils.js";
|
|
4
4
|
|
|
5
|
+
declare module "react" {
|
|
6
|
+
interface CSSProperties {
|
|
7
|
+
"--rmd-font-size"?: string;
|
|
8
|
+
"--rmd-font-family"?: string;
|
|
9
|
+
"--rmd-font-weight"?: string | number;
|
|
10
|
+
"--rmd-font-height"?: string | number;
|
|
11
|
+
"--rmd-font-line-height"?: string | number;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
5
15
|
/**
|
|
6
16
|
* A union of all the material design provided typography styles. When used with
|
|
7
17
|
* the Typography component, this will generate the correct typography className
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { type MinMaxRange } from "../types.js";
|
|
1
2
|
import { getRangeSteps } from "./getRangeSteps.js";
|
|
2
3
|
import { nearest } from "./nearest.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @since 6.0.0
|
|
6
7
|
*/
|
|
7
|
-
export interface GetMiddleOfRangeOptions {
|
|
8
|
-
min: number;
|
|
9
|
-
max: number;
|
|
8
|
+
export interface GetMiddleOfRangeOptions extends MinMaxRange {
|
|
10
9
|
step: number;
|
|
11
10
|
}
|
|
12
11
|
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export interface GetPercentageOptions {
|
|
3
|
-
/**
|
|
4
|
-
* The min value allowed.
|
|
5
|
-
*/
|
|
6
|
-
min: number;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The max value allowed.
|
|
10
|
-
*/
|
|
11
|
-
max: number;
|
|
1
|
+
import { type MinMaxRange } from "../types.js";
|
|
12
2
|
|
|
3
|
+
/** @since 4.0.1 */
|
|
4
|
+
export interface GetPercentageOptions extends MinMaxRange {
|
|
13
5
|
/**
|
|
14
6
|
* The current value
|
|
15
7
|
*/
|
package/src/utils/nearest.ts
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type Point } from "../types.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 6.3.0
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export const radiansToDegrees = (radians: number): number =>
|
|
8
|
+
(radians * 180) / Math.PI;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @since 6.3.0
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export const degreesToRadians = (degrees: number): number =>
|
|
15
|
+
(degrees * Math.PI) / 180;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @since 6.3.0
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
interface IsPointInCircleOptions {
|
|
22
|
+
point: Point;
|
|
23
|
+
center: Point;
|
|
24
|
+
radius: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @since 6.3.0
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export function isPointInCircle(options: IsPointInCircleOptions): boolean {
|
|
32
|
+
const { point, center, radius } = options;
|
|
33
|
+
|
|
34
|
+
const distance = (center.x - point.x) ** 2 + (center.y - point.y) ** 2;
|
|
35
|
+
return distance <= radius ** 2;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
* @since 6.3.0
|
|
41
|
+
*/
|
|
42
|
+
export function calcHypotenuse(point: Point): number {
|
|
43
|
+
const { x, y } = point;
|
|
44
|
+
|
|
45
|
+
return Math.sqrt(x * x + y * y);
|
|
46
|
+
}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes, forwardRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { type LabelRequiredForA11y } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
type BaseWindowSplitterClassNameOptions,
|
|
6
|
+
windowSplitter,
|
|
7
|
+
} from "./styles.js";
|
|
5
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
9
|
import { type useWindowSplitter } from "./useWindowSplitter.js";
|
|
7
10
|
|
|
8
|
-
declare module "react" {
|
|
9
|
-
interface CSSProperties {
|
|
10
|
-
"--rmd-window-splitter-top"?: number | string;
|
|
11
|
-
"--rmd-window-splitter-right"?: number | string;
|
|
12
|
-
"--rmd-window-splitter-bottom"?: number | string;
|
|
13
|
-
"--rmd-window-splitter-left"?: number | string;
|
|
14
|
-
"--rmd-window-splitter-opacity"?: number | string;
|
|
15
|
-
"--rmd-window-splitter-position"?: number | string;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
11
|
/**
|
|
20
|
-
* @since 6.0.0
|
|
21
12
|
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/}
|
|
13
|
+
* @since 6.0.0
|
|
14
|
+
* @since 6.3.1 Extends BaseWindowSplitterClassNameOptions for CSSProperties
|
|
15
|
+
* module augmentation.
|
|
22
16
|
*/
|
|
23
17
|
export interface BaseWindowSplitterProps
|
|
24
|
-
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children"
|
|
18
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children">,
|
|
19
|
+
BaseWindowSplitterClassNameOptions {
|
|
25
20
|
/**
|
|
26
21
|
* This will be provided by the {@link useWindowSplitter} hook.
|
|
27
22
|
*/
|
|
@@ -36,14 +31,6 @@ export interface BaseWindowSplitterProps
|
|
|
36
31
|
* This will be provided by the {@link useWindowSplitter} hook.
|
|
37
32
|
*/
|
|
38
33
|
reversed: boolean;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Set this to `true` if the window splitter should use `position: absolute`
|
|
42
|
-
* instead of `position: fixed`.
|
|
43
|
-
*
|
|
44
|
-
* @defaultValue `false`
|
|
45
|
-
*/
|
|
46
|
-
disableFixed?: boolean;
|
|
47
34
|
}
|
|
48
35
|
|
|
49
36
|
/**
|
|
@@ -4,15 +4,43 @@ import { bem } from "../utils/bem.js";
|
|
|
4
4
|
|
|
5
5
|
const styles = bem("rmd-window-splitter");
|
|
6
6
|
|
|
7
|
+
declare module "react" {
|
|
8
|
+
interface CSSProperties {
|
|
9
|
+
"--rmd-window-splitter-size"?: string | number;
|
|
10
|
+
"--rmd-window-splitter-background-size"?: string | number;
|
|
11
|
+
"--rmd-window-splitter-x"?: string | number;
|
|
12
|
+
"--rmd-window-splitter-y"?: string | number;
|
|
13
|
+
"--rmd-window-splitter-z"?: string | number;
|
|
14
|
+
"--rmd-window-splitter-position"?: string | number;
|
|
15
|
+
"--rmd-window-splitter-backgrond-color"?: string;
|
|
16
|
+
"--rmd-window-splitter-opacity"?: string | number;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
7
20
|
/**
|
|
8
|
-
* @since 6.
|
|
21
|
+
* @since 6.3.1
|
|
9
22
|
*/
|
|
10
|
-
export interface
|
|
23
|
+
export interface BaseWindowSplitterClassNameOptions {
|
|
11
24
|
className?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Set this to `true` if the window splitter should use `position: absolute`
|
|
28
|
+
* instead of `position: fixed`.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue `false`
|
|
31
|
+
*/
|
|
32
|
+
disableFixed?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @since 6.0.0
|
|
37
|
+
* @since 6.3.1 Extends BaseWindowSplitterClassNameOptions
|
|
38
|
+
*/
|
|
39
|
+
export interface WindowSplitterClassNameOptions
|
|
40
|
+
extends BaseWindowSplitterClassNameOptions {
|
|
12
41
|
dragging?: boolean;
|
|
13
42
|
reversed?: boolean;
|
|
14
43
|
vertical?: boolean;
|
|
15
|
-
disableFixed?: boolean;
|
|
16
44
|
}
|
|
17
45
|
|
|
18
46
|
/**
|
|
@@ -42,8 +42,9 @@ export type WindowSplitterOptions<E extends HTMLElement = HTMLButtonElement> =
|
|
|
42
42
|
/**
|
|
43
43
|
* @since 6.0.0
|
|
44
44
|
*/
|
|
45
|
-
export interface WindowSplitterWidgetProps<
|
|
46
|
-
extends
|
|
45
|
+
export interface WindowSplitterWidgetProps<
|
|
46
|
+
E extends HTMLElement = HTMLButtonElement,
|
|
47
|
+
> extends Required<DraggableMouseEventHandlers<E>>,
|
|
47
48
|
Required<DraggableKeyboardEventHandlers<E>> {
|
|
48
49
|
"aria-orientation": "vertical" | undefined;
|
|
49
50
|
"aria-valuenow": number;
|