@galaxy-io/dls 2.9.0 → 2.10.0

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 (101) hide show
  1. package/dist/beacons/Beacon.d.ts +1 -1
  2. package/dist/beacons/Beacon.js +12 -28
  3. package/dist/brand/GalaxyAlchemyWordmark.d.ts +4 -1
  4. package/dist/brand/GalaxyAlchemyWordmark.js +7 -1
  5. package/dist/brand/GalaxyFilamentWordmark.d.ts +5 -2
  6. package/dist/brand/GalaxyFilamentWordmark.js +9 -2
  7. package/dist/brand/GalaxyLogomark.js +3 -0
  8. package/dist/brand/PoweredBy.d.ts +27 -0
  9. package/dist/brand/PoweredBy.js +96 -0
  10. package/dist/brand/internal/svg/GalaxyFilamentWordmarkSvg.d.ts +1 -1
  11. package/dist/brand/internal/svg/GalaxyFilamentWordmarkSvg.js +2 -2
  12. package/dist/charts/Heatmap.js +25 -9
  13. package/dist/charts/Sparkline.d.ts +1 -1
  14. package/dist/charts/Sparkline.js +10 -26
  15. package/dist/charts/chartFormat.d.ts +1 -1
  16. package/dist/charts/chartFormat.js +2 -2
  17. package/dist/charts/heatmapGeometry.d.ts +14 -0
  18. package/dist/charts/heatmapGeometry.js +17 -1
  19. package/dist/chips/Chip.d.ts +2 -2
  20. package/dist/chips/Chip.js +15 -31
  21. package/dist/drawer/Drawer.d.ts +2 -2
  22. package/dist/drawer/Drawer.js +1 -1
  23. package/dist/editor/CodeEditor.d.ts +1 -1
  24. package/dist/editor/CodeEditor.js +2 -1
  25. package/dist/feedback/Alert.d.ts +36 -9
  26. package/dist/feedback/Alert.js +26 -8
  27. package/dist/feedback/ProgressBar.d.ts +4 -1
  28. package/dist/feedback/ProgressBar.js +17 -30
  29. package/dist/feedback/ProgressCircle.d.ts +1 -1
  30. package/dist/feedback/ProgressCircle.js +14 -30
  31. package/dist/hooks/useEndReached.d.ts +40 -0
  32. package/dist/hooks/useEndReached.js +69 -0
  33. package/dist/icons/Icon.d.ts +36 -8
  34. package/dist/icons/Icon.js +14 -7
  35. package/dist/inputs/CronInput.js +114 -78
  36. package/dist/inputs/DateInput.d.ts +1 -1
  37. package/dist/inputs/DateInput.js +10 -10
  38. package/dist/inputs/MultiSelectInput.d.ts +3 -1
  39. package/dist/inputs/MultiSelectInput.js +8 -3
  40. package/dist/inputs/SelectInput.d.ts +8 -1
  41. package/dist/inputs/SelectInput.js +52 -25
  42. package/dist/inputs/internal/selectAll.d.ts +11 -0
  43. package/dist/inputs/internal/selectAll.js +28 -0
  44. package/dist/json/JsonViewer.js +7 -6
  45. package/dist/layout/AppFrame.d.ts +20 -0
  46. package/dist/layout/AppFrame.js +71 -0
  47. package/dist/layout/EmptyLayout.d.ts +53 -0
  48. package/dist/layout/EmptyLayout.js +59 -0
  49. package/dist/layout/ErrorLayout.d.ts +42 -0
  50. package/dist/layout/ErrorLayout.js +60 -0
  51. package/dist/layout/PageLayout.d.ts +26 -0
  52. package/dist/layout/PageLayout.js +116 -0
  53. package/dist/layout/PendingLayout.d.ts +30 -0
  54. package/dist/layout/PendingLayout.js +57 -0
  55. package/dist/layout/internal/errorState.d.ts +14 -0
  56. package/dist/layout/internal/errorState.js +49 -0
  57. package/dist/layout/internal/region.d.ts +10 -0
  58. package/dist/layout/internal/region.js +24 -0
  59. package/dist/lists/DescriptionList.js +1 -0
  60. package/dist/menu/Menu.d.ts +2 -2
  61. package/dist/menu/Menu.js +6 -13
  62. package/dist/modal/Modal.d.ts +2 -2
  63. package/dist/modal/Modal.js +1 -1
  64. package/dist/navigation/CommandPalette.js +4 -11
  65. package/dist/navigation/SidebarNav.d.ts +5 -0
  66. package/dist/navigation/SidebarNav.js +41 -22
  67. package/dist/navigation/Topbar.js +4 -0
  68. package/dist/shapes/Circle.d.ts +1 -1
  69. package/dist/shapes/Circle.js +10 -26
  70. package/dist/shapes/Square.d.ts +1 -1
  71. package/dist/shapes/Square.js +10 -26
  72. package/dist/styles/internal/roleColor.d.ts +3 -0
  73. package/dist/styles/internal/roleColor.js +42 -0
  74. package/dist/styles/mixins.js +1 -1
  75. package/dist/styles.css +1 -1
  76. package/dist/table/InfiniteSpreadsheet.js +6 -6
  77. package/dist/table/InfiniteTable.d.ts +52 -20
  78. package/dist/table/InfiniteTable.js +3 -2
  79. package/dist/table/TableCore.d.ts +7 -1
  80. package/dist/table/TableCore.js +93 -83
  81. package/dist/table/VirtualizedInfiniteTable.d.ts +53 -21
  82. package/dist/table/VirtualizedInfiniteTable.js +7 -5
  83. package/dist/table/useInfiniteScrollSentinel.d.ts +13 -13
  84. package/dist/table/useInfiniteScrollSentinel.js +7 -51
  85. package/dist/theme/tokens/dark.js +1 -1
  86. package/dist/theme/tokens/light.js +4 -3
  87. package/dist/theme/tokens/types.d.ts +7 -7
  88. package/dist/timeline/Timeline.d.ts +1 -1
  89. package/dist/timeline/Timeline.js +6 -24
  90. package/dist/tokens.css +1 -1
  91. package/dist/utils/format.d.ts +35 -10
  92. package/dist/utils/format.js +60 -12
  93. package/dist/utils/search.d.ts +15 -0
  94. package/dist/utils/search.js +24 -0
  95. package/dist/vite/index.d.ts +16 -2
  96. package/dist/vite/index.js +28 -19
  97. package/dist/vite/internal/themeBoot.d.ts +25 -0
  98. package/dist/vite/internal/themeBoot.js +44 -0
  99. package/dist/vite/internal/wywOptions.d.ts +46 -0
  100. package/dist/vite/internal/wywOptions.js +44 -0
  101. package/package.json +34 -1
