@splunk/react-ui 4.39.0 → 4.40.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 (54) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/Card.js +3 -1
  3. package/Chip.js +133 -125
  4. package/ControlGroup.js +27 -30
  5. package/MIGRATION.mdx +31 -0
  6. package/Message.js +136 -123
  7. package/Multiselect.js +3147 -3130
  8. package/Number.js +23 -18
  9. package/Popover.js +2 -1
  10. package/Select.js +2072 -2064
  11. package/SplitButton.d.ts +2 -0
  12. package/TabBar.js +15 -12
  13. package/TabLayout.js +8 -2
  14. package/Table.js +229 -224
  15. package/WaitSpinner.js +1 -1
  16. package/package.json +2 -2
  17. package/types/src/Card/Card.d.ts +1 -0
  18. package/types/src/Card/Footer.d.ts +1 -0
  19. package/types/src/Chip/Chip.d.ts +3 -6
  20. package/types/src/ComboBox/ComboBox.d.ts +1 -1
  21. package/types/src/Multiselect/Compact.d.ts +1 -1
  22. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  23. package/types/src/Multiselect/Normal.d.ts +1 -1
  24. package/types/src/Select/Select.d.ts +3 -1
  25. package/types/src/Select/SelectAllOption.d.ts +2 -2
  26. package/types/src/Select/SelectBase.d.ts +104 -66
  27. package/types/src/Select/docs/examples/Appearance.d.ts +0 -2
  28. package/types/src/Table/Cell.d.ts +0 -2
  29. package/types/src/Table/HeadInner.d.ts +5 -1
  30. package/types/src/WaitSpinner/WaitSpinner.d.ts +0 -1
  31. package/types/src/useControlled/index.d.ts +2 -0
  32. package/types/src/useControlled/useControlled.d.ts +21 -0
  33. package/types/src/useResizeObserver/index.d.ts +2 -0
  34. package/types/src/useResizeObserver/useResizeObserver.d.ts +12 -0
  35. package/useControlled.js +112 -0
  36. package/useKeyPress.d.ts +2 -0
  37. package/useResizeObserver.d.ts +2 -0
  38. package/useResizeObserver.js +137 -0
  39. package/types/src/Chip/docs/examples/Basic.d.ts +0 -2
  40. package/types/src/Chip/docs/examples/prisma/Appearance.d.ts +0 -2
  41. package/types/src/Color/docs/examples/prisma/Controlled.d.ts +0 -2
  42. package/types/src/Color/docs/examples/prisma/ThemeVariables.d.ts +0 -1
  43. package/types/src/Color/docs/examples/prisma/Uncontrolled.d.ts +0 -2
  44. package/types/src/Dropdown/docs/examples/prisma/Basic.d.ts +0 -2
  45. package/types/src/Dropdown/docs/examples/prisma/BasicMenu.d.ts +0 -2
  46. package/types/src/Dropdown/docs/examples/prisma/ControlledDropdown.d.ts +0 -2
  47. package/types/src/Dropdown/docs/examples/prisma/Dialog.d.ts +0 -2
  48. package/types/src/Dropdown/docs/examples/prisma/OtherToggles.d.ts +0 -2
  49. package/types/src/Dropdown/docs/examples/prisma/ScrollingMenu.d.ts +0 -2
  50. package/types/src/File/docs/examples/prisma/Disabled.d.ts +0 -12
  51. package/types/src/Message/docs/examples/Title.d.ts +0 -2
  52. package/types/src/WaitSpinner/docs/examples/prisma/Basic.d.ts +0 -2
  53. /package/types/src/Color/docs/examples/{prisma/CustomizedPalette.d.ts → CustomizedPalette.d.ts} +0 -0
  54. /package/types/src/Color/docs/examples/{prisma/HideInput.d.ts → HideInput.d.ts} +0 -0
package/WaitSpinner.js CHANGED
@@ -99,7 +99,7 @@
99
99
  prisma: (0, c.css)([ "width:24px;height:24px;" ])
100
100
  },
101
101
  large: {
102
- enterprise: (0, c.css)([ "width:19px;height:19px;" ]),
102
+ enterprise: (0, c.css)([ "width:28px;height:28px;" ]),
103
103
  prisma: (0, c.css)([ "width:40px;height:40px;" ])
104
104
  }
