@estiva-app/ui 0.12.3 → 0.12.5
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/Button.d.ts.map +1 -1
- package/dist/IconButton.d.ts.map +1 -1
- package/dist/Popover.d.ts +22 -1
- package/dist/Popover.d.ts.map +1 -1
- package/dist/index.js +27 -9
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/Button.stories.tsx +29 -0
- package/src/Button.test.tsx +18 -0
- package/src/Button.tsx +12 -7
- package/src/IconButton.tsx +6 -0
- package/src/Popover.stories.tsx +36 -1
- package/src/Popover.test.tsx +17 -0
- package/src/Popover.tsx +28 -3
package/dist/Button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAA;AAC5E,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;AAE5C;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAY,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IAClE,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;6EACyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAiB,EACjB,IAAgB,EAChB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,IAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,+
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAA;AAC5E,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;AAE5C;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAY,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IAClE,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;6EACyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAiB,EACjB,IAAgB,EAChB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,IAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,+BAgDb"}
|
package/dist/IconButton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../src/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7D;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAEhE,2EAA2E;AAC3E,MAAM,WAAW,eAAgB,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IACtE,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;8DAC0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC;sEACkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAiB,EACjB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,IAAe,EACf,GAAG,KAAK,EACT,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../src/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7D;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAEhE,2EAA2E;AAC3E,MAAM,WAAW,eAAgB,SAAQ,qBAAqB,CAAC,QAAQ,CAAC;IACtE,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;8DAC0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC;sEACkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAiB,EACjB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,IAAe,EACf,GAAG,KAAK,EACT,EAAE,eAAe,+BAkDjB"}
|
package/dist/Popover.d.ts
CHANGED
|
@@ -90,6 +90,27 @@ export interface PopoverProps {
|
|
|
90
90
|
children: ReactNode;
|
|
91
91
|
/** On the panel's surface — its width, its internal rhythm. */
|
|
92
92
|
className?: string;
|
|
93
|
+
/**
|
|
94
|
+
* A cap on the scrolling box, as a class — `max-h-[360px]`. Without one the
|
|
95
|
+
* panel grows to the room the positioner has, which is the right default for
|
|
96
|
+
* a panel that is as tall as its content.
|
|
97
|
+
*
|
|
98
|
+
* **It cannot go on `className`.** That lands on the panel, and the panel's
|
|
99
|
+
* children sit inside a `ScrollArea` whose viewport carries its own cap — so
|
|
100
|
+
* a `max-h` on the panel is overrun by the viewport and the content draws
|
|
101
|
+
* straight through the panel's border (measured with Peek's `/` menu,
|
|
102
|
+
* 2026-09-12: a 400px panel with 559px of rows hanging out of it). The cap
|
|
103
|
+
* belongs on the viewport, as `DialogShell` takes `bodyMaxHeight`.
|
|
104
|
+
*
|
|
105
|
+
* **When a panel needs one.** A panel taller than the room above *and* below
|
|
106
|
+
* its anchor is not flipped by the positioner — it is moved to the side of
|
|
107
|
+
* the anchor, which for a type-ahead over a caret is not where it belongs.
|
|
108
|
+
* A cap keeps the choice between above and below.
|
|
109
|
+
*
|
|
110
|
+
* It replaces the available-height cap rather than adding to it, so a caller
|
|
111
|
+
* that sets one owns it.
|
|
112
|
+
*/
|
|
113
|
+
maxHeight?: string;
|
|
93
114
|
}
|
|
94
|
-
export declare function Popover({ trigger, anchor, align, side, open, onOpenChange, finalFocus, actionsRef, ariaLabel, children, className }: PopoverProps): import("react").JSX.Element;
|
|
115
|
+
export declare function Popover({ trigger, anchor, align, side, open, onOpenChange, finalFocus, actionsRef, ariaLabel, children, className, maxHeight }: PopoverProps): import("react").JSX.Element;
|
|
95
116
|
//# sourceMappingURL=Popover.d.ts.map
|
package/dist/Popover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../src/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA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;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,IAAI,CAAA;IACrC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACvB;kFAC8E;IAC9E,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC1C;kEAC8D;IAC9D,UAAU,CAAC,EAAE,SAAS,CAAC;QAAE,KAAK,EAAE,MAAM,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;IACzE;uDACmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAOD,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAc,EAAE,IAAe,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,YAAY,+BAsEhL"}
|
package/dist/index.js
CHANGED
|
@@ -312,6 +312,12 @@ function IconButton({
|
|
|
312
312
|
// happened here: a row with no `items-*` drew this 24 wide and 228
|
|
313
313
|
// tall in Peek's TopicMoreMenu story (Katerina, 2026-09-11). A button
|
|
314
314
|
// is the size of its icon and its padding, whatever box it lands in.
|
|
315
|
+
//
|
|
316
|
+
// This is the one of the two that needs it: an IconButton states no
|
|
317
|
+
// height, so its cross size is `auto` and a stretching parent takes
|
|
318
|
+
// it. Measured in the same 260px row on 2026-09-12: 24px with this
|
|
319
|
+
// class, 226px without. `Button` states `h-8`/`h-6`, so it cannot be
|
|
320
|
+
// stretched and carries no `self-center` — see the note there.
|
|
315
321
|
"flex items-center justify-center p-1 rounded-lg transition-colors shrink-0 self-center cursor-pointer",
|
|
316
322
|
!state.disabled && variant === "primary" && "bg-accent-primary hover:bg-accent-hover text-text-inverse",
|
|
317
323
|
!state.disabled && variant === "muted" && "text-text-secondary hover:bg-bg-hover hover:text-text-primary",
|
|
@@ -379,13 +385,18 @@ function Button({
|
|
|
379
385
|
disabled: disabled || !!disabledReason,
|
|
380
386
|
focusableWhenDisabled: !!disabledReason,
|
|
381
387
|
className: (state) => cn(
|
|
382
|
-
// `self-center`
|
|
383
|
-
//
|
|
384
|
-
//
|
|
385
|
-
//
|
|
386
|
-
//
|
|
387
|
-
//
|
|
388
|
-
|
|
388
|
+
// No `self-center` here, deliberately — `IconButton` needs it and this
|
|
389
|
+
// does not, and the difference is the `h-8` / `h-6` on the next two
|
|
390
|
+
// lines. `align-items: stretch` only stretches a child whose cross
|
|
391
|
+
// size is `auto`; a Button always states its height, so a stretching
|
|
392
|
+
// parent cannot change it. Measured in Chrome on 2026-09-12, in the
|
|
393
|
+
// 260px row of Finding 49: 32px with `self-center` and 32px without.
|
|
394
|
+
// What the class DID do was override the caller on the other axis —
|
|
395
|
+
// in a column it beats the parent's `items-start`, which centred the
|
|
396
|
+
// four actions in Ship's `ProjectRail` and the trigger in five of
|
|
397
|
+
// this package's own story frames, each of which asks for the top.
|
|
398
|
+
// A control does not get to decide where its caller puts it.
|
|
399
|
+
"inline-flex items-center justify-center gap-1 rounded-md transition-colors font-sans font-medium",
|
|
389
400
|
size === "default" && "h-8 text-btn-default",
|
|
390
401
|
size === "small" && "h-6 text-btn-small",
|
|
391
402
|
// Extra right padding beside a leading icon, for optical balance.
|
|
@@ -1587,7 +1598,7 @@ import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
|
1587
1598
|
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1588
1599
|
var GAP5 = 4;
|
|
1589
1600
|
var VIEWPORT_PAD4 = 8;
|
|
1590
|
-
function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpenChange, finalFocus, actionsRef, ariaLabel, children, className }) {
|
|
1601
|
+
function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpenChange, finalFocus, actionsRef, ariaLabel, children, className, maxHeight }) {
|
|
1591
1602
|
const anchorTarget = useMemo2(() => {
|
|
1592
1603
|
if (!anchor) return void 0;
|
|
1593
1604
|
if (anchor instanceof Element) return anchor;
|
|
@@ -1619,7 +1630,14 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
|
|
|
1619
1630
|
finalFocus,
|
|
1620
1631
|
className: cn("min-w-[180px] outline-none", className),
|
|
1621
1632
|
render: /* @__PURE__ */ jsx31(MenuPanel, {}),
|
|
1622
|
-
children: /* @__PURE__ */ jsx31(
|
|
1633
|
+
children: /* @__PURE__ */ jsx31(
|
|
1634
|
+
ScrollArea,
|
|
1635
|
+
{
|
|
1636
|
+
viewportClassName: maxHeight ?? "max-h-[calc(var(--available-height)_-_1rem)]",
|
|
1637
|
+
contentClassName: "flex flex-col [&>[role=separator]]:mx-0",
|
|
1638
|
+
children
|
|
1639
|
+
}
|
|
1640
|
+
)
|
|
1623
1641
|
}
|
|
1624
1642
|
)
|
|
1625
1643
|
}
|