@pondipondi/mimas 0.1.5 → 0.2.1

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 (57) hide show
  1. package/dist/components/crumbs/bubble-input.d.ts +33 -0
  2. package/dist/components/crumbs/{Button.d.ts → button.d.ts} +92 -106
  3. package/dist/components/crumbs/checkbox.d.ts +565 -0
  4. package/dist/components/crumbs/input-group.d.ts +29 -0
  5. package/dist/components/crumbs/input.d.ts +305 -0
  6. package/dist/components/crumbs/{LoadingRing.d.ts → loading-ring.d.ts} +3 -3
  7. package/dist/components/crumbs/select.d.ts +95 -0
  8. package/dist/components/crumbs/tooltip.d.ts +20 -0
  9. package/dist/components/frames/dialog.d.ts +17 -0
  10. package/dist/components/frames/drawer.d.ts +215 -0
  11. package/dist/components/frames/inset.d.ts +7 -0
  12. package/dist/components/frames/modal.d.ts +14 -0
  13. package/dist/components/frames/panel.d.ts +9 -0
  14. package/dist/components/index.d.ts +38 -9
  15. package/dist/components/layout/between.d.ts +7 -0
  16. package/dist/components/layout/centre.d.ts +7 -0
  17. package/dist/components/layout/column.d.ts +7 -0
  18. package/dist/components/layout/flex.d.ts +7 -0
  19. package/dist/components/layout/grid.d.ts +7 -0
  20. package/dist/components/plates/bar-chart.d.ts +55 -0
  21. package/dist/components/plates/heatmap.d.ts +31 -0
  22. package/dist/components/util/icons.d.ts +10 -0
  23. package/dist/components/util/{MimasProvider.d.ts → mimas-provider.d.ts} +1 -1
  24. package/dist/components/util/noise.d.ts +5 -0
  25. package/dist/components/util/palette.d.ts +36 -0
  26. package/dist/components/util/rabbet.d.ts +11 -0
  27. package/dist/config/palettes.d.ts +73 -0
  28. package/dist/hooks/use-async-component.d.ts +49 -0
  29. package/dist/hooks/use-container-width.d.ts +2 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/lib/classnames.d.ts +2 -0
  32. package/dist/lib/colour.d.ts +17 -0
  33. package/dist/lib/corners.d.ts +20 -0
  34. package/dist/mimas.cjs.js +135 -10
  35. package/dist/mimas.es.js +16103 -1446
  36. package/dist/stories/Mimas/Crumbs/BubbleInput.stories.d.ts +42 -0
  37. package/dist/stories/Mimas/Crumbs/Button.stories.d.ts +5 -3
  38. package/dist/stories/Mimas/Crumbs/Checkbox.stories.d.ts +313 -0
  39. package/dist/stories/Mimas/Crumbs/Input.stories.d.ts +339 -0
  40. package/dist/stories/Mimas/Crumbs/InputGroup.stories.d.ts +36 -0
  41. package/dist/stories/Mimas/Crumbs/Select.stories.d.ts +13 -0
  42. package/dist/stories/Mimas/Crumbs/Tooltip.stories.d.ts +27 -0
  43. package/dist/stories/Mimas/Frames/Dialog.stories.d.ts +14 -0
  44. package/dist/stories/Mimas/Frames/Drawer.stories.d.ts +28 -0
  45. package/dist/stories/Mimas/Frames/Modal.stories.d.ts +17 -0
  46. package/dist/stories/Mimas/Plates/BarChart.stories.d.ts +20 -0
  47. package/dist/stories/Mimas/Plates/Heatmap.stories.d.ts +32 -0
  48. package/dist/stories/Mimas/Util/Palette.stories.d.ts +31 -0
  49. package/dist/style.css +1 -1
  50. package/package.json +79 -68
  51. package/dist/components/crumbs/ButtonGroup.d.ts +0 -11
  52. package/dist/components/crumbs/ToggleSet.d.ts +0 -2
  53. package/dist/components/frames/Inset.d.ts +0 -50
  54. package/dist/components/frames/Panel.d.ts +0 -50
  55. package/dist/components/layout/Flex.d.ts +0 -204
  56. package/dist/components/util/Noise.d.ts +0 -2
  57. package/dist/stories/Mimas/Crumbs/ButtonGroup.stories.d.ts +0 -25
