@box/blueprint-web 18.5.6 → 18.7.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,4 +1,4 @@
1
- export type { LargeListV2ActionIconButtonProps, LargeListV2ActionsProps, LargeListV2HeaderProps, LargeListV2ItemProps, LargeListV2Props, LargeListV2SubtitleProps, LargeListV2ThumbnailProps, } from './types';
1
+ export type { LargeListV2ActionIconButtonProps, LargeListV2ActionsProps, LargeListV2DescriptionProps, LargeListV2HeaderProps, LargeListV2ItemProps, LargeListV2Props, LargeListV2SubtitleProps, LargeListV2ThumbnailProps, } from './types';
2
2
  /**
3
3
  * LargeListV2 - A modernized horizontal list component for displaying items in a compact row layout.
4
4
  *
@@ -31,6 +31,10 @@ export declare const LargeListV2: import("react").ForwardRefExoticComponent<impo
31
31
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
32
32
  /** Title/name of the item (15px/20px). */
33
33
  Header: import("react").ForwardRefExoticComponent<Omit<import("../util-components/base-grid-list-item").BaseGridListHeaderProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
34
+ /** Text between the title and subtitle. Wraps to three lines. */
35
+ Description: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
36
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
37
+ }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
34
38
  /** Secondary text below the header (13px/20px). */
35
39
  Subtitle: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
36
40
  ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
@@ -5,6 +5,7 @@ import { BaseGridListSubtitle } from '../util-components/base-grid-list-item/bas
5
5
  import { BaseGridListThumbnail } from '../util-components/base-grid-list-item/base-grid-list-item-thumbnail.js';
6
6
  import { LargeListV2Root } from './large-list-v2.js';
7
7
  import { LargeListV2Content } from './large-list-v2-content.js';
8
+ import { LargeListV2Description } from './large-list-v2-description.js';
8
9
 
9
10
  /**
10
11
  * LargeListV2 - A modernized horizontal list component for displaying items in a compact row layout.
@@ -36,6 +37,8 @@ const LargeListV2 = Object.assign(LargeListV2Root, {
36
37
  Content: LargeListV2Content,
37
38
  /** Title/name of the item (15px/20px). */
38
39
  Header: BaseGridListHeader,
40
+ /** Text between the title and subtitle. Wraps to three lines. */
41
+ Description: LargeListV2Description,
39
42
  /** Secondary text below the header (13px/20px). */
40
43
  Subtitle: BaseGridListSubtitle,
41
44
  /** Container for action buttons and selection checkbox. */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Content wrapper for LargeListV2 items.
3
- * Groups the header and subtitle in a vertical stack.
3
+ * Renders with `display: contents`, so its children are laid out by the item grid.
4
4
  */
5
5
  export declare const LargeListV2Content: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
6
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
@@ -4,7 +4,7 @@ import styles from '../util-components/base-grid-list-item/base-grid-list-item.m
4
4
 
5
5
  /**
6
6
  * Content wrapper for LargeListV2 items.
7
- * Groups the header and subtitle in a vertical stack.
7
+ * Renders with `display: contents`, so its children are laid out by the item grid.
8
8
  */
