@datum-cloud/datum-ui 2.0.0 → 2.3.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.
- package/dist/app-navigation/index.mjs +2 -2
- package/dist/{app-navigation-CNig4Maj.mjs → app-navigation--tEBCrfl.mjs} +180 -164
- package/dist/autocomplete/index.mjs +1 -1
- package/dist/{autocomplete-DM6JYV4W.mjs → autocomplete-DZ_HSBak.mjs} +1 -1
- package/dist/autosearch/index.mjs +1 -1
- package/dist/{calendar-date-picker-AzvSqjeS.mjs → calendar-date-picker-ynSGADfR.mjs} +1 -1
- package/dist/components/base/sheet/sheet.d.ts +2 -1
- package/dist/components/base/sidebar/context.d.ts +3 -0
- package/dist/components/base/sidebar/shell.d.ts +2 -2
- package/dist/components/features/app-navigation/nav-menu/index.d.ts +1 -1
- package/dist/components/features/app-navigation/nav-menu/nav-menu-context.d.ts +4 -0
- package/dist/components/features/app-navigation/nav-menu/nav-menu-item.d.ts +3 -0
- package/dist/components/features/app-navigation/nav-menu/types.d.ts +18 -0
- package/dist/components/features/date-time/date-time.d.ts +6 -0
- package/dist/components/features/date-time/formatters.d.ts +13 -0
- package/dist/components/features/date-time/index.d.ts +3 -0
- package/dist/components/features/date-time/types.d.ts +47 -0
- package/dist/components/features/index.d.ts +1 -0
- package/dist/components/features/logs/components/detail.d.ts +3 -0
- package/dist/components/features/logs/components/explorer.d.ts +3 -0
- package/dist/components/features/logs/components/filters.d.ts +11 -0
- package/dist/components/features/logs/components/root.d.ts +2 -0
- package/dist/components/features/logs/components/status-badge.d.ts +7 -0
- package/dist/components/features/logs/components/table.d.ts +3 -0
- package/dist/components/features/logs/components/toolbar.d.ts +12 -0
- package/dist/components/features/logs/fixtures/index.d.ts +2 -0
- package/dist/components/features/logs/hooks/use-controllable-state.d.ts +5 -0
- package/dist/components/features/logs/hooks/use-logs.d.ts +3 -0
- package/dist/components/features/logs/index.d.ts +4 -0
- package/dist/components/features/logs/logs.d.ts +18 -0
- package/dist/components/features/logs/types.d.ts +105 -0
- package/dist/components/features/logs/utils/build-logql.d.ts +2 -0
- package/dist/components/features/logs/utils/constants.d.ts +6 -0
- package/dist/components/features/logs/utils/facets.d.ts +3 -0
- package/dist/components/features/logs/utils/flatten-loki.d.ts +3 -0
- package/dist/components/features/logs/utils/format-timestamp.d.ts +4 -0
- package/dist/components/features/logs/utils/index.d.ts +8 -0
- package/dist/components/features/logs/utils/parse-log-line.d.ts +7 -0
- package/dist/components/features/logs/utils/severity.d.ts +5 -0
- package/dist/components/features/logs/utils/time-range.d.ts +3 -0
- package/dist/data-table/index.mjs +1 -1
- package/dist/{data-table-DjGvAdO_.mjs → data-table-Du7_FLBi.mjs} +4 -4
- package/dist/date-picker/index.mjs +3 -3
- package/dist/date-time/index.mjs +2 -0
- package/dist/date-time-CA-09lnw.mjs +134 -0
- package/dist/date-time-picker/index.mjs +1 -1
- package/dist/{date-time-picker-D3-DeNo8.mjs → date-time-picker-BzcHrf-A.mjs} +1 -1
- package/dist/{picker-b5-x-EHs.mjs → date-time-range-picker-Dog33Ry0.mjs} +22 -456
- package/dist/form/index.mjs +1 -1
- package/dist/{form-BUUNQfC9.mjs → form-BhBsoMFA.mjs} +4 -4
- package/dist/grouped-table/index.mjs +1 -1
- package/dist/{grouped-table-D4J3ioHb.mjs → grouped-table--jejU1Jy.mjs} +1 -1
- package/dist/index.mjs +21 -20
- package/dist/logs/fixtures/index.mjs +231 -0
- package/dist/logs/index.mjs +980 -0
- package/dist/mobile-sheet/index.mjs +1 -1
- package/dist/{mobile-sheet-D9L-JOee.mjs → mobile-sheet-BYp-QQmn.mjs} +1 -1
- package/dist/more-actions/index.mjs +1 -1
- package/dist/{more-actions-Bx443Ccx.mjs → more-actions-B1FUf2rm.mjs} +1 -1
- package/dist/multi-select/index.mjs +1 -1
- package/dist/{multi-select-PHaMEbY-.mjs → multi-select-PtdMChPF.mjs} +1 -1
- package/dist/picker/index.mjs +2 -1
- package/dist/picker-raVuDxsh.mjs +453 -0
- package/dist/responsive-dropdown/index.mjs +1 -1
- package/dist/{responsive-dropdown-fCmduKaz.mjs → responsive-dropdown-n0Txkax5.mjs} +1 -1
- package/dist/responsive-popover/index.mjs +1 -1
- package/dist/{responsive-popover-DJZgXWIE.mjs → responsive-popover-C_1nzIvm.mjs} +1 -1
- package/dist/rich-text-editor/index.mjs +1 -1
- package/dist/{rich-text-editor-CGuSn8xi.mjs → rich-text-editor-Dohp-pbf.mjs} +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/{sheet-BZViad2U.mjs → sheet-C2i2k5i2.mjs} +2 -2
- package/dist/sidebar/index.mjs +1 -1
- package/dist/{sidebar-BRUNOqXi.mjs → sidebar-D6BoAr6C.mjs} +53 -16
- package/dist/styles/shadcn/animations.css +2 -2
- package/dist/task-queue/index.mjs +1 -1
- package/dist/{task-queue-dropdown-pqFd4rSf.mjs → task-queue-dropdown-ClLLTMxU.mjs} +1 -1
- package/dist/time-picker/index.mjs +1 -1
- package/dist/{time-picker-B_fN5vhO.mjs → time-picker-CFhaHTtI.mjs} +1 -1
- package/dist/{to-api-format-43Boq7OR.mjs → to-api-format-WC7b9Mcv.mjs} +2 -2
- package/package.json +16 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { DateTime } from './date-time';
|
|
2
|
+
export { DEFAULT_DATE_FORMAT, formatAbsoluteDate, formatCombinedDate, formatRelativeDate, formatTimezoneDate, formatUTCDate, getTimestamp, getTimezoneAbbreviation, parseDate, } from './formatters';
|
|
3
|
+
export type { DateTimeProps, DateTimeVariant, FormatterOptions, TooltipMode } from './types';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type DateTimeVariant = 'absolute' | 'relative' | 'both' | 'detailed';
|
|
3
|
+
export type TooltipMode = boolean | 'auto' | 'timezone' | 'alternate' | 'detailed';
|
|
4
|
+
export interface DateTimeProps {
|
|
5
|
+
/** Date to format — a `Date` or parseable ISO string. */
|
|
6
|
+
date?: string | Date;
|
|
7
|
+
/**
|
|
8
|
+
* `absolute` — formatted date.
|
|
9
|
+
* `relative` — "X ago".
|
|
10
|
+
* `both` — absolute plus relative.
|
|
11
|
+
* `detailed` — absolute in the trigger; tooltip lists UTC, local, relative, and epoch.
|
|
12
|
+
*/
|
|
13
|
+
variant?: DateTimeVariant;
|
|
14
|
+
/** date-fns format string for absolute dates. */
|
|
15
|
+
format?: string;
|
|
16
|
+
/** Append "ago" (and similar) to relative dates. Defaults to true. */
|
|
17
|
+
addSuffix?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Tooltip behavior:
|
|
20
|
+
* - true/false: show or hide
|
|
21
|
+
* - `auto`: opposite format, or timezone for absolute dates
|
|
22
|
+
* - `timezone`: timezone name and abbreviation
|
|
23
|
+
* - `alternate`: opposite of the visible variant
|
|
24
|
+
* - `detailed`: UTC, local zone, relative, and epoch
|
|
25
|
+
*/
|
|
26
|
+
tooltip?: TooltipMode;
|
|
27
|
+
/** IANA timezone. Defaults to the browser timezone. */
|
|
28
|
+
timezone?: string;
|
|
29
|
+
/** Skip timezone conversion and format in the runtime local zone. */
|
|
30
|
+
disableTimezone?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Separator between absolute and relative when `variant="both"`. */
|
|
33
|
+
separator?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Epoch shown on the `detailed` tooltip Timestamp row.
|
|
36
|
+
* Defaults to microseconds derived from the date.
|
|
37
|
+
*/
|
|
38
|
+
timestamp?: string;
|
|
39
|
+
/** Replace the formatted trigger. Must be a single element (Tooltip `asChild`). */
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
export interface FormatterOptions {
|
|
43
|
+
timezone: string;
|
|
44
|
+
disableTimezone: boolean;
|
|
45
|
+
format?: string;
|
|
46
|
+
addSuffix?: boolean;
|
|
47
|
+
}
|
|
@@ -10,6 +10,7 @@ export * from './avatar-stack';
|
|
|
10
10
|
export * from './calendar-date-picker';
|
|
11
11
|
export * from './code-editor';
|
|
12
12
|
export * from './data-table';
|
|
13
|
+
export * from './date-time';
|
|
13
14
|
export * from './date-time-picker';
|
|
14
15
|
export * from './dropdown';
|
|
15
16
|
export * from './dropzone';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LogFacet } from '../types';
|
|
2
|
+
export declare function LogsFilterGroup({ facet, defaultOpen, }: {
|
|
3
|
+
facet: LogFacet;
|
|
4
|
+
defaultOpen?: boolean;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function LogsTimeRangeFilter({ className }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function LogsFilters({ className }: {
|
|
10
|
+
className?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { LogsRootProps } from '../types';
|
|
2
|
+
export declare function LogsRoot({ entries, facets, timeRange, defaultTimeRange, filters, defaultFilters, search, defaultSearch, live, defaultLive, selectedId, defaultSelectedId, isLoading, error, columns, onTimeRangeChange, onFiltersChange, onSearchChange, onLiveChange, onSelectedIdChange, onRefresh, onExport, className, children, }: LogsRootProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ParsedLogLine } from '../types';
|
|
2
|
+
export declare function LogsSeverityBadge({ severity }: {
|
|
3
|
+
severity?: string;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function LogsStatusBadge({ parsed }: {
|
|
6
|
+
parsed: ParsedLogLine;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function LogsSearch({ placeholder, className, }: {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function LogsLiveToggle({ className }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function LogsToolbar({ children, className, }: {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useLogs } from './hooks/use-logs';
|
|
2
|
+
export { Logs } from './logs';
|
|
3
|
+
export type { BuildLogQLOptions, LogColumnId, LogEntry, LogFacet, LogFacetOption, LogFilters, LogsContextValue, LogsRootProps, LogTimeRange, LokiQueryRangeResponse, LokiStream, ParsedHttpLogLine, ParsedLogLine, ParsedTextLogLine, } from './types';
|
|
4
|
+
export { buildLogQL, facetsFromEntries, filterEntries, flattenLokiStreams, httpStatusBadgeType, httpStatusTextClass, lastThirtyMinutes, logLineDisplay, nsToDate, parseLogLine, severityBadgeType, } from './utils';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LogsDetail } from './components/detail';
|
|
2
|
+
import { LogsExplorer } from './components/explorer';
|
|
3
|
+
import { LogsFilterGroup, LogsFilters, LogsTimeRangeFilter } from './components/filters';
|
|
4
|
+
import { LogsRoot } from './components/root';
|
|
5
|
+
import { LogsTable } from './components/table';
|
|
6
|
+
import { LogsLiveToggle, LogsSearch, LogsToolbar } from './components/toolbar';
|
|
7
|
+
export declare const Logs: {
|
|
8
|
+
readonly Root: typeof LogsRoot;
|
|
9
|
+
readonly Explorer: typeof LogsExplorer;
|
|
10
|
+
readonly Filters: typeof LogsFilters;
|
|
11
|
+
readonly FilterGroup: typeof LogsFilterGroup;
|
|
12
|
+
readonly TimeRangeFilter: typeof LogsTimeRangeFilter;
|
|
13
|
+
readonly Toolbar: typeof LogsToolbar;
|
|
14
|
+
readonly Search: typeof LogsSearch;
|
|
15
|
+
readonly LiveToggle: typeof LogsLiveToggle;
|
|
16
|
+
readonly Table: typeof LogsTable;
|
|
17
|
+
readonly Detail: typeof LogsDetail;
|
|
18
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface LokiStream {
|
|
3
|
+
stream: Record<string, string>;
|
|
4
|
+
values: Array<[timestampNs: string, line: string]>;
|
|
5
|
+
}
|
|
6
|
+
export interface LokiQueryRangeResponse {
|
|
7
|
+
status: 'success' | 'error';
|
|
8
|
+
data?: {
|
|
9
|
+
resultType: 'streams' | 'vector';
|
|
10
|
+
result: LokiStream[];
|
|
11
|
+
};
|
|
12
|
+
errorType?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LogEntry {
|
|
16
|
+
id: string;
|
|
17
|
+
timestamp: Date;
|
|
18
|
+
timestampNs: string;
|
|
19
|
+
line: string;
|
|
20
|
+
labels: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export interface LogFacetOption {
|
|
23
|
+
value: string;
|
|
24
|
+
count?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface LogFacet {
|
|
27
|
+
name: string;
|
|
28
|
+
label: string;
|
|
29
|
+
options: LogFacetOption[];
|
|
30
|
+
}
|
|
31
|
+
export interface LogTimeRange {
|
|
32
|
+
from: string;
|
|
33
|
+
to: string;
|
|
34
|
+
}
|
|
35
|
+
export type LogFilters = Record<string, string[]>;
|
|
36
|
+
export type LogColumnId = 'time' | 'severity' | 'status' | 'service' | 'resource' | 'path' | 'message';
|
|
37
|
+
export interface ParsedHttpLogLine {
|
|
38
|
+
kind: 'http';
|
|
39
|
+
method: string;
|
|
40
|
+
path: string;
|
|
41
|
+
status: number;
|
|
42
|
+
durationMs: number;
|
|
43
|
+
}
|
|
44
|
+
export interface ParsedTextLogLine {
|
|
45
|
+
kind: 'text';
|
|
46
|
+
line: string;
|
|
47
|
+
}
|
|
48
|
+
export type ParsedLogLine = ParsedHttpLogLine | ParsedTextLogLine;
|
|
49
|
+
export interface BuildLogQLOptions {
|
|
50
|
+
matchers?: LogFilters;
|
|
51
|
+
lineContains?: string;
|
|
52
|
+
}
|
|
53
|
+
export type LogSeverity = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'FATAL' | (string & {});
|
|
54
|
+
export interface LogsRootProps {
|
|
55
|
+
entries: readonly LogEntry[];
|
|
56
|
+
facets?: readonly LogFacet[];
|
|
57
|
+
timeRange?: LogTimeRange;
|
|
58
|
+
defaultTimeRange?: LogTimeRange;
|
|
59
|
+
filters?: LogFilters;
|
|
60
|
+
defaultFilters?: LogFilters;
|
|
61
|
+
search?: string;
|
|
62
|
+
defaultSearch?: string;
|
|
63
|
+
live?: boolean;
|
|
64
|
+
defaultLive?: boolean;
|
|
65
|
+
selectedId?: string | null;
|
|
66
|
+
defaultSelectedId?: string | null;
|
|
67
|
+
isLoading?: boolean;
|
|
68
|
+
error?: ReactNode;
|
|
69
|
+
columns?: readonly LogColumnId[];
|
|
70
|
+
onTimeRangeChange?: (range: LogTimeRange) => void;
|
|
71
|
+
onFiltersChange?: (filters: LogFilters) => void;
|
|
72
|
+
onSearchChange?: (search: string) => void;
|
|
73
|
+
onLiveChange?: (live: boolean) => void;
|
|
74
|
+
onSelectedIdChange?: (id: string | null) => void;
|
|
75
|
+
onRefresh?: () => void;
|
|
76
|
+
onExport?: (entries: readonly LogEntry[]) => void;
|
|
77
|
+
className?: string;
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
}
|
|
80
|
+
export interface LogsContextValue {
|
|
81
|
+
entries: readonly LogEntry[];
|
|
82
|
+
facets: readonly LogFacet[];
|
|
83
|
+
timeRange: LogTimeRange;
|
|
84
|
+
setTimeRange: (range: LogTimeRange) => void;
|
|
85
|
+
filters: LogFilters;
|
|
86
|
+
setFilters: (filters: LogFilters) => void;
|
|
87
|
+
toggleFilterValue: (name: string, value: string) => void;
|
|
88
|
+
resetFilters: () => void;
|
|
89
|
+
search: string;
|
|
90
|
+
setSearch: (search: string) => void;
|
|
91
|
+
live: boolean;
|
|
92
|
+
setLive: (live: boolean) => void;
|
|
93
|
+
selectedId: string | null;
|
|
94
|
+
setSelectedId: (id: string | null) => void;
|
|
95
|
+
selectedEntry: LogEntry | null;
|
|
96
|
+
selectedIndex: number;
|
|
97
|
+
selectPrevious: () => void;
|
|
98
|
+
selectNext: () => void;
|
|
99
|
+
isLoading: boolean;
|
|
100
|
+
error: ReactNode;
|
|
101
|
+
columns: readonly LogColumnId[];
|
|
102
|
+
hasActiveFilters: boolean;
|
|
103
|
+
onRefresh?: () => void;
|
|
104
|
+
onExport?: (entries: readonly LogEntry[]) => void;
|
|
105
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LogColumnId } from '../types';
|
|
2
|
+
export declare const DEFAULT_LOG_COLUMNS: readonly LogColumnId[];
|
|
3
|
+
export declare const CANONICAL_FACET_NAMES: readonly ["severity", "service_name", "resource_name"];
|
|
4
|
+
export declare const FACET_LABELS: Record<string, string>;
|
|
5
|
+
export declare const SEVERITY_ORDER: readonly ["ERROR", "FATAL", "WARN", "WARNING", "INFO", "DEBUG", "TRACE"];
|
|
6
|
+
export declare const DEFAULT_LOGQL_MATCHER = "{service_name=~\".+\"}";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LogEntry, LogFacet, LogFilters } from '../types';
|
|
2
|
+
export declare function facetsFromEntries(entries: readonly LogEntry[], names?: readonly string[]): LogFacet[];
|
|
3
|
+
export declare function filterEntries(entries: readonly LogEntry[], filters: LogFilters, search?: string): LogEntry[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function formatLogTimestamp(date: Date): string;
|
|
2
|
+
export declare function formatRelativeTimestamp(date: Date, now?: Date): string;
|
|
3
|
+
export declare function formatUtcTimestamp(date: Date): string;
|
|
4
|
+
export declare function formatLocalTimestamp(date: Date): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { buildLogQL } from './build-logql';
|
|
2
|
+
export { CANONICAL_FACET_NAMES, DEFAULT_LOG_COLUMNS, DEFAULT_LOGQL_MATCHER, FACET_LABELS, SEVERITY_ORDER, } from './constants';
|
|
3
|
+
export { facetsFromEntries, filterEntries } from './facets';
|
|
4
|
+
export { flattenLokiStreams, nsToDate } from './flatten-loki';
|
|
5
|
+
export { formatLocalTimestamp, formatLogTimestamp, formatRelativeTimestamp, formatUtcTimestamp, } from './format-timestamp';
|
|
6
|
+
export { logLineDisplay, parseLogLine } from './parse-log-line';
|
|
7
|
+
export { httpStatusBadgeType, httpStatusTextClass, severityBadgeType } from './severity';
|
|
8
|
+
export { filtersAreActive, lastThirtyMinutes } from './time-range';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BadgeProps } from '../../../base/badge';
|
|
2
|
+
export type SeverityBadgeType = NonNullable<BadgeProps['type']>;
|
|
3
|
+
export declare function severityBadgeType(severity: string | undefined): SeverityBadgeType;
|
|
4
|
+
export declare function httpStatusBadgeType(status: number): SeverityBadgeType;
|
|
5
|
+
export declare function httpStatusTextClass(status: number): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as useNuqsAdapter, a as useDataTablePagination, b as DEFAULT_PAGE_SIZE, c as useDataTableSelection, d as resolvePath, f as rowMatchesSearch, g as createSelectionColumn, h as DataTableColumnHeader, i as useDataTableLoading, l as useDataTableSorting, m as DataTableRowActions, n as useDataTableFilters, o as useDataTableRows, p as dataTableFeatures, r as useDataTableInlineContents, s as useDataTableSearch, t as DataTable, u as createDataTableStore, v as DEFAULT_DEBOUNCE_MS, x as DEFAULT_PAGE_SIZES, y as DEFAULT_LOADING_ROWS } from "../data-table-
|
|
1
|
+
import { _ as useNuqsAdapter, a as useDataTablePagination, b as DEFAULT_PAGE_SIZE, c as useDataTableSelection, d as resolvePath, f as rowMatchesSearch, g as createSelectionColumn, h as DataTableColumnHeader, i as useDataTableLoading, l as useDataTableSorting, m as DataTableRowActions, n as useDataTableFilters, o as useDataTableRows, p as dataTableFeatures, r as useDataTableInlineContents, s as useDataTableSearch, t as DataTable, u as createDataTableStore, v as DEFAULT_DEBOUNCE_MS, x as DEFAULT_PAGE_SIZES, y as DEFAULT_LOADING_ROWS } from "../data-table-Du7_FLBi.mjs";
|
|
2
2
|
export { DEFAULT_DEBOUNCE_MS, DEFAULT_LOADING_ROWS, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZES, DataTable, DataTableColumnHeader, DataTableRowActions, createDataTableStore, createSelectionColumn, dataTableFeatures, resolvePath, rowMatchesSearch, useDataTableFilters, useDataTableInlineContents, useDataTableLoading, useDataTablePagination, useDataTableRows, useDataTableSearch, useDataTableSelection, useDataTableSorting, useNuqsAdapter };
|
|
@@ -3,15 +3,15 @@ import { t as Badge } from "./badge-BTNW_FEU.mjs";
|
|
|
3
3
|
import { t as Button } from "./button-A1qTjZ8U.mjs";
|
|
4
4
|
import { t as Checkbox } from "./checkbox-C6P12fio.mjs";
|
|
5
5
|
import { t as Input } from "./input-j4tbmYYz.mjs";
|
|
6
|
-
import { t as ResponsiveDropdown } from "./responsive-dropdown-
|
|
6
|
+
import { t as ResponsiveDropdown } from "./responsive-dropdown-n0Txkax5.mjs";
|
|
7
7
|
import { i as SelectItem, l as SelectTrigger, n as SelectContent, t as Select, u as SelectValue } from "./select-DCU44UO6.mjs";
|
|
8
8
|
import { Skeleton } from "./skeleton/index.mjs";
|
|
9
9
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "./table/index.mjs";
|
|
10
|
-
import { t as Autocomplete } from "./autocomplete-
|
|
11
|
-
import { t as CalendarDatePicker } from "./calendar-date-picker-
|
|
10
|
+
import { t as Autocomplete } from "./autocomplete-DZ_HSBak.mjs";
|
|
11
|
+
import { t as CalendarDatePicker } from "./calendar-date-picker-ynSGADfR.mjs";
|
|
12
12
|
import { t as ActionRow } from "./action-row-DTvs91_3.mjs";
|
|
13
13
|
import { n as useDebouncedSearchInput } from "./use-debounced-search-input-yu_F0QBt.mjs";
|
|
14
|
-
import { t as MultiSelect } from "./multi-select-
|
|
14
|
+
import { t as MultiSelect } from "./multi-select-PtdMChPF.mjs";
|
|
15
15
|
import { ArrowDown, ArrowUp, ArrowUpDown, ChevronLeft, ChevronRight, MoreHorizontal, X } from "lucide-react";
|
|
16
16
|
import { createContext, memo, use, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
17
17
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CalendarDatePicker } from "../calendar-date-picker-
|
|
3
|
-
import { _ as getShortTimezoneDisplay, a as TimeRangePicker, b as utcToLocalInputString, c as getPresetByKey, d as TimezoneSelector, f as QuickRangesPanel, g as getDefaultTimezoneOptions, h as formatUtcForDisplay, i as formatTimeRangeDisplay, l as getPresetByShortcut, m as createTimezoneOption, n as formatDateForInput, o as DEFAULT_PRESETS, p as CustomRangePanel, r as formatSingleTimeDisplay, s as getDefaultPreset, t as toApiTimeRange, u as getPresetRange, v as localInputStringToUtc, x as zonedDateToUtcString, y as utcStringToZonedDate } from "../to-api-format-
|
|
1
|
+
import { M as getBrowserTimezone, N as getTimezoneOffset, j as formatTimezoneLabel } from "../date-time-range-picker-Dog33Ry0.mjs";
|
|
2
|
+
import { t as CalendarDatePicker } from "../calendar-date-picker-ynSGADfR.mjs";
|
|
3
|
+
import { _ as getShortTimezoneDisplay, a as TimeRangePicker, b as utcToLocalInputString, c as getPresetByKey, d as TimezoneSelector, f as QuickRangesPanel, g as getDefaultTimezoneOptions, h as formatUtcForDisplay, i as formatTimeRangeDisplay, l as getPresetByShortcut, m as createTimezoneOption, n as formatDateForInput, o as DEFAULT_PRESETS, p as CustomRangePanel, r as formatSingleTimeDisplay, s as getDefaultPreset, t as toApiTimeRange, u as getPresetRange, v as localInputStringToUtc, x as zonedDateToUtcString, y as utcStringToZonedDate } from "../to-api-format-WC7b9Mcv.mjs";
|
|
4
4
|
export { CustomRangePanel as AbsoluteRangePanel, CustomRangePanel, CalendarDatePicker, DEFAULT_PRESETS, QuickRangesPanel, TimeRangePicker, TimezoneSelector, createTimezoneOption, formatDateForInput, formatSingleTimeDisplay, formatTimeRangeDisplay, formatTimezoneLabel, formatUtcForDisplay, getBrowserTimezone, getDefaultPreset, getDefaultTimezoneOptions, getPresetByKey, getPresetByShortcut, getPresetRange, getShortTimezoneDisplay, getTimezoneOffset, localInputStringToUtc, toApiTimeRange, utcStringToZonedDate, utcToLocalInputString, zonedDateToUtcString };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as formatRelativeDate, c as getTimestamp, i as formatCombinedDate, l as getTimezoneAbbreviation, n as DEFAULT_DATE_FORMAT, o as formatTimezoneDate, r as formatAbsoluteDate, s as formatUTCDate, t as DateTime, u as parseDate } from "../date-time-CA-09lnw.mjs";
|
|
2
|
+
export { DEFAULT_DATE_FORMAT, DateTime, formatAbsoluteDate, formatCombinedDate, formatRelativeDate, formatTimezoneDate, formatUTCDate, getTimestamp, getTimezoneAbbreviation, parseDate };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { t as cn } from "./utils-Bu32wN-x.mjs";
|
|
2
|
+
import { t as Tooltip } from "./tooltip-C_SL1imw.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { formatInTimeZone } from "date-fns-tz";
|
|
5
|
+
import { format, formatDistanceToNowStrict } from "date-fns";
|
|
6
|
+
import { enUS } from "date-fns/locale/en-US";
|
|
7
|
+
//#region src/components/features/date-time/formatters.ts
|
|
8
|
+
/** e.g. "June 12th at 11:30 AM" — used for absolute / table dates. */
|
|
9
|
+
const DEFAULT_DATE_FORMAT = "MMMM do 'at' h:mm a";
|
|
10
|
+
function getBrowserTimezone() {
|
|
11
|
+
try {
|
|
12
|
+
return new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
13
|
+
} catch {
|
|
14
|
+
return "UTC";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function parseDate(date) {
|
|
18
|
+
const parsedDate = date instanceof Date ? date : new Date(date);
|
|
19
|
+
if (!date || Number.isNaN(parsedDate.getTime())) return null;
|
|
20
|
+
return parsedDate;
|
|
21
|
+
}
|
|
22
|
+
function formatAbsoluteDate(date, options) {
|
|
23
|
+
const formatString = options.format || "MMMM do 'at' h:mm a";
|
|
24
|
+
if (options.disableTimezone) return format(date, formatString, { locale: enUS });
|
|
25
|
+
return formatInTimeZone(date, options.timezone, formatString, { locale: enUS });
|
|
26
|
+
}
|
|
27
|
+
function formatRelativeDate(date, options) {
|
|
28
|
+
return formatDistanceToNowStrict(date, { addSuffix: options.addSuffix ?? true });
|
|
29
|
+
}
|
|
30
|
+
function getTimezoneAbbreviation(date, timezone) {
|
|
31
|
+
return formatInTimeZone(date, timezone, "zzz", { locale: enUS });
|
|
32
|
+
}
|
|
33
|
+
function formatCombinedDate(date, options, separator = " ") {
|
|
34
|
+
return `${formatAbsoluteDate(date, options)}${separator}(${formatRelativeDate(date, options)})`;
|
|
35
|
+
}
|
|
36
|
+
function formatUTCDate(date, format = "dd MMM yy HH:mm:ss") {
|
|
37
|
+
return formatInTimeZone(date, "UTC", format, { locale: enUS });
|
|
38
|
+
}
|
|
39
|
+
function formatTimezoneDate(date, timezone, format = "dd MMM yy HH:mm:ss") {
|
|
40
|
+
return formatInTimeZone(date, timezone, format, { locale: enUS });
|
|
41
|
+
}
|
|
42
|
+
/** Microseconds since epoch, matching the Datum DateTime tooltip. */
|
|
43
|
+
function getTimestamp(date) {
|
|
44
|
+
return (date.getTime() * 1e3).toString();
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/features/date-time/date-time.tsx
|
|
48
|
+
/**
|
|
49
|
+
* Date display with the shared Datum hover tooltip (UTC, local zone, relative, epoch).
|
|
50
|
+
*/
|
|
51
|
+
function DateTime({ date, variant = "detailed", format, addSuffix, tooltip = "auto", timezone, disableTimezone = false, className, separator = " ", timestamp, children }) {
|
|
52
|
+
if (!date) return null;
|
|
53
|
+
const parsedDate = parseDate(date);
|
|
54
|
+
if (!parsedDate) return null;
|
|
55
|
+
const timeZone = timezone ?? getBrowserTimezone();
|
|
56
|
+
const formatterOptions = {
|
|
57
|
+
timezone: timeZone,
|
|
58
|
+
disableTimezone,
|
|
59
|
+
format,
|
|
60
|
+
addSuffix
|
|
61
|
+
};
|
|
62
|
+
const shouldShowTooltip = tooltip !== false && !disableTimezone;
|
|
63
|
+
const textClass = cn("text-sm", shouldShowTooltip && "cursor-pointer", className);
|
|
64
|
+
const trigger = children ?? /* @__PURE__ */ jsx("time", {
|
|
65
|
+
dateTime: parsedDate.toISOString(),
|
|
66
|
+
className: textClass,
|
|
67
|
+
children: formatTriggerContent(parsedDate, variant, formatterOptions, separator)
|
|
68
|
+
});
|
|
69
|
+
if (!shouldShowTooltip) return trigger;
|
|
70
|
+
const showDetailedTooltip = variant === "detailed" || tooltip === "detailed";
|
|
71
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
72
|
+
message: getTooltipContent(parsedDate, variant, tooltip, formatterOptions, timeZone, timestamp),
|
|
73
|
+
contentClassName: showDetailedTooltip ? "min-w-64 text-left" : void 0,
|
|
74
|
+
children: trigger
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function formatTriggerContent(date, variant, options, separator) {
|
|
78
|
+
switch (variant) {
|
|
79
|
+
case "relative": return formatRelativeDate(date, options);
|
|
80
|
+
case "both": return formatCombinedDate(date, options, separator);
|
|
81
|
+
default: return formatAbsoluteDate(date, options);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function getTooltipContent(date, variant, tooltip, options, timeZone, timestamp) {
|
|
85
|
+
if (variant === "detailed" || tooltip === "detailed") {
|
|
86
|
+
const rows = [
|
|
87
|
+
{
|
|
88
|
+
label: "UTC",
|
|
89
|
+
value: formatUTCDate(date)
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: timeZone.replaceAll("_", " "),
|
|
93
|
+
value: formatTimezoneDate(date, timeZone)
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: "Relative",
|
|
97
|
+
value: formatRelativeDate(date, options)
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "Timestamp",
|
|
101
|
+
value: timestamp ?? getTimestamp(date)
|
|
102
|
+
}
|
|
103
|
+
];
|
|
104
|
+
return /* @__PURE__ */ jsx("div", {
|
|
105
|
+
className: "space-y-2 text-xs",
|
|
106
|
+
children: rows.map((row) => /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
className: "flex items-center justify-between gap-2",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "font-medium",
|
|
111
|
+
children: row.label
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "mx-1 flex-1 border-b border-dotted border-current/50" }),
|
|
114
|
+
/* @__PURE__ */ jsx("span", {
|
|
115
|
+
className: "text-right",
|
|
116
|
+
children: row.value
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
}, row.label))
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (tooltip === "timezone") return /* @__PURE__ */ jsx("p", { children: `${timeZone.replaceAll("_", " ")} (${getTimezoneAbbreviation(date, timeZone)})` });
|
|
123
|
+
if (tooltip === "alternate") {
|
|
124
|
+
if (variant === "relative") return formatAbsoluteDate(date, options);
|
|
125
|
+
if (variant === "absolute" || variant === "both") return formatRelativeDate(date, options);
|
|
126
|
+
}
|
|
127
|
+
if (tooltip === "auto" || tooltip === true) switch (variant) {
|
|
128
|
+
case "relative": return formatAbsoluteDate(date, options);
|
|
129
|
+
default: return /* @__PURE__ */ jsx("p", { children: `${timeZone.replaceAll("_", " ")} (${getTimezoneAbbreviation(date, timeZone)})` });
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { formatRelativeDate as a, getTimestamp as c, formatCombinedDate as i, getTimezoneAbbreviation as l, DEFAULT_DATE_FORMAT as n, formatTimezoneDate as o, formatAbsoluteDate as r, formatUTCDate as s, DateTime as t, parseDate as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DateTimePicker } from "../date-time-picker-
|
|
1
|
+
import { t as DateTimePicker } from "../date-time-picker-BzcHrf-A.mjs";
|
|
2
2
|
export { DateTimePicker };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as DateTimePicker$1 } from "./picker-b5-x-EHs.mjs";
|
|
2
1
|
import { t as useDeprecationWarning } from "./use-deprecation-warning-DXrGc0jX.mjs";
|
|
2
|
+
import { r as DateTimePicker$1 } from "./picker-raVuDxsh.mjs";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/features/date-time-picker/date-time-picker.tsx
|
|
5
5
|
/**
|