@box/blueprint-web 19.6.0 → 20.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/THIRD_PARTY_LICENSES +119 -0
- package/dist/lib-esm/accordion/accordion.js +6 -6
- package/dist/lib-esm/accordion/types.d.ts +1 -1
- package/dist/lib-esm/checkbox/checkbox-item.js +3 -3
- package/dist/lib-esm/checkbox/types.d.ts +1 -1
- package/dist/lib-esm/collapsible/collapsible-section.js +5 -5
- package/dist/lib-esm/collapsible/types.d.ts +1 -1
- package/dist/lib-esm/combobox-group/combobox-group-combobox.js +1 -1
- package/dist/lib-esm/date-picker/date-picker.js +8 -7
- package/dist/lib-esm/guided-tooltip/guided-tooltip.js +7 -7
- package/dist/lib-esm/guided-tooltip/types.d.ts +1 -1
- package/dist/lib-esm/modal/alert-modal.types.d.ts +1 -1
- package/dist/lib-esm/modal/modal-close.js +2 -2
- package/dist/lib-esm/modal/modal-content.d.ts +1 -1
- package/dist/lib-esm/modal/modal-content.js +4 -4
- package/dist/lib-esm/modal/modal-description.js +2 -2
- package/dist/lib-esm/modal/modal-title.js +2 -2
- package/dist/lib-esm/modal/modal-trigger.js +2 -2
- package/dist/lib-esm/modal/modal.d.ts +1 -1
- package/dist/lib-esm/modal/modal.js +1 -1
- package/dist/lib-esm/modal/types.d.ts +1 -1
- package/dist/lib-esm/navigation-menu/index.d.ts +4 -2
- package/dist/lib-esm/navigation-menu/navigation-menu-item.d.ts +1 -1
- package/dist/lib-esm/navigation-menu/navigation-menu-trigger.d.ts +3 -1
- package/dist/lib-esm/primitives/chips/chip.d.ts +1 -1
- package/dist/lib-esm/primitives/chips/chip.js +2 -2
- package/dist/lib-esm/primitives/chips/chips-group.js +2 -2
- package/dist/lib-esm/primitives/chips/filter-chip/filter-chip-button.d.ts +1 -1
- package/dist/lib-esm/primitives/chips/filter-chip/filter-chip.d.ts +1 -1
- package/dist/lib-esm/primitives/chips/filter-chip/filter-combo-chip.d.ts +2 -2
- package/dist/lib-esm/primitives/chips/filter-chip/filter-trigger-chip.d.ts +1 -1
- package/dist/lib-esm/primitives/chips/filter-chip/index.d.ts +5 -5
- package/dist/lib-esm/primitives/chips/types.d.ts +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-item.d.ts +2 -2
- package/dist/lib-esm/primitives/context-menu/context-menu-item.js +2 -2
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-content.d.ts +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-content.js +5 -5
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-header.js +3 -10
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-root.d.ts +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-root.js +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-trigger.d.ts +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-menu-trigger.js +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-sub-menu-content.d.ts +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-sub-menu-content.js +5 -5
- package/dist/lib-esm/primitives/context-menu/context-menu-sub-menu-root.d.ts +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-sub-menu-root.js +1 -1
- package/dist/lib-esm/primitives/context-menu/context-menu-sub-menu-trigger.d.ts +2 -2
- package/dist/lib-esm/primitives/context-menu/context-menu-sub-menu-trigger.js +1 -1
- package/dist/lib-esm/primitives/context-menu/index.d.ts +3 -3
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-checkbox-item.d.ts +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-checkbox-item.js +3 -3
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-content.d.ts +1 -1
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-content.js +5 -5
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-group.d.ts +4 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-group.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-item.d.ts +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-item.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-radio-group.d.ts +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-radio-group.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-radio-select-item.d.ts +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-radio-select-item.js +3 -3
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-root.d.ts +1 -1
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-root.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-header.d.ts +4 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-header.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-menu-content.d.ts +1 -1
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-menu-content.js +5 -5
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-menu-root.d.ts +1 -1
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-menu-root.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-menu-trigger.d.ts +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-sub-menu-trigger.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-trigger.d.ts +4 -2
- package/dist/lib-esm/primitives/dropdown-menu/dropdown-menu-trigger.js +2 -2
- package/dist/lib-esm/primitives/dropdown-menu/index.d.ts +14 -8
- package/dist/lib-esm/primitives/notification/hooks/use-notification-layer.d.ts +15 -0
- package/dist/lib-esm/primitives/notification/hooks/use-notification-layer.js +49 -0
- package/dist/lib-esm/primitives/notification/notification-provider.js +2 -2
- package/dist/lib-esm/primitives/notification/notification.viewport-animated.js +12 -8
- package/dist/lib-esm/primitives/notification/notification.viewport.js +5 -1
- package/dist/lib-esm/primitives/notification/private-notification-element-animated.js +44 -6
- package/dist/lib-esm/primitives/notification/private-notification-element.js +34 -4
- package/dist/lib-esm/primitives/popover/index.d.ts +11 -5
- package/dist/lib-esm/primitives/popover/popover-anchor.d.ts +4 -2
- package/dist/lib-esm/primitives/popover/popover-anchor.js +2 -2
- package/dist/lib-esm/primitives/popover/popover-close.d.ts +4 -2
- package/dist/lib-esm/primitives/popover/popover-close.js +2 -2
- package/dist/lib-esm/primitives/popover/popover-content-container.d.ts +1 -1
- package/dist/lib-esm/primitives/popover/popover-content-container.js +3 -3
- package/dist/lib-esm/primitives/popover/popover-footer.d.ts +1 -1
- package/dist/lib-esm/primitives/popover/popover-main-content.d.ts +1 -1
- package/dist/lib-esm/primitives/popover/popover-root.d.ts +1 -1
- package/dist/lib-esm/primitives/popover/popover-root.js +2 -2
- package/dist/lib-esm/primitives/popover/popover-trigger.d.ts +4 -2
- package/dist/lib-esm/primitives/popover/popover-trigger.js +2 -2
- package/dist/lib-esm/radio-group/index.d.ts +1 -1
- package/dist/lib-esm/radio-group/radio-group.d.ts +1 -1
- package/dist/lib-esm/radio-group/radio-group.js +2 -2
- package/dist/lib-esm/radio-group/radio-item.js +3 -3
- package/dist/lib-esm/radio-group/types.d.ts +1 -1
- package/dist/lib-esm/select/select.js +12 -12
- package/dist/lib-esm/select/types.d.ts +1 -1
- package/dist/lib-esm/select/utils/use-select-exit-animation.d.ts +3 -3
- package/dist/lib-esm/select/utils/use-select-exit-animation.js +3 -3
- package/dist/lib-esm/side-panel/side-panel-close.js +2 -2
- package/dist/lib-esm/side-panel/side-panel-content.js +3 -3
- package/dist/lib-esm/side-panel/side-panel-header.js +2 -2
- package/dist/lib-esm/side-panel/side-panel-overlay.js +3 -3
- package/dist/lib-esm/side-panel/side-panel-trigger.js +2 -2
- package/dist/lib-esm/side-panel/side-panel.js +1 -1
- package/dist/lib-esm/side-panel/types.d.ts +1 -1
- package/dist/lib-esm/switch/switch-item.js +3 -3
- package/dist/lib-esm/switch/types.d.ts +1 -1
- package/dist/lib-esm/toolbar/index.d.ts +2 -2
- package/dist/lib-esm/toolbar/toolbar-button.js +2 -2
- package/dist/lib-esm/toolbar/toolbar-input.js +2 -2
- package/dist/lib-esm/toolbar/toolbar-link.js +2 -2
- package/dist/lib-esm/toolbar/toolbar-root.js +3 -3
- package/dist/lib-esm/toolbar/toolbar-separator.d.ts +1 -1
- package/dist/lib-esm/toolbar/toolbar-separator.js +2 -2
- package/dist/lib-esm/toolbar/toolbar-text-toggle-item.js +2 -2
- package/dist/lib-esm/toolbar/toolbar-toggle-group.d.ts +1 -2
- package/dist/lib-esm/toolbar/toolbar-toggle-group.js +2 -2
- package/dist/lib-esm/toolbar/toolbar-toggle-item.js +2 -2
- package/dist/lib-esm/toolbar/types.d.ts +1 -1
- package/dist/lib-esm/tooltip/tooltip.d.ts +1 -1
- package/dist/lib-esm/tooltip/tooltip.js +6 -6
- package/dist/lib-esm/tooltip/types.d.ts +1 -1
- package/dist/lib-esm/utils/radix-compat/accordion.d.ts +45 -0
- package/dist/lib-esm/utils/radix-compat/accordion.js +299 -0
- package/dist/lib-esm/utils/radix-compat/allow-auto-focus.d.ts +9 -0
- package/dist/lib-esm/utils/radix-compat/allow-auto-focus.js +16 -0
- package/dist/lib-esm/utils/radix-compat/bubble-input.d.ts +14 -0
- package/dist/lib-esm/utils/radix-compat/bubble-input.js +70 -0
- package/dist/lib-esm/utils/radix-compat/button-controls.d.ts +9 -0
- package/dist/lib-esm/utils/radix-compat/button-controls.js +6 -0
- package/dist/lib-esm/utils/radix-compat/checkbox.d.ts +18 -0
- package/dist/lib-esm/utils/radix-compat/checkbox.js +131 -0
- package/dist/lib-esm/utils/radix-compat/collapsible.d.ts +33 -0
- package/dist/lib-esm/utils/radix-compat/collapsible.js +133 -0
- package/dist/lib-esm/utils/radix-compat/collection.d.ts +21 -0
- package/dist/lib-esm/utils/radix-compat/collection.js +82 -0
- package/dist/lib-esm/utils/radix-compat/compose-refs.d.ts +8 -0
- package/dist/lib-esm/utils/radix-compat/compose-refs.js +44 -0
- package/dist/lib-esm/utils/radix-compat/content-size.d.ts +15 -0
- package/dist/lib-esm/utils/radix-compat/content-size.js +61 -0
- package/dist/lib-esm/utils/radix-compat/context-menu.d.ts +56 -0
- package/dist/lib-esm/utils/radix-compat/context-menu.js +191 -0
- package/dist/lib-esm/utils/radix-compat/dialog.d.ts +50 -0
- package/dist/lib-esm/utils/radix-compat/dialog.js +367 -0
- package/dist/lib-esm/utils/radix-compat/dismiss-marker.d.ts +5 -0
- package/dist/lib-esm/utils/radix-compat/dismiss-marker.js +12 -0
- package/dist/lib-esm/utils/radix-compat/dismissable.d.ts +34 -0
- package/dist/lib-esm/utils/radix-compat/dismissable.js +205 -0
- package/dist/lib-esm/utils/radix-compat/dropdown-menu.d.ts +57 -0
- package/dist/lib-esm/utils/radix-compat/dropdown-menu.js +187 -0
- package/dist/lib-esm/utils/radix-compat/focus-scope-component.d.ts +16 -0
- package/dist/lib-esm/utils/radix-compat/focus-scope-component.js +41 -0
- package/dist/lib-esm/utils/radix-compat/focus-scope.d.ts +37 -0
- package/dist/lib-esm/utils/radix-compat/focus-scope.js +288 -0
- package/dist/lib-esm/utils/radix-compat/hide-others.d.ts +6 -0
- package/dist/lib-esm/utils/radix-compat/hide-others.js +18 -0
- package/dist/lib-esm/utils/radix-compat/index.d.ts +14 -0
- package/dist/lib-esm/utils/radix-compat/layers.d.ts +25 -0
- package/dist/lib-esm/utils/radix-compat/layers.js +61 -0
- package/dist/lib-esm/utils/radix-compat/menu.d.ts +98 -0
- package/dist/lib-esm/utils/radix-compat/menu.js +1041 -0
- package/dist/lib-esm/utils/radix-compat/popover.d.ts +44 -0
- package/dist/lib-esm/utils/radix-compat/popover.js +386 -0
- package/dist/lib-esm/utils/radix-compat/popper.d.ts +60 -0
- package/dist/lib-esm/utils/radix-compat/popper.js +416 -0
- package/dist/lib-esm/utils/radix-compat/portal.d.ts +11 -0
- package/dist/lib-esm/utils/radix-compat/portal.js +20 -0
- package/dist/lib-esm/utils/radix-compat/presence.d.ts +20 -0
- package/dist/lib-esm/utils/radix-compat/presence.js +110 -0
- package/dist/lib-esm/utils/radix-compat/radio-group.d.ts +27 -0
- package/dist/lib-esm/utils/radix-compat/radio-group.js +189 -0
- package/dist/lib-esm/utils/radix-compat/roving-focus.d.ts +35 -0
- package/dist/lib-esm/utils/radix-compat/roving-focus.js +237 -0
- package/dist/lib-esm/utils/radix-compat/select.d.ts +82 -0
- package/dist/lib-esm/utils/radix-compat/select.js +901 -0
- package/dist/lib-esm/utils/radix-compat/slot.d.ts +31 -0
- package/dist/lib-esm/utils/radix-compat/slot.js +119 -0
- package/dist/lib-esm/utils/radix-compat/store-options.d.ts +8 -0
- package/dist/lib-esm/utils/radix-compat/store-options.js +10 -0
- package/dist/lib-esm/utils/radix-compat/switch.d.ts +16 -0
- package/dist/lib-esm/utils/radix-compat/switch.js +97 -0
- package/dist/lib-esm/utils/radix-compat/toggle-group.d.ts +41 -0
- package/dist/lib-esm/utils/radix-compat/toggle-group.js +195 -0
- package/dist/lib-esm/utils/radix-compat/toolbar.d.ts +32 -0
- package/dist/lib-esm/utils/radix-compat/toolbar.js +136 -0
- package/dist/lib-esm/utils/radix-compat/tooltip.d.ts +59 -0
- package/dist/lib-esm/utils/radix-compat/tooltip.js +636 -0
- package/dist/lib-esm/utils/radix-compat/typeahead.d.ts +22 -0
- package/dist/lib-esm/utils/radix-compat/typeahead.js +64 -0
- package/dist/lib-esm/utils/radix-compat/types.d.ts +53 -0
- package/dist/lib-esm/utils/radix-compat/viewport-height.d.ts +5 -0
- package/dist/lib-esm/utils/radix-compat/viewport-height.js +28 -0
- package/dist/lib-esm/utils/radix-compat/visually-hidden.d.ts +2 -0
- package/dist/lib-esm/utils/radix-compat/visually-hidden.js +24 -0
- package/package.json +8 -19
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Space4 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
3
|
-
import * as RadixPopover from '@radix-ui/react-popover';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
import { forwardRef, useContext, useState, useMemo, useCallback } from 'react';
|
|
6
5
|
import { useBlueprintConfiguration } from '../../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
7
6
|
import { Card } from '../../card/card.js';
|
|
8
7
|
import { useBreakpoint, Breakpoint } from '../../utils/useBreakpoint.js';
|
|
9
8
|
import { useContentSizeObserver } from '../../utils/useContentSizeObserver.js';
|
|
9
|
+
import { Portal, Content } from '../../utils/radix-compat/popover.js';
|
|
10
10
|
import { useForkRef } from '../../utils/useForkRef.js';
|
|
11
11
|
import { focusRadioGroupFirstIfExists } from './popover-focus-utils.js';
|
|
12
12
|
import styles from './popover.module.js';
|
|
@@ -55,9 +55,9 @@ const PopoverContentContainer = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
55
55
|
}, [onOpenAutoFocus]);
|
|
56
56
|
return (
|
|
57
57
|
// TODO(DSYS-440): Unify all Portals (Tooltip, Select, Popover, etc...), Expose a Provider which would tell where to mount (body? other elem?)
|
|
58
|
-
jsx(
|
|
58
|
+
jsx(Portal, {
|
|
59
59
|
container: container,
|
|
60
|
-
children: jsx(
|
|
60
|
+
children: jsx(Content, {
|
|
61
61
|
...rest,
|
|
62
62
|
ref: useForkRef(forwardedRef, sizeObserverRef),
|
|
63
63
|
className: clsx(styles.popoverContentContainer, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as PopoverPrimitive from '
|
|
1
|
+
import type * as PopoverPrimitive from '../../utils/radix-compat/popover';
|
|
2
2
|
export type PopoverFooterProps = PopoverPrimitive.PopoverContentProps;
|
|
3
3
|
/**
|
|
4
4
|
* Container to hold the footer content for the popover
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as PopoverPrimitive from '
|
|
1
|
+
import type * as PopoverPrimitive from '../../utils/radix-compat/popover';
|
|
2
2
|
export type PopoverMainContentProps = PopoverPrimitive.PopoverContentProps;
|
|
3
3
|
/**
|
|
4
4
|
* Container to hold the main content for the popover
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as PopoverPrimitive from '
|
|
1
|
+
import * as PopoverPrimitive from '../../utils/radix-compat/popover';
|
|
2
2
|
export type PopoverRootProps = PopoverPrimitive.PopoverProps;
|
|
3
3
|
/**
|
|
4
4
|
* The Popover component has a trigger which displays a Card to the user with customizable content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { Root } from '../../utils/radix-compat/popover.js';
|
|
3
3
|
import { PopoverModalityContext } from './utils/popover-modality-context.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -16,7 +16,7 @@ const PopoverRoot = props => {
|
|
|
16
16
|
value: {
|
|
17
17
|
isInteractionDisabled
|
|
18
18
|
},
|
|
19
|
-
children: jsx(
|
|
19
|
+
children: jsx(Root, {
|
|
20
20
|
modal: modal,
|
|
21
21
|
...rest,
|
|
22
22
|
children: children
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import * as PopoverPrimitive from '
|
|
1
|
+
import * as PopoverPrimitive from '../../utils/radix-compat/popover';
|
|
2
2
|
export type PopoverTriggerProps = PopoverPrimitive.PopoverTriggerProps;
|
|
3
3
|
/**
|
|
4
4
|
* PopoverTrigger connects your button or chip to open a popover.
|
|
5
5
|
* The button or chip should have a label that clearly describes the popover's content/purpose.
|
|
6
6
|
* @see https://www.radix-ui.com/docs/primitives/components/popover#trigger
|
|
7
7
|
*/
|
|
8
|
-
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<
|
|
8
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixPopover from '@radix-ui/react-popover';
|
|
3
2
|
import { forwardRef } from 'react';
|
|
3
|
+
import { Trigger } from '../../utils/radix-compat/popover.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* PopoverTrigger connects your button or chip to open a popover.
|
|
@@ -12,7 +12,7 @@ const PopoverTrigger = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
12
12
|
children,
|
|
13
13
|
...rest
|
|
14
14
|
} = props;
|
|
15
|
-
return jsx(
|
|
15
|
+
return jsx(Trigger, {
|
|
16
16
|
...rest,
|
|
17
17
|
ref: forwardedRef,
|
|
18
18
|
asChild: true,
|
|
@@ -2,6 +2,6 @@ import { Legend } from '../util-components/legend';
|
|
|
2
2
|
export { type RadioGroupProps, type RadioItemProps } from './types';
|
|
3
3
|
export declare const Radio: {
|
|
4
4
|
Item: import("react").ForwardRefExoticComponent<import("./types").RadioItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
Group: import("react").ForwardRefExoticComponent<import("
|
|
5
|
+
Group: import("react").ForwardRefExoticComponent<import("../utils/radix-compat/radio-group").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
6
|
Legend: typeof Legend;
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as RadixRadioGroup from '
|
|
1
|
+
import * as RadixRadioGroup from '../utils/radix-compat/radio-group';
|
|
2
2
|
export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadixRadioGroup.RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixRadioGroup from '@radix-ui/react-radio-group';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Root } from '../utils/radix-compat/radio-group.js';
|
|
5
5
|
import styles from './radio-group.module.js';
|
|
6
6
|
|
|
7
7
|
const RadioGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
@@ -16,7 +16,7 @@ const RadioGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
16
16
|
orientation,
|
|
17
17
|
...rest
|
|
18
18
|
} = props;
|
|
19
|
-
return jsx(
|
|
19
|
+
return jsx(Root, {
|
|
20
20
|
...rest,
|
|
21
21
|
ref: ref,
|
|
22
22
|
className: clsx([styles.root], {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixRadioGroup from '@radix-ui/react-radio-group';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Item, Indicator } from '../utils/radix-compat/radio-group.js';
|
|
5
5
|
import { TextWithInfoBadge } from '../util-components/text-with-info-badge/text-with-info-badge.js';
|
|
6
6
|
import { useUniqueId } from '../utils/useUniqueId.js';
|
|
7
7
|
import styles from './radio-group.module.js';
|
|
@@ -24,14 +24,14 @@ const RadioItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24
24
|
children: [jsxs("label", {
|
|
25
25
|
className: styles.label,
|
|
26
26
|
"data-target-id": dataTargetId,
|
|
27
|
-
children: [jsx(
|
|
27
|
+
children: [jsx(Item, {
|
|
28
28
|
...rest,
|
|
29
29
|
ref: ref,
|
|
30
30
|
"aria-describedby": descriptionId,
|
|
31
31
|
className: styles.radioButton,
|
|
32
32
|
disabled: disabled,
|
|
33
33
|
value: value,
|
|
34
|
-
children: jsx(
|
|
34
|
+
children: jsx(Indicator, {
|
|
35
35
|
className: styles.indicator,
|
|
36
36
|
forceMount: true
|
|
37
37
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type RadioGroupItemProps, type RadioGroupProps as RadixRadioGroupProps } from '@radix-ui/react-radio-group';
|
|
2
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import { type RadioGroupItemProps, type RadioGroupProps as RadixRadioGroupProps } from '../utils/radix-compat/radio-group';
|
|
3
3
|
import { type StyledText } from '../utils/commonTypes';
|
|
4
4
|
export type RadioGroupProps = RadixRadioGroupProps;
|
|
5
5
|
export interface RadioItemProps extends RadioGroupItemProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { PencilCrossed, ChevronDown, Checkmark } from '@box/blueprint-web-assets/icons/Medium';
|
|
3
3
|
import { bpSize030, bpIconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
4
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
import { forwardRef, useEffect, useCallback, useLayoutEffect, useSyncExternalStore } from 'react';
|
|
6
|
+
import { Root as Root$1, Portal, Content as Content$1, Viewport, Item, ItemText, ItemIndicator, Separator as Separator$1, Trigger as Trigger$1, Value, Icon } from '../utils/radix-compat/select.js';
|
|
7
7
|
import '../blueprint-configuration-context/blueprint-configuration-context.js';
|
|
8
8
|
import '../blueprint-configuration-context/consts.js';
|
|
9
9
|
import { useBlueprintConfiguration } from '../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
@@ -135,7 +135,7 @@ const Root = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
135
135
|
isExiting: isExiting,
|
|
136
136
|
selectedValue: value,
|
|
137
137
|
truncateText: truncateText,
|
|
138
|
-
children: jsxs(
|
|
138
|
+
children: jsxs(Root$1, {
|
|
139
139
|
...selectProps,
|
|
140
140
|
children: [jsx(Trigger, {
|
|
141
141
|
...triggerProps,
|
|
@@ -183,7 +183,7 @@ const Trigger = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
183
183
|
const getSelectedLeftElement = useCallback(() => value ? getLeftElement(value) : null, [getLeftElement, value]);
|
|
184
184
|
const selectedLeftElement = useSyncExternalStore(subscribeToLeftElements, getSelectedLeftElement, getSelectedLeftElement);
|
|
185
185
|
const shouldShowPlaceholderLeftElement = !value && placeholderLeftElement;
|
|
186
|
-
return jsxs(
|
|
186
|
+
return jsxs(Trigger$1, {
|
|
187
187
|
...triggerProps,
|
|
188
188
|
ref: forwardedRef,
|
|
189
189
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -207,10 +207,10 @@ const Trigger = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
207
207
|
}), shouldShowPlaceholderLeftElement && jsx("span", {
|
|
208
208
|
className: styles.triggerLeftElement,
|
|
209
209
|
children: placeholderLeftElement
|
|
210
|
-
}), jsx(
|
|
210
|
+
}), jsx(Value, {
|
|
211
211
|
placeholder: placeholder
|
|
212
212
|
})]
|
|
213
|
-
}), jsx(
|
|
213
|
+
}), jsx(Icon, {
|
|
214
214
|
className: styles.iconWrapper,
|
|
215
215
|
children: icon
|
|
216
216
|
})]
|
|
@@ -234,9 +234,9 @@ const Content = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
234
234
|
const handleExitAnimationEvent = useCallback(event => {
|
|
235
235
|
handleSelectContentExitAnimationEnd(event, isExiting, completeExit);
|
|
236
236
|
}, [completeExit, isExiting]);
|
|
237
|
-
return jsx(
|
|
237
|
+
return jsx(Portal, {
|
|
238
238
|
container: container,
|
|
239
|
-
children: jsx(
|
|
239
|
+
children: jsx(Content$1, {
|
|
240
240
|
...contentProps,
|
|
241
241
|
ref: forwardedRef,
|
|
242
242
|
className: clsx(styles.content, className),
|
|
@@ -247,7 +247,7 @@ const Content = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
247
247
|
}),
|
|
248
248
|
position: "popper",
|
|
249
249
|
sideOffset: 8,
|
|
250
|
-
children: jsx(
|
|
250
|
+
children: jsx(Viewport, {
|
|
251
251
|
className: clsx(styles.viewport, {
|
|
252
252
|
[styles.withTruncatedText]: truncateText
|
|
253
253
|
}),
|
|
@@ -293,7 +293,7 @@ const Option = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
293
293
|
if (!canOpen && itemProps.value !== selectedValue) {
|
|
294
294
|
return null;
|
|
295
295
|
}
|
|
296
|
-
return jsxs(
|
|
296
|
+
return jsxs(Item, {
|
|
297
297
|
...itemProps,
|
|
298
298
|
ref: forwardedRef,
|
|
299
299
|
className: clsx(styles.option, {
|
|
@@ -309,13 +309,13 @@ const Option = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
309
309
|
className: clsx(styles.textWrapper, {
|
|
310
310
|
[styles.ellipsis]: truncateText
|
|
311
311
|
}),
|
|
312
|
-
children: [jsx(
|
|
312
|
+
children: [jsx(ItemText, {
|
|
313
313
|
children: text
|
|
314
314
|
}), !!secondaryText && jsx("span", {
|
|
315
315
|
className: styles.secondaryText,
|
|
316
316
|
children: secondaryText
|
|
317
317
|
})]
|
|
318
|
-
}), !itemProps.disabled && jsx(
|
|
318
|
+
}), !itemProps.disabled && jsx(ItemIndicator, {
|
|
319
319
|
className: styles.indicator,
|
|
320
320
|
children: jsx(Checkmark, {})
|
|
321
321
|
})]
|
|
@@ -323,7 +323,7 @@ const Option = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
323
323
|
});
|
|
324
324
|
Option.displayName = 'Select.Option';
|
|
325
325
|
const Separator = /*#__PURE__*/forwardRef((_, forwardedRef) => {
|
|
326
|
-
return jsx(
|
|
326
|
+
return jsx(Separator$1, {
|
|
327
327
|
ref: forwardedRef,
|
|
328
328
|
className: styles.separator
|
|
329
329
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SelectItemProps as RadixItemProps, type SelectContentProps as RadixSelectContentProps, type SelectProps as RadixSelectProps, type SelectTriggerProps as RadixSelectTriggerProps } from '@radix-ui/react-select';
|
|
2
1
|
import { type ReactElement } from 'react';
|
|
3
2
|
import { type RequireAllOrNone } from 'type-fest';
|
|
3
|
+
import { type SelectItemProps as RadixItemProps, type SelectContentProps as RadixSelectContentProps, type SelectProps as RadixSelectProps, type SelectTriggerProps as RadixSelectTriggerProps } from '../utils/radix-compat/select';
|
|
4
4
|
import { type Modify } from '../types/modify';
|
|
5
5
|
import { type Labelable } from '../util-components/labelable/types';
|
|
6
6
|
import { type StyledText } from '../utils/commonTypes';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type AnimationEvent, type Dispatch, type SetStateAction } from 'react';
|
|
2
2
|
type SetOpen = Dispatch<SetStateAction<boolean | undefined>>;
|
|
3
3
|
/**
|
|
4
|
-
* Deferred close for Select menu exit animations
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Deferred close for Select menu exit animations. Like Radix Select 2.0.x, the Select content
|
|
5
|
+
* unmounts as soon as it closes, so `open` stays true while the exit CSS runs, and the close
|
|
6
|
+
* is committed on `animationend`.
|
|
7
7
|
*/
|
|
8
8
|
export declare function useSelectExitAnimation({ open, setOpen, isAnimationEnabled, }: {
|
|
9
9
|
open: boolean;
|
|
@@ -6,9 +6,9 @@ const completeExitNoop = noop;
|
|
|
6
6
|
const EXIT_DURATION_MS = Number.parseFloat(bpDurationShort);
|
|
7
7
|
const SELECT_EXIT_ANIMATION_FALLBACK_MS = EXIT_DURATION_MS * 3;
|
|
8
8
|
/**
|
|
9
|
-
* Deferred close for Select menu exit animations
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Deferred close for Select menu exit animations. Like Radix Select 2.0.x, the Select content
|
|
10
|
+
* unmounts as soon as it closes, so `open` stays true while the exit CSS runs, and the close
|
|
11
|
+
* is committed on `animationend`.
|
|
12
12
|
*/
|
|
13
13
|
function useSelectExitAnimation({
|
|
14
14
|
open,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { XMark } from '@box/blueprint-web-assets/icons/Medium';
|
|
3
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Close } from '../utils/radix-compat/dialog.js';
|
|
5
5
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
6
6
|
import { useBreakpoint, Breakpoint } from '../utils/useBreakpoint.js';
|
|
7
7
|
import styles from './side-panel.module.js';
|
|
@@ -20,7 +20,7 @@ const SidePanelClose = /*#__PURE__*/forwardRef(({
|
|
|
20
20
|
const breakpoint = useBreakpoint();
|
|
21
21
|
const smallBreakpointActive = breakpoint === Breakpoint.Small;
|
|
22
22
|
const finalProps = smallBreakpointActive ? smallViewportProps : {};
|
|
23
|
-
return jsx(
|
|
23
|
+
return jsx(Close, {
|
|
24
24
|
ref: forwardedRef,
|
|
25
25
|
asChild: true,
|
|
26
26
|
children: jsx(IconButton, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
|
-
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
4
2
|
import { clsx } from 'clsx';
|
|
5
3
|
import { forwardRef, useCallback, useId } from 'react';
|
|
4
|
+
import { Content } from '../utils/radix-compat/dialog.js';
|
|
5
|
+
import { FocusScope } from '../utils/radix-compat/focus-scope-component.js';
|
|
6
6
|
import { useForkRef } from '../utils/useForkRef.js';
|
|
7
7
|
import { ResizeProvider } from './resize-context.js';
|
|
8
8
|
import styles from './side-panel.module.js';
|
|
@@ -87,7 +87,7 @@ const SidePanelContent = /*#__PURE__*/forwardRef(({
|
|
|
87
87
|
value: resize,
|
|
88
88
|
children: jsx(FocusScope, {
|
|
89
89
|
trapped: !isInteractiveOverlayVariant,
|
|
90
|
-
children: jsx(
|
|
90
|
+
children: jsx(Content, {
|
|
91
91
|
...props,
|
|
92
92
|
ref: ref,
|
|
93
93
|
asChild: asChild,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Title } from '../utils/radix-compat/dialog.js';
|
|
5
5
|
import { Text } from '../text/text.js';
|
|
6
6
|
import { useScrollContext } from '../utils/scroll-context.js';
|
|
7
7
|
import { useBreakpoint, Breakpoint } from '../utils/useBreakpoint.js';
|
|
@@ -41,7 +41,7 @@ const SidePanelHeader = /*#__PURE__*/forwardRef(({
|
|
|
41
41
|
[styles.headerShadow]: isScrolledUnderHeader
|
|
42
42
|
}, className);
|
|
43
43
|
if (variant === 'overlay' || variant === 'dropShadowOverlay' || variant === 'interactiveOverlay') {
|
|
44
|
-
return jsx(
|
|
44
|
+
return jsx(Title, {
|
|
45
45
|
...rest,
|
|
46
46
|
ref: forwardedRef,
|
|
47
47
|
asChild: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Portal, Overlay } from '../utils/radix-compat/dialog.js';
|
|
5
5
|
import styles from './side-panel.module.js';
|
|
6
6
|
import { useVariant } from './variant-context.js';
|
|
7
7
|
|
|
@@ -16,9 +16,9 @@ const SidePanelOverlay = /*#__PURE__*/forwardRef(({
|
|
|
16
16
|
...props
|
|
17
17
|
}, forwardedRef) => {
|
|
18
18
|
const variant = useVariant();
|
|
19
|
-
return jsx(
|
|
19
|
+
return jsx(Portal, {
|
|
20
20
|
container: container,
|
|
21
|
-
children: variant === 'interactiveOverlay' ? children : jsx(
|
|
21
|
+
children: variant === 'interactiveOverlay' ? children : jsx(Overlay, {
|
|
22
22
|
ref: forwardedRef,
|
|
23
23
|
className: clsx(styles.overlay, {
|
|
24
24
|
[styles.dropShadowOverlay]: variant === 'dropShadowOverlay'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
2
|
import { forwardRef } from 'react';
|
|
3
|
+
import { Trigger } from '../utils/radix-compat/dialog.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Wrapper component for an interactive element that's responsible for opening SidePanel.
|
|
@@ -8,7 +8,7 @@ import { forwardRef } from 'react';
|
|
|
8
8
|
const SidePanelTrigger = /*#__PURE__*/forwardRef(function SidePanelTrigger({
|
|
9
9
|
children
|
|
10
10
|
}, forwardedRef) {
|
|
11
|
-
return jsx(
|
|
11
|
+
return jsx(Trigger, {
|
|
12
12
|
ref: forwardedRef,
|
|
13
13
|
asChild: true,
|
|
14
14
|
children: children
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Root as Root$1 } from '
|
|
2
|
+
import { Root as Root$1 } from '../utils/radix-compat/dialog.js';
|
|
3
3
|
import { ScrollProvider } from '../utils/scroll-context.js';
|
|
4
4
|
import { SidePanelClose } from './side-panel-close.js';
|
|
5
5
|
import { SidePanelContent, SidePanelPersistentContent } from './side-panel-content.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type DialogContentProps, type DialogPortalProps, type DialogProps } from '@radix-ui/react-dialog';
|
|
2
1
|
import { type ComponentPropsWithRef, type FunctionComponent, type PropsWithChildren, type ReactElement, type ReactNode, type SVGProps } from 'react';
|
|
2
|
+
import { type DialogContentProps, type DialogPortalProps, type DialogProps } from '../utils/radix-compat/dialog';
|
|
3
3
|
/**
|
|
4
4
|
* 'persistent' - side panel is displayed inline with the page content
|
|
5
5
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef, useState } from 'react';
|
|
5
4
|
import '../blueprint-configuration-context/blueprint-configuration-context.js';
|
|
@@ -7,6 +6,7 @@ import '../blueprint-configuration-context/consts.js';
|
|
|
7
6
|
import { useBlueprintConfiguration } from '../blueprint-configuration-context/useBlueprintConfiguration.js';
|
|
8
7
|
import { TextWithInfoBadge } from '../util-components/text-with-info-badge/text-with-info-badge.js';
|
|
9
8
|
import { composeEventHandlers } from '../utils/composeEventHandlers.js';
|
|
9
|
+
import { Root, Thumb } from '../utils/radix-compat/switch.js';
|
|
10
10
|
import { useUniqueId } from '../utils/useUniqueId.js';
|
|
11
11
|
import styles from './switch.module.js';
|
|
12
12
|
|
|
@@ -42,7 +42,7 @@ const Switch = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
42
42
|
className: clsx(styles.label, {
|
|
43
43
|
[styles.rightAlign]: isRightAligned
|
|
44
44
|
}),
|
|
45
|
-
children: [jsx(
|
|
45
|
+
children: [jsx(Root, {
|
|
46
46
|
...rest,
|
|
47
47
|
ref: forwardedRef,
|
|
48
48
|
"aria-describedby": descriptionId,
|
|
@@ -58,7 +58,7 @@ const Switch = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
58
58
|
setWasToggled(true);
|
|
59
59
|
}
|
|
60
60
|
}),
|
|
61
|
-
children: jsx(
|
|
61
|
+
children: jsx(Thumb, {
|
|
62
62
|
className: styles.thumb
|
|
63
63
|
})
|
|
64
64
|
}), jsx(TextWithInfoBadge, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SwitchProps as RadixSwitchProps } from '@radix-ui/react-switch';
|
|
2
1
|
import { type RequireAllOrNone } from 'type-fest';
|
|
3
2
|
import { type StyledText } from '../utils/commonTypes';
|
|
3
|
+
import { type SwitchProps as RadixSwitchProps } from '../utils/radix-compat/switch';
|
|
4
4
|
export interface DescriptionInfo {
|
|
5
5
|
/** Additional text to aid in use. It will appear inside info icon tooltip in the description. */
|
|
6
6
|
descriptionInfoText?: StyledText;
|
|
@@ -51,7 +51,7 @@ export declare const Toolbar: {
|
|
|
51
51
|
/**
|
|
52
52
|
* Parent for a set of `Toolbar.ToggleItem` subcomponents.
|
|
53
53
|
*/
|
|
54
|
-
ToggleGroup: import("react").ForwardRefExoticComponent<import("
|
|
54
|
+
ToggleGroup: import("react").ForwardRefExoticComponent<import("../utils/radix-compat/toggle-group").ToggleGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
55
|
/**
|
|
56
56
|
* A button that is used as a trigger for dropdown elements.
|
|
57
57
|
*/
|
|
@@ -71,7 +71,7 @@ export declare const Toolbar: {
|
|
|
71
71
|
/**
|
|
72
72
|
* Component used to visually separate options in the Toolbar.
|
|
73
73
|
*/
|
|
74
|
-
Separator: import("react").ForwardRefExoticComponent<import("
|
|
74
|
+
Separator: import("react").ForwardRefExoticComponent<import("../utils/radix-compat/toolbar").ToolbarSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
75
75
|
/**
|
|
76
76
|
* A link item.
|
|
77
77
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Button } from '../utils/radix-compat/toolbar.js';
|
|
5
5
|
import styles from './toolbar.module.js';
|
|
6
6
|
|
|
7
7
|
const ToolbarButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
@@ -13,7 +13,7 @@ const ToolbarButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
13
13
|
disabled,
|
|
14
14
|
...rest
|
|
15
15
|
} = props;
|
|
16
|
-
return jsx(
|
|
16
|
+
return jsx(Button, {
|
|
17
17
|
...rest,
|
|
18
18
|
ref: forwardedRef,
|
|
19
19
|
className: clsx(styles.toolbarItem, styles.toolbarButton, className),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { AlertCircle } from '@box/blueprint-web-assets/icons/Medium';
|
|
3
|
-
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
import { forwardRef } from 'react';
|
|
5
|
+
import { Button } from '../utils/radix-compat/toolbar.js';
|
|
6
6
|
import { composeToolbarInputKeyDownCapture } from './toolbar-input-keydown.js';
|
|
7
7
|
import styles from './toolbar.module.js';
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ const ToolbarInput = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
24
24
|
const showError = error && !disabled;
|
|
25
25
|
return jsxs("div", {
|
|
26
26
|
className: styles.toolbarInputContainer,
|
|
27
|
-
children: [jsx(
|
|
27
|
+
children: [jsx(Button, {
|
|
28
28
|
asChild: true,
|
|
29
29
|
disabled: disabled,
|
|
30
30
|
children: jsx("input", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Link } from '../utils/radix-compat/toolbar.js';
|
|
5
5
|
import styles from './toolbar.module.js';
|
|
6
6
|
|
|
7
7
|
const ToolbarLink = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
@@ -10,7 +10,7 @@ const ToolbarLink = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
10
10
|
className,
|
|
11
11
|
...rest
|
|
12
12
|
} = props;
|
|
13
|
-
return jsx(
|
|
13
|
+
return jsx(Link, {
|
|
14
14
|
...rest,
|
|
15
15
|
ref: forwardedRef,
|
|
16
16
|
className: clsx(styles.toolbarItem, styles.toolbarLink, className),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Root } from '../utils/radix-compat/toolbar.js';
|
|
5
5
|
import { ToolbarScrollableContainer } from './toolbar-scrollable-container.js';
|
|
6
6
|
import styles from './toolbar.module.js';
|
|
7
7
|
import { HorizontalScrollProvider } from './utils/horizontal-scroll-context.js';
|
|
@@ -31,7 +31,7 @@ const ToolbarRoot = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
31
31
|
// Emit the attribute only in dark mode so light Toolbars keep the same DOM as master.
|
|
32
32
|
const dataColorScheme = colorScheme === 'dark' ? colorScheme : undefined;
|
|
33
33
|
if (scrollable) {
|
|
34
|
-
return jsx(
|
|
34
|
+
return jsx(Root, {
|
|
35
35
|
...rest,
|
|
36
36
|
ref: forwardedRef,
|
|
37
37
|
className: clsx(styles.toolbarRoot, styles.ScrollableToolbarWithReducedPadding, className),
|
|
@@ -51,7 +51,7 @@ const ToolbarRoot = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
51
51
|
})
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
return jsx(
|
|
54
|
+
return jsx(Root, {
|
|
55
55
|
...rest,
|
|
56
56
|
ref: forwardedRef,
|
|
57
57
|
className: clsx(styles.toolbarRoot, className),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as ToolbarPrimitive from '
|
|
1
|
+
import * as ToolbarPrimitive from '../utils/radix-compat/toolbar';
|
|
2
2
|
export declare const ToolbarSeparator: import("react").ForwardRefExoticComponent<ToolbarPrimitive.ToolbarSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { Separator } from '../utils/radix-compat/toolbar.js';
|
|
5
5
|
import styles from './toolbar.module.js';
|
|
6
6
|
|
|
7
7
|
const ToolbarSeparator = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
@@ -10,7 +10,7 @@ const ToolbarSeparator = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
10
10
|
className,
|
|
11
11
|
...rest
|
|
12
12
|
} = props;
|
|
13
|
-
return jsx(
|
|
13
|
+
return jsx(Separator, {
|
|
14
14
|
...rest,
|
|
15
15
|
ref: forwardedRef,
|
|
16
16
|
className: clsx(styles.separator, className)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { ToggleItem } from '../utils/radix-compat/toolbar.js';
|
|
5
5
|
import styles from './toolbar.module.js';
|
|
6
6
|
|
|
7
7
|
const ToolbarTextToggleItem = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
@@ -9,7 +9,7 @@ const ToolbarTextToggleItem = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
9
9
|
children,
|
|
10
10
|
...rest
|
|
11
11
|
} = props;
|
|
12
|
-
return jsx(
|
|
12
|
+
return jsx(ToggleItem, {
|
|
13
13
|
...rest,
|
|
14
14
|
ref: forwardedRef,
|
|
15
15
|
className: clsx(styles.toolbarItem, styles.toolbarTextToggleItem),
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ToolbarToggleGroup: import("react").ForwardRefExoticComponent<ToolbarPrimitive.ToggleGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
1
|
+
export declare const ToolbarToggleGroup: import("react").ForwardRefExoticComponent<import("../utils/radix-compat/toggle-group").ToggleGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
4
|
+
import { ToggleGroup } from '../utils/radix-compat/toolbar.js';
|
|
5
5
|
import styles from './toolbar.module.js';
|
|
6
6
|
|
|
7
7
|
const ToolbarToggleGroup = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
@@ -10,7 +10,7 @@ const ToolbarToggleGroup = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
10
10
|
className,
|
|
11
11
|
...rest
|
|
12
12
|
} = props;
|
|
13
|
-
return jsx(
|
|
13
|
+
return jsx(ToggleGroup, {
|
|
14
14
|
...rest,
|
|
15
15
|
ref: forwardedRef,
|
|
16
16
|
className: clsx(styles.toggleGroup, className),
|