@box/metadata-taxonomy-picker 2.19.7 → 2.20.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.
@@ -24,8 +24,8 @@ import '../styles/taxonomy-menu-item.css';var g = {
24
24
  rowRef: k,
25
25
  selectionControlRef: A,
26
26
  drillDownRef: j
27
- }), L = i(() => {
28
- y ? w(r) : S && T?.(r);
27
+ }), L = i((e) => {
28
+ e?.target?.tagName !== "INPUT" && (y ? w(r) : S && T?.(r));
29
29
  }, [
30
30
  y,
31
31
  S,
@@ -1,4 +1,5 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
+ import { ReactNode } from 'react';
2
3
  import { MetadataTaxonomyPicker } from '../../index';
3
4
  import { MetadataTaxonomyPickerProps, TaxonomyPickerMode, TaxonomyValue } from '../types';
4
5
  declare const _default: {
@@ -14,7 +15,7 @@ declare const _default: {
14
15
  levels?: import('../types').TaxonomyLevel[] | undefined;
15
16
  placeholder?: string | undefined;
16
17
  disabled?: boolean | undefined;
17
- label?: string | undefined;
18
+ label?: ReactNode;
18
19
  containerClassName?: string | undefined;
19
20
  portalElement?: (HTMLElement | (() => HTMLElement | null) | null) | undefined;
20
21
  ref?: import('react').LegacyRef<HTMLInputElement> | undefined;
@@ -33,7 +33,7 @@ declare const _default: {
33
33
  levels?: TaxonomyLevel[] | undefined;
34
34
  placeholder?: string | undefined;
35
35
  disabled?: boolean | undefined;
36
- label?: string | undefined;
36
+ label?: import('react').ReactNode;
37
37
  containerClassName?: string | undefined;
38
38
  portalElement?: (HTMLElement | (() => HTMLElement | null) | null) | undefined;
39
39
  ref?: import('react').LegacyRef<HTMLInputElement> | undefined;
@@ -22,7 +22,7 @@ declare const _default: {
22
22
  levels?: import('../../types').TaxonomyLevel[] | undefined;
23
23
  placeholder?: string | undefined;
24
24
  disabled?: boolean | undefined;
25
- label?: string | undefined;
25
+ label?: import('react').ReactNode;
26
26
  containerClassName?: string | undefined;
27
27
  portalElement?: (HTMLElement | (() => HTMLElement | null) | null) | undefined;
28
28
  ref?: import('react').LegacyRef<HTMLInputElement> | undefined;
@@ -22,7 +22,7 @@ declare const _default: {
22
22
  levels?: import('../../types').TaxonomyLevel[] | undefined;
23
23
  placeholder?: string | undefined;
24
24
  disabled?: boolean | undefined;
25
- label?: string | undefined;
25
+ label?: import('react').ReactNode;
26
26
  containerClassName?: string | undefined;
27
27
  portalElement?: (HTMLElement | (() => HTMLElement | null) | null) | undefined;
28
28
  ref?: import('react').LegacyRef<HTMLInputElement> | undefined;
@@ -33,7 +33,7 @@ declare const _default: {
33
33
  levels?: import('../../types').TaxonomyLevel[] | undefined;
34
34
  placeholder?: string | undefined;
35
35
  disabled?: boolean | undefined;
36
- label?: string | undefined;
36
+ label?: import('react').ReactNode;
37
37
  containerClassName?: string | undefined;
38
38
  portalElement?: (HTMLElement | (() => HTMLElement | null) | null) | undefined;
39
39
  ref?: import('react').LegacyRef<HTMLInputElement> | undefined;
@@ -33,7 +33,7 @@ declare const _default: {
33
33
  levels?: import('../../types').TaxonomyLevel[] | undefined;
34
34
  placeholder?: string | undefined;
35
35
  disabled?: boolean | undefined;
36
- label?: string | undefined;
36
+ label?: import('react').ReactNode;
37
37
  containerClassName?: string | undefined;
38
38
  portalElement?: (HTMLElement | (() => HTMLElement | null) | null) | undefined;
39
39
  ref?: import('react').LegacyRef<HTMLInputElement> | undefined;
@@ -1,4 +1,5 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
+ import { ReactNode } from 'react';
2
3
  import { MetadataTaxonomyPicker } from '../../../index';
3
4
  import { MetadataTaxonomyPickerProps, TaxonomyPickerMode, TaxonomyValue } from '../../types';
4
5
  declare const _default: {
@@ -25,7 +26,7 @@ declare const _default: {
25
26
  levels?: import('../../types').TaxonomyLevel[] | undefined;
26
27
  placeholder?: string | undefined;
27
28
  disabled?: boolean | undefined;
28
- label?: string | undefined;
29
+ label?: ReactNode;
29
30
  containerClassName?: string | undefined;
30
31
  portalElement?: (HTMLElement | (() => HTMLElement | null) | null) | undefined;
31
32
  ref?: import('react').LegacyRef<HTMLInputElement> | undefined;
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface TaxonomyNode {
2
3
  id: string;
3
4
  displayName: string;
@@ -85,8 +86,12 @@ export interface MetadataTaxonomyPickerProps {
85
86
  * combobox input via `htmlFor` for accessibility. When omitted, no label
86
87
  * element is rendered — the caller is then responsible for providing an
87
88
  * accessible name via `aria-label` / `aria-labelledby` on the picker.
89
+ *
90
+ * Accepts a `ReactNode` so callers can compose decorated labels (badges,
91
+ * tooltips, etc.). The picker owns the wrapping `<label htmlFor>` element,
92
+ * so the node MUST NOT render its own `<label>` (nested labels are invalid).
88
93
  */
89
- label?: string;
94
+ label?: ReactNode;
90
95
  /**
91
96
  * CSS class applied to the outermost container element.
92
97
  * Intended for layout adjustments (margin, width, grid placement) only —
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@box/metadata-taxonomy-picker",
3
- "version": "2.19.7",
3
+ "version": "2.20.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@ariakit/react": "^0.4.21",
7
- "@box/blueprint-web": "^15.9.2",
8
- "@box/blueprint-web-assets": "^4.127.0",
7
+ "@box/blueprint-web": "^15.9.3",
8
+ "@box/blueprint-web-assets": "^4.128.0",
9
9
  "@tanstack/react-virtual": "^3.10.8",
10
10
  "react": "^18.0.0",
11
11
  "react-dom": "^18.0.0",
@@ -13,10 +13,10 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@ariakit/react": "^0.4.21",
16
- "@box/blueprint-web": "^15.9.2",
17
- "@box/blueprint-web-assets": "^4.127.0",
16
+ "@box/blueprint-web": "^15.9.3",
17
+ "@box/blueprint-web-assets": "^4.128.0",
18
18
  "@box/eslint-plugin-blueprint": "1.2.7",
19
- "@box/storybook-utils": "0.21.7",
19
+ "@box/storybook-utils": "0.21.8",
20
20
  "@tanstack/react-virtual": "^3.10.8",
21
21
  "react-intl": "^6.4.2"
22
22
  },