Skip to content

Commit

Permalink
chore(NumberInput): move component to lab
Browse files Browse the repository at this point in the history
  • Loading branch information
DaryaLari committed Sep 26, 2024
1 parent 908e8a4 commit cd9c3bd
Show file tree
Hide file tree
Showing 49 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import React from 'react';
import {KeyCode} from '../../../constants';
import {useForkRef} from '../../../hooks';
import {useFormResetHandler} from '../../../hooks/private';
import {TextInput} from '../../controls/TextInput';
import {defaultBaseTextInputProps} from '../../controls/TextInput/TextInput';
import type {BaseInputControlProps} from '../../controls/types';
import {getInputControlState} from '../../controls/utils';
import {block} from '../../utils/cn';
import {TextInput} from '../TextInput';
import {defaultBaseTextInputProps} from '../TextInput/TextInput';
import type {BaseInputControlProps} from '../types';
import {getInputControlState} from '../utils';

import {NumericArrows} from './NumericArrows/NumericArrows';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {ChevronDown, ChevronUp} from '@gravity-ui/icons';
import {Button} from '../../../Button';
import type {ButtonProps} from '../../../Button';
import {Icon} from '../../../Icon';
import type {InputControlSize} from '../../../controls/types';
import {Flex} from '../../../layout';
import {block} from '../../../utils/cn';
import type {InputControlSize} from '../../types';
import i18n from '../i18n';
import {CONTROL_BUTTONS_QA, DECREMENT_BUTTON_QA, INCREMENT_BUTTON_QA} from '../utils';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!--/GITHUB_BLOCK-->

```tsx
import {NumberInput} from '@gravity-ui/uikit';
import {unstable_NumberInput as NumberInput} from '@gravity-ui/uikit/unstable';
```

NumberInput allow users to enter numbers into a UI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {NumberInputShowcase} from './NumberInputShowcase';
import {NumberInputSizes} from './NumberInputSizes';

export default {
title: 'Components/Inputs/NumberInput',
title: 'Lab/NumberInput',
component: NumberInput,
parameters: {
a11y: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {ArrowShapeUpToLine, CircleDollar} from '@gravity-ui/icons';
import {Button} from '../../../Button';
import {Icon} from '../../../Icon';
import {Text} from '../../../Text';
import {mapTextInputSizeToButtonSize} from '../../../controls/common';
import {Flex} from '../../../layout';
import {cn} from '../../../utils/cn';
import {mapTextInputSizeToButtonSize} from '../../common';
import {NumberInput} from '../NumberInput';
import type {NumberInputProps} from '../NumberInput';
import {getNumericInputValidator} from '../utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {ArrowShapeUpToLine, CircleDollar} from '@gravity-ui/icons';
import {Button} from '../../../Button';
import {Checkbox} from '../../../Checkbox';
import {Icon} from '../../../Icon';
import {mapTextInputSizeToButtonSize} from '../../../controls/common';
import type {InputControlSize} from '../../../controls/types';
import {Flex} from '../../../layout';
import {cn} from '../../../utils/cn';
import {mapTextInputSizeToButtonSize} from '../../common';
import type {InputControlSize} from '../../types';
import {NumberInput} from '../NumberInput';
import type {NumberInputProps} from '../NumberInput';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';

import {act, fireEvent, render, screen} from '../../../../../test-utils/utils';
import {KeyCode} from '../../../../constants';
import {CONTROL_ERROR_ICON_QA} from '../../utils';
import {CONTROL_ERROR_ICON_QA} from '../../../controls/utils';
import {NumberInput} from '../NumberInput';
import {CONTROL_BUTTONS_QA, DECREMENT_BUTTON_QA, INCREMENT_BUTTON_QA} from '../utils';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export {NumberInput} from './NumberInput';
export type {NumberInputProps} from './NumberInput';

export {getNumericInputValidator} from './utils';
export type {GetNumericInputValidatorParams} from './utils';
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const INCREMENT_BUTTON_QA = 'increment-button-qa';
export const DECREMENT_BUTTON_QA = 'decrement-button-qa';
export const CONTROL_BUTTONS_QA = 'control-buttons-qa';

interface GetNumericInputValidatorParams {
export interface GetNumericInputValidatorParams {
positiveOnly: boolean;
withoutFraction: boolean;
min?: number;
Expand Down
9 changes: 9 additions & 0 deletions src/unstable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ export type {
BreadcrumbsProps as unstable_BreadcrumbsProps,
BreadcrumbsItemProps as unstable_BreadcrumbsItemProps,
} from './components/lab/Breadcrumbs';

export {
NumberInput as unstable_NumberInput,
getNumericInputValidator as unstable_getNumericInputValidator,
} from './components/lab/NumberInput';
export type {
NumberInputProps as unstable_NumberInputProps,
GetNumericInputValidatorParams as unstable_GetNumericInputValidatorParams,
} from './components/lab/NumberInput';

0 comments on commit cd9c3bd

Please sign in to comment.