@planningcenter/tapestry 4.15.0 → 4.15.1-qa-1684.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/components/DataTable/DataTable.d.ts +2 -0
  2. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  3. package/dist/components/DataTable/DataTable.js +6 -3
  4. package/dist/components/DataTable/DataTable.js.map +1 -1
  5. package/dist/components/link/BaseLink.d.ts.map +1 -1
  6. package/dist/components/link/BaseLink.js +11 -1
  7. package/dist/components/link/BaseLink.js.map +1 -1
  8. package/dist/components/tag/Tag.d.ts +59 -0
  9. package/dist/components/tag/Tag.d.ts.map +1 -0
  10. package/dist/components/tag/Tag.js +31 -0
  11. package/dist/components/tag/Tag.js.map +1 -0
  12. package/dist/components/tag/TagContent.d.ts +19 -0
  13. package/dist/components/tag/TagContent.d.ts.map +1 -0
  14. package/dist/components/tag/TagContent.js +26 -0
  15. package/dist/components/tag/TagContent.js.map +1 -0
  16. package/dist/components/tag/index.d.ts +4 -0
  17. package/dist/components/tag/index.d.ts.map +1 -0
  18. package/dist/components/tag/useTagMenu.d.ts +31 -0
  19. package/dist/components/tag/useTagMenu.d.ts.map +1 -0
  20. package/dist/components/tag/useTagMenu.js +56 -0
  21. package/dist/components/tag/useTagMenu.js.map +1 -0
  22. package/dist/reactRender.css +2355 -2155
  23. package/dist/reactRender.css.map +1 -1
  24. package/dist/reactRenderLegacy.css +2355 -2155
  25. package/dist/reactRenderLegacy.css.map +1 -1
  26. package/dist/tapestryMount.css +2355 -2155
  27. package/dist/tapestryMount.css.map +1 -1
  28. package/dist/tapestryMountLegacy.css +2355 -2155
  29. package/dist/tapestryMountLegacy.css.map +1 -1
  30. package/dist/unstable.css +200 -0
  31. package/dist/unstable.css.map +1 -1
  32. package/dist/unstable.d.ts +2 -0
  33. package/dist/unstable.d.ts.map +1 -1
  34. package/dist/unstable.js +1 -0
  35. package/dist/unstable.js.map +1 -1
  36. package/docs/components/DataTable.md +3 -1
  37. package/docs/components/tag.md +41 -0
  38. package/docs/llms.txt +3 -0
  39. package/package.json +5 -5
