@lunit/oui 3.1.0 → 3.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.
Files changed (53) hide show
  1. package/dist/presentations/AnalysisBar/AnalysisBar.js +3 -2
  2. package/dist/presentations/AnalysisBar/AnalysisBar.utils.js +11 -0
  3. package/dist/types/components/Alert/Alert.types.d.ts +1 -0
  4. package/dist/types/components/BaseTextField/BaseTextField.types.d.ts +9 -0
  5. package/dist/types/components/Button/Button.types.d.ts +13 -0
  6. package/dist/types/components/Card/Card.types.d.ts +4 -0
  7. package/dist/types/components/Checkbox/Checkbox.types.d.ts +12 -0
  8. package/dist/types/components/Chip/Chip.types.d.ts +2 -0
  9. package/dist/types/components/DatePicker/DatePicker.types.d.ts +2 -0
  10. package/dist/types/components/Dialog/Dialog.types.d.ts +15 -0
  11. package/dist/types/components/Divider/Divider.types.d.ts +1 -0
  12. package/dist/types/components/Dropdown/Dropdown.types.d.ts +9 -0
  13. package/dist/types/components/Dropdown/DropdownItem.types.d.ts +5 -0
  14. package/dist/types/components/Dropdown/DropdownSubtitle.types.d.ts +2 -0
  15. package/dist/types/components/Dropdown/IconDropdown.types.d.ts +7 -0
  16. package/dist/types/components/EllipsisTypography/EllipsisTypography.types.d.ts +4 -0
  17. package/dist/types/components/FileDnDZone/FileDnDZone.types.d.ts +8 -0
  18. package/dist/types/components/List/List.types.d.ts +9 -0
  19. package/dist/types/components/List/ListItem.types.d.ts +6 -0
  20. package/dist/types/components/List/ListItemCaption.types.d.ts +1 -0
  21. package/dist/types/components/LoadingIndicator/LoadingIndicator.types.d.ts +4 -0
  22. package/dist/types/components/Menu/Menu.types.d.ts +5 -0
  23. package/dist/types/components/Menu/MenuItem.types.d.ts +6 -0
  24. package/dist/types/components/Pagination/Pagination.types.d.ts +6 -0
  25. package/dist/types/components/ProductLabel/ProductLabel.types.d.ts +6 -0
  26. package/dist/types/components/Progress/CircularProgress.types.d.ts +2 -0
  27. package/dist/types/components/Progress/LinearProgress.types.d.ts +3 -0
  28. package/dist/types/components/Radio/Radio.types.d.ts +11 -0
  29. package/dist/types/components/Radio/RadioGroup.types.d.ts +6 -0
  30. package/dist/types/components/Stepper/Stepper.types.d.ts +5 -0
  31. package/dist/types/components/TabbedPanel/TabbedPanel.types.d.ts +17 -0
  32. package/dist/types/components/TextField/TextArea.types.d.ts +10 -0
  33. package/dist/types/components/TextField/TextInput.types.d.ts +14 -0
  34. package/dist/types/components/Toggle/Toggle.types.d.ts +14 -0
  35. package/dist/types/components/Tooltip/Tooltip.types.d.ts +5 -0
  36. package/dist/types/components/UploadManager/UploadManager.types.d.ts +9 -0
  37. package/dist/types/presentations/Accordion/Accordion.types.d.ts +11 -0
  38. package/dist/types/presentations/AnalysisBar/AnalysisBar.types.d.ts +18 -1
  39. package/dist/types/presentations/AnalysisBar/AnalysisBar.utils.d.ts +7 -0
  40. package/dist/types/presentations/AnalysisBar/index.d.ts +2 -2
  41. package/dist/types/presentations/FreeText/FreeText.types.d.ts +5 -0
  42. package/dist/types/presentations/Histogram/Histogram.types.d.ts +14 -0
  43. package/dist/types/presentations/HorizonDivider/HorizonDivider.types.d.ts +1 -0
  44. package/dist/types/presentations/ModelType/ModelType.types.d.ts +17 -0
  45. package/dist/types/presentations/Preview/Preview.types.d.ts +2 -0
  46. package/dist/types/presentations/Score/Score.types.d.ts +8 -0
  47. package/dist/types/presentations/Statistic/Statistic.types.d.ts +9 -0
  48. package/dist/types/presentations/Threshold/Threshold.types.d.ts +20 -0
  49. package/dist/types/presentations/ToggleControl/ToggleControl.types.d.ts +29 -0
  50. package/dist/types/presentations/ToggleControlGroup/ToggleControlGroup.types.d.ts +11 -0
  51. package/dist/types/presentations/presentations.types.d.ts +6 -0
  52. package/docs/COMPONENTS.md +28 -0
  53. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box } from '@mui/material';
3
3
  import { AnalysisBarSegmentContainer, AnalysisBarOuter, AxisLabels, GraphAxisLabel, GraphScoreIndicator, GraphSegment, } from './AnalysisBar.styled';
