@slashsuite/ui-react 0.15.0 → 0.15.2
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/CardGrid.js +4 -1
- package/dist/CardParts.js +1 -1
- package/dist/InlineEdit.js +4 -1
- package/dist/textBox.js +7 -4
- package/dist/typography.js +2 -1
- package/package.json +1 -1
package/dist/CardGrid.js
CHANGED
|
@@ -58,7 +58,10 @@ export function CardGrid({ columns = 3, minWidth = "md", align = "stretch", minC
|
|
|
58
58
|
return _jsx(EmptySlot, { size: "md", children: empty });
|
|
59
59
|
}
|
|
60
60
|
const cards = none ? gridBones(columns) : children;
|
|
61
|
-
return (_jsx(LoadingScope, { loading: wait.loading, children: _jsx(Tag, { ...rest, ...wait.attrs, ...(Tag === "ul" ? { role: "list" } : {}), className: cx(
|
|
61
|
+
return (_jsx(LoadingScope, { loading: wait.loading, children: _jsx(Tag, { ...rest, ...wait.attrs, ...(Tag === "ul" ? { role: "list" } : {}), className: cx(
|
|
62
|
+
// A card title shrinks to its fixed-width cell and wraps there (its own break-words);
|
|
63
|
+
// outside a grid it keeps its longest word's width, so a card sized by its content stays wide enough.
|
|
64
|
+
"grid gap-4 *:min-w-0 [&_:is(h2,h3,h4,h5,h6)]:min-w-0", gridColumns(columns, minWidth, minColumns), ALIGN[align]), children: _jsx(InRegions, { value: align === "regions", children: _jsx(GridItems, { list: Tag === "ul", item: ITEM[align], owner: wait.owner, label: wait.label, children: cards }) }) }) }));
|
|
62
65
|
}
|
|
63
66
|
/** A loading grid's cards when it has none yet: one card of bones per column, three for `auto`. */
|
|
64
67
|
function gridBones(columns) {
|
package/dist/CardParts.js
CHANGED
|
@@ -11,7 +11,7 @@ const STRIP_PAD = { sm: "px-3 py-2", md: "px-5 py-3", lg: "px-6 py-4" };
|
|
|
11
11
|
/** The heading of a card whose title is a name: sentence case, in the primary ink. */
|
|
12
12
|
function NameTitle({ id, level, children, }) {
|
|
13
13
|
const Tag = `h${level}`;
|
|
14
|
-
return (_jsx(Tag, { id: id, className: "text-base font-semibold text-slate-900", children: children }));
|
|
14
|
+
return (_jsx(Tag, { id: id, className: "text-base font-semibold text-slate-900 break-words", children: children }));
|
|
15
15
|
}
|
|
16
16
|
export function CardHeading({ id, title, titleStyle, level, count, status, bar, spaced, size, }) {
|
|
17
17
|
const ink = bar ? "text-slate-500" : "text-slate-400";
|
package/dist/InlineEdit.js
CHANGED
|
@@ -56,5 +56,8 @@ export function InlineEdit({ label, renderEditor, children, ...rest }) {
|
|
|
56
56
|
return open ? (_jsx("div", { ...rest, ref: box, role: "group", "aria-label": label, className: "-mx-2 -my-1", onKeyDown: onKeyDown, onBlur: (event) => {
|
|
57
57
|
if (isOutside(event.currentTarget, event.relatedTarget))
|
|
58
58
|
dismiss();
|
|
59
|
-
}, children: renderEditor(close) })) : (_jsxs("button", { ...rest, ref: trigger, type: "button", onClick: () => setPhase("open"),
|
|
59
|
+
}, children: renderEditor(close) })) : (_jsxs("button", { ...rest, ref: trigger, type: "button", onClick: () => setPhase("open"),
|
|
60
|
+
// decoration-1: the font's own underline thickness is a fraction of a pixel, and Chromium
|
|
61
|
+
// anti-aliases the dots' edges differently from one paint to the next when the table scrolls.
|
|
62
|
+
className: cx("-mx-2 -my-1 block w-[calc(100%+1rem)] cursor-pointer rounded-md px-2 py-1 [text-align:inherit] underline decoration-dotted decoration-1 underline-offset-4 transition hover:bg-slate-100", focusRing), children: [children, _jsxs("span", { className: "sr-only", children: [" ", label] })] }));
|
|
60
63
|
}
|
package/dist/textBox.js
CHANGED
|
@@ -4,11 +4,14 @@ const ALIGN = {
|
|
|
4
4
|
center: "text-center",
|
|
5
5
|
end: "text-end",
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* A run clamped to 2, 3 or 4 lines: `line-clamp` is a box of its own. It wraps even inside a box
|
|
9
|
+
* that keeps its text on one line (a `MediaTile` caption), or it would never reach its second line.
|
|
10
|
+
*/
|
|
8
11
|
const CLAMP = {
|
|
9
|
-
2: "line-clamp-2",
|
|
10
|
-
3: "line-clamp-3",
|
|
11
|
-
4: "line-clamp-4",
|
|
12
|
+
2: "line-clamp-2 whitespace-normal",
|
|
13
|
+
3: "line-clamp-3 whitespace-normal",
|
|
14
|
+
4: "line-clamp-4 whitespace-normal",
|
|
12
15
|
};
|
|
13
16
|
/**
|
|
14
17
|
* The alignment, and the box it needs. An aligned run is block-level, so text-align has a box to set
|
package/dist/typography.js
CHANGED
|
@@ -196,7 +196,8 @@ export const Overline = inlineRole("Overline", "span", OVERLINE, "tertiary");
|
|
|
196
196
|
* inks are the card's, never a consumer's.
|
|
197
197
|
*/
|
|
198
198
|
export function CardOverline({ faint, level, ...props }) {
|
|
199
|
-
|
|
199
|
+
// break-words: a word too long for the card wraps inside it; a CardGrid lets the title shrink to its cell.
|
|
200
|
+
return pinned(`h${level}`, `${OVERLINE} break-words`, faint ? "faint" : "tertiary", props);
|
|
200
201
|
}
|
|
201
202
|
/**
|
|
202
203
|
* Running text. A paragraph (`p`; `as="span"` for a run inside a row, a cell or a sentence),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slashsuite/ui-react",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "UISlash React components: primitives, typography roles and a safe Markdown renderer, written against Tailwind v4 utilities. Pair with a theme from @slashsuite/themes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|