@@ -0,0 +1,14 @@
1
+ import { type AsyncComponentBaseArgs } from "@hooks/use-async-component";
2
+ import { DialogContent } from "./dialog";
3
+ import { Button } from "../crumbs/button";
4
+ import type { ComponentProps, ReactNode } from "react";
5
+ export interface ModalProps<I = void, O = void, E = unknown> extends AsyncComponentBaseArgs<I, O, E>, ComponentProps<typeof DialogContent> {
6
+ title?: string;
7
+ children?: ReactNode;
8
+ onConfirm?: (() => Promise<O>) | (() => O);
9
+ onCancel?: (() => Promise<void>) | (() => void);
10
+ confirmButtonProps?: ComponentProps<typeof Button>;
11
+ cancelButtonProps?: ComponentProps<typeof Button>;
12
+ }
13
+ declare function Modal<I = void, O = void, E = unknown>({ isActive, ok, cancel, reject, title, children, onConfirm, onCancel, confirmButtonProps, cancelButtonProps, ...dialogContentProps }: ModalProps<I, O, E>): import("react/jsx-runtime").JSX.Element;
14
+ export { Modal };
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes } from "react";
2
+ interface PanelProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Merge the panel styles onto the single child element instead of a div. */
4
+ asChild?: boolean;
5
+ /** Extra classes on the inner content element. */
6
+ innerClassName?: string;
7
+ }
8
+ declare const Panel: import("react").ForwardRefExoticComponent<PanelProps & import("react").RefAttributes<HTMLDivElement>>;
9
+ export { Panel };
@@ -1,9 +1,38 @@
1
- export { default as MimasProvider } from "./util/MimasProvider";
2
- export { default as Noise } from "./util/Noise";
3
- export { default as Inset } from "./frames/Inset";
4
- export { default as Panel } from "./frames/Panel";
5
- export { default as Button } from "./crumbs/Button";
6
- export { default as ButtonGroup } from "./crumbs/ButtonGroup";
7
- export { default as LoadingRing } from "./crumbs/LoadingRing";
8
- export { default as ToggleSet } from "./crumbs/ToggleSet";
9
- export { default as Flex } from "./layout/Flex";
1
+ export { MimasProvider } from "./util/mimas-provider";
2
+ export { Noise } from "./util/noise";
3
+ export { Palette } from "./util/palette";
4
+ export { Rabbet } from "./util/rabbet";
5
+ export type { RabbetProps } from "./util/rabbet";
6
+ export type { PaletteProps, PaletteValue, Role } from "./util/palette";
7
+ export * from "../config/palettes";
8
+ export { Inset } from "./frames/inset";
9
+ export { Panel } from "./frames/panel";
10
+ export { Drawer, DrawerRoot, DrawerTrigger, DrawerPortal, DrawerClose, DrawerBackdrop, DrawerContent, DrawerTitle, DrawerDescription, } from "./frames/drawer";
11
+ export type { DrawerProps, DrawerContentProps } from "./frames/drawer";
12
+ export { Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from "./frames/dialog";
13
+ export type { DialogContentProps } from "./frames/dialog";
14
+ export { Modal } from "./frames/modal";
15
+ export type { ModalProps } from "./frames/modal";
16
+ export { Button } from "./crumbs/button";
17
+ export { InputGroup } from "./crumbs/input-group";
18
+ export { BubbleInput } from "./crumbs/bubble-input";
19
+ export type { BubbleInputProps } from "./crumbs/bubble-input";
20
+ export { Checkbox } from "./crumbs/checkbox";
21
+ export type { CheckboxProps } from "./crumbs/checkbox";
22
+ export type { Corners, LeftCorners } from "../lib/corners";
23
+ export { Input } from "./crumbs/input";
24
+ export type { InputProps } from "./crumbs/input";
25
+ export { LoadingRing } from "./crumbs/loading-ring";
26
+ export { Tooltip, TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent, } from "./crumbs/tooltip";
27
+ export type { TooltipProps } from "./crumbs/tooltip";
28
+ export { Select, SelectRoot, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectGroup, SelectLabel, SelectSeparator, SelectPortal, } from "./crumbs/select";
29
+ export type { SelectOption, SelectProps } from "./crumbs/select";
30
+ export { Heatmap } from "./plates/heatmap";
31
+ export type { HeatmapEntry, HeatmapProps } from "./plates/heatmap";
32
+ export { BarChart } from "./plates/bar-chart";
33
+ export type { BarChartEntry, BarChartProps, BarChartThreshold, } from "./plates/bar-chart";
34
+ export { Flex } from "./layout/flex";
35
+ export { Column } from "./layout/column";
36
+ export { Centre } from "./layout/centre";
37
+ export { Between } from "./layout/between";
38
+ export { Grid } from "./layout/grid";
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from "react";
2
+ interface BetweenProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Merge the layout styles onto the single child element instead of a div. */
4
+ asChild?: boolean;
5
+ }
6
+ declare const Between: import("react").ForwardRefExoticComponent<BetweenProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export { Between };
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from "react";
2
+ interface CentreProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Merge the layout styles onto the single child element instead of a div. */
4
+ asChild?: boolean;
5
+ }
6
+ declare const Centre: import("react").ForwardRefExoticComponent<CentreProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export { Centre };
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from "react";
2
+ interface ColumnProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Merge the layout styles onto the single child element instead of a div. */
4
+ asChild?: boolean;
5
+ }
6
+ declare const Column: import("react").ForwardRefExoticComponent<ColumnProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export { Column };
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from "react";
2
+ interface FlexProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Merge the layout styles onto the single child element instead of a div. */
4
+ asChild?: boolean;
5
+ }
6
+ declare const Flex: import("react").ForwardRefExoticComponent<FlexProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export { Flex };
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from "react";
2
+ interface GridProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Merge the layout styles onto the single child element instead of a div. */
4
+ asChild?: boolean;
5
+ }
6
+ declare const Grid: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export { Grid };
@@ -0,0 +1,55 @@
1
+ import { ReactNode } from "react";
2
+ import { PaletteName, Palette as PaletteRamp } from "../../config/palettes";
3
+ export type BarChartEntry = {
4
+ label: string;
5
+ value: number;
6
+ };
7
+ export interface BarChartThreshold {
8
+ /** Value along the chart's axis where the line sits. */
9
+ value: number;
10
+ /** Classes for the line — controls colour, dash style, thickness. */
11
+ className?: string;
12
+ /** Optional label rendered above the line's trailing edge. */
13
+ label?: ReactNode;
14
+ }
15
+ export interface BarChartProps {
16
+ /** The (label, value) pairs to plot. */
17
+ data: BarChartEntry[];
18
+ /** Axis ceiling. Defaults to 1.1x the highest bar or threshold value. */
19
+ max?: number;
20
+ /** Height of the plot area in pixels. Default `192`. */
21
+ height?: number;
22
+ /** Palette to apply. Accepts any bundled palette name or custom ramp. Default `"violet"`. */
23
+ palette?: PaletteName | PaletteRamp;
24
+ /** Reference lines drawn across the plot, e.g. a goal or average. */
25
+ thresholds?: BarChartThreshold[];
26
+ /**
27
+ * Shade each bar by its value/max ratio (as Heatmap does) instead of a
28
+ * single flat colour. Default `true`; set `false` for a single flat
29
+ * colour across every bar.
30
+ */
31
+ colourByValue?: boolean;
32
+ /**
33
+ * Format the tooltip shown on hover/focus. Receives the hovered entry;
34
+ * return a ReactNode. Defaults to `label: value`.
35
+ */
36
+ formatTooltip?: (entry: BarChartEntry) => ReactNode;
37
+ /** Format the two axis labels (0 and the ceiling). Defaults to a rounded integer. */
38
+ formatAxisLabel?: (value: number) => ReactNode;
39
+ /** Called when a bar is clicked. Adds `cursor-pointer` to bars when provided. */
40
+ onBarClick?: (entry: BarChartEntry) => void;
41
+ /** Graph title, rotated 90° and centred on the plot's left edge. */
42
+ title?: ReactNode;
43
+ /** Extra classes on the root element. */
44
+ className?: string;
45
+ /** Extra classes on the plot area (axis, bars and thresholds). */
46
+ innerClassName?: string;
47
+ /** Extra classes on each bar. */
48
+ barClassName?: string;
49
+ /** Extra classes on the tooltip. */
50
+ tooltipClassName?: string;
51
+ /** Extra classes on the title. */
52
+ titleClassName?: string;
53
+ }
54
+ declare function BarChart({ data, max: maxProp, height, palette, thresholds, colourByValue, formatTooltip, formatAxisLabel, onBarClick, title, className, innerClassName, barClassName, tooltipClassName, titleClassName, }: BarChartProps): import("react/jsx-runtime").JSX.Element;
55
+ export { BarChart };
@@ -0,0 +1,31 @@
1
+ import { PaletteName, Palette as PaletteRamp } from "../../config/palettes";
2
+ import { ReactNode } from "react";
3
+ export type HeatmapEntry = {
4
+ date: Date;
5
+ value: number;
6
+ /** Show a small marker dot on this pellet. */
7
+ marker?: boolean;
8
+ };
9
+ export interface HeatmapProps {
10
+ /** Day-by-day entries for the date range. */
11
+ entries: HeatmapEntry[];
12
+ /** Target value per day. Default `1`. */
13
+ goal?: number;
14
+ /** Palette to apply. Accepts any bundled palette name or custom ramp. Default `"violet"`. */
15
+ palette?: PaletteName | PaletteRamp;
16
+ /** First day to display. Defaults to Jan 1 of the current year. */
17
+ startDate?: Date;
18
+ /** Last day to display. Defaults to Dec 31 of the current year. */
19
+ endDate?: Date;
20
+ /**
21
+ * Format the tooltip shown on hover/focus. Receives the entry; return a
22
+ * ReactNode. Defaults to a localised weekday + date string.
23
+ */
24
+ formatTooltip?: (entry: HeatmapEntry) => ReactNode;
25
+ /** Called when a pellet is clicked. Adds `cursor-pointer` to pellets when provided. */
26
+ onEntryClick?: (entry: HeatmapEntry) => void;
27
+ /** Extra classes on the root element. */
28
+ className?: string;
29
+ }
30
+ declare function Heatmap({ entries, goal, palette, startDate, endDate, formatTooltip, onEntryClick, className, }: HeatmapProps): import("react/jsx-runtime").JSX.Element;
31
+ export { Heatmap };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Icon aliases.
3
+ *
4
+ * The rest of the library imports its icons from here rather than from
5
+ * `lucide-react` directly, so the underlying icon pack can be swapped in a
6
+ * single place. To change packs, re-point these exports — usage sites don't
7
+ * need to change as long as the names and a compatible props shape stay put.
8
+ */
9
+ export { Check, ChevronDown, X } from "lucide-react";
10
+ export type { LucideProps as IconProps } from "lucide-react";
@@ -3,4 +3,4 @@ import "@/index.css";
3
3
  declare function MimasProvider({ children }: {
4
4
  children?: ReactNode;
5
5
  }): import("react/jsx-runtime").JSX.Element;
