@hyphen/hyphen-components 7.3.2 → 7.3.3
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/css/utilities.css +1 -1
- package/dist/css/variables.css +18 -28
- package/dist/hyphen-components.cjs.development.js +5717 -5021
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +18 -2
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +5618 -4846
- package/dist/hyphen-components.esm.js.map +1 -1
- package/dist/index.d.ts +2693 -57
- package/dist/index.js +0 -1
- package/package.json +18 -19
- package/src/components/Badge/Badge.module.scss +6 -0
- package/src/components/Badge/Badge.stories.tsx +1 -0
- package/src/components/Badge/Badge.test.tsx +3 -2
- package/src/components/Badge/Badge.tsx +5 -3
- package/src/components/Box/Box.tsx +5 -2
- package/src/components/Button/Button.module.scss +1 -1
- package/src/components/Button/Button.test.tsx +2 -2
- package/src/components/Calendar/Calendar.test.tsx +262 -0
- package/src/components/Card/Card.tsx +2 -0
- package/src/components/CheckboxInput/components/Checkbox.module.scss +1 -1
- package/src/components/CheckboxInput/components/Checkbox.tsx +2 -0
- package/src/components/Details/Details.module.scss +2 -2
- package/src/components/Details/Details.tsx +2 -0
- package/src/components/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/Drawer/Drawer.test.tsx +494 -56
- package/src/components/Drawer/Drawer.tsx +7 -1
- package/src/components/DropdownMenu/DropdownMenu.test.tsx +532 -12
- package/src/components/FormControl/FormControl.tsx +2 -0
- package/src/components/Formik/Formik.stories.tsx +30 -7
- package/src/components/Formik/FormikSelectInput/FormikSelectInput.tsx +6 -5
- package/src/components/Formik/FormikToggleGroup/FormikToggleGroup.tsx +1 -1
- package/src/components/HelpText/HelpText.tsx +2 -0
- package/src/components/Icon/Icon.stories.tsx +1 -1
- package/src/components/Icon/Icon.tsx +2 -0
- package/src/components/Modal/Modal.test.tsx +630 -81
- package/src/components/Modal/Modal.tsx +2 -0
- package/src/components/Modal/components/ModalFooter/ModalFooter.test.tsx +2 -2
- package/src/components/Popover/Popover.tsx +2 -0
- package/src/components/RadioGroup/RadioInput/RadioInput.tsx +2 -0
- package/src/components/SelectInput/SelectInput.stories.tsx +22 -22
- package/src/components/SelectInput/SelectInput.tsx +13 -9
- package/src/components/SelectInputInset/SelectInputInset.tsx +2 -0
- package/src/components/Sidebar/Sidebar.module.scss +4 -0
- package/src/components/Sidebar/Sidebar.stories.tsx +8 -4
- package/src/components/Sidebar/Sidebar.test.tsx +7 -4
- package/src/components/Sidebar/Sidebar.tsx +7 -4
- package/src/components/Table/Table.stories.tsx +102 -52
- package/src/components/TextInput/TextInput.tsx +2 -0
- package/src/components/TextInputInset/TextInputInset.tsx +2 -0
- package/src/components/TextareaInputInset/TextareaInputInset.tsx +2 -0
- package/src/components/TimePickerNative/TimePickerNative.stories.tsx +0 -1
- package/src/components/Toast/Toast.store.ts +1 -1
- package/src/components/Toast/Toast.stories.tsx +3 -2
- package/src/components/Toast/Toast.test.tsx +8 -6
- package/src/components/Toggle/Toggle.tsx +2 -0
- package/src/components/ToggleGroup/ToggleGroup.tsx +2 -0
- package/src/docs/Colors.mdx +0 -13
- package/src/lib/getColumnKeys.ts +3 -3
- package/src/lib/mergeRefs.ts +1 -1
- package/src/lib/tokens.ts +4 -4
- package/dist/components/Alert/Alert.constants.d.ts +0 -8
- package/dist/components/Alert/Alert.d.ts +0 -42
- package/dist/components/Alert/Alert.stories.d.ts +0 -12
- package/dist/components/Alert/Alert.types.d.ts +0 -7
- package/dist/components/AspectRatio/AspectRatio.d.ts +0 -3
- package/dist/components/AspectRatio/AspectRatio.stories.d.ts +0 -6
- package/dist/components/Badge/Badge.d.ts +0 -24
- package/dist/components/Badge/Badge.stories.d.ts +0 -8
- package/dist/components/Box/Box.d.ts +0 -247
- package/dist/components/Box/Box.stories.d.ts +0 -46
- package/dist/components/Button/Button.constants.d.ts +0 -3
- package/dist/components/Button/Button.d.ts +0 -53
- package/dist/components/Button/Button.stories.d.ts +0 -16
- package/dist/components/Calendar/Calendar.d.ts +0 -7
- package/dist/components/Calendar/Calendar.stories.d.ts +0 -12
- package/dist/components/Card/Card.d.ts +0 -17
- package/dist/components/Card/Card.stories.d.ts +0 -8
- package/dist/components/Card/components/CardFooter/CardFooter.d.ts +0 -13
- package/dist/components/Card/components/CardHeader/CardHeader.d.ts +0 -13
- package/dist/components/Card/components/CardSection/CardSection.d.ts +0 -46
- package/dist/components/Card/components/index.d.ts +0 -3
- package/dist/components/CheckboxInput/CheckboxInput.d.ts +0 -72
- package/dist/components/CheckboxInput/CheckboxInput.stories.d.ts +0 -18
- package/dist/components/CheckboxInput/components/Checkbox.d.ts +0 -71
- package/dist/components/CheckboxInput/components/CheckboxIcon.d.ts +0 -27
- package/dist/components/Collapsible/Collapsible.d.ts +0 -5
- package/dist/components/Collapsible/Collapsible.stories.d.ts +0 -9
- package/dist/components/Details/Details.d.ts +0 -15
- package/dist/components/Details/Details.stories.d.ts +0 -6
- package/dist/components/Details/DetailsSummary.d.ts +0 -7
- package/dist/components/Drawer/Drawer.d.ts +0 -105
- package/dist/components/Drawer/Drawer.stories.d.ts +0 -62
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -25
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +0 -9
- package/dist/components/FormControl/FormControl.d.ts +0 -38
- package/dist/components/FormLabel/FormLabel.d.ts +0 -41
- package/dist/components/FormLabel/FormLabel.stories.d.ts +0 -6
- package/dist/components/Formik/Formik.stories.d.ts +0 -18
- package/dist/components/Formik/FormikCheckboxInput/FormikCheckboxInput.d.ts +0 -12
- package/dist/components/Formik/FormikRadioGroup/FormikRadioGroup.d.ts +0 -12
- package/dist/components/Formik/FormikSelectInput/FormikSelectInput.d.ts +0 -13
- package/dist/components/Formik/FormikSelectInputInset/FormikSelectInputInset.d.ts +0 -12
- package/dist/components/Formik/FormikSelectInputNative/FormikSelectInputNative.d.ts +0 -12
- package/dist/components/Formik/FormikSwitch/FormikSwitch.d.ts +0 -12
- package/dist/components/Formik/FormikTextInput/FormikTextInput.d.ts +0 -12
- package/dist/components/Formik/FormikTextInputInset/FormikTextInputInset.d.ts +0 -12
- package/dist/components/Formik/FormikTextareaInput/FormikTextareaInput.d.ts +0 -12
- package/dist/components/Formik/FormikTextareaInputInset/FormikTextareaInputInset.d.ts +0 -12
- package/dist/components/Formik/FormikTimePicker/FormikTimePicker.d.ts +0 -12
- package/dist/components/Formik/FormikTimePickerNative/FormikTimePickerNative.d.ts +0 -12
- package/dist/components/Formik/FormikToggleGroup/FormikToggleGroup.d.ts +0 -20
- package/dist/components/Formik/FormikToggleGroupMulti/FormikToggleGroupMulti.d.ts +0 -18
- package/dist/components/Heading/Heading.constants.d.ts +0 -10
- package/dist/components/Heading/Heading.d.ts +0 -35
- package/dist/components/Heading/Heading.stories.d.ts +0 -9
- package/dist/components/HelpText/HelpText.d.ts +0 -12
- package/dist/components/Icon/Icon.d.ts +0 -22
- package/dist/components/Icon/Icon.stories.d.ts +0 -10
- package/dist/components/InputValidationMessage/InputValidationMessage.d.ts +0 -9
- package/dist/components/Modal/Modal.d.ts +0 -83
- package/dist/components/Modal/Modal.stories.d.ts +0 -13
- package/dist/components/Modal/components/ModalBody/ModalBody.d.ts +0 -4
- package/dist/components/Modal/components/ModalFooter/ModalFooter.d.ts +0 -4
- package/dist/components/Modal/components/ModalHeader/ModalHeader.d.ts +0 -21
- package/dist/components/Modal/components/index.d.ts +0 -4
- package/dist/components/Pagination/Pagination.d.ts +0 -51
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -8
- package/dist/components/Pagination/Pagination.utilities.d.ts +0 -10
- package/dist/components/Popover/Popover.d.ts +0 -8
- package/dist/components/Popover/Popover.stories.d.ts +0 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts +0 -75
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts +0 -16
- package/dist/components/RadioGroup/RadioInput/RadioInput.d.ts +0 -57
- package/dist/components/RadioGroup/RadioInput/RadioInputIcon.d.ts +0 -27
- package/dist/components/RangeInput/RangeInput.d.ts +0 -29
- package/dist/components/RangeInput/RangeInput.stories.d.ts +0 -7
- package/dist/components/ResponsiveProvider/ResponsiveProvider.d.ts +0 -17
- package/dist/components/ResponsiveProvider/ResponsiveProvider.stories.d.ts +0 -7
- package/dist/components/SelectInput/SelectInput.d.ts +0 -148
- package/dist/components/SelectInput/SelectInput.stories.d.ts +0 -24
- package/dist/components/SelectInputInset/SelectInputInset.d.ts +0 -92
- package/dist/components/SelectInputInset/SelectInputInset.stories.d.ts +0 -12
- package/dist/components/SelectInputNative/SelectInputNative.d.ts +0 -45
- package/dist/components/SelectInputNative/SelectInputNative.stories.d.ts +0 -19
- package/dist/components/Sidebar/Sidebar.d.ts +0 -57
- package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -9
- package/dist/components/Spinner/Spinner.d.ts +0 -12
- package/dist/components/Spinner/Spinner.stories.d.ts +0 -8
- package/dist/components/Switch/Switch.d.ts +0 -64
- package/dist/components/Switch/Switch.stories.d.ts +0 -12
- package/dist/components/Table/Table.d.ts +0 -86
- package/dist/components/Table/Table.stories.d.ts +0 -31
- package/dist/components/Table/TableBody/TableBody.d.ts +0 -52
- package/dist/components/Table/TableBody/TableBodyCell/TableBodyCell.d.ts +0 -45
- package/dist/components/Table/TableHead/TableHead.d.ts +0 -46
- package/dist/components/Table/TableHead/TableHeaderCell/TableHeaderCell.d.ts +0 -65
- package/dist/components/Table/common/TableRow/TableRow.d.ts +0 -67
- package/dist/components/TextInput/TextInput.d.ts +0 -106
- package/dist/components/TextInput/TextInput.stories.d.ts +0 -19
- package/dist/components/TextInputInset/TextInputInset.d.ts +0 -102
- package/dist/components/TextInputInset/TextInputInset.stories.d.ts +0 -13
- package/dist/components/TextareaInput/TextareaInput.d.ts +0 -97
- package/dist/components/TextareaInput/TextareaInput.stories.d.ts +0 -23
- package/dist/components/TextareaInputInset/TextareaInputInset.d.ts +0 -105
- package/dist/components/TextareaInputInset/TextareaInputInset.stories.d.ts +0 -12
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +0 -15
- package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts +0 -6
- package/dist/components/TimePicker/TimePicker.d.ts +0 -35
- package/dist/components/TimePicker/TimePicker.stories.d.ts +0 -12
- package/dist/components/TimePickerNative/TimePickerNative.d.ts +0 -39
- package/dist/components/TimePickerNative/TimePickerNative.stories.d.ts +0 -11
- package/dist/components/Toast/Toast.store.d.ts +0 -36
- package/dist/components/Toast/Toast.stories.d.ts +0 -14
- package/dist/components/Toast/Toast.types.d.ts +0 -75
- package/dist/components/Toast/ToastContainer.d.ts +0 -43
- package/dist/components/Toast/ToastNotification.d.ts +0 -28
- package/dist/components/Toast/index.d.ts +0 -4
- package/dist/components/Toast/toast.d.ts +0 -20
- package/dist/components/Toast/useToasts.d.ts +0 -14
- package/dist/components/Toggle/Toggle.d.ts +0 -7
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -11
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -19
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.d.ts +0 -8
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -8
- package/dist/constants/keyCodes.d.ts +0 -2
- package/dist/css/index.css +0 -36
- package/dist/hooks/index.d.ts +0 -6
- package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +0 -9
- package/dist/hooks/useBreakpoint/useBreakpoint.stories.d.ts +0 -6
- package/dist/hooks/useIsMobile/useIsMobile.d.ts +0 -1
- package/dist/hooks/useIsMobile/useIsMobile.stories.d.ts +0 -6
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +0 -2
- package/dist/hooks/useOpenClose/useOpenClose.d.ts +0 -39
- package/dist/hooks/useOpenClose/useOpenClose.stories.d.ts +0 -6
- package/dist/hooks/useTheme/useTheme.d.ts +0 -5
- package/dist/hooks/useTheme/useTheme.stories.d.ts +0 -6
- package/dist/hooks/useWindowSize/useWindowSize.d.ts +0 -7
- package/dist/hooks/useWindowSize/useWindowSize.stories.d.ts +0 -6
- package/dist/lib/cssShorthandToClasses.d.ts +0 -4
- package/dist/lib/doesStringIncludeCssUnit.d.ts +0 -1
- package/dist/lib/generateResponsiveClasses.d.ts +0 -2
- package/dist/lib/getAutoCompleteValue.d.ts +0 -1
- package/dist/lib/getColumnKeys.d.ts +0 -3
- package/dist/lib/getDimensionCss.d.ts +0 -12
- package/dist/lib/getElementType.d.ts +0 -14
- package/dist/lib/getFlexCss.d.ts +0 -9
- package/dist/lib/index.d.ts +0 -15
- package/dist/lib/isFunction.d.ts +0 -3
- package/dist/lib/mergeRefs.d.ts +0 -2
- package/dist/lib/prefersReducedMotion.d.ts +0 -1
- package/dist/lib/react-children-utilities/filter.d.ts +0 -3
- package/dist/lib/react-children-utilities/index.d.ts +0 -1
- package/dist/lib/reactRouterClickHandler.d.ts +0 -12
- package/dist/lib/resolveValue.d.ts +0 -3
- package/dist/lib/tokens.d.ts +0 -22
- package/dist/modes.d.ts +0 -8
- package/dist/types/index.d.ts +0 -103
- package/dist/types/lib.types.d.ts +0 -3
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { ChangeEvent, MouseEvent, KeyboardEvent, FocusEvent, ForwardRefExoticComponent, ReactNode, HTMLProps, InputHTMLAttributes } from 'react';
|
|
2
|
-
import { ResponsiveProp } from '../../types';
|
|
3
|
-
import { BoxProps } from '../Box/Box';
|
|
4
|
-
export type TextInputInsetSize = 'md' | 'lg';
|
|
5
|
-
export interface TextInputInsetProps {
|
|
6
|
-
/**
|
|
7
|
-
* The input's id attribute. Used to programmatically tie the input with its label.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
/**
|
|
11
|
-
* Custom content to be displayed above the input. If the label is hidden, will be used to set aria-label attribute.
|
|
12
|
-
*/
|
|
13
|
-
label: string;
|
|
14
|
-
/**
|
|
15
|
-
* Callback function to call on change event.
|
|
16
|
-
*/
|
|
17
|
-
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
/**
|
|
19
|
-
* The text value of the input. Required since our Input is a controlled component.
|
|
20
|
-
*/
|
|
21
|
-
value: InputHTMLAttributes<HTMLInputElement>['value'];
|
|
22
|
-
/**
|
|
23
|
-
* Automatically focus the input when the page is loaded.
|
|
24
|
-
*/
|
|
25
|
-
autoFocus?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Custom class to be added to standard input classes.
|
|
28
|
-
*/
|
|
29
|
-
className?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Mark the input field as invalid and display a validation message.
|
|
32
|
-
* Pass a string or node to render a validation message below the input.
|
|
33
|
-
*/
|
|
34
|
-
error?: ReactNode;
|
|
35
|
-
/**
|
|
36
|
-
* Additional clarifying text to help describe the input
|
|
37
|
-
*/
|
|
38
|
-
helpText?: ReactNode;
|
|
39
|
-
/**
|
|
40
|
-
* Props passed directly to the input element of the component
|
|
41
|
-
*/
|
|
42
|
-
inputProps?: BoxProps & HTMLProps<HTMLInputElement>;
|
|
43
|
-
/**
|
|
44
|
-
* The input's disabled attribute
|
|
45
|
-
*/
|
|
46
|
-
isDisabled?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* The required and aria-required attributes on the input
|
|
49
|
-
*/
|
|
50
|
-
isRequired?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* The input's 'maxlength' attribute.
|
|
53
|
-
* NOTE: initializing the input with a value longer than the desired maxlength will not trim this value.
|
|
54
|
-
*/
|
|
55
|
-
maxLength?: number;
|
|
56
|
-
/**
|
|
57
|
-
* The input's 'name' attribute.
|
|
58
|
-
*/
|
|
59
|
-
name?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Callback function to call on blur event.
|
|
62
|
-
*/
|
|
63
|
-
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
64
|
-
/**
|
|
65
|
-
* Callback function to call when input us cleared. When this is passed,
|
|
66
|
-
* the input will display an icon on the right side, for triggering this callback.
|
|
67
|
-
*/
|
|
68
|
-
onClear?: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
69
|
-
/**
|
|
70
|
-
* Callback function to call on focus event.
|
|
71
|
-
*/
|
|
72
|
-
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
73
|
-
/**
|
|
74
|
-
* The input placeholder attribute.
|
|
75
|
-
*/
|
|
76
|
-
placeholder?: string;
|
|
77
|
-
/**
|
|
78
|
-
* An input helper rendered before the input field value
|
|
79
|
-
*/
|
|
80
|
-
prefix?: ReactNode;
|
|
81
|
-
/**
|
|
82
|
-
* Visual indicator that the field is required, that gets appended to the label
|
|
83
|
-
*/
|
|
84
|
-
requiredIndicator?: ReactNode;
|
|
85
|
-
/**
|
|
86
|
-
* The size of the text input.
|
|
87
|
-
*/
|
|
88
|
-
size?: TextInputInsetSize | ResponsiveProp<TextInputInsetSize>;
|
|
89
|
-
/**
|
|
90
|
-
* An input helper rendered after the input field value
|
|
91
|
-
*/
|
|
92
|
-
suffix?: ReactNode;
|
|
93
|
-
/**
|
|
94
|
-
* The input 'type' value. Defaults to type 'text'.
|
|
95
|
-
*/
|
|
96
|
-
type?: InputHTMLAttributes<HTMLInputElement>['type'];
|
|
97
|
-
/**
|
|
98
|
-
* Additional props to be spread to rendered element
|
|
99
|
-
*/
|
|
100
|
-
[x: string]: any;
|
|
101
|
-
}
|
|
102
|
-
export declare const TextInputInset: ForwardRefExoticComponent<TextInputInsetProps>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextInputInset } from './TextInputInset';
|
|
3
|
-
import type { Meta } from '@storybook/react-vite';
|
|
4
|
-
declare const meta: Meta<typeof TextInputInset>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Default: () => React.JSX.Element;
|
|
7
|
-
export declare const Required: () => React.JSX.Element;
|
|
8
|
-
export declare const HelpText: () => React.JSX.Element;
|
|
9
|
-
export declare const ValidationError: () => React.JSX.Element;
|
|
10
|
-
export declare const Disabled: () => React.JSX.Element;
|
|
11
|
-
export declare const Clearable: () => React.JSX.Element;
|
|
12
|
-
export declare const PrefixAndSuffix: () => React.JSX.Element;
|
|
13
|
-
export declare const Sizes: () => React.JSX.Element;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { FC, ChangeEvent, FocusEvent, ReactNode } from 'react';
|
|
2
|
-
import { ResponsiveProp } from '../../types';
|
|
3
|
-
import { BoxProps } from '../Box/Box';
|
|
4
|
-
export type TextareaInputSize = 'sm' | 'md' | 'lg';
|
|
5
|
-
export interface TextareaInputProps extends Omit<BoxProps, 'as' | 'width'> {
|
|
6
|
-
/**
|
|
7
|
-
* The input's id attribute. Used to programmatically tie the input with its label.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
/**
|
|
11
|
-
* Custom content to be displayed above the input. If the label is hidden, will be used to set aria-label attribute.
|
|
12
|
-
*/
|
|
13
|
-
label: string;
|
|
14
|
-
/**
|
|
15
|
-
* Callback function to call on change event.
|
|
16
|
-
*/
|
|
17
|
-
onChange: (event: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
18
|
-
/**
|
|
19
|
-
* The text value of the input. Required since our Input is a controlled component.
|
|
20
|
-
*/
|
|
21
|
-
value: string;
|
|
22
|
-
/**
|
|
23
|
-
* The input's 'autocomplete' attribute.
|
|
24
|
-
*/
|
|
25
|
-
autoComplete?: boolean | string;
|
|
26
|
-
/**
|
|
27
|
-
* Automatically focus the input when the page is loaded.
|
|
28
|
-
*/
|
|
29
|
-
autoFocus?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Custom class to be added to standard input classes.
|
|
32
|
-
*/
|
|
33
|
-
className?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Mark the input field as invalid and display a validation message.
|
|
36
|
-
* Pass a string or node to render a validation message below the input.
|
|
37
|
-
*/
|
|
38
|
-
error?: ReactNode;
|
|
39
|
-
/**
|
|
40
|
-
* Additional clarifying text to help describe the input
|
|
41
|
-
*/
|
|
42
|
-
helpText?: ReactNode;
|
|
43
|
-
/**
|
|
44
|
-
* Visually hide the label.
|
|
45
|
-
*/
|
|
46
|
-
hideLabel?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* The input's disabled attribute
|
|
49
|
-
*/
|
|
50
|
-
isDisabled?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* The required and aria-required attributes on the input
|
|
53
|
-
*/
|
|
54
|
-
isRequired?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* The input's 'maxlength' attribute.
|
|
57
|
-
* NOTE: initializing the input with a value longer than the desired maxlength will not trim this value.
|
|
58
|
-
*/
|
|
59
|
-
maxLength?: number;
|
|
60
|
-
/**
|
|
61
|
-
* The input's 'name' attribute.
|
|
62
|
-
*/
|
|
63
|
-
name?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Callback function to call on blur event.
|
|
66
|
-
*/
|
|
67
|
-
onBlur?: (event: FocusEvent<HTMLTextAreaElement>) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Callback function to call on focus event.
|
|
70
|
-
*/
|
|
71
|
-
onFocus?: (event: FocusEvent<HTMLTextAreaElement>) => void;
|
|
72
|
-
/**
|
|
73
|
-
* The input placeholder attribute.
|
|
74
|
-
*/
|
|
75
|
-
placeholder?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Visual indicator that the field is required, that gets appended to the label
|
|
78
|
-
*/
|
|
79
|
-
requiredIndicator?: ReactNode;
|
|
80
|
-
/**
|
|
81
|
-
* Textarea resize behavior
|
|
82
|
-
*/
|
|
83
|
-
resize?: 'vertical' | 'horizontal' | 'none' | 'both';
|
|
84
|
-
/**
|
|
85
|
-
* number of visible text lines for the control.
|
|
86
|
-
*/
|
|
87
|
-
rows?: number;
|
|
88
|
-
/**
|
|
89
|
-
* The size of the text input.
|
|
90
|
-
*/
|
|
91
|
-
size?: TextareaInputSize | ResponsiveProp<TextareaInputSize>;
|
|
92
|
-
/**
|
|
93
|
-
* Additional props to be spread to rendered element
|
|
94
|
-
*/
|
|
95
|
-
[x: string]: any;
|
|
96
|
-
}
|
|
97
|
-
export declare const TextareaInput: FC<TextareaInputProps>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TextareaInput } from './TextareaInput';
|
|
4
|
-
declare const meta: Meta<typeof TextareaInput>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Basic: () => React.JSX.Element;
|
|
7
|
-
export declare const Default: () => React.JSX.Element;
|
|
8
|
-
export declare const Required: () => React.JSX.Element;
|
|
9
|
-
export declare const CustomRequiredIndicator: () => React.JSX.Element;
|
|
10
|
-
export declare const HelpText: () => React.JSX.Element;
|
|
11
|
-
export declare const Resize: () => React.JSX.Element;
|
|
12
|
-
export declare const Sizes: () => React.JSX.Element;
|
|
13
|
-
export declare const Placeholder: () => React.JSX.Element;
|
|
14
|
-
export declare const Autofocus: () => React.JSX.Element;
|
|
15
|
-
export declare const HiddenLabel: () => React.JSX.Element;
|
|
16
|
-
export declare const Disabled: () => React.JSX.Element;
|
|
17
|
-
export declare const DisabledWithValue: () => React.JSX.Element;
|
|
18
|
-
export declare const DisabledWithPlaceholder: () => React.JSX.Element;
|
|
19
|
-
export declare const MaxLength: () => React.JSX.Element;
|
|
20
|
-
export declare const RequiredWithError: () => React.JSX.Element;
|
|
21
|
-
export declare const RequiredWithErrorAndValidationMessage: () => React.JSX.Element;
|
|
22
|
-
export declare const NotRequiredWithErrorAndValidationMessage: () => React.JSX.Element;
|
|
23
|
-
export declare const ErrorWithHiddenLabel: () => React.JSX.Element;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { ChangeEvent, FocusEvent, ForwardRefExoticComponent, ReactNode, HTMLProps, InputHTMLAttributes } from 'react';
|
|
2
|
-
import { ResponsiveProp } from '../../types';
|
|
3
|
-
import { BoxProps } from '../Box/Box';
|
|
4
|
-
export type TextareaInputInsetSize = 'md' | 'lg';
|
|
5
|
-
export interface TextareaInputInsetProps {
|
|
6
|
-
/**
|
|
7
|
-
* The input's id attribute. Used to programmatically tie the input with its label.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
/**
|
|
11
|
-
* Custom content to be displayed above the input. If the label is hidden, will be used to set aria-label attribute.
|
|
12
|
-
*/
|
|
13
|
-
label: string;
|
|
14
|
-
/**
|
|
15
|
-
* Callback function to call on change event.
|
|
16
|
-
*/
|
|
17
|
-
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
/**
|
|
19
|
-
* The text value of the input. Required since our Input is a controlled component.
|
|
20
|
-
*/
|
|
21
|
-
value: InputHTMLAttributes<HTMLInputElement>['value'];
|
|
22
|
-
/**
|
|
23
|
-
* Automatically focus the input when the page is loaded.
|
|
24
|
-
*/
|
|
25
|
-
autoFocus?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Custom class to be added to standard input classes.
|
|
28
|
-
*/
|
|
29
|
-
className?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Mark the input field as invalid and display a validation message.
|
|
32
|
-
* Pass a string or node to render a validation message below the input.
|
|
33
|
-
*/
|
|
34
|
-
error?: ReactNode;
|
|
35
|
-
/**
|
|
36
|
-
* Additional clarifying text to help describe the input
|
|
37
|
-
*/
|
|
38
|
-
helpText?: ReactNode;
|
|
39
|
-
/**
|
|
40
|
-
* Props passed directly to the input element of the component
|
|
41
|
-
*/
|
|
42
|
-
inputProps?: BoxProps & HTMLProps<HTMLInputElement>;
|
|
43
|
-
/**
|
|
44
|
-
* The input's disabled attribute
|
|
45
|
-
*/
|
|
46
|
-
isDisabled?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* The required and aria-required attributes on the input
|
|
49
|
-
*/
|
|
50
|
-
isRequired?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* The input's 'maxlength' attribute.
|
|
53
|
-
* NOTE: initializing the input with a value longer than the desired maxlength will not trim this value.
|
|
54
|
-
*/
|
|
55
|
-
maxLength?: number;
|
|
56
|
-
/**
|
|
57
|
-
* The input's 'name' attribute.
|
|
58
|
-
*/
|
|
59
|
-
name?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Callback function to call on blur event.
|
|
62
|
-
*/
|
|
63
|
-
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
64
|
-
/**
|
|
65
|
-
* Callback function to call on focus event.
|
|
66
|
-
*/
|
|
67
|
-
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
68
|
-
/**
|
|
69
|
-
* The input placeholder attribute.
|
|
70
|
-
*/
|
|
71
|
-
placeholder?: string;
|
|
72
|
-
/**
|
|
73
|
-
* An input helper rendered before the input field value
|
|
74
|
-
*/
|
|
75
|
-
prefix?: ReactNode;
|
|
76
|
-
/**
|
|
77
|
-
* Visual indicator that the field is required, that gets appended to the label
|
|
78
|
-
*/
|
|
79
|
-
requiredIndicator?: ReactNode;
|
|
80
|
-
/**
|
|
81
|
-
* Textarea resize behavior
|
|
82
|
-
*/
|
|
83
|
-
resize?: 'vertical' | 'horizontal' | 'none' | 'both';
|
|
84
|
-
/**
|
|
85
|
-
* number of visible text lines for the control.
|
|
86
|
-
*/
|
|
87
|
-
rows?: number;
|
|
88
|
-
/**
|
|
89
|
-
* The size of the text input.
|
|
90
|
-
*/
|
|
91
|
-
size?: TextareaInputInsetSize | ResponsiveProp<TextareaInputInsetSize>;
|
|
92
|
-
/**
|
|
93
|
-
* An input helper rendered after the input field value
|
|
94
|
-
*/
|
|
95
|
-
suffix?: ReactNode;
|
|
96
|
-
/**
|
|
97
|
-
* The input 'type' value. Defaults to type 'text'.
|
|
98
|
-
*/
|
|
99
|
-
type?: InputHTMLAttributes<HTMLInputElement>['type'];
|
|
100
|
-
/**
|
|
101
|
-
* Additional props to be spread to rendered element
|
|
102
|
-
*/
|
|
103
|
-
[x: string]: any;
|
|
104
|
-
}
|
|
105
|
-
export declare const TextareaInputInset: ForwardRefExoticComponent<TextareaInputInsetProps>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TextareaInputInset } from './TextareaInputInset';
|
|
4
|
-
declare const meta: Meta<typeof TextareaInputInset>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Default: () => React.JSX.Element;
|
|
7
|
-
export declare const Required: () => React.JSX.Element;
|
|
8
|
-
export declare const HelpText: () => React.JSX.Element;
|
|
9
|
-
export declare const ValidationError: () => React.JSX.Element;
|
|
10
|
-
export declare const Disabled: () => React.JSX.Element;
|
|
11
|
-
export declare const Sizes: () => React.JSX.Element;
|
|
12
|
-
export declare const Resize: () => React.JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type Theme = 'dark' | 'light' | 'system';
|
|
3
|
-
type ThemeProviderProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
defaultTheme?: Theme;
|
|
6
|
-
storageKey?: string;
|
|
7
|
-
};
|
|
8
|
-
type ThemeProviderState = {
|
|
9
|
-
theme: Theme;
|
|
10
|
-
setTheme: (theme: Theme) => void;
|
|
11
|
-
isDarkMode?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare const ThemeProviderContext: React.Context<ThemeProviderState>;
|
|
14
|
-
export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): React.JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SelectInputProps } from '../SelectInput/SelectInput';
|
|
3
|
-
export type TimePickerProps = Omit<SelectInputProps, 'options'> & {
|
|
4
|
-
/**
|
|
5
|
-
* Options to govern the display of the option labels in the select.
|
|
6
|
-
* This is a direct passthrough to the second argument of JS `toLocaleTimeString`.
|
|
7
|
-
* [More](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)
|
|
8
|
-
*/
|
|
9
|
-
dateDisplayOptions?: Intl.DateTimeFormatOptions;
|
|
10
|
-
/**
|
|
11
|
-
* End hour and minute
|
|
12
|
-
*/
|
|
13
|
-
endTime?: {
|
|
14
|
-
hour: number;
|
|
15
|
-
minute: number;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Interval of displayed times (in seconds). Defaults to 900 seconds (15 minutes).
|
|
19
|
-
*/
|
|
20
|
-
interval?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Locale(s) to be passed down in order to format the label values in the select.
|
|
23
|
-
* This corresponds to the first argument of JS `toLocaleTimeString`.
|
|
24
|
-
* [More](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)
|
|
25
|
-
*/
|
|
26
|
-
locales?: string | string[];
|
|
27
|
-
/**
|
|
28
|
-
* Start hour and minute
|
|
29
|
-
*/
|
|
30
|
-
startTime?: {
|
|
31
|
-
hour: number;
|
|
32
|
-
minute: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export declare const TimePicker: FC<TimePickerProps>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TimePicker } from './TimePicker';
|
|
4
|
-
declare const meta: Meta<typeof TimePicker>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Default: () => React.JSX.Element;
|
|
7
|
-
export declare const WithASpecificInterval: () => React.JSX.Element;
|
|
8
|
-
export declare const WithMinAndMaxTimes: () => React.JSX.Element;
|
|
9
|
-
export declare const WithCustomDateDisplay: () => React.JSX.Element;
|
|
10
|
-
export declare const WithOpenMenu: () => React.JSX.Element;
|
|
11
|
-
export declare const HelpText: () => React.JSX.Element;
|
|
12
|
-
export declare const Sizes: () => React.JSX.Element;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SelectInputNativeProps } from '../SelectInputNative/SelectInputNative';
|
|
3
|
-
export interface TimePickerNativeProps extends Omit<SelectInputNativeProps, 'options'> {
|
|
4
|
-
/**
|
|
5
|
-
* Options to govern the display of the option labels in the select.
|
|
6
|
-
* This is a direct passthrough to the second argument of JS `toLocaleTimeString`.
|
|
7
|
-
* [More](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)
|
|
8
|
-
*/
|
|
9
|
-
dateDisplayOptions?: Intl.DateTimeFormatOptions;
|
|
10
|
-
/**
|
|
11
|
-
* End hour and minute
|
|
12
|
-
*/
|
|
13
|
-
endTime?: {
|
|
14
|
-
hour: number;
|
|
15
|
-
minute: number;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Interval of displayed times (in seconds). Defaults to 900 seconds (15 minutes).
|
|
19
|
-
*/
|
|
20
|
-
interval?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Locale(s) to be passed down in order to format the label values in the select.
|
|
23
|
-
* This corresponds to the first argument of JS `toLocaleTimeString`.
|
|
24
|
-
* [More](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString)
|
|
25
|
-
*/
|
|
26
|
-
locales?: string | string[];
|
|
27
|
-
/**
|
|
28
|
-
* Start hour and minute
|
|
29
|
-
*/
|
|
30
|
-
startTime?: {
|
|
31
|
-
hour: number;
|
|
32
|
-
minute: number;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Should be ISO timestamp as returned by `onChange`, and matching value of option object.
|
|
36
|
-
*/
|
|
37
|
-
value: SelectInputNativeProps['value'];
|
|
38
|
-
}
|
|
39
|
-
export declare const TimePickerNative: FC<TimePickerNativeProps>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TimePickerNative } from './TimePickerNative';
|
|
4
|
-
declare const meta: Meta<typeof TimePickerNative>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Default: () => React.JSX.Element;
|
|
7
|
-
export declare const WithASpecificInterval: () => React.JSX.Element;
|
|
8
|
-
export declare const WithMinAndMaxTimes: () => React.JSX.Element;
|
|
9
|
-
export declare const WithCustomDateDisplay: () => React.JSX.Element;
|
|
10
|
-
export declare const HelpText: () => React.JSX.Element;
|
|
11
|
-
export declare const Sizes: () => React.JSX.Element;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Toast, ExtendedToastOptions } from './Toast.types';
|
|
2
|
-
export declare enum ToastStoreActionType {
|
|
3
|
-
ADD_TOAST = "TOAST/ADD_TOAST",
|
|
4
|
-
UPDATE_TOAST = "TOAST/UPDATE_TOAST",
|
|
5
|
-
UPSERT_TOAST = "TOAST/UPSERT_TOAST",
|
|
6
|
-
DISMISS_TOAST = "TOAST/DISMISS_TOAST",
|
|
7
|
-
REMOVE_TOAST = "TOAST/REMOVE_TOAST",
|
|
8
|
-
START_PAUSE = "TOAST/START_PAUSE",
|
|
9
|
-
END_PAUSE = "TOAST/END_PAUSE"
|
|
10
|
-
}
|
|
11
|
-
type GenericAction<TActionType extends PropertyKey, TPayload extends Record<string, unknown>> = {
|
|
12
|
-
type: TActionType;
|
|
13
|
-
payload: TPayload;
|
|
14
|
-
};
|
|
15
|
-
type ToastStoreAction = GenericAction<ToastStoreActionType.ADD_TOAST, {
|
|
16
|
-
toast: Toast;
|
|
17
|
-
}> | GenericAction<ToastStoreActionType.UPSERT_TOAST, {
|
|
18
|
-
toast: Toast;
|
|
19
|
-
}> | GenericAction<ToastStoreActionType.UPDATE_TOAST, {
|
|
20
|
-
toast: Partial<Toast>;
|
|
21
|
-
}> | GenericAction<ToastStoreActionType.DISMISS_TOAST, {
|
|
22
|
-
toastId?: string;
|
|
23
|
-
}> | GenericAction<ToastStoreActionType.REMOVE_TOAST, {
|
|
24
|
-
toastId?: string;
|
|
25
|
-
}> | GenericAction<ToastStoreActionType.START_PAUSE, {
|
|
26
|
-
time: number;
|
|
27
|
-
}> | GenericAction<ToastStoreActionType.END_PAUSE, {
|
|
28
|
-
time: number;
|
|
29
|
-
}>;
|
|
30
|
-
interface ToastState {
|
|
31
|
-
toasts: Toast[];
|
|
32
|
-
pausedAt: number | undefined;
|
|
33
|
-
}
|
|
34
|
-
export declare const dispatch: (action: ToastStoreAction) => void;
|
|
35
|
-
export declare const useToastStore: (toastOptions?: ExtendedToastOptions) => ToastState;
|
|
36
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ToastContainer } from './';
|
|
4
|
-
declare const meta: Meta<typeof ToastContainer>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Example: () => React.JSX.Element;
|
|
7
|
-
export declare const Column: () => React.JSX.Element;
|
|
8
|
-
export declare const Position: () => React.JSX.Element;
|
|
9
|
-
export declare const Duration: () => React.JSX.Element;
|
|
10
|
-
export declare const NotDismissible: () => React.JSX.Element;
|
|
11
|
-
export declare const ProgrammaticDismiss: () => React.JSX.Element;
|
|
12
|
-
export declare const Compact: () => React.JSX.Element;
|
|
13
|
-
export declare const BasicTypes: () => React.JSX.Element;
|
|
14
|
-
export declare const AdvancedTypes: () => React.JSX.Element;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ValueOrFunction } from '../../types';
|
|
3
|
-
export type ToastType = 'success' | 'error' | 'loading' | 'blank' | 'custom';
|
|
4
|
-
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
5
|
-
export interface Toast {
|
|
6
|
-
/**
|
|
7
|
-
* Type of toast to create.
|
|
8
|
-
*/
|
|
9
|
-
type: ToastType;
|
|
10
|
-
/**
|
|
11
|
-
* Unique id for the toast.
|
|
12
|
-
*/
|
|
13
|
-
id: string;
|
|
14
|
-
/**
|
|
15
|
-
* Toast message
|
|
16
|
-
*/
|
|
17
|
-
message: ValueOrFunction<React.ReactNode, Toast>;
|
|
18
|
-
/**
|
|
19
|
-
* Determine of toast layout is compact or default.
|
|
20
|
-
*/
|
|
21
|
-
isCompact?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Custom duration for toast.
|
|
24
|
-
*/
|
|
25
|
-
duration?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Amount of time the toast timeout has been paused for.
|
|
28
|
-
* When the toast timeout is paused, its auto-dismissal will be delayed.
|
|
29
|
-
*/
|
|
30
|
-
pauseDuration: number;
|
|
31
|
-
/**
|
|
32
|
-
* Custom toast position, use as needed to override global position from ToastContainer.
|
|
33
|
-
*/
|
|
34
|
-
position?: ToastPosition;
|
|
35
|
-
/**
|
|
36
|
-
* Accessibility options
|
|
37
|
-
*/
|
|
38
|
-
ariaProps: {
|
|
39
|
-
role: 'status' | 'alert';
|
|
40
|
-
'aria-live': 'assertive' | 'off' | 'polite';
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Whether the toast can be dismissed (if true, the toast will include a close button)
|
|
44
|
-
*/
|
|
45
|
-
canDismiss?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Custom styles.
|
|
48
|
-
*/
|
|
49
|
-
style?: React.CSSProperties;
|
|
50
|
-
/**
|
|
51
|
-
* Custom className
|
|
52
|
-
*/
|
|
53
|
-
className?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Epoch timestamp
|
|
56
|
-
*/
|
|
57
|
-
createdAt: number;
|
|
58
|
-
/**
|
|
59
|
-
* Whether the toast is visible at the current time.
|
|
60
|
-
* Used in order to display a proper fade-out animation before the element is fully removed from the DOM.
|
|
61
|
-
*/
|
|
62
|
-
visible: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Height of element (calculated with getBoundingClientRect)
|
|
65
|
-
*/
|
|
66
|
-
height?: number;
|
|
67
|
-
}
|
|
68
|
-
export type ToastOptions = Partial<Pick<Toast, 'id' | 'duration' | 'ariaProps' | 'className' | 'style' | 'position' | 'canDismiss' | 'isCompact'>>;
|
|
69
|
-
/**
|
|
70
|
-
* Extends toast options so that you can include options for each type of toast in the options.
|
|
71
|
-
* e.g: { duration: 1000, success: { duration: 2000 } }
|
|
72
|
-
*/
|
|
73
|
-
export type ExtendedToastOptions = ToastOptions & {
|
|
74
|
-
[key in ToastType]?: ToastOptions;
|
|
75
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Toast, ToastPosition, ExtendedToastOptions } from './Toast.types';
|
|
3
|
-
export declare const createRectRef: (onRect: (rect: DOMRect) => void) => (el: HTMLElement | null) => void;
|
|
4
|
-
export interface ToastContainerProps {
|
|
5
|
-
/**
|
|
6
|
-
* Render function for each individual toast.
|
|
7
|
-
* This can be used to render custom toasts, although we recommend using the standard version,
|
|
8
|
-
* unless absolutely necessary.
|
|
9
|
-
*/
|
|
10
|
-
children?: (t: Toast) => JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* Style object for the toast container if needed.
|
|
13
|
-
*/
|
|
14
|
-
containerStyle?: React.CSSProperties;
|
|
15
|
-
/**
|
|
16
|
-
* Custom classname for toast container if needed.
|
|
17
|
-
*/
|
|
18
|
-
containerClassName?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The vertical gap between each toast notification when multiple toasts are on screen (in pixels).
|
|
21
|
-
*/
|
|
22
|
-
gutter?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Global position for all toasts in container.
|
|
25
|
-
* NOTE: This can be overwritten by the position property of each individual toast.
|
|
26
|
-
*/
|
|
27
|
-
position?: ToastPosition;
|
|
28
|
-
/**
|
|
29
|
-
* Display toasts in reverse order.
|
|
30
|
-
* NOTE: Reverse order in this case means that older toasts remain close to the position origin.
|
|
31
|
-
* and newer toasts appear further away from the origin.
|
|
32
|
-
*/
|
|
33
|
-
reverseOrder?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Global options for each toast. Can be overwritten for each individual toast as needed.
|
|
36
|
-
*/
|
|
37
|
-
toastOptions?: ExtendedToastOptions;
|
|
38
|
-
/**
|
|
39
|
-
* Props spread into main container.
|
|
40
|
-
*/
|
|
41
|
-
[x: string]: unknown;
|
|
42
|
-
}
|
|
43
|
-
export declare const ToastContainer: React.FC<ToastContainerProps>;
|