@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
@@ -0,0 +1,21 @@
1
+ import { type KeyboardEvent, type Ref, type CSSProperties } from 'react';
2
+ import { type FieldProps } from '../_shared/field';
3
+ export type TextFieldType = 'text' | 'number' | 'email' | 'tel' | 'url' | 'date' | 'datetime-local';
4
+ export interface TextFieldProps extends FieldProps<string | number | null> {
5
+ type?: TextFieldType;
6
+ placeholder?: string;
7
+ inputMode?: 'text' | 'numeric' | 'decimal' | 'email' | 'tel' | 'url' | 'search' | 'none';
8
+ autoComplete?: string;
9
+ min?: number | string;
10
+ max?: number | string;
11
+ step?: number | string;
12
+ prefix?: string;
13
+ suffix?: string;
14
+ onEnter?: (event: KeyboardEvent<HTMLInputElement>) => void;
15
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
16
+ onBlur?: () => void;
17
+ ref?: Ref<HTMLInputElement>;
18
+ style?: CSSProperties;
19
+ }
20
+ export declare const toNumber: (text: string) => number | null;
21
+ export declare function TextField({ type, value, defaultValue, onChange, setValue, id, name, label, hint, error, required, disabled, readOnly, placeholder, inputMode, autoComplete, min, max, step, prefix, suffix, onEnter, onKeyDown, onBlur, className, style, ref }: TextFieldProps): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { type CSSProperties } from 'react';
2
+ export interface FieldProps<V> {
3
+ value?: V;
4
+ defaultValue?: V;
5
+ onChange?: (value: V) => void;
6
+ setValue?: (value: V) => void;
7
+ id?: string;
8
+ name?: string;
9
+ label?: string;
10
+ hint?: string;
11
+ error?: string;
12
+ required?: boolean;
13
+ disabled?: boolean;
14
+ readOnly?: boolean;
15
+ className?: string;
16
+ style?: CSSProperties;
17
+ }
18
+ export declare function useFieldIds(id: string | undefined, hint?: string, error?: string): {
19
+ control: string;
20
+ hintId: string | undefined;
21
+ errorId: string | undefined;
22
+ aria: {
23
+ 'aria-describedby': string | undefined;
24
+ 'aria-invalid': true | undefined;
25
+ };
26
+ };
27
+ export declare function emit<V>(onChange?: (v: V) => void, setValue?: (v: V) => void): (v: V) => void;
28
+ export type ChoiceOption = {
29
+ value: string;
30
+ label: string;
31
+ disabled?: boolean;
32
+ };
@@ -0,0 +1,9 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export interface PageFrameProps {
3
+ header?: ReactNode;
4
+ children?: ReactNode;
5
+ measure?: 'prose' | 'page' | 'full';
6
+ className?: string;
7
+ style?: CSSProperties;
8
+ }
9
+ export declare function PageFrame({ header, children, measure, className, ...rest }: PageFrameProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export interface RuleSectionProps {
3
+ label?: string;
4
+ actions?: ReactNode;
5
+ children?: ReactNode;
6
+ rail?: boolean;
7
+ anchor?: string;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function RuleSection({ label, actions, children, rail, anchor, className, ...rest }: RuleSectionProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ import { type PressProps } from '../../actions/_shared/press';
3
+ export interface UnderlinedActionProps extends PressProps {
4
+ label?: string;
5
+ children?: ReactNode;
6
+ arrow?: boolean;
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ }
10
+ export declare function UnderlinedAction({ label, children, arrow, className, href, action, input, actions, navigate, onClick, ...rest }: UnderlinedActionProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type CSSProperties } from 'react';
2
+ export interface AvatarProps {
3
+ name?: string;
4
+ initials?: string;
5
+ src?: string;
6
+ alt?: string;
7
+ size?: 'sm' | 'md' | 'lg';
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare const initialsOf: (name?: string) => string;
12
+ export declare function Avatar({ name, initials, src, alt, size, className, ...rest }: AvatarProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export interface CodeProps {
3
+ code?: string;
4
+ children?: ReactNode;
5
+ block?: boolean;
6
+ className?: string;
7
+ style?: CSSProperties;
8
+ }
9
+ export declare function Code({ code, children, block, className, ...rest }: CodeProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export interface HeadingProps {
3
+ text?: string;
4
+ children?: ReactNode;
5
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
6
+ size?: 'display' | 'lg' | 'md' | 'sm' | 'xs';
7
+ anchor?: string;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export declare function Heading({ text, children, level, size, anchor, className, ...rest }: HeadingProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ export type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
+ export type TextTone = 'default' | 'muted' | 'subtle' | 'accent' | 'success' | 'warning' | 'danger';
4
+ export interface TextProps {
5
+ text?: string;
6
+ children?: ReactNode;
7
+ as?: 'span' | 'p' | 'div' | 'label' | 'strong' | 'em' | 'small';
8
+ size?: TextSize;
9
+ weight?: 'normal' | 'medium' | 'semibold' | 'bold';
10
+ tone?: TextTone;
11
+ align?: 'start' | 'center' | 'end';
12
+ truncate?: boolean;
13
+ lines?: number;
14
+ className?: string;
15
+ style?: CSSProperties;
16
+ }
17
+ export declare function Text({ text, children, as, size, weight, tone, align, truncate, lines, className, ...rest }: TextProps): import("react").JSX.Element;
@@ -8,6 +8,43 @@ export { Inline } from './core/Inline/Inline';
8
8
  export { Show } from './core/Show/Show';
9
9
  export { Spacer } from './core/Spacer/Spacer';
10
10
  export { Stack } from './core/Stack/Stack';
11
+ export { PageFrame, type PageFrameProps } from './core/page/PageFrame/PageFrame';
12
+ export { RuleSection, type RuleSectionProps } from './core/page/RuleSection/RuleSection';
13
+ export { UnderlinedAction, type UnderlinedActionProps } from './core/page/UnderlinedAction/UnderlinedAction';
14
+ export { Avatar, initialsOf, type AvatarProps } from './core/text/Avatar/Avatar';
15
+ export { Code, type CodeProps } from './core/text/Code/Code';
16
+ export { Heading, type HeadingProps } from './core/text/Heading/Heading';
17
+ export { Text, type TextProps, type TextSize, type TextTone } from './core/text/Text/Text';
18
+ export { Checkbox, type CheckboxProps } from './core/forms/Checkbox/Checkbox';
19
+ export { CheckboxGroup, type CheckboxGroupProps } from './core/forms/CheckboxGroup/CheckboxGroup';
20
+ export { DateRange, type DateRangeProps, type DateRangeValue } from './core/forms/DateRange/DateRange';
21
+ export { FileField, fileSize, type FileFieldProps, type FileValue, type StoredFile, type UploadResult } from './core/forms/FileField/FileField';
22
+ export { FormField, type FormFieldProps } from './core/forms/FormField/FormField';
23
+ export { RadioGroup, type RadioGroupProps } from './core/forms/RadioGroup/RadioGroup';
24
+ export { SearchField, type SearchFieldProps } from './core/forms/SearchField/SearchField';
25
+ export { Select, type SelectProps } from './core/forms/Select/Select';
26
+ export { Slider, type SliderProps } from './core/forms/Slider/Slider';
27
+ export { Switch, type SwitchProps } from './core/forms/Switch/Switch';
28
+ export { TextArea, type TextAreaProps } from './core/forms/TextArea/TextArea';
29
+ export { TextField, toNumber, type TextFieldProps, type TextFieldType } from './core/forms/TextField/TextField';
30
+ export type { ChoiceOption, FieldProps } from './core/forms/_shared/field';
31
+ export { Badge, type BadgeProps } from './core/feedback/Badge/Badge';
32
+ export { Notice, type NoticeProps } from './core/feedback/Notice/Notice';
33
+ export { Progress, type ProgressProps } from './core/feedback/Progress/Progress';
34
+ export { Skeleton, type SkeletonProps } from './core/feedback/Skeleton/Skeleton';
35
+ export { Spinner, type SpinnerProps } from './core/feedback/Spinner/Spinner';
36
+ export { Tooltip, type TooltipProps } from './core/feedback/Tooltip/Tooltip';
37
+ export { Button, type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant } from './core/actions/Button/Button';
38
+ export { Chip, type ChipProps } from './core/actions/Chip/Chip';
39
+ export { IconButton, type IconButtonProps } from './core/actions/IconButton/IconButton';
40
+ export { Link, type LinkProps } from './core/actions/Link/Link';
41
+ export { SegmentedControl, type Segment, type SegmentedControlProps } from './core/actions/SegmentedControl/SegmentedControl';
42
+ export { Accordion, type AccordionItem, type AccordionProps } from './core/Accordion/Accordion';
43
+ export { Card, type CardProps, type CardTone } from './core/Card/Card';
44
+ export { Columns, Split, type ColumnsProps, type ColumnsRatio } from './core/Columns/Columns';
45
+ export { Disclosure, type DisclosureProps } from './core/Disclosure/Disclosure';
46
+ export { Grid, type GridProps } from './core/Grid/Grid';
47
+ export { Repeat, type RepeatLayout, type RepeatProps } from './core/Repeat/Repeat';
11
48
  export { DEFAULT_PROFILE_ID, documentProfiles, profileIds, registerProfile, resolveProfile, resolvedProfiles } from './core/document/profiles/registry';
12
49
  export { profileCss, profileTokens } from './core/document/profiles/tokens';
13
50
  export { PAGINATOR_BINDINGS, type DocumentProfile, type ProfileDefinition, type ProfileId, type RegionBinding } from './core/document/profiles/profile';
@@ -52,3 +89,10 @@ export { OptionCard, type OptionCardBar, type OptionCardProps } from './core/dis
52
89
  export { ProfileCard, type ProfileCardProps, type ProfileRow, type ProfileRowBadge } from './core/display/ProfileCard/ProfileCard';
53
90
  export { KpiCardGrid, type KpiCard, type KpiCardBadge, type KpiCardGridProps } from './core/display/KpiCardGrid/KpiCardGrid';
54
91
  export { DataTable, type DataTableAlign, type DataTableCell, type DataTableCellInput, type DataTableColumn, type DataTableProps, type DataTableRow, } from './core/display/DataTable/DataTable';
92
+ export { EventCard, type EventCardProps } from './core/events/EventCard/EventCard';
93
+ export { EventDetail, type EventDetailProps, type EventNoteView, type EventParticipantView } from './core/events/EventDetail/EventDetail';
94
+ export { EventLogForm, type EventLogFormProps, type LogEventInput } from './core/events/EventLogForm/EventLogForm';
95
+ export { EventRespond, type EventRespondProps } from './core/events/EventRespond/EventRespond';
96
+ export { EventSchedule, type EventScheduleProps } from './core/events/EventSchedule/EventSchedule';
97
+ export { EventTimeline, type ActivityItem, type EventTimelineProps } from './core/events/EventTimeline/EventTimeline';
98
+ export { eventWhen, typeCard, type EventTypeOption, type EventView, type RenderComponent as EventRenderComponent, type WriteResult as EventWriteResult } from './core/events/_shared/event';