@sckyzo/cosmos-react 0.3.0 → 0.4.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.
- package/CHANGELOG.md +151 -0
- package/README.md +19 -794
- package/dist/CodeBlock-CY18_3tZ.d.cts +52 -0
- package/dist/CodeBlock-CY18_3tZ.d.ts +52 -0
- package/dist/code/index.cjs +331 -0
- package/dist/code/index.cjs.map +1 -0
- package/dist/code/index.d.cts +29 -0
- package/dist/code/index.d.ts +29 -0
- package/dist/code/index.js +326 -0
- package/dist/code/index.js.map +1 -0
- package/dist/editor/index.cjs +879 -0
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.d.cts +100 -0
- package/dist/editor/index.d.ts +100 -0
- package/dist/editor/index.js +872 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/fieldRecipe-Cao5uUIK.d.cts +3 -0
- package/dist/fieldRecipe-Cao5uUIK.d.ts +3 -0
- package/dist/index.cjs +18187 -11973
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1638 -243
- package/dist/index.d.ts +1638 -243
- package/dist/index.js +18158 -11982
- package/dist/index.js.map +1 -1
- package/dist/intent-D0bANgYJ.d.cts +12 -0
- package/dist/intent-D0bANgYJ.d.ts +12 -0
- package/dist/map/index.cjs +559 -0
- package/dist/map/index.cjs.map +1 -0
- package/dist/map/index.d.cts +95 -0
- package/dist/map/index.d.ts +95 -0
- package/dist/map/index.js +556 -0
- package/dist/map/index.js.map +1 -0
- package/package.json +82 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes, ReactNode, ElementType, ComponentPropsWithRef, Ref, ComponentType, AnchorHTMLAttributes, ButtonHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeReferrerPolicy, ComponentPropsWithoutRef, ChangeEvent, MouseEventHandler, ComponentProps } from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, ElementType, ComponentPropsWithRef, Ref, ComponentType, AnchorHTMLAttributes, ButtonHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeReferrerPolicy, ComponentPropsWithoutRef, ChangeEvent, MouseEventHandler, ComponentProps, CSSProperties } from 'react';
|
|
3
|
+
import { I as Intent } from './intent-D0bANgYJ.cjs';
|
|
4
|
+
export { a as CodeBlock, C as CodeBlockProps } from './CodeBlock-CY18_3tZ.cjs';
|
|
3
5
|
import { LucideIcon } from 'lucide-react';
|
|
4
6
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
5
7
|
import * as RadixAccordion from '@radix-ui/react-accordion';
|
|
6
8
|
import { ToasterProps } from 'sonner';
|
|
7
9
|
export { toast } from 'sonner';
|
|
8
10
|
import { Command } from 'cmdk';
|
|
11
|
+
import { F as FieldSize } from './fieldRecipe-Cao5uUIK.cjs';
|
|
9
12
|
import { DayPickerProps } from 'react-day-picker';
|
|
10
13
|
|
|
11
|
-
type DividerAlign = '
|
|
14
|
+
type DividerAlign = 'start' | 'center' | 'end';
|
|
12
15
|
type DividerProps = HTMLAttributes<HTMLDivElement> & {
|
|
13
16
|
/**
|
|
14
17
|
* Render an inset label/icon centered (or aligned) on top of the line.
|
|
@@ -35,9 +38,9 @@ type DividerIconProps = Omit<DividerProps, 'inset' | 'emphasis'> & {
|
|
|
35
38
|
iconClassName?: string;
|
|
36
39
|
};
|
|
37
40
|
type DividerRowProps = HTMLAttributes<HTMLDivElement> & {
|
|
38
|
-
/**
|
|
41
|
+
/** Title at the start of the line. Use `null` to render only actions. */
|
|
39
42
|
title?: ReactNode;
|
|
40
|
-
/**
|
|
43
|
+
/** Trailing content at the end of the line — button, button group, toolbar, etc. */
|
|
41
44
|
actions?: ReactNode;
|
|
42
45
|
/**
|
|
43
46
|
* Use a larger font size for the title (TUI "With title and button").
|
|
@@ -51,7 +54,7 @@ declare const Divider: (({ inset, align, emphasis, insetBg, className, ...rest }
|
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
type MediaObjectAlign = 'start' | 'center' | 'bottom' | 'stretch';
|
|
54
|
-
type MediaObjectPosition = '
|
|
57
|
+
type MediaObjectPosition = 'start' | 'end';
|
|
55
58
|
type MediaObjectProps = ComponentPropsWithRef<'div'> & {
|
|
56
59
|
/**
|
|
57
60
|
* Where the media sits against the body: `start` (top), `center`, `bottom`,
|
|
@@ -59,7 +62,7 @@ type MediaObjectProps = ComponentPropsWithRef<'div'> & {
|
|
|
59
62
|
* `h-full`). Default `start`.
|
|
60
63
|
*/
|
|
61
64
|
align?: MediaObjectAlign;
|
|
62
|
-
/** Side of the body the media sits on. `
|
|
65
|
+
/** Side of the body the media sits on. `end` reverses the row. Default `start`. */
|
|
63
66
|
mediaPosition?: MediaObjectPosition;
|
|
64
67
|
/** Gap between the media and the body. Default `gap-x-4` (16px). */
|
|
65
68
|
gapClassName?: string;
|
|
@@ -106,7 +109,7 @@ declare const PageContainer: ({ children, width, className }: PageContainerProps
|
|
|
106
109
|
|
|
107
110
|
type SplitViewBreakpoint = 'md' | 'lg' | 'xl';
|
|
108
111
|
type SplitViewProps = {
|
|
109
|
-
/** The panes: `SplitView.Pane`, in the order they sit
|
|
112
|
+
/** The panes: `SplitView.Pane`, in the order they sit along the line, the first at the start. */
|
|
110
113
|
children: ReactNode;
|
|
111
114
|
/**
|
|
112
115
|
* Below this breakpoint the panes no longer sit side by side: only the active one shows, and
|
|
@@ -171,7 +174,19 @@ declare const SplitView: (({ children, collapseBelow, activePane: controlledPane
|
|
|
171
174
|
Pane: ({ id, label, width, children, className, ref }: SplitViewPaneProps) => react.JSX.Element;
|
|
172
175
|
};
|
|
173
176
|
|
|
177
|
+
/**
|
|
178
|
+
* How the Shell spans the window: `fluid` (the whole width) or `boxed` (a column of at most
|
|
179
|
+
* 1440px, centred).
|
|
180
|
+
*/
|
|
181
|
+
type ShellContainer = 'fluid' | 'boxed';
|
|
174
182
|
type ShellProps = {
|
|
183
|
+
/**
|
|
184
|
+
* `fluid` (default): the topbar, the sidebar and the content take the whole window.
|
|
185
|
+
* `boxed`: they sit together in a centred column of at most 1440px, with the page background
|
|
186
|
+
* on both sides and a hairline on the column's edges once the window is wider. Below 1440px
|
|
187
|
+
* the two are the same. The sidebar's drawer, below `lg`, is not part of the column.
|
|
188
|
+
*/
|
|
189
|
+
container?: ShellContainer;
|
|
175
190
|
/**
|
|
176
191
|
* Top header bar: typically `<Topbar />`, or any header (a `<Navbar>`). Shell
|
|
177
192
|
* passes it no props: a Topbar or a `SidebarToggle` reads the sidebar state
|
|
@@ -183,7 +198,7 @@ type ShellProps = {
|
|
|
183
198
|
/** Main content area. */
|
|
184
199
|
children: ReactNode;
|
|
185
200
|
/**
|
|
186
|
-
* Optional
|
|
201
|
+
* Optional end-aligned secondary panel — mirrors the TUI Plus "Multi-
|
|
187
202
|
* column" application shell pattern (sidebar + main + secondary). Renders
|
|
188
203
|
* after `children` inside a flex row below the topbar; below `lg` it stacks under `children`.
|
|
189
204
|
*/
|
|
@@ -207,7 +222,7 @@ type ShellProps = {
|
|
|
207
222
|
* Where the built-in collapse control lives. `topbar` (default): the Topbar's
|
|
208
223
|
* hamburger. `sidebar`: a button at the bottom of the Sidebar, and the
|
|
209
224
|
* Topbar shows no hamburger. For both, or another place, put a
|
|
210
|
-
* `<SidebarToggle />` there (a Topbar's `
|
|
225
|
+
* `<SidebarToggle />` there (a Topbar's `startActions`, the Sidebar's
|
|
211
226
|
* `footer`, a custom header): it needs no props in a Shell.
|
|
212
227
|
*/
|
|
213
228
|
collapseControl?: 'topbar' | 'sidebar';
|
|
@@ -242,7 +257,7 @@ type ShellProps = {
|
|
|
242
257
|
*
|
|
243
258
|
* The Shell owns two sidebar states: collapsed from `lg` up (the rail) and open below `lg`,
|
|
244
259
|
* where the sidebar leaves the layout and the toggle opens it as a 288px drawer over a scrim
|
|
245
|
-
* (`sidebarOpen`). It closes on the scrim, the close button, Escape, a swipe toward the
|
|
260
|
+
* (`sidebarOpen`). It closes on the scrim, the close button, Escape, a swipe toward the start
|
|
246
261
|
* edge, a click on a `Sidebar.Item` and when the viewport grows past `lg`.
|
|
247
262
|
*
|
|
248
263
|
* The Shell's state is the only one inside it: the Topbar's
|
|
@@ -250,7 +265,7 @@ type ShellProps = {
|
|
|
250
265
|
* value left on them can't freeze a toggle. Their `onCollapsedChange` still
|
|
251
266
|
* fires when their own button is pressed.
|
|
252
267
|
*/
|
|
253
|
-
declare const Shell: ({ topbar, sidebar, children, secondary, secondaryWidthClassName, defaultSidebarCollapsed, sidebarCollapsed: controlledCollapsed, onCollapsedChange, collapseControl, defaultSidebarOpen, sidebarOpen: controlledOpen, onSidebarOpenChange, className, }: ShellProps) => react.JSX.Element;
|
|
268
|
+
declare const Shell: ({ topbar, sidebar, children, secondary, secondaryWidthClassName, defaultSidebarCollapsed, sidebarCollapsed: controlledCollapsed, onCollapsedChange, collapseControl, container, defaultSidebarOpen, sidebarOpen: controlledOpen, onSidebarOpenChange, className, }: ShellProps) => react.JSX.Element;
|
|
254
269
|
|
|
255
270
|
type TopbarProps = {
|
|
256
271
|
/** Current page title (≠ site name — that lives in `Sidebar.Brand`). */
|
|
@@ -280,16 +295,16 @@ type TopbarProps = {
|
|
|
280
295
|
* it always shows. Keep it compact: it shares the bar with the hamburger and the actions.
|
|
281
296
|
*/
|
|
282
297
|
brand?: ReactNode;
|
|
283
|
-
/** Extra slot rendered between the hamburger and the page title. */
|
|
284
|
-
|
|
298
|
+
/** Extra slot rendered between the hamburger and the page title (at the start of the bar). */
|
|
299
|
+
startActions?: ReactNode;
|
|
285
300
|
/** Center area — typically search, breadcrumb, or empty. */
|
|
286
301
|
center?: ReactNode;
|
|
287
|
-
/**
|
|
288
|
-
|
|
302
|
+
/** Actions at the end of the bar — theme switcher, notifications, avatar… */
|
|
303
|
+
endActions?: ReactNode;
|
|
289
304
|
/**
|
|
290
305
|
* `Menu.Item`s (or `Menu.Group`s) for the actions that do not fit a phone. Below `sm` the
|
|
291
|
-
* Topbar shows a "More" menu with them, before `
|
|
292
|
-
* Hide the matching actions of `
|
|
306
|
+
* Topbar shows a "More" menu with them, before `endActions`; from `sm` up the menu is gone.
|
|
307
|
+
* Hide the matching actions of `endActions` below `sm` (`max-sm:hidden`) and keep there only
|
|
293
308
|
* what must stay in reach, such as the profile menu.
|
|
294
309
|
*/
|
|
295
310
|
moreActions?: ReactNode;
|
|
@@ -299,7 +314,7 @@ type TopbarProps = {
|
|
|
299
314
|
/**
|
|
300
315
|
* Topbar — application header bar.
|
|
301
316
|
*
|
|
302
|
-
* Layout: [toggle] [brand] [
|
|
317
|
+
* Layout: [toggle] [brand] [startActions] [pageTitle] [center] [endActions]
|
|
303
318
|
*
|
|
304
319
|
* The site brand belongs in `<Sidebar.Brand />`; the `brand` prop repeats the logo here while
|
|
305
320
|
* the sidebar is off screen (below `lg` in a Shell). Otherwise the topbar carries only
|
|
@@ -310,7 +325,7 @@ type TopbarProps = {
|
|
|
310
325
|
* Height: 72px. Background: `var(--color-bg-panel)` with a 500ms
|
|
311
326
|
* background-color transition (eases the dark/light toggle).
|
|
312
327
|
*/
|
|
313
|
-
declare const Topbar: ({ pageTitle, as: TitleTag, sidebarCollapsed, onCollapsedChange, brand,
|
|
328
|
+
declare const Topbar: ({ pageTitle, as: TitleTag, sidebarCollapsed, onCollapsedChange, brand, startActions, center, endActions, moreActions, className, }: TopbarProps) => react.JSX.Element;
|
|
314
329
|
|
|
315
330
|
/** How the active row is drawn: a tinted pill (default) or a filled one. */
|
|
316
331
|
type SidebarActiveStyle = 'tint' | 'solid';
|
|
@@ -320,9 +335,24 @@ type SidebarActiveStyle = 'tint' | 'solid';
|
|
|
320
335
|
* room for it).
|
|
321
336
|
*/
|
|
322
337
|
type SidebarExpandOnHover = false | 'overlay' | 'push';
|
|
338
|
+
/**
|
|
339
|
+
* The shape of the sidebar: `default` (expanded, or collapsed to an icon rail) or `compact`, a
|
|
340
|
+
* fixed narrow rail with the label under each icon.
|
|
341
|
+
*/
|
|
342
|
+
type SidebarVariant = 'default' | 'compact';
|
|
323
343
|
/** Line drawn above the footer and the collapse row. */
|
|
324
344
|
type SidebarFooterDivider = 'full' | 'inset' | 'none';
|
|
325
345
|
type SidebarProps = {
|
|
346
|
+
/**
|
|
347
|
+
* `default` (default): expanded, or collapsed to an icon rail. `compact`: a fixed 88 px rail
|
|
348
|
+
* with the label under each icon, on at most two lines (the full name shows in a tooltip when
|
|
349
|
+
* it is cut). A sub-menu opens in a flyout, as in the collapsed rail. It has no collapsed
|
|
350
|
+
* state (`collapsed`, the Shell's toggles, `expandOnHover` and the bottom button do nothing
|
|
351
|
+
* there: with a Shell, set `collapseControl="sidebar"` to keep the Topbar free of a hamburger
|
|
352
|
+
* that would do nothing), and ignores `width`, `maxWidth` and `collapsedWidth`. Below `lg`, in
|
|
353
|
+
* the Shell's drawer, the sidebar is the default one.
|
|
354
|
+
*/
|
|
355
|
+
variant?: SidebarVariant;
|
|
326
356
|
/**
|
|
327
357
|
* Whether the sidebar is in collapsed (icons-only) state, when controlled. Not read inside
|
|
328
358
|
* a `Shell`, which owns the state: control it with the Shell's `sidebarCollapsed`.
|
|
@@ -390,7 +420,7 @@ type SidebarProps = {
|
|
|
390
420
|
className?: string;
|
|
391
421
|
};
|
|
392
422
|
/**
|
|
393
|
-
* Sidebar —
|
|
423
|
+
* Sidebar — navigation panel at the start of the line.
|
|
394
424
|
*
|
|
395
425
|
* Compound component: brand + items + groups + sub-menus + footer slot.
|
|
396
426
|
* Smooth width transition when `collapsed` toggles. The `collapsed` state
|
|
@@ -409,7 +439,7 @@ type SidebarProps = {
|
|
|
409
439
|
* shows the sidebar as a drawer: it then fills the panel, is always expanded, and `Sidebar.Brand`
|
|
410
440
|
* gets a close button.
|
|
411
441
|
*/
|
|
412
|
-
declare const SidebarRoot: ({ collapsed: collapsedProp, defaultCollapsed, width, maxWidth, collapsedWidth, children, expandOnHover, footer, footerDivider, activeStyle, onCollapsedChange, className, }: SidebarProps) => react.JSX.Element;
|
|
442
|
+
declare const SidebarRoot: ({ variant, collapsed: collapsedProp, defaultCollapsed, width, maxWidth, collapsedWidth, children, expandOnHover, footer, footerDivider, activeStyle, onCollapsedChange, className, }: SidebarProps) => react.JSX.Element;
|
|
413
443
|
type SidebarBrandProps = {
|
|
414
444
|
/** Logo node — typically a small icon, lucide component, or img. */
|
|
415
445
|
logo?: ReactNode;
|
|
@@ -461,7 +491,7 @@ type SidebarItemProps = {
|
|
|
461
491
|
* also closes the drawer, after this runs.
|
|
462
492
|
*/
|
|
463
493
|
onClick?: () => void;
|
|
464
|
-
/** Optional badge (count, "new"…) shown
|
|
494
|
+
/** Optional badge (count, "new"…) shown after the label. Hidden when collapsed. */
|
|
465
495
|
badge?: ReactNode;
|
|
466
496
|
/** Override the inherited collapsed state. */
|
|
467
497
|
collapsed?: boolean;
|
|
@@ -504,7 +534,7 @@ type SidebarSubMenuProps = {
|
|
|
504
534
|
* rail the nested rows aren't mounted: pass `active` there to mark the sub-menu.
|
|
505
535
|
*/
|
|
506
536
|
active?: boolean;
|
|
507
|
-
/** Optional badge shown
|
|
537
|
+
/** Optional badge shown after the label (hidden when collapsed). */
|
|
508
538
|
badge?: ReactNode;
|
|
509
539
|
/** Nested items: Sidebar.Item, or another Sidebar.SubMenu for a deeper level. */
|
|
510
540
|
children: ReactNode;
|
|
@@ -587,17 +617,6 @@ type SidebarToggleProps = {
|
|
|
587
617
|
*/
|
|
588
618
|
declare const SidebarToggle: ({ variant, collapsed: collapsedProp, onCollapsedChange, controls, className, ref, }: SidebarToggleProps) => react.JSX.Element | null;
|
|
589
619
|
|
|
590
|
-
/**
|
|
591
|
-
* The meaning a component carries, as a color: the one vocabulary behind every
|
|
592
|
-
* `intent` prop. A component may accept a documented subset (a `Button` takes
|
|
593
|
-
* `brand`, `success`, `warning` and `danger`), but never a synonym: `danger`, not
|
|
594
|
-
* `error` or `crit`; `warning`, not `warn`.
|
|
595
|
-
*
|
|
596
|
-
* `variant` is the other axis: it describes structure or emphasis (`solid`,
|
|
597
|
-
* `outline`, `ghost`), never meaning.
|
|
598
|
-
*/
|
|
599
|
-
type Intent = 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'danger';
|
|
600
|
-
|
|
601
620
|
type PageHeaderProps = {
|
|
602
621
|
/** Main page title */
|
|
603
622
|
title: string;
|
|
@@ -606,25 +625,27 @@ type PageHeaderProps = {
|
|
|
606
625
|
* (the default) passes `h1` so it keeps exactly one.
|
|
607
626
|
*/
|
|
608
627
|
as?: 'h1' | 'h2';
|
|
609
|
-
/** Optional description shown below title
|
|
628
|
+
/** Optional description shown below the title, with or without a `breadcrumb`. */
|
|
610
629
|
description?: string;
|
|
611
|
-
/** Breadcrumb shown
|
|
630
|
+
/** Breadcrumb shown above the title. */
|
|
612
631
|
breadcrumb?: ReactNode;
|
|
613
632
|
/**
|
|
614
633
|
* Optional meta row shown below the title — typically a `flex gap-x-6` of
|
|
615
634
|
* `<PageHeader.MetaItem icon=...>` children, mirroring the TUI "With meta
|
|
616
|
-
* and actions" pattern. Renders
|
|
617
|
-
* `description`.
|
|
635
|
+
* and actions" pattern. Renders below the title and the `description`.
|
|
618
636
|
*/
|
|
619
637
|
meta?: ReactNode;
|
|
620
638
|
/**
|
|
621
|
-
* Icon in a rounded tile
|
|
639
|
+
* Icon in a rounded tile before the title and description: 48px, 40px below `sm`. It is
|
|
622
640
|
* decorative (`aria-hidden`); the title says what the page is.
|
|
623
641
|
*/
|
|
624
642
|
icon?: ElementType;
|
|
625
643
|
/** Color of the icon tile, from `INTENT_STYLE`. Default `brand`. Needs `icon`. */
|
|
626
644
|
iconIntent?: Intent;
|
|
627
|
-
/**
|
|
645
|
+
/**
|
|
646
|
+
* Actions at the end of the line (buttons, icon buttons, etc.). Below `sm` they wrap under the
|
|
647
|
+
* meta, at the start of the line.
|
|
648
|
+
*/
|
|
628
649
|
actions?: ReactNode;
|
|
629
650
|
className?: string;
|
|
630
651
|
};
|
|
@@ -784,6 +805,11 @@ type EmptyStateProps = {
|
|
|
784
805
|
title?: string;
|
|
785
806
|
/** Optional description below title */
|
|
786
807
|
description?: string;
|
|
808
|
+
/**
|
|
809
|
+
* Under the description, before the `action`: a short list of steps, a hint. It is start-aligned
|
|
810
|
+
* and up to 28rem wide, whatever the centering of the rest.
|
|
811
|
+
*/
|
|
812
|
+
children?: ReactNode;
|
|
787
813
|
/** Optional call-to-action (button, link) */
|
|
788
814
|
action?: ReactNode;
|
|
789
815
|
/**
|
|
@@ -805,7 +831,7 @@ type EmptyStateProps = {
|
|
|
805
831
|
* if there's an action the user can take to populate the list.
|
|
806
832
|
* It is static: nothing announces it, since nothing changed under the user.
|
|
807
833
|
*/
|
|
808
|
-
declare const EmptyState: ({ title, description, action, intent, icon, compact, className, }: EmptyStateProps) => react.JSX.Element;
|
|
834
|
+
declare const EmptyState: ({ title, description, children, action, intent, icon, compact, className, }: EmptyStateProps) => react.JSX.Element;
|
|
809
835
|
|
|
810
836
|
type ErrorStateProps = {
|
|
811
837
|
/** What went wrong. Default: 'Something went wrong.' */
|
|
@@ -814,27 +840,34 @@ type ErrorStateProps = {
|
|
|
814
840
|
description?: string;
|
|
815
841
|
/** Alias of `title`, kept for existing callers. `title` wins when both are set. */
|
|
816
842
|
message?: string;
|
|
817
|
-
/** Optional retry callback. If set, a
|
|
843
|
+
/** Optional retry callback. If set, a retry button appears. */
|
|
818
844
|
onRetry?: () => void;
|
|
845
|
+
/** Label of the retry button. Default 'Try again'. */
|
|
846
|
+
retryLabel?: string;
|
|
847
|
+
/**
|
|
848
|
+
* A way out that is not a retry ("Back to tickets" on a record that does not exist), next to
|
|
849
|
+
* the retry button, which comes first. Alone when there is no `onRetry`.
|
|
850
|
+
*/
|
|
851
|
+
action?: ReactNode;
|
|
819
852
|
/** Tighter spacing, for a card or a table body. */
|
|
820
853
|
compact?: boolean;
|
|
821
854
|
className?: string;
|
|
822
855
|
};
|
|
823
856
|
/**
|
|
824
|
-
* ErrorState — error placeholder with optional retry action
|
|
857
|
+
* ErrorState — error placeholder with an optional retry button and an optional `action`.
|
|
825
858
|
*
|
|
826
859
|
* Use when an API call fails or rendering fails inside a section.
|
|
827
860
|
* Pair with `<EmptyState>` when the error is "no data found" rather
|
|
828
861
|
* than a real failure. It is announced to assistive technology (`role="alert"`).
|
|
829
862
|
*/
|
|
830
|
-
declare const ErrorState: ({ title, description, message, onRetry, compact, className, }: ErrorStateProps) => react.JSX.Element;
|
|
863
|
+
declare const ErrorState: ({ title, description, message, onRetry, retryLabel, action, compact, className, }: ErrorStateProps) => react.JSX.Element;
|
|
831
864
|
|
|
832
865
|
type SkProps = {
|
|
833
866
|
/** Tailwind height class — default `h-4`. */
|
|
834
867
|
h?: string;
|
|
835
868
|
/** Tailwind width class — default `w-full`. */
|
|
836
869
|
w?: string;
|
|
837
|
-
/** Tailwind border-radius class — default `rounded`. */
|
|
870
|
+
/** Tailwind border-radius class — default `rounded-sm`. */
|
|
838
871
|
round?: string;
|
|
839
872
|
/** Element to render — default `div`; `span` where only phrasing content is allowed (inside a button). */
|
|
840
873
|
as?: 'div' | 'span';
|
|
@@ -890,6 +923,10 @@ declare const STATUS_DOT: Record<HealthStatus, string>;
|
|
|
890
923
|
type StatusBadgeProps = {
|
|
891
924
|
status: HealthStatus;
|
|
892
925
|
size?: 'sm' | 'md' | 'lg';
|
|
926
|
+
/**
|
|
927
|
+
* Text of the pill, default `status`. It sits in a `<bdi>`: "12 OK" keeps its order in a
|
|
928
|
+
* right-to-left page.
|
|
929
|
+
*/
|
|
893
930
|
label?: string;
|
|
894
931
|
className?: string;
|
|
895
932
|
};
|
|
@@ -919,6 +956,250 @@ type HealthDotProps = {
|
|
|
919
956
|
*/
|
|
920
957
|
declare const HealthDot: ({ status, pulse, label, className }: HealthDotProps) => react.JSX.Element;
|
|
921
958
|
|
|
959
|
+
type DateTimeValue = Date | number | string;
|
|
960
|
+
/** Presets of `DateTime`'s `format`, each a set of `Intl.DateTimeFormat` options. */
|
|
961
|
+
type DateTimeFormat = 'date' | 'time' | 'datetime' | 'long' | 'full';
|
|
962
|
+
type CountdownParts = {
|
|
963
|
+
days: number;
|
|
964
|
+
hours: number;
|
|
965
|
+
minutes: number;
|
|
966
|
+
seconds: number;
|
|
967
|
+
};
|
|
968
|
+
type CountdownUnit = keyof CountdownParts;
|
|
969
|
+
|
|
970
|
+
type RefreshOption = {
|
|
971
|
+
label: string;
|
|
972
|
+
ms: number;
|
|
973
|
+
};
|
|
974
|
+
declare const REFRESH_OPTIONS: RefreshOption[];
|
|
975
|
+
/**
|
|
976
|
+
* Hook that manages auto-refresh state for a page key, persisted to localStorage.
|
|
977
|
+
* Pass a stable `pageKey` (e.g. "room", "rack", "alerts").
|
|
978
|
+
*/
|
|
979
|
+
declare const useAutoRefresh: (pageKey: string, onRefresh: () => void | Promise<void>) => {
|
|
980
|
+
autoRefreshMs: number;
|
|
981
|
+
onIntervalChange: (ms: number) => void;
|
|
982
|
+
};
|
|
983
|
+
type RefreshButtonProps = {
|
|
984
|
+
refreshing?: boolean;
|
|
985
|
+
autoRefreshMs: number;
|
|
986
|
+
onRefresh: () => void | Promise<void>;
|
|
987
|
+
onIntervalChange: (ms: number) => void;
|
|
988
|
+
options?: RefreshOption[];
|
|
989
|
+
className?: string;
|
|
990
|
+
};
|
|
991
|
+
declare const RefreshButton: ({ refreshing, autoRefreshMs, onRefresh, onIntervalChange, options, className, }: RefreshButtonProps) => react.JSX.Element;
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* One health check: a named probe and its last result.
|
|
995
|
+
*
|
|
996
|
+
* `latency` is in milliseconds. `checkedAt` is a `Date`, a timestamp in milliseconds or an
|
|
997
|
+
* ISO 8601 string. `output` is the raw text of the probe, shown in a code block when a row is
|
|
998
|
+
* expanded.
|
|
999
|
+
*/
|
|
1000
|
+
type HealthCheck = {
|
|
1001
|
+
id: string;
|
|
1002
|
+
name: string;
|
|
1003
|
+
status: HealthStatus;
|
|
1004
|
+
message?: string;
|
|
1005
|
+
/** What the check probes: a URL, a DSN, a host. */
|
|
1006
|
+
target?: string;
|
|
1007
|
+
latency?: number;
|
|
1008
|
+
checkedAt?: DateTimeValue;
|
|
1009
|
+
output?: string;
|
|
1010
|
+
};
|
|
1011
|
+
/**
|
|
1012
|
+
* A named set of checks. A group nests: `groups` holds the groups below it, one level per
|
|
1013
|
+
* dependency of a service for instance. Its status is never stored, it is the worst status
|
|
1014
|
+
* of everything under it (`groupWorst`).
|
|
1015
|
+
*/
|
|
1016
|
+
type HealthCheckGroup = {
|
|
1017
|
+
id: string;
|
|
1018
|
+
name: string;
|
|
1019
|
+
checks?: HealthCheck[];
|
|
1020
|
+
groups?: HealthCheckGroup[];
|
|
1021
|
+
};
|
|
1022
|
+
/**
|
|
1023
|
+
* Worst first: CRIT, then WARN, then UNKNOWN (a check nobody could run is worse than one that
|
|
1024
|
+
* passes), then INFO, then OK. Every health component sorts and rolls up by this one list.
|
|
1025
|
+
*/
|
|
1026
|
+
declare const SEVERITY_ORDER: readonly HealthStatus[];
|
|
1027
|
+
/** Comparator for `Array.prototype.sort`: negative when `a` is worse than `b`. */
|
|
1028
|
+
declare const compareSeverity: (a: HealthStatus, b: HealthStatus) => number;
|
|
1029
|
+
/** The worst of some statuses. With none to look at, nothing is known: `UNKNOWN`. */
|
|
1030
|
+
declare const worstStatus: (statuses: Iterable<HealthStatus>) => HealthStatus;
|
|
1031
|
+
/** The reading of each status, for badges, cell names and legends. */
|
|
1032
|
+
declare const STATUS_NAME: Record<HealthStatus, string>;
|
|
1033
|
+
/** Every check under `groups`, depth first, in the order they were given. */
|
|
1034
|
+
declare const flattenChecks: (groups: readonly HealthCheckGroup[]) => HealthCheck[];
|
|
1035
|
+
/** The worst status of the checks under a group, nested groups included. */
|
|
1036
|
+
declare const groupWorst: (group: HealthCheckGroup) => HealthStatus;
|
|
1037
|
+
|
|
1038
|
+
type HealthSummaryProps = {
|
|
1039
|
+
/** The checks to roll up: the worst status among them is the summary's. */
|
|
1040
|
+
checks: HealthCheck[];
|
|
1041
|
+
/**
|
|
1042
|
+
* Forces the status the summary shows, when the host weighs the checks differently (a
|
|
1043
|
+
* warning on a backup job is not an outage). The counts still come from `checks`.
|
|
1044
|
+
*/
|
|
1045
|
+
status?: HealthStatus;
|
|
1046
|
+
/**
|
|
1047
|
+
* The headline of each status. Defaults: "All systems operational" (OK), "Degraded
|
|
1048
|
+
* performance" (WARN), "Major outage" (CRIT), "Status unknown" (UNKNOWN) and "Operational,
|
|
1049
|
+
* with notices" (INFO). Give only the ones to change.
|
|
1050
|
+
*/
|
|
1051
|
+
labels?: Partial<Record<HealthStatus, string>>;
|
|
1052
|
+
/**
|
|
1053
|
+
* `banner` is full width and tinted by the status, with the counts as badges. `compact` is
|
|
1054
|
+
* one line, for a card or a topbar. Default `banner`.
|
|
1055
|
+
*/
|
|
1056
|
+
variant?: 'banner' | 'compact';
|
|
1057
|
+
/** When the checks last ran. Default: the most recent `checkedAt` among `checks`. */
|
|
1058
|
+
checkedAt?: DateTimeValue;
|
|
1059
|
+
/**
|
|
1060
|
+
* When the last data came in, for a source that has stopped answering. The banner takes the
|
|
1061
|
+
* neutral surface, its badges turn grey, a "Stale · 4 minutes ago" tag joins it and the headline
|
|
1062
|
+
* is read as stale. The status shown stays the last known one. Default: fresh.
|
|
1063
|
+
*/
|
|
1064
|
+
stale?: DateTimeValue;
|
|
1065
|
+
/** Draws a `RefreshButton` with these props. Without it there is no refresh action. */
|
|
1066
|
+
refresh?: RefreshButtonProps;
|
|
1067
|
+
/**
|
|
1068
|
+
* Accessible name of the group. Default "System health". It is a group, not a landmark, so
|
|
1069
|
+
* several summaries on a page need no distinct name.
|
|
1070
|
+
*/
|
|
1071
|
+
ariaLabel?: string;
|
|
1072
|
+
/** Freezes the "last check" text at this moment. For stories and tests. */
|
|
1073
|
+
now?: Date | number;
|
|
1074
|
+
className?: string;
|
|
1075
|
+
};
|
|
1076
|
+
/**
|
|
1077
|
+
* HealthSummary — the roll-up of a set of checks, for the top of a status page.
|
|
1078
|
+
*
|
|
1079
|
+
* The worst status among `checks` wins (severity order: critical, warning, unknown, info,
|
|
1080
|
+
* OK) and `status` overrides it. It shows the counts per status, when the checks last ran
|
|
1081
|
+
* and, with `refresh`, a refresh button. The headline is a live region: a change of status is
|
|
1082
|
+
* announced.
|
|
1083
|
+
*/
|
|
1084
|
+
declare const HealthSummary: ({ checks, status, labels, variant, checkedAt, stale, refresh, ariaLabel, now, className, }: HealthSummaryProps) => react.JSX.Element;
|
|
1085
|
+
|
|
1086
|
+
type HealthCheckListProps = {
|
|
1087
|
+
/** Checks outside any group, drawn first. */
|
|
1088
|
+
checks?: HealthCheck[];
|
|
1089
|
+
/**
|
|
1090
|
+
* Groups of checks: database, cache, queue, external APIs. A group nests, so a dependency
|
|
1091
|
+
* tree is groups inside groups, one level per dependency. Each header shows the worst status
|
|
1092
|
+
* under it and the counts, and collapses.
|
|
1093
|
+
*/
|
|
1094
|
+
groups?: HealthCheckGroup[];
|
|
1095
|
+
/**
|
|
1096
|
+
* `severity` puts the failing checks first, and the group with the worst check first,
|
|
1097
|
+
* inside every level (critical, warning, unknown, info, OK; equals keep their order).
|
|
1098
|
+
* `none` keeps the order given. Default `none`.
|
|
1099
|
+
*/
|
|
1100
|
+
sort?: 'none' | 'severity';
|
|
1101
|
+
/** `list` is one row per check, `grid` one small card per check, for a wall screen. Default `list`. */
|
|
1102
|
+
variant?: 'list' | 'grid';
|
|
1103
|
+
/** Ids of the collapsed groups. Controlled. */
|
|
1104
|
+
collapsedGroups?: string[];
|
|
1105
|
+
/** Ids of the groups collapsed at first, when uncontrolled. Default none: every group is open. */
|
|
1106
|
+
defaultCollapsedGroups?: string[];
|
|
1107
|
+
/** Called with the ids of the collapsed groups, once one is opened or closed. */
|
|
1108
|
+
onCollapsedGroupsChange?: (collapsedGroups: string[]) => void;
|
|
1109
|
+
/** Accessible name of the list. */
|
|
1110
|
+
ariaLabel?: string;
|
|
1111
|
+
/** Freezes the "last check" texts at this moment. For stories and tests. */
|
|
1112
|
+
now?: Date | number;
|
|
1113
|
+
className?: string;
|
|
1114
|
+
};
|
|
1115
|
+
/**
|
|
1116
|
+
* HealthCheckList — the checks of a system, as rows or as cards, in groups that collapse.
|
|
1117
|
+
*
|
|
1118
|
+
* Every row says its status in words (a badge), then the name, target, message, latency and
|
|
1119
|
+
* time of the last check. A check with an `output` has a toggle on its name that shows the raw
|
|
1120
|
+
* output in a code block. `sort="severity"` puts the failing checks, and the groups holding
|
|
1121
|
+
* them, first. Groups nest: use one level per dependency to read a dependency tree.
|
|
1122
|
+
*/
|
|
1123
|
+
declare const HealthCheckList: ({ checks, groups, sort, variant, collapsedGroups, defaultCollapsedGroups, onCollapsedGroupsChange, ariaLabel, now, className, }: HealthCheckListProps) => react.JSX.Element;
|
|
1124
|
+
|
|
1125
|
+
/** What one cell of the matrix says: the status of a service in an environment, a node, a region. */
|
|
1126
|
+
type HealthMatrixCell = {
|
|
1127
|
+
status: HealthStatus;
|
|
1128
|
+
/** Why the status is what it is, shown in the cell's popover. */
|
|
1129
|
+
message?: string;
|
|
1130
|
+
/** Milliseconds. */
|
|
1131
|
+
latency?: number;
|
|
1132
|
+
/** When the cell was last checked. */
|
|
1133
|
+
checkedAt?: Date | number | string;
|
|
1134
|
+
/** More for the popover: a link to the checks, an owner, a runbook. */
|
|
1135
|
+
detail?: ReactNode;
|
|
1136
|
+
};
|
|
1137
|
+
/** A column: an environment, a node, a region. */
|
|
1138
|
+
type HealthMatrixColumn = {
|
|
1139
|
+
id: string;
|
|
1140
|
+
label: string;
|
|
1141
|
+
};
|
|
1142
|
+
/**
|
|
1143
|
+
* A row: a service. `cells` is keyed by column id; a column with no entry is a service that does
|
|
1144
|
+
* not run there, drawn as an empty cell.
|
|
1145
|
+
*/
|
|
1146
|
+
type HealthMatrixRow = {
|
|
1147
|
+
id: string;
|
|
1148
|
+
label: string;
|
|
1149
|
+
cells: Record<string, HealthMatrixCell | undefined>;
|
|
1150
|
+
};
|
|
1151
|
+
type HealthMatrixProps = {
|
|
1152
|
+
columns: HealthMatrixColumn[];
|
|
1153
|
+
rows: HealthMatrixRow[];
|
|
1154
|
+
/**
|
|
1155
|
+
* `dots` is the dense variant: one mark per cell, which carries a shape as well as a colour
|
|
1156
|
+
* (OK a filled circle, warning a diamond, critical a square, unknown a hollow ring, info a
|
|
1157
|
+
* triangle). `pills` writes the status in each cell. Default `dots`.
|
|
1158
|
+
*/
|
|
1159
|
+
variant?: 'dots' | 'pills';
|
|
1160
|
+
/** Accessible name of the grid. */
|
|
1161
|
+
ariaLabel: string;
|
|
1162
|
+
/** A visible title, above the grid. */
|
|
1163
|
+
title?: ReactNode;
|
|
1164
|
+
/**
|
|
1165
|
+
* The text of the first header cell, above the row names. Default "Service"; a cluster says
|
|
1166
|
+
* "Rack".
|
|
1167
|
+
*/
|
|
1168
|
+
rowHeader?: ReactNode;
|
|
1169
|
+
/**
|
|
1170
|
+
* Lists the rows holding a warning or a critical cell in a "Needs attention" strip above the
|
|
1171
|
+
* grid, worst first, each with its counts in words. Picking one scrolls its row into view (in
|
|
1172
|
+
* the grid's own box when `maxHeight` is set) and moves the focus to its worst cell. The strip
|
|
1173
|
+
* scrolls sideways on a phone. Default `false`; no strip when no row has a problem.
|
|
1174
|
+
*/
|
|
1175
|
+
attentionStrip?: boolean;
|
|
1176
|
+
/**
|
|
1177
|
+
* When the last data came in, for a source that has stopped answering. The header says "Stale
|
|
1178
|
+
* · 4 minutes ago", the marks turn grey and each cell is named as stale. The statuses stay
|
|
1179
|
+
* those of the last data. Default: fresh.
|
|
1180
|
+
*/
|
|
1181
|
+
stale?: DateTimeValue;
|
|
1182
|
+
/** Shows the legend of the shapes. Default: with `dots`, not with `pills`. */
|
|
1183
|
+
legend?: boolean;
|
|
1184
|
+
/**
|
|
1185
|
+
* Height past which the grid scrolls vertically, its column headers staying in view. The grid
|
|
1186
|
+
* always scrolls sideways in its own box when the columns do not fit.
|
|
1187
|
+
*/
|
|
1188
|
+
maxHeight?: number | string;
|
|
1189
|
+
/** Freezes the "checked" texts of the popovers at this moment. For stories and tests. */
|
|
1190
|
+
now?: Date | number;
|
|
1191
|
+
className?: string;
|
|
1192
|
+
};
|
|
1193
|
+
/**
|
|
1194
|
+
* HealthMatrix — one status cell per service and per environment, node or region.
|
|
1195
|
+
*
|
|
1196
|
+
* A `role="grid"` with sticky row and column headers and one tab stop: the arrow keys move
|
|
1197
|
+
* between cells, Home and End to the ends of the row. A cell opens its detail in a popover with
|
|
1198
|
+
* Enter, Space or a click; Escape closes it and the focus returns to the cell. At a narrow width
|
|
1199
|
+
* the grid scrolls in its own box.
|
|
1200
|
+
*/
|
|
1201
|
+
declare const HealthMatrix: ({ columns, rows, variant, ariaLabel, title, rowHeader, attentionStrip, stale, legend, maxHeight, now, className, }: HealthMatrixProps) => react.JSX.Element;
|
|
1202
|
+
|
|
922
1203
|
type HealthBadgeProps = {
|
|
923
1204
|
status: HealthStatus;
|
|
924
1205
|
/** Custom label override (default: the status text) */
|
|
@@ -933,6 +1214,241 @@ type HealthBadgeProps = {
|
|
|
933
1214
|
*/
|
|
934
1215
|
declare const HealthBadge: ({ status, label, className }: HealthBadgeProps) => react.JSX.Element;
|
|
935
1216
|
|
|
1217
|
+
/**
|
|
1218
|
+
* What one check of a monitor found. `maintenance` is a planned window, `pending` a check
|
|
1219
|
+
* that has not run or has not answered yet.
|
|
1220
|
+
*/
|
|
1221
|
+
type BeatStatus = 'up' | 'down' | 'degraded' | 'maintenance' | 'pending';
|
|
1222
|
+
/**
|
|
1223
|
+
* One check of a monitor: when it ran and what it found. `latency` is in milliseconds.
|
|
1224
|
+
* `time` is a `Date`, a timestamp in milliseconds or an ISO 8601 string. `message` says why
|
|
1225
|
+
* (a timeout, an HTTP status), and shows in the beat's tooltip.
|
|
1226
|
+
*/
|
|
1227
|
+
type Beat = {
|
|
1228
|
+
time: DateTimeValue;
|
|
1229
|
+
status: BeatStatus;
|
|
1230
|
+
latency?: number;
|
|
1231
|
+
message?: string;
|
|
1232
|
+
};
|
|
1233
|
+
/**
|
|
1234
|
+
* One day of history. `uptime` is a share from 0 to 1 (0.9995 is 99.95 %), or `null` for a day
|
|
1235
|
+
* with no data (the monitor did not exist yet, or was paused). `date` is a `Date`, a timestamp or
|
|
1236
|
+
* an ISO string; a bare `YYYY-MM-DD` names that calendar day whatever the time zone of the
|
|
1237
|
+
* reader. `incidents` is how many incidents the day had.
|
|
1238
|
+
*/
|
|
1239
|
+
type UptimeDay = {
|
|
1240
|
+
date: DateTimeValue;
|
|
1241
|
+
uptime: number | null;
|
|
1242
|
+
incidents?: number;
|
|
1243
|
+
};
|
|
1244
|
+
/**
|
|
1245
|
+
* The limits that colour an uptime, as shares from 0 to 1. An uptime of `good` or more is
|
|
1246
|
+
* green, one from `warning` up to `good` is amber, one below `warning` is red. Defaults: 0.999
|
|
1247
|
+
* (99.9 %) and 0.99 (99 %).
|
|
1248
|
+
*/
|
|
1249
|
+
type UptimeThresholds = {
|
|
1250
|
+
good: number;
|
|
1251
|
+
warning: number;
|
|
1252
|
+
};
|
|
1253
|
+
/** What a threshold makes of an uptime. `none` is a day with no data. */
|
|
1254
|
+
type UptimeLevel = 'good' | 'warning' | 'bad' | 'none';
|
|
1255
|
+
/** The statuses of a beat, worst last, as the legend lists them. */
|
|
1256
|
+
declare const BEAT_STATUSES: readonly BeatStatus[];
|
|
1257
|
+
/** The reading of each status, for names, tooltips and legends. */
|
|
1258
|
+
declare const BEAT_NAME: Record<BeatStatus, string>;
|
|
1259
|
+
|
|
1260
|
+
type HeartbeatBarVariant = 'bars' | 'blocks' | 'dots';
|
|
1261
|
+
type HeartbeatBarSize = 'md' | 'sm';
|
|
1262
|
+
type HeartbeatBarProps = {
|
|
1263
|
+
/** The checks, oldest first: the newest is the last, at the end of the bar. */
|
|
1264
|
+
beats: Beat[];
|
|
1265
|
+
/**
|
|
1266
|
+
* `bars` (default) are thin rounded bars, `blocks` square cells and `dots` dots. A `down` beat
|
|
1267
|
+
* differs by shape as well as colour: a taller bar, a block crossed by a diagonal, a square dot.
|
|
1268
|
+
*/
|
|
1269
|
+
variant?: HeartbeatBarVariant;
|
|
1270
|
+
/** `md` is 32px high (default), `sm` is 24px, the height inside a `MonitorRow`. */
|
|
1271
|
+
size?: HeartbeatBarSize;
|
|
1272
|
+
/**
|
|
1273
|
+
* Accessible name of the bar. Default: what it shows, "Last 60 checks: 54 up, 3 down", written
|
|
1274
|
+
* again as the bar is resized.
|
|
1275
|
+
*/
|
|
1276
|
+
ariaLabel?: string;
|
|
1277
|
+
/** Draws the key of the statuses under the bar. Default `false`. */
|
|
1278
|
+
legend?: boolean;
|
|
1279
|
+
className?: string;
|
|
1280
|
+
};
|
|
1281
|
+
/**
|
|
1282
|
+
* HeartbeatBar — one mark per check of a monitor, the newest at the end.
|
|
1283
|
+
*
|
|
1284
|
+
* It holds as many beats as its width allows and drops the oldest, so a narrow screen still shows
|
|
1285
|
+
* the latest history; give it the width of its container and it adapts. The bar is one tab stop
|
|
1286
|
+
* (the newest beat): the arrow keys, Home and End move between beats, and hovering or focusing a
|
|
1287
|
+
* beat shows its time, status, latency and message. Each beat is named in words (status, time,
|
|
1288
|
+
* latency, message), so no status rests on its colour alone.
|
|
1289
|
+
*/
|
|
1290
|
+
declare const HeartbeatBar: ({ beats, variant, size, ariaLabel, legend, className, }: HeartbeatBarProps) => react.JSX.Element;
|
|
1291
|
+
|
|
1292
|
+
type UptimeBarsPeriod = 30 | 60 | 90;
|
|
1293
|
+
type UptimeBarsProps = {
|
|
1294
|
+
/** One entry per day, oldest first: the last is today. */
|
|
1295
|
+
days: UptimeDay[];
|
|
1296
|
+
/** How many days to show, the latest ones: 30, 60 or 90 (default). */
|
|
1297
|
+
period?: UptimeBarsPeriod;
|
|
1298
|
+
/** Overrides the limits that colour a day. Default: 99.9 % and up green, 99 % and up amber, below red. */
|
|
1299
|
+
thresholds?: Partial<UptimeThresholds>;
|
|
1300
|
+
/** Shown at the start of the header, above the bars: the name of the service. */
|
|
1301
|
+
title?: ReactNode;
|
|
1302
|
+
/**
|
|
1303
|
+
* The uptime written in the header, 0 to 1. Default: the mean of the days shown that have
|
|
1304
|
+
* data. Set it when the host has the exact figure for the period.
|
|
1305
|
+
*/
|
|
1306
|
+
uptime?: number | null;
|
|
1307
|
+
/** Draws the key of the thresholds under the bars. Default `false`. */
|
|
1308
|
+
legend?: boolean;
|
|
1309
|
+
/**
|
|
1310
|
+
* The compact form for a card: lower bars, with no header, captions or legend. The days stay
|
|
1311
|
+
* named and reachable.
|
|
1312
|
+
*/
|
|
1313
|
+
compact?: boolean;
|
|
1314
|
+
/** Accessible name of the bars. Default: "Daily uptime over N days". */
|
|
1315
|
+
ariaLabel?: string;
|
|
1316
|
+
className?: string;
|
|
1317
|
+
};
|
|
1318
|
+
/**
|
|
1319
|
+
* UptimeBars — one bar per day over 30, 60 or 90 days, the block of a public status page.
|
|
1320
|
+
*
|
|
1321
|
+
* Each day is coloured by its uptime against the thresholds (green, amber, red), and grey without
|
|
1322
|
+
* data. The captions read "90 days ago" and "Today", and the header gives the uptime of the whole
|
|
1323
|
+
* period. When the width cannot hold every day, the oldest days are dropped, and the caption and
|
|
1324
|
+
* the uptime follow: they always describe what is drawn. The bars are one tab stop (today): the
|
|
1325
|
+
* arrow keys, Home and End move between days, and hovering or focusing a day shows its date, uptime
|
|
1326
|
+
* and incidents. Every day is named in words, and `legend` writes the thresholds.
|
|
1327
|
+
*/
|
|
1328
|
+
declare const UptimeBars: ({ days, period, thresholds, title, uptime, legend, compact, ariaLabel, className, }: UptimeBarsProps) => react.JSX.Element;
|
|
1329
|
+
|
|
1330
|
+
/** The uptime of one period: "24 hours", "30 days". */
|
|
1331
|
+
type UptimePeriod = {
|
|
1332
|
+
/** What the period is called: "24 hours", "7 days", "1 year". */
|
|
1333
|
+
label: string;
|
|
1334
|
+
/** 0 to 1, or `null` when there is no data for the period. */
|
|
1335
|
+
uptime: number | null;
|
|
1336
|
+
/**
|
|
1337
|
+
* How long the period is, in milliseconds. With it the `card` says the downtime the uptime
|
|
1338
|
+
* stands for ("39 min down").
|
|
1339
|
+
*/
|
|
1340
|
+
duration?: number;
|
|
1341
|
+
};
|
|
1342
|
+
/** The certificate of the monitored host. */
|
|
1343
|
+
type UptimeCertificate = {
|
|
1344
|
+
/** Days until it expires; a negative number is an expired certificate. */
|
|
1345
|
+
daysLeft: number;
|
|
1346
|
+
/**
|
|
1347
|
+
* Days left under which the figure is a warning. Default 14. It is a warning for fewer days
|
|
1348
|
+
* than this, never at it.
|
|
1349
|
+
*/
|
|
1350
|
+
warnBelow?: number;
|
|
1351
|
+
};
|
|
1352
|
+
type UptimeStatProps = {
|
|
1353
|
+
/**
|
|
1354
|
+
* `row` (default) puts the figures side by side, for a monitor's header: the uptime of each
|
|
1355
|
+
* period, the average response time and the certificate. `card` is one figure for a dashboard
|
|
1356
|
+
* tile: the first of `periods`, and the downtime it stands for.
|
|
1357
|
+
*/
|
|
1358
|
+
variant?: 'row' | 'card';
|
|
1359
|
+
/** The periods, in the order shown. The `card` shows the first one only. */
|
|
1360
|
+
periods: UptimePeriod[];
|
|
1361
|
+
/** Overrides the limits that colour an uptime. Default: 99.9 % and up green, 99 % and up amber, below red. */
|
|
1362
|
+
thresholds?: Partial<UptimeThresholds>;
|
|
1363
|
+
/** Average response time over the period, in milliseconds. `row` only. */
|
|
1364
|
+
responseTime?: number;
|
|
1365
|
+
/** The certificate and its expiry. `row` only. */
|
|
1366
|
+
certificate?: UptimeCertificate;
|
|
1367
|
+
/** What the `card` is about: "API uptime, 30 days". Default: "Uptime, " and the period. */
|
|
1368
|
+
label?: ReactNode;
|
|
1369
|
+
/** The days of the `card`, drawn as compact bars under the figure. */
|
|
1370
|
+
days?: UptimeDay[];
|
|
1371
|
+
/** Accessible name of the `row`. Default "Uptime". */
|
|
1372
|
+
ariaLabel?: string;
|
|
1373
|
+
className?: string;
|
|
1374
|
+
};
|
|
1375
|
+
/**
|
|
1376
|
+
* UptimeStat — the uptime figures of a monitor.
|
|
1377
|
+
*
|
|
1378
|
+
* `row` lines up the uptime of several periods (24 h, 7 d, 30 d, 1 y: the host names them), each
|
|
1379
|
+
* coloured by the thresholds, then the average response time and the certificate expiry, which
|
|
1380
|
+
* turns to a warning under `certificate.warnBelow` days. `card` is one period's figure and the
|
|
1381
|
+
* downtime it stands for, with the days as compact bars when given.
|
|
1382
|
+
*/
|
|
1383
|
+
declare const UptimeStat: ({ variant, periods, thresholds, responseTime, certificate, label, days, ariaLabel, className, }: UptimeStatProps) => react.JSX.Element;
|
|
1384
|
+
|
|
1385
|
+
/** What a monitor is doing: the status of its last check, or paused. */
|
|
1386
|
+
type MonitorState = BeatStatus | 'paused';
|
|
1387
|
+
type MonitorRowProps = {
|
|
1388
|
+
/** The monitor's name. */
|
|
1389
|
+
name: string;
|
|
1390
|
+
/** What it checks: `HTTP`, `TCP`, `DNS`, `ping`, `keyword`… a free string, shown as a tag. */
|
|
1391
|
+
type?: string;
|
|
1392
|
+
/** Its recent checks, oldest first. Drawn as a `HeartbeatBar` of 24px. */
|
|
1393
|
+
beats: Beat[];
|
|
1394
|
+
/**
|
|
1395
|
+
* The monitor's state. Default: the status of the last beat, `pending` without beats. `paused`
|
|
1396
|
+
* is set by `paused`, which wins.
|
|
1397
|
+
*/
|
|
1398
|
+
status?: BeatStatus;
|
|
1399
|
+
/**
|
|
1400
|
+
* The monitor is paused: it is not checked. The status turns grey, the uptime reads "Paused" and
|
|
1401
|
+
* the row is dimmed. The beats it has stay shown.
|
|
1402
|
+
*/
|
|
1403
|
+
paused?: boolean;
|
|
1404
|
+
/** Uptime over the last 24 hours, 0 to 1. `null` or unset: no data. */
|
|
1405
|
+
uptime?: number | null;
|
|
1406
|
+
/** The current response time, in milliseconds. Default: the latency of the last beat. */
|
|
1407
|
+
latency?: number;
|
|
1408
|
+
/** Overrides the limits that colour the uptime. Default: 99.9 % and up green, 99 % and up amber, below red. */
|
|
1409
|
+
thresholds?: Partial<UptimeThresholds>;
|
|
1410
|
+
/**
|
|
1411
|
+
* When the last data came in, for a source that has stopped answering. The state chip, the
|
|
1412
|
+
* beats and the uptime turn grey, a "Stale · 4 minutes ago" tag sits under the name and the
|
|
1413
|
+
* state is read as stale. The state shown stays the last known one. Default: fresh.
|
|
1414
|
+
*/
|
|
1415
|
+
stale?: DateTimeValue;
|
|
1416
|
+
/** Freezes the "stale" tag at this moment. For stories and tests. */
|
|
1417
|
+
now?: Date | number;
|
|
1418
|
+
/** Makes the name a link, to the monitor's page. */
|
|
1419
|
+
href?: string;
|
|
1420
|
+
/**
|
|
1421
|
+
* `row` (default) is one line in a list, the host drawing the list and its separators; it
|
|
1422
|
+
* stacks on a narrow screen. `card` is a tile for a grid of monitors.
|
|
1423
|
+
*/
|
|
1424
|
+
variant?: 'row' | 'card';
|
|
1425
|
+
className?: string;
|
|
1426
|
+
};
|
|
1427
|
+
/**
|
|
1428
|
+
* MonitorRow — one monitor: its state, name and type, its recent checks, its uptime over 24 hours
|
|
1429
|
+
* and its current response time.
|
|
1430
|
+
*
|
|
1431
|
+
* `row` is a line of a list (the host draws the list), `card` a tile of a grid. The state is a
|
|
1432
|
+
* chip named in words ("Down"); the beats are a 24px `HeartbeatBar` and keep its keyboard model
|
|
1433
|
+
* and tooltips. A paused monitor says "Paused" where its uptime was.
|
|
1434
|
+
*/
|
|
1435
|
+
declare const MonitorRow: ({ name, type, beats, status, paused, uptime, latency, thresholds, stale, now, href, variant, className, }: MonitorRowProps) => react.JSX.Element;
|
|
1436
|
+
|
|
1437
|
+
/** 99.9 % and up is green, 99 % to 99.9 % amber, below 99 % red. */
|
|
1438
|
+
declare const DEFAULT_THRESHOLDS: UptimeThresholds;
|
|
1439
|
+
/**
|
|
1440
|
+
* The thresholds a component uses: the defaults, with the limits the host gave. A `warning`
|
|
1441
|
+
* limit above `good` would leave no amber range: it is lowered to `good`.
|
|
1442
|
+
*/
|
|
1443
|
+
declare const resolveThresholds: (given?: Partial<UptimeThresholds>) => UptimeThresholds;
|
|
1444
|
+
/** The level of an uptime. `null` (no data) and `NaN` are `none`. */
|
|
1445
|
+
declare const uptimeLevel: (uptime: number | null | undefined, thresholds?: Partial<UptimeThresholds>) => UptimeLevel;
|
|
1446
|
+
/**
|
|
1447
|
+
* "99.95%", "100%", "97.4%": at most two decimals, none when they are zero. The value is cut,
|
|
1448
|
+
* never rounded up, so 99.999 % never reads "100%": only a perfect uptime does.
|
|
1449
|
+
*/
|
|
1450
|
+
declare const formatUptime: (uptime: number) => string;
|
|
1451
|
+
|
|
936
1452
|
type StackedListProps = Omit<ComponentPropsWithRef<'ul'>, 'children' | 'title'> & {
|
|
937
1453
|
children: ReactNode;
|
|
938
1454
|
/**
|
|
@@ -945,12 +1461,12 @@ type StackedListProps = Omit<ComponentPropsWithRef<'ul'>, 'children' | 'title'>
|
|
|
945
1461
|
title?: ReactNode;
|
|
946
1462
|
/** Card header text under the title. Only with `card`. */
|
|
947
1463
|
description?: ReactNode;
|
|
948
|
-
/** Card header action at the
|
|
1464
|
+
/** Card header action at the end of the title row (a link, a button). Only with `card`. */
|
|
949
1465
|
action?: ReactNode;
|
|
950
1466
|
};
|
|
951
1467
|
/**
|
|
952
|
-
* Divided list of rows: avatar, title and subtitle
|
|
953
|
-
* (hidden on phones), a trailing slot and a chevron
|
|
1468
|
+
* Divided list of rows: avatar, title and subtitle at the start; a meta column
|
|
1469
|
+
* (hidden on phones), a trailing slot and a chevron at the end. An item with
|
|
954
1470
|
* `href` is a link across the whole row.
|
|
955
1471
|
*
|
|
956
1472
|
* Items also take a `badge` and a line of `details` for content rows (issues,
|
|
@@ -976,7 +1492,7 @@ type StackedListItemProps = Omit<ComponentPropsWithRef<'li'>, 'title'> & {
|
|
|
976
1492
|
title: ReactNode;
|
|
977
1493
|
/** Secondary text below the title (truncated by default). */
|
|
978
1494
|
subtitle?: ReactNode;
|
|
979
|
-
/**
|
|
1495
|
+
/** End-aligned meta column, hidden on mobile (mirrors TUI `hidden sm:flex`). */
|
|
980
1496
|
meta?: ReactNode;
|
|
981
1497
|
/** Trailing slot rendered after `meta` (icon, actions menu, badge…). */
|
|
982
1498
|
trailing?: ReactNode;
|
|
@@ -996,11 +1512,11 @@ type StackedListItemProps = Omit<ComponentPropsWithRef<'li'>, 'title'> & {
|
|
|
996
1512
|
badge?: ReactNode;
|
|
997
1513
|
/**
|
|
998
1514
|
* Inline items under the title (author, date, owner…) separated by a dot. Each item stays
|
|
999
|
-
* on one line; the last one truncates when the row runs out of room. Not the
|
|
1000
|
-
*
|
|
1515
|
+
* on one line; the last one truncates when the row runs out of room. Not the `meta`
|
|
1516
|
+
* column.
|
|
1001
1517
|
*/
|
|
1002
1518
|
details?: ReactNode[];
|
|
1003
|
-
/** Timestamp at the
|
|
1519
|
+
/** Timestamp at the end of the title row, for a narrow column. */
|
|
1004
1520
|
timestamp?: ReactNode;
|
|
1005
1521
|
/** Body text under the title, clamped to two lines. Replaces `subtitle`. */
|
|
1006
1522
|
description?: ReactNode;
|
|
@@ -1052,7 +1568,7 @@ type ActivityFeedItemProps = ComponentPropsWithRef<'li'> & {
|
|
|
1052
1568
|
}>;
|
|
1053
1569
|
/** Color of the circle indicator. Default `neutral`. */
|
|
1054
1570
|
intent?: ActivityFeedIntent;
|
|
1055
|
-
/**
|
|
1571
|
+
/** End-aligned timestamp (text or `<time>`). */
|
|
1056
1572
|
timestamp?: ReactNode;
|
|
1057
1573
|
/** Main content (paragraph). */
|
|
1058
1574
|
children: ReactNode;
|
|
@@ -1098,7 +1614,7 @@ type GridListFooterProps = ComponentPropsWithRef<'div'>;
|
|
|
1098
1614
|
*/
|
|
1099
1615
|
declare function GridListFooter({ className, children, ref, ...rest }: GridListFooterProps): react.JSX.Element;
|
|
1100
1616
|
type GridListFooterActionProps = ComponentPropsWithRef<'a'> & {
|
|
1101
|
-
/** Index in the footer row — only used to apply `-
|
|
1617
|
+
/** Index in the footer row — only used to apply `-ms-px` on cells after the first. */
|
|
1102
1618
|
index?: number;
|
|
1103
1619
|
};
|
|
1104
1620
|
/** One link of the footer row. The first and last cells round the card's bottom corners. */
|
|
@@ -1212,6 +1728,34 @@ type NavbarProps = ComponentPropsWithRef<'nav'> & {
|
|
|
1212
1728
|
children: ReactNode;
|
|
1213
1729
|
};
|
|
1214
1730
|
declare function NavbarRoot({ theme, maxWidth, heightClassName, className, children, ref, ...rest }: NavbarProps): react.JSX.Element;
|
|
1731
|
+
type NavbarMenuProps = {
|
|
1732
|
+
/** Text of the trigger. It also names the group in the "More" menu when the bar is full. */
|
|
1733
|
+
label: string;
|
|
1734
|
+
/**
|
|
1735
|
+
* Marks the group as holding the current page, the way `Navbar.Item`'s `active` marks a page.
|
|
1736
|
+
* Mark the current link itself with `aria-current="page"`.
|
|
1737
|
+
*/
|
|
1738
|
+
active?: boolean;
|
|
1739
|
+
/** Defaults to the theme of the parent `<Navbar>`. */
|
|
1740
|
+
theme?: NavbarTheme;
|
|
1741
|
+
/** Open state, when controlled. */
|
|
1742
|
+
open?: boolean;
|
|
1743
|
+
/** Initial open state, when uncontrolled. Default `false`. */
|
|
1744
|
+
defaultOpen?: boolean;
|
|
1745
|
+
/** Called with the open state to move to. */
|
|
1746
|
+
onOpenChange?: (open: boolean) => void;
|
|
1747
|
+
/** Edge of the trigger the panel lines up with. Default `start`. */
|
|
1748
|
+
align?: 'start' | 'end';
|
|
1749
|
+
/** Tailwind width class of the panel. Default `w-56` (224px). */
|
|
1750
|
+
width?: string;
|
|
1751
|
+
className?: string;
|
|
1752
|
+
/** The links: `Menu.Item` with an `href`, `Menu.Group`, `Menu.Separator`. */
|
|
1753
|
+
children: ReactNode;
|
|
1754
|
+
};
|
|
1755
|
+
type NavbarItemsProps = HTMLAttributes<HTMLDivElement> & {
|
|
1756
|
+
/** Label of the menu that takes the items that do not fit. Default `More`. */
|
|
1757
|
+
moreLabel?: string;
|
|
1758
|
+
};
|
|
1215
1759
|
type NavbarItemProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
1216
1760
|
active?: boolean;
|
|
1217
1761
|
/** Defaults to the theme of the parent `<Navbar>`. */
|
|
@@ -1223,8 +1767,9 @@ type NavbarMobileMenuButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
1223
1767
|
};
|
|
1224
1768
|
declare const Navbar: typeof NavbarRoot & {
|
|
1225
1769
|
Brand: ({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
1226
|
-
Items: ({ className, children, ...rest }:
|
|
1770
|
+
Items: ({ className, children, moreLabel, ...rest }: NavbarItemsProps) => react.JSX.Element;
|
|
1227
1771
|
Item: ({ active, theme, className, children, ...rest }: NavbarItemProps) => react.JSX.Element;
|
|
1772
|
+
Menu: ({ label, active, theme, open, defaultOpen, onOpenChange, align, width, className, children, }: NavbarMenuProps) => react.JSX.Element;
|
|
1228
1773
|
Actions: ({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
1229
1774
|
MobileMenuButton: ({ theme, className, children, ...rest }: NavbarMobileMenuButtonProps) => react.JSX.Element;
|
|
1230
1775
|
};
|
|
@@ -1327,7 +1872,9 @@ type RecordPagerProps = {
|
|
|
1327
1872
|
/**
|
|
1328
1873
|
* Keyboard shortcuts, off unless given: a default key would be taken from apps that never asked
|
|
1329
1874
|
* for one. They listen on the document and do nothing while a field is being typed in. List
|
|
1330
|
-
* them for the user in a `HelpOverlay`; the pager doesn't register itself there.
|
|
1875
|
+
* them for the user in a `HelpOverlay`; the pager doesn't register itself there. The keys are
|
|
1876
|
+
* literal and do not follow the reading direction: where the page reads right to left, give
|
|
1877
|
+
* Previous the arrow that points to the right if you want one.
|
|
1331
1878
|
*/
|
|
1332
1879
|
hotkeys?: RecordPagerHotkeys;
|
|
1333
1880
|
/** Names the landmark. Default `{Noun} navigation`; two pagers on one page need distinct names. */
|
|
@@ -1443,14 +1990,21 @@ type StickyScrollNavProps = {
|
|
|
1443
1990
|
* above. A jump lands the section below the nav, so below that header too.
|
|
1444
1991
|
*/
|
|
1445
1992
|
topOffset?: number;
|
|
1993
|
+
/**
|
|
1994
|
+
* Name of the jump menu shown below `sm`, in place of the row of buttons. Default
|
|
1995
|
+
* 'Jump to section'; a translated app passes its own wording.
|
|
1996
|
+
*/
|
|
1997
|
+
jumpLabel?: string;
|
|
1446
1998
|
className?: string;
|
|
1447
1999
|
};
|
|
1448
2000
|
/**
|
|
1449
2001
|
* StickyScrollNav — sticky horizontal nav row that scrolls to in-page
|
|
1450
2002
|
* sections by id, each landing just below the nav. Useful for long template
|
|
1451
|
-
* gallery pages and
|
|
2003
|
+
* gallery pages, docs and settings pages. Below `sm` the row folds into a jump
|
|
2004
|
+
* menu (a native select) that shows the section being read and moves to the
|
|
2005
|
+
* one picked.
|
|
1452
2006
|
*/
|
|
1453
|
-
declare const StickyScrollNav: ({ sections, onNavigate, topOffset, className, }: StickyScrollNavProps) => react.JSX.Element;
|
|
2007
|
+
declare const StickyScrollNav: ({ sections, onNavigate, topOffset, jumpLabel, className, }: StickyScrollNavProps) => react.JSX.Element;
|
|
1454
2008
|
|
|
1455
2009
|
/**
|
|
1456
2010
|
* Emphasis: how loud the button is. Its color is the `intent`. `link` is the quietest: an action
|
|
@@ -1486,7 +2040,8 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
1486
2040
|
size?: ButtonSize;
|
|
1487
2041
|
shape?: ButtonShape;
|
|
1488
2042
|
icon?: ElementType;
|
|
1489
|
-
|
|
2043
|
+
/** `start` leads the label, `end` follows it. Both follow the reading direction. Default `start`. */
|
|
2044
|
+
iconPosition?: 'start' | 'end';
|
|
1490
2045
|
loading?: boolean;
|
|
1491
2046
|
children?: ReactNode;
|
|
1492
2047
|
/** Ref to the `<button>`. */
|
|
@@ -1513,7 +2068,7 @@ type CardProps = {
|
|
|
1513
2068
|
edgeToEdgeMobile?: boolean;
|
|
1514
2069
|
/**
|
|
1515
2070
|
* `vertical` (default) stacks the parts. `horizontal` puts a `Card.Image` in a fixed-width
|
|
1516
|
-
* column
|
|
2071
|
+
* column at the start and the rest after it from the `sm` breakpoint, and stacks them
|
|
1517
2072
|
* below it.
|
|
1518
2073
|
*/
|
|
1519
2074
|
orientation?: CardOrientation;
|
|
@@ -1561,7 +2116,8 @@ type BadgeProps = {
|
|
|
1561
2116
|
appearance?: BadgeAppearance;
|
|
1562
2117
|
/** Optional Lucide icon. */
|
|
1563
2118
|
icon?: ElementType;
|
|
1564
|
-
|
|
2119
|
+
/** `start` leads the label, `end` follows it. Both follow the reading direction. Default `start`. */
|
|
2120
|
+
iconPosition?: 'start' | 'end';
|
|
1565
2121
|
className?: string;
|
|
1566
2122
|
};
|
|
1567
2123
|
declare const Badge: ({ children, intent, size, shape, appearance, icon: Icon, iconPosition, className, }: BadgeProps) => react.JSX.Element;
|
|
@@ -1628,7 +2184,7 @@ type AvatarProps = {
|
|
|
1628
2184
|
*/
|
|
1629
2185
|
intent?: Intent;
|
|
1630
2186
|
/**
|
|
1631
|
-
* Presence dot at the bottom-right. The status is also text: it joins the accessible name
|
|
2187
|
+
* Presence dot at the bottom-right (bottom-left in right to left). The status is also text: it joins the accessible name
|
|
1632
2188
|
* ("Ana Costa, online").
|
|
1633
2189
|
*/
|
|
1634
2190
|
status?: AvatarStatus;
|
|
@@ -1675,7 +2231,8 @@ type AvatarGroupProps = {
|
|
|
1675
2231
|
*/
|
|
1676
2232
|
declare const AvatarGroup: ({ children, avatars, max, size, spacing, "aria-label": ariaLabel, onOverflowClick, ref, renderOverflow, className, }: AvatarGroupProps) => react.JSX.Element;
|
|
1677
2233
|
|
|
1678
|
-
|
|
2234
|
+
/** `start` and `end` are the sides of the line: `end` is the right of the trigger, its left under `dir="rtl"`. */
|
|
2235
|
+
type TooltipPosition = 'top' | 'bottom' | 'start' | 'end';
|
|
1679
2236
|
/** Surface of the tooltip. */
|
|
1680
2237
|
type TooltipVariant = 'dark' | 'white';
|
|
1681
2238
|
/** Meaning of the tooltip: colors it over its surface. */
|
|
@@ -1743,7 +2300,8 @@ type DropdownProps = {
|
|
|
1743
2300
|
defaultValue?: string;
|
|
1744
2301
|
onChange?: (value: string) => void;
|
|
1745
2302
|
placeholder?: string;
|
|
1746
|
-
|
|
2303
|
+
/** Edge of the trigger the menu lines up with: where the text starts or ends. Default `start`. */
|
|
2304
|
+
align?: 'start' | 'end';
|
|
1747
2305
|
disabled?: boolean;
|
|
1748
2306
|
className?: string;
|
|
1749
2307
|
/** Open state of the menu, when controlled. */
|
|
@@ -1797,8 +2355,8 @@ type ModalAlertProps = {
|
|
|
1797
2355
|
/**
|
|
1798
2356
|
* Visual layout. `centered` (default): icon + title + buttons stacked
|
|
1799
2357
|
* vertically and centered (TUI "Centered with single action").
|
|
1800
|
-
* `horizontal`: icon
|
|
1801
|
-
* a separate gray footer
|
|
2358
|
+
* `horizontal`: icon before the title/message, with buttons in
|
|
2359
|
+
* a separate gray footer aligned to the end (TUI "Simple with gray footer").
|
|
1802
2360
|
*/
|
|
1803
2361
|
layout?: ModalAlertLayout;
|
|
1804
2362
|
/**
|
|
@@ -1821,20 +2379,22 @@ declare const Modal: ((props: ModalProps) => react.JSX.Element) & {
|
|
|
1821
2379
|
Alert: ({ open, onClose, intent, title, message, confirmLabel, cancelLabel, onConfirm, onCancel, loading, layout, fullWidthAction, }: ModalAlertProps) => react.JSX.Element;
|
|
1822
2380
|
};
|
|
1823
2381
|
|
|
1824
|
-
|
|
2382
|
+
/** `start` and `end` are the edges of the line: the left and the right, swapped under `dir="rtl"`. */
|
|
2383
|
+
type DrawerSide = 'start' | 'end' | 'bottom';
|
|
1825
2384
|
type DrawerSize = 'sm' | 'md' | 'lg';
|
|
1826
2385
|
type DrawerProps = {
|
|
1827
2386
|
open: boolean;
|
|
1828
2387
|
onClose: () => void;
|
|
1829
2388
|
/**
|
|
1830
|
-
* The edge the panel slides in from. `
|
|
2389
|
+
* The edge the panel slides in from. `start` and `end` give a full-height panel, on the edge
|
|
2390
|
+
* the text starts at and ends at: left and right, swapped under `dir="rtl"`. `bottom` gives a
|
|
1831
2391
|
* sheet: full width, as tall as its content up to 85% of the viewport (`Drawer.Body` scrolls
|
|
1832
2392
|
* past that), rounded on top, with a grab `handle`, and the scrim stays visible above it. All
|
|
1833
2393
|
* three are the same dialog, with the same focus trap, Escape and `Drawer.Header`, `Body` and
|
|
1834
|
-
* `Footer`. Default `
|
|
2394
|
+
* `Footer`. Default `end`.
|
|
1835
2395
|
*/
|
|
1836
2396
|
side?: DrawerSide;
|
|
1837
|
-
/** The width of a `
|
|
2397
|
+
/** The width of a `start` or `end` drawer. Ignored on `bottom`, where the content sets the height. Default `md`. */
|
|
1838
2398
|
size?: DrawerSize;
|
|
1839
2399
|
/**
|
|
1840
2400
|
* Show a grab handle at the top of a bottom sheet: a visual cue that the sheet can be dragged
|
|
@@ -1858,12 +2418,12 @@ type DrawerProps = {
|
|
|
1858
2418
|
*/
|
|
1859
2419
|
closeOutside?: boolean;
|
|
1860
2420
|
/**
|
|
1861
|
-
* Let a touch or pen swipe on the panel, toward its edge (
|
|
1862
|
-
* `side="
|
|
2421
|
+
* Let a touch or pen swipe on the panel, toward its edge (toward the start of the line for
|
|
2422
|
+
* `side="start"`, the end for `side="end"`, down for `side="bottom"`), close the drawer. The panel follows the finger and
|
|
1863
2423
|
* never goes past its open position; released past a third of its width (its height for
|
|
1864
2424
|
* `bottom`), or as a fast flick, it calls `onClose`, otherwise it springs back (without the
|
|
1865
2425
|
* animation under `prefers-reduced-motion`). A mouse does not swipe. Scrolling inside the panel
|
|
1866
|
-
* is left to the browser: vertical on `
|
|
2426
|
+
* is left to the browser: vertical on `start` and `end`; on `bottom`, a `Drawer.Body` that
|
|
1867
2427
|
* scrolls keeps the vertical drag, so the sheet is dragged by its handle, header, footer or a
|
|
1868
2428
|
* body that fits. Default `false`.
|
|
1869
2429
|
*/
|
|
@@ -1925,7 +2485,7 @@ type TabsProps = {
|
|
|
1925
2485
|
defaultValue?: string;
|
|
1926
2486
|
/** Called with the tab to activate. */
|
|
1927
2487
|
onChange?: (value: string) => void;
|
|
1928
|
-
/** Layout direction. `horizontal` (default) puts the tab list on top; `vertical` puts it
|
|
2488
|
+
/** Layout direction. `horizontal` (default) puts the tab list on top; `vertical` puts it at the start of the line. */
|
|
1929
2489
|
orientation?: TabsOrientation;
|
|
1930
2490
|
/**
|
|
1931
2491
|
* Visual style. `underline` (default) marks the active tab with an accent
|
|
@@ -1960,22 +2520,6 @@ declare const Tabs: (({ value: valueProp, defaultValue, onChange: onChangeProp,
|
|
|
1960
2520
|
}) => react.JSX.Element | null;
|
|
1961
2521
|
};
|
|
1962
2522
|
|
|
1963
|
-
type CodeBlockProps = {
|
|
1964
|
-
code: string;
|
|
1965
|
-
language?: string;
|
|
1966
|
-
/**
|
|
1967
|
-
* Turns `code` into highlighted nodes, rendered inside the block's `<code>`.
|
|
1968
|
-
* Cosmos ships no highlighter: plug one in (the story wires Shiki to the
|
|
1969
|
-
* `--color-code-*` theme tokens). Without it the code is plain text. The
|
|
1970
|
-
* copy button always copies `code`.
|
|
1971
|
-
*/
|
|
1972
|
-
highlight?: (code: string, language?: string) => ReactNode;
|
|
1973
|
-
/** Show the copy button (top-right, hover-revealed). Default `true`. */
|
|
1974
|
-
showCopy?: boolean;
|
|
1975
|
-
className?: string;
|
|
1976
|
-
};
|
|
1977
|
-
declare const CodeBlock: ({ code, language, highlight, showCopy, className, }: CodeBlockProps) => react.JSX.Element;
|
|
1978
|
-
|
|
1979
2523
|
/** Emphasis: a bordered `outline` or a filled `primary`. Its color is the `intent`. */
|
|
1980
2524
|
type PageActionVariant = 'outline' | 'primary';
|
|
1981
2525
|
/** Meaning: the accent or a destructive action. */
|
|
@@ -2005,29 +2549,6 @@ type PageActionIconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, '
|
|
|
2005
2549
|
};
|
|
2006
2550
|
declare const PageActionIconButton: ({ icon: Icon, variant, intent, className, type, ref, ...rest }: PageActionIconButtonProps) => react.JSX.Element;
|
|
2007
2551
|
|
|
2008
|
-
type RefreshOption = {
|
|
2009
|
-
label: string;
|
|
2010
|
-
ms: number;
|
|
2011
|
-
};
|
|
2012
|
-
declare const REFRESH_OPTIONS: RefreshOption[];
|
|
2013
|
-
/**
|
|
2014
|
-
* Hook that manages auto-refresh state for a page key, persisted to localStorage.
|
|
2015
|
-
* Pass a stable `pageKey` (e.g. "room", "rack", "alerts").
|
|
2016
|
-
*/
|
|
2017
|
-
declare const useAutoRefresh: (pageKey: string, onRefresh: () => void | Promise<void>) => {
|
|
2018
|
-
autoRefreshMs: number;
|
|
2019
|
-
onIntervalChange: (ms: number) => void;
|
|
2020
|
-
};
|
|
2021
|
-
type RefreshButtonProps = {
|
|
2022
|
-
refreshing?: boolean;
|
|
2023
|
-
autoRefreshMs: number;
|
|
2024
|
-
onRefresh: () => void | Promise<void>;
|
|
2025
|
-
onIntervalChange: (ms: number) => void;
|
|
2026
|
-
options?: RefreshOption[];
|
|
2027
|
-
className?: string;
|
|
2028
|
-
};
|
|
2029
|
-
declare const RefreshButton: ({ refreshing, autoRefreshMs, onRefresh, onIntervalChange, options, className, }: RefreshButtonProps) => react.JSX.Element;
|
|
2030
|
-
|
|
2031
2552
|
type RowActionButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
2032
2553
|
children?: ReactNode;
|
|
2033
2554
|
hideChevron?: boolean;
|
|
@@ -2036,7 +2557,7 @@ type RowActionButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
2036
2557
|
};
|
|
2037
2558
|
/**
|
|
2038
2559
|
* RowActionButton — compact action button for the right edge of table rows
|
|
2039
|
-
* or list items. Defaults to a chevron
|
|
2560
|
+
* or list items. Defaults to a chevron indicator suggesting navigation, pointing along the reading direction.
|
|
2040
2561
|
*/
|
|
2041
2562
|
declare const RowActionButton: ({ children, hideChevron, className, type, ref, ...rest }: RowActionButtonProps) => react.JSX.Element;
|
|
2042
2563
|
|
|
@@ -2094,7 +2615,7 @@ type AlertBannerProps = {
|
|
|
2094
2615
|
intent?: AlertBannerIntent;
|
|
2095
2616
|
/**
|
|
2096
2617
|
* Surface. `tinted` (default) = a full border and the tinted background. `accent` = the same
|
|
2097
|
-
* background with a 4px edge
|
|
2618
|
+
* background with a 4px edge at the start of the line in the intent color and no other border.
|
|
2098
2619
|
*/
|
|
2099
2620
|
appearance?: AlertBannerAppearance;
|
|
2100
2621
|
/** Bold first line. The icon aligns with it instead of centering on the whole banner. */
|
|
@@ -2106,7 +2627,7 @@ type AlertBannerProps = {
|
|
|
2106
2627
|
*/
|
|
2107
2628
|
bodyTone?: AlertBannerBodyTone;
|
|
2108
2629
|
children: ReactNode;
|
|
2109
|
-
/**
|
|
2630
|
+
/** Slot at the end of the line: a Link or a Button. */
|
|
2110
2631
|
action?: ReactNode;
|
|
2111
2632
|
/** Shows a close button that calls this. The host removes the banner. */
|
|
2112
2633
|
onDismiss?: () => void;
|
|
@@ -2201,8 +2722,8 @@ type NotificationsPanelProps = {
|
|
|
2201
2722
|
open?: boolean;
|
|
2202
2723
|
defaultOpen?: boolean;
|
|
2203
2724
|
onOpenChange?: (open: boolean) => void;
|
|
2204
|
-
/**
|
|
2205
|
-
align?: '
|
|
2725
|
+
/** Edge of the trigger the panel lines up with: where the text starts or ends. Default `end`. */
|
|
2726
|
+
align?: 'start' | 'end';
|
|
2206
2727
|
children: ReactNode;
|
|
2207
2728
|
};
|
|
2208
2729
|
type NotificationsPanelTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'onClick' | 'children'> & {
|
|
@@ -2227,7 +2748,7 @@ type NotificationsPanelHeaderProps = {
|
|
|
2227
2748
|
* rendered without it, and the panel stays open: the host clears its `unread` items.
|
|
2228
2749
|
*/
|
|
2229
2750
|
onMarkAllRead?: () => void;
|
|
2230
|
-
/**
|
|
2751
|
+
/** Slot at the end of the line — pills, action buttons, etc. */
|
|
2231
2752
|
children?: ReactNode;
|
|
2232
2753
|
className?: string;
|
|
2233
2754
|
};
|
|
@@ -2260,7 +2781,7 @@ type NotificationsPanelItemProps = ComponentPropsWithRef<'button'> & {
|
|
|
2260
2781
|
time?: ReactNode;
|
|
2261
2782
|
/** Not read yet: a dot before the title and a tinted row. Default false. */
|
|
2262
2783
|
unread?: boolean;
|
|
2263
|
-
/**
|
|
2784
|
+
/** Badge label at the end of the item. If omitted, derived from `intent` (CRIT/WARN/INFO/OK). */
|
|
2264
2785
|
badgeLabel?: string;
|
|
2265
2786
|
/** When true, the panel auto-closes after the item is clicked. Default true. */
|
|
2266
2787
|
closeOnClick?: boolean;
|
|
@@ -2305,7 +2826,7 @@ type NotificationCardSimpleProps = {
|
|
|
2305
2826
|
className?: string;
|
|
2306
2827
|
};
|
|
2307
2828
|
type NotificationCardCondensedProps = {
|
|
2308
|
-
/** Primary text
|
|
2829
|
+
/** Primary text, at the start of the line. */
|
|
2309
2830
|
title: ReactNode;
|
|
2310
2831
|
/** Inline action label (e.g., "Undo") — rendered as a link-styled button. */
|
|
2311
2832
|
actionLabel?: ReactNode;
|
|
@@ -2324,8 +2845,8 @@ type MenuProps = {
|
|
|
2324
2845
|
open?: boolean;
|
|
2325
2846
|
defaultOpen?: boolean;
|
|
2326
2847
|
onOpenChange?: (open: boolean) => void;
|
|
2327
|
-
/** Edge of the trigger the menu lines up with
|
|
2328
|
-
align?: '
|
|
2848
|
+
/** Edge of the trigger the menu lines up with: where the text starts or ends, so the right under `dir="rtl"` for `start`. Default `start`. */
|
|
2849
|
+
align?: 'start' | 'end';
|
|
2329
2850
|
children: ReactNode;
|
|
2330
2851
|
};
|
|
2331
2852
|
type MenuTriggerProps = ComponentPropsWithRef<'button'>;
|
|
@@ -2417,8 +2938,8 @@ type UserMenuProps = {
|
|
|
2417
2938
|
open?: boolean;
|
|
2418
2939
|
defaultOpen?: boolean;
|
|
2419
2940
|
onOpenChange?: (open: boolean) => void;
|
|
2420
|
-
/**
|
|
2421
|
-
align?: '
|
|
2941
|
+
/** Edge of the trigger the menu lines up with: where the text starts or ends. Default `end`. */
|
|
2942
|
+
align?: 'start' | 'end';
|
|
2422
2943
|
children: ReactNode;
|
|
2423
2944
|
};
|
|
2424
2945
|
type UserMenuTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'onClick' | 'children'> & {
|
|
@@ -2630,8 +3151,9 @@ type RatingProps = {
|
|
|
2630
3151
|
};
|
|
2631
3152
|
declare const Rating: ({ value: valueProp, defaultValue, onChange, max, allowHalf, readOnly, size, label, count, showValue, disabled, className, ref, }: RatingProps) => react.JSX.Element;
|
|
2632
3153
|
|
|
2633
|
-
|
|
2634
|
-
|
|
3154
|
+
/** `start` and `end` are the sides of the line: `end` is the right of the trigger, its left under `dir="rtl"`. */
|
|
3155
|
+
type PopoverPosition = 'top' | 'bottom' | 'start' | 'end';
|
|
3156
|
+
/** Alignment with the trigger along the line, for `top` / `bottom` positions. */
|
|
2635
3157
|
type PopoverAlign = 'center' | 'end';
|
|
2636
3158
|
type PopoverProps = {
|
|
2637
3159
|
open?: boolean;
|
|
@@ -2642,12 +3164,14 @@ type PopoverProps = {
|
|
|
2642
3164
|
type PopoverTriggerProps = ComponentPropsWithRef<'button'>;
|
|
2643
3165
|
declare function PopoverTrigger({ onClick, className, children, ref, ...rest }: PopoverTriggerProps): react.JSX.Element;
|
|
2644
3166
|
type PopoverContentProps = {
|
|
3167
|
+
/** Side of the trigger the panel opens on. `start` / `end` follow the reading direction. Default `bottom`. */
|
|
2645
3168
|
position?: PopoverPosition;
|
|
2646
3169
|
/**
|
|
2647
|
-
*
|
|
2648
|
-
* (default) or `end`, flush with
|
|
2649
|
-
*
|
|
2650
|
-
*
|
|
3170
|
+
* Alignment with the trigger along the line for `top` / `bottom`: `center`
|
|
3171
|
+
* (default) or `end`, flush with the trigger's end edge (its right edge, its
|
|
3172
|
+
* left under `dir="rtl"`) — for triggers near the end of the line. `end` also
|
|
3173
|
+
* caps the width so the panel keeps 16px from the other side of the screen.
|
|
3174
|
+
* Ignored for `start` / `end` positions.
|
|
2651
3175
|
*/
|
|
2652
3176
|
align?: PopoverAlign;
|
|
2653
3177
|
/** Accessible name of the dialog. Name it with this or `aria-labelledby`: a dialog needs a name. */
|
|
@@ -2770,11 +3294,15 @@ type ProgressRingProps = {
|
|
|
2770
3294
|
};
|
|
2771
3295
|
declare const ProgressRing: ({ value, max, size, thickness, intent, children, indeterminate, "aria-label": ariaLabel, "aria-labelledby": labelledBy, className, }: ProgressRingProps) => react.JSX.Element;
|
|
2772
3296
|
|
|
2773
|
-
type RibbonPosition = 'top-
|
|
3297
|
+
type RibbonPosition = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
2774
3298
|
type RibbonIntent = Extract<Intent, 'brand' | 'success' | 'warning' | 'danger' | 'neutral'>;
|
|
2775
3299
|
type RibbonShape = 'flat' | 'angled' | 'pill';
|
|
2776
3300
|
type RibbonProps = {
|
|
2777
|
-
/**
|
|
3301
|
+
/**
|
|
3302
|
+
* Corner of the parent to anchor to. Parent must be `position: relative` (and `overflow-hidden`
|
|
3303
|
+
* for `angled`). `start` and `end` follow the reading direction: under `dir="rtl"` a
|
|
3304
|
+
* `top-end` ribbon sits in the top-left corner.
|
|
3305
|
+
*/
|
|
2778
3306
|
position?: RibbonPosition;
|
|
2779
3307
|
intent?: RibbonIntent;
|
|
2780
3308
|
/**
|
|
@@ -3021,7 +3549,8 @@ declare const VideoEmbed: ({ src, title, aspectRatio, rounded, type, allow, sand
|
|
|
3021
3549
|
* Mount the `<Toaster />` once at the app root. Trigger toasts from anywhere
|
|
3022
3550
|
* with `toast(...)`, `toast.success(...)`, `toast.error(...)`, `toast.promise(...)`.
|
|
3023
3551
|
*
|
|
3024
|
-
* Cosmos defaults: bottom
|
|
3552
|
+
* Cosmos defaults: the bottom corner at the end of the line (bottom right, bottom left under
|
|
3553
|
+
* `dir="rtl"` on `<html>`, or on the `dir` prop), light or dark from the Cosmos theme class on
|
|
3025
3554
|
* `<html>` (not the OS setting), close button on. The toasts are drawn by Cosmos
|
|
3026
3555
|
* classes (`toastOptions.unstyled`), not by sonner: `success`, `info`, `warning`
|
|
3027
3556
|
* and `error` take the `INTENT_STYLE` palette of `AlertBanner` on an opaque
|
|
@@ -3038,7 +3567,7 @@ type AnnouncementBarProps = {
|
|
|
3038
3567
|
/** Override the default icon for the intent. Pass `null` to hide. */
|
|
3039
3568
|
icon?: ElementType | null;
|
|
3040
3569
|
message: ReactNode;
|
|
3041
|
-
/**
|
|
3570
|
+
/** Slot at the end of the line — a Link, Button, etc. */
|
|
3042
3571
|
action?: ReactNode;
|
|
3043
3572
|
/** Render a close button. */
|
|
3044
3573
|
dismissible?: boolean;
|
|
@@ -3101,7 +3630,7 @@ type CommandPaletteGroupProps = ComponentPropsWithRef<typeof Command.Group>;
|
|
|
3101
3630
|
declare function CommandPaletteGroup({ className, ref, ...rest }: CommandPaletteGroupProps): react.JSX.Element;
|
|
3102
3631
|
type CommandPaletteItemProps = Omit<ComponentPropsWithRef<typeof Command.Item>, 'children'> & {
|
|
3103
3632
|
icon?: ElementType;
|
|
3104
|
-
/**
|
|
3633
|
+
/** Keyboard shortcut hint at the end of the item (e.g. "⌘D"). */
|
|
3105
3634
|
shortcut?: ReactNode;
|
|
3106
3635
|
/** Second line under the label: what the command does. The item stays one line without it. */
|
|
3107
3636
|
description?: ReactNode;
|
|
@@ -3128,6 +3657,32 @@ declare const CommandPalette: (({ hotkey, open, onOpenChange, className, overlay
|
|
|
3128
3657
|
Footer: ({ className, children }: CommandPaletteFooterProps) => react.JSX.Element;
|
|
3129
3658
|
};
|
|
3130
3659
|
|
|
3660
|
+
type CommandPaletteTriggerProps = Omit<ComponentPropsWithRef<'button'>, 'children'> & {
|
|
3661
|
+
/** Text of the field-like button. Default `Search…`. Below `sm` it is read by assistive technology only. */
|
|
3662
|
+
placeholder?: string;
|
|
3663
|
+
/**
|
|
3664
|
+
* The hotkey that opens the palette, written as `CommandPalette`'s `hotkey` (`'mod+k'`), shown
|
|
3665
|
+
* as a key hint: `⌘K` on Apple platforms, `Ctrl K` elsewhere. It only labels the button: the
|
|
3666
|
+
* `CommandPalette` listens for the keys, so give both the same value. `null` hides the hint
|
|
3667
|
+
* (a palette with `hotkey={null}`). Default `'mod+k'`.
|
|
3668
|
+
*/
|
|
3669
|
+
shortcut?: string | null;
|
|
3670
|
+
/** Height and text size, aligned on the form fields'. Default `md`. */
|
|
3671
|
+
size?: FieldSize;
|
|
3672
|
+
};
|
|
3673
|
+
/**
|
|
3674
|
+
* `CommandPaletteTrigger` — a button drawn like a search field, which opens a `CommandPalette`:
|
|
3675
|
+
* a placeholder, a magnifier and the hotkey as a key hint. Not an input: nothing is typed here,
|
|
3676
|
+
* the palette holds the field, so a screen reader announces a button that opens a dialog.
|
|
3677
|
+
*
|
|
3678
|
+
* The palette owns the hotkey (its `hotkey` prop, `mod+k` by default) and the open state. This
|
|
3679
|
+
* button registers no key listener: it takes `onClick={() => setOpen(true)}` and the same hotkey
|
|
3680
|
+
* for its hint, so the keys never toggle the palette twice.
|
|
3681
|
+
*
|
|
3682
|
+
* Below `sm` it shrinks to a square icon button; the placeholder stays as its accessible name.
|
|
3683
|
+
*/
|
|
3684
|
+
declare const CommandPaletteTrigger: ({ placeholder, shortcut, size, className, ref, ...rest }: CommandPaletteTriggerProps) => react.JSX.Element;
|
|
3685
|
+
|
|
3131
3686
|
type ClipboardVariant = 'icon' | 'button';
|
|
3132
3687
|
type ClipboardSize = 'sm' | 'md';
|
|
3133
3688
|
type ClipboardProps = Omit<ComponentPropsWithRef<'button'>, 'onCopy'> & {
|
|
@@ -3189,12 +3744,15 @@ type SecretValueProps = {
|
|
|
3189
3744
|
*/
|
|
3190
3745
|
declare const SecretValue: ({ value, label, revealed: revealedProp, defaultRevealed, onRevealedChange, visibleSuffix, autoHideAfter, className, ref, }: SecretValueProps) => react.JSX.Element;
|
|
3191
3746
|
|
|
3192
|
-
type BackToTopFabPosition = 'bottom-
|
|
3747
|
+
type BackToTopFabPosition = 'bottom-end' | 'bottom-start';
|
|
3193
3748
|
type BackToTopFabIntent = Extract<Intent, 'brand' | 'neutral'>;
|
|
3194
3749
|
type BackToTopFabProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> & {
|
|
3195
3750
|
/** Pixels of vertical scroll before the FAB fades in. Default `300`. */
|
|
3196
3751
|
threshold?: number;
|
|
3197
|
-
/**
|
|
3752
|
+
/**
|
|
3753
|
+
* Anchor corner. Default `bottom-end`. The side follows the reading direction: under `dir="rtl"`
|
|
3754
|
+
* `bottom-end` is the bottom-left corner and `bottom-start` the bottom-right one.
|
|
3755
|
+
*/
|
|
3198
3756
|
position?: BackToTopFabPosition;
|
|
3199
3757
|
/** Use smooth scrolling. Default `true`. */
|
|
3200
3758
|
smoothScroll?: boolean;
|
|
@@ -3255,16 +3813,14 @@ declare const HelpOverlay: (({ open: controlledOpen, defaultOpen, onOpenChange,
|
|
|
3255
3813
|
Shortcut: ({ keys, description, className }: HelpOverlayShortcutProps) => react.JSX.Element;
|
|
3256
3814
|
};
|
|
3257
3815
|
|
|
3258
|
-
type FieldSize = 'sm' | 'md' | 'lg';
|
|
3259
|
-
|
|
3260
3816
|
type InputProps = Omit<ComponentPropsWithRef<'input'>, 'size'> & {
|
|
3261
3817
|
label?: string;
|
|
3262
3818
|
description?: string;
|
|
3263
3819
|
error?: string;
|
|
3264
3820
|
/**
|
|
3265
3821
|
* Message shown once the value is valid (a free username, an accepted code):
|
|
3266
|
-
* a green border and message, and a check icon on the
|
|
3267
|
-
* `
|
|
3822
|
+
* a green border and message, and a check icon on the end edge, which
|
|
3823
|
+
* `endSlot` replaces. The message is linked as the description and
|
|
3268
3824
|
* announced politely when it appears. `error` wins when both are set.
|
|
3269
3825
|
*/
|
|
3270
3826
|
success?: string;
|
|
@@ -3275,12 +3831,12 @@ type InputProps = Omit<ComponentPropsWithRef<'input'>, 'size'> & {
|
|
|
3275
3831
|
size?: FieldSize;
|
|
3276
3832
|
/** Marks the field required: an asterisk after the label, `required` and `aria-required` on the input. */
|
|
3277
3833
|
required?: boolean;
|
|
3278
|
-
/** Optional
|
|
3834
|
+
/** Optional icon at the start edge (lucide-react). Ignored when `prefix` is set. */
|
|
3279
3835
|
icon?: ElementType;
|
|
3280
3836
|
/**
|
|
3281
|
-
* Draws an alert icon on the
|
|
3837
|
+
* Draws an alert icon on the end edge while `error` is set, so the state
|
|
3282
3838
|
* doesn't rest on the border color alone. Default `false`. Ignored when
|
|
3283
|
-
* `
|
|
3839
|
+
* `endSlot` is set.
|
|
3284
3840
|
*/
|
|
3285
3841
|
errorIcon?: boolean;
|
|
3286
3842
|
/**
|
|
@@ -3288,8 +3844,8 @@ type InputProps = Omit<ComponentPropsWithRef<'input'>, 'size'> & {
|
|
|
3288
3844
|
* one. Unlike `disabled`, the field stays focusable and is submitted.
|
|
3289
3845
|
*/
|
|
3290
3846
|
readOnly?: boolean;
|
|
3291
|
-
/** Optional
|
|
3292
|
-
|
|
3847
|
+
/** Optional slot on the end edge — e.g. unit suffix, validation pill. Ignored when `suffix` is set. */
|
|
3848
|
+
endSlot?: ReactNode;
|
|
3293
3849
|
/** Slot rendered next to the label text (e.g. a TooltipHelp). */
|
|
3294
3850
|
labelTrailing?: ReactNode;
|
|
3295
3851
|
/** Attached prefix addon (e.g. `https://`, `€`, `@`). Renders as a bordered group. */
|
|
@@ -3297,7 +3853,7 @@ type InputProps = Omit<ComponentPropsWithRef<'input'>, 'size'> & {
|
|
|
3297
3853
|
/** Attached suffix addon (e.g. `.com`, `kg`). Renders as a bordered group. */
|
|
3298
3854
|
suffix?: ReactNode;
|
|
3299
3855
|
};
|
|
3300
|
-
declare function Input({ label, description, error, success, size, required, icon: Icon, errorIcon, readOnly,
|
|
3856
|
+
declare function Input({ label, description, error, success, size, required, icon: Icon, errorIcon, readOnly, endSlot, labelTrailing, prefix, suffix, className, id, ref, ...rest }: InputProps): react.JSX.Element;
|
|
3301
3857
|
|
|
3302
3858
|
/** Naming props shared by the bare controls that can sit in a FormRow. */
|
|
3303
3859
|
type FieldA11yProps = {
|
|
@@ -3450,8 +4006,8 @@ type NumberInputProps = FieldA11yProps & {
|
|
|
3450
4006
|
required?: boolean;
|
|
3451
4007
|
/**
|
|
3452
4008
|
* Where the step buttons sit. `sides` (default): `−` / `+` on the outer edges,
|
|
3453
|
-
* centered text. `stacked`: ↑ / ↓ arrows stacked in a column inside the
|
|
3454
|
-
* edge,
|
|
4009
|
+
* centered text. `stacked`: ↑ / ↓ arrows stacked in a column inside the end
|
|
4010
|
+
* edge, start-aligned text: the compact form for settings panels.
|
|
3455
4011
|
*/
|
|
3456
4012
|
controls?: 'sides' | 'stacked';
|
|
3457
4013
|
/** Tailwind width class for the inner input — default `w-20`. */
|
|
@@ -3508,7 +4064,9 @@ type FormRowProps = {
|
|
|
3508
4064
|
};
|
|
3509
4065
|
/**
|
|
3510
4066
|
* FormRow — horizontal setting row : label (+ optional description and help)
|
|
3511
|
-
*
|
|
4067
|
+
* at the start, control at the end. Below `sm` the label and its description stack
|
|
4068
|
+
* above the control, which takes the row's width; a switch (`Toggle`) stays beside its
|
|
4069
|
+
* label, as phones show a setting that turns on and off. Pair multiple FormRows inside a
|
|
3512
4070
|
* `divide-y` container to build settings panels. The Cosmos controls inside
|
|
3513
4071
|
* (Toggle, NumberInput, SearchInput, Select, SegmentedControl) take the
|
|
3514
4072
|
* label as their name and the description as their description; any other
|
|
@@ -3546,7 +4104,7 @@ type AvatarUploaderProps = {
|
|
|
3546
4104
|
};
|
|
3547
4105
|
declare const AvatarUploader: ({ src, name, size, onUpload, onRemove, loading: loadingProp, error: errorProp, helperText, maxSizeMB, accept, disabled, uploadLabel, removeLabel, className, }: AvatarUploaderProps) => react.JSX.Element;
|
|
3548
4106
|
|
|
3549
|
-
type PasswordInputProps = Omit<InputProps, 'type' | 'icon' | '
|
|
4107
|
+
type PasswordInputProps = Omit<InputProps, 'type' | 'icon' | 'endSlot' | 'labelTrailing'> & {
|
|
3550
4108
|
/** Tooltip text shown next to the label (uses TooltipHelp). */
|
|
3551
4109
|
helpText?: string;
|
|
3552
4110
|
/** Override the visibility-toggle button labels (defaults: "Show/Hide password"). */
|
|
@@ -3762,7 +4320,7 @@ type UploadQueueProps = {
|
|
|
3762
4320
|
*/
|
|
3763
4321
|
declare const UploadQueue: ({ items, onRetry, onRemove, label, className, ref, }: UploadQueueProps) => react.JSX.Element | null;
|
|
3764
4322
|
|
|
3765
|
-
type FormFooterAlign = '
|
|
4323
|
+
type FormFooterAlign = 'end' | 'between';
|
|
3766
4324
|
type FormFooterProps = {
|
|
3767
4325
|
/** Cancel button handler. Hidden when omitted. */
|
|
3768
4326
|
onCancel?: () => void;
|
|
@@ -3779,7 +4337,7 @@ type FormFooterProps = {
|
|
|
3779
4337
|
submitIntent?: ButtonIntent;
|
|
3780
4338
|
/** Form name attribute (used by submit when the button is outside the form). */
|
|
3781
4339
|
formId?: string;
|
|
3782
|
-
/** Where to render the buttons. Default `
|
|
4340
|
+
/** Where to render the buttons: `end` is the end edge (the left one in right to left). Default `end`. */
|
|
3783
4341
|
align?: FormFooterAlign;
|
|
3784
4342
|
/** Render a top border separator. Default `true`. */
|
|
3785
4343
|
bordered?: boolean;
|
|
@@ -3957,7 +4515,7 @@ type ActionPanelProps = ComponentPropsWithRef<'div'> & {
|
|
|
3957
4515
|
action?: ReactNode;
|
|
3958
4516
|
/**
|
|
3959
4517
|
* Layout. `stacked` (default): action sits below the description.
|
|
3960
|
-
* `inline`: action floats top
|
|
4518
|
+
* `inline`: action floats at the top end (TUI "With button at top right").
|
|
3961
4519
|
*/
|
|
3962
4520
|
layout?: ActionPanelLayout;
|
|
3963
4521
|
/**
|
|
@@ -4014,6 +4572,11 @@ declare const Combobox: ({ label, value: valueProp, defaultValue, onChange, opti
|
|
|
4014
4572
|
type MultiSelectOption = ComboboxOption;
|
|
4015
4573
|
type MultiSelectProps = {
|
|
4016
4574
|
label?: ReactNode;
|
|
4575
|
+
/**
|
|
4576
|
+
* Keeps the label for assistive technology only: the label and the count row leave the layout,
|
|
4577
|
+
* so the field's top edge is the component's, for a toolbar where it lines up with buttons.
|
|
4578
|
+
*/
|
|
4579
|
+
labelHidden?: boolean;
|
|
4017
4580
|
/** Chosen option values, when controlled. */
|
|
4018
4581
|
value?: string[];
|
|
4019
4582
|
/** Initial option values, when uncontrolled. None chosen when omitted. */
|
|
@@ -4052,7 +4615,7 @@ type MultiSelectProps = {
|
|
|
4052
4615
|
* the list. The list stays open after a pick, a checkbox marks the chosen options, and Backspace
|
|
4053
4616
|
* in an empty input removes the last value.
|
|
4054
4617
|
*/
|
|
4055
|
-
declare const MultiSelect: ({ label, value: valueProp, defaultValue, onChange, options, placeholder, emptyMessage, maxItems, disabled, helperText, error, size, required, className, ref, open: openProp, defaultOpen, onOpenChange, }: MultiSelectProps) => react.JSX.Element;
|
|
4618
|
+
declare const MultiSelect: ({ label, labelHidden, value: valueProp, defaultValue, onChange, options, placeholder, emptyMessage, maxItems, disabled, helperText, error, size, required, className, ref, open: openProp, defaultOpen, onOpenChange, }: MultiSelectProps) => react.JSX.Element;
|
|
4056
4619
|
|
|
4057
4620
|
type TagInputProps = {
|
|
4058
4621
|
label?: ReactNode;
|
|
@@ -4132,7 +4695,7 @@ type SliderProps = {
|
|
|
4132
4695
|
/** What the arrow keys and the pointer snap to. Default `1`. */
|
|
4133
4696
|
step?: number;
|
|
4134
4697
|
/**
|
|
4135
|
-
* Names the slider,
|
|
4698
|
+
* Names the slider, at the start of the header row. The handles take it as their accessible
|
|
4136
4699
|
* name; a range names them "<label> minimum" and "<label> maximum".
|
|
4137
4700
|
*/
|
|
4138
4701
|
label?: string;
|
|
@@ -4363,7 +4926,10 @@ type DescriptionListItemProps = ComponentPropsWithRef<'div'> & {
|
|
|
4363
4926
|
label: ReactNode;
|
|
4364
4927
|
/** Render the value in a monospace font (IDs, hashes, paths…). */
|
|
4365
4928
|
mono?: boolean;
|
|
4366
|
-
/**
|
|
4929
|
+
/**
|
|
4930
|
+
* Value (`<dd>`). A text or a number sits in a `<bdi>`, so a value that starts with a number
|
|
4931
|
+
* keeps its order in a right-to-left page ("2 minutes ago", not "minutes ago 2").
|
|
4932
|
+
*/
|
|
4367
4933
|
children: ReactNode;
|
|
4368
4934
|
};
|
|
4369
4935
|
declare function Item({ label, mono, children, className, ref, ...rest }: DescriptionListItemProps): react.JSX.Element;
|
|
@@ -4383,8 +4949,8 @@ type DescriptionListProps = ComponentPropsWithRef<'dl'> & {
|
|
|
4383
4949
|
*/
|
|
4384
4950
|
striped?: boolean;
|
|
4385
4951
|
/**
|
|
4386
|
-
* When `true`, items are flat label/value rows, the label
|
|
4387
|
-
*
|
|
4952
|
+
* When `true`, items are flat label/value rows, the label at the start and the value at the
|
|
4953
|
+
* end, for the metadata of a card (ID, template, last seen…). The default items are
|
|
4388
4954
|
* wide, with the label above the value on a phone.
|
|
4389
4955
|
*/
|
|
4390
4956
|
compact?: boolean;
|
|
@@ -4400,6 +4966,13 @@ type KpiCardIntent = Extract<Intent, 'neutral' | 'warning' | 'danger'>;
|
|
|
4400
4966
|
type KpiCardProps = {
|
|
4401
4967
|
label: string;
|
|
4402
4968
|
value: ReactNode;
|
|
4969
|
+
/**
|
|
4970
|
+
* The exact figure behind an abbreviated `value` (`€12,418,906.40` for `€12.4M`). A tooltip shows
|
|
4971
|
+
* it on hover and focus, and it is part of the card's accessible name, which would otherwise
|
|
4972
|
+
* read only "12.4M". On a plain card the value becomes a tab stop to reach the tooltip; a link or
|
|
4973
|
+
* button card shows it when the card takes keyboard focus. Ignored while `loading`.
|
|
4974
|
+
*/
|
|
4975
|
+
exactValue?: string;
|
|
4403
4976
|
/** Smaller text under the value — e.g. "across 3 sites". */
|
|
4404
4977
|
sub?: ReactNode;
|
|
4405
4978
|
/** Lucide icon (or any component taking `className`), in a tinted chip next to the label. */
|
|
@@ -4440,7 +5013,7 @@ type KpiCardProps = {
|
|
|
4440
5013
|
* against a previous period and a chart. Use in dashboards as the top-row at-a-glance panel.
|
|
4441
5014
|
* With `href` or `onClick` the whole card is one link or button.
|
|
4442
5015
|
*/
|
|
4443
|
-
declare const KpiCard: ({ label, value, sub, icon: Icon, iconIntent, delta, chart, intent, loading, href, onClick, ref, className, }: KpiCardProps) => react.JSX.Element;
|
|
5016
|
+
declare const KpiCard: ({ label, value, exactValue, sub, icon: Icon, iconIntent, delta, chart, intent, loading, href, onClick, ref, className, }: KpiCardProps) => react.JSX.Element;
|
|
4444
5017
|
|
|
4445
5018
|
type TrendDeltaSize = 'sm' | 'md';
|
|
4446
5019
|
type TrendDeltaProps = {
|
|
@@ -4484,7 +5057,7 @@ type TimelineItem = {
|
|
|
4484
5057
|
/**
|
|
4485
5058
|
* The state of the event, as a color on its marker: the icon circle of
|
|
4486
5059
|
* `stepper` and `alternating` (tinted), the dot of `dot`, a ring around the
|
|
4487
|
-
* avatar of `avatar`, the
|
|
5060
|
+
* avatar of `avatar`, the start edge of the card of `card`. Defaults to
|
|
4488
5061
|
* `brand` in `dot`, `stepper` and `alternating`; `avatar` and `card` draw
|
|
4489
5062
|
* nothing without it, so an item with no `intent` keeps its look there.
|
|
4490
5063
|
*/
|
|
@@ -4512,9 +5085,9 @@ type TimelineVariant =
|
|
|
4512
5085
|
/** Each entry rendered as a stand-alone card (no connector line). */
|
|
4513
5086
|
| 'card'
|
|
4514
5087
|
/**
|
|
4515
|
-
* Cards alternating
|
|
5088
|
+
* Cards alternating between the two sides of a centred line, with a `stepper`
|
|
4516
5089
|
* icon circle on the line and the time on the other side. Below `md`, one
|
|
4517
|
-
* column with the line
|
|
5090
|
+
* column with the line at the start.
|
|
4518
5091
|
*/
|
|
4519
5092
|
| 'alternating';
|
|
4520
5093
|
type TimelineProps = {
|
|
@@ -4708,17 +5281,6 @@ type KanbanBoardProps = {
|
|
|
4708
5281
|
*/
|
|
4709
5282
|
declare const KanbanBoard: ({ value, defaultValue, onChange, onCardMove, onCardOpen, onAddCard, renderCard, loading, ariaLabel, className, ref, }: KanbanBoardProps) => react.JSX.Element;
|
|
4710
5283
|
|
|
4711
|
-
type DateTimeValue = Date | number | string;
|
|
4712
|
-
/** Presets of `DateTime`'s `format`, each a set of `Intl.DateTimeFormat` options. */
|
|
4713
|
-
type DateTimeFormat = 'date' | 'time' | 'datetime' | 'long' | 'full';
|
|
4714
|
-
type CountdownParts = {
|
|
4715
|
-
days: number;
|
|
4716
|
-
hours: number;
|
|
4717
|
-
minutes: number;
|
|
4718
|
-
seconds: number;
|
|
4719
|
-
};
|
|
4720
|
-
type CountdownUnit = keyof CountdownParts;
|
|
4721
|
-
|
|
4722
5284
|
type DateTimeProps = {
|
|
4723
5285
|
/** A `Date`, a timestamp in milliseconds or a date string (ISO 8601: other forms depend on the browser). */
|
|
4724
5286
|
value: DateTimeValue;
|
|
@@ -4887,7 +5449,8 @@ type AuditDiffProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {
|
|
|
4887
5449
|
* on a green tint, and every cue also has a text: the column headers say Before and After, an
|
|
4888
5450
|
* absent value reads "empty", and the words that moved in a long text are wrapped in `<del>` and
|
|
4889
5451
|
* `<ins>` with a visually hidden "removed:" / "added:", so colour is never the only signal.
|
|
4890
|
-
* Values are React text, so markup in one shows as written.
|
|
5452
|
+
* Values are React text, so markup in one shows as written. Each field name and value is isolated
|
|
5453
|
+
* in a `<bdi>`, so a phone number or a size keeps its order in a right-to-left page.
|
|
4891
5454
|
*/
|
|
4892
5455
|
declare const AuditDiff: ({ changes, variant, formatValue, labels: labelOverrides, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: AuditDiffProps) => react.JSX.Element;
|
|
4893
5456
|
|
|
@@ -4900,16 +5463,74 @@ type DataTableSort = {
|
|
|
4900
5463
|
key: string;
|
|
4901
5464
|
direction: SortDirection;
|
|
4902
5465
|
} | null;
|
|
4903
|
-
/**
|
|
4904
|
-
|
|
5466
|
+
/**
|
|
5467
|
+
* Row height of a `DataTable`: the standard rows, tighter `compact` ones or taller `comfortable`
|
|
5468
|
+
* ones. Same names as the page's `data-density`.
|
|
5469
|
+
*/
|
|
5470
|
+
type DataTableDensity = 'compact' | 'default' | 'comfortable';
|
|
5471
|
+
/** The edge of a `DataTable` a column is pinned to. */
|
|
5472
|
+
type ColumnPin = 'start' | 'end';
|
|
5473
|
+
/**
|
|
5474
|
+
* What `ColumnEdit.render` gets to draw an editor: the draft and what to do with it. The draft is
|
|
5475
|
+
* a string, what a form field holds: parse it in `onCellEdit` / `onRowEdit`.
|
|
5476
|
+
*/
|
|
5477
|
+
type CellEditor<T> = {
|
|
5478
|
+
/** The row being edited. */
|
|
5479
|
+
row: T;
|
|
5480
|
+
/** The draft value: `initialValue(row)` until `setValue` changes it. */
|
|
5481
|
+
value: string;
|
|
5482
|
+
/** Changes the draft. */
|
|
5483
|
+
setValue: (value: string) => void;
|
|
5484
|
+
/**
|
|
5485
|
+
* Saves the draft: what Enter does (and blur, with `editTrigger` `'cell'` and `'button'`). With
|
|
5486
|
+
* `editTrigger="row"` it saves the whole row.
|
|
5487
|
+
*/
|
|
5488
|
+
commit: () => void;
|
|
5489
|
+
/** Drops the draft and closes the editor: what Escape does. With `'row'`, for the whole row. */
|
|
5490
|
+
cancel: () => void;
|
|
5491
|
+
/** A save is waiting for its promise (`'row'` only: a cell editor is closed meanwhile). */
|
|
5492
|
+
saving: boolean;
|
|
5493
|
+
/**
|
|
5494
|
+
* What the field needs, spread on it: its name (`aria-label`, "Rack for node-a02"), the error
|
|
5495
|
+
* tie (`aria-describedby`, `aria-invalid`), `disabled` while saving and a `className` that turns
|
|
5496
|
+
* the border red on `aria-invalid`. An `Input`, a `Select` or any field that takes these props
|
|
5497
|
+
* accepts the object as it is.
|
|
5498
|
+
*/
|
|
5499
|
+
fieldProps: {
|
|
5500
|
+
'aria-label': string;
|
|
5501
|
+
'aria-describedby': string | undefined;
|
|
5502
|
+
'aria-invalid': true | undefined;
|
|
5503
|
+
disabled: boolean | undefined;
|
|
5504
|
+
/** Turns the border red while `aria-invalid` is set. */
|
|
5505
|
+
className: string;
|
|
5506
|
+
};
|
|
5507
|
+
};
|
|
5508
|
+
/** The editor of a column (`ColumnDef.edit`). */
|
|
5509
|
+
type ColumnEdit<T> = {
|
|
5510
|
+
/** The draft the editor starts from, for a row: usually the plain text of the cell. */
|
|
5511
|
+
initialValue: (row: T) => string;
|
|
5512
|
+
/**
|
|
5513
|
+
* Draws the editor from the existing form fields:
|
|
5514
|
+
* `(e) => <Input {...e.fieldProps} size="sm" value={e.value} onChange={(ev) => e.setValue(ev.target.value)} />`.
|
|
5515
|
+
* Enter, Escape and blur are handled by the table around it, not by the field.
|
|
5516
|
+
*/
|
|
5517
|
+
render: (editor: CellEditor<T>) => ReactNode;
|
|
5518
|
+
};
|
|
4905
5519
|
type ColumnDef<T> = {
|
|
4906
5520
|
/** Stable key — used for sort/filter identity. */
|
|
4907
5521
|
key: string;
|
|
4908
5522
|
label: ReactNode;
|
|
4909
5523
|
/** Optional fixed width (CSS value, e.g. `'20%'` or `'180px'`). */
|
|
4910
5524
|
width?: string;
|
|
4911
|
-
/**
|
|
4912
|
-
|
|
5525
|
+
/**
|
|
5526
|
+
* The narrowest the column is drawn when `width` is a percentage or unset (a length, `'180px'`,
|
|
5527
|
+
* is kept as it is). Default `'8rem'`. The table is never narrower than what its columns need,
|
|
5528
|
+
* so on a narrow screen it scrolls sideways instead of squeezing them. Columns without a width
|
|
5529
|
+
* split what the others leave in equal parts: each gets at least the largest `minWidth` of them.
|
|
5530
|
+
*/
|
|
5531
|
+
minWidth?: string;
|
|
5532
|
+
/** Text alignment override: `start` (the default), `end` or `center`. `end` is for numbers. */
|
|
5533
|
+
align?: 'start' | 'end' | 'center';
|
|
4913
5534
|
/** Renders the cell for a row. */
|
|
4914
5535
|
render: (row: T) => ReactNode;
|
|
4915
5536
|
/** Returns the raw sortable value for the row. */
|
|
@@ -4946,6 +5567,25 @@ type ColumnDef<T> = {
|
|
|
4946
5567
|
* the card. The others become label/value pairs. The table above `sm` ignores it.
|
|
4947
5568
|
*/
|
|
4948
5569
|
mobile?: 'title' | 'hidden';
|
|
5570
|
+
/**
|
|
5571
|
+
* Pins the column to the `start` or the `end` of the table while it scrolls sideways, so a row
|
|
5572
|
+
* stays identified (a name at the start) or its status and actions stay in reach (at the end).
|
|
5573
|
+
* Several columns can sit on each side. List the pinned columns first (`start`) or last (`end`)
|
|
5574
|
+
* in `columns`: a pinned column keeps its place in the order. The selection and toggle columns
|
|
5575
|
+
* stay first, and pinned with the start columns; the action column is pinned with the end ones.
|
|
5576
|
+
* A shadow marks the edge while content scrolls under it. With `rowHref`, the link of the row
|
|
5577
|
+
* covers its own column only when that one is pinned, and a click on the rest of the row follows
|
|
5578
|
+
* it from a handler (middle click and the context menu work on that column only). The table
|
|
5579
|
+
* above `sm` only: the cards of `mobileLayout="cards"` ignore it.
|
|
5580
|
+
*/
|
|
5581
|
+
pin?: ColumnPin;
|
|
5582
|
+
/**
|
|
5583
|
+
* Makes the cells of the column editable (see `DataTable`'s `editTrigger`, `onCellEdit` and
|
|
5584
|
+
* `onRowEdit`): the editor to draw, and the draft it starts from. A cell's content is drawn
|
|
5585
|
+
* inside a button with `editTrigger` `'cell'`, so keep it to text and badges, with no link or
|
|
5586
|
+
* button of its own. Not in the cards of `mobileLayout="cards"`.
|
|
5587
|
+
*/
|
|
5588
|
+
edit?: ColumnEdit<T>;
|
|
4949
5589
|
/** The label of the column's pair in a card, in place of `label` (a short or plain-text one). */
|
|
4950
5590
|
mobileLabel?: ReactNode;
|
|
4951
5591
|
};
|
|
@@ -4958,6 +5598,31 @@ type DataTableExportQuery = {
|
|
|
4958
5598
|
sort: DataTableSort;
|
|
4959
5599
|
/** The keys of the visible data columns, in the order they are drawn. */
|
|
4960
5600
|
columns: string[];
|
|
5601
|
+
/**
|
|
5602
|
+
* The `rowKey`s of the selected rows, present only while rows are selected: the export is of
|
|
5603
|
+
* those rows alone, whatever the search and the filters keep.
|
|
5604
|
+
*/
|
|
5605
|
+
selection?: (string | number)[];
|
|
5606
|
+
};
|
|
5607
|
+
/**
|
|
5608
|
+
* A bulk action of `DataTable`'s `bulkActionItems`, shown while rows are selected. The first is a
|
|
5609
|
+
* button; when the bar runs out of room the others fold into an "Actions" menu, and on a phone
|
|
5610
|
+
* (`mobileLayout="cards"`) each one is an icon button named by its `label`.
|
|
5611
|
+
*/
|
|
5612
|
+
type DataTableBulkAction<T> = {
|
|
5613
|
+
/** Identifies the action among the others. */
|
|
5614
|
+
key: string;
|
|
5615
|
+
/** The text of the button or menu item, and the name of its icon-only form. */
|
|
5616
|
+
label: string;
|
|
5617
|
+
/** Drawn before the label. An action with no icon is a text button on a phone too. */
|
|
5618
|
+
icon?: ComponentType<{
|
|
5619
|
+
className?: string;
|
|
5620
|
+
}>;
|
|
5621
|
+
/** `danger` colors a destructive action red. Default `neutral`. */
|
|
5622
|
+
intent?: Extract<Intent, 'neutral' | 'danger'>;
|
|
5623
|
+
disabled?: boolean;
|
|
5624
|
+
/** Called with the selected rows. */
|
|
5625
|
+
onClick: (selectedRows: T[]) => void;
|
|
4961
5626
|
};
|
|
4962
5627
|
/**
|
|
4963
5628
|
* A saved view of a `DataTable`: a name and every part of the state a user sets. Plain JSON, so
|
|
@@ -5015,7 +5680,7 @@ type DataTableProps<T> = {
|
|
|
5015
5680
|
* others' as many as you want: they stay clickable above the row.
|
|
5016
5681
|
*/
|
|
5017
5682
|
rowHref?: (row: T) => string | undefined;
|
|
5018
|
-
/** Optional
|
|
5683
|
+
/** Optional end-edge action column (typically a `RowActionButton` or a `RowActionsMenu`). */
|
|
5019
5684
|
renderRowAction?: (row: T) => React.ReactNode;
|
|
5020
5685
|
/**
|
|
5021
5686
|
* Rows per page, when controlled. Without `pageSizeOptions` it is the fixed size. Default 25.
|
|
@@ -5036,31 +5701,97 @@ type DataTableProps<T> = {
|
|
|
5036
5701
|
emptyTitle?: string;
|
|
5037
5702
|
emptyDescription?: string;
|
|
5038
5703
|
/**
|
|
5039
|
-
*
|
|
5040
|
-
*
|
|
5041
|
-
*
|
|
5042
|
-
*
|
|
5043
|
-
*
|
|
5704
|
+
* A call to action under the empty state ("Create the first order"). It shows when the table
|
|
5705
|
+
* has no data to start with. When a search or filters hide every row it gives way to a
|
|
5706
|
+
* "Clear filters" button that clears both, since a call to create would not answer an empty
|
|
5707
|
+
* result. With `manual`, where the host holds the rows, an active search or filter counts as
|
|
5708
|
+
* the cause.
|
|
5709
|
+
*/
|
|
5710
|
+
emptyAction?: ReactNode;
|
|
5711
|
+
/**
|
|
5712
|
+
* Row height. Without it (and without `defaultDensity`) the table follows the page's
|
|
5713
|
+
* `data-density`. Set, it is a local override of the page: `default` keeps the standard rows,
|
|
5714
|
+
* `compact` pads the header and body cells less, `comfortable` more, for rows that carry two
|
|
5715
|
+
* lines (a name over an email, an avatar) or need more room. Cell content stays vertically
|
|
5716
|
+
* centred. A `density` passed without `onDensityChange` is a controlled value that never
|
|
5717
|
+
* moves: applying a saved view then reports its density and keeps this one. A table that
|
|
5718
|
+
* follows the page saves `default` in a view.
|
|
5044
5719
|
*/
|
|
5045
5720
|
density?: DataTableDensity;
|
|
5046
5721
|
defaultDensity?: DataTableDensity;
|
|
5047
5722
|
/** Called with the density to move to, in both modes (a saved view sets it). */
|
|
5048
5723
|
onDensityChange?: (density: DataTableDensity) => void;
|
|
5049
5724
|
/**
|
|
5050
|
-
*
|
|
5051
|
-
*
|
|
5052
|
-
*
|
|
5053
|
-
*
|
|
5054
|
-
|
|
5055
|
-
|
|
5725
|
+
* Makes the rows expandable: a first column holds a chevron button per row (`aria-expanded`,
|
|
5726
|
+
* `aria-controls` the detail row while it is open, named "Show details for <row key>"), and the
|
|
5727
|
+
* content this returns is drawn in a row below it that spans every column. Opening a row never
|
|
5728
|
+
* selects it nor counts as a click on it. Not combined with `virtualize`: the rows of a
|
|
5729
|
+
* virtualized table have one fixed height, so nothing expands there (the prop is ignored).
|
|
5730
|
+
* With `mobileLayout="cards"` below `sm` the chevron sits on the card's title line and the
|
|
5731
|
+
* content opens inside the card, under its fields.
|
|
5732
|
+
*/
|
|
5733
|
+
renderExpandedRow?: (row: T) => ReactNode;
|
|
5734
|
+
/**
|
|
5735
|
+
* The keys (`rowKey`) of the open rows, when controlled. A controlled table shows a toggle once
|
|
5736
|
+
* the host passes the new set back through `onExpandedRowsChange`.
|
|
5737
|
+
*/
|
|
5738
|
+
expandedRows?: Set<string | number>;
|
|
5739
|
+
defaultExpandedRows?: Set<string | number>;
|
|
5740
|
+
/** Called with the set of open row keys after a row is toggled, in both modes. */
|
|
5741
|
+
onExpandedRowsChange?: (expanded: Set<string | number>) => void;
|
|
5742
|
+
/**
|
|
5743
|
+
* How an editable cell (a column with `edit`) opens its editor. Only one cell, or one row, edits
|
|
5744
|
+
* at a time. Not combined with `virtualize` (its fixed-height cells would clip an editor and its
|
|
5745
|
+
* error) nor with the cards of `mobileLayout="cards"`: the prop is ignored there.
|
|
5746
|
+
* - `'cell'` (default): the cell's content is a button that fills it; a click, Enter or F2 on it
|
|
5747
|
+
* opens the editor in place, focused. Enter or blur saves, Escape cancels and puts the focus
|
|
5748
|
+
* back on the cell's button.
|
|
5749
|
+
* - `'button'`: a pencil button in each editable cell, shown on the hovered or focused row and
|
|
5750
|
+
* always on a screen with no hover, opens the editor, which has Save and Cancel buttons too.
|
|
5751
|
+
* Keys and blur as in `'cell'`.
|
|
5752
|
+
* - `'row'`: an Edit button in the row's action column turns every editable cell of the row into
|
|
5753
|
+
* its field, with Cancel and Save in their place. Save (or Enter in a field) calls
|
|
5754
|
+
* `onRowEdit` once with the cells that changed; Escape or Cancel drops the changes.
|
|
5755
|
+
*/
|
|
5756
|
+
editTrigger?: 'cell' | 'button' | 'row';
|
|
5757
|
+
/**
|
|
5758
|
+
* Saves one cell, with `editTrigger` `'cell'` or `'button'`: the row, the column `key` and the
|
|
5759
|
+
* draft string (parse it yourself). Not called when the draft did not change. Without it those
|
|
5760
|
+
* cells are not editable. Return a promise to show the save: the cell is `aria-busy` with a
|
|
5761
|
+
* spinner until it settles, then the editor closes. If it rejects (or throws), the editor opens
|
|
5762
|
+
* again with the value the user typed, and the error's message shows under the cell, tied to the
|
|
5763
|
+
* field by `aria-describedby`. The table never changes `rows`: update them from here.
|
|
5764
|
+
*/
|
|
5765
|
+
onCellEdit?: (row: T, columnKey: string, value: string) => void | PromiseLike<unknown>;
|
|
5766
|
+
/**
|
|
5767
|
+
* Saves a row, with `editTrigger="row"`: the row and its changes, column `key` → draft string,
|
|
5768
|
+
* for the cells that changed only (not called when none did). Without it the Edit button is not
|
|
5769
|
+
* shown. Return a promise to show the save: the row's Save button spins and the fields are
|
|
5770
|
+
* disabled until it settles. If it rejects (or throws) the fields stay open with what was typed,
|
|
5771
|
+
* and the error's message shows in a row under the row.
|
|
5772
|
+
*/
|
|
5773
|
+
onRowEdit?: (row: T, changes: Record<string, string>) => void | PromiseLike<unknown>;
|
|
5056
5774
|
/** Show a checkbox column and enable row selection. */
|
|
5057
5775
|
selectable?: boolean;
|
|
5058
5776
|
/** Controlled selection set (row keys). */
|
|
5059
5777
|
selection?: Set<string | number>;
|
|
5060
5778
|
defaultSelection?: Set<string | number>;
|
|
5061
5779
|
onSelectionChange?: (selection: Set<string | number>) => void;
|
|
5062
|
-
/**
|
|
5780
|
+
/**
|
|
5781
|
+
* Nodes shown in the selection bar while rows are selected, after `bulkActionItems`. Receives
|
|
5782
|
+
* the selected rows. They stay as given at every width: use `bulkActionItems` for actions that
|
|
5783
|
+
* fold into a menu when the bar runs out of room.
|
|
5784
|
+
*/
|
|
5063
5785
|
bulkActions?: (selectedRows: T[]) => ReactNode;
|
|
5786
|
+
/**
|
|
5787
|
+
* The bulk actions as data, for a bar that adapts: the first is a button and, when the bar is
|
|
5788
|
+
* narrower than 1152px, the others fold into an "Actions" menu; with `mobileLayout="cards"` on a
|
|
5789
|
+
* phone each is an icon button named by its `label`. While rows are selected the bar holds the
|
|
5790
|
+
* count, "Clear" and these actions on the start side, and the search and the toolbar on the end
|
|
5791
|
+
* side; the toolbar buttons go icon-only and the search narrows below 1360px, and under 640px the
|
|
5792
|
+
* bar wraps to two lines. Shown before the nodes of `bulkActions`, which keeps working.
|
|
5793
|
+
*/
|
|
5794
|
+
bulkActionItems?: DataTableBulkAction<T>[];
|
|
5064
5795
|
/** Controlled search value. When provided, the search input is shown. */
|
|
5065
5796
|
searchValue?: string;
|
|
5066
5797
|
defaultSearchValue?: string;
|
|
@@ -5112,13 +5843,13 @@ type DataTableProps<T> = {
|
|
|
5112
5843
|
* assistive technology where the window is, and the row that holds the keyboard focus stays
|
|
5113
5844
|
* drawn while it is scrolled out of view, so focus and selection survive scrolling.
|
|
5114
5845
|
*
|
|
5115
|
-
* Every row has one fixed height, set by
|
|
5846
|
+
* Every row has one fixed height, set by the density (41px `compact`, 49px, or 61px `comfortable`, at the
|
|
5116
5847
|
* default text size, and growing with the text size setting): content taller than that is
|
|
5117
5848
|
* clipped, so keep each cell to the one line of text (or a control) it has in a standard row.
|
|
5118
5849
|
* The rows scroll in the table's own area:
|
|
5119
5850
|
* give it a height (`className="max-h-96"`), or the window has no end. Table layout only: with
|
|
5120
|
-
* `mobileLayout="cards"` below `sm` the cards keep the pagination. Not for expandable rows
|
|
5121
|
-
* paper only the drawn rows print. Default `false`.
|
|
5851
|
+
* `mobileLayout="cards"` below `sm` the cards keep the pagination. Not for expandable rows nor
|
|
5852
|
+
* inline editing: both are off with it. On paper only the drawn rows print. Default `false`.
|
|
5122
5853
|
*/
|
|
5123
5854
|
virtualize?: boolean;
|
|
5124
5855
|
/**
|
|
@@ -5169,7 +5900,8 @@ type DataTableProps<T> = {
|
|
|
5169
5900
|
* Shows an "Export" button in the toolbar, before the "Columns" one; the toolbar then shows even
|
|
5170
5901
|
* without a search field. It downloads a CSV of every page of the rows that the search, the
|
|
5171
5902
|
* filters and the sort keep, in the visible columns and their order (the selection and action
|
|
5172
|
-
* columns are not data).
|
|
5903
|
+
* columns are not data). While rows are selected it follows the selection: the button says
|
|
5904
|
+
* "Export 3" and downloads those rows alone, in the table's sort order. With `manual` it holds the loaded rows only, one page: pass `onExport`
|
|
5173
5905
|
* to export on the server. A column's header is its `label` when that is a string or a number,
|
|
5174
5906
|
* else its `mobileLabel` when that is a string, else its `key`; its cells come from `exportValue`
|
|
5175
5907
|
* (see `ColumnDef`, and `toCsv` for the format). The file is UTF-8 with a byte order mark, so
|
|
@@ -5180,7 +5912,8 @@ type DataTableProps<T> = {
|
|
|
5180
5912
|
exportFileName?: string;
|
|
5181
5913
|
/**
|
|
5182
5914
|
* Makes the Export button call this with what the table shows (search, filters, sort, visible
|
|
5183
|
-
* column keys) and build no file: for a host that
|
|
5915
|
+
* column keys, and the selected keys while rows are selected) and build no file: for a host that
|
|
5916
|
+
* exports on the server.
|
|
5184
5917
|
*/
|
|
5185
5918
|
onExport?: (query: DataTableExportQuery) => void;
|
|
5186
5919
|
/**
|
|
@@ -5206,8 +5939,11 @@ type DataTableProps<T> = {
|
|
|
5206
5939
|
* sideways. `cards` swaps it for a list of blocks: the selection checkbox, the `mobile: 'title'`
|
|
5207
5940
|
* column and the row action on the first line, then one label/value pair per remaining column
|
|
5208
5941
|
* (`mobileLabel`, else the column header; `mobile: 'hidden'` leaves a column out). The toolbar
|
|
5209
|
-
* gets a second line with a "
|
|
5210
|
-
*
|
|
5942
|
+
* gets a second line with a "Filters" button (when a column is filterable), a "Sort by" select
|
|
5943
|
+
* for the sortable columns and the columns button. "Filters" shows how many values are filtered
|
|
5944
|
+
* and opens a bottom sheet with each filterable column's filter, "Clear all" and "Show n rows";
|
|
5945
|
+
* it sets the same `filters` as the column headers do, controlled or not. From `sm` up the table
|
|
5946
|
+
* is the same either way.
|
|
5211
5947
|
*/
|
|
5212
5948
|
mobileLayout?: 'scroll' | 'cards';
|
|
5213
5949
|
};
|
|
@@ -5220,7 +5956,7 @@ type DataTableProps<T> = {
|
|
|
5220
5956
|
* the keyboard focus, so the arrow keys scroll it even when no cell holds a
|
|
5221
5957
|
* control.
|
|
5222
5958
|
*/
|
|
5223
|
-
declare const DataTable: <T>({ rows, columns: allColumns, rowKey, onRowClick, rowHref, renderRowAction, pageSize: pageSizeProp, manual, rowCount, virtualize, loading, loadingRows, error, onRetry, emptyTitle, emptyDescription, density: densityProp, defaultDensity, onDensityChange,
|
|
5959
|
+
declare const DataTable: <T>({ rows, columns: allColumns, rowKey, onRowClick, rowHref, renderRowAction, pageSize: pageSizeProp, manual, rowCount, virtualize, loading, loadingRows, error, onRetry, emptyTitle, emptyDescription, emptyAction, density: densityProp, defaultDensity, onDensityChange, editTrigger, onCellEdit, onRowEdit, renderExpandedRow, expandedRows: expandedRowsProp, defaultExpandedRows, onExpandedRowsChange, selectable, selection: selectionProp, defaultSelection, onSelectionChange, bulkActions, bulkActionItems, searchValue: searchValueProp, defaultSearchValue, onSearchChange, searchPlaceholder, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className, filters: filtersProp, defaultFilters, onFiltersChange, filterTabs, sort: sortProp, defaultSort, onSortChange, page: pageProp, defaultPage, onPageChange, defaultPageSize, onPageSizeChange, pageSizeOptions, columnsMenu, exportable, exportFileName, onExport, views: viewsProp, defaultViews, onViewsChange, activeView: activeViewProp, defaultActiveView, onActiveViewChange, columnVisibility: columnVisibilityProp, defaultColumnVisibility, onColumnVisibilityChange, mobileLayout, }: DataTableProps<T>) => react.JSX.Element;
|
|
5224
5960
|
|
|
5225
5961
|
/**
|
|
5226
5962
|
* The CSV text of `rows` in `columns`: a header row, then one record per row, every record ended
|
|
@@ -5239,15 +5975,16 @@ declare const DataTable: <T>({ rows, columns: allColumns, rowKey, onRowClick, ro
|
|
|
5239
5975
|
declare const toCsv: <T>(rows: T[], columns: ColumnDef<T>[]) => string;
|
|
5240
5976
|
|
|
5241
5977
|
type CellAlignProps = {
|
|
5242
|
-
/** Text alignment. Default `
|
|
5243
|
-
align?: '
|
|
5244
|
-
/** Numbers:
|
|
5978
|
+
/** Text alignment. Default `start`, or `end` when `numeric` is set. */
|
|
5979
|
+
align?: 'start' | 'center' | 'end';
|
|
5980
|
+
/** Numbers: aligned to the end, with tabular figures so the digits line up. */
|
|
5245
5981
|
numeric?: boolean;
|
|
5246
5982
|
};
|
|
5247
5983
|
type TableProps = ComponentProps<'table'> & {
|
|
5248
5984
|
/**
|
|
5249
|
-
* Row height, shared with `DataTable`.
|
|
5250
|
-
* `
|
|
5985
|
+
* Row height, shared with `DataTable`. Without it the table follows the page's
|
|
5986
|
+
* `data-density`. `default` keeps the standard rows whatever the page says, `compact` pads the
|
|
5987
|
+
* cells less, `comfortable` more, for rows with two lines of content.
|
|
5251
5988
|
*/
|
|
5252
5989
|
density?: DataTableDensity;
|
|
5253
5990
|
/** Shade every other body row. */
|
|
@@ -5293,14 +6030,14 @@ declare const TableFoot: ({ className, ...rest }: TableFootProps) => react.JSX.E
|
|
|
5293
6030
|
type TableRowProps = ComponentProps<'tr'>;
|
|
5294
6031
|
/** TableRow — a `<tr>`; body rows highlight on hover. */
|
|
5295
6032
|
declare const TableRow: ({ className, ...rest }: TableRowProps) => react.JSX.Element;
|
|
5296
|
-
type TableHeaderCellProps = ComponentProps<'th'> & CellAlignProps;
|
|
6033
|
+
type TableHeaderCellProps = Omit<ComponentProps<'th'>, 'align'> & CellAlignProps;
|
|
5297
6034
|
/**
|
|
5298
6035
|
* TableHeaderCell — a `<th>`. `scope` defaults to `col` in `TableHead` and to
|
|
5299
6036
|
* `row` in `TableBody` and `TableFoot`; pass `colgroup` or `rowgroup` for a
|
|
5300
6037
|
* header that spans a group.
|
|
5301
6038
|
*/
|
|
5302
6039
|
declare const TableHeaderCell: ({ align, numeric, scope, className, ...rest }: TableHeaderCellProps) => react.JSX.Element;
|
|
5303
|
-
type TableCellProps = ComponentProps<'td'> & CellAlignProps;
|
|
6040
|
+
type TableCellProps = Omit<ComponentProps<'td'>, 'align'> & CellAlignProps;
|
|
5304
6041
|
/** TableCell — a `<td>`, padded to the table's `density`. */
|
|
5305
6042
|
declare const TableCell: ({ align, numeric, className, ...rest }: TableCellProps) => react.JSX.Element;
|
|
5306
6043
|
type TableSkeletonRowsProps = {
|
|
@@ -5320,7 +6057,7 @@ declare const TableSkeletonRows: ({ rows, columns, numericColumns, }: TableSkele
|
|
|
5320
6057
|
|
|
5321
6058
|
type ColumnHeaderProps = {
|
|
5322
6059
|
label: ReactNode;
|
|
5323
|
-
align?: '
|
|
6060
|
+
align?: 'start' | 'end' | 'center';
|
|
5324
6061
|
sortable?: boolean;
|
|
5325
6062
|
filterable?: boolean;
|
|
5326
6063
|
/** Current sort direction for this column, or null if not active. */
|
|
@@ -5331,11 +6068,13 @@ type ColumnHeaderProps = {
|
|
|
5331
6068
|
filterSelected?: Set<string>;
|
|
5332
6069
|
onFilterToggle?: (v: string) => void;
|
|
5333
6070
|
onFilterClear?: () => void;
|
|
5334
|
-
/** Cell padding, matching the `density` of the table it heads. Default
|
|
6071
|
+
/** Cell padding, matching the `density` of the table it heads. Default: the page's. */
|
|
5335
6072
|
density?: DataTableDensity;
|
|
5336
6073
|
className?: string;
|
|
6074
|
+
/** Inline style of the header cell (a pinned column's offset). */
|
|
6075
|
+
style?: CSSProperties;
|
|
5337
6076
|
};
|
|
5338
|
-
declare const ColumnHeader: ({ label, align, sortable, filterable, sortDir, onSortToggle, filterValues, filterSelected, onFilterToggle, onFilterClear, density, className, }: ColumnHeaderProps) => react.JSX.Element;
|
|
6077
|
+
declare const ColumnHeader: ({ label, align, sortable, filterable, sortDir, onSortToggle, filterValues, filterSelected, onFilterToggle, onFilterClear, density, className, style, }: ColumnHeaderProps) => react.JSX.Element;
|
|
5339
6078
|
|
|
5340
6079
|
type ColumnFilterDropdownProps = {
|
|
5341
6080
|
values: string[];
|
|
@@ -5374,8 +6113,8 @@ declare const ActiveFiltersBar: ({ filters, onClearOne, onClearAll, className, }
|
|
|
5374
6113
|
type RowActionsMenuProps = {
|
|
5375
6114
|
/** Name of the trigger. Name the row too ("Actions for node-100"): there is one per row. */
|
|
5376
6115
|
'aria-label'?: string;
|
|
5377
|
-
/** Edge of the trigger the menu lines up with. Default `
|
|
5378
|
-
align?: '
|
|
6116
|
+
/** Edge of the trigger the menu lines up with. Default `end`: the column is the table's last. */
|
|
6117
|
+
align?: 'start' | 'end';
|
|
5379
6118
|
/** Tailwind width class of the menu. Default `w-48`. */
|
|
5380
6119
|
width?: string;
|
|
5381
6120
|
open?: boolean;
|
|
@@ -5441,7 +6180,7 @@ type TableAmountCellProps = {
|
|
|
5441
6180
|
/**
|
|
5442
6181
|
* TableAmountCell — a signed amount tinted by its sign: green for a gain, red for a loss, plain
|
|
5443
6182
|
* for zero. The sign is written too, so the colour is never the only cue. Put it in a numeric
|
|
5444
|
-
* column (`align="
|
|
6183
|
+
* column (`align="end"`, or `numeric` on `TableCell`).
|
|
5445
6184
|
*/
|
|
5446
6185
|
declare const TableAmountCell: ({ value, currency, locale, format }: TableAmountCellProps) => react.JSX.Element;
|
|
5447
6186
|
|
|
@@ -5817,6 +6556,15 @@ type CosmosAccent = 'blue' | 'indigo' | 'violet' | 'purple' | 'rose' | 'teal' |
|
|
|
5817
6556
|
type CosmosFont = 'outfit' | 'inter' | 'plex' | 'montserrat' | 'open-sans' | 'system';
|
|
5818
6557
|
/** A Cosmos text size: the `data-text-size` attribute on `<html>`, none for `md`. */
|
|
5819
6558
|
type CosmosTextSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
6559
|
+
/** A Cosmos density: the `data-density` attribute on `<html>`, none for `default`. */
|
|
6560
|
+
type CosmosDensity = 'compact' | 'default' | 'comfortable';
|
|
6561
|
+
/**
|
|
6562
|
+
* A Cosmos corner radius: the `data-radius` attribute on `<html>`, none for `default`.
|
|
6563
|
+
* `none` squares every corner to 2px, `sm` halves them, `lg` takes them one and a half times.
|
|
6564
|
+
*/
|
|
6565
|
+
type CosmosRadius = 'none' | 'sm' | 'default' | 'lg';
|
|
6566
|
+
/** The reading direction of the page. */
|
|
6567
|
+
type CosmosDirection = 'ltr' | 'rtl';
|
|
5820
6568
|
type CosmosThemeMeta = PaletteMeta & {
|
|
5821
6569
|
id: CosmosTheme;
|
|
5822
6570
|
dark: boolean;
|
|
@@ -5840,9 +6588,17 @@ type CosmosTextSizeMeta = {
|
|
|
5840
6588
|
label: string;
|
|
5841
6589
|
scale: number;
|
|
5842
6590
|
};
|
|
6591
|
+
type CosmosDensityMeta = {
|
|
6592
|
+
id: CosmosDensity;
|
|
6593
|
+
label: string;
|
|
6594
|
+
};
|
|
6595
|
+
type CosmosRadiusMeta = {
|
|
6596
|
+
id: CosmosRadius;
|
|
6597
|
+
label: string;
|
|
6598
|
+
};
|
|
5843
6599
|
/**
|
|
5844
|
-
* The page's appearance. `font`
|
|
5845
|
-
* and `applyAppearance` doesn't touch their attributes.
|
|
6600
|
+
* The page's appearance. `font`, `textSize`, `density`, `radius` and `direction`
|
|
6601
|
+
* are optional: leave them out and `applyAppearance` doesn't touch their attributes.
|
|
5846
6602
|
*/
|
|
5847
6603
|
type CosmosAppearance = {
|
|
5848
6604
|
/** `system` follows `prefers-color-scheme`: see `systemThemes`. */
|
|
@@ -5852,6 +6608,10 @@ type CosmosAppearance = {
|
|
|
5852
6608
|
accent: CosmosAccent;
|
|
5853
6609
|
font?: CosmosFont;
|
|
5854
6610
|
textSize?: CosmosTextSize;
|
|
6611
|
+
density?: CosmosDensity;
|
|
6612
|
+
radius?: CosmosRadius;
|
|
6613
|
+
/** The reading direction: the `dir` attribute on `<html>`, none for `ltr`. */
|
|
6614
|
+
direction?: CosmosDirection;
|
|
5855
6615
|
};
|
|
5856
6616
|
/** The four themes shipped by `@sckyzo/cosmos-theme`, ready for `<PalettePicker>`. */
|
|
5857
6617
|
declare const COSMOS_THEMES: CosmosThemeMeta[];
|
|
@@ -5875,6 +6635,17 @@ declare const COSMOS_ACCENTS: CosmosAccentMeta[];
|
|
|
5875
6635
|
declare const COSMOS_FONTS: CosmosFontMeta[];
|
|
5876
6636
|
/** The four text sizes of `@sckyzo/cosmos-theme`, smallest first. */
|
|
5877
6637
|
declare const COSMOS_TEXT_SIZES: CosmosTextSizeMeta[];
|
|
6638
|
+
/**
|
|
6639
|
+
* The three densities of `@sckyzo/cosmos-theme`, tightest first. They move the
|
|
6640
|
+
* height of controls and the vertical padding of rows, nothing else.
|
|
6641
|
+
*/
|
|
6642
|
+
declare const COSMOS_DENSITIES: CosmosDensityMeta[];
|
|
6643
|
+
/**
|
|
6644
|
+
* The four corner radii of `@sckyzo/cosmos-theme`, sharpest first. They rescale
|
|
6645
|
+
* Tailwind's `--radius-*` tokens (`rounded-sm` to `rounded-4xl`); `rounded-full`
|
|
6646
|
+
* never moves.
|
|
6647
|
+
*/
|
|
6648
|
+
declare const COSMOS_RADII: CosmosRadiusMeta[];
|
|
5878
6649
|
/** `true` for the themes that enable Tailwind's `dark:` variant. */
|
|
5879
6650
|
declare const isDarkTheme: (theme: CosmosTheme) => boolean;
|
|
5880
6651
|
/** Whether the device asks for a dark color scheme. `false` during SSR or without `matchMedia`. */
|
|
@@ -5892,13 +6663,14 @@ declare const resolveTheme: (choice: CosmosThemeChoice, prefersDark: boolean, sy
|
|
|
5892
6663
|
declare const watchSystemTheme: (onChange: (prefersDark: boolean) => void) => (() => void);
|
|
5893
6664
|
/**
|
|
5894
6665
|
* Apply an appearance to `root` (default `<html>`): swaps the theme class and
|
|
5895
|
-
* sets `data-accent`, `data-font
|
|
5896
|
-
*
|
|
5897
|
-
*
|
|
5898
|
-
*
|
|
5899
|
-
*
|
|
6666
|
+
* sets `data-accent`, `data-font`, `data-text-size`, `data-density` and
|
|
6667
|
+
* `data-radius`, and `dir="rtl"` for a `direction` of `rtl`, removing each one
|
|
6668
|
+
* for its default (blue, Outfit, `md`, `default`, `default`, `ltr`). A `system`
|
|
6669
|
+
* theme is resolved with `prefers-color-scheme` when applied: call this again
|
|
6670
|
+
* on `watchSystemTheme`. A `font`, `textSize`, `density`, `radius` or `direction`
|
|
6671
|
+
* left out keeps its attribute as it is. No-op during SSR.
|
|
5900
6672
|
*/
|
|
5901
|
-
declare const applyAppearance: ({ theme: choice, systemThemes, accent, font, textSize }: CosmosAppearance, root?: HTMLElement) => void;
|
|
6673
|
+
declare const applyAppearance: ({ theme: choice, systemThemes, accent, font, textSize, density, radius, direction, }: CosmosAppearance, root?: HTMLElement) => void;
|
|
5902
6674
|
|
|
5903
6675
|
type AppearanceSettingsProps<T extends CosmosThemeChoice = CosmosTheme> = {
|
|
5904
6676
|
/** Selected theme (`'system'` when `themes` offers it: then type the state as `CosmosThemeChoice`). */
|
|
@@ -5928,10 +6700,16 @@ type AppearanceSettingsProps<T extends CosmosThemeChoice = CosmosTheme> = {
|
|
|
5928
6700
|
textSize?: CosmosTextSize;
|
|
5929
6701
|
/** Shows the text size group. */
|
|
5930
6702
|
onTextSizeChange?: (textSize: CosmosTextSize) => void;
|
|
6703
|
+
/** Selected density. Default `'default'`. */
|
|
6704
|
+
density?: CosmosDensity;
|
|
6705
|
+
/** Shows the density group. */
|
|
6706
|
+
onDensityChange?: (density: CosmosDensity) => void;
|
|
5931
6707
|
/** Heading of the font group. Default `'Font'`. */
|
|
5932
6708
|
fontLabel?: string;
|
|
5933
6709
|
/** Heading of the text size group. Default `'Text size'`. */
|
|
5934
6710
|
textSizeLabel?: string;
|
|
6711
|
+
/** Heading of the density group. Default `'Density'`. */
|
|
6712
|
+
densityLabel?: string;
|
|
5935
6713
|
/**
|
|
5936
6714
|
* Fonts to offer. Default: all of `COSMOS_FONTS`. Offer only the fonts whose
|
|
5937
6715
|
* CSS the app imports (`@sckyzo/cosmos-theme/fonts/<id>`).
|
|
@@ -5939,6 +6717,8 @@ type AppearanceSettingsProps<T extends CosmosThemeChoice = CosmosTheme> = {
|
|
|
5939
6717
|
fonts?: CosmosFontMeta[];
|
|
5940
6718
|
/** Text sizes to offer. Default: all of `COSMOS_TEXT_SIZES`. */
|
|
5941
6719
|
textSizes?: CosmosTextSizeMeta[];
|
|
6720
|
+
/** Densities to offer. Default: all of `COSMOS_DENSITIES`. */
|
|
6721
|
+
densities?: CosmosDensityMeta[];
|
|
5942
6722
|
/**
|
|
5943
6723
|
* Pin each group's heading to the top of the scrolling ancestor while its group is in view.
|
|
5944
6724
|
* For a panel that scrolls (`AppearanceMenu` sets it): the headings paint the `Popover` surface
|
|
@@ -5950,11 +6730,11 @@ type AppearanceSettingsProps<T extends CosmosThemeChoice = CosmosTheme> = {
|
|
|
5950
6730
|
};
|
|
5951
6731
|
/**
|
|
5952
6732
|
* AppearanceSettings — theme and accent pickers for the Cosmos themes, built
|
|
5953
|
-
* on `<PalettePicker>` and `<AccentPicker>`, plus font
|
|
5954
|
-
* when their `on…Change` handlers are set. Controlled: pass the result to
|
|
6733
|
+
* on `<PalettePicker>` and `<AccentPicker>`, plus font, text size and density
|
|
6734
|
+
* pickers when their `on…Change` handlers are set. Controlled: pass the result to
|
|
5955
6735
|
* `applyAppearance` (or your own theme switcher) to update the page.
|
|
5956
6736
|
*/
|
|
5957
|
-
declare const AppearanceSettings: <T extends CosmosThemeChoice = CosmosTheme>({ theme, accent, onThemeChange, onAccentChange, themeLabel, accentLabel, themes, accents, themeColumns, font, onFontChange, textSize, onTextSizeChange, fontLabel, textSizeLabel, fonts, textSizes, stickyHeadings, className, }: AppearanceSettingsProps<T>) => react.JSX.Element;
|
|
6737
|
+
declare const AppearanceSettings: <T extends CosmosThemeChoice = CosmosTheme>({ theme, accent, onThemeChange, onAccentChange, themeLabel, accentLabel, themes, accents, themeColumns, font, onFontChange, textSize, onTextSizeChange, density, onDensityChange, fontLabel, textSizeLabel, densityLabel, fonts, textSizes, densities, stickyHeadings, className, }: AppearanceSettingsProps<T>) => react.JSX.Element;
|
|
5958
6738
|
|
|
5959
6739
|
type AppearanceMenuSize = 'sm' | 'md';
|
|
5960
6740
|
type AppearanceMenuProps<T extends CosmosThemeChoice = CosmosTheme> = Omit<AppearanceSettingsProps<T>, 'className' | 'stickyHeadings'> & {
|
|
@@ -5964,7 +6744,7 @@ type AppearanceMenuProps<T extends CosmosThemeChoice = CosmosTheme> = Omit<Appea
|
|
|
5964
6744
|
size?: AppearanceMenuSize;
|
|
5965
6745
|
/**
|
|
5966
6746
|
* Adds a "Reset" button under the groups, always in view. Called with no argument: put the
|
|
5967
|
-
* theme, accent, font
|
|
6747
|
+
* theme, accent, font, text size and density back to the app's defaults. The panel stays open.
|
|
5968
6748
|
*/
|
|
5969
6749
|
onReset?: () => void;
|
|
5970
6750
|
/** Class for the trigger button. */
|
|
@@ -5972,22 +6752,131 @@ type AppearanceMenuProps<T extends CosmosThemeChoice = CosmosTheme> = Omit<Appea
|
|
|
5972
6752
|
};
|
|
5973
6753
|
/**
|
|
5974
6754
|
* AppearanceMenu — icon button for a top bar that opens `<AppearanceSettings>`
|
|
5975
|
-
* in a panel flush with its
|
|
6755
|
+
* in a panel flush with its end edge. Controlled like AppearanceSettings:
|
|
5976
6756
|
* apply the choice in the callbacks (for example with `applyAppearance`). The
|
|
5977
6757
|
* panel stays open while the user tries combinations; Escape, a click
|
|
5978
6758
|
* outside or the button close it.
|
|
5979
6759
|
*/
|
|
5980
6760
|
declare const AppearanceMenu: <T extends CosmosThemeChoice = CosmosTheme>({ label, size, onReset, className, ...settings }: AppearanceMenuProps<T>) => react.JSX.Element;
|
|
5981
6761
|
|
|
6762
|
+
/** The shell's navigation: a sidebar down the side, or a navbar across the top. */
|
|
6763
|
+
type CustomizerLayout = 'vertical' | 'horizontal';
|
|
6764
|
+
/**
|
|
6765
|
+
* The sidebar's mode: `expanded`, `collapsed` to its icons, `hover` (collapsed, opens while the
|
|
6766
|
+
* pointer rests on it) or `compact` (icons over small labels).
|
|
6767
|
+
*/
|
|
6768
|
+
type CustomizerSidebar = 'expanded' | 'collapsed' | 'hover' | 'compact';
|
|
6769
|
+
/**
|
|
6770
|
+
* What the Customizer holds: the page's appearance (what `applyAppearance` takes) plus the three
|
|
6771
|
+
* choices about the shell. Every field is optional but the theme and the accent; a missing one
|
|
6772
|
+
* shows as its Cosmos default.
|
|
6773
|
+
*/
|
|
6774
|
+
type CustomizerValue = CosmosAppearance & {
|
|
6775
|
+
layout?: CustomizerLayout;
|
|
6776
|
+
sidebar?: CustomizerSidebar;
|
|
6777
|
+
container?: ShellContainer;
|
|
6778
|
+
};
|
|
6779
|
+
/** A section of the panel, in the order the panel lists them. */
|
|
6780
|
+
type CustomizerSection = 'presets' | 'theme' | 'accent' | 'font' | 'textSize' | 'density' | 'radius' | 'direction' | 'layout' | 'sidebar' | 'container';
|
|
6781
|
+
/** A named value the host offers as a one-click starting point. */
|
|
6782
|
+
type CustomizerPreset = {
|
|
6783
|
+
id: string;
|
|
6784
|
+
label: string;
|
|
6785
|
+
/** The fields it sets; the others keep the current value. */
|
|
6786
|
+
value: Partial<CustomizerValue>;
|
|
6787
|
+
};
|
|
6788
|
+
/** Every section of the panel, in order: the default of `sections`. */
|
|
6789
|
+
declare const CUSTOMIZER_SECTIONS: CustomizerSection[];
|
|
6790
|
+
/** The Cosmos defaults: the default of `defaultValue`, and what a missing field shows as. */
|
|
6791
|
+
declare const CUSTOMIZER_DEFAULT_VALUE: {
|
|
6792
|
+
theme: "light";
|
|
6793
|
+
accent: "blue";
|
|
6794
|
+
font: "outfit";
|
|
6795
|
+
textSize: "md";
|
|
6796
|
+
density: "default";
|
|
6797
|
+
radius: "default";
|
|
6798
|
+
direction: "ltr";
|
|
6799
|
+
layout: "vertical";
|
|
6800
|
+
sidebar: "expanded";
|
|
6801
|
+
container: "fluid";
|
|
6802
|
+
};
|
|
6803
|
+
type CustomizerProps = {
|
|
6804
|
+
/** Whether the panel is open. The host owns it, as for a `Drawer`. */
|
|
6805
|
+
open: boolean;
|
|
6806
|
+
/** Called by the close button, the backdrop and Escape. */
|
|
6807
|
+
onClose: () => void;
|
|
6808
|
+
/** The current choices. */
|
|
6809
|
+
value: CustomizerValue;
|
|
6810
|
+
/**
|
|
6811
|
+
* Called with the whole new value as soon as an option is picked (on click, never on hover),
|
|
6812
|
+
* a preset is applied, or Reset is pressed. The Customizer applies nothing itself: see above.
|
|
6813
|
+
*/
|
|
6814
|
+
onChange: (next: CustomizerValue) => void;
|
|
6815
|
+
/** What Reset restores. Default `CUSTOMIZER_DEFAULT_VALUE`. */
|
|
6816
|
+
defaultValue?: CustomizerValue;
|
|
6817
|
+
/**
|
|
6818
|
+
* Starting points. The Presets section shows only when this is not empty; Cosmos ships none.
|
|
6819
|
+
* The preset whose fields all equal the current value shows as selected.
|
|
6820
|
+
*/
|
|
6821
|
+
presets?: CustomizerPreset[];
|
|
6822
|
+
/**
|
|
6823
|
+
* The sections to show. A host hides one by leaving it out (a fixed layout: no `layout`,
|
|
6824
|
+
* `sidebar` or `container`). They always appear in the panel's order, whatever the order here.
|
|
6825
|
+
* Default `CUSTOMIZER_SECTIONS`.
|
|
6826
|
+
*/
|
|
6827
|
+
sections?: CustomizerSection[];
|
|
6828
|
+
/** Themes to offer. Default: all of `COSMOS_THEMES`. Add `COSMOS_SYSTEM_THEME` for "System". */
|
|
6829
|
+
themes?: (CosmosThemeMeta | CosmosSystemThemeMeta)[];
|
|
6830
|
+
/** Accents to offer. Default: all of `COSMOS_ACCENTS`. */
|
|
6831
|
+
accents?: CosmosAccentMeta[];
|
|
6832
|
+
/** Fonts to offer. Default: all of `COSMOS_FONTS`; offer only those whose CSS the app imports. */
|
|
6833
|
+
fonts?: CosmosFontMeta[];
|
|
6834
|
+
/** Text sizes to offer. Default: all of `COSMOS_TEXT_SIZES`. */
|
|
6835
|
+
textSizes?: CosmosTextSizeMeta[];
|
|
6836
|
+
/** Densities to offer. Default: all of `COSMOS_DENSITIES`. */
|
|
6837
|
+
densities?: CosmosDensityMeta[];
|
|
6838
|
+
/** Corner radii to offer. Default: all of `COSMOS_RADII`. */
|
|
6839
|
+
radii?: CosmosRadiusMeta[];
|
|
6840
|
+
/** Headings of the sections, by section. Default: English names ("Accent color", "Text size"…). */
|
|
6841
|
+
labels?: Partial<Record<CustomizerSection, string>>;
|
|
6842
|
+
/** Title of the panel. Default `'Customize'`. */
|
|
6843
|
+
title?: string;
|
|
6844
|
+
/** Line under the title. Default `'Changes apply at once.'`. */
|
|
6845
|
+
subtitle?: string;
|
|
6846
|
+
/** Width of the panel. Default `lg`. */
|
|
6847
|
+
size?: DrawerSize;
|
|
6848
|
+
};
|
|
6849
|
+
/**
|
|
6850
|
+
* Customizer — a panel on the end side where a user shapes the app: theme, accent, font, text
|
|
6851
|
+
* size, density, corner radius, direction, and the shell's layout, sidebar mode and container, with optional
|
|
6852
|
+
* presets, a Reset and a "Copy config" that puts the value on the clipboard as JSON. Built on
|
|
6853
|
+
* `Drawer`, `PalettePicker`, `AccentPicker` and `OptionPicker`.
|
|
6854
|
+
*
|
|
6855
|
+
* It only holds the choice, and applies nothing: it is controlled (`value`, `onChange`) and the
|
|
6856
|
+
* host does the rest, on every change:
|
|
6857
|
+
*
|
|
6858
|
+
* - `applyAppearance(value)` sets the theme, accent, font, text size, density, radius
|
|
6859
|
+
* (`data-radius`) and direction (`dir`) on `<html>`;
|
|
6860
|
+
* - `value.container` is `Shell`'s `container`;
|
|
6861
|
+
* - `value.sidebar` drives `Shell` and `Sidebar`: `collapsed` is `Shell`'s `sidebarCollapsed`,
|
|
6862
|
+
* `hover` is collapsed plus `expandOnHover="overlay"`, `compact` is `Sidebar`'s
|
|
6863
|
+
* `variant="compact"`, `expanded` is none of those;
|
|
6864
|
+
* - `value.layout` `horizontal` puts a `Navbar` in `Shell`'s `topbar` in place of the `Sidebar`.
|
|
6865
|
+
*
|
|
6866
|
+
* Keep the Customizer outside what `layout` swaps, so the panel keeps its focus as the shell
|
|
6867
|
+
* re-renders. Saving the value (local storage, a user profile) is the host's too.
|
|
6868
|
+
*/
|
|
6869
|
+
declare const Customizer: ({ open, onClose, value, onChange, defaultValue, presets, sections, themes, accents, fonts, textSizes, densities, radii, labels, title, subtitle, size, }: CustomizerProps) => react.JSX.Element;
|
|
6870
|
+
|
|
5982
6871
|
type BlockquoteVariant = 'plain' | 'solid' | 'icon' | 'testimonial';
|
|
5983
6872
|
type BlockquoteSize = 'sm' | 'md' | 'lg';
|
|
5984
|
-
type BlockquoteAlign = '
|
|
6873
|
+
type BlockquoteAlign = 'start' | 'center' | 'end';
|
|
5985
6874
|
type BlockquoteProps = {
|
|
5986
6875
|
children: ReactNode;
|
|
5987
6876
|
/**
|
|
5988
6877
|
* Visual treatment:
|
|
5989
6878
|
* - `plain` (default): bare italic quote
|
|
5990
|
-
* - `solid`: muted background + brand-coloured
|
|
6879
|
+
* - `solid`: muted background + brand-coloured border on the start edge
|
|
5991
6880
|
* - `icon`: large quote glyph above the text
|
|
5992
6881
|
* - `testimonial`: solid background + author block in the footer
|
|
5993
6882
|
*/
|
|
@@ -6022,7 +6911,7 @@ type KbdProps = {
|
|
|
6022
6911
|
*/
|
|
6023
6912
|
declare const Kbd: ({ children, size, className }: KbdProps) => react.JSX.Element;
|
|
6024
6913
|
|
|
6025
|
-
type FigureAlign = '
|
|
6914
|
+
type FigureAlign = 'start' | 'center' | 'end';
|
|
6026
6915
|
type FigureSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
6027
6916
|
type FigureRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
6028
6917
|
type FigureProps = Omit<ImgHTMLAttributes<HTMLImageElement>, 'children'> & {
|
|
@@ -6090,7 +6979,7 @@ type ChatMessageContent = {
|
|
|
6090
6979
|
children: ReactNode;
|
|
6091
6980
|
};
|
|
6092
6981
|
type ChatMessageBaseProps = {
|
|
6093
|
-
/** `outgoing` (
|
|
6982
|
+
/** `outgoing` (at the end of the line, accent) for the current user, `incoming` (at the start) otherwise. */
|
|
6094
6983
|
direction: ChatMessageDirection;
|
|
6095
6984
|
/** Sender name: shown on the first message of a group, always read by screen readers. */
|
|
6096
6985
|
sender: string;
|
|
@@ -6129,8 +7018,8 @@ type ChatMessageBaseProps = {
|
|
|
6129
7018
|
};
|
|
6130
7019
|
type ChatMessageProps = ChatMessageBaseProps & ChatMessageContent;
|
|
6131
7020
|
/**
|
|
6132
|
-
* One chat bubble. Incoming bubbles sit
|
|
6133
|
-
* on the first message of a group; outgoing ones sit
|
|
7021
|
+
* One chat bubble. Incoming bubbles sit at the start of the line with the sender's
|
|
7022
|
+
* avatar on the first message of a group; outgoing ones sit at the end in the
|
|
6134
7023
|
* accent color with their delivery state. Sender and time are read by screen
|
|
6135
7024
|
* readers on every message, grouped or not.
|
|
6136
7025
|
*/
|
|
@@ -6145,7 +7034,7 @@ type ChatComposerProps = {
|
|
|
6145
7034
|
/** Accessible name of the send button. Default `Send message`. */
|
|
6146
7035
|
sendLabel?: string;
|
|
6147
7036
|
disabled?: boolean;
|
|
6148
|
-
/** Slot
|
|
7037
|
+
/** Slot before the textarea, e.g. an attach-file button. */
|
|
6149
7038
|
attachment?: ReactNode;
|
|
6150
7039
|
/**
|
|
6151
7040
|
* A line under the field and the send button, inside the same panel: an attach button, a model
|
|
@@ -6296,7 +7185,7 @@ type ChatConversationListProps = {
|
|
|
6296
7185
|
className?: string;
|
|
6297
7186
|
};
|
|
6298
7187
|
/**
|
|
6299
|
-
* Conversation picker for the
|
|
7188
|
+
* Conversation picker for the start pane of a two-pane chat: name, last
|
|
6300
7189
|
* message, time, unread count and presence of each thread.
|
|
6301
7190
|
*/
|
|
6302
7191
|
declare const ChatConversationList: ({ conversations, selectedId, onSelect, label, className, }: ChatConversationListProps) => react.JSX.Element;
|
|
@@ -6382,6 +7271,11 @@ type CommentLabels = {
|
|
|
6382
7271
|
replies?: (author: string) => string;
|
|
6383
7272
|
/** The button that unfolds the replies past `maxReplies`. Default `Show 3 more replies`. */
|
|
6384
7273
|
showReplies?: (hidden: number) => string;
|
|
7274
|
+
/**
|
|
7275
|
+
* The same button with `keepReplies="last"`, where the folded replies are the older ones.
|
|
7276
|
+
* Default `Show 3 earlier replies`.
|
|
7277
|
+
*/
|
|
7278
|
+
showEarlierReplies?: (hidden: number) => string;
|
|
6385
7279
|
/** The same button once they are unfolded. Default `Show fewer replies`. */
|
|
6386
7280
|
hideReplies?: string;
|
|
6387
7281
|
};
|
|
@@ -6464,6 +7358,12 @@ type CommentBaseProps = {
|
|
|
6464
7358
|
replies?: ReactNode;
|
|
6465
7359
|
/** Replies shown before the rest fold behind a "Show n more replies" button. Default `2`. */
|
|
6466
7360
|
maxReplies?: number;
|
|
7361
|
+
/**
|
|
7362
|
+
* Which replies stay on screen when they fold: the `first` `maxReplies` (the rest fold below
|
|
7363
|
+
* them, "Show n more replies"), or the `last` ones, for a ticket where the latest exchanges
|
|
7364
|
+
* matter (the older ones fold above them, "Show n earlier replies"). Default `first`.
|
|
7365
|
+
*/
|
|
7366
|
+
keepReplies?: 'first' | 'last';
|
|
6467
7367
|
/** Texts for another language; a `CommentThread` can give them to all of its comments. */
|
|
6468
7368
|
labels?: CommentLabels;
|
|
6469
7369
|
className?: string;
|
|
@@ -6474,13 +7374,52 @@ type CommentProps = CommentBaseProps & CommentContent;
|
|
|
6474
7374
|
/**
|
|
6475
7375
|
* One comment on a record: avatar, author, role, time, body, and the actions the host allows.
|
|
6476
7376
|
* Reply and Edit open a `CommentComposer` in place; the host receives the text and owns the data.
|
|
6477
|
-
* Replies are `Comment`s passed as `replies`, folded beyond `maxReplies
|
|
7377
|
+
* Replies are `Comment`s passed as `replies`, folded beyond `maxReplies` (the first ones stay, or
|
|
7378
|
+
* the last ones with `keepReplies="last"`).
|
|
6478
7379
|
*/
|
|
6479
|
-
declare function Comment({ author, avatarSrc, role, time, edited, variant, text, children, onReply, onEdit, onDelete, editText, replies, maxReplies, labels: ownLabels, className, ref, }: CommentProps): react.JSX.Element;
|
|
7380
|
+
declare function Comment({ author, avatarSrc, role, time, edited, variant, text, children, onReply, onEdit, onDelete, editText, replies, maxReplies, keepReplies, labels: ownLabels, className, ref, }: CommentProps): react.JSX.Element;
|
|
6480
7381
|
|
|
7382
|
+
/** One thing the composer can write: a reply to the customer, an internal note. */
|
|
7383
|
+
type CommentComposerMode = {
|
|
7384
|
+
/** What `onSubmit` and `onModeChange` receive. */
|
|
7385
|
+
value: string;
|
|
7386
|
+
/** The segment's text. */
|
|
7387
|
+
label: string;
|
|
7388
|
+
/**
|
|
7389
|
+
* A note only the team sees. Tints the field and the submit button the way
|
|
7390
|
+
* `variant="internal"` tints a comment, and says so in words, so it is not sent to a customer
|
|
7391
|
+
* by mistake. Default `false`.
|
|
7392
|
+
*/
|
|
7393
|
+
internal?: boolean;
|
|
7394
|
+
/** Placeholder while this mode is selected. Default: the composer's `placeholder`. */
|
|
7395
|
+
placeholder?: string;
|
|
7396
|
+
/** Submit button text while this mode is selected. Default: the composer's `submitLabel`. */
|
|
7397
|
+
submitLabel?: string;
|
|
7398
|
+
};
|
|
6481
7399
|
type CommentComposerProps = {
|
|
6482
|
-
/**
|
|
6483
|
-
|
|
7400
|
+
/**
|
|
7401
|
+
* Called with the trimmed text when the user submits a non-empty comment, and with the selected
|
|
7402
|
+
* mode's `value` when the composer has `modes` (the text alone otherwise).
|
|
7403
|
+
*/
|
|
7404
|
+
onSubmit: (text: string, mode?: string) => void;
|
|
7405
|
+
/**
|
|
7406
|
+
* What the text can be (Reply, Internal note), as a segmented control above the field. Without
|
|
7407
|
+
* it the composer has no control and `onSubmit` gets the text alone.
|
|
7408
|
+
*/
|
|
7409
|
+
modes?: CommentComposerMode[];
|
|
7410
|
+
/** The selected mode's `value`, when the host controls it. Only `undefined` means uncontrolled. */
|
|
7411
|
+
mode?: string;
|
|
7412
|
+
/** The mode selected first when uncontrolled. Default: the first of `modes`. */
|
|
7413
|
+
defaultMode?: string;
|
|
7414
|
+
/** Called with the new mode's `value`, in both modes. */
|
|
7415
|
+
onModeChange?: (mode: string) => void;
|
|
7416
|
+
/** Accessible name of the modes' control. Default `Type of message`. */
|
|
7417
|
+
modeLabel?: string;
|
|
7418
|
+
/**
|
|
7419
|
+
* Said, and announced when the mode changes, while an `internal` mode is selected. Default
|
|
7420
|
+
* `Internal note: only your team sees this.`
|
|
7421
|
+
*/
|
|
7422
|
+
internalNotice?: string;
|
|
6484
7423
|
/**
|
|
6485
7424
|
* Shows a Cancel button and lets Escape cancel. Without it neither exists, which is right for
|
|
6486
7425
|
* the composer at the bottom of a thread.
|
|
@@ -6518,9 +7457,465 @@ type CommentComposerProps = {
|
|
|
6518
7457
|
/**
|
|
6519
7458
|
* The field to write, reply to or edit a comment. Enter adds a line (a comment is not a chat
|
|
6520
7459
|
* message); the submit button, or Ctrl/Cmd+Enter, sends. Built on `Textarea` with `autoResize`.
|
|
6521
|
-
* Submit stays disabled while the text is empty or `submitting`.
|
|
7460
|
+
* Submit stays disabled while the text is empty or `submitting`. `modes` adds a segmented control
|
|
7461
|
+
* to choose what is being written.
|
|
7462
|
+
*/
|
|
7463
|
+
declare function CommentComposer({ onSubmit, modes, mode: modeProp, defaultMode, onModeChange, modeLabel, internalNotice, onCancel, value, defaultValue, onChange, submitting, label, placeholder, submitLabel, cancelLabel, rows, maxRows, autoFocus, className, ref, }: CommentComposerProps): react.JSX.Element;
|
|
7464
|
+
|
|
7465
|
+
/** The severities a log line can carry, from the least to the most severe. */
|
|
7466
|
+
type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
7467
|
+
/** A level as the components know it: one of `LogLevel`, or `unknown` for anything else. */
|
|
7468
|
+
type LogLevelKey = LogLevel | 'unknown';
|
|
7469
|
+
/** Every level, least severe first. */
|
|
7470
|
+
declare const LOG_LEVELS: readonly LogLevel[];
|
|
7471
|
+
/** Every level key, `unknown` last: the default set of the level filters. */
|
|
7472
|
+
declare const LOG_LEVEL_KEYS: readonly LogLevelKey[];
|
|
7473
|
+
/** The id of a line: stable and unique in the buffer. */
|
|
7474
|
+
type LogLineId = string | number;
|
|
7475
|
+
/**
|
|
7476
|
+
* One record of a log. The host owns the data: it fetches, streams and trims the lines, the
|
|
7477
|
+
* components draw what they are given.
|
|
7478
|
+
*/
|
|
7479
|
+
type LogLine = {
|
|
7480
|
+
/** Stable and unique in the buffer: it keys the row, and tells which lines are new. */
|
|
7481
|
+
id: LogLineId;
|
|
7482
|
+
/** A `Date`, a timestamp in milliseconds or an ISO 8601 string. Shown with milliseconds. */
|
|
7483
|
+
time: DateTimeValue;
|
|
7484
|
+
/**
|
|
7485
|
+
* `trace`, `debug`, `info`, `warn`, `error` or `fatal`, in any case. Missing or anything else
|
|
7486
|
+
* (`warning`, `notice`…) draws as `unknown`.
|
|
7487
|
+
*/
|
|
7488
|
+
level?: LogLevel | (string & {});
|
|
7489
|
+
/** The logger or the service that wrote the line. */
|
|
7490
|
+
source?: string;
|
|
7491
|
+
/** The text of the line. Drawn as text, never as HTML. */
|
|
7492
|
+
message: string;
|
|
7493
|
+
/** Structured data of the record (a request id, a duration…). Shown when the row is expanded. */
|
|
7494
|
+
fields?: Record<string, unknown>;
|
|
7495
|
+
/** A stack trace, shown when the row is expanded. */
|
|
7496
|
+
stack?: string;
|
|
7497
|
+
};
|
|
7498
|
+
/** The parts of a row a viewer can hide, besides the message. */
|
|
7499
|
+
type LogColumn = 'time' | 'level' | 'source';
|
|
7500
|
+
/** Which end of the buffer the newest line is at. */
|
|
7501
|
+
type LogOrder = 'newest-last' | 'newest-first';
|
|
7502
|
+
|
|
7503
|
+
type LogTone = 'terminal' | 'surface';
|
|
7504
|
+
type LogLevelBadgeProps = {
|
|
7505
|
+
/**
|
|
7506
|
+
* The level of the line, in any case: `trace`, `debug`, `info`, `warn`, `error` or `fatal`.
|
|
7507
|
+
* Missing, or anything else, draws as `unknown`.
|
|
7508
|
+
*/
|
|
7509
|
+
level?: string;
|
|
7510
|
+
/**
|
|
7511
|
+
* The ground it sits on. `surface` (default) follows the theme, for a table or a card;
|
|
7512
|
+
* `terminal` is for the dark panel of a `LogViewer`, dark in every theme.
|
|
7513
|
+
*/
|
|
7514
|
+
tone?: LogTone;
|
|
7515
|
+
className?: string;
|
|
7516
|
+
};
|
|
7517
|
+
/** The text of each level: the badge never says it with colour alone. */
|
|
7518
|
+
declare const LOG_LEVEL_LABEL: Record<LogLevelKey, string>;
|
|
7519
|
+
/**
|
|
7520
|
+
* LogLevelBadge — the level of a log line as a short label in its colour (`ERROR`, `WARN`…). The
|
|
7521
|
+
* word carries the level, the colour only backs it. Use it in a table cell, a detail panel or a
|
|
7522
|
+
* card; `LogViewer` draws it in every row.
|
|
7523
|
+
*/
|
|
7524
|
+
declare const LogLevelBadge: ({ level, tone, className }: LogLevelBadgeProps) => react.JSX.Element;
|
|
7525
|
+
|
|
7526
|
+
type LogDensity = 'compact' | 'comfortable';
|
|
7527
|
+
type LogViewerProps = {
|
|
7528
|
+
/**
|
|
7529
|
+
* The lines of the buffer, oldest first, whatever the `order` they are drawn in. The host
|
|
7530
|
+
* fetches, streams and trims them; each `id` is unique and stays the same from one render to
|
|
7531
|
+
* the next.
|
|
7532
|
+
*/
|
|
7533
|
+
lines: readonly LogLine[];
|
|
7534
|
+
/** Accessible name of the log. Default `Log`. Name it, or point `aria-labelledby` at a heading. */
|
|
7535
|
+
'aria-label'?: string;
|
|
7536
|
+
/** Id of an element that names the log, instead of `aria-label`. */
|
|
7537
|
+
'aria-labelledby'?: string;
|
|
7538
|
+
/**
|
|
7539
|
+
* `terminal` (default) is a dark panel in every theme, as a console is. `surface` follows the
|
|
7540
|
+
* theme: for a card on a dashboard.
|
|
7541
|
+
*/
|
|
7542
|
+
tone?: LogTone;
|
|
7543
|
+
/** `compact` (default) is one line per record; `comfortable` puts the message under its details. */
|
|
7544
|
+
density?: LogDensity;
|
|
7545
|
+
/**
|
|
7546
|
+
* Wrap the long lines (`true`), or keep each on one line and scroll sideways (`false`, default).
|
|
7547
|
+
* Wrapped lines have no fixed height, so they are all drawn, not windowed: keep the buffer to a
|
|
7548
|
+
* few thousand lines, or leave `wrap` off for a larger one.
|
|
7549
|
+
*/
|
|
7550
|
+
wrap?: boolean;
|
|
7551
|
+
/** Where the newest line sits: last, like a tail (`newest-last`, default), or first. */
|
|
7552
|
+
order?: LogOrder;
|
|
7553
|
+
/** The parts of a row to draw, besides the message. Default all of them. */
|
|
7554
|
+
columns?: readonly LogColumn[];
|
|
7555
|
+
/** Number the lines, from 1, in the order of `lines` (a trimmed buffer renumbers). Default `false`. */
|
|
7556
|
+
lineNumbers?: boolean;
|
|
7557
|
+
/**
|
|
7558
|
+
* Stay at the end while lines arrive (`true`), at the newest line: the bottom for `newest-last`,
|
|
7559
|
+
* the top for `newest-first`. Scrolling away from the end pauses it, and scrolling back to the
|
|
7560
|
+
* end, or the "Jump to latest" button, resumes it. Controlled; defaults to `defaultFollow`.
|
|
7561
|
+
*/
|
|
7562
|
+
follow?: boolean;
|
|
7563
|
+
/** Initial `follow` while uncontrolled. Default `true`. */
|
|
7564
|
+
defaultFollow?: boolean;
|
|
7565
|
+
/** Called with the state to move to when the reader scrolls away from the end or back to it. */
|
|
7566
|
+
onFollowChange?: (follow: boolean) => void;
|
|
7567
|
+
/**
|
|
7568
|
+
* The levels to show. Left out, all of them; an empty list shows nothing. Pair it with the
|
|
7569
|
+
* toolbar's `activeLevels`.
|
|
7570
|
+
*/
|
|
7571
|
+
activeLevels?: readonly LogLevelKey[];
|
|
7572
|
+
/** The sources to show. Left out or empty, all of them. Pair it with the toolbar's `activeSources`. */
|
|
7573
|
+
activeSources?: readonly string[];
|
|
7574
|
+
/**
|
|
7575
|
+
* The text to find in the messages and sources, highlighted in every line. Case-insensitive.
|
|
7576
|
+
* Empty or left out, no search.
|
|
7577
|
+
*/
|
|
7578
|
+
search?: string;
|
|
7579
|
+
/** Read `search` as a regular expression. A pattern that does not compile finds nothing. Default `false`. */
|
|
7580
|
+
searchRegex?: boolean;
|
|
7581
|
+
/**
|
|
7582
|
+
* Which match is the active one, counted from 0 among the lines that match: it is drawn
|
|
7583
|
+
* stronger and scrolled into view when it changes. Held by the host (`LogToolbar` moves it with
|
|
7584
|
+
* previous and next, wrapping around); clamped to the matches there are. Default 0.
|
|
7585
|
+
*/
|
|
7586
|
+
activeMatch?: number;
|
|
7587
|
+
/** Called with the number of lines that match, whenever it changes (also to 0). */
|
|
7588
|
+
onMatchCountChange?: (count: number) => void;
|
|
7589
|
+
/** Ids of the expanded lines, when controlled. */
|
|
7590
|
+
expandedIds?: readonly LogLineId[];
|
|
7591
|
+
/** Ids of the lines expanded at first, when uncontrolled. None by default. */
|
|
7592
|
+
defaultExpandedIds?: readonly LogLineId[];
|
|
7593
|
+
/** Called with the ids to move to when a line is expanded or collapsed. */
|
|
7594
|
+
onExpandedIdsChange?: (ids: readonly LogLineId[]) => void;
|
|
7595
|
+
/**
|
|
7596
|
+
* Adds an "Open details" button to an expanded line, called with it: open a `LogEntryDetail` in
|
|
7597
|
+
* a drawer or a side panel.
|
|
7598
|
+
*/
|
|
7599
|
+
onOpenLine?: (line: LogLine) => void;
|
|
7600
|
+
/** The line to mark as the one in focus (`aria-current`), as in the context of an entry. */
|
|
7601
|
+
currentId?: LogLineId;
|
|
7602
|
+
/**
|
|
7603
|
+
* Announce the error and fatal lines that arrive to screen readers, in a polite live region of
|
|
7604
|
+
* their own: up to three, then the count of the rest. Off by default, as is every other line: a
|
|
7605
|
+
* stream read aloud line by line cannot be followed.
|
|
7606
|
+
*/
|
|
7607
|
+
announceErrors?: boolean;
|
|
7608
|
+
/** Shown when no line is left to draw. Default `No log lines.` */
|
|
7609
|
+
emptyMessage?: string;
|
|
7610
|
+
/** BCP 47 tag for the times (`fr-FR`). Default: the browser's language. */
|
|
7611
|
+
locale?: string;
|
|
7612
|
+
/** IANA zone for the times (`Asia/Tokyo`). Default: the browser's zone. */
|
|
7613
|
+
timeZone?: string;
|
|
7614
|
+
/** The height of the viewer: a CSS length, or a number of px. Default `24rem`. */
|
|
7615
|
+
height?: number | string;
|
|
7616
|
+
className?: string;
|
|
7617
|
+
/** Ref to the scrolling element (`role="log"`). */
|
|
7618
|
+
ref?: Ref<HTMLDivElement>;
|
|
7619
|
+
};
|
|
7620
|
+
/**
|
|
7621
|
+
* LogViewer — the live tail of a log: one monospace row per record, with its time, level, source
|
|
7622
|
+
* and message. It stays at the end while lines arrive and pauses when the reader scrolls away,
|
|
7623
|
+
* with a "Jump to latest" button that counts what came meanwhile. It highlights a search with an
|
|
7624
|
+
* active match, expands a row in place to show its fields and stack trace, and is windowed, so
|
|
7625
|
+
* tens of thousands of lines stay smooth in the default mode (see `wrap` for the limit).
|
|
7626
|
+
*
|
|
7627
|
+
* The host owns the data (fetching, streaming, trimming the buffer) and the filters: it passes
|
|
7628
|
+
* `lines` and what to show. Messages, sources, fields and stacks are text, never HTML. The log
|
|
7629
|
+
* does not announce new lines (`aria-live="off"`); `announceErrors` reads the error ones.
|
|
7630
|
+
*/
|
|
7631
|
+
declare const LogViewer: ({ lines, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, tone, density, wrap, order, columns, lineNumbers, follow: followProp, defaultFollow, onFollowChange, activeLevels, activeSources, search, searchRegex, activeMatch, onMatchCountChange, expandedIds: expandedProp, defaultExpandedIds, onExpandedIdsChange, onOpenLine, currentId, announceErrors: announce, emptyMessage, locale, timeZone, height, className, ref, }: LogViewerProps) => react.JSX.Element;
|
|
7632
|
+
|
|
7633
|
+
/** Where a job or one of its steps stands. */
|
|
7634
|
+
type JobStatus = 'queued' | 'running' | 'passed' | 'failed' | 'skipped';
|
|
7635
|
+
/** One line of a step: its text, and when it was written. */
|
|
7636
|
+
type JobLogLine = {
|
|
7637
|
+
/** The raw text of the line. ANSI colours are drawn as theme colours; markup stays text. */
|
|
7638
|
+
text: string;
|
|
7639
|
+
/** A `Date`, a timestamp in milliseconds or an ISO 8601 string. Shown in the timestamps column. */
|
|
7640
|
+
timestamp?: DateTimeValue;
|
|
7641
|
+
};
|
|
7642
|
+
/** One step of a job, as a CI tool shows it. */
|
|
7643
|
+
type JobLogStep = {
|
|
7644
|
+
/** Stable and unique among the steps: it keys the step and builds the links of its lines. */
|
|
7645
|
+
id: string;
|
|
7646
|
+
/** The name of the step. Text, never HTML. */
|
|
7647
|
+
name: string;
|
|
7648
|
+
status: JobStatus;
|
|
7649
|
+
/** How long the step took, in milliseconds. The host measures it, and updates it while the step runs. */
|
|
7650
|
+
duration?: number;
|
|
7651
|
+
/** When the step started: the origin of the `elapsed` timestamps. Defaults to the first timestamp of the step. */
|
|
7652
|
+
startedAt?: DateTimeValue;
|
|
7653
|
+
/** The output of the step, oldest first: a string is a line without a timestamp. */
|
|
7654
|
+
lines: readonly (string | JobLogLine)[];
|
|
7655
|
+
};
|
|
7656
|
+
/** A line of a step: `line` counts from 1 in each step. */
|
|
7657
|
+
type JobLogLineRef = {
|
|
7658
|
+
step: string;
|
|
7659
|
+
line: number;
|
|
7660
|
+
};
|
|
7661
|
+
/** How the timestamps column reads: the time of day of each line, or the time since its step started. */
|
|
7662
|
+
type JobLogTimestampFormat = 'clock' | 'elapsed';
|
|
7663
|
+
/** The controls of the toolbar the host can leave out. */
|
|
7664
|
+
type JobLogControl = 'search' | 'timestamps' | 'wrap' | 'expand' | 'download';
|
|
7665
|
+
/** The `href` of a line's number: `#<prefix><step id>-L<n>`. */
|
|
7666
|
+
declare const jobLogLineHref: (prefix: string, ref: JobLogLineRef) => string;
|
|
7667
|
+
/**
|
|
7668
|
+
* The line a URL hash (`#run-tests-L6`, with or without the `#`) points at, for a host that
|
|
7669
|
+
* syncs `currentLine` with `location.hash`. `prefix` is the `idPrefix` of the log. `null` for a
|
|
7670
|
+
* hash that is not a line of this log.
|
|
7671
|
+
*/
|
|
7672
|
+
declare const parseJobLogHash: (hash: string, prefix?: string) => JobLogLineRef | null;
|
|
7673
|
+
|
|
7674
|
+
type JobLogProps = {
|
|
7675
|
+
/** The steps of the job, in order. Each `id` is unique and stays the same from one render to the next. */
|
|
7676
|
+
steps: readonly JobLogStep[];
|
|
7677
|
+
/** Accessible name of the log. Default: the `title`, else `Job log`. */
|
|
7678
|
+
'aria-label'?: string;
|
|
7679
|
+
/** Id of an element that names the log, instead of `aria-label`. */
|
|
7680
|
+
'aria-labelledby'?: string;
|
|
7681
|
+
/** Heading of the log: the job's name. The header is drawn when any of `title`, `status`, `meta` or `duration` is given. */
|
|
7682
|
+
title?: ReactNode;
|
|
7683
|
+
/** The status of the job as a whole. */
|
|
7684
|
+
status?: JobStatus;
|
|
7685
|
+
/** What goes with the title: a branch and a commit, a trigger. Drawn in monospace. */
|
|
7686
|
+
meta?: ReactNode;
|
|
7687
|
+
/** How long the job took, in milliseconds. The host measures it. */
|
|
7688
|
+
duration?: number;
|
|
7689
|
+
/**
|
|
7690
|
+
* `terminal` (default) is a dark panel in every theme, as a console is. `surface` follows the
|
|
7691
|
+
* theme: for a card on a page.
|
|
7692
|
+
*/
|
|
7693
|
+
tone?: LogTone;
|
|
7694
|
+
/** The controls of the toolbar to draw. Default all of them; an empty list leaves the toolbar out. */
|
|
7695
|
+
controls?: readonly JobLogControl[];
|
|
7696
|
+
/** Ids of the open steps, when controlled. */
|
|
7697
|
+
expandedSteps?: readonly string[];
|
|
7698
|
+
/**
|
|
7699
|
+
* Ids of the steps open at first, when uncontrolled. Default: the failed and the running
|
|
7700
|
+
* steps. A step that starts running later opens, as the reader would open it.
|
|
7701
|
+
*/
|
|
7702
|
+
defaultExpandedSteps?: readonly string[];
|
|
7703
|
+
/** Called with the ids to move to when a step is opened or closed. */
|
|
7704
|
+
onExpandedStepsChange?: (ids: readonly string[]) => void;
|
|
7705
|
+
/**
|
|
7706
|
+
* The line in focus, when controlled: its step opens, it scrolls into view and is marked
|
|
7707
|
+
* (`aria-current`). `null` is none. A line is a step id and a number counted from 1 in that step.
|
|
7708
|
+
*/
|
|
7709
|
+
currentLine?: JobLogLineRef | null;
|
|
7710
|
+
/** The line in focus at first, when uncontrolled. None by default. */
|
|
7711
|
+
defaultCurrentLine?: JobLogLineRef | null;
|
|
7712
|
+
/**
|
|
7713
|
+
* Called with the line to move to when a line number is clicked. The log never reads or writes
|
|
7714
|
+
* `location`: a host that syncs it with the URL hash does it here (see `parseJobLogHash`). A
|
|
7715
|
+
* click with a modifier key is the browser's own, so "open in a new tab" works.
|
|
7716
|
+
*/
|
|
7717
|
+
onCurrentLineChange?: (line: JobLogLineRef) => void;
|
|
7718
|
+
/** Put in front of the ids of the line links (`#<prefix><step id>-L<n>`), to tell two logs on a page apart. */
|
|
7719
|
+
idPrefix?: string;
|
|
7720
|
+
/** Show the timestamps column, when controlled. Default off. */
|
|
7721
|
+
timestamps?: boolean;
|
|
7722
|
+
/** Initial `timestamps` while uncontrolled. Default `false`. */
|
|
7723
|
+
defaultTimestamps?: boolean;
|
|
7724
|
+
/** Called with the state to move to. */
|
|
7725
|
+
onTimestampsChange?: (timestamps: boolean) => void;
|
|
7726
|
+
/**
|
|
7727
|
+
* What the timestamps column says: the time of day of each line (`clock`, default), or the time
|
|
7728
|
+
* since its step started (`elapsed`, `+0:04.2`).
|
|
7729
|
+
*/
|
|
7730
|
+
timestampFormat?: JobLogTimestampFormat;
|
|
7731
|
+
/**
|
|
7732
|
+
* Wrap the long lines, when controlled. Default off: each line stays on one line and the lines
|
|
7733
|
+
* of a step scroll sideways. Wrapped lines have no fixed height, so all of them are drawn, not
|
|
7734
|
+
* windowed: keep a step to a few thousand lines, or leave `wrap` off.
|
|
7735
|
+
*/
|
|
7736
|
+
wrap?: boolean;
|
|
7737
|
+
/** Initial `wrap` while uncontrolled. Default `false`. */
|
|
7738
|
+
defaultWrap?: boolean;
|
|
7739
|
+
/** Called with the state to move to. */
|
|
7740
|
+
onWrapChange?: (wrap: boolean) => void;
|
|
7741
|
+
/** The text to find in the lines, highlighted, case-insensitive: the search of the toolbar, when controlled. */
|
|
7742
|
+
search?: string;
|
|
7743
|
+
/** Initial search while uncontrolled. Default empty. */
|
|
7744
|
+
defaultSearch?: string;
|
|
7745
|
+
/** Called with the text typed. */
|
|
7746
|
+
onSearchChange?: (search: string) => void;
|
|
7747
|
+
/**
|
|
7748
|
+
* Stay at the end while a step is running (`true`). Scrolling away from the end pauses it, and
|
|
7749
|
+
* scrolling back to it, or "Jump to latest", resumes it. Controlled; defaults to `defaultFollow`.
|
|
7750
|
+
*/
|
|
7751
|
+
follow?: boolean;
|
|
7752
|
+
/** Initial `follow` while uncontrolled. Default `true`. */
|
|
7753
|
+
defaultFollow?: boolean;
|
|
7754
|
+
/** Called with the state to move to. */
|
|
7755
|
+
onFollowChange?: (follow: boolean) => void;
|
|
7756
|
+
/** Name of the downloaded file. Default `job-log.txt`. */
|
|
7757
|
+
fileName?: string;
|
|
7758
|
+
/** BCP 47 tag for the clock times (`fr-FR`). Default: the browser's language. */
|
|
7759
|
+
locale?: string;
|
|
7760
|
+
/** IANA zone for the clock times (`Asia/Tokyo`). Default: the browser's zone. */
|
|
7761
|
+
timeZone?: string;
|
|
7762
|
+
/** The height of the log: a CSS length, or a number of px. Default `32rem`. */
|
|
7763
|
+
height?: number | string;
|
|
7764
|
+
className?: string;
|
|
7765
|
+
/** Ref to the scrolling element. */
|
|
7766
|
+
ref?: Ref<HTMLDivElement>;
|
|
7767
|
+
};
|
|
7768
|
+
/**
|
|
7769
|
+
* JobLog — the output of a CI job or a build: collapsible steps, each with its status and
|
|
7770
|
+
* duration, its lines numbered from 1 and drawn with their ANSI colours as theme colours. Failed
|
|
7771
|
+
* and running steps start open. The header of an open step sticks to the top while its lines
|
|
7772
|
+
* scroll, and a long step is windowed, so tens of thousands of lines stay smooth.
|
|
7773
|
+
*
|
|
7774
|
+
* It is read differently from a live tail (`LogViewer`): a line number is a link, `currentLine`
|
|
7775
|
+
* marks one line and scrolls to it, and the toolbar searches across all the steps, shows
|
|
7776
|
+
* timestamps (the time of day, or the time since the step started), wraps lines, expands or
|
|
7777
|
+
* collapses every step and downloads the log as plain text. While a step runs the log follows the
|
|
7778
|
+
* end, pauses when the reader scrolls up, and has a "Jump to latest" button.
|
|
7779
|
+
*
|
|
7780
|
+
* The host owns the data and the clock: it passes `steps`, their durations and the new lines as
|
|
7781
|
+
* they come. A line is text, never HTML: the ANSI colour codes are read into styled spans, and
|
|
7782
|
+
* every other escape sequence is dropped.
|
|
7783
|
+
*/
|
|
7784
|
+
declare const JobLog: ({ steps, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, title, status, meta, duration, tone, controls, expandedSteps: expandedProp, defaultExpandedSteps: defaultExpandedProp, onExpandedStepsChange, currentLine: currentProp, defaultCurrentLine, onCurrentLineChange, idPrefix, timestamps: timestampsProp, defaultTimestamps, onTimestampsChange, timestampFormat, wrap: wrapProp, defaultWrap, onWrapChange, search: searchProp, defaultSearch, onSearchChange, follow: followProp, defaultFollow, onFollowChange, fileName, locale, timeZone, height, className, ref, }: JobLogProps) => react.JSX.Element;
|
|
7785
|
+
|
|
7786
|
+
type LogToolbarProps = {
|
|
7787
|
+
/** Accessible name of the group of controls. Default `Log controls`. */
|
|
7788
|
+
'aria-label'?: string;
|
|
7789
|
+
/** The stream is running. Controlled; the toolbar has the Live / Paused button when `onLiveChange` is given. */
|
|
7790
|
+
live?: boolean;
|
|
7791
|
+
/** Initial `live` while uncontrolled. Default `true`. */
|
|
7792
|
+
defaultLive?: boolean;
|
|
7793
|
+
/**
|
|
7794
|
+
* Called with the state to move to. Wire it to the viewer's `follow` to have the pause on
|
|
7795
|
+
* scroll shown in the bar, or to your own switch that stops feeding the stream.
|
|
7796
|
+
*/
|
|
7797
|
+
onLiveChange?: (live: boolean) => void;
|
|
7798
|
+
/** The levels to offer as toggles, in the order to show them. No level toggles when omitted. */
|
|
7799
|
+
levels?: readonly LogLevelKey[];
|
|
7800
|
+
/** The number of lines per level, shown in the toggle. Count them with `countLogLevels`. */
|
|
7801
|
+
levelCounts?: Partial<Record<LogLevelKey, number>>;
|
|
7802
|
+
/** The levels that are on, when controlled. Default: all of `levels`. */
|
|
7803
|
+
activeLevels?: readonly LogLevelKey[];
|
|
7804
|
+
/** The levels on at first, when uncontrolled. Default: all of `levels`. */
|
|
7805
|
+
defaultActiveLevels?: readonly LogLevelKey[];
|
|
7806
|
+
/** Called with the levels to move to (in the order of `levels`). */
|
|
7807
|
+
onActiveLevelsChange?: (levels: readonly LogLevelKey[]) => void;
|
|
7808
|
+
/** The search text, when controlled. The search field is there when `onSearchChange` is given. */
|
|
7809
|
+
search?: string;
|
|
7810
|
+
/** Initial search text while uncontrolled. Default empty. */
|
|
7811
|
+
defaultSearch?: string;
|
|
7812
|
+
/** Called with the text typed. Reset the viewer's `activeMatch` to 0 here. */
|
|
7813
|
+
onSearchChange?: (search: string) => void;
|
|
7814
|
+
/** Read the search as a regular expression, when controlled. The toggle is there when `onSearchRegexChange` is given. */
|
|
7815
|
+
searchRegex?: boolean;
|
|
7816
|
+
/** Initial `searchRegex` while uncontrolled. Default `false`. */
|
|
7817
|
+
defaultSearchRegex?: boolean;
|
|
7818
|
+
/** Called with the state to move to. */
|
|
7819
|
+
onSearchRegexChange?: (regex: boolean) => void;
|
|
7820
|
+
/** How many lines match (the viewer's `onMatchCountChange`): shown as "2 of 3", and enables previous / next. */
|
|
7821
|
+
matchCount?: number;
|
|
7822
|
+
/** The active match, counted from 0. */
|
|
7823
|
+
activeMatch?: number;
|
|
7824
|
+
/**
|
|
7825
|
+
* Called with the match to go to, wrapping around the ends, when previous or next is pressed
|
|
7826
|
+
* (also Enter and Shift+Enter in the field). Previous and next are there when it is given.
|
|
7827
|
+
*/
|
|
7828
|
+
onActiveMatchChange?: (index: number) => void;
|
|
7829
|
+
/** The sources to offer in the filter, which is there when this is given. */
|
|
7830
|
+
sources?: readonly string[];
|
|
7831
|
+
/** The sources that are on, when controlled. Empty means all of them. */
|
|
7832
|
+
activeSources?: readonly string[];
|
|
7833
|
+
/** The sources on at first, when uncontrolled. Default none: all of them. */
|
|
7834
|
+
defaultActiveSources?: readonly string[];
|
|
7835
|
+
/** Called with the sources to move to. */
|
|
7836
|
+
onActiveSourcesChange?: (sources: readonly string[]) => void;
|
|
7837
|
+
/** Wrap the long lines, when controlled. The toggle is there when `onWrapChange` is given. */
|
|
7838
|
+
wrap?: boolean;
|
|
7839
|
+
/** Initial `wrap` while uncontrolled. Default `false`. */
|
|
7840
|
+
defaultWrap?: boolean;
|
|
7841
|
+
/** Called with the state to move to. */
|
|
7842
|
+
onWrapChange?: (wrap: boolean) => void;
|
|
7843
|
+
/** Newest line first or last, when controlled. The toggle is there when `onOrderChange` is given. */
|
|
7844
|
+
order?: LogOrder;
|
|
7845
|
+
/** Initial `order` while uncontrolled. Default `newest-last`. */
|
|
7846
|
+
defaultOrder?: LogOrder;
|
|
7847
|
+
/** Called with the order to move to. */
|
|
7848
|
+
onOrderChange?: (order: LogOrder) => void;
|
|
7849
|
+
/** The download button is there when this is given. The host builds the file from its buffer. */
|
|
7850
|
+
onDownload?: () => void;
|
|
7851
|
+
/** The clear button is there when this is given. */
|
|
7852
|
+
onClear?: () => void;
|
|
7853
|
+
/** BCP 47 tag for the counts. Default `en-US`: the numbers do not change between server and browser. */
|
|
7854
|
+
locale?: string;
|
|
7855
|
+
className?: string;
|
|
7856
|
+
};
|
|
7857
|
+
/**
|
|
7858
|
+
* LogToolbar — the controls above a `LogViewer`, each there only when its props are given: Live /
|
|
7859
|
+
* Paused, level toggles with their counts, search with previous / next and an optional regular
|
|
7860
|
+
* expression, a source filter, wrap, order, download and clear. It holds none of the log: the host
|
|
7861
|
+
* passes the same filters to the toolbar and the viewer.
|
|
7862
|
+
*
|
|
7863
|
+
* From `sm` up it is one bar. Below, Live / Paused and the search stay in the bar, and the levels,
|
|
7864
|
+
* the sources and the view options move into a "Filters" popover whose button counts the active
|
|
7865
|
+
* filters (levels narrowed, sources chosen). It sits in a page header, a card header, or on its own.
|
|
7866
|
+
*/
|
|
7867
|
+
declare const LogToolbar: ({ "aria-label": ariaLabel, live: liveProp, defaultLive, onLiveChange, levels, levelCounts, activeLevels: levelsProp, defaultActiveLevels, onActiveLevelsChange, search: searchProp, defaultSearch, onSearchChange, searchRegex: regexProp, defaultSearchRegex, onSearchRegexChange, matchCount, activeMatch, onActiveMatchChange, sources, activeSources: sourcesProp, defaultActiveSources, onActiveSourcesChange, wrap: wrapProp, defaultWrap, onWrapChange, order: orderProp, defaultOrder, onOrderChange, onDownload, onClear, locale, className, }: LogToolbarProps) => react.JSX.Element;
|
|
7868
|
+
|
|
7869
|
+
type LogEntryContext = {
|
|
7870
|
+
/** The lines just before the entry, oldest first. */
|
|
7871
|
+
before: readonly LogLine[];
|
|
7872
|
+
/** The lines just after it, oldest first. */
|
|
7873
|
+
after: readonly LogLine[];
|
|
7874
|
+
};
|
|
7875
|
+
type LogEntryDetailProps = {
|
|
7876
|
+
/** The record to show in full. */
|
|
7877
|
+
line: LogLine;
|
|
7878
|
+
/**
|
|
7879
|
+
* The lines around the entry, for "Show context". Passed up front, the button only shows them;
|
|
7880
|
+
* left out, pressing it calls `onShowContext` and the host passes them once it has them.
|
|
7881
|
+
*/
|
|
7882
|
+
context?: LogEntryContext;
|
|
7883
|
+
/**
|
|
7884
|
+
* Called when "Show context" is pressed and there is no `context` yet: fetch the lines around
|
|
7885
|
+
* `line`. The button is there when this or `context` is given.
|
|
7886
|
+
*/
|
|
7887
|
+
onShowContext?: (line: LogLine) => void;
|
|
7888
|
+
/** Called after a field value is copied. Every field has a copy button. */
|
|
7889
|
+
onCopyField?: (field: string, value: unknown) => void;
|
|
7890
|
+
/** Adds a "Filter on this value" button to every field, called with the field and its value. */
|
|
7891
|
+
onFilterValue?: (field: string, value: unknown) => void;
|
|
7892
|
+
/** Adds an "Exclude this value" button to every field, called with the field and its value. */
|
|
7893
|
+
onExcludeValue?: (field: string, value: unknown) => void;
|
|
7894
|
+
/** BCP 47 tag for the time. Default: the browser's language. */
|
|
7895
|
+
locale?: string;
|
|
7896
|
+
/** IANA zone for the time. Default: the browser's zone. */
|
|
7897
|
+
timeZone?: string;
|
|
7898
|
+
className?: string;
|
|
7899
|
+
};
|
|
7900
|
+
/**
|
|
7901
|
+
* LogEntryDetail — one log record in full, for a drawer or a side panel: its level, time, source
|
|
7902
|
+
* and message, the fields as key / value pairs with a copy button (and "filter on" / "exclude"
|
|
7903
|
+
* buttons when the host handles them), the stack trace, the raw JSON, and the lines around it on
|
|
7904
|
+
* demand. Everything is text, never HTML.
|
|
7905
|
+
*/
|
|
7906
|
+
declare const LogEntryDetail: ({ line, context, onShowContext, onCopyField, onFilterValue, onExcludeValue, locale, timeZone, className, }: LogEntryDetailProps) => react.JSX.Element;
|
|
7907
|
+
|
|
7908
|
+
/** The level of a line: `level` lower-cased, or `unknown` when it is missing or not a `LogLevel`. */
|
|
7909
|
+
declare const parseLogLevel: (level: string | undefined) => LogLevelKey;
|
|
7910
|
+
/** Lines per level, every level present (0 when none): the counts of the toolbar's toggles. */
|
|
7911
|
+
declare const countLogLevels: (lines: readonly LogLine[]) => Record<LogLevelKey, number>;
|
|
7912
|
+
/**
|
|
7913
|
+
* The lines the filters keep. `levels` and `sources` are the ones to show: left out (`undefined`)
|
|
7914
|
+
* means no filter on that side, and an empty `sources` too (nothing chosen is "all sources"),
|
|
7915
|
+
* while an empty `levels` shows nothing. A line without a source passes the source filter only
|
|
7916
|
+
* when none is chosen. Returns `lines` itself when nothing is filtered.
|
|
6522
7917
|
*/
|
|
6523
|
-
declare
|
|
7918
|
+
declare const filterLogLines: (lines: readonly LogLine[], levels?: readonly LogLevelKey[], sources?: readonly string[]) => readonly LogLine[];
|
|
6524
7919
|
|
|
6525
|
-
export { AccentPicker, Accordion, ActionPanel, ActiveFiltersBar, ActivityFeed, AlertBanner, AnnouncementBar, AppearanceMenu, AppearanceSettings, AuditDiff, AuthLayout, Avatar, AvatarGroup, AvatarUploader, BackToTopFab, Backdrop, Badge, BarList, Blockquote, Breadcrumb, Button, ButtonGroup, COSMOS_ACCENTS, COSMOS_FONTS, COSMOS_SYSTEM_THEME, COSMOS_TEXT_SIZES, COSMOS_THEMES, Calendar, Card, Carousel, CarouselRoot, ChatComposer, ChatConversationList, ChatDaySeparator, ChatMessage, ChatMessageActions, ChatSources, ChatSuggestions, ChatThread, ChatToolCall, ChatTypingIndicator, Chatbot, Checkbox, CheckboxGroup, Clipboard, Clock,
|
|
6526
|
-
export type { AccentColor, AccentPickerProps, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSize, AccordionTriggerProps, ActionPanelLayout, ActionPanelProps, ActiveFilter, ActiveFiltersBarProps, ActivityFeedIntent, ActivityFeedItemProps, ActivityFeedProps, AlertBannerAppearance, AlertBannerBodyTone, AlertBannerIntent, AlertBannerProps, AnnouncementBarIntent, AnnouncementBarProps, AppearanceMenuProps, AppearanceMenuSize, AppearanceSettingsProps, AuditChange, AuditDiffLabels, AuditDiffProps, AuditDiffVariant, AuthLayoutProps, AuthLayoutVariant, AvatarGroupProps, AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarStatus, AvatarUploaderProps, AvatarUploaderSize, BackToTopFabIntent, BackToTopFabPosition, BackToTopFabProps, BackdropProps, BadgeAppearance, BadgeProps, BadgeShape, BadgeSize, BarListIntent, BarListItem, BarListProps, BlockquoteAlign, BlockquoteProps, BlockquoteSize, BlockquoteVariant, BreadcrumbItem, BreadcrumbProps, BreadcrumbSeparator, ButtonGroupOrientation, ButtonGroupProps, ButtonIntent, ButtonProps, ButtonShape, ButtonSize, ButtonVariant, CalendarEvent, CalendarProps, CardImageProps, CardOrientation, CardProps, CarouselControlsProps, CarouselIndicatorsProps, CarouselOptions, CarouselProps, CarouselSlideProps, CarouselThumbnailsProps, CarouselViewportProps, ChatComposerProps, ChatConversation, ChatConversationListProps, ChatDaySeparatorProps, ChatFeedback, ChatMessageActionsProps, ChatMessageDirection, ChatMessageProps, ChatMessageStatus, ChatPresence, ChatSource, ChatSourcesProps, ChatSuggestionsProps, ChatThreadProps, ChatToolCallProps, ChatToolCallStatus, ChatTypingIndicatorProps, ChatbotMessage, ChatbotProps, CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, CheckboxSize, ClipboardProps, ClipboardSize, ClipboardVariant, ClockProps, ClockVariant,
|
|
7920
|
+
export { AccentPicker, Accordion, ActionPanel, ActiveFiltersBar, ActivityFeed, AlertBanner, AnnouncementBar, AppearanceMenu, AppearanceSettings, AuditDiff, AuthLayout, Avatar, AvatarGroup, AvatarUploader, BEAT_NAME, BEAT_STATUSES, BackToTopFab, Backdrop, Badge, BarList, Blockquote, Breadcrumb, Button, ButtonGroup, COSMOS_ACCENTS, COSMOS_DENSITIES, COSMOS_FONTS, COSMOS_RADII, COSMOS_SYSTEM_THEME, COSMOS_TEXT_SIZES, COSMOS_THEMES, CUSTOMIZER_DEFAULT_VALUE, CUSTOMIZER_SECTIONS, Calendar, Card, Carousel, CarouselRoot, ChatComposer, ChatConversationList, ChatDaySeparator, ChatMessage, ChatMessageActions, ChatSources, ChatSuggestions, ChatThread, ChatToolCall, ChatTypingIndicator, Chatbot, Checkbox, CheckboxGroup, Clipboard, Clock, ColBox, ColorInput, ColorSwatch, ColumnFilterDropdown, ColumnHeader, Combobox, CommandPalette, CommandPaletteTrigger, Comment, CommentComposer, CommentThread, ConfirmationModal, ContentNarrow, CookieBanner, Countdown, Customizer, DEFAULT_THRESHOLDS, DataTable, DatePicker, DateTime, DescriptionList, Divider, Drawer, Dropdown, Dropzone, EmptyState, ErrorPage, ErrorState, EventCalendar, FieldSize, Figure, FileInput, FileTile, FormFooter, FormRow, GridList, HealthBadge, HealthCheckList, HealthDot, HealthMatrix, HealthSummary, HeartbeatBar, HelpOverlay, IconBox, ImageGrid, Input, IntegrationCard, Intent, JobLog, KanbanBoard, Kbd, KpiCard, LOG_LEVELS, LOG_LEVEL_KEYS, LOG_LEVEL_LABEL, Link, LinkProvider, List, LoadingState, LogEntryDetail, LogLevelBadge, LogToolbar, LogViewer, MediaObject, Menu, MiniCalendar, Modal, MonitorRow, MultiSelect, Navbar, NotificationCard, NotificationsPanel, NumberInput, OptionCard, OptionPicker, OtpInput, PageActionButton, PageActionIconButton, PageContainer, PageHeader, Pagination, PaletteCard, PalettePicker, PasswordInput, PasswordPolicyChecker, PhoneInput, PipelineStages, Popover, ProfileHeader, ProgressBar, ProgressRing, REFRESH_OPTIONS, Radio, RadioGroup, Rating, RecordPager, RefreshButton, RelativeTime, ResetPasswordForm, Ribbon, Row, RowActionButton, RowActionsMenu, SEVERITY_ORDER, STATUS_DOT, STATUS_NAME, STATUS_PILL, SearchInput, SecretValue, SectionCard, SectionLabel, SegmentedControl, Select, Shell, Sidebar, SidebarToggle, SignInForm, SignUpForm, Sk, SkeletonAvatarText, SkeletonList, SkeletonTable, SkeletonText, Slider, SocialAuthButtons, Spinner, SplitView, StackedList, StatefulSaveButton, StatusBadge, Stepper, StepperRoot, StickyScrollNav, Table, TableAmountCell, TableBody, TableCaption, TableCell, TableDescriptionCell, TableFoot, TableHead, TableHeaderCell, TableIdCell, TableIdentityCell, TableRow, TableSkeletonRows, Tabs, Tag, TagInput, Textarea, ThemeToggle, ThemeToggleTri, TimePicker, Timeline, Toaster, Toggle, Tooltip, TooltipHelp, Topbar, TrendDelta, TwoStepVerificationForm, UnsavedIndicator, UploadQueue, UptimeBars, UptimeStat, UserMenu, VerticalNavigation, VideoEmbed, ZoomBar, applyAppearance, compareSeverity, countLogLevels, defaultPasswordRules, filterLogLines, flattenChecks, formatUptime, groupWorst, isDarkTheme, jobLogLineHref, parseJobLogHash, parseLogLevel, resolveTheme, resolveThresholds, systemPrefersDark, toCsv, uptimeLevel, useAutoRefresh, useSplitView, watchSystemTheme, worstStatus };
|
|
7921
|
+
export type { AccentColor, AccentPickerProps, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSize, AccordionTriggerProps, ActionPanelLayout, ActionPanelProps, ActiveFilter, ActiveFiltersBarProps, ActivityFeedIntent, ActivityFeedItemProps, ActivityFeedProps, AlertBannerAppearance, AlertBannerBodyTone, AlertBannerIntent, AlertBannerProps, AnnouncementBarIntent, AnnouncementBarProps, AppearanceMenuProps, AppearanceMenuSize, AppearanceSettingsProps, AuditChange, AuditDiffLabels, AuditDiffProps, AuditDiffVariant, AuthLayoutProps, AuthLayoutVariant, AvatarGroupProps, AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarStatus, AvatarUploaderProps, AvatarUploaderSize, BackToTopFabIntent, BackToTopFabPosition, BackToTopFabProps, BackdropProps, BadgeAppearance, BadgeProps, BadgeShape, BadgeSize, BarListIntent, BarListItem, BarListProps, Beat, BeatStatus, BlockquoteAlign, BlockquoteProps, BlockquoteSize, BlockquoteVariant, BreadcrumbItem, BreadcrumbProps, BreadcrumbSeparator, ButtonGroupOrientation, ButtonGroupProps, ButtonIntent, ButtonProps, ButtonShape, ButtonSize, ButtonVariant, CalendarEvent, CalendarProps, CardImageProps, CardOrientation, CardProps, CarouselControlsProps, CarouselIndicatorsProps, CarouselOptions, CarouselProps, CarouselSlideProps, CarouselThumbnailsProps, CarouselViewportProps, CellEditor, ChatComposerProps, ChatConversation, ChatConversationListProps, ChatDaySeparatorProps, ChatFeedback, ChatMessageActionsProps, ChatMessageDirection, ChatMessageProps, ChatMessageStatus, ChatPresence, ChatSource, ChatSourcesProps, ChatSuggestionsProps, ChatThreadProps, ChatToolCallProps, ChatToolCallStatus, ChatTypingIndicatorProps, ChatbotMessage, ChatbotProps, CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, CheckboxSize, ClipboardProps, ClipboardSize, ClipboardVariant, ClockProps, ClockVariant, ColBoxProps, ColorInputProps, ColorPreset, ColorSwatchProps, ColumnDef, ColumnEdit, ColumnFilterDropdownProps, ColumnHeaderProps, ColumnPin, ComboboxOption, ComboboxProps, CommandPaletteFooterProps, CommandPaletteGroupProps, CommandPaletteInputProps, CommandPaletteItemProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerProps, CommentComposerMode, CommentComposerProps, CommentLabels, CommentProps, CommentThreadProps, CommentVariant, ConfirmationModalProps, ContentNarrowProps, CookieBannerPosition, CookieBannerProps, CosmosAccent, CosmosAccentMeta, CosmosAppearance, CosmosDensity, CosmosDensityMeta, CosmosDirection, CosmosFont, CosmosFontMeta, CosmosRadius, CosmosRadiusMeta, CosmosSystemThemeMeta, CosmosSystemThemes, CosmosTextSize, CosmosTextSizeMeta, CosmosTheme, CosmosThemeChoice, CosmosThemeMeta, CosmosToasterProps, CountdownProps, CountdownUnit, CountdownVariant, CustomizerLayout, CustomizerPreset, CustomizerProps, CustomizerSection, CustomizerSidebar, CustomizerValue, DataTableBulkAction, DataTableDensity, DataTableExportQuery, DataTableFilterTabOption, DataTableFilterTabsConfig, DataTableProps, DataTableSort, DataTableView, DatePickerMode, DatePickerProps, DateRange, DateTimeFormat, DateTimeProps, DescriptionListItemProps, DescriptionListProps, DividerAlign, DividerIconProps, DividerProps, DividerRowProps, DrawerHeaderProps, DrawerProps, DrawerSide, DrawerSize, DropdownDivider, DropdownItem, DropdownOption, DropdownProps, DropzoneProps, DropzoneRejection, EmptyStateIntent, EmptyStateProps, ErrorPageProps, ErrorStateProps, EventCalendarIntent, EventCalendarProps, FigureAlign, FigureProps, FigureRadius, FigureSize, FileInputProps, FileKind, FileTileLayout, FileTileProps, FormFooterAlign, FormFooterProps, FormRowProps, GridListCardProps, GridListCols, GridListFooterActionProps, GridListFooterProps, GridListProps, HealthBadgeProps, HealthCheck, HealthCheckGroup, HealthCheckListProps, HealthDotProps, HealthMatrixCell, HealthMatrixColumn, HealthMatrixProps, HealthMatrixRow, HealthStatus, HealthSummaryProps, HeartbeatBarProps, HeartbeatBarSize, HeartbeatBarVariant, HelpOverlayProps, HelpOverlaySectionProps, HelpOverlayShortcutProps, IconBoxProps, IconBoxSize, ImageGridColumns, ImageGridGap, ImageGridItemProps, ImageGridLayout, ImageGridProps, InputProps, IntegrationCardProps, IntegrationStatus, JobLogControl, JobLogLine, JobLogLineRef, JobLogProps, JobLogStep, JobLogTimestampFormat, JobStatus, KanbanBoardProps, KanbanCard, KanbanColumn, KanbanMove, KbdProps, KbdSize, KpiCardIntent, KpiCardProps, LinkComponent, LinkComponentProps, LinkIntent, LinkProps, LinkProviderProps, LinkVariant, ListItemProps, ListMarker, ListOrientation, ListProps, ListSpacing, ListVariant, LoadingStateProps, LogColumn, LogDensity, LogEntryContext, LogEntryDetailProps, LogLevel, LogLevelBadgeProps, LogLevelKey, LogLine, LogLineId, LogOrder, LogTone, LogToolbarProps, LogViewerProps, MediaObjectAlign, MediaObjectBodyProps, MediaObjectImageProps, MediaObjectPosition, MediaObjectProps, MenuCheckboxItemProps, MenuContentProps, MenuGroupProps, MenuItemIntent, MenuItemProps, MenuProps, MenuRadioItemProps, MenuTriggerProps, MiniCalendarProps, ModalAlertIntent, ModalAlertLayout, ModalAlertProps, ModalHeaderProps, ModalProps, ModalSize, MonitorRowProps, MonitorState, MultiSelectOption, MultiSelectProps, NavbarItemProps, NavbarItemsProps, NavbarMenuProps, NavbarMobileMenuButtonProps, NavbarProps, NavbarTheme, NotificationCardCondensedProps, NotificationCardSimpleProps, NotificationIntent, NotificationsPanelContentProps, NotificationsPanelCountersProps, NotificationsPanelEmptyProps, NotificationsPanelFooterProps, NotificationsPanelHeaderActionProps, NotificationsPanelHeaderProps, NotificationsPanelIntent, NotificationsPanelItemProps, NotificationsPanelListProps, NotificationsPanelProps, NotificationsPanelTriggerProps, NumberInputProps, OptionCardProps, OptionItem, OptionPickerProps, OtpInputProps, PageActionButtonProps, PageActionIconButtonProps, PageActionIntent, PageActionVariant, PageContainerProps, PageContainerWidth, PageHeaderMetaItemProps, PageHeaderProps, PaginationPrevNextLabel, PaginationProps, PaginationSize, PaginationVariant, PaletteCardProps, PaletteMeta, PalettePickerProps, PalettePreview, PasswordInputProps, PasswordPolicyCheckerProps, PasswordRule, PhoneInputProps, PipelineStage, PipelineStageIntent, PipelineStagesProps, PopoverAlign, PopoverContentProps, PopoverPosition, PopoverProps, PopoverTriggerProps, ProfileHeaderProps, ProfileHeaderStat, ProgressBarIntent, ProgressBarLabel, ProgressBarProps, ProgressBarSegment, ProgressBarSize, ProgressRingIntent, ProgressRingProps, ProgressRingSize, RadioGroupOption, RadioGroupProps, RadioProps, RadioSize, RatingProps, RecordPagerHotkeys, RecordPagerLabels, RecordPagerProps, RecordPagerVariant, RefreshButtonProps, RefreshOption, RelativeTimeProps, ResetPasswordFormProps, RibbonIntent, RibbonPosition, RibbonProps, RibbonShape, RowActionButtonProps, RowActionsMenuProps, RowProps, SaveState, SearchInputProps, SecretValueProps, SectionCardProps, SectionLabelProps, SegmentOption, SegmentedControlProps, SegmentedProgressBarProps, SelectOption, SelectProps, ShellContainer, ShellProps, SidebarGroupProps, SidebarItemProps, SidebarProps, SidebarSectionProps, SidebarToggleProps, SidebarToggleVariant, SidebarVariant, SignInFormProps, SignInFormValues, SignUpFormProps, SignUpFormValues, SingleProgressBarProps, SkProps, SkeletonAvatarTextProps, SkeletonListProps, SkeletonTableProps, SkeletonTextProps, SliderIntent, SliderProps, SliderValue, SocialAuthButtonsLayout, SocialAuthButtonsProps, SocialProvider, SortDirection, SpinnerIntent, SpinnerProps, SpinnerSize, SplitViewBreakpoint, SplitViewPaneProps, SplitViewProps, StackedListHeaderProps, StackedListItemProps, StackedListProps, StatefulSaveButtonProps, StatusBadgeProps, StepStatus, StepperOrientation, StepperProps, StepperSize, StepperStepProps, StepperVariant, StickyScrollNavProps, StickyScrollNavSection, TabProps, TableAmountCellProps, TableBodyProps, TableCaptionProps, TableCellProps, TableDescriptionCellProps, TableFootProps, TableHeadProps, TableHeaderCellProps, TableIdCellProps, TableIdentityCellProps, TableProps, TableRowProps, TableSkeletonRowsProps, TabsOrientation, TabsProps, TabsVariant, TagInputProps, TagProps, TagSize, TextareaProps, TextareaResize, ThemeMode, ThemeModeChoice, ThemeToggleProps, ThemeToggleSize, ThemeToggleTriProps, ThemeToggleTriSize, TimePickerProps, TimelineIntent, TimelineItem, TimelineProps, TimelineVariant, ToggleProps, ToggleSize, TooltipIntent, TooltipPosition, TooltipProps, TooltipVariant, TopbarProps, TrendDeltaProps, TrendDeltaSize, TwoStepVerificationFormProps, UnsavedIndicatorProps, UploadQueueItem, UploadQueueProps, UploadStatus, UptimeBarsPeriod, UptimeBarsProps, UptimeCertificate, UptimeDay, UptimeLevel, UptimePeriod, UptimeStatProps, UptimeThresholds, UserMenuContentProps, UserMenuHeaderProps, UserMenuItemIntent, UserMenuItemProps, UserMenuProps, UserMenuTriggerProps, VerticalNavigationItemProps, VerticalNavigationProps, VerticalNavigationSectionProps, VideoEmbedAspect, VideoEmbedProps, ZoomBarProps };
|