@splunk/react-ui 4.14.0 → 4.16.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 (137) hide show
  1. package/.dockerignore +2 -0
  2. package/Accordion.js +41 -16
  3. package/Anchor.js +9 -9
  4. package/Animation.js +6 -6
  5. package/AnimationToggle.js +2 -2
  6. package/Box.js +9 -9
  7. package/Button.js +54 -51
  8. package/ButtonGroup.js +9 -9
  9. package/ButtonSimple.js +68 -64
  10. package/CHANGELOG.md +46 -0
  11. package/Calendar.js +124 -106
  12. package/Card.js +68 -68
  13. package/CardLayout.js +9 -9
  14. package/Chip.js +22 -22
  15. package/Clickable.js +38 -14
  16. package/CloseButton.js +23 -23
  17. package/Code.js +484 -436
  18. package/CollapsiblePanel.js +59 -34
  19. package/Color.js +297 -187
  20. package/ColumnLayout.js +18 -17
  21. package/ComboBox.js +81 -32
  22. package/Concertina.js +88 -27
  23. package/ControlGroup.js +81 -24
  24. package/Date.js +54 -36
  25. package/DefinitionList.js +14 -8
  26. package/Divider.d.ts +2 -0
  27. package/Divider.js +9 -9
  28. package/Dockerfile.enterprise.storybook +7 -0
  29. package/Dockerfile.prisma.storybook +7 -0
  30. package/Dockerfile.visual +10 -0
  31. package/Dropdown.js +78 -18
  32. package/EventListener.js +17 -17
  33. package/File.js +108 -46
  34. package/FormRows.js +38 -37
  35. package/Heading.js +83 -55
  36. package/Image.js +63 -38
  37. package/JSONTree.js +106 -21
  38. package/Layer.js +59 -34
  39. package/Link.js +17 -17
  40. package/List.js +3 -3
  41. package/MIGRATION.md +21 -0
  42. package/Markdown.js +71 -65
  43. package/Menu.js +155 -121
  44. package/Message.js +129 -129
  45. package/MessageBar.js +136 -136
  46. package/Modal.js +57 -32
  47. package/ModalLayer.js +15 -15
  48. package/Monogram.js +18 -17
  49. package/Multiselect.js +2807 -2310
  50. package/Number.js +74 -37
  51. package/Paginator.js +96 -83
  52. package/Paragraph.js +10 -10
  53. package/Popover.js +191 -54
  54. package/Progress.js +23 -22
  55. package/RadioBar.js +32 -14
  56. package/RadioList.js +17 -11
  57. package/Resize.js +33 -20
  58. package/ResultsMenu.js +36 -23
  59. package/ScreenReaderContent.js +9 -9
  60. package/Scroll.js +51 -26
  61. package/ScrollContainerContext.js +48 -48
  62. package/Search.js +68 -31
  63. package/Select.js +501 -204
  64. package/SidePanel.js +37 -24
  65. package/Slider.js +54 -24
  66. package/SlidingPanels.js +52 -14
  67. package/SplitButton.js +23 -22
  68. package/StaticContent.js +9 -9
  69. package/StepBar.js +22 -22
  70. package/Switch.js +18 -13
  71. package/TabBar.js +22 -22
  72. package/TabLayout.js +46 -18
  73. package/Table.js +424 -166
  74. package/Text.js +91 -49
  75. package/TextArea.d.ts +2 -0
  76. package/TextArea.js +127 -49
  77. package/Tooltip.js +236 -59
  78. package/TransitionOpen.js +39 -26
  79. package/Typography.d.ts +2 -0
  80. package/Typography.js +18 -17
  81. package/WaitSpinner.js +15 -15
  82. package/docker-compose.yml +42 -0
  83. package/package.json +13 -12
  84. package/test-runner-jest.config.js +11 -6
  85. package/types/src/Accordion/AccordionContext.d.ts +1 -0
  86. package/types/src/Button/Button.d.ts +5 -2
  87. package/types/src/Button/docs/examples/Basic.d.ts +2 -2
  88. package/types/src/Button/docs/examples/Selected.d.ts +2 -2
  89. package/types/src/ButtonGroup/ButtonGroupContext.d.ts +1 -0
  90. package/types/src/ButtonSimple/ButtonSimple.d.ts +10 -11
  91. package/types/src/Calendar/Calendar.d.ts +2 -0
  92. package/types/src/CardLayout/CardLayoutContext.d.ts +1 -0
  93. package/types/src/Concertina/ConcertinaContext.d.ts +1 -0
  94. package/types/src/ControlGroup/ControlGroup.d.ts +15 -8
  95. package/types/src/ControlGroup/docs/examples/HelpWithErrorText.d.ts +2 -0
  96. package/types/src/ControlGroup/docs/examples/Required.d.ts +2 -0
  97. package/types/src/File/File.d.ts +4 -2
  98. package/types/src/File/FileContext.d.ts +1 -0
  99. package/types/src/FormRows/FormRowsContext.d.ts +1 -0
  100. package/types/src/Markdown/renderers/MarkdownLink.d.ts +1 -1
  101. package/types/src/Menu/MenuContext.d.ts +1 -0
  102. package/types/src/Modal/ModalContext.d.ts +1 -0
  103. package/types/src/Multiselect/Compact.d.ts +14 -1
  104. package/types/src/Multiselect/Multiselect.d.ts +15 -1
  105. package/types/src/Multiselect/Normal.d.ts +2 -0
  106. package/types/src/Popover/Popover.d.ts +25 -5
  107. package/types/src/Popover/PopoverContext.d.ts +1 -0
  108. package/types/src/RadioBar/RadioBar.d.ts +5 -3
  109. package/types/src/RadioBar/RadioBarContext.d.ts +1 -0
  110. package/types/src/RadioList/RadioList.d.ts +5 -1
  111. package/types/src/RadioList/RadioListContext.d.ts +1 -0
  112. package/types/src/Select/Select.d.ts +3 -1
  113. package/types/src/Select/SelectBase.d.ts +14 -0
  114. package/types/src/Slider/Slider.d.ts +5 -3
  115. package/types/src/StepBar/StepBarContext.d.ts +1 -0
  116. package/types/src/Switch/Switch.d.ts +2 -0
  117. package/types/src/TabBar/TabBarContext.d.ts +1 -0
  118. package/types/src/TabLayout/Panel.d.ts +3 -0
  119. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  120. package/types/src/Table/Body.d.ts +2 -0
  121. package/types/src/Table/Head.d.ts +2 -0
  122. package/types/src/Table/Row.d.ts +11 -3
  123. package/types/src/Table/Table.d.ts +5 -3
  124. package/types/src/Table/TableContext.d.ts +1 -0
  125. package/types/src/Text/Text.d.ts +5 -3
  126. package/types/src/TextArea/TextArea.d.ts +5 -3
  127. package/types/src/Tooltip/Tooltip.d.ts +16 -4
  128. package/types/src/Typography/Typography.d.ts +1 -1
  129. package/types/src/useForceUpdate/useForceUpdate.d.ts +1 -0
  130. package/useForceUpdate.js +9 -9
  131. package/useKeyPress.js +2 -2
  132. package/usePrevious.js +9 -9
  133. package/.storybook-visual/config/snapshotResolver.js +0 -29
  134. package/.storybook-visual/main.js +0 -22
  135. package/.storybook-visual/preview.jsx +0 -31
  136. package/.storybook-visual/scripts/test.sh +0 -108
  137. package/.storybook-visual/test-runner.js +0 -108
