@theroutingcompany/components 0.0.18-alpha.9 → 0.0.19
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 +1000 -1001
- package/dist/trc-components.es.js.map +1 -1
- package/dist/trc-components.umd.js +148 -146
- package/dist/trc-components.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/types/components/AlertDialog/AlertDialog.d.ts +1 -1
- package/types/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/types/components/Button/Button.d.ts +4 -4
- package/types/components/Fieldset/Fieldset.d.ts +1 -1
- package/types/components/Flex/Flex.d.ts +3 -3
- package/types/components/FormControl/FormControl.d.ts +2 -2
- package/types/components/Input/NumberInput/NumberInput.d.ts +1 -1
- package/types/components/Input/TextArea/TextArea.d.ts +1 -1
- package/types/components/Input/TextInput/TextInput.d.ts +1 -1
- package/types/components/Label/Label.d.ts +1 -1
- package/types/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/types/components/NavigationMenu/NavigationMenu.d.ts +6 -3
- package/types/components/Paginator/Paginator.d.ts +1 -1
- package/types/components/ReactAriaButton/ReactAriaButton.d.ts +1 -1
- package/types/helpers/interactionStates.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theroutingcompany/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "The Routing Company Components",
|
|
5
5
|
"main": "./dist/trc-components.umd.js",
|
|
6
6
|
"module": "./dist/trc-components.es.js",
|
|
@@ -91,7 +91,6 @@
|
|
|
91
91
|
"@react-types/select": "3.7.0",
|
|
92
92
|
"@tanstack/react-table": "^8.7.9",
|
|
93
93
|
"@theroutingcompany/design-tokens": "^0.0.3",
|
|
94
|
-
"@types/react": "^18.0.0",
|
|
95
94
|
"csstype": "^3.1.1"
|
|
96
95
|
},
|
|
97
96
|
"peerDependencies": {
|
|
@@ -119,6 +118,7 @@
|
|
|
119
118
|
"@storybook/testing-library": "^0.0.14-next.0",
|
|
120
119
|
"@types/eslint": "^8.21.1",
|
|
121
120
|
"@types/prettier": "^2.7.2",
|
|
121
|
+
"@types/react": "^18.0.28",
|
|
122
122
|
"@types/react-dom": "^18.0.11",
|
|
123
123
|
"@types/react-is": "^17.0.3",
|
|
124
124
|
"@types/styled-components": "^5.1.26",
|
|
@@ -130,6 +130,7 @@
|
|
|
130
130
|
"eslint-config-prettier": "^8.6.0",
|
|
131
131
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
132
132
|
"eslint-plugin-react": "^7.32.2",
|
|
133
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
133
134
|
"eslint-plugin-storybook": "^0.6.11",
|
|
134
135
|
"postcss-styled-syntax": "^0.3.3",
|
|
135
136
|
"prettier": "^2.8.4",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
3
|
import type { ComponentPropsWithRef } from 'react';
|
|
4
|
-
import { dialogWidths } from 'components/Dialog/Dialog';
|
|
4
|
+
import { dialogWidths } from '../../components/Dialog/Dialog';
|
|
5
5
|
type DialogWidth = keyof typeof dialogWidths;
|
|
6
6
|
type StyledContentProps = {
|
|
7
7
|
size?: DialogWidth;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type AriaBreadcrumbItemProps, type AriaBreadcrumbsProps } from '@react-aria/breadcrumbs';
|
|
3
|
-
import type { RenameMisprefixedProps } from 'helpers/typeHelpers';
|
|
3
|
+
import type { RenameMisprefixedProps } from '../../helpers/typeHelpers';
|
|
4
4
|
export declare const BreadcrumbListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
5
5
|
export declare const BreadcrumbLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
6
6
|
export declare const Breadcrumbs: import("react").ForwardRefExoticComponent<AriaBreadcrumbsProps & {
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
} & import("react").RefAttributes<HTMLOListElement>>;
|
|
9
9
|
export type BreadcrumbItemProps<ExtraProps = unknown> = RenameMisprefixedProps<AriaBreadcrumbItemProps, 'is', 'isDisabled'> & {
|
|
10
|
-
LinkComponent
|
|
10
|
+
LinkComponent?: JSX.Element | "a";
|
|
11
11
|
href?: string | undefined;
|
|
12
12
|
} & ExtraProps;
|
|
13
13
|
export declare const BreadcrumbItem: import("react").ForwardRefExoticComponent<Omit<AriaBreadcrumbItemProps, "isDisabled"> & {
|
|
14
14
|
disabled?: boolean | undefined;
|
|
15
15
|
} & {
|
|
16
|
-
LinkComponent
|
|
16
|
+
LinkComponent?: "a" | JSX.Element | undefined;
|
|
17
17
|
href?: string | undefined;
|
|
18
18
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type PropsWithChildren } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type PropsWithChildren } from 'react';
|
|
2
2
|
import { type AriaButtonProps } from '@react-aria/button';
|
|
3
|
-
import type { RenameMisprefixedProps } from 'helpers';
|
|
3
|
+
import type { Prettify, RenameMisprefixedProps } from '../../helpers';
|
|
4
4
|
type Variant = 'primary' | 'secondary' | 'danger' | 'inverse';
|
|
5
5
|
type Size = 'small' | 'large';
|
|
6
6
|
type ButtonDesignProps = {
|
|
@@ -20,8 +20,8 @@ export type ButtonBaseProps = {
|
|
|
20
20
|
paddingSize: Size;
|
|
21
21
|
};
|
|
22
22
|
type ReactAriaProps = RenameMisprefixedProps<AriaButtonProps, 'is', 'isDisabled'>;
|
|
23
|
-
export type ButtonProps = PropsWithChildren<ButtonDesignProps
|
|
23
|
+
export type ButtonProps = Prettify<PropsWithChildren<ButtonDesignProps & ReactAriaProps & {
|
|
24
24
|
onClick?: ReactAriaProps['onPress'];
|
|
25
|
-
}
|
|
25
|
+
} & Pick<ComponentPropsWithoutRef<'button'>, 'form'>>>;
|
|
26
26
|
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
27
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { ComponentPropsWithoutStyles } from 'helpers/typeHelpers';
|
|
2
|
+
import type { ComponentPropsWithoutStyles } from '../../helpers/typeHelpers';
|
|
3
3
|
export declare const StyledFieldSet: import("styled-components").StyledComponent<"fieldset", any, {}, never>;
|
|
4
4
|
/** Adding disabled to `<fieldset>` will disable all inputs inside it HTML wise,
|
|
5
5
|
* the problem is that React won't know about that they the input components are disabled (prop-wise)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SpacingToken } from 'helpers/tokenUtils';
|
|
2
|
-
import type { Property } from 'csstype';
|
|
3
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { Property } from 'csstype';
|
|
3
|
+
import { type SpacingToken } from '../../helpers/tokenUtils';
|
|
4
4
|
export type FlexProps = PropsWithChildren<{
|
|
5
5
|
display?: 'flex' | "inline-flex";
|
|
6
6
|
wrap?: Property.FlexWrap;
|
|
@@ -42,7 +42,7 @@ export declare const Flex: import("styled-components").StyledComponent<"div", an
|
|
|
42
42
|
borderTopRightRadius?: Property.BorderTopRightRadius<"0" | "400" | "circle" | "100" | "200" | "800" | "pill"> | undefined;
|
|
43
43
|
borderBottomLeftRadius?: Property.BorderBottomLeftRadius<"0" | "400" | "circle" | "100" | "200" | "800" | "pill"> | undefined;
|
|
44
44
|
borderBottomRightRadius?: Property.BorderBottomRightRadius<"0" | "400" | "circle" | "100" | "200" | "800" | "pill"> | undefined;
|
|
45
|
-
elevation?: import("helpers/tokenUtils").ElevationToken | undefined;
|
|
45
|
+
elevation?: import("../../helpers/tokenUtils").ElevationToken | undefined;
|
|
46
46
|
flexShrink?: (string & {}) | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined;
|
|
47
47
|
flexGrow?: (string & {}) | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined;
|
|
48
48
|
flexBasis?: "0" | "auto" | "1000" | "300" | "400" | "500" | "600" | (string & {}) | "inherit" | "content" | "100" | "200" | "450" | "550" | "650" | "700" | "750" | "800" | "850" | "900" | "350" | "1100" | "1150" | "1200" | "1300" | "1350" | "1400" | "1500" | "initial" | "revert" | "revert-layer" | "unset" | "fit-content" | "max-content" | "min-content" | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PropsWithChildren, type ReactNode } from 'react';
|
|
2
2
|
import { type AriaFieldProps, type FieldAria } from '@react-aria/label';
|
|
3
3
|
import type { AriaTextFieldProps } from '@react-aria/textfield';
|
|
4
|
-
import type { ComponentPropsWithoutStyles } from 'helpers/typeHelpers';
|
|
4
|
+
import type { ComponentPropsWithoutStyles } from '../../helpers/typeHelpers';
|
|
5
5
|
type FormControlProps<FieldProps = AriaFieldProps> = PropsWithChildren<{
|
|
6
6
|
tooltipContent?: string;
|
|
7
7
|
tooltipIcon?: ReactNode;
|
|
@@ -70,7 +70,7 @@ export declare const NumberFormControl: import("react").ForwardRefExoticComponen
|
|
|
70
70
|
tooltipIcon?: ReactNode;
|
|
71
71
|
} & AriaFieldProps & {
|
|
72
72
|
children?: ReactNode;
|
|
73
|
-
} & Omit<import("helpers/typeHelpers").RenameBooleanProps<import("@react-types/numberfield").AriaNumberFieldProps>, "minValue" | "maxValue"> & {
|
|
73
|
+
} & Omit<import("../../helpers/typeHelpers").RenameBooleanProps<import("@react-types/numberfield").AriaNumberFieldProps>, "minValue" | "maxValue"> & {
|
|
74
74
|
min?: number | undefined;
|
|
75
75
|
max?: number | undefined;
|
|
76
76
|
} & import("components/Input/InputBase").InputBaseProps & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type AriaNumberFieldProps } from '@react-aria/numberfield';
|
|
3
3
|
import { type NumberFieldStateOptions } from '@react-stately/numberfield';
|
|
4
|
-
import type { ComponentPropsWithoutStyles, RenameBooleanProps, RenameMissuffixedProps } from 'helpers/typeHelpers';
|
|
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'>;
|
|
7
7
|
type ShowStepper = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type AriaTextFieldOptions } from '@react-aria/textfield';
|
|
3
|
-
import type { RenameBooleanProps } from 'helpers/typeHelpers';
|
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type AriaTextFieldOptions } from '@react-aria/textfield';
|
|
3
|
-
import type { RenameBooleanProps } from 'helpers/typeHelpers';
|
|
3
|
+
import type { RenameBooleanProps } from '../../../helpers/typeHelpers';
|
|
4
4
|
import { type InputBaseProps } from '../InputBase';
|
|
5
5
|
type ReactAriaInputProps = Omit<RenameBooleanProps<AriaTextFieldOptions<'input'>>, 'inputElementType'>;
|
|
6
6
|
export type TextInputProps = ReactAriaInputProps & InputBaseProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ComponentPropsWithoutStyles } from 'helpers/typeHelpers';
|
|
2
|
+
import type { ComponentPropsWithoutStyles } from '../../helpers/typeHelpers';
|
|
3
3
|
export interface LabelProps extends ComponentPropsWithoutStyles<'label'> {
|
|
4
4
|
size?: 'small' | 'medium' | 'large';
|
|
5
5
|
bold?: boolean;
|
|
@@ -25,9 +25,9 @@ type MultiSelectProps = {
|
|
|
25
25
|
/** Sets the default open state of the field (uncontrolled). */
|
|
26
26
|
defaultOpen?: boolean;
|
|
27
27
|
/** The initial selected keys in the collection (uncontrolled). */
|
|
28
|
-
defaultSelectedKeys?: Parameters<typeof useMultiSelectState>[
|
|
28
|
+
defaultSelectedKeys?: Parameters<typeof useMultiSelectState>['0']['defaultSelectedKeys'];
|
|
29
29
|
/** The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with. */
|
|
30
|
-
disabledKeys?: Parameters<typeof useMultiSelectState>[
|
|
30
|
+
disabledKeys?: Parameters<typeof useMultiSelectState>['0']['disabledKeys'];
|
|
31
31
|
excludeFromTabOrder?: boolean;
|
|
32
32
|
items: Option[];
|
|
33
33
|
/** Whether the field can be emptied. */
|
|
@@ -43,8 +43,11 @@ interface ItemProps<T extends React.ElementType> {
|
|
|
43
43
|
as?: T;
|
|
44
44
|
children?: React.ReactNode;
|
|
45
45
|
}
|
|
46
|
-
export declare function Item<T extends React.ElementType =
|
|
47
|
-
|
|
46
|
+
export declare function Item<T extends React.ElementType = 'div'>({ as, ...props }: ItemProps<T> & Omit<React.ComponentPropsWithoutRef<T>, keyof ItemProps<T>>): JSX.Element;
|
|
47
|
+
/**
|
|
48
|
+
* Separator
|
|
49
|
+
*/
|
|
50
|
+
export declare const Separator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
48
51
|
declare const NavigationMenu: CompoundedComponent & {
|
|
49
52
|
Trigger: ({ children }: TriggerProps) => JSX.Element;
|
|
50
53
|
List: ({ children, portalIdOverride, }: {
|
|
@@ -52,7 +55,7 @@ declare const NavigationMenu: CompoundedComponent & {
|
|
|
52
55
|
portalIdOverride?: string | undefined;
|
|
53
56
|
}) => React.ReactPortal;
|
|
54
57
|
Item: typeof Item;
|
|
55
|
-
Separator:
|
|
58
|
+
Separator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
56
59
|
};
|
|
57
60
|
declare const NavigationMenuPortal: () => JSX.Element;
|
|
58
61
|
export { NavigationMenu, NavigationMenuPortal };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AriaButtonProps } from '@react-aria/button';
|
|
2
2
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
export type ReactAriaButtonProps = AriaButtonProps & ComponentPropsWithoutRef<'button'>;
|
|
4
|
-
/**
|
|
4
|
+
/** For internal use only! */
|
|
5
5
|
export declare function ReactAriaButton(props: ReactAriaButtonProps): JSX.Element;
|
|
@@ -2,5 +2,6 @@ type DataStates = {
|
|
|
2
2
|
isFocusVisible: boolean;
|
|
3
3
|
isPressed: boolean;
|
|
4
4
|
};
|
|
5
|
+
/** Utility for turning component state boolean into string for use in `data-state` attribute */
|
|
5
6
|
export declare function getDataState({ isFocusVisible, isPressed }: DataStates): string;
|
|
6
7
|
export {};
|