4
- import { parseStringValToNumber, normalizeSegmentWidths } from './AnalysisBar.utils';
4
+ import { resolveExpressionLevel, normalizeSegmentWidths } from './AnalysisBar.utils';
5
5
  import HeatmapGraphSVG from './HeatmapGraphIcon/HeatmapGraphSVG';
6
6
  const Segments = ({ segments, isCutoff }) => {
7
7
  if (!segments) {
@@ -40,7 +40,8 @@ const AnalysisBar = ({ componentType = 'analysisBar', isCutoff = false, expressi
40
40
  const normalizedSegments = normalizeSegmentWidths(segments, isCutoff);
41
41
  return (_jsxs(AnalysisBarOuter, { className: "analysis-bar", isDimmed: isDimmed, children: [_jsxs(AnalysisBarSegmentContainer, { children: [expressionValue && (_jsx(GraphScoreIndicator, { value: expressionValue, isCutoff: isCutoff, isJet: normalizedSegments?.[0]?.color === 'jet' })), _jsx(Segments, { segments: normalizedSegments, isCutoff: isCutoff })] }), (expressionLevels.length > 0 || caption) && (_jsxs(AxisLabels, { children: [expressionLevels.length > 0 &&
42
42
  expressionLevels.map((val, i) => {
43
- return (_jsx(GraphAxisLabel, { label: expressionLabels[i] || val, isCutoff: isCutoff, leftPos: parseStringValToNumber(val) }, i));
43
+ const { label, position } = resolveExpressionLevel(val);
44
+ return (_jsx(GraphAxisLabel, { label: expressionLabels[i] || label, isCutoff: isCutoff, leftPos: position }, i));
44
45
  }), caption && (_jsx(GraphAxisLabel, { label: caption, isCutoff: isCutoff, leftPos: 50 }))] }))] }));
45
46
  };
46
47
  export default AnalysisBar;
@@ -2,6 +2,17 @@ export function parseStringValToNumber(val) {
2
2
  const value = val.endsWith('%') ? val.slice(0, -1) : val;
3
3
  return parseInt(value, 10);
4
4
  }
5
+ /**
6
+ * @description resolveExpressionLevel normalizes an expression level into a label and its position on the bar.
7
+ * @param level - A numeric string ('20', '20%') used as both label and position, or an object with an explicit label and position.
8
+ * @returns The label to display and its position on the bar.
9
+ */
10
+ export function resolveExpressionLevel(level) {
11
+ if (typeof level === 'string') {
12
+ return { label: level, position: parseStringValToNumber(level) };
13
+ }
14
+ return level;
15
+ }
5
16
  export function clampNumericalPercentage(value) {
6
17
  if (value >= 100)
7
18
  return 100;
@@ -1,4 +1,5 @@
1
1
  import type { AlertProps as MuiAlertProps } from '@mui/material';
2
2
  export interface AlertProps extends MuiAlertProps {
3
+ /** Called when the close button is clicked; the button is only rendered when this is set */
3
4
  onClose?: () => void;
4
5
  }
@@ -1,17 +1,26 @@
1
1
  import type { BoxProps } from '@mui/material';
2
2
  interface BaseTextFieldContainerProps {
3
+ /** Width of the field; a number is treated as px */
3
4
  width?: string | number;
4
5
  }
5
6
  interface RootTextFieldProps extends BaseTextFieldContainerProps {
7
+ /** Blocks input and renders the muted disabled style */
6
8
  disabled?: boolean;
9
+ /** Allows selection and copying but blocks editing */
7
10
  readOnly?: boolean;
11
+ /** Field contents, for controlled use */
8
12
  value?: string;
13
+ /** Initial contents, for uncontrolled use */
9
14
  defaultValue?: string;
15
+ /** Renders the field in its error state */
10
16
  error?: boolean;
17
+ /** Props for the wrapper Box around the field */
11
18
  BoxProps?: BoxProps;
12
19
  }
13
20
  interface HelperMsgProps {
21
+ /** Renders the message in the error style */
14
22
  error?: boolean;
23
+ /** Helper text shown under the field */
15
24
  helperMsg?: string;
16
25
  }
17
26
  export { RootTextFieldProps, BaseTextFieldContainerProps, HelperMsgProps };
@@ -3,20 +3,33 @@ type ButtonVariant = 'contained' | 'ghost' | 'outlined';
3
3
  type ButtonColor = 'primary' | 'secondary' | 'error';
4
4
  type ButtonSize = 'small' | 'medium' | 'large';
5
5
  interface BaseButtonProps extends Omit<MuiButtonProps, 'variant' | 'color'> {
6
+ /** Visual style of the button. Defaults to `contained` */
6
7
  variant?: ButtonVariant;
8
+ /** Colour role applied to the button */
7
9
  color?: ButtonColor;
10
+ /** Height and padding preset */
8
11
  size?: ButtonSize;
12
+ /** Blocks interaction and renders the muted disabled style */
9
13
  disabled?: boolean;
14
+ /** Draws a 2px outline on focus and active; `outlined` variant only. Defaults to `false` */
10
15
  focusOutline?: boolean;
16
+ /** Set internally to pick the icon-only layout; use `IconButtonProps` or `NormalButtonProps` instead */
11
17
  isIconOnly: boolean;
18
+ /** Swaps the content for a spinner and swallows clicks */
12
19
  loading?: boolean;
20
+ /** Text shown in the button */
13
21
  label?: string;
14
22
  }
23
+ /** A button whose content is an icon only */
15
24
  interface IconButtonProps extends Omit<BaseButtonProps, 'isIconOnly'> {
25
+ /** Icon rendered as the whole button content */
16
26
  icon: React.ReactNode;
17
27
  }
28
+ /** A button with a text label, optionally preceded by an icon */
18
29
  interface NormalButtonProps extends Omit<BaseButtonProps, 'isIconOnly'> {
30
+ /** Text shown in the button */
19
31
  label: string;
32
+ /** Icon rendered before the label */
20
33
  icon?: React.ReactNode;
21
34
  }
22
35
  type ButtonProps = IconButtonProps | NormalButtonProps;
@@ -1,8 +1,12 @@
1
1
  import type { CardProps as MuiCardProps } from '@mui/material';
2
2
  export type CardSize = 'small' | 'large';
3
3
  export interface CardProps extends MuiCardProps {
4
+ /** Fixed card dimensions: `small` is 480x156, `large` is 520x284. Defaults to `large` */
4
5
  size?: CardSize;
6
+ /** Not read by this component; forwarded to the underlying MUI Card */
5
7
  open?: boolean;
8
+ /** Renders the card on the lighter selected background */
6
9
  selected?: boolean;
10
+ /** Called when the card is clicked */
7
11
  onClick?: () => void;
8
12
  }
@@ -1,15 +1,27 @@
1
1
  import type { BoxProps, CheckboxProps as MuiCheckboxProps } from '@mui/material';
2
2
  export interface CheckboxProps extends Omit<BoxProps<'span'>, 'onChange' | 'onChangeCapture'> {
3
+ /** Value submitted with the surrounding form */
3
4
  value?: MuiCheckboxProps['value'];
5
+ /** Name of the underlying input */
4
6
  name?: MuiCheckboxProps['name'];
7
+ /** Whether the box is ticked, for controlled use */
5
8
  checked?: MuiCheckboxProps['checked'];
9
+ /** Initial state, for uncontrolled use */
6
10
  defaultChecked?: MuiCheckboxProps['defaultChecked'];
11
+ /** Blocks interaction and renders the muted disabled style */
7
12
  disabled?: MuiCheckboxProps['disabled'];
13
+ /** Marks the input as required in the surrounding form */
8
14
  required?: MuiCheckboxProps['required'];
15
+ /** Renders the dash state used when only some children are ticked */
9
16
  indeterminate?: MuiCheckboxProps['indeterminate'];
17
+ /** Called when the box is ticked or unticked */
10
18
  onChange?: MuiCheckboxProps['onChange'];
19
+ /** Capture-phase change handler */
11
20
  onChangeCapture?: MuiCheckboxProps['onChangeCapture'];
21
+ /** Text shown beside the box; makes the container a `<label>` */
12
22
  label?: string;
23
+ /** Attributes applied to the underlying input element */
13
24
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
25
+ /** Ref to the underlying input element */
14
26
  inputRef?: React.Ref<HTMLInputElement>;
15
27
  }
@@ -1,6 +1,8 @@
1
1
  import type { ChipProps as MuiChipProps } from '@mui/material';
2
2
  export type ChipsPreset = 'default' | 'uploaded' | 'analyzing' | 'analyzed' | 'analysis_failed' | 'qc_failed' | 'ready' | 'inferred' | 'inferencing' | 'invalid' | 'requested';
3
3
  export interface ChipProps extends MuiChipProps {
4
+ /** Analysis status preset that supplies the colour and default label; every `*_failed` preset shares one style */
4
5
  preset?: ChipsPreset;
6
+ /** Text shown in the chip; overrides the preset's default label */
5
7
  label?: string;
6
8
  }
@@ -1,6 +1,8 @@
1
1
  import type { DatePickerProps as MuiDatePickerProps } from '@mui/x-date-pickers/DatePicker';
2
2
  export type DatePickerAlignment = 'left' | 'center' | 'right';
3
3
  export interface DatePickerProps extends MuiDatePickerProps {
4
+ /** Horizontal alignment of the date text inside the field */
4
5
  alignment?: DatePickerAlignment;
6
+ /** Placeholder shown while no date is selected */
5
7
  placeholder?: string;
6
8
  }
@@ -1,18 +1,33 @@
1
1
  import type { SxProps } from '@mui/system';
2
2
  export interface DialogProps {
3
+ /** Whether the dialog is shown */
3
4
  open: boolean;
5
+ /** Heading shown in the dialog header */
4
6
  title?: string;
7
+ /** Icon rendered before the title */
5
8
  icon?: React.ReactNode;
9
+ /** Renders a close button in the header */
6
10
  closable?: boolean;
11
+ /** Keeps the dialog at the narrow 320px prompt width even when `children` is used */
7
12
  isPrompt?: boolean;
13
+ /** Label for the cancel button; the default footer renders only when this or `submitText` is set */
8
14
  cancelText?: string;
15
+ /** Label for the submit button */
9
16
  submitText?: string;
17
+ /** Called when the dialog requests to close, with the reason MUI reports */
10
18
  onClose?: (event: object | null, reason: string) => void;
19
+ /** Plain body text; takes precedence over `children` */
11
20
  text?: string;
21
+ /** Body content, used when `text` is not set. Widens the dialog unless `isPrompt` is set */
12
22
  children?: React.ReactNode;
23
+ /** Replaces the default cancel/submit footer entirely */
13
24
  dialogAction?: React.ReactNode;
25
+ /** Size preset applied to the footer buttons. Defaults to `small` */
14
26
  buttonSize?: 'small' | 'medium' | 'large';
27
+ /** Shows a spinner on the submit button and blocks it */
15
28
  loading?: boolean;
29
+ /** Blocks the submit button without showing a spinner */
16
30
  disableSubmit?: boolean;
31
+ /** Style overrides for the dialog paper */
17
32
  sx?: SxProps;
18
33
  }
@@ -1,5 +1,6 @@
1
1
  import type { DividerProps as MuiDividerProps } from '@mui/material';
2
2
  interface DividerProps extends MuiDividerProps {
3
+ /** Direction the rule runs in. Defaults to `vertical`, unlike MUI's `horizontal` */
3
4
  orientation?: 'horizontal' | 'vertical';
4
5
  }
5
6
  export type { DividerProps };
@@ -1,19 +1,28 @@
1
1
  import type { BoxProps, SelectProps, TypographyProps } from '@mui/material';
2
2
  import { IconDropdownOption } from './IconDropdown.types';
3
3
  interface DropdownContainerProps extends BoxProps {
4
+ /** Stretches the container to the full width of its parent */
4
5
  fullWidth?: boolean;
5
6
  }
6
7
  type BaseDropdownProps<T = unknown> = SelectProps<T>;
7
8
  interface DropdownProps<T = unknown> extends Omit<BaseDropdownProps<T>, 'IconComponent' | 'error' | 'sx' | 'style'> {
9
+ /** Error message shown under the field; also puts the field in its error state */
8
10
  error?: string;
11
+ /** Helper text shown under the field when there is no `error` */
9
12
  helperMsg?: string;
13
+ /** Text shown while nothing is selected */
10
14
  placeholder?: string;
15
+ /** Props for the wrapper around the select and its messages */
11
16
  ContainerProps?: BoxProps;
17
+ /** Style overrides for the select */
12
18
  sx?: SelectProps['sx'];
19
+ /** Inline styles for the select */
13
20
  style?: SelectProps['style'];
21
+ /** Options to render; an alternative to passing DropdownItem children */
14
22
  options?: IconDropdownOption[];
15
23
  }
16
24
  interface PlaceholderProps extends TypographyProps {
25
+ /** Renders the placeholder in the muted disabled style */
17
26
  disabled?: boolean;
18
27
  }
19
28
  type DropdownComponent = <T>(props: DropdownProps<T>) => JSX.Element;
@@ -1,11 +1,16 @@
1
1
  import type { MenuItemProps } from '@mui/material';
2
2
  interface BaseDropdownItemProps extends MenuItemProps {
3
+ /** Reserves leading space so the label lines up with items that show an icon */
3
4
  emptyIcon?: boolean;
4
5
  }
5
6
  interface DropdownItemProps extends BaseDropdownItemProps {
7
+ /** Treats the item as an action rather than a value, so selecting it does not change the field */
6
8
  asButton?: boolean;
9
+ /** Shows a check mark while the item is selected */
7
10
  checkIcon?: boolean;
11
+ /** Icon rendered before the label, taking precedence over `checkIcon` */
8
12
  customIcon?: React.ReactElement;
13
+ /** Shortcut hint pinned to the right of the label */
9
14
  keyboardShortcut?: string;
10
15
  }
11
16
  export { DropdownItemProps, BaseDropdownItemProps };
@@ -1,5 +1,7 @@
1
1
  interface DropdownSubtitleProps {
2
+ /** Section heading shown above a group of items */
2
3
  label: string;
4
+ /** Secondary text shown next to the label */
3
5
  value?: string;
4
6
  }
5
7
  export default DropdownSubtitleProps;
@@ -1,17 +1,24 @@
1
1
  import type { TypographyProps } from '@mui/system';
2
2
  import type { BaseDropdownProps } from '../Dropdown/Dropdown.types';
3
3
  type BaseIconDropdownProps = BaseDropdownProps & {
4
+ /** Renders the trigger in its active, pressed-in style */
4
5
  isToggled?: boolean;
5
6
  };
6
7
  type IconDropdownProps = BaseIconDropdownProps;
7
8
  interface PlaceholderProps extends TypographyProps {
9
+ /** Renders the placeholder in the muted disabled style */
8
10
  disabled?: boolean;
9
11
  }
10
12
  interface IconDropdownOption {
13
+ /** Value selected when the option is picked */
11
14
  value: string;
15
+ /** Icon rendered before the label */
12
16
  icon: React.ReactElement;
17
+ /** Text shown for the option */
13
18
  label: string;
19
+ /** Shortcut hint pinned to the right of the label */
14
20
  shortcut?: string;
21
+ /** Marks the option as the default choice */
15
22
  default?: boolean;
16
23
  }
17
24
  export { IconDropdownProps, BaseIconDropdownProps, PlaceholderProps, IconDropdownOption };
@@ -1,9 +1,13 @@
1
1
  import type { TypographyProps as MuiTypographyProps } from '@mui/material';
2
2
  export interface BaseEllipsisTypographyProps extends MuiTypographyProps {
3
+ /** `row` clamps to a single line, `column` clamps to `maxLines`. Defaults to `row` */
3
4
  direction?: 'row' | 'column';
5
+ /** Lines to show before truncating; `column` direction only. Defaults to 1 */
4
6
  maxLines?: number;
5
7
  }
6
8
  export interface EllipsisTypographyProps extends BaseEllipsisTypographyProps {
9
+ /** Where the overflow tooltip opens. Defaults to `bottom` */
7
10
  tooltipPlacement?: 'top' | 'right' | 'bottom' | 'left';
11
+ /** Slack in px before overflow counts as truncated, to absorb sub-pixel rounding */
8
12
  heightThreshold?: number;
9
13
  }
@@ -1,12 +1,20 @@
1
1
  import type { BoxProps } from '@mui/material';
2
2
  interface FileDnDZoneProps {
3
+ /** Slides already uploaded, shown in the usage message */
3
4
  slidesUploaded: number;
5
+ /** Upper bound shown in the usage message. Defaults to 500 */
4
6
  maxSlideLimit?: number;
7
+ /** Accepted extensions listed in the guidance text */
5
8
  acceptedFileFormats?: string;
9
+ /** Blocks dropping and renders the muted disabled style */
6
10
  disabled?: boolean;
11
+ /** Props for the outermost wrapper */
7
12
  WrapperProps?: BoxProps;
13
+ /** Props for the dashed drop-target box */
8
14
  OuterBoxProps?: BoxProps;
15
+ /** Props for the content box inside the drop target */
9
16
  InnerBoxProps?: BoxProps;
17
+ /** Props for the guidance text section */
10
18
  SectionBoxProps?: BoxProps;
11
19
  }
12
20
  export default FileDnDZoneProps;
@@ -1,17 +1,26 @@
1
1
  import type { ListProps as MuiListProps, ListSubheaderProps as MuiListSubheaderProps } from '@mui/material';
2
2
  export type ListSize = 'small' | 'medium' | 'large';
3
3
  export interface ListProps extends MuiListProps {
4
+ /** Row height and typography preset applied to every item. Defaults to `medium` */
4
5
  size?: ListSize;
6
+ /** Weight of the subheader text. Defaults to `bold` */
5
7
  subheaderType?: ListSubheaderProps['type'];
8
+ /** `visible` keeps the list always open; a boolean makes the subheader a collapse toggle. Defaults to `visible` */
6
9
  open?: boolean | 'visible';
10
+ /** Called when a collapsed list is expanded via the subheader */
7
11
  onOpen?: (event: React.MouseEvent<HTMLLIElement>) => void;
12
+ /** Called when an expanded list is collapsed via the subheader */
8
13
  onClose?: (event: React.MouseEvent<HTMLLIElement>) => void;
14
+ /** Reserves leading space in every item so labels line up with checked ones */
9
15
  showCheck?: boolean;
10
16
  }
11
17
  export interface ListSubheaderProps extends MuiListSubheaderProps {
18
+ /** Weight of the subheader text */
12
19
  type?: 'bold' | 'normal';
20
+ /** Renders the subheader with hover and pointer affordances */
13
21
  clickable?: boolean;
14
22
  }
23
+ /** Size and check settings shared with the list's items */
15
24
  export interface ListContextValue {
16
25
  size: ListSize;
17
26
  showCheck: boolean;
@@ -3,9 +3,13 @@ import { OverrideProps } from '@mui/material/OverridableComponent';
3
3
  import type { ListSize } from '../List/List.types';
4
4
  type ListItemRootBasePropsKey = 'className' | 'classes' | 'style' | 'sx';
5
5
  export interface ListItemBaseProps extends Omit<MuiListItemButtonProps, ListItemRootBasePropsKey>, Pick<MuiListItemProps, ListItemRootBasePropsKey> {
6
+ /** Primary content of the row */
6
7
  label?: React.ReactNode | string;
8
+ /** Content rendered before the label, e.g. an icon or checkbox */
7
9
  startElement?: React.ReactNode;
10
+ /** Content rendered after the label, e.g. a caption or action */
8
11
  endElement?: React.ReactNode;
12
+ /** Props applied to the outer `li`, separate from the inner button */
9
13
  rootProps?: MuiListItemProps;
10
14
  }
11
15
  export type ListItemTypeMap<P = {}, D extends React.ElementType = 'span'> = ExtendButtonBaseTypeMap<{
@@ -16,7 +20,9 @@ export type ListItemTypeMap<P = {}, D extends React.ElementType = 'span'> = Exte
16
20
  export type ListItemComponent = ExtendButtonBase<ListItemTypeMap>;
17
21
  export type ListItemProps<D extends React.ElementType = ListItemTypeMap['defaultComponent'], P = {}> = OverrideProps<ListItemTypeMap<P, D>, D>;
18
22
  export interface StyledListItemButtonProps extends MuiListItemButtonProps {
23
+ /** Element the button renders as */
19
24
  component?: React.ElementType;
25
+ /** Row height and typography preset, supplied by the parent List */
20
26
  size: ListSize;
21
27
  }
22
28
  export {};
@@ -1 +1,2 @@
1
+ /** ListItemCaption takes MUI Typography's props unchanged; it declares none of its own. */
1
2
  export { TypographyProps as ListItemCaptionProps } from '@mui/material';
@@ -1,7 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface LoadingIndicatorProps {
3
+ /** Primary line of text shown under the animation */
3
4
  message?: string;
5
+ /** Secondary content shown under the message; replaces the default detail text */
4
6
  details?: ReactNode;
7
+ /** Which Lottie animation to play. Defaults to `dot` */
5
8
  loadingAnimation?: 'dot' | 'dna';
9
+ /** `data-testid` applied to the container. Defaults to `loading-indicator` */
6
10
  dataTestId?: string;
7
11
  }
@@ -1,15 +1,20 @@
1
1
  import type { MenuProps as MuiMenuProps, PaperProps } from '@mui/material';
2
2
  export type MenuSize = 'small' | 'medium';
3
3
  export interface MenuProps extends StyledMenuProps {
4
+ /** Row height and typography preset applied to every item. Defaults to `medium` */
4
5
  size?: MenuSize;
6
+ /** Content pinned above the item list */
5
7
  subheader?: React.ReactNode;
8
+ /** Reserves leading space in every item so labels line up with checked ones */
6
9
  showCheck?: boolean;
7
10
  }
8
11
  export interface StyledMenuProps extends MuiMenuProps {
12
+ /** Row height and typography preset */
9
13
  size?: MenuSize;
10
14
  /** @deprecated Use slotProps={{ paper: ... }} instead */
11
15
  PaperProps?: PaperProps;
12
16
  }
17
+ /** Size and check settings shared with the menu's items */
13
18
  export interface MenuContextValue {
14
19
  size: MenuSize;
15
20
  showCheck: boolean;
@@ -1,12 +1,18 @@
1
1
  import type { MenuItemProps as MuiMenuItemProps } from '@mui/material';
2
2
  import type { MenuSize } from '../Menu/Menu.types';
3
3
  export interface MenuItemProps extends MuiMenuItemProps {
4
+ /** Icon rendered before the label. Falls back to a spacer when the menu sets `showCheck` */
4
5
  icon?: React.ReactNode;
6
+ /** Secondary text pinned to the right of the row, e.g. a keyboard shortcut */
5
7
  caption?: React.ReactNode;
8
+ /** Primary text of the row */
6
9
  label?: React.ReactNode;
10
+ /** Not read by this component; forwarded to the underlying MUI MenuItem */
7
11
  open?: boolean;
12
+ /** Not rendered; use `label` for the row's text */
8
13
  children?: React.ReactNode;
9
14
  }
10
15
  export interface StyledMenuItemProps extends MuiMenuItemProps {
16
+ /** Row height and typography preset */
11
17
  size: MenuSize;
12
18
  }
@@ -1,8 +1,13 @@
1
1
  export interface PaginationProps {
2
+ /** Current page, 1-based. Defaults to 1 */
2
3
  page?: number;
4
+ /** Rows shown per page */
3
5
  perPage: number;
6
+ /** Total number of pages */
4
7
  totalPage: number;
8
+ /** Called with the page the user picked */
5
9
  onPageChange?: (event: React.MouseEvent<HTMLLIElement> | React.MouseEvent<HTMLButtonElement> | null, page: number) => void;
10
+ /** Called with the rows-per-page value the user picked */
6
11
  onPerPageChange?: (event: React.MouseEvent<HTMLLIElement> | null, perPage: number) => void;
7
12
  }
8
13
  interface SortObject {
@@ -18,6 +23,7 @@ interface Pageable {
18
23
  pageNumber: number;
19
24
  pageSize: number;
20
25
  }
26
+ /** Page metadata as returned by a Spring Data paged response */
21
27
  export interface PaginationViewInfo {
22
28
  totalElements: number;
23
29
  totalPages: number;
@@ -1,9 +1,15 @@
1
1
  import type { SxProps } from '@mui/system';
2
2
  export interface ProductLabelProps {
3
+ /** Called when the label is dismissed */
3
4
  onClose: () => void;
5
+ /** Whether the label is shown */
4
6
  open: boolean;
7
+ /** Body content of the label */
5
8
  children: React.ReactNode;
9
+ /** Content pinned to the left of the footer; the footer renders only when this or `footerEnd` is set */
6
10
  footerStart?: string | React.ReactNode;
11
+ /** Content pinned to the right of the footer */
7
12
  footerEnd?: string | React.ReactNode;
13
+ /** Style overrides for the container */
8
14
  sx?: SxProps;
9
15
  }
@@ -1,5 +1,7 @@
1
1
  import type { CircularProgressProps as MuiCircularProgressProps } from '@mui/material';
2
2
  export interface CircularProgressProps extends MuiCircularProgressProps {
3
+ /** Colour of the progress arc */
3
4
  circleColor?: string;
5
+ /** Completion percentage, 0-100. Spins indefinitely when omitted */
4
6
  progress?: number;
5
7
  }
@@ -1,6 +1,9 @@
1
1
  import type { LinearProgressProps as MuiLinearProgressProps } from '@mui/material';
2
2
  export interface LinearProgressProps extends Omit<MuiLinearProgressProps, 'color'> {
3
+ /** Colour of the filled portion of the bar */
3
4
  barColor?: string;
5
+ /** Completion percentage, 0-100. Animates indefinitely when omitted */
4
6
  progress?: number;
7
+ /** Bar thickness in px. Defaults to 4 */
5
8
  height?: number;
6
9
  }
@@ -1,14 +1,25 @@
1
1
  import type { BoxProps, RadioProps as MuiRadioProps } from '@mui/material';
2
2
  export interface RadioProps extends Omit<BoxProps<'span'>, 'onChange' | 'onChangeCapture'> {
3
+ /** Value submitted with the surrounding form, and matched against the group's value */
3
4
  value?: MuiRadioProps['value'];
5
+ /** Name of the underlying input; shared across a group */
4
6
  name?: MuiRadioProps['name'];
7
+ /** Whether this option is selected, for controlled use */
5
8
  checked?: MuiRadioProps['checked'];
9
+ /** Initial state, for uncontrolled use */
6
10
  defaultChecked?: MuiRadioProps['defaultChecked'];
11
+ /** Blocks interaction and renders the muted disabled style */
7
12
  disabled?: MuiRadioProps['disabled'];
13
+ /** Marks the input as required in the surrounding form */
8
14
  required?: MuiRadioProps['required'];
15
+ /** Called when this option is selected */
9
16
  onChange?: MuiRadioProps['onChange'];
17
+ /** Capture-phase change handler */
10
18
  onChangeCapture?: MuiRadioProps['onChangeCapture'];
19
+ /** Text shown beside the button; makes the container a `<label>` */
11
20
  label?: string;
21
+ /** Attributes applied to the underlying input element */
12
22
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
23
+ /** Ref to the underlying input element */
13
24
  inputRef?: React.Ref<HTMLInputElement>;
14
25
  }
@@ -1,9 +1,15 @@
1
1
  import type { FormGroupProps, RadioGroupProps as MuiRadioGroupProps } from '@mui/material';
2
2
  export interface RadioGroupProps extends MuiRadioGroupProps {
3
+ /** Radio options belonging to this group */
3
4
  children?: FormGroupProps['children'];
5
+ /** Initially selected value, for uncontrolled use */
4
6
  defaultValue?: MuiRadioGroupProps['defaultValue'];
7
+ /** Name shared by every input in the group */
5
8
  name?: MuiRadioGroupProps['name'];
9
+ /** Called with the newly selected value */
6
10
  onChange?: MuiRadioGroupProps['onChange'];
11
+ /** Selected value, for controlled use */
7
12
  value?: MuiRadioGroupProps['value'];
13
+ /** Lays the options out in a row instead of a column */
8
14
  row?: FormGroupProps['row'];
9
15
  }
@@ -1,11 +1,16 @@
1
1
  import type { TypographyProps } from '@mui/material';
2
2
  import type { SxProps } from '@mui/system';
3
3
  export interface StepperProps {
4
+ /** Step number, rendered as `STEP {step}` */
4
5
  step: number;
6
+ /** Step description shown next to the step number */
5
7
  title: string;
8
+ /** Renders the step number and title in the muted disabled style */
6
9
  disabled?: boolean;
10
+ /** Style overrides for the container */
7
11
  sx?: SxProps;
8
12
  }
9
13
  export interface StepperTypographyProps extends TypographyProps {
14
+ /** Renders the text in the muted disabled style */
10
15
  disabled?: boolean;
11
16
  }
@@ -3,28 +3,45 @@ import type { TabProps, TabsProps } from '@mui/material';
3
3
  type TabSize = 'small' | 'medium';
4
4
  type ButtonVariant = 'normal' | 'toggle';
5
5
  interface TabConfig {
6
+ /** Identifier matched against `activatedTab` */
6
7
  value: string;
8
+ /** Panel content shown while this tab is active */
7
9
  element: React.ReactNode;
10
+ /** Blocks selection of this tab */
8
11
  disabled?: boolean;
9
12
  }
10
13
  interface BaseTabProps extends TabProps {
14
+ /** Height and typography preset */
11
15
  size?: TabSize;
16
+ /** `normal` underlines the active tab, `toggle` renders a segmented control */
12
17
  buttonVariant?: ButtonVariant;
13
18
  }
14
19
  interface BaseTabsProps extends TabsProps {
20
+ /** Height and typography preset */
15
21
  size?: TabSize;
22
+ /** `normal` underlines the active tab, `toggle` renders a segmented control */
16
23
  buttonVariant?: ButtonVariant;
17
24
  }
18
25
  interface TabbedPanelProps {
26
+ /** Tabs and their panel content, in display order */
19
27
  tabs: TabConfig[];
28
+ /** `value` of the tab currently shown */
20
29
  activatedTab: string;
30
+ /** Height and typography preset. Defaults to `medium` */
21
31
  size?: TabSize;
32
+ /** `normal` underlines the active tab, `toggle` renders a segmented control. Defaults to `normal` */
22
33
  buttonVariant?: ButtonVariant;
34
+ /** How the tab strip distributes width; falls back to `fullWidth` for two or more tabs */
23
35
  menuVariant?: TabsProps['variant'];
36
+ /** Props forwarded to the underlying MUI Tabs */
24
37
  TabsProps?: Partial<TabsProps>;
38
+ /** Props forwarded to each underlying MUI Tab */
25
39
  TabProps?: Partial<TabProps>;
40
+ /** Props forwarded to each underlying MUI TabPanel */
26
41
  TabPanelProps?: Partial<TabPanelProps>;
42
+ /** Called with the newly selected tab's `value` */
27
43
  onActivatedTab: (tab: string) => void;
44
+ /** Called before `onActivatedTab` with the same value, for side effects */
28
45
  onTabChangeListener?: (newTabValue: string) => void;
29
46
  }
30
47
  export type { TabbedPanelProps, TabConfig, TabSize, BaseTabProps, BaseTabsProps };
@@ -1,17 +1,27 @@
1
1
  import type { BoxProps, SxProps } from '@mui/material';
2
2
  import type { HelperMsgProps, RootTextFieldProps } from '../BaseTextField/BaseTextField.types';
3
3
  interface RootTextAreaProps extends Omit<RootTextFieldProps, 'BoxProps'> {
4
+ /** Marks the element as a textarea; always `'true'` */
4
5
  multiline: 'true';
6
+ /** Called on every keystroke */
5
7
  onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
8
+ /** Renders the field in its error state */
6
9
  error?: boolean;
10
+ /** Ref to the underlying textarea element */
7
11
  ref?: React.ForwardedRef<HTMLTextAreaElement> | undefined;
12
+ /** Text shown while the field is empty */
8
13
  placeholder?: string;
14
+ /** Width of the field; a number is treated as px */
9
15
  width?: string | number;
16
+ /** Height of the field; a number is treated as px */
10
17
  height?: string | number;
18
+ /** Props for the wrapper Box around the field and its helper message */
11
19
  OuterBoxProps?: BoxProps;
20
+ /** Style overrides for the textarea */
12
21
  sx?: SxProps;
13
22
  }
14
23
  interface TextAreaWithHelperMsgProps extends Omit<RootTextAreaProps, 'error' | 'multiline'>, Omit<HelperMsgProps, 'error'> {
24
+ /** Error message shown under the field; also puts the field in its error state */
15
25
  error?: string;
16
26
  }
17
27
  interface TextAreaProps extends TextAreaWithHelperMsgProps {