@@ -8,6 +8,7 @@ import Beacon, { BeaconSize, BeaconVariant } from "../beacons/Beacon.js";
8
8
  import Icon, { IconVariant } from "../icons/Icon.js";
9
9
  import Button, { ButtonVariant } from "../buttons/Button.js";
10
10
  import EmptyState from "../feedback/EmptyState.js";
11
+ import { formatDate } from "../utils/format.js";
11
12
  import { InputSize } from "../inputs/Input.js";
12
13
  import { SelectInputSize } from "../inputs/SelectInput.js";
13
14
  import { DateInputSize } from "../inputs/DateInput.js";
@@ -198,7 +199,6 @@ var CELL_EDITING_CSS = "gx-InfiniteSpreadsheet-CELL_EDITING_CSS-c1dhzhlk";
198
199
  var TRAILING_CSS = "gx-InfiniteSpreadsheet-TRAILING_CSS-tfgc5gq";
199
200
  /** Spread on the row-actions trigger: the cell is the tab stop, not the button. */
200
201
  var UNTABBABLE = { tabIndex: -1 };
201
- var DATE_FORMAT_OPTIONS = { dateStyle: "medium" };
202
202
  /** Two cell values are the same (dates by time; a TEXT `null` edits as `""`). */
203
203
  function isSameValue(type, current, next) {
204
204
  if (current instanceof Date || next instanceof Date) return current instanceof Date && next instanceof Date && current.getTime() === next.getTime();
@@ -233,7 +233,7 @@ function CellDisplay({ column, value, metrics, iconPx, enumGapCss }) {
233
233
  shouldTooltipOnOverflow: true,
234
234
  isTabular: true,
235
235
  className: CELL_TEXT_CSS,
236
- children: new Intl.DateTimeFormat(void 0, DATE_FORMAT_OPTIONS).format(value)
236
+ children: formatDate(value)
237
237
  });
