@linzjs/lui 17.46.0 → 17.47.1

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [17.47.1](https://github.com/linz/lui/compare/v17.47.0...v17.47.1) (2023-04-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * release luitooltip offset change ([#916](https://github.com/linz/lui/issues/916)) ([19a1f37](https://github.com/linz/lui/commit/19a1f37776e0736191359555d4fa163a58dee3c9))
7
+
8
+ # [17.47.0](https://github.com/linz/lui/compare/v17.46.0...v17.47.0) (2023-03-29)
9
+
10
+
11
+ ### Features
12
+
13
+ * Allow onClose timeout to be separately configured for LuiToastMessage ([#908](https://github.com/linz/lui/issues/908)) ([c9629a1](https://github.com/linz/lui/commit/c9629a1a7694bd712f95907fb63e3494da6a3cfd))
14
+
1
15
  # [17.46.0](https://github.com/linz/lui/compare/v17.45.4...v17.46.0) (2023-03-29)
2
16
 
3
17
 
@@ -11,6 +11,8 @@ interface ILuiToastMessageProps {
11
11
  requireDismiss?: boolean;
12
12
  /** called when all said and done, allows the consumer to remove from React Dom */
13
13
  onClose?: () => void;
14
+ /** delay before calling onClose, defaults to displayTimeout */
15
+ onCloseDelay?: number;
14
16
  children?: React.ReactNode;
15
17
  type?: 'button' | 'submit' | 'reset';
16
18
  }
@@ -12,5 +12,6 @@ export interface ILuiTooltipProperties {
12
12
  mode?: 'default' | 'info' | 'error';
13
13
  interactive?: boolean;
14
14
  allowHTML?: boolean;
15
+ offset?: [number, number];
15
16
  }
16
17
  export declare const LuiTooltip: (props: ILuiTooltipProperties) => JSX.Element;
package/dist/index.js CHANGED
@@ -12992,15 +12992,15 @@ var LuiFloatingWindow = function (props) {
12992
12992
  };
12993
12993
 
12994
12994
  var LuiToastMessage = function (_a) {
12995
- var level = _a.level, _b = _a.displayTimeout, displayTimeout = _b === void 0 ? 4000 : _b, _c = _a.display, display = _c === void 0 ? true : _c, requireDismiss = _a.requireDismiss, onClose = _a.onClose, children = _a.children, type = _a.type;
12996
- var _d = React$1.useState('lui-msg-toast-show'), className = _d[0], setClassname = _d[1];
12997
- var _e = React$1.useState(undefined), fadeOutTimer = _e[0], setFadeOutTimer = _e[1];
12998
- var _f = React$1.useState(undefined), removeTimer = _f[0], setRemoveTimer = _f[1];
12995
+ var level = _a.level, _b = _a.displayTimeout, displayTimeout = _b === void 0 ? 4000 : _b, _c = _a.display, display = _c === void 0 ? true : _c, requireDismiss = _a.requireDismiss, onClose = _a.onClose, _d = _a.onCloseDelay, onCloseDelay = _d === void 0 ? displayTimeout : _d, children = _a.children, type = _a.type;
12996
+ var _e = React$1.useState('lui-msg-toast-show'), className = _e[0], setClassname = _e[1];
12997
+ var _f = React$1.useState(undefined), fadeOutTimer = _f[0], setFadeOutTimer = _f[1];
12998
+ var _g = React$1.useState(undefined), removeTimer = _g[0], setRemoveTimer = _g[1];
12999
12999
  var materialIcon = getMaterialIconForLevel(level);
13000
13000
  var callOnCloseAfterDissolved = function () {
13001
13001
  // This is so the caller can remove it from the dom
13002
13002
  if (onClose) {
13003
- var timer = window.setTimeout(onClose, displayTimeout);
13003
+ var timer = window.setTimeout(onClose, onCloseDelay);
13004
13004
  setRemoveTimer(timer);
13005
13005
  }
13006
13006
  };
@@ -47287,7 +47287,7 @@ styleInject(css_248z$4);
47287
47287
  var id = 0;
47288
47288
  var getKey = function () { return id++; };
47289
47289
  var LuiTooltip = function (props) {
47290
- var children = props.children, message = props.message, placement = props.placement, trigger = props.trigger, _a = props.animation, animation = _a === void 0 ? true : _a, _b = props.followCursor, followCursor$1 = _b === void 0 ? false : _b, _c = props.mode, mode = _c === void 0 ? 'default' : _c, _d = props.interactive, interactive = _d === void 0 ? false : _d, _e = props.allowHTML, allowHTML = _e === void 0 ? false : _e;
47290
+ var children = props.children, message = props.message, placement = props.placement, trigger = props.trigger, _a = props.animation, animation = _a === void 0 ? true : _a, _b = props.followCursor, followCursor$1 = _b === void 0 ? false : _b, _c = props.mode, mode = _c === void 0 ? 'default' : _c, _d = props.interactive, interactive = _d === void 0 ? false : _d, _e = props.allowHTML, allowHTML = _e === void 0 ? false : _e, _f = props.offset, offset = _f === void 0 ? [0, 18] : _f;
47291
47291
  var id = "LuiToolTip_".concat(React$1.useMemo(getKey, []));
47292
47292
  if (typeof message !== 'string') {
47293
47293
  throw new Error('LuiTooltip message must be a string!');
@@ -47299,7 +47299,7 @@ var LuiTooltip = function (props) {
47299
47299
  trigger: trigger,
47300
47300
  theme: mode,
47301
47301
  placement: placement,
47302
- offset: [0, 18],
47302
+ offset: offset,
47303
47303
  animation: animation,
47304
47304
  followCursor: followCursor$1,
47305
47305
  interactive: interactive,