@jetbrains/ring-ui-built 7.0.124 → 8.0.0-beta.10

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 (262) hide show
  1. package/components/_helpers/anchor.js +1 -1
  2. package/components/_helpers/avatar-info.js +3 -5
  3. package/components/_helpers/caption.js +1 -1
  4. package/components/_helpers/icon-svg.js +37 -52
  5. package/components/_helpers/legacy-table.js +3 -0
  6. package/components/_helpers/tab-link.js +1 -1
  7. package/components/_helpers/table.js +2 -2
  8. package/components/_helpers/theme.js +49 -37
  9. package/components/alert/alert-actions.js +1 -1
  10. package/components/alert/alert-heading.js +1 -1
  11. package/components/alert/alert.js +2 -2
  12. package/components/alert-service/alert-service.js +2 -2
  13. package/components/auth/auth-core.js +2 -2
  14. package/components/auth/auth.js +2 -2
  15. package/components/auth/down-notification.js +2 -2
  16. package/components/auth/iframe-flow.js +1 -1
  17. package/components/auth/storage.js +2 -2
  18. package/components/auth-dialog/auth-dialog.js +2 -2
  19. package/components/auth-dialog-service/auth-dialog-service.js +2 -2
  20. package/components/avatar/avatar-info.js +1 -1
  21. package/components/avatar/avatar-size.d.ts +0 -4
  22. package/components/avatar/avatar-size.js +0 -4
  23. package/components/avatar/avatar.js +1 -8
  24. package/components/avatar/fallback-avatar.js +3 -48
  25. package/components/avatar-stack/avatar-stack.js +5 -5
  26. package/components/banner/banner.js +2 -2
  27. package/components/button/button.d.ts +0 -4
  28. package/components/button/button.js +4 -10
  29. package/components/button-group/button-group.js +1 -1
  30. package/components/button-toolbar/button-toolbar.js +1 -1
  31. package/components/checkbox/checkbox.d.ts +1 -1
  32. package/components/checkbox/checkbox.js +1 -2
  33. package/components/clipboard/clipboard.js +2 -2
  34. package/components/collapse/collapse-content.js +35 -43
  35. package/components/collapse/collapse-context.d.ts +1 -0
  36. package/components/collapse/collapse-context.js +1 -0
  37. package/components/collapse/collapse-control.js +5 -5
  38. package/components/collapse/collapse.js +34 -25
  39. package/components/collapsible-group/collapsible-group.d.ts +5 -1
  40. package/components/collapsible-group/collapsible-group.js +80 -98
  41. package/components/components/util-stories.js +63 -1
  42. package/components/confirm/confirm.js +2 -2
  43. package/components/confirm-service/confirm-service.js +4 -4
  44. package/components/contenteditable/contenteditable.js +4 -5
  45. package/components/control-help/control-help.js +1 -1
  46. package/components/control-label/control-label.js +1 -1
  47. package/components/data-list/data-list.d.ts +4 -4
  48. package/components/data-list/data-list.js +5 -5
  49. package/components/data-list/data-list.mock.d.ts +1 -1
  50. package/components/data-list/data-list.mock.js +2 -2
  51. package/components/data-list/item.d.ts +1 -1
  52. package/components/data-list/item.js +3 -3
  53. package/components/data-list/selection.d.ts +1 -1
  54. package/components/data-list/selection.js +2 -2
  55. package/components/data-list/title.js +1 -2
  56. package/components/date-picker/date-input.js +2 -2
  57. package/components/date-picker/date-picker.js +2 -3
  58. package/components/date-picker/date-popup.js +4 -5
  59. package/components/date-picker/month-names.js +1 -1
  60. package/components/date-picker/month-slider.js +1 -1
  61. package/components/date-picker/month.d.ts +0 -2
  62. package/components/date-picker/month.js +17 -18
  63. package/components/date-picker/months.js +43 -36
  64. package/components/date-picker/use-scroll-behavior.js +45 -45
  65. package/components/date-picker/weekdays.js +1 -1
  66. package/components/date-picker/years.js +61 -55
  67. package/components/dialog/dialog.d.ts +2 -2
  68. package/components/dialog/dialog.js +5 -5
  69. package/components/dropdown/anchor.js +3 -3
  70. package/components/dropdown/dropdown.js +3 -3
  71. package/components/dropdown-menu/dropdown-menu.d.ts +4 -4
  72. package/components/dropdown-menu/dropdown-menu.js +63 -58
  73. package/components/editable-heading/editable-heading.d.ts +1 -2
  74. package/components/editable-heading/editable-heading.js +14 -13
  75. package/components/error-bubble/error-bubble.js +1 -1
  76. package/components/error-message/error-message.js +1 -2
  77. package/components/footer/footer.js +1 -1
  78. package/components/global/compose-refs.d.ts +2 -1
  79. package/components/global/compose-refs.js +44 -8
  80. package/components/global/configuration.d.ts +0 -5
  81. package/components/global/configuration.js +2 -10
  82. package/components/global/controls-height.js +1 -1
  83. package/components/global/create-stateful-context.js +11 -11
  84. package/components/global/focus-sensor-hoc.js +1 -0
  85. package/components/global/focus-with-temporary-tabindex.d.ts +11 -0
  86. package/components/global/focus-with-temporary-tabindex.js +23 -0
  87. package/components/global/intersection-observer-context.d.ts +46 -0
  88. package/components/global/intersection-observer-context.js +138 -0
  89. package/components/global/is-within-interactive-element.d.ts +6 -0
  90. package/components/global/is-within-interactive-element.js +11 -0
  91. package/components/global/is-within-navigable-element.d.ts +6 -0
  92. package/components/global/is-within-navigable-element.js +11 -0
  93. package/components/global/parse-css-duration.d.ts +5 -0
  94. package/components/global/parse-css-duration.js +14 -0
  95. package/components/global/rerender-hoc.d.ts +4 -2
  96. package/components/global/rerender-hoc.js +11 -24
  97. package/components/global/schedule-with-cleanup.d.ts +12 -0
  98. package/components/global/schedule-with-cleanup.js +36 -0
  99. package/components/{table/selection.d.ts → global/table-selection.d.ts} +15 -15
  100. package/components/{table/selection.js → global/table-selection.js} +5 -5
  101. package/components/global/theme.d.ts +4 -3
  102. package/components/global/theme.js +1 -1
  103. package/components/global/variables.interface.d.ts +0 -4
  104. package/components/header/header-icon.js +3 -3
  105. package/components/header/header.js +3 -3
  106. package/components/header/links.js +1 -1
  107. package/components/header/logo.js +1 -2
  108. package/components/header/profile.js +5 -5
  109. package/components/header/services.js +3 -3
  110. package/components/header/smart-profile.js +3 -3
  111. package/components/header/smart-services.js +3 -3
  112. package/components/heading/heading.js +1 -1
  113. package/components/i18n/i18n-context.js +4 -4
  114. package/components/icon/icon-svg.js +1 -2
  115. package/components/icon/icon.d.ts +0 -1
  116. package/components/icon/icon.js +2 -6
  117. package/components/icon/index.js +1 -2
  118. package/components/input/input.d.ts +1 -1
  119. package/components/input/input.js +3 -3
  120. package/components/internal/reorder-animation-context.js +159 -0
  121. package/components/internal/reorder-handle.js +750 -0
  122. package/components/internal/reorder-layout-context.js +141 -0
  123. package/components/internal/table-header.js +685 -0
  124. package/components/internal/virtualization.js +368 -0
  125. package/components/island/adaptive-island-hoc.js +3 -3
  126. package/components/island/content.d.ts +7 -2
  127. package/components/island/content.js +27 -18
  128. package/components/island/header.js +1 -1
  129. package/components/island/island.js +1 -1
  130. package/components/{table → legacy-table}/cell.js +1 -1
  131. package/components/{table → legacy-table}/header-cell.js +2 -3
  132. package/components/{table → legacy-table}/header.js +2 -3
  133. package/components/{table → legacy-table}/multitable.d.ts +1 -1
  134. package/components/{table → legacy-table}/row-with-focus-sensor.js +3 -3
  135. package/components/{table → legacy-table}/row.d.ts +1 -1
  136. package/components/{table → legacy-table}/row.js +5 -5
  137. package/components/legacy-table/selection-adapter.d.ts +6 -0
  138. package/components/{table → legacy-table}/selection-shortcuts-hoc.d.ts +5 -5
  139. package/components/{table → legacy-table}/simple-table.d.ts +2 -2
  140. package/components/{table → legacy-table}/simple-table.js +5 -5
  141. package/components/{table → legacy-table}/smart-table.d.ts +5 -5
  142. package/components/{table → legacy-table}/smart-table.js +6 -6
  143. package/components/legacy-table/table.d.ts +109 -0
  144. package/components/legacy-table/table.js +369 -0
  145. package/components/list/consts.d.ts +0 -1
  146. package/components/list/consts.js +0 -1
  147. package/components/list/list-item.js +3 -5
  148. package/components/list/list-users-groups-source.js +1 -2
  149. package/components/list/list.d.ts +0 -4
  150. package/components/list/list.js +1 -2
  151. package/components/login-dialog/login-dialog.js +3 -3
  152. package/components/login-dialog/service.js +2 -2
  153. package/components/message/message.js +1 -1
  154. package/components/pager/pager.js +3 -3
  155. package/components/popup/popup.js +1 -1
  156. package/components/popup/popup.target.d.ts +3 -2
  157. package/components/popup/popup.target.js +32 -28
  158. package/components/popup-menu/popup-menu.js +1 -1
  159. package/components/query-assist/query-assist-suggestions.js +1 -2
  160. package/components/query-assist/query-assist.d.ts +3 -1
  161. package/components/query-assist/query-assist.js +2 -2
  162. package/components/radio/radio-item.d.ts +3 -3
  163. package/components/radio/radio-item.js +33 -19
  164. package/components/radio/radio.d.ts +2 -2
  165. package/components/radio/radio.js +2 -2
  166. package/components/scrollable-section/scrollable-section.js +1 -1
  167. package/components/select/chevron-button.js +3 -3
  168. package/components/select/select-filter.js +3 -3
  169. package/components/select/select-popup.d.ts +3 -2
  170. package/components/select/select-popup.js +9 -4
  171. package/components/select/select.d.ts +6 -2
  172. package/components/select/select.js +5 -4
  173. package/components/selection-toolbar/selection-toolbar.d.ts +11 -0
  174. package/components/selection-toolbar/selection-toolbar.js +200 -0
  175. package/components/slider/slider.js +100 -97
  176. package/components/storage/storage-local.js +2 -2
  177. package/components/storage/storage.js +2 -2
  178. package/components/style.css +1 -1
  179. package/components/tab-trap/tab-trap.d.ts +3 -3
  180. package/components/tab-trap/tab-trap.js +83 -80
  181. package/components/table/default-item-renderer.d.ts +55 -0
  182. package/components/table/default-item-renderer.js +240 -0
  183. package/components/table/internal/reorder-animation-context.d.ts +21 -0
  184. package/components/table/internal/reorder-handle.d.ts +9 -0
  185. package/components/table/internal/reorder-layout-context.d.ts +16 -0
  186. package/components/table/internal/table-header.d.ts +1 -0
  187. package/components/table/internal/virtualization.d.ts +41 -0
  188. package/components/table/item-virtualization.d.ts +37 -0
  189. package/components/table/item-virtualization.js +73 -0
  190. package/components/table/reorder-animation.d.ts +37 -0
  191. package/components/table/reorder-animation.js +18 -0
  192. package/components/table/reorder-item-layout.d.ts +32 -0
  193. package/components/table/reorder-item-layout.js +57 -0
  194. package/components/table/table-const.d.ts +10 -0
  195. package/components/table/table-const.js +13 -0
  196. package/components/table/table-primitives.d.ts +64 -0
  197. package/components/table/table-primitives.js +180 -0
  198. package/components/table/table-props.d.ts +304 -0
  199. package/components/table/table-props.js +1 -0
  200. package/components/table/table.d.ts +231 -107
  201. package/components/table/table.js +351 -346
  202. package/components/tabs/collapsible-more.js +1 -1
  203. package/components/tabs/collapsible-tab.js +1 -1
  204. package/components/tabs/collapsible-tabs.js +1 -1
  205. package/components/tabs/dumb-tabs.js +1 -1
  206. package/components/tabs/smart-tabs.js +1 -1
  207. package/components/tabs/tab-link.js +1 -1
  208. package/components/tabs/tabs.js +1 -1
  209. package/components/tag/tag.js +1 -1
  210. package/components/tags-input/tags-input.d.ts +3 -1
  211. package/components/tags-input/tags-input.js +4 -4
  212. package/components/tags-list/tags-list.js +2 -2
  213. package/components/toggle/toggle.js +1 -1
  214. package/components/tooltip/tooltip.d.ts +2 -1
  215. package/components/tooltip/tooltip.js +5 -3
  216. package/components/upload/upload.d.ts +4 -3
  217. package/components/upload/upload.js +7 -30
  218. package/components/user-agreement/service.js +3 -3
  219. package/components/user-agreement/user-agreement.js +2 -2
  220. package/components/user-card/card.js +4 -4
  221. package/components/user-card/smart-user-card-tooltip.js +3 -3
  222. package/components/user-card/tooltip.js +3 -3
  223. package/components/user-card/user-card.js +5 -5
  224. package/components/util-stories.d.ts +26 -0
  225. package/package.json +8 -9
  226. package/components/__mocks__/old-browsers-message.js +0 -3
  227. package/components/_helpers/grid.js +0 -3
  228. package/components/_helpers/sidebar.js +0 -110
  229. package/components/content-layout/content-layout.d.ts +0 -20
  230. package/components/content-layout/content-layout.js +0 -50
  231. package/components/content-layout/sidebar.d.ts +0 -26
  232. package/components/content-layout/sidebar.js +0 -5
  233. package/components/date-picker/use-intersection-observer.d.ts +0 -6
  234. package/components/date-picker/use-intersection-observer.js +0 -93
  235. package/components/expand/collapsible-group.d.ts +0 -8
  236. package/components/expand/collapsible-group.js +0 -52
  237. package/components/global/composeRefs.d.ts +0 -6
  238. package/components/global/composeRefs.js +0 -9
  239. package/components/global/use-event-callback.d.ts +0 -4
  240. package/components/global/use-event-callback.js +0 -49
  241. package/components/grid/col.d.ts +0 -16
  242. package/components/grid/col.js +0 -63
  243. package/components/grid/grid.d.ts +0 -13
  244. package/components/grid/grid.js +0 -27
  245. package/components/grid/row.d.ts +0 -21
  246. package/components/grid/row.js +0 -72
  247. package/components/old-browsers-message/old-browsers-message-stop.d.ts +0 -1
  248. package/components/old-browsers-message/old-browsers-message-stop.js +0 -5
  249. package/components/old-browsers-message/old-browsers-message.d.ts +0 -5
  250. package/components/old-browsers-message/old-browsers-message.js +0 -89
  251. package/components/old-browsers-message/white-list.d.ts +0 -2
  252. package/components/old-browsers-message/white-list.js +0 -30
  253. package/components/table/selection-adapter.d.ts +0 -6
  254. /package/components/{table → legacy-table}/cell.d.ts +0 -0
  255. /package/components/{table → legacy-table}/disable-hover-hoc.d.ts +0 -0
  256. /package/components/{table → legacy-table}/disable-hover-hoc.js +0 -0
  257. /package/components/{table → legacy-table}/header-cell.d.ts +0 -0
  258. /package/components/{table → legacy-table}/header.d.ts +0 -0
  259. /package/components/{table → legacy-table}/multitable.js +0 -0
  260. /package/components/{table → legacy-table}/row-with-focus-sensor.d.ts +0 -0
  261. /package/components/{table → legacy-table}/selection-adapter.js +0 -0
  262. /package/components/{table → legacy-table}/selection-shortcuts-hoc.js +0 -0
