@box/blueprint-web 13.19.0 → 14.0.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 (52) hide show
  1. package/THIRD_PARTY_LICENSES +206 -27
  2. package/dist/lib-esm/button/button.d.ts +0 -2
  3. package/dist/lib-esm/button/button.js +2 -4
  4. package/dist/lib-esm/button/types.d.ts +0 -4
  5. package/dist/lib-esm/card-tooltip/card-tooltip.d.ts +3 -6
  6. package/dist/lib-esm/card-tooltip/card-tooltip.js +96 -42
  7. package/dist/lib-esm/card-tooltip/card-tooltip.module.js +1 -1
  8. package/dist/lib-esm/card-tooltip/types.d.ts +21 -36
  9. package/dist/lib-esm/combobox/chips-group.js +1 -5
  10. package/dist/lib-esm/combobox/types.d.ts +2 -2
  11. package/dist/lib-esm/combobox-group/combobox-group-combobox.js +0 -1
  12. package/dist/lib-esm/data-table/data-table-wrapper.js +2 -0
  13. package/dist/lib-esm/data-table/use-table-scroll-correction.d.ts +15 -0
  14. package/dist/lib-esm/data-table/use-table-scroll-correction.js +211 -0
  15. package/dist/lib-esm/empty-state/empty-state.d.ts +0 -2
  16. package/dist/lib-esm/guided-tooltip/guided-tooltip-footer.d.ts +0 -4
  17. package/dist/lib-esm/guided-tooltip/guided-tooltip.d.ts +0 -4
  18. package/dist/lib-esm/index.css +49 -243
  19. package/dist/lib-esm/index.d.ts +0 -3
  20. package/dist/lib-esm/index.js +0 -3
  21. package/dist/lib-esm/list-item/table-header-dropdown.js +1 -1
  22. package/dist/lib-esm/modal/alert-modal.d.ts +0 -4
  23. package/dist/lib-esm/modal/modal-footer.d.ts +0 -4
  24. package/dist/lib-esm/modal/modal.d.ts +0 -4
  25. package/dist/lib-esm/primitives/context-menu/context-menu.module.js +1 -1
  26. package/dist/lib-esm/primitives/select-menu-grid/select-menu-grid-option.js +0 -1
  27. package/dist/lib-esm/side-panel/side-panel-footer.d.ts +0 -4
  28. package/dist/lib-esm/side-panel/side-panel.d.ts +0 -4
  29. package/dist/lib-esm/tooltip/tooltip.d.ts +3 -2
  30. package/dist/lib-esm/tooltip/tooltip.js +2 -36
  31. package/dist/lib-esm/tooltip/types.d.ts +0 -9
  32. package/dist/lib-esm/util-components/base-grid-list-item/types.d.ts +2 -2
  33. package/dist/lib-esm/utils/useMedia.js +13 -1
  34. package/package.json +14 -14
  35. package/dist/lib-esm/card-tooltip-v2/card-tooltip-v2.d.ts +0 -10
  36. package/dist/lib-esm/card-tooltip-v2/card-tooltip-v2.js +0 -119
  37. package/dist/lib-esm/card-tooltip-v2/card-tooltip-v2.module.js +0 -4
  38. package/dist/lib-esm/card-tooltip-v2/index.d.ts +0 -2
  39. package/dist/lib-esm/card-tooltip-v2/types.d.ts +0 -30
  40. package/dist/lib-esm/content-field/content-field.d.ts +0 -4
  41. package/dist/lib-esm/content-field/content-field.js +0 -126
  42. package/dist/lib-esm/content-field/content-field.module.js +0 -4
  43. package/dist/lib-esm/content-field/index.d.ts +0 -2
  44. package/dist/lib-esm/content-field/messages.d.ts +0 -7
  45. package/dist/lib-esm/content-field/messages.js +0 -8
  46. package/dist/lib-esm/content-field/types.d.ts +0 -35
  47. package/dist/lib-esm/util-components/focus-trap/focus-trap.d.ts +0 -2
  48. package/dist/lib-esm/util-components/focus-trap/focus-trap.js +0 -52
  49. package/dist/lib-esm/util-components/focus-trap/index.d.ts +0 -1
  50. package/dist/lib-esm/util-components/focus-trap/types.d.ts +0 -8
  51. package/dist/lib-esm/utils/useIsTriggerInteractive.d.ts +0 -4
  52. package/dist/lib-esm/utils/useIsTriggerInteractive.js +0 -21
