@indxsearch/systm 2.21.1 → 2.23.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 (46) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/components/BarMeter/BarMeter.d.ts +51 -0
  3. package/dist/components/BarSlider/BarSlider.d.ts +25 -0
  4. package/dist/components/Chart/Chart.d.ts +47 -1
  5. package/dist/components/Chat/ChatPanel.d.ts +10 -6
  6. package/dist/components/Chat/Reasoning.d.ts +15 -0
  7. package/dist/components/Chat/ToolStep.d.ts +35 -0
  8. package/dist/components/Chat/index.d.ts +2 -0
  9. package/dist/components/Combobox/Combobox.d.ts +23 -0
  10. package/dist/components/Combobox/index.d.ts +1 -0
  11. package/dist/components/CommandPalette/CommandPalette.d.ts +30 -0
  12. package/dist/components/CommandPalette/index.d.ts +1 -0
  13. package/dist/components/EmptyState/EmptyState.d.ts +22 -0
  14. package/dist/components/EmptyState/index.d.ts +1 -0
  15. package/dist/components/GroupedBars/GroupedBars.d.ts +28 -0
  16. package/dist/components/Heatmap/Heatmap.d.ts +35 -0
  17. package/dist/components/Kbd/Kbd.d.ts +8 -0
  18. package/dist/components/Kbd/index.d.ts +1 -0
  19. package/dist/components/Popover/Popover.d.ts +4 -0
  20. package/dist/components/Popover/index.d.ts +1 -2
  21. package/dist/components/PortalContainer/PortalContainer.d.ts +9 -0
  22. package/dist/components/RadarChart/RadarChart.d.ts +35 -0
  23. package/dist/components/RadialChart/RadialChart.d.ts +47 -0
  24. package/dist/components/Resizable/Resizable.d.ts +24 -0
  25. package/dist/components/Resizable/index.d.ts +1 -0
  26. package/dist/components/ScrubSlider/ScrubSlider.d.ts +23 -0
  27. package/dist/components/SegmentedControl/SegmentedControl.d.ts +27 -0
  28. package/dist/components/Sheet/Sheet.d.ts +21 -0
  29. package/dist/components/Sheet/index.d.ts +1 -0
  30. package/dist/components/Sidebar/Sidebar.d.ts +63 -0
  31. package/dist/components/Sidebar/index.d.ts +1 -0
  32. package/dist/components/Stat/Stat.d.ts +13 -3
  33. package/dist/components/TagsInput/TagsInput.d.ts +14 -0
  34. package/dist/components/TagsInput/index.d.ts +1 -0
  35. package/dist/components/Toast/Toast.d.ts +20 -0
  36. package/dist/components/Toast/index.d.ts +1 -0
  37. package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +3 -1
  38. package/dist/components/TreeCanvas/TreeCanvas.d.ts +50 -0
  39. package/dist/components/TreeCanvas/viewport.d.ts +11 -0
  40. package/dist/components/Waffle/Waffle.d.ts +27 -0
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.d.ts +23 -3
  43. package/dist/index.es.js +4438 -1272
  44. package/dist/systm.css +1 -1
  45. package/dist/systm.shadow.css +2 -0
  46. package/package.json +3 -2
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ export interface ScrubSliderProps {
3
+ value: number;
4
+ onChange: (value: number) => void;
5
+ /** Called when a drag ends or the field commits. */
6
+ onFinalChange?: (value: number) => void;
7
+ /** The value moves by this per tick (and per arrow key); Shift moves ten. */
8
+ step?: number;
9
+ /** Bounds are optional: without them the slider has no end. */
10
+ min?: number;
11
+ max?: number;
12
+ /** Shown at the left, outside the ruler. */
13
+ label?: string;
14
+ /** A fixed width for the label, as CSS, so a stack of sliders lines up its rulers. */
15
+ labelWidth?: string;
16
+ disabled?: boolean;
17
+ /** Width of the number field, as CSS; 70px by default. */
18
+ fieldWidth?: string;
19
+ className?: string;
20
+ 'aria-label'?: string;
21
+ id?: string;
22
+ }
23
+ export declare const ScrubSlider: React.FC<ScrubSliderProps>;
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SegmentedItem<T extends string = string> {
3
+ value: T;
4
+ label?: ReactNode;
5
+ icon?: ReactNode;
6
+ /** The cell's name when it is only an icon. */
7
+ 'aria-label'?: string;
8
+ disabled?: boolean;
9
+ /** A small count after the label, as on a Tab: the signal red asks for attention, 'info' is information. */
10
+ badge?: ReactNode;
11
+ badgeTone?: 'signal' | 'info';
12
+ }
13
+ export type SegmentedSize = 'micro' | 'default';
14
+ export interface SegmentedControlProps<T extends string = string> {
15
+ items: SegmentedItem<T>[];
16
+ value: T;
17
+ onChange: (value: T) => void;
18
+ /** 'micro' is 24px tall, for a panel header; 'default' 30px, the height of a micro Tab. */
19
+ size?: SegmentedSize;
20
+ /** Cells share the width equally instead of taking their content's. */
21
+ stretch?: boolean;
22
+ disabled?: boolean;
23
+ /** What the choice is: "Period". */
24
+ 'aria-label'?: string;
25
+ className?: string;
26
+ }
27
+ export declare function SegmentedControl<T extends string = string>({ items, value, onChange, size, stretch, disabled, 'aria-label': ariaLabel, className, }: SegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ export interface SheetProps {
3
+ open?: boolean;
4
+ onOpenChange?: (open: boolean) => void;
5
+ /** What opens it, when the Sheet holds its own state. */
6
+ trigger?: React.ReactNode;
7
+ title?: string;
8
+ description?: string;
9
+ children?: React.ReactNode;
10
+ /** Buttons at the foot, primary first. */
11
+ footer?: React.ReactNode;
12
+ side?: 'right' | 'left';
13
+ /** 'default' (480px) or 'wide' (720px); the whole width on a phone. */
14
+ size?: 'default' | 'wide';
15
+ className?: string;
16
+ }
17
+ /** A panel the height of the window, over the page from its right edge (or left): a record opened
18
+ * from a list, a finding with its evidence, settings too long for a Modal. Radix's dialog keeps the
19
+ * focus inside, closes it on Escape and a press on the scrim, and gives the focus back. Header,
20
+ * a body that scrolls, an optional footer. No motion. The Blazor Sheet is its port. */
21
+ export declare function Sheet({ open, onOpenChange, trigger, title, description, children, footer, side, size, className }: SheetProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { Sheet, type SheetProps } from './Sheet';
@@ -0,0 +1,63 @@
1
+ import { default as React } from 'react';
2
+ interface IconProps {
3
+ size?: string | number;
4
+ color?: string;
5
+ }
6
+ export interface SidebarItem {
7
+ /** What `active` and `onSelect` speak of. */
8
+ key: string;
9
+ label: string;
10
+ /** A pixl icon element. */
11
+ icon?: React.ReactElement<IconProps>;
12
+ /** Where it goes; without it the item calls `onSelect` only. */
13
+ href?: string;
14
+ /** At the item's end ("3"); a dot in the rail. */
15
+ badge?: string;
16
+ /** The badge wants attention: the signal colour, a plain count otherwise. */
17
+ signal?: boolean;
18
+ /** The badge's own hover text. */
19
+ badgeTitle?: string;
20
+ /** An icon at the item's end, such as the lab mark of an experimental section. */
21
+ trailing?: React.ReactElement<IconProps>;
22
+ trailingTitle?: string;
23
+ title?: string;
24
+ /** There but not yet usable; its `title` says why. */
25
+ disabled?: boolean;
26
+ }
27
+ export interface SidebarGroup {
28
+ title?: string;
29
+ items: SidebarItem[];
30
+ /** The title opens and closes the items. */
31
+ collapsible?: boolean;
32
+ }
33
+ export interface SidebarProps {
34
+ groups: SidebarGroup[];
35
+ /** The key of the open item, drawn primary. */
36
+ active?: string;
37
+ onSelect?: (item: SidebarItem) => void;
38
+ /** Above the groups; hidden in the rail. */
39
+ header?: React.ReactNode;
40
+ /** Under the groups, above the fold button; hidden in the rail. */
41
+ footer?: React.ReactNode;
42
+ /** The rail of icons, controlled with `onCollapsedChange`; leave both out and it keeps its own. */
43
+ collapsed?: boolean;
44
+ onCollapsedChange?: (collapsed: boolean) => void;
45
+ defaultCollapsed?: boolean;
46
+ /** Whether it can fold to the rail at all. */
47
+ collapsible?: boolean;
48
+ /** The key that folds it with Cmd or Ctrl; `null` for none. */
49
+ shortcut?: string | null;
50
+ /** Where the viewer's own choice is kept (localStorage). */
51
+ storageKey?: string;
52
+ /** The drawer, at 768px and narrower: the host's trigger opens it. */
53
+ open?: boolean;
54
+ onOpenChange?: (open: boolean) => void;
55
+ 'aria-label'?: string;
56
+ className?: string;
57
+ }
58
+ /** The side column of an app: groups of systm Buttons, the open one primary. It folds to a rail of
59
+ * icons (Cmd or Ctrl and B, or the button at its foot), remembered with `storageKey`; in the rail
60
+ * each item names itself in a Tooltip and a badge is a dot. At 768px and narrower it is a drawer
61
+ * over the page, opened by the host and closed by Escape, a press beside it or a choice. No motion. */
62
+ export declare function Sidebar({ groups, active, onSelect, header, footer, collapsed, onCollapsedChange, defaultCollapsed, collapsible, shortcut, storageKey, open, onOpenChange, 'aria-label': ariaLabel, className, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
63
+ export {};
@@ -0,0 +1 @@
1
+ export { Sidebar, type SidebarProps, type SidebarItem, type SidebarGroup } from './Sidebar';
@@ -4,11 +4,21 @@ import { ReactElement, ReactNode } from 'react';
4
4
  * 28, 35. The value is set at 24px; 28 wide (20 tall) sits on its cap height.
5
5
  */
6
6
  export declare const STAT_ICON_SIZE = 28;
7
+ /** Two cells of the pixl grid: 14 wide, 10 tall, on the label's x-height. */
8
+ export declare const STAT_LABEL_ICON_SIZE = 14;
7
9
  export interface StatProps {
8
10
  /** What the number is: "Searches", "Click-through". */
9
11
  label: ReactNode;
10
- /** The number, formatted; or a chip, for a state. */
11
- value: ReactNode;
12
+ /** A pixl icon before the label, at STAT_LABEL_ICON_SIZE in the label's tone: what the tile is
13
+ * about, a search, a cart, a CPU, for a row of tiles read at a glance. */
14
+ labelIcon?: ReactElement<{
15
+ size?: number | string;
16
+ color?: string;
17
+ }>;
18
+ /** The number, formatted; or a chip, for a state. Left out when the figure carries it. */
19
+ value?: ReactNode;
20
+ /** A graphic under the label, the value and foot beside it: a BarMeter ring with the number in it. */
21
+ figure?: ReactNode;
12
22
  /** A pixl icon before the value, for a state ("Up", "Key set"): drawn at STAT_ICON_SIZE in the value's colour. */
13
23
  icon?: ReactElement<{
14
24
  size?: number | string;
@@ -23,7 +33,7 @@ export interface StatProps {
23
33
  className?: string;
24
34
  }
25
35
  /** One number with its label, on the Base surface: a KPI, a count, a state. Put several in a StatGroup. */
26
- export declare function Stat({ label, value, icon, color, hint, children, className }: StatProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function Stat({ label, labelIcon, value, figure, icon, color, hint, children, className }: StatProps): import("react/jsx-runtime").JSX.Element;
27
37
  export interface StatGroupProps {
28
38
  children: ReactNode;
29
39
  /**
@@ -0,0 +1,14 @@
1
+ export interface TagsInputProps {
2
+ value: string[];
3
+ onChange: (value: string[]) => void;
4
+ label?: string;
5
+ placeholder?: string;
6
+ /** A line under the field: what divides the values, what a value may hold. */
7
+ hint?: string;
8
+ /** The characters that end a value as it is typed or pasted, besides Enter; ";" and "," by default. */
9
+ separators?: string;
10
+ disabled?: boolean;
11
+ 'aria-label'?: string;
12
+ className?: string;
13
+ }
14
+ export declare function TagsInput({ value, onChange, label, placeholder, hint, separators, disabled, 'aria-label': ariaLabel, className, }: TagsInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { TagsInput, type TagsInputProps } from './TagsInput';
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ export interface ToastOptions {
3
+ /** A 14px pixl icon. */
4
+ icon?: React.ReactNode;
5
+ /** How long it stays, in milliseconds. */
6
+ duration?: number;
7
+ /** One action, "Undo"; pressing it closes the notice. */
8
+ action?: {
9
+ label: string;
10
+ onClick: () => void;
11
+ };
12
+ }
13
+ /** Shows a notice and returns its id. */
14
+ export declare function toast(message: string, options?: ToastOptions): number;
15
+ export declare namespace toast {
16
+ var error: (message: string, options?: Omit<ToastOptions, "icon">) => number;
17
+ var dismiss: (id: number) => void;
18
+ }
19
+ /** Where the notices show; place one in the app. */
20
+ export declare function Toaster(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { toast, Toaster, type ToastOptions } from './Toast';
@@ -6,8 +6,10 @@ type ToggleSwitchProps = {
6
6
  disabled?: boolean;
7
7
  label?: string;
8
8
  'aria-label'?: string;
9
- /** `positive` turns the track green (teal in dark mode) when on, for settings where on versus off must be seen at a glance. */
9
+ /** `positive` turns the track blue (teal in dark mode) when on, for settings where on versus off must be seen at a glance. */
10
10
  variant?: 'default' | 'positive';
11
+ /** Draws a 0 on the track when off and a | when on, the marks of a power switch, in whole pixels. */
12
+ marks?: boolean;
11
13
  };
12
14
  export declare const ToggleSwitch: React.FC<ToggleSwitchProps>;
13
15
  export {};
@@ -0,0 +1,50 @@
1
+ import { ReactNode } from 'react';
2
+ export interface TreeNode {
3
+ id: string;
4
+ label: string;
5
+ /** Shown in a chip beside the name: products in the category. */
6
+ count?: number;
7
+ children?: TreeNode[];
8
+ /** Marks after the count: a boost, a note. 14px pixl icons, each with a title. */
9
+ marks?: {
10
+ icon: ReactNode;
11
+ title: string;
12
+ }[];
13
+ /** Drawn dim: hidden from search, empty. */
14
+ muted?: boolean;
15
+ }
16
+ export interface TreeCanvasProps {
17
+ roots: TreeNode[];
18
+ /** The chosen node's id. */
19
+ selected?: string;
20
+ onSelect?: (id: string) => void;
21
+ /** The ids open at first; the roots when left out. Opening is kept inside after that. */
22
+ defaultExpanded?: string[];
23
+ /** 'tree' draws the canvas; 'list' the same as nested rows. */
24
+ view?: 'tree' | 'list';
25
+ /** Children shown before the step to the rest; 50 by default. */
26
+ maxChildren?: number;
27
+ /** The count as shown; the number by default. */
28
+ format?: (count: number) => string;
29
+ /** A filter: only nodes it accepts stay, with the path down to each; an ancestor kept only as
30
+ * the way down is drawn muted, and a branch holding a match is opened. "Only boosted." */
31
+ visible?: (node: TreeNode) => boolean;
32
+ /** The zoom the tree opens at, from the left; left out, it opens fitted in view when that leaves
33
+ * it readable, and at 100% from the left when not. */
34
+ zoom?: number;
35
+ /** When set or changed, the tree is opened to this many levels and closed below: 1 shows the
36
+ * roots, 2 their children. Left out, the opening is the component's own. */
37
+ openDepth?: number;
38
+ /** The board: drag to pan, two-finger scroll to pan, pinch or Ctrl/Cmd and the wheel to zoom, the
39
+ * arrows, + - and 0 on it, and the zoom controls in its corner; on by default. Off, the tree is a
40
+ * still picture at `zoom` or fitted, for an example inside a page that scrolls. */
41
+ pan?: boolean;
42
+ /** A systm pattern behind the tree, faint, moving with it. None by default. */
43
+ pattern?: TreeCanvasPattern;
44
+ /** A name for assistive technology: "Categories of shop". */
45
+ 'aria-label'?: string;
46
+ className?: string;
47
+ }
48
+ /** The patterns `pattern` takes: the systm set in globals/patterns.css. */
49
+ export type TreeCanvasPattern = 'grid-12' | 'grid-24' | 'grid-6' | 'checkerboard' | 'checkerboard-spaced-4' | 'checkerboard-spaced-6' | 'checkerboard-spaced-8' | 'checkerboard-spaced-10';
50
+ export declare function TreeCanvas({ roots, selected, onSelect, defaultExpanded, view, maxChildren, format, visible, zoom, openDepth, pan: pannable, pattern, 'aria-label': ariaLabel, className, }: TreeCanvasProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export type ViewportAction = 'in' | 'out' | 'fit' | 'reset';
2
+ export interface Viewport {
3
+ setPan(pan: boolean): void;
4
+ /** The first view of a tree: fitted when that leaves it readable; else at the given zoom (1 when
5
+ * none), from the left, with the first root a third of the way down. */
6
+ initial(zoom?: number): void;
7
+ command(action: ViewportAction): void;
8
+ bringIntoView(el: HTMLElement): void;
9
+ destroy(): void;
10
+ }
11
+ export declare function createViewport(canvas: HTMLElement, view: HTMLElement, grid: HTMLElement | null, pan: boolean): Viewport;
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ export interface WaffleSegment {
3
+ label: ReactNode;
4
+ value: number;
5
+ /** The segment's colour; without it, the tone ladder from the ink down, four steps, so a fifth segment needs one. */
6
+ color?: string;
7
+ /** A small graphic before the label in the legend, about the text's height: a pixl icon, a flag. */
8
+ icon?: ReactNode;
9
+ }
10
+ export interface WaffleProps {
11
+ segments: WaffleSegment[];
12
+ /** Cells across; 20 by default. */
13
+ columns?: number;
14
+ /** Cells down; 5 by default. */
15
+ rows?: number;
16
+ /** A cell's side in pixels; 4 by default, with a 2px gap. */
17
+ cell?: number;
18
+ /** The share as shown in the legend; defaults to a whole percent. */
19
+ format?: (fraction: number, value: number) => ReactNode;
20
+ /** The legend beneath the grid; on by default. */
21
+ legend?: boolean;
22
+ /** A name for assistive technology: "Portfolio by holding". */
23
+ 'aria-label'?: string;
24
+ className?: string;
25
+ }
26
+ export declare function allocateCells(values: number[], total: number): number[];
27
+ export declare function Waffle({ segments, columns, rows, cell, format, legend, 'aria-label': ariaLabel, className, }: WaffleProps): import("react/jsx-runtime").JSX.Element;