238
238
  return /* @__PURE__ */ jsx(TableCellText, {
239
239
  value,
@@ -263,7 +263,7 @@ var SpreadsheetRow = memo(function SpreadsheetRow({ row, rowIndex, rowId, column
263
263
  role: "row",
264
264
  "aria-rowindex": ariaRowIndex,
265
265
  ...isLoaded ? {} : { "aria-busy": true },
266
- className: cx(VIRTUAL_ROW_CSS, isBorderless && "gx-TableCore-ROW_NO_BORDER_CSS-rpsswqs"),
266
+ className: cx(VIRTUAL_ROW_CSS, isBorderless && "gx-TableCore-ROW_NO_BORDER_CSS-rwbqwrq"),
267
267
  style,
268
268
  children: [columns.map((resolved, columnIndex) => {
269
269
  const column = resolved.column;
@@ -331,7 +331,7 @@ var SpreadsheetRow = memo(function SpreadsheetRow({ row, rowIndex, rowId, column
331
331
  ...cellHandlers(actionsColumn),
332
332
  role: "gridcell",
333
333
  "aria-colindex": actionsColumn + 1,
334
- className: cx("gx-TableCore-SYNTHETIC_CELL_CSS-s1g01kh5", PIN_TO_CSS_MAP[Side.RIGHT], TRAILING_CSS, CELL_FOCUS_CSS, hasGridFocus && tabStopColumn === actionsColumn && CELL_SELECTED_CSS),
334
+ className: cx("gx-TableCore-SYNTHETIC_CELL_CSS-s1qwxx34", PIN_TO_CSS_MAP[Side.RIGHT], TRAILING_CSS, CELL_FOCUS_CSS, hasGridFocus && tabStopColumn === actionsColumn && CELL_SELECTED_CSS),
335
335
  children: actions !== null && actions !== void 0 && /* @__PURE__ */ jsx(Menu, {
336
336
  isOpen: isActionsOpen,
337
337
  onOpenChange: (isOpen) => callbacks.onActionsOpenChange(rowId, isOpen),
@@ -350,7 +350,7 @@ var SpreadsheetRow = memo(function SpreadsheetRow({ row, rowIndex, rowId, column
350
350
  role: "gridcell",
351
351
  "aria-colindex": actionsColumn + 1,
352
352
  "aria-readonly": true,
353
- className: cx("gx-TableCore-SYNTHETIC_CELL_CSS-s1g01kh5", PIN_TO_CSS_MAP[Side.RIGHT], TRAILING_CSS)
353
+ className: cx("gx-TableCore-SYNTHETIC_CELL_CSS-s1qwxx34", PIN_TO_CSS_MAP[Side.RIGHT], TRAILING_CSS)
354
354
  }))]
355
355
  });
356
356
  });
@@ -754,7 +754,7 @@ var InfiniteSpreadsheetInner = forwardRef(function InfiniteSpreadsheet(props, re
754
754
  }), showAddRow && isMounted && /* @__PURE__ */ jsx(AddRow, {
755
755
  role: "row",
756
756
  "aria-rowindex": rowCount + 2,
757
- className: "gx-TableCore-VIRTUAL_ROW_CSS-vw38cm1",
757
+ className: "gx-TableCore-VIRTUAL_ROW_CSS-v1n5u17i",
758
758
  style: startStyle(totalSize),
759
759
  children: /* @__PURE__ */ jsx(AddRowCell, {
760
760
  role: "gridcell",
@@ -10,7 +10,8 @@ export declare enum InfiniteTableSize {
10
10
  /** 52px rows, body_lg text. Rows with avatars or two-line cells. */
11
11
  LARGE = "LARGE"
12
12
  }
13
- export interface InfiniteTableProps<TData> extends AriaAttributes {
13
+ /** Every InfiniteTable prop except the header and what lives in it (`hasHeader`, sorting, resize, customize). */
14
+ interface InfiniteTableBaseProps<TData> extends AriaAttributes {
14
15
  /** The columns in their default order. See `TableColumn` in `@galaxy-io/dls/table/types`. */
15
16
  columns: TableColumn<TData>[];
16
17
  /** The rows loaded so far, in display order (unless the table sorts them). */
@@ -45,15 +46,6 @@ export interface InfiniteTableProps<TData> extends AriaAttributes {
45
46
  activeRowId?: string | null;
46
47
  /** Menu rows (`MenuItem`, `MenuSeparator`, …) for a row's actions menu, opened from a trailing "…" button. Return `null` for a row with no actions. */
47
48
  rowActions?: (row: TData, rowIndex: number) => ReactNode;
48
- /** Controlled sorted column. `null` is unsorted. */
49
- sort?: TableSort | null;
50
- /**
51
- * Initial sort while uncontrolled.
52
- * @default null
53
- */
54
- defaultSort?: TableSort | null;
55
- /** Called with the next sort when a sortable header is pressed: ascending, then descending, then unsorted. */
56
- onSortChange?: (sort: TableSort | null) => void;
57
49
  /**
58
50
  * Adds a leading checkbox column, a select-all checkbox in the header, and Space / Shift+Space to select rows.
59
51
  * @default false
@@ -88,16 +80,6 @@ export interface InfiniteTableProps<TData> extends AriaAttributes {
88
80
  defaultColumnLayout?: TableColumnLayout;
89
81
  /** Called with the full new arrangement when the user resizes, moves, hides, shows or resets columns. Fires on every resize step; debounce before saving. */
90
82
  onColumnLayoutChange?: (columnLayout: TableColumnLayout) => void;
91
- /**
92
- * Adds a drag handle at the end of each header cell (arrow keys too). Columns opt out with `canResize: false`.
93
- * @default false
94
- */
95
- canResizeColumns?: boolean;
96
- /**
97
- * Lets the user reorder columns (drag a header, or Alt+ArrowLeft / Alt+ArrowRight on it) and show or hide them from a Columns menu at the end of the header. Columns opt out of hiding with `canHide: false`.
98
- * @default false
99
- */
100
- canCustomizeColumns?: boolean;
101
83
  /**
102
84
  * Space between the ends of each row and its first and last cell, on top of the cells' own padding; rows, hairlines and row fills still run the full width.
103
85
  * For a table flush with a panel's edges whose content should sit on the page's padding line (a `SMALL` table takes `4`: 12px cell padding plus 4 is the island's 16), instead of a padded wrapper, which would cut the hairlines short.
@@ -115,6 +97,56 @@ export interface InfiniteTableProps<TData> extends AriaAttributes {
115
97
  /** Inline style on the root `<div>`; only for setting CSS custom properties. */
116
98
  style?: CSSProperties;
117
99
  }
100
+ /** A table with its header row (the default): sorting, resizing and customizing live in it. */
101
+ interface InfiniteTableWithHeaderProps {
102
+ /**
103
+ * Shows the header row. Without it the row stays in the DOM, visually hidden, so screen readers keep the column names; sorting, resizing, customizing and the select-all checkbox go with it (a type error to pass them). For a compact list whose columns explain themselves.
104
+ * @default true
105
+ */
106
+ hasHeader?: true;
107
+ /** Controlled sorted column. `null` is unsorted. */
108
+ sort?: TableSort | null;
109
+ /**
110
+ * Initial sort while uncontrolled.
111
+ * @default null
112
+ */
113
+ defaultSort?: TableSort | null;
114
+ /** Called with the next sort when a sortable header is pressed: ascending, then descending, then unsorted. */
115
+ onSortChange?: (sort: TableSort | null) => void;
116
+ /**
117
+ * Adds a drag handle at the end of each header cell (arrow keys too). Columns opt out with `canResize: false`.
118
+ * @default false
119
+ */
120
+ canResizeColumns?: boolean;
121
+ /**
122
+ * Lets the user reorder columns (drag a header, or Alt+ArrowLeft / Alt+ArrowRight on it) and show or hide them from a Columns menu at the end of the header. Columns opt out of hiding with `canHide: false`.
123
+ * @default false
124
+ */
125
+ canCustomizeColumns?: boolean;
126
+ }
127
+ /** A table without a visible header row: nothing that lives in the header can be passed. */
128
+ interface InfiniteTableHeaderlessProps {
129
+ /**
130
+ * Shows the header row. Without it the row stays in the DOM, visually hidden, so screen readers keep the column names; sorting, resizing, customizing and the select-all checkbox go with it (a type error to pass them). For a compact list whose columns explain themselves.
131
+ * @default true
132
+ */
133
+ hasHeader: false;
134
+ /** Controlled sorted column. Not without a header. */
135
+ sort?: undefined;
136
+ /** Initial sort while uncontrolled. Not without a header. */
137
+ defaultSort?: undefined;
138
+ /** Called with the next sort. Not without a header. */
139
+ onSortChange?: undefined;
140
+ /** Resize handles live in the header. Not without one. */
141
+ canResizeColumns?: false;
142
+ /** Reordering and the Columns menu live in the header. Not without one. */
143
+ canCustomizeColumns?: false;
144
+ }
145
+ /**
146
+ * InfiniteTable props. `hasHeader: false` with `sort`, `defaultSort`, `onSortChange`,
147
+ * `canResizeColumns` or `canCustomizeColumns` is a type error (the Widget `isCollapsible` precedent).
148
+ */
149
+ export type InfiniteTableProps<TData> = InfiniteTableBaseProps<TData> & (InfiniteTableWithHeaderProps | InfiniteTableHeaderlessProps);
118
150
  /**
119
151
  * The public, generic call signature (`TData` inferred from `data` and `columns`). Never called:
120
152
  * it only types the default export. An arrow function rather than a type literal, so
@@ -15,7 +15,7 @@ import { getCoreRowModel, getSortedRowModel, useReactTable } from "@tanstack/rea
15
15
  * and pages; the table sorts on its own only when it holds every row (no `onEndReached`).
16
16
  *
17
17
  * Built on the shared table core (`TableCore`, `useTableColumnLayout`,
18
- * `useTableKeyboardNavigation`, `useInfiniteScrollSentinel`), which VirtualizedInfiniteTable and
18
+ * `useTableKeyboardNavigation`, `useEndReached`), which VirtualizedInfiniteTable and
19
19
  * InfiniteSpreadsheet share. `@tanstack/react-table` (an optional peer) supplies the row model and
20
20
  * type-aware sorting; this is the only module that imports it.
21
21
  *
@@ -52,7 +52,7 @@ function splitPassthrough(rest) {
52
52
  }
53
53
  /** The read-only data table. */
54
54
  var InfiniteTableInner = forwardRef(function InfiniteTable(props, ref) {
55
- const { columns, data, getRowId, size: sizeProp, isLoading: isLoadingProp, error: errorProp, emptyState, onEndReached, onRowClick, activeRowId, rowActions, sort, defaultSort, onSortChange, isSelectable: isSelectableProp, value, defaultValue, onChange, renderExpandedRow, expandedIds, defaultExpandedIds, onExpandedIdsChange, columnLayout, defaultColumnLayout, onColumnLayoutChange, canResizeColumns: canResizeColumnsProp, canCustomizeColumns: canCustomizeColumnsProp, inset: insetProp, ariaLabel, id, className, style, ...rest } = props;
55
+ const { columns, data, getRowId, size: sizeProp, isLoading: isLoadingProp, error: errorProp, emptyState, onEndReached, onRowClick, activeRowId, rowActions, sort, defaultSort, onSortChange, isSelectable: isSelectableProp, value, defaultValue, onChange, renderExpandedRow, expandedIds, defaultExpandedIds, onExpandedIdsChange, columnLayout, defaultColumnLayout, onColumnLayoutChange, canResizeColumns: canResizeColumnsProp, canCustomizeColumns: canCustomizeColumnsProp, hasHeader = true, inset: insetProp, ariaLabel, id, className, style, ...rest } = props;
56
56
  const error = errorProp === "" ? void 0 : errorProp;
57
57
  const size = sizeProp ?? "MEDIUM";
58
58
  const isLoading = isLoadingProp ?? false;
@@ -235,6 +235,7 @@ var InfiniteTableInner = forwardRef(function InfiniteTable(props, ref) {
235
235
  if (hasExpandColumn) leadingHeaders.push(null);
236
236
  return /* @__PURE__ */ jsx(TableFrame, {
237
237
  metrics,
238
+ hasHeader,
238
239
  columnLayout: layout,
239
240
  leadingHeaders,
240
241
  trailingHeader: canCustomizeColumns ? /* @__PURE__ */ jsx(TableColumnsMenu, {
@@ -208,6 +208,12 @@ export declare function TableExpandedRow({ panelId, colSpan, gutterPx, isLast, c
208
208
  export interface TableFrameProps {
209
209
  metrics: TableMetrics;
210
210
  columnLayout: TableColumnLayoutResult<unknown>;
211
+ /**
212
+ * The header row is shown. Without it the row is visually hidden, holds plain labels only and
213
+ * zeroes the header's scroll padding.
214
+ * @default true
215
+ */
216
+ hasHeader?: boolean;
211
217
  /** Header content of each leading synthetic column (select-all, expand). */
212
218
  leadingHeaders: ReactNode[];
213
219
  /** Header content of the trailing corner column; `undefined` when there is no trailing column. */
@@ -244,7 +250,7 @@ export interface TableFrameProps {
244
250
  style: CSSProperties | undefined;
245
251
  }
246
252
  /** Root → scroll container → table (header, body, status, footer) → sentinel → live region. */
247
- export declare function TableFrame({ metrics, columnLayout, leadingHeaders, trailingHeader, hasTrailingColumn, sort, onSortPress, canCustomizeColumns, rowCount, isLoading, error, emptyState, onEndReached, role, ariaLabel, tableAria, isMultiselectable, ariaRowCount, rootRef, scrollRef, rootProps, className, style, bodyClassName, bodyStyle, announcement, trailingClassName, children, }: TableFrameProps): import("react").JSX.Element;
253
+ export declare function TableFrame({ metrics, hasHeader, columnLayout, leadingHeaders, trailingHeader, hasTrailingColumn, sort, onSortPress, canCustomizeColumns, rowCount, isLoading, error, emptyState, onEndReached, role, ariaLabel, tableAria, isMultiselectable, ariaRowCount, rootRef, scrollRef, rootProps, className, style, bodyClassName, bodyStyle, announcement, trailingClassName, children, }: TableFrameProps): import("react").JSX.Element;
248
254
  /** @internal Header content of the select column: the select-all checkbox. */
249
255
  export declare function TableSelectAllCheckbox({ metrics, isChecked, isIndeterminate, isDisabled, onToggle, }: {
250
256
  metrics: TableMetrics;