@box/blueprint-web 6.38.4 → 6.38.6

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.
@@ -9,7 +9,7 @@ export declare const CollapsibleSection: import("react").ForwardRefExoticCompone
9
9
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
10
10
  Slot: (props: {
11
11
  name: CollapsibleSectionSlotName;
12
- children: JSX.Element | null;
13
- }) => JSX.Element | null;
12
+ children: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
13
+ }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
14
14
  };
15
15
  export {};
@@ -1,4 +1,4 @@
1
- import type React from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  export interface ContentFieldProps {
3
3
  /**
4
4
  * custom aria label for the content field clear button.
@@ -11,7 +11,7 @@ export interface ContentFieldProps {
11
11
  /**
12
12
  * type of the selected content(document, folder, etc.)
13
13
  */
14
- itemIcon?: React.JSX.Element;
14
+ itemIcon?: ReactElement;
15
15
  /**
16
16
  * whether or not the selected content is a shared folder.
17
17
  */
@@ -1,5 +1,5 @@
1
1
  import type * as RadixPopover from '@radix-ui/react-popover';
2
- import { type JSX, type FunctionComponent, type PropsWithChildren, type SVGProps } from 'react';
2
+ import { type FunctionComponent, type PropsWithChildren, type ReactElement, type SVGProps } from 'react';
3
3
  export interface GuidedTooltipContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'content'> {
4
4
  /** The preferred alignment against the anchor. May change when collisions occur.
5
5
  * "start" | "center" | "end"
@@ -10,7 +10,7 @@ export interface GuidedTooltipContentProps extends Omit<React.HTMLAttributes<HTM
10
10
  /** Localized aria-label for close button */
11
11
  closeLabel: string;
12
12
  /** React element with the content of GuildedTooltip */
13
- content: React.ReactElement;
13
+ content: ReactElement;
14
14
  /**
15
15
  * "data-resin-target" to be passed to Close button.
16
16
  */
@@ -58,7 +58,7 @@ export interface GuidedTooltipIconProps {
58
58
  /**
59
59
  * SVG Icon element to pass to GuidedTooltip Icon
60
60
  * */
61
- icon: FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>> | ((props: SVGProps<SVGSVGElement>) => JSX.Element);
61
+ icon: FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>> | ((props: SVGProps<SVGSVGElement>) => ReactElement);
62
62
  }
63
63
  export interface GuidedTooltipTitleProps {
64
64
  /** Title content. */
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes, type ReactElement } from 'react';
2
2
  export interface InputChipProps extends HTMLAttributes<HTMLElement> {
3
3
  /**
4
4
  * Text content inside the Chip.
@@ -7,7 +7,7 @@ export interface InputChipProps extends HTMLAttributes<HTMLElement> {
7
7
  /**
8
8
  * The Avatar element to display.
9
9
  */
10
- avatar?: JSX.Element;
10
+ avatar?: ReactElement;
11
11
  /**
12
12
  * The theme color of the component.
13
13
  *
@@ -23,7 +23,7 @@ const ActionCell = /*#__PURE__*/forwardRef((props, ref) => {
23
23
  } = useTableOptions();
24
24
  const divRef = useRef(null);
25
25
  // Allows consumer to sync changes to dropdown `open` state. Ensures actions are shown when dropdown is open
26
- // TODO: Once we have feature complete dropdown, this could be built-in.
26
+ // TODO(DSYS-1175): Once we have feature complete dropdown, this could be built-in.
27
27
  const onOpenChange = isOpen => {
28
28
  if (divRef.current) {
29
29
  divRef.current.setAttribute('data-state', isOpen ? 'open' : 'closed');
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
- import { forwardRef, useContext, useCallback, useReducer, cloneElement, createContext } from 'react';
3
+ import { forwardRef, useContext, useCallback, useReducer, useMemo, cloneElement, createContext } from 'react';
4
4
  import { DropdownMenu } from '../../dropdown-menu/index.js';
5
5
  import styles from '../chip.module.js';
6
6
  import { FilterChipGroupContext } from './filter-chip-group-context.js';
@@ -59,11 +59,12 @@ const FilterComboChip = /*#__PURE__*/forwardRef((props, forwardedRef) => {
59
59
  ...rest
60
60
  } = props;
61
61
  const [selectionCount, dispatchSelectionCountChange] = useReducer(comboChipSelectionCountReducer, 0);
62
+ const dispatchSelectionCountChangeMemo = useMemo(() => ({
63
+ dispatchSelectionCountChange
64
+ }), []);
62
65
  const isSelectionActive = selectionCount > 0;
63
66
  return jsx(FilterComboChipContext.Provider, {
64
- value: {
65
- dispatchSelectionCountChange
66
- },
67
+ value: dispatchSelectionCountChangeMemo,
67
68
  children: jsxs(DropdownMenu.Root, {
68
69
  ...rest,
69
70
  children: [jsx(DropdownMenu.Trigger, {
@@ -1,5 +1,5 @@
1
1
  import { type I18nProviderProps } from '@react-aria/i18n';
2
- import { type JSX } from 'react';
2
+ import { type ReactElement } from 'react';
3
3
  interface DateI18nProviderProps extends I18nProviderProps {
4
4
  /**
5
5
  * Locale in which date should be displayed, e.g. en-US
@@ -8,8 +8,8 @@ interface DateI18nProviderProps extends I18nProviderProps {
8
8
  /**
9
9
  * I18nProvider children element to be projected
10
10
  */
11
- children: JSX.Element;
11
+ children: ReactElement;
12
12
  }
13
13
  /** Provides internationalized strings to date related components. */
14
- export declare const DateI18nProvider: ({ locale, children, ...rest }: DateI18nProviderProps) => globalThis.JSX.Element;
14
+ export declare const DateI18nProvider: ({ locale, children, ...rest }: DateI18nProviderProps) => JSX.Element;
15
15
  export {};
@@ -16,7 +16,7 @@ const DropdownMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef) => {
16
16
  ...rest
17
17
  } = props;
18
18
  return (
19
- // TODO: Unify all Portals (Tooltip, Select, DropdownMenu, etc...), Expose a Provider which would tell where to mount (body? other elem?)
19
+ // TODO(DSYS-440): Unify all Portals (Tooltip, Select, DropdownMenu, etc...), Expose a Provider which would tell where to mount (body? other elem?)
20
20
  jsx(DropdownMenuPrimitive.Portal, {
21
21
  container: container,
22
22
  children: jsx(DropdownMenuPrimitive.Content, {
@@ -16,7 +16,7 @@ const DropdownMenuSubMenuContent = /*#__PURE__*/forwardRef((props, forwardedRef)
16
16
  ...rest
17
17
  } = props;
18
18
  return (
19
- // TODO: Unify all Portals (Tooltip, Select, DropdownMenu, etc...), Expose a Provider which would tell where to mount (body? other elem?)
19
+ // TODO(DSYS-440): Unify all Portals (Tooltip, Select, DropdownMenu, etc...), Expose a Provider which would tell where to mount (body? other elem?)
20
20
  jsx(DropdownMenuPrimitive.Portal, {
21
21
  container: container,
22
22
  children: jsx(DropdownMenuPrimitive.SubContent, {
@@ -2,7 +2,7 @@ import * as Toast from '@radix-ui/react-toast';
2
2
  import * as React from 'react';
3
3
  import { type PrivateNotificationElementProps } from './private-notification-element';
4
4
  export type NotificationProviderProps = Toast.ToastProviderProps;
5
- export declare const useNotification: () => {
5
+ interface NotificationContextType {
6
6
  /**
7
7
  * Creates notification based on passed arguments.
8
8
  * @returns string, which is notification `id`.
@@ -27,7 +27,8 @@ export declare const useNotification: () => {
27
27
  * @param newProps - new properties of notification
28
28
  */
29
29
  updateNotification: (id: string, newProps: PrivateNotificationElementProps) => void;
30
- };
30
+ }
31
+ export declare const useNotification: () => NotificationContextType;
31
32
  /**
32
33
  * A wrapper for notifications. It must be provided by the application.
33
34
  *
@@ -35,3 +36,4 @@ export declare const useNotification: () => {
35
36
  * useNotification hook provides access to store, and methods to interact with it.
36
37
  */
37
38
  export declare const NotificationProvider: React.FC<NotificationProviderProps>;
39
+ export {};
@@ -23,7 +23,7 @@ const PopoverContentContainer = /*#__PURE__*/forwardRef((props, forwardedRef) =>
23
23
  setIsContentOverflowing
24
24
  }), [isContentOverflowing, setIsContentOverflowing]);
25
25
  return (
26
- // TODO: Unify all Portals (Tooltip, Select, Popover, etc...), Expose a Provider which would tell where to mount (body? other elem?)
26
+ // TODO(DSYS-440): Unify all Portals (Tooltip, Select, Popover, etc...), Expose a Provider which would tell where to mount (body? other elem?)
27
27
  jsx(RadixPopover.Portal, {
28
28
  container: container,
29
29
  children: jsx(PopoverOverflowContext.Provider, {
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
1
+ import { type ReactElement } from 'react';
2
2
  export declare const Slot: <T>(props: {
3
3
  name: T;
4
- children: JSX.Element | null;
5
- }) => JSX.Element | null;
4
+ children: ReactElement | null;
5
+ }) => ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
@@ -1,4 +1,3 @@
1
- // This should never be part of public api because of generic type
2
1
  const Slot = props => props.children;
3
2
 
4
3
  export { Slot };
@@ -22,8 +22,8 @@ import { type SelectContentProps, type SelectOptionProps } from './types';
22
22
  */
23
23
  export declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps, keyof {
24
24
  label: string;
25
- placeholder: string | JSX.Element;
26
- children?: JSX.Element | undefined;
25
+ placeholder: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
26
+ children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
27
27
  defaultValue?: string | undefined;
28
28
  value?: string | undefined;
29
29
  onValueChange?: ((value: string) => void) | undefined;
@@ -38,8 +38,8 @@ export declare const Select: import("react").ForwardRefExoticComponent<Omit<Sele
38
38
  error?: import("react").ReactNode;
39
39
  }> & {
40
40
  label: string;
41
- placeholder: string | JSX.Element;
42
- children?: JSX.Element | undefined;
41
+ placeholder: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
42
+ children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
43
43
  defaultValue?: string | undefined;
44
44
  value?: string | undefined;
45
45
  onValueChange?: ((value: string) => void) | undefined;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { type SelectItemProps as RadixItemProps, type SelectContentProps as RadixSelectContentProps, type SelectProps as RadixSelectProps, type SelectTriggerProps as RadixSelectTriggerProps } from '@radix-ui/react-select';
2
+ import { type ReactElement } from 'react';
3
3
  import { type Modify } from '../types/modify';
4
4
  type ExtraProps = {
5
5
  /**
@@ -9,11 +9,11 @@ type ExtraProps = {
9
9
  /**
10
10
  * The placeholder value displayed within the select trigger button when no values has been selected yet.
11
11
  */
12
- placeholder: string | JSX.Element;
12
+ placeholder: string | ReactElement;
13
13
  /**
14
14
  * Pass the select content using `<Select.Content />`.
15
15
  */
16
- children?: JSX.Element;
16
+ children?: ReactElement;
17
17
  /**
18
18
  * The value of the select when initially rendered. Use when you do not need to control the state of the select.
19
19
  */
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { type FocusTrapProps } from './types';
3
2
  export declare const FocusTrap: ({ containerRef, children, customInitialFocus }: FocusTrapProps) => JSX.Element;
@@ -2,8 +2,8 @@
2
2
  * Helper method to apply a function to all matching regex in a string
3
3
  * ref: https://github.com/EfogDev/react-process-string/blob/master/index.js
4
4
  * */
5
- import type React from 'react';
6
- type ProcessedString = React.JSX.Element | string;
5
+ import { type ReactElement } from 'react';
6
+ type ProcessedString = ReactElement | string;
7
7
  type ProcessStringInput = {
8
8
  processingRegex: RegExp;
9
9
  processingFunction: (key: number, result: Array<string>) => ProcessedString;
@@ -1,8 +1,5 @@
1
1
  import { useMemo } from 'react';
2
2
 
3
- /**
4
- * Credit to material-ui for this snippet
5
- */
6
3
  function setRef(ref, value) {
7
4
  if (typeof ref === 'function') {
8
5
  ref(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "6.38.4",
3
+ "version": "6.38.6",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -57,7 +57,7 @@
57
57
  "devDependencies": {
58
58
  "@box/storybook-utils": "^0.0.7"
59
59
  },
60
- "gitHead": "40c82bade0ae2199758150857d77265cf5995203",
60
+ "gitHead": "bb8021fbff962afbef66578eef0cd3d5facdc9eb",
61
61
  "module": "lib-esm/index.js",
62
62
  "main": "lib-esm/index.js",
63
63
  "exports": {