@box/blueprint-web 13.19.0 → 14.0.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.
Files changed (54) 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/combobox.js +64 -55
  11. package/dist/lib-esm/combobox/combobox.module.js +1 -1
  12. package/dist/lib-esm/combobox/types.d.ts +2 -2
  13. package/dist/lib-esm/combobox-group/combobox-group-combobox.js +0 -1
  14. package/dist/lib-esm/data-table/data-table-wrapper.js +2 -0
  15. package/dist/lib-esm/data-table/use-table-scroll-correction.d.ts +15 -0
  16. package/dist/lib-esm/data-table/use-table-scroll-correction.js +211 -0
  17. package/dist/lib-esm/empty-state/empty-state.d.ts +0 -2
  18. package/dist/lib-esm/guided-tooltip/guided-tooltip-footer.d.ts +0 -4
  19. package/dist/lib-esm/guided-tooltip/guided-tooltip.d.ts +0 -4
  20. package/dist/lib-esm/index.css +105 -289
  21. package/dist/lib-esm/index.d.ts +0 -3
  22. package/dist/lib-esm/index.js +0 -3
  23. package/dist/lib-esm/list-item/table-header-dropdown.js +1 -1
  24. package/dist/lib-esm/modal/alert-modal.d.ts +0 -4
  25. package/dist/lib-esm/modal/modal-footer.d.ts +0 -4
  26. package/dist/lib-esm/modal/modal.d.ts +0 -4
  27. package/dist/lib-esm/primitives/context-menu/context-menu.module.js +1 -1
  28. package/dist/lib-esm/primitives/select-menu-grid/select-menu-grid-option.js +0 -1
  29. package/dist/lib-esm/side-panel/side-panel-footer.d.ts +0 -4
  30. package/dist/lib-esm/side-panel/side-panel.d.ts +0 -4
  31. package/dist/lib-esm/tooltip/tooltip.d.ts +3 -2
  32. package/dist/lib-esm/tooltip/tooltip.js +2 -36
  33. package/dist/lib-esm/tooltip/types.d.ts +0 -9
  34. package/dist/lib-esm/util-components/base-grid-list-item/types.d.ts +2 -2
  35. package/dist/lib-esm/utils/useMedia.js +13 -1
  36. package/package.json +14 -14
  37. package/dist/lib-esm/card-tooltip-v2/card-tooltip-v2.d.ts +0 -10
  38. package/dist/lib-esm/card-tooltip-v2/card-tooltip-v2.js +0 -119
  39. package/dist/lib-esm/card-tooltip-v2/card-tooltip-v2.module.js +0 -4
  40. package/dist/lib-esm/card-tooltip-v2/index.d.ts +0 -2
  41. package/dist/lib-esm/card-tooltip-v2/types.d.ts +0 -30
  42. package/dist/lib-esm/content-field/content-field.d.ts +0 -4
  43. package/dist/lib-esm/content-field/content-field.js +0 -126
  44. package/dist/lib-esm/content-field/content-field.module.js +0 -4
  45. package/dist/lib-esm/content-field/index.d.ts +0 -2
  46. package/dist/lib-esm/content-field/messages.d.ts +0 -7
  47. package/dist/lib-esm/content-field/messages.js +0 -8
  48. package/dist/lib-esm/content-field/types.d.ts +0 -35
  49. package/dist/lib-esm/util-components/focus-trap/focus-trap.d.ts +0 -2
  50. package/dist/lib-esm/util-components/focus-trap/focus-trap.js +0 -52
  51. package/dist/lib-esm/util-components/focus-trap/index.d.ts +0 -1
  52. package/dist/lib-esm/util-components/focus-trap/types.d.ts +0 -8
  53. package/dist/lib-esm/utils/useIsTriggerInteractive.d.ts +0 -4
  54. package/dist/lib-esm/utils/useIsTriggerInteractive.js +0 -21
@@ -10,14 +10,12 @@ export * from './button';
10
10
  export * from './button-wrapper';
11
11
  export * from './card';
12
12
  export * from './card-tooltip';
13
- export * from './card-tooltip-v2';
14
13
  export * from './checkbox';
