@theroutingcompany/components 0.0.71-alpha.6 → 0.0.73-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theroutingcompany/components",
3
- "version": "0.0.71-alpha.6",
3
+ "version": "0.0.73-alpha.1",
4
4
  "description": "The Routing Company Components",
5
5
  "main": "./dist/trc-components.umd.js",
6
6
  "module": "./dist/trc-components.es.js",
@@ -97,7 +97,6 @@
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",
101
100
  "@react-types/calendar": "^3.2.1",
102
101
  "@react-types/combobox": "^3.6.2",
103
102
  "@react-types/datepicker": "^3.3.1",
@@ -1,8 +1,6 @@
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>;
6
4
  export interface TimeDateSelectOutput {
7
5
  day: number;
8
6
  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>) => React.JSX.Element;
10
- var Section: <T>(props: import("@react-types/shared").SectionProps<T>) => React.JSX.Element;
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;
11
11
  }
12
12
  export default ComboBox;
@@ -1,25 +1,83 @@
1
+ import { type PropsWithChildren, type ReactNode } from 'react';
1
2
  import { type AriaFieldProps, type FieldAria } from '@react-aria/label';
2
3
  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';
6
4
  import type { ComponentPropsWithoutStyles } from '../../helpers/typeHelpers';
7
5
  type FormControlProps<FieldProps = AriaFieldProps> = PropsWithChildren<{
8
- errorMessage?: ReactNode;
9
6
  tooltipContent?: string;
10
7
  tooltipIcon?: ReactNode;
11
8
  } & FieldProps>;
9
+ /** If in a `<FormControl/>`, read `fieldProps` generated by that FormControl's `useField` hook */
12
10
  export declare function useFieldProps(): FieldAria['fieldProps'];
13
11
  export declare function FormControl({ children, label, errorMessage, description, tooltipContent, tooltipIcon, validationState, id, ...props }: FormControlProps): import("react/jsx-runtime").JSX.Element;
14
12
  export declare const TextFormControl: import("react").ForwardRefExoticComponent<{
15
- errorMessage?: ReactNode;
16
13
  tooltipContent?: string | undefined;
17
14
  tooltipIcon?: ReactNode;
18
15
  } & AriaTextFieldProps & {
19
16
  children?: ReactNode;
20
17
  } & Omit<ComponentPropsWithoutStyles<"input">, "onChange"> & 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>>;
