@box/blueprint-web 16.20.7 → 17.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.
- package/dist/lib-esm/accordion/accordion.js +7 -18
- package/dist/lib-esm/avatar/avatar.js +1 -5
- package/dist/lib-esm/blueprint-modernization-context/blueprint-modernization-context.d.ts +20 -1
- package/dist/lib-esm/blueprint-modernization-context/blueprint-modernization-context.js +10 -2
- package/dist/lib-esm/blueprint-modernization-context/index.d.ts +4 -0
- package/dist/lib-esm/blueprint-modernization-context/useBlueprintModernization.d.ts +4 -0
- package/dist/lib-esm/blueprint-modernization-context/useBlueprintModernization.js +4 -0
- package/dist/lib-esm/card/card.js +1 -5
- package/dist/lib-esm/card-tooltip/card-tooltip.js +1 -5
- package/dist/lib-esm/checkbox/checkbox-item.js +1 -5
- package/dist/lib-esm/collapsible/collapsible-section.js +6 -9
- package/dist/lib-esm/combobox/combobox.js +8 -15
- package/dist/lib-esm/combobox-group/combobox-group.js +1 -5
- package/dist/lib-esm/content-card/content-card-body.js +2 -6
- package/dist/lib-esm/content-card/content-card.js +2 -9
- package/dist/lib-esm/date-picker/date-picker.js +1 -5
- package/dist/lib-esm/ghost/ghost.js +1 -4
- package/dist/lib-esm/icon-dual-state-button/icon-dual-state-button.js +1 -5
- package/dist/lib-esm/icon-toggle-button/icon-toggle-button.js +5 -14
- package/dist/lib-esm/inline-table/inline-table.js +1 -5
- package/dist/lib-esm/input-chip/input-chip.js +2 -5
- package/dist/lib-esm/list-item/table-column.js +6 -15
- package/dist/lib-esm/list-item/table-header-default.js +1 -5
- package/dist/lib-esm/list-item/table.js +1 -4
- package/dist/lib-esm/loading-indicator/loading-indicator.js +1 -6
- package/dist/lib-esm/modal/modal-close.js +2 -6
- package/dist/lib-esm/modal/modal-content.js +1 -5
- package/dist/lib-esm/navigation-menu/navigation-menu-content.js +1 -5
- package/dist/lib-esm/navigation-menu/navigation-menu-link.js +1 -5
- package/dist/lib-esm/page/page-root.js +1 -5
- package/dist/lib-esm/primitives/base-button/base-button-icon.js +1 -4
- package/dist/lib-esm/primitives/base-button/base-button.js +1 -5
- package/dist/lib-esm/primitives/base-inline-notice/base-inline-notice-icon.js +4 -12
- package/dist/lib-esm/primitives/base-inline-notice/base-inline-notice.js +1 -5
- package/dist/lib-esm/primitives/base-text-input/base-text-input.js +4 -10
- package/dist/lib-esm/primitives/calendar/calendar.js +5 -8
- package/dist/lib-esm/primitives/chips/chip.js +1 -5
- package/dist/lib-esm/primitives/chips/chips-group.js +1 -5
- package/dist/lib-esm/primitives/context-menu/context-menu-item.js +2 -6
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-content.js +2 -6
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-header.js +1 -5
- package/dist/lib-esm/primitives/context-menu/context-menu-sub-menu-content.js +2 -6
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-checkbox-item.js +6 -10
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-content.js +2 -6
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-header.js +4 -11
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-item.js +3 -7
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-radio-select-item.js +6 -10
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-menu-content.js +2 -6
- package/dist/lib-esm/primitives/icon-button/icon-button.js +1 -5
- package/dist/lib-esm/primitives/inline-error/inline-error.js +3 -6
- package/dist/lib-esm/primitives/link/link.js +1 -5
- package/dist/lib-esm/primitives/menu-combobox/menu-combobox-content.js +1 -5
- package/dist/lib-esm/primitives/menu-combobox/menu-combobox-empty.js +1 -5
- package/dist/lib-esm/primitives/menu-combobox/menu-combobox-header.js +2 -6
- package/dist/lib-esm/primitives/menu-combobox/menu-combobox-search.js +3 -7
- package/dist/lib-esm/primitives/notification/private-notification-element.js +8 -39
- package/dist/lib-esm/primitives/page-header/page-header.js +1 -4
- package/dist/lib-esm/primitives/popover/popover-content-container.js +1 -5
- package/dist/lib-esm/primitives/select-menu-grid/select-menu-grid-option.js +6 -24
- package/dist/lib-esm/primitives/tabs/tab-list.js +2 -6
- package/dist/lib-esm/progress-bar/progress-bar.js +1 -5
- package/dist/lib-esm/radio-group/radio-group.js +1 -5
- package/dist/lib-esm/radio-tiles/radio-tiles-option.js +1 -5
- package/dist/lib-esm/radio-tiles/radio-tiles.js +1 -5
- package/dist/lib-esm/search-input/search-input-controlled/search-input-controlled.js +5 -8
- package/dist/lib-esm/search-input/search-input.js +5 -8
- package/dist/lib-esm/select/select.js +5 -15
- package/dist/lib-esm/side-panel/side-panel-close.js +3 -6
- package/dist/lib-esm/side-panel/side-panel-content.js +2 -9
- package/dist/lib-esm/side-panel/side-panel-overlay.js +1 -5
- package/dist/lib-esm/small-list-item/small-list.js +1 -5
- package/dist/lib-esm/split-button/split-button.js +2 -6
- package/dist/lib-esm/status/status.js +1 -5
- package/dist/lib-esm/switch/switch-item.js +1 -5
- package/dist/lib-esm/text/text.js +1 -5
- package/dist/lib-esm/text-area/text-area-autosize/text-area-autosize.js +5 -19
- package/dist/lib-esm/text-area/text-area-autosize/text-area-autosize.module.js +1 -1
- package/dist/lib-esm/text-area/text-area.js +1 -5
- package/dist/lib-esm/text-button/text-button.js +1 -5
- package/dist/lib-esm/text-input/text-input.js +3 -6
- package/dist/lib-esm/text-toggle-button/text-toggle-button.js +1 -5
- package/dist/lib-esm/time-picker/time-picker.js +6 -22
- package/dist/lib-esm/toolbar/toolbar-button.js +1 -5
- package/dist/lib-esm/toolbar/toolbar-dropdown-indicator.js +3 -6
- package/dist/lib-esm/toolbar/toolbar-input.js +1 -5
- package/dist/lib-esm/toolbar/toolbar-link.js +1 -5
- package/dist/lib-esm/toolbar/toolbar-root.js +3 -6
- package/dist/lib-esm/toolbar/toolbar-text-toggle-item.js +1 -5
- package/dist/lib-esm/toolbar/toolbar-toggle-group.js +1 -5
- package/dist/lib-esm/toolbar/toolbar-toggle-item.js +1 -5
- package/dist/lib-esm/tooltip/tooltip.js +2 -19
- package/dist/lib-esm/trigger-button/trigger-button.js +4 -11
- package/dist/lib-esm/util-components/base-grid-list-item/base-grid-list.js +1 -5
- package/dist/lib-esm/util-components/base-grid-list-item/utils/rac-tooltip.js +3 -6
- package/dist/lib-esm/util-components/legend/legend.js +1 -6
- package/dist/lib-esm/util-components/list-checkbox/list-checkbox.js +1 -5
- package/dist/lib-esm/util-components/menu-item-sections/menu-item-sections.js +2 -9
- package/dist/lib-esm/util-components/text-with-info-badge/text-with-info-badge.js +1 -6
- package/dist/lib-esm/utils/TooltipWrapper.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import '@box/blueprint-web-assets/icons/Fill';
|
|
3
3
|
import { ArrowUp, ArrowDown } from '@box/blueprint-web-assets/icons/Medium';
|
|
4
|
-
import { bpSize040,
|
|
4
|
+
import { bpSize040, bpTextTextOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
7
|
import { useFocusRing } from 'react-aria';
|
|
8
8
|
import { Column as Column$1, ColumnResizer } from 'react-aria-components';
|
|
9
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
10
9
|
import { Focusable } from '../focusable/focusable.js';
|
|
11
10
|
import { useBreakpoint, Breakpoint } from '../utils/useBreakpoint.js';
|
|
12
11
|
import { VisuallyHidden } from '../visually-hidden/visually-hidden.js';
|
|
@@ -17,28 +16,20 @@ function SortingArrowIcon({
|
|
|
17
16
|
visibility = 'visible',
|
|
18
17
|
direction
|
|
19
18
|
}) {
|
|
20
|
-
const {
|
|
21
|
-
enableModernizedComponents
|
|
22
|
-
} = useBlueprintModernization();
|
|
23
19
|
const props = {
|
|
24
|
-
color:
|
|
25
|
-
height:
|
|
20
|
+
color: bpTextTextOnLight ,
|
|
21
|
+
height: bpSize040 ,
|
|
26
22
|
role: 'presentation',
|
|
27
23
|
visibility,
|
|
28
|
-
width:
|
|
24
|
+
width: bpSize040
|
|
29
25
|
};
|
|
30
|
-
|
|
26
|
+
{
|
|
31
27
|
return direction === 'up' ? jsx(ArrowUp, {
|
|
32
28
|
...props
|
|
33
29
|
}) : jsx(ArrowDown, {
|
|
34
30
|
...props
|
|
35
31
|
});
|
|
36
32
|
}
|
|
37
|
-
return direction === 'up' ? jsx(ArrowUp$1, {
|
|
38
|
-
...props
|
|
39
|
-
}) : jsx(ArrowDown$1, {
|
|
40
|
-
...props
|
|
41
|
-
});
|
|
42
33
|
}
|
|
43
34
|
function SortIndicator({
|
|
44
35
|
direction
|
|
@@ -2,7 +2,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { TableHeader } from 'react-aria-components';
|
|
5
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
6
5
|
import styles from './main.module.js';
|
|
7
6
|
|
|
8
7
|
const TableHeaderInner = (props, ref) => {
|
|
@@ -12,14 +11,11 @@ const TableHeaderInner = (props, ref) => {
|
|
|
12
11
|
className,
|
|
13
12
|
...rest
|
|
14
13
|
} = props;
|
|
15
|
-
const {
|
|
16
|
-
enableModernizedComponents
|
|
17
|
-
} = useBlueprintModernization();
|
|
18
14
|
return jsx(TableHeader, {
|
|
19
15
|
...rest,
|
|
20
16
|
ref: ref,
|
|
21
17
|
className: clsx(styles.tableHeader, className),
|
|
22
|
-
"data-modern":
|
|
18
|
+
"data-modern": 'true' ,
|
|
23
19
|
children: children
|
|
24
20
|
});
|
|
25
21
|
};
|
|
@@ -3,7 +3,6 @@ import { forwardRef, useRef } from 'react';
|
|
|
3
3
|
import { ResizableTableContainer, Table as Table$1 } from 'react-aria-components';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { noop } from '../utils/noop.js';
|
|
6
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
7
6
|
import styles from './main.module.js';
|
|
8
7
|
import { ColumnVisibilityProvider, useColumnVisibilityContext } from './utils/column-visibility-context/columnVisibilityContext.js';
|
|
9
8
|
import { TableSortingProvider, useTableSortingContext } from './utils/table-sorting-context/tableSortingContext.js';
|
|
@@ -28,9 +27,7 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
28
27
|
} = props;
|
|
29
28
|
const resizableContainerRef = useRef(null);
|
|
30
29
|
const dropdownHeaderContainerRef = useRef(null);
|
|
31
|
-
const
|
|
32
|
-
enableModernizedComponents
|
|
33
|
-
} = useBlueprintModernization();
|
|
30
|
+
const enableModernizedComponents = true;
|
|
34
31
|
return jsx(TableSortingProvider, {
|
|
35
32
|
defaultSortDescriptor: defaultSortDescriptor,
|
|
36
33
|
dropdownHeaderContainerRef: dropdownHeaderContainerRef,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import 'react';
|
|
4
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
5
3
|
import styles from './loading-indicator.module.js';
|
|
6
4
|
|
|
7
5
|
function LoadingIndicator(props) {
|
|
@@ -13,15 +11,12 @@ function LoadingIndicator(props) {
|
|
|
13
11
|
className = '',
|
|
14
12
|
...rest
|
|
15
13
|
} = props;
|
|
16
|
-
const {
|
|
17
|
-
enableModernizedComponents
|
|
18
|
-
} = useBlueprintModernization();
|
|
19
14
|
return jsxs("div", {
|
|
20
15
|
...rest,
|
|
21
16
|
"aria-label": ariaLabel,
|
|
22
17
|
"aria-live": ariaLive,
|
|
23
18
|
className: clsx(styles.crawler, styles[variant], styles[size], className),
|
|
24
|
-
"data-modern":
|
|
19
|
+
"data-modern": 'true' ,
|
|
25
20
|
role: "status",
|
|
26
21
|
children: [jsx("div", {
|
|
27
22
|
className: styles.segment
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import '@box/blueprint-web-assets/icons/Fill';
|
|
3
3
|
import { XMark } from '@box/blueprint-web-assets/icons/Medium';
|
|
4
4
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
8
7
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
9
8
|
import { useMedia } from '../utils/useMedia.js';
|
|
10
9
|
import styles from './modal.module.js';
|
|
@@ -23,10 +22,7 @@ const ModalClose = /*#__PURE__*/forwardRef(({
|
|
|
23
22
|
variant = 'default',
|
|
24
23
|
...rest
|
|
25
24
|
}, forwardedRef) => {
|
|
26
|
-
const
|
|
27
|
-
enableModernizedComponents
|
|
28
|
-
} = useBlueprintModernization();
|
|
29
|
-
const defaultIcon = enableModernizedComponents ? XMark : XMark$1;
|
|
25
|
+
const defaultIcon = XMark ;
|
|
30
26
|
// Change IconButton size for Mobile (only when IconButton size is large)
|
|
31
27
|
// TODO: change to media query tokens
|
|
32
28
|
const breakpoint = 459;
|
|
@@ -5,7 +5,6 @@ import { forwardRef } from 'react';
|
|
|
5
5
|
import '../blueprint-configuration-context/blueprint-configuration-context.js';
|
|
6
6
|
import '../blueprint-configuration-context/consts.js';
|
|
7
7
|
import { useBlueprintConfiguration } from '../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
8
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
9
8
|
import styles from './modal.module.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -20,9 +19,6 @@ const ModalContent = /*#__PURE__*/forwardRef(({
|
|
|
20
19
|
size,
|
|
21
20
|
...props
|
|
22
21
|
}, forwardedRef) => {
|
|
23
|
-
const {
|
|
24
|
-
enableModernizedComponents
|
|
25
|
-
} = useBlueprintModernization();
|
|
26
22
|
const {
|
|
27
23
|
componentsWithAnimationEnabled
|
|
28
24
|
} = useBlueprintConfiguration();
|
|
@@ -32,7 +28,7 @@ const ModalContent = /*#__PURE__*/forwardRef(({
|
|
|
32
28
|
children: jsx(RadixDialog.Overlay, {
|
|
33
29
|
className: styles.overlay,
|
|
34
30
|
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
35
|
-
"data-modern":
|
|
31
|
+
"data-modern": 'true' ,
|
|
36
32
|
children: jsx(RadixDialog.Content, {
|
|
37
33
|
...props,
|
|
38
34
|
ref: forwardedRef,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useBlueprintConfiguration } from '../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
4
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
5
4
|
import { DropdownMenu } from '../primitives/dropdown-menu/index.js';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -12,9 +11,6 @@ const NavigationMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
12
11
|
children,
|
|
13
12
|
...rest
|
|
14
13
|
} = props;
|
|
15
|
-
const {
|
|
16
|
-
enableModernizedComponents
|
|
17
|
-
} = useBlueprintModernization();
|
|
18
14
|
const {
|
|
19
15
|
componentsWithAnimationEnabled
|
|
20
16
|
} = useBlueprintConfiguration();
|
|
@@ -23,7 +19,7 @@ const NavigationMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
23
19
|
...rest,
|
|
24
20
|
ref: forwardedRef,
|
|
25
21
|
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
26
|
-
"data-modern":
|
|
22
|
+
"data-modern": 'true' ,
|
|
27
23
|
children: children
|
|
28
24
|
});
|
|
29
25
|
});
|
|
@@ -2,7 +2,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { Link } from '../primitives/link/link.js';
|
|
5
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
6
5
|
import styles from './navigation-menu.module.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -13,14 +12,11 @@ const NavigationMenuLink = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
13
12
|
children,
|
|
14
13
|
...rest
|
|
15
14
|
} = props;
|
|
16
|
-
const {
|
|
17
|
-
enableModernizedComponents
|
|
18
|
-
} = useBlueprintModernization();
|
|
19
15
|
return jsx(Link, {
|
|
20
16
|
...rest,
|
|
21
17
|
ref: forwardedRef,
|
|
22
18
|
className: clsx([styles.link, styles.ellipsis]),
|
|
23
|
-
"data-modern":
|
|
19
|
+
"data-modern": 'true' ,
|
|
24
20
|
inheritFont: true,
|
|
25
21
|
variant: "standalone",
|
|
26
22
|
children: children
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef, useEffect, Children, isValidElement } from 'react';
|
|
4
|
-
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
5
4
|
import { useBreakpoint, Breakpoint } from '../utils/useBreakpoint.js';
|
|
6
5
|
import { useRefWithEffect as useRefWithEffectMemoized } from '../utils/useRefWithEffect.js';
|
|
7
6
|
import { PageProvider, usePageStore } from './page-context.js';
|
|
@@ -57,9 +56,6 @@ const PageLayout = /*#__PURE__*/forwardRef(({
|
|
|
57
56
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
57
|
}, []);
|
|
59
58
|
const Slots = getChildrenForLandmarks(children);
|
|
60
|
-
const {
|
|
61
|
-
enableModernizedComponents
|
|
62
|
-
} = useBlueprintModernization();
|
|
63
59
|
return jsxs("div", {
|
|
64
60
|
...rest,
|
|
65
61
|
ref: setRefs,
|
|
@@ -68,7 +64,7 @@ const PageLayout = /*#__PURE__*/forwardRef(({
|
|
|
68
64
|
[styles.pageNavigationXXLargeCollapsed]: xxLargeBreakpointActive && !navigationExpanded,
|
|
69
65
|
[styles.pageMediumOrLessViewport]: breakpoint <= Breakpoint.Medium
|
|
70
66
|
}, className),
|
|
71
|
-
"data-modern":
|
|
67
|
+
"data-modern": 'true' ,
|
|
72
68
|
children: [Slots.Navigation, jsxs("div", {
|
|
73
69
|
className: styles.pageBody,
|
|
74
70
|
children: [Slots.SidePanel, jsxs("div", {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef, useCallback, createElement } from 'react';
|
|
4
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
5
4
|
import { useBaseButtonContext } from './base-button-context.js';
|
|
6
5
|
import styles from './base-button.module.js';
|
|
7
6
|
import { buttonVariantToIconColorMap, getIconSize } from './utils.js';
|
|
@@ -19,9 +18,7 @@ const BaseButtonIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
19
18
|
buttonType,
|
|
20
19
|
ariaLabel
|
|
21
20
|
} = useBaseButtonContext();
|
|
22
|
-
const
|
|
23
|
-
enableModernizedComponents
|
|
24
|
-
} = useBlueprintModernization();
|
|
21
|
+
const enableModernizedComponents = true;
|
|
25
22
|
const isIconOnly = buttonType === 'icon-only';
|
|
26
23
|
const renderIcon = useCallback(() => {
|
|
27
24
|
if (!icon) {
|
|
@@ -5,7 +5,6 @@ import { forwardRef, useRef, useMemo } from 'react';
|
|
|
5
5
|
import '../../blueprint-configuration-context/blueprint-configuration-context.js';
|
|
6
6
|
import '../../blueprint-configuration-context/consts.js';
|
|
7
7
|
import { useBlueprintConfiguration } from '../../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
8
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
9
8
|
import { LoadingIndicator } from '../../loading-indicator/loading-indicator.js';
|
|
10
9
|
import { getButtonOptions } from '../../utils/getButtonOptions.js';
|
|
11
10
|
import { useForkRef } from '../../utils/useForkRef.js';
|
|
@@ -37,9 +36,6 @@ const BaseButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
37
36
|
...rest
|
|
38
37
|
} = getButtonOptions(props);
|
|
39
38
|
const effectiveSize = size === 'x-small' && !VALID_X_SMALL_VARIANTS.includes(variant) ? 'small' : size;
|
|
40
|
-
const {
|
|
41
|
-
enableModernizedComponents
|
|
42
|
-
} = useBlueprintModernization();
|
|
43
39
|
const {
|
|
44
40
|
componentsWithAnimationEnabled
|
|
45
41
|
} = useBlueprintConfiguration();
|
|
@@ -58,7 +54,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
58
54
|
ref: useForkRef(ref, forwardedRef),
|
|
59
55
|
"aria-label": loading ? undefined : ariaLabel,
|
|
60
56
|
className: getButtonClassName(variant, effectiveSize, buttonType, loading, className),
|
|
61
|
-
"data-modern":
|
|
57
|
+
"data-modern": 'true' ,
|
|
62
58
|
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
63
59
|
children: jsxs(BaseButtonContext.Provider, {
|
|
64
60
|
value: context,
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { bpSize050,
|
|
2
|
+
import { bpSize050, bpIconIconOnLightSecondary, bpIconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
3
3
|
import { forwardRef, createElement } from 'react';
|
|
4
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
5
4
|
import styles from './base-inline-notice.module.js';
|
|
6
5
|
|
|
7
|
-
const IconColorMap = {
|
|
8
|
-
IconIconOnLight,
|
|
9
|
-
IconIconOnLightSecondary
|
|
10
|
-
};
|
|
11
6
|
const IconColorModernizedMap = {
|
|
12
7
|
IconIconOnLight: bpIconIconOnLight,
|
|
13
8
|
IconIconOnLightSecondary: bpIconIconOnLightSecondary
|
|
@@ -19,17 +14,14 @@ const BaseInlineNoticeIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
19
14
|
iconColor = 'IconIconOnLight',
|
|
20
15
|
...rest
|
|
21
16
|
} = props;
|
|
22
|
-
const {
|
|
23
|
-
enableModernizedComponents
|
|
24
|
-
} = useBlueprintModernization();
|
|
25
17
|
if (!icon) {
|
|
26
18
|
return null;
|
|
27
19
|
}
|
|
28
|
-
const color =
|
|
20
|
+
const color = IconColorModernizedMap[iconColor] ;
|
|
29
21
|
const iconElement = /*#__PURE__*/createElement(icon, {
|
|
30
22
|
color,
|
|
31
|
-
width:
|
|
32
|
-
height:
|
|
23
|
+
width: bpSize050 ,
|
|
24
|
+
height: bpSize050 ,
|
|
33
25
|
'aria-label': iconAriaLabel
|
|
34
26
|
});
|
|
35
27
|
return jsx("span", {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
5
4
|
import styles from './base-inline-notice.module.js';
|
|
6
5
|
|
|
7
6
|
const BaseInlineNotice = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
@@ -12,15 +11,12 @@ const BaseInlineNotice = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
12
11
|
enableContainerQueryLayout = false,
|
|
13
12
|
...rest
|
|
14
13
|
} = props;
|
|
15
|
-
const {
|
|
16
|
-
enableModernizedComponents
|
|
17
|
-
} = useBlueprintModernization();
|
|
18
14
|
return jsx("div", {
|
|
19
15
|
...rest,
|
|
20
16
|
ref: forwardedRef,
|
|
21
17
|
className: clsx(styles.noticeWrapper, styles[backgroundColor], className),
|
|
22
18
|
"data-container-query-layout": enableContainerQueryLayout ? 'true' : 'false',
|
|
23
|
-
"data-modern":
|
|
19
|
+
"data-modern": 'true' ,
|
|
24
20
|
children: children
|
|
25
21
|
});
|
|
26
22
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import '@box/blueprint-web-assets/icons/Fill';
|
|
3
3
|
import { AlertCircle } from '@box/blueprint-web-assets/icons/Medium';
|
|
4
4
|
import { IconIconErrorOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { forwardRef, useState, useMemo, cloneElement } from 'react';
|
|
7
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
8
7
|
import { Focusable } from '../../focusable/focusable.js';
|
|
9
8
|
import { Text } from '../../text/text.js';
|
|
10
9
|
import { Tooltip } from '../../tooltip/tooltip.js';
|
|
@@ -72,16 +71,13 @@ const BaseTextInput = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
72
71
|
className: clsx(endIcon.props?.className, styles.endIcon)
|
|
73
72
|
}), [endIcon]);
|
|
74
73
|
const Label = useLabelable(label, inputId, required);
|
|
75
|
-
const {
|
|
76
|
-
enableModernizedComponents
|
|
77
|
-
} = useBlueprintModernization();
|
|
78
74
|
return jsxs("div", {
|
|
79
75
|
className: clsx(styles.textInputContainerOuter, {
|
|
80
76
|
[styles.disabled]: disabled,
|
|
81
77
|
[styles.error]: shouldMarkError
|
|
82
78
|
}, className),
|
|
83
79
|
"data-bp-animated": animatedDataAttribute ?? 'false',
|
|
84
|
-
"data-modern":
|
|
80
|
+
"data-modern": 'true' ,
|
|
85
81
|
children: [jsx(Label, {
|
|
86
82
|
className: clsx([styles.label], {
|
|
87
83
|
[styles.hidden]: hideLabel
|
|
@@ -117,11 +113,9 @@ const BaseTextInput = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
117
113
|
ref: setValueUsing(setEndIconWidth),
|
|
118
114
|
"aria-labelledby": inlineErrorId,
|
|
119
115
|
className: clsx(styles.endIcon, styles.inlineErrorIcon),
|
|
120
|
-
children:
|
|
121
|
-
color: IconIconErrorOnLight
|
|
122
|
-
}) : jsx(AlertBadge, {
|
|
116
|
+
children: jsx(AlertCircle, {
|
|
123
117
|
color: IconIconErrorOnLight
|
|
124
|
-
})
|
|
118
|
+
})
|
|
125
119
|
})
|
|
126
120
|
}), jsx(VisuallyHidden, {
|
|
127
121
|
id: inlineErrorId,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import '@box/blueprint-web-assets/icons/Fill';
|
|
3
3
|
import { ChevronLeft, ChevronRight } from '@box/blueprint-web-assets/icons/Medium';
|
|
4
4
|
import { Gray65 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
5
5
|
import { isSameDay, today, getLocalTimeZone } from '@internationalized/date';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { forwardRef, useMemo, useRef, useEffect } from 'react';
|
|
8
8
|
import { Calendar as Calendar$1, Button, Heading, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell } from 'react-aria-components';
|
|
9
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
10
9
|
import styles from './calendar.module.js';
|
|
11
10
|
|
|
12
11
|
// Dispatch duplicated event with bubbling enabled, so Radix popover knows that this click happened.
|
|
@@ -63,17 +62,15 @@ const Calendar = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
63
62
|
nextMonthAriaLabel,
|
|
64
63
|
...rest
|
|
65
64
|
} = props;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const ChevronLeftIcon = useMemo(() => enableModernizedComponents ? ChevronLeft : ChevronLeft$1, [enableModernizedComponents]);
|
|
70
|
-
const ChevronRightIcon = useMemo(() => enableModernizedComponents ? ChevronRight : ChevronRight$1, [enableModernizedComponents]);
|
|
65
|
+
const enableModernizedComponents = true;
|
|
66
|
+
const ChevronLeftIcon = useMemo(() => ChevronLeft , [enableModernizedComponents]);
|
|
67
|
+
const ChevronRightIcon = useMemo(() => ChevronRight , [enableModernizedComponents]);
|
|
71
68
|
return jsxs(Calendar$1, {
|
|
72
69
|
...rest,
|
|
73
70
|
ref: forwardedRef,
|
|
74
71
|
"aria-label": calendarAriaLabel,
|
|
75
72
|
className: clsx(styles.calendar, className),
|
|
76
|
-
"data-modern":
|
|
73
|
+
"data-modern": 'true' ,
|
|
77
74
|
children: [jsxs("header", {
|
|
78
75
|
className: styles.calendarHeader,
|
|
79
76
|
children: [jsx(Button, {
|
|
@@ -2,7 +2,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as ToggleGroup from '@radix-ui/react-toggle-group';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
6
5
|
import styles from './chip.module.js';
|
|
7
6
|
|
|
8
7
|
const Chip = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
@@ -11,14 +10,11 @@ const Chip = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
11
10
|
children,
|
|
12
11
|
...rest
|
|
13
12
|
} = props;
|
|
14
|
-
const {
|
|
15
|
-
enableModernizedComponents
|
|
16
|
-
} = useBlueprintModernization();
|
|
17
13
|
return jsx(ToggleGroup.Item, {
|
|
18
14
|
...rest,
|
|
19
15
|
ref: forwardedRef,
|
|
20
16
|
className: clsx(styles.chip, className),
|
|
21
|
-
"data-modern":
|
|
17
|
+
"data-modern": 'true' ,
|
|
22
18
|
children: children
|
|
23
19
|
});
|
|
24
20
|
});
|
|
@@ -2,7 +2,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as ToggleGroup from '@radix-ui/react-toggle-group';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
6
5
|
import styles from './chip.module.js';
|
|
7
6
|
|
|
8
7
|
/** Provides a container for Chips, this component handles keyboard navigation and chips selection state */
|
|
@@ -12,14 +11,11 @@ const ChipsGroup = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
12
11
|
children,
|
|
13
12
|
...rest
|
|
14
13
|
} = props;
|
|
15
|
-
const {
|
|
16
|
-
enableModernizedComponents
|
|
17
|
-
} = useBlueprintModernization();
|
|
18
14
|
return jsx(ToggleGroup.Root, {
|
|
19
15
|
...rest,
|
|
20
16
|
ref: forwardedRef,
|
|
21
17
|
className: clsx([styles.chipsGroup, className]),
|
|
22
|
-
"data-modern":
|
|
18
|
+
"data-modern": 'true' ,
|
|
23
19
|
children: children
|
|
24
20
|
});
|
|
25
21
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Size4, bpIconIconOnLightSecondary
|
|
2
|
+
import { Size4, bpIconIconOnLightSecondary } from '@box/blueprint-web-assets/tokens/tokens';
|
|
3
3
|
import * as ContextMenuPrimitve from '@radix-ui/react-context-menu';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { forwardRef, useCallback, createElement } from 'react';
|
|
6
6
|
import '../../blueprint-configuration-context/blueprint-configuration-context.js';
|
|
7
7
|
import '../../blueprint-configuration-context/consts.js';
|
|
8
8
|
import { useBlueprintConfiguration } from '../../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
9
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
10
9
|
import { MenuItemSideContent, MenuItemMainContent } from '../../util-components/menu-item-sections/menu-item-sections.js';
|
|
11
10
|
import styles from './context-menu.module.js';
|
|
12
11
|
|
|
@@ -43,10 +42,7 @@ const ContextMenuItemStartElement = /*#__PURE__*/forwardRef(({
|
|
|
43
42
|
icon,
|
|
44
43
|
...rest
|
|
45
44
|
}, ref) => {
|
|
46
|
-
const
|
|
47
|
-
enableModernizedComponents
|
|
48
|
-
} = useBlueprintModernization();
|
|
49
|
-
const iconColor = enableModernizedComponents ? bpIconIconOnLightSecondary : IconIconOnLightSecondary;
|
|
45
|
+
const iconColor = bpIconIconOnLightSecondary ;
|
|
50
46
|
return jsxs("div", {
|
|
51
47
|
...rest,
|
|
52
48
|
ref: ref,
|
|
@@ -5,7 +5,6 @@ import { forwardRef, Children, isValidElement } from 'react';
|
|
|
5
5
|
import '../../blueprint-configuration-context/blueprint-configuration-context.js';
|
|
6
6
|
import '../../blueprint-configuration-context/consts.js';
|
|
7
7
|
import { useBlueprintConfiguration } from '../../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
8
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
9
8
|
import { useContentSizeObserver } from '../../utils/useContentSizeObserver.js';
|
|
10
9
|
import { useForkRef } from '../../utils/useForkRef.js';
|
|
11
10
|
import { useFullScreenContextMenu } from '../menu-utils/responsiveness/FullScreenContextMenuContext.js';
|
|
@@ -38,9 +37,6 @@ const ContextMenuMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
38
37
|
className,
|
|
39
38
|
...rest
|
|
40
39
|
} = props;
|
|
41
|
-
const {
|
|
42
|
-
enableModernizedComponents
|
|
43
|
-
} = useBlueprintModernization();
|
|
44
40
|
const {
|
|
45
41
|
componentsWithAnimationEnabled
|
|
46
42
|
} = useBlueprintConfiguration();
|
|
@@ -62,7 +58,7 @@ const ContextMenuMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
62
58
|
ref: ref,
|
|
63
59
|
className: clsx(styles.menuBlock, className),
|
|
64
60
|
"data-menu-fullscreen": true,
|
|
65
|
-
"data-modern":
|
|
61
|
+
"data-modern": 'true' ,
|
|
66
62
|
children: [Header, jsx("div", {
|
|
67
63
|
className: styles.fullScreenContent,
|
|
68
64
|
children: OtherChildren
|
|
@@ -76,7 +72,7 @@ const ContextMenuMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
76
72
|
...rest,
|
|
77
73
|
ref: ref,
|
|
78
74
|
className: clsx(styles.menuBlock, className),
|
|
79
|
-
"data-modern":
|
|
75
|
+
"data-modern": 'true' ,
|
|
80
76
|
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
81
77
|
children: children
|
|
82
78
|
})
|
|
@@ -2,7 +2,6 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { PointerChevronLeft, XMark } from '@box/blueprint-web-assets/icons/Fill';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { forwardRef, useCallback } from 'react';
|
|
5
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
6
5
|
import { Text } from '../../text/text.js';
|
|
7
6
|
import { composeEventHandlers } from '../../utils/composeEventHandlers.js';
|
|
8
7
|
import { IconButton } from '../icon-button/icon-button.js';
|
|
@@ -56,13 +55,10 @@ const MenuHeaderPrimitive = ({
|
|
|
56
55
|
className,
|
|
57
56
|
...rest
|
|
58
57
|
}) => {
|
|
59
|
-
const {
|
|
60
|
-
enableModernizedComponents
|
|
61
|
-
} = useBlueprintModernization();
|
|
62
58
|
return jsx("div", {
|
|
63
59
|
...rest,
|
|
64
60
|
className: clsx(styles.menuHeader, className),
|
|
65
|
-
"data-modern":
|
|
61
|
+
"data-modern": 'true' ,
|
|
66
62
|
role: "presentation",
|
|
67
63
|
children: children
|
|
68
64
|
});
|
|
@@ -5,7 +5,6 @@ import { forwardRef, useCallback } from 'react';
|
|
|
5
5
|
import '../../blueprint-configuration-context/blueprint-configuration-context.js';
|
|
6
6
|
import '../../blueprint-configuration-context/consts.js';
|
|
7
7
|
import { useBlueprintConfiguration } from '../../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
8
|
-
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
9
8
|
import { useContentSizeObserver } from '../../utils/useContentSizeObserver.js';
|
|
10
9
|
import { useForkRef } from '../../utils/useForkRef.js';
|
|
11
10
|
import { useFullScreenContextMenu } from '../menu-utils/responsiveness/FullScreenContextMenuContext.js';
|
|
@@ -25,9 +24,6 @@ const ContextMenuSubMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef)
|
|
|
25
24
|
className,
|
|
26
25
|
...rest
|
|
27
26
|
} = props;
|
|
28
|
-
const {
|
|
29
|
-
enableModernizedComponents
|
|
30
|
-
} = useBlueprintModernization();
|
|
31
27
|
const {
|
|
32
28
|
componentsWithAnimationEnabled
|
|
33
29
|
} = useBlueprintConfiguration();
|
|
@@ -51,7 +47,7 @@ const ContextMenuSubMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef)
|
|
|
51
47
|
alignOffset: alignOffsetPx,
|
|
52
48
|
className: clsx(styles.menuBlock, className),
|
|
53
49
|
"data-menu-fullscreen": true,
|
|
54
|
-
"data-modern":
|
|
50
|
+
"data-modern": 'true' ,
|
|
55
51
|
// Prevents submenu from closing, when detects focus outside submenu in fullscreen mode,
|
|
56
52
|
// while mouse is moving over submenu.
|
|
57
53
|
onFocusOutside: preventDefault,
|
|
@@ -70,7 +66,7 @@ const ContextMenuSubMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef)
|
|
|
70
66
|
ref: ref,
|
|
71
67
|
alignOffset: alignOffsetPx,
|
|
72
68
|
className: clsx(styles.menuBlock, className),
|
|
73
|
-
"data-modern":
|
|
69
|
+
"data-modern": 'true' ,
|
|
74
70
|
"data-bp-animated": isAnimationEnabled ? 'true' : 'false',
|
|
75
71
|
sideOffset: sideOffsetPx,
|
|
76
72
|
children: children
|