@estiva-app/ui 0.64.0 → 0.65.1
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/CodeBlockColours.d.ts.map +1 -1
- package/dist/CollapsibleSection.d.ts +10 -1
- package/dist/CollapsibleSection.d.ts.map +1 -1
- package/dist/NavTree.d.ts +7 -1
- package/dist/NavTree.d.ts.map +1 -1
- package/dist/codeColours.d.ts +1 -12
- package/dist/codeColours.d.ts.map +1 -1
- package/dist/editor.js +11 -2
- package/dist/editor.js.map +2 -2
- package/dist/index.js +14 -9
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +14 -2
- package/src/CodeBlockColours.mdx +4 -3
- package/src/CodeBlockColours.test.ts +36 -0
- package/src/CodeBlockColours.ts +15 -1
- package/src/CollapsibleSection.mdx +7 -0
- package/src/CollapsibleSection.test.tsx +30 -0
- package/src/CollapsibleSection.tsx +15 -3
- package/src/NavTree.mdx +4 -1
- package/src/NavTree.test.tsx +10 -0
- package/src/NavTree.tsx +8 -1
- package/src/RichText.tsx +2 -2
- package/src/codeColours.ts +11 -3
- package/tailwind-preset.js +0 -1
- package/tokens.css +0 -10
package/dist/index.js
CHANGED
|
@@ -2424,14 +2424,17 @@ function InlineChip({ tone = "neutral", icon, href, className, children, ...prop
|
|
|
2424
2424
|
// src/codeColours.ts
|
|
2425
2425
|
import { createElement } from "react";
|
|
2426
2426
|
import { common, createLowlight } from "lowlight";
|
|
2427
|
-
var
|
|
2427
|
+
var instance;
|
|
2428
|
+
function lowlight() {
|
|
2429
|
+
return instance ??= createLowlight(common);
|
|
2430
|
+
}
|
|
2428
2431
|
function draw(node, key) {
|
|
2429
2432
|
if (node.type === "text") return node.value;
|
|
2430
2433
|
return createElement("span", { key, className: node.properties?.className?.join(" ") }, (node.children ?? []).map(draw));
|
|
2431
2434
|
}
|
|
2432
2435
|
function codeColours(text, language) {
|
|
2433
|
-
if (!language || !lowlight.registered(language)) return text;
|
|
2434
|
-
return lowlight.highlight(language, text).children.map(draw);
|
|
2436
|
+
if (!language || !lowlight().registered(language)) return text;
|
|
2437
|
+
return lowlight().highlight(language, text).children.map(draw);
|
|
2435
2438
|
}
|
|
2436
2439
|
|
|
2437
2440
|
// src/RichText.tsx
|
|
@@ -2446,9 +2449,9 @@ var RICH_TEXT_CLASSES = {
|
|
|
2446
2449
|
/* The line in the muted text grey, not the border grey: a border grey was 1.3 : 1 in Leaf (Katerina, 9 October). */
|
|
2447
2450
|
// eslint-disable-next-line token-spacing/no-restricted-classes -- @estiva-escape: the quote line is Peek's, 3px, between the ramp's 2 and 4
|
|
2448
2451
|
quote: "[&_blockquote>p]:m-0 [&_blockquote]:border-l-[3px] [&_blockquote]:border-text-muted [&_blockquote]:pl-2.5",
|
|
2449
|
-
/* Code in a sentence
|
|
2452
|
+
/* Code in a sentence: the code fill and a thin border, in the heading colour (Katerina, 9 October: option B; the amber of 0.64.0 was too much). */
|
|
2450
2453
|
// eslint-disable-next-line token-values/no-restricted-classes -- @estiva-escape: code is 0.85 of the text around it, so it scales with a heading and with `small`; a named size is fixed
|
|
2451
|
-
code: "[&_:not(pre)>code]:rounded-sm [&_:not(pre)>code]:bg-bg-code [&_:not(pre)>code]:px-1 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:
|
|
2454
|
+
code: "[&_:not(pre)>code]:rounded-sm [&_:not(pre)>code]:bg-bg-code [&_:not(pre)>code]:px-1 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:border [&_:not(pre)>code]:border-border-default [&_code]:font-mono [&_code]:text-[0.85em] [&_code]:text-text-primary",
|
|
2452
2455
|
/* 12px either side, 10px above and below, looser lines than the text (Katerina, 9 October; 8px all round before). */
|
|
2453
2456
|
// eslint-disable-next-line token-values/no-restricted-classes -- @estiva-escape: code is 0.85 of the text around it; the code inside the block is the block's own size, not 0.85 of it again
|
|
2454
2457
|
codeBlock: "[&_pre>code]:text-[1em] [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:rounded-md [&_pre]:bg-bg-code [&_pre]:px-3 [&_pre]:py-2.5 [&_pre]:font-mono [&_pre]:text-[0.85em] [&_pre]:leading-relaxed [&_pre]:text-text-primary",
|
|
@@ -3483,7 +3486,7 @@ function writeStored(key, open) {
|
|
|
3483
3486
|
} catch {
|
|
3484
3487
|
}
|
|
3485
3488
|
}
|
|
3486
|
-
function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenChange, storageKey, icon, trailing, actions, menu, menuLabel, showActions, look = "heading", indent = false, children, className, contentClassName }) {
|
|
3489
|
+
function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenChange, pending = false, storageKey, icon, trailing, actions, menu, menuLabel, showActions, look = "heading", indent = false, children, className, contentClassName }) {
|
|
3487
3490
|
const [openState, setOpenState] = useState10(() => readStored(storageKey) ?? defaultOpen);
|
|
3488
3491
|
const open = openProp ?? openState;
|
|
3489
3492
|
const setOpen = (next) => {
|
|
@@ -3491,8 +3494,9 @@ function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenC
|
|
|
3491
3494
|
writeStored(storageKey, next);
|
|
3492
3495
|
onOpenChange?.(next);
|
|
3493
3496
|
};
|
|
3494
|
-
|
|
3495
|
-
|
|
3497
|
+
const shown = open && !pending;
|
|
3498
|
+
return /* @__PURE__ */ jsxs34(Collapsible2.Root, { open: shown, onOpenChange: (next, details) => setOpen(pending && details.reason === "trigger-press" ? !open : next), className: cn("flex flex-col", className), children: [
|
|
3499
|
+
/* @__PURE__ */ jsx51(SectionHeader, { title, chevron: true, icon, isExpanded: open, trailing, actions, menu, menuLabel, showActions, look, className: "shrink-0", render: /* @__PURE__ */ jsx51(Collapsible2.Trigger, { "aria-expanded": open, "aria-busy": pending && open ? true : void 0 }) }),
|
|
3496
3500
|
/* @__PURE__ */ jsx51(
|
|
3497
3501
|
Collapsible2.Panel,
|
|
3498
3502
|
{
|
|
@@ -3557,7 +3561,7 @@ function Group({ group, selected, onSelect, storageKey }) {
|
|
|
3557
3561
|
}
|
|
3558
3562
|
);
|
|
3559
3563
|
}
|
|
3560
|
-
function NavTreeSection({ id, title, message, loading = false, trailing, actions, menu, icon, defaultOpen = true, open, onOpenChange, storageKey, onIntent, children }) {
|
|
3564
|
+
function NavTreeSection({ id, title, message, loading = false, pending, trailing, actions, menu, icon, defaultOpen = true, open, onOpenChange, storageKey, onIntent, children }) {
|
|
3561
3565
|
const timer = useRef11(void 0);
|
|
3562
3566
|
useEffect6(() => () => clearTimeout(timer.current), []);
|
|
3563
3567
|
const intent = onIntent;
|
|
@@ -3580,6 +3584,7 @@ function NavTreeSection({ id, title, message, loading = false, trailing, actions
|
|
|
3580
3584
|
defaultOpen,
|
|
3581
3585
|
open,
|
|
3582
3586
|
onOpenChange,
|
|
3587
|
+
pending,
|
|
3583
3588
|
storageKey,
|
|
3584
3589
|
trailing,
|
|
3585
3590
|
actions,
|