@box/blueprint-web 12.79.0 → 12.81.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.
@@ -1,9 +1,10 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Checkmark } from '@box/blueprint-web-assets/icons/Fill';
3
- import { Gray100 } from '@box/blueprint-web-assets/tokens/tokens';
3
+ import { bpIconIconOnLight, Gray100 } from '@box/blueprint-web-assets/tokens/tokens';
4
4
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
5
5
  import clsx from 'clsx';
6
6
  import { forwardRef, useCallback } from 'react';
7
+ import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
7
8
  import { composeEventHandlers } from '../../utils/composeEventHandlers.js';
8
9
  import styles from './dropdown-menu.module.js';
9
10
  import { useMenuItemVariant } from './menu-item-variant-context.js';
@@ -21,8 +22,12 @@ const DropdownMenuCheckboxItem = /*#__PURE__*/forwardRef((props, forwardedRef) =
21
22
  const {
22
23
  internalSize
23
24
  } = useMenuItemVariant();
25
+ const {
26
+ enableModernizedComponents
27
+ } = useBlueprintModernization();
24
28
  const isSizeSmall = internalSize === 'small';
25
29
  const checkmarkSize = isSizeSmall ? '1rem' : '2rem';
30
+ const checkmarkColor = enableModernizedComponents ? bpIconIconOnLight : Gray100;
26
31
  const preventDefault = useCallback(event => event.preventDefault(), []);
27
32
  return jsxs(DropdownMenuPrimitive.CheckboxItem, {
28
33
  ...rest,
@@ -33,7 +38,7 @@ const DropdownMenuCheckboxItem = /*#__PURE__*/forwardRef((props, forwardedRef) =
33
38
  children: [jsx(DropdownMenuPrimitive.ItemIndicator, {
34
39
  className: styles.checkmark,
35
40
  children: jsx(Checkmark, {
36
- color: Gray100,
41
+ color: checkmarkColor,
37
42
  height: checkmarkSize,
38
43
  role: "presentation",
39
44
  width: checkmarkSize
@@ -1,8 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { Size8, Size4 } from '@box/blueprint-web-assets/tokens/tokens';
2
+ import { Size8, Size4, bpIconIconOnLightSecondary } from '@box/blueprint-web-assets/tokens/tokens';
3
3
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
4
4
  import clsx from 'clsx';
5
5
  import { forwardRef, useCallback, createElement } from 'react';
6
+ import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
6
7
  import { Text } from '../../text/text.js';
7
8
  import { composeEventHandlers } from '../../utils/composeEventHandlers.js';
8
9
  import styles from './dropdown-menu.module.js';
@@ -86,13 +87,18 @@ const MenuItemStartElement = /*#__PURE__*/forwardRef(({
86
87
  const {
87
88
  internalSize
88
89
  } = useMenuItemVariant();
90
+ const {
91
+ enableModernizedComponents
92
+ } = useBlueprintModernization();
89
93
  const iconSize = internalSize === 'medium' ? Size8 : Size4;
94
+ const iconColor = enableModernizedComponents ? bpIconIconOnLightSecondary : undefined;
90
95
  return jsxs("div", {
91
96
  ...rest,
92
97
  ref: ref,
93
98
  className: clsx(styles.startElement, className),
94
99
  children: [icon && /*#__PURE__*/createElement(icon, {
95
100
  className: styles.icon,
101
+ color: iconColor,
96
102
  height: iconSize,
97
103
  width: iconSize,
98
104
  role: 'presentation'
@@ -1,9 +1,10 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Checkmark } from '@box/blueprint-web-assets/icons/Fill';
3
- import { Gray100 } from '@box/blueprint-web-assets/tokens/tokens';
3
+ import { bpIconIconOnLight, Gray100 } from '@box/blueprint-web-assets/tokens/tokens';
4
4
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
5
5
  import clsx from 'clsx';
6
6
  import { forwardRef, useCallback } from 'react';
7
+ import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
7
8
  import { composeEventHandlers } from '../../utils/composeEventHandlers.js';
8
9
  import styles from './dropdown-menu.module.js';
9
10
  import { useMenuItemVariant } from './menu-item-variant-context.js';
@@ -21,8 +22,12 @@ const DropdownMenuRadioSelectItem = /*#__PURE__*/forwardRef((props, forwardedRef
21
22
  const {
22
23
  internalSize
23
24
  } = useMenuItemVariant();
25
+ const {
26
+ enableModernizedComponents
27
+ } = useBlueprintModernization();
24
28
  const isSizeSmall = internalSize === 'small';
25
29
  const checkmarkSize = isSizeSmall ? '1rem' : '2rem';
30
+ const checkmarkColor = enableModernizedComponents ? bpIconIconOnLight : Gray100;
26
31
  const preventDefault = useCallback(event => event.preventDefault(), []);
27
32
  return jsxs(DropdownMenuPrimitive.RadioItem, {
28
33
  ...rest,
@@ -34,7 +39,7 @@ const DropdownMenuRadioSelectItem = /*#__PURE__*/forwardRef((props, forwardedRef
34
39
  children: [jsx(DropdownMenuPrimitive.ItemIndicator, {
35
40
  className: styles.checkmark,
36
41
  children: jsx(Checkmark, {
37
- color: Gray100,
42
+ color: checkmarkColor,
38
43
  height: checkmarkSize,
39
44
  role: "presentation",
40
45
  width: checkmarkSize
@@ -16,7 +16,8 @@ import { RACTooltip } from './utils/rac-tooltip.js';
16
16
 
17
17
  const BaseListActions = ({
18
18
  children,
19
- selectionEnabled
19
+ selectionEnabled,
20
+ isSelectionCheckboxDisabled
20
21
  }) => {
21
22
  return jsxs(Fragment, {
22
23
  children: [jsx("div", {
@@ -27,18 +28,21 @@ const BaseListActions = ({
27
28
  className: styles.inner,
28
29
  children: children
29
30
  }), selectionEnabled && jsx(ListCheckbox, {
30
- className: styles.selection
31
+ className: styles.selection,
32
+ isDisabled: isSelectionCheckboxDisabled
31
33
  })]
32
34
  })]
33
35
  });
34
36
  };
35
37
  const GridListActions = ({
36
38
  children,
37
- selectionEnabled
39
+ selectionEnabled,
40
+ isSelectionCheckboxDisabled
38
41
  }) => {
39
42
  return jsxs(Fragment, {
40
43
  children: [selectionEnabled && jsx(ListCheckbox, {
41
- className: styles.selection
44
+ className: styles.selection,
45
+ isDisabled: isSelectionCheckboxDisabled
42
46
  }), jsx("div", {
43
47
  className: styles.inner,
44
48
  children: children
@@ -91,6 +95,7 @@ const BaseGridListActions = /*#__PURE__*/forwardRef(function BaseGridListActions
91
95
  const {
92
96
  children,
93
97
  className,
98
+ isSelectionCheckboxDisabled,
94
99
  ...rest
95
100
  } = props;
96
101
  const {
@@ -113,9 +118,11 @@ const BaseGridListActions = /*#__PURE__*/forwardRef(function BaseGridListActions
113
118
  ref: forkRef,
114
119
  className: clsx(styles.actions, className),
115
120
  children: isList ? jsx(BaseListActions, {
121
+ isSelectionCheckboxDisabled: isSelectionCheckboxDisabled,
116
122
  selectionEnabled: isSelectionEnabled,
117
123
  children: isRenderPropUsed ? children(setIsItemInteracted) : children
118
124
  }) : jsx(GridListActions, {
125
+ isSelectionCheckboxDisabled: isSelectionCheckboxDisabled,
119
126
  selectionEnabled: isSelectionEnabled,
120
127
  children: isRenderPropUsed ? children(setIsItemInteracted) : children
121
128
  })
@@ -30,6 +30,7 @@ export type BaseGridListSubtitleProps = ComponentPropsWithRef<'span'>;
30
30
  export type BaseGridListDescriptionProps = ComponentPropsWithRef<'p'>;
31
31
  export type BaseGridListActionsProps = Modify<ComponentPropsWithRef<'div'>, {
32
32
  children: ReactNode | ((setIsInteracted: (open: boolean) => void) => ReactNode);
33
+ isSelectionCheckboxDisabled?: boolean;
33
34
  }>;
34
35
  export type BaseGridListActionIconButtonProps = IconButtonProps;
35
36
  export interface BaseGridListProps extends Omit<RAGridListProps<object>, 'layout'>, CustomGridListProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "12.79.0",
3
+ "version": "12.81.0",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {