@box/blueprint-web 14.40.0 → 14.41.1
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/avatar/avatar.module.js +1 -1
- package/dist/lib-esm/combobox/combobox.js +32 -8
- package/dist/lib-esm/combobox/combobox.module.js +1 -1
- package/dist/lib-esm/combobox/types.d.ts +9 -0
- package/dist/lib-esm/index.css +304 -258
- package/dist/lib-esm/primitives/base-button/base-button.module.js +1 -1
- package/dist/lib-esm/primitives/base-text-input/base-text-input.js +29 -3
- package/dist/lib-esm/primitives/base-text-input/base-text-input.module.js +1 -1
- package/dist/lib-esm/primitives/base-text-input/types.d.ts +8 -0
- package/dist/lib-esm/status/status.module.js +1 -1
- package/dist/lib-esm/text-input/text-input.d.ts +2 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../index.css';
|
|
2
|
-
var styles = {"button":"bp_base_button_module_button--
|
|
2
|
+
var styles = {"button":"bp_base_button_module_button--d2a29","primary":"bp_base_button_module_primary--d2a29","secondary":"bp_base_button_module_secondary--d2a29","tertiary":"bp_base_button_module_tertiary--d2a29","quaternary":"bp_base_button_module_quaternary--d2a29","tertiary-destructive":"bp_base_button_module_tertiary-destructive--d2a29","destructive":"bp_base_button_module_destructive--d2a29","outline":"bp_base_button_module_outline--d2a29","small":"bp_base_button_module_small--d2a29","isIconButton":"bp_base_button_module_isIconButton--d2a29","isTextWithIconEndButton":"bp_base_button_module_isTextWithIconEndButton--d2a29","isTextWithIconStartButton":"bp_base_button_module_isTextWithIconStartButton--d2a29","isTextWithStartAndEndIconButton":"bp_base_button_module_isTextWithStartAndEndIconButton--d2a29","x-small":"bp_base_button_module_x-small--d2a29","large":"bp_base_button_module_large--d2a29","icon":"bp_base_button_module_icon--d2a29","hide":"bp_base_button_module_hide--d2a29"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { AlertBadge } from '@box/blueprint-web-assets/icons/Fill';
|
|
3
|
+
import { AlertCircle } from '@box/blueprint-web-assets/icons/Medium';
|
|
4
|
+
import { IconIconErrorOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
2
5
|
import clsx from 'clsx';
|
|
3
6
|
import { forwardRef, useState, useMemo, cloneElement } from 'react';
|
|
4
7
|
import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
|
|
8
|
+
import { Focusable } from '../../focusable/focusable.js';
|
|
5
9
|
import { Text } from '../../text/text.js';
|
|
10
|
+
import { Tooltip } from '../../tooltip/tooltip.js';
|
|
6
11
|
import { useLabelable } from '../../util-components/labelable/useLabelable.js';
|
|
7
12
|
import { useUniqueId } from '../../utils/useUniqueId.js';
|
|
13
|
+
import { VisuallyHidden } from '../../visually-hidden/visually-hidden.js';
|
|
8
14
|
import { InlineError } from '../inline-error/inline-error.js';
|
|
9
15
|
import styles from './base-text-input.module.js';
|
|
10
16
|
|
|
@@ -29,6 +35,7 @@ const BaseTextInput = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
29
35
|
hideLabel,
|
|
30
36
|
readOnly,
|
|
31
37
|
error,
|
|
38
|
+
errorVariant = 'default',
|
|
32
39
|
required = false,
|
|
33
40
|
endIcon,
|
|
34
41
|
startIcon,
|
|
@@ -99,8 +106,27 @@ const BaseTextInput = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
99
106
|
readOnly: readOnly,
|
|
100
107
|
required: required,
|
|
101
108
|
type: type
|
|
102
|
-
}),
|
|
103
|
-
|
|
109
|
+
}), errorVariant === 'inline' && hasError ? jsxs(Fragment, {
|
|
110
|
+
children: [jsx(Tooltip, {
|
|
111
|
+
content: error,
|
|
112
|
+
side: "top",
|
|
113
|
+
variant: "error",
|
|
114
|
+
children: jsx(Focusable, {
|
|
115
|
+
ref: setValueUsing(setEndIconWidth),
|
|
116
|
+
"aria-labelledby": inlineErrorId,
|
|
117
|
+
className: clsx(styles.endIcon, styles.inlineErrorIcon),
|
|
118
|
+
children: enableModernizedComponents ? jsx(AlertCircle, {
|
|
119
|
+
color: IconIconErrorOnLight
|
|
120
|
+
}) : jsx(AlertBadge, {
|
|
121
|
+
color: IconIconErrorOnLight
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
}), jsx(VisuallyHidden, {
|
|
125
|
+
id: inlineErrorId,
|
|
126
|
+
children: error
|
|
127
|
+
})]
|
|
128
|
+
}) : EndIconComponent]
|
|
129
|
+
}), errorVariant === 'default' && hasError ? jsx(InlineError, {
|
|
104
130
|
className: styles.inlineError,
|
|
105
131
|
id: inlineErrorId,
|
|
106
132
|
children: error
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../index.css';
|
|
2
|
-
var styles = {"textInputContainerOuter":"bp_base_text_input_module_textInputContainerOuter--
|
|
2
|
+
var styles = {"textInputContainerOuter":"bp_base_text_input_module_textInputContainerOuter--8494e","label":"bp_base_text_input_module_label--8494e","textInputContainer":"bp_base_text_input_module_textInputContainer--8494e","textInput":"bp_base_text_input_module_textInput--8494e","hidden":"bp_base_text_input_module_hidden--8494e","error":"bp_base_text_input_module_error--8494e","readOnly":"bp_base_text_input_module_readOnly--8494e","endIcon":"bp_base_text_input_module_endIcon--8494e","startIcon":"bp_base_text_input_module_startIcon--8494e","inlineErrorIcon":"bp_base_text_input_module_inlineErrorIcon--8494e","disabled":"bp_base_text_input_module_disabled--8494e","inlineError":"bp_base_text_input_module_inlineError--8494e","subtext":"bp_base_text_input_module_subtext--8494e"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Labelable } from '../../util-components/labelable/types';
|
|
2
|
+
export type ErrorVariant = 'default' | 'inline';
|
|
2
3
|
export type BaseTextInputProps = React.ComponentPropsWithRef<'input'> & Labelable & {
|
|
3
4
|
/** Input type, defaults to 'text' */
|
|
4
5
|
type?: 'text' | 'password';
|
|
@@ -16,6 +17,13 @@ export type BaseTextInputProps = React.ComponentPropsWithRef<'input'> & Labelabl
|
|
|
16
17
|
required?: boolean;
|
|
17
18
|
/** Content of error message */
|
|
18
19
|
error?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Controls how the error is displayed.
|
|
22
|
+
* 'default' renders an inline error message below the input.
|
|
23
|
+
* 'inline' renders an error icon inside the input that shows the error in a tooltip on hover.
|
|
24
|
+
* @default 'default'
|
|
25
|
+
*/
|
|
26
|
+
errorVariant?: ErrorVariant;
|
|
19
27
|
/**
|
|
20
28
|
* Custom icon to be rendered after the input
|
|
21
29
|
* When loading is true and input is not disabled prop value will be ignored
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"
|
|
2
|
+
var styles = {"status":"bp_status_module_status--d29f3","reverse":"bp_status_module_reverse--d29f3","circle":"bp_status_module_circle--d29f3","text":"bp_status_module_text--d29f3","maxContainer":"bp_status_module_maxContainer--d29f3","interactiveStatus":"bp_status_module_interactiveStatus--d29f3","colorSurfaceStatusSurfaceGray":"bp_status_module_colorSurfaceStatusSurfaceGray--d29f3","colorSurfaceStatusSurfaceYellow":"bp_status_module_colorSurfaceStatusSurfaceYellow--d29f3","colorSurfaceStatusSurfaceOrange":"bp_status_module_colorSurfaceStatusSurfaceOrange--d29f3","colorSurfaceStatusSurfaceRed":"bp_status_module_colorSurfaceStatusSurfaceRed--d29f3","colorSurfaceStatusSurfacePurple":"bp_status_module_colorSurfaceStatusSurfacePurple--d29f3","colorSurfaceStatusSurfaceLightBlue":"bp_status_module_colorSurfaceStatusSurfaceLightBlue--d29f3","colorSurfaceStatusSurfaceDarkBlue":"bp_status_module_colorSurfaceStatusSurfaceDarkBlue--d29f3","colorSurfaceStatusSurfaceGreen":"bp_status_module_colorSurfaceStatusSurfaceGreen--d29f3"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -7,6 +7,7 @@ export declare const TextInput: import("react").ForwardRefExoticComponent<(Omit<
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
required?: boolean;
|
|
9
9
|
error?: React.ReactNode;
|
|
10
|
+
errorVariant?: import("../primitives/base-text-input/types").ErrorVariant;
|
|
10
11
|
endIcon?: React.ReactElement;
|
|
11
12
|
startIcon?: React.ReactElement;
|
|
12
13
|
subtext?: string;
|
|
@@ -19,6 +20,7 @@ export declare const TextInput: import("react").ForwardRefExoticComponent<(Omit<
|
|
|
19
20
|
disabled?: boolean;
|
|
20
21
|
required?: boolean;
|
|
21
22
|
error?: React.ReactNode;
|
|
23
|
+
errorVariant?: import("../primitives/base-text-input/types").ErrorVariant;
|
|
22
24
|
endIcon?: React.ReactElement;
|
|
23
25
|
startIcon?: React.ReactElement;
|
|
24
26
|
subtext?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.41.1",
|
|
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.21",
|
|
49
49
|
"@ariakit/react-core": "0.4.21",
|
|
50
|
-
"@box/blueprint-web-assets": "^4.
|
|
50
|
+
"@box/blueprint-web-assets": "^4.121.1",
|
|
51
51
|
"@internationalized/date": "^3.12.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.
|
|
80
|
+
"@box/storybook-utils": "^0.20.1",
|
|
81
81
|
"@figma/code-connect": "1.4.4",
|
|
82
82
|
"@types/react": "^18.0.0",
|
|
83
83
|
"@types/react-dom": "^18.0.0",
|