@kaizen/components 1.70.23 → 1.71.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.
@@ -26,36 +26,49 @@ var CalendarPopover = function (_a) {
26
26
  var _b = React.useState(null),
27
27
  floatingElement = _b[0],
28
28
  setFloatingElement = _b[1];
29
- var floatingStyles = reactDom.useFloating(tslib.__assign({
30
- placement: 'bottom-start',
31
- elements: {
32
- reference: referenceElement,
33
- floating: floatingElement
34
- },
35
- strategy: 'fixed',
36
- middleware: [reactDom.size({
37
- apply: function (_a) {
38
- var availableHeight = _a.availableHeight,
39
- availableWidth = _a.availableWidth,
40
- elements = _a.elements;
41
- Object.assign(elements.floating.style, {
42
- // 155 is enough of a minimum to cut off half of the second row of dates.
43
- // This indicates to users that there is more content that is scrollable
44
- maxHeight: "".concat(Math.max(availableHeight - 25, 155), "px"),
45
- maxWidth: "".concat(availableWidth, "px")
46
- });
47
- }
48
- }), reactDom.offset(15), reactDom.autoPlacement({
49
- allowedPlacements: ['bottom-start', 'bottom', 'top-start', 'top']
50
- })],
51
- whileElementsMounted: reactDom.autoUpdate
52
- }, floatingOptions)).floatingStyles;
29
+ var _c = reactDom.useFloating(tslib.__assign({
30
+ placement: 'bottom-start',
31
+ elements: {
32
+ reference: referenceElement,
33
+ floating: floatingElement
34
+ },
35
+ strategy: 'fixed',
36
+ middleware: [reactDom.size({
37
+ apply: function (_a) {
38
+ var availableHeight = _a.availableHeight,
39
+ availableWidth = _a.availableWidth,
40
+ elements = _a.elements;
41
+ Object.assign(elements.floating.style, {
42
+ // 155 is enough of a minimum to cut off half of the second row of dates.
43
+ // This indicates to users that there is more content that is scrollable
44
+ maxHeight: "".concat(Math.max(availableHeight - 25, 155), "px"),
45
+ maxWidth: "".concat(availableWidth, "px")
46
+ });
47
+ }
48
+ }), reactDom.offset(15), reactDom.autoPlacement({
49
+ allowedPlacements: ['bottom-start', 'bottom', 'top-start', 'top']
50
+ })],
51
+ whileElementsMounted: reactDom.autoUpdate
52
+ }, floatingOptions)),
53
+ floatingStyles = _c.floatingStyles,
54
+ update = _c.update;
55
+ React.useEffect(function () {
56
+ var _a;
57
+ if (floatingElement && referenceElement) {
58
+ // @ts-expect-error this can be removed when we update to react 19
59
+ referenceElement.popoverTargetElement = floatingElement;
60
+ (_a = floatingElement.showPopover) === null || _a === undefined ? undefined : _a.call(floatingElement);
61
+ update();
62
+ }
63
+ }, [referenceElement, floatingElement, update]);
53
64
  return React__default.default.createElement("div", tslib.__assign({
54
65
  ref: setFloatingElement,
55
66
  style: floatingStyles,
56
67
  className: classnames__default.default(CalendarPopover_module.calendarPopover, classNameOverride),
57
68
  role: "dialog",
58
- "aria-modal": "true"
69
+ "aria-modal": "true",
70
+ // @ts-expect-error this can be removed when we update to react 19
71
+ popover: "manual"
59
72
  }, restProps), children);
60
73
  };
61
74
  CalendarPopover.displayName = 'CalendarPopover';
@@ -3,7 +3,6 @@
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var Icon = require('../../../__rc__/Icon/Icon.cjs');
6
- require('vitest');
7
6
  var listIsActive = require('../../utils/commands/listIsActive.cjs');
8
7
  var markIsActive = require('../../utils/commands/markIsActive.cjs');
9
8
  require('prosemirror-transform');
@@ -2,7 +2,6 @@
2
2
 
3
3
  var debounce = require('lodash.debounce');
4
4
  var ProseMirrorState = require('prosemirror-state');
5
- require('vitest');
6
5
  var getMarkAttrs = require('../../commands/getMarkAttrs.cjs');
7
6
  var getMarkRange = require('../../commands/getMarkRange.cjs');
8
7
  require('prosemirror-utils');
