@theroutingcompany/components 0.0.26-alpha.1 → 0.0.26-alpha.4
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 +10009 -8648
- package/dist/trc-components.es.js.map +1 -1
- package/dist/trc-components.umd.js +1301 -854
- package/dist/trc-components.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/types/{src/components → components}/Badge/Badge.d.ts +1 -1
- package/types/components/Box/Box.d.ts +16 -0
- package/types/{src/components → components}/Button/Button.d.ts +4 -8
- package/types/components/Button/ButtonBase.d.ts +6 -0
- package/types/components/Button/HighEmphasisButton/HighEmphasisButton.d.ts +6 -0
- package/types/components/Button/LowEmphasisButton/LowEmphasisButton.d.ts +5 -0
- package/types/components/Button/MediumEmphasisButton/MediumEmphasisButton.d.ts +5 -0
- package/types/components/ButtonV2/ButtonV2.d.ts +17 -0
- package/types/components/ButtonV2/styles.d.ts +25 -0
- package/types/components/Calendar/CalendarCell.d.ts +12 -0
- package/types/{src/components → components}/Calendar/TimeDateSelect.d.ts +1 -1
- package/types/components/Flex/Flex.d.ts +11 -0
- package/types/{src/components → components}/FormControl/FormControl.d.ts +3 -3
- package/types/components/IconButton/IconButton.d.ts +31 -0
- package/types/{src/components → components}/Input/InputBase.d.ts +2 -1
- package/types/{src/components → components}/Input/TextInput/TextInput.d.ts +2 -0
- package/types/components/Skeleton/Skeleton.d.ts +29 -0
- package/types/components/Stack/Stack.d.ts +23 -0
- package/types/{src/components → components}/index.d.ts +2 -1
- package/types/{src/helpers → helpers}/index.d.ts +1 -0
- package/types/helpers/props.d.ts +45 -0
- package/types/{src/helpers → helpers}/tokenUtils.d.ts +3 -0
- package/types/helpers/typeHelpers.d.ts +87 -0
- package/types/styles/index.d.ts +34 -0
- package/types/cypress/support/commands.d.ts +0 -0
- package/types/cypress/support/component.d.ts +0 -9
- package/types/cypress.config.d.ts +0 -3
- package/types/src/components/Badge/Badge.cy.d.ts +0 -1
- package/types/src/components/Box/Box.d.ts +0 -133
- package/types/src/components/Button/ButtonBase.d.ts +0 -54
- package/types/src/components/Button/Group.d.ts +0 -10
- package/types/src/components/Button/styles.d.ts +0 -1
- package/types/src/components/Calendar/CalendarCell.d.ts +0 -12
- package/types/src/components/Flex/Flex.d.ts +0 -73
- package/types/src/components/Stack/Stack.d.ts +0 -0
- package/types/src/components/Tokens/Tokens.cy.d.ts +0 -1
- package/types/src/helpers/typeHelpers.d.ts +0 -27
- /package/types/{src/components → components}/AccessibleIcon/AccessibleIcon.d.ts +0 -0
- /package/types/{src/components → components}/AlertDialog/AlertDialog.d.ts +0 -0
- /package/types/{src/components → components}/Breadcrumbs/Breadcrumbs.d.ts +0 -0
- /package/types/{src/components/Button → components/ButtonV2}/Icon.d.ts +0 -0
- /package/types/{src/components → components}/Calendar/Calendar.d.ts +0 -0
- /package/types/{src/components → components}/Calendar/CalendarGrid.d.ts +0 -0
- /package/types/{src/components → components}/Calendar/CalendarHeader.d.ts +0 -0
- /package/types/{src/components → components}/Calendar/RangeCalendar.d.ts +0 -0
- /package/types/{src/components → components}/Calendar/index.d.ts +0 -0
- /package/types/{src/components → components}/Checkbox/Checkbox.d.ts +0 -0
- /package/types/{src/components → components}/ComboBox/ComboBox.d.ts +0 -0
- /package/types/{src/components → components}/Connect/Connect.d.ts +0 -0
- /package/types/{src/components → components}/Dialog/Dialog.d.ts +0 -0
- /package/types/{src/components → components}/Drawer/Drawer.d.ts +0 -0
- /package/types/{src/components → components}/DropdownMenu/DropdownMenu.d.ts +0 -0
- /package/types/{src/components → components}/Fieldset/Fieldset.d.ts +0 -0
- /package/types/{src/components → components}/FileUpload/FileUpload.d.ts +0 -0
- /package/types/{src/components → components}/FormControl/useFormInput.d.ts +0 -0
- /package/types/{src/components → components}/Grid/Grid.d.ts +0 -0
- /package/types/{src/components → components}/Heading/Heading.d.ts +0 -0
- /package/types/{src/components → components}/Inline/Inline.d.ts +0 -0
- /package/types/{src/components → components}/Input/InlineEdit/InlineEdit.d.ts +0 -0
- /package/types/{src/components → components}/Input/NumberInput/NumberInput.d.ts +0 -0
- /package/types/{src/components → components}/Input/TextArea/TextArea.d.ts +0 -0
- /package/types/{src/components → components}/Input/TimeInput/TimeInput.d.ts +0 -0
- /package/types/{src/components → components}/Label/Label.d.ts +0 -0
- /package/types/{src/components → components}/ListBox/ListBox.d.ts +0 -0
- /package/types/{src/components → components}/ListBox/timezones.d.ts +0 -0
- /package/types/{src/components → components}/MultiSelect/MultiSelect.d.ts +0 -0
- /package/types/{src/components → components}/MultiSelect/MultiSelectListBox.d.ts +0 -0
- /package/types/{src/components → components}/MultiSelect/MultiSelectPopover.d.ts +0 -0
- /package/types/{src/components → components}/MultiSelect/useMultiSelect.d.ts +0 -0
- /package/types/{src/components → components}/MultiSelect/useMultiSelectListState.d.ts +0 -0
- /package/types/{src/components → components}/MultiSelect/useMultiSelectState.d.ts +0 -0
- /package/types/{src/components → components}/NavigationMenu/NavigationMenu.d.ts +0 -0
- /package/types/{src/components → components}/Page/Page.d.ts +0 -0
- /package/types/{src/components → components}/Page/PageHeader.d.ts +0 -0
- /package/types/{src/components → components}/Paginator/Paginator.d.ts +0 -0
- /package/types/{src/components → components}/Popover/Popover.d.ts +0 -0
- /package/types/{src/components → components}/RadioGroup/RadioGroup.d.ts +0 -0
- /package/types/{src/components → components}/ReactAriaButton/ReactAriaButton.d.ts +0 -0
- /package/types/{src/components → components}/Search/Search.d.ts +0 -0
- /package/types/{src/components → components}/SegmentControl/SegmentControl.d.ts +0 -0
- /package/types/{src/components → components}/Select/Select.d.ts +0 -0
- /package/types/{src/components → components}/SingleSelect/SingleSelect.d.ts +0 -0
- /package/types/{src/components → components}/Switch/Switch.d.ts +0 -0
- /package/types/{src/components → components}/Table/Table.d.ts +0 -0
- /package/types/{src/components → components}/Tabs/Tabs.d.ts +0 -0
- /package/types/{src/components → components}/Text/Text.d.ts +0 -0
- /package/types/{src/components → components}/Title/Title.d.ts +0 -0
- /package/types/{src/components → components}/Toast/Toast.d.ts +0 -0
- /package/types/{src/components → components}/Tooltip/IconTooltip.d.ts +0 -0
- /package/types/{src/components → components}/Tooltip/Tooltip.d.ts +0 -0
- /package/types/{src/components → components}/UnstyledLink/UnstyledLink.d.ts +0 -0
- /package/types/{src/helpers → helpers}/css.d.ts +0 -0
- /package/types/{src/helpers → helpers}/interactionStates.d.ts +0 -0
- /package/types/{src/index.d.ts → index.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theroutingcompany/components",
|
|
3
|
-
"version": "0.0.26-alpha.
|
|
3
|
+
"version": "0.0.26-alpha.4",
|
|
4
4
|
"description": "The Routing Company Components",
|
|
5
5
|
"main": "./dist/trc-components.umd.js",
|
|
6
6
|
"module": "./dist/trc-components.es.js",
|
|
@@ -36,9 +36,7 @@
|
|
|
36
36
|
"build:components": "vite build",
|
|
37
37
|
"build": "npm run clean && npm run build:components && npm run build:types",
|
|
38
38
|
"chromatic": "npx chromatic --project-token=df154c51409f",
|
|
39
|
-
"deploy": "npm run chromatic"
|
|
40
|
-
"cy:open": "cypress open",
|
|
41
|
-
"cy:run": "cypress run"
|
|
39
|
+
"deploy": "npm run chromatic"
|
|
42
40
|
},
|
|
43
41
|
"sideEffects": false,
|
|
44
42
|
"license": "UNLICENSED",
|
|
@@ -101,8 +99,11 @@
|
|
|
101
99
|
"@react-types/overlays": "^3.7.2",
|
|
102
100
|
"@react-types/select": "^3.8.1",
|
|
103
101
|
"@tanstack/react-table": "^8.9.1",
|
|
104
|
-
"@theroutingcompany/design-tokens": "0.0.4-alpha.
|
|
105
|
-
"
|
|
102
|
+
"@theroutingcompany/design-tokens": "0.0.4-alpha.2",
|
|
103
|
+
"@types/styled-system": "^5.1.16",
|
|
104
|
+
"csstype": "^3.1.2",
|
|
105
|
+
"react-transition-group": "^4.4.5",
|
|
106
|
+
"styled-system": "^5.1.5"
|
|
106
107
|
},
|
|
107
108
|
"peerDependencies": {
|
|
108
109
|
"@material-ui/icons": "^4.11.3",
|
|
@@ -135,7 +136,6 @@
|
|
|
135
136
|
"@typescript-eslint/parser": "^5.58.0",
|
|
136
137
|
"@vitejs/plugin-react": "^3.1.0",
|
|
137
138
|
"chromatic": "^6.17.3",
|
|
138
|
-
"cypress": "^12.14.0",
|
|
139
139
|
"eslint": "^8.38.0",
|
|
140
140
|
"eslint-config-prettier": "^8.8.0",
|
|
141
141
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
@@ -23,7 +23,7 @@ declare const colors: {
|
|
|
23
23
|
};
|
|
24
24
|
type BadgeVariant = keyof typeof colors;
|
|
25
25
|
export type BadgeProps = PropsWithChildren<{
|
|
26
|
-
variant
|
|
26
|
+
variant: BadgeVariant;
|
|
27
27
|
}>;
|
|
28
28
|
export declare function Badge({ children, variant }: BadgeProps): JSX.Element;
|
|
29
29
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as Polymorphic from 'helpers';
|
|
2
|
+
import { type SpacingTokenValues } from 'helpers/tokenUtils';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
import type { BorderProps, ColorProps, FlexboxProps, GridGapProps, GridProps, LayoutProps, PositionProps, ResponsiveValue, ShadowProps, SpaceProps, TypographyProps } from 'styled-system';
|
|
5
|
+
interface CustomSpaceProps extends SpaceProps {
|
|
6
|
+
gap?: ResponsiveValue<SpacingTokenValues>;
|
|
7
|
+
}
|
|
8
|
+
export interface BoxProps extends BorderProps, ColorProps, FlexboxProps, GridProps, GridGapProps, LayoutProps, Omit<PositionProps, 'zIndex'>, // Override because styled-system by default only allows numbers here
|
|
9
|
+
ShadowProps, CustomSpaceProps, TypographyProps {
|
|
10
|
+
truncate?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
zIndex?: ResponsiveValue<string | number>;
|
|
13
|
+
}
|
|
14
|
+
type PolymorphicBox = Polymorphic.ForwardRefComponent<'div', BoxProps>;
|
|
15
|
+
export declare const Box: PolymorphicBox;
|
|
16
|
+
export default Box;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import { type ComponentPropsWithoutRef, type PropsWithChildren } from 'react';
|
|
3
2
|
import { type AriaButtonProps } from '@react-aria/button';
|
|
4
|
-
import type { BoxProps } from 'components/Box/Box';
|
|
5
3
|
import type { Prettify, RenameMisprefixedProps } from '../../helpers';
|
|
6
4
|
type Variant = 'primary' | 'secondary' | 'danger' | 'inverse';
|
|
7
5
|
type Size = 'small' | 'large';
|
|
@@ -18,14 +16,12 @@ type ButtonDesignProps = {
|
|
|
18
16
|
variant?: Variant;
|
|
19
17
|
size?: Size;
|
|
20
18
|
};
|
|
21
|
-
export type ButtonBaseProps =
|
|
22
|
-
|
|
19
|
+
export type ButtonBaseProps = {
|
|
20
|
+
paddingSize: Size;
|
|
23
21
|
};
|
|
24
22
|
type ReactAriaProps = RenameMisprefixedProps<AriaButtonProps, 'is', 'isDisabled'>;
|
|
25
23
|
export type ButtonProps = Prettify<PropsWithChildren<ButtonDesignProps & ReactAriaProps & {
|
|
26
|
-
test?: React.ElementType | null;
|
|
27
|
-
} & {
|
|
28
24
|
onClick?: ReactAriaProps['onPress'];
|
|
29
25
|
} & Pick<ComponentPropsWithoutRef<'button'>, 'form'>>>;
|
|
30
|
-
export declare const Button:
|
|
31
|
-
export
|
|
26
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ButtonBaseProps } from './Button';
|
|
2
|
+
export declare const buttonPadding: {
|
|
3
|
+
readonly small: "0.5rem 0.75rem";
|
|
4
|
+
readonly large: "0.75rem 1rem";
|
|
5
|
+
};
|
|
6
|
+
export declare const ButtonBase: import("styled-components").StyledComponent<"button", any, ButtonBaseProps, never>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const highEmphasisButtons: {
|
|
2
|
+
readonly primary: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
3
|
+
readonly secondary: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
4
|
+
readonly danger: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
5
|
+
readonly inverse: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const lowEmphasisButtons: {
|
|
2
|
+
readonly primary: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
3
|
+
readonly danger: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
4
|
+
readonly inverse: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const mediumEmphasisButtons: {
|
|
2
|
+
readonly primary: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
3
|
+
readonly danger: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
4
|
+
readonly inverse: import("styled-components").StyledComponent<"button", any, import("../Button").ButtonBaseProps, never>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type Variant = 'primary' | 'secondary' | 'tertiary' | 'danger';
|
|
3
|
+
export type Size = 'small' | 'large';
|
|
4
|
+
export declare const StyledButtonBox: import("styled-components").StyledComponent<import("helpers").ForwardRefComponent<"div", import("components/Box/Box").BoxProps>, any, any, never>;
|
|
5
|
+
export interface ButtonPropsV2 extends React.ComponentPropsWithoutRef<'button'> {
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
to?: string;
|
|
8
|
+
toTitle?: string;
|
|
9
|
+
variant?: Variant;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
size?: Size;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
submit?: boolean;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare const ButtonV2: import("react").ForwardRefExoticComponent<ButtonPropsV2 & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export default ButtonV2;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Size, Variant } from './ButtonV2';
|
|
2
|
+
export declare function focus({ buttonColor }: {
|
|
3
|
+
buttonColor?: string;
|
|
4
|
+
}): string;
|
|
5
|
+
export declare const reset: () => string;
|
|
6
|
+
export declare const base: () => string;
|
|
7
|
+
export type LoadingProp = {
|
|
8
|
+
$loading?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const childwrapper: (props: LoadingProp) => string;
|
|
11
|
+
export declare const disabled: (props: {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}) => "\n opacity: 0.6;\n &:hover {\n cursor: not-allowed;\n }\n " | undefined;
|
|
14
|
+
export declare const fullWidth: (props: {
|
|
15
|
+
fullWidth: boolean;
|
|
16
|
+
}) => "\n display: block;\n width: 100%;\n " | undefined;
|
|
17
|
+
export declare const group: () => string;
|
|
18
|
+
export declare const primary: import("styled-components").FlattenSimpleInterpolation;
|
|
19
|
+
export declare const secondary: import("styled-components").FlattenSimpleInterpolation;
|
|
20
|
+
export declare const tertiary: import("styled-components").FlattenSimpleInterpolation;
|
|
21
|
+
export declare const danger: import("styled-components").FlattenSimpleInterpolation;
|
|
22
|
+
export declare const getVariantStyles: (variant: Variant) => import("styled-components").FlattenSimpleInterpolation | undefined;
|
|
23
|
+
export declare const small: import("styled-components").FlattenSimpleInterpolation;
|
|
24
|
+
export declare const large: import("styled-components").FlattenSimpleInterpolation;
|
|
25
|
+
export declare const getDefaultSize: (size: Size) => import("styled-components").FlattenSimpleInterpolation | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type CalendarDate } from '@internationalized/date';
|
|
3
|
+
import type { RangeCalendarState } from '@react-stately/calendar';
|
|
4
|
+
type CalendarCellProps = {
|
|
5
|
+
state: RangeCalendarState;
|
|
6
|
+
date: CalendarDate;
|
|
7
|
+
currentMonth: CalendarDate;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
today: CalendarDate;
|
|
10
|
+
};
|
|
11
|
+
export declare function CalendarCell({ state, date, today, disabled, currentMonth, }: CalendarCellProps): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
4
|
export interface TimeDateSelectProps {
|
|
5
|
-
children
|
|
5
|
+
children?: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const TimeDateSelect: React.ForwardRefExoticComponent<TimeDateSelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface TimeDateSelectItemProps extends SelectPrimitive.SelectItemProps {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type BoxProps } from 'components/Box/Box';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export type FlexProps = {
|
|
4
|
+
'data-id'?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
} & BoxProps;
|
|
7
|
+
export declare function Flex(props: FlexProps): JSX.Element;
|
|
8
|
+
export declare namespace Flex {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export default Flex;
|
|
@@ -21,15 +21,15 @@ export declare const TextAreaFormControl: import("react").ForwardRefExoticCompon
|
|
|
21
21
|
} & AriaFieldProps & {
|
|
22
22
|
children?: ReactNode;
|
|
23
23
|
} & ComponentPropsWithoutStyles<"textarea"> & {
|
|
24
|
-
type?: "url" | "search" | "text" | (string & {}) | "tel" | "email" | "password" | undefined;
|
|
25
24
|
label?: ReactNode;
|
|
26
25
|
pattern?: string | undefined;
|
|
26
|
+
type?: "search" | "text" | (string & {}) | "tel" | "url" | "email" | "password" | undefined;
|
|
27
27
|
name?: string | undefined;
|
|
28
28
|
defaultValue?: string | undefined;
|
|
29
29
|
autoFocus?: boolean | undefined;
|
|
30
30
|
id?: string | undefined;
|
|
31
31
|
placeholder?: string | undefined;
|
|
32
|
-
inputMode?: "
|
|
32
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
33
33
|
'aria-activedescendant'?: string | undefined;
|
|
34
34
|
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
35
35
|
'aria-describedby'?: string | undefined;
|
|
@@ -55,10 +55,10 @@ export declare const TextAreaFormControl: import("react").ForwardRefExoticCompon
|
|
|
55
55
|
disabled?: boolean | undefined;
|
|
56
56
|
value?: string | undefined;
|
|
57
57
|
autoComplete?: string | undefined;
|
|
58
|
-
required?: boolean | undefined;
|
|
59
58
|
maxLength?: number | undefined;
|
|
60
59
|
minLength?: number | undefined;
|
|
61
60
|
readOnly?: boolean | undefined;
|
|
61
|
+
required?: boolean | undefined;
|
|
62
62
|
description?: ReactNode;
|
|
63
63
|
onFocusChange?: ((isFocused: boolean) => void) | undefined;
|
|
64
64
|
excludeFromTabOrder?: boolean | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type AriaButtonProps } from '@react-aria/button';
|
|
3
|
+
type Size = 'small' | 'large';
|
|
4
|
+
type Variant = 'primary' | 'secondary' | 'danger' | 'inverse';
|
|
5
|
+
type Shape = 'circle' | 'square';
|
|
6
|
+
export type StyledIconButtonProps = AriaButtonProps & {
|
|
7
|
+
onClick?: AriaButtonProps['onPress'] | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
label: string;
|
|
10
|
+
size?: Size;
|
|
11
|
+
variant?: Variant;
|
|
12
|
+
shape?: Shape;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Be sure to add add a `label` prop. Note `aria-label` is already taken care of by the `label` prop.
|
|
16
|
+
* ```jsx
|
|
17
|
+
* <IconButton label="Add new item">
|
|
18
|
+
* <AddIcon/>
|
|
19
|
+
* </IconButton>
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<AriaButtonProps<"button"> & {
|
|
23
|
+
onClick?: AriaButtonProps['onPress'] | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
label: string;
|
|
26
|
+
size?: Size | undefined;
|
|
27
|
+
variant?: Variant | undefined;
|
|
28
|
+
shape?: Shape | undefined;
|
|
29
|
+
disabled?: boolean | undefined;
|
|
30
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
export {};
|
|
@@ -4,9 +4,10 @@ export type InputRadius = typeof tokens.border_radius_0 | typeof tokens.border_r
|
|
|
4
4
|
export type InputBaseProps = {
|
|
5
5
|
paddingSize?: InputSize;
|
|
6
6
|
borderRadius?: InputRadius;
|
|
7
|
+
flex?: string;
|
|
7
8
|
};
|
|
8
9
|
export declare const InputBase: import("styled-components").StyledComponent<"input", any, InputBaseProps, never>;
|
|
9
|
-
export declare const InputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const InputWrapper: import("styled-components").StyledComponent<import("../..").ForwardRefComponent<"div", import("components/Box/Box").BoxProps>, any, {}, never>;
|
|
10
11
|
export declare const InputErrorMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
12
|
export declare const InputDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
13
|
export declare const EndIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -9,6 +9,8 @@ interface CustomTextInputProps {
|
|
|
9
9
|
connectLeft?: React.ReactNode | null;
|
|
10
10
|
connectRight?: React.ReactNode | null;
|
|
11
11
|
className?: string;
|
|
12
|
+
display?: string;
|
|
13
|
+
flex?: string;
|
|
12
14
|
}
|
|
13
15
|
export type TextInputProps = ReactAriaInputProps & InputBaseProps & CustomTextInputProps;
|
|
14
16
|
export declare const TextInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & CustomTextInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type BoxProps } from 'components/Box/Box';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const Animator: import("styled-components").StyledComponent<import("../..").ForwardRefComponent<"div", BoxProps>, any, Omit<BoxProps, "as">, never>;
|
|
4
|
+
export type SkeletonHeaderProps = {
|
|
5
|
+
'data-id'?: string;
|
|
6
|
+
looksLike?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
7
|
+
width?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const SkeletonHeader: React.ForwardRefExoticComponent<SkeletonHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export type SkeletonBodyProps = {
|
|
11
|
+
'data-id'?: string;
|
|
12
|
+
lines?: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const SkeletonBody: React.ForwardRefExoticComponent<SkeletonBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export type SkeletonBoxProps = Omit<BoxProps, 'as'> & {
|
|
16
|
+
'data-id'?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const SkeletonBox: React.ForwardRefExoticComponent<Omit<BoxProps, "as"> & {
|
|
19
|
+
'data-id'?: string | undefined;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare function Skeleton(): null;
|
|
22
|
+
declare namespace Skeleton {
|
|
23
|
+
var Header: React.ForwardRefExoticComponent<SkeletonHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
var Box: React.ForwardRefExoticComponent<Omit<BoxProps, "as"> & {
|
|
25
|
+
'data-id'?: string | undefined;
|
|
26
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
var Body: React.ForwardRefExoticComponent<SkeletonBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
}
|
|
29
|
+
export default Skeleton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AlignX } from 'helpers';
|
|
2
|
+
import { type SpacingTokenValues } from 'helpers/tokenUtils';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { ResponsiveValue } from 'styled-system';
|
|
5
|
+
export type StackProps = {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Positions children horizontally.
|
|
9
|
+
* Styled-system responsive arrays work here.
|
|
10
|
+
*/
|
|
11
|
+
align?: ResponsiveValue<AlignX>;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the gutter space between children.
|
|
14
|
+
* Styled-system responsive arrays work here.
|
|
15
|
+
*/
|
|
16
|
+
space?: ResponsiveValue<SpacingTokenValues>;
|
|
17
|
+
'data-id'?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function Stack(props: StackProps): JSX.Element;
|
|
20
|
+
export declare namespace Stack {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export default Stack;
|
|
@@ -4,9 +4,9 @@ export * from './Badge/Badge';
|
|
|
4
4
|
export * from './Box/Box';
|
|
5
5
|
export * from './Breadcrumbs/Breadcrumbs';
|
|
6
6
|
export * from './Button/Button';
|
|
7
|
+
export * from './ButtonV2/ButtonV2';
|
|
7
8
|
export * from './Calendar';
|
|
8
9
|
export * from './Drawer/Drawer';
|
|
9
|
-
export * from './Button/ButtonBase';
|
|
10
10
|
export * from './Checkbox/Checkbox';
|
|
11
11
|
export * from './Dialog/Dialog';
|
|
12
12
|
export * from './DropdownMenu/DropdownMenu';
|
|
@@ -30,6 +30,7 @@ export * from './RadioGroup/RadioGroup';
|
|
|
30
30
|
export * from './Search/Search';
|
|
31
31
|
export * from './SingleSelect/SingleSelect';
|
|
32
32
|
export * from './Switch/Switch';
|
|
33
|
+
export * from './IconButton/IconButton';
|
|
33
34
|
export * from './Tabs/Tabs';
|
|
34
35
|
export * from './Text/Text';
|
|
35
36
|
export * from './Title/Title';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Omits styled system props from an object
|
|
3
|
+
* @param {Object} props
|
|
4
|
+
* @param {Array} names
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* import { margin } from 'styled-system';
|
|
8
|
+
*
|
|
9
|
+
* omit({ my: '100', className: 'classs' }, margin.propNames)
|
|
10
|
+
* > { className: 'class' }
|
|
11
|
+
*/
|
|
12
|
+
export declare function omit(props: {
|
|
13
|
+
[k: string]: any;
|
|
14
|
+
}, names: string[]): {
|
|
15
|
+
[k: string]: any;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Picks styled system props from an object
|
|
19
|
+
* @param {Object} props
|
|
20
|
+
* @param {Array} names
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { margin } from 'styled-system';
|
|
24
|
+
*
|
|
25
|
+
* pick({ my: '100', py: '100' }, margin.propNames)
|
|
26
|
+
* > { my: '100' }
|
|
27
|
+
*/
|
|
28
|
+
export declare function pick(props: {
|
|
29
|
+
[k: string]: any;
|
|
30
|
+
}, names: string[]): {
|
|
31
|
+
[k: string]: any;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Returns a configuration object for styled-components with omitted props, to be used with .withConfig
|
|
35
|
+
* @param {Array} arr
|
|
36
|
+
* @param {Object} config
|
|
37
|
+
*
|
|
38
|
+
* @see https://styled-components.com/docs/api#shouldforwardprop
|
|
39
|
+
*/
|
|
40
|
+
export declare function clean(arr?: string[], config?: {
|
|
41
|
+
[k: string]: any;
|
|
42
|
+
}): {
|
|
43
|
+
shouldForwardProp: (prop: string, defaultFn: (prop: string) => boolean) => boolean;
|
|
44
|
+
[k: string]: any;
|
|
45
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import nestedTokens from '@theroutingcompany/design-tokens/dist/json/tokens.json';
|
|
3
|
+
import flatTokens from '@theroutingcompany/design-tokens/dist/ts/tokens';
|
|
3
4
|
export declare function filterDefined(obj: Record<PropertyKey, unknown> | CSSProperties | undefined): {
|
|
4
5
|
[k: string]: any;
|
|
5
6
|
} | undefined;
|
|
6
7
|
export type RemoveVendorProperties<P extends string | number> = P extends `-moz-${string}` | `-webkit-${string}` ? never : P;
|
|
8
|
+
type FlatTokenNames = keyof typeof flatTokens;
|
|
9
|
+
export type SpacingTokenValues = (typeof flatTokens)[Extract<FlatTokenNames, `spacing_${string}`>];
|
|
7
10
|
type Spacing = (typeof nestedTokens)['spacing'];
|
|
8
11
|
export type SpacingToken = keyof Spacing;
|
|
9
12
|
export declare const getSpacingValue: (token: string) => string;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
2
|
+
declare module 'csstype' {
|
|
3
|
+
interface Properties {
|
|
4
|
+
[index: `--${string}`]: string | number | undefined;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export type Falsy = '' | 0 | false | null | undefined;
|
|
8
|
+
/** Util for filtering arrays with type guard to remove falsy values from the type */
|
|
9
|
+
export declare function typedBoolean<T>(value: T): value is Exclude<T, Falsy>;
|
|
10
|
+
/** Utility type to get pretty readout of all of the members of an intersection. TS Quirk */
|
|
11
|
+
export type Prettify<T> = {
|
|
12
|
+
[K in keyof T]: T[K];
|
|
13
|
+
} & {};
|
|
14
|
+
export type ComponentPropsWithoutStyles<E extends ElementType> = Omit<ComponentPropsWithoutRef<E>, 'style'>;
|
|
15
|
+
type RemovePrefix<S extends string, Prefix extends string = 'is'> = S extends `${Prefix}${infer R}` ? Uncapitalize<R> : never;
|
|
16
|
+
export type RenameMisprefixedProps<InputProps extends Record<PropertyKey, any>, Prefix extends string, MisnamedKeys extends `${Prefix}${string}`> = Omit<InputProps, MisnamedKeys> & {
|
|
17
|
+
[S in MisnamedKeys as RemovePrefix<S, Prefix>]?: InputProps[S];
|
|
18
|
+
};
|
|
19
|
+
type RemoveSuffix<S extends string, Suffix extends string = 'Value'> = S extends `${infer R}${Suffix}` ? Uncapitalize<R> : never;
|
|
20
|
+
export type RenameMissuffixedProps<InputProps extends Record<PropertyKey, any>, Suffix extends string, MisnamedKeys extends `${string}${Suffix}`> = Omit<InputProps, MisnamedKeys> & {
|
|
21
|
+
[S in MisnamedKeys as RemoveSuffix<S, Suffix>]?: InputProps[S];
|
|
22
|
+
};
|
|
23
|
+
/** Get a type warning when an `errorMessage` is passed without a `validationState` prop. */
|
|
24
|
+
type MisprefixedBooleanProps = 'isDisabled' | 'isRequired' | 'isReadOnly';
|
|
25
|
+
/** renames `isDisabled`, `isRequired,` and `isReadonly` to `disabled`, `required,` and `readOnly` in an object type */
|
|
26
|
+
export type RenameBooleanProps<InputProps extends Record<PropertyKey, any>> = RenameMisprefixedProps<InputProps, 'is', MisprefixedBooleanProps>;
|
|
27
|
+
export type Merge<P1 = {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}, P2 = {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}> = Omit<P1, keyof P2> & P2;
|
|
32
|
+
/**
|
|
33
|
+
* Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
|
|
34
|
+
*/
|
|
35
|
+
export type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
|
|
40
|
+
*/
|
|
41
|
+
export type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any> ? I : never;
|
|
42
|
+
export type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
|
|
43
|
+
as?: E;
|
|
44
|
+
}>>;
|
|
45
|
+
export interface ForwardRefComponent<IntrinsicElementString, OwnProps = {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}> extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
|
|
48
|
+
/**
|
|
49
|
+
* When `as` prop is passed, use this overload.
|
|
50
|
+
* Merges original own props (without DOM props) and the inferred props
|
|
51
|
+
* from `as` element with the own props taking precendence.
|
|
52
|
+
*
|
|
53
|
+
* We explicitly avoid `React.ElementType` and manually narrow the prop types
|
|
54
|
+
* so that events are typed when using JSX.IntrinsicElements.
|
|
55
|
+
*/
|
|
56
|
+
<As = IntrinsicElementString>(props: As extends '' ? {
|
|
57
|
+
as: keyof JSX.IntrinsicElements;
|
|
58
|
+
} : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
|
59
|
+
as: As;
|
|
60
|
+
}> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
|
|
61
|
+
as: As;
|
|
62
|
+
}> : never): React.ReactElement | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Alignment Types
|
|
66
|
+
*/
|
|
67
|
+
export type AlignX = 'center' | 'left' | 'right';
|
|
68
|
+
export type AlignY = 'center' | 'top' | 'bottom';
|
|
69
|
+
export type Breakpoints = 'default' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
70
|
+
export type BreakpointsWithoutDefault = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
71
|
+
export type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
72
|
+
export type LinkActionProps = {
|
|
73
|
+
to?: string | {
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
};
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
external?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Use `as` instead
|
|
80
|
+
*/
|
|
81
|
+
component?: React.ElementType;
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Use `as` instead
|
|
84
|
+
*/
|
|
85
|
+
Component?: React.ElementType;
|
|
86
|
+
};
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const buttonReset = "\n border: none;\n margin: 0;\n padding: 0;\n overflow: visible;\n width: auto;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: normal;\n -webkit-font-smoothing: inherit;\n -moz-osx-font-smoothing: inherit;\n -webkit-appearance: none;\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n";
|
|
2
|
+
export declare const visuallyHidden = "\n border: 0 !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n clip-path: inset(50%) !important;\n height: 1px !important;\n margin: -1px !important;\n overflow: hidden !important;\n padding: 0 !important;\n position: absolute !important;\n width: 1px !important;\n word-wrap: normal !important;\n";
|
|
3
|
+
type FocusOutline = {
|
|
4
|
+
/**
|
|
5
|
+
* Color of the focus ring. Defaults to color_blue_700.
|
|
6
|
+
*/
|
|
7
|
+
color?: string;
|
|
8
|
+
/**
|
|
9
|
+
* CSS selector to target the pseudo-element with the ring. Defaults to '&:focus'.
|
|
10
|
+
*/
|
|
11
|
+
modifier?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Pixel offset of the focus ring. Defaults to '3px'.
|
|
14
|
+
*/
|
|
15
|
+
offset?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Border radius of the focus ring. Defaults to borderRadius_200.
|
|
18
|
+
*/
|
|
19
|
+
radius?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Creates focus styles on an :after pseudo-element.
|
|
23
|
+
* @param string Color of the focus ring. Defaults to color_blue_700.
|
|
24
|
+
* @param modifier CSS selector to target the pseudo-element with the ring, defaults to '&:focus'
|
|
25
|
+
* @param offset Pixel offset of the focus ring. Defaults to '3px'.
|
|
26
|
+
* @param radius Border radius of the focus ring. Defaults to borderRadius_200.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const Styled = styled.div`
|
|
30
|
+
* ${focusOutline({ color: 'gray', modifier: '&:focus-within' })}
|
|
31
|
+
* `;
|
|
32
|
+
*/
|
|
33
|
+
export declare const focusOutline: ({ modifier, offset, }?: FocusOutline) => string;
|
|
34
|
+
export {};
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|