15
14
  export * from './circular-progress';
16
15
  export * from './collapsible';
17
16
  export * from './combobox';
18
17
  export * from './combobox-group';
19
18
  export * from './content-card';
20
- export * from './content-field';
21
19
  export * from './data-table/data-table';
22
20
  export * from './date-picker';
23
21
  export * from './divider';
@@ -78,7 +76,6 @@ export * from './time-picker';
78
76
  export * from './toolbar';
79
77
  export * from './tooltip';
80
78
  export * from './trigger-button';
81
- export * from './util-components/focus-trap';
82
79
  export * from './util-components/interactive-icon';
83
80
  export * from './util-components/labelable';
84
81
  export * from './util-components/list-checkbox';
@@ -16,7 +16,6 @@ export { Button } from './button/button.js';
16
16
  export { ButtonWrapper } from './button-wrapper/button-wrapper.js';
17
17
  export { Card } from './card/card.js';
18
18
  export { CardTooltip } from './card-tooltip/card-tooltip.js';
19
- export { CardTooltipV2 } from './card-tooltip-v2/card-tooltip-v2.js';
20
19
  export { Checkbox } from './checkbox/index.js';
21
20
  export { CircularProgress } from './circular-progress/circular-progress.js';
22
21
  export { CollapsibleSection } from './collapsible/collapsible-section.js';
@@ -24,7 +23,6 @@ export { ChipsGroup } from './combobox/chips-group.js';
24
23
  export { Combobox, Root } from './combobox/combobox.js';
25
24
  export { ComboboxGroup } from './combobox-group/combobox-group.js';
26
25
  export { ContentCard } from './content-card/content-card.js';
27
- export { ContentField } from './content-field/content-field.js';
28
26
  export { DataTableWrapper, StickyCell } from './data-table/data-table.js';
29
27
  export { DatePicker } from './date-picker/date-picker.js';
30
28
  export { Divider } from './divider/divider.js';
@@ -100,7 +98,6 @@ export { TimePicker } from './time-picker/time-picker.js';
100
98
  export { Toolbar } from './toolbar/index.js';
101
99
  export { Tooltip, TooltipProvider } from './tooltip/tooltip.js';
102
100
  export { TriggerButton } from './trigger-button/trigger-button.js';
103
- export { FocusTrap } from './util-components/focus-trap/focus-trap.js';
104
101
  export { InteractiveIcon } from './util-components/interactive-icon/interactive-icon.js';
105
102
  export { useLabelable } from './util-components/labelable/useLabelable.js';
106
103
  export { ListCheckbox } from './util-components/list-checkbox/list-checkbox.js';
