@peripheries/core 0.1.1 → 0.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.
Files changed (59) hide show
  1. package/README.md +1 -1
  2. package/index.css +1 -1
  3. package/index.js +2396 -500
  4. package/package.json +1 -1
  5. package/types/core/Accordion/Accordion.d.ts +17 -0
  6. package/types/core/Card/Card.d.ts +13 -0
  7. package/types/core/Columns/Columns.d.ts +14 -0
  8. package/types/core/Disclosure/Disclosure.d.ts +11 -0
  9. package/types/core/Grid/Grid.d.ts +11 -0
  10. package/types/core/Repeat/Repeat.d.ts +14 -0
  11. package/types/core/actions/Button/Button.d.ts +21 -0
  12. package/types/core/actions/Chip/Chip.d.ts +15 -0
  13. package/types/core/actions/IconButton/IconButton.d.ts +14 -0
  14. package/types/core/actions/Link/Link.d.ts +11 -0
  15. package/types/core/actions/SegmentedControl/SegmentedControl.d.ts +19 -0
  16. package/types/core/actions/_shared/press.d.ts +18 -0
  17. package/types/core/display/DataTable/DataTable.d.ts +2 -2
  18. package/types/core/display/DisclaimerBlock/DisclaimerBlock.d.ts +1 -2
  19. package/types/core/display/HighlightBox/HighlightBox.d.ts +1 -2
  20. package/types/core/display/KpiCardGrid/KpiCardGrid.d.ts +0 -8
  21. package/types/core/display/OptionCard/OptionCard.d.ts +0 -6
  22. package/types/core/display/ProfileCard/ProfileCard.d.ts +0 -2
  23. package/types/core/display/StatStrip/StatStrip.d.ts +1 -4
  24. package/types/core/display/_shared/tone.d.ts +0 -1
  25. package/types/core/document/Contents/Contents.d.ts +1 -1
  26. package/types/core/events/EventCard/EventCard.d.ts +11 -0
  27. package/types/core/events/EventDetail/EventDetail.d.ts +29 -0
  28. package/types/core/events/EventLogForm/EventLogForm.d.ts +24 -0
  29. package/types/core/events/EventRespond/EventRespond.d.ts +13 -0
  30. package/types/core/events/EventSchedule/EventSchedule.d.ts +15 -0
  31. package/types/core/events/EventTimeline/EventTimeline.d.ts +21 -0
  32. package/types/core/events/_shared/event.d.ts +51 -0
  33. package/types/core/feedback/Badge/Badge.d.ts +10 -0
  34. package/types/core/feedback/Notice/Notice.d.ts +12 -0
  35. package/types/core/feedback/Progress/Progress.d.ts +12 -0
  36. package/types/core/feedback/Skeleton/Skeleton.d.ts +10 -0
  37. package/types/core/feedback/Spinner/Spinner.d.ts +8 -0
  38. package/types/core/feedback/Tooltip/Tooltip.d.ts +10 -0
  39. package/types/core/forms/Checkbox/Checkbox.d.ts +8 -0
  40. package/types/core/forms/CheckboxGroup/CheckboxGroup.d.ts +11 -0
  41. package/types/core/forms/DateRange/DateRange.d.ts +15 -0
  42. package/types/core/forms/FileField/FileField.d.ts +28 -0
  43. package/types/core/forms/FormField/FormField.d.ts +15 -0
  44. package/types/core/forms/RadioGroup/RadioGroup.d.ts +9 -0
  45. package/types/core/forms/SearchField/SearchField.d.ts +10 -0
  46. package/types/core/forms/Select/Select.d.ts +10 -0
  47. package/types/core/forms/Slider/Slider.d.ts +11 -0
  48. package/types/core/forms/Switch/Switch.d.ts +7 -0
  49. package/types/core/forms/TextArea/TextArea.d.ts +13 -0
  50. package/types/core/forms/TextField/TextField.d.ts +21 -0
  51. package/types/core/forms/_shared/field.d.ts +32 -0
  52. package/types/core/page/PageFrame/PageFrame.d.ts +9 -0
  53. package/types/core/page/RuleSection/RuleSection.d.ts +11 -0
  54. package/types/core/page/UnderlinedAction/UnderlinedAction.d.ts +10 -0
  55. package/types/core/text/Avatar/Avatar.d.ts +12 -0
  56. package/types/core/text/Code/Code.d.ts +9 -0
  57. package/types/core/text/Heading/Heading.d.ts +11 -0
  58. package/types/core/text/Text/Text.d.ts +17 -0
  59. package/types/index.core.d.ts +45 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peripheries/core",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "The shared core lineage: layout, the document kit and the display cells, on the semantic tokens",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -0,0 +1,17 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ export type AccordionItem = {
