@wso2/oxygen-ui 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/.ai/AGENTS.md +4 -2
  2. package/.ai/components.md +332 -0
  3. package/.ai/patterns.md +12 -8
  4. package/.ai/theming.md +4 -4
  5. package/.claude/components.md +332 -0
  6. package/.claude/patterns.md +12 -8
  7. package/.claude/skills/oxygen-component/SKILL.md +86 -0
  8. package/.claude/skills/oxygen-form/SKILL.md +8 -0
  9. package/.claude/skills/oxygen-layout/SKILL.md +1 -0
  10. package/.claude/theming.md +4 -4
  11. package/README.md +3 -3
  12. package/dist/components/AppBreadcrumbs/AppBreadcrumbs.d.ts +15 -2
  13. package/dist/components/ContextSwitcher/ContextSwitcher.d.ts +69 -0
  14. package/dist/components/ContextSwitcher/ContextSwitcherGroup.d.ts +39 -0
  15. package/dist/components/ContextSwitcher/ContextSwitcherLevel.d.ts +51 -0
  16. package/dist/components/ContextSwitcher/ContextSwitcherOption.d.ts +41 -0
  17. package/dist/components/ContextSwitcher/OverflowTooltip.d.ts +38 -0
  18. package/dist/components/ContextSwitcher/context.d.ts +41 -0
  19. package/dist/components/ContextSwitcher/index.d.ts +26 -0
  20. package/dist/components/ContextSwitcher/model.d.ts +44 -0
  21. package/dist/components/DrawerPanel/DrawerPanel.d.ts +98 -0
  22. package/dist/components/DrawerPanel/DrawerPanelActions.d.ts +44 -0
  23. package/dist/components/DrawerPanel/DrawerPanelBody.d.ts +42 -0
  24. package/dist/components/DrawerPanel/DrawerPanelCloseButton.d.ts +44 -0
  25. package/dist/components/DrawerPanel/DrawerPanelExpandButton.d.ts +46 -0
  26. package/dist/components/DrawerPanel/DrawerPanelFooter.d.ts +41 -0
  27. package/dist/components/DrawerPanel/DrawerPanelHeader.d.ts +44 -0
  28. package/dist/components/DrawerPanel/DrawerPanelTitle.d.ts +45 -0
  29. package/dist/components/DrawerPanel/context.d.ts +42 -0
  30. package/dist/components/DrawerPanel/index.d.ts +35 -0
  31. package/dist/components/FullScreenWizard/FullScreenWizard.d.ts +85 -0
  32. package/dist/components/FullScreenWizard/FullScreenWizardContent.d.ts +70 -0
  33. package/dist/components/FullScreenWizard/FullScreenWizardFooter.d.ts +59 -0
  34. package/dist/components/FullScreenWizard/FullScreenWizardHeader.d.ts +59 -0
  35. package/dist/components/FullScreenWizard/FullScreenWizardPreview.d.ts +61 -0
  36. package/dist/components/FullScreenWizard/FullScreenWizardProgress.d.ts +61 -0
  37. package/dist/components/FullScreenWizard/context.d.ts +71 -0
  38. package/dist/components/FullScreenWizard/index.d.ts +33 -0
  39. package/dist/components/FullScreenWizard/useWizardSteps.d.ts +85 -0
  40. package/dist/components/ListingCard/ListingCard.d.ts +92 -0
  41. package/dist/components/ListingCard/index.d.ts +2 -0
  42. package/dist/components/LogViewer/LogFilterChip.d.ts +31 -0
  43. package/dist/components/LogViewer/LogLevelMarker.d.ts +16 -0
  44. package/dist/components/LogViewer/LogViewer.d.ts +178 -0
  45. package/dist/components/LogViewer/LogViewerControls.d.ts +121 -0
  46. package/dist/components/LogViewer/LogViewerDetails.d.ts +11 -0
  47. package/dist/components/LogViewer/LogViewerSearch.d.ts +42 -0
  48. package/dist/components/LogViewer/LogViewerStream.d.ts +132 -0
  49. package/dist/components/LogViewer/LogViewerToolbar.d.ts +56 -0
  50. package/dist/components/LogViewer/columns.d.ts +17 -0
  51. package/dist/components/LogViewer/context.d.ts +81 -0
  52. package/dist/components/LogViewer/download.d.ts +14 -0
  53. package/dist/components/LogViewer/filters.d.ts +11 -0
  54. package/dist/components/LogViewer/index.d.ts +8 -0
  55. package/dist/components/LogViewer/timestamps.d.ts +26 -0
  56. package/dist/components/LogViewer/types.d.ts +163 -0
  57. package/dist/components/SearchBar/SearchBar.d.ts +7 -0
  58. package/dist/components/Sidebar/Sidebar.d.ts +2 -0
  59. package/dist/components/Sidebar/SidebarCollapseToggle.d.ts +50 -0
  60. package/dist/components/Sidebar/index.d.ts +2 -0
  61. package/dist/components/TextField/TextField.d.ts +28 -0
  62. package/dist/components/TextField/index.d.ts +2 -0
  63. package/dist/components/index.d.ts +13 -1
  64. package/dist/index.d.ts +3 -0
  65. package/dist/index.js +8520 -4539
  66. package/dist/index.js.map +4 -4
  67. package/dist/styles/OxygenThemeBase.d.ts +12 -0
  68. package/dist/styles/Themes/ChoreoLabsTheme.d.ts +20 -0
  69. package/dist/styles/Themes/index.d.ts +1 -0
  70. package/package.json +3 -2
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ /**
19
+ * A wizard step: its id, or an object that can mark the step as skipped.
20
+ */
21
+ export type WizardStepInput<T extends string = string> = T | {
22
+ id: T;
23
+ skip?: boolean;
24
+ };
25
+ /**
26
+ * Options for the useWizardSteps hook.
27
+ */
28
+ export interface UseWizardStepsOptions<T extends string = string> {
29
+ /** Step to start on. Falls back to the first visible step when it is unknown or skipped. */
30
+ initialStep?: T;
31
+ }
32
+ /**
33
+ * Return value of the useWizardSteps hook.
34
+ */
35
+ export interface UseWizardStepsReturn<T extends string = string> {
36
+ /** Id of the active step. `undefined` only when every step is skipped. */
37
+ activeStep: T | undefined;
38
+ /** Index of the active step among the visible steps (`-1` when there are none) */
39
+ activeIndex: number;
40
+ /** Ids of the visible steps, in order. Skipped steps are left out. */
41
+ steps: T[];
42
+ /** Number of visible steps */
43
+ count: number;
44
+ /** Whether the active step is the first visible step */
45
+ isFirst: boolean;
46
+ /** Whether the active step is the last visible step. `false` when every step is skipped. */
47
+ isLast: boolean;
48
+ /** Moves to the next visible step. Does nothing on the last step. */
49
+ next: () => void;
50
+ /** Moves to the previous visible step. Does nothing on the first step. */
51
+ back: () => void;
52
+ /** Moves to the given step. Unknown and skipped ids are ignored. */
53
+ goTo: (step: T) => void;
54
+ /** Progress through the visible steps, from 0 to 100, counting the active step as done */
55
+ progress: number;
56
+ }
57
+ /**
58
+ * useWizardSteps - Step state for a `FullScreenWizard`.
59
+ *
60
+ * Tracks the active step of a linear flow. Steps marked `skip` are left out
61
+ * of navigation, the count and the progress. Navigation clamps at both ends.
62
+ * The hook has no side effects and does not touch the router, so a flow
63
+ * driven by a server or by the URL can manage its own state instead.
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * const wizard = useWizardSteps(['details', { id: 'security', skip: !needsSecurity }, 'review']);
68
+ *
69
+ * <FullScreenWizard onClose={handleClose} aria-label="Create project">
70
+ * <FullScreenWizard.Progress
71
+ * value={wizard.progress}
72
+ * valueText={`Step ${wizard.activeIndex + 1} of ${wizard.count}`}
73
+ * />
74
+ * <FullScreenWizard.Content focusKey={wizard.activeStep}>
75
+ * {wizard.activeStep && stepContent[wizard.activeStep]}
76
+ * </FullScreenWizard.Content>
77
+ * <FullScreenWizard.Footer>
78
+ * {!wizard.isFirst && <Button onClick={wizard.back}>Back</Button>}
79
+ * <Button variant="contained" onClick={wizard.next}>Continue</Button>
80
+ * </FullScreenWizard.Footer>
81
+ * </FullScreenWizard>
82
+ * ```
83
+ */
84
+ export declare const useWizardSteps: <T extends string>(steps: ReadonlyArray<WizardStepInput<T>>, { initialStep }?: UseWizardStepsOptions<T>) => UseWizardStepsReturn<T>;
85
+ export default useWizardSteps;
@@ -0,0 +1,92 @@
1
+ import React from 'react';
2
+ import type { CardProps } from '@mui/material';
3
+ /**
4
+ * Props for the ListingCard component
5
+ */
6
+ export interface ListingCardProps extends Omit<CardProps, 'variant' | 'title' | 'children' | 'onClick'> {
7
+ /**
8
+ * Title of the card. Truncated when too long, with the full name in a tooltip on hover.
9
+ */
10
+ title: React.ReactNode;
11
+ /**
12
+ * Short description shown under the title. Cut off with an ellipsis after two lines, with the full text in a tooltip on hover.
13
+ * Nothing is rendered when it is not set.
14
+ */
15
+ description?: React.ReactNode;
16
+ /**
17
+ * Icon shown in the round badge. Defaults to a cube icon.
18
+ */
19
+ icon?: React.ReactNode;
20
+ /**
21
+ * Theme color of the icon badge.
22
+ * @default 'primary'
23
+ */
24
+ iconColor?: 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
25
+ /**
26
+ * Style of the icon badge: `light` is a tinted background with a colored icon, `filled` is a solid
27
+ * background with a contrasting icon.
28
+ * @default 'light'
29
+ */
30
+ iconVariant?: 'light' | 'filled';
31
+ /**
32
+ * Relative time text for the footer, e.g. "1 minute ago" or "1 day ago", shown with a clock icon.
33
+ * The time is hidden when not set.
34
+ */
35
+ updatedTime?: React.ReactNode;
36
+ /**
37
+ * Optional text before the time, e.g. "Updated".
38
+ */
39
+ updatedLabel?: React.ReactNode;
40
+ /**
41
+ * Machine-readable date/time for the footer time (e.g. an ISO 8601 string).
42
+ */
43
+ updatedDateTime?: string;
44
+ /**
45
+ * Content of the tooltip shown when hovering the time, e.g. the full date. No tooltip when not set.
46
+ */
47
+ updatedTooltip?: React.ReactNode;
48
+ /**
49
+ * Called when the delete button is clicked. The delete button is shown only when this is set,
50
+ * and appears when the card is hovered or focused.
51
+ */
52
+ onDelete?: React.MouseEventHandler<HTMLButtonElement>;
53
+ /**
54
+ * Accessible name (and tooltip) of the delete button.
55
+ * @default 'Delete'
56
+ */
57
+ deleteLabel?: string;
58
+ /**
59
+ * Custom content for the bottom right of the card, shown on hover like the delete button. Replaces the delete button.
60
+ */
61
+ actions?: React.ReactNode;
62
+ /**
63
+ * Called when the card is clicked. When set (or when `href` is set) the whole card is interactive.
64
+ */
65
+ onClick?: React.MouseEventHandler<HTMLElement>;
66
+ /**
67
+ * When set, the whole card renders as a link to this URL.
68
+ */
69
+ href?: string;
70
+ /**
71
+ * Highlights the card with a primary colored border, e.g. for the current item.
72
+ * @default false
73
+ */
74
+ selected?: boolean;
75
+ }
76
+ /**
77
+ * ListingCard component - A card for an item in a listing (such as a project) with an icon, title, description,
78
+ * last updated time and an optional delete action shown on hover.
79
+ *
80
+ * @example
81
+ * ```tsx
82
+ * <ListingCard
83
+ * title="Default"
84
+ * description="Default project"
85
+ * updatedTime="1 day ago"
86
+ * onClick={() => openItem(id)}
87
+ * onDelete={() => deleteItem(id)}
88
+ * />
89
+ * ```
90
+ */
91
+ declare const ListingCard: React.FC<ListingCardProps>;
92
+ export default ListingCard;
@@ -0,0 +1,2 @@
1
+ export { default } from './ListingCard';
2
+ export * from './ListingCard';
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Props for the chip that shows one applied filter in the toolbar of a LogViewer.
4
+ */
5
+ interface LogFilterChipProps {
6
+ /** Name of the filter, shown before the value (e.g. "Status"). */
7
+ name: string;
8
+ /** Current value of the filter (e.g. "Failed"). */
9
+ value: React.ReactNode;
10
+ /** Called when the chip is clicked, to reopen the picker of this filter. */
11
+ onOpen?: (event: React.MouseEvent<HTMLElement>) => void;
12
+ /** Called when the remove icon is clicked, or Backspace or Delete is pressed on the focused chip. */
13
+ onRemove?: () => void;
14
+ /**
15
+ * The action of the chip while it can be clicked to change the filter. Its accessible name is the text
16
+ * the chip shows, then this: `Status: Failed, Change status filter`. A value that is not text cannot be
17
+ * put into a name, so then this alone is the name.
18
+ * @default `Change ${name} filter`, with the name in lower case
19
+ */
20
+ changeLabel?: string;
21
+ /**
22
+ * Accessible name of the remove icon.
23
+ * @default `Remove ${name} filter`, with the name in lower case
24
+ */
25
+ removeLabel?: string;
26
+ }
27
+ /**
28
+ * An applied filter as a removable `name: value` chip, built on the standard `Chip`.
29
+ */
30
+ declare const LogFilterChip: React.FC<LogFilterChipProps>;
31
+ export default LogFilterChip;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import type { LogLevel } from './types';
3
+ /**
4
+ * The text each level is shown as.
5
+ */
6
+ export declare const DEFAULT_LEVEL_LABELS: Record<LogLevel, string>;
7
+ export interface LogLevelMarkerProps {
8
+ level: LogLevel;
9
+ label: string;
10
+ }
11
+ /**
12
+ * The marker shown before a log line. It always has text, so severity is never shown by color
13
+ * alone. It is a span, because it sits inside a button.
14
+ */
15
+ declare const LogLevelMarker: React.FC<LogLevelMarkerProps>;
16
+ export default LogLevelMarker;
@@ -0,0 +1,178 @@
1
+ import * as React from 'react';
2
+ import type { PaperProps } from '@mui/material/Paper';
3
+ import type { SxProps, Theme } from '@mui/material/styles';
4
+ import { LogViewerCount, LogViewerDownload, LogViewerRefresh, LogViewerSort, LogViewerTimeZone } from './LogViewerControls';
5
+ import LogViewerSearch from './LogViewerSearch';
6
+ import LogViewerStream from './LogViewerStream';
7
+ import LogViewerToolbar from './LogViewerToolbar';
8
+ import type { LogEntry, LogColumn, LogFilterDefinition, LogFilterValue, LogFilterValues, LogLevel, LogSort, LogTimeZone, LogViewerOrder } from './types';
9
+ /**
10
+ * Props for the LogViewer component. The root holds the data and the state of the viewer; what its
11
+ * parts look like and say is set on the parts (`LogViewer.Toolbar`, `LogViewer.Stream` and the
12
+ * controls in the toolbar). The props it does not define itself, such as `className` and `data-*`,
13
+ * go to the outer element.
14
+ */
15
+ export interface LogViewerProps extends Omit<PaperProps, 'children' | 'onCopy' | 'sx'> {
16
+ /**
17
+ * Entries, newest first, in the order a log is read from its source. The viewer reverses them
18
+ * itself when the reader chooses oldest first.
19
+ */
20
+ entries: LogEntry[];
21
+ /**
22
+ * The columns of each entry, under a heading row. A column is `{ id, label, width, render, text,
23
+ * filterId, sortable }`; `time` and `level` are built in. The heading of a column holds its sort
24
+ * control (`sortable`) and its filter (`filterId`, an id from `filters`), so such a filter is not
25
+ * also shown in the toolbar. When the columns do not fit, the list scrolls sideways.
26
+ */
27
+ columns: LogColumn[];
28
+ /**
29
+ * Hides the heading row, for a log that reads as one line per entry. The row stays in the table,
30
+ * visually hidden, so assistive technology still announces each cell under its column, which is why
31
+ * the columns should have labels. Its sort and filter controls are not offered: the filters appear in
32
+ * the toolbar instead, and `LogViewer.Sort` switches the order.
33
+ * @default false
34
+ */
35
+ hideHeading?: boolean;
36
+ /**
37
+ * The parts of the viewer, top to bottom: usually a `LogViewer.Toolbar` and a `LogViewer.Stream`.
38
+ * Leave it out for a viewer with just the stream.
39
+ */
40
+ children?: React.ReactNode;
41
+ /**
42
+ * Which end of the list holds the newest entries. Older entries load at the other end. Set it
43
+ * to control the order; leave it out and the viewer keeps the order itself, starting at
44
+ * `defaultOrder`.
45
+ */
46
+ order?: LogViewerOrder;
47
+ /**
48
+ * The order the viewer starts in when `order` is not set.
49
+ * @default 'newest-first'
50
+ */
51
+ defaultOrder?: LogViewerOrder;
52
+ /**
53
+ * Called when the reader switches the order.
54
+ */
55
+ onOrderChange?: (order: LogViewerOrder) => void;
56
+ /**
57
+ * True while the first page is loading.
58
+ * @default false
59
+ */
60
+ loading?: boolean;
61
+ /**
62
+ * True while older entries are loading. Optional: when `onLoadOlder` returns its request's
63
+ * promise, the viewer shows the load button as busy while the promise is pending. Set this when
64
+ * `onLoadOlder` does not return the promise, or to show the busy state from elsewhere.
65
+ * @default false
66
+ */
67
+ loadingOlder?: boolean;
68
+ /**
69
+ * True when entries older than the loaded ones can still be loaded.
70
+ * @default false
71
+ */
72
+ hasMoreOlder?: boolean;
73
+ /**
74
+ * Called when older entries are wanted: when the reader scrolls toward the older end, or uses
75
+ * the load older button. It is not called while loading or when `hasMoreOlder` is false, and
76
+ * not again until the request finishes. Return the request's promise, so the viewer knows when it
77
+ * finishes and shows the button as busy meanwhile; or set `loadingOlder` while it runs. With neither,
78
+ * the viewer cannot tell when the request ends, so it asks again only after the entries change: a
79
+ * request that fails without a promise or `loadingOlder` leaves the button unable to ask again.
80
+ */
81
+ onLoadOlder?: () => void | Promise<unknown>;
82
+ /**
83
+ * The time zone timestamps are shown in. Set it to control the zone; leave it out and the viewer
84
+ * keeps the zone itself, starting at `defaultTimeZone`. Copied and downloaded lines always carry
85
+ * the zone, as ISO 8601.
86
+ */
87
+ timeZone?: LogTimeZone;
88
+ /**
89
+ * The time zone the viewer starts in when `timeZone` is not set.
90
+ * @default 'utc'
91
+ */
92
+ defaultTimeZone?: LogTimeZone;
93
+ /**
94
+ * Called when the reader switches the time zone.
95
+ */
96
+ onTimeZoneChange?: (timeZone: LogTimeZone) => void;
97
+ /**
98
+ * Filters of the viewer, in order, as buttons in the toolbar or in a column heading, with a chip
99
+ * for each applied value. The viewer only displays them and reports changes; it never filters
100
+ * the entries itself.
101
+ */
102
+ filters?: LogFilterDefinition[];
103
+ /**
104
+ * The applied filters, keyed by filter id. The viewer does not keep this state.
105
+ */
106
+ filterValues?: LogFilterValues;
107
+ /**
108
+ * Called with a filter's id and its new value when the reader picks a value (`null` when the
109
+ * reader clears it). Apply the change to your data here.
110
+ */
111
+ onFilterChange?: (id: string, value: LogFilterValue) => void;
112
+ /**
113
+ * The column the entries are sorted by, when it is not the time. Sorting by the time is the
114
+ * `order` of the viewer. The viewer does not sort: load the entries already sorted, in
115
+ * `onSortChange`. While this is set, entries are shown in the order given.
116
+ */
117
+ sort?: LogSort | null;
118
+ /**
119
+ * Called when the reader sorts by a column other than the time, or clears that sort with
120
+ * `null`. Reorder or reload the entries here.
121
+ */
122
+ onSortChange?: (sort: LogSort | null) => void;
123
+ /**
124
+ * Error shown above the list.
125
+ */
126
+ error?: React.ReactNode;
127
+ /**
128
+ * Called when the reader uses the Try again button, which the error shows when this is set.
129
+ * Start the request that failed again.
130
+ */
131
+ onRetry?: () => void;
132
+ /**
133
+ * Warning shown above the list.
134
+ */
135
+ warning?: React.ReactNode;
136
+ /**
137
+ * Called after an entry's Copy button is used, with whether the text was copied. Use it to show
138
+ * feedback.
139
+ */
140
+ onCopy?: (entry: LogEntry, copied: boolean) => void;
141
+ /**
142
+ * Gives the link to one entry, such as a URL that opens the page on that entry. Each entry shows a
143
+ * Copy link button when this returns a link. The viewer cannot build the URL, because it does not
144
+ * know your routes.
145
+ */
146
+ getEntryLink?: (entry: LogEntry) => string | undefined;
147
+ /**
148
+ * Called after an entry's Copy link button is used, with whether the link was copied. Use it to
149
+ * show feedback.
150
+ */
151
+ onCopyLink?: (entry: LogEntry, copied: boolean) => void;
152
+ /**
153
+ * The entry to mark and scroll into view, such as the one a shared link points at. Load the page
154
+ * of entries that holds it, then set its id here.
155
+ */
156
+ highlightedEntryId?: string;
157
+ /**
158
+ * Text of the markers for entry levels. Give only the levels you change.
159
+ * @default { trace: 'Trace', debug: 'Debug', info: 'Info', warn: 'Warn', error: 'Error', fatal: 'Fatal' }
160
+ */
161
+ levelLabels?: Partial<Record<LogLevel, string>>;
162
+ /**
163
+ * Custom styles for the root element.
164
+ */
165
+ sx?: SxProps<Theme>;
166
+ }
167
+ interface LogViewerComponent extends React.ForwardRefExoticComponent<LogViewerProps & React.RefAttributes<HTMLDivElement>> {
168
+ Toolbar: typeof LogViewerToolbar;
169
+ Stream: typeof LogViewerStream;
170
+ Search: typeof LogViewerSearch;
171
+ TimeZone: typeof LogViewerTimeZone;
172
+ Sort: typeof LogViewerSort;
173
+ Download: typeof LogViewerDownload;
174
+ Refresh: typeof LogViewerRefresh;
175
+ Count: typeof LogViewerCount;
176
+ }
177
+ declare const LogViewer: LogViewerComponent;
178
+ export default LogViewer;
@@ -0,0 +1,121 @@
1
+ import * as React from 'react';
2
+ import IconButton from '@mui/material/IconButton';
3
+ import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
4
+ import Typography from '@mui/material/Typography';
5
+ import type { LogEntry } from './types';
6
+ /**
7
+ * Props for LogViewer.Count. The rest of the props go to the text element.
8
+ */
9
+ export interface LogViewerCountProps extends Omit<React.ComponentProps<typeof Typography>, 'children'> {
10
+ /**
11
+ * Text of the count, for the number of loaded entries. Use it to add a unit or a note such as the
12
+ * time zone.
13
+ * @default (count) => `${count} entries`
14
+ */
15
+ label?: (count: number) => string;
16
+ }
17
+ /**
18
+ * LogViewer.Count - The number of loaded entries, as small quiet text. In the toolbar it goes before the
19
+ * applied filter chips, or after the search when there are none, wherever it is placed among the other
20
+ * controls. It passes `className`, `data-*` and other
21
+ * text props to its element, and forwards its `ref` to it.
22
+ */
23
+ export declare const LogViewerCount: React.ForwardRefExoticComponent<Omit<LogViewerCountProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
24
+ /**
25
+ * Props for LogViewer.TimeZone. The rest of the props go to the switch.
26
+ */
27
+ export interface LogViewerTimeZoneProps extends Omit<React.ComponentProps<typeof ToggleButtonGroup>, 'children' | 'value' | 'exclusive' | 'onChange' | 'aria-label'> {
28
+ /**
29
+ * Accessible name of the switch.
30
+ * @default 'Time zone'
31
+ */
32
+ label?: string;
33
+ /**
34
+ * Text of the UTC choice.
35
+ * @default 'UTC'
36
+ */
37
+ utcLabel?: string;
38
+ /**
39
+ * Text of the local time choice.
40
+ * @default 'Local'
41
+ */
42
+ localLabel?: string;
43
+ }
44
+ /**
45
+ * LogViewer.TimeZone - The UTC and Local switch. It changes the zone timestamps are shown in; set
46
+ * `timeZone` and `onTimeZoneChange` on the LogViewer to control it. It passes `className`, `data-*` and
47
+ * other switch props to its element, and forwards its `ref` to it.
48
+ */
49
+ export declare const LogViewerTimeZone: React.ForwardRefExoticComponent<Omit<LogViewerTimeZoneProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
50
+ /**
51
+ * Props for LogViewer.Sort. The rest of the props go to the button.
52
+ */
53
+ export interface LogViewerSortProps extends Omit<React.ComponentProps<typeof IconButton>, 'children' | 'onClick' | 'aria-label'> {
54
+ /**
55
+ * Accessible name and tooltip while the newest entries are first.
56
+ * @default 'Sorted newest first. Switch to oldest first'
57
+ */
58
+ newestFirstLabel?: string;
59
+ /**
60
+ * Accessible name and tooltip while the oldest entries are first.
61
+ * @default 'Sorted oldest first. Switch to newest first'
62
+ */
63
+ oldestFirstLabel?: string;
64
+ }
65
+ /**
66
+ * LogViewer.Sort - A button that switches between newest first and oldest first. It is not shown
67
+ * when the `time` column is sortable, because that column's heading does the same, unless the
68
+ * heading is hidden. It passes `className`, `data-*` and other button props to the button, and forwards
69
+ * its `ref` to it.
70
+ */
71
+ export declare const LogViewerSort: React.ForwardRefExoticComponent<Omit<LogViewerSortProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
72
+ /**
73
+ * Props for LogViewer.Download. The rest of the props go to the button.
74
+ */
75
+ export interface LogViewerDownloadProps extends Omit<React.ComponentProps<typeof IconButton>, 'children' | 'onClick' | 'aria-label'> {
76
+ /**
77
+ * Accessible name and tooltip. Use a function to say what the download holds: it receives the
78
+ * number of loaded entries and whether older ones are still to load.
79
+ * @default 'Download the N loaded entries', with 'Older entries are not included' added while
80
+ * older entries remain
81
+ */
82
+ label?: string | ((info: {
83
+ count: number;
84
+ hasMoreOlder: boolean;
85
+ }) => string);
86
+ /**
87
+ * Replaces the default download, which saves the loaded entries, in the order shown, as a text
88
+ * file with one line per entry. Called with the loaded entries in the order shown.
89
+ */
90
+ onDownload?: (entries: LogEntry[]) => void;
91
+ /**
92
+ * Name of the file the default download saves.
93
+ * @default 'logs.log'
94
+ */
95
+ fileName?: string;
96
+ }
97
+ /**
98
+ * LogViewer.Download - A button that saves the loaded entries. It is disabled while there are none.
99
+ * It passes `className`, `data-*` and other button props to the button, and forwards its `ref` to it.
100
+ */
101
+ export declare const LogViewerDownload: React.ForwardRefExoticComponent<Omit<LogViewerDownloadProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
102
+ /**
103
+ * Props for LogViewer.Refresh. The rest of the props go to the button.
104
+ */
105
+ export interface LogViewerRefreshProps extends Omit<React.ComponentProps<typeof IconButton>, 'children' | 'onClick' | 'aria-label'> {
106
+ /**
107
+ * Called when the button is used.
108
+ */
109
+ onRefresh?: () => void;
110
+ /**
111
+ * Accessible name and tooltip.
112
+ * @default 'Refresh'
113
+ */
114
+ label?: string;
115
+ }
116
+ /**
117
+ * LogViewer.Refresh - A button that asks the page to load the entries again. It is disabled while
118
+ * the first page loads. It passes `className`, `data-*` and other button props to the button, and
119
+ * forwards its `ref` to it.
120
+ */
121
+ export declare const LogViewerRefresh: React.ForwardRefExoticComponent<Omit<LogViewerRefreshProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ interface LogViewerDetailsProps {
3
+ details: Record<string, unknown>;
4
+ expandLabel?: string;
5
+ collapseLabel?: string;
6
+ }
7
+ /**
8
+ * Default expanded view of an entry: one labelled row per field.
9
+ */
10
+ declare const LogViewerDetails: React.FC<LogViewerDetailsProps>;
11
+ export default LogViewerDetails;
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import type { SearchBarBaseProps } from '../SearchBar/SearchBarBase';
3
+ /**
4
+ * Props for LogViewer.Search. The rest of the props go to the search field.
5
+ */
6
+ export interface LogViewerSearchProps extends Omit<SearchBarBaseProps, 'value' | 'onChange' | 'placeholder' | 'endAdornment' | 'onKeyDown'> {
7
+ /**
8
+ * The search text the page holds. The box keeps what the reader types, and shows this value when
9
+ * your page changes it, for example to clear the search.
10
+ * @default ''
11
+ */
12
+ value?: string;
13
+ /**
14
+ * Called with the search text once typing pauses, at once on Enter, and when the reader clears
15
+ * the box. The viewer does not search: apply the text to your data here.
16
+ */
17
+ onChange?: (value: string) => void;
18
+ /**
19
+ * Placeholder, which is also the accessible name.
20
+ * @default 'Search logs'
21
+ */
22
+ placeholder?: string;
23
+ /**
24
+ * Accessible name of the clear button.
25
+ * @default 'Clear search'
26
+ */
27
+ clearLabel?: string;
28
+ /**
29
+ * How long typing must pause, in milliseconds, before `onChange` is called. Use 0 to report
30
+ * every change.
31
+ * @default 300
32
+ */
33
+ debounceMs?: number;
34
+ }
35
+ /**
36
+ * LogViewer.Search - The search box of a LogViewer, for its toolbar. The text is reported once typing pauses, or at once on Enter or
37
+ * when cleared, so a page that searches on a server does not send a request for every key. It is
38
+ * never disabled while the page loads, because that would take the focus away mid-typing. It passes
39
+ * `className`, `data-*` and other search field props to its field, and forwards its `ref` to it.
40
+ */
41
+ declare const LogViewerSearch: React.ForwardRefExoticComponent<Omit<LogViewerSearchProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
42
+ export default LogViewerSearch;