@ahrowe/ui 0.32.0 → 0.34.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.
Files changed (172) hide show
  1. package/dist/esm/common/actionIcon/actionIcon.module.mjs.map +1 -1
  2. package/dist/esm/common/breadcrumb/breadcrumb.mjs +1 -1
  3. package/dist/esm/common/breadcrumb/breadcrumb.mjs.map +1 -1
  4. package/dist/esm/common/breadcrumb/breadcrumb.module.mjs +1 -1
  5. package/dist/esm/common/breadcrumb/breadcrumb.module.mjs.map +1 -1
  6. package/dist/esm/common/card/Card.mjs +1 -1
  7. package/dist/esm/common/card/Card.mjs.map +1 -1
  8. package/dist/esm/common/card/card.types.mjs.map +1 -1
  9. package/dist/esm/common/chip/chip.mjs +1 -1
  10. package/dist/esm/common/chip/chip.mjs.map +1 -1
  11. package/dist/esm/common/chip/chip.types.mjs.map +1 -1
  12. package/dist/esm/common/colorPicker/colorPicker.mjs +1 -1
  13. package/dist/esm/common/colorPicker/colorPicker.mjs.map +1 -1
  14. package/dist/esm/common/colorPicker/colorPicker.module.mjs.map +1 -1
  15. package/dist/esm/common/configProvider/configProvider.mjs.map +1 -1
  16. package/dist/esm/common/configProvider/presentation.types.mjs +2 -0
  17. package/dist/esm/common/configProvider/presentation.types.mjs.map +1 -0
  18. package/dist/esm/common/configProvider/usePresentationDefault.mjs.map +1 -1
  19. package/dist/esm/common/confirmModal/confirmModal.mjs +1 -1
  20. package/dist/esm/common/confirmModal/confirmModal.mjs.map +1 -1
  21. package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.mjs +1 -1
  22. package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.mjs.map +1 -1
  23. package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.module.mjs.map +1 -1
  24. package/dist/esm/common/datePicker/datePicker.mjs +1 -1
  25. package/dist/esm/common/datePicker/datePicker.mjs.map +1 -1
  26. package/dist/esm/common/drawer/drawer.mjs +1 -1
  27. package/dist/esm/common/drawer/drawer.mjs.map +1 -1
  28. package/dist/esm/common/dropdown/dropdown.mjs +1 -1
  29. package/dist/esm/common/dropdown/dropdown.mjs.map +1 -1
  30. package/dist/esm/common/dropdown/dropdown.module.mjs +1 -1
  31. package/dist/esm/common/dropdown/dropdown.module.mjs.map +1 -1
  32. package/dist/esm/common/emptyState/emptyState.mjs +1 -1
  33. package/dist/esm/common/emptyState/emptyState.mjs.map +1 -1
  34. package/dist/esm/common/fab/components/fabBase/fabBase.mjs +1 -1
  35. package/dist/esm/common/fab/components/fabBase/fabBase.mjs.map +1 -1
  36. package/dist/esm/common/fab/fab.mjs +1 -1
  37. package/dist/esm/common/fab/fab.mjs.map +1 -1
  38. package/dist/esm/common/hooks/useAnchorTracking.mjs.map +1 -1
  39. package/dist/esm/common/hooks/useFocusBoundary.mjs +1 -1
  40. package/dist/esm/common/hooks/useFocusBoundary.mjs.map +1 -1
  41. package/dist/esm/common/hooks/useSheet.mjs +1 -1
  42. package/dist/esm/common/hooks/useSheet.mjs.map +1 -1
  43. package/dist/esm/common/infiniteBlock/infiniteBlock.mjs +1 -1
  44. package/dist/esm/common/infiniteBlock/infiniteBlock.mjs.map +1 -1
  45. package/dist/esm/common/inputDropdown/inputDropdown.mjs +1 -1
  46. package/dist/esm/common/inputDropdown/inputDropdown.mjs.map +1 -1
  47. package/dist/esm/common/inputDropdown/inputDropdown.module.mjs +1 -1
  48. package/dist/esm/common/inputDropdown/inputDropdown.module.mjs.map +1 -1
  49. package/dist/esm/common/interactableDiv/interactableDiv.mjs +1 -1
  50. package/dist/esm/common/interactableDiv/interactableDiv.mjs.map +1 -1
  51. package/dist/esm/common/klipyPicker/klipyPicker.mjs +1 -1
  52. package/dist/esm/common/klipyPicker/klipyPicker.mjs.map +1 -1
  53. package/dist/esm/common/menu/menu.mjs +2 -0
  54. package/dist/esm/common/menu/menu.mjs.map +1 -0
  55. package/dist/esm/common/menu/menu.module.mjs +2 -0
  56. package/dist/esm/common/menu/menu.module.mjs.map +1 -0
  57. package/dist/esm/common/menu/menu.types.mjs +2 -0
  58. package/dist/esm/common/menu/menu.types.mjs.map +1 -0
  59. package/dist/esm/common/multiSelect/multiSelect.mjs +1 -1
  60. package/dist/esm/common/multiSelect/multiSelect.mjs.map +1 -1
  61. package/dist/esm/common/multiSelect/multiSelect.module.mjs +1 -1
  62. package/dist/esm/common/multiSelect/multiSelect.module.mjs.map +1 -1
  63. package/dist/esm/common/numberInput/numberInput.mjs +1 -1
  64. package/dist/esm/common/numberInput/numberInput.mjs.map +1 -1
  65. package/dist/esm/common/popover/popover.mjs +1 -1
  66. package/dist/esm/common/popover/popover.mjs.map +1 -1
  67. package/dist/esm/common/popover/popover.module.mjs +1 -1
  68. package/dist/esm/common/popover/popover.module.mjs.map +1 -1
  69. package/dist/esm/common/popover/popover.types.mjs.map +1 -1
  70. package/dist/esm/common/popover/usePopoverPosition.mjs +1 -1
  71. package/dist/esm/common/popover/usePopoverPosition.mjs.map +1 -1
  72. package/dist/esm/common/progressBar/progressBar.mjs +1 -1
  73. package/dist/esm/common/progressBar/progressBar.mjs.map +1 -1
  74. package/dist/esm/common/searchInput/searchInput.mjs +1 -1
  75. package/dist/esm/common/searchInput/searchInput.mjs.map +1 -1
  76. package/dist/esm/common/splitButton/splitButton.mjs +1 -1
  77. package/dist/esm/common/splitButton/splitButton.mjs.map +1 -1
  78. package/dist/esm/common/splitButton/splitButton.module.mjs +1 -1
  79. package/dist/esm/common/splitButton/splitButton.module.mjs.map +1 -1
  80. package/dist/esm/common/timeInput/timeInput.mjs +1 -1
  81. package/dist/esm/common/timeInput/timeInput.mjs.map +1 -1
  82. package/dist/esm/common/toast/toast.module.mjs.map +1 -1
  83. package/dist/esm/common/tooltip/tooltip.mjs +1 -1
  84. package/dist/esm/common/tooltip/tooltip.mjs.map +1 -1
  85. package/dist/esm/common/tooltip/tooltip.module.mjs +1 -1
  86. package/dist/esm/common/tooltip/tooltip.module.mjs.map +1 -1
  87. package/dist/esm/common/virtualList/virtualList.module.mjs +1 -1
  88. package/dist/esm/common/virtualList/virtualList.module.mjs.map +1 -1
  89. package/dist/esm/common/virtualList/virtualListHeader.mjs +1 -1
  90. package/dist/esm/common/virtualList/virtualListHeader.mjs.map +1 -1
  91. package/dist/esm/index.mjs +1 -1
  92. package/dist/index.cjs +3 -3
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/style.css +1 -1
  95. package/dist/types/common/card/card.types.d.ts +6 -1
  96. package/dist/types/common/chip/chip.types.d.ts +6 -1
  97. package/dist/types/common/colorPicker/colorPicker.d.ts +1 -1
  98. package/dist/types/common/colorPicker/colorPicker.types.d.ts +6 -1
  99. package/dist/types/common/configProvider/configProvider.d.ts +1 -1
  100. package/dist/types/common/configProvider/configProvider.types.d.ts +6 -3
  101. package/dist/types/common/configProvider/index.d.ts +1 -0
  102. package/dist/types/common/configProvider/presentation.types.d.ts +14 -0
  103. package/dist/types/common/configProvider/usePresentationDefault.d.ts +1 -1
  104. package/dist/types/common/confirmModal/confirmModal.types.d.ts +4 -2
  105. package/dist/types/common/datePicker/components/datePickerMonth/datePickerMonth.d.ts +1 -1
  106. package/dist/types/common/datePicker/components/datePickerMonth/datePickerMonth.types.d.ts +3 -0
  107. package/dist/types/common/datePicker/datePicker.types.d.ts +11 -2
  108. package/dist/types/common/drawer/drawer.d.ts +1 -1
  109. package/dist/types/common/drawer/drawer.types.d.ts +7 -1
  110. package/dist/types/common/dropdown/dropdown.types.d.ts +7 -7
  111. package/dist/types/common/emptyState/emptyState.d.ts +1 -1
  112. package/dist/types/common/emptyState/emptyState.types.d.ts +6 -1
  113. package/dist/types/common/fab/components/fabBase/fabBase.d.ts +1 -1
  114. package/dist/types/common/fab/components/fabBase/fabBase.types.d.ts +3 -1
  115. package/dist/types/common/fab/fab.d.ts +1 -1
  116. package/dist/types/common/fab/fab.types.d.ts +6 -1
  117. package/dist/types/common/hooks/useAnchorTracking.d.ts +1 -1
  118. package/dist/types/common/hooks/useFocusBoundary.d.ts +3 -3
  119. package/dist/types/common/hooks/useSheet.d.ts +1 -1
  120. package/dist/types/common/infiniteBlock/infiniteBlock.d.ts +1 -1
  121. package/dist/types/common/infiniteBlock/infiniteBlock.types.d.ts +2 -0
  122. package/dist/types/common/menu/index.d.ts +2 -0
  123. package/dist/types/common/menu/menu.d.ts +14 -0
  124. package/dist/types/common/menu/menu.types.d.ts +55 -0
  125. package/dist/types/common/modal/modal.types.d.ts +1 -1
  126. package/dist/types/common/multiSelect/multiSelect.types.d.ts +1 -1
  127. package/dist/types/common/numberInput/numberInput.types.d.ts +6 -0
  128. package/dist/types/common/popover/popover.types.d.ts +34 -3
  129. package/dist/types/common/popover/usePopoverPosition.d.ts +20 -1
  130. package/dist/types/common/progressBar/progressBar.d.ts +1 -1
  131. package/dist/types/common/progressBar/progressBar.types.d.ts +6 -1
  132. package/dist/types/common/searchInput/searchInput.d.ts +1 -1
  133. package/dist/types/common/searchInput/searchInput.types.d.ts +13 -1
  134. package/dist/types/common/splitButton/splitButton.types.d.ts +3 -3
  135. package/dist/types/index.d.ts +2 -2
  136. package/docs/Breadcrumb.md +2 -2
  137. package/docs/ButtonGroup.md +1 -1
  138. package/docs/CLAUDE.md +1 -1
  139. package/docs/Card.md +3 -1
  140. package/docs/Chip.md +2 -0
  141. package/docs/ColorPicker.md +4 -0
  142. package/docs/ConfigProvider.md +2 -2
  143. package/docs/DatePicker.md +4 -0
  144. package/docs/Drawer.md +2 -0
  145. package/docs/Dropdown.md +3 -1
  146. package/docs/EmptyState.md +2 -0
  147. package/docs/Fab.md +2 -0
  148. package/docs/InputDropdown.md +1 -1
  149. package/docs/InteractableDiv.md +2 -0
  150. package/docs/Menu.md +107 -0
  151. package/docs/Modal.md +1 -1
  152. package/docs/NumberInput.md +4 -0
  153. package/docs/Popover.md +11 -5
  154. package/docs/ProgressBar.md +2 -0
  155. package/docs/SearchInput.md +4 -0
  156. package/docs/SplitButton.md +8 -4
  157. package/docs/ThemeProvider.md +1 -1
  158. package/docs/VirtualList.md +2 -2
  159. package/package.json +1 -1
  160. package/dist/esm/common/floatingMenu/floatingMenu.mjs +0 -2
  161. package/dist/esm/common/floatingMenu/floatingMenu.mjs.map +0 -1
  162. package/dist/esm/common/floatingMenu/floatingMenu.module.mjs +0 -2
  163. package/dist/esm/common/floatingMenu/floatingMenu.module.mjs.map +0 -1
  164. package/dist/esm/common/floatingMenu/floatingMenu.types.mjs +0 -2
  165. package/dist/esm/common/floatingMenu/floatingMenu.types.mjs.map +0 -1
  166. package/dist/esm/common/floatingMenu/useFloatingPosition.mjs +0 -2
  167. package/dist/esm/common/floatingMenu/useFloatingPosition.mjs.map +0 -1
  168. package/dist/types/common/floatingMenu/floatingMenu.d.ts +0 -3
  169. package/dist/types/common/floatingMenu/floatingMenu.types.d.ts +0 -32
  170. package/dist/types/common/floatingMenu/index.d.ts +0 -2
  171. package/dist/types/common/floatingMenu/useFloatingPosition.d.ts +0 -27
  172. package/docs/FloatingMenu.md +0 -90