105
105
  }), (function(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.39.0",
3
+ "version": "4.40.0",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -44,7 +44,7 @@
44
44
  "@dnd-kit/modifiers": "^7.0.0",
45
45
  "@dnd-kit/sortable": "^8.0.0",
46
46
  "@dnd-kit/utilities": "^3.2.2",
47
- "@splunk/react-icons": "^4.8.0",
47
+ "@splunk/react-icons": "^4.9.0",
48
48
  "@splunk/themes": "^0.22.0",
49
49
  "@splunk/ui-utils": "^1.7.1",
50
50
  "commonmark": "^0.30.0",
@@ -41,6 +41,7 @@ interface CardPropsBase {
41
41
  /**
42
42
  * Includes a border on the `Card` if set to `true`.
43
43
  * @excludeTheme prisma
44
+ * @deprecated
44
45
  * */
45
46
  showBorder?: boolean;
46
47
  /**
@@ -10,6 +10,7 @@ interface FooterPropsBase {
10
10
  /**
11
11
  * Shows top border of footer.
12
12
  * @excludeTheme prisma
13
+ * @deprecated
13
14
  * */
14
15
  showBorder?: boolean;
15
16
  }
@@ -9,13 +9,11 @@ interface ChipPropsBase {
9
9
  /**
10
10
  * Sets the severity or type of this `Chip`.
11
11
  * Setting this prop causes the `backgroundColor` prop to be ignored.
12
- * @themeNotes 'info', 'success', and 'warning' are supported in Enterprise only. 'outline' supported in Prisma only.
13
12
  */
14
13
  appearance?: 'info' | 'success' | 'warning' | 'error' | 'outline';
15
14
  /**
16
15
  * Changes the background color of the `Chip`.
17
- * Hexadecimal color and valid color names are allowed, such as `#ffffff` or `white`.
18
- * Invalid values will default to the 'default' appearance.
16
+ * Hexadecimal colors and valid color names are allowed, such as `#ffffff` or `white`.
19
17
  * If the `appearance` prop is set, this prop is ignored.
20
18
  */
21
19
  backgroundColor?: string;
@@ -26,8 +24,7 @@ interface ChipPropsBase {
26
24
  elementRef?: React.Ref<HTMLButtonElement | HTMLDivElement>;
27
25
  /**
28
26
  * Changes the text and icon color of the `Chip`.
29
- * Hexadecimal color and valid color names are allowed, such as `#ffffff` or `white`.
30
- * Invalid values will default to the 'default' appearance.
27
+ * Hexadecimal colors and valid color names are allowed, such as `#ffffff` or `white`.
31
28
  */
32
29
  foregroundColor?: string;
33
30
  /** The icon to show before the label. See the Icon component for more information. */
@@ -62,4 +59,4 @@ declare namespace Chip {
62
59
  };
63
60
  }
64
61
  export default Chip;
65
- export { ChipRequestRemoveHandler };
62
+ export { ChipInteractiveProps, ChipNonInteractiveProps, ChipRequestRemoveHandler };
@@ -156,7 +156,7 @@ declare class ComboBox extends Component<ComboBoxProps, ComboBoxState> {
156
156
  private previousActiveIndex;
157
157
  private textInput;
158
158
  static propTypes: React.WeakValidationMap<ComboBoxProps>;
159
- static defaultProps: Required<Pick<ComboBoxPropsBase, "placeholder" | "disabled" | "inline" | "error" | "defaultPlacement" | "animateLoading" | "isLoadingOptions" | "menuStyle" | "controlledFilter">>;
159
+ static defaultProps: Required<Pick<ComboBoxPropsBase, "placeholder" | "disabled" | "inline" | "error" | "defaultPlacement" | "animateLoading" | "menuStyle" | "isLoadingOptions" | "controlledFilter">>;
160
160
  static Option: typeof Option;
161
161
  static Divider: typeof Divider;
162
162
  static Heading: typeof Heading;
@@ -160,7 +160,7 @@ interface CompactState {
160
160
  }
161
161
  declare class Compact extends Component<CompactProps, CompactState> {
162
162
  static propTypes: React.WeakValidationMap<CompactProps>;
163
- static defaultProps: Required<Pick<CompactPropsBase, "placeholder" | "disabled" | "inline" | "defaultPlacement" | "animateLoading" | "noOptionsMessage" | "allowNewValues" | "isLoadingOptions" | "menuStyle" | "tabConfirmsNewValue" | "showSelectedValuesFirst">>;
163
+ static defaultProps: Required<Pick<CompactPropsBase, "placeholder" | "disabled" | "inline" | "defaultPlacement" | "animateLoading" | "noOptionsMessage" | "menuStyle" | "allowNewValues" | "isLoadingOptions" | "showSelectedValuesFirst" | "tabConfirmsNewValue">>;
164
164
  static Option: typeof Option;
165
165
  static Divider: typeof Divider;
166
166
  static Heading: typeof Heading;
@@ -199,7 +199,7 @@ type MultiselectCompactProps = ClassComponentProps<(MultiselectPropsBaseControll
199
199
  type MultiselectProps = MultiselectNormalProps | MultiselectCompactProps;
200
200
  declare class Multiselect extends Component<MultiselectProps, {}> {
201
201
  static propTypes: React.WeakValidationMap<MultiselectProps>;
202
- static defaultProps: Required<Pick<MultiselectPropsBase, "placeholder" | "disabled" | "inline" | "compact" | "defaultPlacement" | "repositionMode" | "animateLoading" | "noOptionsMessage" | "allowNewValues" | "isLoadingOptions" | "menuStyle" | "tabConfirmsNewValue" | "useClickawayOverlay">>;
202
+ static defaultProps: Required<Pick<MultiselectPropsBase, "placeholder" | "disabled" | "inline" | "compact" | "defaultPlacement" | "repositionMode" | "animateLoading" | "noOptionsMessage" | "menuStyle" | "allowNewValues" | "isLoadingOptions" | "tabConfirmsNewValue" | "useClickawayOverlay">>;
203
203
  static componentType: string;
204
204
  static Option: typeof Option;
205
205
  static Heading: typeof Heading;
@@ -148,7 +148,7 @@ declare class Normal extends Component<NormalProps, NormalState> {
148
148
  private popoverId;
149
149
  private previousActiveIndex;
150
150
  static propTypes: React.WeakValidationMap<NormalProps>;
151
- static defaultProps: Required<Pick<NormalPropsBase, "placeholder" | "disabled" | "inline" | "defaultPlacement" | "animateLoading" | "noOptionsMessage" | "allowNewValues" | "isLoadingOptions" | "menuStyle" | "tabConfirmsNewValue" | "useClickawayOverlay">>;
151
+ static defaultProps: Required<Pick<NormalPropsBase, "placeholder" | "disabled" | "inline" | "defaultPlacement" | "animateLoading" | "noOptionsMessage" | "menuStyle" | "allowNewValues" | "isLoadingOptions" | "tabConfirmsNewValue" | "useClickawayOverlay">>;
152
152
  static Option: typeof Option;
153
153
  static Divider: typeof Divider;
154
154
  static Heading: typeof Heading;
@@ -26,6 +26,8 @@ interface SelectPropsBase {
26
26
  animateLoading?: boolean;
27
27
  /**
28
28
  * Change the style of the button or link.
29
+ * @deprecatedValue 'primary'
30
+ * The `primary` value is deprecated and will be removed in the next major version.
29
31
  * @themeNotes The `pill` appearance is deprecated and only supported in Enterprise themes. The `flat` and `toggle` appearances are deprecated and only supported in Prisma themes.
30
32
  */
31
33
  appearance?: 'default' | 'link' | 'primary' | 'pill' | 'toggle' | 'flat' | 'subtle';
@@ -186,7 +188,7 @@ interface SelectState {
186
188
  }
187
189
  declare class Select extends Component<SelectProps, SelectState> {
188
190
  static propTypes: React.WeakValidationMap<SelectProps>;
189
- static defaultProps: Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "appearance" | "inline" | "error" | "defaultPlacement" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "allowKeyMatching" | "isLoadingOptions" | "menuStyle" | "toggleContent">>;
191
+ static defaultProps: Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "appearance" | "inline" | "error" | "defaultPlacement" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "menuStyle" | "allowKeyMatching" | "isLoadingOptions" | "toggleContent">>;
190
192
  static Option: typeof Option;
191
193
  static Heading: typeof BaseHeading;
192
194
  static Divider: typeof BaseDivider;
@@ -2,13 +2,13 @@ import React from 'react';
2
2
  import OptionBase from './OptionBase';
3
3
  interface SelectAllOptionPropsBase {
4
4
  active?: boolean;
5
+ changedToggle?: boolean;
5
6
  elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
6
7
  id?: string;
7
8
  onClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>) => void;
8
9
  selectAllLabel: string;
9
- totalCount?: number;
10
- changedToggle?: boolean;
11
10
  selected?: boolean | 'some';
11
+ totalCount?: number;
12
12
  }
13
13
  declare const SelectAllOption: React.ForwardRefExoticComponent<SelectAllOptionPropsBase & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "css" | keyof SelectAllOptionPropsBase> & React.RefAttributes<OptionBase>>;
14
14
  export default SelectAllOption;
@@ -1,7 +1,10 @@
1
- import React, { Component } from 'react';
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
2
3
  import { Divider, Heading } from '@splunk/react-ui/Menu';
3
- import Option from './OptionBase';
4
- import { ClassComponentProps } from '../utils/types';
4
+ import { TextBlurHandler, TextChangeHandler, TextFocusHandler } from '@splunk/react-ui/Text';
5
+ import Option, { OptionClickHandler } from './OptionBase';
6
+ import { MatchOption } from '../utils/fuzzyMatch';
7
+ import { ComponentProps } from '../utils/types';
5
8
  type SelectBaseFilterChangeHandler = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | React.FocusEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent, data: {
6
9
  keyword: string;
7
10
  }) => void;
@@ -21,6 +24,8 @@ interface SelectBasePropsBase {
21
24
  animateLoading?: boolean;
22
25
  /**
23
26
  * Change the style of the button or link.
27
+ * @deprecatedValue 'primary'
28
+ * The `primary` value is deprecated and will be removed in the next major version.
24
29
  * @themeNotes The `pill` appearance is deprecated and only supported in Enterprise themes. The `flat` and `toggle` appearances are deprecated and only supported in Prisma themes.
25
30
  */
26
31
  appearance?: 'default' | 'link' | 'primary' | 'pill' | 'toggle' | 'flat' | 'subtle';
@@ -197,7 +202,6 @@ interface SelectBasePropsBase {
197
202
  */
198
203
  toggleContent?: 'optionChildren' | 'optionLabel';
199
204
  }
200
- declare const defaultProps: Required<Pick<SelectBasePropsBase, 'allowKeyMatching' | 'allowNewValues' | 'animateLoading' | 'appearance' | 'append' | 'defaultPlacement' | 'disabled' | 'filter' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'multiple' | 'noOptionsMessage' | 'placeholder' | 'prepend' | 'repositionMode' | 'selectAllAppearance' | 'tabConfirmsNewValue' | 'toggleContent'>>;
201
205
  interface SelectBasePropsBaseControlled extends SelectBasePropsBase {
202
206
  defaultValues?: never;
203
207
  onChange: SelectBaseChangeHandler;
@@ -207,74 +211,108 @@ interface SelectBasePropsBaseUncontrolled extends SelectBasePropsBase {
207
211
  defaultValues?: (string | number | boolean)[];
208
212
  values?: never;
209
213
  }
210
- type SelectBaseProps = ClassComponentProps<SelectBasePropsBaseControlled | SelectBasePropsBaseUncontrolled, typeof defaultProps, 'button'>;
214
+ type SelectBaseProps = ComponentProps<SelectBasePropsBaseControlled | SelectBasePropsBaseUncontrolled, 'button'>;
211
215
  type OptionElement = React.ReactElement<React.ComponentPropsWithRef<typeof Option>, typeof Option>;
212
216
  type ChildrenElement = React.ReactElement<React.ComponentProps<typeof Divider | typeof Heading>, typeof Divider | typeof Heading> | OptionElement;
213
217
  declare function isOption(child: ChildrenElement): child is OptionElement;
214
- interface SelectBaseState {
218
+ interface ControlsProps extends Pick<SelectBaseProps, 'inputId' | 'inputRef' | 'multiple' | 'selectAllAppearance'> {
219
+ activeItemId: string;
220
+ filterKeyword: string;
221
+ hasChildren: boolean;
222
+ menuListboxId: string;
223
+ onClearAll: React.MouseEventHandler<HTMLButtonElement> | React.MouseEventHandler<HTMLAnchorElement>;
224
+ onSelectAll: React.MouseEventHandler<HTMLButtonElement> | React.MouseEventHandler<HTMLAnchorElement>;
225
+ onTextBlur: TextBlurHandler;
226
+ onTextChange: TextChangeHandler;
227
+ onTextFocus: TextFocusHandler;
228
+ onTextKeyDown: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
229
+ optionSelection: React.MutableRefObject<'all' | 'some' | 'none'>;
230
+ placement: 'above' | 'below' | 'left' | 'right' | 'misaligned' | null;
231
+ textHasFocus: boolean;
232
+ }
233
+ declare const Controls: ({ activeItemId, filterKeyword, hasChildren, inputId, inputRef, menuListboxId, multiple, onClearAll, onSelectAll, onTextBlur, onTextChange, onTextFocus, onTextKeyDown, optionSelection, placement, selectAllAppearance, textHasFocus, }: ControlsProps) => JSX.Element;
234
+ interface FinalChildrenProps extends Pick<SelectBaseProps, 'allowKeyMatching' | 'allowNewValues' | 'children' | 'filter' | 'isLoadingOptions' | 'multiple' | 'onScrollBottom' | 'selectAllAppearance' | 'toggle'> {
215
235
  activeIndex: number;
236
+ activeItemId: string;
237
+ availableMatchOptions: React.MutableRefObject<MatchOption[]>;
238
+ availableOptionCount: React.MutableRefObject<number>;
239
+ currentValues: (string | number | boolean)[];
216
240
  filterKeyword: string;
217
- open: boolean;
241
+ firstSelectedOptionIndex: React.MutableRefObject<number | undefined>;
242
+ newTopValues: (string | number | boolean)[];
243
+ onActiveOptionMount: (c: Option | null) => void;
244
+ onClearAll: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>) => void;
245
+ onClick: OptionClickHandler;
246
+ onKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>, optionIndex: number) => void;
247
+ onOptionMount: (c: Option | null, itemKey: string, isFirst: boolean) => void;
248
+ onSelectAll: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>) => void;
249
+ optionSelection: React.MutableRefObject<'none' | 'all' | 'some'>;
250
+ selectedOptionCount: React.MutableRefObject<number>;
251
+ setActiveValue: (value?: string | number | boolean) => void;
252
+ setAvailableMatchOptions: (value: MatchOption[]) => void;
253
+ setAvailableOptionCount: (value: number) => void;
254
+ setDisplayedValues: (value: (string | number | boolean)[]) => void;
255
+ setFirstSelectedOptionIndex: (value?: number) => void;
256
+ setOptionSelection: (value: 'none' | 'all' | 'some') => void;
257
+ setSelectedOptionCount: (value: number) => void;
218
258
  textHasFocus: boolean;
219
- topValues: (string | number | boolean)[];
220
- values: (string | number | boolean)[];
221
259
  }
222
- declare class SelectBase extends Component<SelectBaseProps, SelectBaseState> {
223
- private activeItemId;
224
- private activeValue?;
225
- private availableOptionCount;
226
- private controlledExternally;
227
- private displayedValues;
228
- private dropdown;
229
- private firstSelectedEnabledOption;
230
- private firstSelectedOptionIndex?;
231
- private menuListboxId;
232
- private previousActiveIndex;
233
- private selectedOptionCount;
234
- private optionRefsByKey;
235
- private matchCharacter;
236
- private matchTimeout;
237
- private currentMatchOptions;
238
- private availableMatchOptions;
239
- private optionSelection;
240
- static propTypes: React.WeakValidationMap<SelectBaseProps>;
241
- static defaultProps: Required<Pick<SelectBasePropsBase, "filter" | "placeholder" | "disabled" | "multiple" | "appearance" | "inline" | "defaultPlacement" | "repositionMode" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "allowKeyMatching" | "allowNewValues" | "isLoadingOptions" | "menuStyle" | "selectAllAppearance" | "tabConfirmsNewValue" | "toggleContent">>;
242
- static Option: typeof Option;
243
- static Divider: typeof Divider;
244
- static Heading: typeof Heading;
245
- private static invalidLinkAppearanceProps;
246
- private static validateAppearance;
247
- constructor(props: Readonly<SelectBaseProps>);
248
- componentDidUpdate(prevProps: Readonly<SelectBaseProps>, prevState: Readonly<SelectBaseState>): void;
249
- private getCurrentValues;
250
- private getTopValues;
251
- private resetMatches;
252
- private handleSelectAll;
253
- private handleClearAll;
254
- private handleTextKeyDown;
255
- private handleMenuOptionClick;
256
- private handleMenuOptionKeyDown;
257
- private handleTextChange;
258
- private handleTextFocus;
259
- private handleTextBlur;
260
- private handleRequestOpen;
261
- private handleRequestClose;
262
- private handleScrollBottom;
263
- private handleActiveOptionMount;
264
- private handleOptionMount;
265
- private isControlled;
266
- private hasFilter;
267
- private toggleValue;
268
- /**
269
- * Place focus on the toggle.
270
- */
271
- focus(): void;
272
- private renderControls;
273
- private createToggle;
274
- private createChildren;
275
- private wrapLabel;
276
- private handleDropdownMount;
277
- render(): JSX.Element;
260
+ declare const FinalChildren: ({ activeIndex, activeItemId, allowKeyMatching, allowNewValues, availableMatchOptions, availableOptionCount, children, currentValues, filter, filterKeyword, firstSelectedOptionIndex, isLoadingOptions, multiple, newTopValues, onActiveOptionMount, onClearAll, onClick, onKeyDown, onOptionMount, onScrollBottom, onSelectAll, optionSelection, selectAllAppearance, selectedOptionCount, setActiveValue, setAvailableMatchOptions, setAvailableOptionCount, setDisplayedValues, setFirstSelectedOptionIndex, setOptionSelection, setSelectedOptionCount, textHasFocus, toggle, }: FinalChildrenProps) => JSX.Element;
261
+ declare function SelectBase({ allowKeyMatching, animateLoading, appearance, append, allowNewValues, children, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, filter, footerMessage, inline, inputId, inputRef, isLoadingOptions, labelledBy, labelText, loadingMessage, menuStyle, multiple, name, noOptionsMessage, onChange, onScroll, onScrollBottom, onFilterChange, onClick, onClose, onOpen, required, placeholder, prefixLabel, prepend, repositionMode, selectAllAppearance, showSelectedValuesFirst, suffixLabel, tabConfirmsNewValue, values, virtualization, toggle, toggleContent, ...otherProps }: SelectBaseProps): JSX.Element;
262
+ declare namespace SelectBase {
263
+ var propTypes: {
264
+ allowKeyMatching: PropTypes.Requireable<boolean>;
265
+ allowNewValues: PropTypes.Requireable<boolean>;
266
+ animateLoading: PropTypes.Requireable<boolean>;
267
+ appearance: PropTypes.Requireable<string>;
268
+ append: PropTypes.Requireable<boolean>;
269
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
270
+ defaultPlacement: PropTypes.Requireable<string>;
271
+ defaultValues: PropTypes.Requireable<any[]>;
272
+ describedBy: PropTypes.Requireable<string>;
273
+ disabled: PropTypes.Requireable<boolean>;
274
+ elementRef: PropTypes.Requireable<object>;
275
+ error: PropTypes.Requireable<boolean>;
276
+ filter: PropTypes.Requireable<string | boolean>;
277
+ footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
278
+ inline: PropTypes.Requireable<boolean>;
279
+ inputId: PropTypes.Requireable<string>;
280
+ inputRef: PropTypes.Requireable<object>;
281
+ isLoadingOptions: PropTypes.Requireable<boolean>;
282
+ labelledBy: PropTypes.Requireable<string>;
283
+ labelText: PropTypes.Requireable<string>;
284
+ loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
285
+ menuStyle: PropTypes.Requireable<object>;
286
+ multiple: PropTypes.Requireable<boolean>;
287
+ name: PropTypes.Requireable<string>;
288
+ noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
289
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
290
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
291
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
292
+ onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
293
+ onOpen: PropTypes.Requireable<(...args: any[]) => any>;
294
+ onScroll: PropTypes.Requireable<(...args: any[]) => any>;
295
+ onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
296
+ /** @private. */
297
+ required: PropTypes.Requireable<boolean>;
298
+ placeholder: PropTypes.Requireable<string>;
299
+ prefixLabel: PropTypes.Requireable<string>;
300
+ prepend: PropTypes.Requireable<boolean>;
301
+ repositionMode: PropTypes.Requireable<string>;
302
+ selectAllAppearance: PropTypes.Requireable<string>;
303
+ showSelectedValuesFirst: PropTypes.Requireable<string>;
304
+ suffixLabel: PropTypes.Requireable<string>;
305
+ tabConfirmsNewValue: PropTypes.Requireable<boolean>;
306
+ toggle: PropTypes.Requireable<PropTypes.ReactNodeLike>;
307
+ toggleContent: PropTypes.Requireable<string>;
308
+ values: PropTypes.Requireable<any[]>;
309
+ /** @private. */
310
+ virtualization: PropTypes.Requireable<number>;
311
+ };
312
+ var componentType: string;
313
+ var Option: typeof import("./OptionBase").default;
314
+ var Divider: typeof import("../Menu/Divider").default;
315
+ var Heading: typeof import("../Menu/Heading").default;
278
316
  }
279
317
  export default SelectBase;
280
- export { ChildrenElement, Divider, Heading, Option, SelectBaseChangeHandler, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
318
+ export { Controls, FinalChildren, ChildrenElement, Divider, Heading, Option, SelectBaseChangeHandler, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
@@ -3,12 +3,10 @@ import { SelectChangeHandler } from '@splunk/react-ui/Select';
3
3
  declare class Appearance extends Component<{}, {
4
4
  valueA: string | number | boolean;
5
5
  valueB: string | number | boolean;
6
- valueC: string | number | boolean;
7
6
  }> {
8
7
  constructor(props: {});
9
8
  handleChangeA: SelectChangeHandler;
10
9
  handleChangeB: SelectChangeHandler;
11
- handleChangeC: SelectChangeHandler;
12
10
  render(): JSX.Element;
13
11
  }
14
12
  export default Appearance;
@@ -11,7 +11,6 @@ interface CellPropsBase {
11
11
  * - The background color is not lighter on cell hover in `prisma` theme.
12
12
  * 'link':
13
13
  * - The text is blue and darker on cell hover in `enterprise`, `enterpriseDark`, `lite` themes.
14
- * - The `link` appearance is not supported by the `prisma` theme.
15
14
  * 'rowLink':
16
15
  * - The text is blue and darker on row hover in `enterprise`, `enterpriseDark`, `lite` themes.
17
16
  * - The text is white and the background color of the row is lighter on row hover in `prisma` theme.
@@ -27,7 +26,6 @@ interface CellPropsBase {
27
26
  */
28
27
  elementRef?: React.Ref<HTMLTableCellElement>;
29
28
  /** Providing an `onClick` handler enables focus, hover, and related styles.
30
- * @excludeTheme prisma
31
29
  */
32
30
  onClick?: CellClickHandler;
33
31
  /** @private This will be passed through, and will work as expected. */
@@ -7,7 +7,9 @@ type HeadInnerDragStartHandler = (index: number | undefined, columnId: any) => v
7
7
  type HeadInnerRequestResizeHandler = HeadRequestResizeColumnHandler;
8
8
  interface HeadInnerPropsBase {
9
9
  align?: 'left' | 'center' | 'right';
10
+ clickable?: boolean;
10
11
  columnId?: any;
12
+ focusWithin?: boolean;
11
13
  hasActionsHead?: boolean;
12
14
  id?: string;
13
15
  index?: number;
@@ -23,11 +25,13 @@ interface HeadInnerPropsBase {
23
25
  width?: number | 'auto';
24
26
  }
25
27
  type HeadInnerProps = ComponentProps<HeadInnerPropsBase, 'span'>;
26
- declare function HeadInner({ index, columnId, id, width: widthProp, onDragEnd, onAutosizeColumn, align, label, hasActionsHead, isMenu, onDragStart, onRequestResize, resizable, sortDir, truncate, ...otherProps }: HeadInnerProps): JSX.Element;
28
+ declare function HeadInner({ index, clickable, columnId, focusWithin, id, width: widthProp, onDragEnd, onAutosizeColumn, align, label, hasActionsHead, isMenu, onDragStart, onRequestResize, resizable, sortDir, truncate, ...otherProps }: HeadInnerProps): JSX.Element;
27
29
  declare namespace HeadInner {
28
30
  var propTypes: {
29
31
  align: PropTypes.Requireable<string>;
32
+ clickable: PropTypes.Requireable<boolean>;
30
33
  columnId: PropTypes.Requireable<any>;
34
+ focusWithin: PropTypes.Requireable<boolean>;
31
35
  hasActionsHead: PropTypes.Requireable<boolean>;
32
36
  id: PropTypes.Requireable<string>;
33
37
  index: PropTypes.Requireable<number>;
@@ -13,7 +13,6 @@ interface WaitSpinnerPropsBase {
13
13
  screenReaderText?: string | null;
14
14
  /**
15
15
  * Size of WaitSpinner.
16
- * `large` is not supported in enterprise themes; falls back to `medium`.
17
16
  */
18
17
  size?: 'small' | 'medium' | 'large';
19
18
  }
@@ -0,0 +1,2 @@
1
+ export { default } from './useControlled';
2
+ export * from './useControlled';
@@ -0,0 +1,21 @@
1
+ import { MutableRefObject } from 'react';
2
+ interface DefaultValueProps<T> {
3
+ defaultValue: T;
4
+ value: T;
5
+ componentName?: string;
6
+ defaultValuePropName?: string;
7
+ valuePropName?: string;
8
+ }
9
+ /**
10
+ * This is a private component not intended for use outside @splunk/react-ui
11
+ *
12
+ * A hook that accepts a default value (as used in an uncontrolled component)
13
+ * and validates that actions that aren't valid in an uncontrolled component
14
+ * such as updating the default value, combining default value with value, etc.
15
+ * are not happening.
16
+ *
17
+ * Return the controlled state of the component.
18
+ */
19
+ declare function useControlled<T>({ defaultValue, value, componentName, defaultValuePropName, valuePropName, }: DefaultValueProps<T>): MutableRefObject<boolean>['current'];
20
+ export default useControlled;
21
+ export { DefaultValueProps };
@@ -0,0 +1,2 @@
1
+ export { default } from './useResizeObserver';
2
+ export * from './useResizeObserver';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ type Dimensions = {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ /**
7
+ * Watches a React ref element for changes in size.
8
+ *
9
+ * @param ref - The React ref to observe size changes on
10
+ */
11
+ declare const useResizeObserver: (ref: React.MutableRefObject<HTMLElement | null>) => Dimensions;
12
+ export default useResizeObserver;
@@ -0,0 +1,112 @@
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ var e = {
5
+ /***/ 9497:
6
+ /***/ e => {
7
+ e.exports = require("react");
8
+ /***/
9
+ /******/ }
10
+ };
11
+ /************************************************************************/
12
+ /******/ // The module cache
13
+ /******/ var r = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function t(o) {
17
+ /******/ // Check if module is in cache
18
+ /******/ var u = r[o];
19
+ /******/ if (u !== undefined) {
20
+ /******/ return u.exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var a = r[o] = {
24
+ /******/ // no module.id needed
25
+ /******/ // no module.loaded needed
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ e[o](a, a.exports, t);
31
+ /******/
32
+ /******/ // Return the exports of the module
33
+ /******/ return a.exports;
34
+ /******/ }
35
+ /******/
36
+ /************************************************************************/
37
+ /******/ /* webpack/runtime/define property getters */
38
+ /******/ (() => {
39
+ /******/ // define getter functions for harmony exports
40
+ /******/ t.d = (e, r) => {
41
+ /******/ for (var o in r) {
42
+ /******/ if (t.o(r, o) && !t.o(e, o)) {
43
+ /******/ Object.defineProperty(e, o, {
44
+ enumerable: true,
45
+ get: r[o]
46
+ });
47
+ /******/ }
48
+ /******/ }
49
+ /******/ };
50
+ /******/ })();
51
+ /******/
52
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
53
+ /******/ (() => {
54
+ /******/ t.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
55
+ /******/;
56
+ })();
57
+ /******/
58
+ /******/ /* webpack/runtime/make namespace object */
59
+ /******/ (() => {
60
+ /******/ // define __esModule on exports
61
+ /******/ t.r = e => {
62
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
63
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
64
+ value: "Module"
65
+ });
66
+ /******/ }
67
+ /******/ Object.defineProperty(e, "__esModule", {
68
+ value: true
69
+ });
70
+ /******/ };
71
+ /******/ })();
72
+ /******/
73
+ /************************************************************************/ var o = {};
74
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
75
+ (() => {
76
+ // ESM COMPAT FLAG
77
+ t.r(o);
78
+ // EXPORTS
79
+ t.d(o, {
80
+ default: () => /* reexport */ u
81
+ });
82
+ // EXTERNAL MODULE: external "react"
83
+ var e = t(9497);
84
+ // CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
85
+ /**
86
+ * This is a private component not intended for use outside @splunk/react-ui
87
+ *
88
+ * A hook that accepts a default value (as used in an uncontrolled component)
89
+ * and validates that actions that aren't valid in an uncontrolled component
90
+ * such as updating the default value, combining default value with value, etc.
91
+ * are not happening.
92
+ *
93
+ * Return the controlled state of the component.
94
+ */
95
+ function r(r) {
96
+ var t = r.defaultValue, o = r.value, u = r.componentName, a = u === void 0 ? "this component" : u, f = r.defaultValuePropName, n = f === void 0 ? "defaultValue" : f, l = r.valuePropName, i = l === void 0 ? "value" : l;
97
+ var d = (0, e.useRef)(o != null);
98
+ var s = (0, e.useRef)(t);
99
+ (0, e.useEffect)((function() {
100
+ if (false) {}
101
+ }), [ a, t, n, i ]);
102
+ (0, e.useEffect)((function() {
103
+ if (false) {}
104
+ if (false) {}
105
+ }), [ a, t, n, o, i ]);
106
+ return d.current;
107
+ }
108
+ /* harmony default export */ const u = r;
109
+ }) // CONCATENATED MODULE: ./src/useControlled/index.ts
110
+ ();
111
+ module.exports = o;
112
+ /******/})();
@@ -0,0 +1,2 @@
1
+ export { default } from './types/src/useKeyPress';
2
+ export * from './types/src/useKeyPress';
@@ -0,0 +1,2 @@
1
+ export { default } from './types/src/useResizeObserver';
2
+ export * from './types/src/useResizeObserver';