@box/blueprint-web 18.2.1 → 18.3.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.
- package/dist/lib-esm/blueprint-configuration-context/consts.d.ts +2 -2
- package/dist/lib-esm/blueprint-configuration-context/consts.js +2 -2
- package/dist/lib-esm/components.css +452 -258
- package/dist/lib-esm/grid-list-item/types.d.ts +1 -1
- package/dist/lib-esm/index.css +451 -257
- package/dist/lib-esm/large-list-item/types.d.ts +1 -1
- package/dist/lib-esm/modal/constants.d.ts +1 -0
- package/dist/lib-esm/modal/constants.js +3 -1
- package/dist/lib-esm/modal/index.d.ts +1 -1
- package/dist/lib-esm/modal/modal-header-actions.d.ts +12 -0
- package/dist/lib-esm/modal/modal-header-actions.js +57 -0
- package/dist/lib-esm/modal/modal-header.d.ts +4 -4
- package/dist/lib-esm/modal/modal-header.js +10 -3
- package/dist/lib-esm/modal/modal.d.ts +4 -1
- package/dist/lib-esm/modal/modal.module.js +1 -1
- package/dist/lib-esm/modal/types.d.ts +12 -0
- package/dist/lib-esm/primitives/notification/hooks/use-hover-focus-expand.d.ts +17 -0
- package/dist/lib-esm/primitives/notification/hooks/use-hover-focus-expand.js +85 -0
- package/dist/lib-esm/primitives/notification/hooks/use-notification-exit-animation.d.ts +21 -0
- package/dist/lib-esm/primitives/notification/hooks/use-notification-exit-animation.js +141 -0
- package/dist/lib-esm/primitives/notification/hooks/use-stack-layer-metrics.d.ts +19 -0
- package/dist/lib-esm/primitives/notification/hooks/use-stack-layer-metrics.js +96 -0
- package/dist/lib-esm/primitives/notification/hooks/use-staggered-notification-admission.d.ts +10 -0
- package/dist/lib-esm/primitives/notification/hooks/use-staggered-notification-admission.js +126 -0
- package/dist/lib-esm/primitives/notification/load-animated-notification-viewport.d.ts +11 -0
- package/dist/lib-esm/primitives/notification/load-animated-notification-viewport.js +24 -0
- package/dist/lib-esm/primitives/notification/notification-provider.d.ts +8 -0
- package/dist/lib-esm/primitives/notification/notification-provider.js +29 -3
- package/dist/lib-esm/primitives/notification/notification-stack-utils.d.ts +21 -0
- package/dist/lib-esm/primitives/notification/notification-stack-utils.js +38 -0
- package/dist/lib-esm/primitives/notification/notification-stack.module.js +4 -0
- package/dist/lib-esm/primitives/notification/notification.module.js +1 -1
- package/dist/lib-esm/primitives/notification/notification.viewport-animated.d.ts +7 -0
- package/dist/lib-esm/primitives/notification/notification.viewport-animated.js +147 -0
- package/dist/lib-esm/primitives/notification/notification.viewport.d.ts +5 -0
- package/dist/lib-esm/primitives/notification/notification.viewport.js +51 -1
- package/dist/lib-esm/primitives/notification/private-notification-element-animated.d.ts +32 -0
- package/dist/lib-esm/primitives/notification/private-notification-element-animated.js +198 -0
- package/dist/lib-esm/primitives/notification/private-notification-element.d.ts +3 -0
- package/dist/lib-esm/primitives/notification/private-notification-element.js +3 -0
- package/dist/lib-esm/small-list-item/types.d.ts +1 -1
- package/dist/lib-esm/types/selection-visibility.d.ts +4 -0
- package/dist/lib-esm/util-components/base-grid-list-item/base-grid-list-item-actions.js +4 -2
- package/dist/lib-esm/util-components/base-grid-list-item/base-grid-list-item.module.js +1 -1
- package/dist/lib-esm/util-components/base-grid-list-item/base-grid-list.js +3 -1
- package/dist/lib-esm/util-components/base-grid-list-item/types.d.ts +9 -0
- package/package.json +3 -3
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { XMark } from '@box/blueprint-web-assets/icons/Medium';
|
|
3
|
+
import { bpDurationLong } from '@box/blueprint-web-assets/tokens/tokens';
|
|
4
|
+
import * as Toast from '@radix-ui/react-toast';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useMemo, useCallback, useRef, useEffect, useState } from 'react';
|
|
7
|
+
import { composeEventHandlers } from '../../utils/composeEventHandlers.js';
|
|
8
|
+
import { IconButton } from '../icon-button/icon-button.js';
|
|
9
|
+
import { useNotificationExitAnimation, handleNotificationExitTransitionEnd } from './hooks/use-notification-exit-animation.js';
|
|
10
|
+
import { isOpenNotification } from './notification-stack-utils.js';
|
|
11
|
+
import stackStyles from './notification-stack.module.js';
|
|
12
|
+
import styles from './notification.module.js';
|
|
13
|
+
import { getIcon } from './private-notification-element.js';
|
|
14
|
+
import { truncateNotificationCopy } from './truncate-notification-copy.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Stacked-deck toast. Loaded only from the animated viewport chunk so the flat
|
|
18
|
+
* Notification path stays off the first-paint graph.
|
|
19
|
+
*/
|
|
20
|
+
function AnimatedPrivateNotificationElement(props) {
|
|
21
|
+
const {
|
|
22
|
+
variant,
|
|
23
|
+
styledText,
|
|
24
|
+
sensitivity,
|
|
25
|
+
open,
|
|
26
|
+
onClose,
|
|
27
|
+
closeButtonAriaLabel,
|
|
28
|
+
typeIconAriaLabel,
|
|
29
|
+
children,
|
|
30
|
+
isAnimationEnabled = false,
|
|
31
|
+
isEntering = false,
|
|
32
|
+
depth = 0,
|
|
33
|
+
expandOffset = 0,
|
|
34
|
+
isBeyondVisibleDepth = false,
|
|
35
|
+
layerRef,
|
|
36
|
+
stackId,
|
|
37
|
+
onExitStart,
|
|
38
|
+
onEscapeKeyDown,
|
|
39
|
+
onTransitionEnd,
|
|
40
|
+
style,
|
|
41
|
+
...rest
|
|
42
|
+
} = props;
|
|
43
|
+
const iconComponent = useMemo(() => getIcon(typeIconAriaLabel, variant), [typeIconAriaLabel, variant]);
|
|
44
|
+
// Radix's own viewport-wide pause-on-hover/focus (`Toast.Provider`'s `toast.viewportPause`/
|
|
45
|
+
// `viewportResume` events) already covers pausing auto-dismiss while the user is interacting
|
|
46
|
+
// with the stack — no bespoke pause context is ported from EndUserApp here.
|
|
47
|
+
const setOpen = useCallback(nextOpen => {
|
|
48
|
+
const resolved = typeof nextOpen === 'function' ? nextOpen(open) : nextOpen;
|
|
49
|
+
if (!resolved) {
|
|
50
|
+
onClose?.();
|
|
51
|
+
}
|
|
52
|
+
}, [onClose, open]);
|
|
53
|
+
// Snapshot layout before the viewport pops this layer out of flow (it re-renders with offset 0).
|
|
54
|
+
const liveLayoutRef = useRef({
|
|
55
|
+
depth,
|
|
56
|
+
expandOffset
|
|
57
|
+
});
|
|
58
|
+
const frozenLayoutRef = useRef({
|
|
59
|
+
depth,
|
|
60
|
+
expandOffset
|
|
61
|
+
});
|
|
62
|
+
liveLayoutRef.current = {
|
|
63
|
+
depth,
|
|
64
|
+
expandOffset
|
|
65
|
+
};
|
|
66
|
+
const notifyExitStart = useCallback(() => {
|
|
67
|
+
frozenLayoutRef.current = liveLayoutRef.current;
|
|
68
|
+
if (stackId) {
|
|
69
|
+
onExitStart?.(stackId);
|
|
70
|
+
}
|
|
71
|
+
}, [onExitStart, stackId]);
|
|
72
|
+
const {
|
|
73
|
+
radixOpen,
|
|
74
|
+
isExiting,
|
|
75
|
+
hasExitStyles,
|
|
76
|
+
completeExit,
|
|
77
|
+
handleOpenChange
|
|
78
|
+
} = useNotificationExitAnimation({
|
|
79
|
+
open: open ?? true,
|
|
80
|
+
setOpen,
|
|
81
|
+
isAnimationEnabled,
|
|
82
|
+
onExitStart: notifyExitStart
|
|
83
|
+
});
|
|
84
|
+
// Esc fires Radix's own onEscapeKeyDown before handleClose runs, so this reliably
|
|
85
|
+
// captures intent even though Esc and the close button both end up at the same
|
|
86
|
+
// onOpenChange(false) call. Reset once the exit styles clear so the next dismissal
|
|
87
|
+
// (of a different kind) isn't misattributed. Composes with the caller-provided
|
|
88
|
+
// onEscapeKeyDown (pulled out of `rest` so it isn't clobbered by this one) — it runs
|
|
89
|
+
// first and can call preventDefault() to suppress both Radix's close and this attribution.
|
|
90
|
+
const exitReasonRef = useRef(null);
|
|
91
|
+
const handleEscapeKeyDown = useCallback(event => {
|
|
92
|
+
onEscapeKeyDown?.(event);
|
|
93
|
+
if (!event.defaultPrevented) {
|
|
94
|
+
exitReasonRef.current = 'escape';
|
|
95
|
+
}
|
|
96
|
+
}, [onEscapeKeyDown]);
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!hasExitStyles) {
|
|
99
|
+
exitReasonRef.current = null;
|
|
100
|
+
}
|
|
101
|
+
}, [hasExitStyles]);
|
|
102
|
+
const layoutDepth = isExiting ? frozenLayoutRef.current.depth : depth;
|
|
103
|
+
const layoutExpandOffset = isExiting ? frozenLayoutRef.current.expandOffset : expandOffset;
|
|
104
|
+
// `data-entering` is the "from" state; one frame later it flips off so CSS can transition in.
|
|
105
|
+
// `isEnterTransitioning` stays true through --bp-duration-long so the destination uses that duration.
|
|
106
|
+
const [hasEntered, setHasEntered] = useState(!isEntering);
|
|
107
|
+
const [isEnterTransitioning, setIsEnterTransitioning] = useState(isEntering);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
// If this toast stops being the entering one before the rAF, settle immediately
|
|
110
|
+
// so it isn't stranded in the off-screen "from" state.
|
|
111
|
+
if (!isEntering) {
|
|
112
|
+
setHasEntered(true);
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
const frame = requestAnimationFrame(() => setHasEntered(true));
|
|
116
|
+
return () => cancelAnimationFrame(frame);
|
|
117
|
+
}, [isEntering]);
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (!isEnterTransitioning || !hasEntered) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
const timeout = window.setTimeout(() => setIsEnterTransitioning(false), Number.parseFloat(bpDurationLong));
|
|
123
|
+
return () => window.clearTimeout(timeout);
|
|
124
|
+
}, [hasEntered, isEnterTransitioning]);
|
|
125
|
+
// Exit completion must not be blockable by a consumer `preventDefault()`.
|
|
126
|
+
const handleTransitionEnd = useMemo(() => composeEventHandlers(onTransitionEnd, event => handleNotificationExitTransitionEnd(event, isExiting, completeExit), {
|
|
127
|
+
checkForDefaultPrevented: false
|
|
128
|
+
}), [completeExit, isExiting, onTransitionEnd]);
|
|
129
|
+
const layerStyle = isAnimationEnabled ? {
|
|
130
|
+
'--notification-stack-depth': layoutDepth,
|
|
131
|
+
'--notification-stack-expand-offset': `${layoutExpandOffset}px`
|
|
132
|
+
} : undefined;
|
|
133
|
+
return jsx(Toast.Root, {
|
|
134
|
+
...rest,
|
|
135
|
+
ref: layerRef,
|
|
136
|
+
className: clsx(styles.root, styles[variant], {
|
|
137
|
+
[stackStyles.stackLayer]: isAnimationEnabled
|
|
138
|
+
}),
|
|
139
|
+
"data-beyond-visible-depth": isAnimationEnabled && isOpenNotification({
|
|
140
|
+
open
|
|
141
|
+
}) && isBeyondVisibleDepth ? 'true' : undefined,
|
|
142
|
+
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
143
|
+
"data-front": isAnimationEnabled && isOpenNotification({
|
|
144
|
+
open
|
|
145
|
+
}) && layoutDepth === 0 ? 'true' : undefined,
|
|
146
|
+
"data-bp-exiting": hasExitStyles ? 'true' : undefined,
|
|
147
|
+
"data-bp-exit-reason": hasExitStyles ? exitReasonRef.current ?? undefined : undefined,
|
|
148
|
+
"data-enter-transition": isAnimationEnabled && isEnterTransitioning ? 'true' : undefined,
|
|
149
|
+
"data-entering": isAnimationEnabled && !hasEntered ? 'true' : undefined,
|
|
150
|
+
onEscapeKeyDown: handleEscapeKeyDown,
|
|
151
|
+
onTransitionEnd: handleTransitionEnd,
|
|
152
|
+
onOpenChange: handleOpenChange,
|
|
153
|
+
open: radixOpen,
|
|
154
|
+
style: {
|
|
155
|
+
...style,
|
|
156
|
+
...layerStyle
|
|
157
|
+
},
|
|
158
|
+
// Override Toast.Root's tabIndex={0} so a pointer hit cannot leave focus on the
|
|
159
|
+
// <li> and permanently pause TTL. Close / Action stay tabbable.
|
|
160
|
+
tabIndex: -1,
|
|
161
|
+
type: sensitivity,
|
|
162
|
+
children: jsxs("div", {
|
|
163
|
+
className: styles.container,
|
|
164
|
+
children: [jsx("div", {
|
|
165
|
+
className: styles.typeIconContainer,
|
|
166
|
+
children: iconComponent
|
|
167
|
+
}), jsxs("div", {
|
|
168
|
+
className: clsx(styles.messageRow, {
|
|
169
|
+
[styles.withButtons]: children
|
|
170
|
+
}),
|
|
171
|
+
children: [jsx("div", {
|
|
172
|
+
className: styles.text,
|
|
173
|
+
children: jsx(Toast.Description, {
|
|
174
|
+
children: truncateNotificationCopy(styledText)
|
|
175
|
+
})
|
|
176
|
+
}), jsx("div", {
|
|
177
|
+
className: styles.contentButtonSection,
|
|
178
|
+
children: jsx("div", {
|
|
179
|
+
className: styles.contentButtons,
|
|
180
|
+
children: children
|
|
181
|
+
})
|
|
182
|
+
})]
|
|
183
|
+
}), jsx("div", {
|
|
184
|
+
className: styles.closeButtonSection,
|
|
185
|
+
children: jsx(Toast.Close, {
|
|
186
|
+
asChild: true,
|
|
187
|
+
children: jsx(IconButton, {
|
|
188
|
+
"aria-label": closeButtonAriaLabel,
|
|
189
|
+
className: styles.closeButton,
|
|
190
|
+
icon: XMark
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
})]
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export { AnimatedPrivateNotificationElement };
|
|
@@ -36,5 +36,8 @@ export declare const getIcon: (iconLabel: string, variant: PrivateNotificationEl
|
|
|
36
36
|
* * [Radix-UI link](https://www.radix-ui.com/docs/primitives/components/toast)
|
|
37
37
|
*
|
|
38
38
|
* **IMPORTANT**: Must be placed inside a single <b><NotificationProvider></b> singleton component provided by the app
|
|
39
|
+
*
|
|
40
|
+
* The stacked-deck motion variant lives in `private-notification-element-animated.tsx`
|
|
41
|
+
* and is loaded only after first paint when Notification animation is on.
|
|
39
42
|
*/
|
|
40
43
|
export declare function PrivateNotificationElement(props: PrivateNotificationElementProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -44,6 +44,9 @@ const getIcon = (iconLabel, variant) => {
|
|
|
44
44
|
* * [Radix-UI link](https://www.radix-ui.com/docs/primitives/components/toast)
|
|
45
45
|
*
|
|
46
46
|
* **IMPORTANT**: Must be placed inside a single <b><NotificationProvider></b> singleton component provided by the app
|
|
47
|
+
*
|
|
48
|
+
* The stacked-deck motion variant lives in `private-notification-element-animated.tsx`
|
|
49
|
+
* and is loaded only after first paint when Notification animation is on.
|
|
47
50
|
*/
|
|
48
51
|
function PrivateNotificationElement(props) {
|
|
49
52
|
const {
|
|
@@ -4,5 +4,5 @@ export type SmallListActionsProps = BaseGridListActionsProps;
|
|
|
4
4
|
export type SmallListHeaderProps = BaseGridListHeaderProps;
|
|
5
5
|
export type SmallListThumbnailProps = BaseGridListThumbnailProps;
|
|
6
6
|
export type SmallListSubtitleProps = BaseGridListSubtitleProps;
|
|
7
|
-
export type SmallListProps = Omit<BaseGridListProps, 'layoutStyle'>;
|
|
7
|
+
export type SmallListProps = Omit<BaseGridListProps, 'layoutStyle' | 'selectionVisibility'>;
|
|
8
8
|
export type SmallListItemProps = BaseGridListItemProps;
|
|
@@ -105,7 +105,8 @@ const BaseGridListActions = /*#__PURE__*/forwardRef(function BaseGridListActions
|
|
|
105
105
|
const {
|
|
106
106
|
layoutStyle,
|
|
107
107
|
selectionMode,
|
|
108
|
-
centerText
|
|
108
|
+
centerText,
|
|
109
|
+
selectionVisibility
|
|
109
110
|
} = useBaseGridListContext();
|
|
110
111
|
const {
|
|
111
112
|
children,
|
|
@@ -129,11 +130,12 @@ const BaseGridListActions = /*#__PURE__*/forwardRef(function BaseGridListActions
|
|
|
129
130
|
const isGridV2 = layoutStyle === 'grid-v2';
|
|
130
131
|
const isSelectionEnabled = selectionMode === 'multiple';
|
|
131
132
|
const isRenderPropUsed = typeof children === 'function';
|
|
133
|
+
const alwaysShowSelection = selectionVisibility === 'always' && isSelectionEnabled;
|
|
132
134
|
return jsxs(Fragment, {
|
|
133
135
|
children: [jsx("div", {
|
|
134
136
|
...rest,
|
|
135
137
|
ref: forkRef,
|
|
136
|
-
className: clsx(styles.actions, className),
|
|
138
|
+
className: clsx(styles.actions, alwaysShowSelection && styles.alwaysShowSelection, className),
|
|
137
139
|
children: isList ? jsx(BaseListActions, {
|
|
138
140
|
isSelectionCheckboxDisabled: isSelectionCheckboxDisabled,
|
|
139
141
|
selectionEnabled: isSelectionEnabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../index.css';
|
|
2
|
-
var styles = {"smallList":"bp_base_grid_list_item_module_smallList--
|
|
2
|
+
var styles = {"smallList":"bp_base_grid_list_item_module_smallList--a9a55","smallListItem":"bp_base_grid_list_item_module_smallListItem--a9a55","loading":"bp_base_grid_list_item_module_loading--a9a55","thumbnail":"bp_base_grid_list_item_module_thumbnail--a9a55","thumbnailContent":"bp_base_grid_list_item_module_thumbnailContent--a9a55","header":"bp_base_grid_list_item_module_header--a9a55","subtitle":"bp_base_grid_list_item_module_subtitle--a9a55","actions":"bp_base_grid_list_item_module_actions--a9a55","selection":"bp_base_grid_list_item_module_selection--a9a55","inner":"bp_base_grid_list_item_module_inner--a9a55","actionsCheckboxWrapper":"bp_base_grid_list_item_module_actionsCheckboxWrapper--a9a55","largeList":"bp_base_grid_list_item_module_largeList--a9a55","largeListItem":"bp_base_grid_list_item_module_largeListItem--a9a55","fade":"bp_base_grid_list_item_module_fade--a9a55","description":"bp_base_grid_list_item_module_description--a9a55","snippet":"bp_base_grid_list_item_module_snippet--a9a55","snippetContent":"bp_base_grid_list_item_module_snippetContent--a9a55","gridList":"bp_base_grid_list_item_module_gridList--a9a55","gridListItem":"bp_base_grid_list_item_module_gridListItem--a9a55","statusPin":"bp_base_grid_list_item_module_statusPin--a9a55","isItemInteracted":"bp_base_grid_list_item_module_isItemInteracted--a9a55","tooltipContent":"bp_base_grid_list_item_module_tooltipContent--a9a55","tooltipArrow":"bp_base_grid_list_item_module_tooltipArrow--a9a55","gridListV2":"bp_base_grid_list_item_module_gridListV2--a9a55","gridListV2Item":"bp_base_grid_list_item_module_gridListV2Item--a9a55","droppableTarget":"bp_base_grid_list_item_module_droppableTarget--a9a55","noActions":"bp_base_grid_list_item_module_noActions--a9a55","thumbnailBadges":"bp_base_grid_list_item_module_thumbnailBadges--a9a55","statusBadge":"bp_base_grid_list_item_module_statusBadge--a9a55","fileTypePill":"bp_base_grid_list_item_module_fileTypePill--a9a55","alwaysShowSelection":"bp_base_grid_list_item_module_alwaysShowSelection--a9a55","textCentered":"bp_base_grid_list_item_module_textCentered--a9a55","innerCentered":"bp_base_grid_list_item_module_innerCentered--a9a55","gridListV2Small":"bp_base_grid_list_item_module_gridListV2Small--a9a55","gridListV2XSmall":"bp_base_grid_list_item_module_gridListV2XSmall--a9a55","gridListV2XSmallBordered":"bp_base_grid_list_item_module_gridListV2XSmallBordered--a9a55","gridV2ClickShield":"bp_base_grid_list_item_module_gridV2ClickShield--a9a55","listV2ClickShield":"bp_base_grid_list_item_module_listV2ClickShield--a9a55","listV2":"bp_base_grid_list_item_module_listV2--a9a55","listV2Item":"bp_base_grid_list_item_module_listV2Item--a9a55","listV2Divider":"bp_base_grid_list_item_module_listV2Divider--a9a55","content":"bp_base_grid_list_item_module_content--a9a55","staticList":"bp_base_grid_list_item_module_staticList--a9a55","staticListItem":"bp_base_grid_list_item_module_staticListItem--a9a55"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -31,6 +31,7 @@ const BaseGridList = /*#__PURE__*/forwardRef(function BaseGridList(props, forwar
|
|
|
31
31
|
layoutStyle,
|
|
32
32
|
centerText = false,
|
|
33
33
|
variant = 'large',
|
|
34
|
+
selectionVisibility = 'hover',
|
|
34
35
|
...rest
|
|
35
36
|
} = props;
|
|
36
37
|
const handleOnAction = onAction || noop;
|
|
@@ -45,8 +46,9 @@ const BaseGridList = /*#__PURE__*/forwardRef(function BaseGridList(props, forwar
|
|
|
45
46
|
isInteractive,
|
|
46
47
|
centerText,
|
|
47
48
|
variant,
|
|
49
|
+
selectionVisibility,
|
|
48
50
|
onAction: handleOnAction
|
|
49
|
-
}), [rest.selectionMode, rest.selectionBehavior, layoutStyle, isInteractive, centerText, variant, handleOnAction]);
|
|
51
|
+
}), [rest.selectionMode, rest.selectionBehavior, layoutStyle, isInteractive, centerText, variant, selectionVisibility, handleOnAction]);
|
|
50
52
|
let layoutStyleClass;
|
|
51
53
|
let layoutFinal;
|
|
52
54
|
switch (layoutStyle) {
|
|
@@ -2,6 +2,7 @@ import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
|
2
2
|
import { type GridListItemProps, type GridListProps as RAGridListProps } from 'react-aria-components';
|
|
3
3
|
import { type IconButtonProps } from '../../primitives/icon-button';
|
|
4
4
|
import { type Modify } from '../../types/modify';
|
|
5
|
+
import { type SelectionVisibility } from '../../types/selection-visibility';
|
|
5
6
|
export interface BaseGridListLayoutProp {
|
|
6
7
|
layoutStyle: 'grid' | 'grid-v2' | 'list' | 'list-v2' | 'small-list';
|
|
7
8
|
}
|
|
@@ -44,6 +45,14 @@ interface CustomGridListProps extends BaseGridListLayoutProp {
|
|
|
44
45
|
* @default 'large'
|
|
45
46
|
*/
|
|
46
47
|
variant?: GridV2Variant;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the multi-select checkbox stays visible, or shows with the action buttons.
|
|
50
|
+
* `always` keeps the checkbox visible. Action buttons still wait for hover, focus, selection, or an open menu.
|
|
51
|
+
* `hover` shows the checkbox and action buttons together on hover, focus, and selection.
|
|
52
|
+
* `always` is not supported with `selectionMode` `single`.
|
|
53
|
+
* @default 'hover'
|
|
54
|
+
*/
|
|
55
|
+
selectionVisibility?: SelectionVisibility;
|
|
47
56
|
}
|
|
48
57
|
export declare enum ListLayout {
|
|
49
58
|
GRID = "Grid List",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.3.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.12.
|
|
58
|
+
"@box/blueprint-web-assets": "^5.12.2",
|
|
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",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@box/box-test-client": "^3.2.7",
|
|
88
88
|
"@box/playwright-utils": "^2.8.5",
|
|
89
|
-
"@box/storybook-utils": "^1.4.
|
|
89
|
+
"@box/storybook-utils": "^1.4.14",
|
|
90
90
|
"@figma/code-connect": "1.4.4",
|
|
91
91
|
"@playwright/test": "1.46.1",
|
|
92
92
|
"@types/js-yaml": "^4.0.9",
|