An open source design system that's fully customizable and agent ready
TypeScript
feat(core)!: remove emptySearchResultsText (CLN-0001–CLN-0004) (#7289)
Cindy Zhang3045edad62d5
diff --git a/.changeset/remove-empty-search-results-text.md b/.changeset/remove-empty-search-results-text.mdnew file mode 100644index 0000000000..eb5145c0d9--- /dev/null+++ b/.changeset/remove-empty-search-results-text.md@@ -0,0 +1,20 @@+---+'@astryxdesign/core': minor+---++[breaking] Remove the deprecated `emptySearchResultsText` prop. Use `emptySearchText`.+@cixzhang++CLN-0001, CLN-0002, CLN-0003, and CLN-0004 complete DEP-0001 through DEP-0004 (spec:AST-056 FR7).++Old usage:+`emptySearchResultsText` on `Tokenizer`, `Typeahead`, and `BaseTypeahead`, and the `emptySearchResultsText` key on a `ChatComposerInput` trigger.++Replacement:+`emptySearchText`, shipped in 0.6.6. It takes a `ReactNode`, so every old string value stays valid. The old name is no longer in the types and is no longer read; a JavaScript caller that still passes it sees the default empty message.++Migration:+Rename `emptySearchResultsText` to `emptySearchText`. Where both are set, keep `emptySearchText` and delete the old one — unless `emptySearchText` could be `null` or `undefined`: 0.6.x then fell back to the old value, so move that value into `emptySearchText` (for example `emptySearchText={value ?? 'Old copy'}`).++Codemod:+`astryx upgrade` runs `rename-empty-search-results-text`, a straight rename at the JSX boundary: the prop on imported `Tokenizer`, `Typeahead`, and `BaseTypeahead` elements, and the key on trigger objects written inline in `ChatComposerInput`'s `triggers`, each renamed as written. Like every Astryx codemod it does not follow variables, helpers, spreads, wrappers, or types; where it cannot attribute the value — `emptySearchText` already set, any spread onto one of these elements (whether or not the element writes the old name), a `triggers` value not written inline, a trigger object with a spread or computed key (whether or not it writes the old name) — it leaves a TODO instead of choosing a winner. The type checker reports any literal `emptySearchResultsText` it did not reach; the TODOs cover the values that reach an element through a spread, which it cannot.\ No newline at end of filediff --git a/.changeset/rename-empty-search-results-text-codemod.md b/.changeset/rename-empty-search-results-text-codemod.mdnew file mode 100644index 0000000000..3d8081377f--- /dev/null+++ b/.changeset/rename-empty-search-results-text-codemod.md@@ -0,0 +1,6 @@+---+'@astryxdesign/cli': patch+---++[feat] `astryx upgrade` renames `emptySearchResultsText` to `emptySearchText` on `Tokenizer`, `Typeahead`, `BaseTypeahead`, and `ChatComposerInput` trigger objects, for the release that removes the old name.+@cixzhangdiff --git a/packages/cli/assets/codemods/transforms/next/__tests__/rename-empty-search-results-text.test.mjs b/packages/cli/assets/codemods/transforms/next/__tests__/rename-empty-search-results-text.test.mjsnew file mode 100644index 0000000000..cbf0854cea--- /dev/null+++ b/packages/cli/assets/codemods/transforms/next/__tests__/rename-empty-search-results-text.test.mjs@@ -0,0 +1,202 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++import {describe, expect, it} from 'vitest';+import transform from '../rename-empty-search-results-text.mjs';+import manifest from '../index.mjs';++async function applyTransform(source) {+ const jscodeshift = (await import('jscodeshift')).default;+ const j = jscodeshift.withParser('tsx');+ const api = {jscodeshift: j, stats: () => {}, report: () => {}};+ return transform({source, path: 'test.tsx'}, api) ?? source;+}++describe('rename-empty-search-results-text', () => {+ it('is staged in the next-release manifest', () => {+ expect(manifest.map(entry => entry.name)).toContain(+ 'rename-empty-search-results-text',+ );+ });++ describe('JSX props', () => {+ it('renames the prop on Tokenizer, Typeahead, and BaseTypeahead', async () => {+ const output =+ await applyTransform(`import {BaseTypeahead, Tokenizer, Typeahead} from '@astryxdesign/core';+const a = <Tokenizer label="People" emptySearchResultsText="Nobody found" />;+const b = <Typeahead label="Fruit" emptySearchResultsText={copy.empty} />;+const c = <BaseTypeahead emptySearchResultsText={'None'} />;`);++ expect(output).toContain(+ '<Tokenizer label="People" emptySearchText="Nobody found" />',+ );+ expect(output).toContain(+ '<Typeahead label="Fruit" emptySearchText={copy.empty} />',+ );+ expect(output).toContain("<BaseTypeahead emptySearchText={'None'} />");+ expect(output).not.toContain('emptySearchResultsText');+ });++ it('follows aliases, namespaces, and subpath default imports', async () => {+ const output =+ await applyTransform(`import {Tokenizer as People} from '@astryxdesign/core';+import * as Astryx from '@astryxdesign/core';+import Typeahead from '@astryxdesign/core/Typeahead';+const a = <People emptySearchResultsText="x" />;+const b = <Astryx.BaseTypeahead emptySearchResultsText="y" />;+const c = <Typeahead emptySearchResultsText="z" />;`);++ expect(output).not.toContain('emptySearchResultsText');+ expect(output.match(/emptySearchText=/g)).toHaveLength(3);+ });++ it('renames the value as written, whatever shape it has', async () => {+ const output =+ await applyTransform(`import {Tokenizer} from '@astryxdesign/core';+const a = <Tokenizer emptySearchResultsText={compact ? 'None' : 'No matches'} />;+const b = <Tokenizer emptySearchResultsText={props.text ?? null} />;+const c = <Tokenizer {...props} emptySearchResultsText="After a spread" />;`);++ expect(output).toContain(+ "emptySearchText={compact ? 'None' : 'No matches'}",+ );+ expect(output).toContain('emptySearchText={props.text ?? null}');+ // A spread may carry either name, so the element gets a TODO instead.+ expect(output).toContain('{...props} /* TODO(astryx upgrade)');+ expect(output).toContain('emptySearchResultsText="After a spread"');+ expect(output).toContain('spreads props that may carry either name');+ expect(output.match(/emptySearchResultsText/g)).toHaveLength(2);+ });++ it('leaves a TODO instead of choosing when emptySearchText is already set', async () => {+ const output =+ await applyTransform(`import {Typeahead} from '@astryxdesign/core';+const a = <Typeahead emptySearchResultsText="Old copy" emptySearchText="New copy" />;`);++ expect(output).toContain('TODO(astryx upgrade)');+ expect(output).toContain('emptySearchResultsText="Old copy"');+ expect(output).toContain('emptySearchText="New copy"');+ expect(await applyTransform(output)).toBe(output);+ });++ it('leaves other packages, other components, and shadowed names alone', async () => {+ const source = `import {MobileTokenizer} from '@astryxdesign/lab';+import {Selector} from '@astryxdesign/core';+import {Tokenizer} from './my-tokenizer';+const a = <MobileTokenizer emptySearchResultsText="kept" />;+const b = <Selector emptySearchResultsText="kept" />;+const c = <Tokenizer emptySearchResultsText="kept" />;`;+ expect(await applyTransform(source)).toBe(source);+ });++ it('is idempotent', async () => {+ const once =+ await applyTransform(`import {Tokenizer} from '@astryxdesign/core';+const a = <Tokenizer emptySearchResultsText="Nobody found" />;`);+ expect(await applyTransform(once)).toBe(once);+ });+ });++ describe('ChatComposerInput trigger objects', () => {+ it('renames the key on triggers written inline, in an array or alone', async () => {+ const output =+ await applyTransform(`import {ChatComposerInput} from '@astryxdesign/core';+const a = (+ <ChatComposerInput+ triggers={[+ {char: '@', searchSource, onSelect, emptySearchResultsText: 'Nobody found'},+ {char: '#', emptySearchResultsText: 'No tags'} as ChatComposerTrigger,+ ]}+ />+);+const b = <ChatComposerInput triggers={{char: '/', emptySearchResultsText: 'No commands'}} />;`);++ expect(output).toContain("emptySearchText: 'Nobody found'");+ expect(output).toContain("emptySearchText: 'No tags'");+ expect(output).toContain("emptySearchText: 'No commands'");+ expect(output).not.toContain('emptySearchResultsText');+ });++ it('leaves a TODO on a trigger with a spread or computed key, or one that already sets the new name', async () => {+ const output =+ await applyTransform(`import {ChatComposerInput} from '@astryxdesign/core';+const a = (+ <ChatComposerInput+ triggers={[+ {...base, emptySearchResultsText: 'Nobody'},+ {[key]: 1, emptySearchResultsText: 'Nobody'},+ {char: '@', emptySearchText: 'New', emptySearchResultsText: 'Old'},+ ]}+ />+);`);++ expect(output.match(/TODO\(astryx upgrade\)/g)).toHaveLength(3);+ expect(output.match(/emptySearchResultsText:/g)).toHaveLength(3);+ expect(await applyTransform(output)).toBe(output);+ });++ it('leaves a TODO on triggers it cannot read instead of following them', async () => {+ const output =+ await applyTransform(`import {ChatComposerInput} from '@astryxdesign/core';+import {mentionTrigger} from './triggers';+const local = {char: '@', emptySearchResultsText: 'Nobody'};+const a = <ChatComposerInput triggers={[local, mentionTrigger]} />;+const b = <ChatComposerInput triggers={buildTriggers()} />;+const c = <ChatComposerInput triggers={useMemo(() => [t], [t])} />;+const d = <ChatComposerInput {...props} triggers={[{char: '#', emptySearchResultsText: 'No tags'}]} />;`);++ expect(output.match(/These triggers are built elsewhere/g)).toHaveLength(+ 4,+ );+ // The inline object beside a spread is still renamed; the spread is flagged.+ expect(output).toContain("emptySearchText: 'No tags'");+ expect(output).toContain("emptySearchResultsText: 'Nobody'");+ expect(await applyTransform(output)).toBe(output);+ });++ it('marks every spread onto these elements, even when the element writes neither name', async () => {+ const output =+ await applyTransform(`import {Tokenizer, Typeahead, ChatComposerInput} from '@astryxdesign/core';+import {Selector} from '@astryxdesign/core';+const people = {emptySearchResultsText: 'No people match'};+export function Wrappers(props) {+ return (+ <>+ <Tokenizer {...people} />+ <Typeahead {...{emptySearchResultsText: 'Inline'}} />+ <Tokenizer {...props} label="x" />+ <ChatComposerInput {...props} />+ <Selector {...props} />+ <Tokenizer {...props} emptySearchText="already new" />+ </>+ );+}`);++ expect(+ output.match(/spreads props that may carry either name/g),+ ).toHaveLength(4);+ expect(output.match(/These triggers are built elsewhere/g)).toHaveLength(+ 1,+ );+ expect(output).toContain('<Selector {...props} />');+ expect(await applyTransform(output)).toBe(output);+ });++ it('marks an inline trigger object whose keys come only from a spread, once across runs', async () => {+ const once =+ await applyTransform(`import {ChatComposerInput} from '@astryxdesign/core';+const a = <ChatComposerInput triggers={[{...baseMention, onSelect}, {[key]: 1, onSelect}]} />;`);++ expect(once.match(/has a spread or computed key/g)).toHaveLength(2);+ const twice = await applyTransform(once);+ expect(twice).toBe(once);+ expect(twice.match(/TODO\(astryx upgrade\)/g)).toHaveLength(2);+ });++ it('leaves a file with no runtime core import alone', async () => {+ const source = `import {MobileTokenizer} from '@astryxdesign/lab';+const copy = {emptySearchResultsText: 'kept'};+const a = <MobileTokenizer {...copy} />;`;+ expect(await applyTransform(source)).toBe(source);+ });+ });+});diff --git a/packages/cli/assets/codemods/transforms/next/index.mjs b/packages/cli/assets/codemods/transforms/next/index.mjsindex 255f6217e0..2accda6527 100644--- a/packages/cli/assets/codemods/transforms/next/index.mjs+++ b/packages/cli/assets/codemods/transforms/next/index.mjs@@ -16,6 +16,9 @@ import migrateFieldInputStyling, {import preserveBottomSheetContentPadding, {meta as preserveBottomSheetContentPaddingMeta,} from './preserve-bottom-sheet-content-padding.mjs';+import renameEmptySearchResultsText, {+ meta as renameEmptySearchResultsTextMeta,+} from './rename-empty-search-results-text.mjs';import validateDataTokenOwnership, {meta as validateDataTokenOwnershipMeta,} from './validate-data-token-ownership.mjs';@@ -41,4 +44,9 @@ export default [transform: preserveBottomSheetContentPadding,meta: preserveBottomSheetContentPaddingMeta,},+ {+ name: 'rename-empty-search-results-text',+ transform: renameEmptySearchResultsText,+ meta: renameEmptySearchResultsTextMeta,+ },];diff --git a/packages/cli/assets/codemods/transforms/next/rename-empty-search-results-text.mjs b/packages/cli/assets/codemods/transforms/next/rename-empty-search-results-text.mjsnew file mode 100644index 0000000000..1afeba876b--- /dev/null+++ b/packages/cli/assets/codemods/transforms/next/rename-empty-search-results-text.mjs@@ -0,0 +1,254 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file Codemod: rename emptySearchResultsText to emptySearchText+ *+ * `emptySearchResultsText` was renamed to `emptySearchText` (`spec:AST-056`+ * FR1) and the old name is removed in a minor release. The new prop takes a+ * `ReactNode`, so every old `string` value stays valid and the rename never+ * changes a value.+ *+ * A straight rename at the JSX boundary, through the shared `transformProp`+ * helper: the prop on an imported `Tokenizer`, `Typeahead`, or `BaseTypeahead`+ * element, and the key on `ChatComposerInput` trigger objects written inline+ * in its `triggers` prop. Like every transform built on the helper it does+ * not follow variables, helpers, spreads, wrappers, or types. Where it cannot+ * attribute the value it leaves a TODO instead of choosing a winner: the new+ * name already set, any spread onto one of these elements (whether or not the+ * element writes the old name itself — a spread may carry either name or the+ * triggers), a `triggers` value that is not an inline object or array, or a+ * trigger object with a spread or computed key. A value forwarded through a+ * spread is the one case the type checker cannot report after the removal,+ * which is why every spread gets the TODO.+ */++import {transformProp} from '../../transform-prop.mjs';++export const meta = {+ title: 'Rename emptySearchResultsText to emptySearchText',+ description:+ 'Renames the removed `emptySearchResultsText` prop to `emptySearchText` ' ++ 'on imported Tokenizer, Typeahead, and BaseTypeahead elements, and the ' ++ "same key on trigger objects written inline in ChatComposerInput's " ++ '`triggers`. Leaves a TODO where the new name is already set, on every ' ++ 'spread onto these elements, where the triggers value is not written ' ++ 'inline, and on a trigger object with a spread or computed key.',+};++const OLD_NAME = 'emptySearchResultsText';+const NEW_NAME = 'emptySearchText';+const CORE_IMPORT_RE = /^@(astryxdesign|xds)\/core(?:\/|$)/;++const COMPONENTS = new Map([+ ['Tokenizer', new Set([OLD_NAME])],+ ['Typeahead', new Set([OLD_NAME])],+ ['BaseTypeahead', new Set([OLD_NAME])],+ ['ChatComposerInput', new Set(['triggers'])],+]);++const BOTH_SET_COMMENT =+ ' TODO(astryx upgrade): emptySearchResultsText was removed and ' ++ 'emptySearchText is already set here; delete the old one if the new value ' ++ 'is what you want. ';+const UNREADABLE_OBJECT_COMMENT =+ ' TODO(astryx upgrade): emptySearchResultsText was removed. Rename it to ' ++ 'emptySearchText by hand; this object has a spread or computed key. ';+const SPREAD_COMMENT =+ ' TODO(astryx upgrade): emptySearchResultsText was removed. This element ' ++ 'spreads props that may carry either name; rename to emptySearchText ' ++ 'where the props are built and delete the old one. ';+const OPAQUE_TRIGGERS_COMMENT =+ ' TODO(astryx upgrade): emptySearchResultsText was removed. These triggers ' ++ 'are built elsewhere; rename the key to emptySearchText where they are ' ++ 'built. ';++const TYPE_WRAPPERS = new Set([+ 'TSAsExpression',+ 'TSSatisfiesExpression',+ 'TSTypeAssertion',+ 'TSNonNullExpression',+ 'TypeCastExpression',+ 'ParenthesizedExpression',+]);++/** @param {any} node */+function unwrap(node) {+ let current = node;+ while (current && TYPE_WRAPPERS.has(current.type)) {+ current = current.expression;+ }+ return current;+}++/** @param {any} property */+function staticPropertyName(property) {+ if (property.computed) return null;+ const key = property.key;+ if (key?.type === 'Identifier') return key.name;+ if (key?.type === 'StringLiteral' || key?.type === 'Literal') {+ return typeof key.value === 'string' ? key.value : null;+ }+ return null;+}++/**+ * Attach a comment to a node once (re-running the codemod adds nothing).+ * @param {any} j @param {any} node @param {string} text+ */+function addComment(j, node, text) {+ node.comments ??= [];+ if (node.comments.some((/** @type {any} */ c) => c.value === text)) {+ return false;+ }+ node.comments.push(j.commentBlock(text, true, false));+ return true;+}++/**+ * Rename the key on one trigger object literal.+ * @param {any} j @param {any} object @returns {boolean}+ */+function renameTriggerKey(j, object) {+ const old = object.properties.find(+ (/** @type {any} */ property) => staticPropertyName(property) === OLD_NAME,+ );+ const unreadable = object.properties.find(+ (/** @type {any} */ property) =>+ property.type === 'SpreadElement' ||+ property.type === 'SpreadProperty' ||+ property.computed,+ );+ // A spread or computed key may carry the removed key itself, so the+ // object gets the TODO whether or not it writes the old name.+ if (unreadable) {+ return addComment(j, old ?? unreadable, UNREADABLE_OBJECT_COMMENT);+ }+ if (!old) return false;+ const already = object.properties.some(+ (/** @type {any} */ property) => staticPropertyName(property) === NEW_NAME,+ );+ if (already) return addComment(j, old, BOTH_SET_COMMENT);+ old.key = j.identifier(NEW_NAME);+ if (old.shorthand) old.shorthand = false;+ return true;+}++/** @param {any} fileInfo @param {any} api */+export default function transform(fileInfo, api) {+ const j = api.jscodeshift;+ const root = j(fileInfo.source);+ let changed = false;++ transformProp(+ root,+ j,+ {+ matchesImport: source => CORE_IMPORT_RE.test(source),+ components: COMPONENTS,+ },+ (propPath, {component}) => {+ const prop = propPath.node;+ const attributes = propPath.parent.node.attributes ?? [];+ const hasSpread = attributes.some(+ (/** @type {any} */ attribute) =>+ attribute.type === 'JSXSpreadAttribute',+ );+ if (component === 'ChatComposerInput') {+ // `triggers={[{...}, {...}]}` or `triggers={{...}}`: rename the key+ // on each object written inline; a value built elsewhere, or an+ // element whose spread may carry triggers, gets a TODO.+ const value =+ prop.value?.type === 'JSXExpressionContainer'+ ? unwrap(prop.value.expression)+ : null;+ const items =+ value?.type === 'ArrayExpression'+ ? value.elements.map((/** @type {any} */ e) => unwrap(e))+ : [value];+ let opaque = hasSpread;+ for (const item of items) {+ if (item?.type === 'ObjectExpression') {+ changed = renameTriggerKey(j, item) || changed;+ } else {+ opaque = true;+ }+ }+ if (opaque) {+ changed = addComment(j, prop, OPAQUE_TRIGGERS_COMMENT) || changed;+ }+ return;+ }+ if (hasSpread) {+ changed = addComment(j, prop, SPREAD_COMMENT) || changed;+ return;+ }+ const already = attributes.some(+ (/** @type {any} */ attribute) =>+ attribute.type === 'JSXAttribute' &&+ attribute.name?.name === NEW_NAME,+ );+ if (already) {+ changed = addComment(j, prop, BOTH_SET_COMMENT) || changed;+ return;+ }+ prop.name.name = NEW_NAME;+ changed = true;+ },+ );++ // Every spread onto one of these elements that the prop pass did not reach+ // (the element writes neither the old name nor, for ChatComposerInput,+ // `triggers`): the spread may carry the removed key, so it gets the TODO.+ for (const [component, props] of COMPONENTS) {+ const sentinel = `__astryx_spread_${component}`;+ root+ .find(j.JSXOpeningElement)+ .filter((/** @type {any} */ path) =>+ (path.node.attributes ?? []).some(+ (/** @type {any} */ attribute) =>+ attribute.type === 'JSXSpreadAttribute',+ ),+ )+ .forEach((/** @type {any} */ path) => {+ const attributes = path.node.attributes ?? [];+ const names = new Set(+ attributes+ .filter((/** @type {any} */ a) => a.type === 'JSXAttribute')+ .map((/** @type {any} */ a) => a.name?.name),+ );+ if ([...props].some(name => names.has(name))) return;+ // Let the shared helper decide whether this element is the imported+ // component: give it a sentinel prop to find, then take it back.+ const marker = j.jsxAttribute(j.jsxIdentifier(sentinel));+ path.node.attributes = [...attributes, marker];+ let matched = false;+ transformProp(+ root,+ j,+ {+ matchesImport: source => CORE_IMPORT_RE.test(source),+ components: new Map([[component, new Set([sentinel])]]),+ },+ propPath => {+ if (propPath.node === marker) matched = true;+ },+ );+ path.node.attributes = attributes;+ if (!matched) return;+ const spread = attributes.find(+ (/** @type {any} */ attribute) =>+ attribute.type === 'JSXSpreadAttribute',+ );+ changed =+ addComment(+ j,+ spread,+ component === 'ChatComposerInput'+ ? OPAQUE_TRIGGERS_COMMENT+ : SPREAD_COMMENT,+ ) || changed;+ });+ }++ return changed ? root.toSource({quote: 'single'}) : null;+}diff --git a/packages/core/src/Chat/ChatComposerInput.doc.mjs b/packages/core/src/Chat/ChatComposerInput.doc.mjsindex 3c1eb48945..ffe96e13f9 100644--- a/packages/core/src/Chat/ChatComposerInput.doc.mjs+++ b/packages/core/src/Chat/ChatComposerInput.doc.mjs@@ -98,7 +98,7 @@ export const docs = {name: 'triggers',type: 'ChatComposerTrigger[]',description:- 'Trigger definitions for typeahead menus. Each trigger specifies a character (@ or /), a search source, and an onSelect handler that returns the token to insert. Per-trigger emptySearchText (ReactNode) is the message when the query matched nothing; the older emptySearchResultsText (string) is deprecated and still works.',+ 'Trigger definitions for typeahead menus. Each trigger specifies a character (@ or /), a search source, and an onSelect handler that returns the token to insert. Per-trigger emptySearchText (ReactNode) is the message when the query matched nothing.',},{name: 'debounceMs',@@ -174,7 +174,7 @@ export const docsZh = {placeholder: '输入为空时显示的占位文本。',maxRows: '滚动前的最大可见行数。紧凑布局中使用较小值。',triggers:- '菜单的触发定义。每个触发器指定字符(@ 或 /)、搜索源和返回要插入标记的 onSelect 处理器。每个触发器的 emptySearchText(ReactNode)用于查询无匹配结果时的提示;旧的 emptySearchResultsText(string)已弃用,但仍可使用。',+ '菜单的触发定义。每个触发器指定字符(@ 或 /)、搜索源和返回要插入标记的 onSelect 处理器。每个触发器的 emptySearchText(ReactNode)用于查询无匹配结果时的提示。',debounceMs: '异步搜索源的去抖动延迟,避免过多网络请求。',hasHistory: '启用 ArrowUp/Down 回溯之前提交的消息。',label: '屏幕阅读器播报的无障碍标签。',@@ -205,7 +205,7 @@ export const docsDense = {placeholder: 'placeholder when empty',maxRows: 'max visible rows before scroll; lower for compact layouts',triggers:- 'typeahead trigger defs; character(@/)+searchSource+onSelect returning token; emptySearchText (ReactNode) for no matches, emptySearchResultsText deprecated',+ 'typeahead trigger defs; character(@/)+searchSource+onSelect returning token; emptySearchText (ReactNode) for no matches',debounceMs: 'debounce for async search to avoid excess requests',hasHistory: 'ArrowUp/Down to recall previous submissions',label: 'a11y label for screen readers',diff --git a/packages/core/src/Chat/ChatComposerInput.test.tsx b/packages/core/src/Chat/ChatComposerInput.test.tsxindex 531e7607cb..5f1005a934 100644--- a/packages/core/src/Chat/ChatComposerInput.test.tsx+++ b/packages/core/src/Chat/ChatComposerInput.test.tsx@@ -1136,7 +1136,7 @@ describe('ChatComposerInput', () => {it('supports configurable empty/loading text', () => {const trigger = createMentionTrigger({- emptySearchResultsText: 'Nobody found',+ emptySearchText: 'Nobody found',loadingText: 'Looking up...',menuLabel: 'People',});@@ -1146,7 +1146,7 @@ describe('ChatComposerInput', () => {// A trigger's `emptySearchResultsText` was renamed to `emptySearchText`// and widened from `string` to `ReactNode` (`spec:AST-056` FR1). The- // released key keeps working through the overlap (`spec:AST-017` FR28).+ // overlap ended in a minor release (`CLN-0004`, `spec:AST-017` FR31).it('renders an element emptySearchText when the query matched nothing', async () => {const user = userEvent.setup();const trigger = createMentionTrigger({@@ -1166,72 +1166,24 @@ describe('ChatComposerInput', () => {});});- it('keeps the deprecated key working, and says it is deprecated', async () => {- const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});- const user = userEvent.setup();- const trigger = createMentionTrigger({- emptySearchResultsText: 'Nobody found',- });- render(<ChatComposerInput triggers={[trigger]} />);-- await user.click(screen.getByRole('combobox'));- await user.keyboard('@zzzzz');-- await waitFor(() => {- expect(screen.getByText('Nobody found')).toBeInTheDocument();- });- expect(warn).toHaveBeenCalledWith(- expect.stringContaining(- 'ChatComposerInput: A trigger sets `emptySearchResultsText`, which is deprecated',- ),- );- warn.mockRestore();- });-- it('treats an explicit null key as not given, falling through to the old one', async () => {+ it('no longer reads the removed emptySearchResultsText key (CLN-0004)', async () => {const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});const user = userEvent.setup();const trigger = createMentionTrigger({+ // @ts-expect-error -- removed in the minor release (CLN-0004)emptySearchResultsText: 'Nobody found',- emptySearchText: null,});render(<ChatComposerInput triggers={[trigger]} />);await user.click(screen.getByRole('combobox'));await user.keyboard('@zzzzz');- // The same meaning the typeahead family gives `null`: not given, so- // the released key still supplies the message and no warning claims a- // winner the menu did not pick.await waitFor(() => {- expect(screen.getByText('Nobody found')).toBeInTheDocument();+ expect(screen.getByText('No results')).toBeInTheDocument();});+ expect(screen.queryByText('Nobody found')).not.toBeInTheDocument();expect(warn).not.toHaveBeenCalledWith(- expect.stringContaining('sets both'),- );- warn.mockRestore();- });-- it('lets the new key win when a trigger sets both, and warns', async () => {- const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});- const user = userEvent.setup();- const trigger = createMentionTrigger({- emptySearchResultsText: 'Old copy',- emptySearchText: 'New copy',- });- render(<ChatComposerInput triggers={[trigger]} />);-- await user.click(screen.getByRole('combobox'));- await user.keyboard('@zzzzz');-- await waitFor(() => {- expect(screen.getByText('New copy')).toBeInTheDocument();- });- expect(screen.queryByText('Old copy')).not.toBeInTheDocument();- expect(warn).toHaveBeenCalledWith(- expect.stringContaining(- 'ChatComposerInput: A trigger sets both `emptySearchResultsText` and `emptySearchText`',- ),+ expect.stringContaining('is deprecated'),);warn.mockRestore();});diff --git a/packages/core/src/Chat/ChatComposerInput.tsx b/packages/core/src/Chat/ChatComposerInput.tsxindex 82b9466c6f..1add3ced55 100644--- a/packages/core/src/Chat/ChatComposerInput.tsx+++ b/packages/core/src/Chat/ChatComposerInput.tsx@@ -69,7 +69,6 @@ import {Badge, type BadgeProps} from '../Badge';import {useChatComposerContext} from './ChatContext';import {themeProps} from '../utils/themeProps';import {useTranslator} from '../i18n';-import {useDevWarning} from '../hooks/useDevWarning';// =============================================================================// Types@@ -167,17 +166,6 @@ export type ChatComposerTrigger = {* @default 'No results'*/emptySearchText?: ReactNode;- /**- * Text shown when no results found.- * @default 'No results'- * @deprecated `DEP-0004`. Renamed to `emptySearchText`, which takes a- * `ReactNode` rather than a `string` — every existing value stays valid- * (`spec:AST-056` FR1, FR7). Still works exactly as released;- * `emptySearchText` wins when both are set. Removal is `CLN-0004`, in a- * later minor whose frozen manifest carries both ids (`spec:AST-017`- * FR31).- */- emptySearchResultsText?: string;/** Text shown during async search. @default 'Searching\u2026' */loadingText?: string;/** Accessible label for the menu. @default 'Suggestions' */@@ -606,30 +594,6 @@ export function ChatComposerInput(props: ChatComposerInputProps) {insertTextRef.current = insertText;// --- Trigger menu ---- // Each trigger's empty-result message was renamed (`spec:AST-056` FR1); the- // released key keeps working through the overlap and development says which- // one was read (`spec:AST-017` FR28).- // `!= null` matches the `??` the menu resolves with, so an explicit `null`- // counts as "not given" on both names and the warnings cannot claim a- // winner the render did not pick.- const triggersWithDeprecatedEmptyText =- triggers?.filter(trigger => trigger.emptySearchResultsText != null) ?? [];- const triggersWithBothEmptyTexts = triggersWithDeprecatedEmptyText.filter(- trigger => trigger.emptySearchText != null,- );- useDevWarning(- 'ChatComposerInput',- 'A trigger sets `emptySearchResultsText`, which is deprecated; use ' +- '`emptySearchText` instead. It still works exactly as released.',- triggersWithDeprecatedEmptyText.length > triggersWithBothEmptyTexts.length,- );- useDevWarning(- 'ChatComposerInput',- 'A trigger sets both `emptySearchResultsText` and `emptySearchText`; ' +- '`emptySearchText` wins. `emptySearchResultsText` is deprecated — ' +- 'drop it.',- triggersWithBothEmptyTexts.length > 0,- );const triggerMenu = useTriggerMenu({triggers,editableRef,diff --git a/packages/core/src/Chat/useTriggerMenu.tsx b/packages/core/src/Chat/useTriggerMenu.tsxindex 30a91de6f6..00ca6bd65d 100644--- a/packages/core/src/Chat/useTriggerMenu.tsx+++ b/packages/core/src/Chat/useTriggerMenu.tsx@@ -640,10 +640,7 @@ export function useTriggerMenu(const renderMenu = useCallback((): ReactNode => {const trigger = state.activeTrigger;- const emptyText =- trigger?.emptySearchText ??- trigger?.emptySearchResultsText ??- 'No results';+ const emptyText = trigger?.emptySearchText ?? 'No results';const loadingText = trigger?.loadingText ?? 'Searching\u2026';let listContent: ReactNode;diff --git a/packages/core/src/Tokenizer/Tokenizer.doc.mjs b/packages/core/src/Tokenizer/Tokenizer.doc.mjsindex d9293f3404..b393882d80 100644--- a/packages/core/src/Tokenizer/Tokenizer.doc.mjs+++ b/packages/core/src/Tokenizer/Tokenizer.doc.mjs@@ -180,13 +180,6 @@ export const docs = {'Content shown when the query matched nothing. Takes a ReactNode, so the dead end can carry a link or a create row. Announced in a polite live region as the text it renders, read from the DOM; aria-hidden parts stay out of both, and content that renders no text announces nothing. null counts as not given, like undefined, and falls through to the default; pass an empty string to render nothing.',default: "'No results found'",},- {- name: 'emptySearchResultsText',- type: 'string',- description:- 'Deprecated: renamed to emptySearchText, which takes a ReactNode rather than a string, so every existing value stays valid. Still works exactly as released; emptySearchText wins when both are set.',- default: "'No results found'",- },{name: 'hasAutoFocus',type: 'boolean',@@ -559,13 +552,6 @@ export const docsZh = {'查询无匹配结果时显示的内容。接受 ReactNode,因此可在无结果处放置链接或创建入口。会从 DOM 读取其渲染出的文本在礼貌性实时区域中播报;aria-hidden 的部分两处都不包含,不渲染任何文本的内容则不会播报。null 与 undefined 同样视为未提供,将回退到默认值;若要不渲染任何内容,请传入空字符串。',default: "'No results found'",},- {- name: 'emptySearchResultsText',- type: 'string',- description:- '已弃用:改名为 emptySearchText,其类型由 string 放宽为 ReactNode,原有取值全部仍然有效。仍按已发布行为工作;两者同时设置时以 emptySearchText 为准。',- default: "'No results found'",- },{name: 'hasAutoFocus',type: 'boolean',@@ -831,8 +817,6 @@ export const docsDense = {minQueryLength:'Min query length before searching. Menu stays closed below it, except the hasCreate entry.',emptySearchText: 'Content when the query matched nothing. ReactNode.',- emptySearchResultsText:- 'deprecated, use emptySearchText (ReactNode). still works as released; emptySearchText wins if both set.',hasAutoFocus: 'Auto-focus input on mount.',size: 'Input+token size.',debounceMs: 'Search debounce delay ms. 0 for sync sources.',diff --git a/packages/core/src/Tokenizer/Tokenizer.test.tsx b/packages/core/src/Tokenizer/Tokenizer.test.tsxindex 939f00d5ff..00dc343c79 100644--- a/packages/core/src/Tokenizer/Tokenizer.test.tsx+++ b/packages/core/src/Tokenizer/Tokenizer.test.tsx@@ -1762,9 +1762,9 @@ describe('Tokenizer end-lane reserve', () => {});// `emptySearchResultsText` was renamed to `emptySearchText` and widened from-// `string` to `ReactNode` (`spec:AST-056` FR1). It is a released prop with a-// victim, so the replacement ships first and the old name keeps working-// through the overlap (`spec:AST-017` FR28, FR29).+// `string` to `ReactNode` (`spec:AST-056` FR1). The overlap ended in a minor+// release (`CLN-0001`–`CLN-0004`, `spec:AST-017` FR31): the old name is no+// longer part of the type and is no longer read.describe('Tokenizer emptySearchText', () => {async function searchForNothing() {const input = screen.getByRole('combobox');@@ -1847,33 +1847,6 @@ describe('Tokenizer emptySearchText', () => {).not.toContain('→');});- it('treats an explicit null as not given, falling through to the old name', async () => {- const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});- render(- <Tokenizer- label="People"- searchSource={userSource}- value={[]}- onChange={() => {}}- debounceMs={0}- emptySearchResultsText="Nobody found"- emptySearchText={null}- />,- );- await searchForNothing();-- // `null` is what this prop's own `??` default already treats as absent,- // so the released name still supplies the message and the warning says- // only that it is deprecated.- await waitFor(() => {- expect(screen.getByText('Nobody found')).toBeInTheDocument();- });- expect(warn).not.toHaveBeenCalledWith(- expect.stringContaining('are both set'),- );- warn.mockRestore();- });-it('falls through to the default when null is the only value given', async () => {render(<Tokenizer@@ -1892,8 +1865,10 @@ describe('Tokenizer emptySearchText', () => {});});- it('keeps the deprecated name working, and says it is deprecated', async () => {+ it('no longer reads the removed emptySearchResultsText (CLN-0001)', async () => {const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});+ // The unknown prop reaches the root element, which React reports.+ const error = vi.spyOn(console, 'error').mockImplementation(() => {});render(<Tokenizerlabel="People"@@ -1901,47 +1876,21 @@ describe('Tokenizer emptySearchText', () => {value={[]}onChange={() => {}}debounceMs={0}+ // @ts-expect-error -- removed in the minor release (CLN-0001)emptySearchResultsText="Nobody found"/>,);await searchForNothing();await waitFor(() => {- expect(screen.getByText('Nobody found')).toBeInTheDocument();- });- expect(warn).toHaveBeenCalledWith(- expect.stringContaining(- 'Tokenizer: `emptySearchResultsText` is deprecated; use `emptySearchText`',- ),- );- warn.mockRestore();- });-- it('lets the new name win when both are set, and warns', async () => {- const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});- render(- <Tokenizer- label="People"- searchSource={userSource}- value={[]}- onChange={() => {}}- debounceMs={0}- emptySearchResultsText="Old copy"- emptySearchText="New copy"- />,- );- await searchForNothing();-- await waitFor(() => {- expect(screen.getByText('New copy')).toBeInTheDocument();+ expect(screen.getByText('No results found')).toBeInTheDocument();});- expect(screen.queryByText('Old copy')).not.toBeInTheDocument();- expect(warn).toHaveBeenCalledWith(- expect.stringContaining(- 'Tokenizer: `emptySearchResultsText` and `emptySearchText` are both set',- ),+ expect(screen.queryByText('Nobody found')).not.toBeInTheDocument();+ expect(warn).not.toHaveBeenCalledWith(+ expect.stringContaining('is deprecated'),);warn.mockRestore();+ error.mockRestore();});});diff --git a/packages/core/src/Tokenizer/Tokenizer.tsx b/packages/core/src/Tokenizer/Tokenizer.tsxindex ede69ed009..d0fd190345 100644--- a/packages/core/src/Tokenizer/Tokenizer.tsx+++ b/packages/core/src/Tokenizer/Tokenizer.tsx@@ -68,7 +68,6 @@ import type {SearchableItem, SearchSource} from '../Typeahead/types';import {mergeProps} from '../utils';import {themeProps} from '../utils/themeProps';import {useTranslator} from '../i18n';-import {useRenamedProp} from '../hooks/useRenamedProp';// Re-export status types for convenienceexport type {@@ -206,18 +205,6 @@ export interface TokenizerProps<T extends SearchableItem> extends Omit<* @default 'No results found'*/emptySearchText?: ReactNode;-- /**- * Text shown when no results found.- * @default 'No results found'- * @deprecated `DEP-0001`. Renamed to `emptySearchText`, which takes a- * `ReactNode` rather than a `string` — every existing value stays valid- * (`spec:AST-056` FR1, FR7). Still works exactly as released;- * `emptySearchText` wins when both are set. Removal is `CLN-0001`, in a- * later minor whose frozen manifest carries both ids (`spec:AST-017`- * FR31).- */- emptySearchResultsText?: string;/** Whether the input is disabled. @default false */isDisabled?: boolean;/**@@ -577,8 +564,7 @@ export function Tokenizer<T extends SearchableItem>({maxMenuItems,menuWidth,minQueryLength,- emptySearchResultsText,- emptySearchText: emptySearchTextFromProps,+ emptySearchText,isDisabled = false,htmlName,disabledMessage,@@ -633,16 +619,6 @@ export function Tokenizer<T extends SearchableItem>({isEnabled: showsDisabledMessage,});- // The replacement wins, the released name keeps working, and development- // says which one was read (`spec:AST-056` FR7, `spec:AST-017` FR28).- const emptySearchText = useRenamedProp<ReactNode>({- component: 'Tokenizer',- deprecated: 'emptySearchResultsText',- deprecatedValue: emptySearchResultsText,- replacement: 'emptySearchText',- value: emptySearchTextFromProps,- });-useImperativeHandle(handleRef, () => ({focus() {inputRef.current?.focus();diff --git a/packages/core/src/Typeahead/BaseTypeahead.doc.mjs b/packages/core/src/Typeahead/BaseTypeahead.doc.mjsindex c31773a600..af4e93f2c1 100644--- a/packages/core/src/Typeahead/BaseTypeahead.doc.mjs+++ b/packages/core/src/Typeahead/BaseTypeahead.doc.mjs@@ -165,13 +165,6 @@ export const docs = {'Content shown when the query matched nothing. Takes a ReactNode, so the dead end can carry a link or a create row. Announced in a polite live region as the text it renders, read from the DOM; aria-hidden parts stay out of both, and content that renders no text announces nothing. null counts as not given, like undefined, and falls through to the default; pass an empty string to render nothing.',default: "'No results found'",},- {- name: 'emptySearchResultsText',- type: 'string',- description:- 'Deprecated: renamed to emptySearchText, which takes a ReactNode rather than a string, so every existing value stays valid. Still works exactly as released; emptySearchText wins when both are set.',- default: "'No results found'",- },{name: 'isDisabled',type: 'boolean',@@ -331,13 +324,6 @@ export const docsZh = {'查询无匹配结果时显示的内容。接受 ReactNode,因此可在无结果处放置链接或创建入口。会从 DOM 读取其渲染出的文本在礼貌性实时区域中播报;aria-hidden 的部分两处都不包含,不渲染任何文本的内容则不会播报。null 与 undefined 同样视为未提供,将回退到默认值;若要不渲染任何内容,请传入空字符串。',default: "'No results found'",},- {- name: 'emptySearchResultsText',- type: 'string',- description:- '已弃用:改名为 emptySearchText,其类型由 string 放宽为 ReactNode,原有取值全部仍然有效。仍按已发布行为工作;两者同时设置时以 emptySearchText 为准。',- default: "'No results found'",- },{name: 'isDisabled',type: 'boolean',@@ -479,8 +465,6 @@ export const docsDense = {minQueryLength:'Min query length before searching. Menu stays closed below it.',emptySearchText: 'Content when the query matched nothing. ReactNode.',- emptySearchResultsText:- 'deprecated, use emptySearchText (ReactNode). still works as released; emptySearchText wins if both set.',isDisabled: 'Whether input disabled.',isFocusableDisabled:'Keeps disabled input focusable and blocks text entry; an already-open highlight can still be selected with Enter.',diff --git a/packages/core/src/Typeahead/BaseTypeahead.test.tsx b/packages/core/src/Typeahead/BaseTypeahead.test.tsxindex b2ee856f9e..772a7ef9d8 100644--- a/packages/core/src/Typeahead/BaseTypeahead.test.tsx+++ b/packages/core/src/Typeahead/BaseTypeahead.test.tsx@@ -238,7 +238,7 @@ describe('BaseTypeahead', () => {value={null}onChange={() => {}}debounceMs={0}- emptySearchResultsText="No matching frameworks"+ emptySearchText="No matching frameworks"/>,);diff --git a/packages/core/src/Typeahead/BaseTypeahead.tsx b/packages/core/src/Typeahead/BaseTypeahead.tsxindex 225cfda2ee..0dd1c0e31b 100644--- a/packages/core/src/Typeahead/BaseTypeahead.tsx+++ b/packages/core/src/Typeahead/BaseTypeahead.tsx@@ -33,7 +33,6 @@ import type {StyleXStyles} from '@stylexjs/stylex';import {usePopover} from '../Popover/usePopover';import {useAnnounce} from '../hooks/useAnnounce';import {useAnnounceRenderedText} from '../hooks/useAnnounceRenderedText';-import {useRenamedProp} from '../hooks/useRenamedProp';import {useHighlightedOptionScroll} from '../hooks/useHighlightedOptionScroll';import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';import {isImeKeyEvent} from '../utils/ime';@@ -143,18 +142,6 @@ export interface BaseTypeaheadProps<T extends SearchableItem> extends Omit<*/emptySearchText?: ReactNode;- /**- * Text shown when no results found.- * @default 'No results found'- * @deprecated `DEP-0003`. Renamed to `emptySearchText`, which takes a- * `ReactNode` rather than a `string` — every existing value stays valid- * (`spec:AST-056` FR1, FR7). Still works exactly as released;- * `emptySearchText` wins when both are set. Removal is `CLN-0003`, in a- * later minor whose frozen manifest carries both ids (`spec:AST-017`- * FR31).- */- emptySearchResultsText?: string;-/*** Whether the input is disabled.* @default false@@ -465,7 +452,6 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({maxMenuItems = 10,menuWidth,minQueryLength = 1,- emptySearchResultsText: deprecatedEmptySearchResultsText,emptySearchText: emptySearchTextFromProps,isDisabled = false,isFocusableDisabled = false,@@ -500,13 +486,7 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({const placeholder =placeholderFromProps ?? t('@astryx.typeahead.searchPlaceholder');const emptySearchText =- useRenamedProp<ReactNode>({- component: 'BaseTypeahead',- deprecated: 'emptySearchResultsText',- deprecatedValue: deprecatedEmptySearchResultsText,- replacement: 'emptySearchText',- value: emptySearchTextFromProps,- }) ?? t('@astryx.typeahead.emptySearchResults');+ emptySearchTextFromProps ?? t('@astryx.typeahead.emptySearchResults');// The empty-state row carries the message visually, and the live region has// to speak the same words. `emptySearchText` takes a ReactNode, so they are// read off the rendered row after it renders rather than guessed from thediff --git a/packages/core/src/Typeahead/Typeahead.doc.mjs b/packages/core/src/Typeahead/Typeahead.doc.mjsindex ffe9cafaed..db3eba41d4 100644--- a/packages/core/src/Typeahead/Typeahead.doc.mjs+++ b/packages/core/src/Typeahead/Typeahead.doc.mjs@@ -230,13 +230,6 @@ export const docs = {'Content shown when the query matched nothing. Takes a ReactNode, so the dead end can carry a link or a create row. Announced in a polite live region as the text it renders, read from the DOM; aria-hidden parts stay out of both, and content that renders no text announces nothing. null counts as not given, like undefined, and falls through to the default; pass an empty string to render nothing.',default: "'No results found'",},- {- name: 'emptySearchResultsText',- type: 'string',- description:- 'Deprecated: renamed to emptySearchText, which takes a ReactNode rather than a string, so every existing value stays valid. Still works exactly as released; emptySearchText wins when both are set.',- default: "'No results found'",- },{name: 'hasAutoFocus',type: 'boolean',diff --git a/packages/core/src/Typeahead/Typeahead.test.tsx b/packages/core/src/Typeahead/Typeahead.test.tsxindex 2e65fbd1ef..84a0f7ee32 100644--- a/packages/core/src/Typeahead/Typeahead.test.tsx+++ b/packages/core/src/Typeahead/Typeahead.test.tsx@@ -239,7 +239,7 @@ describe('BaseTypeahead', () => {value={null}onChange={() => {}}debounceMs={0}- emptySearchResultsText="No results found"+ emptySearchText="No results found"/>,);const input = screen.getByRole('combobox');@@ -260,7 +260,7 @@ describe('BaseTypeahead', () => {value={null}onChange={() => {}}debounceMs={0}- emptySearchResultsText="No results found"+ emptySearchText="No results found"/>,);const input = screen.getByRole('combobox');@@ -2189,9 +2189,9 @@ describe('the value is bounded by the content lane', () => {});// `emptySearchResultsText` was renamed to `emptySearchText` and widened from-// `string` to `ReactNode` (`spec:AST-056` FR1). It is a released prop with a-// victim, so the replacement ships first and the old name keeps working-// through the overlap (`spec:AST-017` FR28, FR29).+// `string` to `ReactNode` (`spec:AST-056` FR1). The overlap ended in a minor+// release (`CLN-0001`–`CLN-0004`, `spec:AST-017` FR31): the old name is no+// longer part of the type and is no longer read.describe('emptySearchText rename', () => {function searchForNothing() {fireEvent.change(screen.getByRole('combobox'), {@@ -2222,8 +2222,10 @@ describe('emptySearchText rename', () => {});});- it('keeps the deprecated name working, and says it is deprecated', async () => {+ it('no longer reads the removed emptySearchResultsText (CLN-0002)', async () => {const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});+ // The unknown prop reaches the root element, which React reports.+ const error = vi.spyOn(console, 'error').mockImplementation(() => {});render(<Typeaheadlabel="Fruit"@@ -2231,47 +2233,21 @@ describe('emptySearchText rename', () => {value={null}onChange={() => {}}debounceMs={0}+ // @ts-expect-error -- removed in the minor release (CLN-0002)emptySearchResultsText="Nothing ripe"/>,);searchForNothing();await waitFor(() => {- expect(screen.getByText('Nothing ripe')).toBeInTheDocument();+ expect(screen.getByText('No results found')).toBeInTheDocument();});- expect(warn).toHaveBeenCalledWith(- expect.stringContaining(- 'Typeahead: `emptySearchResultsText` is deprecated; use `emptySearchText`',- ),- );- warn.mockRestore();- });-- it('lets the new name win when both are set, and warns', async () => {- const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});- render(- <Typeahead- label="Fruit"- searchSource={fruitSource}- value={null}- onChange={() => {}}- debounceMs={0}- emptySearchResultsText="Old copy"- emptySearchText="New copy"- />,- );- searchForNothing();-- await waitFor(() => {- expect(screen.getByText('New copy')).toBeInTheDocument();- });- expect(screen.queryByText('Old copy')).not.toBeInTheDocument();- expect(warn).toHaveBeenCalledWith(- expect.stringContaining(- 'Typeahead: `emptySearchResultsText` and `emptySearchText` are both set',- ),+ expect(screen.queryByText('Nothing ripe')).not.toBeInTheDocument();+ expect(warn).not.toHaveBeenCalledWith(+ expect.stringContaining('is deprecated'),);warn.mockRestore();+ error.mockRestore();});});@@ -2301,14 +2277,16 @@ describe('emptySearchText rename', () => {});});- it('announces the deprecated name unchanged', async () => {- const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});+ it('no longer announces the removed emptySearchResultsText (CLN-0003)', async () => {+ // The unknown prop reaches the root element, which React reports.+ const error = vi.spyOn(console, 'error').mockImplementation(() => {});render(<BaseTypeaheadsearchSource={fruitSource}value={null}onChange={() => {}}debounceMs={0}+ // @ts-expect-error -- removed in the minor release (CLN-0003)emptySearchResultsText="Nothing ripe"/>,);@@ -2317,9 +2295,13 @@ describe('emptySearchText rename', () => {await waitFor(() => {expect(document.querySelector('[data-astryx-live-region="polite"]'),- ).toHaveTextContent('Nothing ripe');+ ).toHaveTextContent('No results found');});- warn.mockRestore();+ expect(+ document.querySelector('[data-astryx-live-region="polite"]')+ ?.textContent,+ ).not.toContain('Nothing ripe');+ error.mockRestore();});});});diff --git a/packages/core/src/Typeahead/Typeahead.tsx b/packages/core/src/Typeahead/Typeahead.tsxindex 9004afadaa..131dda98fd 100644--- a/packages/core/src/Typeahead/Typeahead.tsx+++ b/packages/core/src/Typeahead/Typeahead.tsx@@ -70,7 +70,6 @@ import {themeProps} from '../utils/themeProps';import {useTranslator} from '../i18n';import {useMergedRefs} from '../hooks/useMergedRefs';-import {useRenamedProp} from '../hooks/useRenamedProp';export type {InputStatus as TypeaheadStatus,InputStatusType as TypeaheadStatusType,@@ -160,18 +159,6 @@ export interface TypeaheadProps<T extends SearchableItem> extends Omit<* @default 'No results found'*/emptySearchText?: ReactNode;-- /**- * Text shown when no results found.- * @default 'No results found'- * @deprecated `DEP-0002`. Renamed to `emptySearchText`, which takes a- * `ReactNode` rather than a `string` — every existing value stays valid- * (`spec:AST-056` FR1, FR7). Still works exactly as released;- * `emptySearchText` wins when both are set. Removal is `CLN-0002`, in a- * later minor whose frozen manifest carries both ids (`spec:AST-017`- * FR31).- */- emptySearchResultsText?: string;/** Whether the input is disabled. @default false */isDisabled?: boolean;/**@@ -399,8 +386,7 @@ export function Typeahead<T extends SearchableItem>({hasEntriesOnFocus,maxMenuItems,minQueryLength,- emptySearchResultsText,- emptySearchText: emptySearchTextFromProps,+ emptySearchText,isDisabled = false,disabledMessage,hasClear = true,@@ -435,16 +421,6 @@ export function Typeahead<T extends SearchableItem>({const statusMessageId = useId();const inputGroup = useInputGroup();- // The replacement wins, the released name keeps working, and development- // says which one was read (`spec:AST-056` FR7, `spec:AST-017` FR28).- const emptySearchText = useRenamedProp<ReactNode>({- component: 'Typeahead',- deprecated: 'emptySearchResultsText',- deprecatedValue: emptySearchResultsText,- replacement: 'emptySearchText',- value: emptySearchTextFromProps,- });-const wrapperRef = useRef<HTMLDivElement>(null);const inputRef = useRef<HTMLInputElement>(null);const tokenRef = useRef<HTMLElement>(null);diff --git a/packages/core/src/hooks/useRenamedProp.ts b/packages/core/src/hooks/useRenamedProp.tsindex 25bdcb2e82..9c589bbec4 100644--- a/packages/core/src/hooks/useRenamedProp.ts+++ b/packages/core/src/hooks/useRenamedProp.ts@@ -56,12 +56,12 @@ export interface RenamedPropOptions<T> {** @example* ```- * const emptySearchText = useRenamedProp({- * component: 'Tokenizer',- * deprecated: 'emptySearchResultsText',- * deprecatedValue: emptySearchResultsText,- * replacement: 'emptySearchText',- * value: emptySearchTextFromProps,+ * const label = useRenamedProp({+ * component: 'Example',+ * deprecated: 'oldLabel',+ * deprecatedValue: oldLabel,+ * replacement: 'label',+ * value: labelFromProps,* });* ```*/