@peripheries/core 0.2.0 → 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 (52) hide show
  1. package/README.md +1 -1
  2. package/index.css +1 -1
  3. package/index.js +2361 -443
  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 -0
  18. package/types/core/document/Contents/Contents.d.ts +1 -1
  19. package/types/core/events/EventCard/EventCard.d.ts +11 -0
  20. package/types/core/events/EventDetail/EventDetail.d.ts +29 -0
  21. package/types/core/events/EventLogForm/EventLogForm.d.ts +24 -0
  22. package/types/core/events/EventRespond/EventRespond.d.ts +13 -0
  23. package/types/core/events/EventSchedule/EventSchedule.d.ts +15 -0
  24. package/types/core/events/EventTimeline/EventTimeline.d.ts +21 -0
  25. package/types/core/events/_shared/event.d.ts +51 -0
  26. package/types/core/feedback/Badge/Badge.d.ts +10 -0
  27. package/types/core/feedback/Notice/Notice.d.ts +12 -0
  28. package/types/core/feedback/Progress/Progress.d.ts +12 -0
  29. package/types/core/feedback/Skeleton/Skeleton.d.ts +10 -0
  30. package/types/core/feedback/Spinner/Spinner.d.ts +8 -0
  31. package/types/core/feedback/Tooltip/Tooltip.d.ts +10 -0
  32. package/types/core/forms/Checkbox/Checkbox.d.ts +8 -0
  33. package/types/core/forms/CheckboxGroup/CheckboxGroup.d.ts +11 -0
  34. package/types/core/forms/DateRange/DateRange.d.ts +15 -0
  35. package/types/core/forms/FileField/FileField.d.ts +28 -0
  36. package/types/core/forms/FormField/FormField.d.ts +15 -0
  37. package/types/core/forms/RadioGroup/RadioGroup.d.ts +9 -0
  38. package/types/core/forms/SearchField/SearchField.d.ts +10 -0
  39. package/types/core/forms/Select/Select.d.ts +10 -0
  40. package/types/core/forms/Slider/Slider.d.ts +11 -0
  41. package/types/core/forms/Switch/Switch.d.ts +7 -0
  42. package/types/core/forms/TextArea/TextArea.d.ts +13 -0
  43. package/types/core/forms/TextField/TextField.d.ts +21 -0
  44. package/types/core/forms/_shared/field.d.ts +32 -0
  45. package/types/core/page/PageFrame/PageFrame.d.ts +9 -0
  46. package/types/core/page/RuleSection/RuleSection.d.ts +11 -0
  47. package/types/core/page/UnderlinedAction/UnderlinedAction.d.ts +10 -0
  48. package/types/core/text/Avatar/Avatar.d.ts +12 -0
  49. package/types/core/text/Code/Code.d.ts +9 -0
  50. package/types/core/text/Heading/Heading.d.ts +11 -0
  51. package/types/core/text/Text/Text.d.ts +17 -0
  52. package/types/index.core.d.ts +44 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peripheries/core",
3
- "version": "0.2.0",
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,7 +8,9 @@ export interface DataTableColumn {
8
8
  sublabel?: ReactNode;
9
9
  align?: DataTableAlign;
10
10
  minWidth?: number;
11
+ format?: DataTableColumnFormat;
11
12
  }
13
+ export type DataTableColumnFormat = 'date' | 'datetime';
12
14
  export interface DataTableCell {
13
15
  value: FormattableValue | ReactNode;
14
16
  tone?: Tone | string;
@@ -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;
@@ -0,0 +1,15 @@
1
+ import { type ReactNode, type CSSProperties } from 'react';
2
+ export interface FormFieldProps {
3
+ label?: string;
4
+ hint?: string;
5
+ error?: string;
6
+ required?: boolean;
7
+ htmlFor?: string;
8
+ hintId?: string;
9
+ errorId?: string;
10
+ as?: 'div' | 'fieldset';
11
+ children?: ReactNode;
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ }
15
+ export declare function FormField({ label, hint, error, required, htmlFor, hintId, errorId, as, children, className, style }: FormFieldProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import { type ChoiceOption, type FieldProps } from '../_shared/field';
3
+ export interface RadioGroupProps extends FieldProps<string | null> {
4
+ options: ChoiceOption[];
5
+ orientation?: 'vertical' | 'horizontal';
6
+ ref?: Ref<HTMLInputElement>;
7
+ style?: CSSProperties;
8
+ }
9
+ export declare function RadioGroup({ options, value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, orientation, className, style, ref }: RadioGroupProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import type { FieldProps } from '../_shared/field';
3
+ export interface SearchFieldProps extends FieldProps<string> {
4
+ placeholder?: string;
5
+ onSearch?: (query: string) => void;
6
+ size?: 'sm' | 'md';
7
+ ref?: Ref<HTMLInputElement>;
8
+ style?: CSSProperties;
9
+ }
10
+ export declare function SearchField({ value, defaultValue, onChange, setValue, label, onSearch, size, className, ...rest }: SearchFieldProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import { type ChoiceOption, type FieldProps } from '../_shared/field';
3
+ export type { ChoiceOption };
4
+ export interface SelectProps extends FieldProps<string | null> {
5
+ options: ChoiceOption[];
6
+ placeholder?: string;
7
+ ref?: Ref<HTMLSelectElement>;
8
+ style?: CSSProperties;
9
+ }
10
+ export declare function Select({ options, value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, placeholder, className, style, ref }: SelectProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import { type FieldProps } from '../_shared/field';
3
+ export interface SliderProps extends FieldProps<number> {
4
+ min?: number;
5
+ max?: number;
6
+ step?: number;
7
+ format?: (value: number) => string;
8
+ ref?: Ref<HTMLInputElement>;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function Slider({ value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, min, max, step, format, className, style, ref }: SliderProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type Ref, type CSSProperties } from 'react';
2
+ import { type FieldProps } from '../_shared/field';
3
+ export interface SwitchProps extends FieldProps<boolean> {
4
+ ref?: Ref<HTMLButtonElement>;
5
+ style?: CSSProperties;
6
+ }
7
+ export declare function Switch({ value, defaultValue, onChange, setValue, id, name, label, hint, error, disabled, readOnly, className, style, ref }: SwitchProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type KeyboardEvent, type Ref, type CSSProperties } from 'react';
2
+ import { type FieldProps } from '../_shared/field';
3
+ export interface TextAreaProps extends FieldProps<string> {
4
+ placeholder?: string;
5
+ rows?: number;
6
+ autoGrow?: boolean;
7
+ maxLength?: number;
8
+ onKeyDown?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;
9
+ onBlur?: () => void;
10
+ ref?: Ref<HTMLTextAreaElement>;
11
+ style?: CSSProperties;
12
+ }
13
+ export declare function TextArea({ value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, placeholder, rows, autoGrow, maxLength, onKeyDown, onBlur, className, style, ref }: TextAreaProps): import("react").JSX.Element;