3
+ id?: string;
4
+ question: string;
5
+ answer: string;
6
+ open?: boolean;
7
+ };
8
+ export interface AccordionProps {
9
+ items?: AccordionItem[];
10
+ children?: ReactNode;
11
+ numbered?: boolean;
12
+ single?: boolean;
13
+ rules?: 'strong' | 'subtle';
14
+ className?: string;
15
+ style?: CSSProperties;
16
+ }
17
+ export declare function Accordion({ items, children, numbered, single, rules, className, ...rest }: AccordionProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export type CardTone = 'plain' | 'raised' | 'sunken';
3
+ export interface CardProps {
4
+ media?: ReactNode;
5
+ header?: ReactNode;
6
+ body?: ReactNode;
7
+ footer?: ReactNode;
8
+ children?: ReactNode;
9
+ tone?: CardTone;
10
+ className?: string;
11
+ style?: CSSProperties;
12
+ }
13
+ export declare function Card({ media, header, body, footer, children, tone, className, ...rest }: CardProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export type ColumnsRatio = '1:1' | '2:1' | '1:2' | '3:1' | '1:3';
3
+ export interface ColumnsProps {
4
+ start?: ReactNode;
5
+ end?: ReactNode;
6
+ children?: ReactNode;
7
+ ratio?: ColumnsRatio | string;
8
+ gap?: number | string;
9
+ stackBelow?: 'narrow' | 'compact';
10
+ className?: string;
11
+ style?: CSSProperties;
12
+ }
13
+ export declare function Columns({ start, end, children, ratio, gap, stackBelow, className, ...rest }: ColumnsProps): import("react").JSX.Element;
14
+ export declare const Split: typeof Columns;
@@ -0,0 +1,11 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export interface DisclosureProps {
3
+ summary?: ReactNode;
4
+ content?: ReactNode;
5
+ children?: ReactNode;
6
+ open?: boolean;
7
+ onToggle?: (open: boolean) => void;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function Disclosure({ summary, content, children, open, onToggle, className, ...rest }: DisclosureProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ReactNode, type CSSProperties } from 'react';
2
+ export interface GridProps {
3
+ items?: ReactNode;
4
+ children?: ReactNode;
5
+ min?: number | string;
6
+ columns?: number;
7
+ gap?: number | string;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function Grid({ items, children, min, columns, gap, className, style, ...rest }: GridProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type ReactNode, type CSSProperties } from 'react';
2
+ export type RepeatLayout = 'stack' | 'inline' | 'grid';
3
+ export interface RepeatProps {
4
+ item?: ReactNode;
5
+ each?: unknown;
6
+ as?: string;
7
+ layout?: RepeatLayout;
8
+ gap?: number | string;
9
+ min?: number | string;
10
+ empty?: string;
11
+ className?: string;
12
+ style?: CSSProperties;
13
+ }
14
+ export declare function Repeat({ item, each: _each, as: _as, layout, gap, min, empty, className, style, ...rest }: RepeatProps): import("react").JSX.Element | null;
@@ -0,0 +1,21 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ import { type PressProps } from '../_shared/press';
3
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost';
4
+ export type ButtonSize = 'sm' | 'md' | 'lg';
5
+ export type ButtonTone = 'neutral' | 'danger';
6
+ export interface ButtonProps extends PressProps {
7
+ children?: ReactNode;
8
+ label?: string;
9
+ variant?: ButtonVariant;
10
+ size?: ButtonSize;
11
+ tone?: ButtonTone;
12
+ iconLeft?: ReactNode;
13
+ iconRight?: ReactNode;
14
+ loading?: boolean;
15
+ disabled?: boolean;
16
+ type?: 'button' | 'submit' | 'reset';
17
+ fullWidth?: boolean;
18
+ className?: string;
19
+ style?: CSSProperties;
20
+ }
21
+ export declare function Button({ children, label, variant, size, tone, iconLeft, iconRight, loading, disabled, type, fullWidth, className, href, action, input, actions, navigate, onClick, ...rest }: ButtonProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ import { type PressProps } from '../_shared/press';
3
+ export interface ChipProps extends PressProps {
4
+ children?: ReactNode;
5
+ label?: string;
6
+ variant?: 'prompt' | 'toggle';
7
+ size?: 'sm' | 'md';
8
+ selected?: boolean;
9
+ onToggle?: (next: boolean) => void;
10
+ iconLeft?: ReactNode;
11
+ disabled?: boolean;
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ }
15
+ export declare function Chip({ children, label, variant, size, selected, onToggle, iconLeft, disabled, className, href, action, input, actions, navigate, onClick, ...rest }: ChipProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ import { type PressProps } from '../_shared/press';
3
+ export interface IconButtonProps extends PressProps {
4
+ icon?: ReactNode;
5
+ children?: ReactNode;
6
+ label: string;
7
+ size?: 'sm' | 'md' | 'lg';
8
+ variant?: 'ghost' | 'secondary' | 'primary';
9
+ pressed?: boolean;
10
+ disabled?: boolean;
11
+ className?: string;
12
+ style?: CSSProperties;
13
+ }
14
+ export declare function IconButton({ icon, children, label, size, variant, pressed, disabled, className, href, action, input, actions, navigate, onClick, ...rest }: IconButtonProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ import { type PressProps } from '../_shared/press';
3
+ export interface LinkProps extends Omit<PressProps, 'action' | 'input'> {
4
+ href: string;
5
+ children?: ReactNode;
6
+ label?: string;
7
+ variant?: 'default' | 'subtle';
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function Link({ href, children, label, variant, className, navigate, onClick, ...rest }: LinkProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { type CSSProperties } from 'react';
2
+ export type Segment = {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ };
7
+ export interface SegmentedControlProps {
8
+ options: Segment[];
9
+ value?: string;
10
+ defaultValue?: string;
11
+ onChange?: (value: string) => void;
12
+ label?: string;
13
+ fullWidth?: boolean;
14
+ size?: 'sm' | 'md';
15
+ className?: string;
16
+ setValue?: (value: string) => void;
17
+ style?: CSSProperties;
18
+ }
19
+ export declare function SegmentedControl({ options, value, defaultValue, onChange, label, fullWidth, size, className, setValue, ...rest }: SegmentedControlProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { type MouseEvent } from 'react';
2
+ type CellAction = (input: unknown) => Promise<unknown>;
3
+ export interface PressProps {
4
+ href?: string;
5
+ action?: string;
6
+ input?: unknown;
7
+ actions?: Record<string, CellAction>;
8
+ navigate?: (to: string) => void;
9
+ onClick?: (e: MouseEvent<HTMLElement>) => void;
10
+ }
11
+ export declare const isInApp: (href: string) => boolean;
12
+ export declare const isFragment: (href: string) => boolean;
13
+ export declare function usePress({ href, action, input, actions, navigate, onClick }: PressProps): {
14
+ busy: boolean;
15
+ onClick: (e: MouseEvent<HTMLElement>) => void;
16
+ external: boolean;
17
+ };
18
+ export {};
@@ -8,8 +8,9 @@ export interface DataTableColumn {
8
8
  sublabel?: ReactNode;
9
9
  align?: DataTableAlign;
10
10
  minWidth?: number;
11
- label?: ReactNode;
11
+ format?: DataTableColumnFormat;
12
12
  }
13
+ export type DataTableColumnFormat = 'date' | 'datetime';
13
14
  export interface DataTableCell {
14
15
  value: FormattableValue | ReactNode;
15
16
  tone?: Tone | string;
@@ -19,7 +20,6 @@ export interface DataTableRow {
19
20
  cells: ReadonlyArray<DataTableCellInput> | Readonly<Record<string, DataTableCellInput>>;
20
21
  highlighted?: boolean;
21
22
  total?: boolean;
22
- tone?: 'default' | 'total' | 'highlight' | string;
23
23
  }
24
24
  export interface DataTableProps {
25
25
  title?: string;
@@ -1,9 +1,8 @@
1
1
  import type { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  export interface DisclaimerBlockProps {
3
3
  label?: string;
4
- leadIn?: string;
5
4
  children?: ReactNode;
6
5
  className?: string;
7
6
  style?: CSSProperties;
8
7
  }
9
- export declare function DisclaimerBlock({ label, leadIn, children, className, style }: DisclaimerBlockProps): ReactElement;
8
+ export declare function DisclaimerBlock({ label, children, className, style }: DisclaimerBlockProps): ReactElement;
@@ -2,7 +2,6 @@ import type { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  import { type Tone } from '../_shared/tone';
3
3
  export interface HighlightBoxProps {
4
4
  tone?: Tone | string;
5
- variant?: string;
6
5
  label?: string;
7
6
  headline?: ReactNode;
8
7
  children?: ReactNode;
@@ -10,4 +9,4 @@ export interface HighlightBoxProps {
10
9
  className?: string;
11
10
  style?: CSSProperties;
12
11
  }
13
- export declare function HighlightBox({ tone, variant, label, headline, children, trailing, className, style }: HighlightBoxProps): ReactElement;
12
+ export declare function HighlightBox({ tone, label, headline, children, trailing, className, style }: HighlightBoxProps): ReactElement;
@@ -12,12 +12,6 @@ export interface KpiCard {
12
12
  tone?: Tone | string;
13
13
  delta?: FormattableValue;
14
14
  badge?: KpiCardBadge;
15
- caption?: FormattableValue;
16
- borderColor?: string;
17
- tag?: {
18
- label: FormattableValue;
19
- tone?: string;
20
- };
21
15
  }
22
16
  export interface KpiCardGridProps {
23
17
  cards?: ReadonlyArray<KpiCard>;
@@ -26,7 +20,5 @@ export interface KpiCardGridProps {
26
20
  minColumnWidth?: number;
27
21
  className?: string;
28
22
  style?: CSSProperties;
29
- items?: ReadonlyArray<KpiCard>;
30
23
  }
31
24
  export declare function KpiCardGrid(props: KpiCardGridProps): ReactElement;
32
- export declare const KpiGrid: typeof KpiCardGrid;
@@ -7,8 +7,6 @@ export interface OptionCardBar {
7
7
  fillPercent: number;
8
8
  tone?: Tone | string;
9
9
  valueTone?: Tone | string;
10
- color?: string;
11
- accent?: string;
12
10
  }
13
11
  export interface OptionCardProps {
14
12
  number?: number | string;
@@ -21,9 +19,5 @@ export interface OptionCardProps {
21
19
  isSelected?: boolean;
22
20
  className?: string;
23
21
  style?: CSSProperties;
24
- name?: string;
25
- badge?: FormattableValue;
26
- badgeVariant?: string;
27
- accent?: string;
28
22
  }
29
23
  export declare function OptionCard(props: OptionCardProps): ReactElement;
@@ -4,7 +4,6 @@ import { type Tone } from '../_shared/tone';
4
4
  export interface ProfileRowBadge {
5
5
  text: FormattableValue;
6
6
  tone?: Tone | string;
7
- variant?: string;
8
7
  }
9
8
  export interface ProfileRow {
10
9
  label: string;
@@ -18,6 +17,5 @@ export interface ProfileCardProps {
18
17
  rows?: ReadonlyArray<ProfileRow>;
19
18
  className?: string;
20
19
  style?: CSSProperties;
21
- headerAccent?: string;
22
20
  }
23
21
  export declare function ProfileCard(props: ProfileCardProps): ReactElement;
@@ -7,10 +7,7 @@ export interface StatStripProps {
7
7
  fillPercent?: number;
8
8
  subtitle?: FormattableValue;
9
9
  tone?: Tone | string;
10
- accentColor?: string;
11
- accent?: string;
12
- caption?: FormattableValue;
13
10
  className?: string;
14
11
  style?: CSSProperties;
15
12
  }
16
- export declare function StatStrip({ label, value, fillPercent, subtitle, tone, accentColor, accent, caption, className, style }: StatStripProps): ReactElement;
13
+ export declare function StatStrip({ label, value, fillPercent, subtitle, tone, className, style }: StatStripProps): ReactElement;
@@ -1,4 +1,3 @@
1
1
  export type Tone = 'neutral' | 'strong' | 'accent' | 'info' | 'success' | 'warning' | 'danger';
2
2
  export declare const TONES: ReadonlyArray<Tone>;
3
3
  export declare function toneOf(value: unknown, fallback?: Tone): Tone;
4
- export declare const isToneAlias: (value: unknown) => boolean;
@@ -8,7 +8,7 @@ export interface ContentsEntry {
8
8
  page?: number;
9
9
  }
10
10
  export interface ContentsProps {
11
- entries: ReadonlyArray<ContentsEntry>;
11
+ entries?: ReadonlyArray<ContentsEntry>;
12
12
  depth?: number;
13
13
  title?: string;
14
14
  profileId?: ProfileId;
@@ -0,0 +1,11 @@
1
+ import type { CSSProperties, ReactElement } from 'react';
2
+ import { type EventView } from '../_shared/event';
3
+ export interface EventCardProps {
4
+ event: EventView;
5
+ href?: string;
6
+ locale?: string;
7
+ timeZone?: string;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function EventCard(props: EventCardProps): ReactElement;
@@ -0,0 +1,29 @@
1
+ import type { CSSProperties, ReactElement } from 'react';
2
+ import { type Action, type EventView, type Response } from '../_shared/event';
3
+ export interface EventNoteView {
4
+ body: string;
5
+ audience?: 'shared' | 'staff';
6
+ author?: string;
7
+ createdAt?: string;
8
+ }
9
+ export interface EventParticipantView {
10
+ name: string;
11
+ role?: string;
12
+ response?: Response;
13
+ }
14
+ export interface EventDetailProps {
15
+ event: EventView;
16
+ notes?: ReadonlyArray<EventNoteView>;
17
+ participants?: ReadonlyArray<EventParticipantView>;
18
+ viewerResponse?: Response;
19
+ actions?: {
20
+ respond?: Action<{
21
+ response: string;
22
+ }>;
23
+ };
24
+ locale?: string;
25
+ timeZone?: string;
26
+ className?: string;
27
+ style?: CSSProperties;
28
+ }
29
+ export declare function EventDetail(props: EventDetailProps): ReactElement;
@@ -0,0 +1,24 @@
1
+ import { type CSSProperties, type ReactElement } from 'react';
2
+ import { type Action, type EventTypeOption, type WriteResult } from '../_shared/event';
3
+ export interface LogEventInput {
4
+ event: Record<string, unknown>;
5
+ notes?: Array<{
6
+ body: string;
7
+ audience: 'shared' | 'staff';
8
+ }>;
9
+ }
10
+ export interface EventLogFormProps {
11
+ types: ReadonlyArray<EventTypeOption>;
12
+ orgId: string;
13
+ projectId?: string;
14
+ subjects?: ReadonlyArray<string>;
15
+ defaultTypeId?: string;
16
+ canWriteStaffNotes?: boolean;
17
+ actions?: {
18
+ logEvent?: Action<LogEventInput>;
19
+ };
20
+ onDone?: (result: WriteResult) => void;
21
+ className?: string;
22
+ style?: CSSProperties;
23
+ }
24
+ export declare function EventLogForm(props: EventLogFormProps): ReactElement;
@@ -0,0 +1,13 @@
1
+ import { type CSSProperties, type ReactElement } from 'react';
2
+ import { type Action, type Response } from '../_shared/event';
3
+ export interface EventRespondProps {
4
+ response?: Response;
5
+ actions?: {
6
+ respond?: Action<{
7
+ response: string;
8
+ }>;
9
+ };
10
+ className?: string;
11
+ style?: CSSProperties;
12
+ }
13
+ export declare function EventRespond(props: EventRespondProps): ReactElement;
@@ -0,0 +1,15 @@
1
+ import type { CSSProperties, ReactElement } from 'react';
2
+ import { type RenderComponent, type EventView } from '../_shared/event';
3
+ export interface EventScheduleProps {
4
+ occurrences: ReadonlyArray<EventView>;
5
+ view?: 'week' | 'agenda';
6
+ weekOf?: string;
7
+ weekParam?: string;
8
+ eventHref?: string;
9
+ locale?: string;
10
+ timeZone?: string;
11
+ renderComponent?: RenderComponent;
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ }
15
+ export declare function EventSchedule(props: EventScheduleProps): ReactElement;
@@ -0,0 +1,21 @@
1
+ import type { CSSProperties, ReactElement } from 'react';
2
+ import { type RenderComponent, type EventView } from '../_shared/event';
3
+ export interface ActivityItem {
4
+ id?: string;
5
+ at: string;
6
+ summary?: string;
7
+ actor?: string;
8
+ op?: string;
9
+ event?: EventView;
10
+ }
11
+ export interface EventTimelineProps {
12
+ items: ReadonlyArray<ActivityItem>;
13
+ eventHref?: string;
14
+ emptyText?: string;
15
+ locale?: string;
16
+ timeZone?: string;
17
+ renderComponent?: RenderComponent;
18
+ className?: string;
19
+ style?: CSSProperties;
20
+ }
21
+ export declare function EventTimeline(props: EventTimelineProps): ReactElement;
@@ -0,0 +1,51 @@
1
+ export interface EventView {
2
+ id?: string;
3
+ name: string;
4
+ typeName?: string;
5
+ kind?: 'scheduled' | 'record';
6
+ status?: 'tentative' | 'confirmed' | 'cancelled' | 'completed';
7
+ startsAt?: string;
8
+ endsAt?: string;
9
+ tzid?: string;
10
+ startOn?: string;
11
+ endOn?: string;
12
+ location?: string;
13
+ cardComponent?: string;
14
+ }
15
+ export type RenderComponent = (key: string, props?: Record<string, unknown>) => unknown;
16
+ export declare function typeCard(e: EventView, renderComponent: RenderComponent | undefined, props: Record<string, unknown>): unknown;
17
+ export interface EventTypeOption {
18
+ id: string;
19
+ name: string;
20
+ kind: 'scheduled' | 'record';
21
+ dataSchema?: {
22
+ properties?: Record<string, JsonField>;
23
+ required?: string[];
24
+ } | null;
25
+ }
26
+ export interface JsonField {
27
+ type?: 'string' | 'number' | 'integer' | 'boolean';
28
+ enum?: string[];
29
+ title?: string;
30
+ description?: string;
31
+ }
32
+ export interface WriteResult {
33
+ success: boolean;
34
+ id?: string;
35
+ data?: unknown;
36
+ errors?: string;
37
+ code?: 'DENIED' | 'CONFLICT' | 'INVALID' | 'FAILED';
38
+ }
39
+ export type Action<I> = (input: I) => Promise<WriteResult>;
40
+ export declare const RESPONSES: readonly ["accepted", "tentative", "declined"];
41
+ export type Response = (typeof RESPONSES)[number] | 'needs_action' | 'delegated';
42
+ export declare function eventWhen(e: EventView, locale?: string, timeZone?: string): string;
43
+ export declare const localZone: () => string;
44
+ export declare function localToInstant(value: string): string | undefined;
45
+ export declare function nowLocal(): string;
46
+ export declare function writeMessage(r: WriteResult): string;
47
+ export declare function dateIn(instant: string | Date, timeZone?: string): string;
48
+ export declare function addDays(date: string, n: number): string;
49
+ export declare function weekStart(date: string): string;
50
+ export declare function datesOf(e: EventView, timeZone?: string): string[];
51
+ export declare const hrefFrom: (template: string | undefined, id: string | undefined) => string | undefined;
@@ -0,0 +1,10 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export interface BadgeProps {
3
+ label?: string;
4
+ children?: ReactNode;
5
+ tone?: string;
6
+ variant?: 'soft' | 'solid' | 'outline';
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ }
10
+ export declare function Badge({ label, children, tone, variant, className, ...rest }: BadgeProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export interface NoticeProps {
3
+ title?: string;
4
+ message?: string;
5
+ children?: ReactNode;
6
+ tone?: 'info' | 'success' | 'warning' | 'danger' | string;
7
+ action?: ReactNode;
8
+ onDismiss?: () => void;
9
+ className?: string;
10
+ style?: CSSProperties;
11
+ }
12
+ export declare function Notice({ title, message, children, tone, action, onDismiss, className, ...rest }: NoticeProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties } from 'react';
2
+ export interface ProgressProps {
3
+ value?: number;
4
+ max?: number;
5
+ label?: string;
6
+ showValue?: boolean;
7
+ tone?: string;
8
+ size?: 'sm' | 'md';
9
+ className?: string;
10
+ style?: CSSProperties;
11
+ }
12
+ export declare function Progress({ value, max, label, showValue, tone, size, className, style, ...rest }: ProgressProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { CSSProperties } from 'react';
2
+ export interface SkeletonProps {
3
+ shape?: 'text' | 'block' | 'circle';
4
+ lines?: number;
5
+ width?: number | string;
6
+ height?: number | string;
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ }
10
+ export declare function Skeleton({ shape, lines, width, height, className, style: given, ...rest }: SkeletonProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties } from 'react';
2
+ export interface SpinnerProps {
3
+ label?: string;
4
+ size?: 'sm' | 'md' | 'lg';
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ }
8
+ export declare function Spinner({ label, size, className, ...rest }: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ReactNode, type CSSProperties } from 'react';
2
+ export interface TooltipProps {
3
+ content?: ReactNode;
4
+ text?: string;
5
+ children?: ReactNode;
6
+ side?: 'top' | 'bottom';
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ }
10
+ export declare function Tooltip({ content, text, children, side, className, ...rest }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode, type Ref, type CSSProperties } from 'react';
2
+ import { type FieldProps } from '../_shared/field';
3
+ export interface CheckboxProps extends FieldProps<boolean> {
4
+ children?: ReactNode;
5
+ ref?: Ref<HTMLInputElement>;
6
+ style?: CSSProperties;
7
+ }
8
+ export declare function Checkbox({ value, defaultValue, onChange, setValue, id, name, label, children, hint, error, required, disabled, readOnly, className, style, ref }: CheckboxProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import { type ChoiceOption, type FieldProps } from '../_shared/field';
3
+ export interface CheckboxGroupProps extends FieldProps<string[]> {
4
+ options: ChoiceOption[];
5
+ orientation?: 'vertical' | 'horizontal';
6
+ min?: number;
7
+ max?: number;
8
+ ref?: Ref<HTMLInputElement>;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function CheckboxGroup({ options, value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, orientation, min, max, className, style, ref }: CheckboxGroupProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import { type FieldProps } from '../_shared/field';
3
+ export type DateRangeValue = {
4
+ from: string | null;
5
+ to: string | null;
6
+ };
7
+ export interface DateRangeProps extends FieldProps<DateRangeValue> {
8
+ min?: string;
9
+ max?: string;
10
+ fromLabel?: string;
11
+ toLabel?: string;
12
+ ref?: Ref<HTMLInputElement>;
13
+ style?: CSSProperties;
14
+ }
15
+ export declare function DateRange({ value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, min, max, fromLabel, toLabel, className, style, ref }: DateRangeProps): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import { type FieldProps } from '../_shared/field';
3
+ export type StoredFile = {
4
+ bucket: string;
5
+ path: string;
6
+ name: string;
7
+ type: string;
8
+ size: number;
9
+ doc_hash?: string;
10
+ };
11
+ export type FileValue = {
12
+ v: 1;
13
+ file: StoredFile;
14
+ };
15
+ export type UploadResult = FileValue | {
16
+ error: string;
17
+ };
18
+ export interface FileFieldProps extends FieldProps<FileValue | null> {
19
+ upload?: (file: File, options: {
20
+ hash: boolean;
21
+ }) => Promise<UploadResult>;
22
+ accept?: string;
23
+ hash?: boolean;
24
+ ref?: Ref<HTMLButtonElement>;
25
+ style?: CSSProperties;
26
+ }
27
+ export declare function fileSize(bytes: number): string;
28
+ export declare function FileField({ value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, upload, accept, hash, className, style, ref }: FileFieldProps): import("react").JSX.Element;