@stackone/malachite 0.63.1 → 0.64.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
@@ -5,6 +5,7 @@ import { FC } from 'react';
5
5
  import { FieldPath } from 'react-hook-form';
6
6
  import { FieldValues } from 'react-hook-form';
7
7
  import { JSX as JSX_2 } from 'react/jsx-runtime';
8
+ import { NamedExoticComponent } from 'react';
8
9
  import { ReactNode } from 'react';
9
10
  import { UseFormReturn } from 'react-hook-form';
10
11
 
@@ -279,9 +280,16 @@ export declare interface CheckboxProps {
279
280
 
280
281
  /**
281
282
  * Text clamped to `lines`, revealing the full text on hover / keyboard focus when
282
- * `expandOnHover`. Pure CSS; `line-height` is fixed at 1.5 so the collapsed max-height
283
- * matches `lines` exactly for the animation. The expanded state caps at 1000px, so this
284
- * is for short blurbs — longer content clips rather than a scrollable component.
283
+ * `expandOnHover`. Pure CSS. The expanded state caps at 1000px, so this is for short blurbs.
284
+ *
285
+ * `line-height` is `1.5em`, NOT the bare `1.5`, and that unit is what makes the cap exact: a
286
+ * `<number>` inherits as a FACTOR, so each descendant re-resolves it against its own
287
+ * font-size, while `max-height: calc(1.5em * lines)` resolves against THIS element's. With
288
+ * the bare number they disagreed — 14px text in a 13px row gave 21px line boxes against a
289
+ * 19.5px allowance and the last line was sliced. As a `<length>` both share one basis.
290
+ *
291
+ * The cap also bounds block children, which `-webkit-line-clamp` counts as one "line" each —
292
+ * so a MarkdownBlock in `block` variant relies on it. (Prefer `variant="flow"` there.)
285
293
  */
286
294
  export declare const ClampText: default_2.FC<ClampTextProps>;
287
295
 
@@ -318,10 +326,11 @@ declare interface CodeBlockProps {
318
326
  language?: 'yaml';
319
327
  }
320
328
 
321
- declare interface CodeTextProps {
329
+ export declare interface CodeTextProps {
322
330
  bold?: boolean;
323
331
  size?: FontSize;
324
332
  hasBorder?: boolean;
333
+ variant?: CodeTextVariant;
325
334
  color?: string;
326
335
  backgroundColor?: string;
327
336
  children: default_2.ReactNode;
@@ -329,6 +338,8 @@ declare interface CodeTextProps {
329
338
  style?: default_2.CSSProperties;
330
339
  }
331
340
 
341
+ export declare type CodeTextVariant = 'block' | 'inline';
342
+
332
343
  export declare const CollapsibleSection: default_2.FC<CollapsibleSectionProps>;
333
344
 
334
345
  export declare interface CollapsibleSectionProps {
@@ -591,9 +602,9 @@ declare interface FlexProps {
591
602
  className?: string;
592
603
  }
593
604
 
594
- declare type FontSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
605
+ export declare type FontSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
595
606
 
596
- declare type FontWeight = 'normal' | 'semi-bold' | 'bold';
607
+ export declare type FontWeight = 'normal' | 'semi-bold' | 'bold';
597
608
 
598
609
  export declare const FooterLinks: default_2.FC<FooterLinksProps>;
599
610
 
@@ -1026,6 +1037,13 @@ export declare interface MalachiteTheme {
1026
1037
  foreground: string;
1027
1038
  hoverBackground: string;
1028
1039
  border: string;
1040
+ /** `Table`'s `selectedRowKey` tint. Must stay distinguishable from
1041
+ * `hoverBackground`: a selected row keeps this tint under the cursor. */
1042
+ selectedBackground: string;
1043
+ /** Leading accent bar on that same row. */
1044
+ selectedAccent: string;
1045
+ /** Cascades, so cells setting their own colour are deliberately unaffected. */
1046
+ selectedForeground: string;
1029
1047
  };
1030
1048
  border: string;
1031
1049
  borderedRow: {
@@ -1088,13 +1106,17 @@ export declare interface MalachiteTheme {
1088
1106
  };
1089
1107
  }
1090
1108
 
1091
- declare interface MarkdownProps {
1109
+ export declare interface MarkdownProps {
1092
1110
  text: string;
1093
1111
  color?: TextColor;
1094
1112
  size?: FontSize;
1095
1113
  omitMargin?: boolean;
1114
+ variant?: MarkdownVariant;
1115
+ normalizeSource?: boolean;
1096
1116
  }
1097
1117
 
1118
+ export declare type MarkdownVariant = 'block' | 'flow';
1119
+
1098
1120
  export declare const MultiSelect: default_2.FC<MultiSelectProps>;
1099
1121
 
1100
1122
  declare interface MultiSelectBaseProps {
@@ -1233,7 +1255,15 @@ export declare interface PartialMalachiteTheme {
1233
1255
  dropdown?: Partial<MalachiteTheme['colors']['dropdown']>;
1234
1256
  tag?: Partial<MalachiteTheme['colors']['tag']>;
1235
1257
  numberTag?: Partial<MalachiteTheme['colors']['numberTag']>;
1236
- table?: Partial<MalachiteTheme['colors']['table']>;
1258
+ table?: Partial<Omit<MalachiteTheme['colors']['table'], 'header' | 'row' | 'borderedRow' | 'rowVariant' | 'error'>> & {
1259
+ header?: Partial<MalachiteTheme['colors']['table']['header']>;
1260
+ row?: Partial<MalachiteTheme['colors']['table']['row']>;
1261
+ borderedRow?: Partial<MalachiteTheme['colors']['table']['borderedRow']>;
1262
+ rowVariant?: {
1263
+ [K in keyof MalachiteTheme['colors']['table']['rowVariant']]?: Partial<MalachiteTheme['colors']['table']['rowVariant'][K]>;
1264
+ };
1265
+ error?: Partial<MalachiteTheme['colors']['table']['error']>;
1266
+ };
1237
1267
  text?: Partial<MalachiteTheme['colors']['text']>;
1238
1268
  codeBlock?: Partial<MalachiteTheme['colors']['codeBlock']>;
1239
1269
  };
@@ -1670,7 +1700,7 @@ export declare interface TabItem {
1670
1700
  disabled?: boolean;
1671
1701
  }
1672
1702
 
1673
- export declare const Table: <T = Record<string, unknown>>({ columns, data, loading, error, errorTitle, errorSubTitle, emptyTitle, emptySubTitle, bordered, showHeader, rowKey, scrollHeight, size, rowDensity, layout, headerVariant, rowClassName, rowVariant, onRow, onClickRow, rowSelection, pagination, className, style, stickyHeaderTop, scrollX, rowSection, renderSectionDivider, virtual, virtualRowHeightEstimate, virtualScrollElement, }: TableProps<T>) => JSX_2.Element;
1703
+ export declare const Table: <T = Record<string, unknown>>({ columns, data, loading, error, errorTitle, errorSubTitle, emptyTitle, emptySubTitle, bordered, showHeader, rowKey, scrollHeight, size, rowDensity, layout, headerVariant, rowClassName, rowVariant, onRow, onClickRow, selectedRowKey, scrollSelectedIntoView, rowSelection, pagination, className, style, stickyHeaderTop, scrollX, rowSection, renderSectionDivider, virtual, virtualRowHeightEstimate, virtualScrollElement, }: TableProps<T>) => JSX_2.Element;
1674
1704
 
1675
1705
  export declare type TableColumnDefinition<T = Record<string, unknown>> = {
1676
1706
  title: string | default_2.ReactNode;
@@ -1724,6 +1754,16 @@ declare type TableProps<T = Record<string, unknown>> = {
1724
1754
  rowVariant?: (record: T, index: number) => RowVariant | undefined;
1725
1755
  onRow?: (record: T, index: number) => TableRowActions<T>;
1726
1756
  onClickRow?: (record: T, index: number) => void;
1757
+ /** Row the master-detail view is showing, resolved against `rowKey`. Controlled, so
1758
+ * selection can change without a row click and the highlight follows. Unlike
1759
+ * `rowSelection` it paints no control — a tint, an accent bar and `aria-current`. */
1760
+ selectedRowKey?: default_2.Key;
1761
+ /** Whether a selection change scrolls the row into view. Default true.
1762
+ *
1763
+ * Set `false` when the initial key comes from a URL: the reveal uses `scrollIntoView`,
1764
+ * which walks every scrollable ancestor, so a deep-linked row below the fold jumps the
1765
+ * page on load. Selection still highlights; only the scroll is suppressed. */
1766
+ scrollSelectedIntoView?: boolean;
1727
1767
  rowSelection?: TableRowSelection<T>;
1728
1768
  pagination?: {
1729
1769
  current?: number;
@@ -1871,9 +1911,9 @@ declare interface TextAreaProps {
1871
1911
 
1872
1912
  declare type TextAreaSize = 'small' | 'medium' | 'large';
1873
1913
 
1874
- declare type TextColor = 'primary' | 'secondary' | 'dimmed' | 'placeholder' | 'emphasis' | 'muted' | 'destructive' | 'success' | 'highlight' | 'warning' | 'error' | 'link';
1914
+ export declare type TextColor = 'primary' | 'secondary' | 'dimmed' | 'placeholder' | 'emphasis' | 'muted' | 'destructive' | 'success' | 'highlight' | 'warning' | 'error' | 'link' | 'inherit';
1875
1915
 
1876
- declare interface TextProps {
1916
+ export declare interface TextProps {
1877
1917
  color?: TextColor;
1878
1918
  size?: FontSize;
1879
1919
  underline?: boolean;
@@ -2000,7 +2040,7 @@ export declare const Typography: {
2000
2040
  EllipsisText: FC<EllipsisTextProps>;
2001
2041
  FormSectionTitle: FC<FormSectionTitleProps>;
2002
2042
  LinkText: FC<LinkProps_2>;
2003
- MarkdownBlock: FC<MarkdownProps>;
2043
+ MarkdownBlock: NamedExoticComponent<MarkdownProps>;
2004
2044
  PageTitle: FC<PageTitleProps>;
2005
2045
  SecondaryText: FC<SecondaryTextProps>;
2006
2046
  SectionTitle: FC<SectionTitleProps>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as s, c as t, d as o, e as i, B as r, f as n, g as l, h as p, i as T, j as d, k as m, l as S, m as c, n as h, o as u, D as g, p as C, q as w, r as y, F, s as x, t as f, u as v, v as k, w as B, x as L, y as P, z as b, I as A, K as D, L as z, E as R, M, G as I, N, O as V, P as j, H 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 ia, a8 as ra, a9 as na, aa as la, ab as pa, ac as Ta, ad as da, ae as ma, af as Sa, ag as ca, ah as ha, ai as ua, aj as ga, ak as Ca, al as wa, am as ya, an as Fa, ao as xa, ap as fa, aq as va, ar as ka, as as Ba, at as La, au as Pa, av as ba, aw as Aa } from "./index-BViCOEUo.js";
1
+ import { A as s, c as t, d as o, e as i, B as r, f as n, g as l, h as p, i as T, j as d, k as m, l as S, m as c, n as h, o as u, D as g, p as C, q as w, r as y, F, s as x, t as f, u as v, v as k, w as B, x as L, y as P, z as b, I as A, K as D, L as z, E as R, M, G as I, N, O as V, P as j, H 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 ia, a8 as ra, a9 as na, aa as la, ab as pa, ac as Ta, ad as da, ae as ma, af as Sa, ag as ca, ah as ha, ai as ua, aj as ga, ak as Ca, al as wa, am as ya, an as Fa, ao as xa, ap as fa, aq as va, ar as ka, as as Ba, at as La, au as Pa, av as ba, aw as Aa } from "./index-C3bTzOZ2.js";
2
2
  export {
3
3
  s as Accordion,
4
4
  t as ActionMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/malachite",
3
- "version": "0.63.1",
3
+ "version": "0.64.0",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",