@theroutingcompany/components 0.0.71-alpha.3 → 0.0.71-alpha.5
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/trc-components.es.js +5921 -5842
- package/dist/trc-components.es.js.map +1 -1
- package/dist/trc-components.umd.js +410 -411
- package/dist/trc-components.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/types/components/Calendar/TimeDateSelect.d.ts +2 -0
- package/types/components/ComboBox/ComboBox.d.ts +2 -2
- package/types/components/FormControl/FormControl.d.ts +9 -69
- package/types/components/Input/NumberInput/NumberInput.d.ts +5 -1
- package/types/components/Input/TextArea/TextArea.d.ts +5 -1
- package/types/components/Input/TextInput/TextInput.d.ts +11 -3
- package/types/components/ListBox/ListBox.d.ts +3 -1
- package/types/components/MultiSelect/useMultiSelectState.d.ts +6 -6
- package/types/components/Search/Search.d.ts +1 -1
- package/types/components/SingleSelect/SingleSelect.d.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theroutingcompany/components",
|
|
3
|
-
"version": "0.0.71-alpha.
|
|
3
|
+
"version": "0.0.71-alpha.5",
|
|
4
4
|
"description": "The Routing Company Components",
|
|
5
5
|
"main": "./dist/trc-components.umd.js",
|
|
6
6
|
"module": "./dist/trc-components.es.js",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"@react-stately/searchfield": "^3.4.2",
|
|
98
98
|
"@react-stately/select": "^3.5.1",
|
|
99
99
|
"@react-stately/selection": "^3.13.1",
|
|
100
|
+
"@react-stately/tree": "^3.7.6",
|
|
100
101
|
"@react-types/calendar": "^3.2.1",
|
|
101
102
|
"@react-types/combobox": "^3.6.2",
|
|
102
103
|
"@react-types/datepicker": "^3.3.1",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
|
+
export declare const TriggerContent: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
5
|
+
export declare const DropdownContent: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
4
6
|
export interface TimeDateSelectOutput {
|
|
5
7
|
day: number;
|
|
6
8
|
month: number;
|
|
@@ -6,7 +6,7 @@ declare function ComboBox<T extends object>(props: ComboBoxProps<T> & {
|
|
|
6
6
|
errorMessage?: string;
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare namespace ComboBox {
|
|
9
|
-
var Item: <T>(props: import("@react-types/shared").ItemProps<T>) => JSX.Element;
|
|
10
|
-
var Section: <T>(props: import("@react-types/shared").SectionProps<T>) => JSX.Element;
|
|
9
|
+
var Item: <T>(props: import("@react-types/shared").ItemProps<T>) => React.JSX.Element;
|
|
10
|
+
var Section: <T>(props: import("@react-types/shared").SectionProps<T>) => React.JSX.Element;
|
|
11
11
|
}
|
|
12
12
|
export default ComboBox;
|
|
@@ -1,85 +1,25 @@
|
|
|
1
|
-
import { type PropsWithChildren, type ReactNode } from 'react';
|
|
2
1
|
import { type AriaFieldProps, type FieldAria } from '@react-aria/label';
|
|
3
2
|
import type { AriaTextFieldProps } from '@react-aria/textfield';
|
|
3
|
+
import { type NumberInputProps } from 'components/Input/NumberInput/NumberInput';
|
|
4
|
+
import { type TextAreaInputProps } from 'components/Input/TextArea/TextArea';
|
|
5
|
+
import { type PropsWithChildren, type ReactNode } from 'react';
|
|
4
6
|
import type { ComponentPropsWithoutStyles } from '../../helpers/typeHelpers';
|
|
5
7
|
type FormControlProps<FieldProps = AriaFieldProps> = PropsWithChildren<{
|
|
8
|
+
errorMessage?: ReactNode;
|
|
6
9
|
tooltipContent?: string;
|
|
7
10
|
tooltipIcon?: ReactNode;
|
|
8
11
|
} & FieldProps>;
|
|
9
|
-
/** If in a `<FormControl/>`, read `fieldProps` generated by that FormControl's `useField` hook */
|
|
10
12
|
export declare function useFieldProps(): FieldAria['fieldProps'];
|
|
11
13
|
export declare function FormControl({ children, label, errorMessage, description, tooltipContent, tooltipIcon, validationState, id, ...props }: FormControlProps): import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export declare const TextFormControl: import("react").ForwardRefExoticComponent<{
|
|
15
|
+
errorMessage?: ReactNode;
|
|
13
16
|
tooltipContent?: string | undefined;
|
|
14
17
|
tooltipIcon?: ReactNode;
|
|
15
18
|
} & AriaTextFieldProps & {
|
|
16
19
|
children?: ReactNode;
|
|
17
20
|
} & Omit<ComponentPropsWithoutStyles<"input">, "onChange"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
} & ComponentPropsWithoutStyles<"textarea"> & {
|
|
24
|
-
label?: ReactNode;
|
|
25
|
-
pattern?: string | undefined;
|
|
26
|
-
id?: string | undefined;
|
|
27
|
-
name?: string | undefined;
|
|
28
|
-
type?: "search" | "text" | (string & {}) | "tel" | "url" | "email" | "password" | undefined;
|
|
29
|
-
'aria-activedescendant'?: string | undefined;
|
|
30
|
-
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
31
|
-
'aria-describedby'?: string | undefined;
|
|
32
|
-
'aria-details'?: string | undefined;
|
|
33
|
-
'aria-errormessage'?: string | undefined;
|
|
34
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
|
|
35
|
-
'aria-label'?: string | undefined;
|
|
36
|
-
'aria-labelledby'?: string | undefined;
|
|
37
|
-
onCopy?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
38
|
-
onCut?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
39
|
-
onPaste?: import("react").ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
40
|
-
onCompositionEnd?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
|
|
41
|
-
onCompositionStart?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
|
|
42
|
-
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLInputElement> | undefined;
|
|
43
|
-
onFocus?: ((e: import("react").FocusEvent<Element, Element>) => void) | undefined;
|
|
44
|
-
onBlur?: ((e: import("react").FocusEvent<Element, Element>) => void) | undefined;
|
|
45
|
-
onChange?: ((value: string) => void) | undefined;
|
|
46
|
-
onBeforeInput?: import("react").FormEventHandler<HTMLInputElement> | undefined;
|
|
47
|
-
onInput?: import("react").FormEventHandler<HTMLInputElement> | undefined;
|
|
48
|
-
onKeyDown?: ((e: import("@react-types/shared").KeyboardEvent) => void) | undefined;
|
|
49
|
-
onKeyUp?: ((e: import("@react-types/shared").KeyboardEvent) => void) | undefined;
|
|
50
|
-
onSelect?: import("react").ReactEventHandler<HTMLInputElement> | undefined;
|
|
51
|
-
defaultValue?: string | undefined;
|
|
52
|
-
autoFocus?: boolean | undefined;
|
|
53
|
-
placeholder?: string | undefined;
|
|
54
|
-
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
55
|
-
disabled?: boolean | undefined;
|
|
56
|
-
value?: string | undefined;
|
|
57
|
-
autoComplete?: string | undefined;
|
|
58
|
-
maxLength?: number | undefined;
|
|
59
|
-
minLength?: number | undefined;
|
|
60
|
-
readOnly?: boolean | undefined;
|
|
61
|
-
required?: boolean | undefined;
|
|
62
|
-
description?: ReactNode;
|
|
63
|
-
onFocusChange?: ((isFocused: boolean) => void) | undefined;
|
|
64
|
-
excludeFromTabOrder?: boolean | undefined;
|
|
65
|
-
validationState?: import("@react-types/shared").ValidationState | undefined;
|
|
66
|
-
errorMessage?: ReactNode;
|
|
67
|
-
} & import("components/Input/InputBase").InputBaseProps & {
|
|
68
|
-
rows?: number | undefined;
|
|
69
|
-
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
70
|
-
export declare const NumberFormControl: import("react").ForwardRefExoticComponent<{
|
|
71
|
-
tooltipContent?: string | undefined;
|
|
72
|
-
tooltipIcon?: ReactNode;
|
|
73
|
-
} & AriaFieldProps & {
|
|
74
|
-
children?: ReactNode;
|
|
75
|
-
} & Omit<import("../../helpers/typeHelpers").RenameBooleanProps<import("@react-types/numberfield").AriaNumberFieldProps>, "minValue" | "maxValue"> & {
|
|
76
|
-
min?: number | undefined;
|
|
77
|
-
max?: number | undefined;
|
|
78
|
-
} & import("components/Input/InputBase").InputBaseProps & {
|
|
79
|
-
name?: string | undefined;
|
|
80
|
-
} & {
|
|
81
|
-
showStepper?: boolean | undefined;
|
|
82
|
-
} & {
|
|
83
|
-
locale?: string | undefined;
|
|
84
|
-
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
21
|
+
type TextAreaFormControlProps = FormControlProps & ComponentPropsWithoutStyles<'textarea'> & TextAreaInputProps;
|
|
22
|
+
export declare const TextAreaFormControl: import("react").ForwardRefExoticComponent<Omit<TextAreaFormControlProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
23
|
+
type NumberFormControlProps = FormControlProps & NumberInputProps;
|
|
24
|
+
export declare const NumberFormControl: import("react").ForwardRefExoticComponent<Omit<NumberFormControlProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
85
25
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type AriaNumberFieldProps } from '@react-aria/numberfield';
|
|
3
2
|
import { type NumberFieldStateOptions } from '@react-stately/numberfield';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
4
|
import type { ComponentPropsWithoutStyles, RenameBooleanProps, RenameMissuffixedProps } from '../../../helpers/typeHelpers';
|
|
5
5
|
import { type InputBaseProps } from '../InputBase';
|
|
6
6
|
type ReactAriaNumberInputProps = RenameMissuffixedProps<RenameBooleanProps<AriaNumberFieldProps>, 'Value', 'minValue' | 'maxValue'>;
|
|
@@ -10,6 +10,8 @@ type ShowStepper = {
|
|
|
10
10
|
type StandardInputProps = Pick<ComponentPropsWithoutStyles<'input'>, 'name'>;
|
|
11
11
|
export type NumberInputProps = ReactAriaNumberInputProps & InputBaseProps & StandardInputProps & ShowStepper & {
|
|
12
12
|
locale?: NumberFieldStateOptions['locale'];
|
|
13
|
+
errorMessage?: ReactNode;
|
|
14
|
+
required?: boolean;
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* Use cases
|
|
@@ -37,5 +39,7 @@ export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit
|
|
|
37
39
|
max?: number | undefined;
|
|
38
40
|
} & InputBaseProps & StandardInputProps & ShowStepper & {
|
|
39
41
|
locale?: string | undefined;
|
|
42
|
+
errorMessage?: ReactNode;
|
|
43
|
+
required?: boolean | undefined;
|
|
40
44
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
41
45
|
export {};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type AriaTextFieldOptions } from '@react-aria/textfield';
|
|
3
3
|
import type { RenameBooleanProps } from '../../../helpers/typeHelpers';
|
|
4
4
|
import { type InputBaseProps } from '../InputBase';
|
|
5
5
|
type ReactAriaInputProps = Omit<RenameBooleanProps<AriaTextFieldOptions<'textarea'>>, 'inputElementType'>;
|
|
6
6
|
export type TextAreaInputProps = ReactAriaInputProps & InputBaseProps & {
|
|
7
7
|
rows?: number;
|
|
8
|
+
errorMessage?: ReactNode;
|
|
9
|
+
validationState?: 'valid' | 'invalid' | 'invalid-disabled';
|
|
8
10
|
};
|
|
9
11
|
export declare const TextAreaInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & {
|
|
10
12
|
rows?: number | undefined;
|
|
13
|
+
errorMessage?: ReactNode;
|
|
14
|
+
validationState?: "invalid" | "valid" | "invalid-disabled" | undefined;
|
|
11
15
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
12
16
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type AriaTextFieldOptions } from '@react-aria/textfield';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import type { RenameBooleanProps } from '../../../helpers/typeHelpers';
|
|
4
4
|
import { type InputBaseProps, type InputRadius } from '../InputBase';
|
|
5
5
|
type ReactAriaInputProps = Omit<RenameBooleanProps<AriaTextFieldOptions<'input'>>, 'inputElementType'>;
|
|
@@ -13,6 +13,14 @@ interface CustomTextInputProps {
|
|
|
13
13
|
connectRight?: React.ReactNode | null;
|
|
14
14
|
className?: string;
|
|
15
15
|
}
|
|
16
|
-
export type TextInputProps = ReactAriaInputProps & InputBaseProps & CustomTextInputProps
|
|
17
|
-
|
|
16
|
+
export type TextInputProps = ReactAriaInputProps & InputBaseProps & CustomTextInputProps & {
|
|
17
|
+
validationState?: 'valid' | 'invalid' | 'invalid-disabled';
|
|
18
|
+
errorMessage?: ReactNode;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & CustomTextInputProps & {
|
|
22
|
+
validationState?: "invalid" | "valid" | "invalid-disabled" | undefined;
|
|
23
|
+
errorMessage?: ReactNode;
|
|
24
|
+
required?: boolean | undefined;
|
|
25
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
18
26
|
export {};
|
|
@@ -34,5 +34,7 @@ interface ListBoxPopoverProps extends Omit<AriaPopoverProps, 'popoverRef'> {
|
|
|
34
34
|
state: OverlayTriggerState;
|
|
35
35
|
popoverRef?: React.RefObject<HTMLDivElement>;
|
|
36
36
|
}
|
|
37
|
-
export declare function ListBoxPopover(props: ListBoxPopoverProps
|
|
37
|
+
export declare function ListBoxPopover(props: Omit<ListBoxPopoverProps, 'triggerRef'> & {
|
|
38
|
+
targetRef: React.RefObject<HTMLElement>;
|
|
39
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
38
40
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { MenuTriggerState } from
|
|
2
|
-
import type { OverlayTriggerProps } from
|
|
3
|
-
import type { AsyncLoadable, CollectionBase, FocusableProps, InputBase, LabelableProps, MultipleSelection, TextInputBase, Validation } from
|
|
4
|
-
import type { MultiSelectListState } from
|
|
5
|
-
export interface MultiSelectProps<T> extends CollectionBase<T>, AsyncLoadable, Omit<InputBase,
|
|
1
|
+
import type { MenuTriggerState } from '@react-stately/menu';
|
|
2
|
+
import type { OverlayTriggerProps } from '@react-types/overlays';
|
|
3
|
+
import type { AsyncLoadable, CollectionBase, FocusableProps, InputBase, LabelableProps, MultipleSelection, TextInputBase, Validation } from '@react-types/shared';
|
|
4
|
+
import type { MultiSelectListState } from './useMultiSelectListState';
|
|
5
|
+
export interface MultiSelectProps<T> extends CollectionBase<T>, AsyncLoadable, Omit<InputBase, 'isReadOnly'>, Validation<T>, LabelableProps, TextInputBase, MultipleSelection, FocusableProps, OverlayTriggerProps {
|
|
6
6
|
/**
|
|
7
7
|
* Whether the menu should automatically flip direction when space is limited.
|
|
8
8
|
* @default true
|
|
@@ -15,4 +15,4 @@ export interface MultiSelectState<T> extends MultiSelectListState<T>, MenuTrigge
|
|
|
15
15
|
/** Sets whether the select is focused. */
|
|
16
16
|
setFocused(isFocused: boolean): void;
|
|
17
17
|
}
|
|
18
|
-
export declare function useMultiSelectState<T extends
|
|
18
|
+
export declare function useMultiSelectState<T extends object>(props: MultiSelectProps<T>): MultiSelectState<T>;
|
|
@@ -7,6 +7,6 @@ export declare const Search: import("react").ForwardRefExoticComponent<{
|
|
|
7
7
|
height?: string | undefined;
|
|
8
8
|
} & Omit<AriaSearchFieldProps, "isDisabled" | "isRequired" | "isReadOnly"> & {
|
|
9
9
|
disabled?: boolean | undefined;
|
|
10
|
-
required?:
|
|
10
|
+
required?: unknown;
|
|
11
11
|
readOnly?: boolean | undefined;
|
|
12
12
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -6,6 +6,11 @@ type SingleSelectProps<T> = AriaSelectProps<T> & {
|
|
|
6
6
|
tooltipContent?: string;
|
|
7
7
|
showCaret?: boolean;
|
|
8
8
|
};
|
|
9
|
+
type PlaceholderProps = {
|
|
10
|
+
lineHeight?: number | string;
|
|
11
|
+
fontSize?: number | string;
|
|
12
|
+
};
|
|
13
|
+
export declare const Placeholder: import("styled-components").StyledComponent<"span", any, PlaceholderProps, never>;
|
|
9
14
|
export declare function SingleSelect<T extends object>(props: SingleSelectProps<T> & {
|
|
10
15
|
hideLabel?: boolean | undefined;
|
|
11
16
|
errorMessage?: string;
|