@@ -2,6 +2,7 @@ import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  import * as React from 'react';
3
3
  export declare const FOCUSABLE_ELEMENTS = "input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])";
4
4
  export interface TabTrapProps extends HTMLAttributes<HTMLElement> {
5
+ ref?: React.Ref<TabTrapObject>;
5
6
  children: ReactNode;
6
7
  trapDisabled?: boolean;
7
8
  autoFocusFirst?: boolean;
@@ -11,8 +12,7 @@ export interface TabTrapProps extends HTMLAttributes<HTMLElement> {
11
12
  /**
12
13
  * @name TabTrap
13
14
  */
14
- interface TabTrap {
15
+ export interface TabTrapObject {
15
16
  node: HTMLElement | null;
16
17
  }
17
- declare const TabTrap: React.ForwardRefExoticComponent<TabTrapProps & React.RefAttributes<TabTrap>>;
18
- export default TabTrap;
18
+ export default function TabTrap({ ref, children, trapDisabled, autoFocusFirst, focusBackOnClose, focusBackOnExit, ...restProps }: TabTrapProps): React.JSX.Element;
@@ -1,21 +1,21 @@
1
- import { c } from 'react-compiler-runtime';
2
- import { forwardRef, useRef, useImperativeHandle, useEffect } from 'react';
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useRef, useImperativeHandle, useEffect } from 'react';
3
3
  import { isNodeInVisiblePartOfPage } from '../global/dom.js';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
 
6
6
  var styles = {"trapButton":"ring-tab-trap-trapButton"};
7
7
 
8
8
  const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])';
