@stackone/malachite 0.67.2 → 0.69.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/dist/index.d.ts CHANGED
@@ -59,6 +59,30 @@ export declare type AccordionProps = AccordionBaseProps & ({
59
59
  header: default_2.ReactNode;
60
60
  });
61
61
 
62
+ export declare const ActionBar: default_2.FC<ActionBarProps>;
63
+
64
+ export declare interface ActionBarItem {
65
+ label: string;
66
+ onClick?: () => void;
67
+ disabled?: boolean;
68
+ icon?: default_2.ReactNode;
69
+ tooltip?: string;
70
+ variant?: BaseButtonProps['variant'];
71
+ size?: BaseButtonProps['size'];
72
+ radius?: BaseButtonProps['radius'];
73
+ /** Renders a vertical rule before this button (and a menu divider when collapsed). */
74
+ dividerBefore?: boolean;
75
+ }
76
+
77
+ export declare interface ActionBarProps {
78
+ buttons: ActionBarItem[];
79
+ /** Container width, in px, below which the row collapses into a single menu. */
80
+ collapseBelow?: number;
81
+ /** Accessible name for the collapsed menu trigger. */
82
+ menuLabel?: string;
83
+ className?: string;
84
+ }
85
+
62
86
  /**
63
87
  * ActionMenu is a kebab-style overflow action menu. The trigger is a square
64
88
  * icon-only outline Button (three-dot icon by default); on click, a popover
@@ -103,7 +127,28 @@ declare interface AlertProps {
103
127
  onToggle?: (expanded: boolean) => void;
104
128
  }
105
129
 
106
- declare type AlertType = 'info' | 'success' | 'error' | 'warning';
130
+ export declare type AlertType = 'info' | 'success' | 'error' | 'warning';
131
+
132
+ export declare const AppLogo: default_2.FC<AppLogoProps>;
133
+
134
+ export declare interface AppLogoProps {
135
+ /** Connector logo URL. Falls back to a coloured initial tile when missing or broken. */
136
+ src?: string;
137
+ /** Connector name — the accessible label, the fallback initial, and the visible text. */
138
+ name: string;
139
+ /** Renders the name beside the mark. Omit for a bare logo (e.g. inside a dense row). */
140
+ showName?: boolean;
141
+ /** Pixel size of the square mark. */
142
+ size?: number;
143
+ nameSize?: FontSize;
144
+ /** Defaults to `normal`. Raise it when the logo doubles as a page title. */
145
+ nameWeight?: FontWeight;
146
+ /** Rendered as a tag after the name, e.g. `v1.2.0` or `Legacy`. */
147
+ version?: string;
148
+ /** Truncates a long name with an ellipsis and reveals the full value on hover. */
149
+ truncate?: boolean;
150
+ className?: string;
151
+ }
107
152
 
108
153
  /**
109
154
  * Apply a custom theme while preserving the current theme mode (light/dark)
@@ -150,6 +195,8 @@ export declare interface AvatarProps {
150
195
 
151
196
  export declare type AvatarShape = 'square' | 'circle';
152
197
 
198
+ declare type BaseButtonProps = default_2.ComponentProps<typeof Button>;
199
+
153
200
  export declare const BaseFormComponent: default_2.FC<BaseFormComponentProps>;
154
201
 
155
202
  declare interface BaseFormComponentProps {
@@ -176,7 +223,25 @@ declare interface BaseSkeletonProps {
176
223
  className?: string;
177
224
  }
178
225
 
179
- export declare const Button: default_2.ForwardRefExoticComponent<ButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
226
+ export declare interface BreadcrumbLink {
227
+ name: default_2.ReactNode;
228
+ url?: string;
229
+ isRoot?: boolean;
230
+ }
231
+
232
+ export declare const Breadcrumbs: default_2.FC<BreadcrumbsProps>;
233
+
234
+ export declare interface BreadcrumbsProps {
235
+ links: BreadcrumbLink[];
236
+ actions?: PageAction[];
237
+ renderLink?: RenderBreadcrumbLink;
238
+ className?: string;
239
+ style?: default_2.CSSProperties;
240
+ }
241
+
242
+ export declare const buildActionBarMenuItems: (buttons: ActionBarItem[]) => ActionMenuItem[];
243
+
244
+ export declare const Button: default_2.ForwardRefExoticComponent<ButtonProps & default_2.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
180
245
 
181
246
  declare interface ButtonDefinition {
182
247
  label: string;
@@ -227,14 +292,18 @@ declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonE
227
292
  tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
228
293
  iconOnly?: boolean;
229
294
  children?: default_2.ReactNode;
230
- onClick?: default_2.MouseEventHandler<HTMLButtonElement>;
295
+ onClick?: default_2.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement>;
296
+ /** Renders the button as a real anchor, so a link action is never an <a> nested in a <button>. */
297
+ href?: string;
298
+ target?: default_2.HTMLAttributeAnchorTarget;
299
+ rel?: string;
231
300
  }
