@sckyzo/cosmos-react 0.4.1 → 0.6.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/CHANGELOG.md +80 -0
- package/README.md +2 -2
- package/dist/editor/index.cjs +421 -66
- package/dist/editor/index.cjs.map +1 -1
- package/dist/editor/index.d.cts +38 -12
- package/dist/editor/index.d.ts +38 -12
- package/dist/editor/index.js +423 -69
- package/dist/editor/index.js.map +1 -1
- package/dist/index.cjs +5564 -1584
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1456 -169
- package/dist/index.d.ts +1456 -169
- package/dist/index.js +5542 -1586
- package/dist/index.js.map +1 -1
- package/dist/qr/index.cjs +62 -0
- package/dist/qr/index.cjs.map +1 -0
- package/dist/qr/index.d.cts +43 -0
- package/dist/qr/index.d.ts +43 -0
- package/dist/qr/index.js +60 -0
- package/dist/qr/index.js.map +1 -0
- package/package.json +39 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes, ReactNode, ElementType, ComponentPropsWithRef, Ref, ComponentType, AnchorHTMLAttributes, ButtonHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeReferrerPolicy, ComponentPropsWithoutRef, ChangeEvent,
|
|
2
|
+
import { HTMLAttributes, ReactNode, ElementType, ComponentPropsWithRef, Ref, ComponentType, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes, ImgHTMLAttributes, MouseEvent, HTMLAttributeReferrerPolicy, ComponentPropsWithoutRef, ChangeEvent, ComponentProps, CSSProperties } from 'react';
|
|
3
3
|
import { I as Intent } from './intent-D0bANgYJ.js';
|
|
4
4
|
export { a as CodeBlock, C as CodeBlockProps } from './CodeBlock-CY18_3tZ.js';
|
|
5
5
|
import { LucideIcon } from 'lucide-react';
|
|
@@ -179,6 +179,11 @@ declare const SplitView: (({ children, collapseBelow, activePane: controlledPane
|
|
|
179
179
|
* 1440px, centred).
|
|
180
180
|
*/
|
|
181
181
|
type ShellContainer = 'fluid' | 'boxed';
|
|
182
|
+
/**
|
|
183
|
+
* How the sidebar and the page meet: `attached` (the sidebar against the window's edge, the page
|
|
184
|
+
* beside it) or `floating` (both are cards, 10px from the window and from each other).
|
|
185
|
+
*/
|
|
186
|
+
type ShellVariant = 'attached' | 'floating';
|
|
182
187
|
type ShellProps = {
|
|
183
188
|
/**
|
|
184
189
|
* `fluid` (default): the topbar, the sidebar and the content take the whole window.
|
|
@@ -187,6 +192,21 @@ type ShellProps = {
|
|
|
187
192
|
* the two are the same. The sidebar's drawer, below `lg`, is not part of the column.
|
|
188
193
|
*/
|
|
189
194
|
container?: ShellContainer;
|
|
195
|
+
/**
|
|
196
|
+
* `attached` (default): the sidebar against the window's edge, its end edge a line, the
|
|
197
|
+
* topbar and the page beside it on the base background.
|
|
198
|
+
* `floating`: the sidebar is a card 10px from the window's edges (border all round, rounded
|
|
199
|
+
* corners, a light shadow), and the topbar, the page and `secondary` sit together in a second
|
|
200
|
+
* card beside it, 10px away. The sidebar takes the tight gutter and the edge toggle (a strip
|
|
201
|
+
* along its edge that collapses it on click) unless it sets them. Below `lg`, where the sidebar
|
|
202
|
+
* is a drawer, the page fills the window as in `attached`.
|
|
203
|
+
*/
|
|
204
|
+
variant?: ShellVariant;
|
|
205
|
+
/**
|
|
206
|
+
* The gutter of the Sidebar, when it sets none: `default` (20px) or `tight` (10px). Default
|
|
207
|
+
* `tight` in a floating Shell, `default` otherwise.
|
|
208
|
+
*/
|
|
209
|
+
sidebarGutter?: 'default' | 'tight';
|
|
190
210
|
/**
|
|
191
211
|
* Top header bar: typically `<Topbar />`, or any header (a `<Navbar>`). Shell
|
|
192
212
|
* passes it no props: a Topbar or a `SidebarToggle` reads the sidebar state
|
|
@@ -265,7 +285,7 @@ type ShellProps = {
|
|
|
265
285
|
* value left on them can't freeze a toggle. Their `onCollapsedChange` still
|
|
266
286
|
* fires when their own button is pressed.
|
|
267
287
|
*/
|
|
268
|
-
declare const Shell: ({ topbar, sidebar, children, secondary, secondaryWidthClassName, defaultSidebarCollapsed, sidebarCollapsed: controlledCollapsed, onCollapsedChange, collapseControl, container, defaultSidebarOpen, sidebarOpen: controlledOpen, onSidebarOpenChange, className, }: ShellProps) => react.JSX.Element;
|
|
288
|
+
declare const Shell: ({ topbar, sidebar, children, secondary, secondaryWidthClassName, defaultSidebarCollapsed, sidebarCollapsed: controlledCollapsed, onCollapsedChange, collapseControl, container, variant, sidebarGutter, defaultSidebarOpen, sidebarOpen: controlledOpen, onSidebarOpenChange, className, }: ShellProps) => react.JSX.Element;
|
|
269
289
|
|
|
270
290
|
type TopbarProps = {
|
|
271
291
|
/** Current page title (≠ site name — that lives in `Sidebar.Brand`). */
|
|
@@ -340,6 +360,11 @@ type SidebarExpandOnHover = false | 'overlay' | 'push';
|
|
|
340
360
|
* fixed narrow rail with the label under each icon.
|
|
341
361
|
*/
|
|
342
362
|
type SidebarVariant = 'default' | 'compact';
|
|
363
|
+
/**
|
|
364
|
+
* How far the rows sit from the sidebar's edges: `default` (20 px) or `tight` (10 px, the floating
|
|
365
|
+
* Shell's).
|
|
366
|
+
*/
|
|
367
|
+
type SidebarGutter = 'default' | 'tight';
|
|
343
368
|
/** Line drawn above the footer and the collapse row. */
|
|
344
369
|
type SidebarFooterDivider = 'full' | 'inset' | 'none';
|
|
345
370
|
type SidebarProps = {
|
|
@@ -407,6 +432,22 @@ type SidebarProps = {
|
|
|
407
432
|
footerDivider?: SidebarFooterDivider;
|
|
408
433
|
/** How the active row is drawn: `tint` (default) or `solid` (filled with the accent). */
|
|
409
434
|
activeStyle?: SidebarActiveStyle;
|
|
435
|
+
/**
|
|
436
|
+
* How far the rows sit from the sidebar's edges, with the logo, the section titles and the
|
|
437
|
+
* footer following them: `default` (20 px) or `tight` (10 px). It sets
|
|
438
|
+
* `--cosmos-sidebar-gutter` on the sidebar; an app can set that variable itself for another
|
|
439
|
+
* distance. The collapsed rail and the compact one keep their own. Inside a Shell, the Shell's
|
|
440
|
+
* `sidebarGutter` is the default (`tight` in a floating Shell).
|
|
441
|
+
*/
|
|
442
|
+
gutter?: SidebarGutter;
|
|
443
|
+
/**
|
|
444
|
+
* A strip along the sidebar's end edge that collapses or expands it on click, and shows a line
|
|
445
|
+
* under the pointer: a large target next to the toggles, for the mouse (the keyboard has the
|
|
446
|
+
* toggles). Default `false`, `true` in a floating Shell. Not on the compact rail nor in the
|
|
447
|
+
* Shell's drawer. Outside a Shell it moves the sidebar's own state and calls
|
|
448
|
+
* `onCollapsedChange`.
|
|
449
|
+
*/
|
|
450
|
+
edgeToggle?: boolean;
|
|
410
451
|
/**
|
|
411
452
|
* Renders a collapse button (a `SidebarToggle`, `panel` variant) at the very
|
|
412
453
|
* bottom, under `footer`, and fires with the next state when it is clicked;
|
|
@@ -439,7 +480,7 @@ type SidebarProps = {
|
|
|
439
480
|
* shows the sidebar as a drawer: it then fills the panel, is always expanded, and `Sidebar.Brand`
|
|
440
481
|
* gets a close button.
|
|
441
482
|
*/
|
|
442
|
-
declare const SidebarRoot: ({ variant, collapsed: collapsedProp, defaultCollapsed, width, maxWidth, collapsedWidth, children, expandOnHover, footer, footerDivider, activeStyle, onCollapsedChange, className, }: SidebarProps) => react.JSX.Element;
|
|
483
|
+
declare const SidebarRoot: ({ variant, collapsed: collapsedProp, defaultCollapsed, width, maxWidth, collapsedWidth, children, expandOnHover, footer, footerDivider, activeStyle, gutter: gutterProp, edgeToggle: edgeToggleProp, onCollapsedChange, className, }: SidebarProps) => react.JSX.Element;
|
|
443
484
|
type SidebarBrandProps = {
|
|
444
485
|
/** Logo node — typically a small icon, lucide component, or img. */
|
|
445
486
|
logo?: ReactNode;
|
|
@@ -617,6 +658,101 @@ type SidebarToggleProps = {
|
|
|
617
658
|
*/
|
|
618
659
|
declare const SidebarToggle: ({ variant, collapsed: collapsedProp, onCollapsedChange, controls, className, ref, }: SidebarToggleProps) => react.JSX.Element | null;
|
|
619
660
|
|
|
661
|
+
type SiteFooterVariant = 'full' | 'compact';
|
|
662
|
+
type SiteFooterTheme = 'light' | 'dark';
|
|
663
|
+
type SiteFooterProps = ComponentPropsWithRef<'footer'> & {
|
|
664
|
+
/**
|
|
665
|
+
* `full` is the footer of a page: the brand, link columns, an end column and a bottom row.
|
|
666
|
+
* `compact` puts the same parts on one line, for the pages where the big footer would push
|
|
667
|
+
* the main action away (the cart, the checkout). Default `full`.
|
|
668
|
+
*/
|
|
669
|
+
variant?: SiteFooterVariant;
|
|
670
|
+
/**
|
|
671
|
+
* `light` follows the page theme (white, gray-800 in the dark themes); `dark` stays dark in
|
|
672
|
+
* every theme. The parts take it from here. Default `light`.
|
|
673
|
+
*/
|
|
674
|
+
theme?: SiteFooterTheme;
|
|
675
|
+
/** Constrain the content to a max-width column, as `Navbar` does. Default `7xl`. */
|
|
676
|
+
maxWidth?: 'none' | '7xl';
|
|
677
|
+
/**
|
|
678
|
+
* The parts, in the order they are read: `SiteFooter.Banner`, `Brand`, `Column`, `Aside` and
|
|
679
|
+
* `Bottom`. The banner goes above and the bottom row below whatever the order.
|
|
680
|
+
*/
|
|
681
|
+
children: ReactNode;
|
|
682
|
+
};
|
|
683
|
+
declare function SiteFooterRoot({ variant, theme, maxWidth, className, children, ref, ...rest }: SiteFooterProps): react.JSX.Element;
|
|
684
|
+
type SiteFooterLinkProps = ComponentPropsWithRef<'a'>;
|
|
685
|
+
/**
|
|
686
|
+
* A link of the footer, drawn through `LinkProvider` like the links of the other components.
|
|
687
|
+
* `aria-current="page"` marks the current page, in bolder, stronger text.
|
|
688
|
+
*/
|
|
689
|
+
declare function SiteFooterLink({ className, ref, ...rest }: SiteFooterLinkProps): react.JSX.Element;
|
|
690
|
+
type SiteFooterTitleProps = ComponentPropsWithRef<'h2'>;
|
|
691
|
+
/**
|
|
692
|
+
* The heading of a column. Also for a group of your own in `Aside` or `Banner`, so it looks like
|
|
693
|
+
* the others and follows `theme`; name the group with `aria-labelledby`.
|
|
694
|
+
*/
|
|
695
|
+
declare function SiteFooterTitle({ className, ref, ...rest }: SiteFooterTitleProps): react.JSX.Element;
|
|
696
|
+
type SiteFooterBrandProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {
|
|
697
|
+
/** Makes the logo and name a link, usually to the home page. */
|
|
698
|
+
href?: string;
|
|
699
|
+
/** A line under the name. Only the `full` variant shows it. */
|
|
700
|
+
description?: ReactNode;
|
|
701
|
+
/** The logo and the name: any node, as in `Navbar.Brand`. */
|
|
702
|
+
children: ReactNode;
|
|
703
|
+
};
|
|
704
|
+
declare function SiteFooterBrand({ href, description, className, children, ref, ...rest }: SiteFooterBrandProps): react.JSX.Element;
|
|
705
|
+
type SiteFooterColumnProps = Omit<ComponentPropsWithRef<'nav'>, 'title'> & {
|
|
706
|
+
/** The heading of the column, and the name of its `nav`. The compact variant hides it. */
|
|
707
|
+
title: ReactNode;
|
|
708
|
+
/** `SiteFooter.Link`s: each one goes in a list item. */
|
|
709
|
+
children: ReactNode;
|
|
710
|
+
};
|
|
711
|
+
declare function SiteFooterColumn({ title, className, children, ref, ...rest }: SiteFooterColumnProps): react.JSX.Element;
|
|
712
|
+
type SiteFooterAsideProps = ComponentPropsWithRef<'div'>;
|
|
713
|
+
/**
|
|
714
|
+
* A free slot at the end: a newsletter form, social links, anything. In the compact variant it
|
|
715
|
+
* ends the line. To name it, give it `role="group"` and `aria-labelledby` the id of a
|
|
716
|
+
* `SiteFooter.Title`.
|
|
717
|
+
*/
|
|
718
|
+
declare function SiteFooterAside({ className, ref, ...rest }: SiteFooterAsideProps): react.JSX.Element;
|
|
719
|
+
type SiteFooterBannerProps = ComponentPropsWithRef<'div'>;
|
|
720
|
+
/**
|
|
721
|
+
* A full-width band above the columns, for a call to action such as the newsletter. It takes
|
|
722
|
+
* any content and goes first, wherever it is among the parts.
|
|
723
|
+
*/
|
|
724
|
+
declare function SiteFooterBanner({ className, ref, ...rest }: SiteFooterBannerProps): react.JSX.Element;
|
|
725
|
+
type SiteFooterBottomLink = Omit<ComponentPropsWithRef<'a'>, 'children' | 'href'> & {
|
|
726
|
+
label: ReactNode;
|
|
727
|
+
href: string;
|
|
728
|
+
};
|
|
729
|
+
type SiteFooterBottomProps = ComponentPropsWithRef<'div'> & {
|
|
730
|
+
/** Legal links (terms, privacy, cookie settings), in a `nav` after the text. */
|
|
731
|
+
links?: SiteFooterBottomLink[];
|
|
732
|
+
/** Name of the legal links' `nav`. Default `Legal`. */
|
|
733
|
+
linksLabel?: string;
|
|
734
|
+
};
|
|
735
|
+
/**
|
|
736
|
+
* The last row: the copyright as children, the legal links as `links`. In the `full` variant it
|
|
737
|
+
* goes under everything, with a rule above it, whatever its place among the parts.
|
|
738
|
+
*/
|
|
739
|
+
declare function SiteFooterBottom({ links, linksLabel, className, children, ref, ...rest }: SiteFooterBottomProps): react.JSX.Element;
|
|
740
|
+
/**
|
|
741
|
+
* The footer of a public page, the counterpart of `Navbar`: a `footer` landmark (`contentinfo`
|
|
742
|
+
* when it follows `main` rather than sits inside it), built from `Brand`, link `Column`s with
|
|
743
|
+
* their heading, a free `Aside`, an optional `Banner` and a `Bottom` row. `variant="compact"`
|
|
744
|
+
* puts them on one line.
|
|
745
|
+
*/
|
|
746
|
+
declare const SiteFooter: typeof SiteFooterRoot & {
|
|
747
|
+
Brand: typeof SiteFooterBrand;
|
|
748
|
+
Column: typeof SiteFooterColumn;
|
|
749
|
+
Link: typeof SiteFooterLink;
|
|
750
|
+
Title: typeof SiteFooterTitle;
|
|
751
|
+
Aside: typeof SiteFooterAside;
|
|
752
|
+
Banner: typeof SiteFooterBanner;
|
|
753
|
+
Bottom: typeof SiteFooterBottom;
|
|
754
|
+
};
|
|
755
|
+
|
|
620
756
|
type PageHeaderProps = {
|
|
621
757
|
/** Main page title */
|
|
622
758
|
title: string;
|
|
@@ -682,17 +818,50 @@ type SectionCardProps = {
|
|
|
682
818
|
iconColor?: string;
|
|
683
819
|
/** Tailwind bg-* class for the icon container. Overridden by `iconTone` when both are set. */
|
|
684
820
|
iconBg?: string;
|
|
821
|
+
/**
|
|
822
|
+
* At the end of the header: a button, a menu, a link. Below `sm` it goes under the title. It
|
|
823
|
+
* stays in every state; remove it yourself where it makes no sense (`action={empty ? undefined : …}`).
|
|
824
|
+
*/
|
|
825
|
+
action?: ReactNode;
|
|
826
|
+
/**
|
|
827
|
+
* The data is on its way: a skeleton replaces the body, the card is `aria-busy` and a status
|
|
828
|
+
* line says what loads. Wins over `error` and `empty`.
|
|
829
|
+
*/
|
|
830
|
+
loading?: boolean;
|
|
831
|
+
/** The request failed: a compact `ErrorState` replaces the body. Wins over `empty`. */
|
|
832
|
+
error?: boolean;
|
|
833
|
+
/** What went wrong, as the title of the error. Default 'Something went wrong.' */
|
|
834
|
+
errorMessage?: string;
|
|
835
|
+
/** A line under `errorMessage`: the cause, or what to do next. */
|
|
836
|
+
errorDescription?: string;
|
|
837
|
+
/** With `error`, shows a "Try again" button that calls it. */
|
|
838
|
+
onRetry?: () => void;
|
|
839
|
+
/** There is nothing to show: a compact `EmptyState` replaces the body. */
|
|
840
|
+
empty?: boolean;
|
|
841
|
+
/** Title of the empty state. Default 'No data'. For a richer one, pass your own `EmptyState` as `children`. */
|
|
842
|
+
emptyMessage?: string;
|
|
843
|
+
/** Under the empty message: the way to fill the card (a button, a link). */
|
|
844
|
+
emptyAction?: ReactNode;
|
|
845
|
+
/**
|
|
846
|
+
* A Tailwind `min-h-*` class (`min-h-44`) the body keeps in every state, so a card alone in its
|
|
847
|
+
* row does not jump when it loads. In a grid the body already takes the height the row gives it.
|
|
848
|
+
*/
|
|
849
|
+
minBodyHeight?: string;
|
|
685
850
|
/** Card content */
|
|
686
851
|
children?: ReactNode;
|
|
852
|
+
/** On the root `<section>`: the place for a grid span (`lg:col-span-2`) or a margin. */
|
|
687
853
|
className?: string;
|
|
688
854
|
};
|
|
689
855
|
/**
|
|
690
|
-
* SectionCard — a `Card` (24px padding) with title, optional icon and description,
|
|
856
|
+
* SectionCard — a `Card` (24px padding) with title, optional icon and description, an optional
|
|
857
|
+
* `action` at the end of the header, and children. Its body can load, come back empty or fail on
|
|
858
|
+
* its own (`loading`, `empty`, `error`): the header stays, so the reader knows which card it is.
|
|
691
859
|
*
|
|
692
860
|
* The de-facto building block for grouped content in a page. Use multiple
|
|
693
|
-
* SectionCards stacked vertically (with `space-y-6`) or in a grid.
|
|
861
|
+
* SectionCards stacked vertically (with `space-y-6`) or in a grid. The root is a `<section>` named
|
|
862
|
+
* by the title, so a screen reader lists the cards of a page as regions.
|
|
694
863
|
*/
|
|
695
|
-
declare const SectionCard: ({ title, as: Heading, desc, icon: Icon, iconTone, iconColor, iconBg, children, className, }: SectionCardProps) => react.JSX.Element;
|
|
864
|
+
declare const SectionCard: ({ title, as: Heading, desc, icon: Icon, iconTone, iconColor, iconBg, action, loading, error, errorMessage, errorDescription, onRetry, empty, emptyMessage, emptyAction, minBodyHeight, children, className, }: SectionCardProps) => react.JSX.Element;
|
|
696
865
|
|
|
697
866
|
type ContentNarrowProps = {
|
|
698
867
|
children: ReactNode;
|
|
@@ -1449,6 +1618,99 @@ declare const uptimeLevel: (uptime: number | null | undefined, thresholds?: Part
|
|
|
1449
1618
|
*/
|
|
1450
1619
|
declare const formatUptime: (uptime: number) => string;
|
|
1451
1620
|
|
|
1621
|
+
type MenuProps = {
|
|
1622
|
+
open?: boolean;
|
|
1623
|
+
defaultOpen?: boolean;
|
|
1624
|
+
onOpenChange?: (open: boolean) => void;
|
|
1625
|
+
/** Edge of the trigger the menu lines up with: where the text starts or ends, so the right under `dir="rtl"` for `start`. Default `start`. */
|
|
1626
|
+
align?: 'start' | 'end';
|
|
1627
|
+
children: ReactNode;
|
|
1628
|
+
};
|
|
1629
|
+
type MenuTriggerProps = ComponentPropsWithRef<'button'>;
|
|
1630
|
+
/** An unstyled button: give it a label or an icon with an `aria-label`, and your own classes. */
|
|
1631
|
+
declare function MenuTrigger({ onClick, onKeyDown, className, ref, ...rest }: MenuTriggerProps): react.JSX.Element;
|
|
1632
|
+
type MenuContentProps = {
|
|
1633
|
+
/** Tailwind width class. Default `w-56` (224px). */
|
|
1634
|
+
width?: string;
|
|
1635
|
+
/** Name of the menu. Default: the trigger's. */
|
|
1636
|
+
'aria-label'?: string;
|
|
1637
|
+
className?: string;
|
|
1638
|
+
children: ReactNode;
|
|
1639
|
+
};
|
|
1640
|
+
type MenuGroupProps = {
|
|
1641
|
+
/** Heading of the group. The group is named by it. */
|
|
1642
|
+
label?: string;
|
|
1643
|
+
className?: string;
|
|
1644
|
+
children: ReactNode;
|
|
1645
|
+
};
|
|
1646
|
+
type MenuItemIntent = Extract<Intent, 'neutral' | 'danger'>;
|
|
1647
|
+
type MenuItemProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'onSelect' | 'type'> & {
|
|
1648
|
+
children: ReactNode;
|
|
1649
|
+
icon?: ComponentType<{
|
|
1650
|
+
className?: string;
|
|
1651
|
+
}>;
|
|
1652
|
+
/** `danger` colors a destructive item (delete, sign out) red. Default `neutral`. */
|
|
1653
|
+
intent?: MenuItemIntent;
|
|
1654
|
+
/** Keyboard shortcut hint, shown at the end (e.g. "⌘D"). It is a hint, not a binding. */
|
|
1655
|
+
shortcut?: ReactNode;
|
|
1656
|
+
/** Trailing badge, before the shortcut: a `<Badge size="sm">` with a count or a tag. */
|
|
1657
|
+
badge?: ReactNode;
|
|
1658
|
+
/**
|
|
1659
|
+
* Makes the item a link (`<a role="menuitem">`) instead of a button: middle-click, "open in a
|
|
1660
|
+
* new tab" and a router's link interception work. `onSelect` still runs and the menu still
|
|
1661
|
+
* closes. A disabled link item has no `href` and `aria-disabled="true"`.
|
|
1662
|
+
*/
|
|
1663
|
+
href?: string;
|
|
1664
|
+
/** With `href`: where the link opens (`_blank`…). */
|
|
1665
|
+
target?: string;
|
|
1666
|
+
/** With `href`: the link's `rel`. */
|
|
1667
|
+
rel?: string;
|
|
1668
|
+
/** Runs when the item is chosen, by click, Enter or Space. */
|
|
1669
|
+
onSelect?: () => void;
|
|
1670
|
+
/** Closes the menu once the item is chosen. Default true. */
|
|
1671
|
+
closeOnSelect?: boolean;
|
|
1672
|
+
};
|
|
1673
|
+
declare function MenuItem({ icon: Icon, intent, shortcut, badge, onSelect, closeOnSelect, href, disabled, onClick, className, children, ref, ...rest }: MenuItemProps): react.JSX.Element;
|
|
1674
|
+
type MenuCheckboxItemProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'onSelect' | 'type' | 'role' | 'defaultChecked'> & {
|
|
1675
|
+
children: ReactNode;
|
|
1676
|
+
/** Controlled state. Only `undefined` means uncontrolled. */
|
|
1677
|
+
checked?: boolean;
|
|
1678
|
+
defaultChecked?: boolean;
|
|
1679
|
+
/** Called with the state to move to, on click, Enter or Space. */
|
|
1680
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1681
|
+
/** Closes the menu once the item is toggled. Default false: a list of options stays open. */
|
|
1682
|
+
closeOnSelect?: boolean;
|
|
1683
|
+
};
|
|
1684
|
+
/**
|
|
1685
|
+
* An item that is on or off (`role="menuitemcheckbox"`). It keeps the menu open, so several can
|
|
1686
|
+
* be toggled in a row, and takes the same arrows, Home, End and typeahead as `Menu.Item`.
|
|
1687
|
+
*/
|
|
1688
|
+
declare function MenuCheckboxItem({ checked: checkedProp, defaultChecked, onCheckedChange, closeOnSelect, disabled, onClick, className, children, ref, ...rest }: MenuCheckboxItemProps): react.JSX.Element;
|
|
1689
|
+
type MenuRadioItemProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'onSelect' | 'type' | 'role'> & {
|
|
1690
|
+
children: ReactNode;
|
|
1691
|
+
/** Whether this is the picked item of its group. The host owns it: the item never flips itself. */
|
|
1692
|
+
checked: boolean;
|
|
1693
|
+
/** Runs when the item is chosen, by click, Enter or Space (also when it is already checked). */
|
|
1694
|
+
onSelect?: () => void;
|
|
1695
|
+
/** Closes the menu once the item is chosen. Default true: picking an option is a choice made. */
|
|
1696
|
+
closeOnSelect?: boolean;
|
|
1697
|
+
};
|
|
1698
|
+
/**
|
|
1699
|
+
* One option of a set where a single one is picked (`role="menuitemradio"`), as the views of a
|
|
1700
|
+
* table. Put them in a `Menu.Group` with a `label`. It takes the same arrows, Home, End and
|
|
1701
|
+
* typeahead as `Menu.Item`.
|
|
1702
|
+
*/
|
|
1703
|
+
declare function MenuRadioItem({ checked, onSelect, closeOnSelect, disabled, onClick, className, children, ref, ...rest }: MenuRadioItemProps): react.JSX.Element;
|
|
1704
|
+
declare const Menu: (({ open: openProp, defaultOpen, onOpenChange, align, children, }: MenuProps) => react.JSX.Element) & {
|
|
1705
|
+
Trigger: typeof MenuTrigger;
|
|
1706
|
+
Content: ({ width, "aria-label": ariaLabel, className, children, }: MenuContentProps) => react.JSX.Element;
|
|
1707
|
+
Group: ({ label, className, children }: MenuGroupProps) => react.JSX.Element;
|
|
1708
|
+
Item: typeof MenuItem;
|
|
1709
|
+
CheckboxItem: typeof MenuCheckboxItem;
|
|
1710
|
+
RadioItem: typeof MenuRadioItem;
|
|
1711
|
+
Separator: () => react.JSX.Element;
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1452
1714
|
type StackedListProps = Omit<ComponentPropsWithRef<'ul'>, 'children' | 'title'> & {
|
|
1453
1715
|
children: ReactNode;
|
|
1454
1716
|
/**
|
|
@@ -1471,21 +1733,57 @@ type StackedListProps = Omit<ComponentPropsWithRef<'ul'>, 'children' | 'title'>
|
|
|
1471
1733
|
*
|
|
1472
1734
|
* Items also take a `badge` and a line of `details` for content rows (issues,
|
|
1473
1735
|
* projects), a `timestamp` and a `description` for narrow columns, and a `rank`
|
|
1474
|
-
* for "top N" lists. `StackedList.Header` adds group headings between items
|
|
1475
|
-
* With `card` the list sits on a card surface, with an optional header.
|
|
1736
|
+
* for "top N" lists. `StackedList.Header` adds group headings between items, or a
|
|
1737
|
+
* selection bar. With `card` the list sits on a card surface, with an optional header.
|
|
1738
|
+
*
|
|
1739
|
+
* A triage list (a mail inbox, notifications) takes `unread`, `selected`, a checkbox
|
|
1740
|
+
* (`checked`), a star (`starred`) and `actions` on its items, and a select-all on the
|
|
1741
|
+
* header. The host keeps the state.
|
|
1476
1742
|
*/
|
|
1477
1743
|
declare function StackedListRoot({ card, title, description, action, className, children, ref, ...rest }: StackedListProps): react.JSX.Element;
|
|
1478
1744
|
type StackedListHeaderProps = Omit<ComponentPropsWithRef<'li'>, 'children'> & {
|
|
1479
1745
|
/** Render with `position: sticky` so the header stays pinned while scrolling. */
|
|
1480
1746
|
sticky?: boolean;
|
|
1747
|
+
/** The heading, or in a selection bar the count ("3 selected"). */
|
|
1481
1748
|
children: ReactNode;
|
|
1749
|
+
/**
|
|
1750
|
+
* Adds a select-all checkbox at the start, which makes the header a selection bar. The host
|
|
1751
|
+
* owns it: pass `checked` (every row is picked) and `indeterminate` (some are), and answer
|
|
1752
|
+
* `onCheckedChange` by picking or clearing them all.
|
|
1753
|
+
*/
|
|
1754
|
+
checked?: boolean;
|
|
1755
|
+
/** Shows the checkbox as mixed: some rows are picked, not all. */
|
|
1756
|
+
indeterminate?: boolean;
|
|
1757
|
+
/** Called with the state the checkbox moves to. */
|
|
1758
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1759
|
+
/**
|
|
1760
|
+
* Controls at the end of the bar, for the actions on the picked rows. Keep them short, and
|
|
1761
|
+
* icon-only on a phone: the bar does not wrap.
|
|
1762
|
+
*/
|
|
1763
|
+
actions?: ReactNode;
|
|
1482
1764
|
};
|
|
1483
1765
|
/**
|
|
1484
1766
|
* Group heading, rendered as an `<li>` among the items of the same list. With
|
|
1485
|
-
* `sticky` it stays pinned to the top of the scrolling container.
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1767
|
+
* `sticky` it stays pinned to the top of the scrolling container. With `checked`
|
|
1768
|
+
* or `onCheckedChange` it is a selection bar: a select-all checkbox, the count and
|
|
1769
|
+
* the bulk `actions`.
|
|
1770
|
+
*/
|
|
1771
|
+
declare function StackedListHeader({ sticky, checked, indeterminate, onCheckedChange, actions, className, children, ref, ...rest }: StackedListHeaderProps): react.JSX.Element;
|
|
1772
|
+
/** One action of a row: an icon button on a wide screen, an item of a menu on a phone. */
|
|
1773
|
+
type StackedListAction = {
|
|
1774
|
+
/** What the action does ("Archive"). The button's name, with the row's title, and the menu item's text. */
|
|
1775
|
+
label: string;
|
|
1776
|
+
/** Icon of the button, and of the menu item. */
|
|
1777
|
+
icon: ComponentType<{
|
|
1778
|
+
className?: string;
|
|
1779
|
+
}>;
|
|
1780
|
+
/** `danger` colors a destructive action (delete). Default `neutral`. */
|
|
1781
|
+
intent?: MenuItemIntent;
|
|
1782
|
+
disabled?: boolean;
|
|
1783
|
+
/** Runs when the action is chosen. */
|
|
1784
|
+
onSelect: () => void;
|
|
1785
|
+
};
|
|
1786
|
+
type StackedListItemProps = Omit<ComponentPropsWithRef<'li'>, 'title' | 'onClick'> & {
|
|
1489
1787
|
/** Leading slot — typically an `<img>` (size-12, rounded-full) or `<Avatar>`. */
|
|
1490
1788
|
avatar?: ReactNode;
|
|
1491
1789
|
/** Primary text. */
|
|
@@ -1504,6 +1802,12 @@ type StackedListItemProps = Omit<ComponentPropsWithRef<'li'>, 'title'> & {
|
|
|
1504
1802
|
* `position: relative`.
|
|
1505
1803
|
*/
|
|
1506
1804
|
href?: string;
|
|
1805
|
+
/**
|
|
1806
|
+
* Makes the title a button, with the same full-row overlay as `href`, or runs on the link when
|
|
1807
|
+
* `href` is set too. It is the title's handler, not the `<li>`'s: it no longer fires from a
|
|
1808
|
+
* click on a control or on a part of the row that is not the title.
|
|
1809
|
+
*/
|
|
1810
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
1507
1811
|
/** When `href` is set, also append a chevron-right icon to indicate navigation. */
|
|
1508
1812
|
chevron?: boolean;
|
|
1509
1813
|
/** Position in a "top N" list, shown before the avatar. */
|
|
@@ -1520,8 +1824,35 @@ type StackedListItemProps = Omit<ComponentPropsWithRef<'li'>, 'title'> & {
|
|
|
1520
1824
|
timestamp?: ReactNode;
|
|
1521
1825
|
/** Body text under the title, clamped to two lines. Replaces `subtitle`. */
|
|
1522
1826
|
description?: ReactNode;
|
|
1827
|
+
/**
|
|
1828
|
+
* Whether the row is unread. `true` is a bold title with a dot in the start gutter and
|
|
1829
|
+
* "Unread" for a screen reader; `false` the read look, a lighter title. Left out, the row
|
|
1830
|
+
* keeps the look it always had. Set it on every row of an inbox, so the titles stay aligned.
|
|
1831
|
+
*/
|
|
1832
|
+
unread?: boolean;
|
|
1833
|
+
/**
|
|
1834
|
+
* The row open in a master-detail layout: `aria-current` on the title, a tint and a bar at
|
|
1835
|
+
* the start edge. Not the checkbox: that is `checked`.
|
|
1836
|
+
*/
|
|
1837
|
+
selected?: boolean;
|
|
1838
|
+
/** Controlled state of the row's checkbox. Setting it, `defaultChecked` or `onCheckedChange` adds the checkbox. */
|
|
1839
|
+
checked?: boolean;
|
|
1840
|
+
defaultChecked?: boolean;
|
|
1841
|
+
/** Called with the state the checkbox moves to. */
|
|
1842
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1843
|
+
/** Controlled state of the star. Setting it, `defaultStarred` or `onStarredChange` adds the star toggle. */
|
|
1844
|
+
starred?: boolean;
|
|
1845
|
+
defaultStarred?: boolean;
|
|
1846
|
+
/** Called with the state the star moves to. */
|
|
1847
|
+
onStarredChange?: (starred: boolean) => void;
|
|
1848
|
+
/**
|
|
1849
|
+
* Actions on the row. Icon buttons that appear on hover and focus (they are only transparent
|
|
1850
|
+
* until then, so a keyboard reaches them); on a phone, and on a screen with no hover, one
|
|
1851
|
+
* "More actions" menu. Anything else goes in `trailing`.
|
|
1852
|
+
*/
|
|
1853
|
+
actions?: StackedListAction[];
|
|
1523
1854
|
};
|
|
1524
|
-
declare function StackedListItem({ avatar, title, subtitle, meta, trailing, href, chevron, rank, badge, details, timestamp, description, className, ref, ...rest }: StackedListItemProps): react.JSX.Element;
|
|
1855
|
+
declare function StackedListItem({ avatar, title, subtitle, meta, trailing, href, onClick, chevron, rank, badge, details, timestamp, description, unread, selected, checked: checkedProp, defaultChecked, onCheckedChange, starred: starredProp, defaultStarred, onStarredChange, actions, className, ref, ...rest }: StackedListItemProps): react.JSX.Element;
|
|
1525
1856
|
declare const StackedList: typeof StackedListRoot & {
|
|
1526
1857
|
Header: typeof StackedListHeader;
|
|
1527
1858
|
Item: typeof StackedListItem;
|
|
@@ -1557,7 +1888,7 @@ type RowProps = {
|
|
|
1557
1888
|
* insets the content from the hover background, so stack rows in a plain
|
|
1558
1889
|
* container, with or without dividers.
|
|
1559
1890
|
*/
|
|
1560
|
-
declare const Row: ({ icon: Icon, title, subtitle, status, onClick, href, className, ref, }: RowProps) => react.JSX.Element;
|
|
1891
|
+
declare const Row$1: ({ icon: Icon, title, subtitle, status, onClick, href, className, ref, }: RowProps) => react.JSX.Element;
|
|
1561
1892
|
|
|
1562
1893
|
type ActivityFeedIntent = Extract<Intent, 'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
|
|
1563
1894
|
type ActivityFeedItemProps = ComponentPropsWithRef<'li'> & {
|
|
@@ -2716,7 +3047,45 @@ type ConfirmationModalProps = {
|
|
|
2716
3047
|
*/
|
|
2717
3048
|
declare const ConfirmationModal: ({ open, onClose, ...content }: ConfirmationModalProps) => react.JSX.Element;
|
|
2718
3049
|
|
|
2719
|
-
type
|
|
3050
|
+
type NotificationRowIntent = Extract<Intent, 'danger' | 'warning' | 'info' | 'success'>;
|
|
3051
|
+
type NotificationRowProps = ComponentPropsWithRef<'button'> & {
|
|
3052
|
+
/** Color of the chip and the badge, and the icon unless `icon` replaces it. */
|
|
3053
|
+
intent: NotificationRowIntent;
|
|
3054
|
+
/**
|
|
3055
|
+
* Icon of the chip, in place of the one `intent` picks (a comment, an invoice, a deploy). The
|
|
3056
|
+
* chip keeps the color of the intent.
|
|
3057
|
+
*/
|
|
3058
|
+
icon?: ComponentType<{
|
|
3059
|
+
className?: string;
|
|
3060
|
+
}>;
|
|
3061
|
+
title: string;
|
|
3062
|
+
subtitle?: string;
|
|
3063
|
+
/** Small mono caption shown below the subtitle (e.g. check id, error code). */
|
|
3064
|
+
caption?: string;
|
|
3065
|
+
/** When the notification happened, as a line under the text (e.g. "2 min ago"). */
|
|
3066
|
+
time?: ReactNode;
|
|
3067
|
+
/** Not read yet: a dot before the title and a tinted row. Default false. */
|
|
3068
|
+
unread?: boolean;
|
|
3069
|
+
/** Badge label at the end of the row. If omitted, derived from `intent` (CRIT/WARN/INFO/OK). */
|
|
3070
|
+
badgeLabel?: string;
|
|
3071
|
+
/**
|
|
3072
|
+
* Controls at the end of the row (mark as read, delete…): icon buttons named for their row
|
|
3073
|
+
* (`aria-label="Delete: {title}"`), or a menu. They come after the row's own button and are
|
|
3074
|
+
* siblings of it, never inside it, so each is a stop of its own for the keyboard and a click
|
|
3075
|
+
* on one is not a click on the row. With `actions` the row is a `<div>` around that button and
|
|
3076
|
+
* them: `className` styles the `<div>`, and `ref` and the other props stay on the button.
|
|
3077
|
+
*/
|
|
3078
|
+
actions?: ReactNode;
|
|
3079
|
+
};
|
|
3080
|
+
/**
|
|
3081
|
+
* One notification, as a full-width button: a chip with its icon, the title, subtitle, caption
|
|
3082
|
+
* and time, and a badge. `NotificationsPanel.Item` is this row plus closing the panel; on a
|
|
3083
|
+
* notifications page, put it in your own list (`<ul>` and `<li>`) with the filters and paging
|
|
3084
|
+
* that page has.
|
|
3085
|
+
*/
|
|
3086
|
+
declare function NotificationRow({ intent, icon, title, subtitle, caption, time, unread, badgeLabel, actions, className, ref, ...rest }: NotificationRowProps): react.JSX.Element;
|
|
3087
|
+
|
|
3088
|
+
type NotificationsPanelIntent = NotificationRowIntent;
|
|
2720
3089
|
type NotificationsPanelProps = {
|
|
2721
3090
|
/** Controlled open state. If omitted, the panel manages its own state. */
|
|
2722
3091
|
open?: boolean;
|
|
@@ -2770,23 +3139,15 @@ type NotificationsPanelListProps = {
|
|
|
2770
3139
|
className?: string;
|
|
2771
3140
|
children: ReactNode;
|
|
2772
3141
|
};
|
|
2773
|
-
type NotificationsPanelItemProps =
|
|
2774
|
-
/** Color and icon of the item. */
|
|
2775
|
-
intent: NotificationsPanelIntent;
|
|
2776
|
-
title: string;
|
|
2777
|
-
subtitle?: string;
|
|
2778
|
-
/** Small mono caption shown below the subtitle (e.g. check id, error code). */
|
|
2779
|
-
caption?: string;
|
|
2780
|
-
/** When the notification happened, as a line under the text (e.g. "2 min ago"). */
|
|
2781
|
-
time?: ReactNode;
|
|
2782
|
-
/** Not read yet: a dot before the title and a tinted row. Default false. */
|
|
2783
|
-
unread?: boolean;
|
|
2784
|
-
/** Badge label at the end of the item. If omitted, derived from `intent` (CRIT/WARN/INFO/OK). */
|
|
2785
|
-
badgeLabel?: string;
|
|
3142
|
+
type NotificationsPanelItemProps = NotificationRowProps & {
|
|
2786
3143
|
/** When true, the panel auto-closes after the item is clicked. Default true. */
|
|
2787
3144
|
closeOnClick?: boolean;
|
|
2788
3145
|
};
|
|
2789
|
-
|
|
3146
|
+
/**
|
|
3147
|
+
* A `NotificationRow` in the panel: it closes the panel when its button is clicked (`closeOnClick`),
|
|
3148
|
+
* and nothing else. Its `actions` do not close it.
|
|
3149
|
+
*/
|
|
3150
|
+
declare function NotificationsPanelItem({ closeOnClick, onClick, ...rest }: NotificationsPanelItemProps): react.JSX.Element;
|
|
2790
3151
|
type NotificationsPanelEmptyProps = {
|
|
2791
3152
|
title?: string;
|
|
2792
3153
|
subtitle?: string;
|
|
@@ -2841,99 +3202,6 @@ declare const NotificationCard: (({ title, description, intent, icon, onDismiss,
|
|
|
2841
3202
|
Condensed: ({ title, actionLabel, onAction, onDismiss, className, }: NotificationCardCondensedProps) => react.JSX.Element;
|
|
2842
3203
|
};
|
|
2843
3204
|
|
|
2844
|
-
type MenuProps = {
|
|
2845
|
-
open?: boolean;
|
|
2846
|
-
defaultOpen?: boolean;
|
|
2847
|
-
onOpenChange?: (open: boolean) => void;
|
|
2848
|
-
/** Edge of the trigger the menu lines up with: where the text starts or ends, so the right under `dir="rtl"` for `start`. Default `start`. */
|
|
2849
|
-
align?: 'start' | 'end';
|
|
2850
|
-
children: ReactNode;
|
|
2851
|
-
};
|
|
2852
|
-
type MenuTriggerProps = ComponentPropsWithRef<'button'>;
|
|
2853
|
-
/** An unstyled button: give it a label or an icon with an `aria-label`, and your own classes. */
|
|
2854
|
-
declare function MenuTrigger({ onClick, onKeyDown, className, ref, ...rest }: MenuTriggerProps): react.JSX.Element;
|
|
2855
|
-
type MenuContentProps = {
|
|
2856
|
-
/** Tailwind width class. Default `w-56` (224px). */
|
|
2857
|
-
width?: string;
|
|
2858
|
-
/** Name of the menu. Default: the trigger's. */
|
|
2859
|
-
'aria-label'?: string;
|
|
2860
|
-
className?: string;
|
|
2861
|
-
children: ReactNode;
|
|
2862
|
-
};
|
|
2863
|
-
type MenuGroupProps = {
|
|
2864
|
-
/** Heading of the group. The group is named by it. */
|
|
2865
|
-
label?: string;
|
|
2866
|
-
className?: string;
|
|
2867
|
-
children: ReactNode;
|
|
2868
|
-
};
|
|
2869
|
-
type MenuItemIntent = Extract<Intent, 'neutral' | 'danger'>;
|
|
2870
|
-
type MenuItemProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'onSelect' | 'type'> & {
|
|
2871
|
-
children: ReactNode;
|
|
2872
|
-
icon?: ComponentType<{
|
|
2873
|
-
className?: string;
|
|
2874
|
-
}>;
|
|
2875
|
-
/** `danger` colors a destructive item (delete, sign out) red. Default `neutral`. */
|
|
2876
|
-
intent?: MenuItemIntent;
|
|
2877
|
-
/** Keyboard shortcut hint, shown at the end (e.g. "⌘D"). It is a hint, not a binding. */
|
|
2878
|
-
shortcut?: ReactNode;
|
|
2879
|
-
/** Trailing badge, before the shortcut: a `<Badge size="sm">` with a count or a tag. */
|
|
2880
|
-
badge?: ReactNode;
|
|
2881
|
-
/**
|
|
2882
|
-
* Makes the item a link (`<a role="menuitem">`) instead of a button: middle-click, "open in a
|
|
2883
|
-
* new tab" and a router's link interception work. `onSelect` still runs and the menu still
|
|
2884
|
-
* closes. A disabled link item has no `href` and `aria-disabled="true"`.
|
|
2885
|
-
*/
|
|
2886
|
-
href?: string;
|
|
2887
|
-
/** With `href`: where the link opens (`_blank`…). */
|
|
2888
|
-
target?: string;
|
|
2889
|
-
/** With `href`: the link's `rel`. */
|
|
2890
|
-
rel?: string;
|
|
2891
|
-
/** Runs when the item is chosen, by click, Enter or Space. */
|
|
2892
|
-
onSelect?: () => void;
|
|
2893
|
-
/** Closes the menu once the item is chosen. Default true. */
|
|
2894
|
-
closeOnSelect?: boolean;
|
|
2895
|
-
};
|
|
2896
|
-
declare function MenuItem({ icon: Icon, intent, shortcut, badge, onSelect, closeOnSelect, href, disabled, onClick, className, children, ref, ...rest }: MenuItemProps): react.JSX.Element;
|
|
2897
|
-
type MenuCheckboxItemProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'onSelect' | 'type' | 'role' | 'defaultChecked'> & {
|
|
2898
|
-
children: ReactNode;
|
|
2899
|
-
/** Controlled state. Only `undefined` means uncontrolled. */
|
|
2900
|
-
checked?: boolean;
|
|
2901
|
-
defaultChecked?: boolean;
|
|
2902
|
-
/** Called with the state to move to, on click, Enter or Space. */
|
|
2903
|
-
onCheckedChange?: (checked: boolean) => void;
|
|
2904
|
-
/** Closes the menu once the item is toggled. Default false: a list of options stays open. */
|
|
2905
|
-
closeOnSelect?: boolean;
|
|
2906
|
-
};
|
|
2907
|
-
/**
|
|
2908
|
-
* An item that is on or off (`role="menuitemcheckbox"`). It keeps the menu open, so several can
|
|
2909
|
-
* be toggled in a row, and takes the same arrows, Home, End and typeahead as `Menu.Item`.
|
|
2910
|
-
*/
|
|
2911
|
-
declare function MenuCheckboxItem({ checked: checkedProp, defaultChecked, onCheckedChange, closeOnSelect, disabled, onClick, className, children, ref, ...rest }: MenuCheckboxItemProps): react.JSX.Element;
|
|
2912
|
-
type MenuRadioItemProps = Omit<ComponentPropsWithRef<'button'>, 'children' | 'onSelect' | 'type' | 'role'> & {
|
|
2913
|
-
children: ReactNode;
|
|
2914
|
-
/** Whether this is the picked item of its group. The host owns it: the item never flips itself. */
|
|
2915
|
-
checked: boolean;
|
|
2916
|
-
/** Runs when the item is chosen, by click, Enter or Space (also when it is already checked). */
|
|
2917
|
-
onSelect?: () => void;
|
|
2918
|
-
/** Closes the menu once the item is chosen. Default true: picking an option is a choice made. */
|
|
2919
|
-
closeOnSelect?: boolean;
|
|
2920
|
-
};
|
|
2921
|
-
/**
|
|
2922
|
-
* One option of a set where a single one is picked (`role="menuitemradio"`), as the views of a
|
|
2923
|
-
* table. Put them in a `Menu.Group` with a `label`. It takes the same arrows, Home, End and
|
|
2924
|
-
* typeahead as `Menu.Item`.
|
|
2925
|
-
*/
|
|
2926
|
-
declare function MenuRadioItem({ checked, onSelect, closeOnSelect, disabled, onClick, className, children, ref, ...rest }: MenuRadioItemProps): react.JSX.Element;
|
|
2927
|
-
declare const Menu: (({ open: openProp, defaultOpen, onOpenChange, align, children, }: MenuProps) => react.JSX.Element) & {
|
|
2928
|
-
Trigger: typeof MenuTrigger;
|
|
2929
|
-
Content: ({ width, "aria-label": ariaLabel, className, children, }: MenuContentProps) => react.JSX.Element;
|
|
2930
|
-
Group: ({ label, className, children }: MenuGroupProps) => react.JSX.Element;
|
|
2931
|
-
Item: typeof MenuItem;
|
|
2932
|
-
CheckboxItem: typeof MenuCheckboxItem;
|
|
2933
|
-
RadioItem: typeof MenuRadioItem;
|
|
2934
|
-
Separator: () => react.JSX.Element;
|
|
2935
|
-
};
|
|
2936
|
-
|
|
2937
3205
|
type UserMenuProps = {
|
|
2938
3206
|
open?: boolean;
|
|
2939
3207
|
defaultOpen?: boolean;
|
|
@@ -2961,6 +3229,11 @@ type UserMenuHeaderProps = {
|
|
|
2961
3229
|
name: string;
|
|
2962
3230
|
email?: string;
|
|
2963
3231
|
avatarSrc?: string;
|
|
3232
|
+
/**
|
|
3233
|
+
* Shown after the name on the same line, for what the user is here: a `Badge` with their role
|
|
3234
|
+
* or plan. The name gives way to it (it truncates), the badge never shrinks.
|
|
3235
|
+
*/
|
|
3236
|
+
badge?: ReactNode;
|
|
2964
3237
|
className?: string;
|
|
2965
3238
|
};
|
|
2966
3239
|
type UserMenuItemIntent = MenuItemIntent;
|
|
@@ -2978,7 +3251,7 @@ declare function UserMenuItem({ closeOnClick, ...rest }: UserMenuItemProps): rea
|
|
|
2978
3251
|
declare const UserMenu: (({ align, ...rest }: UserMenuProps) => react.JSX.Element) & {
|
|
2979
3252
|
Trigger: typeof UserMenuTrigger;
|
|
2980
3253
|
Content: (props: UserMenuContentProps) => react.JSX.Element;
|
|
2981
|
-
Header: ({ name, email, avatarSrc, className }: UserMenuHeaderProps) => react.JSX.Element;
|
|
3254
|
+
Header: ({ name, email, avatarSrc, badge, className }: UserMenuHeaderProps) => react.JSX.Element;
|
|
2982
3255
|
Items: ({ children }: {
|
|
2983
3256
|
children: ReactNode;
|
|
2984
3257
|
}) => react.JSX.Element;
|
|
@@ -3502,6 +3775,65 @@ declare const ImageGrid: typeof ImageGridRoot & {
|
|
|
3502
3775
|
Item: typeof ImageGridItem;
|
|
3503
3776
|
};
|
|
3504
3777
|
|
|
3778
|
+
type LightboxItem = {
|
|
3779
|
+
/** The large picture. The page's own grid or carousel keeps its small one. */
|
|
3780
|
+
src: string;
|
|
3781
|
+
/** What the picture shows: its accessible name, and read out when the viewer reaches it. */
|
|
3782
|
+
alt: string;
|
|
3783
|
+
/** Under the picture, two lines at most (the whole text is still read out). */
|
|
3784
|
+
caption?: ReactNode;
|
|
3785
|
+
/** The picture of the strip when `thumbnails` is set. Default `src`: the large picture, downloaded for it too. */
|
|
3786
|
+
thumbSrc?: string;
|
|
3787
|
+
};
|
|
3788
|
+
type LightboxProps = {
|
|
3789
|
+
/** The pictures, in order. */
|
|
3790
|
+
items: LightboxItem[];
|
|
3791
|
+
/** Whether the viewer is open. The page owns it: it opens the viewer, and closes it on `onOpenChange(false)`. */
|
|
3792
|
+
open: boolean;
|
|
3793
|
+
/** Called with `false` from the close button, Escape and a click on the dark around the picture. */
|
|
3794
|
+
onOpenChange: (open: boolean) => void;
|
|
3795
|
+
/** The picture shown (controlled). */
|
|
3796
|
+
index?: number;
|
|
3797
|
+
/** The picture shown first, while uncontrolled. Default 0. */
|
|
3798
|
+
defaultIndex?: number;
|
|
3799
|
+
/** Called with the picture moved to, by the arrows, the keys, the thumbnails and a swipe. */
|
|
3800
|
+
onIndexChange?: (index: number) => void;
|
|
3801
|
+
/** Draws a strip of thumbnails under the picture, from `sm` up. Default `false`. */
|
|
3802
|
+
thumbnails?: boolean;
|
|
3803
|
+
/** Accessible name of the viewer. Default "Picture viewer". */
|
|
3804
|
+
ariaLabel?: string;
|
|
3805
|
+
/** Default "Previous picture". */
|
|
3806
|
+
prevLabel?: string;
|
|
3807
|
+
/** Default "Next picture". */
|
|
3808
|
+
nextLabel?: string;
|
|
3809
|
+
/** Default "Close". */
|
|
3810
|
+
closeLabel?: string;
|
|
3811
|
+
/** What is read out when the picture changes, from the 1-based `position`. Default "Picture 3 of 12". */
|
|
3812
|
+
counterLabel?: (position: number, total: number) => string;
|
|
3813
|
+
/** Accessible name of the thumbnail strip. Default "Picture thumbnails". */
|
|
3814
|
+
thumbnailsLabel?: string;
|
|
3815
|
+
/** Accessible name of the thumbnail of the 1-based `position`. Default "Go to picture 3". */
|
|
3816
|
+
thumbnailLabel?: (position: number, total: number) => string;
|
|
3817
|
+
/** Shown when a picture can't be loaded. Default "This picture could not be loaded." */
|
|
3818
|
+
errorLabel?: string;
|
|
3819
|
+
/** The button that loads the picture again. Default "Try again". */
|
|
3820
|
+
retryLabel?: string;
|
|
3821
|
+
};
|
|
3822
|
+
/**
|
|
3823
|
+
* Lightbox: a fullscreen picture viewer, dark in every theme. A counter and the close button
|
|
3824
|
+
* on top, arrows on the sides (under the picture below `sm`), the caption at the bottom, and an
|
|
3825
|
+
* optional strip of thumbnails. The page opens it, usually from an `ImageGrid.Item` or a
|
|
3826
|
+
* `Carousel` slide (`onClick` sets `index` and `open`).
|
|
3827
|
+
*
|
|
3828
|
+
* It is a modal dialog: focus moves in and comes back to what opened it, Escape closes the top
|
|
3829
|
+
* overlay only (a viewer opened from a modal leaves the modal open), and the page behind stops
|
|
3830
|
+
* scrolling. The arrow keys, a swipe and the arrows move between pictures, never in a loop, and
|
|
3831
|
+
* follow the reading direction in right to left. The picture shown and its neighbours are loaded.
|
|
3832
|
+
*
|
|
3833
|
+
* Every text is a prop with an English default.
|
|
3834
|
+
*/
|
|
3835
|
+
declare const Lightbox: ({ items, open, onOpenChange, index, defaultIndex, onIndexChange, thumbnails, ariaLabel, prevLabel, nextLabel, closeLabel, counterLabel, thumbnailsLabel, thumbnailLabel, errorLabel, retryLabel, }: LightboxProps) => react.JSX.Element | null;
|
|
3836
|
+
|
|
3505
3837
|
type VideoEmbedAspect = '16:9' | '4:3' | '1:1' | '21:9' | (string & {});
|
|
3506
3838
|
type VideoEmbedProps = {
|
|
3507
3839
|
src: string;
|
|
@@ -3853,7 +4185,7 @@ type InputProps = Omit<ComponentPropsWithRef<'input'>, 'size'> & {
|
|
|
3853
4185
|
/** Attached suffix addon (e.g. `.com`, `kg`). Renders as a bordered group. */
|
|
3854
4186
|
suffix?: ReactNode;
|
|
3855
4187
|
};
|
|
3856
|
-
declare function Input({ label, description, error, success, size, required, icon: Icon, errorIcon, readOnly, endSlot, labelTrailing, prefix, suffix, className, id, ref, ...rest }: InputProps): react.JSX.Element;
|
|
4188
|
+
declare function Input({ label, description, error, success, size, required, icon: Icon, errorIcon, readOnly, endSlot, labelTrailing, prefix, suffix, className, id, ref, 'aria-describedby': describedBy, ...rest }: InputProps): react.JSX.Element;
|
|
3857
4189
|
|
|
3858
4190
|
/** Naming props shared by the bare controls that can sit in a FormRow. */
|
|
3859
4191
|
type FieldA11yProps = {
|
|
@@ -3954,7 +4286,7 @@ type SegmentOption<T extends string> = {
|
|
|
3954
4286
|
icon?: ElementType;
|
|
3955
4287
|
/**
|
|
3956
4288
|
* A count or short text in a small pill after the label. It is part of the radio's accessible
|
|
3957
|
-
* name ("Active 4").
|
|
4289
|
+
* name ("Active 4"). Not shown on an option that shows its icon alone (`iconOnly` and an `icon`).
|
|
3958
4290
|
*/
|
|
3959
4291
|
badge?: ReactNode;
|
|
3960
4292
|
};
|
|
@@ -3973,6 +4305,12 @@ type SegmentedControlProps<T extends string> = FieldA11yProps & {
|
|
|
3973
4305
|
appearance?: 'segments' | 'pills';
|
|
3974
4306
|
/** Height and text size: `md` (default) or the more compact `sm`. */
|
|
3975
4307
|
size?: 'sm' | 'md';
|
|
4308
|
+
/**
|
|
4309
|
+
* Draws each option as its `icon` alone, in a square segment: a grid / list switch. The `label`
|
|
4310
|
+
* stays the radio's accessible name, and shows as a tooltip on hover and keyboard focus. An
|
|
4311
|
+
* option with no `icon` keeps its text and its `badge`. Default `false`.
|
|
4312
|
+
*/
|
|
4313
|
+
iconOnly?: boolean;
|
|
3976
4314
|
/** Icon shown in a cell before the first option, for the whole group. */
|
|
3977
4315
|
icon?: ElementType;
|
|
3978
4316
|
/**
|
|
@@ -3987,7 +4325,7 @@ type SegmentedControlProps<T extends string> = FieldA11yProps & {
|
|
|
3987
4325
|
*/
|
|
3988
4326
|
ref?: Ref<HTMLButtonElement>;
|
|
3989
4327
|
};
|
|
3990
|
-
declare const SegmentedControl: <T extends string>({ options, value: valueProp, defaultValue, onChange, appearance, size, icon: GroupIcon, fullWidth, className, ref, ...a11y }: SegmentedControlProps<T>) => react.JSX.Element;
|
|
4328
|
+
declare const SegmentedControl: <T extends string>({ options, value: valueProp, defaultValue, onChange, appearance, size, iconOnly, icon: GroupIcon, fullWidth, className, ref, ...a11y }: SegmentedControlProps<T>) => react.JSX.Element;
|
|
3991
4329
|
|
|
3992
4330
|
type NumberInputProps = FieldA11yProps & {
|
|
3993
4331
|
name?: string;
|
|
@@ -3999,17 +4337,30 @@ type NumberInputProps = FieldA11yProps & {
|
|
|
3999
4337
|
min?: number;
|
|
4000
4338
|
max?: number;
|
|
4001
4339
|
step?: number;
|
|
4340
|
+
/** Text after the value, inside the border: `s`, `ms`, `kg`. */
|
|
4002
4341
|
unit?: string;
|
|
4342
|
+
/**
|
|
4343
|
+
* Text before the value, inside the border, as `unit` follows it: a currency sign (`$`, `€`),
|
|
4344
|
+
* a protocol. It sits on the start edge, so it moves to the right in right to left.
|
|
4345
|
+
*/
|
|
4346
|
+
prefix?: ReactNode;
|
|
4003
4347
|
/** Height and text size, aligned on Button's. Default `md`. */
|
|
4004
4348
|
size?: FieldSize;
|
|
4005
4349
|
/** Sets `aria-required` on the input. It has no label of its own to carry an asterisk. */
|
|
4006
4350
|
required?: boolean;
|
|
4351
|
+
/**
|
|
4352
|
+
* Marks the field invalid: a red border and `aria-invalid`. It carries no message: write it
|
|
4353
|
+
* under the field and point `aria-describedby` at it.
|
|
4354
|
+
*/
|
|
4355
|
+
error?: boolean;
|
|
4007
4356
|
/**
|
|
4008
4357
|
* Where the step buttons sit. `sides` (default): `−` / `+` on the outer edges,
|
|
4009
4358
|
* centered text. `stacked`: ↑ / ↓ arrows stacked in a column inside the end
|
|
4010
|
-
* edge, start-aligned text: the compact form for settings panels.
|
|
4359
|
+
* edge, start-aligned text: the compact form for settings panels. `none`: no
|
|
4360
|
+
* button, start-aligned text, for a price or an amount where a step of one means
|
|
4361
|
+
* nothing; the arrow keys of the field still step.
|
|
4011
4362
|
*/
|
|
4012
|
-
controls?: 'sides' | 'stacked';
|
|
4363
|
+
controls?: 'sides' | 'stacked' | 'none';
|
|
4013
4364
|
/** Tailwind width class for the inner input — default `w-20`. */
|
|
4014
4365
|
width?: string;
|
|
4015
4366
|
/**
|
|
@@ -4032,7 +4383,7 @@ type NumberInputProps = FieldA11yProps & {
|
|
|
4032
4383
|
* Typing can pass through an empty field or a value outside `min`…`max`;
|
|
4033
4384
|
* only valid values reach `onChange`, and leaving the field clamps.
|
|
4034
4385
|
*/
|
|
4035
|
-
declare const NumberInput: ({ value: valueProp, defaultValue, onChange, min, max, step, unit, size, required, controls, width, fullWidth, disabled, className, name, ref, ...a11y }: NumberInputProps) => react.JSX.Element;
|
|
4386
|
+
declare const NumberInput: ({ value: valueProp, defaultValue, onChange, min, max, step, unit, prefix, size, required, error, controls, width, fullWidth, disabled, className, name, ref, ...a11y }: NumberInputProps) => react.JSX.Element;
|
|
4036
4387
|
|
|
4037
4388
|
type ZoomBarProps = {
|
|
4038
4389
|
zoom: number;
|
|
@@ -4074,6 +4425,40 @@ type FormRowProps = {
|
|
|
4074
4425
|
*/
|
|
4075
4426
|
declare const FormRow: ({ label, description, tooltip, children, className }: FormRowProps) => react.JSX.Element;
|
|
4076
4427
|
|
|
4428
|
+
type ErrorSummaryItem = {
|
|
4429
|
+
/**
|
|
4430
|
+
* The `id` of the field, or of any box around it. The link focuses the field if that is the
|
|
4431
|
+
* field, else the first enabled control inside it (input, select, textarea or button).
|
|
4432
|
+
*/
|
|
4433
|
+
field: string;
|
|
4434
|
+
/** What the link says: the name of the field ("Booking URL"). */
|
|
4435
|
+
label: string;
|
|
4436
|
+
};
|
|
4437
|
+
type ErrorSummaryProps = {
|
|
4438
|
+
/** One entry per field in error, in the order of the page. Nothing is drawn for an empty list. */
|
|
4439
|
+
errors: ErrorSummaryItem[];
|
|
4440
|
+
/** Bold first line of the banner. Default "There is a problem". */
|
|
4441
|
+
title?: string;
|
|
4442
|
+
/**
|
|
4443
|
+
* The sentence under the title, for another language or another wording. It gets the number of
|
|
4444
|
+
* fields and a link to each, in order, and returns what to draw around them:
|
|
4445
|
+
* `(count, links) => <>Corrigez {count} champs : {links}.</>`. Default: "Fix 3 fields and try
|
|
4446
|
+
* again: A, B and C need attention." ("Fix 1 field and try again: A needs attention.").
|
|
4447
|
+
*/
|
|
4448
|
+
message?: (count: number, links: ReactNode[]) => ReactNode;
|
|
4449
|
+
className?: string;
|
|
4450
|
+
};
|
|
4451
|
+
/**
|
|
4452
|
+
* `ErrorSummary` — the banner a form shows when it could not be submitted: how many fields need
|
|
4453
|
+
* attention, and a link to each that moves the focus to it. Put it above the form, where it is
|
|
4454
|
+
* seen, and draw each field's own message under the field.
|
|
4455
|
+
*
|
|
4456
|
+
* <ErrorSummary errors={[{ field: 'booking-url', label: 'Booking URL' }]} />
|
|
4457
|
+
*
|
|
4458
|
+
* It is an `AlertBanner` in `danger`, so a screen reader announces it as it appears.
|
|
4459
|
+
*/
|
|
4460
|
+
declare const ErrorSummary: ({ errors, title, message, className, }: ErrorSummaryProps) => react.JSX.Element | null;
|
|
4461
|
+
|
|
4077
4462
|
type AvatarUploaderSize = 'md' | 'lg';
|
|
4078
4463
|
type AvatarUploaderProps = {
|
|
4079
4464
|
/** Current avatar URL (data URL or http). null/undefined → initials fallback. */
|
|
@@ -4117,18 +4502,165 @@ type PasswordRule = {
|
|
|
4117
4502
|
label: string;
|
|
4118
4503
|
ok: boolean;
|
|
4119
4504
|
};
|
|
4505
|
+
/** What a screen reader hears after each rule, since the tick and the cross are drawn. */
|
|
4506
|
+
type PasswordPolicyLabels = {
|
|
4507
|
+
/** Default "met". */
|
|
4508
|
+
met?: string;
|
|
4509
|
+
/** Default "not met". */
|
|
4510
|
+
notMet?: string;
|
|
4511
|
+
};
|
|
4120
4512
|
type PasswordPolicyCheckerProps = {
|
|
4121
4513
|
rules: PasswordRule[];
|
|
4122
4514
|
/** Title shown above the rules list. Pass `null` to hide it. */
|
|
4123
4515
|
title?: string | null;
|
|
4516
|
+
/**
|
|
4517
|
+
* The words said after each rule's label for a screen reader only ("At least 12 characters, not
|
|
4518
|
+
* met"), to translate with the rest of the page.
|
|
4519
|
+
*/
|
|
4520
|
+
labels?: PasswordPolicyLabels;
|
|
4521
|
+
className?: string;
|
|
4522
|
+
};
|
|
4523
|
+
declare const PasswordPolicyChecker: ({ rules, title, labels, className, }: PasswordPolicyCheckerProps) => react.JSX.Element;
|
|
4524
|
+
/**
|
|
4525
|
+
* Sensible default password policy. Override per-app if stricter/looser
|
|
4526
|
+
* rules are needed (i18n, custom min length, blocklists, …).
|
|
4527
|
+
*/
|
|
4528
|
+
declare const defaultPasswordRules: (pwd: string) => PasswordRule[];
|
|
4529
|
+
|
|
4530
|
+
/** The five levels a score of 0 to 4 stands for, from the weakest. */
|
|
4531
|
+
type PasswordStrengthLevels = readonly [string, string, string, string, string];
|
|
4532
|
+
type PasswordStrengthLabels = {
|
|
4533
|
+
/** The words before the level, in the visible text and in the announcement. Default "Password strength". */
|
|
4534
|
+
name?: string;
|
|
4535
|
+
/** The level for each score, 0 to 4. Default "Very weak", "Weak", "Fair", "Good", "Strong". */
|
|
4536
|
+
levels?: PasswordStrengthLevels;
|
|
4537
|
+
};
|
|
4538
|
+
type PasswordStrengthMeterProps = {
|
|
4539
|
+
/**
|
|
4540
|
+
* How strong the password is, from 0 to 4 (zxcvbn's scale). Cosmos bundles no estimator: the
|
|
4541
|
+
* page works the score out. A value outside the range is held to it and rounded.
|
|
4542
|
+
*/
|
|
4543
|
+
score: number;
|
|
4544
|
+
/**
|
|
4545
|
+
* Id of the visible text ("Password strength: Fair"). Point the field's `aria-describedby` at
|
|
4546
|
+
* it so the level is read when the field gets focus. Generated when omitted.
|
|
4547
|
+
*/
|
|
4548
|
+
id?: string;
|
|
4549
|
+
/** The words, to translate with the rest of the page. */
|
|
4550
|
+
labels?: PasswordStrengthLabels;
|
|
4551
|
+
className?: string;
|
|
4552
|
+
};
|
|
4553
|
+
/**
|
|
4554
|
+
* A strength gauge for a password field: the level in words, and a bar of four segments with as
|
|
4555
|
+
* many lit as the score (the segments of `ProgressBar`). It draws what the page works out and bundles no estimator.
|
|
4556
|
+
*
|
|
4557
|
+
* The bar is decoration (`aria-hidden`); the text says the level. A polite status announces a new
|
|
4558
|
+
* level once the score has held for 800 ms, so a screen reader is not read to on every key, and
|
|
4559
|
+
* says nothing when the meter first shows.
|
|
4560
|
+
*/
|
|
4561
|
+
declare const PasswordStrengthMeter: ({ score, id, labels, className, }: PasswordStrengthMeterProps) => react.JSX.Element;
|
|
4562
|
+
|
|
4563
|
+
/** A column: an action (view, edit…) or a role. */
|
|
4564
|
+
type PermissionGridColumn = {
|
|
4565
|
+
id: string;
|
|
4566
|
+
/** Names the column, and is read as part of the name of each of its cells. */
|
|
4567
|
+
label: string;
|
|
4568
|
+
/**
|
|
4569
|
+
* A column nobody can edit, such as a built-in role. Its cells show what is granted as an icon
|
|
4570
|
+
* and a text for the screen reader, and its box in the header is left out.
|
|
4571
|
+
*/
|
|
4572
|
+
readOnly?: boolean;
|
|
4573
|
+
};
|
|
4574
|
+
/** A permission: one row of the grid. */
|
|
4575
|
+
type PermissionGridRow = {
|
|
4576
|
+
id: string;
|
|
4577
|
+
/** Names the row, and is read as part of the name of each of its cells. */
|
|
4578
|
+
label: string;
|
|
4579
|
+
/**
|
|
4580
|
+
* The ids of the columns this permission applies to. A column that is not listed has an empty
|
|
4581
|
+
* cell that no one can grant, and that no count includes. Omitted: every column.
|
|
4582
|
+
*/
|
|
4583
|
+
columns?: string[];
|
|
4584
|
+
};
|
|
4585
|
+
/** An area of permissions: a header row over its permissions. */
|
|
4586
|
+
type PermissionGridGroup = {
|
|
4587
|
+
id: string;
|
|
4588
|
+
label: string;
|
|
4589
|
+
rows: PermissionGridRow[];
|
|
4590
|
+
};
|
|
4591
|
+
/**
|
|
4592
|
+
* The key of a cell in the grid's `value`: the id of the row, a colon and the id of the column.
|
|
4593
|
+
* To build a `defaultValue`, or to read a granted cell back.
|
|
4594
|
+
*/
|
|
4595
|
+
declare const cellKey: (rowId: string, columnId: string) => string;
|
|
4596
|
+
/** Every text the grid writes itself, to translate or reword. */
|
|
4597
|
+
type PermissionGridLabels = {
|
|
4598
|
+
/** The header over the first column. Default `Permission`. */
|
|
4599
|
+
rowHeader: string;
|
|
4600
|
+
/** Name of the box in the corner, which selects every cell. Default `Select all`. */
|
|
4601
|
+
selectAll: string;
|
|
4602
|
+
/** Name of the box of a row, a column or a group. Default `Select all for <label>`. */
|
|
4603
|
+
selectAllFor: (label: string) => string;
|
|
4604
|
+
/** Name of the box of one cell. Default `<row>, <column>`, e.g. `Edit invoices, Admin`. */
|
|
4605
|
+
cell: (row: string, column: string) => string;
|
|
4606
|
+
/** What a read-only cell says, in place of a box. Default `<cell>: granted, read-only`. */
|
|
4607
|
+
readOnlyCell: (cell: string, granted: boolean) => string;
|
|
4608
|
+
/** What an empty cell, a column the row does not apply to, says. Default `<cell>: not applicable`. */
|
|
4609
|
+
notApplicable: (cell: string) => string;
|
|
4610
|
+
/** Read after the name of a read-only column. Default `Read-only`. */
|
|
4611
|
+
readOnlyColumn: string;
|
|
4612
|
+
/** Announced after a box that selects several cells. Default `8 of 26 permissions granted`. */
|
|
4613
|
+
summary: (granted: number, total: number) => string;
|
|
4614
|
+
};
|
|
4615
|
+
|
|
4616
|
+
type PermissionGridProps = {
|
|
4617
|
+
/** The permissions, grouped by area: a header row per group, then one row per permission. */
|
|
4618
|
+
groups: PermissionGridGroup[];
|
|
4619
|
+
/** What the permissions are granted for: actions (view, edit, delete) or roles. */
|
|
4620
|
+
columns: PermissionGridColumn[];
|
|
4621
|
+
/**
|
|
4622
|
+
* The granted cells, as `cellKey(rowId, columnId)` keys: the row id, a colon and the column id.
|
|
4623
|
+
* With `defaultValue` and `onChange(value)`, as for every control. Keys the grid does not own (a
|
|
4624
|
+
* read-only column's grants, a cell that does not apply) are kept as they are.
|
|
4625
|
+
*/
|
|
4626
|
+
value?: string[];
|
|
4627
|
+
defaultValue?: string[];
|
|
4628
|
+
onChange?: (value: string[]) => void;
|
|
4629
|
+
/**
|
|
4630
|
+
* Nobody can change anything: every cell shows what is granted as an icon, with a text for the
|
|
4631
|
+
* screen reader, and no box is drawn. A single column is read-only with `column.readOnly`.
|
|
4632
|
+
*/
|
|
4633
|
+
readOnly?: boolean;
|
|
4634
|
+
/** What is wrong ("Grant at least one permission"), written under the grid and read with it. */
|
|
4635
|
+
error?: string;
|
|
4636
|
+
/** Replaces the texts the grid writes itself, e.g. for another language. */
|
|
4637
|
+
labels?: Partial<PermissionGridLabels>;
|
|
4638
|
+
/** Accessible name of the grid. */
|
|
4639
|
+
ariaLabel: string;
|
|
4640
|
+
/**
|
|
4641
|
+
* Height past which the grid scrolls vertically, its header row staying in view. The grid
|
|
4642
|
+
* always scrolls sideways in its own box when the columns do not fit, its first column staying
|
|
4643
|
+
* in view.
|
|
4644
|
+
*/
|
|
4645
|
+
maxHeight?: number | string;
|
|
4124
4646
|
className?: string;
|
|
4125
4647
|
};
|
|
4126
|
-
declare const PasswordPolicyChecker: ({ rules, title, className, }: PasswordPolicyCheckerProps) => react.JSX.Element;
|
|
4127
4648
|
/**
|
|
4128
|
-
*
|
|
4129
|
-
*
|
|
4649
|
+
* PermissionGrid — permissions grouped by area down the side, actions or roles across the top, a
|
|
4650
|
+
* checkbox in each cell: the editor of a role, or the matrix of roles against permissions.
|
|
4651
|
+
*
|
|
4652
|
+
* There is a box per row (first column), per column (header), per group (its header row) and one
|
|
4653
|
+
* for the whole grid (the corner). Each shows `indeterminate` when it covers some granted cells
|
|
4654
|
+
* and not all, and a click on a mixed box grants everything, then clears. Cells that do not apply
|
|
4655
|
+
* to a row, and cells that are read-only, are left out of every box and of the counts.
|
|
4656
|
+
*
|
|
4657
|
+
* It is a `role="grid"`, not a table of checkboxes: one Tab stop, then arrows, Home and End,
|
|
4658
|
+
* Ctrl+Home and Ctrl+End move between cells (and Space toggles the box in focus). After a box
|
|
4659
|
+
* that selects several cells, a polite status says how many permissions are granted; a single
|
|
4660
|
+
* cell says nothing. The header row and the first column stay in view while the grid scrolls,
|
|
4661
|
+
* also at 375px, where it scrolls inside its own frame.
|
|
4130
4662
|
*/
|
|
4131
|
-
declare const
|
|
4663
|
+
declare const PermissionGrid: ({ groups, columns, value, defaultValue, onChange, readOnly, error, labels: labelOverrides, ariaLabel, maxHeight, className, }: PermissionGridProps) => react.JSX.Element;
|
|
4132
4664
|
|
|
4133
4665
|
type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both';
|
|
4134
4666
|
type TextareaProps = ComponentPropsWithRef<'textarea'> & {
|
|
@@ -4374,6 +4906,16 @@ type DateRange = {
|
|
|
4374
4906
|
to: Date | undefined;
|
|
4375
4907
|
};
|
|
4376
4908
|
type DatePickerMode = 'single' | 'range';
|
|
4909
|
+
/** A button of the range picker that sets the range in one click. */
|
|
4910
|
+
type DateRangePreset = {
|
|
4911
|
+
/** The text of the button: "Last 7 days". */
|
|
4912
|
+
label: string;
|
|
4913
|
+
/**
|
|
4914
|
+
* The range it sets: fixed, or a function of today (see `today`) for one that moves with the
|
|
4915
|
+
* date: `(today) => ({ from: subDays(today, 6), to: today })`.
|
|
4916
|
+
*/
|
|
4917
|
+
range: DateRange | ((today: Date) => DateRange);
|
|
4918
|
+
};
|
|
4377
4919
|
type SingleProps = {
|
|
4378
4920
|
mode?: 'single';
|
|
4379
4921
|
value?: Date;
|
|
@@ -4386,11 +4928,30 @@ type RangeProps = {
|
|
|
4386
4928
|
mode: 'range';
|
|
4387
4929
|
value?: DateRange;
|
|
4388
4930
|
defaultValue?: DateRange;
|
|
4931
|
+
/** Called with the range. After the first day picked in the calendar `to` is `undefined`. */
|
|
4389
4932
|
onChange?: (range: DateRange) => void;
|
|
4390
4933
|
/** Placeholder for the FROM trigger. */
|
|
4391
4934
|
fromPlaceholder?: string;
|
|
4392
4935
|
/** Placeholder for the TO trigger. */
|
|
4393
4936
|
toPlaceholder?: string;
|
|
4937
|
+
/**
|
|
4938
|
+
* Buttons beside the calendar that set the range in one click ("Last 7 days", "This month").
|
|
4939
|
+
* Picking one sets the range, as picking its two days would, and closes the calendar. The one
|
|
4940
|
+
* whose days are the current range is marked `aria-current`, and one that falls outside `fromDate` or
|
|
4941
|
+
* `toDate` is disabled. Below `sm` they sit under the calendar and wrap; from `sm` up they
|
|
4942
|
+
* are a column at its end, after it in the tab order at every width.
|
|
4943
|
+
*/
|
|
4944
|
+
presets?: DateRangePreset[];
|
|
4945
|
+
/**
|
|
4946
|
+
* The name of the group of `presets`, for assistive technology, to translate with the rest of
|
|
4947
|
+
* the page. Default "Date range presets".
|
|
4948
|
+
*/
|
|
4949
|
+
presetsLabel?: string;
|
|
4950
|
+
/**
|
|
4951
|
+
* The date `presets` count from, and the one the calendar marks as today. Default now. Pass a
|
|
4952
|
+
* fixed date to test the dates a preset makes. A preset gets it at the start of its day.
|
|
4953
|
+
*/
|
|
4954
|
+
today?: Date;
|
|
4394
4955
|
};
|
|
4395
4956
|
type CommonProps = {
|
|
4396
4957
|
label?: string;
|
|
@@ -4536,15 +5097,44 @@ type ComboboxOption = {
|
|
|
4536
5097
|
};
|
|
4537
5098
|
type ComboboxProps = {
|
|
4538
5099
|
label?: ReactNode;
|
|
4539
|
-
/**
|
|
5100
|
+
/**
|
|
5101
|
+
* Names the input when there is no visible `label`, as for a field in a table row or a grid
|
|
5102
|
+
* of lines. A `label` wins: the name is the one on screen.
|
|
5103
|
+
*/
|
|
5104
|
+
'aria-label'?: string;
|
|
5105
|
+
/**
|
|
5106
|
+
* Selected option value, when controlled. With `allowCustomValue` it is also any text the
|
|
5107
|
+
* host holds as the value.
|
|
5108
|
+
*/
|
|
4540
5109
|
value?: string;
|
|
4541
5110
|
/** Initial option value, when uncontrolled. None selected when omitted. */
|
|
4542
5111
|
defaultValue?: string;
|
|
4543
|
-
/**
|
|
5112
|
+
/**
|
|
5113
|
+
* Called when the user picks an option, with its `value`. With `allowCustomValue` it is also
|
|
5114
|
+
* called on every keystroke, with the text typed.
|
|
5115
|
+
*/
|
|
4544
5116
|
onChange?: (value: string) => void;
|
|
5117
|
+
/**
|
|
5118
|
+
* Called with the option the user picks (a click, or Enter on the active option). Typed text
|
|
5119
|
+
* never fires it, which is how `allowCustomValue` tells a pick from typing.
|
|
5120
|
+
*/
|
|
5121
|
+
onSelect?: (option: ComboboxOption) => void;
|
|
5122
|
+
/**
|
|
5123
|
+
* Accepts the text typed as the value, when no option is picked: a field that suggests a
|
|
5124
|
+
* catalogue and lets the user write their own entry. The text is the value (`onChange` fires on
|
|
5125
|
+
* every keystroke) and stays in the field when focus leaves. Nothing is active until an arrow
|
|
5126
|
+
* key moves there, so Enter keeps the text and lets an enclosing form submit; the list closes
|
|
5127
|
+
* when no option matches, unless `emptyMessage` is set. Keep the `value` of the options out of
|
|
5128
|
+
* what people type: a text equal to one names that option. Default `false`: the typed text is
|
|
5129
|
+
* only a filter, and the field goes back to the selected option when focus leaves.
|
|
5130
|
+
*/
|
|
5131
|
+
allowCustomValue?: boolean;
|
|
4545
5132
|
options: ComboboxOption[];
|
|
4546
5133
|
placeholder?: string;
|
|
4547
|
-
/**
|
|
5134
|
+
/**
|
|
5135
|
+
* Show this when no option matches the typed query. Default "No matches found."; none with
|
|
5136
|
+
* `allowCustomValue`, where the text is accepted and the empty list stays closed.
|
|
5137
|
+
*/
|
|
4548
5138
|
emptyMessage?: string;
|
|
4549
5139
|
/** Disable the input + dropdown. */
|
|
4550
5140
|
disabled?: boolean;
|
|
@@ -4566,7 +5156,126 @@ type ComboboxProps = {
|
|
|
4566
5156
|
/** Called with the open state to move to. */
|
|
4567
5157
|
onOpenChange?: (open: boolean) => void;
|
|
4568
5158
|
};
|
|
4569
|
-
declare const Combobox: ({ label, value: valueProp, defaultValue, onChange, options, placeholder, emptyMessage, disabled, helperText, error, size, required, className, ref, open: openProp, defaultOpen, onOpenChange, }: ComboboxProps) => react.JSX.Element;
|
|
5159
|
+
declare const Combobox: ({ label, "aria-label": ariaLabel, value: valueProp, defaultValue, onChange, onSelect, allowCustomValue, options, placeholder, emptyMessage, disabled, helperText, error, size, required, className, ref, open: openProp, defaultOpen, onOpenChange, }: ComboboxProps) => react.JSX.Element;
|
|
5160
|
+
|
|
5161
|
+
/** One line of an invoice or an order. `quantity` and `rate` are numbers, `rate` in units. */
|
|
5162
|
+
type LineItem = {
|
|
5163
|
+
/** Identifies the line across edits and removals: the key of its row and of its `errors`. */
|
|
5164
|
+
id: string;
|
|
5165
|
+
/** What is sold: free text, or the label of a catalogue entry. */
|
|
5166
|
+
item: string;
|
|
5167
|
+
quantity: number;
|
|
5168
|
+
/** Price of one unit, in units of the currency (`24.5`, not 2450 cents). */
|
|
5169
|
+
rate: number;
|
|
5170
|
+
};
|
|
5171
|
+
/** What the lines add up to: given to a page that draws the total itself. */
|
|
5172
|
+
type LineItemsSummary = {
|
|
5173
|
+
/** The sum of the amounts shown, each rounded to the minor unit of the currency. */
|
|
5174
|
+
subtotal: number;
|
|
5175
|
+
};
|
|
5176
|
+
/**
|
|
5177
|
+
* The summary of `lines` as the editor reports it to `onChange`, for a page that holds lines it
|
|
5178
|
+
* did not just receive (a draft loaded from a server) and shows the total outside the editor.
|
|
5179
|
+
*/
|
|
5180
|
+
declare const summarizeLineItems: (lines: readonly Pick<LineItem, "quantity" | "rate">[], { currency, locale }?: {
|
|
5181
|
+
currency?: string;
|
|
5182
|
+
locale?: string;
|
|
5183
|
+
}) => LineItemsSummary;
|
|
5184
|
+
|
|
5185
|
+
/** Error messages of one line, by cell. A cell with a message is marked invalid and describes it. */
|
|
5186
|
+
type LineItemErrors = {
|
|
5187
|
+
item?: string;
|
|
5188
|
+
quantity?: string;
|
|
5189
|
+
rate?: string;
|
|
5190
|
+
};
|
|
5191
|
+
/** An entry of the catalogue the item field suggests. */
|
|
5192
|
+
type LineItemsCatalogueEntry = {
|
|
5193
|
+
/** What the line says once picked, and what the field suggests. Keep the labels unique. */
|
|
5194
|
+
label: string;
|
|
5195
|
+
/** Unit price, in units of the currency: shown in the list, and copied to the line when picked. */
|
|
5196
|
+
rate?: number;
|
|
5197
|
+
};
|
|
5198
|
+
/** The words of the editor, for another language. Every one has an English default. */
|
|
5199
|
+
type LineItemsLabels = {
|
|
5200
|
+
/** Column titles, and the names of the fields ("Quantity, line 2"). */
|
|
5201
|
+
item: string;
|
|
5202
|
+
quantity: string;
|
|
5203
|
+
rate: string;
|
|
5204
|
+
amount: string;
|
|
5205
|
+
/** Placeholder of the item field. Default: "Select or type an item" with a catalogue, else "Describe the item". */
|
|
5206
|
+
itemPlaceholder?: string;
|
|
5207
|
+
add: string;
|
|
5208
|
+
/** The row of the default totals block. */
|
|
5209
|
+
subtotal: string;
|
|
5210
|
+
emptyTitle: string;
|
|
5211
|
+
emptyDescription: string;
|
|
5212
|
+
/** The title of a line in the stacked layout. */
|
|
5213
|
+
line: (n: number) => string;
|
|
5214
|
+
/** The name of the field of `column` on line `n`. */
|
|
5215
|
+
fieldName: (column: string, n: number) => string;
|
|
5216
|
+
/** The name of the remove button of line `n`, whose item is `item` (possibly empty). */
|
|
5217
|
+
remove: (n: number, item: string) => string;
|
|
5218
|
+
/** Announced once line `n` is added, with the number of lines now. */
|
|
5219
|
+
added: (n: number, count: number) => string;
|
|
5220
|
+
/** Announced once line `n` is removed, with the number of lines left. */
|
|
5221
|
+
removed: (n: number, count: number) => string;
|
|
5222
|
+
/** Announced when a cell is committed and the subtotal changed. `amount` is written. */
|
|
5223
|
+
subtotalAnnouncement: (amount: string) => string;
|
|
5224
|
+
};
|
|
5225
|
+
type LineItemsEditorProps = Omit<ComponentPropsWithRef<'div'>, 'children' | 'onChange' | 'defaultValue'> & {
|
|
5226
|
+
/** The lines, when controlled. An empty list is `[]`: only `undefined` means uncontrolled. */
|
|
5227
|
+
value?: LineItem[];
|
|
5228
|
+
/** The lines to start from, when uncontrolled. Default none: the empty state. */
|
|
5229
|
+
defaultValue?: LineItem[];
|
|
5230
|
+
/**
|
|
5231
|
+
* Called with the lines after every edit (a keystroke, a pick, a line added or removed) and
|
|
5232
|
+
* what they add up to, for a page that shows the total itself (`footer={false}`).
|
|
5233
|
+
*/
|
|
5234
|
+
onChange?: (lines: LineItem[], summary: LineItemsSummary) => void;
|
|
5235
|
+
/** ISO 4217 code (`'EUR'`) of the rates and the amounts. Without it, they are plain numbers. */
|
|
5236
|
+
currency?: string;
|
|
5237
|
+
/** BCP 47 locale of the figures. Default: the user's. Pass it when the page is in one. */
|
|
5238
|
+
locale?: string;
|
|
5239
|
+
/**
|
|
5240
|
+
* Entries the item field suggests: it becomes a `Combobox` that also takes what the user types,
|
|
5241
|
+
* and picking an entry copies its `rate` to the line. Without a catalogue, a plain text field.
|
|
5242
|
+
*/
|
|
5243
|
+
catalogue?: LineItemsCatalogueEntry[];
|
|
5244
|
+
/** Bounds of the quantity: `min` (default 1) and `step` (default 1). `{ min: 0.5, step: 0.5 }` for hours. */
|
|
5245
|
+
quantity?: {
|
|
5246
|
+
min?: number;
|
|
5247
|
+
step?: number;
|
|
5248
|
+
};
|
|
5249
|
+
/** Messages of the cells, by line `id`. */
|
|
5250
|
+
errors?: Record<string, LineItemErrors>;
|
|
5251
|
+
/** A message about the editor as a whole ("Add at least one line"), under the lines. */
|
|
5252
|
+
error?: string;
|
|
5253
|
+
/**
|
|
5254
|
+
* Rows added to the totals block under the lines, after the subtotal: `Totals.Row` and
|
|
5255
|
+
* `Totals.Total` for tax, a discount, the total due. They take the editor's currency and
|
|
5256
|
+
* locale. `false` draws no block, for a page that shows the summary elsewhere and reads it from
|
|
5257
|
+
* `onChange`. The block is hidden while there is no line.
|
|
5258
|
+
*/
|
|
5259
|
+
footer?: false | ((summary: LineItemsSummary) => ReactNode);
|
|
5260
|
+
/** Shows the lines as text, with no field, no "Add line" and no remove button. */
|
|
5261
|
+
readOnly?: boolean;
|
|
5262
|
+
labels?: Partial<LineItemsLabels>;
|
|
5263
|
+
};
|
|
5264
|
+
/**
|
|
5265
|
+
* LineItemsEditor — the lines of an invoice or an order: an item (free text, or picked from a
|
|
5266
|
+
* catalogue), a quantity, a rate, and the amount worked out from them, with lines added and
|
|
5267
|
+
* removed, and the subtotal under them. From 42rem of its own width the lines are a grid with
|
|
5268
|
+
* the amounts aligned in a column; below, each line is a stacked card.
|
|
5269
|
+
*
|
|
5270
|
+
* Each amount is rounded to the minor unit of the currency, then the amounts shown are added up,
|
|
5271
|
+
* so the subtotal is always what the rows say. Enter in a field does not add a line (it submits
|
|
5272
|
+
* the form around, or picks the option of the list): "Add line" is one Tab after the last field.
|
|
5273
|
+
* A removed line hands the focus to the remove button of the line that took its place, the one
|
|
5274
|
+
* of the new last line when it was the last, or "Add line" when none is left. A polite status
|
|
5275
|
+
* announces a line added or removed, and the subtotal once a cell is committed (focus leaves it,
|
|
5276
|
+
* or Enter), never on each keystroke.
|
|
5277
|
+
*/
|
|
5278
|
+
declare const LineItemsEditor: ({ value: valueProp, defaultValue, onChange, currency, locale, catalogue, quantity, errors, error, footer, readOnly, labels: labelsProp, className, ref, ...rest }: LineItemsEditorProps) => react.JSX.Element;
|
|
4570
5279
|
|
|
4571
5280
|
/** An option of a `MultiSelect`: the shape of a `Combobox` option. */
|
|
4572
5281
|
type MultiSelectOption = ComboboxOption;
|
|
@@ -4823,6 +5532,164 @@ type PhoneInputProps = FieldA11yProps & {
|
|
|
4823
5532
|
*/
|
|
4824
5533
|
declare const PhoneInput: ({ label, description, error, size, required, value: valueProp, defaultValue, onChange, defaultCountry, countries, format, validate, placeholder, disabled, className, ref, ...a11y }: PhoneInputProps) => react.JSX.Element;
|
|
4825
5534
|
|
|
5535
|
+
type CardBrand = 'visa' | 'mastercard' | 'amex' | 'discover' | 'diners' | 'jcb' | 'unionpay';
|
|
5536
|
+
/**
|
|
5537
|
+
* The brand a card number belongs to, from its leading digits, or `null` while they do not tell yet
|
|
5538
|
+
* (a lone 5 is a Mastercard only from 51 to 55) or no brand has the prefix. Reads a number as it is
|
|
5539
|
+
* shown, spaces and dashes included.
|
|
5540
|
+
*/
|
|
5541
|
+
declare const cardBrand: (number: string) => CardBrand | null;
|
|
5542
|
+
/** The numbers of digits the brand issues; 12 to 19 while the brand is `null`. */
|
|
5543
|
+
declare const cardNumberLengths: (brand: CardBrand | null) => readonly number[];
|
|
5544
|
+
/** Digits of the security code: 4 for Amex, 3 for every other brand and while there is none. */
|
|
5545
|
+
declare const cardCvcLength: (brand: CardBrand | null) => 3 | 4;
|
|
5546
|
+
/**
|
|
5547
|
+
* The Luhn checksum of a card number (spaces and dashes are ignored; any other character, or a
|
|
5548
|
+
* single digit, fails). It catches a mistyped digit, not a card that does not exist. Some UnionPay
|
|
5549
|
+
* numbers are issued without the checksum.
|
|
5550
|
+
*/
|
|
5551
|
+
declare const luhnValid: (number: string) => boolean;
|
|
5552
|
+
/**
|
|
5553
|
+
* Whether an expiry (`MMYY`, or as it is shown, `MM / YY`) is a real month that is not over: a
|
|
5554
|
+
* card holds through the end of the month it names. The year is read in `today`'s century. A date
|
|
5555
|
+
* far in the future passes: the page may add a horizon of its own. `today` is the date to compare
|
|
5556
|
+
* with, for a test; it defaults to now.
|
|
5557
|
+
*/
|
|
5558
|
+
declare const expiryValid: (expiry: string, today?: Date) => boolean;
|
|
5559
|
+
|
|
5560
|
+
type CardInputAttributes = Omit<ComponentPropsWithRef<'input'>, 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'inputMode' | 'autoComplete' | 'className' | 'children'>;
|
|
5561
|
+
type CardFieldProps = CardInputAttributes & {
|
|
5562
|
+
label?: string;
|
|
5563
|
+
/** Helper text under the field. */
|
|
5564
|
+
description?: string;
|
|
5565
|
+
/** Error message, replaces `description`. The page decides when and with which words. */
|
|
5566
|
+
error?: string;
|
|
5567
|
+
/** Height and text size, aligned on Button's. Default `md`. */
|
|
5568
|
+
size?: FieldSize;
|
|
5569
|
+
/** Marks the field required: an asterisk after the label, `required` and `aria-required` on the input. */
|
|
5570
|
+
required?: boolean;
|
|
5571
|
+
/** Slot rendered next to the label text (e.g. a TooltipHelp). */
|
|
5572
|
+
labelTrailing?: ReactNode;
|
|
5573
|
+
/** Merged on the wrapper. */
|
|
5574
|
+
className?: string;
|
|
5575
|
+
};
|
|
5576
|
+
|
|
5577
|
+
type CardNumberInputProps = CardFieldProps & {
|
|
5578
|
+
/** The card number as digits only (`4111111111111111`), when controlled. `''` is none. */
|
|
5579
|
+
value?: string;
|
|
5580
|
+
/** Initial number, when uncontrolled. Empty when omitted. */
|
|
5581
|
+
defaultValue?: string;
|
|
5582
|
+
/**
|
|
5583
|
+
* Called with the digits only, however the number is grouped on screen. It is not checked: the
|
|
5584
|
+
* length for the brand and the Luhn checksum are `cardNumberLengths` and `luhnValid`, the page
|
|
5585
|
+
* calls them when it chooses to.
|
|
5586
|
+
*/
|
|
5587
|
+
onChange?: (digits: string) => void;
|
|
5588
|
+
/**
|
|
5589
|
+
* Called with the brand the leading digits point to (`'visa'`, `'amex'`…) and with `null` when
|
|
5590
|
+
* they no longer do. Fires once on mount when the initial number has a brand.
|
|
5591
|
+
*/
|
|
5592
|
+
onBrandChange?: (brand: CardBrand | null) => void;
|
|
5593
|
+
};
|
|
5594
|
+
/**
|
|
5595
|
+
* CardNumberInput — the number of a payment card. Digits are grouped as they are typed (4-4-4-4,
|
|
5596
|
+
* an Amex 4-6-5) with the caret kept where it was, a pasted number with spaces or dashes is
|
|
5597
|
+
* accepted, and the brand the leading digits point to shows as text in a pill at the end of the
|
|
5598
|
+
* field. No `name` is set, so a plain form post never carries the number: pass one if you mean it.
|
|
5599
|
+
* Cosmos handles no real card data: a real checkout uses its payment provider's hosted fields.
|
|
5600
|
+
*/
|
|
5601
|
+
declare const CardNumberInput: ({ value: valueProp, defaultValue, onChange, onBrandChange, size, placeholder, ...rest }: CardNumberInputProps) => react.JSX.Element;
|
|
5602
|
+
|
|
5603
|
+
type CardExpiryInputProps = CardFieldProps & {
|
|
5604
|
+
/** The expiry as `MMYY` (`'1228'` for December 2028), when controlled. `''` is none. */
|
|
5605
|
+
value?: string;
|
|
5606
|
+
/** Initial expiry, when uncontrolled. Empty when omitted. */
|
|
5607
|
+
defaultValue?: string;
|
|
5608
|
+
/**
|
|
5609
|
+
* Called with `MMYY`, a partial one while it is typed. It is not checked: a month that exists
|
|
5610
|
+
* and is not over is `expiryValid`, the page calls it when it chooses to.
|
|
5611
|
+
*/
|
|
5612
|
+
onChange?: (value: string) => void;
|
|
5613
|
+
};
|
|
5614
|
+
/**
|
|
5615
|
+
* CardExpiryInput — the expiry date of a payment card, shown as `MM / YY` while the value is
|
|
5616
|
+
* `MMYY`. A first digit from 2 to 9 becomes the month 02 to 09, Backspace takes the separator and
|
|
5617
|
+
* the digit before it together, and a pasted `12/2028` or `12 / 28` is accepted. No `name` is set,
|
|
5618
|
+
* so a plain form post never carries the date: pass one if you mean it.
|
|
5619
|
+
*/
|
|
5620
|
+
declare const CardExpiryInput: ({ value: valueProp, defaultValue, onChange, placeholder, ...rest }: CardExpiryInputProps) => react.JSX.Element;
|
|
5621
|
+
|
|
5622
|
+
type CardCvcInputProps = CardFieldProps & {
|
|
5623
|
+
/** The security code as digits, when controlled. `''` is none. */
|
|
5624
|
+
value?: string;
|
|
5625
|
+
/** Initial code, when uncontrolled. Empty when omitted. */
|
|
5626
|
+
defaultValue?: string;
|
|
5627
|
+
/**
|
|
5628
|
+
* Called with the digits. It is not checked: the code is complete at `cardCvcLength(brand)`
|
|
5629
|
+
* digits, the page compares them when it chooses to.
|
|
5630
|
+
*/
|
|
5631
|
+
onChange?: (value: string) => void;
|
|
5632
|
+
/**
|
|
5633
|
+
* The brand the code belongs to: 4 digits for `'amex'`, 3 for any other brand and for `null`.
|
|
5634
|
+
* Inside a CardFields group it follows the group's number, and a `brand` set here wins.
|
|
5635
|
+
*/
|
|
5636
|
+
brand?: CardBrand | null;
|
|
5637
|
+
};
|
|
5638
|
+
/**
|
|
5639
|
+
* CardCvcInput — the security code of a payment card (CVC, CVV, CID): digits only, 3 of them, or 4
|
|
5640
|
+
* for an Amex. A code longer than its brand allows is cut when the brand turns up, and `onChange`
|
|
5641
|
+
* is called with the shorter one. No `name` is set, so a plain form post never carries the code:
|
|
5642
|
+
* pass one if you mean it.
|
|
5643
|
+
*/
|
|
5644
|
+
declare const CardCvcInput: ({ value: valueProp, defaultValue, onChange, brand: brandProp, placeholder, ...rest }: CardCvcInputProps) => react.JSX.Element;
|
|
5645
|
+
|
|
5646
|
+
/** What a card group holds: the number as digits, the expiry as `MMYY`, the code as digits. */
|
|
5647
|
+
type CardValue = {
|
|
5648
|
+
number: string;
|
|
5649
|
+
expiry: string;
|
|
5650
|
+
cvc: string;
|
|
5651
|
+
};
|
|
5652
|
+
type CardFieldKey = keyof CardValue;
|
|
5653
|
+
type CardFieldsProps = {
|
|
5654
|
+
/** The group's name, drawn as its `<legend>` and read by a screen reader before each field. */
|
|
5655
|
+
legend: string;
|
|
5656
|
+
/** The three values, when controlled. */
|
|
5657
|
+
value?: CardValue;
|
|
5658
|
+
/** Initial values, when uncontrolled. All empty when omitted. */
|
|
5659
|
+
defaultValue?: CardValue;
|
|
5660
|
+
/** Called with the three values whenever one of them changes. */
|
|
5661
|
+
onChange?: (value: CardValue) => void;
|
|
5662
|
+
/** Error message under each field. The page decides when and with which words. */
|
|
5663
|
+
errors?: Partial<Record<CardFieldKey, string>>;
|
|
5664
|
+
/**
|
|
5665
|
+
* An error for the whole card ("Your card was declined."), under the three fields and read as
|
|
5666
|
+
* the group's description. It is announced when it appears.
|
|
5667
|
+
*/
|
|
5668
|
+
error?: string;
|
|
5669
|
+
/** Labels of the three fields. Default `Card number`, `Expiry date` and `Security code`. */
|
|
5670
|
+
labels?: Partial<Record<CardFieldKey, string>>;
|
|
5671
|
+
/** Height and text size of the three fields, aligned on Button's. Default `md`. */
|
|
5672
|
+
size?: FieldSize;
|
|
5673
|
+
/** Marks the three fields required. */
|
|
5674
|
+
required?: boolean;
|
|
5675
|
+
/** Disables the group and its three fields. */
|
|
5676
|
+
disabled?: boolean;
|
|
5677
|
+
/** Called when the brand the number points to changes, as `CardNumberInput`'s. */
|
|
5678
|
+
onBrandChange?: (brand: CardBrand | null) => void;
|
|
5679
|
+
/** Refs to the three `<input>`s, where focus belongs on the field a validation error names. */
|
|
5680
|
+
inputRefs?: Partial<Record<CardFieldKey, Ref<HTMLInputElement>>>;
|
|
5681
|
+
/** Merged on the `<fieldset>`. */
|
|
5682
|
+
className?: string;
|
|
5683
|
+
};
|
|
5684
|
+
/**
|
|
5685
|
+
* CardFields — the three card fields as one group: a `<fieldset>` with a shared legend and error,
|
|
5686
|
+
* the number on its own line and the expiry and the code in two equal columns (still two at 375px),
|
|
5687
|
+
* and the brand handed from the number to the code through context, so an Amex asks four digits
|
|
5688
|
+
* with nothing to wire. The fields keep their own `error`; the group adds the card's. Each field is
|
|
5689
|
+
* also exported and works alone.
|
|
5690
|
+
*/
|
|
5691
|
+
declare const CardFields: ({ legend, value: valueProp, defaultValue, onChange, errors, error, labels, size, required, disabled, onBrandChange, inputRefs, className, }: CardFieldsProps) => react.JSX.Element;
|
|
5692
|
+
|
|
4826
5693
|
type BarListIntent = Extract<Intent, 'brand' | 'success' | 'warning' | 'danger' | 'info'>;
|
|
4827
5694
|
type BarListItem = {
|
|
4828
5695
|
/** Stable key of the row. */
|
|
@@ -4961,8 +5828,205 @@ declare const DescriptionList: typeof DescriptionListRoot & {
|
|
|
4961
5828
|
Item: typeof Item;
|
|
4962
5829
|
};
|
|
4963
5830
|
|
|
5831
|
+
/** When the sign of an amount is written: the values of `Intl.NumberFormat`'s `signDisplay`. */
|
|
5832
|
+
type MoneySignDisplay = 'auto' | 'always' | 'exceptZero' | 'negative' | 'never';
|
|
5833
|
+
/** When the zeros after the decimal point are written: `Intl.NumberFormat`'s `trailingZeroDisplay`. */
|
|
5834
|
+
type MoneyTrailingZeroDisplay = 'auto' | 'stripIfInteger';
|
|
5835
|
+
type FormatMoneyOptions = {
|
|
5836
|
+
/** ISO 4217 code (`'EUR'`): writes the value as a price. Without it, as a plain number. */
|
|
5837
|
+
currency?: string;
|
|
5838
|
+
/** BCP 47 locale of the figure (`'fr-FR'`, `'ar-EG'`). Default: the user's. */
|
|
5839
|
+
locale?: string;
|
|
5840
|
+
/**
|
|
5841
|
+
* Which amounts get a sign. Default `negative`: a minus in front of a loss, nothing in front of
|
|
5842
|
+
* a gain or of zero, and no `-$0.00` for a loss too small to show. `exceptZero` adds a plus in
|
|
5843
|
+
* front of a gain, `always` and `never` write a sign in front of every amount or none.
|
|
5844
|
+
*/
|
|
5845
|
+
signDisplay?: MoneySignDisplay;
|
|
5846
|
+
/**
|
|
5847
|
+
* Default `auto`: every decimal of the currency (`$24.00`). `stripIfInteger` drops them from a
|
|
5848
|
+
* whole amount and only from a whole one (`$24`, but `$24.50`), for a price tag.
|
|
5849
|
+
*/
|
|
5850
|
+
trailingZeroDisplay?: MoneyTrailingZeroDisplay;
|
|
5851
|
+
};
|
|
5852
|
+
/**
|
|
5853
|
+
* `value` written as an amount, in units (`24.5`, not 2450 cents), by `Intl.NumberFormat`: the
|
|
5854
|
+
* separators, the digits, the number of decimals of the currency (none for JPY) and the place of
|
|
5855
|
+
* its sign come from `locale`. For a string, a toast, an `aria-label` or an export; to draw the
|
|
5856
|
+
* figure on a page, use `Amount`, which also isolates it from the text around it.
|
|
5857
|
+
*
|
|
5858
|
+
* An unknown locale or a malformed currency code throws a `RangeError`: a wrong amount on a page
|
|
5859
|
+
* is worse than an error.
|
|
5860
|
+
*/
|
|
5861
|
+
declare const formatMoney: (value: number, { currency, locale, signDisplay, trailingZeroDisplay, }?: FormatMoneyOptions) => string;
|
|
5862
|
+
|
|
5863
|
+
type AmountProps = Omit<ComponentPropsWithRef<'bdi'>, 'children'> & {
|
|
5864
|
+
/** The amount, in units (`24.5`, not 2450 cents). */
|
|
5865
|
+
value: number;
|
|
5866
|
+
/** ISO 4217 code (`'EUR'`): writes the value as a price. Without it, as a plain number. */
|
|
5867
|
+
currency?: string;
|
|
5868
|
+
/** BCP 47 locale of the figure. Default: the user's. Pass it when the text around is in one. */
|
|
5869
|
+
locale?: string;
|
|
5870
|
+
/**
|
|
5871
|
+
* Which amounts get a sign. Default `negative`: a minus in front of a loss, nothing in front of
|
|
5872
|
+
* a gain or of zero (no `-$0.00`). See `formatMoney`.
|
|
5873
|
+
*/
|
|
5874
|
+
signDisplay?: MoneySignDisplay;
|
|
5875
|
+
/**
|
|
5876
|
+
* `stripIfInteger` writes a whole amount with no decimals (`$24`) and keeps them on the others
|
|
5877
|
+
* (`$24.50`). Default `auto`: every decimal of the currency. See `formatMoney`.
|
|
5878
|
+
*/
|
|
5879
|
+
trailingZeroDisplay?: MoneyTrailingZeroDisplay;
|
|
5880
|
+
/** Writes the value yourself, in place of `currency`, `locale`, `signDisplay` and the rest. */
|
|
5881
|
+
format?: (value: number) => string;
|
|
5882
|
+
};
|
|
5883
|
+
/**
|
|
5884
|
+
* Amount — a figure of money in running text, a cell or a row of totals. It is written by
|
|
5885
|
+
* `formatMoney`, so it follows the locale and the currency, in tabular digits that line up in a
|
|
5886
|
+
* column, on one line. It sits in a `<bdi>`, so the sign and the digits keep their order in a
|
|
5887
|
+
* right-to-left page and a minus never jumps to the other side of the figure. It takes the colour
|
|
5888
|
+
* and the weight of the text around it; tint it with `className`.
|
|
5889
|
+
*/
|
|
5890
|
+
declare const Amount: ({ value, currency, locale, signDisplay, trailingZeroDisplay, format, className, ...rest }: AmountProps) => react.JSX.Element;
|
|
5891
|
+
|
|
5892
|
+
type TotalsRowProps = Omit<ComponentPropsWithRef<'li'>, 'children'> & {
|
|
5893
|
+
/** What the figure is: "Subtotal", "Shipping", "VAT (20%)". Wraps when the row is narrow. */
|
|
5894
|
+
label: ReactNode;
|
|
5895
|
+
/** The amount, in units (`24.5`, not 2450 cents), written with the block's currency and locale. */
|
|
5896
|
+
value?: number;
|
|
5897
|
+
/**
|
|
5898
|
+
* The value as text or a node ("Free", "Calculated at the next step"), in place of `value`. A
|
|
5899
|
+
* text sits in a `<bdi>`, so it keeps its order in a right-to-left page. A row with neither
|
|
5900
|
+
* shows no value.
|
|
5901
|
+
*/
|
|
5902
|
+
children?: ReactNode;
|
|
5903
|
+
};
|
|
5904
|
+
/** Totals.Row — a label and its amount: a subtotal, a discount, shipping, tax. */
|
|
5905
|
+
declare function Row(props: TotalsRowProps): react.JSX.Element;
|
|
5906
|
+
/**
|
|
5907
|
+
* Totals.Total — the row that closes the block: a rule above it and a larger, bolder label and
|
|
5908
|
+
* amount. Takes the same props as `Totals.Row`.
|
|
5909
|
+
*/
|
|
5910
|
+
declare function Total(props: TotalsRowProps): react.JSX.Element;
|
|
5911
|
+
type TotalsNoteProps = ComponentPropsWithRef<'li'> & {
|
|
5912
|
+
/** The text under the rows: "Tax included", "Shipping calculated at checkout". */
|
|
5913
|
+
children: ReactNode;
|
|
5914
|
+
};
|
|
5915
|
+
/** Totals.Note — a line of small, muted text under the rows, at the end of the line with them. */
|
|
5916
|
+
declare function Note({ className, children, ref, ...rest }: TotalsNoteProps): react.JSX.Element;
|
|
5917
|
+
type TotalsProps = Omit<ComponentPropsWithRef<'ul'>, 'children'> & {
|
|
5918
|
+
/** ISO 4217 code (`'EUR'`) of every amount. Without it, they are plain numbers. */
|
|
5919
|
+
currency?: string;
|
|
5920
|
+
/** BCP 47 locale of every amount. Default: the user's. Pass it when the page is in one. */
|
|
5921
|
+
locale?: string;
|
|
5922
|
+
/**
|
|
5923
|
+
* Which amounts get a sign. Default `negative`: a minus in front of a discount, nothing in front
|
|
5924
|
+
* of a subtotal or of zero. See `formatMoney`.
|
|
5925
|
+
*/
|
|
5926
|
+
signDisplay?: MoneySignDisplay;
|
|
5927
|
+
/** `Totals.Row`, `Totals.Total` and `Totals.Note`, in the order they show. */
|
|
5928
|
+
children: ReactNode;
|
|
5929
|
+
};
|
|
5930
|
+
declare function TotalsRoot({ currency, locale, signDisplay, className, children, ref, ...rest }: TotalsProps): react.JSX.Element;
|
|
5931
|
+
/**
|
|
5932
|
+
* Totals — the summary rows that end a cart, an order or an invoice: subtotal, discount,
|
|
5933
|
+
* shipping, tax, then a total that stands out and an optional note. It adds nothing up: every
|
|
5934
|
+
* amount is yours, and each is written by `formatMoney` with the block's `currency` and `locale`,
|
|
5935
|
+
* in tabular digits at the end of the line, so the figures line up and mirror in right to left.
|
|
5936
|
+
* A discount is a negative amount: it shows with a minus, in the colour of the text around it.
|
|
5937
|
+
* The block takes the width of its container; give it a `max-w-*` and `ms-auto` to sit at the end.
|
|
5938
|
+
*/
|
|
5939
|
+
declare const Totals: typeof TotalsRoot & {
|
|
5940
|
+
Row: typeof Row;
|
|
5941
|
+
Total: typeof Total;
|
|
5942
|
+
Note: typeof Note;
|
|
5943
|
+
};
|
|
5944
|
+
|
|
5945
|
+
type PlanFeature = {
|
|
5946
|
+
/** What the plan gives, or does not give. */
|
|
5947
|
+
label: ReactNode;
|
|
5948
|
+
/** `false` for a feature the plan lacks: a muted dash and muted text. Default `true`. */
|
|
5949
|
+
included?: boolean;
|
|
5950
|
+
};
|
|
5951
|
+
/** The level of the plan's name: the page decides where the cards sit in its outline. */
|
|
5952
|
+
type PlanCardHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
5953
|
+
type PlanCardProps = Omit<ComponentPropsWithRef<'article'>, 'children'> & {
|
|
5954
|
+
/** The plan's name: "Starter", "Pro". It is the heading of the card. */
|
|
5955
|
+
name: string;
|
|
5956
|
+
/**
|
|
5957
|
+
* One or two lines under the name. The card keeps room for two, so the actions of cards side by
|
|
5958
|
+
* side line up; a third line pushes this card's action down.
|
|
5959
|
+
*/
|
|
5960
|
+
description?: ReactNode;
|
|
5961
|
+
/**
|
|
5962
|
+
* A number is written as money by `formatMoney` (`24` gives `$24`, `24.5` gives `$24.50`), in
|
|
5963
|
+
* units and in tabular digits. Anything else is shown as it is, for a price that is not a figure
|
|
5964
|
+
* ("Free", "Custom").
|
|
5965
|
+
*/
|
|
5966
|
+
price: ReactNode;
|
|
5967
|
+
/** ISO 4217 code (`'USD'`) of a numeric `price`. Without it, a plain number. */
|
|
5968
|
+
currency?: string;
|
|
5969
|
+
/** BCP 47 locale of a numeric `price`. Default: the user's. Pass it when the page is in one. */
|
|
5970
|
+
locale?: string;
|
|
5971
|
+
/** What the price covers, after it: "/ month", "per seat per year". */
|
|
5972
|
+
period?: ReactNode;
|
|
5973
|
+
/**
|
|
5974
|
+
* A line of small text under the price: "Billed $228 yearly", "Save 20%". The card keeps room
|
|
5975
|
+
* for one line, so cards with and without a note keep their actions level.
|
|
5976
|
+
*/
|
|
5977
|
+
priceNote?: ReactNode;
|
|
5978
|
+
/**
|
|
5979
|
+
* The plan to look at first: an accent outline and a shadow. Pair it with `highlightLabel`
|
|
5980
|
+
* ("Most popular").
|
|
5981
|
+
*/
|
|
5982
|
+
highlighted?: boolean;
|
|
5983
|
+
/**
|
|
5984
|
+
* The text of the label set in the corner of a `highlighted` card, a `Ribbon` pill. Keep it
|
|
5985
|
+
* short: the name wraps under it, but a long label runs over the name.
|
|
5986
|
+
*/
|
|
5987
|
+
highlightLabel?: ReactNode;
|
|
5988
|
+
/**
|
|
5989
|
+
* The plan the customer is on. The card draws its own disabled button, a `secondary` one, in
|
|
5990
|
+
* place of `action`.
|
|
5991
|
+
*/
|
|
5992
|
+
current?: boolean;
|
|
5993
|
+
/** Text of that button, for translations. Default `Current plan`. */
|
|
5994
|
+
currentLabel?: string;
|
|
5995
|
+
/**
|
|
5996
|
+
* The action: a `Button` of `size="lg"`, set right under the price and as wide as the card. The
|
|
5997
|
+
* page decides what it does (a link to the sign-up, a button that opens a confirmation).
|
|
5998
|
+
*/
|
|
5999
|
+
action?: ReactNode;
|
|
6000
|
+
/** The list under the action, in order: each is a mark and a label. */
|
|
6001
|
+
features?: PlanFeature[];
|
|
6002
|
+
/** Under the feature list, or in its place when there is none: a link, a note. */
|
|
6003
|
+
children?: ReactNode;
|
|
6004
|
+
/** Level of the name's heading. Default `3`. */
|
|
6005
|
+
headingLevel?: PlanCardHeadingLevel;
|
|
6006
|
+
/** Read before an included feature by a screen reader, for translations. Default `Included:`. */
|
|
6007
|
+
includedLabel?: string;
|
|
6008
|
+
/** Read before a missing feature by a screen reader. Default `Not included:`. */
|
|
6009
|
+
notIncludedLabel?: string;
|
|
6010
|
+
};
|
|
6011
|
+
/**
|
|
6012
|
+
* PlanCard — one plan of a pricing page or a billing page: its name, a short description, the
|
|
6013
|
+
* price and what it covers, the action under it and the list of what it includes. Cards in a row
|
|
6014
|
+
* keep their actions level (the description and the price note keep their room) and stack in a
|
|
6015
|
+
* column on a narrow screen: put them in a grid, `grid gap-6 md:grid-cols-3`, and place the
|
|
6016
|
+
* monthly and yearly switch above it, a `SegmentedControl` of your own. The card computes
|
|
6017
|
+
* nothing: a yearly price, "Save 20%" and the billed total are yours to pass.
|
|
6018
|
+
*
|
|
6019
|
+
* `highlighted` draws the plan to look at first, with a label from `highlightLabel`, and
|
|
6020
|
+
* `current` the plan in use, whose button reads "Current plan" and is disabled. A feature the plan
|
|
6021
|
+
* lacks is a muted dash with muted text, never struck through; a screen reader hears "Included:"
|
|
6022
|
+
* or "Not included:" before each.
|
|
6023
|
+
*/
|
|
6024
|
+
declare const PlanCard: ({ name, description, price, currency, locale, period, priceNote, highlighted, highlightLabel, current, currentLabel, action, features, children, headingLevel, includedLabel, notIncludedLabel, className, ref, ...rest }: PlanCardProps) => react.JSX.Element;
|
|
6025
|
+
|
|
4964
6026
|
/** The meanings a card can carry: the plain one, or a metric that needs a look. */
|
|
4965
6027
|
type KpiCardIntent = Extract<Intent, 'neutral' | 'warning' | 'danger'>;
|
|
6028
|
+
/** Where the `chart` goes: under the delta, or at the end of the line beside the value. */
|
|
6029
|
+
type KpiCardChartPosition = 'bottom' | 'end';
|
|
4966
6030
|
type KpiCardProps = {
|
|
4967
6031
|
label: string;
|
|
4968
6032
|
value: ReactNode;
|
|
@@ -4985,10 +6049,24 @@ type KpiCardProps = {
|
|
|
4985
6049
|
/** Under the value: normally a `<TrendDelta label="vs last month" />`. */
|
|
4986
6050
|
delta?: ReactNode;
|
|
4987
6051
|
/**
|
|
4988
|
-
*
|
|
4989
|
-
* Cosmos does not couple `react` to `charts`, so the chart is yours
|
|
6052
|
+
* A `Sparkline`, mini bars, a ring: by default under the delta, the full width of the card (see
|
|
6053
|
+
* `chartPosition`). You size it. Cosmos does not couple `react` to `charts`, so the chart is yours
|
|
6054
|
+
* to pass.
|
|
4990
6055
|
*/
|
|
4991
6056
|
chart?: ReactNode;
|
|
6057
|
+
/**
|
|
6058
|
+
* Where the `chart` goes. `bottom` (default) is under the delta, the full width of the card.
|
|
6059
|
+
* `end` sets it at the end of the line beside the value, delta and sub line, at its own size and
|
|
6060
|
+
* centered on them: a `ProgressRing` next to a percentage. When the card is too narrow for both
|
|
6061
|
+
* it drops under them, at the start of the line. Needs a `chart`.
|
|
6062
|
+
*/
|
|
6063
|
+
chartPosition?: KpiCardChartPosition;
|
|
6064
|
+
/**
|
|
6065
|
+
* The one figure a dashboard leads with: the card takes the tinted surface of its meaning (the
|
|
6066
|
+
* accent for `neutral`, else the intent's color), and its label, value and sub line stay readable
|
|
6067
|
+
* on it in every theme. Default `false`: the plain card.
|
|
6068
|
+
*/
|
|
6069
|
+
featured?: boolean;
|
|
4992
6070
|
/**
|
|
4993
6071
|
* Meaning of the metric. `warning` and `danger` take the border, the icon chip and the value
|
|
4994
6072
|
* to the intent color; the background stays the card's. Default `neutral`.
|
|
@@ -5013,7 +6091,7 @@ type KpiCardProps = {
|
|
|
5013
6091
|
* against a previous period and a chart. Use in dashboards as the top-row at-a-glance panel.
|
|
5014
6092
|
* With `href` or `onClick` the whole card is one link or button.
|
|
5015
6093
|
*/
|
|
5016
|
-
declare const KpiCard: ({ label, value, exactValue, sub, icon: Icon, iconIntent, delta, chart, intent, loading, href, onClick, ref, className, }: KpiCardProps) => react.JSX.Element;
|
|
6094
|
+
declare const KpiCard: ({ label, value, exactValue, sub, icon: Icon, iconIntent, delta, chart, chartPosition, featured, intent, loading, href, onClick, ref, className, }: KpiCardProps) => react.JSX.Element;
|
|
5017
6095
|
|
|
5018
6096
|
type TrendDeltaSize = 'sm' | 'md';
|
|
5019
6097
|
type TrendDeltaProps = {
|
|
@@ -5123,6 +6201,9 @@ type MiniCalendarProps = {
|
|
|
5123
6201
|
*/
|
|
5124
6202
|
declare const MiniCalendar: ({ today, selected: selectedProp, defaultSelected, onSelect, eventDays, locale, className, }: MiniCalendarProps) => react.JSX.Element;
|
|
5125
6203
|
|
|
6204
|
+
/** What the calendar shows: a month grid, a week of hours, or one day of hours. */
|
|
6205
|
+
type CalendarView = 'month' | 'week' | 'day';
|
|
6206
|
+
|
|
5126
6207
|
/**
|
|
5127
6208
|
* An event's color: an `Intent`, or `violet`, a category color that carries no meaning of
|
|
5128
6209
|
* its own.
|
|
@@ -5131,51 +6212,104 @@ type EventCalendarIntent = Extract<Intent, 'brand' | 'success' | 'warning' | 'da
|
|
|
5131
6212
|
type CalendarEvent = {
|
|
5132
6213
|
id: string;
|
|
5133
6214
|
title: string;
|
|
5134
|
-
/**
|
|
6215
|
+
/**
|
|
6216
|
+
* When the event starts. The month view uses its date and writes its time on the chip, unless
|
|
6217
|
+
* the event is all-day; the week and day views put it at its time in the hour grid.
|
|
6218
|
+
*/
|
|
5135
6219
|
start: Date;
|
|
5136
|
-
/**
|
|
6220
|
+
/**
|
|
6221
|
+
* An all-day event: the last day, inclusive. A timed one: the moment it ends. Omit for an event
|
|
6222
|
+
* that lasts no longer than its day (in the hour grid, one with no end is drawn at the
|
|
6223
|
+
* minimum height).
|
|
6224
|
+
*/
|
|
5137
6225
|
end?: Date;
|
|
6226
|
+
/**
|
|
6227
|
+
* An all-day event has a date and no time: it goes in the row above the hour grid and shows no
|
|
6228
|
+
* time. Left unset, it is true when `start` is at 00:00 and `end` is missing or at 00:00, so an
|
|
6229
|
+
* event made of dates alone stays all-day. Set it to force the answer either way (a timed event
|
|
6230
|
+
* that starts at midnight is `allDay: false`).
|
|
6231
|
+
*/
|
|
6232
|
+
allDay?: boolean;
|
|
5138
6233
|
/** Dot and chip colour. Defaults to `brand`. */
|
|
5139
6234
|
intent?: EventCalendarIntent;
|
|
5140
6235
|
};
|
|
5141
6236
|
type EventCalendarProps = {
|
|
5142
6237
|
events: CalendarEvent[];
|
|
5143
|
-
/**
|
|
5144
|
-
|
|
5145
|
-
/**
|
|
5146
|
-
|
|
5147
|
-
/** Fires with the
|
|
5148
|
-
|
|
5149
|
-
/** Day
|
|
6238
|
+
/** What is shown: `month` (default), `week` or `day`. Set it with `onViewChange` to control it. */
|
|
6239
|
+
view?: CalendarView;
|
|
6240
|
+
/** The view shown first when `view` is not set. Defaults to `month`. */
|
|
6241
|
+
defaultView?: CalendarView;
|
|
6242
|
+
/** Fires with the view picked in the toolbar. */
|
|
6243
|
+
onViewChange?: (view: CalendarView) => void;
|
|
6244
|
+
/** Day that sets the period shown (any day in it). Set it with `onDateChange` to control the calendar. */
|
|
6245
|
+
date?: Date;
|
|
6246
|
+
/** Day that sets the first period shown when `date` is not set. Defaults to `today`. */
|
|
6247
|
+
defaultDate?: Date;
|
|
6248
|
+
/**
|
|
6249
|
+
* Fires with the first day of the period reached by previous / next / Today (the 1st of a month,
|
|
6250
|
+
* the Monday of a week, the day itself), and by a change of view that lands on another period.
|
|
6251
|
+
*/
|
|
6252
|
+
onDateChange?: (date: Date) => void;
|
|
6253
|
+
/**
|
|
6254
|
+
* The current moment. Its day is highlighted, Today goes to it, and the line of the week and day
|
|
6255
|
+
* views sits at its time. Defaults to now, and the line moves every minute; set it to freeze it
|
|
6256
|
+
* (stories, screenshots and tests).
|
|
6257
|
+
*/
|
|
5150
6258
|
today?: Date;
|
|
5151
6259
|
/** Makes each event chip a button. */
|
|
5152
6260
|
onEventClick?: (event: CalendarEvent) => void;
|
|
5153
6261
|
/** Makes each day number a button. */
|
|
5154
6262
|
onDayClick?: (date: Date) => void;
|
|
5155
6263
|
/**
|
|
5156
|
-
*
|
|
6264
|
+
* Makes the empty time slots of the week and day views interactive: a click on one, or Enter on
|
|
6265
|
+
* the keyboard cursor, calls it with the start of the 30-minute slot. `info.allDay` is `true`
|
|
6266
|
+
* for a click on the all-day row, whose start is 00:00. With it set, the hour grid is a single
|
|
6267
|
+
* tab stop for a cursor on the slots: the arrow keys move it a day or 30 minutes, Page Up and
|
|
6268
|
+
* Page Down a week (a day, in the day view), Home and End to the first and the last slot of
|
|
6269
|
+
* the day.
|
|
6270
|
+
*/
|
|
6271
|
+
onSlotClick?: (start: Date, info: {
|
|
6272
|
+
allDay: boolean;
|
|
6273
|
+
}) => void;
|
|
6274
|
+
/**
|
|
6275
|
+
* BCP 47 language tag (`'fr-FR'`) for the weekday names, the titles, the times and the
|
|
5157
6276
|
* date in the accessible name of each day and of its "+N more" list. Defaults to
|
|
5158
6277
|
* the browser's locale. The grid itself stays Gregorian, weeks starting on
|
|
5159
6278
|
* Monday, whatever the locale. The button labels (Today, Previous month, Next
|
|
5160
6279
|
* month, "+N more") stay English. An invalid tag throws a `RangeError`.
|
|
5161
6280
|
*/
|
|
5162
6281
|
locale?: string;
|
|
5163
|
-
/**
|
|
6282
|
+
/**
|
|
6283
|
+
* Shown under the grid when no event falls in the period shown. Default `No events this month`,
|
|
6284
|
+
* `No events this week` or `No events this day`.
|
|
6285
|
+
*/
|
|
5164
6286
|
emptyMessage?: ReactNode;
|
|
6287
|
+
/**
|
|
6288
|
+
* Classes of the card. The week and day views are as tall as the card is: give it a height
|
|
6289
|
+
* (`h-[640px]`) and the hour grid scrolls inside it; without one the grid is 36rem tall.
|
|
6290
|
+
*/
|
|
5165
6291
|
className?: string;
|
|
5166
6292
|
};
|
|
5167
6293
|
/**
|
|
5168
|
-
* EventCalendar — month
|
|
6294
|
+
* EventCalendar — events in a month grid, a week of hours or a day of hours, with ISO weeks
|
|
6295
|
+
* (Monday first).
|
|
5169
6296
|
*
|
|
5170
|
-
*
|
|
5171
|
-
* "+N more" button that lists the whole day. An event
|
|
5172
|
-
*
|
|
5173
|
-
*
|
|
6297
|
+
* The month shows up to three event chips a day (a color dot, the time and the title) and a
|
|
6298
|
+
* "+N more" button that lists the whole day. An all-day event has no time; a timed one writes its
|
|
6299
|
+
* start time before the title. An event with an `end` shows its title on its first day and a bare
|
|
6300
|
+
* chip on each following day. Below `sm` the weekday names shrink to a letter, the chips to their
|
|
6301
|
+
* dots, and picking a day lists its events under the grid.
|
|
5174
6302
|
*
|
|
5175
|
-
*
|
|
5176
|
-
*
|
|
6303
|
+
* The week and day views draw a scrolling grid of 24 hours, 48px each, opened at 7 AM (or an hour
|
|
6304
|
+
* before the first event). All-day events sit in a row above it; timed ones are placed at their
|
|
6305
|
+
* time, side by side when they overlap, as many as the width allows (72px each, two at least),
|
|
6306
|
+
* the rest behind a "+N" button. A line marks the current time. Below `sm` a week is a strip of
|
|
6307
|
+
* its seven days and the grid of the picked day.
|
|
6308
|
+
*
|
|
6309
|
+
* Uncontrolled by default; pass `date` with `onDateChange`, and `view` with `onViewChange`, to
|
|
6310
|
+
* drive it from outside (a side MiniCalendar, or loading events per period).
|
|
5177
6311
|
*/
|
|
5178
|
-
declare const EventCalendar: ({ events,
|
|
6312
|
+
declare const EventCalendar: ({ events, view: viewProp, defaultView, onViewChange, date, defaultDate, onDateChange, today, onEventClick, onDayClick, onSlotClick, locale, emptyMessage, className, }: EventCalendarProps) => react.JSX.Element;
|
|
5179
6313
|
|
|
5180
6314
|
type IntegrationStatus = 'connected' | 'available' | 'error' | 'pending';
|
|
5181
6315
|
type IntegrationCardProps = {
|
|
@@ -6180,11 +7314,14 @@ type TableAmountCellProps = {
|
|
|
6180
7314
|
/**
|
|
6181
7315
|
* TableAmountCell — a signed amount tinted by its sign: green for a gain, red for a loss, plain
|
|
6182
7316
|
* for zero. The sign is written too, so the colour is never the only cue. Put it in a numeric
|
|
6183
|
-
* column (`align="end"`, or `numeric` on `TableCell`).
|
|
7317
|
+
* column (`align="end"`, or `numeric` on `TableCell`). It is an `Amount` with a plus in front of
|
|
7318
|
+
* a gain (`signDisplay="exceptZero"`), so it writes the figure as the rest of the page does.
|
|
6184
7319
|
*/
|
|
6185
7320
|
declare const TableAmountCell: ({ value, currency, locale, format }: TableAmountCellProps) => react.JSX.Element;
|
|
6186
7321
|
|
|
6187
7322
|
type AuthLayoutVariant = 'card' | 'split' | 'cover';
|
|
7323
|
+
/** The width of the card (or of the form column in `split`): the `Modal` widths. */
|
|
7324
|
+
type AuthLayoutSize = 'md' | 'lg' | 'xl';
|
|
6188
7325
|
type AuthLayoutProps = {
|
|
6189
7326
|
/** Brand icon component (lucide). Renders inside a brand-colored square above the title. */
|
|
6190
7327
|
logo?: ComponentType<{
|
|
@@ -6206,6 +7343,12 @@ type AuthLayoutProps = {
|
|
|
6206
7343
|
* `h1`. A `brand` node of your own is rendered as written.
|
|
6207
7344
|
*/
|
|
6208
7345
|
variant?: AuthLayoutVariant;
|
|
7346
|
+
/**
|
|
7347
|
+
* Width of the card, or of the form column in `split`: `md` (448px, default), `lg` (512px) or
|
|
7348
|
+
* `xl` (672px), the widths of `Modal`'s sizes. `lg` and `xl` pad the card by 24px below `sm`
|
|
7349
|
+
* and 32px from there, `md` keeps its 32px. A wide card suits a step of an onboarding wizard.
|
|
7350
|
+
*/
|
|
7351
|
+
size?: AuthLayoutSize;
|
|
6209
7352
|
/**
|
|
6210
7353
|
* `split` only: the panel beside the form, from `lg` up (hidden below, where the brand block
|
|
6211
7354
|
* shows above the form instead). Without it, a panel on the brand accent with the `logo`,
|
|
@@ -6240,7 +7383,7 @@ type AuthLayoutProps = {
|
|
|
6240
7383
|
*
|
|
6241
7384
|
* `variant="split"` and `variant="cover"` keep the same brand block and children; see the props.
|
|
6242
7385
|
*/
|
|
6243
|
-
declare const AuthLayout: ({ logo: Logo, title, subtitle, brand, variant, aside, asidePosition, cover, children, className, }: AuthLayoutProps) => react.JSX.Element;
|
|
7386
|
+
declare const AuthLayout: ({ logo: Logo, title, subtitle, brand, variant, size, aside, asidePosition, cover, children, className, }: AuthLayoutProps) => react.JSX.Element;
|
|
6244
7387
|
|
|
6245
7388
|
type ErrorPageProps = {
|
|
6246
7389
|
/**
|
|
@@ -6278,6 +7421,56 @@ type ErrorPageProps = {
|
|
|
6278
7421
|
*/
|
|
6279
7422
|
declare const ErrorPage: ({ code, title, description, illustration, actions, className, }: ErrorPageProps) => react.JSX.Element;
|
|
6280
7423
|
|
|
7424
|
+
/** `form` asks for the password, `expired` is a link that no longer works, `done` is the end. */
|
|
7425
|
+
type NewPasswordFormView = 'form' | 'expired' | 'done';
|
|
7426
|
+
type NewPasswordFormProps = {
|
|
7427
|
+
/** Called with the new password once it follows the `rules` and the confirmation matches. */
|
|
7428
|
+
onSubmit: (password: string) => void | Promise<void>;
|
|
7429
|
+
/** Which screen to show. Default `form`. */
|
|
7430
|
+
view?: NewPasswordFormView;
|
|
7431
|
+
/** `expired`: where to ask for another link. Without it, the view has no link to follow. */
|
|
7432
|
+
requestHref?: string;
|
|
7433
|
+
requestLabel?: string;
|
|
7434
|
+
/** `form` and `expired`: where "Back to sign in" goes; `done`: where "Continue to sign in" goes. */
|
|
7435
|
+
signInHref?: string;
|
|
7436
|
+
signInLabel?: string;
|
|
7437
|
+
/** `done`: the label of the link to the sign-in page. */
|
|
7438
|
+
continueLabel?: string;
|
|
7439
|
+
/**
|
|
7440
|
+
* The password policy: what the rules say of a password, listed live under the field. Default
|
|
7441
|
+
* `defaultPasswordRules`. The form stays closed until they all hold; a list that comes back
|
|
7442
|
+
* empty shows none and asks for a non-empty password only.
|
|
7443
|
+
*/
|
|
7444
|
+
rules?: (password: string) => PasswordRule[];
|
|
7445
|
+
/**
|
|
7446
|
+
* Scores a password from 0 to 4 (zxcvbn's scale). Given, a `PasswordStrengthMeter` shows under
|
|
7447
|
+
* the field once something is typed. Cosmos bundles no estimator: see the docs.
|
|
7448
|
+
*/
|
|
7449
|
+
strength?: (password: string) => number;
|
|
7450
|
+
loading?: boolean;
|
|
7451
|
+
error?: string;
|
|
7452
|
+
title?: string;
|
|
7453
|
+
description?: string;
|
|
7454
|
+
submitLabel?: string;
|
|
7455
|
+
className?: string;
|
|
7456
|
+
};
|
|
7457
|
+
/**
|
|
7458
|
+
* The page the e-mail link of `ResetPasswordForm` opens: a new password and its confirmation, then
|
|
7459
|
+
* a confirmation screen, or an offer to ask for another link when this one has expired. Each
|
|
7460
|
+
* screen is its own `h1`.
|
|
7461
|
+
*/
|
|
7462
|
+
declare const NewPasswordForm: ({ onSubmit, view, requestHref, requestLabel, signInHref, signInLabel, continueLabel, rules: rulesOf, strength, loading, error, title, description, submitLabel, className, }: NewPasswordFormProps) => react.JSX.Element;
|
|
7463
|
+
|
|
7464
|
+
/** The words of a resend button that waits between two presses. */
|
|
7465
|
+
type ResendLabels = {
|
|
7466
|
+
/** Said when a press sends again, and shown until the wait ends. */
|
|
7467
|
+
resent?: string;
|
|
7468
|
+
/** Said once, when the wait ends and the button works again. */
|
|
7469
|
+
ready?: string;
|
|
7470
|
+
/** What the button is waiting for, as its description: "available in 0:30". */
|
|
7471
|
+
availableIn?: (seconds: number) => string;
|
|
7472
|
+
};
|
|
7473
|
+
|
|
6281
7474
|
type ResetPasswordFormProps = {
|
|
6282
7475
|
onSubmit: (email: string) => void | Promise<void>;
|
|
6283
7476
|
signInHref?: string;
|
|
@@ -6294,9 +7487,19 @@ type ResetPasswordFormProps = {
|
|
|
6294
7487
|
/** Resend handler in the `sent` view. Hidden if not provided. */
|
|
6295
7488
|
onResend?: () => void;
|
|
6296
7489
|
resendLabel?: string;
|
|
7490
|
+
/**
|
|
7491
|
+
* Seconds the resend button waits before it can be pressed again, from the moment the `sent`
|
|
7492
|
+
* view shows (the e-mail was just sent) and from each press. Default `0`: no wait. While it
|
|
7493
|
+
* waits the button is `aria-disabled` and keeps focus, the countdown is its description, and a
|
|
7494
|
+
* polite status says when a new link went out and when the wait is over. The server stays the
|
|
7495
|
+
* authority: show its refusal (a 429) through `error`.
|
|
7496
|
+
*/
|
|
7497
|
+
resendCooldown?: number;
|
|
7498
|
+
/** The words of the resend wait, to translate with the rest of the page. */
|
|
7499
|
+
resendLabels?: ResendLabels;
|
|
6297
7500
|
className?: string;
|
|
6298
7501
|
};
|
|
6299
|
-
declare const ResetPasswordForm: ({ onSubmit, signInHref, signInLabel, sent, sentEmail, loading, error, title, description, submitLabel, onResend, resendLabel, className, }: ResetPasswordFormProps) => react.JSX.Element;
|
|
7502
|
+
declare const ResetPasswordForm: ({ onSubmit, signInHref, signInLabel, sent, sentEmail, loading, error, title, description, submitLabel, onResend, resendLabel, resendCooldown, resendLabels: resendWords, className, }: ResetPasswordFormProps) => react.JSX.Element;
|
|
6300
7503
|
|
|
6301
7504
|
type SignInFormValues = {
|
|
6302
7505
|
email: string;
|
|
@@ -6339,6 +7542,17 @@ type SignUpFormProps = {
|
|
|
6339
7542
|
privacyHref?: string;
|
|
6340
7543
|
/** Show PasswordPolicyChecker live below the password field. Default `true`. */
|
|
6341
7544
|
showPolicy?: boolean;
|
|
7545
|
+
/**
|
|
7546
|
+
* The password policy: what the rules say of a password. Default `defaultPasswordRules`. They
|
|
7547
|
+
* are listed once something is typed and keep the form closed until they all hold, unless
|
|
7548
|
+
* `showPolicy` is `false`.
|
|
7549
|
+
*/
|
|
7550
|
+
rules?: (password: string) => PasswordRule[];
|
|
7551
|
+
/**
|
|
7552
|
+
* Scores a password from 0 to 4 (zxcvbn's scale). Given, a `PasswordStrengthMeter` shows under
|
|
7553
|
+
* the field once something is typed. Cosmos bundles no estimator: see the docs.
|
|
7554
|
+
*/
|
|
7555
|
+
strength?: (password: string) => number;
|
|
6342
7556
|
loading?: boolean;
|
|
6343
7557
|
error?: string;
|
|
6344
7558
|
title?: string;
|
|
@@ -6348,7 +7562,7 @@ type SignUpFormProps = {
|
|
|
6348
7562
|
extraTop?: ReactNode;
|
|
6349
7563
|
className?: string;
|
|
6350
7564
|
};
|
|
6351
|
-
declare const SignUpForm: ({ onSubmit, signInHref, signInLabel, termsHref, privacyHref, showPolicy, loading, error, title, description, submitLabel, extraTop, className, }: SignUpFormProps) => react.JSX.Element;
|
|
7565
|
+
declare const SignUpForm: ({ onSubmit, signInHref, signInLabel, termsHref, privacyHref, showPolicy, rules: rulesOf, strength, loading, error, title, description, submitLabel, extraTop, className, }: SignUpFormProps) => react.JSX.Element;
|
|
6352
7566
|
|
|
6353
7567
|
type SocialProvider = 'google' | 'github' | 'x' | 'facebook' | 'apple' | 'microsoft';
|
|
6354
7568
|
type SocialAuthButtonsLayout = 'stacked' | 'grid';
|
|
@@ -6370,15 +7584,57 @@ type SocialAuthButtonsProps = {
|
|
|
6370
7584
|
};
|
|
6371
7585
|
declare const SocialAuthButtons: ({ providers, onProviderClick, loading, divider, dividerLabel, layout, labelFor, position, className, }: SocialAuthButtonsProps) => react.JSX.Element | null;
|
|
6372
7586
|
|
|
7587
|
+
/** How the person proves who they are: the verification `code`, or a `backup` code they saved. */
|
|
7588
|
+
type TwoStepMethod = 'code' | 'backup';
|
|
7589
|
+
/** The words of the backup entry and of the resend wait, to translate with the rest of the page. */
|
|
7590
|
+
type TwoStepVerificationLabels = ResendLabels & {
|
|
7591
|
+
/** The link to the backup entry. Default "Use a backup code". */
|
|
7592
|
+
useBackupCode?: string;
|
|
7593
|
+
/** The link back to the verification code. Default "Use a verification code instead". */
|
|
7594
|
+
useVerificationCode?: string;
|
|
7595
|
+
/** Title of the backup entry. Default "Use a backup code". */
|
|
7596
|
+
backupTitle?: string;
|
|
7597
|
+
/** Description of the backup entry. */
|
|
7598
|
+
backupDescription?: string;
|
|
7599
|
+
/** Label of the backup field. Default "Backup code". */
|
|
7600
|
+
backupField?: string;
|
|
7601
|
+
};
|
|
6373
7602
|
type TwoStepVerificationFormProps = {
|
|
6374
|
-
|
|
7603
|
+
/**
|
|
7604
|
+
* Called with the code and the method it was typed for. The `backup` code is passed as typed,
|
|
7605
|
+
* trimmed: no length or format is checked, the host's server says if it is good.
|
|
7606
|
+
*/
|
|
7607
|
+
onSubmit: (code: string, method: TwoStepMethod) => void | Promise<void>;
|
|
6375
7608
|
onResend?: () => void;
|
|
7609
|
+
/**
|
|
7610
|
+
* Seconds the resend button waits before it can be pressed again, from the moment the form
|
|
7611
|
+
* shows (a code was just sent) and from each press. Default `0`: no wait. While it waits the
|
|
7612
|
+
* button is `aria-disabled` and keeps focus, the countdown is its description, and a polite
|
|
7613
|
+
* status says when a new code went out and when the wait is over. The server stays the
|
|
7614
|
+
* authority: show its refusal (a 429) through `error`.
|
|
7615
|
+
*/
|
|
7616
|
+
resendCooldown?: number;
|
|
7617
|
+
/** Offer the link that switches to the backup-code entry, and back. Default `false`. */
|
|
7618
|
+
backupCode?: boolean;
|
|
7619
|
+
/**
|
|
7620
|
+
* The entry shown: the verification `code` (default) or a `backup` code. Set it, with
|
|
7621
|
+
* `onMethodChange`, to own it; the link asks, the host answers.
|
|
7622
|
+
*/
|
|
7623
|
+
method?: TwoStepMethod;
|
|
7624
|
+
/** The entry shown first, while uncontrolled. Default `code`. */
|
|
7625
|
+
defaultMethod?: TwoStepMethod;
|
|
7626
|
+
onMethodChange?: (method: TwoStepMethod) => void;
|
|
7627
|
+
labels?: TwoStepVerificationLabels;
|
|
6376
7628
|
/** Email/phone where the code was sent — shown in the description. */
|
|
6377
7629
|
sentTo?: string;
|
|
6378
7630
|
length?: number;
|
|
6379
7631
|
loading?: boolean;
|
|
7632
|
+
/**
|
|
7633
|
+
* What went wrong: a banner above the cells, or under the field on the backup entry, where it
|
|
7634
|
+
* should not say if the code was already used.
|
|
7635
|
+
*/
|
|
6380
7636
|
error?: string;
|
|
6381
|
-
/**
|
|
7637
|
+
/** `code` only: trigger onSubmit automatically when the user fills the last cell. Default `true`. */
|
|
6382
7638
|
autoSubmit?: boolean;
|
|
6383
7639
|
cancelHref?: string;
|
|
6384
7640
|
cancelLabel?: string;
|
|
@@ -6387,7 +7643,7 @@ type TwoStepVerificationFormProps = {
|
|
|
6387
7643
|
resendLabel?: string;
|
|
6388
7644
|
className?: string;
|
|
6389
7645
|
};
|
|
6390
|
-
declare const TwoStepVerificationForm: ({ onSubmit, onResend, sentTo, length, loading, error, autoSubmit, cancelHref, cancelLabel, title, submitLabel, resendLabel, className, }: TwoStepVerificationFormProps) => react.JSX.Element;
|
|
7646
|
+
declare const TwoStepVerificationForm: ({ onSubmit, onResend, resendCooldown, backupCode, method: methodProp, defaultMethod, onMethodChange, labels, sentTo, length, loading, error, autoSubmit, cancelHref, cancelLabel, title, submitLabel, resendLabel, className, }: TwoStepVerificationFormProps) => react.JSX.Element;
|
|
6391
7647
|
|
|
6392
7648
|
type ColorSwatchProps = {
|
|
6393
7649
|
/** Color hex (e.g. `#465fff`). */
|
|
@@ -6893,6 +8149,27 @@ type BlockquoteProps = {
|
|
|
6893
8149
|
};
|
|
6894
8150
|
declare const Blockquote: ({ children, variant, size, align, author, role, authorAvatar, className, }: BlockquoteProps) => react.JSX.Element;
|
|
6895
8151
|
|
|
8152
|
+
type HighlightProps = {
|
|
8153
|
+
/** The text. It is drawn as text: markup in it shows as written. */
|
|
8154
|
+
text: string;
|
|
8155
|
+
/**
|
|
8156
|
+
* What was searched for. Each word (split on spaces) is marked wherever it occurs in `text`,
|
|
8157
|
+
* whatever its case, and every character in it is plain text, never a pattern. Nothing is marked
|
|
8158
|
+
* for an empty query.
|
|
8159
|
+
*/
|
|
8160
|
+
query: string;
|
|
8161
|
+
};
|
|
8162
|
+
/**
|
|
8163
|
+
* `Highlight` — `text` with the words of `query` wrapped in `<mark>`, for a search result or a
|
|
8164
|
+
* filtered list. It renders inline and takes the style of where it sits, so it goes inside a
|
|
8165
|
+
* heading, a link or a table cell:
|
|
8166
|
+
*
|
|
8167
|
+
* <Highlight text="Disk alert on rack B4" query="alert" />
|
|
8168
|
+
*
|
|
8169
|
+
* Built from text nodes and `<mark>` elements only, never `dangerouslySetInnerHTML`.
|
|
8170
|
+
*/
|
|
8171
|
+
declare const Highlight: ({ text, query }: HighlightProps) => react.JSX.Element;
|
|
8172
|
+
|
|
6896
8173
|
type KbdSize = 'sm' | 'md';
|
|
6897
8174
|
type KbdProps = {
|
|
6898
8175
|
children: ReactNode;
|
|
@@ -7174,6 +8451,14 @@ type ChatConversation = {
|
|
|
7174
8451
|
unread?: number;
|
|
7175
8452
|
presence?: ChatPresence;
|
|
7176
8453
|
avatarSrc?: string;
|
|
8454
|
+
/**
|
|
8455
|
+
* Drawn in place of the `Avatar` that `name` and `avatarSrc` make: an `AvatarGroup` or an
|
|
8456
|
+
* `IconBox` for a group conversation. It sits in a 40px-high slot, centered, and a node
|
|
8457
|
+
* wider than 40px pushes the text along. The `presence` dot still marks its end corner.
|
|
8458
|
+
* Hidden from assistive technology, as the picture of the conversation: the row is named by
|
|
8459
|
+
* `name`, so a stack of members does not turn into a long list of names to read.
|
|
8460
|
+
*/
|
|
8461
|
+
avatar?: ReactNode;
|
|
7177
8462
|
};
|
|
7178
8463
|
type ChatConversationListProps = {
|
|
7179
8464
|
conversations: ChatConversation[];
|
|
@@ -7186,7 +8471,9 @@ type ChatConversationListProps = {
|
|
|
7186
8471
|
};
|
|
7187
8472
|
/**
|
|
7188
8473
|
* Conversation picker for the start pane of a two-pane chat: name, last
|
|
7189
|
-
* message, time, unread count and presence of each thread.
|
|
8474
|
+
* message, time, unread count and presence of each thread. A conversation
|
|
8475
|
+
* with an `avatar` node (a group, a channel) shows it in place of the avatar
|
|
8476
|
+
* made from its name.
|
|
7190
8477
|
*/
|
|
7191
8478
|
declare const ChatConversationList: ({ conversations, selectedId, onSelect, label, className, }: ChatConversationListProps) => react.JSX.Element;
|
|
7192
8479
|
|
|
@@ -7917,5 +9204,5 @@ declare const countLogLevels: (lines: readonly LogLine[]) => Record<LogLevelKey,
|
|
|
7917
9204
|
*/
|
|
7918
9205
|
declare const filterLogLines: (lines: readonly LogLine[], levels?: readonly LogLevelKey[], sources?: readonly string[]) => readonly LogLine[];
|
|
7919
9206
|
|
|
7920
|
-
export { AccentPicker, Accordion, ActionPanel, ActiveFiltersBar, ActivityFeed, AlertBanner, AnnouncementBar, AppearanceMenu, AppearanceSettings, AuditDiff, AuthLayout, Avatar, AvatarGroup, AvatarUploader, BEAT_NAME, BEAT_STATUSES, BackToTopFab, Backdrop, Badge, BarList, Blockquote, Breadcrumb, Button, ButtonGroup, COSMOS_ACCENTS, COSMOS_DENSITIES, COSMOS_FONTS, COSMOS_RADII, COSMOS_SYSTEM_THEME, COSMOS_TEXT_SIZES, COSMOS_THEMES, CUSTOMIZER_DEFAULT_VALUE, CUSTOMIZER_SECTIONS, Calendar, Card, Carousel, CarouselRoot, ChatComposer, ChatConversationList, ChatDaySeparator, ChatMessage, ChatMessageActions, ChatSources, ChatSuggestions, ChatThread, ChatToolCall, ChatTypingIndicator, Chatbot, Checkbox, CheckboxGroup, Clipboard, Clock, ColBox, ColorInput, ColorSwatch, ColumnFilterDropdown, ColumnHeader, Combobox, CommandPalette, CommandPaletteTrigger, Comment, CommentComposer, CommentThread, ConfirmationModal, ContentNarrow, CookieBanner, Countdown, Customizer, DEFAULT_THRESHOLDS, DataTable, DatePicker, DateTime, DescriptionList, Divider, Drawer, Dropdown, Dropzone, EmptyState, ErrorPage, ErrorState, EventCalendar, FieldSize, Figure, FileInput, FileTile, FormFooter, FormRow, GridList, HealthBadge, HealthCheckList, HealthDot, HealthMatrix, HealthSummary, HeartbeatBar, HelpOverlay, IconBox, ImageGrid, Input, IntegrationCard, Intent, JobLog, KanbanBoard, Kbd, KpiCard, LOG_LEVELS, LOG_LEVEL_KEYS, LOG_LEVEL_LABEL, Link, LinkProvider, List, LoadingState, LogEntryDetail, LogLevelBadge, LogToolbar, LogViewer, MediaObject, Menu, MiniCalendar, Modal, MonitorRow, MultiSelect, Navbar, NotificationCard, NotificationsPanel, NumberInput, OptionCard, OptionPicker, OtpInput, PageActionButton, PageActionIconButton, PageContainer, PageHeader, Pagination, PaletteCard, PalettePicker, PasswordInput, PasswordPolicyChecker, PhoneInput, PipelineStages, Popover, ProfileHeader, ProgressBar, ProgressRing, REFRESH_OPTIONS, Radio, RadioGroup, Rating, RecordPager, RefreshButton, RelativeTime, ResetPasswordForm, Ribbon, Row, RowActionButton, RowActionsMenu, SEVERITY_ORDER, STATUS_DOT, STATUS_NAME, STATUS_PILL, SearchInput, SecretValue, SectionCard, SectionLabel, SegmentedControl, Select, Shell, Sidebar, SidebarToggle, SignInForm, SignUpForm, Sk, SkeletonAvatarText, SkeletonList, SkeletonTable, SkeletonText, Slider, SocialAuthButtons, Spinner, SplitView, StackedList, StatefulSaveButton, StatusBadge, Stepper, StepperRoot, StickyScrollNav, Table, TableAmountCell, TableBody, TableCaption, TableCell, TableDescriptionCell, TableFoot, TableHead, TableHeaderCell, TableIdCell, TableIdentityCell, TableRow, TableSkeletonRows, Tabs, Tag, TagInput, Textarea, ThemeToggle, ThemeToggleTri, TimePicker, Timeline, Toaster, Toggle, Tooltip, TooltipHelp, Topbar, TrendDelta, TwoStepVerificationForm, UnsavedIndicator, UploadQueue, UptimeBars, UptimeStat, UserMenu, VerticalNavigation, VideoEmbed, ZoomBar, applyAppearance, compareSeverity, countLogLevels, defaultPasswordRules, filterLogLines, flattenChecks, formatUptime, groupWorst, isDarkTheme, jobLogLineHref, parseJobLogHash, parseLogLevel, resolveTheme, resolveThresholds, systemPrefersDark, toCsv, uptimeLevel, useAutoRefresh, useSplitView, watchSystemTheme, worstStatus };
|
|
7921
|
-
export type { AccentColor, AccentPickerProps, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSize, AccordionTriggerProps, ActionPanelLayout, ActionPanelProps, ActiveFilter, ActiveFiltersBarProps, ActivityFeedIntent, ActivityFeedItemProps, ActivityFeedProps, AlertBannerAppearance, AlertBannerBodyTone, AlertBannerIntent, AlertBannerProps, AnnouncementBarIntent, AnnouncementBarProps, AppearanceMenuProps, AppearanceMenuSize, AppearanceSettingsProps, AuditChange, AuditDiffLabels, AuditDiffProps, AuditDiffVariant, AuthLayoutProps, AuthLayoutVariant, AvatarGroupProps, AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarStatus, AvatarUploaderProps, AvatarUploaderSize, BackToTopFabIntent, BackToTopFabPosition, BackToTopFabProps, BackdropProps, BadgeAppearance, BadgeProps, BadgeShape, BadgeSize, BarListIntent, BarListItem, BarListProps, Beat, BeatStatus, BlockquoteAlign, BlockquoteProps, BlockquoteSize, BlockquoteVariant, BreadcrumbItem, BreadcrumbProps, BreadcrumbSeparator, ButtonGroupOrientation, ButtonGroupProps, ButtonIntent, ButtonProps, ButtonShape, ButtonSize, ButtonVariant, CalendarEvent, CalendarProps, CardImageProps, CardOrientation, CardProps, CarouselControlsProps, CarouselIndicatorsProps, CarouselOptions, CarouselProps, CarouselSlideProps, CarouselThumbnailsProps, CarouselViewportProps, CellEditor, ChatComposerProps, ChatConversation, ChatConversationListProps, ChatDaySeparatorProps, ChatFeedback, ChatMessageActionsProps, ChatMessageDirection, ChatMessageProps, ChatMessageStatus, ChatPresence, ChatSource, ChatSourcesProps, ChatSuggestionsProps, ChatThreadProps, ChatToolCallProps, ChatToolCallStatus, ChatTypingIndicatorProps, ChatbotMessage, ChatbotProps, CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, CheckboxSize, ClipboardProps, ClipboardSize, ClipboardVariant, ClockProps, ClockVariant, ColBoxProps, ColorInputProps, ColorPreset, ColorSwatchProps, ColumnDef, ColumnEdit, ColumnFilterDropdownProps, ColumnHeaderProps, ColumnPin, ComboboxOption, ComboboxProps, CommandPaletteFooterProps, CommandPaletteGroupProps, CommandPaletteInputProps, CommandPaletteItemProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerProps, CommentComposerMode, CommentComposerProps, CommentLabels, CommentProps, CommentThreadProps, CommentVariant, ConfirmationModalProps, ContentNarrowProps, CookieBannerPosition, CookieBannerProps, CosmosAccent, CosmosAccentMeta, CosmosAppearance, CosmosDensity, CosmosDensityMeta, CosmosDirection, CosmosFont, CosmosFontMeta, CosmosRadius, CosmosRadiusMeta, CosmosSystemThemeMeta, CosmosSystemThemes, CosmosTextSize, CosmosTextSizeMeta, CosmosTheme, CosmosThemeChoice, CosmosThemeMeta, CosmosToasterProps, CountdownProps, CountdownUnit, CountdownVariant, CustomizerLayout, CustomizerPreset, CustomizerProps, CustomizerSection, CustomizerSidebar, CustomizerValue, DataTableBulkAction, DataTableDensity, DataTableExportQuery, DataTableFilterTabOption, DataTableFilterTabsConfig, DataTableProps, DataTableSort, DataTableView, DatePickerMode, DatePickerProps, DateRange, DateTimeFormat, DateTimeProps, DescriptionListItemProps, DescriptionListProps, DividerAlign, DividerIconProps, DividerProps, DividerRowProps, DrawerHeaderProps, DrawerProps, DrawerSide, DrawerSize, DropdownDivider, DropdownItem, DropdownOption, DropdownProps, DropzoneProps, DropzoneRejection, EmptyStateIntent, EmptyStateProps, ErrorPageProps, ErrorStateProps, EventCalendarIntent, EventCalendarProps, FigureAlign, FigureProps, FigureRadius, FigureSize, FileInputProps, FileKind, FileTileLayout, FileTileProps, FormFooterAlign, FormFooterProps, FormRowProps, GridListCardProps, GridListCols, GridListFooterActionProps, GridListFooterProps, GridListProps, HealthBadgeProps, HealthCheck, HealthCheckGroup, HealthCheckListProps, HealthDotProps, HealthMatrixCell, HealthMatrixColumn, HealthMatrixProps, HealthMatrixRow, HealthStatus, HealthSummaryProps, HeartbeatBarProps, HeartbeatBarSize, HeartbeatBarVariant, HelpOverlayProps, HelpOverlaySectionProps, HelpOverlayShortcutProps, IconBoxProps, IconBoxSize, ImageGridColumns, ImageGridGap, ImageGridItemProps, ImageGridLayout, ImageGridProps, InputProps, IntegrationCardProps, IntegrationStatus, JobLogControl, JobLogLine, JobLogLineRef, JobLogProps, JobLogStep, JobLogTimestampFormat, JobStatus, KanbanBoardProps, KanbanCard, KanbanColumn, KanbanMove, KbdProps, KbdSize, KpiCardIntent, KpiCardProps, LinkComponent, LinkComponentProps, LinkIntent, LinkProps, LinkProviderProps, LinkVariant, ListItemProps, ListMarker, ListOrientation, ListProps, ListSpacing, ListVariant, LoadingStateProps, LogColumn, LogDensity, LogEntryContext, LogEntryDetailProps, LogLevel, LogLevelBadgeProps, LogLevelKey, LogLine, LogLineId, LogOrder, LogTone, LogToolbarProps, LogViewerProps, MediaObjectAlign, MediaObjectBodyProps, MediaObjectImageProps, MediaObjectPosition, MediaObjectProps, MenuCheckboxItemProps, MenuContentProps, MenuGroupProps, MenuItemIntent, MenuItemProps, MenuProps, MenuRadioItemProps, MenuTriggerProps, MiniCalendarProps, ModalAlertIntent, ModalAlertLayout, ModalAlertProps, ModalHeaderProps, ModalProps, ModalSize, MonitorRowProps, MonitorState, MultiSelectOption, MultiSelectProps, NavbarItemProps, NavbarItemsProps, NavbarMenuProps, NavbarMobileMenuButtonProps, NavbarProps, NavbarTheme, NotificationCardCondensedProps, NotificationCardSimpleProps, NotificationIntent, NotificationsPanelContentProps, NotificationsPanelCountersProps, NotificationsPanelEmptyProps, NotificationsPanelFooterProps, NotificationsPanelHeaderActionProps, NotificationsPanelHeaderProps, NotificationsPanelIntent, NotificationsPanelItemProps, NotificationsPanelListProps, NotificationsPanelProps, NotificationsPanelTriggerProps, NumberInputProps, OptionCardProps, OptionItem, OptionPickerProps, OtpInputProps, PageActionButtonProps, PageActionIconButtonProps, PageActionIntent, PageActionVariant, PageContainerProps, PageContainerWidth, PageHeaderMetaItemProps, PageHeaderProps, PaginationPrevNextLabel, PaginationProps, PaginationSize, PaginationVariant, PaletteCardProps, PaletteMeta, PalettePickerProps, PalettePreview, PasswordInputProps, PasswordPolicyCheckerProps, PasswordRule, PhoneInputProps, PipelineStage, PipelineStageIntent, PipelineStagesProps, PopoverAlign, PopoverContentProps, PopoverPosition, PopoverProps, PopoverTriggerProps, ProfileHeaderProps, ProfileHeaderStat, ProgressBarIntent, ProgressBarLabel, ProgressBarProps, ProgressBarSegment, ProgressBarSize, ProgressRingIntent, ProgressRingProps, ProgressRingSize, RadioGroupOption, RadioGroupProps, RadioProps, RadioSize, RatingProps, RecordPagerHotkeys, RecordPagerLabels, RecordPagerProps, RecordPagerVariant, RefreshButtonProps, RefreshOption, RelativeTimeProps, ResetPasswordFormProps, RibbonIntent, RibbonPosition, RibbonProps, RibbonShape, RowActionButtonProps, RowActionsMenuProps, RowProps, SaveState, SearchInputProps, SecretValueProps, SectionCardProps, SectionLabelProps, SegmentOption, SegmentedControlProps, SegmentedProgressBarProps, SelectOption, SelectProps, ShellContainer, ShellProps, SidebarGroupProps, SidebarItemProps, SidebarProps, SidebarSectionProps, SidebarToggleProps, SidebarToggleVariant, SidebarVariant, SignInFormProps, SignInFormValues, SignUpFormProps, SignUpFormValues, SingleProgressBarProps, SkProps, SkeletonAvatarTextProps, SkeletonListProps, SkeletonTableProps, SkeletonTextProps, SliderIntent, SliderProps, SliderValue, SocialAuthButtonsLayout, SocialAuthButtonsProps, SocialProvider, SortDirection, SpinnerIntent, SpinnerProps, SpinnerSize, SplitViewBreakpoint, SplitViewPaneProps, SplitViewProps, StackedListHeaderProps, StackedListItemProps, StackedListProps, StatefulSaveButtonProps, StatusBadgeProps, StepStatus, StepperOrientation, StepperProps, StepperSize, StepperStepProps, StepperVariant, StickyScrollNavProps, StickyScrollNavSection, TabProps, TableAmountCellProps, TableBodyProps, TableCaptionProps, TableCellProps, TableDescriptionCellProps, TableFootProps, TableHeadProps, TableHeaderCellProps, TableIdCellProps, TableIdentityCellProps, TableProps, TableRowProps, TableSkeletonRowsProps, TabsOrientation, TabsProps, TabsVariant, TagInputProps, TagProps, TagSize, TextareaProps, TextareaResize, ThemeMode, ThemeModeChoice, ThemeToggleProps, ThemeToggleSize, ThemeToggleTriProps, ThemeToggleTriSize, TimePickerProps, TimelineIntent, TimelineItem, TimelineProps, TimelineVariant, ToggleProps, ToggleSize, TooltipIntent, TooltipPosition, TooltipProps, TooltipVariant, TopbarProps, TrendDeltaProps, TrendDeltaSize, TwoStepVerificationFormProps, UnsavedIndicatorProps, UploadQueueItem, UploadQueueProps, UploadStatus, UptimeBarsPeriod, UptimeBarsProps, UptimeCertificate, UptimeDay, UptimeLevel, UptimePeriod, UptimeStatProps, UptimeThresholds, UserMenuContentProps, UserMenuHeaderProps, UserMenuItemIntent, UserMenuItemProps, UserMenuProps, UserMenuTriggerProps, VerticalNavigationItemProps, VerticalNavigationProps, VerticalNavigationSectionProps, VideoEmbedAspect, VideoEmbedProps, ZoomBarProps };
|
|
9207
|
+
export { AccentPicker, Accordion, ActionPanel, ActiveFiltersBar, ActivityFeed, AlertBanner, Amount, AnnouncementBar, AppearanceMenu, AppearanceSettings, AuditDiff, AuthLayout, Avatar, AvatarGroup, AvatarUploader, BEAT_NAME, BEAT_STATUSES, BackToTopFab, Backdrop, Badge, BarList, Blockquote, Breadcrumb, Button, ButtonGroup, COSMOS_ACCENTS, COSMOS_DENSITIES, COSMOS_FONTS, COSMOS_RADII, COSMOS_SYSTEM_THEME, COSMOS_TEXT_SIZES, COSMOS_THEMES, CUSTOMIZER_DEFAULT_VALUE, CUSTOMIZER_SECTIONS, Calendar, Card, CardCvcInput, CardExpiryInput, CardFields, CardNumberInput, Carousel, CarouselRoot, ChatComposer, ChatConversationList, ChatDaySeparator, ChatMessage, ChatMessageActions, ChatSources, ChatSuggestions, ChatThread, ChatToolCall, ChatTypingIndicator, Chatbot, Checkbox, CheckboxGroup, Clipboard, Clock, ColBox, ColorInput, ColorSwatch, ColumnFilterDropdown, ColumnHeader, Combobox, CommandPalette, CommandPaletteTrigger, Comment, CommentComposer, CommentThread, ConfirmationModal, ContentNarrow, CookieBanner, Countdown, Customizer, DEFAULT_THRESHOLDS, DataTable, DatePicker, DateTime, DescriptionList, Divider, Drawer, Dropdown, Dropzone, EmptyState, ErrorPage, ErrorState, ErrorSummary, EventCalendar, FieldSize, Figure, FileInput, FileTile, FormFooter, FormRow, GridList, HealthBadge, HealthCheckList, HealthDot, HealthMatrix, HealthSummary, HeartbeatBar, HelpOverlay, Highlight, IconBox, ImageGrid, Input, IntegrationCard, Intent, JobLog, KanbanBoard, Kbd, KpiCard, LOG_LEVELS, LOG_LEVEL_KEYS, LOG_LEVEL_LABEL, Lightbox, LineItemsEditor, Link, LinkProvider, List, LoadingState, LogEntryDetail, LogLevelBadge, LogToolbar, LogViewer, MediaObject, Menu, MiniCalendar, Modal, MonitorRow, MultiSelect, Navbar, NewPasswordForm, NotificationCard, NotificationRow, NotificationsPanel, NumberInput, OptionCard, OptionPicker, OtpInput, PageActionButton, PageActionIconButton, PageContainer, PageHeader, Pagination, PaletteCard, PalettePicker, PasswordInput, PasswordPolicyChecker, PasswordStrengthMeter, PermissionGrid, PhoneInput, PipelineStages, PlanCard, Popover, ProfileHeader, ProgressBar, ProgressRing, REFRESH_OPTIONS, Radio, RadioGroup, Rating, RecordPager, RefreshButton, RelativeTime, ResetPasswordForm, Ribbon, Row$1 as Row, RowActionButton, RowActionsMenu, SEVERITY_ORDER, STATUS_DOT, STATUS_NAME, STATUS_PILL, SearchInput, SecretValue, SectionCard, SectionLabel, SegmentedControl, Select, Shell, Sidebar, SidebarToggle, SignInForm, SignUpForm, SiteFooter, Sk, SkeletonAvatarText, SkeletonList, SkeletonTable, SkeletonText, Slider, SocialAuthButtons, Spinner, SplitView, StackedList, StatefulSaveButton, StatusBadge, Stepper, StepperRoot, StickyScrollNav, Table, TableAmountCell, TableBody, TableCaption, TableCell, TableDescriptionCell, TableFoot, TableHead, TableHeaderCell, TableIdCell, TableIdentityCell, TableRow, TableSkeletonRows, Tabs, Tag, TagInput, Textarea, ThemeToggle, ThemeToggleTri, TimePicker, Timeline, Toaster, Toggle, Tooltip, TooltipHelp, Topbar, Totals, TrendDelta, TwoStepVerificationForm, UnsavedIndicator, UploadQueue, UptimeBars, UptimeStat, UserMenu, VerticalNavigation, VideoEmbed, ZoomBar, applyAppearance, cardBrand, cardCvcLength, cardNumberLengths, cellKey, compareSeverity, countLogLevels, defaultPasswordRules, expiryValid, filterLogLines, flattenChecks, formatMoney, formatUptime, groupWorst, isDarkTheme, jobLogLineHref, luhnValid, parseJobLogHash, parseLogLevel, resolveTheme, resolveThresholds, summarizeLineItems, systemPrefersDark, toCsv, uptimeLevel, useAutoRefresh, useSplitView, watchSystemTheme, worstStatus };
|
|
9208
|
+
export type { AccentColor, AccentPickerProps, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSize, AccordionTriggerProps, ActionPanelLayout, ActionPanelProps, ActiveFilter, ActiveFiltersBarProps, ActivityFeedIntent, ActivityFeedItemProps, ActivityFeedProps, AlertBannerAppearance, AlertBannerBodyTone, AlertBannerIntent, AlertBannerProps, AmountProps, AnnouncementBarIntent, AnnouncementBarProps, AppearanceMenuProps, AppearanceMenuSize, AppearanceSettingsProps, AuditChange, AuditDiffLabels, AuditDiffProps, AuditDiffVariant, AuthLayoutProps, AuthLayoutSize, AuthLayoutVariant, AvatarGroupProps, AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarStatus, AvatarUploaderProps, AvatarUploaderSize, BackToTopFabIntent, BackToTopFabPosition, BackToTopFabProps, BackdropProps, BadgeAppearance, BadgeProps, BadgeShape, BadgeSize, BarListIntent, BarListItem, BarListProps, Beat, BeatStatus, BlockquoteAlign, BlockquoteProps, BlockquoteSize, BlockquoteVariant, BreadcrumbItem, BreadcrumbProps, BreadcrumbSeparator, ButtonGroupOrientation, ButtonGroupProps, ButtonIntent, ButtonProps, ButtonShape, ButtonSize, ButtonVariant, CalendarEvent, CalendarProps, CalendarView, CardBrand, CardCvcInputProps, CardExpiryInputProps, CardFieldsProps, CardImageProps, CardNumberInputProps, CardOrientation, CardProps, CardValue, CarouselControlsProps, CarouselIndicatorsProps, CarouselOptions, CarouselProps, CarouselSlideProps, CarouselThumbnailsProps, CarouselViewportProps, CellEditor, ChatComposerProps, ChatConversation, ChatConversationListProps, ChatDaySeparatorProps, ChatFeedback, ChatMessageActionsProps, ChatMessageDirection, ChatMessageProps, ChatMessageStatus, ChatPresence, ChatSource, ChatSourcesProps, ChatSuggestionsProps, ChatThreadProps, ChatToolCallProps, ChatToolCallStatus, ChatTypingIndicatorProps, ChatbotMessage, ChatbotProps, CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, CheckboxSize, ClipboardProps, ClipboardSize, ClipboardVariant, ClockProps, ClockVariant, ColBoxProps, ColorInputProps, ColorPreset, ColorSwatchProps, ColumnDef, ColumnEdit, ColumnFilterDropdownProps, ColumnHeaderProps, ColumnPin, ComboboxOption, ComboboxProps, CommandPaletteFooterProps, CommandPaletteGroupProps, CommandPaletteInputProps, CommandPaletteItemProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerProps, CommentComposerMode, CommentComposerProps, CommentLabels, CommentProps, CommentThreadProps, CommentVariant, ConfirmationModalProps, ContentNarrowProps, CookieBannerPosition, CookieBannerProps, CosmosAccent, CosmosAccentMeta, CosmosAppearance, CosmosDensity, CosmosDensityMeta, CosmosDirection, CosmosFont, CosmosFontMeta, CosmosRadius, CosmosRadiusMeta, CosmosSystemThemeMeta, CosmosSystemThemes, CosmosTextSize, CosmosTextSizeMeta, CosmosTheme, CosmosThemeChoice, CosmosThemeMeta, CosmosToasterProps, CountdownProps, CountdownUnit, CountdownVariant, CustomizerLayout, CustomizerPreset, CustomizerProps, CustomizerSection, CustomizerSidebar, CustomizerValue, DataTableBulkAction, DataTableDensity, DataTableExportQuery, DataTableFilterTabOption, DataTableFilterTabsConfig, DataTableProps, DataTableSort, DataTableView, DatePickerMode, DatePickerProps, DateRange, DateRangePreset, DateTimeFormat, DateTimeProps, DescriptionListItemProps, DescriptionListProps, DividerAlign, DividerIconProps, DividerProps, DividerRowProps, DrawerHeaderProps, DrawerProps, DrawerSide, DrawerSize, DropdownDivider, DropdownItem, DropdownOption, DropdownProps, DropzoneProps, DropzoneRejection, EmptyStateIntent, EmptyStateProps, ErrorPageProps, ErrorStateProps, ErrorSummaryItem, ErrorSummaryProps, EventCalendarIntent, EventCalendarProps, FigureAlign, FigureProps, FigureRadius, FigureSize, FileInputProps, FileKind, FileTileLayout, FileTileProps, FormFooterAlign, FormFooterProps, FormRowProps, FormatMoneyOptions, GridListCardProps, GridListCols, GridListFooterActionProps, GridListFooterProps, GridListProps, HealthBadgeProps, HealthCheck, HealthCheckGroup, HealthCheckListProps, HealthDotProps, HealthMatrixCell, HealthMatrixColumn, HealthMatrixProps, HealthMatrixRow, HealthStatus, HealthSummaryProps, HeartbeatBarProps, HeartbeatBarSize, HeartbeatBarVariant, HelpOverlayProps, HelpOverlaySectionProps, HelpOverlayShortcutProps, HighlightProps, IconBoxProps, IconBoxSize, ImageGridColumns, ImageGridGap, ImageGridItemProps, ImageGridLayout, ImageGridProps, InputProps, IntegrationCardProps, IntegrationStatus, JobLogControl, JobLogLine, JobLogLineRef, JobLogProps, JobLogStep, JobLogTimestampFormat, JobStatus, KanbanBoardProps, KanbanCard, KanbanColumn, KanbanMove, KbdProps, KbdSize, KpiCardChartPosition, KpiCardIntent, KpiCardProps, LightboxItem, LightboxProps, LineItem, LineItemErrors, LineItemsCatalogueEntry, LineItemsEditorProps, LineItemsLabels, LineItemsSummary, LinkComponent, LinkComponentProps, LinkIntent, LinkProps, LinkProviderProps, LinkVariant, ListItemProps, ListMarker, ListOrientation, ListProps, ListSpacing, ListVariant, LoadingStateProps, LogColumn, LogDensity, LogEntryContext, LogEntryDetailProps, LogLevel, LogLevelBadgeProps, LogLevelKey, LogLine, LogLineId, LogOrder, LogTone, LogToolbarProps, LogViewerProps, MediaObjectAlign, MediaObjectBodyProps, MediaObjectImageProps, MediaObjectPosition, MediaObjectProps, MenuCheckboxItemProps, MenuContentProps, MenuGroupProps, MenuItemIntent, MenuItemProps, MenuProps, MenuRadioItemProps, MenuTriggerProps, MiniCalendarProps, ModalAlertIntent, ModalAlertLayout, ModalAlertProps, ModalHeaderProps, ModalProps, ModalSize, MoneySignDisplay, MoneyTrailingZeroDisplay, MonitorRowProps, MonitorState, MultiSelectOption, MultiSelectProps, NavbarItemProps, NavbarItemsProps, NavbarMenuProps, NavbarMobileMenuButtonProps, NavbarProps, NavbarTheme, NewPasswordFormProps, NewPasswordFormView, NotificationCardCondensedProps, NotificationCardSimpleProps, NotificationIntent, NotificationRowIntent, NotificationRowProps, NotificationsPanelContentProps, NotificationsPanelCountersProps, NotificationsPanelEmptyProps, NotificationsPanelFooterProps, NotificationsPanelHeaderActionProps, NotificationsPanelHeaderProps, NotificationsPanelIntent, NotificationsPanelItemProps, NotificationsPanelListProps, NotificationsPanelProps, NotificationsPanelTriggerProps, NumberInputProps, OptionCardProps, OptionItem, OptionPickerProps, OtpInputProps, PageActionButtonProps, PageActionIconButtonProps, PageActionIntent, PageActionVariant, PageContainerProps, PageContainerWidth, PageHeaderMetaItemProps, PageHeaderProps, PaginationPrevNextLabel, PaginationProps, PaginationSize, PaginationVariant, PaletteCardProps, PaletteMeta, PalettePickerProps, PalettePreview, PasswordInputProps, PasswordPolicyCheckerProps, PasswordPolicyLabels, PasswordRule, PasswordStrengthLabels, PasswordStrengthLevels, PasswordStrengthMeterProps, PermissionGridColumn, PermissionGridGroup, PermissionGridLabels, PermissionGridProps, PermissionGridRow, PhoneInputProps, PipelineStage, PipelineStageIntent, PipelineStagesProps, PlanCardHeadingLevel, PlanCardProps, PlanFeature, PopoverAlign, PopoverContentProps, PopoverPosition, PopoverProps, PopoverTriggerProps, ProfileHeaderProps, ProfileHeaderStat, ProgressBarIntent, ProgressBarLabel, ProgressBarProps, ProgressBarSegment, ProgressBarSize, ProgressRingIntent, ProgressRingProps, ProgressRingSize, RadioGroupOption, RadioGroupProps, RadioProps, RadioSize, RatingProps, RecordPagerHotkeys, RecordPagerLabels, RecordPagerProps, RecordPagerVariant, RefreshButtonProps, RefreshOption, RelativeTimeProps, ResendLabels, ResetPasswordFormProps, RibbonIntent, RibbonPosition, RibbonProps, RibbonShape, RowActionButtonProps, RowActionsMenuProps, RowProps, SaveState, SearchInputProps, SecretValueProps, SectionCardProps, SectionLabelProps, SegmentOption, SegmentedControlProps, SegmentedProgressBarProps, SelectOption, SelectProps, ShellContainer, ShellProps, ShellVariant, SidebarGroupProps, SidebarGutter, SidebarItemProps, SidebarProps, SidebarSectionProps, SidebarToggleProps, SidebarToggleVariant, SidebarVariant, SignInFormProps, SignInFormValues, SignUpFormProps, SignUpFormValues, SingleProgressBarProps, SiteFooterAsideProps, SiteFooterBannerProps, SiteFooterBottomLink, SiteFooterBottomProps, SiteFooterBrandProps, SiteFooterColumnProps, SiteFooterLinkProps, SiteFooterProps, SiteFooterTheme, SiteFooterTitleProps, SiteFooterVariant, SkProps, SkeletonAvatarTextProps, SkeletonListProps, SkeletonTableProps, SkeletonTextProps, SliderIntent, SliderProps, SliderValue, SocialAuthButtonsLayout, SocialAuthButtonsProps, SocialProvider, SortDirection, SpinnerIntent, SpinnerProps, SpinnerSize, SplitViewBreakpoint, SplitViewPaneProps, SplitViewProps, StackedListAction, StackedListHeaderProps, StackedListItemProps, StackedListProps, StatefulSaveButtonProps, StatusBadgeProps, StepStatus, StepperOrientation, StepperProps, StepperSize, StepperStepProps, StepperVariant, StickyScrollNavProps, StickyScrollNavSection, TabProps, TableAmountCellProps, TableBodyProps, TableCaptionProps, TableCellProps, TableDescriptionCellProps, TableFootProps, TableHeadProps, TableHeaderCellProps, TableIdCellProps, TableIdentityCellProps, TableProps, TableRowProps, TableSkeletonRowsProps, TabsOrientation, TabsProps, TabsVariant, TagInputProps, TagProps, TagSize, TextareaProps, TextareaResize, ThemeMode, ThemeModeChoice, ThemeToggleProps, ThemeToggleSize, ThemeToggleTriProps, ThemeToggleTriSize, TimePickerProps, TimelineIntent, TimelineItem, TimelineProps, TimelineVariant, ToggleProps, ToggleSize, TooltipIntent, TooltipPosition, TooltipProps, TooltipVariant, TopbarProps, TotalsNoteProps, TotalsProps, TotalsRowProps, TrendDeltaProps, TrendDeltaSize, TwoStepMethod, TwoStepVerificationFormProps, TwoStepVerificationLabels, UnsavedIndicatorProps, UploadQueueItem, UploadQueueProps, UploadStatus, UptimeBarsPeriod, UptimeBarsProps, UptimeCertificate, UptimeDay, UptimeLevel, UptimePeriod, UptimeStatProps, UptimeThresholds, UserMenuContentProps, UserMenuHeaderProps, UserMenuItemIntent, UserMenuItemProps, UserMenuProps, UserMenuTriggerProps, VerticalNavigationItemProps, VerticalNavigationProps, VerticalNavigationSectionProps, VideoEmbedAspect, VideoEmbedProps, ZoomBarProps };
|