@companycam/slab-web 2.1.0 → 2.1.2
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/index.js +398 -402
- package/index.mjs +2126 -2121
- package/lib/AssetThumbnail/AssetThumbnail.d.ts +13 -12
- package/lib/Avatar/Avatar.d.ts +2 -2
- package/lib/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/lib/Billboard/Billboard.d.ts +5 -5
- package/lib/Button/Button.d.ts +4 -4
- package/lib/Card/Card.d.ts +1 -1
- package/lib/ChipFilter/ChipFilter.d.ts +2 -2
- package/lib/Comment/Comment.d.ts +1 -1
- package/lib/Drawer/Drawer.d.ts +2 -2
- package/lib/Grid/Grid.d.ts +8 -8
- package/lib/InputCheckboxGroup/InputCheckboxGroup.d.ts +3 -3
- package/lib/InputDate/InputDate.d.ts +2 -2
- package/lib/InputDate/InputDateHeader.d.ts +1 -1
- package/lib/InputDate/InputDateSelect.d.ts +1 -1
- package/lib/InputFile/InputFile.d.ts +9 -9
- package/lib/InputRadioGroup/InputRadioGroup.d.ts +2 -2
- package/lib/InputSelectHTML/InputSelectHTML.d.ts +2 -2
- package/lib/Lottie/Lottie.d.ts +1 -1
- package/lib/Modal/Modal.d.ts +15 -12
- package/lib/ProgressBar/ProgressBar.d.ts +1 -1
- package/lib/ProgressCircle/ProgressCircle.d.ts +2 -2
- package/lib/Rating/Rating.d.ts +1 -1
- package/lib/Spinner/Spinner.d.ts +1 -1
- package/lib/Table/Table.d.ts +9 -9
- package/lib/Text/Text.d.ts +1 -1
- package/lib/TimeStamp/TimeStamp.d.ts +1 -1
- package/lib/shared/Buttons/IconFromSVG.d.ts +4 -2
- package/lib/shared/Fieldset/Fieldset.d.ts +1 -1
- package/lib/shared/styles.d.ts +5 -0
- package/lib/shared/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
type ButtonAction = Omit<ComponentPropsWithRef<'button'>, 'children'> & {
|
|
2
|
+
type ButtonAction = Readonly<Omit<ComponentPropsWithRef<'button'>, 'children'> & {
|
|
3
3
|
accessibilityLabel: string;
|
|
4
|
-
}
|
|
4
|
+
}>;
|
|
5
5
|
export type AssetThumbnailProps = ComponentPropsWithRef<'div'> & {
|
|
6
|
-
image: {
|
|
6
|
+
image: Readonly<{
|
|
7
7
|
src: string;
|
|
8
8
|
alt?: string;
|
|
9
|
-
}
|
|
9
|
+
}>;
|
|
10
10
|
/**
|
|
11
11
|
* **Render a button that overlays the image**
|
|
12
12
|
*
|
|
@@ -16,23 +16,24 @@ export type AssetThumbnailProps = ComponentPropsWithRef<'div'> & {
|
|
|
16
16
|
* */
|
|
17
17
|
buttonAction?: ButtonAction;
|
|
18
18
|
/** Content slot - opt in to reveal content on hover/focus */
|
|
19
|
-
contentTopLeft?: {
|
|
19
|
+
contentTopLeft?: Readonly<{
|
|
20
20
|
content: ReactNode;
|
|
21
21
|
shouldShowOnHover: boolean;
|
|
22
|
-
}
|
|
22
|
+
}>;
|
|
23
23
|
/** Content slot - opt in to reveal content on hover/focus */
|
|
24
|
-
contentTopRight?: {
|
|
24
|
+
contentTopRight?: Readonly<{
|
|
25
25
|
content: ReactNode;
|
|
26
26
|
shouldShowOnHover: boolean;
|
|
27
|
-
}
|
|
27
|
+
}>;
|
|
28
28
|
/** Content slot */
|
|
29
29
|
contentBottomLeft?: ReactNode;
|
|
30
30
|
/** Content slot */
|
|
31
31
|
contentBottomRight?: ReactNode;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
32
|
+
/**
|
|
33
|
+
* **Render content below the thumbnail image**
|
|
34
|
+
* (`string` will be styled automatically)
|
|
35
|
+
*/
|
|
36
|
+
contentAfter?: ReactNode;
|
|
36
37
|
/** Adds visual state to indicate image is selected */
|
|
37
38
|
isSelected?: boolean;
|
|
38
39
|
/** Adds visual state to indicate thumbnail previews a video */
|
package/lib/Avatar/Avatar.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ export type AvatarProps = HTMLAvatarProps & {
|
|
|
17
17
|
size?: number | 'xsmall' | 'small' | 'medium' | 'large';
|
|
18
18
|
/** @deprecated - use `data-testid` */
|
|
19
19
|
testId?: string;
|
|
20
|
-
tooltip?: {
|
|
20
|
+
tooltip?: Readonly<{
|
|
21
21
|
shouldShow?: boolean;
|
|
22
22
|
placement?: TooltipProps['placement'];
|
|
23
|
-
}
|
|
23
|
+
}>;
|
|
24
24
|
};
|
|
25
25
|
export declare const Avatar: import('react').ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
26
26
|
export default Avatar;
|
|
@@ -4,9 +4,9 @@ type HTMLUnorderedListProps = ComponentPropsWithRef<'ul'>;
|
|
|
4
4
|
type FilteredAvatarProps = Omit<AvatarProps, 'design' | 'size' | 'tooltip'>;
|
|
5
5
|
export type AvatarGroupProps = HTMLUnorderedListProps & {
|
|
6
6
|
/** [Avatar](../?path=/docs/avatar--docs) */
|
|
7
|
-
avatars: FilteredAvatarProps[];
|
|
7
|
+
avatars: readonly FilteredAvatarProps[];
|
|
8
8
|
/** Render content at the end of the list (e.g., `+2`) */
|
|
9
|
-
renderListFooter?: (hiddenAvatars: FilteredAvatarProps[]) => ReactNode;
|
|
9
|
+
renderListFooter?: (hiddenAvatars: readonly FilteredAvatarProps[]) => ReactNode;
|
|
10
10
|
/** [Avatar](../?path=/docs/avatar--docs) sizes */
|
|
11
11
|
size?: AvatarProps['size'];
|
|
12
12
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, CSSProperties, ElementType } from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button/Button';
|
|
3
3
|
export type BillboardIconColor = 'success' | 'caution' | 'destroy' | 'info';
|
|
4
|
-
export type BillboardImage = {
|
|
4
|
+
export type BillboardImage = Readonly<{
|
|
5
5
|
src: string;
|
|
6
6
|
alt: string;
|
|
7
|
-
imageContainerStyle?: CSSProperties
|
|
8
|
-
}
|
|
9
|
-
type Action<C extends ElementType> = ButtonProps<C> & {
|
|
7
|
+
imageContainerStyle?: Readonly<CSSProperties>;
|
|
8
|
+
}>;
|
|
9
|
+
type Action<C extends ElementType> = ButtonProps<C> & Readonly<{
|
|
10
10
|
label: string;
|
|
11
11
|
'data-testid'?: string;
|
|
12
12
|
children?: 'never';
|
|
13
|
-
}
|
|
13
|
+
}>;
|
|
14
14
|
type HTMLDivProps = ComponentPropsWithRef<'div'>;
|
|
15
15
|
export type BillboardProps<PrimaryActionButtonComponent extends ElementType = 'button', SecondaryActionButtonComponent extends ElementType = 'button'> = HTMLDivProps & {
|
|
16
16
|
color?: BillboardIconColor;
|
package/lib/Button/Button.d.ts
CHANGED
|
@@ -15,20 +15,20 @@ type StyledButtonBaseProps = {
|
|
|
15
15
|
$color: ButtonColor;
|
|
16
16
|
$size: ButtonSize;
|
|
17
17
|
};
|
|
18
|
-
export type IconComponentProps = ReactElement<{
|
|
18
|
+
export type IconComponentProps = Readonly<ReactElement<{
|
|
19
19
|
style?: CSSProperties;
|
|
20
|
-
}
|
|
20
|
+
}>>;
|
|
21
21
|
/** explicit, static props of the Slab button that will override any polyporphic props */
|
|
22
22
|
export type BaseButtonProps = {
|
|
23
23
|
ccMargin?: StyledButtonBaseProps['$ccMargin'];
|
|
24
24
|
color?: StyledButtonBaseProps['$color'];
|
|
25
25
|
design?: StyledButtonBaseProps['$design'];
|
|
26
26
|
disabled?: boolean;
|
|
27
|
-
icon?: {
|
|
27
|
+
icon?: Readonly<{
|
|
28
28
|
component?: IconComponentProps;
|
|
29
29
|
name?: string;
|
|
30
30
|
position?: 'before' | 'after';
|
|
31
|
-
}
|
|
31
|
+
}>;
|
|
32
32
|
loading?: boolean;
|
|
33
33
|
size?: StyledButtonBaseProps['$size'];
|
|
34
34
|
};
|
package/lib/Card/Card.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type HTMLCardProps = Omit<ComponentPropsWithRef<'button'> & ComponentProp
|
|
|
3
3
|
export type CardProps = HTMLCardProps & {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
/** Style hook for the _interior_ card container (border, background, etc.) */
|
|
6
|
-
containerStyle?: CSSProperties
|
|
6
|
+
containerStyle?: Readonly<CSSProperties>;
|
|
7
7
|
contentAction?: ReactNode;
|
|
8
8
|
contentBefore?: ReactNode;
|
|
9
9
|
contentAfter?: ReactNode;
|
|
@@ -3,10 +3,10 @@ import { GetChipProps } from '../shared/types';
|
|
|
3
3
|
type HTMLSpanProps = ComponentPropsWithRef<'span'>;
|
|
4
4
|
type HTMLButtonProps = ComponentPropsWithRef<'button'>;
|
|
5
5
|
type FilteredChipProps = Omit<GetChipProps, 'contentAfter'>;
|
|
6
|
-
type CloseAction = HTMLButtonProps & {
|
|
6
|
+
type CloseAction = Readonly<HTMLButtonProps & {
|
|
7
7
|
accessibilityLabel: string;
|
|
8
8
|
'data-testid'?: string;
|
|
9
|
-
}
|
|
9
|
+
}>;
|
|
10
10
|
export type ChipFilterProps = HTMLSpanProps & FilteredChipProps & {
|
|
11
11
|
closeAction?: CloseAction;
|
|
12
12
|
};
|
package/lib/Comment/Comment.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import { AvatarProps } from '../Avatar/Avatar';
|
|
3
3
|
type HTMLDivProps = ComponentPropsWithRef<'div'>;
|
|
4
|
-
type CommentAvatar = Omit<AvatarProps, 'size' | 'ccMargin'
|
|
4
|
+
type CommentAvatar = Readonly<Omit<AvatarProps, 'size' | 'ccMargin'>>;
|
|
5
5
|
export type CommentProps = HTMLDivProps & {
|
|
6
6
|
/** Provides access to most of [Avatar's props](/docs/avatar--docs) */
|
|
7
7
|
avatar: CommentAvatar;
|
package/lib/Drawer/Drawer.d.ts
CHANGED
|
@@ -9,13 +9,13 @@ export type DrawerProps = ComponentPropsWithRef<'div'> & {
|
|
|
9
9
|
/** The content of the Drawer */
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
/** Target content container (background color, shadow, border radius, padding, etc.) */
|
|
12
|
-
containerStyle?: CSSProperties
|
|
12
|
+
containerStyle?: Readonly<CSSProperties>;
|
|
13
13
|
/** Where to mount the Drawer portal */
|
|
14
14
|
mountNodeId?: string;
|
|
15
15
|
/** Offset from the edge of the viewport/window, using spacing design tokens (`s`, `m`, `l`, etc.) */
|
|
16
16
|
offset?: Spacing;
|
|
17
17
|
/** Target the backdrop container if `shouldShowBackdrop` */
|
|
18
|
-
backDropStyle?: CSSProperties
|
|
18
|
+
backDropStyle?: Readonly<CSSProperties>;
|
|
19
19
|
/** Side of screen the drawer is anchored to */
|
|
20
20
|
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
21
21
|
/** Whether to show the backdrop and trap focus inside drawer */
|
package/lib/Grid/Grid.d.ts
CHANGED
|
@@ -2,24 +2,24 @@ import { ComponentPropsWithRef, CSSProperties, ReactNode } from 'react';
|
|
|
2
2
|
import { CellSize, Spacing } from '../shared/types';
|
|
3
3
|
type HTMLDivProps = ComponentPropsWithRef<'div'>;
|
|
4
4
|
type ItemAlign = 'start' | 'center' | 'end';
|
|
5
|
-
type Breakpoint = {
|
|
6
|
-
cols: CellSize[];
|
|
5
|
+
type Breakpoint = Readonly<{
|
|
6
|
+
cols: readonly CellSize[];
|
|
7
7
|
minWidth?: number;
|
|
8
8
|
maxWidth?: number;
|
|
9
9
|
colAlign?: ItemAlign;
|
|
10
10
|
colGap?: Spacing;
|
|
11
11
|
rowAlign?: ItemAlign;
|
|
12
12
|
rowGap?: Spacing;
|
|
13
|
-
rows?: CellSize[];
|
|
14
|
-
areas?: string[];
|
|
15
|
-
}
|
|
13
|
+
rows?: readonly CellSize[];
|
|
14
|
+
areas?: readonly string[];
|
|
15
|
+
}>;
|
|
16
16
|
export type GridProps = HTMLDivProps & {
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
id: string;
|
|
19
|
-
breakpoints: Breakpoint[];
|
|
19
|
+
breakpoints: readonly Breakpoint[];
|
|
20
20
|
debug?: boolean;
|
|
21
|
-
gridContainerStyle?: CSSProperties
|
|
22
|
-
gridItemStyle?: CSSProperties
|
|
21
|
+
gridContainerStyle?: Readonly<CSSProperties>;
|
|
22
|
+
gridItemStyle?: Readonly<CSSProperties>;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
- Uses CSS [container queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries) to change layouts based on the **width of the grid's container**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { InputGroupProps } from '../shared/InputGroup/InputGroup';
|
|
3
3
|
import { InputCheckboxProps } from '../InputCheckbox/InputCheckbox';
|
|
4
|
-
type FilteredInputCheckboxProps = Omit<InputCheckboxProps, 'id' | 'name' | 'onChange'
|
|
4
|
+
type FilteredInputCheckboxProps = Readonly<Omit<InputCheckboxProps, 'id' | 'name' | 'onChange'>>;
|
|
5
5
|
export type InputCheckboxGroupProps = InputGroupProps & {
|
|
6
|
-
options: FilteredInputCheckboxProps[];
|
|
6
|
+
options: readonly FilteredInputCheckboxProps[];
|
|
7
7
|
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
-
selectedValues: string[];
|
|
8
|
+
selectedValues: readonly string[];
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* - InputCheckboxGroup is a controlled component: You must provide an `onChange` handler to update `selectedValues`.
|
|
@@ -11,8 +11,8 @@ export type InputDateProps = DatePickerProps & UseMessageProps & {
|
|
|
11
11
|
placement?: Placement;
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
size?: 'medium' | 'large';
|
|
14
|
-
style?: CSSProperties
|
|
15
|
-
months: string[];
|
|
14
|
+
style?: Readonly<CSSProperties>;
|
|
15
|
+
months: readonly string[];
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
- [react-datepicker docs](https://reactdatepicker.com/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactDatePickerCustomHeaderProps } from 'react-datepicker';
|
|
2
2
|
type InputDateHeaderProps = ReactDatePickerCustomHeaderProps & {
|
|
3
|
-
months: string[];
|
|
3
|
+
months: readonly string[];
|
|
4
4
|
};
|
|
5
5
|
export declare function InputDateHeader({ date, months, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, }: InputDateHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default InputDateHeader;
|
|
@@ -2,7 +2,7 @@ import { ChangeEventHandler, ComponentPropsWithRef } from 'react';
|
|
|
2
2
|
type HTMLSelectProps = ComponentPropsWithRef<'select'>;
|
|
3
3
|
export type InputDateSelectProps = HTMLSelectProps & {
|
|
4
4
|
label: string;
|
|
5
|
-
options: string[];
|
|
5
|
+
options: readonly string[];
|
|
6
6
|
value: string;
|
|
7
7
|
onChange: ChangeEventHandler<HTMLSelectElement>;
|
|
8
8
|
};
|
|
@@ -4,25 +4,25 @@ import { UseMessageProps } from '../shared/types';
|
|
|
4
4
|
type HTMLInputProps = Omit<ComponentPropsWithRef<'input'>, 'onDrop'>;
|
|
5
5
|
export type DropEvent = DragEvent<HTMLElement> | ChangeEvent<HTMLInputElement> | DragEvent;
|
|
6
6
|
export type InputFileProps = HTMLInputProps & UseMessageProps & {
|
|
7
|
-
onDrop: (acceptedFiles: File[], rejectedFiles: File[], event: DropEvent) => void;
|
|
8
|
-
onDropAccepted?: (acceptedFiles: File[]) => void;
|
|
9
|
-
onDropRejected?: (rejectedFiles: File[]) => void;
|
|
10
|
-
messages?: string[];
|
|
7
|
+
onDrop: (acceptedFiles: readonly File[], rejectedFiles: readonly File[], event: DropEvent) => void;
|
|
8
|
+
onDropAccepted?: (acceptedFiles: readonly File[]) => void;
|
|
9
|
+
onDropRejected?: (rejectedFiles: readonly File[]) => void;
|
|
10
|
+
messages?: readonly string[];
|
|
11
11
|
accept: string;
|
|
12
12
|
multiple?: boolean;
|
|
13
|
-
loading?: {
|
|
13
|
+
loading?: Readonly<{
|
|
14
14
|
isVisible: boolean;
|
|
15
15
|
component?: ReactNode;
|
|
16
|
-
}
|
|
16
|
+
}>;
|
|
17
17
|
maxSize?: number;
|
|
18
|
-
dropZoneStyle?: CSSProperties
|
|
19
|
-
billboard?: {
|
|
18
|
+
dropZoneStyle?: Readonly<CSSProperties>;
|
|
19
|
+
billboard?: Readonly<{
|
|
20
20
|
title?: BillboardProps['title'];
|
|
21
21
|
iconName?: BillboardProps['iconName'];
|
|
22
22
|
message?: BillboardProps['message'];
|
|
23
23
|
color?: BillboardIconColor;
|
|
24
24
|
image?: BillboardImage;
|
|
25
|
-
}
|
|
25
|
+
}>;
|
|
26
26
|
fileUploadButtonLabel?: string;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { InputGroupProps } from '../shared/InputGroup/InputGroup';
|
|
3
3
|
import { InputRadioProps } from '../InputRadio/InputRadio';
|
|
4
|
-
type FilteredInputRadioProps = Omit<InputRadioProps, 'id' | 'name' | 'onChange'
|
|
4
|
+
type FilteredInputRadioProps = Readonly<Omit<InputRadioProps, 'id' | 'name' | 'onChange'>>;
|
|
5
5
|
export type InputRadioGroupProps = InputGroupProps & {
|
|
6
|
-
options: FilteredInputRadioProps[];
|
|
6
|
+
options: readonly FilteredInputRadioProps[];
|
|
7
7
|
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
selectedValue: string;
|
|
9
9
|
};
|
|
@@ -3,11 +3,11 @@ import { UseMessageProps } from '../shared/types';
|
|
|
3
3
|
type FilteredHTMLSelectProps = Omit<ComponentPropsWithRef<'select'>, 'children' | 'multiple'>;
|
|
4
4
|
export type InputSelectHTMLProps = FilteredHTMLSelectProps & UseMessageProps & {
|
|
5
5
|
label: ReactNode;
|
|
6
|
-
options: {
|
|
6
|
+
options: readonly Readonly<{
|
|
7
7
|
label: string;
|
|
8
8
|
value: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
-
}[];
|
|
10
|
+
}>[];
|
|
11
11
|
hideLabel?: boolean;
|
|
12
12
|
inputSize?: 'medium' | 'large';
|
|
13
13
|
};
|
package/lib/Lottie/Lottie.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type LottieProps = LottieWebProps & {
|
|
|
11
11
|
/** Simpler CSS-inspired API for lottie-web's `preserveAspectRatio`. You can still pass in `rendererSettings { preserveAspectRatio }` for more granular control. */
|
|
12
12
|
objectFit?: 'contain' | 'cover' | 'fill';
|
|
13
13
|
/** Set the width, height, etc. of the container, if needed */
|
|
14
|
-
style?: CSSProperties
|
|
14
|
+
style?: Readonly<CSSProperties>;
|
|
15
15
|
/** Applies a test id to the container */
|
|
16
16
|
'data-testid'?: string;
|
|
17
17
|
};
|
package/lib/Modal/Modal.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
type AsProp = keyof HTMLElementTagNameMap;
|
|
3
|
-
|
|
3
|
+
type ModalFooterProps = {
|
|
4
|
+
/** replace footer or pass `null` for no footer */
|
|
5
|
+
footerComponent?: ReactNode;
|
|
6
|
+
/** content slot for buttons in footer */
|
|
7
|
+
footerActions?: ReactNode;
|
|
8
|
+
/** content slot on left side of footer */
|
|
9
|
+
footerContentBefore?: ReactNode;
|
|
10
|
+
/** target footer container */
|
|
11
|
+
footerStyle?: Readonly<CSSProperties>;
|
|
12
|
+
};
|
|
13
|
+
export type ModalProps = ModalFooterProps & {
|
|
4
14
|
isOpen: boolean;
|
|
5
15
|
onClose: () => void;
|
|
6
16
|
title: string;
|
|
@@ -9,25 +19,17 @@ export type ModalProps = {
|
|
|
9
19
|
/** rendered in main content area */
|
|
10
20
|
children?: ReactNode;
|
|
11
21
|
/** target modal container */
|
|
12
|
-
containerStyle?: CSSProperties
|
|
22
|
+
containerStyle?: Readonly<CSSProperties>;
|
|
13
23
|
/** for automation testing */
|
|
14
24
|
'data-testid__close-button'?: string;
|
|
15
25
|
/** target main content area */
|
|
16
|
-
bodyStyle?: CSSProperties
|
|
26
|
+
bodyStyle?: Readonly<CSSProperties>;
|
|
17
27
|
/** target header container */
|
|
18
|
-
headerStyle?: CSSProperties
|
|
19
|
-
/** target footer container */
|
|
20
|
-
footerStyle?: CSSProperties;
|
|
28
|
+
headerStyle?: Readonly<CSSProperties>;
|
|
21
29
|
/** replace header or pass `null` for no header */
|
|
22
30
|
headerComponent?: ReactNode | null;
|
|
23
31
|
/** content slot below title in header */
|
|
24
32
|
headerContentAfter?: ReactNode;
|
|
25
|
-
/** replace footer or pass `null` for no footer */
|
|
26
|
-
footerComponent?: ReactNode | null;
|
|
27
|
-
/** content slot for buttons in footer */
|
|
28
|
-
footerActions?: ReactNode;
|
|
29
|
-
/** content slot on left side of footer */
|
|
30
|
-
footerContentBefore?: ReactNode;
|
|
31
33
|
/** `small (600)` | `medium (900)` | `large (full)` */
|
|
32
34
|
size?: 'small' | 'medium' | 'large';
|
|
33
35
|
};
|
|
@@ -35,6 +37,7 @@ export type ModalProps = {
|
|
|
35
37
|
* - `Modal` is a controlled component; you must manage the `isOpen` state and provide an `onClose` handler
|
|
36
38
|
* - `title` is required for accessibility. If you replace or provide no header via props, it will be read via `aria-label`
|
|
37
39
|
* - The modal body (main content area) has padding is scrollable by default. Overwrite via `bodyStyle`.
|
|
40
|
+
* - Use `design="outline"` for non-primary footer actions (e.g. Cancel) to visually distinguish them from the primary action.
|
|
38
41
|
*/
|
|
39
42
|
export declare function Modal({ isOpen, onClose, as, children, 'data-testid__close-button': dataTestIdCloseButton, bodyStyle, containerStyle, headerStyle, footerStyle, headerComponent, headerContentAfter, footerComponent, footerActions, footerContentBefore, size, title, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
40
43
|
export default Modal;
|
|
@@ -2,7 +2,7 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
import { ProgressProps } from '../shared/types';
|
|
3
3
|
export type ProgressBarProps = ProgressProps & {
|
|
4
4
|
/** Target the styles of the label */
|
|
5
|
-
labelStyle?: CSSProperties
|
|
5
|
+
labelStyle?: Readonly<CSSProperties>;
|
|
6
6
|
/** Visually hide the label */
|
|
7
7
|
hideLabel?: boolean;
|
|
8
8
|
size?: 'small' | 'medium';
|
|
@@ -13,10 +13,10 @@ type ProgressCircleSizeProps = WithSizeProp | WithCustomDiameterProp;
|
|
|
13
13
|
export type ProgressCircleProps = ProgressProps & ProgressCircleSizeProps & {
|
|
14
14
|
ccMargin?: string;
|
|
15
15
|
shouldShowCompleteIcon?: boolean;
|
|
16
|
-
formatValue?: ({ value, max, }: {
|
|
16
|
+
formatValue?: ({ value, max, }: Readonly<{
|
|
17
17
|
value: ProgressProps['value'];
|
|
18
18
|
max: ProgressProps['max'];
|
|
19
|
-
}) => ReactNode;
|
|
19
|
+
}>) => ReactNode;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
- Reads a hidden [HTML `<progress>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress) to screen readers.
|
package/lib/Rating/Rating.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type RatingProps = {
|
|
|
16
16
|
onHover?: (hoveredValue: number) => void;
|
|
17
17
|
/** Tracks our `size_avatar` tokens for consistent sizing */
|
|
18
18
|
size?: 'xsmall' | 'small' | 'medium' | 'large';
|
|
19
|
-
style?: CSSProperties
|
|
19
|
+
style?: Readonly<CSSProperties>;
|
|
20
20
|
className?: string;
|
|
21
21
|
/** Test id for automation */
|
|
22
22
|
'data-testid'?: string;
|
package/lib/Spinner/Spinner.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type SpinnerProps = ComponentPropsWithRef<'span'> & {
|
|
|
21
21
|
type LayoutProps = {
|
|
22
22
|
$isCentered?: boolean;
|
|
23
23
|
$layout?: Layout;
|
|
24
|
-
$ccMargin?:
|
|
24
|
+
$ccMargin?: SpinnerProps['ccMargin'];
|
|
25
25
|
};
|
|
26
26
|
declare const Layout: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, LayoutProps>> & string;
|
|
27
27
|
/** Use Spinner when something's happening and the user needs to wait. Versatile and customizable. */
|
package/lib/Table/Table.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { Row, CellContext, ColumnDef, ColumnSort, OnChangeFn, SortingState } from '@tanstack/react-table';
|
|
3
|
-
import { CellSize } from '../shared/types
|
|
4
|
-
type FilteredCellSize =
|
|
3
|
+
import { CellSize } from '../shared/types';
|
|
4
|
+
type FilteredCellSize = Exclude<CellSize, 'auto'>;
|
|
5
5
|
type TableProps<T> = ComponentPropsWithRef<'table'> & {
|
|
6
|
-
defaultData: T[];
|
|
6
|
+
defaultData: readonly T[];
|
|
7
7
|
/** Pulls in our spacing tokens for easy margin setting (e.g., `ccMargin="0 m xl"`). */
|
|
8
8
|
ccMargin?: string;
|
|
9
|
-
columns: ColumnDef<T, unknown
|
|
9
|
+
columns: readonly Readonly<ColumnDef<T, unknown>>[];
|
|
10
10
|
/** Make sure this matches the number of `columns` */
|
|
11
|
-
columnSizes: FilteredCellSize[];
|
|
11
|
+
columnSizes: readonly FilteredCellSize[];
|
|
12
12
|
/** Array of columns to sort by default, provided column id and whether or not sort should be descending */
|
|
13
|
-
defaultSortedColumns?: {
|
|
13
|
+
defaultSortedColumns?: readonly Readonly<{
|
|
14
14
|
id: string;
|
|
15
15
|
desc: boolean;
|
|
16
|
-
}[];
|
|
16
|
+
}>[];
|
|
17
17
|
/** Enables/Disables the ability to remove sorting for the table.
|
|
18
18
|
*
|
|
19
19
|
* If true then changing sort order will circle like: 'none' -> 'desc' -> 'asc' -> 'none' -> ...
|
|
@@ -44,9 +44,9 @@ type TableProps<T> = ComponentPropsWithRef<'table'> & {
|
|
|
44
44
|
* When this prop is provided, manual sorting is automatically enabled (useful for server-side sorting scenarios).
|
|
45
45
|
* The table will not automatically sort rows and expects you to manually sort the rows before passing them to the table.
|
|
46
46
|
*/
|
|
47
|
-
sorting?:
|
|
47
|
+
sorting?: readonly Readonly<ColumnSort>[];
|
|
48
48
|
/** Callback for when the sorting changes */
|
|
49
|
-
onSortingChange?: (newSorting:
|
|
49
|
+
onSortingChange?: (newSorting: readonly Readonly<ColumnSort>[]) => void;
|
|
50
50
|
};
|
|
51
51
|
export type { CellContext, ColumnDef, ColumnSort, OnChangeFn, Row, SortingState, };
|
|
52
52
|
export declare const Table: <T extends object>({ defaultSortedColumns, defaultData, ccMargin, columns, columnSizes, enableSortingRemoval, enableStickyHeaders, manualPagination, pageCount, sorting: externalSorting, onSortingChange, ...props }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/lib/Text/Text.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type TextProps = {
|
|
|
13
13
|
weight?: string | number;
|
|
14
14
|
display?: 'inline' | 'block';
|
|
15
15
|
className?: string;
|
|
16
|
-
style?: CSSProperties
|
|
16
|
+
style?: Readonly<CSSProperties>;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
- Sensible defaults based on size, with the flexibility to render as any HTML element.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import { AvatarProps } from '../Avatar/Avatar';
|
|
3
|
-
type FilteredAvatarProps = Omit<AvatarProps, 'design' | 'size' | 'tooltip'
|
|
3
|
+
type FilteredAvatarProps = Readonly<Omit<AvatarProps, 'design' | 'size' | 'tooltip'>>;
|
|
4
4
|
export type TimeStampProps = ComponentPropsWithRef<'div'> & {
|
|
5
5
|
/** Text for the timestamp (accepts markup, too) */
|
|
6
6
|
children: ReactNode;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ButtonSize, IconComponentProps } from '../../Button/Button';
|
|
2
2
|
export type IconFromSVGProps = {
|
|
3
|
-
component: IconComponentProps
|
|
3
|
+
component: Readonly<IconComponentProps>;
|
|
4
4
|
isLoading?: boolean;
|
|
5
5
|
size?: ButtonSize;
|
|
6
6
|
};
|
|
7
|
-
export declare const IconFromSVG: ({ component, isLoading, size, }: IconFromSVGProps) =>
|
|
7
|
+
export declare const IconFromSVG: ({ component, isLoading, size, }: IconFromSVGProps) => Readonly<Readonly<import('react').ReactElement<{
|
|
8
|
+
style?: import('react').CSSProperties;
|
|
9
|
+
}, string | import('react').JSXElementConstructor<any>>>>;
|
|
8
10
|
export default IconFromSVG;
|
|
@@ -4,7 +4,7 @@ type HTMLFieldsetProps = ComponentPropsWithRef<'fieldset'>;
|
|
|
4
4
|
type FilteredHTMLFieldsetProps = Omit<HTMLFieldsetProps, 'onChange'>;
|
|
5
5
|
export type FieldsetProps = FilteredHTMLFieldsetProps & UseMessageProps & {
|
|
6
6
|
label: ReactNode;
|
|
7
|
-
children?: ReactNode
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
hideLabel?: boolean;
|
|
9
9
|
testId?: string;
|
|
10
10
|
};
|
package/lib/shared/styles.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export declare const statusStyles: (status: GetStatusProps["status"]) => {
|
|
|
10
10
|
focusStyles: import('styled-components').RuleSet<object>;
|
|
11
11
|
};
|
|
12
12
|
export declare const visuallyHidden: import('styled-components').RuleSet<object>;
|
|
13
|
+
/**
|
|
14
|
+
* Conversts {@linkcode CSSSpacing} values to CSS tokens.
|
|
15
|
+
*
|
|
16
|
+
* @param spacing Spacing value to be converted.
|
|
17
|
+
*/
|
|
13
18
|
export declare const spacingTokensToCSS: (spacing: string) => string;
|
|
14
19
|
export declare const avatarSizes: {
|
|
15
20
|
large: number;
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type ProgressProps = ComponentPropsWithRef<'progress'> & {
|
|
|
24
24
|
color?: keyof typeof ProgressColor;
|
|
25
25
|
[key: `data-${string}`]: string;
|
|
26
26
|
};
|
|
27
|
-
export type CellSize = 'auto' | 'fill' | number | string;
|
|
27
|
+
export type CellSize = 'auto' | 'fill' | 'masonry' | 'none' | 'subgrid' | `${'max' | 'min'}-content` | `${number}${string}` | `fit-content(${string})` | `minmax(${string})` | `repeat(${string})` | number;
|
|
28
28
|
/** props applied to all polymorphic components */
|
|
29
29
|
export type BasePolymorphicComponentProps<C extends ElementType> = {
|
|
30
30
|
component?: C;
|