9
- // eslint-disable-next-line no-shadow
10
- const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
11
- const $ = c(38);
12
- if ($[0] !== "2100b1464fbf6825dd3f080feb9e20c095c3f9f9256eec8ae18adf474c19d1f2") {
13
- for (let $i = 0; $i < 38; $i += 1) {
9
+ function TabTrap(t0) {
10
+ const $ = c(39);
11
+ if ($[0] !== "daf3c9f73144edaae4842be22241426b0a063f37615637c8bca095939d2fdeaf") {
12
+ for (let $i = 0; $i < 39; $i += 1) {
14
13
  $[$i] = Symbol.for("react.memo_cache_sentinel");
15
14
  }
16
- $[0] = "2100b1464fbf6825dd3f080feb9e20c095c3f9f9256eec8ae18adf474c19d1f2";
15
+ $[0] = "daf3c9f73144edaae4842be22241426b0a063f37615637c8bca095939d2fdeaf";
17
16
  }
18
17
  let children;
18
+ let ref;
19
19
  let restProps;
20
20
  let t1;
21
21
  let t2;
@@ -23,6 +23,7 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
23
23
  let t4;
24
24
  if ($[1] !== t0) {
25
25
  ({
26
+ ref,
26
27
  children,
27
28
  trapDisabled: t1,
28
29
  autoFocusFirst: t2,
@@ -32,18 +33,20 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
32
33
  } = t0);
33
34
  $[1] = t0;
34
35
  $[2] = children;
35
- $[3] = restProps;
36
- $[4] = t1;
37
- $[5] = t2;
38
- $[6] = t3;
39
- $[7] = t4;
36
+ $[3] = ref;
37
+ $[4] = restProps;
38
+ $[5] = t1;
39
+ $[6] = t2;
40
+ $[7] = t3;
41
+ $[8] = t4;
40
42
  } else {
41
43
  children = $[2];
42
- restProps = $[3];
43
- t1 = $[4];
44
- t2 = $[5];
45
- t3 = $[6];
46
- t4 = $[7];
44
+ ref = $[3];
45
+ restProps = $[4];
46
+ t1 = $[5];
47
+ t2 = $[6];
48
+ t3 = $[7];
49
+ t4 = $[8];
47
50
  }
48
51
  const trapDisabled = t1 === undefined ? false : t1;
49
52
  const autoFocusFirst = t2 === undefined ? true : t2;
@@ -59,20 +62,20 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
59
62
  }
60
63
  let t5;
61
64
  let t6;
62
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
65
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
63
66
  t5 = () => ({
64
67
  node: nodeRef.current
65
68
  });
66
69
  t6 = [];
67
- $[8] = t5;
68
- $[9] = t6;
70
+ $[9] = t5;
71
+ $[10] = t6;
69
72
  } else {
70
- t5 = $[8];
71
- t6 = $[9];
73
+ t5 = $[9];
74
+ t6 = $[10];
72
75
  }
73
76
  useImperativeHandle(ref, t5, t6);
74
77
  let t7;
75
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
78
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
76
79
  t7 = function restoreFocusIfUnmounted(orElse) {
77
80
  const previousFocusedNode = previousFocusedNodeRef.current;
78
81
  if (previousFocusedNode instanceof HTMLElement && previousFocusedNode.focus && isNodeInVisiblePartOfPage(previousFocusedNode) && mountedRef.current === false) {
@@ -83,13 +86,13 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
83
86
  orElse?.();
84
87
  }
85
88
  };
86
- $[10] = t7;
89
+ $[11] = t7;
87
90
  } else {
88
- t7 = $[10];
91
+ t7 = $[11];
89
92
  }
