@stackone/malachite 0.47.1 → 0.49.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 +3 -3
- package/dist/index.d.ts +85 -10
- package/dist/index.js +4226 -3829
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/COMPONENTS.md
CHANGED
|
@@ -6,7 +6,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
6
6
|
|
|
7
7
|
## Layout & containers
|
|
8
8
|
|
|
9
|
-
- **`Surface`** — Rounded, bordered card container with the standard elevation shadow. _Key props:_ `children`, `className`, `style`.
|
|
9
|
+
- **`Surface`** — Rounded, bordered card container with the standard elevation shadow. Set `overflow="visible"` when a descendant must escape the card box (e.g. a sticky row). _Key props:_ `children`, `padding`, `overflow`, `className`, `style`.
|
|
10
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
11
|
- **`Card`** — Generic content card.
|
|
12
12
|
- **`SplitScreenLayout`** — Two-pane full-screen layout (content + preview/aside) with an optional dismiss button.
|
|
@@ -20,7 +20,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
20
20
|
## Lists, rows & navigation
|
|
21
21
|
|
|
22
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 (disclosure arrow + title/header + trailing slot). Use `header` for rich content and `trailing` for an interactive control (e.g. a Checkbox) — trailing sits outside the toggle button, so a selectable+expandable row is just an Accordion. Controlled or uncontrolled. _Key props:_ `title` or `header`, `trailing`, `disabled`, `isExpanded`/`defaultExpanded`, `onToggle`.
|
|
23
|
+
- **`Accordion`** — Expand/collapse section with a clickable header (disclosure arrow + title/header + trailing slot). Use `header` for rich content and `trailing` for an interactive control (e.g. a Checkbox) — trailing sits outside the toggle button, so a selectable+expandable row is just an Accordion. Controlled or uncontrolled. Pass `stickyHeader` (+ optional `stickyTopOffset`) to pin the header while the body scrolls — needs an unclipped scroll ancestor (e.g. `<Surface overflow="visible">`); `roundTop`/`roundBottom` round the first/last row inside such a Surface. _Key props:_ `title` or `header`, `trailing`, `disabled`, `isExpanded`/`defaultExpanded`, `onToggle`, `stickyHeader`, `stickyTopOffset`, `roundTop`, `roundBottom`, `animate`.
|
|
24
24
|
- **`DefinitionRow`** — Row showing an icon, label, optional tag and description — for definition/detail lists. _Key props:_ `icon`, `label`, `tag`, `description`.
|
|
25
25
|
- **`PreviewTree`** — Nested, indented tree for previewing hierarchical structure.
|
|
26
26
|
- **`PreviewTreeRow`** — A single labelled row within a PreviewTree. _Key props:_ `label`.
|
|
@@ -37,7 +37,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
37
37
|
- **`Input`** — Single-line text input.
|
|
38
38
|
- **`TextArea`** — Multi-line text input.
|
|
39
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`.
|
|
40
|
+
- **`Checkbox`** — Checkbox supporting checked/indeterminate/disabled. Pass `presentational` to render a visual-only, non-focusable indicator for use inside a clickable row/card. _Key props:_ `checked`, `indeterminate`, `disabled`, `onChange`, `presentational`.
|
|
41
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
42
|
- **`Toggle`** — On/off switch.
|
|
43
43
|
- **`Dropdown`** — Single-select dropdown. _Key props:_ `DropdownItem[]`, `DropdownSize`.
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,24 @@ declare interface AccordionBaseProps {
|
|
|
23
23
|
onToggle?: (expanded: boolean) => void;
|
|
24
24
|
/** Disables the toggle (and its hover). Trailing controls manage their own state. */
|
|
25
25
|
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Pin the header row to the top of the nearest scroll container so it stays
|
|
28
|
+
* reachable while the body scrolls. Needs an unclipped scroll ancestor — e.g. a
|
|
29
|
+
* `<Surface overflow="visible">`, since `overflow: hidden` traps sticky.
|
|
30
|
+
*/
|
|
31
|
+
stickyHeader?: boolean;
|
|
32
|
+
/** Offset (px) from the top of the scroll container when `stickyHeader` is set. */
|
|
33
|
+
stickyTopOffset?: number;
|
|
34
|
+
/** Round the top corners — for the first row inside an `overflow="visible"` Surface. */
|
|
35
|
+
roundTop?: boolean;
|
|
36
|
+
/** Round the bottom corners — for the last row inside an `overflow="visible"` Surface. */
|
|
37
|
+
roundBottom?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Animate the expand/collapse height (default `true`). Set `false` for an instant
|
|
40
|
+
* open — the body isn't clipped, so a `position: sticky` child pins immediately with
|
|
41
|
+
* no post-animation settle.
|
|
42
|
+
*/
|
|
43
|
+
animate?: boolean;
|
|
26
44
|
}
|
|
27
45
|
|
|
28
46
|
/**
|
|
@@ -238,9 +256,16 @@ export declare interface CheckboxProps {
|
|
|
238
256
|
checked: boolean;
|
|
239
257
|
/** Tri-state "partial" look — overrides the checked tick with a square. */
|
|
240
258
|
indeterminate?: boolean;
|
|
241
|
-
|
|
259
|
+
/** Optional when `presentational` — a presentational checkbox is a visual indicator only. */
|
|
260
|
+
onChange?: (checked: boolean) => void;
|
|
242
261
|
disabled?: boolean;
|
|
243
262
|
size?: number;
|
|
263
|
+
/**
|
|
264
|
+
* Render a visual-only indicator (a non-interactive, non-focusable `<span>`,
|
|
265
|
+
* `aria-hidden`) instead of an interactive checkbox. Use this inside a clickable
|
|
266
|
+
* row/card whose wrapper is the real control, so there's a single tab stop.
|
|
267
|
+
*/
|
|
268
|
+
presentational?: boolean;
|
|
244
269
|
'aria-label'?: string;
|
|
245
270
|
'aria-labelledby'?: string;
|
|
246
271
|
className?: string;
|
|
@@ -977,16 +1002,13 @@ declare interface MarkdownProps {
|
|
|
977
1002
|
|
|
978
1003
|
export declare const MultiSelect: default_2.FC<MultiSelectProps>;
|
|
979
1004
|
|
|
980
|
-
|
|
981
|
-
value: string;
|
|
982
|
-
label: default_2.ReactNode;
|
|
983
|
-
searchText?: string;
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
export declare interface MultiSelectProps {
|
|
1005
|
+
declare interface MultiSelectBaseProps {
|
|
987
1006
|
options: MultiSelectOption[];
|
|
988
|
-
value
|
|
989
|
-
|
|
1007
|
+
/** Controlled value. When provided, component is fully controlled. */
|
|
1008
|
+
value?: string[];
|
|
1009
|
+
/** Initial value for uncontrolled usage (like Dropdown's defaultValue). */
|
|
1010
|
+
defaultValue?: string[];
|
|
1011
|
+
onChange?: (next: string[]) => void;
|
|
990
1012
|
placeholder?: string;
|
|
991
1013
|
renderTrigger?: (selected: MultiSelectOption[]) => default_2.ReactNode;
|
|
992
1014
|
searchable?: boolean;
|
|
@@ -997,10 +1019,48 @@ export declare interface MultiSelectProps {
|
|
|
997
1019
|
error?: boolean;
|
|
998
1020
|
loading?: boolean;
|
|
999
1021
|
label?: string;
|
|
1022
|
+
description?: string;
|
|
1023
|
+
tooltip?: string;
|
|
1024
|
+
hint?: string;
|
|
1025
|
+
required?: boolean;
|
|
1026
|
+
/** Show selected values as chips instead of "N selected" text */
|
|
1027
|
+
chips?: boolean;
|
|
1028
|
+
/** Show × button on each chip to remove it (only when chips=true) */
|
|
1029
|
+
chipsRemovable?: boolean;
|
|
1030
|
+
/** Max visible chips. 'auto' = show all chips. Number = hard limit with "+N" badge */
|
|
1031
|
+
chipsMax?: number | 'auto';
|
|
1032
|
+
/** Search input inside the trigger field instead of external search bar */
|
|
1033
|
+
inlineSearch?: boolean;
|
|
1000
1034
|
className?: string;
|
|
1001
1035
|
style?: default_2.CSSProperties;
|
|
1002
1036
|
}
|
|
1003
1037
|
|
|
1038
|
+
export declare interface MultiSelectOption {
|
|
1039
|
+
value: string;
|
|
1040
|
+
label: default_2.ReactNode;
|
|
1041
|
+
searchText?: string;
|
|
1042
|
+
/** Prevent toggling or removing this option — used for mandatory/locked selections */
|
|
1043
|
+
disabled?: boolean;
|
|
1044
|
+
/** Right-aligned badge shown in the dropdown only (not in chips) */
|
|
1045
|
+
badge?: default_2.ReactNode;
|
|
1046
|
+
/** Description text for this option */
|
|
1047
|
+
description?: string;
|
|
1048
|
+
/** How description renders — 'icon': info icon with tooltip, 'subtitle': text below label, 'hover': tooltip on label. Default: 'icon' */
|
|
1049
|
+
descriptionMode?: 'icon' | 'subtitle' | 'hover';
|
|
1050
|
+
/** Custom icon for 'icon' mode. Default: built-in ⓘ */
|
|
1051
|
+
descriptionIcon?: default_2.ReactNode;
|
|
1052
|
+
/** Truncate subtitle after N lines. Only applies to 'subtitle' mode */
|
|
1053
|
+
descriptionMaxLines?: number;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
export declare type MultiSelectProps = (MultiSelectBaseProps & {
|
|
1057
|
+
formControl: Control<FieldValues, unknown>;
|
|
1058
|
+
name: string;
|
|
1059
|
+
}) | (MultiSelectBaseProps & {
|
|
1060
|
+
formControl?: undefined;
|
|
1061
|
+
name?: string;
|
|
1062
|
+
});
|
|
1063
|
+
|
|
1004
1064
|
export declare type MultiSelectSize = 'small' | 'medium';
|
|
1005
1065
|
|
|
1006
1066
|
export declare const NumberTag: default_2.FC<NumberTagProps>;
|
|
@@ -1353,6 +1413,12 @@ declare interface SurfaceComponent extends default_2.FC<SurfaceProps> {
|
|
|
1353
1413
|
export declare interface SurfaceProps {
|
|
1354
1414
|
children?: default_2.ReactNode;
|
|
1355
1415
|
padding?: boolean;
|
|
1416
|
+
/**
|
|
1417
|
+
* Content overflow. Defaults to `hidden` so children are clipped to the rounded
|
|
1418
|
+
* corners. Set to `visible` when a descendant needs to escape the card box —
|
|
1419
|
+
* e.g. a `position: sticky` row, which `overflow: hidden` would otherwise trap.
|
|
1420
|
+
*/
|
|
1421
|
+
overflow?: 'hidden' | 'visible';
|
|
1356
1422
|
role?: default_2.AriaRole;
|
|
1357
1423
|
'aria-label'?: string;
|
|
1358
1424
|
'aria-labelledby'?: string;
|
|
@@ -1542,6 +1608,7 @@ export declare interface TagProps {
|
|
|
1542
1608
|
iconColor?: TextColor;
|
|
1543
1609
|
pointerType?: 'pointer' | 'default';
|
|
1544
1610
|
onClick?: () => void;
|
|
1611
|
+
onRemove?: (e: default_2.MouseEvent) => void;
|
|
1545
1612
|
className?: string;
|
|
1546
1613
|
}
|
|
1547
1614
|
|
|
@@ -1649,6 +1716,8 @@ declare interface TooltipProps {
|
|
|
1649
1716
|
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
1650
1717
|
isShrinkable?: boolean;
|
|
1651
1718
|
fill?: boolean;
|
|
1719
|
+
/** Max width of tooltip. Default: 320px */
|
|
1720
|
+
maxWidth?: number | string;
|
|
1652
1721
|
}
|
|
1653
1722
|
|
|
1654
1723
|
/**
|
|
@@ -1695,6 +1764,12 @@ export declare interface WizardLayoutProps {
|
|
|
1695
1764
|
stepper?: default_2.ReactNode;
|
|
1696
1765
|
/** Far-right top-bar slot — e.g. a theme toggle. */
|
|
1697
1766
|
trailing?: default_2.ReactNode;
|
|
1767
|
+
/**
|
|
1768
|
+
* Pinned below the top bar and always visible while the content scrolls —
|
|
1769
|
+
* e.g. connection logos + a step title. Rendered in the same centred column
|
|
1770
|
+
* as the content (`contentWidth`).
|
|
1771
|
+
*/
|
|
1772
|
+
header?: default_2.ReactNode;
|
|
1698
1773
|
/** Pinned to the bottom of the screen — typically a <FooterNav />. */
|
|
1699
1774
|
footer?: default_2.ReactNode;
|
|
1700
1775
|
/** Vertically centre the content (used for terminal/success screens). */
|