@peripheries/core 0.4.0 → 0.5.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/README.md +1 -1
- package/index.css +1 -1
- package/index.js +4 -4211
- package/package.json +1 -1
- package/types/core/Rail/Rail.d.ts +9 -0
- package/types/core/_shared/formatters.d.ts +9 -2
- package/types/core/_shared/overlay/focusables.d.ts +2 -0
- package/types/core/_shared/overlay/hooks.d.ts +4 -0
- package/types/core/_shared/overlay/placement.d.ts +28 -0
- package/types/core/_shared/overlay/scroll-lock.d.ts +1 -0
- package/types/core/_shared/safe-url.d.ts +2 -0
- package/types/core/_shared/viewer.d.ts +15 -0
- package/types/core/display/DataTable/DataTable.d.ts +5 -3
- package/types/core/display/KpiCardGrid/KpiCardGrid.d.ts +1 -0
- package/types/core/display/OptionCard/OptionCard.d.ts +1 -0
- package/types/core/display/ProfileCard/ProfileCard.d.ts +1 -0
- package/types/core/display/SectionHeader/SectionHeader.d.ts +2 -1
- package/types/core/display/Stat/Stat.d.ts +2 -1
- package/types/core/display/StatStrip/StatStrip.d.ts +2 -1
- package/types/core/display/_shared/ValueBadge.d.ts +3 -2
- package/types/core/document/ComparisonBars/ComparisonBars.d.ts +2 -1
- package/types/core/document/RowList/RowList.d.ts +5 -3
- package/types/core/events/CalendarFilters/CalendarFilters.d.ts +22 -0
- package/types/core/events/CalendarView/CalendarView.d.ts +23 -0
- package/types/core/events/EventCard/EventCard.d.ts +1 -0
- package/types/core/events/EventSchedule/EventSchedule.d.ts +2 -0
- package/types/core/events/HandoverCard/HandoverCard.d.ts +19 -0
- package/types/core/events/HourGrid/HourGrid.d.ts +24 -0
- package/types/core/events/LogCard/LogCard.d.ts +27 -0
- package/types/core/events/MiniMonth/MiniMonth.d.ts +18 -0
- package/types/core/events/NoteSplitCard/NoteSplitCard.d.ts +22 -0
- package/types/core/events/QuickNoteCard/QuickNoteCard.d.ts +21 -0
- package/types/core/events/ShareApprovalCard/ShareApprovalCard.d.ts +16 -0
- package/types/core/events/StartProcessCard/StartProcessCard.d.ts +22 -0
- package/types/core/events/SuggestedActions/SuggestedActions.d.ts +10 -0
- package/types/core/events/TaskCard/TaskCard.d.ts +17 -0
- package/types/core/events/WeekStrip/WeekStrip.d.ts +16 -0
- package/types/core/events/_shared/SeriesGlyph.d.ts +9 -0
- package/types/core/events/_shared/calendar.d.ts +36 -0
- package/types/core/events/_shared/event.d.ts +7 -1
- package/types/core/events/_shared/intent.d.ts +18 -0
- package/types/core/events/_shared/path.d.ts +1 -0
- package/types/core/forms/CodeField/CodeField.d.ts +15 -0
- package/types/core/forms/Combobox/Combobox.d.ts +17 -0
- package/types/core/forms/Combobox/useCombobox.d.ts +74 -0
- package/types/core/overlay/Dialog/Dialog.d.ts +16 -0
- package/types/core/overlay/Menu/Menu.d.ts +26 -0
- package/types/core/overlay/Popover/Popover.d.ts +19 -0
- package/types/core/overlay/Sheet/Sheet.d.ts +21 -0
- package/types/core/overlay/Toast/Toast.d.ts +20 -0
- package/types/core/overlay/Toast/toast-store.d.ts +51 -0
- package/types/core/overlay/_shared/Modal.d.ts +19 -0
- package/types/core/public/ContactForm/ContactForm.d.ts +24 -0
- package/types/core/public/CtaBand/CtaBand.d.ts +11 -0
- package/types/core/public/FeatureGrid/FeatureGrid.d.ts +15 -0
- package/types/core/public/Hero/Hero.d.ts +14 -0
- package/types/core/public/Image/Image.d.ts +12 -0
- package/types/core/public/LogoMark/LogoMark.d.ts +10 -0
- package/types/core/public/PublicFooter/PublicFooter.d.ts +15 -0
- package/types/core/public/PublicHeader/PublicHeader.d.ts +16 -0
- package/types/core/public/TeamGrid/TeamGrid.d.ts +16 -0
- package/types/core/public/Testimonial/Testimonial.d.ts +11 -0
- package/types/core/public/_shared/actions.d.ts +15 -0
- package/types/core/public/_shared/media.d.ts +9 -0
- package/types/index.core.d.ts +40 -2
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
export interface RailProps {
|
|
3
|
+
label: string;
|
|
4
|
+
snap?: 'start' | 'none';
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export declare function Rail({ label, snap, children, className, ...rest }: RailProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
export type FormatterToken = 'currency' | 'currency-k' | 'currency-m' | 'currency-compact' | 'currency-monthly' | 'percent' | 'age' | 'years' | 'number';
|
|
1
|
+
export type FormatterToken = 'currency' | 'currency-k' | 'currency-m' | 'currency-compact' | 'currency-monthly' | 'percent' | 'fraction-percent' | 'age' | 'years' | 'year' | 'number';
|
|
2
|
+
export interface DisplayLocale {
|
|
3
|
+
locale: string;
|
|
4
|
+
currency: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const DEFAULT_DISPLAY_LOCALE: DisplayLocale;
|
|
7
|
+
export declare function displayLocale(baseProps?: unknown): DisplayLocale;
|
|
2
8
|
export interface FormatOpts {
|
|
3
9
|
precision?: number;
|
|
4
10
|
signed?: boolean;
|
|
11
|
+
locale?: DisplayLocale;
|
|
5
12
|
}
|
|
6
13
|
export interface ValueSpec {
|
|
7
14
|
value: number;
|
|
@@ -11,5 +18,5 @@ export interface ValueSpec {
|
|
|
11
18
|
unit?: string;
|
|
12
19
|
}
|
|
13
20
|
export type FormattableValue = string | ValueSpec;
|
|
14
|
-
export declare function renderFormatted(v: FormattableValue | undefined): string;
|
|
21
|
+
export declare function renderFormatted(v: FormattableValue | undefined, locale?: DisplayLocale): string;
|
|
15
22
|
export declare function formatValue(token: FormatterToken | undefined, value: number, opts?: FormatOpts): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Ref, type RefCallback } from 'react';
|
|
2
|
+
export declare function useControllable<T>(value: T | undefined, initial: T, onChange?: (next: T) => void): [T, (next: T) => void];
|
|
3
|
+
export declare function mergeRefs<T>(...refs: Array<Ref<T> | undefined>): RefCallback<T>;
|
|
4
|
+
export declare function useMediaQuery(query: string): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type Placement = 'bottom-start' | 'bottom-end' | 'bottom' | 'top-start' | 'top-end' | 'top';
|
|
2
|
+
export interface Rect {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
}
|
|
8
|
+
export interface PlaceInput {
|
|
9
|
+
anchor: Rect;
|
|
10
|
+
size: {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
viewport: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
placement: Placement;
|
|
19
|
+
gap?: number;
|
|
20
|
+
margin?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface Placed {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
placement: Placement;
|
|
26
|
+
}
|
|
27
|
+
export declare function place({ anchor, size, viewport, placement, gap, margin }: PlaceInput): Placed;
|
|
28
|
+
export declare function supportsAnchorPositioning(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function lockScroll(): () => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export interface Viewer {
|
|
3
|
+
audience: 'staff' | 'client';
|
|
4
|
+
roles: ReadonlyArray<string>;
|
|
5
|
+
previewing?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_VIEWER: Viewer;
|
|
8
|
+
export declare function normalizeViewer(value: unknown): Viewer;
|
|
9
|
+
export declare function ViewerProvider({ value, children }: {
|
|
10
|
+
value: unknown;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}): ReactElement;
|
|
13
|
+
export declare function useViewer(): Viewer;
|
|
14
|
+
export declare const isStaff: (viewer: Viewer) => boolean;
|
|
15
|
+
export declare const hasRole: (viewer: Viewer, role: string) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactElement, type ReactNode } from 'react';
|
|
2
|
-
import { type FormattableValue } from '../../_shared/formatters';
|
|
2
|
+
import { type FormattableValue, type FormatterToken } from '../../_shared/formatters';
|
|
3
3
|
import { type Tone } from '../_shared/tone';
|
|
4
4
|
export type DataTableAlign = 'left' | 'right' | 'center';
|
|
5
5
|
export interface DataTableColumn {
|
|
@@ -10,7 +10,7 @@ export interface DataTableColumn {
|
|
|
10
10
|
minWidth?: number;
|
|
11
11
|
format?: DataTableColumnFormat;
|
|
12
12
|
}
|
|
13
|
-
export type DataTableColumnFormat = 'date' | 'datetime' | 'raw';
|
|
13
|
+
export type DataTableColumnFormat = 'date' | 'datetime' | 'raw' | 'unit' | FormatterToken;
|
|
14
14
|
export interface DataTableCell {
|
|
15
15
|
value: FormattableValue | ReactNode;
|
|
16
16
|
tone?: Tone | string;
|
|
@@ -20,14 +20,16 @@ export interface DataTableRow {
|
|
|
20
20
|
cells: ReadonlyArray<DataTableCellInput> | Readonly<Record<string, DataTableCellInput>>;
|
|
21
21
|
highlighted?: boolean;
|
|
22
22
|
total?: boolean;
|
|
23
|
+
unit?: string;
|
|
23
24
|
}
|
|
24
25
|
export interface DataTableProps {
|
|
25
26
|
title?: string;
|
|
26
27
|
subtitle?: string;
|
|
27
28
|
columns: ReadonlyArray<DataTableColumn>;
|
|
28
29
|
rows: ReadonlyArray<DataTableRow>;
|
|
30
|
+
baseProps?: unknown;
|
|
29
31
|
className?: string;
|
|
30
32
|
style?: CSSProperties;
|
|
31
33
|
}
|
|
32
34
|
export declare function asWords(value: string): string;
|
|
33
|
-
export declare function DataTable({ title, subtitle, columns, rows, className, style }: DataTableProps): ReactElement;
|
|
35
|
+
export declare function DataTable({ title, subtitle, columns, rows, baseProps, className, style }: DataTableProps): ReactElement;
|
|
@@ -4,8 +4,9 @@ export interface SectionHeaderProps {
|
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
trailing?: ReactNode;
|
|
7
|
+
level?: 2 | 3;
|
|
7
8
|
revealDelay?: number;
|
|
8
9
|
className?: string;
|
|
9
10
|
style?: CSSProperties;
|
|
10
11
|
}
|
|
11
|
-
export declare function SectionHeader({ eyebrow, title, description, trailing, revealDelay, className, style }: SectionHeaderProps): ReactElement;
|
|
12
|
+
export declare function SectionHeader({ eyebrow, title, description, trailing, level, revealDelay, className, style }: SectionHeaderProps): ReactElement;
|
|
@@ -13,8 +13,9 @@ export interface StatProps {
|
|
|
13
13
|
autoStepDown?: boolean;
|
|
14
14
|
className?: string;
|
|
15
15
|
style?: CSSProperties;
|
|
16
|
+
baseProps?: unknown;
|
|
16
17
|
}
|
|
17
|
-
export declare function Stat({ value, label, size, tone, progress, progressLabel, autoStepDown, className, style, }: StatProps): ReactElement;
|
|
18
|
+
export declare function Stat({ value, label, size, tone, progress, progressLabel, autoStepDown, baseProps, className, style, }: StatProps): ReactElement;
|
|
18
19
|
export interface StatGroupProps {
|
|
19
20
|
children?: ReactNode;
|
|
20
21
|
minColumnWidth?: number;
|
|
@@ -9,5 +9,6 @@ export interface StatStripProps {
|
|
|
9
9
|
tone?: Tone | string;
|
|
10
10
|
className?: string;
|
|
11
11
|
style?: CSSProperties;
|
|
12
|
+
baseProps?: unknown;
|
|
12
13
|
}
|
|
13
|
-
export declare function StatStrip({ label, value, fillPercent, subtitle, tone, className, style }: StatStripProps): ReactElement;
|
|
14
|
+
export declare function StatStrip({ label, value, fillPercent, subtitle, tone, baseProps, className, style }: StatStripProps): ReactElement;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type FormattableValue } from '../../_shared/formatters';
|
|
1
|
+
import { type DisplayLocale, type FormattableValue } from '../../_shared/formatters';
|
|
2
2
|
import { type Tone } from './tone';
|
|
3
3
|
export interface ValueBadgeProps {
|
|
4
4
|
text: FormattableValue;
|
|
5
5
|
tone?: Tone | string;
|
|
6
|
+
locale?: DisplayLocale;
|
|
6
7
|
className?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function ValueBadge({ text, tone, className }: ValueBadgeProps): import("react").JSX.Element;
|
|
9
|
+
export declare function ValueBadge({ text, tone, locale, className }: ValueBadgeProps): import("react").JSX.Element;
|
|
@@ -15,5 +15,6 @@ export interface ComparisonBarsProps {
|
|
|
15
15
|
profile?: DocumentProfile;
|
|
16
16
|
className?: string;
|
|
17
17
|
style?: CSSProperties;
|
|
18
|
+
baseProps?: unknown;
|
|
18
19
|
}
|
|
19
|
-
export declare function ComparisonBars({ bars, target, targetLabel, max, profileId, profile, className, style }: ComparisonBarsProps): ReactElement | null;
|
|
20
|
+
export declare function ComparisonBars({ bars, target, targetLabel, max, profileId, profile, baseProps, className, style }: ComparisonBarsProps): ReactElement | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { type FormattableValue } from '../../_shared/formatters';
|
|
2
3
|
import { type DocumentProfile, type ProfileId } from '../_shared/profile';
|
|
3
4
|
export interface RowListItem {
|
|
4
|
-
marker?:
|
|
5
|
+
marker?: FormattableValue;
|
|
5
6
|
primary: ReactNode;
|
|
6
|
-
secondary?: ReactNode;
|
|
7
|
+
secondary?: ReactNode | FormattableValue;
|
|
7
8
|
missing?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface RowListProps {
|
|
@@ -13,7 +14,8 @@ export interface RowListProps {
|
|
|
13
14
|
markerWidth?: number;
|
|
14
15
|
secondaryWidth?: number;
|
|
15
16
|
missingLabel?: string;
|
|
17
|
+
baseProps?: unknown;
|
|
16
18
|
className?: string;
|
|
17
19
|
style?: CSSProperties;
|
|
18
20
|
}
|
|
19
|
-
export declare function RowList({ items, profileId, profile, markerWidth, secondaryWidth, missingLabel, className, style, }: RowListProps): ReactElement | null;
|
|
21
|
+
export declare function RowList({ items, profileId, profile, markerWidth, secondaryWidth, missingLabel, baseProps, className, style, }: RowListProps): ReactElement | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
export interface CalendarFilterType {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
series?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface CalendarFiltersProps {
|
|
8
|
+
types: ReadonlyArray<CalendarFilterType>;
|
|
9
|
+
selected?: ReadonlyArray<string>;
|
|
10
|
+
showCancelled?: boolean;
|
|
11
|
+
param?: string;
|
|
12
|
+
cancelledParam?: string;
|
|
13
|
+
keep?: Readonly<Record<string, string>>;
|
|
14
|
+
label?: string;
|
|
15
|
+
onChange?: (next: {
|
|
16
|
+
selected: string[];
|
|
17
|
+
showCancelled: boolean;
|
|
18
|
+
}) => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function CalendarFilters(props: CalendarFiltersProps): ReactElement | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { type EventView } from '../_shared/event';
|
|
3
|
+
export type CalendarViewName = 'day' | 'week' | 'agenda';
|
|
4
|
+
export interface CalendarViewProps {
|
|
5
|
+
occurrences: ReadonlyArray<EventView>;
|
|
6
|
+
view?: CalendarViewName;
|
|
7
|
+
date?: string;
|
|
8
|
+
weekStartsOn?: number;
|
|
9
|
+
viewParam?: string;
|
|
10
|
+
dateParam?: string;
|
|
11
|
+
eventHref?: string;
|
|
12
|
+
newEventHref?: string;
|
|
13
|
+
summary?: string;
|
|
14
|
+
notice?: ReactNode;
|
|
15
|
+
startHour?: number;
|
|
16
|
+
endHour?: number;
|
|
17
|
+
locale?: string;
|
|
18
|
+
timeZone?: string;
|
|
19
|
+
now?: string | number;
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
export declare function CalendarView(props: CalendarViewProps): ReactElement;
|
|
@@ -5,10 +5,12 @@ export interface EventScheduleProps {
|
|
|
5
5
|
view?: 'week' | 'agenda';
|
|
6
6
|
weekOf?: string;
|
|
7
7
|
weekParam?: string;
|
|
8
|
+
linkParams?: Readonly<Record<string, string>>;
|
|
8
9
|
eventHref?: string;
|
|
9
10
|
locale?: string;
|
|
10
11
|
timeZone?: string;
|
|
11
12
|
renderComponent?: RenderComponent;
|
|
13
|
+
label?: string;
|
|
12
14
|
className?: string;
|
|
13
15
|
style?: CSSProperties;
|
|
14
16
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
3
|
+
export type HandoverPointer = {
|
|
4
|
+
kind: 'conversation';
|
|
5
|
+
at?: string;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'event';
|
|
8
|
+
name?: string;
|
|
9
|
+
};
|
|
10
|
+
export interface HandoverCardProps {
|
|
11
|
+
scopeName?: string;
|
|
12
|
+
pointer?: HandoverPointer;
|
|
13
|
+
locale?: string;
|
|
14
|
+
timeZone?: string;
|
|
15
|
+
onIntent?: IntentHandler<'handover_continue' | 'dismiss'>;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
export declare function HandoverCard(props: HandoverCardProps): ReactElement | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type EventView } from '../_shared/event';
|
|
3
|
+
export interface HourGridColumn {
|
|
4
|
+
id: string;
|
|
5
|
+
date: string;
|
|
6
|
+
label: string;
|
|
7
|
+
sublabel?: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
events: ReadonlyArray<EventView>;
|
|
10
|
+
}
|
|
11
|
+
export interface HourGridProps {
|
|
12
|
+
columns: ReadonlyArray<HourGridColumn>;
|
|
13
|
+
label?: string;
|
|
14
|
+
startHour?: number;
|
|
15
|
+
endHour?: number;
|
|
16
|
+
hourHeight?: number;
|
|
17
|
+
eventHref?: string;
|
|
18
|
+
locale?: string;
|
|
19
|
+
timeZone?: string;
|
|
20
|
+
now?: string | number;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
export declare function HourGrid(props: HourGridProps): ReactElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type EventTypeOption } from '../_shared/event';
|
|
3
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
4
|
+
export interface LogCardPrefill {
|
|
5
|
+
typeId?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
startsAt?: string;
|
|
8
|
+
durationMin?: number;
|
|
9
|
+
attendees?: ReadonlyArray<string>;
|
|
10
|
+
outcome?: string;
|
|
11
|
+
followUp?: string;
|
|
12
|
+
note?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LogCardProps {
|
|
15
|
+
types: ReadonlyArray<EventTypeOption>;
|
|
16
|
+
subjectName?: string;
|
|
17
|
+
prefill?: LogCardPrefill;
|
|
18
|
+
canWriteStaffNotes?: boolean;
|
|
19
|
+
logged?: {
|
|
20
|
+
name?: string;
|
|
21
|
+
href?: string;
|
|
22
|
+
};
|
|
23
|
+
onIntent?: IntentHandler<'log_event'>;
|
|
24
|
+
className?: string;
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
export declare function LogCard(props: LogCardProps): ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type EventView } from '../_shared/event';
|
|
3
|
+
export interface MiniMonthProps {
|
|
4
|
+
month?: string;
|
|
5
|
+
date?: string;
|
|
6
|
+
highlight?: 'week' | 'day';
|
|
7
|
+
occurrences?: ReadonlyArray<EventView>;
|
|
8
|
+
weekStartsOn?: number;
|
|
9
|
+
param?: string;
|
|
10
|
+
monthParam?: string;
|
|
11
|
+
keep?: Readonly<Record<string, string>>;
|
|
12
|
+
locale?: string;
|
|
13
|
+
timeZone?: string;
|
|
14
|
+
now?: string | number;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
}
|
|
18
|
+
export declare function MiniMonth({ month: monthProp, date, highlight, occurrences, weekStartsOn, param, monthParam, keep, locale, timeZone, now, className, style }: MiniMonthProps): ReactElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
3
|
+
export interface NoteSplitMatch {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
kind: 'client' | 'project';
|
|
7
|
+
detail?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface NoteSplitPart {
|
|
10
|
+
id: string;
|
|
11
|
+
text: string;
|
|
12
|
+
matches?: ReadonlyArray<NoteSplitMatch>;
|
|
13
|
+
state?: 'open' | 'assigned' | 'dropped';
|
|
14
|
+
assignedToName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface NoteSplitCardProps {
|
|
17
|
+
parts: ReadonlyArray<NoteSplitPart>;
|
|
18
|
+
onIntent?: IntentHandler<'confirm_part' | 'drop_part'>;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function NoteSplitCard(props: NoteSplitCardProps): ReactElement | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type ComboboxOption } from '../../forms/Combobox/Combobox';
|
|
3
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
4
|
+
export interface QuickNote {
|
|
5
|
+
body?: string;
|
|
6
|
+
createdAt?: string;
|
|
7
|
+
state?: 'saved' | 'assigned' | 'event' | 'archived' | 'discarded' | 'unavailable';
|
|
8
|
+
assignedToName?: string;
|
|
9
|
+
eventHref?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface QuickNoteCardProps {
|
|
12
|
+
note: QuickNote;
|
|
13
|
+
locale?: string;
|
|
14
|
+
timeZone?: string;
|
|
15
|
+
searchTargets?: (query: string, signal: AbortSignal) => Promise<ReadonlyArray<ComboboxOption>>;
|
|
16
|
+
onIntent?: IntentHandler<'assign' | 'make_event' | 'archive' | 'discard' | 'ask_instead'>;
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
export declare const UNDO_MS = 6000;
|
|
21
|
+
export declare function QuickNoteCard(props: QuickNoteCardProps): ReactElement | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
3
|
+
export interface ShareApprovalItem {
|
|
4
|
+
name: string;
|
|
5
|
+
projectName?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ShareApprovalCardProps {
|
|
8
|
+
mode?: 'share' | 'withdraw';
|
|
9
|
+
clientName?: string;
|
|
10
|
+
items?: ReadonlyArray<ShareApprovalItem>;
|
|
11
|
+
onIntent?: IntentHandler<'share' | 'withdraw'>;
|
|
12
|
+
onCancel?: () => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
export declare function ShareApprovalCard(props: ShareApprovalCardProps): ReactElement | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
3
|
+
export interface StartProcessNeed {
|
|
4
|
+
label: string;
|
|
5
|
+
have?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface StartProcessCardProps {
|
|
8
|
+
processName: string;
|
|
9
|
+
subjectName?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
needs?: ReadonlyArray<StartProcessNeed>;
|
|
12
|
+
typicalTime?: string;
|
|
13
|
+
typicalCost?: string;
|
|
14
|
+
costCap?: string;
|
|
15
|
+
running?: {
|
|
16
|
+
href?: string;
|
|
17
|
+
};
|
|
18
|
+
onIntent?: IntentHandler<'start_process'>;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function StartProcessCard(props: StartProcessCardProps): ReactElement | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
3
|
+
export type SuggestedAction = 'save_as_note' | 'make_follow_up';
|
|
4
|
+
export interface SuggestedActionsProps {
|
|
5
|
+
actions?: ReadonlyArray<SuggestedAction>;
|
|
6
|
+
onIntent?: IntentHandler<SuggestedAction>;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function SuggestedActions(props: SuggestedActionsProps): ReactElement | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement } from 'react';
|
|
2
|
+
import { type IntentHandler } from '../_shared/intent';
|
|
3
|
+
export interface TaskView {
|
|
4
|
+
title: string;
|
|
5
|
+
dueOn?: string;
|
|
6
|
+
assigneeName?: string;
|
|
7
|
+
state?: 'proposed' | 'created' | 'done';
|
|
8
|
+
}
|
|
9
|
+
export interface TaskCardProps {
|
|
10
|
+
task: TaskView;
|
|
11
|
+
subjectName?: string;
|
|
12
|
+
locale?: string;
|
|
13
|
+
onIntent?: IntentHandler<'log_event' | 'complete'>;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
export declare function TaskCard(props: TaskCardProps): ReactElement | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement } from 'react';
|
|
2
|
+
import { type EventView } from '../_shared/event';
|
|
3
|
+
export interface WeekStripProps {
|
|
4
|
+
date?: string;
|
|
5
|
+
occurrences?: ReadonlyArray<EventView>;
|
|
6
|
+
weekStartsOn?: number;
|
|
7
|
+
param?: string;
|
|
8
|
+
steps?: boolean;
|
|
9
|
+
keep?: Readonly<Record<string, string>>;
|
|
10
|
+
locale?: string;
|
|
11
|
+
timeZone?: string;
|
|
12
|
+
now?: string | number;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
export declare function WeekStrip({ date, occurrences, weekStartsOn, param, steps, keep, locale, timeZone, now, className, style }: WeekStripProps): ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export declare const SERIES_SHAPES: readonly ["circle", "square", "triangle", "diamond", "plus", "hexagon"];
|
|
3
|
+
export type SeriesShape = (typeof SERIES_SHAPES)[number];
|
|
4
|
+
export declare const seriesShape: (series: number) => SeriesShape;
|
|
5
|
+
export declare const seriesNumber: (series: unknown) => number;
|
|
6
|
+
export declare function SeriesGlyph({ series, className }: {
|
|
7
|
+
series: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): ReactElement;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type EventView } from './event';
|
|
2
|
+
export declare const DAY_MINUTES = 1440;
|
|
3
|
+
export declare const OPEN_ENDED_MINUTES = 30;
|
|
4
|
+
export interface Wall {
|
|
5
|
+
date: string;
|
|
6
|
+
minutes: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function wallOf(instant: string | number | Date, timeZone?: string): Wall | null;
|
|
9
|
+
export interface CalendarBlock {
|
|
10
|
+
event: EventView;
|
|
11
|
+
startMin: number;
|
|
12
|
+
endMin: number;
|
|
13
|
+
shownEndMin: number;
|
|
14
|
+
col: number;
|
|
15
|
+
cols: number;
|
|
16
|
+
continuesBefore: boolean;
|
|
17
|
+
continuesAfter: boolean;
|
|
18
|
+
busyOnly: boolean;
|
|
19
|
+
overlaps: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface DayLayout {
|
|
22
|
+
date: string;
|
|
23
|
+
blocks: CalendarBlock[];
|
|
24
|
+
allDay: EventView[];
|
|
25
|
+
}
|
|
26
|
+
export declare const isBusyOnly: (e: EventView) => boolean;
|
|
27
|
+
export declare function layoutDay(events: ReadonlyArray<EventView>, date: string, { timeZone, minMinutes }?: {
|
|
28
|
+
timeZone?: string;
|
|
29
|
+
minMinutes?: number;
|
|
30
|
+
}): DayLayout;
|
|
31
|
+
export declare function visibleRange(days: ReadonlyArray<DayLayout>, startHour?: number, endHour?: number): {
|
|
32
|
+
fromMin: number;
|
|
33
|
+
toMin: number;
|
|
34
|
+
};
|
|
35
|
+
export declare function weekDates(date: string, weekStartsOn?: number): string[];
|
|
36
|
+
export declare function overlapDays(events: ReadonlyArray<EventView>, dates: ReadonlyArray<string>, timeZone?: string): string[];
|
|
@@ -10,6 +10,9 @@ export interface EventView {
|
|
|
10
10
|
startOn?: string;
|
|
11
11
|
endOn?: string;
|
|
12
12
|
location?: string;
|
|
13
|
+
series?: number;
|
|
14
|
+
clientName?: string;
|
|
15
|
+
busyOnly?: boolean;
|
|
13
16
|
cardComponent?: string;
|
|
14
17
|
}
|
|
15
18
|
export type RenderComponent = (key: string, props?: Record<string, unknown>) => unknown;
|
|
@@ -33,7 +36,10 @@ export interface WriteResult {
|
|
|
33
36
|
success: boolean;
|
|
34
37
|
id?: string;
|
|
35
38
|
data?: unknown;
|
|
36
|
-
errors?: string
|
|
39
|
+
errors?: string | ReadonlyArray<{
|
|
40
|
+
message: string;
|
|
41
|
+
field?: string;
|
|
42
|
+
}>;
|
|
37
43
|
code?: 'DENIED' | 'CONFLICT' | 'INVALID' | 'FAILED';
|
|
38
44
|
}
|
|
39
45
|
export type Action<I> = (input: I) => Promise<WriteResult>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type WriteResult } from './event';
|
|
2
|
+
export interface CardIntent<A extends string = string> {
|
|
3
|
+
action: A;
|
|
4
|
+
values?: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export type IntentHandler<A extends string = string> = (intent: CardIntent<A>) => Promise<WriteResult | void> | WriteResult | void;
|
|
7
|
+
export declare function displayName(value: unknown): string | undefined;
|
|
8
|
+
export declare const NOT_AVAILABLE = "This can\u2019t be done from here yet.";
|
|
9
|
+
export declare function useIntent<A extends string>(handler: IntentHandler<A> | undefined): {
|
|
10
|
+
run: (action: A, values?: Record<string, unknown>) => Promise<{
|
|
11
|
+
ok: boolean;
|
|
12
|
+
result?: WriteResult | void;
|
|
13
|
+
}>;
|
|
14
|
+
busy: A | null;
|
|
15
|
+
message: string;
|
|
16
|
+
available: boolean;
|
|
17
|
+
clearMessage: () => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sameOriginPath(value: unknown): string | undefined;
|