9
9
  const LargeListV2Content = /*#__PURE__*/forwardRef(function LargeListV2Content(props, ref) {
10
10
  const {
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Secondary content between the header and subtitle, e.g. breadcrumbs or a search snippet.
3
+ */
4
+ export declare const LargeListV2Description: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
6
+ }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,33 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import { forwardRef } from 'react';
4
+ import { Ghost } from '../ghost/ghost.js';
5
+ import { useBaseGridListItemContext } from '../util-components/base-grid-list-item/base-grid-list-item.js';
6
+ import styles from '../util-components/base-grid-list-item/base-grid-list-item.module.js';
7
+
8
+ /**
9
+ * Secondary content between the header and subtitle, e.g. breadcrumbs or a search snippet.
10
+ */
11
+ const LargeListV2Description = /*#__PURE__*/forwardRef(function LargeListV2Description(props, ref) {
12
+ const {
13
+ children,
14
+ className,
15
+ ...rest
16
+ } = props;
17
+ const {
18
+ loading
19
+ } = useBaseGridListItemContext();
20
+ return jsx("div", {
21
+ ...rest,
22
+ ref: ref,
23
+ className: clsx(styles.listV2Description, {
24
+ [styles.loading]: loading
25
+ }, className),
26
+ children: loading ? jsx(Ghost, {
27
+ variant: "rectangle",
28
+ width: "25%"
29
+ }) : children
30
+ });
31
+ });
32
+
33
+ export { LargeListV2Description };
@@ -1,8 +1,9 @@
1
- import { type BaseGridListActionIconButtonProps, type BaseGridListActionsProps, type BaseGridListHeaderProps, type BaseGridListItemProps, type BaseGridListProps, type BaseGridListSubtitleProps, type BaseGridListThumbnailProps } from '../util-components/base-grid-list-item/types';
1
+ import { type BaseGridListActionIconButtonProps, type BaseGridListActionsProps, type BaseGridListHeaderProps, type BaseGridListItemProps, type BaseGridListProps, type BaseGridListSubtitleProps, type BaseGridListThumbnailProps, type BaseGridListV2DescriptionProps } from '../util-components/base-grid-list-item/types';
2
2
  export type LargeListV2Props = Omit<BaseGridListProps, 'layoutStyle' | 'centerText' | 'variant'>;
3
3
  export type LargeListV2ItemProps = BaseGridListItemProps;
4
4
  export type LargeListV2ThumbnailProps = BaseGridListThumbnailProps;
5
5
  export type LargeListV2HeaderProps = BaseGridListHeaderProps;
6
6
  export type LargeListV2SubtitleProps = BaseGridListSubtitleProps;
7
+ export type LargeListV2DescriptionProps = BaseGridListV2DescriptionProps;
7
8
  export type LargeListV2ActionsProps = BaseGridListActionsProps;
8
9
  export type LargeListV2ActionIconButtonProps = BaseGridListActionIconButtonProps;
@@ -14,6 +14,7 @@ import styles from './base-grid-list-item.module.js';
14
14
  import { RACButton } from './utils/rac-button.js';
15
15
  import { RACTooltip } from './utils/rac-tooltip.js';
16
16
 
17
+ const hasChildren = children => children !== null && children !== undefined && children !== false;
17
18
  const BaseListActions = ({
18
19
  children,
19
20
  selectionEnabled,
@@ -24,10 +25,10 @@ const BaseListActions = ({
24
25
  className: styles.fade
25
26
  }), jsxs("div", {
26
27
  className: styles.actionsCheckboxWrapper,
27
- children: [jsx("div", {
28
+ children: [hasChildren(children) ? jsx("div", {
28
29
  className: styles.inner,
29
30
  children: children
30
- }), selectionEnabled && jsx(ListCheckbox, {
31
+ }) : null, selectionEnabled && jsx(ListCheckbox, {
31
32
  className: styles.selection,
32
33
  isDisabled: isSelectionCheckboxDisabled
33
34
  })]
@@ -41,11 +42,10 @@ const GridListActions = ({
41
42
  centerText,
42
43
  setHasActions
43
44
  }) => {
44
- const hasChildren = children !== null && children !== undefined && children !== false;
45
45
  // Communicate action button presence to parent context for subtitle visibility logic
46
46
  useEffect(() => {
47
- setHasActions(hasChildren);
48
- }, [hasChildren, setHasActions]);
47
+ setHasActions(hasChildren(children));
48
+ }, [children, setHasActions]);
49
49
  return jsxs(Fragment, {
50
50
  children: [selectionEnabled && jsx(ListCheckbox, {
51
51
  className: styles.selection,
@@ -1,4 +1,4 @@
1
1
  import '../../index.css';
2
- var styles = {"smallList":"bp_base_grid_list_item_module_smallList--4337a","smallListItem":"bp_base_grid_list_item_module_smallListItem--4337a","loading":"bp_base_grid_list_item_module_loading--4337a","thumbnail":"bp_base_grid_list_item_module_thumbnail--4337a","thumbnailContent":"bp_base_grid_list_item_module_thumbnailContent--4337a","header":"bp_base_grid_list_item_module_header--4337a","subtitle":"bp_base_grid_list_item_module_subtitle--4337a","actions":"bp_base_grid_list_item_module_actions--4337a","selection":"bp_base_grid_list_item_module_selection--4337a","inner":"bp_base_grid_list_item_module_inner--4337a","actionsCheckboxWrapper":"bp_base_grid_list_item_module_actionsCheckboxWrapper--4337a","largeList":"bp_base_grid_list_item_module_largeList--4337a","largeListItem":"bp_base_grid_list_item_module_largeListItem--4337a","fade":"bp_base_grid_list_item_module_fade--4337a","description":"bp_base_grid_list_item_module_description--4337a","snippet":"bp_base_grid_list_item_module_snippet--4337a","snippetContent":"bp_base_grid_list_item_module_snippetContent--4337a","gridList":"bp_base_grid_list_item_module_gridList--4337a","gridListItem":"bp_base_grid_list_item_module_gridListItem--4337a","statusPin":"bp_base_grid_list_item_module_statusPin--4337a","isItemInteracted":"bp_base_grid_list_item_module_isItemInteracted--4337a","tooltipContent":"bp_base_grid_list_item_module_tooltipContent--4337a","tooltipArrow":"bp_base_grid_list_item_module_tooltipArrow--4337a","gridListV2":"bp_base_grid_list_item_module_gridListV2--4337a","gridListV2Item":"bp_base_grid_list_item_module_gridListV2Item--4337a","droppableTarget":"bp_base_grid_list_item_module_droppableTarget--4337a","noActions":"bp_base_grid_list_item_module_noActions--4337a","thumbnailBadges":"bp_base_grid_list_item_module_thumbnailBadges--4337a","statusBadge":"bp_base_grid_list_item_module_statusBadge--4337a","fileTypePill":"bp_base_grid_list_item_module_fileTypePill--4337a","alwaysShowSelection":"bp_base_grid_list_item_module_alwaysShowSelection--4337a","textCentered":"bp_base_grid_list_item_module_textCentered--4337a","innerCentered":"bp_base_grid_list_item_module_innerCentered--4337a","highlighted":"bp_base_grid_list_item_module_highlighted--4337a","gridListV2Small":"bp_base_grid_list_item_module_gridListV2Small--4337a","gridListV2XSmall":"bp_base_grid_list_item_module_gridListV2XSmall--4337a","gridListV2XSmallBordered":"bp_base_grid_list_item_module_gridListV2XSmallBordered--4337a","gridV2ClickShield":"bp_base_grid_list_item_module_gridV2ClickShield--4337a","listV2ClickShield":"bp_base_grid_list_item_module_listV2ClickShield--4337a","listV2":"bp_base_grid_list_item_module_listV2--4337a","listV2Item":"bp_base_grid_list_item_module_listV2Item--4337a","listV2Divider":"bp_base_grid_list_item_module_listV2Divider--4337a","content":"bp_base_grid_list_item_module_content--4337a","staticList":"bp_base_grid_list_item_module_staticList--4337a","staticListItem":"bp_base_grid_list_item_module_staticListItem--4337a"};
2
+ var styles = {"smallList":"bp_base_grid_list_item_module_smallList--896fb","smallListItem":"bp_base_grid_list_item_module_smallListItem--896fb","loading":"bp_base_grid_list_item_module_loading--896fb","thumbnail":"bp_base_grid_list_item_module_thumbnail--896fb","thumbnailContent":"bp_base_grid_list_item_module_thumbnailContent--896fb","header":"bp_base_grid_list_item_module_header--896fb","subtitle":"bp_base_grid_list_item_module_subtitle--896fb","actions":"bp_base_grid_list_item_module_actions--896fb","selection":"bp_base_grid_list_item_module_selection--896fb","inner":"bp_base_grid_list_item_module_inner--896fb","actionsCheckboxWrapper":"bp_base_grid_list_item_module_actionsCheckboxWrapper--896fb","largeList":"bp_base_grid_list_item_module_largeList--896fb","largeListItem":"bp_base_grid_list_item_module_largeListItem--896fb","fade":"bp_base_grid_list_item_module_fade--896fb","description":"bp_base_grid_list_item_module_description--896fb","snippet":"bp_base_grid_list_item_module_snippet--896fb","snippetContent":"bp_base_grid_list_item_module_snippetContent--896fb","gridList":"bp_base_grid_list_item_module_gridList--896fb","gridListItem":"bp_base_grid_list_item_module_gridListItem--896fb","statusPin":"bp_base_grid_list_item_module_statusPin--896fb","isItemInteracted":"bp_base_grid_list_item_module_isItemInteracted--896fb","tooltipContent":"bp_base_grid_list_item_module_tooltipContent--896fb","tooltipArrow":"bp_base_grid_list_item_module_tooltipArrow--896fb","gridListV2":"bp_base_grid_list_item_module_gridListV2--896fb","gridListV2Item":"bp_base_grid_list_item_module_gridListV2Item--896fb","droppableTarget":"bp_base_grid_list_item_module_droppableTarget--896fb","noActions":"bp_base_grid_list_item_module_noActions--896fb","thumbnailBadges":"bp_base_grid_list_item_module_thumbnailBadges--896fb","statusBadge":"bp_base_grid_list_item_module_statusBadge--896fb","fileTypePill":"bp_base_grid_list_item_module_fileTypePill--896fb","alwaysShowSelection":"bp_base_grid_list_item_module_alwaysShowSelection--896fb","textCentered":"bp_base_grid_list_item_module_textCentered--896fb","innerCentered":"bp_base_grid_list_item_module_innerCentered--896fb","highlighted":"bp_base_grid_list_item_module_highlighted--896fb","gridListV2Small":"bp_base_grid_list_item_module_gridListV2Small--896fb","gridListV2XSmall":"bp_base_grid_list_item_module_gridListV2XSmall--896fb","gridListV2XSmallBordered":"bp_base_grid_list_item_module_gridListV2XSmallBordered--896fb","gridV2ClickShield":"bp_base_grid_list_item_module_gridV2ClickShield--896fb","listV2ClickShield":"bp_base_grid_list_item_module_listV2ClickShield--896fb","listV2":"bp_base_grid_list_item_module_listV2--896fb","listV2Item":"bp_base_grid_list_item_module_listV2Item--896fb","listV2Divider":"bp_base_grid_list_item_module_listV2Divider--896fb","content":"bp_base_grid_list_item_module_content--896fb","listV2Description":"bp_base_grid_list_item_module_listV2Description--896fb","staticList":"bp_base_grid_list_item_module_staticList--896fb","staticListItem":"bp_base_grid_list_item_module_staticListItem--896fb"};
3
3
 
4
4
  export { styles as default };
@@ -33,4 +33,4 @@ export declare const BaseGridList: import("react").ForwardRefExoticComponent<imp
33
33
  */
34
34
  ActionIconButton: import("react").ForwardRefExoticComponent<(Omit<import("../../primitives/icon-button/types").IconButtonVariantsProps, "ref"> | Omit<import("../../primitives/icon-button/types").IconButtonSmallUtilityVariantProps, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
35
35
  };
36
- export type { BaseGridListActionIconButtonProps, BaseGridListActionsProps, BaseGridListDescriptionProps, BaseGridListHeaderProps, BaseGridListItemProps, BaseGridListProps, BaseGridListSubtitleProps, BaseGridListThumbnailProps, GridV2Variant, } from './types';
36
+ export type { BaseGridListActionIconButtonProps, BaseGridListActionsProps, BaseGridListDescriptionProps, BaseGridListV2DescriptionProps, BaseGridListHeaderProps, BaseGridListItemProps, BaseGridListProps, BaseGridListSubtitleProps, BaseGridListThumbnailProps, GridV2Variant, } from './types';
@@ -129,6 +129,8 @@ export type BaseGridListThumbnailProps = ComponentPropsWithRef<'div'> & {
129
129
  };
130
130
  export type BaseGridListSubtitleProps = ComponentPropsWithRef<'span'>;
131
131
  export type BaseGridListDescriptionProps = ComponentPropsWithRef<'p'>;
132
+ /** LargeListV2 description. A div so it can wrap non-phrasing content (v1 uses `p`). */
133
+ export type BaseGridListV2DescriptionProps = ComponentPropsWithRef<'div'>;
132
134
  export type BaseGridListActionsProps = Modify<ComponentPropsWithRef<'div'>, {
133
135
  children: ReactNode | ((setIsInteracted: (open: boolean) => void) => ReactNode);
134
136
  isSelectionCheckboxDisabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "18.5.6",
3
+ "version": "18.7.0",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@ariakit/react": "0.4.21",
57
57
  "@ariakit/react-core": "0.4.21",
58
- "@box/blueprint-web-assets": "^5.13.3",
58
+ "@box/blueprint-web-assets": "^5.13.5",
59
59
  "@internationalized/date": "^3.12.0",
60
60
  "@radix-ui/react-accordion": "1.1.2",
61
61
  "@radix-ui/react-checkbox": "1.0.4",
@@ -85,7 +85,7 @@
85
85
  "devDependencies": {
86
86
  "@box/box-test-client": "^3.2.7",
87
87
  "@box/playwright-utils": "^2.8.5",
88
- "@box/storybook-utils": "^1.4.22",
88
+ "@box/storybook-utils": "^1.4.24",
89
89
  "@figma/code-connect": "1.4.4",
90
90
  "@playwright/test": "1.46.1",
91
91
  "@types/js-yaml": "^4.0.9",