@theroutingcompany/components 0.0.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.
Files changed (48) hide show
  1. package/README.md +68 -0
  2. package/dist/trc-components.es.js +10519 -0
  3. package/dist/trc-components.es.js.map +1 -0
  4. package/dist/trc-components.umd.js +1430 -0
  5. package/dist/trc-components.umd.js.map +1 -0
  6. package/package.json +109 -0
  7. package/types/components/AccessibleIcon/AccessibleIcon.d.ts +3 -0
  8. package/types/components/AlertDialog/AlertDialog.d.ts +18 -0
  9. package/types/components/Box/Box.d.ts +12 -0
  10. package/types/components/Breadcrumbs/Breadcrumbs.d.ts +16 -0
  11. package/types/components/Button/Button.d.ts +55 -0
  12. package/types/components/Button/ButtonBase.d.ts +1 -0
  13. package/types/components/Button/HighEmphasisButton/HighEmphasisButton.d.ts +6 -0
  14. package/types/components/Button/LowEmphasisButton/LowEmphasisButton.d.ts +5 -0
  15. package/types/components/Button/MediumEmphasisButton/MediumEmphasisButton.d.ts +5 -0
  16. package/types/components/Checkbox/Checkbox.d.ts +7 -0
  17. package/types/components/Dialog/Dialog.d.ts +24 -0
  18. package/types/components/Fieldset/Fieldset.d.ts +9 -0
  19. package/types/components/FormControl/FormControl.d.ts +19 -0
  20. package/types/components/FormControl/useFormInput.d.ts +9 -0
  21. package/types/components/Grid/Grid.d.ts +0 -0
  22. package/types/components/Heading/Heading.d.ts +10 -0
  23. package/types/components/IconButton/IconButton.d.ts +21 -0
  24. package/types/components/Input/CreditCardInput/CreditCardInput.d.ts +1 -0
  25. package/types/components/Input/InputBase.d.ts +9 -0
  26. package/types/components/Input/NumberInput/NumberInput.d.ts +32 -0
  27. package/types/components/Input/PasswordInput/PasswordInput.d.ts +0 -0
  28. package/types/components/Input/PhoneInput/PhoneInput.d.ts +0 -0
  29. package/types/components/Input/TextArea/TextArea.d.ts +8 -0
  30. package/types/components/Input/TextInput/TextInput.d.ts +27 -0
  31. package/types/components/Input/URLInput/URLInput.d.ts +0 -0
  32. package/types/components/Label/Label.d.ts +9 -0
  33. package/types/components/Page/Page.d.ts +4 -0
  34. package/types/components/Popover/Popover.d.ts +8 -0
  35. package/types/components/RadioGroup/RadioGroup.d.ts +6 -0
  36. package/types/components/SegmentControl/SegmentControl.d.ts +8 -0
  37. package/types/components/Select/Select.d.ts +23 -0
  38. package/types/components/Stack/Stack.d.ts +0 -0
  39. package/types/components/Switch/Switch.d.ts +4 -0
  40. package/types/components/Text/Text.d.ts +39 -0
  41. package/types/components/Title/Title.d.ts +9 -0
  42. package/types/components/Toast/Toast.d.ts +16 -0
  43. package/types/components/Tooltip/IconTooltip.d.ts +8 -0
  44. package/types/components/Tooltip/Tooltip.d.ts +8 -0
  45. package/types/components/index.d.ts +21 -0
  46. package/types/helpers/index.d.ts +1 -0
  47. package/types/helpers/typeHelpers.d.ts +24 -0
  48. package/types/index.d.ts +2 -0
