@canonical/react-components 0.37.9 → 0.39.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 (69) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Accordion/AccordionSection/AccordionSection.d.ts +2 -2
  3. package/dist/components/ActionButton/ActionButton.d.ts +1 -1
  4. package/dist/components/ArticlePagination/ArticlePagination.d.ts +1 -1
  5. package/dist/components/Badge/Badge.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +1 -1
  7. package/dist/components/Card/Card.d.ts +1 -1
  8. package/dist/components/CheckboxInput/CheckableInput/CheckableInput.d.ts +1 -1
  9. package/dist/components/CheckboxInput/CheckboxInput.d.ts +1 -1
  10. package/dist/components/Chip/Chip.d.ts +1 -1
  11. package/dist/components/Code/Code.d.ts +1 -1
  12. package/dist/components/CodeSnippet/CodeSnippet.d.ts +1 -1
  13. package/dist/components/CodeSnippet/CodeSnippetBlock.d.ts +1 -1
  14. package/dist/components/CodeSnippet/CodeSnippetDropdown.d.ts +2 -2
  15. package/dist/components/Col/Col.d.ts +2 -2
  16. package/dist/components/ContextualMenu/ContextualMenu.d.ts +1 -1
  17. package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +3 -3
  18. package/dist/components/Field/Field.d.ts +2 -2
  19. package/dist/components/Form/Form.d.ts +1 -1
  20. package/dist/components/Icon/Icon.d.ts +1 -1
  21. package/dist/components/Input/Input.d.ts +1 -1
  22. package/dist/components/Input/Input.js +2 -2
  23. package/dist/components/Label/Label.d.ts +1 -1
  24. package/dist/components/Link/Link.d.ts +1 -1
  25. package/dist/components/List/List.d.ts +4 -4
  26. package/dist/components/List/List.js +1 -1
  27. package/dist/components/MainTable/MainTable.d.ts +4 -4
  28. package/dist/components/Modal/Modal.d.ts +1 -1
  29. package/dist/components/ModularTable/ModularTable.d.ts +6 -2
  30. package/dist/components/ModularTable/ModularTable.js +8 -4
  31. package/dist/components/Navigation/Navigation.d.ts +1 -1
  32. package/dist/components/Navigation/NavigationLink/NavigationLink.d.ts +1 -1
  33. package/dist/components/Navigation/NavigationMenu/NavigationMenu.d.ts +1 -1
  34. package/dist/components/Navigation/types.d.ts +8 -8
  35. package/dist/components/Notification/Notification.d.ts +2 -2
  36. package/dist/components/Pagination/Pagination.d.ts +6 -2
  37. package/dist/components/Pagination/Pagination.js +13 -3
  38. package/dist/components/Pagination/PaginationButton/PaginationButton.d.ts +2 -2
  39. package/dist/components/Pagination/PaginationItem/PaginationItem.d.ts +1 -1
  40. package/dist/components/PasswordToggle/PasswordToggle.d.ts +1 -1
  41. package/dist/components/RadioInput/RadioInput.d.ts +1 -1
  42. package/dist/components/Row/Row.d.ts +1 -1
  43. package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.d.ts +1 -1
  44. package/dist/components/SearchAndFilter/SearchAndFilter.d.ts +1 -1
  45. package/dist/components/SearchAndFilter/types.d.ts +2 -2
  46. package/dist/components/SearchBox/SearchBox.d.ts +10 -2
  47. package/dist/components/SearchBox/SearchBox.js +7 -3
  48. package/dist/components/Select/Select.d.ts +2 -2
  49. package/dist/components/Slider/Slider.d.ts +1 -1
  50. package/dist/components/Slider/Slider.js +3 -1
  51. package/dist/components/Spinner/Spinner.d.ts +1 -1
  52. package/dist/components/StatusLabel/StatusLabel.d.ts +1 -1
  53. package/dist/components/Strip/Strip.d.ts +1 -1
  54. package/dist/components/SummaryButton/SummaryButton.d.ts +1 -1
  55. package/dist/components/Switch/Switch.d.ts +1 -1
  56. package/dist/components/Table/Table.d.ts +1 -1
  57. package/dist/components/TableCell/TableCell.d.ts +1 -1
  58. package/dist/components/TableHeader/TableHeader.d.ts +1 -1
  59. package/dist/components/TableRow/TableRow.d.ts +1 -1
  60. package/dist/components/Tabs/Tabs.d.ts +2 -2
  61. package/dist/components/Textarea/Textarea.d.ts +1 -1
  62. package/dist/components/Tooltip/Tooltip.d.ts +4 -4
  63. package/dist/components/Tooltip/Tooltip.js +8 -3
  64. package/dist/hooks/useThrottle.d.ts +1 -1
  65. package/dist/hooks/useWindowFitment.d.ts +1 -1
  66. package/dist/testing/mock-scss.js +4 -0
  67. package/dist/types/index.d.ts +7 -7
  68. package/dist/types/react-table-config.d.js +3 -1
  69. package/package.json +47 -47