18
+ export declare const TextAreaFormControl: import("react").ForwardRefExoticComponent<{
19
+ tooltipContent?: string | undefined;
20
+ tooltipIcon?: ReactNode;
21
+ } & AriaFieldProps & {
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 & import("react").RefAttributes<HTMLTextAreaElement>>;
68
+ export declare const NumberFormControl: import("react").ForwardRefExoticComponent<{
69
+ tooltipContent?: string | undefined;
70
+ tooltipIcon?: ReactNode;
71
+ } & AriaFieldProps & {
72
+ children?: ReactNode;
73
+ } & Omit<import("../../helpers/typeHelpers").RenameBooleanProps<import("@react-types/numberfield").AriaNumberFieldProps>, "minValue" | "maxValue"> & {
74
+ min?: number | undefined;
75
+ max?: number | undefined;
76
+ } & import("components/Input/InputBase").InputBaseProps & {
77
+ name?: string | undefined;
78
+ } & {
79
+ showStepper?: boolean | undefined;
80
+ } & {
81
+ locale?: string | undefined;
82
+ } & import("react").RefAttributes<HTMLInputElement>>;
25
83
  export {};
@@ -1,33 +1,11 @@
1
1
  import tokens from '@theroutingcompany/design-tokens';
2
- import { type FlattenSimpleInterpolation } from 'styled-components';
3
2
  export type InputSize = 'small' | 'large';
4
3
  export type InputRadius = typeof tokens.border_radius_0 | typeof tokens.border_radius_100 | typeof tokens.border_radius_200 | typeof tokens.border_radius_400 | typeof tokens.border_radius_800;
5
- export interface InputBaseProps {
4
+ export type InputBaseProps = {
6
5
  borderRadius?: InputRadius;
7
6
  paddingSize?: InputSize;
8
7
  height?: number | string;
9
- fontSize?: number | string;
10
- lineHeight?: number | string;
11
- }
12
- export declare const inputPadding: {
13
- readonly small: ".293rem .5rem";
14
- readonly large: ".5rem .5rem";
15
8
  };
16
- export declare const inputHeight: {
17
- readonly small: "2rem";
18
- readonly large: "2.25rem";
19
- };
20
- export declare function placeholderStyles({ lineHeight, fontSize, }: {
21
- lineHeight?: string | number;
22
- fontSize?: string | number;
23
- }): FlattenSimpleInterpolation;
24
- export declare function defaultTypography({ lineHeight, fontSize, }: {
25
- lineHeight?: string | number;
26
- fontSize?: string | number;
27
- }): FlattenSimpleInterpolation;
28
- export declare function defaultFormInput({ paddingSize, }: {
29
- paddingSize?: string;
30
- }): FlattenSimpleInterpolation;
31
9
  export declare const InputBase: import("styled-components").StyledComponent<"input", any, InputBaseProps, never>;
32
10
  export declare const InputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
33
11
  export declare const InputErrorMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,6 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { type AriaNumberFieldProps } from '@react-aria/numberfield';
2
3
  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,8 +10,6 @@ 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;
15
13
  };
16
14
  /**
17
15
  * Use cases
@@ -39,7 +37,5 @@ export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit
39
37
  max?: number | undefined;
40
38
  } & InputBaseProps & StandardInputProps & ShowStepper & {
41
39
  locale?: string | undefined;
42
- errorMessage?: ReactNode;
43
- required?: boolean | undefined;
44
40
  } & import("react").RefAttributes<HTMLInputElement>>;
45
41
  export {};
@@ -1,16 +1,8 @@
1
- import { type ReactNode } from 'react';
1
+ /// <reference types="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
- export type TextAreaInputProps = ReactAriaInputProps & InputBaseProps & {
7
- rows?: number;
8
- errorMessage?: ReactNode;
9
- validationState?: 'valid' | 'invalid' | 'invalid-disabled';
10
- };
11
- export declare const TextAreaInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & {
12
- rows?: number | undefined;
13
- errorMessage?: ReactNode;
14
- validationState?: "invalid" | "valid" | "invalid-disabled" | undefined;
15
- } & import("react").RefAttributes<HTMLTextAreaElement>>;
6
+ export type TextAreaInputProps = ReactAriaInputProps & InputBaseProps;
7
+ export declare const TextAreaInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & import("react").RefAttributes<HTMLTextAreaElement>>;
16
8
  export {};
@@ -1,26 +1,16 @@
1
+ /// <reference types="react" />
1
2
  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'>;
6
6
  interface CustomTextInputProps {
7
7
  focus?: boolean;
8
8
  height?: number | string;
9
- fontSize?: number | string;
10
- lineHeight?: number | string;
11
9
  inputBorderRadius?: InputRadius;
12
10
  connectLeft?: React.ReactNode | null;
13
11
  connectRight?: React.ReactNode | null;
14
12
  className?: string;
15
13
  }
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>>;
14
+ export type TextInputProps = ReactAriaInputProps & InputBaseProps & CustomTextInputProps;
15
+ export declare const TextInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & CustomTextInputProps & import("react").RefAttributes<HTMLInputElement>>;
26
16
  export {};
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type TODOFIXME } from 'helpers';
3
3
  export { Time } from '@internationalized/date';
4
- export declare const TimeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const TimeField: import("styled-components").StyledComponent<"div", any, {}, never>;
6
4
  interface TimeInputProps {
7
5
  label?: string;
8
6
  defaultValue?: TODOFIXME;
@@ -10,6 +8,6 @@ interface TimeInputProps {
10
8
  onChange?: TODOFIXME;
11
9
  hourCycle?: 12 | 24;
12
10
  errorMessage?: string;
13
- wrapper?: React.ComponentType<TODOFIXME>;
11
+ wrapper?: React.ComponentType<any>;
14
12
  }
15
13
  export declare function TimeInput({ ...props }: TimeInputProps): import("react/jsx-runtime").JSX.Element;
@@ -34,7 +34,5 @@ interface ListBoxPopoverProps extends Omit<AriaPopoverProps, 'popoverRef'> {
34
34
  state: OverlayTriggerState;
35
35
  popoverRef?: React.RefObject<HTMLDivElement>;
36
36
  }
37
- export declare function ListBoxPopover(props: Omit<ListBoxPopoverProps, 'triggerRef'> & {
38
- targetRef: React.RefObject<HTMLElement>;
39
- }): import("react/jsx-runtime").JSX.Element;
37
+ export declare function ListBoxPopover(props: ListBoxPopoverProps): import("react/jsx-runtime").JSX.Element;
40
38
  export {};
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  export type ModalHeaderProps = {
3
3
  children?: React.ReactNode;
4
4
  showCloseButton?: boolean;
5
- mb?: string;
6
5
  };
7
6
  declare const Header: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
8
7
  export default Header;
@@ -56,6 +56,7 @@ type MultiSelectProps = {
56
56
  tooltipIcon?: string;
57
57
  errorMessage?: string;
58
58
  };
59
+ export declare const MultiSelectComponent: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<HTMLButtonElement>>;
59
60
  export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & {
60
61
  /** Item objects in the collection. */
61
62
  options: Option[];
@@ -1,8 +1,8 @@
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 {
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, 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 object>(props: MultiSelectProps<T>): MultiSelectState<T>;
18
+ export declare function useMultiSelectState<T extends {}>(props: MultiSelectProps<T>): MultiSelectState<T>;
@@ -4,9 +4,8 @@ export declare const Search: import("react").ForwardRefExoticComponent<{
4
4
  size: 'small' | 'large';
5
5
  leadingIcon?: boolean | undefined;
6
6
  hideLabel?: boolean | undefined;
7
- height?: string | undefined;
8
7
  } & Omit<AriaSearchFieldProps, "isDisabled" | "isRequired" | "isReadOnly"> & {
9
8
  disabled?: boolean | undefined;
10
- required?: unknown;
9
+ required?: boolean | undefined;
11
10
  readOnly?: boolean | undefined;
12
11
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,16 +1,11 @@
1
1
  import type { AriaSelectProps } from '@react-types/select';
2
- export { Item as SingleSelectItem, Section as SingleSelectSection } from '@react-stately/collections';
2
+ export { Item as SingleSelectItem, Section as SingleSelectSection, } from '@react-stately/collections';
3
3
  type SingleSelectProps<T> = AriaSelectProps<T> & {
4
4
  placeholder?: string;
5
5
  tooltipIcon?: string;
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>;
14
9
  export declare function SingleSelect<T extends object>(props: SingleSelectProps<T> & {
15
10
  hideLabel?: boolean | undefined;
16
11
  errorMessage?: string;
@@ -25,7 +25,6 @@ export * from './Input/InlineEdit/InlineEdit';
25
25
  export * from './Input/NumberInput/NumberInput';
26
26
  export * from './Input/TextInput/TextInput';
27
27
  export * from './Input/TimeInput/TimeInput';
28
- export * from './Input/DateInput/DateInput';
29
28
  export * from './Label/Label';
30
29
  export * from './Modal';
31
30
  export * from './LabeledText';
@@ -1,11 +0,0 @@
1
- import { type DateFieldState, type DateSegment } from '@react-stately/datepicker';
2
- export { Time } from '@internationalized/date';
3
- export declare const SegmentDiv: import("styled-components").StyledComponent<"div", any, {
4
- literal: boolean;
5
- }, never>;
6
- export type DateSegmentProps = {
7
- segment: DateSegment;
8
- state: DateFieldState;
9
- };
10
- declare function DateSegment({ segment, state }: DateSegmentProps): import("react/jsx-runtime").JSX.Element;
11
- export default DateSegment;
@@ -1,16 +0,0 @@
1
- import { CalendarDateTime } from '@internationalized/date';
2
- import { type Granularity } from '@react-types/datepicker';
3
- export declare const DateField: import("styled-components").StyledComponent<"div", any, {
4
- height: string;
5
- paddingSize: string;
6
- }, never>;
7
- export interface DateInputProps {
8
- defaultValue?: CalendarDateTime;
9
- date?: Date;
10
- label?: string;
11
- granularity?: Granularity;
12
- order?: string[];
13
- height?: string;
14
- paddingSize?: string;
15
- }
16
- export declare function DateInput({ granularity, height, paddingSize, ...props }: DateInputProps): import("react/jsx-runtime").JSX.Element;