@scattered-light/loomiere-base-ui 0.13.0 → 0.14.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 (71) hide show
  1. package/README.md +1 -0
  2. package/dist/custom/collection/index.d.ts +10 -3
  3. package/dist/custom/collection/index.js +11 -3
  4. package/dist/custom/collection/index.js.map +1 -1
  5. package/dist/design-system/components/DataTable/preview.html +1 -1
  6. package/dist/design-system/components/Table/README.md +1 -1
  7. package/dist/design-system/components/bundle.js +6 -6
  8. package/dist/design-system/components/styles.css +90 -60
  9. package/dist/styles/components/Accordion.css +1 -1
  10. package/dist/styles/components/AlertDialog.css +1 -1
  11. package/dist/styles/components/Autocomplete.css +1 -1
  12. package/dist/styles/components/Avatar.css +1 -1
  13. package/dist/styles/components/Button.css +1 -1
  14. package/dist/styles/components/Checkbox.css +1 -1
  15. package/dist/styles/components/CheckboxGroup.css +1 -1
  16. package/dist/styles/components/Collapsible.css +1 -1
  17. package/dist/styles/components/Combobox.css +1 -1
  18. package/dist/styles/components/ContextMenu.css +1 -1
  19. package/dist/styles/components/Dialog.css +1 -1
  20. package/dist/styles/components/Drawer.css +1 -1
  21. package/dist/styles/components/Field.css +1 -1
  22. package/dist/styles/components/Fieldset.css +1 -1
  23. package/dist/styles/components/Form.css +1 -1
  24. package/dist/styles/components/Input.css +1 -1
  25. package/dist/styles/components/Menu.css +1 -1
  26. package/dist/styles/components/Menubar.css +1 -1
  27. package/dist/styles/components/Meter.css +1 -1
  28. package/dist/styles/components/NavigationMenu.css +1 -1
  29. package/dist/styles/components/NumberField.css +1 -1
  30. package/dist/styles/components/OTPField.css +1 -1
  31. package/dist/styles/components/Popover.css +1 -1
  32. package/dist/styles/components/PreviewCard.css +1 -1
  33. package/dist/styles/components/Progress.css +1 -1
  34. package/dist/styles/components/Radio.css +1 -1
  35. package/dist/styles/components/ScrollArea.css +1 -1
  36. package/dist/styles/components/Select.css +1 -1
  37. package/dist/styles/components/Separator.css +1 -1
  38. package/dist/styles/components/Slider.css +1 -1
  39. package/dist/styles/components/Switch.css +1 -1
  40. package/dist/styles/components/Tabs.css +1 -1
  41. package/dist/styles/components/Toast.css +1 -1
  42. package/dist/styles/components/Toggle.css +1 -1
  43. package/dist/styles/components/ToggleGroup.css +1 -1
  44. package/dist/styles/components/Toolbar.css +1 -1
  45. package/dist/styles/components/Tooltip.css +1 -1
  46. package/dist/styles/custom/AppBar.css +1 -1
  47. package/dist/styles/custom/Badge.css +1 -1
  48. package/dist/styles/custom/Collection.css +1 -1
  49. package/dist/styles/custom/CollectionPagination.css +1 -1
  50. package/dist/styles/custom/CollectionToolbar.css +1 -1
  51. package/dist/styles/custom/DataList.css +1 -1
  52. package/dist/styles/custom/DataTable.css +12 -1
  53. package/dist/styles/custom/DatePicker.css +1 -1
  54. package/dist/styles/custom/DescriptionList.css +1 -1
  55. package/dist/styles/custom/EditableList.css +1 -1
  56. package/dist/styles/custom/EmptyState.css +1 -1
  57. package/dist/styles/custom/ListDetail.css +1 -1
  58. package/dist/styles/custom/MoneyField.css +1 -1
  59. package/dist/styles/custom/PickerButton.css +1 -1
  60. package/dist/styles/custom/Sheet.css +3 -1
  61. package/dist/styles/custom/SideNav.css +1 -1
  62. package/dist/styles/custom/Splitter.css +1 -1
  63. package/dist/styles/custom/StatFigure.css +1 -1
  64. package/dist/styles/custom/Table.css +18 -1
  65. package/dist/styles/index.css +1 -1
  66. package/dist/styles/reset/accessibility.css +1 -1
  67. package/dist/styles/reset/reset-accessibility.css +1 -1
  68. package/dist/styles/reset/reset-tailwind.css +1 -1
  69. package/dist/styles/reset/reset.css +1 -1
  70. package/dist/styles/tailwind.css +1 -1
  71. package/package.json +2 -2
package/README.md CHANGED
@@ -174,6 +174,7 @@ A tree in a DataTable (`getSubRows`) has options for a register of parents and c
174
174
  - `treeLines` also gives parent, child and total rows their own heights, from `collection.tree-row-height-parent`, `tree-row-height-child`, `total-row-height-subtotal` and `total-row-height-grand` (all the dense row until a brand sets them), and starts the elbow `collection.tree-line-offset` in. With `disclosure="small"` the chevron takes `collection.disclosure-color`. A row with `onRowActivate` or `getRowHref` shows a pointer. `table.row-hover-color` is the text color on the hovered row.
