// ─── Internal imports (used to assemble the curated `Widget` const) ───────── import { Provider } from './provider/widget-provider' import { Wrapper, Actions, Options, Content, Footer, DEFAULT_WRAPPER_LABELS, } from './wrapper' import { Subheader } from './subheader/subheader' import { State } from './state/widget-state' import { DEFAULT_STATE_LABELS } from './state/labels' import { SelectionSummary } from './selection-summary/selection-summary' import { DEFAULT_SELECTION_SUMMARY_LABELS } from './selection-summary/labels' import { Toolbox } from './toolbox/toolbox' import { DEFAULT_TOOLBOX_LABELS } from './toolbox/labels' import { Echart, EchartUI, DEFAULT_INIT_OPTS } from './echart' import { Note } from './note/widget-note' import { DEFAULT_NOTE_LABELS } from './note/labels' import { Searcher, SearcherToggle, StackToggle, ShowAllToggle, ZoomToggle, BrushToggle, RelativeData, Download, FullScreen, LockSelection, ChangeColumn, } from './actions' import { Formula, FormulaUI } from './formula' import { Markdown, MarkdownUI } from './markdown' import { Spread, SpreadUI } from './spread' import { Range, RangeUI } from './range' import { Category, CategoryUI } from './category' import { Table, TableUI } from './table' /** * Curated namespace export — the only way to reach v2 widget components. * Consumers import the const and access components via property access: * * ```tsx * import { Widget } from '@carto/ps-react-ui/widgets-v2' * * * * * }> * * * * * * ``` * * Component identifiers are not surfaced as separate named exports — Types * (props, data shapes, label types, default-label consts) and per-widget * subpath entries (`@carto/ps-react-ui/widgets-v2/bar`, `…/category`, * `…/table`, `…/actions`, `…/stores`, `…/utils`, etc.) remain available for * direct import where needed. */ export const Widget = { // Composition shell Provider, Wrapper, Actions, Options, Content, Footer, Subheader, State, SelectionSummary, Toolbox, Note, // ECharts bridge Echart, EchartUI, // Actions Searcher, SearcherToggle, StackToggle, ShowAllToggle, ZoomToggle, BrushToggle, RelativeData, Download, FullScreen, LockSelection, ChangeColumn, // Widget primitives (renderer bridges + pure UI). Pre-composed widget // modules (Bar, FormulaWidget, TableWidget, etc.) are application-level // compositions of these primitives and live outside the library — // see `apps/storybook/stories/modules/widgets/` for canonical examples. Formula, FormulaUI, Markdown, MarkdownUI, Spread, SpreadUI, Range, RangeUI, Category, CategoryUI, Table, TableUI, } as const // ─── Default-label consts ────────────────────────────────────────────────── // Exported separately so consumers can build customized label sets via spread. export { DEFAULT_WRAPPER_LABELS, DEFAULT_STATE_LABELS, DEFAULT_SELECTION_SUMMARY_LABELS, DEFAULT_TOOLBOX_LABELS, DEFAULT_NOTE_LABELS, DEFAULT_INIT_OPTS, } // ─── Types ───────────────────────────────────────────────────────────────── // Types are erased at runtime so they can't live on the `Widget` const. // They are re-exported here for direct import by consumers. export type { ProviderProps } from './provider/widget-provider' export type { WrapperProps, ActionsProps, OptionsProps, ContentProps, FooterProps, WrapperLabels, } from './wrapper' export type { SubheaderProps } from './subheader/subheader' export type { StateProps } from './state/widget-state' export type { StateLabels } from './state/labels' export type { SelectionSummaryProps } from './selection-summary/selection-summary' export type { SelectionSummaryLabels } from './selection-summary/labels' export type { ToolboxProps } from './toolbox/toolbox' export type { ToolboxLabels } from './toolbox/labels' export type { EchartProps, EchartUIProps, EchartsEventHandler } from './echart' export type { NoteProps, NoteMarkdownProps } from './note/widget-note' export type { NoteLabels } from './note/labels' // Action types export type { SearcherProps, SearcherToggleProps, StackToggleProps, ShowAllToggleProps, ZoomToggleProps, BrushToggleProps, RelativeDataProps, DownloadProps, DownloadItem, FullScreenTriggerProps, FullScreenSlotProps, LockSelectionProps, LockSelectionKey, ChangeColumnProps, ChangeColumnItem, } from './actions' // Widget primitive types export type { FormulaUIProps, FormulaDataItem, FormulaWidgetData, } from './formula' export type { MarkdownUIProps, MarkdownWidgetData } from './markdown' export type { PieDatum, PieWidgetData } from './pie' export type { TimeseriesDatum, TimeseriesWidgetData } from './timeseries' export type { ScatterplotDatum, ScatterplotWidgetData } from './scatterplot' export type { SpreadUIProps, SpreadDataItem, SpreadWidgetData } from './spread' export type { RangeProps, RangeUIProps, RangeDataItem, RangeWidgetData, RangeItemValue, } from './range' export type { CategoryProps, CategoryUIProps, CategoryDataItem, CategoryWidgetData, CategoryKey, CategorySeriesConfig, CategoryLabels, } from './category' export type { TableProps, TableUIProps, TableColumn, TableRow, TableWidgetData, TableWidgetState, TableSortDirection, TableSortState, } from './table' // Canonical cross-widget series shape — see `widgets-v2/types.ts`. export type { WidgetSeries } from './types'