@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/overlay/styles.ts
CHANGED
|
@@ -13,26 +13,45 @@ import { bem } from "../utils/bem.js";
|
|
|
13
13
|
|
|
14
14
|
const styles = bem("rmd-overlay");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
declare module "react" {
|
|
17
|
+
interface CSSProperties {
|
|
18
|
+
"--rmd-overlay-background-color"?: string;
|
|
19
|
+
"--rmd-overlay-z-index"?: number;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface BaseOverlayClassNameOptions {
|
|
18
24
|
className?: string;
|
|
19
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Set this to `true` for when the overlay should be visible. Toggling this
|
|
28
|
+
* value will trigger the enter/exit animation.
|
|
29
|
+
*/
|
|
20
30
|
visible: boolean;
|
|
21
31
|
|
|
22
|
-
/**
|
|
23
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @defaultValue `"center"`
|
|
34
|
+
* @since 6.0.0
|
|
35
|
+
*/
|
|
36
|
+
align?: BoxAlignItems;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @defaultValue `"center"`
|
|
40
|
+
* @since 6.0.0
|
|
41
|
+
*/
|
|
42
|
+
justify?: BoxJustifyContent;
|
|
24
43
|
|
|
25
44
|
/** @defaultValue `false` */
|
|
26
45
|
clickable?: boolean;
|
|
46
|
+
}
|
|
27
47
|
|
|
48
|
+
/** @since 6.0.0 */
|
|
49
|
+
export interface OverlayClassNameOptions extends BaseOverlayClassNameOptions {
|
|
28
50
|
/** @defaultValue `false` */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/** @defaultValue `"center"` */
|
|
32
|
-
align?: BoxAlignItems;
|
|
51
|
+
active?: boolean;
|
|
33
52
|
|
|
34
|
-
/** @defaultValue `
|
|
35
|
-
|
|
53
|
+
/** @defaultValue `false` */
|
|
54
|
+
absolute?: boolean;
|
|
36
55
|
}
|
|
37
56
|
|
|
38
57
|
/**
|
|
@@ -8,14 +8,21 @@ import {
|
|
|
8
8
|
import { type LabelRequiredForA11y, type PropsWithRef } from "../types.js";
|
|
9
9
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
10
10
|
import { getPercentage } from "../utils/getPercentage.js";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
type BaseLinearProgressClassNameOptions,
|
|
13
|
+
linearProgress,
|
|
14
|
+
linearProgressBar,
|
|
15
|
+
} from "./linearProgressStyles.js";
|
|
12
16
|
import { type ProgressProps } from "./types.js";
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* @since 6.0.0 Added the `theme` prop
|
|
20
|
+
* @since 6.3.1 extends BaseLinearProgressClassNameOptions for CSSProperties
|
|
21
|
+
* module augmentation.
|
|
16
22
|
*/
|
|
17
23
|
export interface LinearProgressProps
|
|
18
24
|
extends Omit<HTMLAttributes<HTMLSpanElement>, "id" | "children">,
|
|
25
|
+
BaseLinearProgressClassNameOptions,
|
|
19
26
|
ProgressProps {
|
|
20
27
|
/**
|
|
21
28
|
* An optional style to apply to the progress bar. This will be merged with
|
|
@@ -44,15 +51,6 @@ export interface LinearProgressProps
|
|
|
44
51
|
*/
|
|
45
52
|
reverse?: boolean;
|
|
46
53
|
|
|
47
|
-
/**
|
|
48
|
-
* Boolean if the progress should be vertical instead of horizontal. When
|
|
49
|
-
* this prop is set, you should also set the `verticalHeight` prop to a height
|
|
50
|
-
* value you want for your progress bar.
|
|
51
|
-
*
|
|
52
|
-
* @defaultValue `false`
|
|
53
|
-
*/
|
|
54
|
-
vertical?: boolean;
|
|
55
|
-
|
|
56
54
|
/**
|
|
57
55
|
* Since there isn't really a good way to have "auto height", you'll need to
|
|
58
56
|
* manually set the progress bar's height with this prop to some pixel value.
|
|
@@ -6,6 +6,13 @@ import { type ProgressTheme } from "./types.js";
|
|
|
6
6
|
|
|
7
7
|
const styles = bem("rmd-circular-progress");
|
|
8
8
|
|
|
9
|
+
declare module "react" {
|
|
10
|
+
interface CSSProperties {
|
|
11
|
+
"--rmd-progress-circular-size"?: string | number;
|
|
12
|
+
"--rmd-progress-circular-stroke-width"?: string | number;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
/**
|
|
10
17
|
* @since 6.2.0
|
|
11
18
|
*/
|
|
@@ -6,10 +6,15 @@ import { type ProgressTheme } from "./types.js";
|
|
|
6
6
|
|
|
7
7
|
const styles = bem("rmd-linear-progress");
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
declare module "react" {
|
|
10
|
+
interface CSSProperties {
|
|
11
|
+
"--rmd-progress-background-color"?: string;
|
|
12
|
+
"--rmd-progress-color"?: string;
|
|
13
|
+
"--rmd-progress-linear-size"?: string | number;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface BaseLinearProgressClassNameOptions {
|
|
13
18
|
className?: string;
|
|
14
19
|
|
|
15
20
|
/**
|
|
@@ -18,9 +23,21 @@ export interface LinearProgressClassNameOptions {
|
|
|
18
23
|
*/
|
|
19
24
|
theme?: ProgressTheme;
|
|
20
25
|
|
|
21
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Boolean if the progress should be vertical instead of horizontal. When
|
|
28
|
+
* this prop is set, you should also set the `verticalHeight` prop to a height
|
|
29
|
+
* value you want for your progress bar.
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue `false`
|
|
32
|
+
*/
|
|
22
33
|
vertical?: boolean;
|
|
34
|
+
}
|
|
23
35
|
|
|
36
|
+
/**
|
|
37
|
+
* @since 6.2.0
|
|
38
|
+
*/
|
|
39
|
+
export interface LinearProgressClassNameOptions
|
|
40
|
+
extends BaseLinearProgressClassNameOptions {
|
|
24
41
|
/** @defaultValue `false` */
|
|
25
42
|
indeterminate?: boolean;
|
|
26
43
|
}
|
package/src/progress/types.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { type ThemeColor } from "../cssUtils.js";
|
|
2
2
|
|
|
3
|
-
declare module "react" {
|
|
4
|
-
interface CSSProperties {
|
|
5
|
-
"--rmd-progress-background-color"?: string;
|
|
6
|
-
"--rmd-progress-color"?: string;
|
|
7
|
-
"--rmd-progress-circular-size"?: string | number;
|
|
8
|
-
"--rmd-progress-circular-stroke-width"?: number;
|
|
9
|
-
"--rmd-progress-linear-size"?: string | number;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
3
|
/**
|
|
14
4
|
* @since 6.0.0
|
|
15
5
|
*/
|
|
@@ -6,31 +6,30 @@ import { getIcon } from "../icon/config.js";
|
|
|
6
6
|
import { type ComponentWithRippleProps } from "../interaction/types.js";
|
|
7
7
|
import { useElementInteraction } from "../interaction/useElementInteraction.js";
|
|
8
8
|
import { useHigherContrastChildren } from "../interaction/useHigherContrastChildren.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
type BaseMaxWidthTransitionOptions,
|
|
11
|
+
useMaxWidthTransition,
|
|
12
|
+
} from "../transition/useMaxWidthTransition.js";
|
|
13
|
+
import {
|
|
14
|
+
type BaseSegmentedButtonClassNameOptions,
|
|
15
|
+
segmentedButton,
|
|
16
|
+
} from "./segmentedButtonStyles.js";
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
19
|
* @since 6.0.0
|
|
20
|
+
* @since 6.3.1 Extends BaseMaxWidthTransitionOptions for CSS module
|
|
21
|
+
* augmentation.
|
|
22
|
+
* @since 6.3.1 Extends BaseSegmentedButtonClassNameOptions for CSSProperties
|
|
23
|
+
* module augmentation.
|
|
14
24
|
*/
|
|
15
25
|
export interface SegmentedButtonProps
|
|
16
26
|
extends ButtonHTMLAttributes<HTMLButtonElement>,
|
|
27
|
+
BaseMaxWidthTransitionOptions,
|
|
28
|
+
BaseSegmentedButtonClassNameOptions,
|
|
17
29
|
ComponentWithRippleProps {
|
|
18
|
-
/**
|
|
19
|
-
* Set this to `true` to apply selected styles and an optional
|
|
20
|
-
* {@link selectedIcon}
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue `false`
|
|
23
|
-
*/
|
|
24
|
-
selected?: boolean;
|
|
25
|
-
|
|
26
30
|
/** @defaultValue `getIcon("selected")` */
|
|
27
31
|
selectedIcon?: ReactNode;
|
|
28
32
|
|
|
29
|
-
/**
|
|
30
|
-
* An optional className to apply when {@link selected} is `true`.
|
|
31
|
-
*/
|
|
32
|
-
selectedClassName?: string;
|
|
33
|
-
|
|
34
33
|
/**
|
|
35
34
|
* Set this to `true` to not render the {@link selectedIcon} when
|
|
36
35
|
* {@link selected} is `true`.
|
|
@@ -5,20 +5,45 @@ import { bem } from "../utils/bem.js";
|
|
|
5
5
|
|
|
6
6
|
const styles = bem("rmd-segmented-button");
|
|
7
7
|
|
|
8
|
+
declare module "react" {
|
|
9
|
+
interface CSSProperties {
|
|
10
|
+
"--rmd-segmented-button-border-radius"?: string | number;
|
|
11
|
+
"--rmd-segmented-button-min-height"?: string | number;
|
|
12
|
+
"--rmd-segmented-button-min-width"?: string | number;
|
|
13
|
+
"--rmd-segmented-button-outline-width"?: string | number;
|
|
14
|
+
"--rmd-segmented-button-outline-color"?: string | number;
|
|
15
|
+
"--rmd-segmented-button-color"?: string | number;
|
|
16
|
+
"--rmd-segmented-button-selected-background-color"?: string | number;
|
|
17
|
+
"--rmd-segmented-button-selected-color"?: string | number;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
/**
|
|
9
|
-
* @since 6.
|
|
22
|
+
* @since 6.3.1
|
|
10
23
|
*/
|
|
11
|
-
export interface
|
|
24
|
+
export interface BaseSegmentedButtonClassNameOptions {
|
|
12
25
|
className?: string;
|
|
13
26
|
|
|
14
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Set this to `true` to apply selected styles and an optional
|
|
29
|
+
* {@link selectedIcon}
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue `false`
|
|
32
|
+
*/
|
|
15
33
|
selected?: boolean;
|
|
16
34
|
|
|
17
35
|
/**
|
|
18
36
|
* An optional className to apply when {@link selected} is `true`
|
|
19
37
|
*/
|
|
20
38
|
selectedClassName?: string;
|
|
39
|
+
}
|
|
21
40
|
|
|
41
|
+
/**
|
|
42
|
+
* @since 6.0.0
|
|
43
|
+
* @since 6.3.1 Extends BaseSegmentedButtonClassNameOptions
|
|
44
|
+
*/
|
|
45
|
+
export interface SegmentedButtonClassNameOptions
|
|
46
|
+
extends BaseSegmentedButtonClassNameOptions {
|
|
22
47
|
/** @internal */
|
|
23
48
|
pressedClassName?: string;
|
|
24
49
|
}
|
package/src/sheet/Sheet.tsx
CHANGED
|
@@ -11,19 +11,6 @@ import {
|
|
|
11
11
|
sheet,
|
|
12
12
|
} from "./styles.js";
|
|
13
13
|
|
|
14
|
-
declare module "react" {
|
|
15
|
-
interface CSSProperties {
|
|
16
|
-
"--rmd-sheet-height"?: string | number;
|
|
17
|
-
"--rmd-sheet-width"?: string | number;
|
|
18
|
-
"--rmd-sheet-max-height"?: string | number;
|
|
19
|
-
"--rmd-sheet-touch-width"?: string | number;
|
|
20
|
-
"--rmd-sheet-touch-max-height"?: string | number;
|
|
21
|
-
"--rmd-sheet-static-width"?: string | number;
|
|
22
|
-
"--rmd-sheet-transform-offscreen"?: string | number;
|
|
23
|
-
"--rmd-sheet-z-index"?: number;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
14
|
/**
|
|
28
15
|
* @since 6.0.0
|
|
29
16
|
*/
|
package/src/sheet/styles.ts
CHANGED
|
@@ -8,6 +8,19 @@ import {
|
|
|
8
8
|
} from "../transition/types.js";
|
|
9
9
|
import { bem } from "../utils/bem.js";
|
|
10
10
|
|
|
11
|
+
declare module "react" {
|
|
12
|
+
interface CSSProperties {
|
|
13
|
+
"--rmd-sheet-height"?: string | number;
|
|
14
|
+
"--rmd-sheet-width"?: string | number;
|
|
15
|
+
"--rmd-sheet-max-height"?: string | number;
|
|
16
|
+
"--rmd-sheet-touch-width"?: string | number;
|
|
17
|
+
"--rmd-sheet-touch-max-height"?: string | number;
|
|
18
|
+
"--rmd-sheet-static-width"?: string | number;
|
|
19
|
+
"--rmd-sheet-transform-offscreen"?: string | number;
|
|
20
|
+
"--rmd-sheet-z-index"?: number;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
/**
|
|
12
25
|
* @since 6.0.0 Uses `as const satisfies TransitionTimeout`
|
|
13
26
|
*/
|
package/src/snackbar/Toast.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
} from "react";
|
|
11
11
|
|
|
12
12
|
import { type ButtonProps } from "../button/Button.js";
|
|
13
|
-
import { type BackgroundColor } from "../cssUtils.js";
|
|
14
13
|
import {
|
|
15
14
|
type CSSTransitionClassNames,
|
|
16
15
|
type TransitionCallbacks,
|
|
@@ -22,21 +21,14 @@ import { useEnsuredId } from "../useEnsuredId.js";
|
|
|
22
21
|
import { ToastActionButton } from "./ToastActionButton.js";
|
|
23
22
|
import { ToastCloseButton } from "./ToastCloseButton.js";
|
|
24
23
|
import { ToastContent, type ToastContentProps } from "./ToastContent.js";
|
|
25
|
-
import { toast } from "./toastStyles.js";
|
|
26
|
-
|
|
27
|
-
declare module "react" {
|
|
28
|
-
interface CSSProperties {
|
|
29
|
-
"--rmd-toast-color"?: string;
|
|
30
|
-
"--rmd-toast-background-color"?: string;
|
|
31
|
-
"--rmd-toast-offset"?: string | number;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
24
|
+
import { type BaseToastClasNameOptions, toast } from "./toastStyles.js";
|
|
34
25
|
|
|
35
26
|
/**
|
|
36
27
|
* @since 6.0.0
|
|
37
28
|
*/
|
|
38
29
|
export interface ConfigurableToastProps
|
|
39
30
|
extends HTMLAttributes<HTMLDivElement>,
|
|
31
|
+
BaseToastClasNameOptions,
|
|
40
32
|
TransitionCallbacks {
|
|
41
33
|
/**
|
|
42
34
|
* Note: this default value will only be generated in the `Toast` component.
|
|
@@ -52,11 +44,6 @@ export interface ConfigurableToastProps
|
|
|
52
44
|
*/
|
|
53
45
|
role?: AriaRole;
|
|
54
46
|
|
|
55
|
-
/**
|
|
56
|
-
* @defaultValue `"surface"`
|
|
57
|
-
*/
|
|
58
|
-
theme?: BackgroundColor;
|
|
59
|
-
|
|
60
47
|
/**
|
|
61
48
|
* Set this to `true` to stack the content above the {@link action}. It is not
|
|
62
49
|
* recommended to enable this prop if the {@link closeButton} is enabled.
|
|
@@ -5,11 +5,29 @@ import { bem } from "../utils/bem.js";
|
|
|
5
5
|
|
|
6
6
|
const styles = bem("rmd-toast");
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
declare module "react" {
|
|
9
|
+
interface CSSProperties {
|
|
10
|
+
"--rmd-toast-color"?: string;
|
|
11
|
+
"--rmd-toast-background-color"?: string;
|
|
12
|
+
"--rmd-toast-offset"?: string | number;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 6.3.1
|
|
18
|
+
*/
|
|
19
|
+
export interface BaseToastClasNameOptions {
|
|
10
20
|
className?: string;
|
|
21
|
+
|
|
11
22
|
/** @defaultValue `"surface"` */
|
|
12
23
|
theme?: BackgroundColor;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 6.0.0
|
|
28
|
+
* @since 6.3.1 Extends BaseToastClasNameOptions
|
|
29
|
+
*/
|
|
30
|
+
export interface ToastClassNameOptions extends BaseToastClasNameOptions {
|
|
13
31
|
/** @defaultValue `false` */
|
|
14
32
|
action?: boolean;
|
|
15
33
|
/** @defaultValue `false` */
|
package/src/tabs/Tab.tsx
CHANGED
|
@@ -13,36 +13,16 @@ import { useHigherContrastChildren } from "../interaction/useHigherContrastChild
|
|
|
13
13
|
import { type CustomLinkComponent } from "../link/Link.js";
|
|
14
14
|
import { useKeyboardMovementContext } from "../movement/useKeyboardMovementProvider.js";
|
|
15
15
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
16
|
-
|
|
17
|
-
import { type TabListProps } from "./TabList.js";
|
|
18
|
-
import { tab } from "./tabStyles.js";
|
|
16
|
+
import { type BaseTabClassNameOptions, tab } from "./tabStyles.js";
|
|
19
17
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
18
|
import { type useTabs } from "./useTabs.js";
|
|
21
19
|
|
|
22
|
-
declare module "react" {
|
|
23
|
-
interface CSSProperties {
|
|
24
|
-
"--rmd-tab-color"?: string;
|
|
25
|
-
"--rmd-tab-active-color"?: string;
|
|
26
|
-
"--rmd-tab-inactive-color"?: string;
|
|
27
|
-
"--rmd-tab-disabled-color"?: string;
|
|
28
|
-
|
|
29
|
-
"--rmd-tab-size"?: string;
|
|
30
|
-
"--rmd-tab-offset"?: string | number;
|
|
31
|
-
"--rmd-tab-min-width"?: string;
|
|
32
|
-
"--rmd-tab-max-width"?: string;
|
|
33
|
-
"--rmd-tab-min-height"?: string;
|
|
34
|
-
"--rmd-tab-stacked-height"?: string;
|
|
35
|
-
"--rmd-tab-stacked-width"?: string;
|
|
36
|
-
"--rmd-tab-padding"?: string | number;
|
|
37
|
-
"--rmd-tab-stacked-padding"?: string | number;
|
|
38
|
-
"--rmd-tab-indicator-background"?: string;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
20
|
/**
|
|
43
21
|
* @since 6.0.0
|
|
44
22
|
*/
|
|
45
|
-
export interface BaseTabProps
|
|
23
|
+
export interface BaseTabProps
|
|
24
|
+
extends ComponentWithRippleProps,
|
|
25
|
+
BaseTabClassNameOptions {
|
|
46
26
|
/**
|
|
47
27
|
* Set this to `true` if the tab is currently active.
|
|
48
28
|
*
|
|
@@ -50,23 +30,6 @@ export interface BaseTabProps extends ComponentWithRippleProps {
|
|
|
50
30
|
*/
|
|
51
31
|
active: boolean;
|
|
52
32
|
|
|
53
|
-
/**
|
|
54
|
-
* Set this to `true` if the {@link TabListProps.disableTransition} prop has
|
|
55
|
-
* also been set to `true` to disable an active indicator below the tab when
|
|
56
|
-
* {@link active} is `true`.
|
|
57
|
-
*
|
|
58
|
-
* @defaultValue `false`
|
|
59
|
-
*/
|
|
60
|
-
activeIndicator?: boolean;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Set this to `true` when rendering the tabs vertically and
|
|
64
|
-
* {@link activeIndicator} has been enabled.
|
|
65
|
-
*
|
|
66
|
-
* @defaultValue !false
|
|
67
|
-
*/
|
|
68
|
-
verticalActiveIndicator?: boolean;
|
|
69
|
-
|
|
70
33
|
/**
|
|
71
34
|
* An optional icon to render with the with the {@link children}. The default
|
|
72
35
|
* behavior will render this icon before the children.
|
|
@@ -82,14 +45,6 @@ export interface BaseTabProps extends ComponentWithRippleProps {
|
|
|
82
45
|
* @defaultValue `false`
|
|
83
46
|
*/
|
|
84
47
|
iconAfter?: boolean;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Set this to `true` to render the {@link icon} and {@link children} stacked
|
|
88
|
-
* instead of horizontally.
|
|
89
|
-
*
|
|
90
|
-
* @defaultValue `false`
|
|
91
|
-
*/
|
|
92
|
-
stacked?: boolean;
|
|
93
48
|
}
|
|
94
49
|
|
|
95
50
|
/**
|
package/src/tabs/tabStyles.ts
CHANGED
|
@@ -2,20 +2,68 @@ import { cnb } from "cnbuilder";
|
|
|
2
2
|
|
|
3
3
|
import { cssUtils } from "../cssUtils.js";
|
|
4
4
|
import { bem } from "../utils/bem.js";
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
import { type TabListProps } from "./TabList.js";
|
|
5
7
|
import { tabIndicator } from "./tabIndicatorStyles.js";
|
|
6
8
|
|
|
7
9
|
const styles = bem("rmd-tab");
|
|
8
10
|
|
|
11
|
+
declare module "react" {
|
|
12
|
+
interface CSSProperties {
|
|
13
|
+
"--rmd-tab-color"?: string;
|
|
14
|
+
"--rmd-tab-active-color"?: string;
|
|
15
|
+
"--rmd-tab-inactive-color"?: string;
|
|
16
|
+
"--rmd-tab-disabled-color"?: string;
|
|
17
|
+
"--rmd-tab-indicator-background"?: string;
|
|
18
|
+
"--rmd-tab-min-height"?: string;
|
|
19
|
+
"--rmd-tab-min-width"?: string;
|
|
20
|
+
"--rmd-tab-max-width"?: string;
|
|
21
|
+
"--rmd-tab-stacked-height"?: string;
|
|
22
|
+
"--rmd-tab-stacked-width"?: string;
|
|
23
|
+
"--rmd-tab-padding"?: string | number;
|
|
24
|
+
"--rmd-tab-stacked-padding"?: string | number;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
9
28
|
/**
|
|
10
|
-
* @since 6.
|
|
29
|
+
* @since 6.3.1
|
|
11
30
|
*/
|
|
12
|
-
export interface
|
|
31
|
+
export interface BaseTabClassNameOptions {
|
|
13
32
|
className?: string;
|
|
14
|
-
|
|
15
|
-
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Set this to `true` if the {@link TabListProps.disableTransition} prop has
|
|
36
|
+
* also been set to `true` to disable an active indicator below the tab when
|
|
37
|
+
* {@link active} is `true`.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue `false`
|
|
40
|
+
*/
|
|
16
41
|
activeIndicator?: boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Set this to `true` when rendering the tabs vertically and
|
|
45
|
+
* {@link activeIndicator} has been enabled.
|
|
46
|
+
*
|
|
47
|
+
* @defaultValue !false
|
|
48
|
+
*/
|
|
17
49
|
verticalActiveIndicator?: boolean;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Set this to `true` to render the {@link icon} and {@link children} stacked
|
|
53
|
+
* instead of horizontally.
|
|
54
|
+
*
|
|
55
|
+
* @defaultValue `false`
|
|
56
|
+
*/
|
|
18
57
|
stacked?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @since 6.0.0
|
|
62
|
+
* @since 6.3.1 Extends BaseTabClassNameOptions
|
|
63
|
+
*/
|
|
64
|
+
export interface TabClassNameOptions extends BaseTabClassNameOptions {
|
|
65
|
+
active?: boolean;
|
|
66
|
+
isLink?: boolean;
|
|
19
67
|
reversed?: boolean;
|
|
20
68
|
disabled?: boolean;
|
|
21
69
|
}
|
package/src/tabs/useTabList.ts
CHANGED
|
@@ -176,6 +176,7 @@ export function useTabList(
|
|
|
176
176
|
const forwardRef = useRef<HTMLDivElement>(null);
|
|
177
177
|
const backwardRef = useRef<HTMLDivElement>(null);
|
|
178
178
|
const { movementProps, movementContext } = useKeyboardMovementProvider({
|
|
179
|
+
ref: tabListRef,
|
|
179
180
|
onClick(event) {
|
|
180
181
|
onClick(event);
|
|
181
182
|
if (event.isPropagationStopped() || !(event.target instanceof Element)) {
|
|
@@ -226,7 +227,6 @@ export function useTabList(
|
|
|
226
227
|
return {
|
|
227
228
|
elementProps: {
|
|
228
229
|
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
229
|
-
ref: tabListRef,
|
|
230
230
|
style: {
|
|
231
231
|
...style,
|
|
232
232
|
...(disableTransition ? undefined : indicatorStyles),
|
package/src/test-utils/drag.ts
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { fireEvent } from "@testing-library/dom";
|
|
2
2
|
import type { MouseEvent } from "react";
|
|
3
3
|
|
|
4
|
+
import { type Point } from "../types.js";
|
|
4
5
|
import { wait } from "../utils/wait.js";
|
|
5
6
|
|
|
6
|
-
interface XYCoords {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
7
|
interface BaseDragOptions {
|
|
12
|
-
to?:
|
|
13
|
-
from?:
|
|
14
|
-
delta?:
|
|
8
|
+
to?: Point | Element;
|
|
9
|
+
from?: Point;
|
|
10
|
+
delta?: Point;
|
|
15
11
|
steps?: number;
|
|
16
12
|
duration?: number;
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
type DragOptions = BaseDragOptions &
|
|
20
|
-
({ to:
|
|
16
|
+
({ to: Point | Element; delta?: never } | { delta: Point; to?: never });
|
|
21
17
|
|
|
22
|
-
const getElementClientCenter = (element: Element):
|
|
18
|
+
const getElementClientCenter = (element: Element): Point => {
|
|
23
19
|
const { left, top, width, height } = element.getBoundingClientRect();
|
|
24
20
|
return {
|
|
25
21
|
x: left + width / 2,
|
|
@@ -27,7 +23,7 @@ const getElementClientCenter = (element: Element): XYCoords => {
|
|
|
27
23
|
};
|
|
28
24
|
};
|
|
29
25
|
|
|
30
|
-
const getCoords = (elementOrCoords: Element |
|
|
26
|
+
const getCoords = (elementOrCoords: Element | Point): Point =>
|
|
31
27
|
"x" in elementOrCoords && "y" in elementOrCoords
|
|
32
28
|
? elementOrCoords
|
|
33
29
|
: getElementClientCenter(elementOrCoords);
|
|
@@ -58,7 +54,7 @@ export async function drag(
|
|
|
58
54
|
}
|
|
59
55
|
: getCoords(inTo);
|
|
60
56
|
|
|
61
|
-
const step:
|
|
57
|
+
const step: Point = {
|
|
62
58
|
x: (to.x - from.x) / steps,
|
|
63
59
|
y: (to.y - from.y) / steps,
|
|
64
60
|
};
|
|
@@ -17,32 +17,6 @@ import {
|
|
|
17
17
|
} from "./cssVars.js";
|
|
18
18
|
import { type ConfigurableThemeColors } from "./types.js";
|
|
19
19
|
|
|
20
|
-
declare module "react" {
|
|
21
|
-
interface CSSProperties {
|
|
22
|
-
"--rmd-background-color"?: string;
|
|
23
|
-
"--rmd-on-background-color"?: string;
|
|
24
|
-
"--rmd-surface-color"?: string;
|
|
25
|
-
"--rmd-primary-color"?: string;
|
|
26
|
-
"--rmd-on-primary-color"?: string;
|
|
27
|
-
"--rmd-secondary-color"?: string;
|
|
28
|
-
"--rmd-on-secondary-color"?: string;
|
|
29
|
-
"--rmd-warning-color"?: string;
|
|
30
|
-
"--rmd-on-warning-color"?: string;
|
|
31
|
-
"--rmd-error-color"?: string;
|
|
32
|
-
"--rmd-on-error-color"?: string;
|
|
33
|
-
"--rmd-success-color"?: string;
|
|
34
|
-
"--rmd-on-success-color"?: string;
|
|
35
|
-
"--rmd-text-primary-color"?: string;
|
|
36
|
-
"--rmd-text-secondary-color"?: string;
|
|
37
|
-
"--rmd-text-hint-color"?: string;
|
|
38
|
-
"--rmd-text-disabled-color"?: string;
|
|
39
|
-
|
|
40
|
-
"--rmd-outline-width"?: string | number;
|
|
41
|
-
"--rmd-outline-color"?: string;
|
|
42
|
-
"--rmd-outline-grey-color"?: string;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
20
|
/** @since 6.0.0 */
|
|
47
21
|
export const getDerivedTheme = (
|
|
48
22
|
container: Element = document.documentElement
|
package/src/theme/types.ts
CHANGED
|
@@ -2,6 +2,32 @@ import { type CSSProperties } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { type UseStateSetter } from "../types.js";
|
|
4
4
|
|
|
5
|
+
declare module "react" {
|
|
6
|
+
interface CSSProperties {
|
|
7
|
+
"--rmd-background-color"?: string;
|
|
8
|
+
"--rmd-on-background-color"?: string;
|
|
9
|
+
"--rmd-surface-color"?: string;
|
|
10
|
+
"--rmd-primary-color"?: string;
|
|
11
|
+
"--rmd-on-primary-color"?: string;
|
|
12
|
+
"--rmd-secondary-color"?: string;
|
|
13
|
+
"--rmd-on-secondary-color"?: string;
|
|
14
|
+
"--rmd-success-color"?: string;
|
|
15
|
+
"--rmd-on-success-color"?: string;
|
|
16
|
+
"--rmd-warning-color"?: string;
|
|
17
|
+
"--rmd-on-warning-color"?: string;
|
|
18
|
+
"--rmd-error-color"?: string;
|
|
19
|
+
"--rmd-on-error-color"?: string;
|
|
20
|
+
"--rmd-text-primary-color"?: string;
|
|
21
|
+
"--rmd-text-secondary-color"?: string;
|
|
22
|
+
"--rmd-text-hint-color"?: string;
|
|
23
|
+
"--rmd-text-disabled-color"?: string;
|
|
24
|
+
"--rmd-outline-width"?: string | number;
|
|
25
|
+
"--rmd-outline-color"?: string;
|
|
26
|
+
"--rmd-outline-grey-color"?: string;
|
|
27
|
+
"--rmd-inverse-color"?: string;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
5
31
|
/**
|
|
6
32
|
* @since 6.0.0
|
|
7
33
|
*/
|