@stackone/malachite 2.86.0 → 2.87.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 (46) hide show
  1. package/COMPONENTS.md +3 -2
  2. package/dist/components/Card.js +128 -75
  3. package/dist/components/Card.js.map +1 -1
  4. package/dist/components/FilterSearch.js +228 -224
  5. package/dist/components/FilterSearch.js.map +1 -1
  6. package/dist/components/FrameHeader.js +36 -0
  7. package/dist/components/FrameHeader.js.map +1 -0
  8. package/dist/components/LoadingBar.js +5 -5
  9. package/dist/components/LoadingBar.js.map +1 -1
  10. package/dist/components/MultiSelect.js +431 -382
  11. package/dist/components/MultiSelect.js.map +1 -1
  12. package/dist/components/Table/Table.js +630 -606
  13. package/dist/components/Table/Table.js.map +1 -1
  14. package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
  15. package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
  16. package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
  17. package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
  18. package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
  19. package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
  20. package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
  21. package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
  22. package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
  23. package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
  24. package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
  25. package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
  26. package/dist/components/TimeBarChart/stackLayout.js +25 -0
  27. package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
  28. package/dist/components/TimeBarChart/timeBuckets.js +133 -0
  29. package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
  30. package/dist/components/TimeBarChart/tones.js +10 -0
  31. package/dist/components/TimeBarChart/tones.js.map +1 -0
  32. package/dist/components/dateMath.js +1 -0
  33. package/dist/components/dateMath.js.map +1 -1
  34. package/dist/components/filterSearchModel.js +53 -45
  35. package/dist/components/filterSearchModel.js.map +1 -1
  36. package/dist/components/frameStyles.js +14 -0
  37. package/dist/components/frameStyles.js.map +1 -0
  38. package/dist/components/headerContent.js +10 -0
  39. package/dist/components/headerContent.js.map +1 -0
  40. package/dist/index.d.ts +123 -3
  41. package/dist/index.js +24 -22
  42. package/dist/index.js.map +1 -1
  43. package/dist/tailwind.css.js +1 -1
  44. package/dist/theme.js +340 -340
  45. package/dist/theme.js.map +1 -1
  46. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -531,7 +531,17 @@ export declare const Card: default_2.FC<CardProps>;
531
531
  export declare const CardIcon: React.FC<IconProps_15>;
532
532
 
