Skip to content

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

TypeScript

docs: fix storybook compat, add missing xstyle docs, add @example to XDSTheme (#618)

Cindy Zhangce90b30cddbb
diff --git a/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs b/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
index 3ecb5c8658..990981c900 100644
--- a/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
+++ b/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
@@ -203,7 +203,7 @@ export const docs = {
{
name: 'xstyle',
type: 'StyleXStyles',
- description: 'StyleX styles for the root container.',
+ description: 'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.',
},
],
examples: [
diff --git a/packages/core/src/Popover/Popover.doc.mjs b/packages/core/src/Popover/Popover.doc.mjs
index 745527f9f4..fd23b084c0 100644
--- a/packages/core/src/Popover/Popover.doc.mjs
+++ b/packages/core/src/Popover/Popover.doc.mjs
@@ -149,6 +149,11 @@ export const docs = {
type: 'string',
description: 'Accessible label for the popover dialog.',
},
+ {
+ name: 'xstyle',
+ type: 'StyleXStyles',
+ description: 'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.',
+ },
],
},
{
diff --git a/packages/core/src/PowerSearch/XDSPowerSearch.tsx b/packages/core/src/PowerSearch/XDSPowerSearch.tsx
index 3eff91ee17..fd0688972b 100644
--- a/packages/core/src/PowerSearch/XDSPowerSearch.tsx
+++ b/packages/core/src/PowerSearch/XDSPowerSearch.tsx
@@ -369,7 +369,10 @@ export interface XDSPowerSearchProps {
ref?: React.Ref<XDSPowerSearchHandle>;
/** Test ID. */
'data-testid'?: string;
- /** StyleX styles. */
+ /**
+ * StyleX styles for layout customization (margins, positioning, sizing).
+ * Must be a `stylex.create()` value — not an inline style object.
+ */
xstyle?: StyleXStyles;
/** CSS class name. */
className?: string;
@@ -428,7 +431,6 @@ type PopoverState =
* },
* ],
* };
- *
* const [filters, setFilters] = useState([]);
* <XDSPowerSearch
* config={config}
diff --git a/packages/core/src/Table/XDSTableCell.tsx b/packages/core/src/Table/XDSTableCell.tsx
index 9e69d36257..3650908a6a 100644
--- a/packages/core/src/Table/XDSTableCell.tsx
+++ b/packages/core/src/Table/XDSTableCell.tsx
@@ -28,6 +28,10 @@ export interface XDSTableCellProps extends XDSBaseProps<HTMLTableCellElement> {
/** Space-separated list of header cell IDs this cell is described by. */
headers?: string;
children?: ReactNode;
+ /**
+ * StyleX styles for layout customization (margins, positioning, sizing).
+ * Must be a `stylex.create()` value — not an inline style object.
+ */
xstyle?: StyleXStyles | StyleXStyles[];
}
diff --git a/packages/core/src/Table/XDSTableHeaderCell.tsx b/packages/core/src/Table/XDSTableHeaderCell.tsx
index c8c9758649..3239d17a9e 100644
--- a/packages/core/src/Table/XDSTableHeaderCell.tsx
+++ b/packages/core/src/Table/XDSTableHeaderCell.tsx
@@ -31,6 +31,10 @@ export interface XDSTableHeaderCellProps extends XDSBaseProps<HTMLTableCellEleme
/** Specifies which cells this header relates to. */
scope?: 'col' | 'row' | 'colgroup' | 'rowgroup';
children?: ReactNode;
+ /**
+ * StyleX styles for layout customization (margins, positioning, sizing).
+ * Must be a `stylex.create()` value — not an inline style object.
+ */
xstyle?: StyleXStyles | StyleXStyles[];
}
diff --git a/packages/core/src/Table/XDSTableRow.tsx b/packages/core/src/Table/XDSTableRow.tsx
index f3e898b82f..afb4aa04ad 100644
--- a/packages/core/src/Table/XDSTableRow.tsx
+++ b/packages/core/src/Table/XDSTableRow.tsx
@@ -24,6 +24,10 @@ export interface XDSTableRowProps extends XDSBaseProps<HTMLTableRowElement> {
/** Ref forwarded to the root element */
ref?: React.Ref<HTMLTableRowElement>;
children: ReactNode;
+ /**
+ * StyleX styles for layout customization (margins, positioning, sizing).
+ * Must be a `stylex.create()` value — not an inline style object.
+ */
xstyle?: StyleXStyles[];
}
diff --git a/packages/core/src/theme/XDSTheme.tsx b/packages/core/src/theme/XDSTheme.tsx
index 0c58344de6..3c97466afd 100644
--- a/packages/core/src/theme/XDSTheme.tsx
+++ b/packages/core/src/theme/XDSTheme.tsx
@@ -6,7 +6,7 @@
* - Token overrides set as CSS custom properties on [data-xds-theme]
* - Component overrides scoped via @scope'd CSS selectors on .xds-* classes
*
- * Usage:
+ * @example
* ```
* const ocean = defineTheme({
* name: 'ocean',
@@ -15,11 +15,6 @@
* icons: oceanIcons,
* });
* <XDSTheme theme={ocean}><App /></XDSTheme>
- *
- * // Built theme — CSS imported separately
- * import { oceanTheme } from '@xds/theme-ocean';
- * import '@xds/theme-ocean/theme.css';
- * <XDSTheme theme={oceanTheme}><App /></XDSTheme>
* ```
*/