@kb.ui/react 0.10.4 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +142 -707
  2. package/dist/components/Accordion/Accordion.d.ts +33 -0
  3. package/dist/components/Avatar/Avatar.d.ts +19 -0
  4. package/dist/components/Code/Code.d.ts +26 -3
  5. package/dist/components/Code/tokenize.d.ts +5 -0
  6. package/dist/components/CodeBlock/CodeBlock.d.ts +10 -0
  7. package/dist/components/Collection/Collection.d.ts +99 -0
  8. package/dist/components/Collection/useCollection.d.ts +66 -0
  9. package/dist/components/CollectionList/CollectionList.d.ts +12 -0
  10. package/dist/components/CollectionRow/CollectionRow.d.ts +17 -0
  11. package/dist/components/Combobox/Combobox.d.ts +14 -2
  12. package/dist/components/ConfirmAction/ConfirmAction.d.ts +42 -0
  13. package/dist/components/CopyableText/CopyableText.d.ts +38 -0
  14. package/dist/components/CopyableText/content.d.ts +14 -0
  15. package/dist/components/Dashboard/Dashboard.d.ts +17 -0
  16. package/dist/components/DescriptionList/DescriptionList.d.ts +20 -0
  17. package/dist/components/Dialog/Dialog.d.ts +3 -1
  18. package/dist/components/Disclosure/Disclosure.d.ts +21 -0
  19. package/dist/components/EmptyState/EmptyState.d.ts +30 -0
  20. package/dist/components/Form/Form.d.ts +19 -0
  21. package/dist/components/FormSection/FormSection.d.ts +26 -0
  22. package/dist/components/Gallery/Gallery.d.ts +26 -0
  23. package/dist/components/Grid/Grid.d.ts +17 -6
  24. package/dist/components/Image/Image.d.ts +20 -0
  25. package/dist/components/Link/Link.d.ts +15 -2
  26. package/dist/components/PageHeader/PageHeader.d.ts +27 -0
  27. package/dist/components/Panel/Panel.d.ts +3 -1
  28. package/dist/components/Popover/Popover.d.ts +55 -0
  29. package/dist/components/Settings/Settings.d.ts +11 -0
  30. package/dist/components/Skeleton/Skeleton.d.ts +34 -0
  31. package/dist/components/Spinner/Spinner.d.ts +26 -0
  32. package/dist/components/Stack/Stack.d.ts +15 -0
  33. package/dist/components/StatsRow/StatsRow.d.ts +33 -0
  34. package/dist/components/SupportingPane/SupportingPane.d.ts +15 -0
  35. package/dist/components/Table/Table.d.ts +65 -0
  36. package/dist/components/Tabs/Tabs.d.ts +69 -0
  37. package/dist/components/Tabs/index.d.ts +1 -0
  38. package/dist/components/Thumbnail/Thumbnail.d.ts +14 -0
  39. package/dist/components/Toast/Toast.d.ts +72 -0
  40. package/dist/index.d.ts +39 -4
  41. package/dist/index.js +3901 -1238
  42. package/dist/index.js.map +1 -1
  43. package/dist/styles.css +1 -1
  44. package/dist/utils/CollapsiblePanel.d.ts +10 -0
  45. package/dist/utils/useClipboard.d.ts +28 -0
  46. package/docs/components/Accordion.md +66 -0
  47. package/docs/components/Avatar.md +80 -0
  48. package/docs/components/Badge.md +37 -0
  49. package/docs/components/Button.md +46 -0
  50. package/docs/components/Callout.md +41 -0
  51. package/docs/components/Card.md +41 -0
  52. package/docs/components/Checkbox.md +60 -0
  53. package/docs/components/Code.md +77 -0
  54. package/docs/components/CodeBlock.md +77 -0
  55. package/docs/components/Collection.md +183 -0
  56. package/docs/components/CollectionList.md +44 -0
  57. package/docs/components/CollectionRow.md +62 -0
  58. package/docs/components/Combobox.md +88 -0
  59. package/docs/components/ConfirmAction.md +100 -0
  60. package/docs/components/Container.md +41 -0
  61. package/docs/components/CopyableText.md +93 -0
  62. package/docs/components/Dashboard.md +81 -0
  63. package/docs/components/DescriptionList.md +61 -0
  64. package/docs/components/Dialog.md +84 -0
  65. package/docs/components/Disclosure.md +53 -0
  66. package/docs/components/EmptyState.md +50 -0
  67. package/docs/components/ErrorSummary.md +48 -0
  68. package/docs/components/Fieldset.md +42 -0
  69. package/docs/components/FileInput.md +74 -0
  70. package/docs/components/Form.md +67 -0
  71. package/docs/components/FormActions.md +45 -0
  72. package/docs/components/FormSection.md +57 -0
  73. package/docs/components/Gallery.md +84 -0
  74. package/docs/components/Grid.md +66 -0
  75. package/docs/components/Heading.md +40 -0
  76. package/docs/components/Image.md +62 -0
  77. package/docs/components/Inline.md +42 -0
  78. package/docs/components/Input.md +82 -0
  79. package/docs/components/Link.md +52 -0
  80. package/docs/components/Menu.md +44 -0
  81. package/docs/components/MultiSelect.md +59 -0
  82. package/docs/components/NumberField.md +65 -0
  83. package/docs/components/PageHeader.md +68 -0
  84. package/docs/components/Panel.md +153 -0
  85. package/docs/components/Popover.md +89 -0
  86. package/docs/components/Progress.md +37 -0
  87. package/docs/components/RadioGroup.md +69 -0
  88. package/docs/components/ScrollArea.md +40 -0
  89. package/docs/components/Select.md +71 -0
  90. package/docs/components/Separator.md +40 -0
  91. package/docs/components/Settings.md +57 -0
  92. package/docs/components/Skeleton.md +86 -0
  93. package/docs/components/Spinner.md +45 -0
  94. package/docs/components/Split.md +47 -0
  95. package/docs/components/Stack.md +54 -0
  96. package/docs/components/Stat.md +34 -0
  97. package/docs/components/StatsRow.md +80 -0
  98. package/docs/components/Status.md +48 -0
  99. package/docs/components/SupportingPane.md +59 -0
  100. package/docs/components/Switch.md +73 -0
  101. package/docs/components/Table.md +105 -0
  102. package/docs/components/Tabs.md +89 -0
  103. package/docs/components/Text.md +36 -0
  104. package/docs/components/Textarea.md +47 -0
  105. package/docs/components/Thumbnail.md +66 -0
  106. package/docs/components/Toast.md +130 -0
  107. package/docs/components/Toolbar.md +39 -0
  108. package/docs/components/Tooltip.md +42 -0
  109. package/package.json +3 -2