@@ -297,6 +297,8 @@ interface DataTableBaseProps {
297
297
  * filters as a view with the id `"initial"`, which replaces "All" and is the
298
298
  * default. Once the table's filters, sort, or visible columns differ from a
299
299
  * static view, it isn't shown as selected; picking it again reapplies it.
300
+ * Without `filters`, a view's filters don't show as chips, so the views bar
301
+ * is the only place people see them.
300
302
  * Omit both `staticViews` and `initialSavedViews` to hide the views bar.
301
303
  */
302
304
  staticViews?: StaticView[];
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,eAAe,CAAA;AAMtB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;AAGhF,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,EASL,KAAK,UAAU,IAAI,cAAc,EAClC,MAAM,6BAA6B,CAAA;AAGpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,KAAK,sBAAsB,EAAa,MAAM,gBAAgB,CAAA;AAIvE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,cAAc,CAAA;AAEzD,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,gBAAgB,CAAA;AAI/D,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,yBAAyB,CAAA;AAOhC,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EAEV,MAAM,SAAS,CAAA;AAIhB,YAAY,EACV,sBAA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,CAAA;CAC9B;AAED,UAAU,+BAA+B;IACvC,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,KAAK,CAAA;IACzB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAA;IACtD,6BAA6B;IAC7B,YAAY,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAClC,mEAAmE;IACnE,YAAY,CAAC,EAAE,WAAW,EAAE,CAAA;CAC7B;AAED,UAAU,+BAA+B;IACvC;;;;;;OAMG;IACH,iBAAiB,EAAE,IAAI,CAAA;IACvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAC1D;;;;OAIG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,mEAAmE;IACnE,YAAY,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,EAAE,CAAA;CACjD;AAED,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,CAAC,+BAA+B,GAAG,+BAA+B,CAAC,CAAA;AAMrE,KAAK,oBAAoB,GAAG,UAAU,GAAG,MAAM,CAAA;AAE/C,KAAK,uBAAuB,GAAG,KAAK,CAAA;AAEpC,MAAM,MAAM,qBAAqB,GAAG,+BAA+B,CACjE,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,uBAAuB,CACxB,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS;2CAInB,qBAAqB;;CAQvB,CAAA"}
@@ -253,7 +253,10 @@ const DataTableInner = ({ activeFilters = [], className, canSelectAllPages, colu
253
253
  const showHeader = hasResults || Boolean(hasTrailingControls);
254
254
  const hasRowActions = (rowActions?.length ?? 0) > 0;
255
255
  const { pendingFilters } = usePendingFilters();
256
- const hasEditableFilters = chipFilters.length + pendingFilters.length > 0;
256
+ // A chip needs its filter in `filters` to render, so a table without them
257
+ // shows no chips. A view's filters still apply, and still select the view.
258
+ const shelfFilters = hasFilters ? chipFilters : [];
259
+ const hasEditableFilters = shelfFilters.length + pendingFilters.length > 0;
257
260
  // A modified view's actions live in the shelf, so it shows them even
258
261
  // without filters, such as after a column or sort change.
259
262
  const hasShelfContent = hasEditableFilters || isActiveSavedViewModified;
@@ -266,7 +269,7 @@ const DataTableInner = ({ activeFilters = [], className, canSelectAllPages, colu
266
269
  ?.focus();
267
270
  }, []);
268
271
  const { filterOpenRequest } = useFilterOpenRequest();
269
- const [isShelfExpanded, toggleShelf] = useShelfExpanded(chipFilters.length + pendingFilters.length, pendingFilters.length, filterOpenRequest, isActiveSavedViewModified);
272
+ const [isShelfExpanded, toggleShelf] = useShelfExpanded(shelfFilters.length + pendingFilters.length, pendingFilters.length, filterOpenRequest, isActiveSavedViewModified);
270
273
  // Keeps collapsed shelf content out of tab order/a11y tree. Needs a string,
271
274
  // not a boolean — `inert` isn't in `@types/react@18` or recognized by
272
275
  // react-dom as a boolean attribute before React 19.
@@ -289,7 +292,7 @@ const DataTableInner = ({ activeFilters = [], className, canSelectAllPages, colu
289
292
  (hasFilters || hasShelfContent) && (React__default.createElement("div", { className: classNames("tds-data-table-filters-shelf", {
290
293
  "tds-data-table-filters-shelf--collapsed": !isShelfExpanded,
291
294
  }), ...shelfInertProps },
292
- React__default.createElement("div", { className: "tds-data-table-filters" }, hasShelfContent && (React__default.createElement(ActiveFilters, { activeFilters: chipFilters, activeSavedView: isActiveSavedViewModified ? activeView : undefined, currentState: currentState, focusSelectedView: focusSelectedView, hasFilters: hasFilters, saveStatus: saveStatus, selectSavedViewWhenSaved: selectWhenSaved, onActiveFiltersChange: changeChipFilters, onClear: clearFilters, onSavedViewApply: applyView, onSavedViewCreate: onSavedViewCreate, onSavedViewUpdate: onSavedViewUpdate }))))),
295
+ React__default.createElement("div", { className: "tds-data-table-filters" }, hasShelfContent && (React__default.createElement(ActiveFilters, { activeFilters: shelfFilters, activeSavedView: isActiveSavedViewModified ? activeView : undefined, currentState: currentState, focusSelectedView: focusSelectedView, hasFilters: hasFilters, saveStatus: saveStatus, selectSavedViewWhenSaved: selectWhenSaved, onActiveFiltersChange: changeChipFilters, onClear: clearFilters, onSavedViewApply: applyView, onSavedViewCreate: onSavedViewCreate, onSavedViewUpdate: onSavedViewUpdate }))))),
293
296
  React__default.createElement(SelectAllBanner, { resultNoun: resultNoun })),
294
297
  React__default.createElement("div", { ref: wrapperRef, className: "tds-data-table-scroll-wrapper" },
295
298
  React__default.createElement("div", { ref: scrollRef, className: "tds-data-table-scroll", "aria-busy": showLoadingOverlay || undefined },
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.js","sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["import \"./index.css\"\nimport \"./filters.css\"\n\nimport { LoadingAnnouncement, LoadingSpinner } from \"@components/internal\"\nimport { Pagination } from \"@components/internal/pagination\"\nimport Icon from \"@utilities/Icon\"\nimport { useTapestryLocale } from \"@utilities/locale\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n Cell,\n Checkbox,\n Column,\n Row,\n type SortDescriptor,\n Table,\n TableBody,\n TableHeader,\n type TableProps as AriaTableProps,\n} from \"react-aria-components/Table\"\n\nimport { ActiveFilters } from \"./ActiveFilters\"\nimport type { DataTableColumn } from \"./DataTableColumn\"\nimport { prepareColumn, type PreparedColumn } from \"./DataTableColumnTypes\"\nimport { type DataTableRowAppearance, getRowKey } from \"./DataTableRow\"\nimport { FiltersProvider } from \"./FilterContext\"\nimport { FilterControls } from \"./FilterControls\"\nimport { useFilterOpenRequest } from \"./FilterOpenRequest\"\nimport type { ActiveFilter, FilterNode } from \"./FilterTypes\"\nimport { usePendingFilters } from \"./PendingFilterContext\"\nimport {\n hasResultsCount,\n resolveResultNounLabel,\n type ResultNoun,\n ResultsCount,\n} from \"./ResultsCount\"\nimport { type RowAction, RowActions } from \"./RowActions\"\nimport { SelectAllBanner } from \"./SelectAllBanner\"\nimport { type TableAction, TableActions } from \"./TableActions\"\nimport { TableSearch } from \"./TableSearch\"\nimport { useActiveView } from \"./useActiveView\"\nimport { useColumnVisibility } from \"./useColumnVisibility\"\nimport {\n type DataTableSelection,\n DataTableSelectionContext,\n useDataTableSelection,\n} from \"./useDataTableSelection\"\nimport { useResultsAnnouncement } from \"./useResultsAnnouncement\"\nimport { useRowPressBoundary } from \"./useRowPressBoundary\"\nimport { useSavedViewsState } from \"./useSavedViewsState\"\nimport { useSaveStatus } from \"./useSaveStatus\"\nimport { useSearchFilter } from \"./useSearchFilter\"\nimport { useShelfExpanded } from \"./useShelfExpanded\"\nimport {\n initialView,\n isViewEditable,\n isViewModified,\n type SavedView,\n type StaticView,\n type View,\n withoutSearch,\n} from \"./views\"\nimport { ViewsBar } from \"./ViewsBar\"\nimport { ViewSettingsToggle } from \"./ViewSettingsToggle\"\n\nexport type {\n DataTableRowAppearance,\n DataTableSelection,\n ResultNoun,\n RowAction,\n TableAction,\n}\n\n/**\n * A PCO API order string: the column name for ascending (`\"lastName\"`), or\n * the name prefixed with a hyphen for descending (`\"-lastName\"`).\n */\nexport type Sort = string\n\nexport type DataTableLoadingState = \"error\" | \"idle\" | \"loading\"\n\ninterface DataTableBaseProps {\n activeFilters?: ActiveFilter[]\n /**\n * Columns define what data is displayed and how. Pass a stable reference\n * (e.g. a module constant or memoized value); columns are prepared per array\n * identity, so an inline array rebuilds each column's formatter every render.\n */\n columns: DataTableColumn[]\n /**\n * The 1-indexed current page. Only used by the default `\"paged\"` pagination,\n * where `totalPages` is set, and defaults to `1`.\n */\n currentPage?: number\n /** The array of rows to display. */\n data: unknown[]\n /**\n * Row keys that can't be selected. Keys are the values returned by `getRowId`\n * (or `row.id`, or the row's index) — the same keys used by `selectedKeys`.\n * Only selection is disabled: the row's checkbox renders disabled and \"select\n * all\" skips it, while the row itself stays clickable, navigable, and\n * focusable. Has no effect unless the table is `selectable`.\n */\n disabledKeys?: (number | string)[]\n /** Rendered in place of the table body when there is no data. */\n emptyState?: ReactNode\n /** Rendered in place of the table body when `loadingState` is `\"error\"`. */\n errorState?: ReactNode\n /**\n * The filter tree shown in the \"Add filter\" popover. Renders the filter\n * controls in the header when set; omit to leave filtering off entirely.\n * `q` is reserved for the search, so no filter can use it as its name.\n */\n filters?: FilterNode[]\n /**\n * Returns one of a fixed set of looks for the row, or `undefined` for the\n * default. Called on every render, so the appearance can depend on state\n * outside the row, such as a date picked elsewhere on the page. A row has\n * one appearance at a time; return the one that matters most.\n * - `\"reveal\"`: something outside the table points to the row. A highlight\n * plays when the row's appearance changes to `\"reveal\"`, then fades.\n * - `\"flagged\"`: the row needs attention. A persistent tint.\n * - `\"new\"`: the row was recently added. A persistent tint.\n * - `\"muted\"`: the row is less relevant. Subdued text.\n *\n * Reveal sits above selection and hover, which sit above flagged and new.\n * Color can't be the only signal, so flagged and new rows also need a\n * visible indicator in a cell, such as an icon or badge. A reveal doesn't\n * move focus; announce reveals that matter, such as \"3 events on November 9\".\n */\n getRowAppearance?: (row: unknown) => DataTableRowAppearance | undefined\n /** Returns a stable identity for each row. Defaults to `row.id`. */\n getRowId?: (row: unknown) => number | string\n /**\n * Returns a URL to navigate to when the row is clicked. Rows with a link\n * render as navigable elements (clickable, keyboard-focusable, and\n * openable in a new tab). Works alongside `onRowClick` and `selectable`.\n */\n getRowLink?: (row: unknown) => string\n /**\n * Whether a page exists after the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Next button.\n */\n hasNextPage?: boolean\n /**\n * Whether a page exists before the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Previous button.\n */\n hasPreviousPage?: boolean\n /**\n * An `id` for the table element. When omitted, a stable generated id is used\n * so the results count can be linked to the table via `aria-describedby`.\n */\n id?: string\n /**\n * The id of the default view. Defaults to `\"initial\"`. The table doesn't\n * apply it; it's selected on mount when the initial `activeFilters` (apart\n * from the search), sort, and visible columns match it. Otherwise the first\n * matching view is selected, or none. Later changes are ignored.\n */\n initialDefaultViewId?: NonNullable<View[\"id\"]>\n /**\n * Named sets of filters, sort, and visible columns the user can apply, shown\n * in array order. Can't use the id `\"initial\"`, which is reserved for the\n * initial view. Later changes are ignored; remount with a new `key` to start\n * from fresh views. In a Rails app, load them with tapestry-rails'\n * `SavedView.on_table(...).data_table_props` and save changes with\n * `useSavedViewsClient`.\n */\n initialSavedViews?: SavedView[]\n /**\n * Async loading state for the table body.\n * - `\"loading\"`: While `data` is empty, replaces the empty state with a\n * centered spinner. While `data` has rows, keeps them on screen with a\n * spinner over them until new `data` arrives, so a search doesn't blank\n * the table. When requests can overlap, apply only the latest response.\n * Set it while any request is in flight, so screen reader users hear\n * the new count when it ends. Keep `\"idle\"` for a refresh the user did\n * not start, such as polling, or the count is announced again.\n * - `\"error\"`: While `data` is empty, replaces the empty state with\n * `errorState` (or a default error message).\n * - `\"idle\"` (default): Normal rendering.\n */\n loadingState?: DataTableLoadingState\n /**\n * Called when the active filters change.\n * Provides an argument with the updated active filters array.\n */\n onActiveFiltersChange?: (activeFilters: ActiveFilter[]) => void\n /**\n * Called with the id of the view the user sets as the default, or\n * `\"initial\"` once the default view is deleted. Without it, the Set as\n * default action is hidden; on the default view it's disabled and reads\n * \"Default view\". The table shows the new default right away, and puts the\n * previous one back if the promise rejects, unless the user has set another\n * default since.\n */\n onDefaultViewIdChange?: (id: NonNullable<View[\"id\"]>) => Promise<void> | void\n /**\n * Called when the Next button is activated. Only used by\n * `paginationType=\"indexed\"`; load the following page's rows and pass them\n * back in through `data` in response.\n */\n onNextPageClick?: () => void\n /**\n * Called with the 1-indexed page the user navigated to. The table doesn't\n * page `data` itself — pass the rows for the new page back in through `data`\n * (and update `currentPage`) in response. Only used by the default `\"paged\"`\n * pagination; the indexed type has no page number to report.\n *\n * Also called with `1`, right after `onActiveFiltersChange` or\n * `onSortChange`, when the user changes the filters, search, sort, or view\n * away from the first page. Load from state set by all three, not inside\n * each callback, or the same change loads twice. Update `currentPage` when\n * it's called, not once the page loads, or a change made while a page is\n * loading won't go back to page 1.\n */\n onPageChange?: (page: number) => void\n /**\n * Called when the Previous button is activated. Only used by\n * `paginationType=\"indexed\"`; load the preceding page's rows and pass them\n * back in through `data` in response.\n */\n onPreviousPageClick?: () => void\n /**\n * Called with the row when it is clicked. Rows with a click handler render\n * as interactive elements (clickable and keyboard-focusable). When\n * `getRowLink` is also set, both run and the row navigates.\n */\n onRowClick?: (row: unknown) => void\n /**\n * Called with the new view when the user saves the current filters, sort,\n * and columns as a view, or duplicates a view. Without it, views can't be\n * created or duplicated. Return the saved view with its new id, or a promise\n * of it; that view is selected once it's passed back in `savedViews`, unless\n * it was duplicated from the manage views modal. A callback that returns\n * nothing doesn't type check, so resolve to the view after refetching, e.g.\n * `(view) => api.create(view).then(async (saved) => { await refetch(); return saved })`.\n */\n onSavedViewCreate?: (\n savedView: Omit<SavedView, \"id\">\n ) => Promise<SavedView> | SavedView\n /**\n * Called with the view once the user confirms deleting it, from the context\n * menu or the manage views modal. Without it, views can't be deleted. The\n * table removes the view right away, and puts it back in its place if the\n * promise rejects. Deleting the default view resets the default to\n * `\"initial\"`, which is restored too.\n */\n onSavedViewDelete?: (savedView: SavedView) => Promise<void> | void\n /**\n * Called when the user moves a saved view, with the saved view it now comes\n * after, or `null` when it's first. Save the new position and return a\n * promise. The table moves the view right away, and moves it back if the\n * promise rejects. Without it, the manage views modal has no drag handles.\n */\n onSavedViewReorder?: (\n savedView: SavedView,\n after: SavedView | null\n ) => Promise<void> | void\n /**\n * Called with the updated view, matched by `id`. Return the saved view, or a\n * promise of it. The table shows the change right away, then swaps in the\n * returned view, or puts the old one back if the promise rejects, unless\n * the view has changed again since. Without it, view names are read only.\n */\n onSavedViewUpdate?: (savedView: SavedView) => Promise<SavedView> | SavedView\n /** Callback invoked when the sort state changes. */\n onSortChange?: (sort: Sort) => void\n /**\n * Called with the visible column names, in `columns` order, when the\n * visibility toggle changes or a view is applied. Always-visible columns\n * are included and unknown names are dropped, so the value can be passed\n * straight back as `visibleColumnNames`. Column visibility is controlled,\n * so the table only updates once `visibleColumnNames` changes.\n */\n onVisibleColumnNamesChange?: (visibleColumnNames: string[]) => void\n /**\n * Which shape the page controls take, forwarded to the `Pagination` control's\n * `type`.\n * - `\"paged\"` (the default): a numbered run of pages. Driven by `totalPages`,\n * `currentPage`, and `onPageChange`, and rendered only once `totalPages` is\n * set and greater than `1`.\n * - `\"indexed\"`: a labeled Previous/Next pair, for a result set that can only\n * be stepped through — a cursor-paged API, say, which reports whether a\n * neighboring page exists but not how many there are. Driven by\n * `hasPreviousPage`/`hasNextPage` and `onPreviousPageClick`/\n * `onNextPageClick`; `totalPages` and `currentPage` play no part. With no\n * page count there's no threshold to hide the controls below, so they\n * always render — a single page of results shows both buttons disabled.\n * The table can't go back to the first page itself, so reset the cursor\n * when the filters or sort change.\n */\n paginationType?: \"indexed\" | \"paged\"\n /**\n * Overrides the number shown by the `resultNoun` count, which otherwise\n * uses the length of `data`. Use this when the table renders only part of\n * the result set — a paginated or virtualized table — so the count reflects\n * the whole set. It also sizes an all-pages selection when\n * `canSelectAllPages` is true, including the count used by table actions and\n * the select-all banner. Without a result count, the banner isn't offered\n * because the table can't accurately describe the all-pages selection.\n * It also sets the count announced to screen reader users after a filter\n * change or a load. Without it, a paginated table announces only the current page,\n * e.g. `\"25 results on this page\"`.\n */\n resultCount?: number\n /**\n * Displays the number of results (the length of `data`, or `resultCount`\n * when supplied) above the table, followed by a noun that matches the count.\n * Pass a string to use it as the singular noun and append `\"s\"` for the\n * plural (e.g. `\"result\"` → `\"results\"`), or a `[singular, plural]` tuple to\n * supply an irregular plural explicitly (e.g. `[\"person\", \"people\"]`). Pass\n * `true` to use `\"result\"`.\n * When `false` or omitted, no count is rendered. The count is formatted with\n * `Intl.NumberFormat` and the singular form is used only when the count is\n * exactly `1`. When the table is `selectable` and rows are selected, the\n * count instead reflects the selection as `\"{selected} of {total}\"`, e.g.\n * `\"2 of 100\"`, with a visually-hidden suffix naming the noun so assistive\n * tech reads the unambiguous `\"2 of 100 people selected\"`.\n * The count is linked to the table with `aria-describedby` so\n * screen readers announce it as a description of the table. When a string or\n * `[singular, plural]` tuple is provided, the noun also supplies the table's\n * `aria-label` in its plural form (e.g. `\"items\"` or `\"people\"`) unless an\n * `aria-label` is passed directly, which always takes precedence; `true`\n * never provides a label. The same plural noun also names the pagination\n * landmark (e.g. `\"people table pagination\"`), which otherwise falls back to\n * `\"Pagination\"`.\n */\n resultNoun?: ResultNoun\n /**\n * Displays a sticky column to the right that holds row-scoped actions.\n * Renders as a dropdown with 2+ actions or a single button with one. Every\n * row renders the same control, even when `hidden` leaves a row with one\n * action. Each action's `onAction` or `getHref` receives the row.\n */\n rowActions?: RowAction[]\n /** Ref to the scroll container the sticky header should track. Takes priority over `scrollContainerSelector`. Only used when `stickyHeader` is true. */\n scrollContainerRef?: React.RefObject<HTMLElement>\n /** CSS selector for the scroll container the sticky header should track. Only used when `stickyHeader` is true. Defaults to \".content-wrap\" */\n scrollContainerSelector?: string\n /**\n * Displays a search input above the table. The query is kept in\n * `activeFilters` as a `q` filter and reported through\n * `onActiveFiltersChange` once typing pauses. It isn't saved with\n * views, and applying a view leaves it alone.\n */\n searchable?: boolean\n /**\n * Enables row selection via checkboxes, including a \"select all\" checkbox in\n * the header for the loaded page. Without a row action (`onRowClick` or\n * `getRowLink`), pressing anywhere in a row toggles the row selection.\n */\n selectable?: boolean\n /** The current sort state for the table. */\n sortBy?: Sort\n /**\n * Read-only views from the app, listed before the saved views. Ids must not\n * overlap with `initialSavedViews`. Unless one has the id `\"initial\"`, an\n * \"All\" view is added first. A table that opens filtered should pass those\n * filters as a view with the id `\"initial\"`, which replaces \"All\" and is the\n * default. Once the table's filters, sort, or visible columns differ from a\n * static view, it isn't shown as selected; picking it again reapplies it.\n * Omit both `staticViews` and `initialSavedViews` to hide the views bar.\n */\n staticViews?: StaticView[]\n /** Enables a sticky header that tracks an outer scroll container. Progressive enhancement: Relies on `animation-timeline: scroll()`, which isn't supported in all browsers (e.g. Firefox) — the header scrolls with the table body instead of sticking in those cases. */\n stickyHeader?: boolean\n /**\n * The number of disabled rows across the whole result set. Used to size an\n * all-pages selection when disabled rows exist on unloaded pages. Replaces\n * the count inferred from `disabledKeys` rather than adding to it. Values are\n * clamped to the result count, and zero is used as supplied.\n */\n totalDisabledCount?: number\n /**\n * The total number of pages in the result set. Setting it renders the page\n * controls below the table; leaving it unset renders no pagination at all.\n * A single page has nothing to navigate to, so the controls only render once\n * there are two or more pages. Only used by the default `\"paged\"` pagination\n * — an indexed result set has no page count, which is the reason to reach for\n * `paginationType=\"indexed\"` in the first place.\n *\n * The table displays whatever rows it is given — paging is the caller's job.\n * `data` should hold only the current page's rows, `resultCount` the size of\n * the whole result set, and `onPageChange` should load the next page. The\n * table goes back to page 1 through `onPageChange` when the user changes the\n * filters, search, sort, or view; when the app changes them itself, it sets\n * `currentPage` too.\n */\n totalPages?: number\n /**\n * The names of the columns currently visible. Only columns marked `hideable`\n * are affected — every other column stays visible. Omitting this leaves all\n * columns visible. Once it's set, a hideable column it doesn't name is\n * hidden, so a column added later stays hidden in a stored value until the\n * user shows it. Unknown names are ignored and display order always follows\n * `columns`.\n */\n visibleColumnNames?: string[]\n}\n\ninterface DataTableExplicitSelectionProps {\n /** Keeps selection values as arrays of row keys. */\n canSelectAllPages?: false\n /**\n * Called with the selected row keys whenever selection changes. Called with\n * `[]` when the user changes a filter or the search, so actions never apply\n * to rows the new filters hide.\n */\n onSelectedChange?: (keys: (number | string)[]) => void\n /** The selected row keys. */\n selectedKeys?: (number | string)[]\n /** Table actions whose callbacks receive the selected row keys. */\n tableActions?: TableAction[]\n}\n\ninterface DataTableAllPagesSelectionProps {\n /**\n * Enables tagged selection values that can represent every page plus\n * exclusions. Explicit arrays and the header checkbox remain page-scoped.\n * When `resultCount` proves more selectable results exist, selecting the\n * loaded page reveals a banner that widens the selection to every page or\n * clears it again. This works with both paged and indexed pagination.\n */\n canSelectAllPages: true\n /**\n * Called with the current explicit or all-pages selection. Called with `[]`\n * when the user changes a filter or the search, so actions never apply to\n * rows the new filters hide.\n */\n onSelectedChange?: (selection: DataTableSelection) => void\n /**\n * The current explicit or all-pages selection. Use\n * `{ keys: \"all\", excludedKeys: [] }` for every selectable result; a bare\n * `\"all\"` value is not accepted.\n */\n selectedKeys?: DataTableSelection\n /** Table actions whose callbacks receive the current selection. */\n tableActions?: TableAction<DataTableSelection>[]\n}\n\nexport type DataTableProps = DataTableBaseProps &\n (DataTableAllPagesSelectionProps | DataTableExplicitSelectionProps)\n\nconst DEFAULT_ERROR_STATE = \"Something went wrong.\"\n\nconst ROW_APPEARANCES = new Set<string>([\"flagged\", \"muted\", \"new\", \"reveal\"])\n\ntype AriaTablePropsToOmit = \"children\" | \"slot\"\n\ntype AriaTablePropsToInclude = never\n\nexport type DataTableElementProps = CombineAriaPropsWithCustomProps<\n AriaTableProps,\n DataTableProps,\n AriaTablePropsToOmit,\n AriaTablePropsToInclude\n>\n\n/**\n * A table for displaying tabular data. Built on React Aria's `Table`.\n *\n * Each column declares a `type` that controls how its cell values are\n * formatted: `string`, `number`, `currency`, `date`, `datetime`, `boolean`,\n * `enum`, and `custom`. A column's `render` function always takes precedence\n * over the built-in type formatting.\n *\n * Setting `totalPages` renders page controls below the table; the table itself\n * never slices `data`, so `onPageChange` is where the caller loads the page.\n * `paginationType=\"indexed\"` swaps the numbered run for a labeled\n * Previous/Next pair, for a result set with no known page count.\n *\n * Filtering, presets, and other RFC features are not yet implemented.\n *\n * @component\n */\nexport const DataTable = ({\n activeFilters = [],\n filters = [],\n ...props\n}: DataTableElementProps) => (\n <FiltersProvider activeFilters={activeFilters} filters={filters}>\n <DataTableInner\n {...props}\n activeFilters={activeFilters}\n filters={filters}\n />\n </FiltersProvider>\n)\n\nconst DataTableInner = ({\n activeFilters = [],\n className,\n canSelectAllPages,\n columns,\n currentPage = 1,\n data,\n disabledKeys,\n emptyState,\n errorState,\n filters = [],\n getRowAppearance,\n getRowId,\n getRowLink,\n hasNextPage = false,\n hasPreviousPage = false,\n id,\n initialDefaultViewId = \"initial\",\n initialSavedViews,\n loadingState = \"idle\",\n paginationType = \"paged\",\n resultCount,\n resultNoun,\n scrollContainerRef,\n scrollContainerSelector = \".content-wrap\",\n rowActions,\n searchable,\n selectable,\n selectedKeys: controlledSelectedKeys,\n staticViews: staticViewsProp,\n stickyHeader,\n sortBy,\n tableActions,\n totalDisabledCount,\n totalPages,\n visibleColumnNames,\n onActiveFiltersChange = () => {},\n onDefaultViewIdChange: onDefaultViewIdChangeProp,\n onNextPageClick,\n onPageChange,\n onPreviousPageClick,\n onRowClick,\n onSavedViewCreate: onSavedViewCreateProp,\n onSavedViewDelete: onSavedViewDeleteProp,\n onSavedViewReorder,\n onSavedViewUpdate: onSavedViewUpdateProp,\n onSelectedChange,\n onSortChange,\n onVisibleColumnNamesChange,\n ...restProps\n}: DataTableElementProps) => {\n const hasRowPressAction = Boolean(onRowClick || getRowLink)\n const rowsAreInteractive = hasRowPressAction || Boolean(selectable)\n const combinedClassName = classNames(\"tds-data-table-grid\", className)\n const sortDescriptor = useSortDescriptor(sortBy)\n const { hasScrollContainer, wrapperRef } = useStickyHeader(\n stickyHeader,\n scrollContainerRef,\n scrollContainerSelector\n )\n const scrollRef = useRef<HTMLDivElement>(null)\n // A `Button` or `Link` in a cell keeps its presses to itself, so activating\n // one doesn't also press the row it's in.\n const cellBoundaryProps = useRowPressBoundary(scrollRef, rowsAreInteractive)\n\n // React Aria only invokes `renderEmptyState` when the collection is empty, so\n // the loading spinner and error message only take over the body while `data`\n // is empty; once rows exist they always render.\n const emptyStateContent = getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n })\n const renderEmptyState = emptyStateContent\n ? () => emptyStateContent\n : undefined\n // With rows on screen, loading keeps them in place under a spinner instead.\n const showLoadingOverlay = loadingState === \"loading\" && data.length > 0\n\n // Keyed on column names rather than the `columns` array identity so a fresh\n // `columns` literal each render doesn't rebuild every formatter. `columns` is\n // intentionally omitted from the deps.\n const columnKey = columns.map((c) => `${c.name}/${c.type}`).join(\"|\")\n const locale = useTapestryLocale()\n const preparedColumns = useMemo<PreparedColumn[]>(\n () => columns.map((column) => prepareColumn(column, locale)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [columnKey, locale]\n )\n\n const {\n currentVisibleColumnNames,\n hideableColumns,\n isColumnVisible,\n onColumnVisibilityChange,\n resolveVisibleColumnNames,\n visibleHideableColumns,\n } = useColumnVisibility({\n columns,\n onVisibleColumnNamesChange,\n visibleColumnNames,\n })\n\n const staticViews = useMemo(\n () => staticViewsProp?.map(withoutSearch),\n [staticViewsProp]\n )\n const {\n defaultViewId,\n isReordering: isSavedViewReordering,\n onCreate: onSavedViewCreate,\n onDelete: onSavedViewDelete,\n onReorder: onSavedViewMove,\n onSetDefault: onDefaultViewIdChange,\n onUpdate: onSavedViewUpdate,\n savedViews,\n } = useSavedViewsState({\n initialDefaultViewId,\n initialSavedViews,\n onCreate: onSavedViewCreateProp,\n onDelete: onSavedViewDeleteProp,\n onReorder: onSavedViewReorder,\n onSetDefault: onDefaultViewIdChangeProp,\n onUpdate: onSavedViewUpdateProp,\n })\n const hasInitialView = staticViews?.some(({ id }) => id === initialView.id)\n const staticViewsWithInitial = hasInitialView\n ? (staticViews ?? [])\n : [initialView, ...(staticViews ?? [])]\n const views = [...staticViewsWithInitial, ...(savedViews ?? [])]\n\n const visiblePreparedColumns = useMemo(\n () => preparedColumns.filter(({ column }) => isColumnVisible(column)),\n [preparedColumns, isColumnVisible]\n )\n\n // The row header names each row for assistive tech. Avatars are decorative,\n // so it goes to the first visible column that isn't one, or to the first\n // column when every visible column is an avatar.\n const rowHeaderColumn =\n visiblePreparedColumns.find(({ column }) => column.type !== \"avatar\") ??\n visiblePreparedColumns[0]\n\n const selectionModel = useDataTableSelection({\n canSelectAllPages,\n data,\n disabledKeys,\n getRowId,\n hasRowPressAction,\n onSelectedChange,\n resultCount,\n selectable,\n selectedKeys: controlledSelectedKeys,\n totalDisabledCount,\n })\n const {\n commitSelection,\n headerCheckboxProps,\n rowPressSelects,\n selectedCount,\n selection,\n tableProps: selectionProps,\n totalCount,\n } = selectionModel\n\n // Selected rows a filter hides would still be acted on, so any filter or\n // search change the user makes clears the selection.\n const changeActiveFiltersClearingSelection = (\n activeFilters: ActiveFilter[]\n ) => {\n const hasSelection = !Array.isArray(selection) || selection.length > 0\n if (hasSelection) commitSelection([])\n onActiveFiltersChange(activeFilters)\n }\n\n // A lone page has nothing to navigate to, so the paged controls stay out of\n // the frame entirely rather than rendering a single inert page marker. The\n // indexed type has no page count to measure against — stepping is the only\n // way through the set — so asking for it always renders the controls, and a\n // set that fits on one page shows both buttons disabled.\n const isIndexedPagination = paginationType === \"indexed\"\n const showPagination =\n isIndexedPagination || (totalPages !== undefined && totalPages > 1)\n\n // A filter, search, or sort change from the table makes the current page\n // meaningless, so it goes back to the first page. Changes the app makes to\n // `activeFilters` or `sortBy` itself, including on mount, don't. The indexed\n // type has no page number, so the app resets its own cursor.\n const resetPage = () => {\n if (!isIndexedPagination && currentPage !== 1) onPageChange?.(1)\n }\n\n const announcedActiveFiltersChange = useResultsAnnouncement({\n isPageCount: showPagination && resultCount === undefined,\n loadingState,\n onActiveFiltersChange: (activeFilters) => {\n changeActiveFiltersClearingSelection(activeFilters)\n resetPage()\n },\n resultNoun,\n totalCount,\n })\n\n const {\n chipFilters,\n clearFilters,\n onChipFiltersChange,\n onSearchChange,\n searchQuery,\n } = useSearchFilter(activeFilters, announcedActiveFiltersChange)\n\n // Shared by the views bar and the filters shelf, so a save from the\n // shelf shows its status in the bar.\n const saveStatus = useSaveStatus()\n\n // The view being applied, until the table's state matches it, so its actions\n // don't flash in before the app passes the view's filters back.\n const [applyingView, setApplyingView] = useState<View>()\n\n // Search isn't part of a view, so applying one keeps the current search.\n const applyView = (view: View) => {\n setApplyingView(view)\n onChipFiltersChange(view.activeFilters)\n if (view.sort) onSortChange?.(view.sort)\n if (view.visibleColumnNames) {\n onColumnVisibilityChange(view.visibleColumnNames)\n }\n }\n\n // What a view saves from the table. Visible columns are saved even when no\n // column can be hidden, so a hideable column added later stays out of the\n // view. Sort is left out when there isn't one.\n const currentState = {\n activeFilters: chipFilters,\n ...(sortBy && { sort: sortBy }),\n visibleColumnNames: currentVisibleColumnNames,\n }\n\n // Compares a view against the table by the columns it shows today, so a\n // view that names a column that's gone, or leaves out an always-visible\n // one, still matches.\n const isModified = (view: View) =>\n isViewModified(\n view.visibleColumnNames\n ? {\n ...view,\n visibleColumnNames: resolveVisibleColumnNames(\n view.visibleColumnNames\n ),\n }\n : view,\n currentState\n )\n\n // Opens on the default view only when the table's state matches it, so a\n // table seeded from elsewhere, such as the URL, shows the view it's in.\n const { activeView, select, selectWhenSaved } = useActiveView(views, () => {\n const defaultView = views.find(({ id }) => id === defaultViewId)\n if (defaultView && !isModified(defaultView)) return defaultView\n return views.find((view) => !isModified(view))\n })\n\n if (applyingView && !isModified(applyingView)) setApplyingView(undefined)\n\n // A filter, sort, or column edit also ends applying, so the actions still\n // show when the table can't match a view, such as an app that doesn't apply\n // the view's sort or columns.\n const changeChipFilters = (filters: ActiveFilter[]) => {\n setApplyingView(undefined)\n onChipFiltersChange(filters)\n }\n\n const changeColumnVisibility = (names: string[]) => {\n setApplyingView(undefined)\n onColumnVisibilityChange(names)\n }\n\n // Only a user-created view can be saved over. Pending filters aren't applied\n // yet, so they don't count as changes.\n const isActiveSavedViewModified =\n activeView !== undefined &&\n activeView.id !== applyingView?.id &&\n isViewEditable(activeView, savedViews ?? []) &&\n isModified(activeView)\n\n // A changed system view has no Update or Discard, so the bar stops showing it\n // as selected. Picking it again, such as after Clear filters, reapplies it.\n const selectedView =\n activeView &&\n (activeView.id === applyingView?.id ||\n isViewEditable(activeView, savedViews ?? []) ||\n !isModified(activeView))\n ? activeView\n : undefined\n\n // Associate the visible results count with the table so screen readers\n // announce it as a description of the table. `Table` doesn't support a real\n // `<caption>` (its children go through a collection builder), so we link the\n // count via `aria-describedby`, merging with any caller-supplied value.\n const stableId = useId()\n const tableId = id || `tds-data-table-${stableId}`\n const resultsCountId = `${tableId}-results-count`\n const describedBy = hasResultsCount(resultNoun)\n ? [restProps[\"aria-describedby\"], resultsCountId].filter(Boolean).join(\" \")\n : restProps[\"aria-describedby\"]\n\n // A caller-supplied `aria-label` always wins; otherwise the results noun\n // provides the table's accessible name so a label is present whenever a noun\n // is given. Array nouns are transformed to their plural form.\n const resultNounLabel = resolveResultNounLabel(resultNoun)\n const ariaLabel = restProps[\"aria-label\"] || resultNounLabel\n const paginationLabel = resultNounLabel\n ? `${resultNounLabel} table pagination`\n : undefined\n const searchLabel = ariaLabel ? `Search ${ariaLabel}` : \"Search table\"\n\n const hasActions = (tableActions?.length ?? 0) > 0\n const hasFilters = (filters.length ?? 0) > 0\n const hasViewSettingsToggle = hideableColumns.length > 0\n const hasTrailingControls = searchable || hasFilters || hasViewSettingsToggle\n const hasResults = hasResultsCount(resultNoun) || hasActions\n const showHeader = hasResults || Boolean(hasTrailingControls)\n const hasRowActions = (rowActions?.length ?? 0) > 0\n const { pendingFilters } = usePendingFilters()\n const hasEditableFilters = chipFilters.length + pendingFilters.length > 0\n // A modified view's actions live in the shelf, so it shows them even\n // without filters, such as after a column or sort change.\n const hasShelfContent = hasEditableFilters || isActiveSavedViewModified\n // Where focus goes once the shelf's actions are gone in a table without\n // filters, since it has no Add filter.\n const rootRef = useRef<HTMLDivElement>(null)\n const focusSelectedView = useCallback(() => {\n rootRef.current\n ?.querySelector<HTMLElement>(\n '.tds-data-table-views [role=\"option\"][aria-selected=\"true\"]'\n )\n ?.focus()\n }, [])\n const { filterOpenRequest } = useFilterOpenRequest()\n const [isShelfExpanded, toggleShelf] = useShelfExpanded(\n chipFilters.length + pendingFilters.length,\n pendingFilters.length,\n filterOpenRequest,\n isActiveSavedViewModified\n )\n // Keeps collapsed shelf content out of tab order/a11y tree. Needs a string,\n // not a boolean — `inert` isn't in `@types/react@18` or recognized by\n // react-dom as a boolean attribute before React 19.\n const shelfInertProps = { inert: isShelfExpanded ? undefined : \"\" } as {\n inert?: string\n }\n return (\n <div\n ref={rootRef}\n className={classNames(\"tds-data-table\", {\n \"tds-data-table--sticky-header\": hasScrollContainer,\n })}\n >\n {(Array.isArray(staticViews) || Array.isArray(savedViews)) && (\n <ViewsBar\n activeView={selectedView}\n currentState={currentState}\n defaultViewId={defaultViewId}\n isReordering={isSavedViewReordering}\n saveStatus={saveStatus}\n savedViews={savedViews ?? []}\n select={select}\n selectWhenSaved={selectWhenSaved}\n staticViews={staticViewsWithInitial}\n onApply={applyView}\n onCreate={onSavedViewCreate}\n onDelete={onSavedViewDelete}\n onReorder={onSavedViewMove}\n onSetDefault={onDefaultViewIdChange}\n onUpdate={onSavedViewUpdate}\n />\n )}\n <div className=\"tds-data-table-frame\">\n <DataTableSelectionContext.Provider value={selectionModel}>\n {showHeader && (\n <div className=\"tds-data-table-frame-header\">\n <div className=\"tds-data-table-frame-header-content\">\n {hasResults && (\n <div className=\"tds-data-table-frame-header-results\">\n <ResultsCount\n id={resultsCountId}\n resultNoun={resultNoun}\n selectable={selectable}\n selectedCount={selectedCount}\n totalCount={totalCount}\n />\n {hasActions && (\n <TableActions\n actions={\n tableActions as TableAction<DataTableSelection>[]\n }\n resultNoun={resultNoun}\n />\n )}\n </div>\n )}\n {hasTrailingControls && (\n <div className=\"tds-data-table-frame-header-controls\">\n {searchable && (\n <TableSearch\n label={searchLabel}\n tableId={tableId}\n value={searchQuery}\n onChange={onSearchChange}\n />\n )}\n {hasFilters && (\n <FilterControls\n activeFilters={chipFilters}\n filters={filters}\n isShelfExpanded={isShelfExpanded}\n onToggleShelf={toggleShelf}\n />\n )}\n {hasViewSettingsToggle && (\n <ViewSettingsToggle\n columns={hideableColumns}\n onColumnVisibilityChange={changeColumnVisibility}\n visibleColumnNames={visibleHideableColumns}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )}\n {(hasFilters || hasShelfContent) && (\n <div\n className={classNames(\"tds-data-table-filters-shelf\", {\n \"tds-data-table-filters-shelf--collapsed\": !isShelfExpanded,\n })}\n {...shelfInertProps}\n >\n <div className=\"tds-data-table-filters\">\n {hasShelfContent && (\n <ActiveFilters\n activeFilters={chipFilters}\n activeSavedView={\n isActiveSavedViewModified ? activeView : undefined\n }\n currentState={currentState}\n focusSelectedView={focusSelectedView}\n hasFilters={hasFilters}\n saveStatus={saveStatus}\n selectSavedViewWhenSaved={selectWhenSaved}\n onActiveFiltersChange={changeChipFilters}\n onClear={clearFilters}\n onSavedViewApply={applyView}\n onSavedViewCreate={onSavedViewCreate}\n onSavedViewUpdate={onSavedViewUpdate}\n />\n )}\n </div>\n </div>\n )}\n <SelectAllBanner resultNoun={resultNoun} />\n </DataTableSelectionContext.Provider>\n <div ref={wrapperRef} className=\"tds-data-table-scroll-wrapper\">\n <div\n ref={scrollRef}\n className=\"tds-data-table-scroll\"\n // Set here because RAC's `Table` doesn't forward `aria-busy`.\n aria-busy={showLoadingOverlay || undefined}\n >\n <Table\n {...restProps}\n {...selectionProps}\n {...(ariaLabel ? { \"aria-label\": ariaLabel } : {})}\n {...(describedBy ? { \"aria-describedby\": describedBy } : {})}\n // RAC's `Table` forwards `id` to the underlying table element at\n // runtime (via `filterDOMProps({ global: true })`) but omits `id`\n // from its prop types, so spread it through a cast.\n {...({ id: tableId } as Partial<AriaTableProps>)}\n className={combinedClassName}\n // Pinned rather than exposed as a prop: `disabledKeys` only ever\n // turns off selection here, leaving the row clickable and\n // focusable. React Aria defaults this to \"all\", which would also\n // disable `onRowClick`/`getRowLink` and drop the row out of the\n // focus order, so it has to be set explicitly.\n disabledBehavior=\"selection\"\n disabledKeys={disabledKeys}\n sortDescriptor={sortDescriptor}\n onSortChange={(sort) => {\n setApplyingView(undefined)\n onSortChange?.(serializeSort(sort))\n resetPage()\n }}\n >\n <TableHeader className=\"tds-data-table-header\">\n {selectable && (\n <Column className=\"tds-data-table-column tds-data-table-column--selectable\">\n {headerCheckboxProps ? (\n <Checkbox\n {...headerCheckboxProps}\n aria-label=\"Select all\"\n slot={null}\n className=\"tds-data-table-selectable-checkbox\"\n />\n ) : (\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n )}\n </Column>\n )}\n {visiblePreparedColumns.map(({ align, column }) => (\n <Column\n key={column.name}\n id={column.name}\n isRowHeader={column === rowHeaderColumn?.column}\n className={classNames(\"tds-data-table-column\", {\n [`tds-data-table-column--align-${align}`]:\n align !== \"start\",\n \"tds-data-table-column--avatar\": column.type === \"avatar\",\n })}\n allowsSorting={column.sortable}\n >\n {column.hideLabel ? (\n <span className=\"tds-data-table-column-label--hidden\">\n {column.headerLabel}\n </span>\n ) : (\n column.headerLabel\n )}\n {column.sortable && (\n <Icon\n className=\"tds-data-table-column-icon tds-data-table-column-icon--sort\"\n symbol=\"general#up-caret\"\n aria-hidden={true}\n />\n )}\n </Column>\n ))}\n {hasRowActions && (\n <Column className=\"tds-data-table-column tds-data-table-column--actions\">\n <span className=\"tds-data-table-column-label--hidden\">\n Actions\n </span>\n </Column>\n )}\n </TableHeader>\n <TableBody\n className=\"tds-data-table-body\"\n renderEmptyState={renderEmptyState}\n >\n {data.map((row, rowIndex) => {\n const rowKey = getRowKey(row, rowIndex, getRowId)\n const appearance = getRowAppearance?.(row)\n return (\n <Row\n key={rowKey}\n id={rowKey}\n href={getRowLink?.(row)}\n onAction={onRowClick ? () => onRowClick(row) : undefined}\n className={classNames(\"tds-data-table-row\", {\n // A press fires the link/action only until something\n // is selected; after that it toggles selection.\n \"tds-data-table-row--has-action\":\n hasRowPressAction && !rowPressSelects,\n \"tds-data-table-row--interactive\": rowsAreInteractive,\n \"tds-data-table-row--press-selects\": rowPressSelects,\n [`tds-data-table-row--${appearance}`]:\n appearance && ROW_APPEARANCES.has(appearance),\n })}\n >\n {selectable && (\n <Cell className=\"tds-data-table-cell tds-data-table-cell--selectable\">\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n </Cell>\n )}\n {visiblePreparedColumns.map((prepared) => (\n <Cell\n key={prepared.column.name}\n {...cellBoundaryProps}\n data-pii={prepared.column.pii || undefined}\n className={classNames(\"tds-data-table-cell\", {\n [`tds-data-table-cell--align-${prepared.align}`]:\n prepared.align !== \"start\",\n \"tds-data-table-cell--avatar\":\n prepared.column.type === \"avatar\",\n \"tds-data-table-cell--numeric\": prepared.isNumeric,\n })}\n >\n {prepared.renderCell(row)}\n </Cell>\n ))}\n {hasRowActions && (\n <Cell\n {...cellBoundaryProps}\n className=\"tds-data-table-cell tds-data-table-cell--actions\"\n >\n <RowActions\n actions={rowActions!} // Safe to assert non-null here because of `hasRowActions`\n row={row}\n rowKey={rowKey}\n />\n </Cell>\n )}\n </Row>\n )\n })}\n </TableBody>\n </Table>\n </div>\n {showLoadingOverlay && (\n <div className=\"tds-data-table-loading-overlay\">\n <span className=\"tds-data-table-loading-label--hidden\">\n Loading\n </span>\n <span\n className=\"tds-data-table-loading-spinner\"\n aria-hidden=\"true\"\n >\n <LoadingSpinner />\n </span>\n <LoadingAnnouncement message=\"Loading\" />\n </div>\n )}\n </div>\n {showPagination && (\n <div className=\"tds-data-table-frame-footer\">\n {/*\n `Pagination`'s two shapes are a discriminated union, so each is\n spelled out in full rather than assembled from one prop bag.\n */}\n {isIndexedPagination ? (\n <Pagination\n aria-label={paginationLabel}\n hasNextPage={hasNextPage}\n hasPreviousPage={hasPreviousPage}\n onNextPageClick={onNextPageClick}\n onPreviousPageClick={onPreviousPageClick}\n type=\"indexed\"\n />\n ) : (\n <Pagination\n aria-label={paginationLabel}\n currentPage={currentPage}\n onPageChange={onPageChange}\n totalPages={totalPages!}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nDataTable.displayName = \"DataTable\"\n\n/**\n * Resolves the content rendered in the table body's empty-state slot based on\n * `loadingState`, falling back to `emptyState`. Returns `null` when nothing\n * should render (idle with no `emptyState`).\n */\nfunction getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n}: {\n emptyState: ReactNode\n errorState: ReactNode\n loadingState: DataTableLoadingState\n}): ReactNode {\n if (loadingState === \"loading\") {\n return (\n <div className=\"tds-data-table-loading\">\n <span className=\"tds-data-table-cell-label--hidden\">Loading</span>\n <span className=\"tds-data-table-loading-spinner\" aria-hidden=\"true\">\n <LoadingSpinner />\n </span>\n <LoadingAnnouncement message=\"Loading\" />\n </div>\n )\n }\n\n // Error and empty share the same container; they differ only in content.\n const content =\n loadingState === \"error\" ? (errorState ?? DEFAULT_ERROR_STATE) : emptyState\n if (content == null) return null\n\n return <div className=\"tds-data-table-empty\">{content}</div>\n}\n\nfunction useSortDescriptor(\n sortBy: Sort | undefined\n): SortDescriptor | undefined {\n return useMemo(() => {\n if (!sortBy) return undefined\n return deserializeSort(sortBy)\n }, [sortBy])\n}\n\nfunction deserializeSort(sort: Sort): SortDescriptor {\n if (sort.startsWith(\"-\"))\n return { column: sort.slice(1), direction: \"descending\" }\n return { column: sort, direction: \"ascending\" }\n}\n\nfunction serializeSort(sort: SortDescriptor): Sort {\n const column = String(sort.column)\n return sort.direction === \"descending\" ? `-${column}` : column\n}\n\nfunction useStickyHeader(\n stickyHeader: boolean | undefined,\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined\n) {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const [hasScrollContainer, setHasScrollContainer] = useState(false)\n\n useLayoutEffect(() => {\n setHasScrollContainer(false)\n if (!stickyHeader) return\n if (typeof ResizeObserver === \"undefined\") return\n const wrapper = wrapperRef.current\n if (!wrapper) return\n\n const scrollContainer = getScrollContainer(\n scrollContainerRef,\n scrollContainerSelector,\n wrapper\n )\n if (!scrollContainer) return\n\n setHasScrollContainer(true)\n\n let thead: HTMLElement | null = null\n\n const resizeObserver = new ResizeObserver(() => {\n if (!thead) {\n thead = wrapper.querySelector<HTMLElement>(\".tds-data-table-header\")\n if (!thead) return\n scrollContainer.style.setProperty(\n \"scroll-timeline-name\",\n \"--_sticky-header-scroll\"\n )\n }\n\n const { top: wrapperTop, bottom: wrapperBottom } =\n wrapper.getBoundingClientRect()\n const { top: scrollContainerTop } =\n scrollContainer.getBoundingClientRect()\n // Derive headerTop from the untransformed wrapper to avoid reading the\n // scroll-driven translateY that getBoundingClientRect() includes on thead.\n const headerTop = wrapperTop + wrapper.clientTop\n const start = scrollContainer.scrollTop + (headerTop - scrollContainerTop)\n const max = Math.max(0, wrapperBottom - headerTop - thead.offsetHeight)\n wrapper.style.setProperty(\"--_sticky-header-scroll-start\", `${start}px`)\n wrapper.style.setProperty(\"--_sticky-header-scroll-max\", `${max}px`)\n })\n\n resizeObserver.observe(wrapper)\n // The banner moves the wrapper without changing its size.\n if (wrapper.parentElement) resizeObserver.observe(wrapper.parentElement)\n resizeObserver.observe(scrollContainer)\n\n return () => {\n resizeObserver.disconnect()\n wrapper.style.removeProperty(\"--_sticky-header-scroll-start\")\n wrapper.style.removeProperty(\"--_sticky-header-scroll-max\")\n }\n }, [stickyHeader, scrollContainerRef, scrollContainerSelector])\n\n return { hasScrollContainer, wrapperRef }\n}\n\nfunction getScrollContainer(\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n const element =\n scrollContainerRef?.current ??\n getScrollContainerFromSelector(scrollContainerSelector, wrapper)\n if (element instanceof Window) return\n return element\n}\n\nfunction getScrollContainerFromSelector(\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n return scrollContainerSelector\n ? (wrapper.parentElement?.closest<HTMLElement>(scrollContainerSelector) ??\n undefined)\n : undefined\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwcA,MAAM,mBAAmB,GAAG,uBAAuB;AA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,EAAE,CAAA,EAAG,KAAK,CAAA,EAAA,CAAI,CAAC;YACxE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,6BAA6B,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI,CAAC;AACtE,QAAA,CAAC,CAAC;AAEF,QAAA,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC;;QAE/B,IAAI,OAAO,CAAC,aAAa;AAAE,YAAA,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;AACxE,QAAA,cAAc,CAAC,OAAO,CAAC,eAAe,CAAC;AAEvC,QAAA,OAAO,MAAK;YACV,cAAc,CAAC,UAAU,EAAE;AAC3B,YAAA,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,+BAA+B,CAAC;AAC7D,YAAA,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,6BAA6B,CAAC;AAC7D,QAAA,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;AAE/D,IAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE;AAC3C;AAEA,SAAS,kBAAkB,CACzB,kBAA4D,EAC5D,uBAA2C,EAC3C,OAAoB,EAAA;AAEpB,IAAA,MAAM,OAAO,GACX,kBAAkB,EAAE,OAAO;AAC3B,QAAA,8BAA8B,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAClE,IAAI,OAAO,YAAY,MAAM;QAAE;AAC/B,IAAA,OAAO,OAAO;AAChB;AAEA,SAAS,8BAA8B,CACrC,uBAA2C,EAC3C,OAAoB,EAAA;AAEpB,IAAA,OAAO;WACF,OAAO,CAAC,aAAa,EAAE,OAAO,CAAc,uBAAuB,CAAC;AACnE,YAAA,SAAS;UACX,SAAS;AACf;;;;"}
1
+ {"version":3,"file":"DataTable.js","sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["import \"./index.css\"\nimport \"./filters.css\"\n\nimport { LoadingAnnouncement, LoadingSpinner } from \"@components/internal\"\nimport { Pagination } from \"@components/internal/pagination\"\nimport Icon from \"@utilities/Icon\"\nimport { useTapestryLocale } from \"@utilities/locale\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n Cell,\n Checkbox,\n Column,\n Row,\n type SortDescriptor,\n Table,\n TableBody,\n TableHeader,\n type TableProps as AriaTableProps,\n} from \"react-aria-components/Table\"\n\nimport { ActiveFilters } from \"./ActiveFilters\"\nimport type { DataTableColumn } from \"./DataTableColumn\"\nimport { prepareColumn, type PreparedColumn } from \"./DataTableColumnTypes\"\nimport { type DataTableRowAppearance, getRowKey } from \"./DataTableRow\"\nimport { FiltersProvider } from \"./FilterContext\"\nimport { FilterControls } from \"./FilterControls\"\nimport { useFilterOpenRequest } from \"./FilterOpenRequest\"\nimport type { ActiveFilter, FilterNode } from \"./FilterTypes\"\nimport { usePendingFilters } from \"./PendingFilterContext\"\nimport {\n hasResultsCount,\n resolveResultNounLabel,\n type ResultNoun,\n ResultsCount,\n} from \"./ResultsCount\"\nimport { type RowAction, RowActions } from \"./RowActions\"\nimport { SelectAllBanner } from \"./SelectAllBanner\"\nimport { type TableAction, TableActions } from \"./TableActions\"\nimport { TableSearch } from \"./TableSearch\"\nimport { useActiveView } from \"./useActiveView\"\nimport { useColumnVisibility } from \"./useColumnVisibility\"\nimport {\n type DataTableSelection,\n DataTableSelectionContext,\n useDataTableSelection,\n} from \"./useDataTableSelection\"\nimport { useResultsAnnouncement } from \"./useResultsAnnouncement\"\nimport { useRowPressBoundary } from \"./useRowPressBoundary\"\nimport { useSavedViewsState } from \"./useSavedViewsState\"\nimport { useSaveStatus } from \"./useSaveStatus\"\nimport { useSearchFilter } from \"./useSearchFilter\"\nimport { useShelfExpanded } from \"./useShelfExpanded\"\nimport {\n initialView,\n isViewEditable,\n isViewModified,\n type SavedView,\n type StaticView,\n type View,\n withoutSearch,\n} from \"./views\"\nimport { ViewsBar } from \"./ViewsBar\"\nimport { ViewSettingsToggle } from \"./ViewSettingsToggle\"\n\nexport type {\n DataTableRowAppearance,\n DataTableSelection,\n ResultNoun,\n RowAction,\n TableAction,\n}\n\n/**\n * A PCO API order string: the column name for ascending (`\"lastName\"`), or\n * the name prefixed with a hyphen for descending (`\"-lastName\"`).\n */\nexport type Sort = string\n\nexport type DataTableLoadingState = \"error\" | \"idle\" | \"loading\"\n\ninterface DataTableBaseProps {\n activeFilters?: ActiveFilter[]\n /**\n * Columns define what data is displayed and how. Pass a stable reference\n * (e.g. a module constant or memoized value); columns are prepared per array\n * identity, so an inline array rebuilds each column's formatter every render.\n */\n columns: DataTableColumn[]\n /**\n * The 1-indexed current page. Only used by the default `\"paged\"` pagination,\n * where `totalPages` is set, and defaults to `1`.\n */\n currentPage?: number\n /** The array of rows to display. */\n data: unknown[]\n /**\n * Row keys that can't be selected. Keys are the values returned by `getRowId`\n * (or `row.id`, or the row's index) — the same keys used by `selectedKeys`.\n * Only selection is disabled: the row's checkbox renders disabled and \"select\n * all\" skips it, while the row itself stays clickable, navigable, and\n * focusable. Has no effect unless the table is `selectable`.\n */\n disabledKeys?: (number | string)[]\n /** Rendered in place of the table body when there is no data. */\n emptyState?: ReactNode\n /** Rendered in place of the table body when `loadingState` is `\"error\"`. */\n errorState?: ReactNode\n /**\n * The filter tree shown in the \"Add filter\" popover. Renders the filter\n * controls in the header when set; omit to leave filtering off entirely.\n * `q` is reserved for the search, so no filter can use it as its name.\n */\n filters?: FilterNode[]\n /**\n * Returns one of a fixed set of looks for the row, or `undefined` for the\n * default. Called on every render, so the appearance can depend on state\n * outside the row, such as a date picked elsewhere on the page. A row has\n * one appearance at a time; return the one that matters most.\n * - `\"reveal\"`: something outside the table points to the row. A highlight\n * plays when the row's appearance changes to `\"reveal\"`, then fades.\n * - `\"flagged\"`: the row needs attention. A persistent tint.\n * - `\"new\"`: the row was recently added. A persistent tint.\n * - `\"muted\"`: the row is less relevant. Subdued text.\n *\n * Reveal sits above selection and hover, which sit above flagged and new.\n * Color can't be the only signal, so flagged and new rows also need a\n * visible indicator in a cell, such as an icon or badge. A reveal doesn't\n * move focus; announce reveals that matter, such as \"3 events on November 9\".\n */\n getRowAppearance?: (row: unknown) => DataTableRowAppearance | undefined\n /** Returns a stable identity for each row. Defaults to `row.id`. */\n getRowId?: (row: unknown) => number | string\n /**\n * Returns a URL to navigate to when the row is clicked. Rows with a link\n * render as navigable elements (clickable, keyboard-focusable, and\n * openable in a new tab). Works alongside `onRowClick` and `selectable`.\n */\n getRowLink?: (row: unknown) => string\n /**\n * Whether a page exists after the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Next button.\n */\n hasNextPage?: boolean\n /**\n * Whether a page exists before the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Previous button.\n */\n hasPreviousPage?: boolean\n /**\n * An `id` for the table element. When omitted, a stable generated id is used\n * so the results count can be linked to the table via `aria-describedby`.\n */\n id?: string\n /**\n * The id of the default view. Defaults to `\"initial\"`. The table doesn't\n * apply it; it's selected on mount when the initial `activeFilters` (apart\n * from the search), sort, and visible columns match it. Otherwise the first\n * matching view is selected, or none. Later changes are ignored.\n */\n initialDefaultViewId?: NonNullable<View[\"id\"]>\n /**\n * Named sets of filters, sort, and visible columns the user can apply, shown\n * in array order. Can't use the id `\"initial\"`, which is reserved for the\n * initial view. Later changes are ignored; remount with a new `key` to start\n * from fresh views. In a Rails app, load them with tapestry-rails'\n * `SavedView.on_table(...).data_table_props` and save changes with\n * `useSavedViewsClient`.\n */\n initialSavedViews?: SavedView[]\n /**\n * Async loading state for the table body.\n * - `\"loading\"`: While `data` is empty, replaces the empty state with a\n * centered spinner. While `data` has rows, keeps them on screen with a\n * spinner over them until new `data` arrives, so a search doesn't blank\n * the table. When requests can overlap, apply only the latest response.\n * Set it while any request is in flight, so screen reader users hear\n * the new count when it ends. Keep `\"idle\"` for a refresh the user did\n * not start, such as polling, or the count is announced again.\n * - `\"error\"`: While `data` is empty, replaces the empty state with\n * `errorState` (or a default error message).\n * - `\"idle\"` (default): Normal rendering.\n */\n loadingState?: DataTableLoadingState\n /**\n * Called when the active filters change.\n * Provides an argument with the updated active filters array.\n */\n onActiveFiltersChange?: (activeFilters: ActiveFilter[]) => void\n /**\n * Called with the id of the view the user sets as the default, or\n * `\"initial\"` once the default view is deleted. Without it, the Set as\n * default action is hidden; on the default view it's disabled and reads\n * \"Default view\". The table shows the new default right away, and puts the\n * previous one back if the promise rejects, unless the user has set another\n * default since.\n */\n onDefaultViewIdChange?: (id: NonNullable<View[\"id\"]>) => Promise<void> | void\n /**\n * Called when the Next button is activated. Only used by\n * `paginationType=\"indexed\"`; load the following page's rows and pass them\n * back in through `data` in response.\n */\n onNextPageClick?: () => void\n /**\n * Called with the 1-indexed page the user navigated to. The table doesn't\n * page `data` itself — pass the rows for the new page back in through `data`\n * (and update `currentPage`) in response. Only used by the default `\"paged\"`\n * pagination; the indexed type has no page number to report.\n *\n * Also called with `1`, right after `onActiveFiltersChange` or\n * `onSortChange`, when the user changes the filters, search, sort, or view\n * away from the first page. Load from state set by all three, not inside\n * each callback, or the same change loads twice. Update `currentPage` when\n * it's called, not once the page loads, or a change made while a page is\n * loading won't go back to page 1.\n */\n onPageChange?: (page: number) => void\n /**\n * Called when the Previous button is activated. Only used by\n * `paginationType=\"indexed\"`; load the preceding page's rows and pass them\n * back in through `data` in response.\n */\n onPreviousPageClick?: () => void\n /**\n * Called with the row when it is clicked. Rows with a click handler render\n * as interactive elements (clickable and keyboard-focusable). When\n * `getRowLink` is also set, both run and the row navigates.\n */\n onRowClick?: (row: unknown) => void\n /**\n * Called with the new view when the user saves the current filters, sort,\n * and columns as a view, or duplicates a view. Without it, views can't be\n * created or duplicated. Return the saved view with its new id, or a promise\n * of it; that view is selected once it's passed back in `savedViews`, unless\n * it was duplicated from the manage views modal. A callback that returns\n * nothing doesn't type check, so resolve to the view after refetching, e.g.\n * `(view) => api.create(view).then(async (saved) => { await refetch(); return saved })`.\n */\n onSavedViewCreate?: (\n savedView: Omit<SavedView, \"id\">\n ) => Promise<SavedView> | SavedView\n /**\n * Called with the view once the user confirms deleting it, from the context\n * menu or the manage views modal. Without it, views can't be deleted. The\n * table removes the view right away, and puts it back in its place if the\n * promise rejects. Deleting the default view resets the default to\n * `\"initial\"`, which is restored too.\n */\n onSavedViewDelete?: (savedView: SavedView) => Promise<void> | void\n /**\n * Called when the user moves a saved view, with the saved view it now comes\n * after, or `null` when it's first. Save the new position and return a\n * promise. The table moves the view right away, and moves it back if the\n * promise rejects. Without it, the manage views modal has no drag handles.\n */\n onSavedViewReorder?: (\n savedView: SavedView,\n after: SavedView | null\n ) => Promise<void> | void\n /**\n * Called with the updated view, matched by `id`. Return the saved view, or a\n * promise of it. The table shows the change right away, then swaps in the\n * returned view, or puts the old one back if the promise rejects, unless\n * the view has changed again since. Without it, view names are read only.\n */\n onSavedViewUpdate?: (savedView: SavedView) => Promise<SavedView> | SavedView\n /** Callback invoked when the sort state changes. */\n onSortChange?: (sort: Sort) => void\n /**\n * Called with the visible column names, in `columns` order, when the\n * visibility toggle changes or a view is applied. Always-visible columns\n * are included and unknown names are dropped, so the value can be passed\n * straight back as `visibleColumnNames`. Column visibility is controlled,\n * so the table only updates once `visibleColumnNames` changes.\n */\n onVisibleColumnNamesChange?: (visibleColumnNames: string[]) => void\n /**\n * Which shape the page controls take, forwarded to the `Pagination` control's\n * `type`.\n * - `\"paged\"` (the default): a numbered run of pages. Driven by `totalPages`,\n * `currentPage`, and `onPageChange`, and rendered only once `totalPages` is\n * set and greater than `1`.\n * - `\"indexed\"`: a labeled Previous/Next pair, for a result set that can only\n * be stepped through — a cursor-paged API, say, which reports whether a\n * neighboring page exists but not how many there are. Driven by\n * `hasPreviousPage`/`hasNextPage` and `onPreviousPageClick`/\n * `onNextPageClick`; `totalPages` and `currentPage` play no part. With no\n * page count there's no threshold to hide the controls below, so they\n * always render — a single page of results shows both buttons disabled.\n * The table can't go back to the first page itself, so reset the cursor\n * when the filters or sort change.\n */\n paginationType?: \"indexed\" | \"paged\"\n /**\n * Overrides the number shown by the `resultNoun` count, which otherwise\n * uses the length of `data`. Use this when the table renders only part of\n * the result set — a paginated or virtualized table — so the count reflects\n * the whole set. It also sizes an all-pages selection when\n * `canSelectAllPages` is true, including the count used by table actions and\n * the select-all banner. Without a result count, the banner isn't offered\n * because the table can't accurately describe the all-pages selection.\n * It also sets the count announced to screen reader users after a filter\n * change or a load. Without it, a paginated table announces only the current page,\n * e.g. `\"25 results on this page\"`.\n */\n resultCount?: number\n /**\n * Displays the number of results (the length of `data`, or `resultCount`\n * when supplied) above the table, followed by a noun that matches the count.\n * Pass a string to use it as the singular noun and append `\"s\"` for the\n * plural (e.g. `\"result\"` → `\"results\"`), or a `[singular, plural]` tuple to\n * supply an irregular plural explicitly (e.g. `[\"person\", \"people\"]`). Pass\n * `true` to use `\"result\"`.\n * When `false` or omitted, no count is rendered. The count is formatted with\n * `Intl.NumberFormat` and the singular form is used only when the count is\n * exactly `1`. When the table is `selectable` and rows are selected, the\n * count instead reflects the selection as `\"{selected} of {total}\"`, e.g.\n * `\"2 of 100\"`, with a visually-hidden suffix naming the noun so assistive\n * tech reads the unambiguous `\"2 of 100 people selected\"`.\n * The count is linked to the table with `aria-describedby` so\n * screen readers announce it as a description of the table. When a string or\n * `[singular, plural]` tuple is provided, the noun also supplies the table's\n * `aria-label` in its plural form (e.g. `\"items\"` or `\"people\"`) unless an\n * `aria-label` is passed directly, which always takes precedence; `true`\n * never provides a label. The same plural noun also names the pagination\n * landmark (e.g. `\"people table pagination\"`), which otherwise falls back to\n * `\"Pagination\"`.\n */\n resultNoun?: ResultNoun\n /**\n * Displays a sticky column to the right that holds row-scoped actions.\n * Renders as a dropdown with 2+ actions or a single button with one. Every\n * row renders the same control, even when `hidden` leaves a row with one\n * action. Each action's `onAction` or `getHref` receives the row.\n */\n rowActions?: RowAction[]\n /** Ref to the scroll container the sticky header should track. Takes priority over `scrollContainerSelector`. Only used when `stickyHeader` is true. */\n scrollContainerRef?: React.RefObject<HTMLElement>\n /** CSS selector for the scroll container the sticky header should track. Only used when `stickyHeader` is true. Defaults to \".content-wrap\" */\n scrollContainerSelector?: string\n /**\n * Displays a search input above the table. The query is kept in\n * `activeFilters` as a `q` filter and reported through\n * `onActiveFiltersChange` once typing pauses. It isn't saved with\n * views, and applying a view leaves it alone.\n */\n searchable?: boolean\n /**\n * Enables row selection via checkboxes, including a \"select all\" checkbox in\n * the header for the loaded page. Without a row action (`onRowClick` or\n * `getRowLink`), pressing anywhere in a row toggles the row selection.\n */\n selectable?: boolean\n /** The current sort state for the table. */\n sortBy?: Sort\n /**\n * Read-only views from the app, listed before the saved views. Ids must not\n * overlap with `initialSavedViews`. Unless one has the id `\"initial\"`, an\n * \"All\" view is added first. A table that opens filtered should pass those\n * filters as a view with the id `\"initial\"`, which replaces \"All\" and is the\n * default. Once the table's filters, sort, or visible columns differ from a\n * static view, it isn't shown as selected; picking it again reapplies it.\n * Without `filters`, a view's filters don't show as chips, so the views bar\n * is the only place people see them.\n * Omit both `staticViews` and `initialSavedViews` to hide the views bar.\n */\n staticViews?: StaticView[]\n /** Enables a sticky header that tracks an outer scroll container. Progressive enhancement: Relies on `animation-timeline: scroll()`, which isn't supported in all browsers (e.g. Firefox) — the header scrolls with the table body instead of sticking in those cases. */\n stickyHeader?: boolean\n /**\n * The number of disabled rows across the whole result set. Used to size an\n * all-pages selection when disabled rows exist on unloaded pages. Replaces\n * the count inferred from `disabledKeys` rather than adding to it. Values are\n * clamped to the result count, and zero is used as supplied.\n */\n totalDisabledCount?: number\n /**\n * The total number of pages in the result set. Setting it renders the page\n * controls below the table; leaving it unset renders no pagination at all.\n * A single page has nothing to navigate to, so the controls only render once\n * there are two or more pages. Only used by the default `\"paged\"` pagination\n * — an indexed result set has no page count, which is the reason to reach for\n * `paginationType=\"indexed\"` in the first place.\n *\n * The table displays whatever rows it is given — paging is the caller's job.\n * `data` should hold only the current page's rows, `resultCount` the size of\n * the whole result set, and `onPageChange` should load the next page. The\n * table goes back to page 1 through `onPageChange` when the user changes the\n * filters, search, sort, or view; when the app changes them itself, it sets\n * `currentPage` too.\n */\n totalPages?: number\n /**\n * The names of the columns currently visible. Only columns marked `hideable`\n * are affected — every other column stays visible. Omitting this leaves all\n * columns visible. Once it's set, a hideable column it doesn't name is\n * hidden, so a column added later stays hidden in a stored value until the\n * user shows it. Unknown names are ignored and display order always follows\n * `columns`.\n */\n visibleColumnNames?: string[]\n}\n\ninterface DataTableExplicitSelectionProps {\n /** Keeps selection values as arrays of row keys. */\n canSelectAllPages?: false\n /**\n * Called with the selected row keys whenever selection changes. Called with\n * `[]` when the user changes a filter or the search, so actions never apply\n * to rows the new filters hide.\n */\n onSelectedChange?: (keys: (number | string)[]) => void\n /** The selected row keys. */\n selectedKeys?: (number | string)[]\n /** Table actions whose callbacks receive the selected row keys. */\n tableActions?: TableAction[]\n}\n\ninterface DataTableAllPagesSelectionProps {\n /**\n * Enables tagged selection values that can represent every page plus\n * exclusions. Explicit arrays and the header checkbox remain page-scoped.\n * When `resultCount` proves more selectable results exist, selecting the\n * loaded page reveals a banner that widens the selection to every page or\n * clears it again. This works with both paged and indexed pagination.\n */\n canSelectAllPages: true\n /**\n * Called with the current explicit or all-pages selection. Called with `[]`\n * when the user changes a filter or the search, so actions never apply to\n * rows the new filters hide.\n */\n onSelectedChange?: (selection: DataTableSelection) => void\n /**\n * The current explicit or all-pages selection. Use\n * `{ keys: \"all\", excludedKeys: [] }` for every selectable result; a bare\n * `\"all\"` value is not accepted.\n */\n selectedKeys?: DataTableSelection\n /** Table actions whose callbacks receive the current selection. */\n tableActions?: TableAction<DataTableSelection>[]\n}\n\nexport type DataTableProps = DataTableBaseProps &\n (DataTableAllPagesSelectionProps | DataTableExplicitSelectionProps)\n\nconst DEFAULT_ERROR_STATE = \"Something went wrong.\"\n\nconst ROW_APPEARANCES = new Set<string>([\"flagged\", \"muted\", \"new\", \"reveal\"])\n\ntype AriaTablePropsToOmit = \"children\" | \"slot\"\n\ntype AriaTablePropsToInclude = never\n\nexport type DataTableElementProps = CombineAriaPropsWithCustomProps<\n AriaTableProps,\n DataTableProps,\n AriaTablePropsToOmit,\n AriaTablePropsToInclude\n>\n\n/**\n * A table for displaying tabular data. Built on React Aria's `Table`.\n *\n * Each column declares a `type` that controls how its cell values are\n * formatted: `string`, `number`, `currency`, `date`, `datetime`, `boolean`,\n * `enum`, and `custom`. A column's `render` function always takes precedence\n * over the built-in type formatting.\n *\n * Setting `totalPages` renders page controls below the table; the table itself\n * never slices `data`, so `onPageChange` is where the caller loads the page.\n * `paginationType=\"indexed\"` swaps the numbered run for a labeled\n * Previous/Next pair, for a result set with no known page count.\n *\n * Filtering, presets, and other RFC features are not yet implemented.\n *\n * @component\n */\nexport const DataTable = ({\n activeFilters = [],\n filters = [],\n ...props\n}: DataTableElementProps) => (\n <FiltersProvider activeFilters={activeFilters} filters={filters}>\n <DataTableInner\n {...props}\n activeFilters={activeFilters}\n filters={filters}\n />\n </FiltersProvider>\n)\n\nconst DataTableInner = ({\n activeFilters = [],\n className,\n canSelectAllPages,\n columns,\n currentPage = 1,\n data,\n disabledKeys,\n emptyState,\n errorState,\n filters = [],\n getRowAppearance,\n getRowId,\n getRowLink,\n hasNextPage = false,\n hasPreviousPage = false,\n id,\n initialDefaultViewId = \"initial\",\n initialSavedViews,\n loadingState = \"idle\",\n paginationType = \"paged\",\n resultCount,\n resultNoun,\n scrollContainerRef,\n scrollContainerSelector = \".content-wrap\",\n rowActions,\n searchable,\n selectable,\n selectedKeys: controlledSelectedKeys,\n staticViews: staticViewsProp,\n stickyHeader,\n sortBy,\n tableActions,\n totalDisabledCount,\n totalPages,\n visibleColumnNames,\n onActiveFiltersChange = () => {},\n onDefaultViewIdChange: onDefaultViewIdChangeProp,\n onNextPageClick,\n onPageChange,\n onPreviousPageClick,\n onRowClick,\n onSavedViewCreate: onSavedViewCreateProp,\n onSavedViewDelete: onSavedViewDeleteProp,\n onSavedViewReorder,\n onSavedViewUpdate: onSavedViewUpdateProp,\n onSelectedChange,\n onSortChange,\n onVisibleColumnNamesChange,\n ...restProps\n}: DataTableElementProps) => {\n const hasRowPressAction = Boolean(onRowClick || getRowLink)\n const rowsAreInteractive = hasRowPressAction || Boolean(selectable)\n const combinedClassName = classNames(\"tds-data-table-grid\", className)\n const sortDescriptor = useSortDescriptor(sortBy)\n const { hasScrollContainer, wrapperRef } = useStickyHeader(\n stickyHeader,\n scrollContainerRef,\n scrollContainerSelector\n )\n const scrollRef = useRef<HTMLDivElement>(null)\n // A `Button` or `Link` in a cell keeps its presses to itself, so activating\n // one doesn't also press the row it's in.\n const cellBoundaryProps = useRowPressBoundary(scrollRef, rowsAreInteractive)\n\n // React Aria only invokes `renderEmptyState` when the collection is empty, so\n // the loading spinner and error message only take over the body while `data`\n // is empty; once rows exist they always render.\n const emptyStateContent = getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n })\n const renderEmptyState = emptyStateContent\n ? () => emptyStateContent\n : undefined\n // With rows on screen, loading keeps them in place under a spinner instead.\n const showLoadingOverlay = loadingState === \"loading\" && data.length > 0\n\n // Keyed on column names rather than the `columns` array identity so a fresh\n // `columns` literal each render doesn't rebuild every formatter. `columns` is\n // intentionally omitted from the deps.\n const columnKey = columns.map((c) => `${c.name}/${c.type}`).join(\"|\")\n const locale = useTapestryLocale()\n const preparedColumns = useMemo<PreparedColumn[]>(\n () => columns.map((column) => prepareColumn(column, locale)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [columnKey, locale]\n )\n\n const {\n currentVisibleColumnNames,\n hideableColumns,\n isColumnVisible,\n onColumnVisibilityChange,\n resolveVisibleColumnNames,\n visibleHideableColumns,\n } = useColumnVisibility({\n columns,\n onVisibleColumnNamesChange,\n visibleColumnNames,\n })\n\n const staticViews = useMemo(\n () => staticViewsProp?.map(withoutSearch),\n [staticViewsProp]\n )\n const {\n defaultViewId,\n isReordering: isSavedViewReordering,\n onCreate: onSavedViewCreate,\n onDelete: onSavedViewDelete,\n onReorder: onSavedViewMove,\n onSetDefault: onDefaultViewIdChange,\n onUpdate: onSavedViewUpdate,\n savedViews,\n } = useSavedViewsState({\n initialDefaultViewId,\n initialSavedViews,\n onCreate: onSavedViewCreateProp,\n onDelete: onSavedViewDeleteProp,\n onReorder: onSavedViewReorder,\n onSetDefault: onDefaultViewIdChangeProp,\n onUpdate: onSavedViewUpdateProp,\n })\n const hasInitialView = staticViews?.some(({ id }) => id === initialView.id)\n const staticViewsWithInitial = hasInitialView\n ? (staticViews ?? [])\n : [initialView, ...(staticViews ?? [])]\n const views = [...staticViewsWithInitial, ...(savedViews ?? [])]\n\n const visiblePreparedColumns = useMemo(\n () => preparedColumns.filter(({ column }) => isColumnVisible(column)),\n [preparedColumns, isColumnVisible]\n )\n\n // The row header names each row for assistive tech. Avatars are decorative,\n // so it goes to the first visible column that isn't one, or to the first\n // column when every visible column is an avatar.\n const rowHeaderColumn =\n visiblePreparedColumns.find(({ column }) => column.type !== \"avatar\") ??\n visiblePreparedColumns[0]\n\n const selectionModel = useDataTableSelection({\n canSelectAllPages,\n data,\n disabledKeys,\n getRowId,\n hasRowPressAction,\n onSelectedChange,\n resultCount,\n selectable,\n selectedKeys: controlledSelectedKeys,\n totalDisabledCount,\n })\n const {\n commitSelection,\n headerCheckboxProps,\n rowPressSelects,\n selectedCount,\n selection,\n tableProps: selectionProps,\n totalCount,\n } = selectionModel\n\n // Selected rows a filter hides would still be acted on, so any filter or\n // search change the user makes clears the selection.\n const changeActiveFiltersClearingSelection = (\n activeFilters: ActiveFilter[]\n ) => {\n const hasSelection = !Array.isArray(selection) || selection.length > 0\n if (hasSelection) commitSelection([])\n onActiveFiltersChange(activeFilters)\n }\n\n // A lone page has nothing to navigate to, so the paged controls stay out of\n // the frame entirely rather than rendering a single inert page marker. The\n // indexed type has no page count to measure against — stepping is the only\n // way through the set — so asking for it always renders the controls, and a\n // set that fits on one page shows both buttons disabled.\n const isIndexedPagination = paginationType === \"indexed\"\n const showPagination =\n isIndexedPagination || (totalPages !== undefined && totalPages > 1)\n\n // A filter, search, or sort change from the table makes the current page\n // meaningless, so it goes back to the first page. Changes the app makes to\n // `activeFilters` or `sortBy` itself, including on mount, don't. The indexed\n // type has no page number, so the app resets its own cursor.\n const resetPage = () => {\n if (!isIndexedPagination && currentPage !== 1) onPageChange?.(1)\n }\n\n const announcedActiveFiltersChange = useResultsAnnouncement({\n isPageCount: showPagination && resultCount === undefined,\n loadingState,\n onActiveFiltersChange: (activeFilters) => {\n changeActiveFiltersClearingSelection(activeFilters)\n resetPage()\n },\n resultNoun,\n totalCount,\n })\n\n const {\n chipFilters,\n clearFilters,\n onChipFiltersChange,\n onSearchChange,\n searchQuery,\n } = useSearchFilter(activeFilters, announcedActiveFiltersChange)\n\n // Shared by the views bar and the filters shelf, so a save from the\n // shelf shows its status in the bar.\n const saveStatus = useSaveStatus()\n\n // The view being applied, until the table's state matches it, so its actions\n // don't flash in before the app passes the view's filters back.\n const [applyingView, setApplyingView] = useState<View>()\n\n // Search isn't part of a view, so applying one keeps the current search.\n const applyView = (view: View) => {\n setApplyingView(view)\n onChipFiltersChange(view.activeFilters)\n if (view.sort) onSortChange?.(view.sort)\n if (view.visibleColumnNames) {\n onColumnVisibilityChange(view.visibleColumnNames)\n }\n }\n\n // What a view saves from the table. Visible columns are saved even when no\n // column can be hidden, so a hideable column added later stays out of the\n // view. Sort is left out when there isn't one.\n const currentState = {\n activeFilters: chipFilters,\n ...(sortBy && { sort: sortBy }),\n visibleColumnNames: currentVisibleColumnNames,\n }\n\n // Compares a view against the table by the columns it shows today, so a\n // view that names a column that's gone, or leaves out an always-visible\n // one, still matches.\n const isModified = (view: View) =>\n isViewModified(\n view.visibleColumnNames\n ? {\n ...view,\n visibleColumnNames: resolveVisibleColumnNames(\n view.visibleColumnNames\n ),\n }\n : view,\n currentState\n )\n\n // Opens on the default view only when the table's state matches it, so a\n // table seeded from elsewhere, such as the URL, shows the view it's in.\n const { activeView, select, selectWhenSaved } = useActiveView(views, () => {\n const defaultView = views.find(({ id }) => id === defaultViewId)\n if (defaultView && !isModified(defaultView)) return defaultView\n return views.find((view) => !isModified(view))\n })\n\n if (applyingView && !isModified(applyingView)) setApplyingView(undefined)\n\n // A filter, sort, or column edit also ends applying, so the actions still\n // show when the table can't match a view, such as an app that doesn't apply\n // the view's sort or columns.\n const changeChipFilters = (filters: ActiveFilter[]) => {\n setApplyingView(undefined)\n onChipFiltersChange(filters)\n }\n\n const changeColumnVisibility = (names: string[]) => {\n setApplyingView(undefined)\n onColumnVisibilityChange(names)\n }\n\n // Only a user-created view can be saved over. Pending filters aren't applied\n // yet, so they don't count as changes.\n const isActiveSavedViewModified =\n activeView !== undefined &&\n activeView.id !== applyingView?.id &&\n isViewEditable(activeView, savedViews ?? []) &&\n isModified(activeView)\n\n // A changed system view has no Update or Discard, so the bar stops showing it\n // as selected. Picking it again, such as after Clear filters, reapplies it.\n const selectedView =\n activeView &&\n (activeView.id === applyingView?.id ||\n isViewEditable(activeView, savedViews ?? []) ||\n !isModified(activeView))\n ? activeView\n : undefined\n\n // Associate the visible results count with the table so screen readers\n // announce it as a description of the table. `Table` doesn't support a real\n // `<caption>` (its children go through a collection builder), so we link the\n // count via `aria-describedby`, merging with any caller-supplied value.\n const stableId = useId()\n const tableId = id || `tds-data-table-${stableId}`\n const resultsCountId = `${tableId}-results-count`\n const describedBy = hasResultsCount(resultNoun)\n ? [restProps[\"aria-describedby\"], resultsCountId].filter(Boolean).join(\" \")\n : restProps[\"aria-describedby\"]\n\n // A caller-supplied `aria-label` always wins; otherwise the results noun\n // provides the table's accessible name so a label is present whenever a noun\n // is given. Array nouns are transformed to their plural form.\n const resultNounLabel = resolveResultNounLabel(resultNoun)\n const ariaLabel = restProps[\"aria-label\"] || resultNounLabel\n const paginationLabel = resultNounLabel\n ? `${resultNounLabel} table pagination`\n : undefined\n const searchLabel = ariaLabel ? `Search ${ariaLabel}` : \"Search table\"\n\n const hasActions = (tableActions?.length ?? 0) > 0\n const hasFilters = (filters.length ?? 0) > 0\n const hasViewSettingsToggle = hideableColumns.length > 0\n const hasTrailingControls = searchable || hasFilters || hasViewSettingsToggle\n const hasResults = hasResultsCount(resultNoun) || hasActions\n const showHeader = hasResults || Boolean(hasTrailingControls)\n const hasRowActions = (rowActions?.length ?? 0) > 0\n const { pendingFilters } = usePendingFilters()\n // A chip needs its filter in `filters` to render, so a table without them\n // shows no chips. A view's filters still apply, and still select the view.\n const shelfFilters = hasFilters ? chipFilters : []\n const hasEditableFilters = shelfFilters.length + pendingFilters.length > 0\n // A modified view's actions live in the shelf, so it shows them even\n // without filters, such as after a column or sort change.\n const hasShelfContent = hasEditableFilters || isActiveSavedViewModified\n // Where focus goes once the shelf's actions are gone in a table without\n // filters, since it has no Add filter.\n const rootRef = useRef<HTMLDivElement>(null)\n const focusSelectedView = useCallback(() => {\n rootRef.current\n ?.querySelector<HTMLElement>(\n '.tds-data-table-views [role=\"option\"][aria-selected=\"true\"]'\n )\n ?.focus()\n }, [])\n const { filterOpenRequest } = useFilterOpenRequest()\n const [isShelfExpanded, toggleShelf] = useShelfExpanded(\n shelfFilters.length + pendingFilters.length,\n pendingFilters.length,\n filterOpenRequest,\n isActiveSavedViewModified\n )\n // Keeps collapsed shelf content out of tab order/a11y tree. Needs a string,\n // not a boolean — `inert` isn't in `@types/react@18` or recognized by\n // react-dom as a boolean attribute before React 19.\n const shelfInertProps = { inert: isShelfExpanded ? undefined : \"\" } as {\n inert?: string\n }\n return (\n <div\n ref={rootRef}\n className={classNames(\"tds-data-table\", {\n \"tds-data-table--sticky-header\": hasScrollContainer,\n })}\n >\n {(Array.isArray(staticViews) || Array.isArray(savedViews)) && (\n <ViewsBar\n activeView={selectedView}\n currentState={currentState}\n defaultViewId={defaultViewId}\n isReordering={isSavedViewReordering}\n saveStatus={saveStatus}\n savedViews={savedViews ?? []}\n select={select}\n selectWhenSaved={selectWhenSaved}\n staticViews={staticViewsWithInitial}\n onApply={applyView}\n onCreate={onSavedViewCreate}\n onDelete={onSavedViewDelete}\n onReorder={onSavedViewMove}\n onSetDefault={onDefaultViewIdChange}\n onUpdate={onSavedViewUpdate}\n />\n )}\n <div className=\"tds-data-table-frame\">\n <DataTableSelectionContext.Provider value={selectionModel}>\n {showHeader && (\n <div className=\"tds-data-table-frame-header\">\n <div className=\"tds-data-table-frame-header-content\">\n {hasResults && (\n <div className=\"tds-data-table-frame-header-results\">\n <ResultsCount\n id={resultsCountId}\n resultNoun={resultNoun}\n selectable={selectable}\n selectedCount={selectedCount}\n totalCount={totalCount}\n />\n {hasActions && (\n <TableActions\n actions={\n tableActions as TableAction<DataTableSelection>[]\n }\n resultNoun={resultNoun}\n />\n )}\n </div>\n )}\n {hasTrailingControls && (\n <div className=\"tds-data-table-frame-header-controls\">\n {searchable && (\n <TableSearch\n label={searchLabel}\n tableId={tableId}\n value={searchQuery}\n onChange={onSearchChange}\n />\n )}\n {hasFilters && (\n <FilterControls\n activeFilters={chipFilters}\n filters={filters}\n isShelfExpanded={isShelfExpanded}\n onToggleShelf={toggleShelf}\n />\n )}\n {hasViewSettingsToggle && (\n <ViewSettingsToggle\n columns={hideableColumns}\n onColumnVisibilityChange={changeColumnVisibility}\n visibleColumnNames={visibleHideableColumns}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )}\n {(hasFilters || hasShelfContent) && (\n <div\n className={classNames(\"tds-data-table-filters-shelf\", {\n \"tds-data-table-filters-shelf--collapsed\": !isShelfExpanded,\n })}\n {...shelfInertProps}\n >\n <div className=\"tds-data-table-filters\">\n {hasShelfContent && (\n <ActiveFilters\n activeFilters={shelfFilters}\n activeSavedView={\n isActiveSavedViewModified ? activeView : undefined\n }\n currentState={currentState}\n focusSelectedView={focusSelectedView}\n hasFilters={hasFilters}\n saveStatus={saveStatus}\n selectSavedViewWhenSaved={selectWhenSaved}\n onActiveFiltersChange={changeChipFilters}\n onClear={clearFilters}\n onSavedViewApply={applyView}\n onSavedViewCreate={onSavedViewCreate}\n onSavedViewUpdate={onSavedViewUpdate}\n />\n )}\n </div>\n </div>\n )}\n <SelectAllBanner resultNoun={resultNoun} />\n </DataTableSelectionContext.Provider>\n <div ref={wrapperRef} className=\"tds-data-table-scroll-wrapper\">\n <div\n ref={scrollRef}\n className=\"tds-data-table-scroll\"\n // Set here because RAC's `Table` doesn't forward `aria-busy`.\n aria-busy={showLoadingOverlay || undefined}\n >\n <Table\n {...restProps}\n {...selectionProps}\n {...(ariaLabel ? { \"aria-label\": ariaLabel } : {})}\n {...(describedBy ? { \"aria-describedby\": describedBy } : {})}\n // RAC's `Table` forwards `id` to the underlying table element at\n // runtime (via `filterDOMProps({ global: true })`) but omits `id`\n // from its prop types, so spread it through a cast.\n {...({ id: tableId } as Partial<AriaTableProps>)}\n className={combinedClassName}\n // Pinned rather than exposed as a prop: `disabledKeys` only ever\n // turns off selection here, leaving the row clickable and\n // focusable. React Aria defaults this to \"all\", which would also\n // disable `onRowClick`/`getRowLink` and drop the row out of the\n // focus order, so it has to be set explicitly.\n disabledBehavior=\"selection\"\n disabledKeys={disabledKeys}\n sortDescriptor={sortDescriptor}\n onSortChange={(sort) => {\n setApplyingView(undefined)\n onSortChange?.(serializeSort(sort))\n resetPage()\n }}\n >\n <TableHeader className=\"tds-data-table-header\">\n {selectable && (\n <Column className=\"tds-data-table-column tds-data-table-column--selectable\">\n {headerCheckboxProps ? (\n <Checkbox\n {...headerCheckboxProps}\n aria-label=\"Select all\"\n slot={null}\n className=\"tds-data-table-selectable-checkbox\"\n />\n ) : (\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n )}\n </Column>\n )}\n {visiblePreparedColumns.map(({ align, column }) => (\n <Column\n key={column.name}\n id={column.name}\n isRowHeader={column === rowHeaderColumn?.column}\n className={classNames(\"tds-data-table-column\", {\n [`tds-data-table-column--align-${align}`]:\n align !== \"start\",\n \"tds-data-table-column--avatar\": column.type === \"avatar\",\n })}\n allowsSorting={column.sortable}\n >\n {column.hideLabel ? (\n <span className=\"tds-data-table-column-label--hidden\">\n {column.headerLabel}\n </span>\n ) : (\n column.headerLabel\n )}\n {column.sortable && (\n <Icon\n className=\"tds-data-table-column-icon tds-data-table-column-icon--sort\"\n symbol=\"general#up-caret\"\n aria-hidden={true}\n />\n )}\n </Column>\n ))}\n {hasRowActions && (\n <Column className=\"tds-data-table-column tds-data-table-column--actions\">\n <span className=\"tds-data-table-column-label--hidden\">\n Actions\n </span>\n </Column>\n )}\n </TableHeader>\n <TableBody\n className=\"tds-data-table-body\"\n renderEmptyState={renderEmptyState}\n >\n {data.map((row, rowIndex) => {\n const rowKey = getRowKey(row, rowIndex, getRowId)\n const appearance = getRowAppearance?.(row)\n return (\n <Row\n key={rowKey}\n id={rowKey}\n href={getRowLink?.(row)}\n onAction={onRowClick ? () => onRowClick(row) : undefined}\n className={classNames(\"tds-data-table-row\", {\n // A press fires the link/action only until something\n // is selected; after that it toggles selection.\n \"tds-data-table-row--has-action\":\n hasRowPressAction && !rowPressSelects,\n \"tds-data-table-row--interactive\": rowsAreInteractive,\n \"tds-data-table-row--press-selects\": rowPressSelects,\n [`tds-data-table-row--${appearance}`]:\n appearance && ROW_APPEARANCES.has(appearance),\n })}\n >\n {selectable && (\n <Cell className=\"tds-data-table-cell tds-data-table-cell--selectable\">\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n </Cell>\n )}\n {visiblePreparedColumns.map((prepared) => (\n <Cell\n key={prepared.column.name}\n {...cellBoundaryProps}\n data-pii={prepared.column.pii || undefined}\n className={classNames(\"tds-data-table-cell\", {\n [`tds-data-table-cell--align-${prepared.align}`]:\n prepared.align !== \"start\",\n \"tds-data-table-cell--avatar\":\n prepared.column.type === \"avatar\",\n \"tds-data-table-cell--numeric\": prepared.isNumeric,\n })}\n >\n {prepared.renderCell(row)}\n </Cell>\n ))}\n {hasRowActions && (\n <Cell\n {...cellBoundaryProps}\n className=\"tds-data-table-cell tds-data-table-cell--actions\"\n >\n <RowActions\n actions={rowActions!} // Safe to assert non-null here because of `hasRowActions`\n row={row}\n rowKey={rowKey}\n />\n </Cell>\n )}\n </Row>\n )\n })}\n </TableBody>\n </Table>\n </div>\n {showLoadingOverlay && (\n <div className=\"tds-data-table-loading-overlay\">\n <span className=\"tds-data-table-loading-label--hidden\">\n Loading\n </span>\n <span\n className=\"tds-data-table-loading-spinner\"\n aria-hidden=\"true\"\n >\n <LoadingSpinner />\n </span>\n <LoadingAnnouncement message=\"Loading\" />\n </div>\n )}\n </div>\n {showPagination && (\n <div className=\"tds-data-table-frame-footer\">\n {/*\n `Pagination`'s two shapes are a discriminated union, so each is\n spelled out in full rather than assembled from one prop bag.\n */}\n {isIndexedPagination ? (\n <Pagination\n aria-label={paginationLabel}\n hasNextPage={hasNextPage}\n hasPreviousPage={hasPreviousPage}\n onNextPageClick={onNextPageClick}\n onPreviousPageClick={onPreviousPageClick}\n type=\"indexed\"\n />\n ) : (\n <Pagination\n aria-label={paginationLabel}\n currentPage={currentPage}\n onPageChange={onPageChange}\n totalPages={totalPages!}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nDataTable.displayName = \"DataTable\"\n\n/**\n * Resolves the content rendered in the table body's empty-state slot based on\n * `loadingState`, falling back to `emptyState`. Returns `null` when nothing\n * should render (idle with no `emptyState`).\n */\nfunction getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n}: {\n emptyState: ReactNode\n errorState: ReactNode\n loadingState: DataTableLoadingState\n}): ReactNode {\n if (loadingState === \"loading\") {\n return (\n <div className=\"tds-data-table-loading\">\n <span className=\"tds-data-table-cell-label--hidden\">Loading</span>\n <span className=\"tds-data-table-loading-spinner\" aria-hidden=\"true\">\n <LoadingSpinner />\n </span>\n <LoadingAnnouncement message=\"Loading\" />\n </div>\n )\n }\n\n // Error and empty share the same container; they differ only in content.\n const content =\n loadingState === \"error\" ? (errorState ?? DEFAULT_ERROR_STATE) : emptyState\n if (content == null) return null\n\n return <div className=\"tds-data-table-empty\">{content}</div>\n}\n\nfunction useSortDescriptor(\n sortBy: Sort | undefined\n): SortDescriptor | undefined {\n return useMemo(() => {\n if (!sortBy) return undefined\n return deserializeSort(sortBy)\n }, [sortBy])\n}\n\nfunction deserializeSort(sort: Sort): SortDescriptor {\n if (sort.startsWith(\"-\"))\n return { column: sort.slice(1), direction: \"descending\" }\n return { column: sort, direction: \"ascending\" }\n}\n\nfunction serializeSort(sort: SortDescriptor): Sort {\n const column = String(sort.column)\n return sort.direction === \"descending\" ? `-${column}` : column\n}\n\nfunction useStickyHeader(\n stickyHeader: boolean | undefined,\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined\n) {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const [hasScrollContainer, setHasScrollContainer] = useState(false)\n\n useLayoutEffect(() => {\n setHasScrollContainer(false)\n if (!stickyHeader) return\n if (typeof ResizeObserver === \"undefined\") return\n const wrapper = wrapperRef.current\n if (!wrapper) return\n\n const scrollContainer = getScrollContainer(\n scrollContainerRef,\n scrollContainerSelector,\n wrapper\n )\n if (!scrollContainer) return\n\n setHasScrollContainer(true)\n\n let thead: HTMLElement | null = null\n\n const resizeObserver = new ResizeObserver(() => {\n if (!thead) {\n thead = wrapper.querySelector<HTMLElement>(\".tds-data-table-header\")\n if (!thead) return\n scrollContainer.style.setProperty(\n \"scroll-timeline-name\",\n \"--_sticky-header-scroll\"\n )\n }\n\n const { top: wrapperTop, bottom: wrapperBottom } =\n wrapper.getBoundingClientRect()\n const { top: scrollContainerTop } =\n scrollContainer.getBoundingClientRect()\n // Derive headerTop from the untransformed wrapper to avoid reading the\n // scroll-driven translateY that getBoundingClientRect() includes on thead.\n const headerTop = wrapperTop + wrapper.clientTop\n const start = scrollContainer.scrollTop + (headerTop - scrollContainerTop)\n const max = Math.max(0, wrapperBottom - headerTop - thead.offsetHeight)\n wrapper.style.setProperty(\"--_sticky-header-scroll-start\", `${start}px`)\n wrapper.style.setProperty(\"--_sticky-header-scroll-max\", `${max}px`)\n })\n\n resizeObserver.observe(wrapper)\n // The banner moves the wrapper without changing its size.\n if (wrapper.parentElement) resizeObserver.observe(wrapper.parentElement)\n resizeObserver.observe(scrollContainer)\n\n return () => {\n resizeObserver.disconnect()\n wrapper.style.removeProperty(\"--_sticky-header-scroll-start\")\n wrapper.style.removeProperty(\"--_sticky-header-scroll-max\")\n }\n }, [stickyHeader, scrollContainerRef, scrollContainerSelector])\n\n return { hasScrollContainer, wrapperRef }\n}\n\nfunction getScrollContainer(\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n const element =\n scrollContainerRef?.current ??\n getScrollContainerFromSelector(scrollContainerSelector, wrapper)\n if (element instanceof Window) return\n return element\n}\n\nfunction getScrollContainerFromSelector(\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n return scrollContainerSelector\n ? (wrapper.parentElement?.closest<HTMLElement>(scrollContainerSelector) ??\n undefined)\n : undefined\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0cA,MAAM,mBAAmB,GAAG,uBAAuB;AAEnD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAa9E;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,SAAS,GAAG,CAAC,EACxB,aAAa,GAAG,EAAE,EAClB,OAAO,GAAG,EAAE,EACZ,GAAG,KAAK,EACc,MACtBA,cAAA,CAAA,aAAA,CAAC,eAAe,EAAA,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAA;AAC7D,IAAAA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAA,GACT,KAA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ACF,GACD,QAAQ,CAAC,iBAAiB,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEnE,eAAO,MAAM,QAAQ,gGA8DpB,CAAA"}
@@ -4,8 +4,18 @@ import { COMPONENT_SIZE_CLASS_MAP, COMPONENT_KIND_CLASS_MAP, wrapStringWithSpan
4
4
  import classNames from 'classnames';
5
5
  import React__default, { forwardRef } from 'react';
6
6
 
7
+ function hasVisibleContent(value) {
8
+ if (typeof value === "string")
9
+ return value.trim() !== "";
10
+ return Boolean(value) || value === 0;
11
+ }
7
12
  const BaseLink = forwardRef(({ asChild = false, "aria-describedby": ariaDescribedBy, children, className, external = false, fullWidth, href, kind, label, prefix, size, suffix, ...restProps }, ref) => {
8
13
  const { describedBy, mergedProps, mergedRef } = useTooltipTriggerProps(restProps, ref, ariaDescribedBy);
14
+ const hasLabel = hasVisibleContent(label);
15
+ const hasChildren = hasVisibleContent(children);
16
+ if (!hasLabel && !hasChildren)
17
+ return null;
18
+ const content = hasLabel ? label : children;
9
19
  const combinedClassName = classNames(kind && "tds-btn", size && size !== "md" && kind && COMPONENT_SIZE_CLASS_MAP[size], kind && COMPONENT_KIND_CLASS_MAP[kind], fullWidth && "tds-btn--full-width", className, { "tds-btn--prefix": prefix, "tds-btn--suffix": suffix });
10
20
  const externalProps = external
11
21
  ? { rel: "noopener noreferrer", target: "_blank" }
@@ -13,7 +23,7 @@ const BaseLink = forwardRef(({ asChild = false, "aria-describedby": ariaDescribe
13
23
  const Comp = asChild ? Slot : "a";
14
24
  return (React__default.createElement(Comp, { ...(!asChild && { href }), className: combinedClassName, ref: mergedRef, ...mergedProps, "aria-describedby": describedBy, ...externalProps },
15
25
  wrapStringWithSpan(prefix),
16
- React__default.createElement(Slottable, null, label || children),
26
+ React__default.createElement(Slottable, null, content),
17
27
  wrapStringWithSpan(suffix)));
18
28
  });
19
29
  BaseLink.displayName = "BaseLink";
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLink.js","sources":["../../../src/components/link/BaseLink.tsx"],"sourcesContent":["import \"../button/btn.css\"\n\nimport { useTooltipTriggerProps } from \"@components/internal/tooltip/useTooltipTriggerProps\"\nimport { Slot, Slottable } from \"@radix-ui/react-slot\"\nimport {\n BaseComponentProps,\n COMPONENT_KIND_CLASS_MAP,\n COMPONENT_SIZE_CLASS_MAP,\n ComponentKind,\n wrapStringWithSpan,\n} from \"@utilities/buttonLinkShared\"\nimport { Simplify } from \"@utilities/typeUtils\"\nimport classNames from \"classnames\"\nimport React, { AnchorHTMLAttributes, forwardRef } from \"react\"\n\ntype BaseLinkBaseProps = BaseComponentProps &\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof BaseComponentProps | \"children\" | \"href\"\n > & {\n children?: React.ReactNode\n external?: boolean\n kind?: ComponentKind\n label?: React.ReactNode\n }\n\nexport type BaseLinkElementProps =\n | Simplify<\n BaseLinkBaseProps & {\n /**\n * When true, merges the link's styling onto the child element instead\n * of rendering an `<a>`. Use to wrap a router link (e.g. react-router,\n * Next.js) or any link-like component. The `external` prop still\n * applies — it spreads `rel`/`target` onto the child element.\n */\n asChild: true\n href?: never\n }\n >\n | Simplify<BaseLinkBaseProps & { asChild?: false; href: string }>\n\nexport const BaseLink = forwardRef<HTMLAnchorElement, BaseLinkElementProps>(\n (\n {\n asChild = false,\n \"aria-describedby\": ariaDescribedBy,\n children,\n className,\n external = false,\n fullWidth,\n href,\n kind,\n label,\n prefix,\n size,\n suffix,\n ...restProps\n }: BaseLinkElementProps,\n ref\n ) => {\n const { describedBy, mergedProps, mergedRef } = useTooltipTriggerProps(\n restProps,\n ref,\n ariaDescribedBy\n )\n\n const combinedClassName = classNames(\n kind && \"tds-btn\",\n size && size !== \"md\" && kind && COMPONENT_SIZE_CLASS_MAP[size],\n kind && COMPONENT_KIND_CLASS_MAP[kind],\n fullWidth && \"tds-btn--full-width\",\n className,\n { \"tds-btn--prefix\": prefix, \"tds-btn--suffix\": suffix }\n )\n\n const externalProps = external\n ? { rel: \"noopener noreferrer\", target: \"_blank\" }\n : {}\n\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n {...(!asChild && { href })}\n className={combinedClassName}\n ref={mergedRef}\n {...mergedProps}\n aria-describedby={describedBy}\n {...externalProps}\n >\n {wrapStringWithSpan(prefix)}\n <Slottable>{label || children}</Slottable>\n {wrapStringWithSpan(suffix)}\n </Comp>\n )\n }\n)\n\nBaseLink.displayName = \"BaseLink\"\n"],"names":["React"],"mappings":";;;;;;MAyCa,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,OAAO,GAAG,KAAK,EACf,kBAAkB,EAAE,eAAe,EACnC,QAAQ,EACR,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,GAAG,SAAS,EACS,EACvB,GAAG,KACD;AACF,IAAA,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,sBAAsB,CACpE,SAAS,EACT,GAAG,EACH,eAAe,CAChB;IAED,MAAM,iBAAiB,GAAG,UAAU,CAClC,IAAI,IAAI,SAAS,EACjB,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAC/D,IAAI,IAAI,wBAAwB,CAAC,IAAI,CAAC,EACtC,SAAS,IAAI,qBAAqB,EAClC,SAAS,EACT,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,CACzD;IAED,MAAM,aAAa,GAAG;UAClB,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,QAAQ;UAC9C,EAAE;IAEN,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,GAAG;IAEjC,QACEA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,IACE,CAAC,OAAO,IAAI,EAAE,IAAI,EAAE,CAAC,EAC1B,SAAS,EAAE,iBAAiB,EAC5B,GAAG,EAAE,SAAS,EAAA,GACV,WAAW,EAAA,kBAAA,EACG,WAAW,EAAA,GACzB,aAAa,EAAA;QAEhB,kBAAkB,CAAC,MAAM,CAAC;AAC3B,QAAAA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,IAAA,EAAE,KAAK,IAAI,QAAQ,CAAa;AACzC,QAAA,kBAAkB,CAAC,MAAM,CAAC,CACtB;AAEX,CAAC;AAGH,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
1
+ {"version":3,"file":"BaseLink.js","sources":["../../../src/components/link/BaseLink.tsx"],"sourcesContent":["import \"../button/btn.css\"\n\nimport { useTooltipTriggerProps } from \"@components/internal/tooltip/useTooltipTriggerProps\"\nimport { Slot, Slottable } from \"@radix-ui/react-slot\"\nimport {\n BaseComponentProps,\n COMPONENT_KIND_CLASS_MAP,\n COMPONENT_SIZE_CLASS_MAP,\n ComponentKind,\n wrapStringWithSpan,\n} from \"@utilities/buttonLinkShared\"\nimport { Simplify } from \"@utilities/typeUtils\"\nimport classNames from \"classnames\"\nimport React, { AnchorHTMLAttributes, forwardRef, ReactNode } from \"react\"\n\ntype BaseLinkBaseProps = BaseComponentProps &\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof BaseComponentProps | \"children\" | \"href\"\n > & {\n children?: React.ReactNode\n external?: boolean\n kind?: ComponentKind\n label?: React.ReactNode\n }\n\nfunction hasVisibleContent(value: ReactNode) {\n if (typeof value === \"string\") return value.trim() !== \"\"\n return Boolean(value) || value === 0\n}\n\nexport type BaseLinkElementProps =\n | Simplify<\n BaseLinkBaseProps & {\n /**\n * When true, merges the link's styling onto the child element instead\n * of rendering an `<a>`. Use to wrap a router link (e.g. react-router,\n * Next.js) or any link-like component. The `external` prop still\n * applies — it spreads `rel`/`target` onto the child element.\n */\n asChild: true\n href?: never\n }\n >\n | Simplify<BaseLinkBaseProps & { asChild?: false; href: string }>\n\nexport const BaseLink = forwardRef<HTMLAnchorElement, BaseLinkElementProps>(\n (\n {\n asChild = false,\n \"aria-describedby\": ariaDescribedBy,\n children,\n className,\n external = false,\n fullWidth,\n href,\n kind,\n label,\n prefix,\n size,\n suffix,\n ...restProps\n }: BaseLinkElementProps,\n ref\n ) => {\n const { describedBy, mergedProps, mergedRef } = useTooltipTriggerProps(\n restProps,\n ref,\n ariaDescribedBy\n )\n\n const hasLabel = hasVisibleContent(label)\n const hasChildren = hasVisibleContent(children)\n\n if (!hasLabel && !hasChildren) return null\n\n const content = hasLabel ? label : children\n\n const combinedClassName = classNames(\n kind && \"tds-btn\",\n size && size !== \"md\" && kind && COMPONENT_SIZE_CLASS_MAP[size],\n kind && COMPONENT_KIND_CLASS_MAP[kind],\n fullWidth && \"tds-btn--full-width\",\n className,\n { \"tds-btn--prefix\": prefix, \"tds-btn--suffix\": suffix }\n )\n\n const externalProps = external\n ? { rel: \"noopener noreferrer\", target: \"_blank\" }\n : {}\n\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n {...(!asChild && { href })}\n className={combinedClassName}\n ref={mergedRef}\n {...mergedProps}\n aria-describedby={describedBy}\n {...externalProps}\n >\n {wrapStringWithSpan(prefix)}\n <Slottable>{content}</Slottable>\n {wrapStringWithSpan(suffix)}\n </Comp>\n )\n }\n)\n\nBaseLink.displayName = \"BaseLink\"\n"],"names":["React"],"mappings":";;;;;;AA0BA,SAAS,iBAAiB,CAAC,KAAgB,EAAA;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;IACzD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC;AACtC;MAiBa,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,OAAO,GAAG,KAAK,EACf,kBAAkB,EAAE,eAAe,EACnC,QAAQ,EACR,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,SAAS,E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/B,QAAA,kBAAkB,CAAC,MAAM,CAAC,CACtB;AAEX,CAAC;AAGH,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
@@ -0,0 +1,59 @@
1
+ import React, { type HTMLAttributes, type ReactNode } from "react";
2
+ import { type TagOption } from "./useTagMenu";
3
+ export type { TagOption } from "./useTagMenu";
4
+ export type TagColor = "aqua" | "blue" | "green" | "indigo" | "magenta" | "neutral" | "orange" | "pink" | "purple" | "teal" | "yellow";
5
+ export type TagVariant = "bold" | "subtle";
6
+ interface TagBaseProps {
7
+ className?: string;
8
+ /** The hue. Defaults to `neutral`. */
9
+ color?: TagColor;
10
+ /** Text before the name, on a darker fill. */
11
+ label?: string;
12
+ /**
13
+ * The text of the tag. With `options`, the name of the current option.
14
+ */
15
+ name: string;
16
+ /** Defaults to `subtle`. */
17
+ variant?: TagVariant;
18
+ }
19
+ interface TagIconProps {
20
+ /** Leading icon. Cannot be used with `onDismiss` or `options`. */
21
+ icon?: ReactNode;
22
+ onChange?: never;
23
+ onDismiss?: never;
24
+ options?: never;
25
+ }
26
+ interface TagDismissProps {
27
+ icon?: never;
28
+ onChange?: never;
29
+ /** Shows the ✕ when set. Called when the ✕ is pressed. */
30
+ onDismiss?: () => void;
31
+ options?: never;
32
+ }
33
+ interface TagMenuProps {
34
+ icon?: never;
35
+ /** Called with the picked option. */
36
+ onChange: (option: TagOption) => void;
37
+ onDismiss?: () => void;
38
+ /**
39
+ * The values the tag can change to. Shows a menu button after the name.
40
+ * The menu marks the option whose `name` matches.
41
+ */
42
+ options: TagOption[];
43
+ }
44
+ /**
45
+ * A tag has a leading icon, or its ✕ and menu buttons, not both, so the
46
+ * icons do not compete.
47
+ */
48
+ export type TagProps = TagBaseProps & (TagDismissProps | TagIconProps | TagMenuProps);
49
+ /** `TagProps`, plus any other attribute of the root `div`, such as `id`. */
50
+ export type TagElementProps = Omit<HTMLAttributes<HTMLDivElement>, keyof TagProps | "children"> & TagProps;
51
+ /**
52
+ * A small, colored label for a value, such as a status or a category. A tag
53
+ * can show a label before its name, a ✕ to remove it, and a menu that
54
+ * changes its value.
55
+ *
56
+ * @component
57
+ */
58
+ export declare function Tag({ className, color, icon, label, name, onChange, onDismiss, options, variant, ...restProps }: TagElementProps): React.JSX.Element;
59
+ //# sourceMappingURL=Tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/components/tag/Tag.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGlE,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,cAAc,CAAA;AAEzD,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,MAAM,GACN,QAAQ,CAAA;AAEZ,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE1C,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAED,UAAU,YAAY;IACpB,kEAAkE;IAClE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB;AAED,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB;AAED,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,qCAAqC;IACrC,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAA;IACrC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB;;;OAGG;IACH,OAAO,EAAE,SAAS,EAAE,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,GACjC,CAAC,eAAe,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AAEjD,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,cAAc,CAAC,cAAc,CAAC,EAC9B,MAAM,QAAQ,GAAG,UAAU,CAC5B,GACC,QAAQ,CAAA;AAEV;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,EAClB,SAAS,EACT,KAAiB,EACjB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,OAAkB,EAClB,GAAG,SAAS,EACb,EAAE,eAAe,qBA0CjB"}
@@ -0,0 +1,31 @@
1
+ import Icon from '../../utilities/Icon.js';
2
+ import classNames from 'classnames';
3
+ import React__default from 'react';
4
+ import { TagContent, tagText } from './TagContent.js';
5
+ import { useTagMenu } from './useTagMenu.js';
6
+
7
+ /**
8
+ * A small, colored label for a value, such as a status or a category. A tag
9
+ * can show a label before its name, a ✕ to remove it, and a menu that
10
+ * changes its value.
11
+ *
12
+ * @component
13
+ */
14
+ function Tag({ className, color = "neutral", icon, label, name, onChange, onDismiss, options, variant = "subtle", ...restProps }) {
15
+ const text = tagText(label, name);
16
+ const hasMenu = !!options?.length;
17
+ const menu = useTagMenu({
18
+ buttonLabel: `Change ${text}`,
19
+ menuLabel: label ?? name,
20
+ onChange: (option) => onChange?.(option),
21
+ options: options ?? [],
22
+ selectedName: name,
23
+ });
24
+ return (React__default.createElement("div", { ...restProps, className: classNames("tds-tag", `tds-tag--${color}`, `tds-tag--${variant}`, className) },
25
+ React__default.createElement(TagContent, { dismissButton: onDismiss && (React__default.createElement("button", { "aria-label": `Remove ${text}`, className: "tds-tag-dismiss", onClick: onDismiss, type: "button" },
26
+ React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#x" }))), icon: icon, label: label, menuButton: hasMenu && menu.button, name: name }),
27
+ hasMenu && menu.popover));
28
+ }
29
+
30
+ export { Tag };
31
+ //# sourceMappingURL=Tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.js","sources":["../../../src/components/tag/Tag.tsx"],"sourcesContent":["import Icon from \"@utilities/Icon\"\nimport classNames from \"classnames\"\nimport React, { type HTMLAttributes, type ReactNode } from \"react\"\n\nimport { TagContent, tagText } from \"./TagContent\"\nimport { type TagOption, useTagMenu } from \"./useTagMenu\"\n\nexport type { TagOption } from \"./useTagMenu\"\n\nexport type TagColor =\n | \"aqua\"\n | \"blue\"\n | \"green\"\n | \"indigo\"\n | \"magenta\"\n | \"neutral\"\n | \"orange\"\n | \"pink\"\n | \"purple\"\n | \"teal\"\n | \"yellow\"\n\nexport type TagVariant = \"bold\" | \"subtle\"\n\ninterface TagBaseProps {\n className?: string\n /** The hue. Defaults to `neutral`. */\n color?: TagColor\n /** Text before the name, on a darker fill. */\n label?: string\n /**\n * The text of the tag. With `options`, the name of the current option.\n */\n name: string\n /** Defaults to `subtle`. */\n variant?: TagVariant\n}\n\ninterface TagIconProps {\n /** Leading icon. Cannot be used with `onDismiss` or `options`. */\n icon?: ReactNode\n onChange?: never\n onDismiss?: never\n options?: never\n}\n\ninterface TagDismissProps {\n icon?: never\n onChange?: never\n /** Shows the ✕ when set. Called when the ✕ is pressed. */\n onDismiss?: () => void\n options?: never\n}\n\ninterface TagMenuProps {\n icon?: never\n /** Called with the picked option. */\n onChange: (option: TagOption) => void\n onDismiss?: () => void\n /**\n * The values the tag can change to. Shows a menu button after the name.\n * The menu marks the option whose `name` matches.\n */\n options: TagOption[]\n}\n\n/**\n * A tag has a leading icon, or its ✕ and menu buttons, not both, so the\n * icons do not compete.\n */\nexport type TagProps = TagBaseProps &\n (TagDismissProps | TagIconProps | TagMenuProps)\n\n/** `TagProps`, plus any other attribute of the root `div`, such as `id`. */\nexport type TagElementProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof TagProps | \"children\"\n> &\n TagProps\n\n/**\n * A small, colored label for a value, such as a status or a category. A tag\n * can show a label before its name, a ✕ to remove it, and a menu that\n * changes its value.\n *\n * @component\n */\nexport function Tag({\n className,\n color = \"neutral\",\n icon,\n label,\n name,\n onChange,\n onDismiss,\n options,\n variant = \"subtle\",\n ...restProps\n}: TagElementProps) {\n const text = tagText(label, name)\n const hasMenu = !!options?.length\n const menu = useTagMenu({\n buttonLabel: `Change ${text}`,\n menuLabel: label ?? name,\n onChange: (option) => onChange?.(option),\n options: options ?? [],\n selectedName: name,\n })\n\n return (\n <div\n {...restProps}\n className={classNames(\n \"tds-tag\",\n `tds-tag--${color}`,\n `tds-tag--${variant}`,\n className\n )}\n >\n <TagContent\n dismissButton={\n onDismiss && (\n <button\n aria-label={`Remove ${text}`}\n className=\"tds-tag-dismiss\"\n onClick={onDismiss}\n type=\"button\"\n >\n <Icon aria-hidden symbol=\"general#x\" />\n </button>\n )\n }\n icon={icon}\n label={label}\n menuButton={hasMenu && menu.button}\n name={name}\n />\n {hasMenu && menu.popover}\n </div>\n )\n}\n"],"names":["React"],"mappings":";;;;;;AAgFA;;;;;;AAMG;AACG,SAAU,GAAG,CAAC,EAClB,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,OAAO,GAAG,QAAQ,EAClB,GAAG,SAAS,EACI,EAAA;IAChB,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;A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