@stackone/malachite 0.38.1 → 0.39.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/COMPONENTS.md +84 -0
- package/dist/index.d.ts +68 -2
- package/dist/index.js +569 -465
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/COMPONENTS.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<!-- GENERATED by `npm run docs:components` from scripts/component-catalog.mjs. Do not edit by hand. -->
|
|
2
|
+
|
|
3
|
+
# Malachite components
|
|
4
|
+
|
|
5
|
+
The catalog of components exported from `@stackone/malachite`. **Reach for one of these before hand-rolling UI** — see `CLAUDE.md` for why. Open the demo app and pick a component from the sidebar to see it live.
|
|
6
|
+
|
|
7
|
+
## Layout & containers
|
|
8
|
+
|
|
9
|
+
- **`Surface`** — Rounded, bordered card container with the standard elevation shadow. _Key props:_ `children`, `className`, `style`.
|
|
10
|
+
- **`SurfaceRow`** — A full-bleed row inside a Surface (used as `Surface.Row`). Owns hover highlight, colour transition and an optional bottom divider. Pass `onClick`/`href` to make the whole row clickable (renders as a real button/anchor, so keyboard nav works). For a selectable row use `role="radio"` + `selected` and put a presentational `<Radio>` inside as the indicator. _Key props:_ `divider`, `disabled`, `onClick`, `href`, `selected`, `role`, `className`, `style`.
|
|
11
|
+
- **`Card`** — Generic content card.
|
|
12
|
+
- **`SplitScreenLayout`** — Two-pane full-screen layout (content + preview/aside) with an optional dismiss button.
|
|
13
|
+
- **`WizardLayout`** — Full-screen wizard scaffold: top bar (back button, right-aligned stepper, trailing slot), centered content column, pinned footer. _Key props:_ `showBack`, `onBack`, `stepper`, `trailing`, `footer`, `center`, `contentWidth`, `minWidth`.
|
|
14
|
+
- **`Flex`** — Flexbox layout helper with semantic direction/align/justify/gap props. _Key props:_ `FlexDirection`, `FlexAlign`, `FlexJustify`, `FlexGapSize`.
|
|
15
|
+
- **`Padded`** — Padding wrapper applying consistent design-system spacing.
|
|
16
|
+
- **`Spacer`** — Empty element that adds fixed spacing between siblings.
|
|
17
|
+
- **`Divider`** — Horizontal/vertical separator; supports a dashed line style. _Key props:_ `lineStyle="solid" | "dashed"`, `DividerVariant`, `SpacingSize`, `PaddingSize`.
|
|
18
|
+
- **`OverflowRow`** — Horizontal row that collapses items that do not fit into an overflow affordance.
|
|
19
|
+
|
|
20
|
+
## Lists, rows & navigation
|
|
21
|
+
|
|
22
|
+
- **`ButtonList`** — Vertical list of pill-style button/link rows with built-in hover/focus/active states. _Key props:_ `buttons[]` (`key`, `children`, `onClick`, `href`), `compact`.
|
|
23
|
+
- **`Accordion`** — Expand/collapse section with a clickable header (arrow + title + trailing slot). Controlled or uncontrolled. _Key props:_ `title`, `trailing`, `isExpanded`/`defaultExpanded`, `onToggle`.
|
|
24
|
+
- **`DefinitionRow`** — Row showing an icon, label, optional tag and description — for definition/detail lists. _Key props:_ `icon`, `label`, `tag`, `description`.
|
|
25
|
+
- **`PreviewTree`** — Nested, indented tree for previewing hierarchical structure.
|
|
26
|
+
- **`PreviewTreeRow`** — A single labelled row within a PreviewTree. _Key props:_ `label`.
|
|
27
|
+
- **`Tabs`** — Tabbed navigation switching between content panels. _Key props:_ `TabItem[]`.
|
|
28
|
+
- **`ActionMenu`** — Dropdown menu of actions (kebab/overflow style). _Key props:_ `ActionMenuItem[]`.
|
|
29
|
+
- **`FooterNav`** — Footer navigation bar of links. _Key props:_ `FooterNavLink[]`.
|
|
30
|
+
- **`FooterLinks`** — Inline list of footer links (e.g. terms, privacy, support).
|
|
31
|
+
|
|
32
|
+
## Forms & inputs
|
|
33
|
+
|
|
34
|
+
- **`Form`** — Form container coordinating field layout and submission.
|
|
35
|
+
- **`FormItem`** — Labelled form field wrapper (label, help text, error).
|
|
36
|
+
- **`BaseFormComponent`** — Low-level base used by form controls; rarely used directly.
|
|
37
|
+
- **`Input`** — Single-line text input.
|
|
38
|
+
- **`TextArea`** — Multi-line text input.
|
|
39
|
+
- **`Search`** — Search input with a leading icon; `filled` and `muted` variants. _Key props:_ `value`, `onChange`, `placeholder`, `variant`, `size`, `disabled`.
|
|
40
|
+
- **`Checkbox`** — Checkbox supporting checked/indeterminate/disabled. _Key props:_ `checked`, `indeterminate`, `disabled`, `onChange`.
|
|
41
|
+
- **`Radio`** — Single radio control with hover state; parent manages the group. Pass `presentational` to render a visual-only, non-focusable indicator for use inside a clickable row/card. _Key props:_ `checked`, `onChange`, `disabled`, `size`, `presentational`.
|
|
42
|
+
- **`Toggle`** — On/off switch.
|
|
43
|
+
- **`Dropdown`** — Single-select dropdown. _Key props:_ `DropdownItem[]`, `DropdownSize`.
|
|
44
|
+
- **`MultiSelect`** — Multi-select dropdown. _Key props:_ `MultiSelectOption[]`, `MultiSelectSize`.
|
|
45
|
+
|
|
46
|
+
## Buttons & actions
|
|
47
|
+
|
|
48
|
+
- **`Button`** — Primary button. Variants: `filled`, `outline`, `destructive`, `success`, `warning`, `error`, `ghost`, `no-style`. Supports `iconOnly`, `loading`, `tooltip`. _Key props:_ `variant`, `size`, `icon`, `iconOnly`, `loading`, `disabled`, `fill`, `tooltip`.
|
|
49
|
+
- **`PillButton`** — Pill-shaped button, often used for filters/toggleable chips.
|
|
50
|
+
- **`Link`** — Styled anchor/link text. _Key props:_ `LinkProps`.
|
|
51
|
+
|
|
52
|
+
## Feedback & status
|
|
53
|
+
|
|
54
|
+
- **`Alert`** — Inline alert/callout (info, success, warning, error).
|
|
55
|
+
- **`StatusBadge`** — Large status indicator (e.g. success checkmark) for terminal/confirmation screens. _Key props:_ `type`.
|
|
56
|
+
- **`StatBadge`** — Pill showing a numeric value with a label (e.g. "3 accounts selected"). _Key props:_ `count`, `label`.
|
|
57
|
+
- **`Tag`** — Small status/label tag. Types: success, error, warning, default. _Key props:_ `value`, `type`, `paddingSize`, `textTransform`, `WidthSize`.
|
|
58
|
+
- **`NumberTag`** — Compact numeric badge/counter.
|
|
59
|
+
- **`Progress`** — Progress bar.
|
|
60
|
+
- **`Spinner`** — Loading spinner.
|
|
61
|
+
- **`Skeleton`** — Loading placeholders. Includes `Skeleton.Avatar` and `Skeleton.Input`.
|
|
62
|
+
- **`Tooltip`** — Hover/focus tooltip; also works on disabled controls (see CLAUDE.md).
|
|
63
|
+
- **`TruncatedTooltip`** — Shows a tooltip only when its text is truncated.
|
|
64
|
+
- **`Confetti`** — Celebratory confetti burst for success moments. _Key props:_ `pieces`.
|
|
65
|
+
|
|
66
|
+
## Data display
|
|
67
|
+
|
|
68
|
+
- **`Table`** — Data table with columns, sizing, pagination and row selection. _Key props:_ `TableColumns`, `TableSize`, `TableType`, `TableRowSelection`, `TablePaginationPosition`.
|
|
69
|
+
- **`Statistic`** — Displays a statistic value with a label; primary/secondary sizes. _Key props:_ `StatisticValueSize`.
|
|
70
|
+
- **`Avatar`** — Logo/initial avatar. Renders the image when available, otherwise a coloured tile with the first letter of `name`. Encapsulates the fallback colour. _Key props:_ `src`, `name`, `size`, `shape="square" | "circle"`.
|
|
71
|
+
- **`ConnectionHeader`** — Two tilted logo tiles (from → to) showing a connection between apps. _Key props:_ `from`, `to` (`ConnectionEndpoint`: `icon`, `label`, `background`).
|
|
72
|
+
- **`CodeBlock`** — Syntax-styled code block. _Key props:_ `code`.
|
|
73
|
+
- **`Stepper`** — Progress dots/segments for a multi-step flow; optionally clickable. _Key props:_ `steps`, `active`, `onChange`.
|
|
74
|
+
- **`Swatch`** — Colour swatch preview.
|
|
75
|
+
|
|
76
|
+
## Typography
|
|
77
|
+
|
|
78
|
+
- **`Typography`** — Text primitives — use these instead of raw colour tokens on `<span>`s. Includes `Typography.Text`, `Typography.SecondaryText`, `Typography.EllipsisText`, etc., with size/weight/color props.
|
|
79
|
+
|
|
80
|
+
## Theming & utility
|
|
81
|
+
|
|
82
|
+
- **`MalachiteContext`** — Wraps a subtree in the shadow root + theme context. Wrap groups of components in this.
|
|
83
|
+
- **`CustomIcons`** — Namespace of all built-in icons (`CustomIcons.<Name>Icon`), coloured via `currentColor`.
|
|
84
|
+
- **`ShadowEscape`** — Renders children into the document (escaping the shadow root) for portals/overlays.
|
package/dist/index.d.ts
CHANGED
|
@@ -86,6 +86,26 @@ export declare function applyLightTheme(): void;
|
|
|
86
86
|
*/
|
|
87
87
|
export declare function applyTheme(theme: PartialMalachiteTheme): void;
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* A logo/initial avatar. Renders `src` when available, otherwise a coloured tile
|
|
91
|
+
* with the first letter of `name`. Encapsulates the fallback colour so consumers
|
|
92
|
+
* never hand-roll it.
|
|
93
|
+
*/
|
|
94
|
+
export declare const Avatar: default_2.FC<AvatarProps>;
|
|
95
|
+
|
|
96
|
+
export declare interface AvatarProps {
|
|
97
|
+
/** Image URL (logo/photo). Falls back to the initial of `name` when missing or it fails to load. */
|
|
98
|
+
src?: string;
|
|
99
|
+
/** Used for the initial fallback and as the image alt / accessible label. */
|
|
100
|
+
name?: string;
|
|
101
|
+
/** Pixel size of the (square) avatar. */
|
|
102
|
+
size?: number;
|
|
103
|
+
shape?: AvatarShape;
|
|
104
|
+
className?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare type AvatarShape = 'square' | 'circle';
|
|
108
|
+
|
|
89
109
|
export declare const BaseFormComponent: default_2.FC<BaseFormComponentProps>;
|
|
90
110
|
|
|
91
111
|
declare interface BaseFormComponentProps {
|
|
@@ -1083,9 +1103,16 @@ export declare const Radio: default_2.FC<RadioProps>;
|
|
|
1083
1103
|
|
|
1084
1104
|
export declare interface RadioProps {
|
|
1085
1105
|
checked: boolean;
|
|
1086
|
-
|
|
1106
|
+
/** Optional when `presentational` — a presentational radio is a visual indicator only. */
|
|
1107
|
+
onChange?: (checked: boolean) => void;
|
|
1087
1108
|
disabled?: boolean;
|
|
1088
1109
|
size?: number;
|
|
1110
|
+
/**
|
|
1111
|
+
* Render a visual-only indicator (a non-interactive, non-focusable `<span>`,
|
|
1112
|
+
* `aria-hidden`) instead of an interactive radio. Use this inside a clickable
|
|
1113
|
+
* row/card whose wrapper is the real control, so there's a single tab stop.
|
|
1114
|
+
*/
|
|
1115
|
+
presentational?: boolean;
|
|
1089
1116
|
'aria-label'?: string;
|
|
1090
1117
|
'aria-labelledby'?: string;
|
|
1091
1118
|
className?: string;
|
|
@@ -1284,7 +1311,11 @@ export declare interface StepperProps {
|
|
|
1284
1311
|
'aria-label'?: string;
|
|
1285
1312
|
}
|
|
1286
1313
|
|
|
1287
|
-
export declare const Surface:
|
|
1314
|
+
export declare const Surface: SurfaceComponent;
|
|
1315
|
+
|
|
1316
|
+
declare interface SurfaceComponent extends default_2.FC<SurfaceProps> {
|
|
1317
|
+
Row: default_2.FC<SurfaceRowProps>;
|
|
1318
|
+
}
|
|
1288
1319
|
|
|
1289
1320
|
export declare interface SurfaceProps {
|
|
1290
1321
|
children?: default_2.ReactNode;
|
|
@@ -1292,6 +1323,41 @@ export declare interface SurfaceProps {
|
|
|
1292
1323
|
style?: default_2.CSSProperties;
|
|
1293
1324
|
}
|
|
1294
1325
|
|
|
1326
|
+
/**
|
|
1327
|
+
* A single full-bleed row inside a <Surface>. Owns the row chrome — hover
|
|
1328
|
+
* highlight, colour transition and an optional bottom divider — so consumers
|
|
1329
|
+
* compose their own content inside without re-implementing design-system styling.
|
|
1330
|
+
* Pass `onClick`/`href` to make the entire row clickable (rendered as a real
|
|
1331
|
+
* button/anchor, so keyboard navigation works natively).
|
|
1332
|
+
*/
|
|
1333
|
+
export declare const SurfaceRow: default_2.FC<SurfaceRowProps>;
|
|
1334
|
+
|
|
1335
|
+
export declare interface SurfaceRowProps {
|
|
1336
|
+
children?: default_2.ReactNode;
|
|
1337
|
+
/** Renders a bottom divider — omit on the last row in a Surface. */
|
|
1338
|
+
divider?: boolean;
|
|
1339
|
+
/** Removes the hover affordance / disables the control (e.g. while loading/busy). */
|
|
1340
|
+
disabled?: boolean;
|
|
1341
|
+
/**
|
|
1342
|
+
* When provided, the whole row becomes clickable: it renders as a `<button>`
|
|
1343
|
+
* (or `<a>` when `href` is set), so the entire row is the click target with
|
|
1344
|
+
* native focus + Enter/Space — no manual tabIndex/key handlers. For a
|
|
1345
|
+
* selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the
|
|
1346
|
+
* visual indicator; do NOT nest an interactive control (invalid + double tab stop).
|
|
1347
|
+
*/
|
|
1348
|
+
onClick?: (event: default_2.MouseEvent) => void;
|
|
1349
|
+
/** Renders the clickable row as an anchor instead of a button. */
|
|
1350
|
+
href?: string;
|
|
1351
|
+
/** Selected state. Drives `aria-checked` when `role` is `radio`/`checkbox`. */
|
|
1352
|
+
selected?: boolean;
|
|
1353
|
+
/** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */
|
|
1354
|
+
role?: default_2.AriaRole;
|
|
1355
|
+
'aria-label'?: string;
|
|
1356
|
+
'aria-labelledby'?: string;
|
|
1357
|
+
className?: string;
|
|
1358
|
+
style?: default_2.CSSProperties;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1295
1361
|
export declare const Swatch: default_2.FC<SwatchProps>;
|
|
1296
1362
|
|
|
1297
1363
|
export declare interface SwatchProps {
|