Skip to content

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

TypeScript

fix(cli): clarify DateRangeInput ISODateString type and Table ColumnWidth in docs (#3907)

Cindy Zhang1f35be82d381
diff --git a/packages/core/src/DateRangeInput/DateRangeInput.doc.mjs b/packages/core/src/DateRangeInput/DateRangeInput.doc.mjs
index 669b119491..e6d2d6a0ac 100644
--- a/packages/core/src/DateRangeInput/DateRangeInput.doc.mjs
+++ b/packages/core/src/DateRangeInput/DateRangeInput.doc.mjs
@@ -57,7 +57,8 @@ export const docs = {
{
name: 'value',
type: 'DateRange | null',
- description: 'Selected date range ({start, end} in ISO format), or null.',
+ description:
+ 'Selected date range or null. Import the `DateRange` type from `@astryxdesign/core/DateRangeInput` — it is `{start: ISODateString, end: ISODateString}`. Do NOT redeclare your own DateRange type; use the exported one so TypeScript structurally matches.',
required: true,
},
{
@@ -83,12 +84,14 @@ export const docs = {
{
name: 'min',
type: 'ISODateString',
- description: 'Minimum selectable date.',
+ description:
+ 'Minimum selectable date. `ISODateString` is a template literal type (`\\`${number}${number}${number}${number}-${number}${number}-${number}${number}\\``) — pass a string literal like `"2026-01-28"`, not a runtime string variable. Import it from `@astryxdesign/core/Calendar` or use `as ISODateString` if computing the value dynamically.',
},
{
name: 'max',
type: 'ISODateString',
- description: 'Maximum selectable date.',
+ description:
+ 'Maximum selectable date. Same template literal type as `min` — use a YYYY-MM-DD string literal or cast with `as ISODateString`.',
},
{
name: 'dateConstraints',
@@ -283,10 +286,10 @@ export const docsDense = {
isDisabled: 'disable trigger+picker',
disabledMessage:
'reason shown in a tooltip on hover/focus when disabled; keeps trigger focusable via aria-disabled',
- value: 'selected range {start, end} or null',
+ value: 'selected range {start, end} or null — import DateRange type from @astryxdesign/core/DateRangeInput (do not redeclare)',
onChange: 'callback on range change; null on clear',
- min: 'min selectable date',
- max: 'max selectable date',
+ min: 'min selectable date — ISODateString template literal type (YYYY-MM-DD); use string literal or cast `as ISODateString`',
+ max: 'max selectable date — ISODateString template literal type (YYYY-MM-DD); use string literal or cast `as ISODateString`',
dateConstraints: 'custom constraint fns to disable dates',
presets: 'preset ranges as quick-select options',
hasClear: 'clear button when range is set (default true)',
diff --git a/packages/core/src/Table/Table.doc.mjs b/packages/core/src/Table/Table.doc.mjs
index 3bd7b0f2e0..e8abdf3a62 100644
--- a/packages/core/src/Table/Table.doc.mjs
+++ b/packages/core/src/Table/Table.doc.mjs
@@ -45,7 +45,7 @@ export const docs = {
{
name: 'columns',
type: 'TableColumn<T>[]',
- description: 'Column definitions: each column has {key, header, width?, align?, renderCell?}. The `header` field sets the column heading text. If omitted, columns are auto-generated from data object keys.',
+ description: 'Column definitions: each column has {key, header, width?, align?, renderCell?}. The `header` field sets the column heading text. If omitted, columns are auto-generated from data object keys. The `width` field is typed as `ColumnWidth` (not a number) — use `proportional(n)` or `pixel(n)` helpers imported from `@astryxdesign/core/Table`. Example: `width: pixel(120)` for 120px fixed, `width: proportional(1)` for flex distribution.',
},
{
name: 'idKey',