@@ -49,7 +49,7 @@ SOFTWARE.
49
49
  License for @ariakit/react:
50
50
  MIT License
51
51
 
52
- Copyright (c) Diego Haz
52
+ Copyright (c) 2025-present Ariakit FZ-LLC
53
53
 
54
54
  Permission is hereby granted, free of charge, to any person obtaining a copy
55
55
  of this software and associated documentation files (the "Software"), to deal
@@ -73,7 +73,7 @@ SOFTWARE.
73
73
  License for @ariakit/react-core:
74
74
  MIT License
75
75
 
76
- Copyright (c) Diego Haz
76
+ Copyright (c) 2025-present Ariakit FZ-LLC
77
77
 
78
78
  Permission is hereby granted, free of charge, to any person obtaining a copy
79
79
  of this software and associated documentation files (the "Software"), to deal
@@ -884,6 +884,210 @@ License for @react-aria/i18n:
884
884
  limitations under the License.
885
885
 
886
886
 
887
+ License for @react-aria/interactions:
888
+ Apache License
889
+ Version 2.0, January 2004
890
+ http://www.apache.org/licenses/
891
+
892
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
893
+
894
+ 1. Definitions.
895
+
896
+ "License" shall mean the terms and conditions for use, reproduction,
897
+ and distribution as defined by Sections 1 through 9 of this document.
898
+
899
+ "Licensor" shall mean the copyright owner or entity authorized by
900
+ the copyright owner that is granting the License.
901
+
902
+ "Legal Entity" shall mean the union of the acting entity and all
903
+ other entities that control, are controlled by, or are under common
904
+ control with that entity. For the purposes of this definition,
905
+ "control" means (i) the power, direct or indirect, to cause the
906
+ direction or management of such entity, whether by contract or
907
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
908
+ outstanding shares, or (iii) beneficial ownership of such entity.
909
+
910
+ "You" (or "Your") shall mean an individual or Legal Entity
911
+ exercising permissions granted by this License.
912
+
913
+ "Source" form shall mean the preferred form for making modifications,
914
+ including but not limited to software source code, documentation
915
+ source, and configuration files.
916
+
917
+ "Object" form shall mean any form resulting from mechanical
918
+ transformation or translation of a Source form, including but
919
+ not limited to compiled object code, generated documentation,
920
+ and conversions to other media types.
921
+
922
+ "Work" shall mean the work of authorship, whether in Source or
923
+ Object form, made available under the License, as indicated by a
924
+ copyright notice that is included in or attached to the work
925
+ (an example is provided in the Appendix below).
926
+
927
+ "Derivative Works" shall mean any work, whether in Source or Object
928
+ form, that is based on (or derived from) the Work and for which the
929
+ editorial revisions, annotations, elaborations, or other modifications
930
+ represent, as a whole, an original work of authorship. For the purposes
931
+ of this License, Derivative Works shall not include works that remain
932
+ separable from, or merely link (or bind by name) to the interfaces of,
933
+ the Work and Derivative Works thereof.
934
+
935
+ "Contribution" shall mean any work of authorship, including
936
+ the original version of the Work and any modifications or additions
937
+ to that Work or Derivative Works thereof, that is intentionally
938
+ submitted to Licensor for inclusion in the Work by the copyright owner
939
+ or by an individual or Legal Entity authorized to submit on behalf of
940
+ the copyright owner. For the purposes of this definition, "submitted"
941
+ means any form of electronic, verbal, or written communication sent
942
+ to the Licensor or its representatives, including but not limited to
943
+ communication on electronic mailing lists, source code control systems,
944
+ and issue tracking systems that are managed by, or on behalf of, the
945
+ Licensor for the purpose of discussing and improving the Work, but
946
+ excluding communication that is conspicuously marked or otherwise
947
+ designated in writing by the copyright owner as "Not a Contribution."
948
+
949
+ "Contributor" shall mean Licensor and any individual or Legal Entity
950
+ on behalf of whom a Contribution has been received by Licensor and
951
+ subsequently incorporated within the Work.
952
+
953
+ 2. Grant of Copyright License. Subject to the terms and conditions of
954
+ this License, each Contributor hereby grants to You a perpetual,
955
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
956
+ copyright license to reproduce, prepare Derivative Works of,
957
+ publicly display, publicly perform, sublicense, and distribute the
958
+ Work and such Derivative Works in Source or Object form.
959
+
960
+ 3. Grant of Patent License. Subject to the terms and conditions of
961
+ this License, each Contributor hereby grants to You a perpetual,
962
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
963
+ (except as stated in this section) patent license to make, have made,
964
+ use, offer to sell, sell, import, and otherwise transfer the Work,
965
+ where such license applies only to those patent claims licensable
966
+ by such Contributor that are necessarily infringed by their
967
+ Contribution(s) alone or by combination of their Contribution(s)
968
+ with the Work to which such Contribution(s) was submitted. If You
969
+ institute patent litigation against any entity (including a
970
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
971
+ or a Contribution incorporated within the Work constitutes direct
972
+ or contributory patent infringement, then any patent licenses
973
+ granted to You under this License for that Work shall terminate
974
+ as of the date such litigation is filed.
975
+
976
+ 4. Redistribution. You may reproduce and distribute copies of the
977
+ Work or Derivative Works thereof in any medium, with or without
978
+ modifications, and in Source or Object form, provided that You
979
+ meet the following conditions:
980
+
981
+ (a) You must give any other recipients of the Work or
982
+ Derivative Works a copy of this License; and
983
+
984
+ (b) You must cause any modified files to carry prominent notices
985
+ stating that You changed the files; and
986
+
987
+ (c) You must retain, in the Source form of any Derivative Works
988
+ that You distribute, all copyright, patent, trademark, and
989
+ attribution notices from the Source form of the Work,
990
+ excluding those notices that do not pertain to any part of
991
+ the Derivative Works; and
992
+
993
+ (d) If the Work includes a "NOTICE" text file as part of its
994
+ distribution, then any Derivative Works that You distribute must
995
+ include a readable copy of the attribution notices contained
996
+ within such NOTICE file, excluding those notices that do not
997
+ pertain to any part of the Derivative Works, in at least one
998
+ of the following places: within a NOTICE text file distributed
999
+ as part of the Derivative Works; within the Source form or
1000
+ documentation, if provided along with the Derivative Works; or,
1001
+ within a display generated by the Derivative Works, if and
1002
+ wherever such third-party notices normally appear. The contents
1003
+ of the NOTICE file are for informational purposes only and
1004
+ do not modify the License. You may add Your own attribution
1005
+ notices within Derivative Works that You distribute, alongside
1006
+ or as an addendum to the NOTICE text from the Work, provided
1007
+ that such additional attribution notices cannot be construed
1008
+ as modifying the License.
1009
+
1010
+ You may add Your own copyright statement to Your modifications and
1011
+ may provide additional or different license terms and conditions
1012
+ for use, reproduction, or distribution of Your modifications, or
1013
+ for any such Derivative Works as a whole, provided Your use,
1014
+ reproduction, and distribution of the Work otherwise complies with
1015
+ the conditions stated in this License.
1016
+
1017
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
1018
+ any Contribution intentionally submitted for inclusion in the Work
1019
+ by You to the Licensor shall be under the terms and conditions of
1020
+ this License, without any additional terms or conditions.
1021
+ Notwithstanding the above, nothing herein shall supersede or modify
1022
+ the terms of any separate license agreement you may have executed
1023
+ with Licensor regarding such Contributions.
1024
+
1025
+ 6. Trademarks. This License does not grant permission to use the trade
1026
+ names, trademarks, service marks, or product names of the Licensor,
1027
+ except as required for reasonable and customary use in describing the
1028
+ origin of the Work and reproducing the content of the NOTICE file.
1029
+
1030
+ 7. Disclaimer of Warranty. Unless required by applicable law or
1031
+ agreed to in writing, Licensor provides the Work (and each
1032
+ Contributor provides its Contributions) on an "AS IS" BASIS,
1033
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1034
+ implied, including, without limitation, any warranties or conditions
1035
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
1036
+ PARTICULAR PURPOSE. You are solely responsible for determining the
1037
+ appropriateness of using or redistributing the Work and assume any
1038
+ risks associated with Your exercise of permissions under this License.
1039
+
1040
+ 8. Limitation of Liability. In no event and under no legal theory,
1041
+ whether in tort (including negligence), contract, or otherwise,
1042
+ unless required by applicable law (such as deliberate and grossly
1043
+ negligent acts) or agreed to in writing, shall any Contributor be
1044
+ liable to You for damages, including any direct, indirect, special,
1045
+ incidental, or consequential damages of any character arising as a
1046
+ result of this License or out of the use or inability to use the
1047
+ Work (including but not limited to damages for loss of goodwill,
1048
+ work stoppage, computer failure or malfunction, or any and all
1049
+ other commercial damages or losses), even if such Contributor
1050
+ has been advised of the possibility of such damages.
1051
+
1052
+ 9. Accepting Warranty or Additional Liability. While redistributing
1053
+ the Work or Derivative Works thereof, You may choose to offer,
1054
+ and charge a fee for, acceptance of support, warranty, indemnity,
1055
+ or other liability obligations and/or rights consistent with this
1056
+ License. However, in accepting such obligations, You may act only
1057
+ on Your own behalf and on Your sole responsibility, not on behalf
1058
+ of any other Contributor, and only if You agree to indemnify,
1059
+ defend, and hold each Contributor harmless for any liability
1060
+ incurred by, or claims asserted against, such Contributor by reason
1061
+ of your accepting any such warranty or additional liability.
1062
+
1063
+ END OF TERMS AND CONDITIONS
1064
+
1065
+ APPENDIX: How to apply the Apache License to your work.
1066
+
1067
+ To apply the Apache License to your work, attach the following
1068
+ boilerplate notice, with the fields enclosed by brackets "[]"
1069
+ replaced with your own identifying information. (Don't include
1070
+ the brackets!) The text should be enclosed in the appropriate
1071
+ comment syntax for the file format. We also recommend that a
1072
+ file or class name and description of purpose be included on the
1073
+ same "printed page" as the copyright notice for easier
1074
+ identification within third-party archives.
1075
+
1076
+ Copyright 2019 Adobe
1077
+
1078
+ Licensed under the Apache License, Version 2.0 (the "License");
1079
+ you may not use this file except in compliance with the License.
1080
+ You may obtain a copy of the License at
1081
+
1082
+ http://www.apache.org/licenses/LICENSE-2.0
1083
+
1084
+ Unless required by applicable law or agreed to in writing, software
1085
+ distributed under the License is distributed on an "AS IS" BASIS,
1086
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1087
+ See the License for the specific language governing permissions and
1088
+ limitations under the License.
1089
+
1090
+
887
1091
  License for @react-aria/utils:
888
1092
  Apache License
889
1093
  Version 2.0, January 2004
@@ -1582,31 +1786,6 @@ License for react-aria-components:
1582
1786
  limitations under the License.
1583
1787
 
1584
1788
 
1585
- License for tabbable:
1586
- The MIT License (MIT)
1587
-
1588
- Copyright (c) 2015 David Clark
1589
-
1590
- Permission is hereby granted, free of charge, to any person obtaining a copy
1591
- of this software and associated documentation files (the "Software"), to deal
1592
- in the Software without restriction, including without limitation the rights
1593
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1594
- copies of the Software, and to permit persons to whom the Software is
1595
- furnished to do so, subject to the following conditions:
1596
-
1597
- The above copyright notice and this permission notice shall be included in all
1598
- copies or substantial portions of the Software.
1599
-
1600
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1601
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1602
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1603
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1604
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1605
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1606
- SOFTWARE.
1607
-
1608
-
1609
-
1610
1789
  License for @radix-ui:
1611
1790
  MIT License
1612
1791
 
@@ -1,11 +1,9 @@
1
1
  export declare const Button: import("react").ForwardRefExoticComponent<(Omit<import("../primitives/base-button").BaseButtonInterface & Required<Pick<import("../primitives/base-button").Loading, keyof import("../primitives/base-button").Loading>> & Omit<import("../primitives/base-button").Loading, keyof import("../primitives/base-button").Loading> & {
2
2
  children?: string | string[];
3
- icon?: import("./types").SvgIconComponent;
4
3
  endIcon?: import("./types").SvgIconComponent;
5
4
  startIcon?: import("./types").SvgIconComponent;
6
5
  }, "ref"> | Omit<import("../primitives/base-button").BaseButtonInterface & Partial<Record<keyof import("../primitives/base-button").Loading, never>> & Omit<import("../primitives/base-button").Loading, keyof import("../primitives/base-button").Loading> & {
7
6
  children?: string | string[];
8
- icon?: import("./types").SvgIconComponent;
9
7
  endIcon?: import("./types").SvgIconComponent;
10
8
  startIcon?: import("./types").SvgIconComponent;
11
9
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
@@ -5,12 +5,10 @@ import { BaseButton } from '../primitives/base-button/index.js';
5
5
  const Button = /*#__PURE__*/forwardRef((props, forwardedRef) => {
6
6
  const {
7
7
  children,
8
- icon,
9
8
  endIcon,
10
9
  startIcon,
11
10
  ...rest
12
11
  } = props;
13
- const effectiveIcon = endIcon ?? icon;
14
12
  return jsxs(BaseButton, {
15
13
  ref: forwardedRef,
16
14
  ...rest,
@@ -18,8 +16,8 @@ const Button = /*#__PURE__*/forwardRef((props, forwardedRef) => {
18
16
  icon: startIcon
19
17
  }) : null, children ? jsx(BaseButton.Label, {
20
18
  children: children
21
- }) : null, effectiveIcon ? jsx(BaseButton.Icon, {
22
- icon: effectiveIcon
19
+ }) : null, endIcon ? jsx(BaseButton.Icon, {
20
+ icon: endIcon
23
21
  }) : null]
24
22
  });
25
23
  });
@@ -3,10 +3,6 @@ import { type BaseButtonProps } from '../primitives/base-button';
3
3
  export type SvgIconComponent = FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>>;
4
4
  export type ButtonProps = BaseButtonProps & {
5
5
  children?: string | string[];
6
- /** Icon that will be placed after the children text (or icon-only when no children).
7
- * Note: When creating an icon-only button aria-label must also be provided.
8
- * @deprecated Use endIcon instead. */
9
- icon?: SvgIconComponent;
10
6
  /** Icon that will be placed after the children text (or icon-only when no children).
11
7
  * Note: When creating an icon-only button aria-label must also be provided. */
12
8
  endIcon?: SvgIconComponent;
@@ -1,13 +1,10 @@
1
1
  import { type CardTooltipProps } from './types';
2
2
  /**
3
- * Temporary component that displays Card styled tooltip.
3
+ * CardTooltip is a component that wraps a Card component inside a Tooltip component. It uses the Ariakit Tooltip component.
4
4
  *
5
5
  * You must only pass non-interactive content inside `content` prop.
6
6
  *
7
- * **IMPORTANT (1)**: Must be placed inside a single <b>TooltipProvider</b> component provided by the app, see [issue on github](https://github.com/radix-ui/primitives/issues/1712) and [radix docs](https://www.radix-ui.com/docs/primitives/components/tooltip#provider).
7
+ * **IMPORTANT**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
8
8
  *
9
- * **IMPORTANT (2)**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
10
- *
11
- * @deprecated Use CardTooltipV2 instead.
12
9
  */
13
- export declare const CardTooltip: (props: CardTooltipProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const CardTooltip: import("react").ForwardRefExoticComponent<CardTooltipProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,67 +1,121 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import * as RadixTooltip from '@radix-ui/react-tooltip';
2
+ import * as Ariakit from '@ariakit/react';
3
3
  import clsx from 'clsx';
4
- import React__default, { useContext } from 'react';
4
+ import { forwardRef, useRef, useLayoutEffect, useCallback } from 'react';
5
+ import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
5
6
  import { Card } from '../card/card.js';
6
- import { ContainerContext, TooltipTrigger } from '../tooltip/tooltip.js';
7
+ import { composeEventHandlers } from '../utils/composeEventHandlers.js';
7
8
  import styles from './card-tooltip.module.js';
8
9
 
9
10
  /**
10
- * Temporary component that displays Card styled tooltip.
11
+ * CardTooltip is a component that wraps a Card component inside a Tooltip component. It uses the Ariakit Tooltip component.
11
12
  *
12
13
  * You must only pass non-interactive content inside `content` prop.
13
14
  *
14
- * **IMPORTANT (1)**: Must be placed inside a single <b>TooltipProvider</b> component provided by the app, see [issue on github](https://github.com/radix-ui/primitives/issues/1712) and [radix docs](https://www.radix-ui.com/docs/primitives/components/tooltip#provider).
15
+ * **IMPORTANT**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
15
16
  *
16
- * **IMPORTANT (2)**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
17
- *
18
- * @deprecated Use CardTooltipV2 instead.
19
17
  */
20
- const CardTooltip = props => {
18
+ const CardTooltip = /*#__PURE__*/forwardRef((props, ref) => {
21
19
  const {
22
20
  children,
23
21
  content,
24
- onOpenChange,
22
+ setOpen,
25
23
  open,
26
24
  defaultOpen,
27
- forceMount,
25
+ className,
26
+ skipTimeout,
27
+ hideTooltipOnContentClick,
28
+ hideOnInteractOutside,
29
+ placement = 'bottom',
30
+ elevation = 'dropshadow-3',
31
+ addDelayOnFocus,
32
+ unmountOnHide = true,
28
33
  ...contentProps
29
34
  } = props;
30
- const container = useContext(ContainerContext);
31
- return jsxs(RadixTooltip.Root, {
32
- defaultOpen: defaultOpen,
33
- onOpenChange: onOpenChange,
34
- open: open,
35
- children: [jsx(TooltipTrigger, {
36
- open: open,
37
- children: children
38
- }), jsx(RadixTooltip.Portal, {
39
- container: container,
40
- forceMount: forceMount,
41
- children: jsx(Content, {
42
- ...contentProps,
35
+ const SHOW_TIMEOUT = 300;
36
+ const tooltipStore = Ariakit.useTooltipStore({
37
+ open,
38
+ setOpen,
39
+ defaultOpen,
40
+ placement,
41
+ showTimeout: SHOW_TIMEOUT,
42
+ hideTimeout: 0,
43
+ skipTimeout
44
+ });
45
+ const side = Ariakit.useStoreState(tooltipStore, 'currentPlacement').split('-')[0];
46
+ const contentId = Ariakit.useStoreState(tooltipStore, state => state.contentElement?.id);
47
+ const mounted = Ariakit.useStoreState(tooltipStore, 'mounted');
48
+ const isOpen = Ariakit.useStoreState(tooltipStore, 'open');
49
+ const focusTimeout = useRef(0);
50
+ const {
51
+ enableModernizedComponents
52
+ } = useBlueprintModernization();
53
+ useLayoutEffect(() => {
54
+ if (mounted && !isOpen) {
55
+ // Make sure that tooltip disappears instantly after it is closed.
56
+ // Otherwise, once a tooltip is hovered, moving mouse to other tooltips
57
+ // could open them without honoring `showTimeout`.
58
+ tooltipStore.setState('animating', false);
59
+ }
60
+ }, [isOpen, mounted, tooltipStore]);
61
+ const handleHideOnInteractOutside = useCallback(e => {
62
+ if (typeof hideOnInteractOutside === 'function') {
63
+ hideOnInteractOutside(e);
64
+ }
65
+ if (e.type === 'focusin') {
66
+ const state = tooltipStore.getState();
67
+ const contentElement = state?.contentElement;
68
+ // If tooltip content is losing focus, do not hide it
69
+ // since it can be stolen sometimes by elements outside of it.
70
+ if (e?.relatedTarget === contentElement) {
71
+ return false;
72
+ }
73
+ }
74
+ return true;
75
+ }, [hideOnInteractOutside, tooltipStore]);
76
+ const handleOnFocusVisibleWithDelay = event => {
77
+ event.preventDefault();
78
+ event.currentTarget.setAttribute('data-focus-visible', 'true');
79
+ focusTimeout.current = window.setTimeout(() => {
80
+ tooltipStore?.setAnchorElement(event.currentTarget);
81
+ tooltipStore?.show();
82
+ }, SHOW_TIMEOUT);
83
+ };
84
+ const handleBlur = event => {
85
+ event.currentTarget.removeAttribute('data-focus-visible');
86
+ window.clearTimeout(focusTimeout.current);
87
+ };
88
+ return jsxs(Ariakit.TooltipProvider, {
89
+ store: tooltipStore,
90
+ children: [jsx(Ariakit.TooltipAnchor, {
91
+ ...(mounted && {
92
+ 'aria-describedby': contentId
93
+ }),
94
+ onClick: tooltipStore.hide,
95
+ render: children,
96
+ ...(addDelayOnFocus && {
97
+ onFocusVisible: handleOnFocusVisibleWithDelay,
98
+ onBlur: handleBlur
99
+ })
100
+ }), jsx(Ariakit.Tooltip, {
101
+ ...contentProps,
102
+ ...(hideTooltipOnContentClick && {
103
+ onClick: composeEventHandlers(tooltipStore.hide, contentProps.onClick)
104
+ }),
105
+ ref: ref,
106
+ className: clsx(styles.content, className),
107
+ "data-modern": enableModernizedComponents ? 'true' : 'false',
108
+ "data-side": side,
109
+ fitViewport: true,
110
+ gutter: 4,
111
+ hideOnInteractOutside: handleHideOnInteractOutside,
112
+ unmountOnHide: unmountOnHide,
113
+ children: jsx(Card, {
114
+ elevation: elevation,
43
115
  children: content
44
116
  })
45
117
  })]
46
118
  });
47
- };
48
- const Content = /*#__PURE__*/React__default.forwardRef(function Content(props, ref) {
49
- const {
50
- children,
51
- className,
52
- elevation = 'dropshadow-3',
53
- ...rest
54
- } = props;
55
- return jsx(RadixTooltip.Content, {
56
- ...rest,
57
- ref: ref,
58
- className: clsx(styles.content, styles.card, className),
59
- sideOffset: 4,
60
- children: jsx(Card, {
61
- elevation: elevation,
62
- children: children
63
- })
64
- });
65
119
  });
66
120
 
67
121
  export { CardTooltip };
@@ -1,4 +1,4 @@
1
1
  import '../index.css';
2
- var styles = {"content":"bp_card_tooltip_module_content--83370","card":"bp_card_tooltip_module_card--83370"};
2
+ var styles = {"content":"bp_card_tooltip_module_content--02910"};
3
3
 
4
4
  export { styles as default };
@@ -1,45 +1,30 @@
1
- import type * as RadixTooltip from '@radix-ui/react-tooltip';
2
- import type React from 'react';
1
+ import { type TooltipProps, type TooltipStoreProps } from '@ariakit/react';
2
+ import { type ReactElement, type ReactNode } from 'react';
3
3
  import { type CardProps } from '../card/types';
4
- export interface CardTooltipContentProps extends RadixTooltip.TooltipContentProps {
4
+ export interface CardTooltipProps extends Omit<TooltipProps, 'content' | 'ref'> {
5
5
  /**
6
- * The elevation of the Card inside.
7
- * @default 'dropshadow-3'
6
+ * If true, the tooltip will be opened with delay when user focuses on the anchor. Be mindful that are accessibility concerns when using this prop. It should only be used in cases where the content is purely decorative and does not convey important information that needs to be accessible to screen readers or assistive technologies.
7
+ * @default false
8
8
  */
9
- elevation?: CardProps['elevation'];
10
- }
11
- export interface PropsOnlyChildren {
12
- children?: React.ReactNode;
13
- }
14
- export interface CardTooltipProps extends Omit<React.ComponentPropsWithRef<typeof RadixTooltip.TooltipContent>, 'content'> {
15
- /**
16
- * The anchor for the tooltip.
17
- */
18
- children: React.ReactNode;
19
- /**
20
- * The content of the tooltip.
21
- */
22
- content: React.ReactNode;
9
+ addDelayOnFocus?: boolean;
10
+ /** The anchor for the tooltip. */
11
+ children: ReactElement;
12
+ /** The content of the tooltip. */
13
+ content: ReactNode;
14
+ defaultOpen?: TooltipStoreProps['defaultOpen'];
23
15
  /**
24
16
  * The elevation of the Card inside.
25
- * @default 'dropshadow-3'
26
- */
27
- elevation: CardProps['elevation'];
28
- /**
29
- * Event handler called when the open state of the tooltip changes.
17
+ * @default dropshadow-3
30
18
  */
31
- onOpenChange?: RadixTooltip.TooltipProps['onOpenChange'];
32
- /**
33
- * The controlled open state of the tooltip. Must be used in conjunction with onOpenChange.
34
- * */
35
- open?: RadixTooltip.TooltipProps['open'];
36
- /**
37
- * The open state of the tooltip when it is initially rendered. Use when you do not need to control its open state.
38
- * */
39
- defaultOpen?: RadixTooltip.TooltipProps['defaultOpen'];
19
+ elevation?: CardProps['elevation'];
40
20
  /**
41
- * Used to force mounting when more control is needed. Useful when
42
- * controlling animation with React animation libraries.
21
+ * If true, the tooltip will close itself when the content area is clicked.
22
+ * @default false
43
23
  */
44
- forceMount?: RadixTooltip.TooltipPortalProps['forceMount'];
24
+ hideTooltipOnContentClick?: boolean;
25
+ open?: TooltipStoreProps['open'];
26
+ placement?: TooltipStoreProps['placement'];
27
+ portalElement?: TooltipProps['portalElement'];
28
+ setOpen?: TooltipStoreProps['setOpen'];
29
+ skipTimeout?: TooltipStoreProps['skipTimeout'];
45
30
  }
@@ -64,12 +64,8 @@ const ChipsGroup = props => {
64
64
  children: jsx("div", {
65
65
  role: "gridcell",
66
66
  children: jsx(Tooltip
67
- // Disable interactivity check for this specific tooltip. While the Tooltip always requires the trigger element to be interactive,
68
- // it is not the case for the Chips Group as per the a11y pattern. In this case, the error is false positive.
67
+ // Hide tooltip from screen readers as content is same as InputChip text
69
68
  , {
70
- // Disable interactivity check for this specific tooltip. While the Tooltip always requires the trigger element to be interactive,
71
- // it is not the case for the Chips Group as per the a11y pattern. In this case, the error is false positive.
72
- __checkInteractivity: false,
73
69
  "aria-hidden": true,
74
70
  content: childElement.props.tooltip ?? childElement.props.label,
75
71
  children: /*#__PURE__*/React__default.cloneElement(childElement, {
@@ -15,7 +15,7 @@ export interface ComboboxBaseProps<Multiple extends boolean, FreeInput extends b
15
15
  /**
16
16
  * The list of values for the combobox items.
17
17
  */
18
- options: T[];
18
+ options: ReadonlyArray<T>;
19
19
  /**
20
20
  * If set to `true`, the combobox input can contain any arbitrary value.
21
21
  * In other words, options just behave as suggestions and the user input
@@ -291,7 +291,7 @@ export interface ComboboxOptionProps extends Pick<SelectItemProps, 'hideOnClick'
291
291
  className?: string;
292
292
  }
293
293
  export interface CollectionProps<T> {
294
- options: Array<T>;
294
+ options: ReadonlyArray<T>;
295
295
  experimentalVirtualization: boolean;
296
296
  inputValue: string;
297
297
  renderOptionFn: (option: T) => React.ReactElement;
@@ -3,7 +3,6 @@ import clsx from 'clsx';
3
3
  import { forwardRef, useCallback, useEffect } from 'react';
4
4
  import '@box/blueprint-web-assets/tokens/px-tokens';
5
5
  import '@radix-ui/react-tooltip';
6
- import 'tabbable';
7
6
  import { Combobox } from '../combobox/combobox.js';
8
7
  import { useComboboxGroupContext } from './combobox-group-context.js';
9
8
  import styles from './combobox-group.module.js';
@@ -4,6 +4,7 @@ import { forwardRef, useRef } from 'react';
4
4
  import { useScroll, ScrollContext } from '../util-components/scrollable-container/scrollable-container.js';
5
5
  import { useForkRef } from '../utils/useForkRef.js';
6
6
  import styles from './data-table.module.js';
7
+ import { useTableScrollCorrection } from './use-table-scroll-correction.js';
7
8
 
8
9
  const hideActionWrapperRightOffsetPx = 30;
9
10
  const DataTableWrapper = /*#__PURE__*/forwardRef((props, forwardedRef) => {
@@ -17,6 +18,7 @@ const DataTableWrapper = /*#__PURE__*/forwardRef((props, forwardedRef) => {
17
18
  value,
18
19
  onScrollThrottled
19
20
  } = useScroll(localRef);
21
+ useTableScrollCorrection(localRef);
20
22
  const {
21
23
  offsetTillEndX,
22
24
  isScrolledX,
@@ -0,0 +1,15 @@
1
+ import { type RefObject } from 'react';
2
+ export declare function getScrollableAncestors(element: HTMLElement): HTMLElement[];
3
+ /**
4
+ * corrects the scroll position of the ancestor element to make the element visible
5
+ */
6
+ export declare function scrollElementIntoAncestor(ancestor: HTMLElement, element: HTMLElement): void;
7
+ /**
8
+ * Attaches a corrective scroll listener to the container referenced by
9
+ * `containerRef`. When keyboard focus moves to a descendant element,
10
+ * react-aria's Chrome-specific scroll path may leave the focused element
11
+ * partially or fully out of view. This hook schedules a corrective
12
+ * `scrollBy` in the animation frame after react-aria's own frame, ensuring
13
+ * the focused element is visible.
14
+ */
15
+ export declare function useTableScrollCorrection(containerRef: RefObject<HTMLDivElement | null>): void;