@@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
3
3
  import { AnyTheme } from '@splunk/themes';
4
4
  import { ClassComponentProps } from '../utils/types';
5
5
  /** @public */
6
- declare type openReasons = 'focusToggle' | 'mouseEnterPopover' | 'mouseEnterToggle';
6
+ declare type openReasons = 'focusToggle' | 'mouseEnterPopover' | 'mouseEnterToggle' | 'mouseEnterHitArea';
7
7
  /** @public */
8
- declare type closeReasons = 'blurToggle' | 'clickAway' | 'escapeKey' | 'mouseLeavePopover' | 'mouseLeaveToggle' | 'offScreen' | 'tabKey' | 'toggleClick';
8
+ declare type closeReasons = 'blurToggle' | 'clickAway' | 'escapeKey' | 'mouseLeaveHitArea' | 'mouseLeavePopover' | 'mouseLeaveToggle' | 'mouseStopHitArea' | 'offScreen' | 'tabKey' | 'toggleClick';
9
9
  /** @public */
10
10
  declare type TooltipRequestCloseHandler = (event: React.FocusEvent<HTMLSpanElement> | React.MouseEvent | MouseEvent | null, data: {
11
11
  reason: closeReasons;
@@ -92,9 +92,13 @@ declare const defaultProps: Required<Pick<TooltipPropsBase, 'appearance' | 'clos
92
92
  declare type TooltipProps = ClassComponentProps<TooltipPropsBase, typeof defaultProps, 'span'>;
93
93
  interface TooltipState {
94
94
  open: boolean;
95
- anchor: HTMLSpanElement | null;
95
+ anchorEl: HTMLSpanElement | null;
96
+ hitAreaEl: SVGElement | null;
97
+ hitAreaPath: string | null;
98
+ hitAreaStyle: React.CSSProperties;
96
99
  popoverEl: HTMLDivElement | null;
97
- lastCloseReason: closeReasons | null;
100
+ popoverOuterEl: HTMLDivElement | null;
101
+ popoverPlacement: string | null;
98
102
  }
99
103
  /**
100
104
  * The Tooltip component wraps arbitrary content to be displayed when the target element is hovered
@@ -112,17 +116,25 @@ declare class Tooltip extends Component<TooltipProps, TooltipState> {
112
116
  componentWillUnmount(): void;
113
117
  private handleMount;
114
118
  private handlePopoverMount;
119
+ private handlePopoverOuterMount;
120
+ private handleHitAreaMount;
115
121
  private handleMouseEnter;
116
122
  private handleMouseEnterPopover;
123
+ private handleMouseEnterHitArea;
117
124
  private handleMouseLeave;
118
125
  private handleMouseLeavePopover;
126
+ private handleMouseLeaveHitArea;
127
+ private handleMouseMoveHitAreaImpl;
128
+ private handleMouseMoveHitArea;
119
129
  private handleClick;
120
130
  private handleFocus;
121
131
  private handleBlur;
122
132
  private handlePopoverOnRequestClose;
123
133
  private handleRequestClose;
124
134
  private handleRequestOpen;
135
+ private updateHitArea;
125
136
  private isControlled;
137
+ private isOpen;
126
138
  render(): JSX.Element;
127
139
  }
128
140
  declare const TooltipWithTheme: React.ForwardRefExoticComponent<Pick<Pick<Pick<ClassComponentProps<TooltipPropsBase, Required<Pick<TooltipPropsBase, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">>, "span", never>, "slot" | "style" | "title" | "children" | "onChange" | "onPause" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "open" | "content" | "appearance" | "inline" | "elementRef" | "onRequestClose" | "defaultPlacement" | "splunkTheme" | "onRequestOpen" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay"> & Pick<PropTypes.InferProps<React.WeakValidationMap<ClassComponentProps<TooltipPropsBase, Required<Pick<TooltipPropsBase, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">>, "span", never>>>, "inlist"> & Pick<ClassComponentProps<TooltipPropsBase, Required<Pick<TooltipPropsBase, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">>, "span", never>, never>, "slot" | "style" | "title" | "children" | "onChange" | "onPause" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "open" | "content" | "elementRef" | "onRequestClose" | "splunkTheme" | "onRequestOpen"> & Partial<Pick<Pick<ClassComponentProps<TooltipPropsBase, Required<Pick<TooltipPropsBase, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">>, "span", never>, "slot" | "style" | "title" | "children" | "onChange" | "onPause" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "open" | "content" | "appearance" | "inline" | "elementRef" | "onRequestClose" | "defaultPlacement" | "splunkTheme" | "onRequestOpen" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay"> & Pick<PropTypes.InferProps<React.WeakValidationMap<ClassComponentProps<TooltipPropsBase, Required<Pick<TooltipPropsBase, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">>, "span", never>>>, "inlist"> & Pick<ClassComponentProps<TooltipPropsBase, Required<Pick<TooltipPropsBase, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">>, "span", never>, never>, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">> & Partial<Pick<Required<Pick<TooltipPropsBase, "appearance" | "inline" | "defaultPlacement" | "closeDelay" | "closeWhen" | "contentRelationship" | "openDelay">>, never>> & {
@@ -39,7 +39,7 @@ interface TypographyPropsBase extends TypographyParams {
39
39
  /**
40
40
  * Set the color to a system-standard color: e.g. `active` for `@splunk/themes/variables.contentColorActive`.
41
41
  */
42
- color?: 'active' | 'default' | 'disabled' | 'inverted' | 'muted';
42
+ color?: 'active' | 'default' | 'disabled' | 'inverted' | 'muted' | 'inherit';
43
43
  /**
44
44
  * Set the font-weight to a system-standard value.
45
45
  *
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * This is a private component not intended for use outside @splunk/react-ui
3
4
  *
package/useForceUpdate.js CHANGED
@@ -82,12 +82,19 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 187);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 236);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 187:
90
+ /***/ 2:
91
+ /***/ (function(module, exports) {
92
+
93
+ module.exports = require("react");
94
+
95
+ /***/ }),
96
+
97
+ /***/ 236:
91
98
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
99
 
93
100
  "use strict";
@@ -139,13 +146,6 @@ function useForceUpdate() {
139
146
 
140
147
 
141
148
 
142
- /***/ }),
143
-
144
- /***/ 2:
145
- /***/ (function(module, exports) {
146
-
147
- module.exports = require("react");
148
-
149
149
  /***/ })
150
150
 
151
151
  /******/ });
