@stackone/malachite 2.57.1 → 2.58.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
CHANGED
|
@@ -70,7 +70,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
70
70
|
- **`CommandPalette`** — Chrome for a command palette, over a headless library that keeps its own elements. `FieldRow`/`Field` take the query input, `List` the scrolling viewport (with a bottom fade for `hasMoreBelow`), `Group` + `Heading` a titled section, and `Row` one result — composing leading/label/tags/crumb/meta/status/hint so names start and statuses end on the same x down the list. `Message` covers empty and loading, `Legend` documents the scope sigils, `Footer` the key hints. Everything the library owns is taken through `asChild`, so its role, id, state and handlers are untouched.
|
|
71
71
|
- **`Keycap`** — One key on a keyboard, drawn as a cap — `esc`, `⌘`, a caret, or a sigil a user types to scope a search. Renders a `<kbd>`, or a button as soon as either `onClick` or `disabled` is passed — `disabled={false}` included, since naming the prop at all is the statement that the cap is a control. `SidePanelNavFooter` is built on it.
|
|
72
72
|
- **`CollapsibleSection`** — Collapsible sunken-card section (title - subtitle header, disclosure arrow right) for stacked detail sections in side panels and detail pages. A preset over `Accordion`’s `sunken` variant.
|
|
73
|
-
- **`KeyValueList`** — Bordered card of label/value rows (`KeyValueList.Row`) for entity details: fixed-width secondary labels, free-form values, row dividers.
|
|
73
|
+
- **`KeyValueList`** — Bordered card of label/value rows (`KeyValueList.Row`) for entity details: fixed-width secondary labels, free-form values, row dividers. `truncate` keeps a long value (an ID) to one line with an ellipsis at the cell width and a tooltip only when it is actually cut off — the value itself when it is text, else the row’s `tooltip` (`null` turns it off). For inline content only: a Tag or AppLogo is clipped without an ellipsis, so use its own truncate, as with `CodeText truncate`. _Key props:_ `label`, `truncate`, `tooltip`.
|
|
74
74
|
|
|
75
75
|
## Forms & inputs
|
|
76
76
|
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { Children as i } from "react";
|
|
3
|
+
import s from "./Typography/EllipsisText.js";
|
|
4
|
+
const x = (e) => typeof e == "string" || typeof e == "number", c = (e) => {
|
|
5
|
+
const r = i.toArray(e);
|
|
6
|
+
return r.length > 0 && r.every(x) ? r.join("") : void 0;
|
|
7
|
+
}, m = ({
|
|
8
|
+
label: e,
|
|
9
|
+
className: r = "",
|
|
10
|
+
children: a,
|
|
11
|
+
truncate: l = !1,
|
|
12
|
+
tooltip: o
|
|
13
|
+
}) => /* @__PURE__ */ d(
|
|
3
14
|
"div",
|
|
4
15
|
{
|
|
5
16
|
className: `flex min-h-[52px] w-full items-start border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0 ${r}`,
|
|
6
17
|
children: [
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ t("dt", { className: "m-0 w-[200px] shrink-0 p-[16px] text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-secondary)]", children: e }),
|
|
19
|
+
/* @__PURE__ */ t("dd", { className: "m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] py-[16px] pr-[16px] text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-primary)]", children: l ? /* @__PURE__ */ t(
|
|
20
|
+
s,
|
|
21
|
+
{
|
|
22
|
+
maxWidth: "100%",
|
|
23
|
+
tooltip: o !== void 0 ? o : c(a),
|
|
24
|
+
tooltipWhenTruncated: !0,
|
|
25
|
+
children: a
|
|
26
|
+
}
|
|
27
|
+
) : a })
|
|
9
28
|
]
|
|
10
29
|
}
|
|
11
|
-
),
|
|
30
|
+
), n = ({
|
|
12
31
|
className: e = "",
|
|
13
32
|
children: r
|
|
14
|
-
}) => /* @__PURE__ */
|
|
33
|
+
}) => /* @__PURE__ */ t(
|
|
15
34
|
"dl",
|
|
16
35
|
{
|
|
17
36
|
className: `m-0 flex w-full flex-col overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] ${e}`,
|
|
18
37
|
children: r
|
|
19
38
|
}
|
|
20
39
|
);
|
|
21
|
-
|
|
40
|
+
n.Row = m;
|
|
22
41
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
n as KeyValueList,
|
|
43
|
+
n as default
|
|
25
44
|
};
|
|
26
45
|
//# sourceMappingURL=KeyValueList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueList.js","sources":["../../src/components/KeyValueList.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface KeyValueListProps {\n className?: string;\n children: React.ReactNode;\n}\n\nexport interface KeyValueListRowProps {\n label: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n}\n\nconst Row: React.FC<KeyValueListRowProps> = ({
|
|
1
|
+
{"version":3,"file":"KeyValueList.js","sources":["../../src/components/KeyValueList.tsx"],"sourcesContent":["import React, { Children } from 'react';\nimport EllipsisText from './Typography/EllipsisText';\n\nexport interface KeyValueListProps {\n className?: string;\n children: React.ReactNode;\n}\n\nexport interface KeyValueListRowProps {\n label: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n /**\n * Keep the value to one line, cut with an ellipsis at the cell's width. For inline content:\n * block/flex children (Tag, AppLogo) are clipped without an ellipsis, so use their own truncate.\n */\n truncate?: boolean;\n /**\n * Shown on hover/focus when a `truncate` value is actually cut off. Defaults to the value\n * itself when it is text (strings/numbers); give one for any other value, or none is shown.\n * Pass `null` to turn the tooltip off.\n */\n tooltip?: React.ReactNode;\n}\n\nconst isText = (node: React.ReactNode): node is string | number =>\n typeof node === 'string' || typeof node === 'number';\n\nconst textOf = (children: React.ReactNode): string | undefined => {\n const parts = Children.toArray(children);\n return parts.length > 0 && parts.every(isText) ? parts.join('') : undefined;\n};\n\nconst Row: React.FC<KeyValueListRowProps> = ({\n label,\n className = '',\n children,\n truncate = false,\n tooltip,\n}) => (\n <div\n className={`flex min-h-[52px] w-full items-start border-0 border-b border-solid border-[var(--malachite-card-border)] last:border-b-0 ${className}`}\n >\n <dt className=\"m-0 w-[200px] shrink-0 p-[16px] text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-secondary)]\">\n {label}\n </dt>\n <dd className=\"m-0 flex min-w-0 flex-1 flex-wrap items-center gap-[6px] py-[16px] pr-[16px] text-[13px] leading-[1.6] tracking-[0.13px] text-[var(--malachite-text-primary)]\">\n {truncate ? (\n <EllipsisText\n maxWidth=\"100%\"\n tooltip={tooltip !== undefined ? tooltip : textOf(children)}\n tooltipWhenTruncated\n >\n {children}\n </EllipsisText>\n ) : (\n children\n )}\n </dd>\n </div>\n);\n\nconst KeyValueList: React.FC<KeyValueListProps> & { Row: typeof Row } = ({\n className = '',\n children,\n}) => (\n <dl\n className={`m-0 flex w-full flex-col overflow-hidden rounded-lg border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] ${className}`}\n >\n {children}\n </dl>\n);\n\nKeyValueList.Row = Row;\n\nexport default KeyValueList;\nexport { KeyValueList };\n"],"names":["isText","node","textOf","children","parts","Children","Row","label","className","truncate","tooltip","jsxs","jsx","EllipsisText","KeyValueList"],"mappings":";;;AAyBA,MAAMA,IAAS,CAACC,MACZ,OAAOA,KAAS,YAAY,OAAOA,KAAS,UAE1CC,IAAS,CAACC,MAAkD;AAC9D,QAAMC,IAAQC,EAAS,QAAQF,CAAQ;AACvC,SAAOC,EAAM,SAAS,KAAKA,EAAM,MAAMJ,CAAM,IAAII,EAAM,KAAK,EAAE,IAAI;AACtE,GAEME,IAAsC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAL;AAAA,EACA,UAAAM,IAAW;AAAA,EACX,SAAAC;AACJ,MACI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,6HAA6HH,CAAS;AAAA,IAEjJ,UAAA;AAAA,MAAA,gBAAAI,EAAC,MAAA,EAAG,WAAU,sHACT,UAAAL,GACL;AAAA,MACA,gBAAAK,EAAC,MAAA,EAAG,WAAU,iKACT,UAAAH,IACG,gBAAAG;AAAA,QAACC;AAAA,QAAA;AAAA,UACG,UAAS;AAAA,UACT,SAASH,MAAY,SAAYA,IAAUR,EAAOC,CAAQ;AAAA,UAC1D,sBAAoB;AAAA,UAEnB,UAAAA;AAAA,QAAA;AAAA,MAAA,IAGLA,EAAA,CAER;AAAA,IAAA;AAAA,EAAA;AACJ,GAGEW,IAAkE,CAAC;AAAA,EACrE,WAAAN,IAAY;AAAA,EACZ,UAAAL;AACJ,MACI,gBAAAS;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,uJAAuJJ,CAAS;AAAA,IAE1K,UAAAL;AAAA,EAAA;AACL;AAGJW,EAAa,MAAMR;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2751,6 +2751,17 @@ export declare interface KeyValueListRowProps {
|
|
|
2751
2751
|
label: default_2.ReactNode;
|
|
2752
2752
|
className?: string;
|
|
2753
2753
|
children: default_2.ReactNode;
|
|
2754
|
+
/**
|
|
2755
|
+
* Keep the value to one line, cut with an ellipsis at the cell's width. For inline content:
|
|
2756
|
+
* block/flex children (Tag, AppLogo) are clipped without an ellipsis, so use their own truncate.
|
|
2757
|
+
*/
|
|
2758
|
+
truncate?: boolean;
|
|
2759
|
+
/**
|
|
2760
|
+
* Shown on hover/focus when a `truncate` value is actually cut off. Defaults to the value
|
|
2761
|
+
* itself when it is text (strings/numbers); give one for any other value, or none is shown.
|
|
2762
|
+
* Pass `null` to turn the tooltip off.
|
|
2763
|
+
*/
|
|
2764
|
+
tooltip?: default_2.ReactNode;
|
|
2754
2765
|
}
|
|
2755
2766
|
|
|
2756
2767
|
export declare const LayoutIcon: React.FC<IconProps_63>;
|
package/package.json
CHANGED