@estiva-app/ui 0.66.0 → 0.67.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/EditorTableControls.d.ts +38 -0
- package/dist/EditorTableControls.d.ts.map +1 -0
- package/dist/NavItem.d.ts +11 -1
- package/dist/NavItem.d.ts.map +1 -1
- package/dist/RichText.d.ts.map +1 -1
- package/dist/editor.d.ts +1 -0
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +165 -11
- package/dist/editor.js.map +4 -4
- package/dist/index.js +23 -14
- package/dist/index.js.map +2 -2
- package/package.json +2 -1
- package/registry.json +127 -4
- package/src/EditorTableControls.mdx +78 -0
- package/src/EditorTableControls.stories.tsx +63 -0
- package/src/EditorTableControls.test.tsx +288 -0
- package/src/EditorTableControls.tsx +255 -0
- package/src/NavItem.mdx +10 -0
- package/src/NavItem.stories.tsx +23 -1
- package/src/NavItem.test.tsx +36 -0
- package/src/NavItem.tsx +40 -16
- package/src/RichText.tsx +2 -1
- package/src/editor.ts +1 -0
- package/src/registry/registry.test.ts +6 -6
- package/src/registry/siblings.test.ts +2 -2
- package/stories/Choosing.mdx +1 -0
package/dist/index.js
CHANGED
|
@@ -2466,7 +2466,8 @@ var RICH_TEXT_CLASSES = {
|
|
|
2466
2466
|
syntax: "[&_:is(.hljs-keyword,.hljs-doctag,.hljs-type,.hljs-template-tag,.hljs-template-variable)]:text-syntax-keyword [&_.hljs-title]:text-syntax-function [&_:is(.hljs-number,.hljs-literal,.hljs-attr,.hljs-attribute,.hljs-meta,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id)]:text-syntax-constant [&_:is(.hljs-string,.hljs-regexp)]:text-syntax-string [&_:is(.hljs-built_in,.hljs-symbol)]:text-syntax-variable [&_.hljs-comment]:text-syntax-comment [&_:is(.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo)]:text-syntax-tag",
|
|
2467
2467
|
/* A divider splits the text in two: 16px either side (Katerina, 9 October; 4 before). */
|
|
2468
2468
|
divider: "[&_hr]:my-2 [&_hr]:border-border-default",
|
|
2469
|
-
table
|
|
2469
|
+
/* A table 16px above and below, as a divider (Katerina, 14 October; 8 before): the editor's row ➕ sits in that room, not over the next line. */
|
|
2470
|
+
table: "[&_:is(th,td)>p]:m-0 [&_:is(th,td)]:border [&_:is(th,td)]:border-border-default [&_:is(th,td)]:px-2 [&_:is(th,td)]:py-1 [&_:is(th,td)]:text-left [&_:is(th,td)]:align-top [&_table]:my-2 [&_table]:w-full [&_table]:border-collapse [&_th]:bg-bg-code [&_th]:font-medium [&_th]:text-text-primary",
|
|
2470
2471
|
/* Bold in the heading colour, not only heavier. An underlined word draws a faint line, so it does not read as a link (Katerina, 9 October). */
|
|
2471
2472
|
marks: "[&_em]:italic [&_strong]:font-semibold [&_strong]:text-text-primary [&_u]:underline [&_u]:decoration-text-muted [&_u]:underline-offset-2",
|
|
2472
2473
|
/* Lines 1.5 apart (Katerina, 9 October; 1.4 before). */
|
|
@@ -3288,6 +3289,7 @@ function NavItem({
|
|
|
3288
3289
|
icon,
|
|
3289
3290
|
menu,
|
|
3290
3291
|
menuLabel,
|
|
3292
|
+
action,
|
|
3291
3293
|
hint,
|
|
3292
3294
|
unread = false,
|
|
3293
3295
|
urgent = false,
|
|
@@ -3308,9 +3310,10 @@ function NavItem({
|
|
|
3308
3310
|
setOpenState(next);
|
|
3309
3311
|
onOpenChange?.(next);
|
|
3310
3312
|
};
|
|
3311
|
-
const
|
|
3313
|
+
const buttons = (menu != null ? 1 : 0) + (action ? 1 : 0);
|
|
3314
|
+
const besides = buttons > 0 || hasRows;
|
|
3312
3315
|
const mark = unread ? urgent ? /* @__PURE__ */ jsx49(UrgentMark, {}) : /* @__PURE__ */ jsx49(UnreadDot, {}) : null;
|
|
3313
|
-
const stepsAside =
|
|
3316
|
+
const stepsAside = buttons > 0 && "transition-opacity group-hover/nav:opacity-0 group-has-[:focus-visible]/nav:opacity-0 group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:opacity-0 [@media(hover:none)]:opacity-0";
|
|
3314
3317
|
const row = /* @__PURE__ */ jsxs32(
|
|
3315
3318
|
"a",
|
|
3316
3319
|
{
|
|
@@ -3327,7 +3330,7 @@ function NavItem({
|
|
|
3327
3330
|
// look while the ⋮ is pointed at and while its menu is open. The same
|
|
3328
3331
|
// for the arrow.
|
|
3329
3332
|
besides && !active && "group-hover/nav:bg-bg-hover group-hover/nav:text-text-primary",
|
|
3330
|
-
|
|
3333
|
+
buttons > 0 && !active && "group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:bg-bg-hover group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:text-text-primary",
|
|
3331
3334
|
className
|
|
3332
3335
|
),
|
|
3333
3336
|
...props,
|
|
@@ -3347,6 +3350,9 @@ function NavItem({
|
|
|
3347
3350
|
/* @__PURE__ */ jsx49("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }),
|
|
3348
3351
|
hint != null && // Takes room only while it shows, so the label gives way to it.
|
|
3349
3352
|
/* @__PURE__ */ jsx49("span", { className: "hidden shrink-0 items-center group-hover/nav:flex group-has-[:focus-visible]/nav:flex", children: hint }),
|
|
3353
|
+
buttons > 1 && // Two buttons: the second one's room (24px and the 4px between them, the
|
|
3354
|
+
// row's 8px gap making up the rest), kept only while they show.
|
|
3355
|
+
/* @__PURE__ */ jsx49("span", { "aria-hidden": "true", className: "hidden w-5 shrink-0 group-hover/nav:block group-has-[:focus-visible]/nav:block group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:block [@media(hover:none)]:block" }),
|
|
3350
3356
|
count ? /* @__PURE__ */ jsx49(WithTooltip, { label: countLabel ?? `${count} open`, children: /* @__PURE__ */ jsx49(
|
|
3351
3357
|
"span",
|
|
3352
3358
|
{
|
|
@@ -3364,7 +3370,7 @@ function NavItem({
|
|
|
3364
3370
|
// of the ⋮ (8px from the edge to the 16px box), one column with a
|
|
3365
3371
|
// folder heading's dot and ⋮ (Katerina, 5 October).
|
|
3366
3372
|
/* @__PURE__ */ jsx49("span", { className: cn("-mr-1 flex shrink-0", stepsAside), children: mark })
|
|
3367
|
-
) :
|
|
3373
|
+
) : buttons > 0 && !count ? (
|
|
3368
3374
|
// Nothing at the right, but a menu: no room is kept at rest, so the
|
|
3369
3375
|
// label has the row's whole width; while the ⋮ shows, its 24px slot
|
|
3370
3376
|
// is kept, so a long label ends before it instead of running under it.
|
|
@@ -3393,7 +3399,7 @@ function NavItem({
|
|
|
3393
3399
|
children: /* @__PURE__ */ jsx49(IconChevronRight2, { size: 16, stroke: 1.5, className: cn("transition-transform duration-150", open && "rotate-90") })
|
|
3394
3400
|
}
|
|
3395
3401
|
) }),
|
|
3396
|
-
|
|
3402
|
+
buttons > 0 && // `right-1`: the 24px button's 16px icon ends 8px from the row's
|
|
3397
3403
|
// edge, where a count ends (px-2) — and where a SectionHeader's
|
|
3398
3404
|
// actions and ⋮ end, so a folder's ⋮ and its rows' ⋮ are one column
|
|
3399
3405
|
// (Katerina, 5 October: the rows move to the heading, not the
|
|
@@ -3401,14 +3407,17 @@ function NavItem({
|
|
|
3401
3407
|
// right of the slot's centre.
|
|
3402
3408
|
// On a screen with no hover it always shows: nothing there can point
|
|
3403
3409
|
// at the row, and the menu has no other way in.
|
|
3404
|
-
/* @__PURE__ */
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3410
|
+
/* @__PURE__ */ jsxs32("div", { "data-nav-menu": true, className: cn("absolute inset-y-0 right-1 flex items-center gap-1", "opacity-0 transition-opacity group-hover/nav:opacity-100 group-has-[:focus-visible]/nav:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100"), children: [
|
|
3411
|
+
action && /* @__PURE__ */ jsx49(IconButton, { tooltip: action.tooltip, "aria-label": `${action.tooltip}: ${label}`, onClick: action.onClick, children: action.icon }),
|
|
3412
|
+
menu != null && /* @__PURE__ */ jsx49(
|
|
3413
|
+
Menu,
|
|
3414
|
+
{
|
|
3415
|
+
align: "right",
|
|
3416
|
+
trigger: /* @__PURE__ */ jsx49(IconButton, { tooltip: "More options", "aria-label": name, children: /* @__PURE__ */ jsx49(IconDotsVertical, { size: 16, stroke: 1.5 }) }),
|
|
3417
|
+
children: menu
|
|
3418
|
+
}
|
|
3419
|
+
)
|
|
3420
|
+
] })
|
|
3412
3421
|
] });
|
|
3413
3422
|
if (!hasRows) return line;
|
|
3414
3423
|
return /* @__PURE__ */ jsxs32(Collapsible.Root, { open, onOpenChange: setOpen, className: "flex shrink-0 flex-col", children: [
|