@indico-data/design-system 3.0.10 → 3.2.0
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/.storybook/main.ts +3 -0
- package/lib/components/badge/types.d.ts +4 -0
- package/lib/components/button/types.d.ts +52 -2
- package/lib/components/card/Card.d.ts +5 -0
- package/lib/components/floatUI/types.d.ts +7 -0
- package/lib/components/forms/checkbox/Checkbox.d.ts +7 -0
- package/lib/components/forms/date/datePicker/types.d.ts +10 -0
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +16 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +8 -0
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +9 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +9 -0
- package/lib/components/forms/numberInput/NumberInput.d.ts +4 -0
- package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -0
- package/lib/components/forms/radio/Radio.d.ts +6 -0
- package/lib/components/forms/select/Select.d.ts +10 -0
- package/lib/components/forms/textarea/Textarea.d.ts +7 -0
- package/lib/components/forms/timePicker/TimePicker.d.ts +5 -0
- package/lib/components/forms/toggle/Toggle.d.ts +7 -0
- package/lib/components/icons/types.d.ts +5 -0
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +4 -0
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +2 -0
- package/lib/components/menu/Menu.d.ts +1 -0
- package/lib/components/modal/types.d.ts +22 -0
- package/lib/components/pagination/types.d.ts +4 -0
- package/lib/components/pill/Pill.d.ts +1 -1
- package/lib/components/pill/Pill.stories.d.ts +2 -1
- package/lib/components/pill/types.d.ts +8 -2
- package/lib/components/skeleton/Skeleton.d.ts +5 -0
- package/lib/components/stepper/types.d.ts +9 -0
- package/lib/components/table/types.d.ts +9 -0
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +25 -0
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +4 -0
- package/lib/components/tooltip/Tooltip.d.ts +6 -0
- package/lib/components/truncate/types.d.ts +4 -0
- package/lib/index.css +4977 -5020
- package/lib/index.d.ts +268 -5
- package/lib/index.esm.css +4977 -5020
- package/lib/index.esm.js +3 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +3 -1
- package/package.json +2 -1
- package/src/components/badge/Badge.stories.tsx +0 -4
- package/src/components/badge/types.ts +4 -0
- package/src/components/button/Button.stories.tsx +5 -18
- package/src/components/button/types.ts +52 -2
- package/src/components/card/Card.stories.tsx +0 -5
- package/src/components/card/Card.tsx +5 -0
- package/src/components/floatUI/FloatUI.stories.tsx +0 -11
- package/src/components/floatUI/types.ts +7 -0
- package/src/components/forms/checkbox/Checkbox.stories.tsx +0 -7
- package/src/components/forms/checkbox/Checkbox.tsx +7 -0
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +0 -33
- package/src/components/forms/date/datePicker/types.ts +10 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +5 -22
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +16 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +0 -25
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +8 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +0 -32
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +9 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +0 -28
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +9 -0
- package/src/components/forms/numberInput/NumberInput.stories.tsx +0 -4
- package/src/components/forms/numberInput/NumberInput.tsx +4 -0
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +0 -1
- package/src/components/forms/passwordInput/PasswordInput.tsx +1 -0
- package/src/components/forms/radio/Radio.stories.tsx +0 -6
- package/src/components/forms/radio/Radio.tsx +6 -0
- package/src/components/forms/select/Select.stories.tsx +1 -14
- package/src/components/forms/select/Select.tsx +10 -0
- package/src/components/forms/textarea/Textarea.stories.tsx +0 -7
- package/src/components/forms/textarea/Textarea.tsx +7 -0
- package/src/components/forms/timePicker/TimePicker.stories.tsx +0 -5
- package/src/components/forms/timePicker/TimePicker.tsx +5 -0
- package/src/components/forms/toggle/Toggle.stories.tsx +0 -7
- package/src/components/forms/toggle/Toggle.tsx +7 -0
- package/src/components/icons/Icon.stories.tsx +0 -7
- package/src/components/icons/types.ts +5 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -5
- package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +4 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -3
- package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +2 -0
- package/src/components/menu/Menu.stories.tsx +0 -3
- package/src/components/menu/Menu.tsx +1 -0
- package/src/components/modal/Modal.stories.tsx +1 -25
- package/src/components/modal/types.ts +22 -0
- package/src/components/pagination/Pagination.stories.tsx +0 -4
- package/src/components/pagination/types.ts +4 -0
- package/src/components/pill/Pill.mdx +6 -2
- package/src/components/pill/Pill.stories.tsx +50 -61
- package/src/components/pill/Pill.tsx +4 -2
- package/src/components/pill/__tests__/Pill.test.tsx +28 -10
- package/src/components/pill/styles/Pill.scss +12 -129
- package/src/components/pill/types.ts +8 -2
- package/src/components/skeleton/Skeleton.stories.tsx +0 -7
- package/src/components/skeleton/Skeleton.tsx +5 -0
- package/src/components/stepper/Stepper.stories.tsx +0 -19
- package/src/components/stepper/types.ts +9 -0
- package/src/components/table/Table.stories.tsx +0 -35
- package/src/components/table/types.ts +9 -0
- package/src/components/tanstackTable/TankstackTable.types.ts +25 -0
- package/src/components/tanstackTable/TanstackTable.stories.tsx +0 -29
- package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +0 -4
- package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +4 -0
- package/src/components/tooltip/Tooltip.stories.tsx +0 -8
- package/src/components/tooltip/Tooltip.tsx +6 -0
- package/src/components/truncate/Truncate.stories.tsx +0 -8
- package/src/components/truncate/types.ts +4 -0
- package/src/styles/_colors.scss +9 -0
- package/src/styles/globals.scss +22 -0
- package/src/styles/index.scss +11 -10
- package/src/styles/variables/_colors.scss +269 -2
- package/src/types.ts +12 -8
- package/src/styles/variables/themes/dark.scss +0 -267
- package/src/styles/variables/themes/light.scss +0 -266
package/.storybook/main.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export type BadgeSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
2
|
export interface BadgeProps {
|
|
3
|
+
/** Additional classes for the badge component */
|
|
3
4
|
className?: string;
|
|
5
|
+
/** The content of the badge (superseded by the string prop) */
|
|
4
6
|
children?: React.ReactNode;
|
|
7
|
+
/** The string to display in the badge. (supersedes children prop) */
|
|
5
8
|
string?: string;
|
|
9
|
+
/** The size of the badge */
|
|
6
10
|
size?: BadgeSizes;
|
|
7
11
|
}
|
|
@@ -3,20 +3,70 @@ export type ButtonVariants = 'solid' | 'outline' | 'link' | 'action' | 'destruct
|
|
|
3
3
|
export type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg';
|
|
4
4
|
export type ButtonTypes = 'button' | 'submit' | 'reset';
|
|
5
5
|
export interface ButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* The class name to apply to the button
|
|
8
|
+
*/
|
|
6
9
|
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The aria-label to apply to the button
|
|
12
|
+
*/
|
|
7
13
|
ariaLabel: string;
|
|
14
|
+
/**
|
|
15
|
+
* The children to apply to the button
|
|
16
|
+
*/
|
|
8
17
|
children?: React.ReactNode | React.ReactNode[];
|
|
18
|
+
/**
|
|
19
|
+
* The function to call when the mouse enters the button
|
|
20
|
+
*/
|
|
9
21
|
onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
22
|
+
/**
|
|
23
|
+
* The function to call when the mouse exits the button
|
|
24
|
+
*/
|
|
10
25
|
onMouseExit?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
-
|
|
12
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The function to call when the button is clicked
|
|
28
|
+
*/
|
|
13
29
|
onClick?: (...args: any[]) => void;
|
|
30
|
+
/**
|
|
31
|
+
* The function to call when the button is pressed
|
|
32
|
+
*/
|
|
33
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Determines the visual style and emphasis level of the button
|
|
36
|
+
*/
|
|
14
37
|
variant?: ButtonVariants;
|
|
38
|
+
/**
|
|
39
|
+
* Disables the button and shows a load spinner on the left hand side of the button children by default.
|
|
40
|
+
* If iconLeft is passed, the loading icon will be displayed on the left hand side of the iconLeft.
|
|
41
|
+
* If iconRight is passed, the loading icon will be displayed on the right hand side of the iconRight.
|
|
42
|
+
*/
|
|
43
|
+
isLoading?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Makes the button round, pill-shaped when true
|
|
46
|
+
*/
|
|
15
47
|
isPill?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The icon to display on the left hand side of the button
|
|
50
|
+
*/
|
|
16
51
|
iconLeft?: IconName;
|
|
52
|
+
/**
|
|
53
|
+
* The icon to display on the right hand side of the button
|
|
54
|
+
*/
|
|
17
55
|
iconRight?: IconName;
|
|
56
|
+
/**
|
|
57
|
+
* Controls the button's padding and text size
|
|
58
|
+
*/
|
|
18
59
|
size?: ButtonSizes;
|
|
60
|
+
/**
|
|
61
|
+
* The type of the button
|
|
62
|
+
*/
|
|
19
63
|
type?: ButtonTypes;
|
|
64
|
+
/**
|
|
65
|
+
* URL destination for the button when it needs to function as a link
|
|
66
|
+
*/
|
|
20
67
|
href?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Disables the button
|
|
70
|
+
*/
|
|
21
71
|
isDisabled?: boolean;
|
|
22
72
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type Props = {
|
|
3
|
+
/** Additional classes for the card component */
|
|
3
4
|
className?: string;
|
|
5
|
+
/** The content of the card */
|
|
4
6
|
children: React.ReactNode;
|
|
7
|
+
/** The title of the card */
|
|
5
8
|
title?: string;
|
|
9
|
+
/** The subtitle of the card */
|
|
6
10
|
subtitle?: string;
|
|
11
|
+
/** Adds a box shadow to the card */
|
|
7
12
|
hasBoxShadow?: boolean;
|
|
8
13
|
};
|
|
9
14
|
export declare const Card: React.FC<Props>;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
3
3
|
export type FloatUIProps = {
|
|
4
|
+
/** An array of exactly two elements: the first element is the trigger that opens the FloatUI, and the second element is the content displayed within the FloatUI. */
|
|
4
5
|
children: [ReactElement, ReactElement];
|
|
6
|
+
/** Sets the aria-label attribute for the FloatUI. */
|
|
5
7
|
ariaLabel: string;
|
|
8
|
+
/** Options for configuring the floating UI behavior. For more, see the [floating-ui docs](https://floating-ui.com/docs/useFloating#options). */
|
|
6
9
|
floatingOptions?: UseFloatingOptions;
|
|
10
|
+
/** Controls the visibility of the FloatUI (for controlled mode). */
|
|
7
11
|
isOpen?: boolean;
|
|
8
12
|
className?: string;
|
|
13
|
+
/** Controls whether the FloatUI content is rendered as a portal (i.e. rendered outside the app root and into the body) */
|
|
9
14
|
isPortal?: boolean;
|
|
15
|
+
/** Options for configuring the portal behavior. Includes the rootId, which is the id of the root element to render the portal into. */
|
|
10
16
|
portalOptions?: {
|
|
11
17
|
rootId?: string;
|
|
12
18
|
};
|
|
19
|
+
/** Function to toggle the visibility of the FloatUI (for controlled mode). */
|
|
13
20
|
setIsOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
21
|
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface CheckboxProps {
|
|
3
3
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
4
|
+
/** This explains what button group this checkbox belongs to. */
|
|
4
5
|
id: string;
|
|
6
|
+
/** The label for the checkbox field */
|
|
5
7
|
label: string;
|
|
8
|
+
/** The name for the checkbox field */
|
|
6
9
|
name: string;
|
|
10
|
+
/** This holds the value that will be emitted when the checkbox is selected */
|
|
7
11
|
value?: string;
|
|
12
|
+
/** Toggles the checked state of the checkbox field when true */
|
|
8
13
|
isChecked?: boolean | undefined;
|
|
14
|
+
/** onChange event handler */
|
|
9
15
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
/** Toggles the disabled state of the checkbox field */
|
|
10
17
|
isDisabled?: boolean;
|
|
11
18
|
defaultChecked?: boolean;
|
|
12
19
|
className?: string;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { CustomComponents, DateRange, DayEventHandler, Formatters, Matcher, Mode, MonthChangeEventHandler, OnSelectHandler } from 'react-day-picker';
|
|
2
2
|
export interface DatePickerProps {
|
|
3
3
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
4
|
+
/** The selected day(s). */
|
|
4
5
|
selected?: Date | DateRange | undefined;
|
|
6
|
+
/** Event handler when a day is selected. */
|
|
5
7
|
onSelect?: OnSelectHandler<Date> | OnSelectHandler<DateRange>;
|
|
8
|
+
/** Allows you to select a single day, a range of days, or multiple days. */
|
|
6
9
|
mode?: Mode;
|
|
10
|
+
/** Accepts a CSS class name */
|
|
7
11
|
className?: string;
|
|
12
|
+
/** The layout of the caption. Enables you to add or remove the dropdown navigation for months/years */
|
|
8
13
|
captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
|
|
9
14
|
id?: string;
|
|
10
15
|
month?: Date;
|
|
11
16
|
defaultMonth?: Date;
|
|
12
17
|
startMonth?: Date | undefined;
|
|
18
|
+
/** Whether to show the time picker. */
|
|
13
19
|
hasTimePicker?: boolean;
|
|
20
|
+
/** The time value to display in the date picker. */
|
|
14
21
|
timeValue?: string;
|
|
15
22
|
endMonth?: Date;
|
|
16
23
|
components?: Partial<CustomComponents>;
|
|
@@ -21,8 +28,11 @@ export interface DatePickerProps {
|
|
|
21
28
|
firstWeekContainsDate?: 1 | 4;
|
|
22
29
|
today?: Date;
|
|
23
30
|
isRequired?: any;
|
|
31
|
+
/** The minimum date that can be selected. */
|
|
24
32
|
min?: number;
|
|
33
|
+
/** The maximum date that can be selected. */
|
|
25
34
|
max?: number;
|
|
35
|
+
/** Callback when the time changes. */
|
|
26
36
|
onTimeChange?: (time: string) => void;
|
|
27
37
|
onMonthChange?: MonthChangeEventHandler;
|
|
28
38
|
onNextClick?: MonthChangeEventHandler;
|
|
@@ -3,24 +3,40 @@ import { IconName, IconSizes } from '../../../icons/types';
|
|
|
3
3
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
4
4
|
import { PortalOptions } from '../datePicker/types';
|
|
5
5
|
interface Props {
|
|
6
|
+
/** Allows you to select a single day, a range of days, or multiple days. */
|
|
6
7
|
mode?: Mode;
|
|
8
|
+
/** A label for assistive technologies. */
|
|
7
9
|
ariaLabel: string;
|
|
10
|
+
/** Disable dates before this date. */
|
|
8
11
|
disableBeforeDate?: Date;
|
|
12
|
+
/** Disable dates after this date. */
|
|
9
13
|
disableAfterDate?: Date;
|
|
14
|
+
/** Disable the date picker. */
|
|
10
15
|
isDisabled?: boolean;
|
|
16
|
+
/** The id of the input field. */
|
|
11
17
|
id: string;
|
|
18
|
+
/** The label for the input field. */
|
|
12
19
|
label?: string;
|
|
20
|
+
/** Event handler when a day is selected. */
|
|
13
21
|
onSelect?: (selected: Date | DateRange | undefined) => void;
|
|
14
22
|
selected?: Date | DateRange | undefined;
|
|
23
|
+
/** The icon to use as a trigger. */
|
|
15
24
|
triggerIcon: IconName;
|
|
25
|
+
/** The size of the trigger icon. */
|
|
16
26
|
triggerIconSize: IconSizes;
|
|
27
|
+
/** Whether the date picker is open. */
|
|
17
28
|
isOpen?: boolean;
|
|
29
|
+
/** Clear the selected date(s) when the date picker closes. */
|
|
18
30
|
clearOnClose?: boolean;
|
|
31
|
+
/** Accepts a CSS class name */
|
|
19
32
|
className?: string;
|
|
20
33
|
initialMonth?: Date;
|
|
21
34
|
'data-testid'?: string;
|
|
35
|
+
/** The portal options for the date picker. Follows floating-ui options. */
|
|
22
36
|
portalOptions?: PortalOptions;
|
|
37
|
+
/** Whether the date picker is a portal. */
|
|
23
38
|
isPortal?: boolean;
|
|
39
|
+
/** The floating options for the date picker. Follows floating-ui options. */
|
|
24
40
|
floatingOptions?: UseFloatingOptions;
|
|
25
41
|
}
|
|
26
42
|
export declare const IconTriggerDatePicker: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,10 +2,12 @@ import type { IconName } from '../../../icons/types';
|
|
|
2
2
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
3
3
|
import { PortalOptions } from '../datePicker/types';
|
|
4
4
|
export interface SingleInputDatePickerProps {
|
|
5
|
+
/** A label for assistive technologies. */
|
|
5
6
|
ariaLabel: string;
|
|
6
7
|
disableBeforeDate?: Date;
|
|
7
8
|
disableAfterDate?: Date;
|
|
8
9
|
isDisabled?: boolean;
|
|
10
|
+
/** The layout of the caption. Enables you to add or remove the dropdown navigation for months/years */
|
|
9
11
|
captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
|
|
10
12
|
id?: string;
|
|
11
13
|
label?: string;
|
|
@@ -14,18 +16,24 @@ export interface SingleInputDatePickerProps {
|
|
|
14
16
|
selected?: Date;
|
|
15
17
|
isOpen?: boolean;
|
|
16
18
|
clearOnClose?: boolean;
|
|
19
|
+
/** Accepts a CSS class name */
|
|
17
20
|
className?: string;
|
|
18
21
|
inputIconName?: IconName;
|
|
19
22
|
isClearable?: boolean;
|
|
20
23
|
inputPlaceholder?: string;
|
|
21
24
|
errorMessage?: string | undefined;
|
|
25
|
+
/** Whether the label is hidden. */
|
|
22
26
|
hasHiddenLabel?: boolean;
|
|
23
27
|
'data-testid'?: string;
|
|
28
|
+
/** The ref of the input field. */
|
|
24
29
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
30
|
+
/** Whether the date picker is read only. */
|
|
25
31
|
isReadOnly?: boolean;
|
|
32
|
+
/** The tab index of the input field. */
|
|
26
33
|
tabIndex?: number;
|
|
27
34
|
portalOptions?: PortalOptions;
|
|
28
35
|
floatingOptions?: UseFloatingOptions;
|
|
36
|
+
/** Whether the date picker is a portal. */
|
|
29
37
|
isPortal?: boolean;
|
|
30
38
|
}
|
|
31
39
|
export declare function SingleInputDatePicker(props: SingleInputDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { DateRange } from 'react-day-picker';
|
|
|
3
3
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
4
4
|
import { PortalOptions } from '../datePicker/types';
|
|
5
5
|
interface InputDateRangePickerProps {
|
|
6
|
+
/** A label for assistive technologies. */
|
|
6
7
|
ariaLabel: string;
|
|
7
8
|
disableBeforeDate?: Date;
|
|
8
9
|
disableAfterDate?: Date;
|
|
@@ -13,6 +14,7 @@ interface InputDateRangePickerProps {
|
|
|
13
14
|
month?: Date;
|
|
14
15
|
selected?: DateRange | undefined;
|
|
15
16
|
isOpen?: boolean;
|
|
17
|
+
/** Whether the date picker is open. */
|
|
16
18
|
setIsOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
17
19
|
className?: string;
|
|
18
20
|
inputIconName?: IconName;
|
|
@@ -20,19 +22,26 @@ interface InputDateRangePickerProps {
|
|
|
20
22
|
toErrorMessage?: string | undefined;
|
|
21
23
|
fromErrorMessage?: string | undefined;
|
|
22
24
|
'data-testid'?: string;
|
|
25
|
+
/** The gutter width for the date picker. */
|
|
23
26
|
gutterWidth?: number;
|
|
24
27
|
fromLabel?: string;
|
|
25
28
|
toLabel?: string;
|
|
26
29
|
closeOnSelect?: boolean;
|
|
27
30
|
clearOnClose?: boolean;
|
|
31
|
+
/** Whether the label is hidden. */
|
|
28
32
|
hasHiddenLabel?: boolean;
|
|
33
|
+
/** The ref of the input field. */
|
|
29
34
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
35
|
+
/** Whether the from input is read only. */
|
|
30
36
|
isFromReadOnly?: boolean;
|
|
37
|
+
/** Whether the to input is read only. */
|
|
31
38
|
isToReadOnly?: boolean;
|
|
32
39
|
toTabIndex?: number;
|
|
40
|
+
/** The tab index of the from input field. */
|
|
33
41
|
fromTabIndex?: number;
|
|
34
42
|
portalOptions?: PortalOptions;
|
|
35
43
|
floatingOptions?: UseFloatingOptions;
|
|
44
|
+
/** Whether the date picker is a portal. */
|
|
36
45
|
isPortal?: boolean;
|
|
37
46
|
}
|
|
38
47
|
export declare function InputDateRangePicker(props: InputDateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,7 @@ import type { IconName } from '../../../icons/types';
|
|
|
2
2
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
3
3
|
import { PortalOptions } from '../datePicker/types';
|
|
4
4
|
export interface SingleInputDateTimePickerProps {
|
|
5
|
+
/** A label for assistive technologies. */
|
|
5
6
|
ariaLabel: string;
|
|
6
7
|
disableBeforeDate?: Date;
|
|
7
8
|
disableAfterDate?: Date;
|
|
@@ -20,16 +21,24 @@ export interface SingleInputDateTimePickerProps {
|
|
|
20
21
|
inputPlaceholder?: string;
|
|
21
22
|
errorMessage?: string | undefined;
|
|
22
23
|
'data-testid'?: string;
|
|
24
|
+
/** Whether the label is hidden. */
|
|
23
25
|
hasHiddenLabel?: boolean;
|
|
26
|
+
/** The time value to display. */
|
|
24
27
|
timeValue?: string;
|
|
28
|
+
/** Callback function that is called when the time is changed. */
|
|
25
29
|
onTimeChange?: (time: string) => void;
|
|
30
|
+
/** Whether the date picker is read only. */
|
|
26
31
|
isReadOnly?: boolean;
|
|
32
|
+
/** The ref of the input field. */
|
|
27
33
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
34
|
+
/** The ref of the time picker input field. */
|
|
28
35
|
timePickerRef?: React.LegacyRef<HTMLInputElement>;
|
|
29
36
|
dateTabIndex?: number;
|
|
37
|
+
/** The tab index of the time input field. */
|
|
30
38
|
timeTabIndex?: number;
|
|
31
39
|
portalOptions?: PortalOptions;
|
|
32
40
|
floatingOptions?: UseFloatingOptions;
|
|
41
|
+
/** Whether the date picker is a portal. */
|
|
33
42
|
isPortal?: boolean;
|
|
34
43
|
}
|
|
35
44
|
export declare function SingleInputDateTimePicker(props: SingleInputDateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { LabelProps } from '../subcomponents/Label';
|
|
3
3
|
import { BaseInputProps } from '../input/Input';
|
|
4
4
|
export interface NumberInputProps extends Omit<BaseInputProps, 'value'>, LabelProps {
|
|
5
|
+
/** The value for the input field */
|
|
5
6
|
value?: number | '';
|
|
7
|
+
/** The minimum value for the input field */
|
|
6
8
|
min?: number;
|
|
9
|
+
/** The maximum value for the input field */
|
|
7
10
|
max?: number;
|
|
11
|
+
/** The step value for the input field */
|
|
8
12
|
step?: number;
|
|
9
13
|
}
|
|
10
14
|
declare const LabeledNumberInput: React.ForwardRefExoticComponent<Omit<NumberInputProps & React.RefAttributes<HTMLInputElement> & LabelProps, "ref"> & React.RefAttributes<any>>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface RadioProps {
|
|
3
3
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
4
|
+
/** This explains what button group this radio belongs to. */
|
|
4
5
|
id: string;
|
|
6
|
+
/** The label for the Radio field */
|
|
5
7
|
label: string;
|
|
8
|
+
/** The name for the Radio field */
|
|
6
9
|
name: string;
|
|
10
|
+
/** This holds the value that will be emitted when the radio is selected */
|
|
7
11
|
value?: string;
|
|
12
|
+
/** onChange event handler */
|
|
8
13
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
/** Toggles the disabled state of the Radio field */
|
|
9
15
|
isDisabled?: boolean;
|
|
10
16
|
defaultChecked?: boolean;
|
|
11
17
|
}
|
|
@@ -2,10 +2,20 @@ import React from 'react';
|
|
|
2
2
|
import { Props as ReactSelectProps } from 'react-select';
|
|
3
3
|
import { SelectOption } from './types';
|
|
4
4
|
export interface SelectProps<OptionType extends SelectOption> extends ReactSelectProps<OptionType> {
|
|
5
|
+
/** Options for the select component */
|
|
5
6
|
options: OptionType[];
|
|
7
|
+
/** The label for the select component */
|
|
6
8
|
label?: string;
|
|
9
|
+
/** The name of the select component */
|
|
7
10
|
name?: string;
|
|
11
|
+
/** Toggles the visibility of the label */
|
|
8
12
|
hasHiddenLabel?: boolean;
|
|
13
|
+
/** Additional CSS class for the select component */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** The prefix to use for the CSS class names. Changing this will result in losing all default styles */
|
|
16
|
+
classNamePrefix?: string;
|
|
17
|
+
/** Event handler for when the selected value changes */
|
|
18
|
+
onChange?: (newValue: any, actionMeta: any) => void;
|
|
9
19
|
}
|
|
10
20
|
declare const LabeledSelect: React.ForwardRefExoticComponent<SelectProps<SelectOption> & import("../subcomponents/Label").LabelProps & React.RefAttributes<any>>;
|
|
11
21
|
export { LabeledSelect as Select };
|
|
@@ -9,12 +9,19 @@ export interface TextareaProps extends LabelProps {
|
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
errorMessage?: string | undefined;
|
|
11
11
|
helpText?: string;
|
|
12
|
+
/** The number of rows for the textarea field */
|
|
12
13
|
rows?: number;
|
|
14
|
+
/** Specifies the visible width of a text area */
|
|
13
15
|
cols?: number;
|
|
16
|
+
/** Sets the textarea field to readonly */
|
|
14
17
|
readonly?: boolean;
|
|
18
|
+
/** Sets the wrap attribute for the textarea field */
|
|
15
19
|
wrap?: 'hard' | 'soft';
|
|
20
|
+
/** Specifies which form the text area belongs to */
|
|
16
21
|
form?: string;
|
|
22
|
+
/** Specifies the maximum number of characters allowed in the text area */
|
|
17
23
|
maxLength?: number;
|
|
24
|
+
/** Specifies that a text area should automatically get focus when the page loads */
|
|
18
25
|
autofocus?: boolean;
|
|
19
26
|
defaultValue?: string;
|
|
20
27
|
tabIndex?: number;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
interface TimePickerProps {
|
|
2
2
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
3
|
+
/** The time value to be displayed in the input field */
|
|
3
4
|
timeValue?: string;
|
|
5
|
+
/** The label for the time picker */
|
|
4
6
|
label?: string;
|
|
7
|
+
/** The name of the input field */
|
|
5
8
|
name?: string;
|
|
9
|
+
/** Hides the input label in an accessible way (visually hides the label) */
|
|
6
10
|
hasHiddenLabel?: boolean;
|
|
11
|
+
/** returns an object with the time and errors if they exist */
|
|
7
12
|
onTimeChange?: (time: string) => void;
|
|
8
13
|
className?: string;
|
|
9
14
|
isReadOnly?: boolean;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface ToggleProps {
|
|
3
3
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
4
|
+
/** This explains what button group this toggle belongs to. */
|
|
4
5
|
id: string;
|
|
6
|
+
/** The label for the toggle field */
|
|
5
7
|
label?: string;
|
|
8
|
+
/** The name for the toggle field */
|
|
6
9
|
name: string;
|
|
10
|
+
/** This holds the value that will be emitted when the toggle is selected */
|
|
7
11
|
value?: string;
|
|
12
|
+
/** onChange event handler */
|
|
8
13
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
/** This disables the toggle */
|
|
9
15
|
isDisabled?: boolean;
|
|
16
|
+
/** This is the state of the toggle */
|
|
10
17
|
isChecked?: boolean;
|
|
11
18
|
defaultChecked?: boolean;
|
|
12
19
|
}
|
|
@@ -6,9 +6,14 @@ export type IconSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
|
6
6
|
export type IndiconName = keyof typeof indicons;
|
|
7
7
|
export type IconName = IndiconName | `fa-${FAIconName}`;
|
|
8
8
|
export type IconProps = PermafrostComponent & {
|
|
9
|
+
/** The name of the icon */
|
|
9
10
|
name: IconName;
|
|
11
|
+
/** Accessible label for the icon */
|
|
10
12
|
ariaLabel?: string;
|
|
13
|
+
/** Size of the icon */
|
|
11
14
|
size?: IconSizes;
|
|
15
|
+
/** Inline styles for the icon */
|
|
12
16
|
style?: CSSProperties;
|
|
17
|
+
/** Click event handler */
|
|
13
18
|
onClick?: MouseEventHandler<SVGElement>;
|
|
14
19
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export declare function BarSpinner({ width, id, height, className, ...rest }: {
|
|
2
2
|
'data-testid'?: string;
|
|
3
|
+
/** The width of the bar spinner */
|
|
3
4
|
width?: number;
|
|
5
|
+
/** The id of the tooltip. This needs to match the element that holds it's data attribute */
|
|
4
6
|
id?: string;
|
|
7
|
+
/** The height of the bar spinner */
|
|
5
8
|
height?: number;
|
|
9
|
+
/** The class name of the bar spinner */
|
|
6
10
|
className?: string;
|
|
7
11
|
[key: string]: any;
|
|
8
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type MenuProps = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
/** The class name to apply to the Menu component. */
|
|
4
5
|
className?: string;
|
|
5
6
|
};
|
|
6
7
|
export declare function Menu({ children, className, ...rest }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
import { ButtonVariants } from '../button/types';
|
|
2
2
|
import { IconName } from '../icons/types';
|
|
3
3
|
export interface ModalProps {
|
|
4
|
+
/** Additional classes for the badge component */
|
|
4
5
|
className?: string;
|
|
6
|
+
/** The content of the badge (superseded by the string prop) */
|
|
5
7
|
children?: React.ReactNode;
|
|
8
|
+
/** Whether the modal is open */
|
|
6
9
|
isOpen: boolean;
|
|
10
|
+
/** Callback function to be called when the modal is closed */
|
|
7
11
|
onRequestClose?: () => void;
|
|
12
|
+
/** Additional classes for the portal element */
|
|
8
13
|
portalClassName?: string;
|
|
14
|
+
/** Additional classes for the overlay element */
|
|
9
15
|
overlayClassName?: string;
|
|
16
|
+
/** The element to use as the app element */
|
|
10
17
|
appElement?: HTMLElement;
|
|
18
|
+
/** Whether the modal should close when the overlay is clicked */
|
|
11
19
|
shouldCloseOnOverlayClick?: boolean;
|
|
20
|
+
/** Whether the modal should close when the escape key is pressed */
|
|
12
21
|
shouldCloseOnEsc?: boolean;
|
|
13
22
|
testId?: string;
|
|
23
|
+
/** Custom content element for the modal */
|
|
14
24
|
contentElement?: (props: any, children: React.ReactNode) => React.ReactElement;
|
|
25
|
+
/** Custom overlay element for the modal */
|
|
15
26
|
overlayElement?: (props: any, contentElement: React.ReactElement) => React.ReactElement;
|
|
27
|
+
/** The position of the modal opens on the page */
|
|
16
28
|
position?: 'top' | 'center';
|
|
17
29
|
parentSelector?: () => HTMLElement;
|
|
30
|
+
/** The title of the modal */
|
|
18
31
|
title?: string;
|
|
32
|
+
/** The subtitle of the modal */
|
|
19
33
|
subtitle?: string;
|
|
34
|
+
/** The footer of the modal. It accepts a React Component */
|
|
20
35
|
footer?: React.ReactNode;
|
|
36
|
+
/** The maximum width of the modal in pixels */
|
|
21
37
|
maxWidthInPixels?: number;
|
|
22
38
|
}
|
|
23
39
|
export interface ConfirmationModalProps extends ModalProps {
|
|
@@ -25,10 +41,16 @@ export interface ConfirmationModalProps extends ModalProps {
|
|
|
25
41
|
dontShowAgain?: boolean;
|
|
26
42
|
}) => void | Promise<void> | Promise<boolean>;
|
|
27
43
|
onCancelRequest?: () => void | Promise<void> | Promise<boolean>;
|
|
44
|
+
/** Whether the modal should have a checkbox to not show again */
|
|
28
45
|
hasDontShowAgainCheckbox?: boolean;
|
|
46
|
+
/** The variant of the confirmation button. */
|
|
29
47
|
confirmationButtonVariant?: ButtonVariants;
|
|
48
|
+
/** The text of the confirmation button */
|
|
30
49
|
confirmationButtonText?: string;
|
|
50
|
+
/** The text of the cancel button */
|
|
31
51
|
cancelButtonText?: string;
|
|
52
|
+
/** The icon of the modal */
|
|
32
53
|
icon?: IconName;
|
|
54
|
+
/** The status of the modal. This will determine the color of the icon. */
|
|
33
55
|
status?: 'info' | 'success' | 'error';
|
|
34
56
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface PaginationProps {
|
|
2
|
+
/** The total number of pages to be displayed */
|
|
2
3
|
totalPages: number;
|
|
4
|
+
/** The current page displayed in the input field. */
|
|
3
5
|
currentPage?: number;
|
|
6
|
+
/** The css class name for the pagination component */
|
|
4
7
|
className?: string;
|
|
8
|
+
/** The callback function that is called when the page changes. */
|
|
5
9
|
onChange?: (value: number) => void;
|
|
6
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PillProps } from './types';
|
|
2
|
-
export declare const Pill: ({ children, className, color, size, ...rest }: PillProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const Pill: ({ children, className, color, size, shade, ...rest }: PillProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChromaticColor } from '../../types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export type PillSize = 'sm' | 'md' | 'lg';
|
|
4
|
-
export type PillColor =
|
|
4
|
+
export type PillColor = ChromaticColor;
|
|
5
|
+
export type PillShade = 1 | 2 | 3 | 4 | 5;
|
|
5
6
|
export interface PillProps {
|
|
7
|
+
/** The content displayed inside the pill */
|
|
6
8
|
children: React.ReactNode | React.ReactNode[];
|
|
9
|
+
/** Applies a CSS class to change the style of the pill */
|
|
7
10
|
color?: PillColor;
|
|
11
|
+
/** Applies a CSS class to change the size of the pill */
|
|
8
12
|
size?: PillSize;
|
|
13
|
+
/** Applies a CSS class to change the shade of the pill */
|
|
14
|
+
shade?: PillShade;
|
|
9
15
|
className?: string;
|
|
10
16
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
type Props = {
|
|
2
|
+
/** Additional classes for the skeleton component */
|
|
2
3
|
className?: string;
|
|
4
|
+
/** The height of the skeleton component, either in px (number) or a generic string (e.g. "20px", "50%", "100%") */
|
|
3
5
|
height?: number | string;
|
|
6
|
+
/** The width of the skeleton component, either in px (number) or a generic string (e.g. "20px", "50%", "100%") */
|
|
4
7
|
width?: number | string;
|
|
8
|
+
/** Sets the skeleton component to be a circle */
|
|
5
9
|
isCircle?: boolean;
|
|
10
|
+
/** Sets the skeleton component to be full height */
|
|
6
11
|
isFullHeight?: boolean;
|
|
7
12
|
};
|
|
8
13
|
export declare const Skeleton: ({ className, height, width, isCircle, isFullHeight, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|