@@ -355,7 +355,6 @@ var RichTextEditor = require('./RichTextEditor/RichTextEditor/RichTextEditor.cjs
355
355
  var ToggleIconButton = require('./RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/ToggleIconButton.cjs');
356
356
  var Toolbar = require('./RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.cjs');
357
357
  var ToolbarSection = require('./RichTextEditor/RichTextEditor/subcomponents/ToolbarSection/ToolbarSection.cjs');
358
- var mockRangeForBoundingRect = require('./RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.cjs');
359
358
  var addMark = require('./RichTextEditor/utils/commands/addMark.cjs');
360
359
  var getMarkAttrs = require('./RichTextEditor/utils/commands/getMarkAttrs.cjs');
361
360
  var getMarkRange = require('./RichTextEditor/utils/commands/getMarkRange.cjs');
@@ -982,7 +981,6 @@ exports.RichTextEditor = RichTextEditor.RichTextEditor;
982
981
  exports.ToggleIconButton = ToggleIconButton.ToggleIconButton;
983
982
  exports.Toolbar = Toolbar.Toolbar;
984
983
  exports.ToolbarSection = ToolbarSection.ToolbarSection;
985
- exports.mockRangeForBoundingRect = mockRangeForBoundingRect.mockRangeForBoundingRect;
986
984
  exports.addMark = addMark.addMark;
987
985
  exports.getMarkAttrs = getMarkAttrs.getMarkAttrs;
988
986
  exports.getMarkRange = getMarkRange.getMarkRange;
@@ -1,5 +1,5 @@
1
1
  import { __rest, __assign } from 'tslib';
2
- import React, { useState } from 'react';
2
+ import React, { useState, useEffect } from 'react';
3
3
  import { useFloating, size, offset, autoPlacement, autoUpdate } from '@floating-ui/react-dom';
4
4
  import classnames from 'classnames';
5
5
  import styles from './CalendarPopover.module.scss.mjs';
@@ -18,36 +18,49 @@ const CalendarPopover = /*#__PURE__*/function () {
18
18
  var _b = useState(null),
19
19
  floatingElement = _b[0],
20
20
  setFloatingElement = _b[1];
21
- var floatingStyles = useFloating(__assign({
22
- placement: 'bottom-start',
23
- elements: {
24
- reference: referenceElement,
25
- floating: floatingElement
26
- },
27
- strategy: 'fixed',
28
- middleware: [size({
29
- apply: function (_a) {
30
- var availableHeight = _a.availableHeight,
31
- availableWidth = _a.availableWidth,
32
- elements = _a.elements;
33
- Object.assign(elements.floating.style, {
34
- // 155 is enough of a minimum to cut off half of the second row of dates.
35
- // This indicates to users that there is more content that is scrollable
36
- maxHeight: "".concat(Math.max(availableHeight - 25, 155), "px"),
37
- maxWidth: "".concat(availableWidth, "px")
38
- });
39
- }
40
- }), offset(15), autoPlacement({
41
- allowedPlacements: ['bottom-start', 'bottom', 'top-start', 'top']
42
- })],
43
- whileElementsMounted: autoUpdate
44
- }, floatingOptions)).floatingStyles;
21
+ var _c = useFloating(__assign({
22
+ placement: 'bottom-start',
23
+ elements: {
24
+ reference: referenceElement,
25
+ floating: floatingElement
26
+ },
27
+ strategy: 'fixed',
28
+ middleware: [size({
29
+ apply: function (_a) {
30
+ var availableHeight = _a.availableHeight,
31
+ availableWidth = _a.availableWidth,
32
+ elements = _a.elements;
33
+ Object.assign(elements.floating.style, {
34
+ // 155 is enough of a minimum to cut off half of the second row of dates.
35
+ // This indicates to users that there is more content that is scrollable
36
+ maxHeight: "".concat(Math.max(availableHeight - 25, 155), "px"),
37
+ maxWidth: "".concat(availableWidth, "px")
38
+ });
39
+ }
40
+ }), offset(15), autoPlacement({
41
+ allowedPlacements: ['bottom-start', 'bottom', 'top-start', 'top']
42
+ })],
43
+ whileElementsMounted: autoUpdate
44
+ }, floatingOptions)),
45
+ floatingStyles = _c.floatingStyles,
46
+ update = _c.update;
47
+ useEffect(function () {
48
+ var _a;
49
+ if (floatingElement && referenceElement) {
50
+ // @ts-expect-error this can be removed when we update to react 19
51
+ referenceElement.popoverTargetElement = floatingElement;
52
+ (_a = floatingElement.showPopover) === null || _a === undefined ? undefined : _a.call(floatingElement);
53
+ update();
54
+ }
55
+ }, [referenceElement, floatingElement, update]);
45
56
  return /*#__PURE__*/React.createElement("div", __assign({
46
57
  ref: setFloatingElement,
47
58
  style: floatingStyles,
48
59
  className: classnames(styles.calendarPopover, classNameOverride),
49
60
  role: "dialog",
50
- "aria-modal": "true"
61
+ "aria-modal": "true",
62
+ // @ts-expect-error this can be removed when we update to react 19
63
+ popover: "manual"
51
64
  }, restProps), children);
52
65
  };
53
66
  CalendarPopover.displayName = 'CalendarPopover';
@@ -1,7 +1,6 @@
1
1
  import { __assign } from 'tslib';
2
2
  import React from 'react';
3
3
  import { Icon } from '../../../__rc__/Icon/Icon.mjs';
4
- import 'vitest';
5
4
  import { listIsActive } from '../../utils/commands/listIsActive.mjs';
6
5
  import { markIsActive } from '../../utils/commands/markIsActive.mjs';
7
6
  import 'prosemirror-transform';
@@ -1,6 +1,5 @@
1
1
  import debounce from 'lodash.debounce';
2
2
  import { Plugin } from 'prosemirror-state';
3
- import 'vitest';
4
3
  import { getMarkAttrs } from '../../commands/getMarkAttrs.mjs';
5
4
  import { getMarkRange } from '../../commands/getMarkRange.mjs';
6
5
  import 'prosemirror-utils';
@@ -353,7 +353,6 @@ export { RichTextEditor } from './RichTextEditor/RichTextEditor/RichTextEditor.m
353
353
  export { ToggleIconButton } from './RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/ToggleIconButton.mjs';
354
354
  export { Toolbar } from './RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.mjs';
355
355
  export { ToolbarSection } from './RichTextEditor/RichTextEditor/subcomponents/ToolbarSection/ToolbarSection.mjs';
356
- export { mockRangeForBoundingRect } from './RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.mjs';
357
356
  export { addMark } from './RichTextEditor/utils/commands/addMark.mjs';
358
357
  export { getMarkAttrs } from './RichTextEditor/utils/commands/getMarkAttrs.mjs';
359
358
  export { getMarkRange } from './RichTextEditor/utils/commands/getMarkRange.mjs';