@@ -4,7 +4,7 @@ export declare enum Label {
4
4
  Clear = "Clear input",
5
5
  SearchAndFilter = "Search and filter"
6
6
  }
7
- export declare type Props = {
7
+ export type Props = {
8
8
  /**
9
9
  * A list of chips to initialise inside the input.
10
10
  */
@@ -1,10 +1,10 @@
1
- export declare type SearchAndFilterChip = {
1
+ export type SearchAndFilterChip = {
2
2
  id?: number;
3
3
  lead?: string;
4
4
  quoteValue?: boolean;
5
5
  value: string;
6
6
  };
7
- export declare type SearchAndFilterData = {
7
+ export type SearchAndFilterData = {
8
8
  id: number;
9
9
  chips?: SearchAndFilterChip[];
10
10
  heading?: string;
@@ -4,7 +4,7 @@ export declare enum Label {
4
4
  Clear = "Clear search field",
5
5
  Search = "Search"
6
6
  }
7
- export declare type Props = PropsWithSpread<{
7
+ export type Props = PropsWithSpread<{
8
8
  /**
9
9
  * Whether autocomplete should be enabled for the search input.
10
10
  */
@@ -29,10 +29,18 @@ export declare type Props = PropsWithSpread<{
29
29
  * A function that is called when the user clicks the search icon
30
30
  */
31
31
  onSearch?: () => void;
32
+ /**
33
+ * A function that is called when the user clicks the reset icon
34
+ */
35
+ onClear?: () => void;
32
36
  /**
33
37
  * A search input placeholder message.
34
38
  */
35
39
  placeholder?: string;
40
+ /**
41
+ * Whether the search input should receive focus after pressing the reset button
42
+ */
43
+ shouldRefocusAfterReset?: boolean;
36
44
  /**
37
45
  * A ref that is passed to the input element.
38
46
  */
@@ -42,5 +50,5 @@ export declare type Props = PropsWithSpread<{
42
50
  */
43
51
  value?: string;
44
52
  }, HTMLProps<HTMLInputElement>>;
45
- declare const SearchBox: React.ForwardRefExoticComponent<Pick<Props, "content" | "title" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "pattern" | "children" | "className" | "key" | "list" | "role" | "id" | "onClick" | "type" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "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" | "onChange" | "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" | "onPause" | "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" | "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" | "externallyControlled" | "autocomplete" | "onSearch"> & React.RefAttributes<HTMLInputElement>>;
53
+ declare const SearchBox: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
46
54
  export default SearchBox;
@@ -13,7 +13,7 @@ var _react = _interopRequireWildcard(require("react"));
13
13
 
14
14
  var _Icon = _interopRequireDefault(require("../Icon"));
15
15
 
16
- var _excluded = ["autocomplete", "className", "disabled", "externallyControlled", "onChange", "onSearch", "placeholder", "value"];
16
+ var _excluded = ["autocomplete", "className", "disabled", "externallyControlled", "onChange", "onSearch", "onClear", "placeholder", "shouldRefocusAfterReset", "value"];
17
17
 
18
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
19
 
@@ -43,18 +43,22 @@ var SearchBox = /*#__PURE__*/_react.default.forwardRef(function (_ref, forwarded
43
43
  externallyControlled = _ref.externallyControlled,
44
44
  _onChange = _ref.onChange,
45
45
  onSearch = _ref.onSearch,
46
+ onClear = _ref.onClear,
46
47
  _ref$placeholder = _ref.placeholder,
47
48
  placeholder = _ref$placeholder === void 0 ? "Search" : _ref$placeholder,
49
+ shouldRefocusAfterReset = _ref.shouldRefocusAfterReset,
48
50
  value = _ref.value,
49
51
  props = _objectWithoutProperties(_ref, _excluded);
50
52
 
51
53
  var internalRef = (0, _react.useRef)();
52
54
 
53
55
  var resetInput = function resetInput() {
54
- _onChange && _onChange("");
56
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange("");
57
+ onClear === null || onClear === void 0 ? void 0 : onClear();
55
58
 
56
59
  if (internalRef.current) {
57
60
  internalRef.current.value = "";
61
+ if (shouldRefocusAfterReset) internalRef.current.focus();
58
62
  }
59
63
  };
60
64
 
@@ -74,7 +78,7 @@ var SearchBox = /*#__PURE__*/_react.default.forwardRef(function (_ref, forwarded
74
78
  id: "search",
75
79
  name: "search",
76
80
  onChange: function onChange(evt) {
77
- return _onChange(evt.target.value);
81
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange(evt.target.value);
78
82
  },
79
83
  placeholder: placeholder,
80
84
  ref: function ref(input) {
@@ -1,10 +1,10 @@
1
1
  import type { ChangeEventHandler, ReactNode, OptionHTMLAttributes, SelectHTMLAttributes } from "react";
2
2
  import type { ClassName, PropsWithSpread } from "../../types";
3
- declare type Option = OptionHTMLAttributes<HTMLOptionElement>;
3
+ type Option = OptionHTMLAttributes<HTMLOptionElement>;
4
4
  /**
5
5
  * The props for the Select component.
6
6
  */
7
- export declare type Props = PropsWithSpread<{
7
+ export type Props = PropsWithSpread<{
8
8
  /**
9
9
  * The content for caution validation.
10
10
  */
@@ -2,7 +2,7 @@ import type { ChangeEventHandler, HTMLProps, ReactNode } from "react";
2
2
  import type { PropsWithSpread } from "../../types";
3
3
  export declare const FILLED_COLOR = "#0066CC";
4
4
  export declare const EMPTY_COLOR = "#D9D9D9";
5
- export declare type Props = PropsWithSpread<{
5
+ export type Props = PropsWithSpread<{
6
6
  /**
7
7
  * Field caution message.
8
8
  */
@@ -53,9 +53,11 @@ var Slider = function Slider(_ref) {
53
53
  var style = {};
54
54
 
55
55
  if ((_navigator = navigator) !== null && _navigator !== void 0 && (_navigator$userAgent = _navigator.userAgent) !== null && _navigator$userAgent !== void 0 && _navigator$userAgent.includes("AppleWebKit")) {
56
+ var _inputProps$value;
57
+
56
58
  // Range inputs on Webkit browsers don't have a built-in "filled" portion,
57
59
  // so instead it is handled here as a background.
58
- var val = inputProps.value || inputProps.defaultValue;
60
+ var val = (_inputProps$value = inputProps.value) !== null && _inputProps$value !== void 0 ? _inputProps$value : inputProps.defaultValue;
59
61
  var filledPercentage = "".concat((Number(val) - min) / (max - min) * 100, "%");
60
62
  style = {
61
63
  background: "linear-gradient(\n to right,\n ".concat(FILLED_COLOR, " 0%,\n ").concat(FILLED_COLOR, " ").concat(filledPercentage, ",\n ").concat(EMPTY_COLOR, " ").concat(filledPercentage, ",\n ").concat(EMPTY_COLOR, " 100%\n )")
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps } from "react";
2
2
  import type { ClassName } from "../../types";
3
- export declare type Props = {
3
+ export type Props = {
4
4
  /**
5
5
  * Optional class(es) to pass to the wrapping span element.
6
6
  */
@@ -10,7 +10,7 @@ export declare const StatusLabelAppearance: {
10
10
  /**
11
11
  * The type of the StatusLabel props.
12
12
  */
13
- export declare type Props = PropsWithSpread<{
13
+ export type Props = PropsWithSpread<{
14
14
  /**
15
15
  * The appearance of the label.
16
16
  */
@@ -1,7 +1,7 @@
1
1
  import type { ElementType, HTMLProps, ReactNode } from "react";
2
2
  import type { ColSize } from "../Col/Col";
3
3
  import type { ClassName, PropsWithSpread } from "../../types";
4
- export declare type Props = PropsWithSpread<{
4
+ export type Props = PropsWithSpread<{
5
5
  /**
6
6
  * The content of the strip.
7
7
  */
@@ -1,6 +1,6 @@
1
1
  import type { MouseEventHandler } from "react";
2
2
  import type { ClassName } from "../../types";
3
- export declare type Props = {
3
+ export type Props = {
4
4
  /**
5
5
  * Optional class(es) to pass to the wrapping element.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { HTMLProps, ReactNode } from "react";
2
2
  import type { PropsWithSpread } from "../../types";
3
- export declare type Props = PropsWithSpread<{
3
+ export type Props = PropsWithSpread<{
4
4
  /**
5
5
  * The label name for the switch
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps, ReactNode } from "react";
2
2
  import type { ClassName, PropsWithSpread } from "../../types";
3
- export declare type Props = PropsWithSpread<{
3
+ export type Props = PropsWithSpread<{
4
4
  /**
5
5
  * The content of the table.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps, ReactNode } from "react";
2
2
  import type { ClassName, PropsWithSpread } from "../../types";
3
- export declare type Props = PropsWithSpread<{
3
+ export type Props = PropsWithSpread<{
4
4
  /**
5
5
  * The content of the table cell.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps, ReactNode } from "react";
2
2
  import { PropsWithSpread, SortDirection } from "../../types";
3
- export declare type Props = PropsWithSpread<{
3
+ export type Props = PropsWithSpread<{
4
4
  /**
5
5
  * The content of the table header.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { HTMLProps, ReactNode } from "react";
2
2
  import type { PropsWithSpread } from "../../types";
3
- export declare type Props = PropsWithSpread<{
3
+ export type Props = PropsWithSpread<{
4
4
  /**
5
5
  * The content of the table row.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { HTMLProps, ElementType, ReactNode, ComponentType } from "react";
2
2
  import type { ClassName } from "../../types";
3
- export declare type TabLink<P = null> = {
3
+ export type TabLink<P = null> = {
4
4
  /**
5
5
  * Whether the tab link should have active styling.
6
6
  */
@@ -22,7 +22,7 @@ export declare type TabLink<P = null> = {
22
22
  */
23
23
  listItemClassName?: string;
24
24
  } & (HTMLProps<HTMLElement> | P);
25
- export declare type Props<P = null> = {
25
+ export type Props<P = null> = {
26
26
  /**
27
27
  * Optional classes applied to the parent "nav" element.
28
28
  */
@@ -3,7 +3,7 @@ import type { ClassName, PropsWithSpread } from "../../types";
3
3
  /**
4
4
  * The props for the Textarea component.
5
5
  */
6
- export declare type Props = PropsWithSpread<{
6
+ export type Props = PropsWithSpread<{
7
7
  /**
8
8
  * The content for caution validation.
9
9
  */
@@ -1,8 +1,8 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { WindowFitment } from "../../hooks";
3
3
  import type { ClassName, ValueOf } from "../../types";
4
- export declare type CSSPosition = "static" | "absolute" | "fixed" | "relative" | "sticky" | "initial" | "inherit";
5
- export declare type PositionStyle = {
4
+ export type CSSPosition = "static" | "absolute" | "fixed" | "relative" | "sticky" | "initial" | "inherit";
5
+ export type PositionStyle = {
6
6
  left: number;
7
7
  pointerEvents?: string;
8
8
  position: CSSPosition;
@@ -18,8 +18,8 @@ export declare const position: {
18
18
  readonly topLeft: "top-left";
19
19
  readonly topRight: "top-right";
20
20
  };
21
- export declare type Position = ValueOf<typeof position>;
22
- export declare type Props = {
21
+ export type Position = ValueOf<typeof position>;
22
+ export type Props = {
23
23
  /**
24
24
  * Whether the tooltip should adjust to fit in the screen.
25
25
  */
@@ -186,8 +186,8 @@ var Tooltip = function Tooltip(_ref) {
186
186
  position: "absolute",
187
187
  // Initially position the tooltip of the screen in case it gets shown
188
188
  // before setting the position.
189
- left: -99999999999999,
190
- top: -99999999999999
189
+ left: -9999999,
190
+ top: -9999999
191
191
  }),
192
192
  _useState4 = _slicedToArray(_useState3, 2),
193
193
  positionStyle = _useState4[0],
@@ -282,7 +282,12 @@ var Tooltip = function Tooltip(_ref) {
282
282
  "u-off-screen": !isOpen
283
283
  }, tooltipClassName),
284
284
  "data-testid": "tooltip-portal",
285
- style: positionStyle
285
+ style: positionStyle // style={
286
+ // isOpen
287
+ // ? (positionStyle as React.CSSProperties)
288
+ // : { left: -9999 }
289
+ // }
290
+
286
291
  }, /*#__PURE__*/_react.default.createElement("span", {
287
292
  role: "tooltip",
288
293
  className: "p-tooltip__message",
@@ -1,5 +1,5 @@
1
1
  export declare const THROTTLE_DELAY: number;
2
- export declare type Callback = (...args: any[]) => any;
2
+ export type Callback = (...args: any[]) => any;
3
3
  /**
4
4
  * A hook to handle throttling calls to a function.
5
5
  * @param callback The function to throttle.
@@ -1,4 +1,4 @@
1
- export declare type WindowFitment = {
1
+ export type WindowFitment = {
2
2
  fromTop: {
3
3
  fitsAbove: boolean;
4
4
  fitsBelow: boolean;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ // A fake module to use in place of required scss files.
4
+ module.exports = {};
@@ -2,36 +2,36 @@
2
2
  * This type should be used for all className props in order to ensure
3
3
  * consistency across components.
4
4
  */
5
- export declare type ClassName = string | null;
5
+ export type ClassName = string | null;
6
6
  /**
7
7
  * The allowable heading levels.
8
8
  */
9
- export declare type Headings = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
9
+ export type Headings = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
10
10
  /**
11
11
  * This type can be used when defining props that also spread the props of
12
12
  * something else. It ensures that the defined component props are never
13
13
  * overwritten by the spread props.
14
14
  */
15
- export declare type PropsWithSpread<P, H> = P & Omit<H, keyof P>;
15
+ export type PropsWithSpread<P, H> = P & Omit<H, keyof P>;
16
16
  /**
17
17
  * The allowable sort directions e.g. for a sortable table.
18
18
  */
19
- export declare type SortDirection = "none" | "ascending" | "descending";
19
+ export type SortDirection = "none" | "ascending" | "descending";
20
20
  /**
21
21
  * This type can be used when passing props to a sub component. It makes all
22
22
  * component props optional.
23
23
  */
24
- export declare type SubComponentProps<P> = Partial<P> & {
24
+ export type SubComponentProps<P> = Partial<P> & {
25
25
  [prop: string]: unknown;
26
26
  };
27
27
  /**
28
28
  * This type is simply an alias for the 'any' type and should be used sparingly,
29
29
  * if at all.
30
30
  */
31
- export declare type TSFixMe = any;
31
+ export type TSFixMe = any;
32
32
  /**
33
33
  * This type allows for converting an object const into an enum-like construct,
34
34
  * e.g. value: ValueOf<typeof EnumLike> will only allow value to be a value
35
35
  * defined in EnumLike.
36
36
  */
37
- export declare type ValueOf<T> = T[keyof T];
37
+ export type ValueOf<T> = T[keyof T];
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("react-table");
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "0.37.9",
3
+ "version": "0.39.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "Huw Wilkins <huw.wilkins@canonical.com>",
@@ -22,88 +22,88 @@
22
22
  },
23
23
  "homepage": "https://canonical.github.io/react-components",
24
24
  "devDependencies": {
25
- "@babel/cli": "7.18.9",
26
- "@babel/eslint-parser": "7.18.9",
25
+ "@babel/cli": "7.20.7",
26
+ "@babel/eslint-parser": "7.19.1",
27
27
  "@babel/preset-typescript": "7.18.6",
28
- "@percy/cli": "1.7.2",
29
- "@percy/storybook": "4.3.1",
30
- "@storybook/addon-a11y": "6.5.10",
31
- "@storybook/addon-controls": "6.5.10",
32
- "@storybook/addon-docs": "6.4.22",
33
- "@storybook/addons": "6.5.10",
34
- "@storybook/builder-webpack5": "6.5.10",
35
- "@storybook/manager-webpack5": "6.5.10",
36
- "@storybook/react": "6.5.10",
37
- "@storybook/theming": "6.5.10",
38
- "@testing-library/cypress": "8.0.3",
39
- "@testing-library/dom": "8.16.0",
40
- "@testing-library/jest-dom": "5.16.4",
28
+ "@percy/cli": "1.18.0",
29
+ "@percy/storybook": "4.3.4",
30
+ "@storybook/addon-a11y": "6.5.16",
31
+ "@storybook/addon-controls": "6.5.16",
32
+ "@storybook/addon-docs": "6.5.16",
33
+ "@storybook/addons": "6.5.16",
34
+ "@storybook/builder-webpack5": "6.5.16",
35
+ "@storybook/manager-webpack5": "6.5.16",
36
+ "@storybook/react": "6.5.16",
37
+ "@storybook/theming": "6.5.16",
38
+ "@testing-library/cypress": "8.0.7",
39
+ "@testing-library/dom": "8.20.0",
40
+ "@testing-library/jest-dom": "5.16.5",
41
41
  "@testing-library/react": "12.1.5",
42
42
  "@testing-library/react-hooks": "8.0.1",
43
- "@testing-library/user-event": "14.3.0",
44
- "@typescript-eslint/eslint-plugin": "5.32.0",
45
- "@typescript-eslint/parser": "5.32.0",
43
+ "@testing-library/user-event": "14.4.3",
44
+ "@typescript-eslint/eslint-plugin": "5.51.0",
45
+ "@typescript-eslint/parser": "5.51.0",
46
46
  "babel-jest": "27.5.1",
47
- "babel-loader": "8.2.5",
48
- "babel-plugin-module-resolver": "4.1.0",
47
+ "babel-loader": "9.1.2",
48
+ "babel-plugin-module-resolver": "5.0.0",
49
49
  "babel-plugin-typescript-to-proptypes": "2.0.0",
50
- "concurrently": "7.3.0",
51
- "css-loader": "6.7.1",
50
+ "concurrently": "7.6.0",
51
+ "css-loader": "6.7.3",
52
52
  "cypress": "9.7.0",
53
- "deepmerge": "4.2.2",
54
- "eslint": "8.21.0",
55
- "eslint-config-prettier": "8.5.0",
53
+ "deepmerge": "4.3.0",
54
+ "eslint": "8.33.0",
55
+ "eslint-config-prettier": "8.6.0",
56
56
  "eslint-config-react-app": "7.0.1",
57
57
  "eslint-plugin-cypress": "2.12.1",
58
58
  "eslint-plugin-flowtype": "8.0.3",
59
- "eslint-plugin-import": "2.26.0",
60
- "eslint-plugin-jsx-a11y": "6.6.1",
59
+ "eslint-plugin-import": "2.27.5",
60
+ "eslint-plugin-jsx-a11y": "6.7.1",
61
61
  "eslint-plugin-prettier": "4.2.1",
62
- "eslint-plugin-react": "7.30.1",
62
+ "eslint-plugin-react": "7.32.2",
63
63
  "eslint-plugin-react-hooks": "4.6.0",
64
- "eslint-plugin-testing-library": "5.6.0",
64
+ "eslint-plugin-testing-library": "5.10.0",
65
65
  "jest": "27.5.1",
66
66
  "npm-package-json-lint": "5.4.2",
67
- "prettier": "2.7.1",
67
+ "prettier": "2.8.4",
68
68
  "react": "17.0.2",
69
69
  "react-docgen-typescript-loader": "3.7.2",
70
70
  "react-dom": "17.0.2",
71
- "sass": "1.54.0",
72
- "sass-loader": "10.3.1",
71
+ "sass": "1.58.0",
72
+ "sass-loader": "10.4.1",
73
73
  "style-loader": "3.3.1",
74
- "stylelint": "14.9.1",
75
- "stylelint-config-prettier": "9.0.3",
74
+ "stylelint": "14.16.1",
75
+ "stylelint-config-prettier": "9.0.4",
76
76
  "stylelint-config-recommended-scss": "5.0.2",
77
77
  "stylelint-order": "5.0.0",
78
78
  "stylelint-prettier": "2.0.0",
79
79
  "ts-jest": "27.1.5",
80
- "tsc-alias": "1.7.0",
81
- "typescript": "4.7.4",
82
- "vanilla-framework": "3.10.0",
80
+ "tsc-alias": "1.8.2",
81
+ "typescript": "4.9.5",
82
+ "vanilla-framework": "3.11.1",
83
83
  "wait-on": "5.3.0",
84
- "webpack": "5.74.0"
84
+ "webpack": "5.75.0"
85
85
  },
86
86
  "dependencies": {
87
87
  "@types/jest": "27.5.2",
88
- "@types/node": "16.11.47",
89
- "@types/react": "17.0.48",
90
- "@types/react-dom": "17.0.17",
91
- "@types/react-table": "7.7.12",
92
- "classnames": "2.3.1",
88
+ "@types/node": "16.18.12",
89
+ "@types/react": "18.0.28",
90
+ "@types/react-dom": "17.0.18",
91
+ "@types/react-table": "7.7.14",
92
+ "classnames": "2.3.2",
93
93
  "nanoid": "3.3.4",
94
94
  "prop-types": "15.8.1",
95
95
  "react-table": "7.8.0",
96
96
  "react-useportal": "1.0.17"
97
97
  },
98
98
  "resolutions": {
99
- "@types/react": "17.0.48",
100
- "@types/react-dom": "17.0.17",
99
+ "@types/react": "18.0.28",
100
+ "@types/react-dom": "17.0.18",
101
101
  "postcss": "^8.3.11"
102
102
  },
103
103
  "peerDependencies": {
104
104
  "react": "^17.0.2 || ^18.0.0",
105
105
  "react-dom": "^17.0.2 || ^18.0.0",
106
- "vanilla-framework": "3.10.0"
106
+ "vanilla-framework": "3.11.1"
107
107
  },
108
108
  "scripts": {
109
109
  "build": "rm -rf dist && yarn build-local; yarn build-declaration",