@@ -1,12 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonStyleType } from '../button/button.types';
3
- import { HtmlProps } from '../types/slots.types';
3
+ import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
4
4
  import { IconAction } from '../types/actions.types';
5
5
  export declare enum CardStyleType {
6
6
  Elevated = "elevated",
7
7
  Outlined = "outlined",
8
8
  Filled = "filled"
9
9
  }
10
+ export type CardSlots = 'root' | 'content';
10
11
  export interface CardProps extends Omit<HtmlProps, 'tabIndex'> {
11
12
  className?: string | undefined;
12
13
  children?: ReactNode;
@@ -17,6 +18,10 @@ export interface CardProps extends Omit<HtmlProps, 'tabIndex'> {
17
18
  style?: React.CSSProperties;
18
19
  autoGap?: boolean;
19
20
  clip?: boolean;
21
+ /** Classes for the inner elements. See `CardSlots`. */
22
+ classNames?: SlotClassNames<CardSlots>;
23
+ /** Inline styles for the inner elements. See `CardSlots`. */
24
+ styles?: SlotStyles<CardSlots>;
20
25
  }
21
26
  export type CardHeaderAction = IconAction;
22
27
  export interface CardHeaderProps {
@@ -1,4 +1,4 @@
1
- import { HtmlProps } from '../types/slots.types';
1
+ import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
2
2
  export declare enum ChipStyleType {
3
3
  Default = "default",
4
4
  Primary = "primary",
@@ -11,6 +11,7 @@ export interface ChipLabels {
11
11
  /** The remove button, read out by screen readers (default `Remove`). */
12
12
  remove?: string;
13
13
  }
14
+ export type ChipSlots = 'root' | 'inner' | 'thumbnail' | 'text' | 'removeIcon';
14
15
  export interface ChipProps extends HtmlProps {
15
16
  className?: string;
16
17
  text?: string;
@@ -22,6 +23,10 @@ export interface ChipProps extends HtmlProps {
22
23
  onRemove?: () => void;
23
24
  /** Overrides the text Chip renders of its own. Merged per key. */
24
25
  labels?: ChipLabels;
26
+ /** Classes for the inner elements. See `ChipSlots`. */
27
+ classNames?: SlotClassNames<ChipSlots>;
28
+ /** Inline styles for the inner elements. See `ChipSlots`. */
29
+ styles?: SlotStyles<ChipSlots>;
25
30
  }
26
31
  export interface ChipContainerProps extends HtmlProps {
27
32
  className?: string;
@@ -1,4 +1,4 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ColorPickerProps } from './colorPicker.types';
3
- declare function ColorPicker({ className, value, onChange, showInput, showAlpha, inline, labels, ...rest }: ColorPickerProps): ReactElement;
3
+ declare function ColorPicker({ className, value, onChange, showInput, showAlpha, inline, labels, style, classNames, styles: slotStyles, ...rest }: ColorPickerProps): ReactElement;
4
4
  export default ColorPicker;
@@ -1,4 +1,5 @@
1
- import { HtmlProps } from '../types/slots.types';
1
+ import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
2
+ export type ColorPickerSlots = 'root' | 'swatch' | 'panel' | 'gradient' | 'hueSlider' | 'alphaSlider' | 'hexInput' | 'eyeDropper';
2
3
  /** Text ColorPicker renders of its own, for translating it. */
3
4
  export interface ColorPickerLabels {
4
5
  /** The eyedropper button, read out by screen readers. */
@@ -13,4 +14,8 @@ export interface ColorPickerProps extends Omit<HtmlProps, 'onChange'> {
13
14
  inline?: boolean;
14
15
  /** Overrides the text ColorPicker renders of its own. Merged per key. */
15
16
  labels?: ColorPickerLabels;
17
+ /** Classes for the inner elements. See `ColorPickerSlots`. */
18
+ classNames?: SlotClassNames<ColorPickerSlots>;
19
+ /** Inline styles for the inner elements. See `ColorPickerSlots`. */
20
+ styles?: SlotStyles<ColorPickerSlots>;
16
21
  }
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { ComponentDefaults, ConfigProviderProps } from './configProvider.types';
3
- import { Presentation } from '../floatingMenu/floatingMenu.types';
3
+ import { Presentation } from '../configProvider/presentation.types';
4
4
  export declare const ConfigContext: React.Context<ComponentDefaults | null>;
5
5
  /**
6
6
  * One setting for every component that can present as a bottom sheet, kept separate from
@@ -11,6 +11,7 @@ import { DatePickerProps } from '../datePicker/datePicker.types';
11
11
  import { ColorPickerLabels } from '../colorPicker/colorPicker.types';
12
12
  import { EmptyStateLabels } from '../emptyState/emptyState.types';
13
13
  import { KlipyPickerLabels } from '../klipyPicker/klipyPicker.types';
14
+ import { SearchInputLabels } from '../searchInput/searchInput.types';
14
15
  import { VirtualListLabels } from '../virtualList/virtualList.types';
15
16
  import { ButtonProps } from '../button/button.types';
16
17
  import { ActionButtonsProps } from '../actionButtons/actionButtons.types';
@@ -38,9 +39,9 @@ import { PaginationProps } from '../pagination/pagination.types';
38
39
  import { TreeProps } from '../tree/tree.types';
39
40
  import { RoomDrawerProps } from '../roomDrawer/roomDrawer.types';
40
41
  import { RoomViewerProps } from '../roomViewer/roomViewer.types';
41
- import { FloatingMenuProps, Presentation } from '../floatingMenu/floatingMenu.types';
42
42
  import { PopoverProps } from '../popover/popover.types';
43
43
  import { ModalProps } from '../modal/modal.types';
44
+ import { Presentation } from '../configProvider/presentation.types';
44
45
  /**
45
46
  * Global default props keyed by component name.
46
47
  *
@@ -70,6 +71,9 @@ export interface ComponentDefaults {
70
71
  KlipyPicker?: {
71
72
  labels?: KlipyPickerLabels;
72
73
  };
74
+ SearchInput?: {
75
+ labels?: SearchInputLabels;
76
+ };
73
77
  VirtualList?: {
74
78
  labels?: VirtualListLabels;
75
79
  };
@@ -108,7 +112,6 @@ export interface ComponentDefaults {
108
112
  Tree?: Partial<TreeProps>;
109
113
  RoomDrawer?: Partial<RoomDrawerProps>;
110
114
  RoomViewer?: Partial<RoomViewerProps>;
111
- FloatingMenu?: Partial<FloatingMenuProps>;
112
115
  Popover?: Partial<PopoverProps>;
113
116
  Modal?: Partial<ModalProps>;
114
117
  }
@@ -118,7 +121,7 @@ export interface ConfigProviderProps {
118
121
  defaultProps?: ComponentDefaults;
119
122
  /**
120
123
  * How every sheet-capable component presents by default: anchored to its trigger, always a
121
- * bottom sheet, or a sheet only on a small touch screen. One switch for `FloatingMenu`,
124
+ * bottom sheet, or a sheet only on a small touch screen. One switch for `Popover`,
122
125
  * `Dropdown`, `Popover` and `Modal` at once (and so for everything built on them). A
123
126
  * component-keyed entry in `defaultProps` overrides it, and an explicit prop overrides both.
124
127
  */
@@ -3,3 +3,4 @@ export { useComponentDefaults } from './useComponentDefaults';
3
3
  export { useLabels } from './useLabels';
4
4
  export { usePresentationDefault } from './usePresentationDefault';
5
5
  export type { ComponentDefaults, ConfigProviderProps } from './configProvider.types';
6
+ export { Presentation } from './presentation.types';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * How a surface is presented on screen. Lives here rather than with any one of
3
+ * the components that read it: `Modal`, `Popover`, `Dropdown` and `MultiSelect`
4
+ * all take it, and `ConfigProvider` owns the app-wide switch that sets it for
5
+ * every one of them at once.
6
+ */
7
+ export declare enum Presentation {
8
+ /** Wherever the component normally puts it: anchored to its trigger, or centred for a Modal. */
9
+ Default = "default",
10
+ /** Pinned to the bottom of the screen, full width up to a maximum. */
11
+ Sheet = "sheet",
12
+ /** A sheet on touch devices with a small screen, anchored everywhere else. */
13
+ Auto = "auto"
14
+ }
@@ -1,4 +1,4 @@
1
- import { Presentation } from '../floatingMenu/floatingMenu.types';
1
+ import { Presentation } from '../configProvider/presentation.types';
2
2
  /**
3
3
  * The nearest `ConfigProvider`'s app-wide `presentation`, or `undefined` when none is set.
4
4
  *
@@ -1,4 +1,5 @@
1
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { HtmlProps } from '../types/slots.types';
2
3
  import { ActionButtonsProps } from '../actionButtons';
3
4
  /** Text ConfirmModal renders of its own, for translating it. */
4
5
  export interface ConfirmModalLabels {
@@ -7,9 +8,10 @@ export interface ConfirmModalLabels {
7
8
  /** The dismissing button (default `Cancel`). */
8
9
  cancel?: string;
9
10
  }
10
- export interface ConfirmModalProps {
11
+ export interface ConfirmModalProps extends Omit<HtmlProps<HTMLDivElement>, 'onClose' | 'content' | 'title'> {
11
12
  children?: ReactNode;
12
13
  className?: string;
14
+ style?: CSSProperties;
13
15
  onClose?: (didSubmit: boolean) => void;
14
16
  onConfirm?: () => void | Promise<void>;
15
17
  title?: string;
@@ -1,2 +1,2 @@
1
1
  import { DatePickerMonthProps } from './datePickerMonth.types';
2
- export default function DatePickerMonth({ className, month, year, onSelect, selectionStart, selectionEnd, minDate, maxDate, onNavigateMonth, }: DatePickerMonthProps): import("react").JSX.Element;
2
+ export default function DatePickerMonth({ style, className, month, year, onSelect, selectionStart, selectionEnd, minDate, maxDate, onNavigateMonth, }: DatePickerMonthProps): import("react").JSX.Element;
@@ -1,6 +1,9 @@
1
+ import { CSSProperties } from 'react';
1
2
  export interface DatePickerMonthProps {
2
3
  /** Class on the root element. */
3
4
  className?: string;
5
+ /** Inline style on the root element, forwarded from DatePicker's `calendar` slot. */
6
+ style?: CSSProperties;
4
7
  /** Month to display, 1 to 12. */
5
8
  month?: number;
6
9
  /** Year to display. */
@@ -1,8 +1,17 @@
1
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  import { FormValidator } from '../../services/formValidation';
3
- export interface DatePickerProps {
3
+ import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
4
+ export type DatePickerSlots = 'root' | 'input' | 'header' | 'monthDropdown' | 'yearDropdown' | 'calendar' | 'clearButton';
5
+ /**
6
+ * `onChange` and `onSelect` report a date rather than a DOM event, so the native
7
+ * handlers of those names are dropped instead of being widened to accept both.
8
+ */
9
+ export interface DatePickerProps extends Omit<HtmlProps<HTMLDivElement>, 'onChange' | 'onSelect'> {
4
10
  /** Class on the root element. */
5
11
  className?: string;
12
+ style?: CSSProperties;
13
+ classNames?: SlotClassNames<DatePickerSlots>;
14
+ styles?: SlotStyles<DatePickerSlots>;
6
15
  /** Selected date, controlled. Ignored while a `formValidator` owns the value. */
7
16
  selected?: Date;
8
17
  /** Floating label on the input. */
@@ -1,4 +1,4 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { DrawerProps } from './drawer.types';
3
- declare function Drawer({ className, isOpen, closedWidth, openedWidth, children }: DrawerProps): ReactElement;
3
+ declare function Drawer({ className, isOpen, closedWidth, openedWidth, children, style, classNames, styles: slotStyles, ...rest }: DrawerProps): ReactElement;
4
4
  export default Drawer;
@@ -1,5 +1,11 @@
1
- export interface DrawerProps {
1
+ import { CSSProperties } from 'react';
2
+ import { HtmlProps, SlotClassNames, SlotStyles } from '../types/slots.types';
3
+ export type DrawerSlots = 'root' | 'content' | 'inner';
4
+ export interface DrawerProps extends HtmlProps<HTMLDivElement> {
2
5
  className?: string;
6
+ style?: CSSProperties;
7
+ classNames?: SlotClassNames<DrawerSlots>;
8
+ styles?: SlotStyles<DrawerSlots>;
3
9
  isOpen?: boolean;
4
10
  /** Width of the container when closed. Defaults to 0. Any CSS length value, e.g. '48px'. */
5
11
  closedWidth?: string;
@@ -1,12 +1,13 @@
1
+ import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
1
2
  import { ReactNode, Ref } from 'react';
2
3
  import { FormValidator } from '../../services/formValidation';
3
- import { HtmlProps } from '../types/slots.types';
4
- import { Presentation } from '../floatingMenu/floatingMenu.types';
4
+ import { Presentation } from '../configProvider/presentation.types';
5
5
  export interface DropdownItem {
6
6
  key: string | number;
7
7
  label: ReactNode;
8
8
  disabled?: boolean;
9
9
  }
10
+ export type DropdownSlots = 'root' | 'label' | 'field' | 'control' | 'icon' | 'placeholder' | 'list' | 'option';
10
11
  export interface DropdownProps extends Omit<HtmlProps, 'onFocus' | 'onBlur' | 'onMouseEnter' | 'onMouseLeave'> {
11
12
  formValidator?: FormValidator | null;
12
13
  onMouseEnter?: ((event: React.MouseEvent) => void) | null;
@@ -33,15 +34,14 @@ export interface DropdownProps extends Omit<HtmlProps, 'onFocus' | 'onBlur' | 'o
33
34
  /** Where the list opens: anchored to the input (`Default`), pinned to the bottom of the
34
35
  * screen, or the latter only on a small touch screen. */
35
36
  presentation?: Presentation;
36
- inputClassName?: string;
37
- dropDownIconClassName?: string;
38
- dropDownClassName?: string;
39
- labelClassName?: string;
40
- dropDownInputClassName?: string;
41
37
  useMatLabelStyle?: boolean;
42
38
  alwaysFloatLabel?: boolean;
43
39
  placeholder?: string;
44
40
  plainStyle?: boolean;
45
41
  scrollToSelected?: boolean;
46
42
  reactRef?: Ref<HTMLButtonElement>;
43
+ /** Classes for the inner elements. See `DropdownSlots`. */
44
+ classNames?: SlotClassNames<DropdownSlots>;
45
+ /** Inline styles for the inner elements. See `DropdownSlots`. */
46
+ styles?: SlotStyles<DropdownSlots>;
47
47
  }
@@ -1,3 +1,3 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { EmptyStateProps } from './emptyState.types';
3
- export default function EmptyState({ className, icon, children, labels, ...rest }: EmptyStateProps): ReactElement;
3
+ export default function EmptyState({ className, icon, children, labels, style, classNames, styles: slotStyles, ...rest }: EmptyStateProps): ReactElement;
@@ -1,6 +1,7 @@
1
+ import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
1
2
  import { ReactNode } from 'react';
2
3
  import { IconContent } from '../types/icon.types';
3
- import { HtmlProps } from '../types/slots.types';
4
+ export type EmptyStateSlots = 'root' | 'icon' | 'text';
4
5
  /** Text EmptyState renders of its own, for translating it. */
5
6
  export interface EmptyStateLabels {
6
7
  /** Shown when no `children` are given. */
@@ -12,4 +13,8 @@ export interface EmptyStateProps extends HtmlProps {
12
13
  children?: ReactNode;
13
14
  /** Overrides the text EmptyState renders of its own. Merged per key. */
14
15
  labels?: EmptyStateLabels;
16
+ /** Classes for the inner elements. See `EmptyStateSlots`. */
17
+ classNames?: SlotClassNames<EmptyStateSlots>;
18
+ /** Inline styles for the inner elements. See `EmptyStateSlots`. */
19
+ styles?: SlotStyles<EmptyStateSlots>;
15
20
  }
@@ -1,3 +1,3 @@
1
1
  import { FabBaseProps } from './fabBase.types';
2
- declare function FabBase({ children, size, className, styleType, onClick, }: FabBaseProps): import("react").JSX.Element;
2
+ declare function FabBase({ style, children, size, className, styleType, onClick, }: FabBaseProps): import("react").JSX.Element;
3
3
  export default FabBase;
@@ -1,10 +1,12 @@
1
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  import { ButtonStyleType } from '../../../button/button.types';
3
3
  export type FabBaseSize = 'default' | 'mini';
4
4
  export interface FabBaseProps {
5
5
  children?: ReactNode;
6
6
  size?: FabBaseSize;
7
7
  className?: string;
8
+ /** Forwarded from Fab's `button` slot. */
9
+ style?: CSSProperties;
8
10
  styleType?: ButtonStyleType;
9
11
  onClick?: () => void;
10
12
  }
@@ -1,3 +1,3 @@
1
1
  import { FabProps } from './fab.types';
2
- declare function Fab({ children, size, menuEntries, onMenuEntryClicked, onClick, closeMenuOnEntryClicked, ...rest }: FabProps): import("react").JSX.Element;
2
+ declare function Fab({ children, size, menuEntries, onMenuEntryClicked, onClick, closeMenuOnEntryClicked, className, style, classNames, styles: slotStyles, ...rest }: FabProps): import("react").JSX.Element;
3
3
  export default Fab;
@@ -1,12 +1,13 @@
1
+ import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
1
2
  import { ReactNode } from 'react';
2
3
  import { IconContent } from '../types/icon.types';
3
- import { HtmlProps } from '../types/slots.types';
4
4
  export type FabSize = 'default' | 'mini';
5
5
  export interface FabMenuEntry {
6
6
  id: string;
7
7
  icon: IconContent;
8
8
  label?: string;
9
9
  }
10
+ export type FabSlots = 'root' | 'backdrop' | 'button' | 'icon' | 'menu' | 'menuEntry' | 'menuEntryLabel';
10
11
  export interface FabProps extends HtmlProps {
11
12
  children?: ReactNode;
12
13
  size?: FabSize;
@@ -14,4 +15,8 @@ export interface FabProps extends HtmlProps {
14
15
  onMenuEntryClicked?: (id: string) => void;
15
16
  onClick?: () => void;
16
17
  closeMenuOnEntryClicked?: boolean;
18
+ /** Classes for the inner elements. See `FabSlots`. */
19
+ classNames?: SlotClassNames<FabSlots>;
20
+ /** Inline styles for the inner elements. See `FabSlots`. */
21
+ styles?: SlotStyles<FabSlots>;
17
22
  }
@@ -31,7 +31,7 @@ export interface UseAnchorTrackingArgs {
31
31
  * positioning on every scroll, viewport resize and tracked size change until it closes.
32
32
  *
33
33
  * Callers supply only the geometry (`update`) and the inline styles to clear again (`teardown`);
34
- * `useFloatingPosition` and `usePopoverPosition` are both built on this.
34
+ * `usePopoverPosition` is built on this.
35
35
  *
36
36
  * Position is deliberately written straight to the DOM by the caller rather than through React
37
37
  * state: going through setState -> re-render -> commit adds a round-trip that lags behind the
@@ -9,9 +9,9 @@ export interface UseFocusBoundaryArgs {
9
9
  }
10
10
  /**
11
11
  * Focus helpers for content portaled to the end of the DOM (e.g. via BodyEnd), where Tab can't
12
- * reach it in visual document order on its own. Shared by FloatingMenu and Popover, which both
13
- * need to hand focus back to the trigger on Escape / Shift+Tab out of the top, and continue
14
- * focus naturally past the trigger when Tab exits the bottom.
12
+ * reach it in visual document order on its own. Used by Popover and by Menu, which both need to
13
+ * hand focus back to the trigger on Escape / Shift+Tab out of the top, and continue focus
14
+ * naturally past the trigger when Tab exits the bottom.
15
15
  */
16
16
  export declare function useFocusBoundary({ triggerRef, contentRef }: UseFocusBoundaryArgs): {
17
17
  firstTriggerFocusable: () => HTMLElement | null;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from 'react';
2
- import { Presentation } from '../floatingMenu/floatingMenu.types';
2
+ import { Presentation } from '../configProvider/presentation.types';
3
3
  export interface Sheet {
4
4
  /** Whether the popup should render as a bottom sheet instead of anchored to its trigger. */
5
5
  isSheet: boolean;
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { InfiniteBlockProps } from './infiniteBlock.types';
3
- declare function InfiniteBlock({ children, onScroll, className, isDataLoading, setHighlightedIndex, }: InfiniteBlockProps): React.JSX.Element;
3
+ declare function InfiniteBlock({ children, onScroll, className, style, isDataLoading, setHighlightedIndex, }: InfiniteBlockProps): React.JSX.Element;
4
4
  export default InfiniteBlock;
@@ -4,6 +4,8 @@ export interface InfiniteBlockProps {
4
4
  /** Called when the user scrolls to the bottom; must return a Promise that resolves when the new data has loaded. */
5
5
  onScroll: () => Promise<void>;
6
6
  className?: string;
7
+ /** Inline style on the scroll container. */
8
+ style?: React.CSSProperties;
7
9
  /** Replaces children with a full-block spinner (initial load). */
8
10
  isDataLoading?: boolean;
9
11
  /** Called with the newly highlighted child index after keyboard navigation. */
@@ -0,0 +1,2 @@
1
+ export { default } from './menu';
2
+ export * from './menu.types';
@@ -0,0 +1,14 @@
1
+ import { ReactElement } from 'react';
2
+ import { MenuProps } from './menu.types';
3
+ /**
4
+ * A menu of actions on a trigger of your choosing.
5
+ *
6
+ * `Popover` does the anchoring, portalling and outside-click work but takes
7
+ * arbitrary `content`, which leaves every consumer to write their own `ul`/`li`
8
+ * and, in practice, to leave out the roles and the arrow keys. This is that list,
9
+ * done once: `role="menu"`, a roving focus that skips disabled entries, Escape
10
+ * back to the trigger, and separators and headings that stay out of the keyboard
11
+ * order.
12
+ */
13
+ declare function Menu({ items, children, onAction, isOpen: controlledOpen, onOpenChange, placement, align, presentation, className, style, classNames, styles: slotStyles, ...rest }: MenuProps): ReactElement;
14
+ export default Menu;
@@ -0,0 +1,55 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
3
+ import { IconContent } from '../types/icon.types';
4
+ import { PopoverAlign, PopoverPlacement } from '../popover/popover.types';
5
+ import { Presentation } from '../configProvider/presentation.types';
6
+ /** One thing the menu can do. */
7
+ export interface MenuAction {
8
+ /** Stable id, also what `onAction` reports. */
9
+ id: string;
10
+ label: ReactNode;
11
+ icon?: IconContent;
12
+ /**
13
+ * Keyboard hint on the trailing edge, e.g. `⌘K`. Display only: binding the
14
+ * shortcut is yours, since only you know what else is listening.
15
+ */
16
+ shortcut?: ReactNode;
17
+ disabled?: boolean;
18
+ /** Renders in the destructive colour. For deleting, discarding, revoking. */
19
+ danger?: boolean;
20
+ onClick?: () => void;
21
+ }
22
+ /** A line between groups of actions. */
23
+ export interface MenuSeparator {
24
+ separator: true;
25
+ }
26
+ /** A label over the actions that follow it. */
27
+ export interface MenuHeading {
28
+ heading: ReactNode;
29
+ }
30
+ export type MenuEntry = MenuAction | MenuSeparator | MenuHeading;
31
+ export declare function isMenuSeparator(entry: MenuEntry): entry is MenuSeparator;
32
+ export declare function isMenuHeading(entry: MenuEntry): entry is MenuHeading;
33
+ export declare function isMenuAction(entry: MenuEntry): entry is MenuAction;
34
+ export type MenuSlots = 'root' | 'trigger' | 'menu' | 'item' | 'itemIcon' | 'itemLabel' | 'itemShortcut' | 'separator' | 'heading';
35
+ export interface MenuProps extends Omit<HtmlProps, 'onSelect'> {
36
+ /** What the menu offers, in the order it is read. */
37
+ items: MenuEntry[];
38
+ /** The element that opens the menu. */
39
+ children?: ReactNode;
40
+ /** Called with the id of the action that was picked, after its own `onClick`. */
41
+ onAction?: (id: string) => void;
42
+ /** Controlled open state. Leave it out to let the menu manage its own. */
43
+ isOpen?: boolean;
44
+ onOpenChange?: (isOpen: boolean) => void;
45
+ /** Which side of the trigger the menu opens on (default `Bottom`). */
46
+ placement?: PopoverPlacement;
47
+ /** Which edge it lines up with on the cross axis (default `Start`). */
48
+ align?: PopoverAlign;
49
+ /** Anchored to the trigger, pinned to the bottom of the screen, or the latter only on touch. */
50
+ presentation?: Presentation;
51
+ className?: string;
52
+ style?: CSSProperties;
53
+ classNames?: SlotClassNames<MenuSlots>;
54
+ styles?: SlotStyles<MenuSlots>;
55
+ }
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
3
- import { Presentation } from '../floatingMenu/floatingMenu.types';
3
+ import { Presentation } from '../configProvider/presentation.types';
4
4
  export type ModalSlots = 'container' | 'backdrop' | 'modal' | 'header' | 'title' | 'closeButton' | 'body';
5
5
  /** Text Modal renders of its own, for translating it. */
6
6
  export interface ModalLabels {
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { FormValidator } from '../../services/formValidation';
3
3
  import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
4
- import { Presentation } from '../floatingMenu/floatingMenu.types';
4
+ import { Presentation } from '../configProvider/presentation.types';
5
5
  export type MultiSelectValue = string | number;
6
6
  export interface MultiSelectItem {
7
7
  key: MultiSelectValue;
@@ -1,6 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { NumericFormatProps } from 'react-number-format';
3
3
  import { FormValidator } from '../../services/formValidation';
4
+ import { SlotClassNames, SlotStyles } from '../types/slots.types';
4
5
  /**
5
6
  * How the stepper buttons are laid out.
6
7
  *
@@ -17,6 +18,7 @@ export interface NumberInputLabels {
17
18
  /** The step-down button, read out by screen readers (default `Decrease`). */
18
19
  decrease?: string;
19
20
  }
21
+ export type NumberInputSlots = 'root' | 'input' | 'arrows' | 'increaseButton' | 'decreaseButton';
20
22
  export interface NumberInputProps extends Omit<NumericFormatProps, 'onValueChange' | 'value' | 'customInput' | 'onChange' | 'step' | 'onKeyDown' | 'min' | 'max'> {
21
23
  value?: number | string;
22
24
  onChange?: (value: number | undefined) => void;
@@ -65,4 +67,8 @@ export interface NumberInputProps extends Omit<NumericFormatProps, 'onValueChang
65
67
  onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
66
68
  /** Overrides the text NumberInput renders of its own. Merged per key. */
67
69
  labels?: NumberInputLabels;
70
+ /** Classes for the inner elements. See `NumberInputSlots`. */
71
+ classNames?: SlotClassNames<NumberInputSlots>;
72
+ /** Inline styles for the inner elements. See `NumberInputSlots`. */
73
+ styles?: SlotStyles<NumberInputSlots>;
68
74
  }
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';
3
- import { Presentation } from '../floatingMenu/floatingMenu.types';
3
+ import { Presentation } from '../configProvider/presentation.types';
4
4
  /** Preferred side of the trigger the panel opens on. Flips to the opposite side when there's no room. */
5
5
  export declare enum PopoverPlacement {
6
6
  Top = "top",
@@ -36,8 +36,14 @@ export interface PopoverProps extends Omit<HtmlProps, 'content'> {
36
36
  isOpen?: boolean;
37
37
  /** Initial open state when uncontrolled (default `false`). */
38
38
  defaultOpen?: boolean;
39
- /** Fires whenever the popover wants to open or close. */
40
- onOpenChange?: (isOpen: boolean) => void;
39
+ /**
40
+ * Fires whenever the popover wants to open or close. `fromKeyboard` says
41
+ * whether a key caused it, which is what a menu needs in order to put the
42
+ * focus on an entry only when the pointer was not what opened it.
43
+ */
44
+ onOpenChange?: (isOpen: boolean, meta: {
45
+ fromKeyboard: boolean;
46
+ }) => void;
41
47
  /** Gap in px between trigger and panel (default `10`). */
42
48
  offset?: number;
43
49
  /** Render the arrow pointing at the trigger (default `true`). */
@@ -52,6 +58,31 @@ export interface PopoverProps extends Omit<HtmlProps, 'content'> {
52
58
  closeDelay?: number;
53
59
  /** Prevent the popover from opening. */
54
60
  disabled?: boolean;
61
+ /**
62
+ * Move focus into the panel when it opens, and claim `role="dialog"` with it.
63
+ * `'keyboard'` (the default) does it only when the open came from the
64
+ * keyboard: the panel is portaled to the end of the document, so Tab never
65
+ * reaches it on its own, while a click leaves the focus where the pointer
66
+ * already put it. `true` always, `false` never.
67
+ */
68
+ focusOnOpen?: boolean | 'keyboard';
69
+ /**
70
+ * Whether clicking the trigger while the panel is open closes it (default
71
+ * `true`). A menu button should toggle; a text field that opens a picker
72
+ * should not, or clicking into it to place the caret would close the panel.
73
+ */
74
+ closeOnTriggerClick?: boolean;
75
+ /**
76
+ * `'trigger'` gives the panel at least the trigger's width, for a list that
77
+ * should line up with the field it belongs to. `'auto'` (the default) lets it
78
+ * size to its own content.
79
+ */
80
+ width?: 'auto' | 'trigger';
81
+ /**
82
+ * Cap the panel at a readable measure (default `true`). Off for a panel with
83
+ * its own width, a calendar or a media grid.
84
+ */
85
+ constrainWidth?: boolean;
55
86
  /** Where the panel opens: anchored to the trigger (`Default`), pinned to the bottom of the
56
87
  * screen, or the latter only on a small touch screen. Only a `Click` trigger presents as a
57
88
  * sheet. */
@@ -12,6 +12,25 @@ export interface UsePopoverPositionArgs {
12
12
  panelRef: RefObject<HTMLElement | null>;
13
13
  /** Arrow element; gets `--arrow-x` / `--arrow-y` written to it. Pass a null ref when `withArrow` is false. */
14
14
  arrowRef: RefObject<HTMLElement | null>;
15
+ /**
16
+ * Give the panel at least the trigger's width, for a list that lines up with
17
+ * the field it belongs to. A minimum rather than a fixed width: a menu on a
18
+ * narrow icon button still sizes to its own content.
19
+ */
20
+ matchTriggerWidth?: boolean;
21
+ /**
22
+ * When the panel does not fit on the side its alignment puts it, narrow it
23
+ * rather than sliding it away from the trigger. Sliding keeps the panel
24
+ * on-screen but detaches it: an end-aligned bubble stops ending where its
25
+ * trigger ends, and its arrow stops pointing at anything. Off by default, since
26
+ * a panel whose width is its content, a menu or a list, would rather overhang
27
+ * its trigger than wrap.
28
+ *
29
+ * Only down to `MIN_SHRINK_WIDTH`. Past that the panel is narrower than it is
30
+ * readable, and a trigger that close to the screen edge is better served by a
31
+ * panel that overhangs it.
32
+ */
33
+ shrinkToFit?: boolean;
15
34
  }
16
35
  /**
17
36
  * Positions a portaled, `position: fixed` popover on any of the four sides of its trigger with
@@ -22,4 +41,4 @@ export interface UsePopoverPositionArgs {
22
41
  * `useAnchorTracking` supplies the lifecycle around this: mount wait, ancestor resolution, and
23
42
  * re-running on scroll, viewport resize and panel size changes.
24
43
  */
25
- export declare function usePopoverPosition({ isOpen, placement, align, offset, triggerRef, floatingRef, panelRef, arrowRef, }: UsePopoverPositionArgs): void;
44
+ export declare function usePopoverPosition({ isOpen, placement, align, offset, triggerRef, floatingRef, panelRef, arrowRef, matchTriggerWidth, shrinkToFit, }: UsePopoverPositionArgs): void;
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ProgressBarProps } from './progressBar.types';
3
3
  export declare function getContrastColor(hexColor: string): string;
4
- declare function ProgressBar({ className, total, progress, style, ...rest }: ProgressBarProps): ReactElement;
4
+ declare function ProgressBar({ className, total, progress, style, classNames, styles: slotStyles, ...rest }: ProgressBarProps): ReactElement;
5
5
  export default ProgressBar;