Skip to content

Commit 243d4d9

Browse files
tidy: use snake-case for all filenames
1 parent 52dcff0 commit 243d4d9

File tree

11 files changed

+31
-27
lines changed

11 files changed

+31
-27
lines changed

lib/components/input/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { forwardRef, Input as ChakraInput } from '@chakra-ui/react';
33
import type { KeyboardEvent } from 'react';
44
import { memo, useCallback } from 'react';
55

6-
import { useGlobalModifiersImperativeAPI } from '../../hooks/useGlobalModifiers';
6+
import { useGlobalModifiersImperativeAPI } from '../../hooks/use-global-modifiers';
77
import { stopPastePropagation } from '../../util';
88

99
export type InputProps = ChakraInputProps;

lib/components/number-input/composite-number-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { clamp } from 'lodash-es';
55
import type { FocusEventHandler } from 'react';
66
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
77

8-
import { useShiftModifier } from '../../hooks/useGlobalModifiers';
8+
import { useShiftModifier } from '../../hooks/use-global-modifiers';
99
import { stopPastePropagation } from '../../util';
1010
import { NumberInputField } from './number-input-field';
1111
import type { NumberInputProps } from './wrapper';

lib/components/slider/composite-range-slider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AnimatePresence } from 'framer-motion';
44
import type React from 'react';
55
import { memo, useCallback, useMemo, useState } from 'react';
66

7-
import { useShiftModifier } from '../../hooks/useGlobalModifiers';
7+
import { useShiftModifier } from '../../hooks/use-global-modifiers';
88
import { Tooltip } from '../tooltip';
99
import type { FormattedSliderMark } from './composite-slider';
1010
import { RangeSliderMark } from './range-slider-mark';

lib/components/slider/composite-slider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isNil } from 'lodash-es';
55
import type React from 'react';
66
import { memo, useCallback, useMemo, useState } from 'react';
77

8-
import { useShiftModifier } from '../../hooks/useGlobalModifiers';
8+
import { useShiftModifier } from '../../hooks/use-global-modifiers';
99
import { Tooltip } from '../tooltip';
1010
import { SliderMark } from './slider-mark';
1111
import type { SliderProps } from './wrapper';

lib/hooks/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { useGlobalMenuClose } from './useGlobalMenuClose';
2-
export { useGlobalModifiersImperativeAPI, useGlobalModifiersInit } from './useGlobalModifiers';
1+
export { useGlobalMenuClose } from './use-global-menu-close';
2+
export { useGlobalModifiersImperativeAPI, useGlobalModifiersInit } from './use-global-modifiers';
File renamed without changes.
File renamed without changes.

lib/util/index.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
import type { ClipboardEvent, MouseEvent } from 'react';
2-
import { memo } from 'react';
3-
4-
/**
5-
* Prevents the default behavior of the event.
6-
*/
7-
export const skipMouseEvent = (e: MouseEvent) => {
8-
e.preventDefault();
9-
};
10-
11-
/**
12-
* A typed version of React.memo, useful for components that take generics.
13-
*/
14-
export const typedMemo: <T>(c: T) => T = memo;
15-
16-
/**
17-
* Stops the propagation of a clipboard event. Useful for preventing triggering an uploader element that catches pastes.
18-
*/
19-
export const stopPastePropagation = (e: ClipboardEvent) => {
20-
e.stopPropagation();
21-
};
1+
export { skipMouseEvent } from './skip-mouse-event';
2+
export { stopPastePropagation } from './stop-paste-propagation';
3+
export { typedMemo } from './typed-memo';

lib/util/skip-mouse-event.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { MouseEvent } from 'react';
2+
3+
/**
4+
* Prevents the default behavior of the event.
5+
*/
6+
export const skipMouseEvent = (e: MouseEvent) => {
7+
e.preventDefault();
8+
};

lib/util/stop-paste-propagation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { ClipboardEvent } from 'react';
2+
3+
/**
4+
* Stops the propagation of a clipboard event. Useful for preventing triggering an uploader element that catches pastes.
5+
*/
6+
export const stopPastePropagation = (e: ClipboardEvent) => {
7+
e.stopPropagation();
8+
};

0 commit comments

Comments
 (0)