@@ -1,12 +1,23 @@
1
1
  import { type ComponentProps } from "react";
2
- type Container = "div" | "ul" | "ol";
3
- export type GridProps<T extends Container = "div"> = ComponentProps<T> & {
2
+ import type { LayoutAlign, LayoutGap } from "../../utils/layout";
3
+ export type GridElement = "div" | "ul" | "ol";
4
+ export type GridLayout = "auto" | "stack";
5
+ export type GridColumns = "auto" | 1 | 2 | 3 | 4;
6
+ export type GridMinItemWidth = "sm" | "md" | "lg";
7
+ export type GridProps<T extends GridElement = "div"> = ComponentProps<T> & {
4
8
  /** Native container; list children must be list items. */
5
- as?: T;
9
+ as?: T | undefined;
6
10
  /** Responsive equal columns or a single vertical track. */
7
- layout?: "auto" | "stack";
11
+ layout?: GridLayout | undefined;
12
+ /** Explicit column count or automatic wrapping columns. */
13
+ columns?: GridColumns | undefined;
14
+ /** Minimum column width before automatic columns wrap. */
15
+ minItemWidth?: GridMinItemWidth | undefined;
16
+ /** Space between columns and stacked rows. */
17
+ gap?: LayoutGap | undefined;
18
+ /** Cross-axis alignment within each grid row. */
19
+ align?: LayoutAlign | undefined;
8
20
  };
9
- export declare function Grid<T extends Container = "div">({ as, layout, className, ...props }: GridProps<T>): import("react").ReactElement<Omit<GridProps<T>, "as" | "className" | "layout"> & {
21
+ export declare function Grid<T extends GridElement = "div">({ as, layout, columns, minItemWidth, gap, align, className, ...props }: GridProps<T>): import("react").ReactElement<Omit<GridProps<T>, "align" | "as" | "className" | "columns" | "gap" | "layout" | "minItemWidth"> & {
10
22
  className: string;
11
23
  } & Record<`data-${string}`, string>, string | import("react").JSXElementConstructor<any>>;
12
- export {};
@@ -0,0 +1,20 @@
1
+ import { type ComponentProps, type CSSProperties, type ReactNode } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ export type ImageRatio = "square" | "landscape" | "portrait" | "wide" | "auto";
4
+ type SourceProps = Pick<ComponentProps<"img">, "src" | "srcSet" | "sizes" | "width" | "height" | "loading" | "decoding" | "crossOrigin" | "referrerPolicy" | "fetchPriority" | "onLoad" | "onError">;
5
+ export type ImageProps = Omit<ComponentProps<"span">, "children" | "onLoad" | "onError"> & SourceProps & {
6
+ /** Image alternative; empty string marks decorative media. */
7
+ alt: string;
8
+ /** Reserved frame ratio; auto uses width/height, then landscape. */
9
+ ratio?: ImageRatio | undefined;
10
+ /** Crop to fill frame or keep entire image visible. */
11
+ fit?: "cover" | "contain" | undefined;
12
+ /** Focal point within image frame. */
13
+ position?: CSSProperties["objectPosition"] | undefined;
14
+ /** Non-interactive visual shown while missing, loading or failed. */
15
+ fallback?: ReactNode | undefined;
16
+ /** Extra classes for frame, image and fallback. */
17
+ classNames?: ClassNames<"root" | "image" | "fallback"> | undefined;
18
+ };
19
+ export declare function Image(props: ImageProps): import("react").JSX.Element;
20
+ export {};
@@ -1,6 +1,19 @@
1
- import type { ComponentProps } from "react";
1
+ import { type ComponentProps, type ComponentType, type ReactNode } from "react";
2
2
  export type LinkProps = ComponentProps<"a"> & {
3
3
  /** Navigation destination; use Button for actions. */
4
4
  href: string;
5
5
  };
6
- export declare function Link({ className, ...props }: LinkProps): import("react").JSX.Element;
6
+ /** Router adapter contract: render an anchor with href; pass other props and ref through. */
7
+ export type LinkComponent = "a" | ComponentType<LinkProps>;
8
+ export type LinkProviderProps = {
9
+ /** Renders every kbui anchor below it; adapt your router's link here. */
10
+ component: LinkComponent;
11
+ children?: ReactNode;
12
+ };
13
+ declare function LinkProvider({ component, children }: LinkProviderProps): import("react").JSX.Element;
14
+ export declare function useLinkComponent(): LinkComponent;
15
+ declare function LinkRoot({ className, ...props }: LinkProps): import("react").JSX.Element;
16
+ export declare const Link: typeof LinkRoot & {
17
+ Provider: typeof LinkProvider;
18
+ };
19
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ export type PageHeaderSize = "sm" | "md" | "lg";
4
+ export type PageHeaderHeadingLevel = 1 | 2 | 3;
5
+ export type PageHeaderProps = Omit<ComponentProps<"div">, "title"> & {
6
+ /** Page title; renders as the screen's main heading. */
7
+ title: ReactNode;
8
+ /** One or two sentences of context below the title. */
9
+ description?: ReactNode | undefined;
10
+ /** Short section or object-type label above the title. */
11
+ eyebrow?: ReactNode | undefined;
12
+ /** Back link or breadcrumb trail above the heading. */
13
+ navigation?: ReactNode | undefined;
14
+ /** Status badges or metadata beside the title, outside its accessible name. */
15
+ meta?: ReactNode | undefined;
16
+ /** Page-level actions; end-aligned, wrapping below the heading when narrow. */
17
+ actions?: ReactNode | undefined;
18
+ /** Document outline rank for the title (`1`–`3`); keep `1` for a screen's own header. */
19
+ headingLevel?: PageHeaderHeadingLevel | undefined;
20
+ /** Title scale: `sm` for dense app shells, `lg` for landing screens. */
21
+ size?: PageHeaderSize | undefined;
22
+ /** Draws a rule below the header to separate it from page content. */
23
+ divider?: boolean | undefined;
24
+ classNames?: ClassNames<"navigation" | "main" | "heading" | "eyebrow" | "headline" | "title" | "meta" | "description" | "actions" | "body"> | undefined;
25
+ };
26
+ /** Opening region of a screen: title, context, status and page-level actions. */
27
+ export declare function PageHeader({ title, description, eyebrow, navigation, meta, actions, headingLevel, size, divider, className, classNames, children, ...rest }: PageHeaderProps): import("react").JSX.Element;
@@ -12,6 +12,8 @@ export type PanelProps = ComponentProps<"section"> & {
12
12
  rail?: PanelRail;
13
13
  /** Padding scale. */
14
14
  density?: PanelDensity;
15
+ /** Solid fill with no theme backdrop filter; for content that redraws often. */
16
+ opaque?: boolean;
15
17
  /** Makes Panel.Body collapse and expand from Panel.Toggle. */
16
18
  collapsible?: boolean;
17
19
  /** Controlled open state; collapsible only. */
@@ -53,7 +55,7 @@ export type PanelHandleProps = Omit<ComponentProps<"div">, "children" | "role">
53
55
  } | {
54
56
  "aria-labelledby": string;
55
57
  });
56
- declare function PanelRoot({ tone, rail, density, collapsible, open, defaultOpen, onOpenChange, className, children, ref, ...props }: PanelProps): import("react").JSX.Element;
58
+ declare function PanelRoot({ tone, rail, density, opaque, collapsible, open, defaultOpen, onOpenChange, className, children, ref, ...props }: PanelProps): import("react").JSX.Element;
57
59
  declare function PanelHeader({ className, ...props }: PanelHeaderProps): import("react").JSX.Element;
58
60
  declare function PanelToolbar({ className, ...props }: PanelToolbarProps): import("react").JSX.Element;
59
61
  declare function PanelBody({ className, ...props }: PanelBodyProps): import("react").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { Popover as Base } from "@base-ui/react/popover";
2
+ import type { ComponentProps, ReactNode } from "react";
3
+ import { type ClassNames } from "../../utils/kb";
4
+ export type PopoverProps = Base.Root.Props;
5
+ export type PopoverTriggerProps = Base.Trigger.Props;
6
+ export type PopoverCloseProps = Base.Close.Props;
7
+ export type PopoverSectionProps = ComponentProps<"div">;
8
+ export type PopoverTitleProps = Omit<Base.Title.Props, "className"> & {
9
+ /** Plain class string on title. */
10
+ className?: string | undefined;
11
+ };
12
+ export type PopoverDescriptionProps = Omit<Base.Description.Props, "className"> & {
13
+ /** Plain class string on description. */
14
+ className?: string | undefined;
15
+ };
16
+ export type PopoverContentProps = Omit<Base.Popup.Props, "className" | "title"> & {
17
+ /** Accessible name; omit when composing Popover.Title. */
18
+ title?: ReactNode;
19
+ /** Accessible description; omit when composing Popover.Description. */
20
+ description?: ReactNode;
21
+ /** Plain class string on popup. */
22
+ className?: string | undefined;
23
+ /** Portal target; pass nested theme host when needed. */
24
+ container?: Base.Portal.Props["container"];
25
+ /** Preferred side; collision handling may flip it. */
26
+ side?: Base.Positioner.Props["side"];
27
+ /** Alignment relative to trigger. */
28
+ align?: Base.Positioner.Props["align"];
29
+ /** Gap between trigger and popup, in CSS pixels. */
30
+ sideOffset?: Base.Positioner.Props["sideOffset"];
31
+ /** Advanced positioning, including collision boundary, padding and anchor. */
32
+ positionerProps?: Omit<Base.Positioner.Props, "children" | "className" | "side" | "align" | "sideOffset"> | undefined;
33
+ /** Classes for inner positioner. */
34
+ classNames?: ClassNames<"positioner"> | undefined;
35
+ };
36
+ declare function PopoverRoot(props: PopoverProps): import("react").JSX.Element;
37
+ declare function PopoverTrigger(props: PopoverTriggerProps): import("react").JSX.Element;
38
+ declare function PopoverClose(props: PopoverCloseProps): import("react").JSX.Element;
39
+ declare function PopoverTitle({ className, ...props }: PopoverTitleProps): import("react").JSX.Element;
40
+ declare function PopoverDescription({ className, ...props }: PopoverDescriptionProps): import("react").JSX.Element;
41
+ declare function PopoverHeader({ className, ...props }: PopoverSectionProps): import("react").JSX.Element;
42
+ declare function PopoverBody({ className, ...props }: PopoverSectionProps): import("react").JSX.Element;
43
+ declare function PopoverFooter({ className, ...props }: PopoverSectionProps): import("react").JSX.Element;
44
+ declare function PopoverContent({ title, description, container, side, align, sideOffset, positionerProps, classNames, className, children, ...props }: PopoverContentProps): import("react").JSX.Element;
45
+ export declare const Popover: typeof PopoverRoot & {
46
+ Trigger: typeof PopoverTrigger;
47
+ Content: typeof PopoverContent;
48
+ Title: typeof PopoverTitle;
49
+ Description: typeof PopoverDescription;
50
+ Close: typeof PopoverClose;
51
+ Header: typeof PopoverHeader;
52
+ Body: typeof PopoverBody;
53
+ Footer: typeof PopoverFooter;
54
+ };
55
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ export type SettingsPart = "header" | "sections";
4
+ export interface SettingsProps extends ComponentProps<"div"> {
5
+ /** Page title and intro above the sections. */
6
+ header?: ReactNode | undefined;
7
+ /** Classes for inner regions, keyed by region. */
8
+ classNames?: ClassNames<SettingsPart> | undefined;
9
+ }
10
+ /** Layout intent for sections of fields and managed lists, each saved on its own. */
11
+ export declare const Settings: ({ ref, header, className, classNames, children, ...props }: SettingsProps) => import("react").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ export type SkeletonVariant = "text" | "rect" | "circle" | "pill" | "auto";
4
+ export type SkeletonSize = "sm" | "md" | "lg";
5
+ export type SkeletonAnimation = "shimmer" | "pulse" | "wave" | "none";
6
+ export type SkeletonTone = "default" | "subtle" | "accent";
7
+ export type SkeletonPart = "root" | "line" | "content" | "status";
8
+ export interface SkeletonProps extends ComponentPropsWithoutRef<"div"> {
9
+ /** Shape preset; `auto` shapes placeholders from kbui children, falling back to `text` without them. */
10
+ variant?: SkeletonVariant | undefined;
11
+ /** Size preset controlling line height or avatar diameter. */
12
+ size?: SkeletonSize | undefined;
13
+ /** Number of stacked placeholder lines when `variant="text"`. */
14
+ lines?: number | undefined;
15
+ /** Enable motion on placeholder shapes; set `false` for static placeholders. */
16
+ animated?: boolean | undefined;
17
+ /** Motion: `shimmer` sweep, `pulse` fade, `wave` staggered fade, or `none`. */
18
+ animation?: SkeletonAnimation | undefined;
19
+ /** Surface color: `default`, `subtle` recessed, or `accent` tinted. */
20
+ tone?: SkeletonTone | undefined;
21
+ /** Whether content is still loading; when `false`, renders `children` inside `.kb-skeleton-content`. */
22
+ loading?: boolean | undefined;
23
+ /** Loading status announced by `variant="auto"`. */
24
+ label?: string | undefined;
25
+ /** Optional explicit inline size (`px` number or CSS length string). */
26
+ width?: number | string | undefined;
27
+ /** Optional explicit block size (`px` number or CSS length string). */
28
+ height?: number | string | undefined;
29
+ /** Loaded content; `variant="auto"` also renders it inert as the placeholder layout. */
30
+ children?: ReactNode | undefined;
31
+ /** Custom class names for internal component slots. */
32
+ classNames?: ClassNames<SkeletonPart> | undefined;
33
+ }
34
+ export declare const Skeleton: import("react").ForwardRefExoticComponent<SkeletonProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,26 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ export type SpinnerSize = "sm" | "md" | "lg";
4
+ export type SpinnerTone = "current" | "accent" | "neutral" | "info" | "success" | "warning" | "danger";
5
+ export type SpinnerVariant = "ring" | "orbit" | "dots" | "bars";
6
+ export type SpinnerAppearance = "plain" | "pill";
7
+ export type SpinnerPart = "root" | "icon" | "track" | "arc" | "core" | "dot" | "bar" | "label";
8
+ export interface SpinnerProps extends Omit<ComponentPropsWithoutRef<"span">, "children"> {
9
+ /** Accessible status label announced by assistive technology and optionally shown beside the indicator. */
10
+ label?: string | undefined;
11
+ /** Render the label visibly beside the spinner instead of visually hidden. */
12
+ showLabel?: boolean | undefined;
13
+ /** Mark spinner as purely decorative (`aria-hidden="true"`, no status role) when a parent control already owns busy semantics. */
14
+ decorative?: boolean | undefined;
15
+ /** Visual size token preset. */
16
+ size?: SpinnerSize | undefined;
17
+ /** Semantic color tone; use `current` inside buttons or badges to inherit text color. */
18
+ tone?: SpinnerTone | undefined;
19
+ /** Indicator geometry and motion style. */
20
+ variant?: SpinnerVariant | undefined;
21
+ /** Container framing; `pill` wraps the indicator and label in a tinted status pill. */
22
+ appearance?: SpinnerAppearance | undefined;
23
+ /** Custom class names for internal component slots. */
24
+ classNames?: ClassNames<SpinnerPart> | undefined;
25
+ }
26
+ export declare const Spinner: import("react").ForwardRefExoticComponent<SpinnerProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,15 @@
1
+ import type { LayoutElementProps, LayoutGap } from "../../utils/layout";
2
+ export type StackElement = "div" | "section" | "article" | "aside" | "ul" | "ol" | "nav" | "form";
3
+ export type StackAlign = "start" | "center" | "end" | "stretch";
4
+ export type StackJustify = "start" | "center" | "end" | "between";
5
+ export type StackProps<T extends StackElement = "div"> = LayoutElementProps<T> & {
6
+ /** Space between stacked items. */
7
+ gap?: LayoutGap;
8
+ /** Inline-axis alignment; stretch fills the stack width. */
9
+ align?: StackAlign;
10
+ /** Block-axis distribution when the stack is taller than its content. */
11
+ justify?: StackJustify;
12
+ };
13
+ export declare function Stack<T extends StackElement = "div">({ as, gap, align, justify, className, ...props }: StackProps<T>): import("react").DetailedReactHTMLElement<Omit<StackProps<T>, "align" | "as" | "className" | "gap" | "justify"> & {
14
+ className: string;
15
+ } & Record<`data-${string}`, string>, HTMLElement>;
@@ -0,0 +1,33 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ export type StatsRowAppearance = "plain" | "outlined";
4
+ export type StatsRowTrend = "up" | "down" | "flat";
5
+ export type StatsRowTone = "positive" | "negative" | "neutral";
6
+ export type StatsRowProps = ComponentProps<"ul"> & {
7
+ /** Plain metrics on the page, or each metric on an outlined card surface. */
8
+ appearance?: StatsRowAppearance | undefined;
9
+ };
10
+ /** A list of comparable metrics that fills its region and wraps when narrow. */
11
+ declare function StatsRowRoot({ appearance, className, ...rest }: StatsRowProps): import("react").JSX.Element;
12
+ export type StatsRowItemProps = Omit<ComponentProps<"li">, "children"> & {
13
+ /** What the value measures, including its period when that changes the meaning. */
14
+ label: ReactNode;
15
+ /** The figure with its unit; figures are tabular. */
16
+ value: ReactNode;
17
+ /** Change since the comparison period; its text must state the direction, such as `+12.8%`. */
18
+ change?: ReactNode | undefined;
19
+ /** Direction glyph beside `change`; decorative, so the change text carries the meaning. */
20
+ trend?: StatsRowTrend | undefined;
21
+ /** Colors `change` by whether it is good or bad news; color alone, so state it in text too. */
22
+ tone?: StatsRowTone | undefined;
23
+ /** Comparison period or freshness, such as `vs. previous month`. */
24
+ context?: ReactNode | undefined;
25
+ /** Optional link to the detail behind the metric. */
26
+ link?: ReactNode | undefined;
27
+ classNames?: ClassNames<"stat" | "label" | "value" | "trend" | "change" | "glyph" | "context" | "link"> | undefined;
28
+ };
29
+ declare function StatsRowItem({ label, value, change, trend, tone, context, link, className, classNames, ...rest }: StatsRowItemProps): import("react").JSX.Element;
30
+ export declare const StatsRow: typeof StatsRowRoot & {
31
+ Item: typeof StatsRowItem;
32
+ };
33
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ export type SupportingPanePart = "main" | "aside";
4
+ export interface SupportingPaneProps extends ComponentProps<"div"> {
5
+ /** Supporting content, such as an order summary; moves below main at compact size. */
6
+ aside?: ReactNode | undefined;
7
+ /** Accessible name for the aside landmark. */
8
+ asideLabel?: string | undefined;
9
+ /** Id of a visible heading that names the aside; preferred over `asideLabel`. */
10
+ asideLabelledBy?: string | undefined;
11
+ /** Classes for inner regions, keyed by region. */
12
+ classNames?: ClassNames<SupportingPanePart> | undefined;
13
+ }
14
+ /** Layout intent for a main column with a complementary aside beside it, or below it when narrow. */
15
+ export declare const SupportingPane: ({ ref, aside, asideLabel, asideLabelledBy, className, classNames, children, ...props }: SupportingPaneProps) => import("react").JSX.Element;
@@ -0,0 +1,65 @@
1
+ import type { ComponentProps, CSSProperties } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ import { Checkbox, type CheckboxProps } from "../Checkbox/Checkbox";
4
+ export type TableProps = ComponentProps<"table"> & {
5
+ /** Cell spacing; dense retains full-size control targets. */
6
+ density?: "comfortable" | "dense" | undefined;
7
+ stickyHeader?: boolean | undefined;
8
+ /** Fixed column sizing; supply widths through colgroup or cell styles. */
9
+ layout?: "auto" | "fixed" | undefined;
10
+ };
11
+ export declare function TableRoot({ density, stickyHeader, layout, className, ...props }: TableProps): import("react").JSX.Element;
12
+ export type TableScrollContainerProps = ComponentProps<"section"> & {
13
+ label: string;
14
+ /** Height cap; sticky headers use this scroll boundary. */
15
+ maxHeight?: CSSProperties["maxHeight"] | undefined;
16
+ };
17
+ export declare function TableScrollContainer({ label, maxHeight, onFocus, className, style, ...props }: TableScrollContainerProps): import("react").JSX.Element;
18
+ export type TableCaptionProps = ComponentProps<"caption">;
19
+ export declare function TableCaption({ className, ...props }: TableCaptionProps): import("react").JSX.Element;
20
+ export type TableHeadProps = ComponentProps<"thead">;
21
+ export declare function TableHead({ className, ...props }: TableHeadProps): import("react").JSX.Element;
22
+ export type TableBodyProps = ComponentProps<"tbody">;
23
+ export declare function TableBody({ className, ...props }: TableBodyProps): import("react").JSX.Element;
24
+ export type TableFootProps = ComponentProps<"tfoot">;
25
+ export declare function TableFoot({ className, ...props }: TableFootProps): import("react").JSX.Element;
26
+ export type TableRowProps = ComponentProps<"tr"> & {
27
+ /** Highlight a row whose checkbox is selected; adds no grid role. */
28
+ selected?: boolean | undefined;
29
+ };
30
+ export declare function TableRow({ selected, className, ...props }: TableRowProps): import("react").JSX.Element;
31
+ export type TableCellOptions = {
32
+ align?: "start" | "center" | "end" | undefined;
33
+ /** Pin one edge cell; use matching edges in header and body. */
34
+ sticky?: "start" | "end" | undefined;
35
+ };
36
+ export type TableSortDirection = "none" | "ascending" | "descending";
37
+ export type TableColumnHeaderProps = Omit<ComponentProps<"th">, "align"> & TableCellOptions & {
38
+ /** Controlled order; app owns sorting and resets other columns to none. */
39
+ sortDirection?: TableSortDirection | undefined;
40
+ /** Enables native sort button; none starts ascending, then toggles. */
41
+ onSortChange?: ((direction: Exclude<TableSortDirection, "none">) => void) | undefined;
42
+ sortDisabled?: boolean | undefined;
43
+ classNames?: ClassNames<"sortButton" | "sortIcon"> | undefined;
44
+ };
45
+ export declare function TableColumnHeader({ align, sticky, sortDirection, onSortChange, sortDisabled, className, classNames, children, scope, "aria-sort": ariaSort, ...props }: TableColumnHeaderProps): import("react").JSX.Element;
46
+ export type TableRowHeaderProps = Omit<ComponentProps<"th">, "align"> & TableCellOptions;
47
+ export declare function TableRowHeader({ align, sticky, scope, className, ...props }: TableRowHeaderProps): import("react").JSX.Element;
48
+ export type TableCellProps = Omit<ComponentProps<"td">, "align"> & TableCellOptions;
49
+ export declare function TableCell({ align, sticky, className, ...props }: TableCellProps): import("react").JSX.Element;
50
+ export type TableSelectionCheckboxProps = CheckboxProps;
51
+ export type TableRowActionsProps = ComponentProps<"div">;
52
+ export declare function TableRowActions({ className, ...props }: TableRowActionsProps): import("react").JSX.Element;
53
+ export declare const Table: typeof TableRoot & {
54
+ ScrollContainer: typeof TableScrollContainer;
55
+ Caption: typeof TableCaption;
56
+ Head: typeof TableHead;
57
+ Body: typeof TableBody;
58
+ Foot: typeof TableFoot;
59
+ Row: typeof TableRow;
60
+ ColumnHeader: typeof TableColumnHeader;
61
+ RowHeader: typeof TableRowHeader;
62
+ Cell: typeof TableCell;
63
+ SelectionCheckbox: typeof Checkbox;
64
+ RowActions: typeof TableRowActions;
65
+ };
@@ -0,0 +1,69 @@
1
+ import { Tabs as BaseTabs } from "@base-ui/react/tabs";
2
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
3
+ import type { ClassNames } from "../../utils/kb";
4
+ export type TabsOrientation = "horizontal" | "vertical";
5
+ export type TabsVariant = "line" | "pill";
6
+ export type TabsSize = "sm" | "md";
7
+ export type TabsClassKey = "root" | "list" | "tab" | "tabIcon" | "tabLabel" | "tabBadge" | "indicator" | "panel";
8
+ export interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof BaseTabs.Root>, "className" | "orientation" | "value" | "defaultValue" | "onValueChange"> {
9
+ /** Controlled active tab value. */
10
+ value?: string | number | null | undefined;
11
+ /** Initial active tab value when uncontrolled. */
12
+ defaultValue?: string | number | null | undefined;
13
+ /** Called when the active tab value changes. */
14
+ onValueChange?: ((value: string | number | null, eventDetails: BaseTabs.Root.ChangeEventDetails) => void) | undefined;
15
+ /** Layout axis for the tab list and panels. */
16
+ orientation?: TabsOrientation | undefined;
17
+ /** Visual treatment of the tab list and active indicator. */
18
+ variant?: TabsVariant | undefined;
19
+ /** Control density for tab triggers. */
20
+ size?: TabsSize | undefined;
21
+ /** Additional root class name. */
22
+ className?: string | undefined;
23
+ /** Custom class names for inner anatomy slots. */
24
+ classNames?: ClassNames<TabsClassKey> | undefined;
25
+ }
26
+ export interface TabsListProps extends Omit<ComponentPropsWithoutRef<typeof BaseTabs.List>, "className"> {
27
+ /** Move selection automatically when focus moves between tabs. */
28
+ activateOnFocus?: boolean | undefined;
29
+ /** Wrap arrow-key focus from the last tab back to the first. */
30
+ loopFocus?: boolean | undefined;
31
+ /** Render the sliding active indicator inside the list. */
32
+ showIndicator?: boolean | undefined;
33
+ /** Additional tablist class name. */
34
+ className?: string | undefined;
35
+ }
36
+ export interface TabsTabProps extends Omit<ComponentPropsWithoutRef<typeof BaseTabs.Tab>, "className" | "value"> {
37
+ /** Unique value matching the associated panel. */
38
+ value: string | number;
39
+ /** Prevent selecting or activating the tab. */
40
+ disabled?: boolean | undefined;
41
+ /** Optional leading icon rendered inside the tab trigger. */
42
+ icon?: ReactNode | undefined;
43
+ /** Optional trailing count or status badge. */
44
+ badge?: ReactNode | undefined;
45
+ /** Additional tab button class name. */
46
+ className?: string | undefined;
47
+ }
48
+ export interface TabsIndicatorProps extends Omit<ComponentPropsWithoutRef<typeof BaseTabs.Indicator>, "className"> {
49
+ /** Additional indicator class name. */
50
+ className?: string | undefined;
51
+ }
52
+ export interface TabsPanelProps extends Omit<ComponentPropsWithoutRef<typeof BaseTabs.Panel>, "className" | "value"> {
53
+ /** Tab value that reveals this panel when active. */
54
+ value: string | number;
55
+ /** Keep inactive panel DOM mounted when hidden. */
56
+ keepMounted?: boolean | undefined;
57
+ /** Additional panel class name. */
58
+ className?: string | undefined;
59
+ }
60
+ export declare const TabsIndicator: import("react").ForwardRefExoticComponent<TabsIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
61
+ export declare const TabsList: import("react").ForwardRefExoticComponent<TabsListProps & import("react").RefAttributes<HTMLDivElement>>;
62
+ export declare const TabsTab: import("react").ForwardRefExoticComponent<TabsTabProps & import("react").RefAttributes<HTMLButtonElement>>;
63
+ export declare const TabsPanel: import("react").ForwardRefExoticComponent<TabsPanelProps & import("react").RefAttributes<HTMLDivElement>>;
64
+ export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>> & {
65
+ List: import("react").ForwardRefExoticComponent<TabsListProps & import("react").RefAttributes<HTMLDivElement>>;
66
+ Tab: import("react").ForwardRefExoticComponent<TabsTabProps & import("react").RefAttributes<HTMLButtonElement>>;
67
+ Indicator: import("react").ForwardRefExoticComponent<TabsIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
68
+ Panel: import("react").ForwardRefExoticComponent<TabsPanelProps & import("react").RefAttributes<HTMLDivElement>>;
69
+ };
@@ -0,0 +1 @@
1
+ export { Tabs, type TabsClassKey, TabsIndicator, type TabsIndicatorProps, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, type TabsSize, TabsTab, type TabsTabProps, type TabsVariant, } from "./Tabs";
@@ -0,0 +1,14 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ import { type ClassNames } from "../../utils/kb";
3
+ import { type ImageProps } from "../Image/Image";
4
+ export type ThumbnailProps = Omit<ComponentProps<"figure">, "children"> & Pick<ImageProps, "src" | "alt" | "ratio" | "fit" | "position" | "fallback"> & {
5
+ /** Visible title; may contain a native link or button. */
6
+ caption?: ReactNode | undefined;
7
+ /** Supporting metadata; remains visible when media fails. */
8
+ description?: ReactNode | undefined;
9
+ /** Native source/loading attributes and Image styling hooks. */
10
+ imageProps?: Omit<ImageProps, "src" | "alt" | "ratio" | "fit" | "position" | "fallback"> | undefined;
11
+ /** Extra classes for figure, media, caption, title and description. */
12
+ classNames?: ClassNames<"root" | "media" | "caption" | "title" | "description"> | undefined;
13
+ };
14
+ export declare function Thumbnail({ src, alt, ratio, fit, position, fallback, caption, description, imageProps, className, classNames, ...props }: ThumbnailProps): import("react").JSX.Element;
@@ -0,0 +1,72 @@
1
+ import { Toast as Base, type ToastManagerAddOptions as BaseAddOptions, type ToastManagerPromiseOptions as BasePromiseOptions, type ToastManager as BaseToastManager, type ToastObject as BaseToastObject, type ToastManagerUpdateOptions as BaseUpdateOptions, type UseToastManagerReturnValue } from "@base-ui/react/toast";
2
+ import type { ReactNode } from "react";
3
+ import { type ClassNames } from "../../utils/kb";
4
+ export type ToastTone = "neutral" | "info" | "success" | "warning" | "danger";
5
+ export type ToastPlacement = "top-start" | "top-end" | "bottom-start" | "bottom-end" | "inline";
6
+ export type ToastObject<Data extends object = Record<string, unknown>> = BaseToastObject<Data>;
7
+ export type ToastManager<Data extends object = Record<string, unknown>> = BaseToastManager<Data>;
8
+ export type ToastAddOptions<Data extends object = Record<string, unknown>> = BaseAddOptions<Data>;
9
+ export type ToastUpdateOptions<Data extends object = Record<string, unknown>> = BaseUpdateOptions<Data>;
10
+ export type ToastPromiseOptions<Value, Data extends object = Record<string, unknown>> = BasePromiseOptions<Value, Data>;
11
+ export type ToastProviderProps = Base.Provider.Props;
12
+ export type ToastContentProps = Omit<Base.Content.Props, "className"> & {
13
+ /** Extra classes for content. */
14
+ className?: string | undefined;
15
+ };
16
+ export type ToastTitleProps = Omit<Base.Title.Props, "className"> & {
17
+ /** Extra classes for title. */
18
+ className?: string | undefined;
19
+ };
20
+ export type ToastDescriptionProps = Omit<Base.Description.Props, "className"> & {
21
+ /** Extra classes for description. */
22
+ className?: string | undefined;
23
+ };
24
+ export type ToastActionProps = Omit<Base.Action.Props, "className"> & {
25
+ /** Extra classes for action. */
26
+ className?: string | undefined;
27
+ };
28
+ export type ToastCloseProps = Omit<Base.Close.Props, "className"> & {
29
+ /** Extra classes for dismissal control. */
30
+ className?: string | undefined;
31
+ };
32
+ export type ToastProps<Data extends object = Record<string, unknown>> = Omit<Base.Root.Props, "className" | "toast"> & {
33
+ /** Message object from the matching provider. */
34
+ toast: ToastObject<Data>;
35
+ /** Extra classes for root. */
36
+ className?: string | undefined;
37
+ /** Visual emphasis; defaults to matching toast.type, with error mapped to danger. */
38
+ tone?: ToastTone | undefined;
39
+ /** Localized accessible name for default dismissal control. */
40
+ closeLabel?: string | undefined;
41
+ /** Classes for default parts; custom children own their part classes. */
42
+ classNames?: ClassNames<"content" | "title" | "description" | "action" | "close"> | undefined;
43
+ };
44
+ export type ToastViewportProps<Data extends object = Record<string, unknown>> = Omit<Base.Viewport.Props, "className"> & {
45
+ /** Extra classes for viewport. */
46
+ className?: string | undefined;
47
+ /** Logical screen corner; inline participates in surrounding layout without a portal. */
48
+ placement?: ToastPlacement | undefined;
49
+ /** Theme-scoped portal host; defaults to document.body for fixed placements. */
50
+ container?: Base.Portal.Props["container"];
51
+ /** Custom renderer for each message; defaults to a complete Toast with all parts. */
52
+ renderToast?: ((toast: ToastObject<Data>) => ReactNode) | undefined;
53
+ };
54
+ export declare function createToastManager<Data extends object = Record<string, unknown>>(): ToastManager<Data>;
55
+ export declare function useToastManager<Data extends object = Record<string, unknown>>(): UseToastManagerReturnValue<Data>;
56
+ declare function ToastContent({ className, ...props }: ToastContentProps): import("react").JSX.Element;
57
+ declare function ToastTitle({ className, ...props }: ToastTitleProps): import("react").JSX.Element;
58
+ declare function ToastDescription({ className, ...props }: ToastDescriptionProps): import("react").JSX.Element;
59
+ declare function ToastAction({ className, ...props }: ToastActionProps): import("react").JSX.Element;
60
+ declare function ToastClose({ className, ...props }: ToastCloseProps): import("react").JSX.Element;
61
+ declare function ToastRoot<Data extends object = Record<string, unknown>>({ toast, tone, closeLabel, classNames, className, children, ...props }: ToastProps<Data>): import("react").JSX.Element;
62
+ declare function ToastViewport<Data extends object = Record<string, unknown>>({ placement, container, renderToast, className, children, ...props }: ToastViewportProps<Data>): import("react").JSX.Element;
63
+ export declare const Toast: typeof ToastRoot & {
64
+ Provider: import("react").FC<import("@base-ui/react").ToastProviderProps>;
65
+ Viewport: typeof ToastViewport;
66
+ Content: typeof ToastContent;
67
+ Title: typeof ToastTitle;
68
+ Description: typeof ToastDescription;
69
+ Action: typeof ToastAction;
70
+ Close: typeof ToastClose;
71
+ };
72
+ export {};