package/useKeyPress.js CHANGED
@@ -82,12 +82,12 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 114);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 163);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 114:
90
+ /***/ 163:
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";
package/usePrevious.js CHANGED
@@ -82,12 +82,19 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 188);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 237);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 188:
90
+ /***/ 2:
91
+ /***/ (function(module, exports) {
92
+
93
+ module.exports = require("react");
94
+
95
+ /***/ }),
96
+
97
+ /***/ 237:
91
98
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
99
 
93
100
  "use strict";
@@ -125,13 +132,6 @@ function usePrevious(value) {
125
132
 
126
133
 
127
134
 
128
- /***/ }),
129
-
130
- /***/ 2:
131
- /***/ (function(module, exports) {
132
-
133
- module.exports = require("react");
134
-
135
135
  /***/ })
136
136
 
137
137
  /******/ });
@@ -1,29 +0,0 @@
1
- /* eslint-disable */
2
- const path = require('path');
3
-
4
- const family = process.env.STORYBOOK_THEME_FAMILY.toString();
5
- const browser = process.env.STORYBOOK_TEST_BROWSER.toString();
6
-
7
- module.exports = {
8
- testPathForConsistencyCheck: `src/__test__/example.test.tsx`,
9
-
10
- /** resolves from test to snapshot path */
11
- resolveSnapshotPath: (testPath, snapshotExtension) => {
12
- const testSourcePath = testPath.replace('.tsx', `.${browser}.${family}`);
13
- // Get directory of test source file
14
- const testDirectory = path.dirname(testSourcePath);
15
- // Get file name of test source file
16
- const testFilename = path.basename(testSourcePath);
17
- return `${testDirectory}/__snapshots__/${testFilename}${snapshotExtension}`;
18
- },
19
-
20
- /** resolves from snapshot to test path */
21
- resolveTestPath: (snapshotFilePath, snapshotExtension) => {
22
- const testSourceFile = snapshotFilePath
23
- .replace('__test__/__snapshots__', '__test__')
24
- .replace(`.${browser}.${family}`, '.tsx')
25
- .slice(0, -snapshotExtension.length);
26
-
27
- return `${testSourceFile}`;
28
- },
29
- };
@@ -1,22 +0,0 @@
1
- /* eslint-env node */
2
- /* eslint-disable @typescript-eslint/no-var-requires */
3
-
4
- const webpackMerge = require('webpack-merge');
5
- const webpackTestConfig = require('../webpack.test.config.js');
6
-
7
- module.exports = {
8
- // visualRegression tests will only test *.stories and *.example files
9
- stories: [
10
- '../src/**/stories/*.stories.@(js|jsx|ts|tsx)',
11
- '../src/**/stories/*.examples.@(js|jsx|ts|tsx)',
12
- ],
13
- addons: ['@splunk/themes/storybook-addon-splunk-themes'],
14
- typescript: {
15
- check: false,
16
- checkOptions: {},
17
- reactDocgen: false,
18
- },
19
- webpackFinal: (config) => {
20
- return webpackMerge(webpackTestConfig, config);
21
- },
22
- };
@@ -1,31 +0,0 @@
1
- /* eslint-disable */
2
- import React from 'react';
3
-
4
- import {
5
- parameters as infraParameters,
6
- decorators as infraDecorators,
7
- } from '../../../infra/storybook/preview';
8
-
9
- const splunkThemes = process.env.STORYBOOK_THEME_FAMILY
10
- ? {
11
- family: process.env.STORYBOOK_THEME_FAMILY,
12
- colorScheme: process.env.STORYBOOK_THEME_COLOR_SCHEME,
13
- density: process.env.STORYBOOK_THEME_DENSITY,
14
- }
15
- : undefined;
16
-
17
- const parameters = {
18
- ...infraParameters,
19
- splunkThemes,
20
- };
21
-
22
- const decorators = [
23
- ...infraDecorators,
24
- (Story) => (
25
- <div id="storybook-test-wrapper">
26
- <Story />
27
- </div>
28
- ),
29
- ];
30
-
31
- export { parameters, decorators };
@@ -1,108 +0,0 @@
1
- #!/bin/bash
2
-
3
- family="prisma"
4
- colorScheme="dark"
5
- density="comfortable"
6
- browser="chromium"
7
- component=""
8
- maxWorkers="100%"
9
- a11y="false"
10
- skipBuild="false"
11
-
12
- if ! options=$(getopt -o tfcd -l theme,family,color,component,density,browser,all,updateSnapshot,maxWorkers,a11y,skipBuild $*)
13
- then
14
- exit 1
15
- fi
16
-
17
- set -- $options
18
-
19
- while [ $# -gt 0 ]
20
- do
21
- case $1 in
22
- -t|--theme) themeArg=$2 ;;
23
- -f|--family) familyArg=$2 ;;
24
- -c|--color) colorSchemeArg=$2 ;;
25
- -ct|--component) componentArg=$2 ;;
26
- -d|--density) densityArg=$2 ;;
27
- -a|--all) all='true' ;;
28
- -u|--updateSnapshot) updateSnapshot='--updateSnapshot' ;;
29
- -a|--a11y) a11y='true' ;;
30
- -u|--maxWorkers) maxWorkers=$2 ;;
31
- -ssb|--skipBuild) skipBuild='true' ;;
32
- esac
33
- shift
34
- done
35
-
36
-
37
-
38
- if [[ "$themeArg" == "enterprise" ]]; then
39
- family="enterprise"
40
- colorScheme="light"
41
- density="comfortable"
42
- fi
43
-
44
- if [[ "$themeArg" == "prisma" ]]; then
45
- family="prisma"
46
- colorScheme="dark"
47
- density="comfortable"
48
- fi
49
-
50
- if [[ -n "$familyArg" ]]; then
51
- family="$familyArg"
52
- fi
53
-
54
- if [[ -n "$colorSchemeArg" ]]; then
55
- colorScheme="$colorSchemeArg"
56
- fi
57
-
58
- if [[ -n "$densityArg" ]]; then
59
- density="$densityArg"
60
- fi
61
-
62
- if [[ -n "$browserArg" ]]; then
63
- browser="$browserArg"
64
- fi
65
-
66
- export STORYBOOK_THEME_FAMILY=$family
67
- export STORYBOOK_THEME_COLOR_SCHEME=$colorScheme
68
- export STORYBOOK_THEME_DENSITY=$density
69
- export STORYBOOK_TEST_BROWSER=$browser
70
- export STORYBOOK_TEST_A11Y=$a11y
71
-
72
- if [[ -n "$componentArg" ]]; then
73
- export STORYBOOK_TEST_COMPONENT=$componentArg
74
- fi
75
-
76
- if [[ $all == "true" ]]; then
77
- if [[ $skipBuild == 'false' ]]; then
78
- yarn build-storybook -c .storybook-visual --output-dir storybook-static-visual
79
- else
80
- echo "--skipBuild should not be used with --all. This will create invalid snapshots!"
81
- exit 1;
82
- fi
83
- yarn build-storybook -c .storybook-visual --output-dir storybook-static-visual
84
- http-server storybook-static-visual --port 6007 & wait-on tcp:6007
85
- yarn cache clean && yarn test-storybook -c .storybook-visual ${updateSnapshot} --maxWorkers=${maxWorkers} --browsers chromium --url http://localhost:6007
86
-
87
- export STORYBOOK_TEST_BROWSER=firefox
88
- yarn cache clean && yarn test-storybook -c .storybook-visual ${updateSnapshot} --maxWorkers=${maxWorkers} --browsers firefox --url http://localhost:6007
89
- lsof -ti tcp:6007 | xargs kill
90
-
91
- export STORYBOOK_THEME_FAMILY=enterprise STORYBOOK_THEME_COLOR_SCHEME=light STORYBOOK_TEST_BROWSER=chromium
92
- yarn build-storybook -c .storybook-visual --output-dir storybook-static-visual
93
- http-server storybook-static-visual --port 6007 & wait-on tcp:6007
94
- yarn cache clean && yarn test-storybook -c .storybook-visual ${updateSnapshot} --maxWorkers=${maxWorkers} --browsers chromium --url http://localhost:6007
95
-
96
- export STORYBOOK_TEST_BROWSER=firefox
97
- yarn cache clean && yarn test-storybook -c .storybook-visual ${updateSnapshot} --maxWorkers=${maxWorkers} --browsers firefox --url http://localhost:6007
98
- lsof -ti tcp:6007 | xargs kill
99
- else
100
- if [[ $skipBuild == 'false' ]]; then
101
- echo "BUILDING"
102
- yarn build-storybook -c .storybook-visual --output-dir storybook-static-visual
103
- else
104
- echo "Skipping storybook-static-visual build (${STORYBOOK_THEME_FAMILY}, ${STORYBOOK_THEME_COLOR_SCHEME})..."
105
- fi
106
-
107
- http-server storybook-static-visual --port 6007 & wait-on tcp:6007 && yarn cache clean && yarn test-storybook "${updateSnapshot}" --maxWorkers=${maxWorkers} --browsers $browser --url http://localhost:6007 ; lsof -ti tcp:6007 | xargs kill
108
- fi
@@ -1,108 +0,0 @@
1
- /* eslint-disable */
2
- const { toMatchImageSnapshot } = require('jest-image-snapshot');
3
- const { injectAxe, checkA11y, getViolations } = require('axe-playwright');
4
- const { getStoryContext } = require('@storybook/test-runner');
5
- const { createHtmlReport } = require('axe-html-reporter');
6
-
7
- const customA11yViolationsDir = `${process.cwd()}/test-reports/a11y/${
8
- process.env.STORYBOOK_TEST_BROWSER
9
- }-${process.env.STORYBOOK_THEME_FAMILY}/a11y-violations/`;
10
-
11
- const customDiffDir = `${process.cwd()}/test-reports/visual/${process.env.STORYBOOK_TEST_BROWSER}-${
12
- process.env.STORYBOOK_THEME_FAMILY
13
- }/image_snapshot_diff/`;
14
-
15
- const customReceivedDir = `${process.cwd()}/test-reports/visual/${
16
- process.env.STORYBOOK_TEST_BROWSER
17
- }-${process.env.STORYBOOK_THEME_FAMILY}/image_snapshot_received/`;
18
-
19
- module.exports = {
20
- setup() {
21
- expect.extend({ toMatchImageSnapshot });
22
- },
23
- async preRender(page) {
24
- jest.retryTimes(2);
25
- if (process.env.STORYBOOK_TEST_A11Y == 'true') {
26
- await injectAxe(page);
27
- }
28
- },
29
- async postRender(page, context) {
30
- // check for theme compatibility first, if it isn't compatible, exit test
31
- const storyContext = await getStoryContext(page, context);
32
- if (
33
- storyContext.parameters?.themeSupport?.family !== undefined &&
34
- storyContext.parameters?.themeSupport?.family !== process.env.STORYBOOK_THEME_FAMILY
35
- ) {
36
- return;
37
- }
38
-
39
- // check if should skip taking a snapshot for this story
40
- if (storyContext.parameters?.skipSnapshot) {
41
- return;
42
- }
43
-
44
- let componentName = context.title.split('/')[1];
45
- componentName = componentName === 'ThemedIcon' ? 'icons' : componentName;
46
-
47
- if (process.env.STORYBOOK_TEST_A11Y == 'false') {
48
- const customSnapshotsDir = `${process.cwd()}/src/${componentName}/stories/__images__/${
49
- process.env.STORYBOOK_TEST_BROWSER
50
- }/${process.env.STORYBOOK_THEME_FAMILY}`;
51
-
52
- if (
53
- componentName === 'Modal' ||
54
- componentName === 'Popover' ||
55
- componentName === 'Tooltip' ||
56
- componentName === 'Color' ||
57
- componentName === 'Progress'
58
- ) {
59
- await new Promise((r) => setTimeout(r, 3000));
60
- } else {
61
- await new Promise((r) => setTimeout(r, 0));
62
- }
63
-
64
- const image = await page.screenshot({ animations: 'disabled' });
65
-
66
- expect(image).toMatchImageSnapshot({
67
- customSnapshotsDir,
68
- customDiffDir,
69
- customSnapshotIdentifier: context.id,
70
- storeReceivedOnFailure: true,
71
- customReceivedDir,
72
- });
73
-
74
- // const accessibilityTree = await page.accessibility.snapshot();
75
- // expect(accessibilityTree).toMatchSnapshot();
76
- } else {
77
- // Run only if specified
78
- const violations = await getViolations(page, '#storybook-test-wrapper', {
79
- runOnly: {
80
- type: 'tag',
81
- values: ['wcag2a'],
82
- },
83
- });
84
-
85
- await new Promise((resolve, reject) => {
86
- if (violations.length > 0) {
87
- createHtmlReport(
88
- {
89
- results: {
90
- violations: violations,
91
- },
92
- options: {
93
- outputDirPath: customA11yViolationsDir + '/' + componentName,
94
- reportFileName: `${context.id}-violations.html`,
95
- },
96
- },
97
- (err) => {
98
- if (err) reject(err);
99
- }
100
- );
101
- }
102
- resolve();
103
- });
104
-
105
- await checkA11y(page, '#storybook-test-wrapper');
106
- }
107
- },
108
- };