90
93
  const restoreFocusIfUnmounted = t7;
91
94
  let t8;
92
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
95
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
93
96
  t8 = function focusElement(t9) {
94
97
  const first = t9 === undefined ? true : t9;
95
98
  const node = nodeRef.current;
@@ -102,30 +105,30 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
102
105
  toBeFocused.focus();
103
106
  }
104
107
  };
105
- $[11] = t8;
108
+ $[12] = t8;
106
109
  } else {
107
- t8 = $[11];
110
+ t8 = $[12];
108
111
  }
109
112
  const focusElement = t8;
110
113
  let t9;
111
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
114
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
112
115
  t9 = () => focusElement(true);
113
- $[12] = t9;
116
+ $[13] = t9;
114
117
  } else {
115
- t9 = $[12];
118
+ t9 = $[13];
116
119
  }
117
120
  const focusFirst = t9;
118
121
  let t10;
119
- if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
122
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
120
123
  t10 = () => focusElement(false);
121
- $[13] = t10;
124
+ $[14] = t10;
122
125
  } else {
123
- t10 = $[13];
126
+ t10 = $[14];
124
127
  }
125
128
  const focusLast = t10;
126
129
  let t11;
127
130
  let t12;
128
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
131
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
129
132
  t11 = () => {
130
133
  mountedRef.current = true;
131
134
  return () => {
@@ -133,16 +136,16 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
133
136
  };
134
137
  };