6
- export default MimasProvider;
6
+ export { MimasProvider };
@@ -0,0 +1,5 @@
1
+ export interface NoiseProps {
2
+ opacity?: number;
3
+ }
4
+ declare function Noise(props: NoiseProps): import("react/jsx-runtime").JSX.Element;
5
+ export { Noise };
@@ -0,0 +1,36 @@
1
+ import { ReactNode } from "react";
2
+ import { Palette as PaletteRamp, PaletteName } from "../../config/palettes";
3
+ /** Semantic colour roles a palette can be mapped onto. */
4
+ export type Role = "primary" | "base" | "positive" | "negative" | "warning";
5
+ /**
6
+ * A palette to apply to a role: either the name of a bundled palette
7
+ * (e.g. `"violet"`) or a full ramp object for bring-your-own colours.
8
+ */
9
+ export type PaletteValue = PaletteName | PaletteRamp;
10
+ export interface PaletteProps extends Partial<Record<Role, PaletteValue>> {
11
+ children?: ReactNode;
12
+ }
13
+ /**
14
+ * Scopes one or more colour palettes onto semantic roles for everything it wraps.
15
+ *
16
+ * It writes the role's `--color-*` CSS variables onto a `display: contents`
17
+ * carrier, so descendants pick them up through the normal cascade without
18
+ * introducing a layout box. Nest freely — an inner `<Palette>` overrides an
19
+ * outer one, and only the roles you pass are changed (the rest keep inheriting).
20
+ *
21
+ * Each role accepts either the name of a bundled palette or a custom ramp.
22
+ *
23
+ * @example
24
+ * // Bundled palette by name:
25
+ * <Palette primary="red">
26
+ * <Button colour="primary">Delete</Button>
27
+ * </Palette>
28
+ *
29
+ * @example
30
+ * // Bring your own ramp, and remap several roles at once:
31
+ * <Palette primary={myBrandRamp} base="slate">
32
+ * …
33
+ * </Palette>
34
+ */
35
+ declare function Palette({ children, ...roles }: PaletteProps): import("react/jsx-runtime").JSX.Element;
36
+ export { Palette };
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from "react";
2
+ import { Corners, LeftCorners } from "../../lib/corners";
3
+ export interface RabbetProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ corners?: Corners;
5
+ leftCorners?: LeftCorners;
6
+ /** Extra classes on the outer frame (e.g. fixed size, cursor). */
7
+ className?: string;
8
+ children?: ReactNode;
9
+ }
10
+ declare const Rabbet: import("react").ForwardRefExoticComponent<RabbetProps & import("react").RefAttributes<HTMLDivElement>>;
11
+ export { Rabbet };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * A color ramp: the 50–950 shades used to build a semantic colour role.
3
+ *
4
+ * `text` is an optional contrast colour for content placed on this palette's
5
+ * main surface. When omitted, the role's existing `--color-*-text` token is
6
+ * left untouched (the theme default — near-white — which reads well on the
7
+ * 600–800 shades most surfaces use).
8
+ */
9
+ export type Palette = {
10
+ 50: string;
11
+ 100: string;
12
+ 200: string;
13
+ 300: string;
14
+ 400: string;
15
+ 500: string;
16
+ 600: string;
17
+ 700: string;
18
+ 800: string;
19
+ 900: string;
20
+ 950: string;
21
+ text?: string;
22
+ };
23
+ /** The ordered shade steps that make up a {@link Palette} ramp. */
24
+ export declare const STEPS: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
25
+ export declare const red: Palette;
26
+ export declare const orange: Palette;
27
+ export declare const amber: Palette;
28
+ export declare const yellow: Palette;
29
+ export declare const lime: Palette;
30
+ export declare const green: Palette;
31
+ export declare const emerald: Palette;
32
+ export declare const teal: Palette;
33
+ export declare const cyan: Palette;
34
+ export declare const sky: Palette;
35
+ export declare const blue: Palette;
36
+ export declare const indigo: Palette;
37
+ export declare const violet: Palette;
38
+ export declare const purple: Palette;
39
+ export declare const fuchsia: Palette;
40
+ export declare const pink: Palette;
41
+ export declare const rose: Palette;
42
+ export declare const slate: Palette;
43
+ export declare const gray: Palette;
44
+ export declare const zinc: Palette;
45
+ export declare const neutral: Palette;
46
+ export declare const stone: Palette;
47
+ /** Every bundled palette, keyed by name. */
48
+ export declare const palettes: {
49
+ red: Palette;
50
+ orange: Palette;
51
+ amber: Palette;
52
+ yellow: Palette;
53
+ lime: Palette;
54
+ green: Palette;
55
+ emerald: Palette;
56
+ teal: Palette;
57
+ cyan: Palette;
58
+ sky: Palette;
59
+ blue: Palette;
60
+ indigo: Palette;
61
+ violet: Palette;
62
+ purple: Palette;
63
+ fuchsia: Palette;
64
+ pink: Palette;
65
+ rose: Palette;
66
+ slate: Palette;
67
+ gray: Palette;
68
+ zinc: Palette;
69
+ neutral: Palette;
70
+ stone: Palette;
71
+ };
72
+ /** The name of a bundled palette, e.g. "red" | "blue" | "violet". */
73
+ export type PaletteName = keyof typeof palettes;
@@ -0,0 +1,49 @@
1
+ import { type ReactNode } from "react";
2
+ export type AsyncComponentCancelled = {
3
+ result: "cancelled";
4
+ };
5
+ export type AsyncComponentOk<O> = {
6
+ result: "ok";
7
+ value: O;
8
+ };
9
+ export type AsyncComponentOutcome<O> = AsyncComponentCancelled | AsyncComponentOk<O>;
10
+ export type OkFunction<O> = [O] extends [void] ? () => void : (value: O) => void;
11
+ type ActivationFunction<I, O> = [I] extends [void] ? () => Promise<AsyncComponentOutcome<O>> : (input: I) => Promise<AsyncComponentOutcome<O>>;
12
+ type RejectionFunction<E> = [E] extends [void] ? () => void : (error?: E) => void;
13
+ export declare function step<O, Next>(outcome: AsyncComponentOutcome<O>, next: (value: O) => Promise<AsyncComponentOutcome<Next>>): Promise<AsyncComponentOutcome<Next>>;
14
+ export type AsyncComponentBaseArgs<I = void, O = void, E = void> = {
15
+ /** Whether the component is currently active. */
16
+ isActive: boolean;
17
+ /** Finish successfully with `{ result: 'ok', value }`. */
18
+ ok: OkFunction<O>;
19
+ /** Dismiss without a value (e.g. if the user cancels). */
20
+ cancel: () => void;
21
+ /** Reject the promise with `E`. */
22
+ reject: RejectionFunction<E>;
23
+ /** The input provided on activation, if any. */
24
+ input?: I;
25
+ };
26
+ export type AsyncComponentRenderArgs<I = void, O = void, E = void> = [
27
+ I
28
+ ] extends [void] ? Omit<AsyncComponentBaseArgs<void, O, E>, "input"> : AsyncComponentBaseArgs<I, O, E>;
29
+ type AsyncComponentOptions = {
30
+ /** How long to wait before resetting the component after close. */
31
+ exitDelay?: number;
32
+ /** Keep internal state across activations. */
33
+ persistState?: boolean;
34
+ };
35
+ type UseAsyncComponentResult<I = void, O = void> = {
36
+ /** Key for the rendered fragment. */
37
+ key: string;
38
+ /** Render this node in the tree. */
39
+ element: ReactNode;
40
+ /** The input provided on activation, if any. */
41
+ input?: I;
42
+ /** Whether the component is currently active. */
43
+ isActive: boolean;
44
+ activate: ActivationFunction<I, O>;
45
+ /** Reset component state without activating. */
46
+ reset: () => void;
47
+ };
48
+ export declare const useAsyncComponent: <I = void, O = void, E = void>(render: (props: AsyncComponentRenderArgs<I, O, E>) => ReactNode, options?: AsyncComponentOptions) => UseAsyncComponentResult<I, O>;
49
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Tracks an element's rendered width, so layout can be driven by whatever CSS the caller applies. */
2
+ export declare function useContainerWidth<T extends HTMLElement>(): readonly [import("react").MutableRefObject<T>, number];
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from "./components";
2
+ export { useAsyncComponent, step, type AsyncComponentBaseArgs, type AsyncComponentRenderArgs, type AsyncComponentOutcome, type AsyncComponentCancelled, type AsyncComponentOk, type OkFunction, } from "./hooks/use-async-component";
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Value-to-colour mapping shared by magnitude visualisations (Heatmap,
3
+ * BarChart, …) so a given ratio always reads as the same intensity
4
+ * everywhere it appears.
5
+ */
6
+ /**
7
+ * Maps a value/goal (or value/max) ratio to a palette shade step. `null`
8
+ * below zero (nothing to shade); darkest step near empty, saturating to the
9
+ * lightest step as it climbs past 2.5x.
10
+ */
11
+ export declare function ratioToShade(ratio: number): number | null;
12
+ /** The darker shade step used for chip accents beneath a fill. */
13
+ export declare function chipShade(shade: number): number;
14
+ /** A shade step's CSS custom-property colour, e.g. `var(--color-primary-500)`. */
15
+ export declare function shadeColour(shade: number | null, role?: string): string | undefined;
16
+ /** Brightness filter (%) for a ratio climbing past its goal/max — undefined once empty. */
17
+ export declare function ratioBrightness(ratio: number): number | undefined;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Single source of truth for corner styles across the library.
3
+ *
4
+ * Two scales exist because a Rabbet has 2px of padding between its outer frame
5
+ * and the inner face — the inner face must use a radius 2px smaller so both
6
+ * visually appear to share the same curvature centre.
7
+ *
8
+ * - outerCornerRadius / outerLeftCornerRadius:
9
+ * Rabbet frame, chip shelf, and standalone controls (Input, Select).
10
+ *
11
+ * - innerCornerRadius / innerLeftCornerRadius:
12
+ * Inner faces inside a Rabbet (Button inner div, Checkbox root).
13
+ */
14
+ export type Corners = "sharp" | "round" | "circle";
15
+ /** Left-side corner override — used to flatten the leading edge inside a group. */
16
+ export type LeftCorners = "none" | Corners;
17
+ export declare const outerCornerRadius: Record<Corners, string>;
18
+ export declare const innerCornerRadius: Record<Corners, string>;
19
+ export declare const outerLeftCornerRadius: Record<LeftCorners, string>;
20
+ export declare const innerLeftCornerRadius: Record<LeftCorners, string>;