Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(core): export XDSFieldStatus component under its proper name (#2640)

Cindy Zhang1a17bbd7386c
diff --git a/packages/cli/templates/blocks/components/FieldStatus/FieldStatusShowcase.tsx b/packages/cli/templates/blocks/components/FieldStatus/FieldStatusShowcase.tsx
index 24a8149d65..21eedc0cb8 100644
--- a/packages/cli/templates/blocks/components/FieldStatus/FieldStatusShowcase.tsx
+++ b/packages/cli/templates/blocks/components/FieldStatus/FieldStatusShowcase.tsx
@@ -2,23 +2,23 @@
'use client';
-import {XDSFieldStatusComponent} from '@xds/core/Field';
+import {XDSFieldStatus} from '@xds/core/Field';
import {XDSVStack} from '@xds/core/Layout';
export default function FieldStatusShowcase() {
return (
<XDSVStack gap={4}>
- <XDSFieldStatusComponent
+ <XDSFieldStatus
type="error"
message="This field is required"
variant="detached"
/>
- <XDSFieldStatusComponent
+ <XDSFieldStatus
type="warning"
message="This username is already taken by another team"
variant="detached"
/>
- <XDSFieldStatusComponent
+ <XDSFieldStatus
type="success"
message="Your changes have been saved"
variant="detached"
diff --git a/packages/core/src/Field/XDSField.tsx b/packages/core/src/Field/XDSField.tsx
index 0ba1ab8a3f..cb893ae1e0 100644
--- a/packages/core/src/Field/XDSField.tsx
+++ b/packages/core/src/Field/XDSField.tsx
@@ -20,7 +20,7 @@ import {type ReactNode, use} from 'react';
import * as stylex from '@stylexjs/stylex';
import type {XDSBaseProps} from '../XDSBaseProps';
import {XDSFieldLabel} from './XDSFieldLabel';
-import {XDSFieldStatus as XDSFieldStatusComponent} from './XDSFieldStatus';
+import {XDSFieldStatus} from './XDSFieldStatus';
import {spacingVars, borderVars} from '../theme/tokens.stylex';
import type {XDSIconType} from '../Icon';
import {xdsClassName, mergeProps} from '../utils';
@@ -53,7 +53,7 @@ const styles = stylex.create({
export type XDSFieldStatusType = 'warning' | 'error' | 'success';
-export interface XDSFieldStatus {
+export interface XDSFieldStatusInput {
/**
* The type of status to display.
*/
@@ -119,7 +119,7 @@ export interface XDSFieldProps extends Omit<
* Status indicator for the field.
* When set with a message, displays a colored message box below the input.
*/
- status?: XDSFieldStatus;
+ status?: XDSFieldStatusInput;
/**
* Tooltip text to display in an info icon at the end of the label.
*/
@@ -199,7 +199,7 @@ export function XDSField({
);
const statusNode = status?.message ? (
- <XDSFieldStatusComponent
+ <XDSFieldStatus
type={status.type}
message={status.message}
id={resolvedMessageID}
diff --git a/packages/core/src/Field/index.ts b/packages/core/src/Field/index.ts
index 9922e7b91a..84c2838c16 100644
--- a/packages/core/src/Field/index.ts
+++ b/packages/core/src/Field/index.ts
@@ -5,7 +5,7 @@
/**
* @file index.ts
* @input Imports XDSField component and types from XDSField.tsx, XDSFieldLabel from XDSFieldLabel.tsx, XDSFieldStatus from XDSFieldStatus.tsx
- * @output Exports XDSField, XDSFieldProps, XDSFieldStatus, XDSFieldStatusType, XDSFieldLabel, XDSFieldLabelProps, XDSFieldStatus component
+ * @output Exports XDSField, XDSFieldProps, XDSFieldStatusInput, XDSFieldStatusType, XDSFieldLabel, XDSFieldLabelProps, XDSFieldStatus component
* @position Component entry point; re-exported by /packages/core/src/index.ts
*
* SYNC: When modified, update this header and /packages/core/src/Field/Field.doc.mjs
@@ -14,12 +14,12 @@
export {XDSField} from './XDSField';
export type {
XDSFieldProps,
- XDSFieldStatus,
+ XDSFieldStatusInput,
XDSFieldStatusType,
} from './XDSField';
export {XDSFieldLabel} from './XDSFieldLabel';
export type {XDSFieldLabelProps} from './XDSFieldLabel';
-export {XDSFieldStatus as XDSFieldStatusComponent} from './XDSFieldStatus';
+export {XDSFieldStatus} from './XDSFieldStatus';
export type {
XDSFieldStatusProps,
XDSFieldStatusVariant,
diff --git a/packages/core/src/Layout/Layout.doc.mjs b/packages/core/src/Layout/Layout.doc.mjs
index 49be0b70f6..d66425b77e 100644
--- a/packages/core/src/Layout/Layout.doc.mjs
+++ b/packages/core/src/Layout/Layout.doc.mjs
@@ -201,14 +201,6 @@ export const docs = {
},
],
},
- {
- name: 'XDSLayoutContainer',
- isHiddenFromOverview: true,
- displayName: 'Layout Container',
- description:
- 'Primitive component that sets CSS variables for padding, used as the base for XDSCard and XDSSection.',
- props: [],
- },
{
name: 'XDSCard',
displayName: 'Card',
@@ -444,14 +436,6 @@ export const docsZh = {
},
],
},
- {
- name: 'XDSLayoutContainer',
- isHiddenFromOverview: true,
- displayName: 'Layout Container',
- description:
- '设置内边距 CSS 变量的基础组件,作为 XDSCard 和 XDSSection 的基础。',
- props: [],
- },
{
name: 'XDSCard',
displayName: 'Card',
@@ -581,13 +565,6 @@ export const docsDense = {
role: 'ARIA landmark role.',
},
},
- {
- name: 'XDSLayoutContainer',
- isHiddenFromOverview: true,
- displayName: 'Layout Container',
- description:
- 'Primitive setting CSS padding vars; base for XDSCard + XDSSection.',
- },
{
name: 'XDSCard',
displayName: 'Card',
diff --git a/packages/core/src/Table/Table.doc.mjs b/packages/core/src/Table/Table.doc.mjs
index 42bf758572..c61dd2fcd3 100644
--- a/packages/core/src/Table/Table.doc.mjs
+++ b/packages/core/src/Table/Table.doc.mjs
@@ -98,56 +98,6 @@ export const docs = {
'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.',
},
], },
- {
- name: 'XDSBaseTable',
- isHiddenFromOverview: true,
- displayName: 'Base Table',
- description:
- 'Unstyled structural table component with a plugin transform pipeline and a components prop for swapping in custom row/cell renderers.',
- props: [
- {
- name: 'data',
- type: 'T[]',
- description: 'Array of data items to render as rows. T must extend Record<string, unknown>.',
- },
- {
- name: 'columns',
- type: 'XDSTableColumn<T>[]',
- description:
- 'Column definitions — each column has {key, header, width?, renderCell?}. If omitted, columns are auto-generated from data object keys.',
- },
- {
- name: 'idKey',
- type: '(keyof T & string) | ((item: T) => string | number)',
- description:
- 'Row key for React reconciliation. Pass a property name string or a function. Falls back to row index if omitted.',
- },
- {
- name: 'plugins',
- type: 'TablePlugin<T>[]',
- description:
- 'Ordered array of plugins applied as a sequential transform pipeline.',
- },
- {
- name: 'components',
- type: '{Row?: ComponentType<TableRowComponentProps>; Cell?: ComponentType<TableCellComponentProps>; HeaderCell?: ComponentType<TableHeaderCellComponentProps>}',
- description:
- 'Component overrides for row and cell elements. When provided, these components receive xstyle from plugin transforms.',
- },
- {
- name: 'children',
- type: 'ReactNode',
- description:
- 'Children mode — render rows directly in the tbody instead of using data-driven rendering.',
- },
- {
- name: 'tableProps',
- type: 'HTMLAttributes<HTMLTableElement>',
- description:
- 'Additional HTML attributes passed directly to the root <table> element.',
- },
- ],
- },
{
name: 'XDSTableRow',
isHiddenFromOverview: true,
@@ -589,56 +539,6 @@ export const docsZh = {
},
],
},
- {
- name: 'XDSBaseTable',
- isHiddenFromOverview: true,
- displayName: 'Base Table',
- description:
- '无样式的结构表格组件,配有插件转换管道和 components 属性,用于替换自定义行/单元格渲染器。',
- props: [
- {
- name: 'data',
- type: 'T[]',
- description: '要渲染为行的数据项数组。T 需 extends Record<string, unknown>。',
- },
- {
- name: 'columns',
- type: 'XDSTableColumn<T>[]',
- description:
- '列定义 — 每列含 {key, header, width?, renderCell?}。省略时自动从数据键生成。',
- },
- {
- name: 'idKey',
- type: '(keyof T & string) | ((item: T) => string | number)',
- description:
- '用于 React 协调的行键。传入属性名称字符串或函数。省略时回退到行索引。',
- },
- {
- name: 'plugins',
- type: 'TablePlugin<T>[]',
- description:
- '作为顺序转换管道应用的有序插件数组。',
- },
- {
- name: 'components',
- type: '{Row?: ComponentType<TableRowComponentProps>; Cell?: ComponentType<TableCellComponentProps>; HeaderCell?: ComponentType<TableHeaderCellComponentProps>}',
- description:
- '行和单元格元素的组件覆盖。提供时,这些组件从插件转换中接收 xstyle。',
- },
- {
- name: 'children',
- type: 'ReactNode',
- description:
- '子元素模式 — 在 tbody 中直接渲染行,而非使用数据驱动渲染。',
- },
- {
- name: 'tableProps',
- type: 'HTMLAttributes<HTMLTableElement>',
- description:
- '直接传递给根 <table> 元素的额外 HTML 属性。',
- },
- ],
- },
{
name: 'XDSTableRow',
isHiddenFromOverview: true,
@@ -947,21 +847,6 @@ export const docsDense = {
xstyle: 'StyleX layout styles; must be stylex.create() value.',
},
},
- {
- name: 'XDSBaseTable',
- isHiddenFromOverview: true,
- displayName: 'Base Table',
- description: 'Unstyled structural table w/ plugin transform pipeline + components prop for custom row/cell renderers.',
- propDescriptions: {
- data: 'Array of data items to render as rows. T must extend Record<string, unknown>.',
- columns: 'Column defs {key, header, width?, renderCell?}; auto-generated from data keys if omitted.',
- idKey: 'Row key for React reconciliation; property name or fn. Falls back to index.',
- plugins: 'Ordered plugin array applied as sequential transform pipeline.',
- components: 'Component overrides for row/cell elements; receive xstyle from plugin transforms.',
- children: 'Children mode; render rows in tbody directly.',
- tableProps: 'Extra HTML attrs passed to root <table> element.',
- },
- },
{
name: 'XDSTableRow',
isHiddenFromOverview: true,