@fluentui/react-input 9.0.0-beta.7 → 9.0.0-rc.2

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.
@@ -1,79 +0,0 @@
1
- import * as React from 'react';
2
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
- export declare type InputSlots = {
4
- /**
5
- * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.
6
- * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)
7
- *
8
- * The root slot receives the `className` and `style` specified directly on the `<Input>`.
9
- * All other top-level native props will be applied to the primary slot, `input`.
10
- */
11
- root: NonNullable<Slot<'span'>>;
12
- /**
13
- * The actual `<input>` element. `type="text"` will be automatically applied unless overridden.
14
- *
15
- * This is the "primary" slot, so native props specified directly on the `<Input>` will go here
16
- * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will
17
- * also go here.
18
- */
19
- input: NonNullable<Slot<'input'>>;
20
- /** Element before the input text, within the input border */
21
- contentBefore?: Slot<'span'>;
22
- /** Element after the input text, within the input border */
23
- contentAfter?: Slot<'span'>;
24
- };
25
- export declare type InputProps = Omit<ComponentProps<Partial<InputSlots>, 'input'>, 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'> & {
26
- /** Input can't have children. */
27
- children?: never;
28
- /**
29
- * Size of the input (changes the font size and spacing).
30
- * @default 'medium'
31
- */
32
- size?: 'small' | 'medium' | 'large';
33
- /**
34
- * Controls the colors and borders of the input.
35
- * @default 'outline'
36
- */
37
- appearance?: 'outline' | 'underline' | 'filledDarker' | 'filledLighter';
38
- /**
39
- * Default value of the input. Provide this if the input should be an uncontrolled component
40
- * which tracks its current state internally; otherwise, use `value`.
41
- *
42
- * (This prop is mutually exclusive with `value`.)
43
- */
44
- defaultValue?: string;
45
- /**
46
- * Current value of the input. Provide this if the input is a controlled component where you
47
- * are maintaining its current state; otherwise, use `defaultValue`.
48
- *
49
- * (This prop is mutually exclusive with `defaultValue`.)
50
- */
51
- value?: string;
52
- /**
53
- * Called when the user changes the input's value.
54
- */
55
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;
56
- /**
57
- * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)
58
- * based on the type of value the user will enter.
59
- *
60
- * Note that no custom styling is currently applied for alternative types, and some types may
61
- * activate browser-default styling which does not match the Fluent design language.
62
- *
63
- * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an
64
- * `<input>` element instead.)
65
- * @default 'text'
66
- */
67
- type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local' | 'month' | 'number' | 'time' | 'week';
68
- };
69
- /**
70
- * State used in rendering Input.
71
- */
72
- export declare type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;
73
- /**
74
- * Data passed to the `onChange` callback when a user changes the input's value.
75
- */
76
- export declare type InputOnChangeData = {
77
- /** Updated input value from the user */
78
- value: string;
79
- };
@@ -1,5 +0,0 @@
1
- export * from './Input';
2
- export * from './Input.types';
3
- export * from './renderInput';
4
- export * from './useInput';
5
- export * from './useInputStyles';
@@ -1,5 +0,0 @@
1
- import type { InputState } from './Input.types';
2
- /**
3
- * Render the final JSX of Input
4
- */
5
- export declare const renderInput_unstable: (state: InputState) => JSX.Element;
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import type { InputProps, InputState } from './Input.types';
3
- /**
4
- * Create the state required to render Input.
5
- *
6
- * The returned state can be modified with hooks such as useInputStyles_unstable,
7
- * before being passed to renderInput_unstable.
8
- *
9
- * @param props - props from this instance of Input
10
- * @param ref - reference to `<input>` element of Input
11
- */
12
- export declare const useInput_unstable: (props: InputProps, ref: React.Ref<HTMLInputElement>) => InputState;
@@ -1,11 +0,0 @@
1
- import type { InputSlots, InputState } from './Input.types';
2
- import type { SlotClassNames } from '@fluentui/react-utilities';
3
- /**
4
- * @deprecated Use `inputClassNames.root` instead.
5
- */
6
- export declare const inputClassName = "fui-Input";
7
- export declare const inputClassNames: SlotClassNames<InputSlots>;
8
- /**
9
- * Apply styling to the Input slots based on the state
10
- */
11
- export declare const useInputStyles_unstable: (state: InputState) => InputState;
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { Input, inputClassName, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable, } from './Input';
2
- export type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';
@@ -1 +0,0 @@
1
- export * from './components/Input/index';
@@ -1,6 +0,0 @@
1
- import type { InputProps } from './Input.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * The Input component allows people to enter and edit text.
5
- */
6
- export declare const Input: ForwardRefComponent<InputProps>;
@@ -1,79 +0,0 @@
1
- import * as React from 'react';
2
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
- export declare type InputSlots = {
4
- /**
5
- * Wrapper element which visually appears to be the input and is used for borders, focus styling, etc.
6
- * (A wrapper is needed to properly position `contentBefore` and `contentAfter` relative to `input`.)
7
- *
8
- * The root slot receives the `className` and `style` specified directly on the `<Input>`.
9
- * All other top-level native props will be applied to the primary slot, `input`.
10
- */
11
- root: NonNullable<Slot<'span'>>;
12
- /**
13
- * The actual `<input>` element. `type="text"` will be automatically applied unless overridden.
14
- *
15
- * This is the "primary" slot, so native props specified directly on the `<Input>` will go here
16
- * (except `className` and `style`, which go to the `root` slot). The top-level `ref` will
17
- * also go here.
18
- */
19
- input: NonNullable<Slot<'input'>>;
20
- /** Element before the input text, within the input border */
21
- contentBefore?: Slot<'span'>;
22
- /** Element after the input text, within the input border */
23
- contentAfter?: Slot<'span'>;
24
- };
25
- export declare type InputProps = Omit<ComponentProps<Partial<InputSlots>, 'input'>, 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'> & {
26
- /** Input can't have children. */
27
- children?: never;
28
- /**
29
- * Size of the input (changes the font size and spacing).
30
- * @default 'medium'
31
- */
32
- size?: 'small' | 'medium' | 'large';
33
- /**
34
- * Controls the colors and borders of the input.
35
- * @default 'outline'
36
- */
37
- appearance?: 'outline' | 'underline' | 'filledDarker' | 'filledLighter';
38
- /**
39
- * Default value of the input. Provide this if the input should be an uncontrolled component
40
- * which tracks its current state internally; otherwise, use `value`.
41
- *
42
- * (This prop is mutually exclusive with `value`.)
43
- */
44
- defaultValue?: string;
45
- /**
46
- * Current value of the input. Provide this if the input is a controlled component where you
47
- * are maintaining its current state; otherwise, use `defaultValue`.
48
- *
49
- * (This prop is mutually exclusive with `defaultValue`.)
50
- */
51
- value?: string;
52
- /**
53
- * Called when the user changes the input's value.
54
- */
55
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;
56
- /**
57
- * An input can have different text-based [types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types)
58
- * based on the type of value the user will enter.
59
- *
60
- * Note that no custom styling is currently applied for alternative types, and some types may
61
- * activate browser-default styling which does not match the Fluent design language.
62
- *
63
- * (For non-text-based types such as `button` or `checkbox`, use the appropriate component or an
64
- * `<input>` element instead.)
65
- * @default 'text'
66
- */
67
- type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local' | 'month' | 'number' | 'time' | 'week';
68
- };
69
- /**
70
- * State used in rendering Input.
71
- */
72
- export declare type InputState = Required<Pick<InputProps, 'appearance' | 'size'>> & ComponentState<InputSlots>;
73
- /**
74
- * Data passed to the `onChange` callback when a user changes the input's value.
75
- */
76
- export declare type InputOnChangeData = {
77
- /** Updated input value from the user */
78
- value: string;
79
- };
@@ -1,5 +0,0 @@
1
- export * from './Input';
2
- export * from './Input.types';
3
- export * from './renderInput';
4
- export * from './useInput';
5
- export * from './useInputStyles';
@@ -1,5 +0,0 @@
1
- import type { InputState } from './Input.types';
2
- /**
3
- * Render the final JSX of Input
4
- */
5
- export declare const renderInput_unstable: (state: InputState) => JSX.Element;
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import type { InputProps, InputState } from './Input.types';
3
- /**
4
- * Create the state required to render Input.
5
- *
6
- * The returned state can be modified with hooks such as useInputStyles_unstable,
7
- * before being passed to renderInput_unstable.
8
- *
9
- * @param props - props from this instance of Input
10
- * @param ref - reference to `<input>` element of Input
11
- */
12
- export declare const useInput_unstable: (props: InputProps, ref: React.Ref<HTMLInputElement>) => InputState;
@@ -1,11 +0,0 @@
1
- import type { InputSlots, InputState } from './Input.types';
2
- import type { SlotClassNames } from '@fluentui/react-utilities';
3
- /**
4
- * @deprecated Use `inputClassNames.root` instead.
5
- */
6
- export declare const inputClassName = "fui-Input";
7
- export declare const inputClassNames: SlotClassNames<InputSlots>;
8
- /**
9
- * Apply styling to the Input slots based on the state
10
- */
11
- export declare const useInputStyles_unstable: (state: InputState) => InputState;
@@ -1,2 +0,0 @@
1
- export { Input, inputClassName, inputClassNames, renderInput_unstable, useInputStyles_unstable, useInput_unstable, } from './Input';
2
- export type { InputOnChangeData, InputProps, InputSlots, InputState } from './Input';