@box/blueprint-web 12.116.2 → 12.117.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.
@@ -83,6 +83,7 @@ const RootInner = ({
83
83
  endComboboxIcon,
84
84
  idForLabel,
85
85
  displaySingleSelectionAsChip = multiselect,
86
+ autoComplete,
86
87
  ...comboboxProps
87
88
  } = rest;
88
89
  const isInput = useMemo(() => as === 'input', [as]);
@@ -339,6 +340,14 @@ const RootInner = ({
339
340
  const ariaDescribedBy = clsx(rest['aria-describedby'], {
340
341
  [inlineErrorId]: hasError
341
342
  });
343
+ // Ariakit sets autoComplete="off" by default on the input element.
344
+ // We need to force update it if the user provided a custom value.
345
+ useEffect(() => {
346
+ const element = inputRef.current;
347
+ if (element && autoComplete) {
348
+ element.setAttribute('autocomplete', autoComplete);
349
+ }
350
+ }, [autoComplete]);
342
351
  const inputComponent = isInput ? jsxs(Fragment, {
343
352
  children: [jsx(Label, {
344
353
  className: clsx(styles.label, {
@@ -241,6 +241,12 @@ export interface ComboboxBaseProps<Multiple extends boolean, FreeInput extends b
241
241
  * @default false
242
242
  */
243
243
  selectOnEnterOrTab?: boolean;
244
+ /**
245
+ * If `off`, the combobox disables autofill suggestions from the browser.
246
+ *
247
+ * @default none
248
+ */
249
+ autoComplete?: string;
244
250
  }
245
251
  export type ComboboxTextArea = Pick<TextAreaProps, 'maxRows' | 'minRows' | 'maxLength' | 'aria-describedby'> & {
246
252
  as: 'textarea';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "12.116.2",
3
+ "version": "12.117.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.93.3",
50
+ "@box/blueprint-web-assets": "^4.93.4",
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.1",
80
+ "@box/storybook-utils": "^0.16.2",
81
81
  "@types/react": "^18.0.0",
82
82
  "@types/react-dom": "^18.0.0",
83
83
  "react": "^18.3.0",