@usefidel/design-system 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fidel.manifest.json +2 -2
- package/dist/index.cjs +569 -57
- package/dist/index.css +796 -9
- package/dist/index.d.cts +247 -9
- package/dist/index.d.ts +247 -9
- package/dist/index.js +565 -56
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, ReactNode, AnchorHTMLAttributes, HTMLAttributes, InputHTMLAttributes, SVGAttributes, ReactElement } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, AnchorHTMLAttributes, HTMLAttributes, InputHTMLAttributes, SVGAttributes, ReactElement, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type ButtonVariant = 'primary' | 'outlined' | 'text' | 'neutral' | 'link'
|
|
5
5
|
/** High-contrast near-black, for a page's main create action ("New comparison"). */
|
|
@@ -831,23 +831,57 @@ interface MenuItem {
|
|
|
831
831
|
/** `danger` for destructive actions, e.g. "Sign out of this device". */
|
|
832
832
|
tone?: 'default' | 'danger';
|
|
833
833
|
icon?: ReactNode;
|
|
834
|
+
/** Square or round image before the label, e.g. a workspace avatar. */
|
|
835
|
+
avatar?: ReactNode;
|
|
836
|
+
/** Second line under the label. */
|
|
837
|
+
description?: ReactNode;
|
|
838
|
+
/** Shows a check at the end of the row, for the current choice. */
|
|
839
|
+
selected?: boolean;
|
|
840
|
+
/** Content at the end of the row, e.g. a Badge or a "Sign in" action. */
|
|
841
|
+
trailing?: ReactNode;
|
|
842
|
+
/** Text the search matches against. Defaults to the label when it is a string. */
|
|
843
|
+
keywords?: string;
|
|
834
844
|
disabled?: boolean;
|
|
835
845
|
}
|
|
846
|
+
interface MenuLabel {
|
|
847
|
+
type: 'label';
|
|
848
|
+
label: ReactNode;
|
|
849
|
+
}
|
|
850
|
+
interface MenuDivider {
|
|
851
|
+
type: 'divider';
|
|
852
|
+
}
|
|
853
|
+
type MenuEntry = MenuItem | MenuLabel | MenuDivider;
|
|
854
|
+
interface MenuSearch {
|
|
855
|
+
placeholder: string;
|
|
856
|
+
/** Shown when nothing matches. */
|
|
857
|
+
emptyLabel: string;
|
|
858
|
+
/** Shows the field but turns it off, e.g. when there is nothing to search yet. */
|
|
859
|
+
disabled?: boolean;
|
|
860
|
+
}
|
|
861
|
+
type MenuPlacement = 'bottom' | 'top' | 'right';
|
|
836
862
|
interface MenuProps {
|
|
837
|
-
/** The button that opens the menu
|
|
863
|
+
/** The button that opens the menu. It gets the click and ARIA wiring. */
|
|
838
864
|
trigger: ReactElement;
|
|
839
|
-
items:
|
|
865
|
+
items: MenuEntry[];
|
|
840
866
|
/** Which edge of the trigger the menu lines up with. @default 'end' */
|
|
841
867
|
align?: 'start' | 'end';
|
|
868
|
+
/** Which side of the trigger the menu opens on. @default 'bottom' */
|
|
869
|
+
placement?: MenuPlacement;
|
|
870
|
+
/** Adds a search field that filters items by label or `keywords`. */
|
|
871
|
+
search?: MenuSearch;
|
|
872
|
+
/** `wide` is 304px, for menus with avatars and descriptions. @default 'auto' */
|
|
873
|
+
width?: 'auto' | 'wide';
|
|
874
|
+
/** Lets the trigger fill the width of its container. */
|
|
875
|
+
block?: boolean;
|
|
842
876
|
className?: string;
|
|
843
877
|
}
|
|
844
878
|
/**
|
|
845
|
-
* Fidel design-system Menu: a
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
*
|
|
879
|
+
* Fidel design-system Menu: a list of actions or choices opened from a button.
|
|
880
|
+
* Keyboard: Enter/Space/↓ on the trigger open it; ↑/↓/Home/End move; Enter
|
|
881
|
+
* chooses; Esc closes and returns focus to the trigger; Tab and clicking
|
|
882
|
+
* outside close it.
|
|
849
883
|
*/
|
|
850
|
-
declare function Menu({ trigger, items, align, className }: MenuProps): react.JSX.Element;
|
|
884
|
+
declare function Menu({ trigger, items, align, placement, search, width, block, className, }: MenuProps): react.JSX.Element;
|
|
851
885
|
|
|
852
886
|
interface TableColumn<Row> {
|
|
853
887
|
key: string;
|
|
@@ -907,4 +941,208 @@ interface PricingCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
|
907
941
|
*/
|
|
908
942
|
declare function PricingCard({ eyebrow, title, badge, price, period, description, action, featuresTitle, featuresIntro, features, highlighted, className, ...rest }: PricingCardProps): react.JSX.Element;
|
|
909
943
|
|
|
910
|
-
|
|
944
|
+
type StatusDotStatus = 'running' | 'idle' | 'failed' | 'passed';
|
|
945
|
+
interface StatusDotProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
946
|
+
status: StatusDotStatus;
|
|
947
|
+
/** Accessible name. Leave out when a visible label next to the dot already says it. */
|
|
948
|
+
label?: string;
|
|
949
|
+
}
|
|
950
|
+
/** Fidel design-system StatusDot: a small dot for the state of the latest run. `running` pulses. */
|
|
951
|
+
declare function StatusDot({ status, label, className, ...rest }: StatusDotProps): react.JSX.Element;
|
|
952
|
+
|
|
953
|
+
interface ListLabelProps extends HTMLAttributes<HTMLDivElement> {
|
|
954
|
+
children: ReactNode;
|
|
955
|
+
}
|
|
956
|
+
/** Fidel design-system ListLabel: the small heading above a group of list or menu items. */
|
|
957
|
+
declare function ListLabel({ className, children, ...rest }: ListLabelProps): react.JSX.Element;
|
|
958
|
+
|
|
959
|
+
interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
960
|
+
/** @default 'horizontal' */
|
|
961
|
+
orientation?: 'horizontal' | 'vertical';
|
|
962
|
+
}
|
|
963
|
+
/** Fidel design-system Divider: a 1px rule between groups. */
|
|
964
|
+
declare function Divider({ orientation, className, ...rest }: DividerProps): react.JSX.Element;
|
|
965
|
+
|
|
966
|
+
type TooltipSide = 'right' | 'top' | 'bottom' | 'left';
|
|
967
|
+
interface TooltipProps {
|
|
968
|
+
content: ReactNode;
|
|
969
|
+
/** The element the tooltip describes. It must accept mouse and focus handlers. */
|
|
970
|
+
children: ReactElement;
|
|
971
|
+
/** @default 'right' */
|
|
972
|
+
side?: TooltipSide;
|
|
973
|
+
/** Hover delay in ms. Keyboard focus shows it at once. @default 400 */
|
|
974
|
+
delay?: number;
|
|
975
|
+
/** Turns the tooltip off without unmounting the child, e.g. when a visible label is shown. */
|
|
976
|
+
disabled?: boolean;
|
|
977
|
+
}
|
|
978
|
+
/** Fidel design-system Tooltip: a short label shown on hover (after `delay`) or keyboard focus. */
|
|
979
|
+
declare function Tooltip({ content, children, side, delay, disabled }: TooltipProps): react.JSX.Element;
|
|
980
|
+
|
|
981
|
+
interface BrandButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
982
|
+
/** The product mark shown at rest. */
|
|
983
|
+
mark: ReactNode;
|
|
984
|
+
/** Shown on hover and focus in place of the mark. @default PanelLeftOpen */
|
|
985
|
+
hoverIcon?: ReactNode;
|
|
986
|
+
'aria-label': string;
|
|
987
|
+
}
|
|
988
|
+
/** Fidel design-system BrandButton: the product mark that turns into an action icon on hover or focus. */
|
|
989
|
+
declare function BrandButton({ mark, hoverIcon, type, className, ...rest }: BrandButtonProps): react.JSX.Element;
|
|
990
|
+
|
|
991
|
+
type OwnProps<C extends ElementType> = {
|
|
992
|
+
/** Element or component to render, e.g. a router Link. @default 'a' */
|
|
993
|
+
as?: C;
|
|
994
|
+
/** 16px icon before the label. */
|
|
995
|
+
icon?: ReactNode;
|
|
996
|
+
/** Shown in place of the icon, e.g. a StatusDot. */
|
|
997
|
+
leading?: ReactNode;
|
|
998
|
+
/** The current page. Sets `aria-current="page"`. */
|
|
999
|
+
active?: boolean;
|
|
1000
|
+
/** Hide the label and show it as a tooltip. Defaults to the surrounding Sidebar's collapsed state. */
|
|
1001
|
+
iconOnly?: boolean;
|
|
1002
|
+
children: ReactNode;
|
|
1003
|
+
};
|
|
1004
|
+
type SidebarItemProps<C extends ElementType = 'a'> = OwnProps<C> & Omit<ComponentPropsWithoutRef<C>, keyof OwnProps<C>>;
|
|
1005
|
+
/** Fidel design-system SidebarItem: one row in a side navigation. */
|
|
1006
|
+
declare function SidebarItem<C extends ElementType = 'a'>({ as, icon, leading, active, iconOnly, className, children, ...rest }: SidebarItemProps<C>): react.JSX.Element;
|
|
1007
|
+
|
|
1008
|
+
interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
1009
|
+
/** Controlled collapsed state. */
|
|
1010
|
+
collapsed?: boolean;
|
|
1011
|
+
/** Starting state when uncontrolled. @default false */
|
|
1012
|
+
defaultCollapsed?: boolean;
|
|
1013
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
1014
|
+
/** ⌘\ / Ctrl+\ toggles the sidebar. @default true */
|
|
1015
|
+
shortcut?: boolean;
|
|
1016
|
+
children: ReactNode;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Fidel design-system Sidebar: the app's side navigation, 240px wide or a
|
|
1020
|
+
* 60px rail. Compose it from Sidebar.Header, Sidebar.Brand, Sidebar.Action, Sidebar.Section, Sidebar.Item and
|
|
1021
|
+
* Sidebar.Footer; parts read the collapsed state from context (`useSidebar`).
|
|
1022
|
+
*/
|
|
1023
|
+
declare function SidebarRoot({ collapsed: controlled, defaultCollapsed, onCollapsedChange, shortcut, className, children, 'aria-label': ariaLabel, ...rest }: SidebarProps): react.JSX.Element;
|
|
1024
|
+
interface SidebarBrandProps {
|
|
1025
|
+
/** The full logo, shown when expanded. */
|
|
1026
|
+
logo: ReactNode;
|
|
1027
|
+
/** The compact mark, shown in the rail. */
|
|
1028
|
+
mark: ReactNode;
|
|
1029
|
+
/** @default 'Collapse sidebar' */
|
|
1030
|
+
collapseLabel?: string;
|
|
1031
|
+
/** @default 'Expand sidebar' */
|
|
1032
|
+
expandLabel?: string;
|
|
1033
|
+
}
|
|
1034
|
+
/** The top row: logo and collapse button, crossfading to the mark that expands the rail. */
|
|
1035
|
+
declare function SidebarBrand({ logo, mark, collapseLabel, expandLabel, }: SidebarBrandProps): react.JSX.Element;
|
|
1036
|
+
interface SidebarActionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
1037
|
+
icon: ReactNode;
|
|
1038
|
+
/** The visible label; in the rail it becomes the tooltip and accessible name. */
|
|
1039
|
+
label: string;
|
|
1040
|
+
}
|
|
1041
|
+
/** The sidebar's main action, e.g. "New check": an outlined button that shrinks to its icon in the rail. */
|
|
1042
|
+
declare function SidebarAction({ icon, label, type, className, ...rest }: SidebarActionProps): react.JSX.Element;
|
|
1043
|
+
interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
1044
|
+
/** Leave the section out of the rail, e.g. a list of recent items. */
|
|
1045
|
+
hideWhenCollapsed?: boolean;
|
|
1046
|
+
children: ReactNode;
|
|
1047
|
+
}
|
|
1048
|
+
/** A vertical group of rows. */
|
|
1049
|
+
declare function SidebarSection({ hideWhenCollapsed, className, children, ...rest }: SidebarSectionProps): react.JSX.Element;
|
|
1050
|
+
/** The top block: brand row, workspace switcher and the main action, spaced tighter than sections. */
|
|
1051
|
+
declare function SidebarHeader({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
1052
|
+
/** Rows pinned to the bottom of the sidebar. */
|
|
1053
|
+
declare function SidebarFooter({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
1054
|
+
declare const Sidebar: typeof SidebarRoot & {
|
|
1055
|
+
Header: typeof SidebarHeader;
|
|
1056
|
+
Brand: typeof SidebarBrand;
|
|
1057
|
+
Action: typeof SidebarAction;
|
|
1058
|
+
Section: typeof SidebarSection;
|
|
1059
|
+
Item: typeof SidebarItem;
|
|
1060
|
+
Footer: typeof SidebarFooter;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
interface SidebarState {
|
|
1064
|
+
collapsed: boolean;
|
|
1065
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
1066
|
+
toggle: () => void;
|
|
1067
|
+
}
|
|
1068
|
+
/** The surrounding Sidebar's collapsed state, or null outside a Sidebar. */
|
|
1069
|
+
declare function useSidebar(): SidebarState | null;
|
|
1070
|
+
|
|
1071
|
+
interface WorkspaceSwitcherProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
1072
|
+
name: string;
|
|
1073
|
+
/** Plan name shown as a small tag, e.g. "Pro". */
|
|
1074
|
+
plan?: string;
|
|
1075
|
+
/** Replaces the default initial-on-dark square. */
|
|
1076
|
+
avatar?: ReactNode;
|
|
1077
|
+
/** Show only the avatar. Defaults to the surrounding Sidebar's collapsed state. */
|
|
1078
|
+
compact?: boolean;
|
|
1079
|
+
}
|
|
1080
|
+
/** The square avatar used for a workspace: its first letter on the primary colour. */
|
|
1081
|
+
declare function WorkspaceAvatar({ name }: {
|
|
1082
|
+
name: string;
|
|
1083
|
+
}): react.JSX.Element;
|
|
1084
|
+
/**
|
|
1085
|
+
* Fidel design-system WorkspaceSwitcher: shows the active workspace and opens
|
|
1086
|
+
* the workspace menu. Use it as a Menu trigger; `aria-expanded` drives the open state.
|
|
1087
|
+
*/
|
|
1088
|
+
declare const WorkspaceSwitcher: react.ForwardRefExoticComponent<WorkspaceSwitcherProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1089
|
+
|
|
1090
|
+
interface AvatarLabelGroupProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
1091
|
+
name: string;
|
|
1092
|
+
/** Second line, usually the email. */
|
|
1093
|
+
detail?: string;
|
|
1094
|
+
src?: string | null;
|
|
1095
|
+
/** Show only the avatar. @default false */
|
|
1096
|
+
compact?: boolean;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Fidel design-system AvatarLabelGroup: an avatar with a name and a second
|
|
1100
|
+
* line, as a button (e.g. the trigger for an account menu).
|
|
1101
|
+
*/
|
|
1102
|
+
declare const AvatarLabelGroup: react.ForwardRefExoticComponent<AvatarLabelGroupProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1103
|
+
|
|
1104
|
+
interface AppLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
1105
|
+
children: ReactNode;
|
|
1106
|
+
}
|
|
1107
|
+
/** Fidel design-system AppLayout: a full-height row holding a Sidebar and an AppLayout.Panel. */
|
|
1108
|
+
declare function AppLayoutRoot({ className, children, ...rest }: AppLayoutProps): react.JSX.Element;
|
|
1109
|
+
/** The content panel: inset from the window edges, rounded, and scrolls on its own. */
|
|
1110
|
+
declare function AppLayoutPanel({ className, children, ...rest }: HTMLAttributes<HTMLElement>): react.JSX.Element;
|
|
1111
|
+
declare const AppLayout: typeof AppLayoutRoot & {
|
|
1112
|
+
Panel: typeof AppLayoutPanel;
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
1116
|
+
title: ReactNode;
|
|
1117
|
+
description?: ReactNode;
|
|
1118
|
+
/** Above the title, e.g. "Projects / Flow web app". */
|
|
1119
|
+
breadcrumb?: ReactNode;
|
|
1120
|
+
/** The page's one primary action, and any secondary ones. */
|
|
1121
|
+
actions?: ReactNode;
|
|
1122
|
+
/** Below the title row, e.g. a TabNav. */
|
|
1123
|
+
children?: ReactNode;
|
|
1124
|
+
}
|
|
1125
|
+
/** Fidel design-system PageHeader: breadcrumb, title, description and actions at the top of a page. */
|
|
1126
|
+
declare function PageHeader({ title, description, breadcrumb, actions, className, children, ...rest }: PageHeaderProps): react.JSX.Element;
|
|
1127
|
+
|
|
1128
|
+
interface ToastAction {
|
|
1129
|
+
label: string;
|
|
1130
|
+
onClick: () => void;
|
|
1131
|
+
}
|
|
1132
|
+
interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
1133
|
+
children: ReactNode;
|
|
1134
|
+
action?: ToastAction;
|
|
1135
|
+
/** Shows a close button and is called when the toast should go away. */
|
|
1136
|
+
onDismiss?: () => void;
|
|
1137
|
+
/** Calls `onDismiss` after this many ms. Leave out to keep it until closed. */
|
|
1138
|
+
duration?: number;
|
|
1139
|
+
}
|
|
1140
|
+
interface ToastRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
1141
|
+
children: ReactNode;
|
|
1142
|
+
}
|
|
1143
|
+
/** Fixed stack in the top-right corner of the window that holds Toasts, newest on top. */
|
|
1144
|
+
declare function ToastRegion({ className, children, ...rest }: ToastRegionProps): react.JSX.Element;
|
|
1145
|
+
/** Fidel design-system Toast: a short status message with an optional action. Place it in a ToastRegion. */
|
|
1146
|
+
declare function Toast({ children, action, onDismiss, duration, className, ...rest }: ToastProps): react.JSX.Element;
|
|
1147
|
+
|
|
1148
|
+
export { Accordion, type AccordionProps, AppLayout, type AppLayoutProps, AppNav, type AppNavProps, Avatar, AvatarLabelGroup, type AvatarLabelGroupProps, type AvatarProps, type AvatarSize, Badge, type BadgeProps, BrandButton, type BrandButtonProps, type Breakpoint, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, Callout, type CalloutProps, type CalloutTone, Card, type CardPadding, type CardProps, type CardTone, Checkbox, type CheckboxProps, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, Input, type InputProps, ListLabel, type ListLabelProps, Menu, type MenuDivider, type MenuEntry, type MenuItem, type MenuLabel, type MenuPlacement, type MenuProps, type MenuSearch, MismatchCard, type MismatchCardProps, type MismatchProperty, Modal, type ModalProps, type ModalSize, type ModalTone, MultiSelect, type MultiSelectOption, type MultiSelectProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, PricingCard, type PricingCardProps, Radio, RadioCard, type RadioCardProps, type RadioProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectOption, type SelectProps, SettingsSection, type SettingsSectionProps, Sidebar, type SidebarBrandProps, SidebarItem, type SidebarItemProps, type SidebarProps, type SidebarSectionProps, type SidebarState, Skeleton, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, type SkeletonShape, Spinner, type SpinnerProps, Split, type SplitProps, StackedCardsIllustration, Stat, type StatProps, StatusDot, type StatusDotProps, type StatusDotStatus, type Step, StepList, type StepListProps, type StepStatus, Swatch, type SwatchProps, TabNav, type TabNavProps, Table, type TableColumn, type TableProps, Tag, type TagProps, Toast, type ToastAction, type ToastProps, ToastRegion, type ToastRegionProps, Toggle, type ToggleProps, type ToggleSize, type Tone, Tooltip, type TooltipProps, type TooltipSide, WorkspaceAvatar, WorkspaceSwitcher, type WorkspaceSwitcherProps, breakpoints, useSidebar };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, ReactNode, AnchorHTMLAttributes, HTMLAttributes, InputHTMLAttributes, SVGAttributes, ReactElement } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, AnchorHTMLAttributes, HTMLAttributes, InputHTMLAttributes, SVGAttributes, ReactElement, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type ButtonVariant = 'primary' | 'outlined' | 'text' | 'neutral' | 'link'
|
|
5
5
|
/** High-contrast near-black, for a page's main create action ("New comparison"). */
|
|
@@ -831,23 +831,57 @@ interface MenuItem {
|
|
|
831
831
|
/** `danger` for destructive actions, e.g. "Sign out of this device". */
|
|
832
832
|
tone?: 'default' | 'danger';
|
|
833
833
|
icon?: ReactNode;
|
|
834
|
+
/** Square or round image before the label, e.g. a workspace avatar. */
|
|
835
|
+
avatar?: ReactNode;
|
|
836
|
+
/** Second line under the label. */
|
|
837
|
+
description?: ReactNode;
|
|
838
|
+
/** Shows a check at the end of the row, for the current choice. */
|
|
839
|
+
selected?: boolean;
|
|
840
|
+
/** Content at the end of the row, e.g. a Badge or a "Sign in" action. */
|
|
841
|
+
trailing?: ReactNode;
|
|
842
|
+
/** Text the search matches against. Defaults to the label when it is a string. */
|
|
843
|
+
keywords?: string;
|
|
834
844
|
disabled?: boolean;
|
|
835
845
|
}
|
|
846
|
+
interface MenuLabel {
|
|
847
|
+
type: 'label';
|
|
848
|
+
label: ReactNode;
|
|
849
|
+
}
|
|
850
|
+
interface MenuDivider {
|
|
851
|
+
type: 'divider';
|
|
852
|
+
}
|
|
853
|
+
type MenuEntry = MenuItem | MenuLabel | MenuDivider;
|
|
854
|
+
interface MenuSearch {
|
|
855
|
+
placeholder: string;
|
|
856
|
+
/** Shown when nothing matches. */
|
|
857
|
+
emptyLabel: string;
|
|
858
|
+
/** Shows the field but turns it off, e.g. when there is nothing to search yet. */
|
|
859
|
+
disabled?: boolean;
|
|
860
|
+
}
|
|
861
|
+
type MenuPlacement = 'bottom' | 'top' | 'right';
|
|
836
862
|
interface MenuProps {
|
|
837
|
-
/** The button that opens the menu
|
|
863
|
+
/** The button that opens the menu. It gets the click and ARIA wiring. */
|
|
838
864
|
trigger: ReactElement;
|
|
839
|
-
items:
|
|
865
|
+
items: MenuEntry[];
|
|
840
866
|
/** Which edge of the trigger the menu lines up with. @default 'end' */
|
|
841
867
|
align?: 'start' | 'end';
|
|
868
|
+
/** Which side of the trigger the menu opens on. @default 'bottom' */
|
|
869
|
+
placement?: MenuPlacement;
|
|
870
|
+
/** Adds a search field that filters items by label or `keywords`. */
|
|
871
|
+
search?: MenuSearch;
|
|
872
|
+
/** `wide` is 304px, for menus with avatars and descriptions. @default 'auto' */
|
|
873
|
+
width?: 'auto' | 'wide';
|
|
874
|
+
/** Lets the trigger fill the width of its container. */
|
|
875
|
+
block?: boolean;
|
|
842
876
|
className?: string;
|
|
843
877
|
}
|
|
844
878
|
/**
|
|
845
|
-
* Fidel design-system Menu: a
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
*
|
|
879
|
+
* Fidel design-system Menu: a list of actions or choices opened from a button.
|
|
880
|
+
* Keyboard: Enter/Space/↓ on the trigger open it; ↑/↓/Home/End move; Enter
|
|
881
|
+
* chooses; Esc closes and returns focus to the trigger; Tab and clicking
|
|
882
|
+
* outside close it.
|
|
849
883
|
*/
|
|
850
|
-
declare function Menu({ trigger, items, align, className }: MenuProps): react.JSX.Element;
|
|
884
|
+
declare function Menu({ trigger, items, align, placement, search, width, block, className, }: MenuProps): react.JSX.Element;
|
|
851
885
|
|
|
852
886
|
interface TableColumn<Row> {
|
|
853
887
|
key: string;
|
|
@@ -907,4 +941,208 @@ interface PricingCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
|
907
941
|
*/
|
|
908
942
|
declare function PricingCard({ eyebrow, title, badge, price, period, description, action, featuresTitle, featuresIntro, features, highlighted, className, ...rest }: PricingCardProps): react.JSX.Element;
|
|
909
943
|
|
|
910
|
-
|
|
944
|
+
type StatusDotStatus = 'running' | 'idle' | 'failed' | 'passed';
|
|
945
|
+
interface StatusDotProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
946
|
+
status: StatusDotStatus;
|
|
947
|
+
/** Accessible name. Leave out when a visible label next to the dot already says it. */
|
|
948
|
+
label?: string;
|
|
949
|
+
}
|
|
950
|
+
/** Fidel design-system StatusDot: a small dot for the state of the latest run. `running` pulses. */
|
|
951
|
+
declare function StatusDot({ status, label, className, ...rest }: StatusDotProps): react.JSX.Element;
|
|
952
|
+
|
|
953
|
+
interface ListLabelProps extends HTMLAttributes<HTMLDivElement> {
|
|
954
|
+
children: ReactNode;
|
|
955
|
+
}
|
|
956
|
+
/** Fidel design-system ListLabel: the small heading above a group of list or menu items. */
|
|
957
|
+
declare function ListLabel({ className, children, ...rest }: ListLabelProps): react.JSX.Element;
|
|
958
|
+
|
|
959
|
+
interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
960
|
+
/** @default 'horizontal' */
|
|
961
|
+
orientation?: 'horizontal' | 'vertical';
|
|
962
|
+
}
|
|
963
|
+
/** Fidel design-system Divider: a 1px rule between groups. */
|
|
964
|
+
declare function Divider({ orientation, className, ...rest }: DividerProps): react.JSX.Element;
|
|
965
|
+
|
|
966
|
+
type TooltipSide = 'right' | 'top' | 'bottom' | 'left';
|
|
967
|
+
interface TooltipProps {
|
|
968
|
+
content: ReactNode;
|
|
969
|
+
/** The element the tooltip describes. It must accept mouse and focus handlers. */
|
|
970
|
+
children: ReactElement;
|
|
971
|
+
/** @default 'right' */
|
|
972
|
+
side?: TooltipSide;
|
|
973
|
+
/** Hover delay in ms. Keyboard focus shows it at once. @default 400 */
|
|
974
|
+
delay?: number;
|
|
975
|
+
/** Turns the tooltip off without unmounting the child, e.g. when a visible label is shown. */
|
|
976
|
+
disabled?: boolean;
|
|
977
|
+
}
|
|
978
|
+
/** Fidel design-system Tooltip: a short label shown on hover (after `delay`) or keyboard focus. */
|
|
979
|
+
declare function Tooltip({ content, children, side, delay, disabled }: TooltipProps): react.JSX.Element;
|
|
980
|
+
|
|
981
|
+
interface BrandButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
982
|
+
/** The product mark shown at rest. */
|
|
983
|
+
mark: ReactNode;
|
|
984
|
+
/** Shown on hover and focus in place of the mark. @default PanelLeftOpen */
|
|
985
|
+
hoverIcon?: ReactNode;
|
|
986
|
+
'aria-label': string;
|
|
987
|
+
}
|
|
988
|
+
/** Fidel design-system BrandButton: the product mark that turns into an action icon on hover or focus. */
|
|
989
|
+
declare function BrandButton({ mark, hoverIcon, type, className, ...rest }: BrandButtonProps): react.JSX.Element;
|
|
990
|
+
|
|
991
|
+
type OwnProps<C extends ElementType> = {
|
|
992
|
+
/** Element or component to render, e.g. a router Link. @default 'a' */
|
|
993
|
+
as?: C;
|
|
994
|
+
/** 16px icon before the label. */
|
|
995
|
+
icon?: ReactNode;
|
|
996
|
+
/** Shown in place of the icon, e.g. a StatusDot. */
|
|
997
|
+
leading?: ReactNode;
|
|
998
|
+
/** The current page. Sets `aria-current="page"`. */
|
|
999
|
+
active?: boolean;
|
|
1000
|
+
/** Hide the label and show it as a tooltip. Defaults to the surrounding Sidebar's collapsed state. */
|
|
1001
|
+
iconOnly?: boolean;
|
|
1002
|
+
children: ReactNode;
|
|
1003
|
+
};
|
|
1004
|
+
type SidebarItemProps<C extends ElementType = 'a'> = OwnProps<C> & Omit<ComponentPropsWithoutRef<C>, keyof OwnProps<C>>;
|
|
1005
|
+
/** Fidel design-system SidebarItem: one row in a side navigation. */
|
|
1006
|
+
declare function SidebarItem<C extends ElementType = 'a'>({ as, icon, leading, active, iconOnly, className, children, ...rest }: SidebarItemProps<C>): react.JSX.Element;
|
|
1007
|
+
|
|
1008
|
+
interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
1009
|
+
/** Controlled collapsed state. */
|
|
1010
|
+
collapsed?: boolean;
|
|
1011
|
+
/** Starting state when uncontrolled. @default false */
|
|
1012
|
+
defaultCollapsed?: boolean;
|
|
1013
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
1014
|
+
/** ⌘\ / Ctrl+\ toggles the sidebar. @default true */
|
|
1015
|
+
shortcut?: boolean;
|
|
1016
|
+
children: ReactNode;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Fidel design-system Sidebar: the app's side navigation, 240px wide or a
|
|
1020
|
+
* 60px rail. Compose it from Sidebar.Header, Sidebar.Brand, Sidebar.Action, Sidebar.Section, Sidebar.Item and
|
|
1021
|
+
* Sidebar.Footer; parts read the collapsed state from context (`useSidebar`).
|
|
1022
|
+
*/
|
|
1023
|
+
declare function SidebarRoot({ collapsed: controlled, defaultCollapsed, onCollapsedChange, shortcut, className, children, 'aria-label': ariaLabel, ...rest }: SidebarProps): react.JSX.Element;
|
|
1024
|
+
interface SidebarBrandProps {
|
|
1025
|
+
/** The full logo, shown when expanded. */
|
|
1026
|
+
logo: ReactNode;
|
|
1027
|
+
/** The compact mark, shown in the rail. */
|
|
1028
|
+
mark: ReactNode;
|
|
1029
|
+
/** @default 'Collapse sidebar' */
|
|
1030
|
+
collapseLabel?: string;
|
|
1031
|
+
/** @default 'Expand sidebar' */
|
|
1032
|
+
expandLabel?: string;
|
|
1033
|
+
}
|
|
1034
|
+
/** The top row: logo and collapse button, crossfading to the mark that expands the rail. */
|
|
1035
|
+
declare function SidebarBrand({ logo, mark, collapseLabel, expandLabel, }: SidebarBrandProps): react.JSX.Element;
|
|
1036
|
+
interface SidebarActionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
1037
|
+
icon: ReactNode;
|
|
1038
|
+
/** The visible label; in the rail it becomes the tooltip and accessible name. */
|
|
1039
|
+
label: string;
|
|
1040
|
+
}
|
|
1041
|
+
/** The sidebar's main action, e.g. "New check": an outlined button that shrinks to its icon in the rail. */
|
|
1042
|
+
declare function SidebarAction({ icon, label, type, className, ...rest }: SidebarActionProps): react.JSX.Element;
|
|
1043
|
+
interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
1044
|
+
/** Leave the section out of the rail, e.g. a list of recent items. */
|
|
1045
|
+
hideWhenCollapsed?: boolean;
|
|
1046
|
+
children: ReactNode;
|
|
1047
|
+
}
|
|
1048
|
+
/** A vertical group of rows. */
|
|
1049
|
+
declare function SidebarSection({ hideWhenCollapsed, className, children, ...rest }: SidebarSectionProps): react.JSX.Element;
|
|
1050
|
+
/** The top block: brand row, workspace switcher and the main action, spaced tighter than sections. */
|
|
1051
|
+
declare function SidebarHeader({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
1052
|
+
/** Rows pinned to the bottom of the sidebar. */
|
|
1053
|
+
declare function SidebarFooter({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
1054
|
+
declare const Sidebar: typeof SidebarRoot & {
|
|
1055
|
+
Header: typeof SidebarHeader;
|
|
1056
|
+
Brand: typeof SidebarBrand;
|
|
1057
|
+
Action: typeof SidebarAction;
|
|
1058
|
+
Section: typeof SidebarSection;
|
|
1059
|
+
Item: typeof SidebarItem;
|
|
1060
|
+
Footer: typeof SidebarFooter;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
interface SidebarState {
|
|
1064
|
+
collapsed: boolean;
|
|
1065
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
1066
|
+
toggle: () => void;
|
|
1067
|
+
}
|
|
1068
|
+
/** The surrounding Sidebar's collapsed state, or null outside a Sidebar. */
|
|
1069
|
+
declare function useSidebar(): SidebarState | null;
|
|
1070
|
+
|
|
1071
|
+
interface WorkspaceSwitcherProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
1072
|
+
name: string;
|
|
1073
|
+
/** Plan name shown as a small tag, e.g. "Pro". */
|
|
1074
|
+
plan?: string;
|
|
1075
|
+
/** Replaces the default initial-on-dark square. */
|
|
1076
|
+
avatar?: ReactNode;
|
|
1077
|
+
/** Show only the avatar. Defaults to the surrounding Sidebar's collapsed state. */
|
|
1078
|
+
compact?: boolean;
|
|
1079
|
+
}
|
|
1080
|
+
/** The square avatar used for a workspace: its first letter on the primary colour. */
|
|
1081
|
+
declare function WorkspaceAvatar({ name }: {
|
|
1082
|
+
name: string;
|
|
1083
|
+
}): react.JSX.Element;
|
|
1084
|
+
/**
|
|
1085
|
+
* Fidel design-system WorkspaceSwitcher: shows the active workspace and opens
|
|
1086
|
+
* the workspace menu. Use it as a Menu trigger; `aria-expanded` drives the open state.
|
|
1087
|
+
*/
|
|
1088
|
+
declare const WorkspaceSwitcher: react.ForwardRefExoticComponent<WorkspaceSwitcherProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1089
|
+
|
|
1090
|
+
interface AvatarLabelGroupProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
1091
|
+
name: string;
|
|
1092
|
+
/** Second line, usually the email. */
|
|
1093
|
+
detail?: string;
|
|
1094
|
+
src?: string | null;
|
|
1095
|
+
/** Show only the avatar. @default false */
|
|
1096
|
+
compact?: boolean;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Fidel design-system AvatarLabelGroup: an avatar with a name and a second
|
|
1100
|
+
* line, as a button (e.g. the trigger for an account menu).
|
|
1101
|
+
*/
|
|
1102
|
+
declare const AvatarLabelGroup: react.ForwardRefExoticComponent<AvatarLabelGroupProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1103
|
+
|
|
1104
|
+
interface AppLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
1105
|
+
children: ReactNode;
|
|
1106
|
+
}
|
|
1107
|
+
/** Fidel design-system AppLayout: a full-height row holding a Sidebar and an AppLayout.Panel. */
|
|
1108
|
+
declare function AppLayoutRoot({ className, children, ...rest }: AppLayoutProps): react.JSX.Element;
|
|
1109
|
+
/** The content panel: inset from the window edges, rounded, and scrolls on its own. */
|
|
1110
|
+
declare function AppLayoutPanel({ className, children, ...rest }: HTMLAttributes<HTMLElement>): react.JSX.Element;
|
|
1111
|
+
declare const AppLayout: typeof AppLayoutRoot & {
|
|
1112
|
+
Panel: typeof AppLayoutPanel;
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
1116
|
+
title: ReactNode;
|
|
1117
|
+
description?: ReactNode;
|
|
1118
|
+
/** Above the title, e.g. "Projects / Flow web app". */
|
|
1119
|
+
breadcrumb?: ReactNode;
|
|
1120
|
+
/** The page's one primary action, and any secondary ones. */
|
|
1121
|
+
actions?: ReactNode;
|
|
1122
|
+
/** Below the title row, e.g. a TabNav. */
|
|
1123
|
+
children?: ReactNode;
|
|
1124
|
+
}
|
|
1125
|
+
/** Fidel design-system PageHeader: breadcrumb, title, description and actions at the top of a page. */
|
|
1126
|
+
declare function PageHeader({ title, description, breadcrumb, actions, className, children, ...rest }: PageHeaderProps): react.JSX.Element;
|
|
1127
|
+
|
|
1128
|
+
interface ToastAction {
|
|
1129
|
+
label: string;
|
|
1130
|
+
onClick: () => void;
|
|
1131
|
+
}
|
|
1132
|
+
interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
1133
|
+
children: ReactNode;
|
|
1134
|
+
action?: ToastAction;
|
|
1135
|
+
/** Shows a close button and is called when the toast should go away. */
|
|
1136
|
+
onDismiss?: () => void;
|
|
1137
|
+
/** Calls `onDismiss` after this many ms. Leave out to keep it until closed. */
|
|
1138
|
+
duration?: number;
|
|
1139
|
+
}
|
|
1140
|
+
interface ToastRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
1141
|
+
children: ReactNode;
|
|
1142
|
+
}
|
|
1143
|
+
/** Fixed stack in the top-right corner of the window that holds Toasts, newest on top. */
|
|
1144
|
+
declare function ToastRegion({ className, children, ...rest }: ToastRegionProps): react.JSX.Element;
|
|
1145
|
+
/** Fidel design-system Toast: a short status message with an optional action. Place it in a ToastRegion. */
|
|
1146
|
+
declare function Toast({ children, action, onDismiss, duration, className, ...rest }: ToastProps): react.JSX.Element;
|
|
1147
|
+
|
|
1148
|
+
export { Accordion, type AccordionProps, AppLayout, type AppLayoutProps, AppNav, type AppNavProps, Avatar, AvatarLabelGroup, type AvatarLabelGroupProps, type AvatarProps, type AvatarSize, Badge, type BadgeProps, BrandButton, type BrandButtonProps, type Breakpoint, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, Callout, type CalloutProps, type CalloutTone, Card, type CardPadding, type CardProps, type CardTone, Checkbox, type CheckboxProps, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, Input, type InputProps, ListLabel, type ListLabelProps, Menu, type MenuDivider, type MenuEntry, type MenuItem, type MenuLabel, type MenuPlacement, type MenuProps, type MenuSearch, MismatchCard, type MismatchCardProps, type MismatchProperty, Modal, type ModalProps, type ModalSize, type ModalTone, MultiSelect, type MultiSelectOption, type MultiSelectProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, PricingCard, type PricingCardProps, Radio, RadioCard, type RadioCardProps, type RadioProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectOption, type SelectProps, SettingsSection, type SettingsSectionProps, Sidebar, type SidebarBrandProps, SidebarItem, type SidebarItemProps, type SidebarProps, type SidebarSectionProps, type SidebarState, Skeleton, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, type SkeletonShape, Spinner, type SpinnerProps, Split, type SplitProps, StackedCardsIllustration, Stat, type StatProps, StatusDot, type StatusDotProps, type StatusDotStatus, type Step, StepList, type StepListProps, type StepStatus, Swatch, type SwatchProps, TabNav, type TabNavProps, Table, type TableColumn, type TableProps, Tag, type TagProps, Toast, type ToastAction, type ToastProps, ToastRegion, type ToastRegionProps, Toggle, type ToggleProps, type ToggleSize, type Tone, Tooltip, type TooltipProps, type TooltipSide, WorkspaceAvatar, WorkspaceSwitcher, type WorkspaceSwitcherProps, breakpoints, useSidebar };
|