@box/blueprint-web 12.122.2 → 12.124.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/combobox/types.d.ts +13 -1
- package/dist/lib-esm/inline-notice-list-item/inline-notice-list-item.js +12 -13
- package/dist/lib-esm/primitives/base-inline-notice/base-inline-notice-icon.js +12 -2
- package/dist/lib-esm/primitives/base-inline-notice/types.d.ts +3 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComboboxPopoverProps } from '@ariakit/react';
|
|
1
|
+
import { type ComboboxProps as AriakitComboboxProps, type ComboboxPopoverProps } from '@ariakit/react';
|
|
2
2
|
import { type SelectItemProps } from '@ariakit/react-core/select/select-item';
|
|
3
3
|
import { type SelectRendererProps } from '@ariakit/react-core/select/select-renderer';
|
|
4
4
|
import { type InputChipProps } from '../input-chip/types';
|
|
@@ -247,6 +247,18 @@ export interface ComboboxBaseProps<Multiple extends boolean, FreeInput extends b
|
|
|
247
247
|
* @default none
|
|
248
248
|
*/
|
|
249
249
|
autoComplete?: string;
|
|
250
|
+
/**
|
|
251
|
+
* If `true`, the combobox popover will open when the user changes the input value.
|
|
252
|
+
*
|
|
253
|
+
* @default true
|
|
254
|
+
*/
|
|
255
|
+
showOnChange?: AriakitComboboxProps['showOnChange'];
|
|
256
|
+
/**
|
|
257
|
+
* If `true`, the combobox popover will open when the user clicks the input element.
|
|
258
|
+
*
|
|
259
|
+
* @default true
|
|
260
|
+
*/
|
|
261
|
+
showOnClick?: AriakitComboboxProps['showOnClick'];
|
|
250
262
|
}
|
|
251
263
|
export type ComboboxTextArea = Pick<TextAreaProps, 'maxRows' | 'minRows' | 'maxLength' | 'aria-describedby'> & {
|
|
252
264
|
as: 'textarea';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { BaseInlineNotice } from '../primitives/base-inline-notice/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { EllipsizableText } from '../ellipsizable-text/ellipsizable-text.js';
|
|
5
5
|
import styles from './inline-notice-list-item.module.js';
|
|
6
6
|
|
|
7
7
|
const InlineNoticeListItem = /*#__PURE__*/forwardRef(function InlineNoticeListItem(props, forwardedRef) {
|
|
@@ -21,23 +21,22 @@ const InlineNoticeListItem = /*#__PURE__*/forwardRef(function InlineNoticeListIt
|
|
|
21
21
|
className: styles.contentContainer,
|
|
22
22
|
children: [icon && iconAriaLabel && jsx(BaseInlineNotice.Icon, {
|
|
23
23
|
icon: icon,
|
|
24
|
-
iconAriaLabel: iconAriaLabel
|
|
24
|
+
iconAriaLabel: iconAriaLabel,
|
|
25
|
+
iconColor: "IconIconOnLightSecondary"
|
|
25
26
|
}), jsxs(BaseInlineNotice.Content, {
|
|
26
|
-
children: [jsxs(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
children: [jsxs(EllipsizableText, {
|
|
28
|
+
as: "div",
|
|
29
|
+
color: "textOnLightDefault",
|
|
30
|
+
lineClamp: 3,
|
|
31
|
+
variant: "bodyDefault",
|
|
32
|
+
children: [jsx("strong", {
|
|
31
33
|
children: title
|
|
32
|
-
}), subtitle
|
|
33
|
-
as: "span",
|
|
34
|
-
color: "textOnLightDefault",
|
|
35
|
-
children: subtitle
|
|
36
|
-
})]
|
|
34
|
+
}), subtitle]
|
|
37
35
|
}), text && jsx(BaseInlineNotice.Content.Body, {
|
|
38
|
-
children: jsx(
|
|
36
|
+
children: jsx(EllipsizableText, {
|
|
39
37
|
as: "span",
|
|
40
38
|
color: "textOnLightSecondary",
|
|
39
|
+
lineClamp: 3,
|
|
41
40
|
children: text
|
|
42
41
|
})
|
|
43
42
|
})]
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { bpSize050, Size5, bpIconIconOnLight, IconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
2
|
+
import { bpSize050, Size5, bpIconIconOnLightSecondary, bpIconIconOnLight, IconIconOnLightSecondary, IconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
3
3
|
import { forwardRef, createElement } from 'react';
|
|
4
4
|
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
5
5
|
import styles from './base-inline-notice.module.js';
|
|
6
6
|
|
|
7
|
+
const IconColorMap = {
|
|
8
|
+
IconIconOnLight,
|
|
9
|
+
IconIconOnLightSecondary
|
|
10
|
+
};
|
|
11
|
+
const IconColorModernizedMap = {
|
|
12
|
+
IconIconOnLight: bpIconIconOnLight,
|
|
13
|
+
IconIconOnLightSecondary: bpIconIconOnLightSecondary
|
|
14
|
+
};
|
|
7
15
|
const BaseInlineNoticeIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
8
16
|
const {
|
|
9
17
|
icon,
|
|
10
18
|
iconAriaLabel,
|
|
19
|
+
iconColor = 'IconIconOnLight',
|
|
11
20
|
...rest
|
|
12
21
|
} = props;
|
|
13
22
|
const {
|
|
@@ -16,8 +25,9 @@ const BaseInlineNoticeIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
16
25
|
if (!icon) {
|
|
17
26
|
return null;
|
|
18
27
|
}
|
|
28
|
+
const color = enableModernizedComponents ? IconColorModernizedMap[iconColor] : IconColorMap[iconColor];
|
|
19
29
|
const iconElement = /*#__PURE__*/createElement(icon, {
|
|
20
|
-
color
|
|
30
|
+
color,
|
|
21
31
|
width: enableModernizedComponents ? bpSize050 : Size5,
|
|
22
32
|
height: enableModernizedComponents ? bpSize050 : Size5,
|
|
23
33
|
'aria-label': iconAriaLabel
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type FunctionComponent, type HTMLAttributes, type PropsWithChildren, type ReactNode, type SVGProps } from 'react';
|
|
2
2
|
import { type BaseButtonProps } from '../base-button';
|
|
3
|
+
export type IconColor = 'IconIconOnLight' | 'IconIconOnLightSecondary';
|
|
3
4
|
export interface BaseInlineNoticeActionsProps {
|
|
4
5
|
/** Child button components for inline notice actions */
|
|
5
6
|
children: ReactNode;
|
|
@@ -21,6 +22,8 @@ export type BaseInlineNoticeIconProps = ComponentPropsWithRef<'span'> & {
|
|
|
21
22
|
icon: FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>> | null;
|
|
22
23
|
/** Icon aria label for accessibility */
|
|
23
24
|
iconAriaLabel: string;
|
|
25
|
+
/** Icon color - defaults to IconIconOnLight */
|
|
26
|
+
iconColor?: IconColor;
|
|
24
27
|
};
|
|
25
28
|
export interface BaseInlineNoticeContentContainerProps {
|
|
26
29
|
/** Optional class name */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.124.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@ariakit/react": "0.4.15",
|
|
49
49
|
"@ariakit/react-core": "0.4.15",
|
|
50
|
-
"@box/blueprint-web-assets": "^4.96.
|
|
50
|
+
"@box/blueprint-web-assets": "^4.96.2",
|
|
51
51
|
"@internationalized/date": "^3.7.0",
|
|
52
52
|
"@radix-ui/react-accordion": "1.1.2",
|
|
53
53
|
"@radix-ui/react-checkbox": "1.0.4",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"type-fest": "^3.2.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@box/storybook-utils": "^0.16.
|
|
80
|
+
"@box/storybook-utils": "^0.16.13",
|
|
81
81
|
"@figma/code-connect": "1.3.12",
|
|
82
82
|
"@types/react": "^18.0.0",
|
|
83
83
|
"@types/react-dom": "^18.0.0",
|