@@ -42,7 +42,7 @@ const TableHeaderInner = ({
42
42
  children: jsx(Button, {
43
43
  "aria-label": "sort-by",
44
44
  "aria-sort": sortDescriptor.direction === 'ascending' ? 'ascending' : 'descending',
45
- icon: SortIcon,
45
+ endIcon: SortIcon,
46
46
  size: "small",
47
47
  variant: "secondary",
48
48
  children: columnLabel
@@ -5,23 +5,19 @@ export declare const AlertModal: {
5
5
  } & {
6
6
  PrimaryButton: 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> & {
7
7
  children?: string | string[];
8
- icon?: import("../button/types").SvgIconComponent;
9
8
  endIcon?: import("../button/types").SvgIconComponent;
10
9
  startIcon?: import("../button/types").SvgIconComponent;
11
10
  }, "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> & {
12
11
  children?: string | string[];
13
- icon?: import("../button/types").SvgIconComponent;
14
12
  endIcon?: import("../button/types").SvgIconComponent;
15
13
  startIcon?: import("../button/types").SvgIconComponent;
16
14
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
17
15
  SecondaryButton: 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> & {
18
16
  children?: string | string[];
19
- icon?: import("../button/types").SvgIconComponent;
20
17
  endIcon?: import("../button/types").SvgIconComponent;
21
18
  startIcon?: import("../button/types").SvgIconComponent;
22
19
  }, "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> & {
23
20
  children?: string | string[];
24
- icon?: import("../button/types").SvgIconComponent;
25
21
  endIcon?: import("../button/types").SvgIconComponent;
26
22
  startIcon?: import("../button/types").SvgIconComponent;
27
23
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
@@ -6,23 +6,19 @@ import { type ModalFooterProps } from './types';
6
6
  export declare const ModalFooter: import("react").ForwardRefExoticComponent<ModalFooterProps & import("react").RefAttributes<HTMLDivElement>> & {
7
7
  PrimaryButton: 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> & {
8
8
  children?: string | string[];
9
- icon?: import("../button/types").SvgIconComponent;
10
9
  endIcon?: import("../button/types").SvgIconComponent;
11
10
  startIcon?: import("../button/types").SvgIconComponent;
12
11
  }, "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> & {
13
12
  children?: string | string[];
14
- icon?: import("../button/types").SvgIconComponent;
15
13
  endIcon?: import("../button/types").SvgIconComponent;
16
14
  startIcon?: import("../button/types").SvgIconComponent;
17
15
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
18
16
  SecondaryButton: 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> & {
19
17
  children?: string | string[];
20
- icon?: import("../button/types").SvgIconComponent;
21
18
  endIcon?: import("../button/types").SvgIconComponent;
22
19
  startIcon?: import("../button/types").SvgIconComponent;
23
20
  }, "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> & {
24
21
  children?: string | string[];
25
- icon?: import("../button/types").SvgIconComponent;
26
22
  endIcon?: import("../button/types").SvgIconComponent;
27
23
  startIcon?: import("../button/types").SvgIconComponent;
28
24
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
@@ -33,23 +33,19 @@ export declare const Modal: (({ children, modal, ...props }: ModalProps) => impo
33
33
  Footer: import("react").ForwardRefExoticComponent<import("./types").ModalFooterProps & import("react").RefAttributes<HTMLDivElement>> & {
34
34
  PrimaryButton: 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> & {
35
35
  children?: string | string[];
36
- icon?: import("../button/types").SvgIconComponent;
37
36
  endIcon?: import("../button/types").SvgIconComponent;
38
37
  startIcon?: import("../button/types").SvgIconComponent;
39
38
  }, "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> & {
40
39
  children?: string | string[];
41
- icon?: import("../button/types").SvgIconComponent;
42
40
  endIcon?: import("../button/types").SvgIconComponent;
43
41
  startIcon?: import("../button/types").SvgIconComponent;
44
42
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
45
43
  SecondaryButton: 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> & {
46
44
  children?: string | string[];
47
- icon?: import("../button/types").SvgIconComponent;
48
45
  endIcon?: import("../button/types").SvgIconComponent;
49
46
  startIcon?: import("../button/types").SvgIconComponent;
50
47
  }, "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> & {
51
48
  children?: string | string[];
52
- icon?: import("../button/types").SvgIconComponent;
53
49
  endIcon?: import("../button/types").SvgIconComponent;
54
50
  startIcon?: import("../button/types").SvgIconComponent;
55
51
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,4 +1,4 @@
1
1
  import '../../index.css';
2
- var styles = {"menuBlock":"bp_context_menu_module_menuBlock--b9e5e","menuHeader":"bp_context_menu_module_menuHeader--b9e5e","fullScreenContent":"bp_context_menu_module_fullScreenContent--b9e5e","menuItemsSeparator":"bp_context_menu_module_menuItemsSeparator--b9e5e","menuItem":"bp_context_menu_module_menuItem--b9e5e","startElement":"bp_context_menu_module_startElement--b9e5e","endElement":"bp_context_menu_module_endElement--b9e5e","headerTextContent":"bp_context_menu_module_headerTextContent--b9e5e","submenuCloseButton":"bp_context_menu_module_submenuCloseButton--b9e5e","menuCloseButton":"bp_context_menu_module_menuCloseButton--b9e5e","ellipsis":"bp_context_menu_module_ellipsis--b9e5e"};
2
+ var styles = {"menuBlock":"bp_context_menu_module_menuBlock--2df31","menuHeader":"bp_context_menu_module_menuHeader--2df31","fullScreenContent":"bp_context_menu_module_fullScreenContent--2df31","menuItemsSeparator":"bp_context_menu_module_menuItemsSeparator--2df31","menuItem":"bp_context_menu_module_menuItem--2df31","startElement":"bp_context_menu_module_startElement--2df31","endElement":"bp_context_menu_module_endElement--2df31","headerTextContent":"bp_context_menu_module_headerTextContent--2df31","submenuCloseButton":"bp_context_menu_module_submenuCloseButton--2df31","menuCloseButton":"bp_context_menu_module_menuCloseButton--2df31","ellipsis":"bp_context_menu_module_ellipsis--2df31"};
3
3
 
4
4
  export { styles as default };
@@ -81,7 +81,6 @@ const SelectMenuGridOption = /*#__PURE__*/forwardRef((props, forwardedRef) => {
81
81
  "data-modern": enableModernizedComponents ? 'true' : 'false',
82
82
  role: "gridcell",
83
83
  children: [shouldShowTooltip && jsx(Tooltip, {
84
- __checkInteractivity: false,
85
84
  "aria-hidden": true,
86
85
  content: ariaLabel,
87
86
  side: props.tooltipSide,
@@ -6,23 +6,19 @@ import { type SidePanelFooterProps } from './types';
6
6
  export declare const SidePanelFooter: import("react").ForwardRefExoticComponent<Omit<SidePanelFooterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
7
7
  PrimaryButton: 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> & {
8
8
  children?: string | string[];
9
- icon?: import("../button/types").SvgIconComponent;
10
9
  endIcon?: import("../button/types").SvgIconComponent;
11
10
  startIcon?: import("../button/types").SvgIconComponent;
12
11
  }, "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> & {
13
12
  children?: string | string[];
14
- icon?: import("../button/types").SvgIconComponent;
15
13
  endIcon?: import("../button/types").SvgIconComponent;
16
14
  startIcon?: import("../button/types").SvgIconComponent;
17
15
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
18
16
  SecondaryButton: 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> & {
19
17
  children?: string | string[];
20
- icon?: import("../button/types").SvgIconComponent;
21
18
  endIcon?: import("../button/types").SvgIconComponent;
22
19
  startIcon?: import("../button/types").SvgIconComponent;
23
20
  }, "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> & {
24
21
  children?: string | string[];
25
- icon?: import("../button/types").SvgIconComponent;
26
22
  endIcon?: import("../button/types").SvgIconComponent;
27
23
  startIcon?: import("../button/types").SvgIconComponent;
28
24
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
@@ -7,23 +7,19 @@ export declare const SidePanel: ((props: SidePanelProps) => import("react/jsx-ru
7
7
  Footer: import("react").ForwardRefExoticComponent<Omit<import("./types").SidePanelFooterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
8
8
  PrimaryButton: 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> & {
9
9
  children?: string | string[];
10
- icon?: import("../button/types").SvgIconComponent;
11
10
  endIcon?: import("../button/types").SvgIconComponent;
12
11
  startIcon?: import("../button/types").SvgIconComponent;
13
12
  }, "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> & {
14
13
  children?: string | string[];
15
- icon?: import("../button/types").SvgIconComponent;
16
14
  endIcon?: import("../button/types").SvgIconComponent;
17
15
  startIcon?: import("../button/types").SvgIconComponent;
18
16
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
19
17
  SecondaryButton: 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> & {
20
18
  children?: string | string[];
21
- icon?: import("../button/types").SvgIconComponent;
22
19
  endIcon?: import("../button/types").SvgIconComponent;
23
20
  startIcon?: import("../button/types").SvgIconComponent;
24
21
  }, "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> & {
25
22
  children?: string | string[];
26
- icon?: import("../button/types").SvgIconComponent;
27
23
  endIcon?: import("../button/types").SvgIconComponent;
28
24
  startIcon?: import("../button/types").SvgIconComponent;
29
25
  }, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,6 +1,7 @@
1
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
1
2
  import React from 'react';
2
- import { type TooltipProps, type TooltipProviderProps, type TooltipTriggerProps } from './types';
3
+ import { type TooltipProps, type TooltipProviderProps } from './types';
3
4
  export declare const Tooltip: (props: TooltipProps) => import("react/jsx-runtime").JSX.Element;
4
5
  export declare const ContainerContext: React.Context<HTMLElement | null | undefined>;
5
6
  export declare const TooltipProvider: (props: TooltipProviderProps) => import("react/jsx-runtime").JSX.Element;
6
- export declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
7
+ export declare const TooltipTrigger: typeof RadixTooltip.Trigger;
@@ -4,8 +4,6 @@ import * as RadixTooltip from '@radix-ui/react-tooltip';
4
4
  import clsx from 'clsx';
5
5
  import React__default, { useContext } from 'react';
6
6
  import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
7
- import { useForkRef } from '../utils/useForkRef.js';
8
- import { useIsTriggerInteractive } from '../utils/useIsTriggerInteractive.js';
9
7
  import styles from './tooltip.module.js';
10
8
 
11
9
  /**
@@ -27,7 +25,6 @@ const Tooltip = props => {
27
25
  open,
28
26
  defaultOpen,
29
27
  forceMount,
30
- __checkInteractivity,
31
28
  ...contentProps
32
29
  } = props;
33
30
  const container = useContext(ContainerContext);
@@ -36,8 +33,6 @@ const Tooltip = props => {
36
33
  onOpenChange: onOpenChange,
37
34
  open: open,
38
35
  children: [jsx(TooltipTrigger, {
39
- __checkInteractivity: __checkInteractivity,
40
- open: open,
41
36
  children: children
42
37
  }), jsx(RadixTooltip.Portal, {
43
38
  container: container,
@@ -65,43 +60,14 @@ const TooltipProvider = props => {
65
60
  })
66
61
  });
67
62
  };
68
- const Trigger = /*#__PURE__*/React__default.forwardRef(function Trigger(props, ref) {
63
+ const TooltipTrigger = /*#__PURE__*/React__default.forwardRef(function TooltipTrigger(props, ref) {
69
64
  return jsx(RadixTooltip.Trigger, {
70
65
  ref: ref,
71
66
  asChild: true,
67
+ "data-blueprint-tooltip-trigger": "",
72
68
  children: props.children
73
69
  });
74
70
  });
75
- /**
76
- * Trigger component with interactivity check.
77
- * Encapsulation in separate component is a workaround which allows to render hooks
78
- * responsible for check only when it's specifically needed, without breaking rule of hooks
79
- * by calling them conditionally.
80
- */
81
- const TriggerWithInteractivityCheck = /*#__PURE__*/React__default.forwardRef(function TriggerWithInteractivityCheck(props, ref) {
82
- const triggerRef = useIsTriggerInteractive();
83
- return jsx(Trigger, {
84
- ref: useForkRef(triggerRef, ref),
85
- children: props.children
86
- });
87
- });
88
- const TooltipTrigger = /*#__PURE__*/React__default.forwardRef(({
89
- children,
90
- open,
91
- __checkInteractivity = true
92
- }, ref) => {
93
- // in dev environment, if Tooltip open state is not explicitly controlled by user, check if it's used with interactive element
94
- if (process.env.NODE_ENV !== 'production' && open === undefined && __checkInteractivity) {
95
- return jsx(TriggerWithInteractivityCheck, {
96
- ref: ref,
97
- children: children
98
- });
99
- }
100
- return jsx(Trigger, {
101
- ref: ref,
102
- children: children
103
- });
104
- });
105
71
  const Arrow = /*#__PURE__*/React__default.forwardRef(function Arrow({
106
72
  variant
107
73
  }, ref) {
@@ -23,8 +23,6 @@ export interface TooltipProps extends Omit<React.ComponentProps<typeof RadixTool
23
23
  defaultOpen?: RadixTooltip.TooltipProps['defaultOpen'];
24
24
  /** Used to force mounting when more control is needed. */
25
25
  forceMount?: RadixTooltip.TooltipPortalProps['forceMount'];
26
- /** Blueprint internal prop. Checks whether the trigger element is interactive to provide a warning if it's not interactive. Defaults to `true`. */
27
- __checkInteractivity?: boolean;
28
26
  }
29
27
  export interface TooltipProviderProps {
30
28
  /** The rest of the application */
@@ -37,10 +35,3 @@ export interface TooltipProviderProps {
37
35
  export interface ArrowProps {
38
36
  variant: TooltipVariant;
39
37
  }
40
- export interface TooltipTriggerProps {
41
- children?: React.ReactNode;
42
- /** The controlled open state of the tooltip. */
43
- open?: TooltipProps['open'];
44
- /** Blueprint internal prop. Checks whether the trigger element is interactive to provide a warning if it's not interactive. Defaults to `true`. */
45
- __checkInteractivity?: boolean;
46
- }
@@ -99,9 +99,9 @@ export type BaseGridListThumbnailProps = ComponentPropsWithRef<'div'> & {
99
99
  * fileExtension="xlsx"
100
100
  * fileCategory="excel-spreadsheet"
101
101
  * statusBadge={
102
- * <CardTooltipV2 content="Classification: Confidential">
102
+ * <CardTooltip content="Classification: Confidential">
103
103
  * <Status colorIndex={2} hideText icon={Shield} text="Confidential" />
104
- * </CardTooltipV2>
104
+ * </CardTooltip>
105
105
  * }
106
106
  * >
107
107
  * <img src={thumbnailUrl} alt={fileName} />
@@ -1,9 +1,21 @@
1
1
  import { useState, useEffect } from 'react';
2
2
 
3
+ const canUseMatchMedia = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function';
3
4
  const useMedia = query => {
4
- const [matches, setMatches] = useState(window.matchMedia(query).matches);
5
+ // SSR-safe: use lazy initializer to defer window access
6
+ const [matches, setMatches] = useState(() => {
7
+ if (!canUseMatchMedia()) {
8
+ return false;
9
+ }
10
+ return window.matchMedia(query).matches;
11
+ });
5
12
  useEffect(() => {
13
+ if (!canUseMatchMedia()) {
14
+ return undefined;
15
+ }
6
16
  const mediaQueryList = window.matchMedia(query);
17
+ // Sync state on mount (handles SSR hydration mismatch)
18
+ setMatches(mediaQueryList.matches);
7
19
  const onChange = e => setMatches(e.matches);
8
20
  mediaQueryList.addEventListener('change', onChange);
9
21
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "13.19.0",
3
+ "version": "14.0.1",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -11,8 +11,8 @@
11
11
  "THIRD_PARTY_LICENSES"
12
12
  ],
13
13
  "peerDependencies": {
14
- "react": "^17.0.0 || ^18.0.0",
15
- "react-dom": "^17.0.0 || ^18.0.0"
14
+ "react": "^18.0.0",
15
+ "react-dom": "^18.0.0"
16
16
  },
17
17
  "scripts": {
18
18
  "build-storybook": "nx run blueprint-web:build-storybook",
@@ -45,10 +45,10 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@ariakit/react": "0.4.15",
49
- "@ariakit/react-core": "0.4.15",
50
- "@box/blueprint-web-assets": "^4.111.14",
51
- "@internationalized/date": "^3.7.0",
48
+ "@ariakit/react": "0.4.21",
49
+ "@ariakit/react-core": "0.4.21",
50
+ "@box/blueprint-web-assets": "^4.111.16",
51
+ "@internationalized/date": "^3.12.0",
52
52
  "@radix-ui/react-accordion": "1.1.2",
53
53
  "@radix-ui/react-checkbox": "1.0.4",
54
54
  "@radix-ui/react-collapsible": "1.0.3",
@@ -66,24 +66,24 @@
66
66
  "@radix-ui/react-toggle-group": "1.0.4",
67
67
  "@radix-ui/react-toolbar": "1.0.4",
68
68
  "@radix-ui/react-tooltip": "1.0.7",
69
- "@react-aria/i18n": "3.12.7",
70
- "@react-aria/utils": "3.28.1",
69
+ "@react-aria/i18n": "3.12.16",
70
+ "@react-aria/interactions": "3.27.1",
71
+ "@react-aria/utils": "3.33.1",
71
72
  "clsx": "^1.2.1",
72
73
  "color": "2.0.1",
73
74
  "lodash": "^4.17.15",
74
- "react-aria": "3.38.1",
75
- "react-aria-components": "1.7.1",
76
- "tabbable": "^4.0.0",
75
+ "react-aria": "3.47.0",
76
+ "react-aria-components": "1.16.0",
77
77
  "type-fest": "^3.2.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@box/storybook-utils": "^0.17.14",
80
+ "@box/storybook-utils": "^0.17.16",
81
81
  "@figma/code-connect": "1.3.12",
82
82
  "@types/react": "^18.0.0",
83
83
  "@types/react-dom": "^18.0.0",
84
84
  "react": "^18.3.0",
85
85
  "react-dom": "^18.3.0",
86
- "react-stately": "^3.35.0",
86
+ "react-stately": "^3.45.0",
87
87
  "tsx": "^4.16.5"
88
88
  }
89
89
  }
@@ -1,10 +0,0 @@
1
- import { type CardTooltipV2Props } from './types';
2
- /**
3
- * CardTooltipV2 is a component that wraps a Card component inside a Tooltip component. The main difference between CardTooltipV2 and CardTooltip is that CardTooltipV2 uses Ariakit Tooltip component instead of Radix Tooltip component.
4
- *
5
- * You must only pass non-interactive content inside `content` prop.
6
- *
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
- *
9
- */
10
- export declare const CardTooltipV2: import("react").ForwardRefExoticComponent<CardTooltipV2Props & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,119 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import * as Ariakit from '@ariakit/react';
3
- import clsx from 'clsx';
4
- import { forwardRef, useRef, useLayoutEffect, useCallback } from 'react';
5
- import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
6
- import { Card } from '../card/card.js';
7
- import { composeEventHandlers } from '../utils/composeEventHandlers.js';
8
- import styles from './card-tooltip-v2.module.js';
9
-
10
- /**
11
- * CardTooltipV2 is a component that wraps a Card component inside a Tooltip component. The main difference between CardTooltipV2 and CardTooltip is that CardTooltipV2 uses Ariakit Tooltip component instead of Radix Tooltip component.
12
- *
13
- * You must only pass non-interactive content inside `content` prop.
14
- *
15
- * **IMPORTANT**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
16
- *
17
- */
18
- const CardTooltipV2 = /*#__PURE__*/forwardRef((props, ref) => {
19
- const {
20
- children,
21
- content,
22
- setOpen,
23
- open,
24
- defaultOpen,
25
- className,
26
- skipTimeout,
27
- hideTooltipOnContentClick,
28
- hideOnInteractOutside,
29
- placement = 'bottom',
30
- elevation = 'dropshadow-3',
31
- addDelayOnFocus,
32
- ...contentProps
33
- } = props;
34
- const SHOW_TIMEOUT = 300;
35
- const tooltipStore = Ariakit.useTooltipStore({
36
- open,
37
- setOpen,
38
- defaultOpen,
39
- placement,
40
- showTimeout: SHOW_TIMEOUT,
41
- hideTimeout: 0,
42
- skipTimeout
43
- });
44
- const side = Ariakit.useStoreState(tooltipStore, 'currentPlacement').split('-')[0];
45
- const contentId = Ariakit.useStoreState(tooltipStore, state => state.contentElement?.id);
46
- const mounted = Ariakit.useStoreState(tooltipStore, 'mounted');
47
- const isOpen = Ariakit.useStoreState(tooltipStore, 'open');
48
- const focusTimeout = useRef(0);
49
- const {
50
- enableModernizedComponents
51
- } = useBlueprintModernization();
52
- useLayoutEffect(() => {
53
- if (mounted && !isOpen) {
54
- // Make sure that tooltip disappears instantly after it is closed.
55
- // Otherwise, once a tooltip is hovered, moving mouse to other tooltips
56
- // could open them without honoring `showTimeout`.
57
- tooltipStore.setState('animating', false);
58
- }
59
- }, [isOpen, mounted, tooltipStore]);
60
- const handleHideOnInteractOutside = useCallback(e => {
61
- if (typeof hideOnInteractOutside === 'function') {
62
- hideOnInteractOutside(e);
63
- }
64
- if (e.type === 'focusin') {
65
- const state = tooltipStore.getState();
66
- const contentElement = state?.contentElement;
67
- // If tooltip content is losing focus, do not hide it
68
- // since it can be stolen sometimes by elements outside of it.
69
- if (e?.relatedTarget === contentElement) {
70
- return false;
71
- }
72
- }
73
- return true;
74
- }, [hideOnInteractOutside, tooltipStore]);
75
- const handleOnFocusVisibleWithDelay = event => {
76
- event.preventDefault();
77
- event.currentTarget.setAttribute('data-focus-visible', 'true');
78
- focusTimeout.current = window.setTimeout(() => {
79
- tooltipStore?.setAnchorElement(event.currentTarget);
80
- tooltipStore?.show();
81
- }, SHOW_TIMEOUT);
82
- };
83
- const handleBlur = event => {
84
- event.currentTarget.removeAttribute('data-focus-visible');
85
- window.clearTimeout(focusTimeout.current);
86
- };
87
- return jsxs(Ariakit.TooltipProvider, {
88
- store: tooltipStore,
89
- children: [jsx(Ariakit.TooltipAnchor, {
90
- ...(mounted && {
91
- 'aria-describedby': contentId
92
- }),
93
- onClick: tooltipStore.hide,
94
- render: children,
95
- ...(addDelayOnFocus && {
96
- onFocusVisible: handleOnFocusVisibleWithDelay,
97
- onBlur: handleBlur
98
- })
99
- }), jsx(Ariakit.Tooltip, {
100
- ...contentProps,
101
- ...(hideTooltipOnContentClick && {
102
- onClick: composeEventHandlers(tooltipStore.hide, contentProps.onClick)
103
- }),
104
- ref: ref,
105
- className: clsx(styles.content, className),
106
- "data-modern": enableModernizedComponents ? 'true' : 'false',
107
- "data-side": side,
108
- fitViewport: true,
109
- gutter: 4,
110
- hideOnInteractOutside: handleHideOnInteractOutside,
111
- children: jsx(Card, {
112
- elevation: elevation,
113
- children: content
114
- })
115
- })]
116
- });
117
- });
118
-
119
- export { CardTooltipV2 };
@@ -1,4 +0,0 @@
1
- import '../index.css';
2
- var styles = {"content":"bp_card_tooltip_v2_module_content--0d2ae"};
3
-
4
- export { styles as default };
@@ -1,2 +0,0 @@
1
- export { CardTooltipV2 } from './card-tooltip-v2';
2
- export { type CardTooltipV2Props } from './types';
@@ -1,30 +0,0 @@
1
- import { type TooltipProps, type TooltipStoreProps } from '@ariakit/react';
2
- import { type ReactElement, type ReactNode } from 'react';
3
- import { type CardProps } from '../card/types';
4
- export interface CardTooltipV2Props extends Omit<TooltipProps, 'content' | 'ref'> {
5
- /**
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
- */
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'];
15
- /**
16
- * The elevation of the Card inside.
17
- * @default dropshadow-3
18
- */
19
- elevation?: CardProps['elevation'];
20
- /**
21
- * If true, the tooltip will close itself when the content area is clicked.
22
- * @default false
23
- */
24
- hideTooltipOnContentClick?: boolean;
25
- open?: TooltipStoreProps['open'];
26
- placement?: TooltipStoreProps['placement'];
27
- portalElement?: TooltipProps['portalElement'];
28
- setOpen?: TooltipStoreProps['setOpen'];
29
- skipTimeout?: TooltipStoreProps['skipTimeout'];
30
- }
@@ -1,4 +0,0 @@
1
- import { type ContentFieldProps } from './types';
2
- export declare const contentFieldButtonTestId = "ContentField-button";
3
- /** @deprecated Use ContentField from @box/content-field package */
4
- export declare const ContentField: import("react").ForwardRefExoticComponent<ContentFieldProps & import("react").RefAttributes<HTMLButtonElement>>;