175
175
  - `CollectionToolbar` takes `searchWidth="fixed"` (the search keeps `collection.search-fixed-width`), `meta` and `metaEnd` (quiet text beside the search and at the far end of the row) and `framed` (padding and a rule under it, inside a Sheet).
176
176
  - `treeLines` draws an elbow from each child's name back up to its parent. `disclosure="small"` shrinks the expand button so a parent is as tall as its children. `getRowKind={(row) => 'link'}` marks a row (`data-kind="link"`) whose name reads as a link, for a row such as "3 more Entities".
177
+ - `CollectionToolbar` takes `searchPlaceholder`. `DataTable` takes `headerStyle="caps"` (column names and total-row labels in caps-condense) and `figures` (end-aligned cells in the figures family). With `treeLines`, parent rows take `collection.tree-parent-row-background` and `collection.tree-parent-row-hover`.
177
178
 
178
179
 
179
180
  ### App bar: AppBar, PickerButton and a segmented ToggleGroup
@@ -455,6 +455,10 @@ interface DataTableProps<T> extends CollectionViewProps<T> {
455
455
  * total, so totalStyle is ignored. The label defaults to the messages for page subtotal and total.
456
456
  */
457
457
  totalRows?: DataTableTotalRow<T>[];
458
+ /** 'caps' sets the column names, and the labels in total rows, in caps-condense, as on a working paper. */
459
+ headerStyle?: 'default' | 'caps';
460
+ /** Sets right-aligned cells (numbers) in the figures text family: mono, tabular. Total rows included. */
461
+ figures?: boolean;
458
462
  /** Draws an elbow connector from each child row's name back up to its parent. Use it with getSubRows. */
459
463
  treeLines?: boolean;
460
464
  /** 'small' shrinks the expand/collapse button so a parent row stays the height of its siblings. */
@@ -471,7 +475,7 @@ interface DataTableTotalRow<T = unknown> {
471
475
  * A data table, the APG pattern: one tab stop for the rows, headers announce sort, and it is
472
476
  * not a grid. A grid would say this is a spreadsheet, and it is not. AG Grid is that tool.
473
477
  */
474
- declare function DataTable<T>({ collection, label, caption, onRowActivate, getRowHref, activeRowId, rowActions, empty, loading, stickyHeader, stickyRowHeader, narrow, size, totalStyle, totalRows, treeLines, disclosure, getRowKind, rowNavigation, className, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
478
+ declare function DataTable<T>({ collection, label, caption, onRowActivate, getRowHref, activeRowId, rowActions, empty, loading, stickyHeader, stickyRowHeader, narrow, size, totalStyle, totalRows, treeLines, headerStyle, figures, disclosure, getRowKind, rowNavigation, className, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
475
479
 
476
480
  interface CollectionPaginationProps {
477
481
  /** 1-based. */
@@ -510,6 +514,8 @@ interface CollectionToolbarProps<T> {
510
514
  }>;
511
515
  actions?: React.ReactNode;
512
516
  bulkActions?: React.ReactNode;
517
+ /** Placeholder text in the search box, such as "Find a client". The label still names it for screen readers. */
518
+ searchPlaceholder?: string;
513
519
  /** 'fill' (the default) lets the search grow. 'fixed' gives it collection.search-fixed-width, so the meta beside it has room. */
514
520
  searchWidth?: 'fill' | 'fixed';
515
521
  /** Quiet text beside the search, such as "12 clients". */
@@ -524,7 +530,7 @@ interface CollectionToolbarProps<T> {
524
530
  * Tabs and search stay put while rows are selected. The trailing controls swap for the
525
531
  * selection bar, so the bar takes their place and the row does not grow.
526
532
  */
527
- declare function CollectionToolbarImpl<T>({ collection, searchLabel, searchLabelVisible, showSort, groupOptions, actions, bulkActions, searchWidth, meta, metaEnd, framed, className }: CollectionToolbarProps<T>): react_jsx_runtime.JSX.Element;
533
+ declare function CollectionToolbarImpl<T>({ collection, searchLabel, searchLabelVisible, searchPlaceholder, showSort, groupOptions, actions, bulkActions, searchWidth, meta, metaEnd, framed, className }: CollectionToolbarProps<T>): react_jsx_runtime.JSX.Element;
528
534
  declare function ToolbarTabs<T>({ collection, column }: {
529
535
  collection: CollectionApi<T>;
530
536
  column: CollectionColumn<T>;
@@ -533,8 +539,9 @@ declare function ToolbarTabs<T>({ collection, column }: {
533
539
  * The icon and the clear button sit inside the field. The clear button is the only clear
534
540
  * control and shows only when there is text. Escape clears too.
535
541
  */
536
- declare function SearchField({ label, visible, value, onChange, clearLabel }: {
542
+ declare function SearchField({ label, visible, placeholder, value, onChange, clearLabel }: {
537
543
  label: string;
544
+ placeholder?: string;
538
545
  visible?: boolean;
539
546
  value: string;
540
547
  onChange: (value: string) => void;
@@ -446,6 +446,8 @@ function DataTable({
446
446
  totalStyle = "band",
447
447
  totalRows,
448
448
  treeLines,
449
+ headerStyle = "default",
450
+ figures,
449
451
  disclosure = "default",
450
452
  getRowKind,
451
453
  rowNavigation,
@@ -495,6 +497,8 @@ function DataTable({
495
497
  totalStyle,
496
498
  totalRows,
497
499
  treeLines,
500
+ headerStyle,
501
+ figures,
498
502
  disclosure,
499
503
  getRowKind,
500
504
  className,
@@ -506,7 +510,7 @@ function DataTable({
506
510
  );
507
511
  return /* @__PURE__ */ jsx("div", { ref: narrowWidth.ref, className: cn("CollectionView", asList ? className : void 0), "data-narrow": narrowWidth.under ? "" : void 0, children: view });
508
512
  }
509
- function TableView({ collection, columns, label, caption, colSpan, leaves, navigate, allSelected, someSelected, loading, empty, stickyHeader, stickyRowHeader, size, totalStyle, totalRows, treeLines, disclosure, getRowKind, className, onRowActivate, getRowHref, activeRowId, rowActions }) {
513
+ function TableView({ collection, columns, label, caption, colSpan, leaves, navigate, allSelected, someSelected, loading, empty, stickyHeader, stickyRowHeader, size, totalStyle, totalRows, treeLines, headerStyle, figures, disclosure, getRowKind, className, onRowActivate, getRowHref, activeRowId, rowActions }) {
510
514
  const roving = useRovingRows(leaves.length, navigate);
511
515
  const scrollerRef = React4.useRef(null);
512
516
  const [overflows, setOverflows] = React4.useState(false);
@@ -560,6 +564,8 @@ function TableView({ collection, columns, label, caption, colSpan, leaves, navig
560
564
  "data-sticky-header": stickyHeader ? "" : void 0,
561
565
  "data-sticky-row-header": stickyRowHeader ? "" : void 0,
562
566
  "data-tree-lines": treeLines ? "" : void 0,
567
+ "data-header-style": headerStyle === "caps" ? "caps" : void 0,
568
+ "data-figures": figures ? "" : void 0,
563
569
  "data-disclosure": disclosure === "small" ? "small" : void 0,
564
570
  children: [
565
571
  caption ? /* @__PURE__ */ jsx("caption", { children: caption }) : null,
@@ -816,7 +822,7 @@ function CollectionPagination({
816
822
  ] });
817
823
  }
818
824
  var COMBOBOX_AT = 12;
819
- function CollectionToolbarImpl({ collection, searchLabel, searchLabelVisible, showSort, groupOptions, actions, bulkActions, searchWidth = "fill", meta, metaEnd, framed, className }) {
825
+ function CollectionToolbarImpl({ collection, searchLabel, searchLabelVisible, searchPlaceholder, showSort, groupOptions, actions, bulkActions, searchWidth = "fill", meta, metaEnd, framed, className }) {
820
826
  const tabs = collection.columns.find((column) => column.filter?.kind === "tabs");
821
827
  const selects = collection.columns.filter((column) => column.filter && column.filter.kind !== "tabs");
822
828
  const searchable = collection.columns.some((column) => column.searchable);
@@ -850,6 +856,7 @@ function CollectionToolbarImpl({ collection, searchLabel, searchLabelVisible, sh
850
856
  {
851
857
  label: searchLabel ?? "Search",
852
858
  visible: searchLabelVisible,
859
+ placeholder: searchPlaceholder,
853
860
  value: collection.search,
854
861
  onChange: collection.setSearch,
855
862
  clearLabel: collection.messages.clearSearch
@@ -901,7 +908,7 @@ function ToolbarTabs({ collection, column }) {
901
908
  ] }, tabValue || "all");
902
909
  }) }) });
903
910
  }
904
- function SearchField({ label, visible, value, onChange, clearLabel = "Clear search" }) {
911
+ function SearchField({ label, visible, placeholder, value, onChange, clearLabel = "Clear search" }) {
905
912
  const id = React4.useId();
906
913
  const input = React4.useRef(null);
907
914
  return /* @__PURE__ */ jsxs("div", { className: "CollectionSearch", children: [
@@ -914,6 +921,7 @@ function SearchField({ label, visible, value, onChange, clearLabel = "Clear sear
914
921
  ref: input,
915
922
  id,
916
923
  type: "search",
924
+ placeholder,
917
925
  value,
918
926
  onChange: (event) => onChange(event.target.value),
919
927
  onKeyDown: (event) => {