package/package.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "@theroutingcompany/components",
3
+ "version": "0.0.1",
4
+ "description": "The Routing Company Components",
5
+ "main": "./dist/trc-components.umd.js",
6
+ "module": "./dist/trc-components.es.js",
7
+ "engines": {
8
+ "node": ">= 17.4.0",
9
+ "npm": ">= 8.3.1"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/trc-components.es.js",
14
+ "require": "./dist/trc-components.umd.js"
15
+ }
16
+ },
17
+ "types": "./types/index.d.ts",
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "types"
22
+ ],
23
+ "scripts": {
24
+ "prebuild": "npm run clean",
25
+ "format": "prettier ./dist/**/*.{js,css,scss} --write --no-config",
26
+ "clean": "rimraf ./dist ./types",
27
+ "storybook": "storybook dev -p 6006",
28
+ "build-storybook": "storybook build",
29
+ "lint:css": "stylelint components/**/*.{tsx,ts}",
30
+ "build:types": "tsc",
31
+ "build:components": "vite build",
32
+ "build": "npm run clean && npm run build:components && npm run build:types",
33
+ "chromatic": "npx chromatic --project-token=df154c51409f"
34
+ },
35
+ "sideEffects": false,
36
+ "license": "ISC",
37
+ "dependencies": {
38
+ "@material-ui/icons": "^4.11.3",
39
+ "@radix-ui/react-accessible-icon": "^1.0.1",
40
+ "@radix-ui/react-alert-dialog": "^1.0.2",
41
+ "@radix-ui/react-checkbox": "^1.0.1",
42
+ "@radix-ui/react-dialog": "^1.0.2",
43
+ "@radix-ui/react-polymorphic": "^0.0.14",
44
+ "@radix-ui/react-popover": "^1.0.2",
45
+ "@radix-ui/react-radio-group": "^1.1.0",
46
+ "@radix-ui/react-select": "^1.1.2",
47
+ "@radix-ui/react-separator": "^1.0.1",
48
+ "@radix-ui/react-switch": "^1.0.1",
49
+ "@radix-ui/react-toast": "^1.1.2",
50
+ "@radix-ui/react-toggle-group": "^1.0.1",
51
+ "@radix-ui/react-tooltip": "^1.0.2",
52
+ "@react-aria/breadcrumbs": "^3.4.1",
53
+ "@react-aria/button": "^3.6.4",
54
+ "@react-aria/focus": "^3.10.1",
55
+ "@react-aria/label": "^3.4.4",
56
+ "@react-aria/numberfield": "^3.3.4",
57
+ "@react-aria/radio": "^3.4.2",
58
+ "@react-aria/textfield": "^3.8.1",
59
+ "@react-aria/utils": "^3.14.2",
60
+ "@react-stately/numberfield": "^3.3.1",
61
+ "@react-stately/radio": "^3.6.2",
62
+ "@tanstack/react-table": "^8.7.4",
63
+ "@theroutingcompany/design-tokens": "^0.0.1",
64
+ "flag-icons": "^6.6.6",
65
+ "lodash.kebabcase": "^4.1.1",
66
+ "styled-components": "^5.3.6",
67
+ "styled-system": "^5.1.5",
68
+ "system-props": "^0.22.0"
69
+ },
70
+ "peerDependencies": {
71
+ "@material-ui/icons": "^4.11.3",
72
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
73
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
74
+ "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0",
75
+ "styled-components": "^5.3.6"
76
+ },
77
+ "devDependencies": {
78
+ "@babel/core": "^7.20.2",
79
+ "@material-ui/core": "^4.12.4",
80
+ "@rollup/plugin-node-resolve": "^15.0.1",
81
+ "@rollup/plugin-typescript": "^9.0.2",
82
+ "@storybook/addon-a11y": "^7.0.0-beta.2",
83
+ "@storybook/addon-actions": "^7.0.0-beta.2",
84
+ "@storybook/addon-essentials": "^7.0.0-beta.2",
85
+ "@storybook/addon-interactions": "^7.0.0-beta.2",
86
+ "@storybook/addon-links": "^7.0.0-beta.2",
87
+ "@storybook/react": "^7.0.0-beta.2",
88
+ "@storybook/react-vite": "^7.0.0-beta.2",
89
+ "@storybook/testing-library": "^0.0.14-next.0",
90
+ "@styled-system/prop-types": "^5.1.5",
91
+ "@types/lodash.kebabcase": "^4.1.7",
92
+ "@types/react": "^17.0.0 || ^18.0.0",
93
+ "@types/react-dom": "^17.0.0 || ^18.0.0",
94
+ "@types/react-is": "^17.0.0 || ^18.0.0",
95
+ "@vitejs/plugin-react": "^2.2.0",
96
+ "chromatic": "^6.11.4",
97
+ "csstype": "^3.1.1",
98
+ "react": "^16.14.0",
99
+ "react-dom": "^16.14.0",
100
+ "react-is": "^16.13.1 || ^17.0.0 || ^18.0.0",
101
+ "rimraf": "^3.0.2",
102
+ "storybook": "^7.0.0-beta.13",
103
+ "stylelint": "^14.15.0",
104
+ "type-fest": "^3.4.0",
105
+ "typescript": "^4.9.4",
106
+ "vite": "^3.2.4",
107
+ "vite-tsconfig-paths": "^3.6.0"
108
+ }
109
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import * as AccessibleIconPrimitive from '@radix-ui/react-accessible-icon';
3
+ export declare function AccessibleIcon({ children, label, }: AccessibleIconPrimitive.AccessibleIconProps): JSX.Element;
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
3
+ import type { ComponentPropsWithRef } from 'react';
4
+ import { dialogWidths } from 'components/Dialog/Dialog';
5
+ type DialogWidth = keyof typeof dialogWidths;
6
+ type StyledContentProps = {
7
+ size?: DialogWidth;
8
+ };
9
+ export type AlertDialogContentProps = StyledContentProps & AlertDialogPrimitive.DialogContentProps & ComponentPropsWithRef<'div'>;
10
+ export declare function AlertDialogContent({ children, size, ...props }: AlertDialogContentProps): JSX.Element;
11
+ export declare const AlertDialogTitle: any;
12
+ export declare const AlertDialogDescription: any;
13
+ export declare const AlertDialogFooter: any;
14
+ export declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
15
+ export declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
16
+ export declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
17
+ export declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
18
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ForwardRefComponent } from '@radix-ui/react-polymorphic';
3
+ import type { BorderProps, ColorProps, FlexboxProps, GridProps, LayoutProps, PositionProps, ShadowProps, SpaceProps, TypographyProps, ResponsiveValue } from 'styled-system';
4
+ export interface BoxProps extends BorderProps, ColorProps, FlexboxProps, GridProps, LayoutProps, Omit<PositionProps, 'zIndex'>, // Override because styled-system by default only allows numbers here
5
+ ShadowProps, SpaceProps, TypographyProps {
6
+ truncate?: boolean;
7
+ children?: ReactNode;
8
+ zIndex?: ResponsiveValue<string | number>;
9
+ }
10
+ type PolymorphicBox = ForwardRefComponent<'div', BoxProps>;
11
+ export declare const Box: PolymorphicBox;
12
+ export {};
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { type AriaBreadcrumbItemProps, type AriaBreadcrumbsProps } from '@react-aria/breadcrumbs';
3
+ import type { ComponentPropsWithoutStyles, RenameMisprefixedProps } from 'helpers/typeHelpers';
4
+ export declare const Breadcrumbs: import("react").ForwardRefExoticComponent<AriaBreadcrumbsProps & {
5
+ children?: import("react").ReactNode;
6
+ } & import("react").RefAttributes<HTMLOListElement>>;
7
+ export type BreadcrumbItemProps = RenameMisprefixedProps<AriaBreadcrumbItemProps, 'is', 'isDisabled'> & ComponentPropsWithoutStyles<'a'> & {
8
+ as?: string;
9
+ navigate?: any;
10
+ };
11
+ export declare const BreadcrumbItem: import("react").ForwardRefExoticComponent<Omit<AriaBreadcrumbItemProps, "isDisabled"> & {
12
+ disabled?: boolean;
13
+ } & ComponentPropsWithoutStyles<"a"> & {
14
+ as?: string;
15
+ navigate?: any;
16
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,55 @@
1
+ import { type ComponentPropsWithRef, type PropsWithChildren } from 'react';
2
+ import { type AriaButtonProps } from '@react-aria/button';
3
+ import type { RenameMisprefixedProps } from 'helpers';
4
+ type Variant = 'primary' | 'secondary' | 'danger' | 'inverse';
5
+ type Size = 'small' | 'large';
6
+ type ButtonDesignProps = {
7
+ emphasis?: 'low';
8
+ variant?: 'primary' | 'danger' | 'inverse';
9
+ size?: Size;
10
+ } | {
11
+ emphasis?: 'medium';
12
+ variant?: 'primary' | 'danger' | 'inverse';
13
+ size?: Size;
14
+ } | {
15
+ emphasis?: 'high';
16
+ variant?: Variant;
17
+ size?: Size;
18
+ };
19
+ export type ButtonBaseProps = {
20
+ paddingSize: Size;
21
+ };
22
+ type ReactAriaProps = RenameMisprefixedProps<AriaButtonProps, 'is', 'isDisabled'>;
23
+ export type ButtonProps = PropsWithChildren<ButtonDesignProps> & ComponentPropsWithRef<'button'> & ReactAriaProps;
24
+ export declare const Button: import("react").ForwardRefExoticComponent<(Pick<{
25
+ emphasis?: 'low';
26
+ variant?: 'primary' | 'danger' | 'inverse';
27
+ size?: Size;
28
+ } & {
29
+ children?: import("react").ReactNode;
30
+ } & Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
31
+ ref?: import("react").Ref<HTMLButtonElement>;
32
+ } & Omit<AriaButtonProps<"button">, "isDisabled"> & {
33
+ disabled?: boolean;
34
+ }, "key" | "size" | "onFocusChange" | "elementType" | "onPress" | "onPressStart" | "onPressEnd" | "onPressChange" | "onPressUp" | "href" | "rel" | "target" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "excludeFromTabOrder" | "emphasis" | "variant"> | Pick<{
35
+ emphasis?: 'medium';
36
+ variant?: 'primary' | 'danger' | 'inverse';
37
+ size?: Size;
38
+ } & {
39
+ children?: import("react").ReactNode;
40
+ } & Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
41
+ ref?: import("react").Ref<HTMLButtonElement>;
42
+ } & Omit<AriaButtonProps<"button">, "isDisabled"> & {
43
+ disabled?: boolean;
44
+ }, "key" | "size" | "onFocusChange" | "elementType" | "onPress" | "onPressStart" | "onPressEnd" | "onPressChange" | "onPressUp" | "href" | "rel" | "target" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "excludeFromTabOrder" | "emphasis" | "variant"> | Pick<{
45
+ emphasis?: 'high';
46
+ variant?: Variant;
47
+ size?: Size;
48
+ } & {
49
+ children?: import("react").ReactNode;
50
+ } & Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
51
+ ref?: import("react").Ref<HTMLButtonElement>;
52
+ } & Omit<AriaButtonProps<"button">, "isDisabled"> & {
53
+ disabled?: boolean;
54
+ }, "key" | "size" | "onFocusChange" | "elementType" | "onPress" | "onPressStart" | "onPressEnd" | "onPressChange" | "onPressUp" | "href" | "rel" | "target" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "excludeFromTabOrder" | "emphasis" | "variant">) & import("react").RefAttributes<HTMLButtonElement>>;
55
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ButtonBase: any;
@@ -0,0 +1,6 @@
1
+ export declare const highEmphasisButtons: {
2
+ readonly primary: any;
3
+ readonly secondary: any;
4
+ readonly danger: any;
5
+ readonly inverse: any;
6
+ };
@@ -0,0 +1,5 @@
1
+ export declare const lowEmphasisButtons: {
2
+ readonly primary: any;
3
+ readonly danger: any;
4
+ readonly inverse: any;
5
+ };
@@ -0,0 +1,5 @@
1
+ export declare const mediumEmphasisButtons: {
2
+ readonly primary: any;
3
+ readonly danger: any;
4
+ readonly inverse: any;
5
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
+ export type CheckedState = CheckboxPrimitive.CheckedState;
4
+ export type CheckboxProps = CheckboxPrimitive.CheckboxProps & {
5
+ invalid?: boolean;
6
+ };
7
+ export declare function Checkbox({ disabled, checked, invalid, ...props }: CheckboxProps): JSX.Element;
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ import type { ComponentPropsWithRef } from 'react';
4
+ export declare const overlayShow: any;
5
+ export declare const contentShow: any;
6
+ export declare const dialogWidths: {
7
+ readonly small: "360px";
8
+ readonly medium: "540px";
9
+ readonly large: "960px";
10
+ };
11
+ type DialogWidth = keyof typeof dialogWidths;
12
+ type StyledContentProps = {
13
+ size?: DialogWidth;
14
+ };
15
+ export type DialogContentProps = StyledContentProps & DialogPrimitive.DialogContentProps & ComponentPropsWithRef<'div'>;
16
+ export declare function DialogContent({ children, size, ...props }: DialogContentProps): JSX.Element;
17
+ export declare const DialogTitle: any;
18
+ export declare const DialogDescription: any;
19
+ export declare const DialogFooter: any;
20
+ export declare const DialogCloseButton: any;
21
+ export declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
22
+ export declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
23
+ export declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
24
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { ComponentPropsWithoutStyles } from 'helpers/typeHelpers';
3
+ export declare const StyledFieldSet: any;
4
+ /** Adding disabled to <fieldset> will disable all inputs inside it HTML wise,
5
+ * the problem is that React won't know about that they the input components are disabled (prop-wise)
6
+ * This 'compound component' makes it known to child input components via React context (for example for react-aria input hooks)
7
+ */
8
+ export declare function Fieldset({ children, disabled, ...fieldsetProps }: ComponentPropsWithoutStyles<'fieldset'>): JSX.Element;
9
+ export declare function useFieldset(): boolean;
@@ -0,0 +1,19 @@
1
+ import { type PropsWithChildren, type ReactNode } from 'react';
2
+ import { type AriaFieldProps } from '@react-aria/label';
3
+ import type { ComponentPropsWithoutStyles, InputValidationProps } from 'helpers/typeHelpers';
4
+ import { type NumberInputProps } from 'components/Input/NumberInput/NumberInput';
5
+ import { type TextAreaInputProps } from 'components/Input/TextArea/TextArea';
6
+ type FormControlProps = PropsWithChildren<{
7
+ tooltipContent?: string;
8
+ tooltipIcon?: ReactNode;
9
+ } & AriaFieldProps>;
10
+ /** If in a `<FormControl/>`, read `fieldProps` generated by that FormControl's `useField` hook */
11
+ export declare function useFieldProps(): import("@react-types/shared").AriaLabelingProps & import("@react-types/shared").DOMProps;
12
+ export declare function FormControl({ children, label, errorMessage, description, tooltipContent, tooltipIcon, validationState, id, ...props }: FormControlProps): JSX.Element;
13
+ type TextFormControlProps = FormControlProps & InputValidationProps & ComponentPropsWithoutStyles<'input'>;
14
+ export declare const TextFormControl: import("react").ForwardRefExoticComponent<TextFormControlProps & import("react").RefAttributes<HTMLInputElement>>;
15
+ type TextAreaFormControlProps = FormControlProps & InputValidationProps & ComponentPropsWithoutStyles<'textarea'> & TextAreaInputProps;
16
+ export declare const TextAreaFormControl: import("react").ForwardRefExoticComponent<TextAreaFormControlProps & import("react").RefAttributes<HTMLTextAreaElement>>;
17
+ type NumberFormControlProps = FormControlProps & NumberInputProps;
18
+ export declare const NumberFormControl: import("react").ForwardRefExoticComponent<NumberFormControlProps & import("react").RefAttributes<HTMLInputElement>>;
19
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Returns the right field props when the input component is used inside a `<FormField>`. Also ensures a `disabled` */
2
+ export declare function useFormInput(disabled?: boolean): {
3
+ disabled: boolean;
4
+ 'aria-label'?: string;
5
+ 'aria-labelledby'?: string;
6
+ 'aria-describedby'?: string;
7
+ 'aria-details'?: string;
8
+ id?: string;
9
+ };
File without changes
@@ -0,0 +1,10 @@
1
+ import type * as Polymorphic from '@radix-ui/react-polymorphic';
2
+ type HeadingProps = {
3
+ size: 'small' | 'medium' | 'large';
4
+ className: never;
5
+ style: never;
6
+ };
7
+ type PolymorphicHeading = Polymorphic.ForwardRefComponent<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', // more? span? div?
8
+ HeadingProps>;
9
+ export declare const Heading: PolymorphicHeading;
10
+ export {};
@@ -0,0 +1,21 @@
1
+ import { AriaButtonProps } from '@react-aria/button';
2
+ import { type ComponentPropsWithRef } from 'react';
3
+ type Size = 'small' | 'large';
4
+ type Variant = 'primary' | 'secondary' | 'danger' | 'inverse';
5
+ type Shape = 'circle' | 'square';
6
+ export type StyledIconButtonProps = ComponentPropsWithRef<'button'> & AriaButtonProps & {
7
+ label: string;
8
+ size?: Size;
9
+ variant?: Variant;
10
+ shape?: Shape;
11
+ disabled?: boolean;
12
+ };
13
+ /** Be sure to add add a `label`.
14
+ * ```jsx
15
+ * <IconButton label="Add new item">
16
+ * <AddIcon/>
17
+ * </IconButton>
18
+ *
19
+ */
20
+ export declare const IconButton: import("react").ForwardRefExoticComponent<Pick<StyledIconButtonProps, "form" | "label" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "isDisabled" | "autoFocus" | "onFocusChange" | "value" | "disabled" | "elementType" | "onPress" | "onPressStart" | "onPressEnd" | "onPressChange" | "onPressUp" | "href" | "rel" | "target" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "excludeFromTabOrder" | "variant" | "shape"> & import("react").RefAttributes<HTMLButtonElement>>;
21
+ export {};
@@ -0,0 +1,9 @@
1
+ export type InputSize = 'small' | 'large';
2
+ export type InputBaseProps = {
3
+ paddingSize?: InputSize;
4
+ };
5
+ export declare const InputBase: any;
6
+ export declare const InputWrapper: any;
7
+ export declare const InputErrorMessage: any;
8
+ export declare const InputDescription: any;
9
+ export declare const EndIconWrapper: any;
@@ -0,0 +1,32 @@
1
+ /// <reference types="react" />
2
+ import { type AriaNumberFieldProps } from '@react-aria/numberfield';
3
+ import type { ComponentPropsWithoutStyles, InputValidationProps, RenameBooleanProps, RenameMissuffixedProps } from 'helpers/typeHelpers';
4
+ import { type InputBaseProps } from '../InputBase';
5
+ type ReactAriaNumberInputProps = Omit<RenameBooleanProps<AriaNumberFieldProps>, 'minValue' | 'maxValue'> & RenameMissuffixedProps<AriaNumberFieldProps, 'Value', 'minValue' | 'maxValue'>;
6
+ type ShowStepper = {
7
+ showStepper?: boolean;
8
+ };
9
+ export type NumberInputProps = Pick<ComponentPropsWithoutStyles<'input'>, 'name'> & ReactAriaNumberInputProps & InputBaseProps & InputValidationProps & ShowStepper;
10
+ /**
11
+ * Use cases
12
+ *
13
+ * 1. With custom Label element as prop
14
+ * ```jsx
15
+ * <NumberInput label={<Label>Label text</Label>} />
16
+ * ```
17
+ *
18
+ * 2. With string label as prop
19
+ * ```jsx
20
+ * <NumberInput label="Label text" />
21
+ * ```
22
+ *
23
+ * 3. Wrapped by `<label>`
24
+ * ```jsx
25
+ * <label>
26
+ * Label text
27
+ * <NumberInput />
28
+ * </label>
29
+ * ```
30
+ */
31
+ export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
32
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { type AriaTextFieldOptions } from '@react-aria/textfield';
3
+ import type { RenameBooleanProps } from 'helpers/typeHelpers';
4
+ import { type InputBaseProps } from '../InputBase';
5
+ type ReactAriaInputProps = Omit<RenameBooleanProps<AriaTextFieldOptions<'textarea'>>, 'inputElementType'>;
6
+ export type TextAreaInputProps = ReactAriaInputProps & InputBaseProps;
7
+ export declare const TextAreaInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & import("react").RefAttributes<HTMLTextAreaElement>>;
8
+ export {};
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { type AriaTextFieldOptions } from '@react-aria/textfield';
3
+ import type { ComponentPropsWithoutStyles, RenameBooleanProps } from 'helpers/typeHelpers';
4
+ import { type InputBaseProps } from '../InputBase';
5
+ type ReactAriaInputProps = Omit<RenameBooleanProps<AriaTextFieldOptions<'input'>>, 'inputElementType'>;
6
+ export type TextInputProps = ReactAriaInputProps & InputBaseProps & ComponentPropsWithoutStyles<'input'>;
7
+ /**
8
+ * 1. With custom label element as prop
9
+ * ```jsx
10
+ * <TextInput label={<Label>Label text</Label>} />
11
+ * ```
12
+ *
13
+ * 2. With string label as prop
14
+ * ```jsx
15
+ * <TextInput label="Label text" />
16
+ * ```
17
+ *
18
+ * 3. Wrapped by <label>
19
+ * ```jsx
20
+ * <label>
21
+ * Label text
22
+ * <TextInput />
23
+ * </label>
24
+ * ```
25
+ */
26
+ export declare const TextInput: import("react").ForwardRefExoticComponent<ReactAriaInputProps & InputBaseProps & ComponentPropsWithoutStyles<"input"> & import("react").RefAttributes<HTMLInputElement>>;
27
+ export {};
File without changes
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { ComponentPropsWithoutStyles } from 'helpers/typeHelpers';
3
+ interface LabelProps extends ComponentPropsWithoutStyles<'label'> {
4
+ size?: 'small' | 'medium' | 'large';
5
+ bold?: boolean;
6
+ display?: 'flex' | 'inline-flex' | 'inline' | 'black';
7
+ }
8
+ export declare function Label({ children, bold, size, display, ...labelProps }: LabelProps): JSX.Element;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare function Page({ children }: {
3
+ children: ReactNode;
4
+ }): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
+ declare function Content({ children, ...props }: PopoverPrimitive.PopoverContentProps): JSX.Element;
4
+ export declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
5
+ export declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ export declare const PopoverContent: typeof Content;
7
+ export declare const PopoverClose: any;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
+ export declare function RadioGroup({ children, disabled, ...props }: RadioGroupPrimitive.RadioGroupProps): JSX.Element;
4
+ export declare const RadioGroupRadio: any;
5
+ export declare const RadioGroupIndicator: any;
6
+ export declare function Radio({ disabled, ...props }: RadioGroupPrimitive.RadioGroupItemProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import * as ToggleGroup from '@radix-ui/react-toggle-group';
3
+ export declare const StyledSegmentControlRoot: any;
4
+ export type SegmentControlRootProps = Omit<ToggleGroup.ToggleGroupSingleProps, 'type' | 'style' | 'className'> & {
5
+ size?: 'small' | 'large';
6
+ };
7
+ export declare const SegmentControlRoot: ({ children, size, ...props }: SegmentControlRootProps) => JSX.Element;
8
+ export declare const SegmentControlItem: any;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ export declare const StyledTrigger: any;
4
+ declare function Content({ children, ...props }: SelectPrimitive.SelectContentProps): JSX.Element;
5
+ export declare const Select: React.FC<SelectPrimitive.SelectProps>;
6
+ export declare const SelectTrigger: any;
7
+ export declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
8
+ export declare const SelectIcon: any;
9
+ export declare const SelectContent: typeof Content;
10
+ export declare const SelectViewport: any;
11
+ export declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const SelectItem: any;
13
+ export declare const SelectItemText: React.ForwardRefExoticComponent<SelectPrimitive.SelectItemTextProps & React.RefAttributes<HTMLSpanElement>>;
14
+ export declare const SelectItemIndicator: any;
15
+ export declare const SelectGroupLabel: any;
16
+ export declare const SelectSeparator: any;
17
+ export declare const SelectScrollUpButton: any;
18
+ export declare const SelectScrollDownButton: any;
19
+ type SingleSelectProps = {
20
+ items: string[];
21
+ } & SelectPrimitive.SelectProps;
22
+ export declare function SingleSelect({ items, ...selectProps }: SingleSelectProps): JSX.Element;
23
+ export {};
File without changes
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import * as SwitchPrimitive from '@radix-ui/react-switch';
3
+ export type { SwitchProps } from '@radix-ui/react-switch';
4
+ export declare function Switch({ disabled, ...props }: SwitchPrimitive.SwitchProps): JSX.Element;
@@ -0,0 +1,39 @@
1
+ import type * as Polymorphic from '@radix-ui/react-polymorphic';
2
+ import { type ComponentPropsWithoutRef } from 'react';
3
+ type TextElements = 'p' | 'div' | 'span' | 'legend' | 'caption' | 'figcaption' | 'strong' | 'em' | 'strong' | 'abbr' | 'mark' | 'q' | 'small' | 'time';
4
+ interface BodyTextProps extends ComponentPropsWithoutRef<'p'> {
5
+ type: 'body';
6
+ size?: 'small' | 'medium' | 'large';
7
+ bold?: boolean;
8
+ as?: TextElements;
9
+ }
10
+ interface NumberTextProps extends ComponentPropsWithoutRef<'p'> {
11
+ size?: 'xsmall' | 'small' | 'medium' | 'large';
12
+ bold?: boolean;
13
+ type: 'number';
14
+ as?: TextElements;
15
+ }
16
+ interface CaptionTextProps extends ComponentPropsWithoutRef<'p'> {
17
+ size?: 'small' | 'medium';
18
+ bold?: boolean;
19
+ type: 'caption';
20
+ as?: TextElements;
21
+ }
22
+ type NormalVariant = 'standard' | 'strong' | 'weak';
23
+ type SentimentVariant = 'positive' | 'negative' | 'notice' | 'neutral';
24
+ type NormalTextColorProps = {
25
+ textType?: 'normal';
26
+ variant?: NormalVariant;
27
+ };
28
+ type SentimentTextColorProps = {
29
+ textType?: 'sentiment';
30
+ variant?: SentimentVariant;
31
+ };
32
+ type TextColorProps = NormalTextColorProps | SentimentTextColorProps;
33
+ export type TextProps = TextColorProps & Partial<NumberTextProps | CaptionTextProps | BodyTextProps> & {
34
+ bold?: boolean;
35
+ as?: TextElements;
36
+ };
37
+ type PolymorphicText = Polymorphic.ForwardRefComponent<TextElements, TextProps>;
38
+ export declare const Text: PolymorphicText;
39
+ export {};
@@ -0,0 +1,9 @@
1
+ import type * as Polymorphic from '@radix-ui/react-polymorphic';
2
+ interface TitleProps {
3
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'legend';
4
+ size: 'small' | 'medium' | 'large' | 'xsmall';
5
+ }
6
+ type PolymorphicTitle = Polymorphic.ForwardRefComponent<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', // more? span? div?
7
+ TitleProps>;
8
+ export declare const Title: PolymorphicTitle;
9
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ import * as ToastPrimitive from '@radix-ui/react-toast';
3
+ export declare const ToastAction: any;
4
+ export declare const ToastClose: any;
5
+ export declare const ToastSeparator: any;
6
+ type Sentiment = 'inverse' | 'negative' | 'info';
7
+ export declare const ToastViewport: any;
8
+ export declare function ToastProvider({ children, ...props }: ToastPrimitive.ToastProviderProps): JSX.Element;
9
+ export type ToastProps = PropsWithChildren<{
10
+ sentiment: Sentiment;
11
+ title: string;
12
+ onDismiss?: () => void;
13
+ }> & ToastPrimitive.ToastProps;
14
+ export type ToastActionProps = ToastPrimitive.ToastActionProps;
15
+ export declare function Toast({ title, children, sentiment, onDismiss, ...toastRootProps }: ToastProps): JSX.Element;
16
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ type IconTooltipProps = {
3
+ children: ReactNode;
4
+ label?: string;
5
+ icon?: ReactNode;
6
+ };
7
+ export declare function IconTooltip({ children, icon, label, }: IconTooltipProps): JSX.Element;
8
+ export {};