@estiva-app/ui 0.12.7 → 0.12.8
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/Menu.d.ts +17 -0
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Select.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/Menu.tsx +5 -1
- package/src/Select.tsx +28 -6
package/package.json
CHANGED
package/src/Menu.tsx
CHANGED
|
@@ -363,7 +363,11 @@ export interface MenuItemProps extends Omit<ComponentPropsWithRef<'button'>, 'ch
|
|
|
363
363
|
* consequence of the port: the fill that followed the pointer now also
|
|
364
364
|
* follows the arrow keys, because Base UI sets one attribute for both.
|
|
365
365
|
*/
|
|
366
|
-
|
|
366
|
+
/** The row's look, shared inside the package: `MenuItem` draws it, and
|
|
367
|
+
* `Select` puts it on Base UI's `Select.Item`, whose parts (`ItemText`,
|
|
368
|
+
* `ItemIndicator`) have to stay the element's own. One row, two parts. Not
|
|
369
|
+
* exported from the package's index. */
|
|
370
|
+
export function menuItemClassName({ size, selected, className }: { size: 'default' | 'tall'; selected?: boolean; className?: string }) {
|
|
367
371
|
return cn(
|
|
368
372
|
// shrink-0: a menu is a flex column that scrolls at its max height,
|
|
369
373
|
// and a flex child shrinks before its container does — so every row
|
package/src/Select.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Select as BaseSelect } from '@base-ui/react/select'
|
|
|
3
3
|
import type { ReactNode } from 'react'
|
|
4
4
|
import { cn } from './cn'
|
|
5
5
|
import { ScrollArea } from './ScrollArea'
|
|
6
|
+
import { MenuPanel, menuItemClassName } from './Menu'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Peek's Select (2026-08-28), verbatim, plus what Ship added: an option may
|
|
@@ -126,13 +127,28 @@ export function Select({ value, onChange, options, size = 'default', ariaLabel,
|
|
|
126
127
|
clamped it — the two numbers `fitMenu` used to compute here. The
|
|
127
128
|
288px is the old `max-h-72`, now a ceiling on that room rather
|
|
128
129
|
than a height applied blind. */
|
|
129
|
-
|
|
130
|
+
/* The list is the package's one list (Katerina, 2026-09-13: "i
|
|
131
|
+
thought the type to search menu would be from estiva-ui and be
|
|
132
|
+
the one used in select component"). The box is `MenuPanel` —
|
|
133
|
+
the same border, fill, radius and shadow this used to spell out
|
|
134
|
+
— with its padding moved onto the scrolling content (D63). */
|
|
135
|
+
render={<MenuPanel />}
|
|
136
|
+
className="min-w-[var(--anchor-width)] p-0"
|
|
130
137
|
>
|
|
131
138
|
{/* The list scrolls in a ScrollArea: the bar takes no width, so a
|
|
132
139
|
long list is exactly as wide as a short one (Katerina,
|
|
133
|
-
2026-09-08).
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
2026-09-08).
|
|
141
|
+
*
|
|
142
|
+
* **The padding is on the scrolling content, not on the panel**
|
|
143
|
+
* (D63, applied here 2026-09-13). On the panel it inset the
|
|
144
|
+
* scrolling box, so the thumb sat 7px from the panel's edge where
|
|
145
|
+
* DialogShell, Popover, Menu and ChipInput all draw it at 3px —
|
|
146
|
+
* Katerina: "the position of the scrollbar in select … not closer
|
|
147
|
+
* to the right side". The rows keep their 4px inset, because the
|
|
148
|
+
* padding that was the panel's is the content's; and the cap loses
|
|
149
|
+
* its `- 0.5rem`, because that padding is inside the box that
|
|
150
|
+
* scrolls now, so 288px stays 288px. */}
|
|
151
|
+
<ScrollArea viewportClassName="max-h-[min(288px,var(--available-height))]" contentClassName="flex flex-col p-2">
|
|
136
152
|
{options.map((option) => (
|
|
137
153
|
<BaseSelect.Item
|
|
138
154
|
key={option.value}
|
|
@@ -141,11 +157,17 @@ export function Select({ value, onChange, options, size = 'default', ariaLabel,
|
|
|
141
157
|
keyboard set the same attribute, so what the DOM says and
|
|
142
158
|
what the row looks like cannot disagree. It used to be an
|
|
143
159
|
index this component counted. */
|
|
144
|
-
|
|
160
|
+
/* A menu row, exactly (`menuItemClassName`): 36px floor, 8px
|
|
161
|
+
in from a panel padded 8px, so the label lands 17px from the
|
|
162
|
+
panel's edge — the same pixel as the old 4px + 12px. What
|
|
163
|
+
Select adds is its own: the ✓ at the end, and the chosen
|
|
164
|
+
row in medium weight. No fade on the highlight, as in every
|
|
165
|
+
menu (Katerina, 2026-09-05). */
|
|
166
|
+
className={cn(menuItemClassName({ size: 'default' }), 'justify-between data-[selected]:font-medium')}
|
|
145
167
|
>
|
|
146
168
|
<span className="flex min-w-0 items-center gap-2">
|
|
147
169
|
{option.leading && <span className="flex shrink-0 items-center">{option.leading}</span>}
|
|
148
|
-
<BaseSelect.ItemText className="truncate">{option.label}</BaseSelect.ItemText>
|
|
170
|
+
<BaseSelect.ItemText className="truncate text-[14px] leading-[140%] text-text-primary">{option.label}</BaseSelect.ItemText>
|
|
149
171
|
</span>
|
|
150
172
|
<BaseSelect.ItemIndicator
|
|
151
173
|
render={<IconCheck size={16} stroke={1.5} className="shrink-0 text-text-secondary" />}
|