533
533
  declare interface CardProps {
534
+ /**
535
+ * `framed` draws the detached Table's frame: the title row sits on a grey frame and the
536
+ * children in a bordered section inside it, so a card above a table reads as part of the
537
+ * same set. `dimmed`, `border`, `size`, `glassFooter` and `headerConfig` do not apply to it.
538
+ */
539
+ variant?: CardVariant;
534
540
  title?: string | default_2.ReactNode;
541
+ /** Dimmed text beside the title, such as a count or a unit. */
542
+ subtitle?: default_2.ReactNode;
543
+ /** Actions at the right of the title row. */
544
+ extra?: default_2.ReactNode;
535
545
  padding?: string;
536
546
  children?: default_2.ReactNode;
537
547
  size?: 'default' | 'small';
@@ -607,6 +617,8 @@ export declare interface CardStripProps {
607
617
  /** Palette for the strip's rule. Pass the tone of whatever card is selected. */
608
618
  export declare type CardStripTone = 'profile' | 'library' | 'editing';
609
619
 
620
+ export declare type CardVariant = 'default' | 'framed';
621
+
610
622
  export declare const CaretDoubleLeftIcon: React.FC<IconProps_16>;
611
623
 
612
624
  export declare const CaretDoubleRightIcon: React.FC<IconProps_17>;
@@ -1907,6 +1919,12 @@ export declare interface FilterSearchItem {
1907
1919
 
1908
1920
  export declare interface FilterSearchProps {
1909
1921
  filters: FilterSearchFilter[];
1922
+ /**
1923
+ * What a query typed before a filter is picked searches, when it should differ from
1924
+ * `filters`: every value, say, while `filters` holds only those the applied filters leave.
1925
+ * Memoise it: a new array on each render rebuilds the chip labels over every value it holds.
1926
+ */
1927
+ searchFilters?: FilterSearchFilter[];
1910
1928
  /** Controlled: the bar always shows `value`, so a URL-backed selection needs no syncing. */
1911
1929
  value: FilterSearchSelection[];
1912
1930
  /** `changes` lists only the filters that moved; an empty `items` means that filter was removed. */
@@ -5332,7 +5350,7 @@ export declare interface TabItem {
5332
5350
  disabled?: boolean;
5333
5351
  }
5334
5352
 
5335
- export declare const Table: <T = Record<string, unknown>>({ columns, data, loading, error, errorTitle, errorSubTitle, emptyTitle, emptySubTitle, bordered, showHeader, rowKey, scrollHeight, size, rowDensity, layout, headerVariant, rowClassName, rowVariant, onRow, onClickRow, selectedRowKey, scrollSelectedIntoView, rowSelection, pagination, className, style, stickyHeaderTop, scrollX, rowSection, renderSectionDivider, onVisibleOrderChange, virtual, virtualRowHeightEstimate, virtualScrollElement, }: TableProps<T>) => JSX_2.Element;
5353
+ export declare const Table: <T = Record<string, unknown>>({ columns, data, loading, error, errorTitle, errorSubTitle, emptyTitle, emptySubTitle, bordered, showHeader, rowKey, scrollHeight, size, rowDensity, layout, headerVariant, title, subtitle, extra, rowClassName, rowVariant, onRow, onClickRow, selectedRowKey, scrollSelectedIntoView, rowSelection, pagination, className, style, stickyHeaderTop, scrollX, rowSection, renderSectionDivider, onVisibleOrderChange, virtual, virtualRowHeightEstimate, virtualScrollElement, }: TableProps<T>) => JSX_2.Element;
5336
5354
 
5337
5355
  export declare type TableColumnDefinition<T = Record<string, unknown>> = {
5338
5356
  title: string | default_2.ReactNode;
@@ -5344,12 +5362,24 @@ export declare type TableColumnDefinition<T = Record<string, unknown>> = {
5344
5362
  minWidth?: number;
5345
5363
  ellipsis?: boolean;
5346
5364
  render?: (value: unknown, record?: T, index?: number) => default_2.ReactNode;
5347
- sorter?: boolean | ((a: T, b: T) => number);
5365
+ /**
5366
+ * `true` sorts the rows by `dataIndex`, a function sorts them with it, and `'server'` leaves
5367
+ * them in the order given: the arrow still moves and `onHeaderCell` still runs, for a page
5368
+ * the server has already sorted.
5369
+ */
5370
+ sorter?: boolean | 'server' | ((a: T, b: T) => number);
5348
5371
  sortIcon?: (props: {
5349
5372
  sortOrder: 'desc' | 'asc' | null;
5350
5373
  }) => default_2.ReactNode;
5351
- onHeaderCell?: (data: T, index?: number) => default_2.HTMLAttributes<HTMLTableCellElement> | default_2.TdHTMLAttributes<HTMLTableCellElement>;
5374
+ /**
5375
+ * Its `onClick` runs when a sortable column's header is clicked, as the table moves its
5376
+ * arrow: the hook for a sort the server does, with `sorter: 'server'`. The arrow cycles
5377
+ * ascending, descending, none, and the handler runs on each click, the clearing one too.
5378
+ */
5379
+ onHeaderCell?: (column: TableColumnDefinition<T>, index?: number) => TableHeaderCellHandlers;
5380
+ /** The arrow the column starts with, and for a `sorter` function the order it starts in. */
5352
5381
  defaultSortOrder?: 'ascend' | 'descend';
5382
+ /** Not read: the header always cycles ascending, descending, none. */
5353
5383
  sortDirections?: ('ascend' | 'descend')[];
5354
5384
  fixed?: 'left' | 'right';
5355
5385
  align?: 'left' | 'center' | 'right';
@@ -5357,6 +5387,11 @@ export declare type TableColumnDefinition<T = Record<string, unknown>> = {
5357
5387
 
5358
5388
  export declare type TableColumns<T = Record<string, unknown>> = TableColumnDefinition<T>[];
5359
5389
 
5390
+ /** What the table reads from a column's `onHeaderCell`: `onClick`, run from the sort button. */
5391
+ export declare interface TableHeaderCellHandlers {
5392
+ onClick?: (event: default_2.MouseEvent<HTMLButtonElement>) => void;
5393
+ }
5394
+
5360
5395
  declare type TableHeaderVariant = 'inline' | 'detached';
5361
5396
 
5362
5397
  export declare type TablePaginationPosition = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
@@ -5382,6 +5417,15 @@ declare type TableProps<T = Record<string, unknown>> = {
5382
5417
  rowDensity?: 'default' | 'compact';
5383
5418
  layout?: 'fixed' | 'auto';
5384
5419
  headerVariant?: TableHeaderVariant;
5420
+ /** A title row on the detached frame, above the column headers, as on Card's `framed`
5421
+ * variant. With `stickyHeaderTop` it docks with the column headers; with
5422
+ * `showHeader={false}` nothing docks and it scrolls with the rows. Detached only: the inline
5423
+ * header has no frame, and warns in development when given one. */
5424
+ title?: default_2.ReactNode;
5425
+ /** Dimmed text beside `title`, such as a count. */
5426
+ subtitle?: default_2.ReactNode;
5427
+ /** Actions at the right of the title row. */
5428
+ extra?: default_2.ReactNode;
5385
5429
  rowClassName?: (record: T, index: number) => string;
5386
5430
  rowVariant?: (record: T, index: number) => RowVariant | undefined;
5387
5431
  onRow?: (record: T, index: number) => TableRowActions<T>;
@@ -5643,6 +5687,82 @@ export declare const ThumbsDownIcon: React.FC<IconProps_109>;
5643
5687
 
5644
5688
  export declare const ThumbsUpIcon: React.FC<IconProps_110>;
5645
5689
 
5690
+ export declare const TimeBarChart: default_2.FC<TimeBarChartProps>;
5691
+
5692
+ export declare interface TimeBarChartBucket {
5693
+ /** The bucket's start. A string with no zone is read as UTC. */
5694
+ start: TimeInput;
5695
+ /** Each series' count in this bucket, by series key. A missing key counts as 0. */
5696
+ values: Record<string, number>;
5697
+ }
5698
+
5699
+ export declare interface TimeBarChartInterval {
5700
+ unit: TimeBarChartUnit;
5701
+ /** How many `unit`s one bucket spans, e.g. 3 with `hour` for 3-hour buckets. Default 1. */
5702
+ step?: number;
5703
+ }
5704
+
5705
+ export declare interface TimeBarChartProps {
5706
+ /** Stacked by tone, failures on top (`neutral`, `success`, `error`), and in the order given
5707
+ * within a tone. The legend, tooltip and table keep the order given. */
5708
+ series: TimeBarChartSeries[];
5709
+ /** Only the buckets that have values; empty buckets in `range` are laid out regardless. */
5710
+ buckets: TimeBarChartBucket[];
5711
+ interval: TimeBarChartInterval;
5712
+ /** The window the axis covers, `end` exclusive as `onRangeSelect` reports it, so a selection
5713
+ * fed back in shows exactly the buckets selected. Without it the axis spans the buckets
5714
+ * given. At most 2,000 buckets are laid out; past that the newest are kept, so a live window
5715
+ * still ends at now. */
5716
+ range?: {
5717
+ start: TimeInput;
5718
+ end: TimeInput;
5719
+ };
5720
+ /** The plot's height, axis labels included: 120, 160 or 240px. */
5721
+ size?: TimeBarChartSize;
5722
+ /** With buckets already drawn, they stay and dim while new ones load. */
5723
+ loading?: boolean;
5724
+ error?: boolean;
5725
+ errorTitle?: string;
5726
+ errorSubTitle?: string;
5727
+ /** What the stacked total counts, shown in the tooltip, e.g. "Requests". */
5728
+ valueLabel?: string;
5729
+ /** A legend naming each series. Leave it off only where the page labels the series itself. */
5730
+ legend?: boolean;
5731
+ /** A time whose bucket is shaded behind the bars, e.g. the row under the pointer in a list. */
5732
+ highlightTime?: TimeInput;
5733
+ /** Turns on click-and-drag selection of whole buckets. */
5734
+ onRangeSelect?: (selection: TimeBarChartRangeSelection) => void;
5735
+ /** Names the chart. Pass this or `aria-labelledby`; the hidden table takes it as its caption. */
5736
+ 'aria-label'?: string;
5737
+ /** Names the chart from a visible heading instead, and the hidden table with it. */
5738
+ 'aria-labelledby'?: string;
5739
+ className?: string;
5740
+ style?: default_2.CSSProperties;
5741
+ }
5742
+
5743
+ export declare interface TimeBarChartRangeSelection {
5744
+ /** UTC ISO start of the first selected bucket. */
5745
+ start: string;
5746
+ /** UTC ISO end of the last selected bucket, exclusive: the start of the bucket after it. */
5747
+ end: string;
5748
+ /** Whether the selection takes in the last bucket, i.e. "up to now" on a live window. */
5749
+ reachesEnd: boolean;
5750
+ }
5751
+
5752
+ export declare interface TimeBarChartSeries {
5753
+ key: string;
5754
+ label: string;
5755
+ tone: TimeBarChartTone;
5756
+ }
5757
+
5758
+ export declare type TimeBarChartSize = 'small' | 'medium' | 'large';
5759
+
5760
+ export declare type TimeBarChartTone = 'success' | 'error' | 'neutral';
5761
+
5762
+ export declare type TimeBarChartUnit = 'minute' | 'hour' | 'day' | 'week' | 'month';
5763
+
5764
+ declare type TimeInput = string | number | Date;
5765
+
5646
5766
  export declare interface ToastApi {
5647
5767
  show: (options: ToastOptions) => void;
5648
5768
  }
package/dist/index.js CHANGED
@@ -216,17 +216,18 @@ import { default as Rm } from "./components/Table/Table.js";
216
216
  import { default as km } from "./components/TextArea/TextArea.js";
217
217
  import { default as _m } from "./components/CustomIcons/ThumbsDownIcon.js";
218
218
  import { default as vm } from "./components/CustomIcons/ThumbsUpIcon.js";
219
- import { default as Om } from "./components/CustomIcons/TrashIcon.js";
220
- import { default as Wm } from "./components/CustomIcons/TriangleDownIcon.js";
221
- import { default as Um } from "./components/CustomIcons/TriangleRightIcon.js";
222
- import { default as Xm } from "./components/CustomIcons/UnarchiveIcon.js";
223
- import { default as Km } from "./components/CustomIcons/UploadIcon.js";
224
- import { default as Gm } from "./components/CustomIcons/WarningCircleFilled.js";
225
- import { default as jm } from "./components/CustomIcons/WarningTriangleIcon.js";
226
- import { default as Jm } from "./components/CustomIcons/WebhookEventsIcon.js";
227
- import { default as Zm } from "./components/CustomIcons/WebhookIcon.js";
228
- import { default as ol } from "./components/CustomIcons/WebhookSigningSecretIcon.js";
229
- import { PageActions as rl } from "./components/PageLayout/regularLayout.js";
219
+ import { TimeBarChart as Om } from "./components/TimeBarChart/TimeBarChart.js";
220
+ import { default as Wm } from "./components/CustomIcons/TrashIcon.js";
221
+ import { default as Um } from "./components/CustomIcons/TriangleDownIcon.js";
222
+ import { default as Xm } from "./components/CustomIcons/TriangleRightIcon.js";
223
+ import { default as Km } from "./components/CustomIcons/UnarchiveIcon.js";
224
+ import { default as Gm } from "./components/CustomIcons/UploadIcon.js";
225
+ import { default as jm } from "./components/CustomIcons/WarningCircleFilled.js";
226
+ import { default as Jm } from "./components/CustomIcons/WarningTriangleIcon.js";
227
+ import { default as Zm } from "./components/CustomIcons/WebhookEventsIcon.js";
228
+ import { default as ol } from "./components/CustomIcons/WebhookIcon.js";
229
+ import { default as rl } from "./components/CustomIcons/WebhookSigningSecretIcon.js";
230
+ import { PageActions as al } from "./components/PageLayout/regularLayout.js";
230
231
  export {
231
232
  lt as AccessPills,
232
233
  r as Accordion,
@@ -375,7 +376,7 @@ export {
375
376
  Pr as OverflowRow,
376
377
  Ie as Padded,
377
378
  Po as PaddingSize,
378
- rl as PageActions,
379
+ al as PageActions,
379
380
  Zr as PageLayout,
380
381
  Ir as PillButton,
381
382
  _p as PinIcon,
@@ -450,23 +451,24 @@ export {
450
451
  Jr as ThemeScope,
451
452
  _m as ThumbsDownIcon,
452
453
  vm as ThumbsUpIcon,
454
+ Om as TimeBarChart,
453
455
  He as ToastProvider,
454
456
  Cr as Toggle,
455
457
  No as Toolbar,
456
458
  Ve as Tooltip,
457
- Om as TrashIcon,
458
- Wm as TriangleDownIcon,
459
- Um as TriangleRightIcon,
459
+ Wm as TrashIcon,
460
+ Um as TriangleDownIcon,
461
+ Xm as TriangleRightIcon,
460
462
  Ye as TruncatedTooltip,
461
463
  ur as Typography,
462
- Xm as UnarchiveIcon,
463
- Km as UploadIcon,
464
+ Km as UnarchiveIcon,
465
+ Gm as UploadIcon,
464
466
  $e as UsageCard,
465
- Gm as WarningCircleFilled,
466
- jm as WarningTriangleIcon,
467
- Jm as WebhookEventsIcon,
468
- Zm as WebhookIcon,
469
- ol as WebhookSigningSecretIcon,
467
+ jm as WarningCircleFilled,
468
+ Jm as WarningTriangleIcon,
469
+ Zm as WebhookEventsIcon,
470
+ ol as WebhookIcon,
471
+ rl as WebhookSigningSecretIcon,
470
472
  Ho as WizardLayout,
471
473
  zo as ZoomableImage,
472
474
  st as applyCustomTheme,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}