135
138
  t12 = [];
136
- $[14] = t11;
137
- $[15] = t12;
139
+ $[15] = t11;
140
+ $[16] = t12;
138
141
  } else {
139
- t11 = $[14];
140
- t12 = $[15];
142
+ t11 = $[15];
143
+ t12 = $[16];
141
144
  }
142
145
  useEffect(t11, t12);
143
146
  let t13;
144
147
  let t14;
145
- if ($[16] !== autoFocusFirst || $[17] !== focusBackOnClose || $[18] !== trapDisabled) {
148
+ if ($[17] !== autoFocusFirst || $[18] !== focusBackOnClose || $[19] !== trapDisabled) {
146
149
  t13 = () => {
147
150
  if (autoFocusFirst) {
148
151
  focusFirst();
@@ -163,18 +166,18 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
163
166
  };
164
167
  };
165
168
  t14 = [autoFocusFirst, trapDisabled, focusBackOnClose, focusFirst];
166
- $[16] = autoFocusFirst;
167
- $[17] = focusBackOnClose;
168
- $[18] = trapDisabled;
169
- $[19] = t13;
170
- $[20] = t14;
169
+ $[17] = autoFocusFirst;
170
+ $[18] = focusBackOnClose;
171
+ $[19] = trapDisabled;
172
+ $[20] = t13;
173
+ $[21] = t14;
171
174
  } else {
172
- t13 = $[19];
173
- t14 = $[20];
175
+ t13 = $[20];
176
+ t14 = $[21];
174
177
  }
175
178
  useEffect(t13, t14);
176
179
  let t15;
177
- if ($[21] !== focusBackOnExit) {
180
+ if ($[22] !== focusBackOnExit) {
178
181
  t15 = function focusLastIfEnabled(event) {
179
182
  if (trapWithoutFocusRef.current) {
180
183
  return;
@@ -188,14 +191,14 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
188
191
  focusLast();
189
192
  }
190
193
  };
191
- $[21] = focusBackOnExit;
192
- $[22] = t15;
194
+ $[22] = focusBackOnExit;
195
+ $[23] = t15;
193
196
  } else {
194
- t15 = $[22];
197
+ t15 = $[23];
195
198
  }
196
199
  const focusLastIfEnabled = t15;
197
200
  let t16;
198
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
201
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
199
202
  t16 = function handleBlurIfWithoutFocus(event_0) {
200
203
  if (!trapWithoutFocusRef.current) {
201
204
  return;
@@ -210,13 +213,13 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
210
213
  }
211
214
  focusLast();
212
215
  };
213
- $[23] = t16;
216
+ $[24] = t16;
214
217
  } else {
215
- t16 = $[23];
218
+ t16 = $[24];
216
219
  }
217
220
  const handleBlurIfWithoutFocus = t16;
218
221
  let t17;
219
- if ($[24] !== focusBackOnExit) {
222
+ if ($[25] !== focusBackOnExit) {
220
223
  t17 = function restoreFocusOrFocusFirst() {
221
224
  if (focusBackOnExit) {
222
225
  restoreFocusIfUnmounted(focusFirst);
@@ -224,30 +227,30 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
224
227
  focusFirst();
225
228
  }
226
229
  };
227
- $[24] = focusBackOnExit;
228
- $[25] = t17;
230
+ $[25] = focusBackOnExit;
231
+ $[26] = t17;
229
232
  } else {
230
- t17 = $[25];
233
+ t17 = $[26];
231
234
  }
232
235
  const restoreFocusOrFocusFirst = t17;
233
236
  if (trapDisabled) {
234
237
  let t18;
235
- if ($[26] !== children || $[27] !== restProps) {
238
+ if ($[27] !== children || $[28] !== restProps) {
236
239
  t18 = /*#__PURE__*/jsx("div", {
237
240
  ref: nodeRef,
238
241
  ...restProps,
239
242
  children: children
240
243
  });
241
- $[26] = children;
242
- $[27] = restProps;
243
- $[28] = t18;
244
+ $[27] = children;
245
+ $[28] = restProps;
246
+ $[29] = t18;
244
247
  } else {
245
- t18 = $[28];
248
+ t18 = $[29];
246
249
  }
247
250
  return t18;
248
251
  }
249
252
  let t18;
250
- if ($[29] !== focusLastIfEnabled) {
253
+ if ($[30] !== focusLastIfEnabled) {
251
254
  t18 = /*#__PURE__*/jsx("div", {
252
255
  tabIndex: 0,
253
256
  ref: trapButtonNodeRef,
@@ -256,40 +259,40 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
256
259
  onBlur: handleBlurIfWithoutFocus,
257
260
  "data-trap-button": true
258
261
  });
259
- $[29] = focusLastIfEnabled;
260
- $[30] = t18;
262
+ $[30] = focusLastIfEnabled;
263
+ $[31] = t18;
261
264
  } else {
262
- t18 = $[30];
265
+ t18 = $[31];
263
266
  }
264
267
  let t19;
265
- if ($[31] !== restoreFocusOrFocusFirst) {
268
+ if ($[32] !== restoreFocusOrFocusFirst) {
266
269
  t19 = /*#__PURE__*/jsx("div", {
267
270
  tabIndex: 0,
268
271
  onFocus: restoreFocusOrFocusFirst,
269
272
  "data-trap-button": true
270
273
  });
271
- $[31] = restoreFocusOrFocusFirst;
272
- $[32] = t19;
274
+ $[32] = restoreFocusOrFocusFirst;
275
+ $[33] = t19;
273
276
  } else {
274
- t19 = $[32];
277
+ t19 = $[33];
275
278
  }
276
279
  let t20;
277
- if ($[33] !== children || $[34] !== restProps || $[35] !== t18 || $[36] !== t19) {
280
+ if ($[34] !== children || $[35] !== restProps || $[36] !== t18 || $[37] !== t19) {
278
281
  t20 = /*#__PURE__*/jsxs("div", {
279
282
  ref: nodeRef,
280
283
  ...restProps,
281
284
  children: [t18, children, t19]
282
285
  });
283
- $[33] = children;
284
- $[34] = restProps;
285
- $[35] = t18;
286
- $[36] = t19;
287
- $[37] = t20;
286
+ $[34] = children;
287
+ $[35] = restProps;
288
+ $[36] = t18;
289
+ $[37] = t19;
290
+ $[38] = t20;
288
291
  } else {
289
- t20 = $[37];
292
+ t20 = $[38];
290
293
  }
291
294
  return t20;
292
- });
295
+ }
293
296
  function _temp(item) {
294
297
  return item.tabIndex >= 0;
295
298
  }
@@ -0,0 +1,55 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface DefaultItemRendererProps {
3
+ /**
4
+ * The index of the `data` item to render.
5
+ */
6
+ index: number;
7
+ /**
8
+ * If `true`, the row will be focusable with up/down arrow keys.
9
+ * Focus is implemented using the
10
+ * ["roving tabindex"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Guides/Keyboard-navigable_JavaScript_widgets#technique_1_roving_tabindex)
11
+ * technique, that is, only the focused row has `tabIndex={0}`.
12
+ */
13
+ keyboardFocusable?: boolean;
14
+ /**
15
+ * Changes the background on hover and applies the pointer cursor.
16
+ * Note that `false` does not mean the row cannot handle `onClick`.
17
+ */
18
+ clickable?: boolean;
19
+ /**
20
+ * If `true`, the row is highlighted as selected with a different background color.
21
+ */
22
+ selected?: boolean;
23
+ /**
24
+ * The nesting level of an item. Applies an indent for columns with
25
+ * `Column.indent` set to `true`. `0`, negative values, and an unset value
26
+ * mean no indent.
27
+ */
28
+ level?: number;
29
+ /**
30
+ * When set to `true`, does not control item virtualization.
31
+ * Useful when you include `DefaultItemRenderer` as a part of a custom row renderer,
32
+ * and track the visibility yourself.
33
+ */
34
+ noItemVirtualization?: boolean;
35
+ /**
36
+ * When set to `true`, does not report the item's boundaries to the reorder system.
37
+ * Useful when you include `DefaultItemRenderer` as a part of a custom row renderer
38
+ * that registers boundaries itself.
39
+ */
40
+ noReorderLayout?: boolean;
41
+ }
42
+ /**
43
+ * Standard component for rendering a table row.
44
+ *
45
+ * Renders an item using the table's column definitions and lets you
46
+ * configure item-scoped behavior such as selection, keyboard navigation,
47
+ * event handlers, `className`, and `ref`.
48
+ *
49
+ * Note that row-level click and keyboard handlers are not discoverable
50
+ * by assistive technologies. Make sure that any functionality relying on
51
+ * them (such as selection or expand/collapse) is also available through
52
+ * accessible controls, such as checkboxes or buttons with accessible
53
+ * labels.
54
+ */
55
+ export declare function DefaultItemRenderer<T>({ index, keyboardFocusable, clickable, selected, level, noItemVirtualization, noReorderLayout, ref: userRef, className, ...restProps }: DefaultItemRendererProps & ComponentPropsWithRef<'tr'>): import("react").JSX.Element | null;
@@ -0,0 +1,240 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useRef, use } from 'react';
3
+ import classNames from 'classnames';
4
+ import { TablePropsContext } from './table-const.js';
5
+ import { useComposedRef } from '../global/compose-refs.js';
6
+ import { useItemVirtualization } from './item-virtualization.js';
7
+ import { TableRow, TableCell } from './table-primitives.js';
8
+ import { ReorderAnimationContext } from '../internal/reorder-animation-context.js';
9
+ import { useReorderItemLayout } from './reorder-item-layout.js';
10
+ import { s as styles } from '../_helpers/table.js';
11
+ import { jsx } from 'react/jsx-runtime';
12
+ import 'memoize-one';
13
+ import '../internal/virtualization.js';
14
+ import '../global/intersection-observer-context.js';
15
+ import '../global/schedule-with-cleanup.js';
16
+ import '../internal/reorder-handle.js';
17
+ import '@jetbrains/icons/drag-12px';
18
+ import '../icon/icon.js';
19
+ import 'util-deprecate';
20
+ import '../icon/icon.constants.js';
21
+ import '../_helpers/icon-svg.js';
22
+ import '../global/memoize.js';
23
+ import '../global/parse-css-duration.js';
24
+ import '../internal/reorder-layout-context.js';
25
+
26
+ function DefaultItemRenderer(t0) {
27
+ const $ = c(47);
28
+ if ($[0] !== "bc245d0d0a3699b5ab0d750beda2a663dcc05f6d122b039db369f77f976f7ee8") {
29
+ for (let $i = 0; $i < 47; $i += 1) {
30
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
31
+ }
32
+ $[0] = "bc245d0d0a3699b5ab0d750beda2a663dcc05f6d122b039db369f77f976f7ee8";
33
+ }
34
+ let className;
35
+ let clickable;
36
+ let index;
37
+ let keyboardFocusable;
38
+ let level;
39
+ let noItemVirtualization;
40
+ let noReorderLayout;
41
+ let restProps;
42
+ let selected;
43
+ let userRef;
44
+ if ($[1] !== t0) {
45
+ ({
46
+ index,
47
+ keyboardFocusable,
48
+ clickable,
49
+ selected,
50
+ level,
51
+ noItemVirtualization,
52
+ noReorderLayout,
53
+ ref: userRef,
54
+ className,
55
+ ...restProps
56
+ } = t0);
57
+ $[1] = t0;
58
+ $[2] = className;
59
+ $[3] = clickable;
60
+ $[4] = index;
61
+ $[5] = keyboardFocusable;
62
+ $[6] = level;
63
+ $[7] = noItemVirtualization;
64
+ $[8] = noReorderLayout;
65
+ $[9] = restProps;
66
+ $[10] = selected;
67
+ $[11] = userRef;
68
+ } else {
69
+ className = $[2];
70
+ clickable = $[3];
71
+ index = $[4];
72
+ keyboardFocusable = $[5];
73
+ level = $[6];
74
+ noItemVirtualization = $[7];
75
+ noReorderLayout = $[8];
76
+ restProps = $[9];
77
+ selected = $[10];
78
+ userRef = $[11];
79
+ }
80
+ const localRef = useRef(null);
81
+ const composedRef = useComposedRef(userRef, localRef);
82
+ let t1;
83
+ if ($[12] !== noItemVirtualization) {
84
+ t1 = (t2, _i, t3) => {
85
+ const [isIntersecting] = t2;
86
+ const [element] = t3;
87
+ return isIntersecting === false && !noItemVirtualization && element?.isConnected && !element.contains(document.activeElement) && !element.previousElementSibling?.contains(document.activeElement) && !element.nextElementSibling?.contains(document.activeElement) ? element.getBoundingClientRect().height : undefined;
88
+ };
89
+ $[12] = noItemVirtualization;
90
+ $[13] = t1;
91
+ } else {
92
+ t1 = $[13];
93
+ }
94
+ const t2 = t1;
95
+ let t3;
96
+ if ($[14] !== index || $[15] !== t2) {
97
+ t3 = {
98
+ index,
99
+ refs: localRef,
100
+ onIntersectionChange: t2
101
+ };
102
+ $[14] = index;
103
+ $[15] = t2;
104
+ $[16] = t3;
105
+ } else {
106
+ t3 = $[16];
107
+ }
108
+ useItemVirtualization(t3);
109
+ let t4;
110
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
111
+ t4 = () => {
112
+ var _r$top, _r$bottom;
113
+ const r = localRef.current?.getBoundingClientRect();
114
+ return {
115
+ start: (_r$top = r?.top) !== null && _r$top !== void 0 ? _r$top : 0,
116
+ end: (_r$bottom = r?.bottom) !== null && _r$bottom !== void 0 ? _r$bottom : 0
117
+ };
118
+ };
119
+ $[17] = t4;
120
+ } else {
121
+ t4 = $[17];
122
+ }
123
+ let t5;
124
+ if ($[18] !== index || $[19] !== noReorderLayout) {
125
+ t5 = {
126
+ disabled: noReorderLayout,
127
+ index,
128
+ getBounds: t4
129
+ };
130
+ $[18] = index;
131
+ $[19] = noReorderLayout;
132
+ $[20] = t5;
133
+ } else {
134
+ t5 = $[20];
135
+ }
136
+ useReorderItemLayout(t5);
137
+ const tableProps = use(TablePropsContext);
138
+ if (!tableProps) {
139
+ return null;
140
+ }
141
+ const {
142
+ reorderAnimation
143
+ } = use(ReorderAnimationContext);
144
+ const isAnimatedItem = reorderAnimation?.direction === "items" && reorderAnimation.index === index;
145
+ const animatedColumnIndex = reorderAnimation?.direction === "columns" ? reorderAnimation.index : undefined;
146
+ const animateClassName = reorderAnimation?.className;
147
+ const {
148
+ data,
149
+ columns
150
+ } = tableProps;
151
+ const item = data[index];
152
+ const t6 = clickable && styles.clickableRow;
153
+ const t7 = selected && styles.selectedRow;
154
+ const t8 = isAnimatedItem && animateClassName;
155
+ let t9;
156
+ if ($[21] !== className || $[22] !== t6 || $[23] !== t7 || $[24] !== t8) {
157
+ t9 = classNames(className, t6, t7, t8);
158
+ $[21] = className;
159
+ $[22] = t6;
160
+ $[23] = t7;
161
+ $[24] = t8;
162
+ $[25] = t9;
163
+ } else {
164
+ t9 = $[25];
165
+ }
166
+ let t10;
167
+ if ($[26] !== animateClassName || $[27] !== animatedColumnIndex || $[28] !== columns || $[29] !== data || $[30] !== index || $[31] !== item || $[32] !== level) {
168
+ let t11;
169
+ if ($[34] !== animateClassName || $[35] !== animatedColumnIndex || $[36] !== data || $[37] !== index || $[38] !== item || $[39] !== level) {
170
+ t11 = (column, columnIndex) => {
171
+ var _column$renderCell;
172
+ const {
173
+ key,
174
+ tdClassName,
175
+ indent
176
+ } = column;
177
+ return /*#__PURE__*/jsx(TableCell, {
178
+ className: classNames(columnIndex === animatedColumnIndex && animateClassName, typeof tdClassName === "function" ? tdClassName(item, index, data) : tdClassName),
179
+ style: indent && level != null && level > 0 ? {
180
+ paddingInlineStart: `${level * 24}px`
181
+ } : undefined,
182
+ children: (_column$renderCell = column.renderCell?.(item, index, data)) !== null && _column$renderCell !== void 0 ? _column$renderCell : getDefaultCellValue(item, columnIndex, key)
183
+ }, key);
184
+ };
185
+ $[34] = animateClassName;
186
+ $[35] = animatedColumnIndex;
187
+ $[36] = data;
188
+ $[37] = index;
189
+ $[38] = item;
190
+ $[39] = level;
191
+ $[40] = t11;
192
+ } else {
193
+ t11 = $[40];
194
+ }
195
+ t10 = columns.map(t11);
196
+ $[26] = animateClassName;
197
+ $[27] = animatedColumnIndex;
198
+ $[28] = columns;
199
+ $[29] = data;
200
+ $[30] = index;
201
+ $[31] = item;
202
+ $[32] = level;
203
+ $[33] = t10;
204
+ } else {
205
+ t10 = $[33];
206
+ }
207
+ let t11;
208
+ if ($[41] !== composedRef || $[42] !== keyboardFocusable || $[43] !== restProps || $[44] !== t10 || $[45] !== t9) {
209
+ t11 = /*#__PURE__*/jsx(TableRow, {
210
+ ref: composedRef,
211
+ keyboardFocusable: keyboardFocusable,
212
+ className: t9,
213
+ ...restProps,
214
+ children: t10
215
+ });
216
+ $[41] = composedRef;
217
+ $[42] = keyboardFocusable;
218
+ $[43] = restProps;
219
+ $[44] = t10;
220
+ $[45] = t9;
221
+ $[46] = t11;
222
+ } else {
223
+ t11 = $[46];
224
+ }
225
+ return t11;
226
+ }
227
+ function getDefaultCellValue(item, columnIndex, columnKey) {
228
+ if (Array.isArray(item)) {
229
+ return String(item[columnIndex]);
230
+ }
231
+ if (item !== null && typeof item === 'object') {
232
+ return String(item[String(columnKey)]);
233
+ }
234
+ if (columnIndex === 0) {
235
+ return String(item);
236
+ }
237
+ return '';
238
+ }
239
+
240
+ export { DefaultItemRenderer };
@@ -0,0 +1,21 @@
1
+ import { type RefObject } from 'react';
2
+ import type { Column } from '../table-props';
3
+ import type { ReorderAnimation } from '../reorder-animation';
4
+ export interface ReorderSpec {
5
+ direction: 'columns' | 'items';
6
+ fromIndex: number;
7
+ insertionIndex: number;
8
+ }
9
+ interface ReorderAnimationContextValue {
10
+ reorderAnimation: ReorderAnimation | null;
11
+ expectReorder: (reorderSpec: ReorderSpec) => void;
12
+ }
13
+ export declare const ReorderAnimationContext: import("react").Context<ReorderAnimationContextValue>;
14
+ export declare function useReorderAnimationContextValue<T>({ noColumnReorderAnimation, noItemReorderAnimation, tableRef, data, columns, }: {
15
+ noColumnReorderAnimation: boolean | undefined;
16
+ noItemReorderAnimation: boolean | undefined;
17
+ tableRef: RefObject<HTMLTableElement | null>;
18
+ data: readonly T[];
19
+ columns: readonly Column<T>[];
20
+ }): ReorderAnimationContextValue;
21
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ import type { DragState } from '../table-primitives';
3
+ export declare function ReorderHandle<T>({ direction, index, noDragFrame, noHandleTranslate, onUserDrag, ref: userRef, className, onKeyDown, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture, ...restProps }: {
4
+ direction: 'columns' | 'items';
5
+ index: number;
6
+ noDragFrame?: boolean;
7
+ noHandleTranslate?: boolean;
8
+ onUserDrag?: (state: DragState) => void;
9
+ } & ComponentPropsWithRef<'button'>): import("react").JSX.Element;