232
301
 
233
- declare type ButtonRadius = 'md' | 'lg' | 'xl';
302
+ export declare type ButtonRadius = 'md' | 'lg' | 'xl';
234
303
 
235
- declare type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large';
304
+ export declare type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large';
236
305
 
237
- declare type ButtonVariant = 'filled' | 'outline' | 'destructive' | 'success' | 'warning' | 'error' | 'ghost' | 'no-style';
306
+ export declare type ButtonVariant = 'filled' | 'outline' | 'destructive' | 'success' | 'warning' | 'error' | 'ghost' | 'no-style';
238
307
 
239
308
  export declare const Card: default_2.FC<CardProps>;
240
309
 
@@ -439,6 +508,7 @@ export declare const CustomIcons: {
439
508
  CaretLeftIcon: FC<IconProps>;
440
509
  CaretRightIcon: FC<IconProps>;
441
510
  CaretUpIcon: FC<IconProps>;
511
+ CodeIcon: FC<IconProps>;
442
512
  ChangePasswordIcon: FC<IconProps>;
443
513
  CheckCircleFilled: FC<IconProps>;
444
514
  CheckIcon: FC<IconProps>;
@@ -587,7 +657,7 @@ export declare interface DropdownProps {
587
657
  helperText?: default_2.ReactNode;
588
658
  placeholder?: string;
589
659
  search?: boolean;
590
- /** 'medium' (42px) for form inputs; 'small' (32px) for toolbar chips. */
660
+ /** 'medium' (42px) for form inputs; 'small' (32px) for toolbar chips; 'xsmall' (28px) beside a title. */
591
661
  size?: DropdownSize;
592
662
  /** Names the trigger from the light DOM, where `htmlFor` cannot reach into the shadow root. */
593
663
  id?: string;
@@ -595,17 +665,36 @@ export declare interface DropdownProps {
595
665
  'aria-labelledby'?: string;
596
666
  }
597
667
 
598
- export declare type DropdownSize = 'small' | 'medium';
668
+ export declare type DropdownSize = 'xsmall' | 'small' | 'medium';
599
669
 
600
670
  declare interface EllipsisTextProps {
601
671
  children: default_2.ReactNode;
602
672
  tooltip?: default_2.ReactNode | string;
673
+ /**
674
+ * Defaults to filling the container. Pass a fixed width only when the text should
675
+ * truncate before its container runs out of room (e.g. a column with a hard cap).
676
+ */
603
677
  maxWidth?: string;
604
678
  color?: TextColor;
605
679
  className?: string;
606
680
  style?: default_2.CSSProperties;
607
681
  }
608
682
 
683
+ export declare interface EmptyLayoutProps {
684
+ title?: string;
685
+ children: default_2.ReactNode;
686
+ centered?: boolean;
687
+ uniformPadding?: boolean;
688
+ headerActions?: default_2.ReactNode;
689
+ background?: default_2.ReactNode;
690
+ /** Demotes the default `main` landmark — pass e.g. `region` when the app owns its own. */
691
+ role?: default_2.AriaRole;
692
+ 'aria-label'?: string;
693
+ 'aria-labelledby'?: string;
694
+ className?: string;
695
+ style?: default_2.CSSProperties;
696
+ }
697
+
609
698
  export declare const Flex: default_2.FC<FlexProps>;
610
699
 
611
700
  export declare enum FlexAlign {
@@ -653,7 +742,7 @@ declare interface FlexProps {
653
742
  }
654
743
 
655
744
  /** Which of the three theme typefaces to render in. Defaults to the sans body face. */
656
- declare type FontFamily = 'sans' | 'heading' | 'body';
745
+ declare type FontFamily = 'sans' | 'heading' | 'body' | 'mono';
657
746
 
658
747
  export declare type FontSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
659
748
 
@@ -1303,6 +1392,28 @@ declare type PaddingSize_2 = 'xsmall' | 'small' | 'medium' | 'large' | 'none';
1303
1392
 
1304
1393
  declare type PaddingSize_3 = 'default' | 'compact';
1305
1394
 
1395
+ export declare interface PageAction {
1396
+ label: string;
1397
+ /** Ignored when `href` is set. */
1398
+ onClick?: () => void;
1399
+ disabled?: boolean;
1400
+ variant?: ButtonVariant;
1401
+ icon?: default_2.ReactNode;
1402
+ href?: string;
1403
+ /** Defaults to `_blank`. */
1404
+ target?: '_self' | '_blank';
1405
+ tooltip?: string;
1406
+ tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
1407
+ dividerBefore?: boolean;
1408
+ }
1409
+
1410
+ declare type PageContentGap = 'small' | 'medium' | 'large' | 'xlarge';
1411
+
1412
+ export declare const PageLayout: {
1413
+ Regular: FC<RegularLayoutProps>;
1414
+ Empty: FC<EmptyLayoutProps>;
1415
+ };
1416
+
1306
1417
  declare interface PageTitleProps {
1307
1418
  children: default_2.ReactNode;
1308
1419
  margin?: string;
@@ -1425,6 +1536,48 @@ export declare interface RadioProps {
1425
1536
  id?: string;
1426
1537
  }
1427
1538
 
1539
+ export declare interface RegularLayoutProps {
1540
+ breadcrumbLinks?: BreadcrumbLink[];
1541
+ breadcrumbActions?: PageAction[];
1542
+ renderLink?: RenderBreadcrumbLink;
1543
+ title?: default_2.ReactNode;
1544
+ titleSuffix?: default_2.ReactNode;
1545
+ subtitle?: string;
1546
+ description?: default_2.ReactNode;
1547
+ buttons?: PageAction[];
1548
+ /**
1549
+ * Hides the buttons and skeletons the title. `subtitle` and `description` are only
1550
+ * skeletoned when those props are also passed.
1551
+ */
1552
+ loading?: boolean;
1553
+ children: default_2.ReactNode;
1554
+ centered?: boolean;
1555
+ noPadding?: boolean;
1556
+ contentGap?: PageContentGap;
1557
+ alert?: {
1558
+ message: string;
1559
+ type?: AlertType;
1560
+ };
1561
+ /** Demotes the default `main` landmark — pass e.g. `region` when the app owns its own. */
1562
+ role?: default_2.AriaRole;
1563
+ 'aria-label'?: string;
1564
+ 'aria-labelledby'?: string;
1565
+ className?: string;
1566
+ style?: default_2.CSSProperties;
1567
+ }
1568
+
1569
+ /**
1570
+ * Renders a crumb or the back button through the app's own link component, spreading every
1571
+ * field onto it. A client-side-routed consumer MUST pass this, or navigation breaks.
1572
+ */
1573
+ declare type RenderBreadcrumbLink = (props: {
1574
+ href: string;
1575
+ children: default_2.ReactNode;
1576
+ className?: string;
1577
+ 'aria-current'?: 'page';
1578
+ 'aria-label'?: string;
1579
+ }) => default_2.ReactNode;
1580
+
1428
1581
  /**
1429
1582
  * Reset theme to default values
1430
1583
  */
@@ -1980,8 +2133,12 @@ export declare interface TabsProps {
1980
2133
 
1981
2134
  export declare const Tag: default_2.FC<TagProps>;
1982
2135
 
2136
+ declare type TagFontSize = 'xsmall' | 'small' | 'medium';
2137
+
1983
2138
  export declare interface TagProps {
1984
2139
  value: string | number | default_2.ReactNode;
2140
+ /** Defaults to 12px. Use `xsmall` for a secondary badge beside a primary one. */
2141
+ fontSize?: TagFontSize;
1985
2142
  type?: TagType;
1986
2143
  bordered?: boolean;
1987
2144
  shadow?: boolean;
package/dist/index.js CHANGED
@@ -1,89 +1,94 @@
1
- import { A as s, c as t, d as o, e as r, B as i, f as l, g as n, h as p, i as d, j as T, k as S, l as m, m as c, n as h, o as u, p as g, D as C, q as y, r as w, s as x, F, t as f, u as v, v as k, w as B, x as L, y as P, z as b, E as A, I as D, K as z, L as R, G as M, M as I, H as N, N as V, O as j, P as q, J as E, Q as G, R as H, S as J, T as K, U as O, V as W, W as Q, X as U, Y as X, Z as Y, $ as Z, a0 as $, a1 as _, a2 as aa, a3 as ea, a4 as sa, a5 as ta, a6 as oa, a7 as ra, a8 as ia, a9 as la, aa as na, ab as pa, ac as da, ad as Ta, ae as Sa, af as ma, ag as ca, ah as ha, ai as ua, aj as ga, ak as Ca, al as ya, am as wa, an as xa, ao as Fa, ap as fa, aq as va, ar as ka, as as Ba, at as La, au as Pa, av as ba, aw as Aa, ax as Da, ay as za } from "./index-BBZpz36P.js";
1
+ import { A as s, c as t, d as o, e as r, f as i, g as n, B as l, h as p, i as d, j as c, k as m, l as T, m as S, n as u, o as g, p as h, q as C, r as y, s as B, D as w, t as x, u as F, v as A, F as L, w as b, x as f, y as v, z as P, E as k, G as D, H as z, I as M, J as R, K as I, L as N, M as V, N as j, O as q, P as E, Q as G, R as H, S as J, T as K, U as O, V as W, W as Q, X as U, Y as X, Z as Y, $ as Z, a0 as $, a1 as _, a2 as aa, a3 as ea, a4 as sa, a5 as ta, a6 as oa, a7 as ra, a8 as ia, a9 as na, aa as la, ab as pa, ac as da, ad as ca, ae as ma, af as Ta, ag as Sa, ah as ua, ai as ga, aj as ha, ak as Ca, al as ya, am as Ba, an as wa, ao as xa, ap as Fa, aq as Aa, ar as La, as as ba, at as fa, au as va, av as Pa, aw as ka, ax as Da, ay as za, az as Ma, aA as Ra, aB as Ia, aC as Na, aD as Va } from "./index-CG9LBZIb.js";
2
2
  export {
3
3
  s as Accordion,
4
- t as ActionMenu,
5
- o as Alert,
6
- r as Avatar,
7
- i as BaseFormComponent,
8
- l as Button,
9
- n as ButtonList,
10
- p as Card,
11
- d as CardStrip,
12
- T as Checkbox,
13
- S as ClampText,
14
- m as CodeBlock,
15
- c as CollapsibleSection,
16
- h as Confetti,
17
- u as ConnectionHeader,
18
- g as CustomIcons,
19
- C as DefinitionRow,
20
- y as Divider,
21
- w as DividerVariant,
22
- x as Dropdown,
23
- F as Flex,
24
- f as FlexAlign,
25
- v as FlexDirection,
26
- k as FlexGapSize,
27
- B as FlexJustify,
28
- L as FooterLinks,
29
- P as FooterNav,
30
- b as Form,
31
- A as FormItem,
32
- D as Input,
33
- z as KeyValueList,
34
- R as Link,
35
- M as LoadingBar,
36
- I as MalachiteContext,
37
- N as MultiSelect,
38
- V as NumberTag,
39
- j as OverflowRow,
40
- q as Padded,
41
- E as PaddingSize,
42
- G as PillButton,
43
- H as PreviewTree,
44
- J as PreviewTreeRow,
45
- K as Progress,
46
- O as Radio,
47
- W as Search,
48
- Q as SegmentedControl,
49
- U as SelectableCard,
50
- X as ShadowEscape,
51
- Y as SidePanel,
52
- Z as SidePanelNavFooter,
53
- $ as Skeleton,
54
- _ as Spacer,
55
- aa as SpacingSize,
56
- ea as Spinner,
57
- sa as SplitScreenLayout,
58
- ta as StatBadge,
59
- oa as Statistic,
60
- ra as StatusBadge,
61
- ia as Stepper,
62
- la as Surface,
63
- na as SurfaceRow,
64
- pa as Swatch,
65
- da as Table,
66
- Ta as Tabs,
67
- Sa as Tag,
68
- ma as TextArea,
69
- ca as ThemeScope,
70
- ha as Toggle,
71
- ua as Toolbar,
72
- ga as Tooltip,
73
- Ca as TruncatedTooltip,
74
- ya as Typography,
75
- wa as WizardLayout,
76
- xa as applyCustomTheme,
77
- Fa as applyDarkTheme,
4
+ t as ActionBar,
5
+ o as ActionMenu,
6
+ r as Alert,
7
+ i as AppLogo,
8
+ n as Avatar,
9
+ l as BaseFormComponent,
10
+ p as Breadcrumbs,
11
+ d as Button,
12
+ c as ButtonList,
13
+ m as Card,
14
+ T as CardStrip,
15
+ S as Checkbox,
16
+ u as ClampText,
17
+ g as CodeBlock,
18
+ h as CollapsibleSection,
19
+ C as Confetti,
20
+ y as ConnectionHeader,
21
+ B as CustomIcons,
22
+ w as DefinitionRow,
23
+ x as Divider,
24
+ F as DividerVariant,
25
+ A as Dropdown,
26
+ L as Flex,
27
+ b as FlexAlign,
28
+ f as FlexDirection,
29
+ v as FlexGapSize,
30
+ P as FlexJustify,
31
+ k as FooterLinks,
32
+ D as FooterNav,
33
+ z as Form,
34
+ M as FormItem,
35
+ R as Input,
36
+ I as KeyValueList,
37
+ N as Link,
38
+ V as LoadingBar,
39
+ j as MalachiteContext,
40
+ q as MultiSelect,
41
+ E as NumberTag,
42
+ G as OverflowRow,
43
+ H as Padded,
44
+ J as PaddingSize,
45
+ K as PageLayout,
46
+ O as PillButton,
47
+ W as PreviewTree,
48
+ Q as PreviewTreeRow,
49
+ U as Progress,
50
+ X as Radio,
51
+ Y as Search,
52
+ Z as SegmentedControl,
53
+ $ as SelectableCard,
54
+ _ as ShadowEscape,
55
+ aa as SidePanel,
56
+ ea as SidePanelNavFooter,
57
+ sa as Skeleton,
58
+ ta as Spacer,
59
+ oa as SpacingSize,
60
+ ra as Spinner,
61
+ ia as SplitScreenLayout,
62
+ na as StatBadge,
63
+ la as Statistic,
64
+ pa as StatusBadge,
65
+ da as Stepper,
66
+ ca as Surface,
67
+ ma as SurfaceRow,
68
+ Ta as Swatch,
69
+ Sa as Table,
70
+ ua as Tabs,
71
+ ga as Tag,
72
+ ha as TextArea,
73
+ Ca as ThemeScope,
74
+ ya as Toggle,
75
+ Ba as Toolbar,
76
+ wa as Tooltip,
77
+ xa as TruncatedTooltip,
78
+ Fa as Typography,
79
+ Aa as WizardLayout,
80
+ La as applyCustomTheme,
81
+ ba as applyDarkTheme,
78
82
  fa as applyLightTheme,
79
83
  va as applyTheme,
80
- ka as applyThemeVars,
81
- Ba as darkTheme,
82
- La as defaultTheme,
83
- Pa as getCurrentTheme,
84
- ba as getCurrentThemeMode,
85
- Aa as initializeTheme,
86
- Da as resetTheme,
87
- za as toggleTheme
84
+ Pa as applyThemeVars,
85
+ ka as buildActionBarMenuItems,
86
+ Da as darkTheme,
87
+ za as defaultTheme,
88
+ Ma as getCurrentTheme,
89
+ Ra as getCurrentThemeMode,
90
+ Ia as initializeTheme,
91
+ Na as resetTheme,
92
+ Va as toggleTheme
88
93
  };
89
94
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/malachite",
3
- "version": "0.67.2",
3
+ "version": "0.69.0",
4
4
  "description": "StackOne's themeable React component library — Shadow DOM isolated, scoped Tailwind, theme-token driven.",
5
5
  "license": "MIT",
6
6
  "author": "StackOne",
@@ -39,18 +39,6 @@
39
39
  "default": "./dist/index.js"
40
40
  }
41
41
  },
42
- "scripts": {
43
- "dev": "vite",
44
- "build": "vite build",
45
- "lint": "biome lint",
46
- "lint:fix": "biome lint --fix",
47
- "test": "vitest run",
48
- "test:watch": "vitest",
49
- "typecheck": "tsc -p tsconfig.app.json --noEmit && tsc -p tsconfig.demo.json --noEmit",
50
- "docs:components": "node scripts/generate-components-doc.mjs",
51
- "docs:check": "node scripts/generate-components-doc.mjs --check",
52
- "publish-release": "npm publish --access=public"
53
- },
54
42
  "peerDependencies": {
55
43
  "react": "^18.3.1 || ^19.0.0",
56
44
  "react-dom": "^18.3.1 || ^19.0.0",
@@ -88,5 +76,17 @@
88
76
  "@uiw/react-json-view": "^2.0.0-alpha.35",
89
77
  "marked-react": "^3.0.0",
90
78
  "react-syntax-highlighter": "^16.1.1"
79
+ },
80
+ "scripts": {
81
+ "dev": "vite",
82
+ "build": "vite build",
83
+ "lint": "biome lint",
84
+ "lint:fix": "biome lint --fix",
85
+ "test": "vitest run",
86
+ "test:watch": "vitest",
87
+ "typecheck": "tsc -p tsconfig.app.json --noEmit && tsc -p tsconfig.demo.json --noEmit",
88
+ "docs:components": "node scripts/generate-components-doc.mjs",
89
+ "docs:check": "node scripts/generate-components-doc.mjs --check",
90
+ "publish-release": "pnpm publish --access=public --no-git-checks"
91
91
  }
92
- }
92
+ }