@eldrajs/ui 0.2.2 → 0.2.3

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/CHANGELOG.md CHANGED
@@ -7,7 +7,10 @@ Release-please writes the generated notes from commit messages and does not repl
7
7
 
8
8
  ### Added
9
9
 
10
+ - **`Image` exact crops.** `zoomOrigin: 'focal'` zooms around the focal point itself, so a crop can reach the edges of the picture; the default, `'band'`, keeps the origin in the band the page builder's framing clamps to, so stored framings render as before and as Studio previews them. `crops: ImageCrop[]` art-directs the one `<img>`: a `ratio`, `focal`, `zoom` and `sizes` per media condition, first match first, with `sizes` scoped and scaled per crop, so a phone gets its own crop without a second download. `ratio` also takes a number (width ÷ height). New type `ImageCrop`.
10
11
  - **`NavMenu`** — the header navigation: top-level links, and buttons opening a `dropdown` panel or a `mega` panel of columns (entries with `description`, `badge`, `current`, `newTab`). Disclosure pattern: `Enter`/`Space` open, `Tab` walks through, `Escape` closes and returns focus, an outside click or focus leaving closes, one panel at a time; plus the APG arrow keys (`←`/`→`/`Home`/`End` along the bar, `↓`/`↑` into and through a panel, never wrapping). Optional `openOnHover`, opening after a 150ms rest and closing 150ms after the pointer leaves; a closing panel fades out. Below `collapseBelow` (default `lg`; also `md`, `xl`, the container breakpoints `@tablet`/`@content`/`@wide`, `never` and `always`) it becomes a menu button and a left `Drawer` with accordion rows. Takes a resolved Studio link tree as it is. `variant`: `ghost` (default; text colour with a fill on hover and while open) or `muted` (muted text turning the text colour on hover, while open and on the current page, no fill), for the bar and its panels alike. `linkAs`, `classes`, slots `panelItem`/`groupHeading`/`panelFooter`/`toggle`/`drawerFooter`, `v-model` (open panel) and `v-model:drawerOpen`, exposed `close()`. New messages `navMenuLabel`, `navMenuOpen`, `navMenuDrawer`, `navMenuOverview`; new CSS variables `--eldra-nav-menu-offset`, `--eldra-nav-menu-dropdown-min`/`-max`, `--eldra-nav-menu-column-min`.
12
+ - **`NavMenu`'s phone menu**: `drawerLayout` (`accordion`, the default, or `sections`, each panel listed open under its label, the new `drawerSectionHeading` part naming its list, group headings kept where a panel has them); `drawerItems`, the drawer's own entries when they differ from the bar's (a mega panel's area pages, a bar panel's footer links as rows); the `drawerHeader` slot (`{ close }`) for a logo and a call to action in the drawer's header row; the `triggerIcon` slot (`{ item, open }`) replacing the panel buttons' chevron, still turned over while open; `placement` (`bar` or `drawer`) in the `panelItem` and `groupHeading` slot props; new parts `drawerRoot`, `drawerHeader`, `drawerClose`, `drawerBody`, `drawerSectionHeading`. New types `NavMenuDrawerLayout`, `NavMenuPlacement`, `NavMenuPanelPart`, `NavMenuDrawerPanelPart`, `NavMenuPanelItemSlotProps`, `NavMenuGroupHeadingSlotProps`.
13
+ - **`Drawer`'s `header` slot**: content for the header row, after the title and before the close button.
11
14
  - **`@eldrajs/ui/components.css`** — `style.css` without Tailwind's preflight, whose reset reached every element on the page (rich-text headings, lists, links and paragraphs lost their browser defaults). Same theme and utilities; the reset only touches elements inside a component: every component's outermost element, and every panel, bubble or toast region it teleports, now carries the public `data-eldra-ui` marker, and the reset reaches those and the `data-part` elements within them, so a site's own `data-part` elements (Ark UI and Zag included) keep their defaults. `Rating`'s stars, `FilterPanel`'s colour ring, `SearchBar`'s no-results text and `SearchModal`'s key hints no longer lean on the global reset, so they draw the same under either stylesheet.
12
15
  - **`zoomSizes(sizes, zoom)`** — multiplies every length in an `<img sizes>` list by `zoom`, keeping its media conditions (`(min-width: 1024px) 50vw, 100vw` at zoom 3 is `(min-width: 1024px) calc(50vw * 3), calc(100vw * 3)`); a zoom of 1 or less, `auto` and a size-less condition are left as given. What `Image` now does to its own `sizes`, for a renderer that draws a zoomed crop itself.
13
16
  - **`Breadcrumb`'s `structuredData` prop** (default `true`, so nothing changes by default). `false` omits the component's own `BreadcrumbList` JSON-LD `<script>`, for a page whose theme already writes one at page level (`@eldrajs/theme-core`'s `buildBreadcrumbLd`); two on one page is duplicate markup.
@@ -34,6 +37,7 @@ Release-please writes the generated notes from commit messages and does not repl
34
37
 
35
38
  ### Changed
36
39
 
40
+ - **`NavMenu`'s drawer names its copies of the panel parts with a `drawer` prefix** (`drawerPanelLink`, `drawerGroupHeading`, `drawerOverview`, `drawerBadge`…), in `data-part` and in `classes` alike, so a bar panel's classes (`panelLink`, `columns`, `groupHeading`…) no longer reach the drawer's rows; move any drawer styling onto the prefixed keys. The `triggerIcon` part is now a `<span>` around the icon rather than the `<svg>` itself, so the `triggerIcon` slot's icon turns with it.
37
41
  - **Icelandic prints the same everywhere.** Every number, price, date and list now formats through `@eldrajs/sdk/format`, a new dependency on `@eldrajs/sdk`, so Chrome and Cloudflare Workers (which ship without Icelandic locale data) print `2.800 kr.` and `12. sep. 2026` exactly as Node, Safari and Firefox do, and a server-rendered page hydrates without a mismatch. This replaces the Danish (`da-DK`) fallback, which matched Icelandic only for narrow currency signs and plain decimals. `formatDate` now builds and formats its date in UTC.
38
42
  - **The wide currency sign is the default.** `Price`, `CurrencyInput` and `UnitInput` default `narrowSymbol` to `false`, and `RangeFacet` passes `false`: an English price reads `ISK 2,800`, not `kr 2,800`, which is also the Danish, Norwegian and Swedish krone. `is-IS` is unaffected (`2.800 kr.` either way). `formatCurrency` and `currencySymbol` keep the private library's narrow default.
39
43
  - **`FilterPanel`'s price range fills its panel, and the en dash sits between the fields.** The track and histogram are inset by the thumb's radius (new `eldra-range-gutter-thumb` utility, swappable against `eldra-range-gutter` through `classes.group`) rather than by half a touch target, and the separator is a control-height box on the fields' own baseline.
package/README.md CHANGED
@@ -1208,6 +1208,19 @@ aria-pressed>` that fills `primary`/`primary-contrast` when `selected`, the same
1208
1208
  is drawn that many times wider than the frame `sizes` describes, and a `srcset` candidate chosen
1209
1209
  for the frame is soft. A zoom of 1 or less, `auto` and a size-less media condition are left as
1210
1210
  given. See [An art-directed crop](../../docs/images.md#an-art-directed-crop).
1211
+ - **`Image`'s `zoomOrigin`, `crops` and a numeric `ratio`** — `zoomOrigin: 'focal'` zooms around the
1212
+ focal point itself; the default `'band'` keeps the origin inside the band
1213
+ `@eldrajs/theme-core`'s image framing clamps to, so a page-builder framing renders exactly as
1214
+ Studio previews it. The band is not needed to keep the frame covered (a zoom of 1 or more around
1215
+ any point of the frame covers it), only for that parity. Under `'focal'` the zoom sizes the media
1216
+ rather than scaling it with a transform, because the browser rounds the cover's offset to a pixel
1217
+ first and a transform would multiply the rounding by the zoom. `crops` art-directs the one
1218
+ `<img>`: each `ImageCrop` (`media`, and any of `ratio`, `focal`, `zoom`, `sizes`) replaces the
1219
+ instance's values where its media condition matches, first match first, written as a `<style>`
1220
+ scoped to the instance and as `sizes` entries scoped to the condition. A condition with any character
1221
+ but letters, digits, `_`, spaces and `().:<>=/+*-`, or with `/*` or `</`, is refused with a dev
1222
+ warning. `ratio` also takes a number, width ÷ height. See
1223
+ [An exact crop](../../docs/images.md#an-exact-crop).
1211
1224
  - **`formatDate`** (`src/utils/date.ts`) — the ISO-date formatter behind `ContentCard`'s `date` prop.
1212
1225
  Never throws: a malformed, empty or calendar-invalid value (`'2026-02-30'`) returns `null` rather
1213
1226
  than a fabricated date or a thrown `RangeError`, warning once per bad value in dev.
@@ -1291,13 +1304,28 @@ children?, layout? }`, one level of children. Children sharing a `group` form a
1291
1304
  no empty `<nav>`.
1292
1305
 
1293
1306
  **Narrow screens.** Below `collapseBelow` the bar is hidden and a menu button
1294
- (`aria-controls` the drawer) opens a left `Drawer`, each panel an `AccordionItem` and each plain
1295
- entry a row. `md`, `lg` (default) and `xl` are **viewport** breakpoints, since the menu's own width
1296
- says nothing about how crowded the header is; `@tablet`, `@content` and `@wide` measure the nearest
1297
- `@container` instead, for a header block whose own width is the measure; `never` keeps the bar and
1298
- `always` shows only the button. The button is named by `messages.navMenuOpen` and the drawer by
1299
- `messages.navMenuDrawer` (both "Menu"). `v-model` is the open panel's index and
1300
- `v-model:drawerOpen` the drawer; `close()` (exposed) closes both, for a router's navigation hook.
1307
+ (`aria-controls` the drawer) opens a left `Drawer`. `md`, `lg` (default) and `xl` are **viewport**
1308
+ breakpoints, since the menu's own width says nothing about how crowded the header is; `@tablet`,
1309
+ `@content` and `@wide` measure the nearest `@container` instead, for a header block whose own
1310
+ width is the measure; `never` keeps the bar and `always` shows only the button. The button is
1311
+ named by `messages.navMenuOpen` and the drawer by `messages.navMenuDrawer` (both "Menu").
1312
+ `v-model` is the open panel's index and `v-model:drawerOpen` the drawer; `close()` (exposed)
1313
+ closes both, for a router's navigation hook.
1314
+
1315
+ **The phone menu.** `drawerLayout` picks how the drawer shows a panel: `accordion` (default)
1316
+ folds each into an `AccordionItem` row, `sections` lists each open under its label (the
1317
+ `drawerSectionHeading` part, which names the section's list), keeping a panel's group headings
1318
+ when it has them and drawing none when it has not; plain entries are rows in both. A phone menu
1319
+ rarely wants the bar's exact entries — a mega panel's sixteen links may be five area pages on a
1320
+ phone, and the links in a bar panel's footer still need a row somewhere — so `drawerItems`, when
1321
+ given, is what the drawer draws instead of `items` (same shape, same rules; the bar keeps
1322
+ `items`). The `drawerHeader` slot fills the drawer's header row before its close button — a logo
1323
+ and a call to action, so the open menu keeps the header's own row — and is handed `close`, since
1324
+ only the menu's own links close the drawer when followed. The drawer focuses its first control
1325
+ when it opens, which is the header's first link when the slot holds one. `panelItem` and
1326
+ `groupHeading` are handed `placement` (`bar` or `drawer`), for content that differs between the
1327
+ two, and `triggerIcon` replaces the panel buttons' chevron inside the `triggerIcon` part, which
1328
+ keeps its size and turns over while its panel is open.
1301
1329
 
1302
1330
  **Variants.** `variant` names the two common looks, each after the component that already has
1303
1331
  it: `ghost` (default) is `Button`'s ghost — text colour, the same 6% text fill on hover and while
@@ -1307,8 +1335,16 @@ children?, layout? }`, one level of children. Children sharing a `group` form a
1307
1335
  current page keeps its underline in both, since colour alone cannot mark it. The drawer's rows
1308
1336
  are the same under either. Spacing, size and type are left to `classes`.
1309
1337
 
1310
- `classes.badge`, `drawer`, `drawerTrigger`, `drawerPanel` and `drawerFooter` restyle the composed
1311
- `Badge`, `Drawer` and `AccordionItem`, which keep their own `data-part` names.
1338
+ The drawer draws a panel's content with the same parts as the bar, each named with a `drawer`
1339
+ prefix (`drawerPanelLink`, `drawerGroupHeading`, `drawerPanelLabel`…, `NavMenuDrawerPanelPart`),
1340
+ so a bar panel's classes never reach the drawer's rows. `classes.badge`/`drawerBadge`,
1341
+ `drawerRoot` (the `<dialog>`, its backdrop and entrance), `drawer`, `drawerHeader`, `drawerClose`,
1342
+ `drawerBody`, `drawerFooter`, `drawerTrigger` and `drawerPanel` restyle the composed `Badge`,
1343
+ `Drawer` and `AccordionItem`, which keep their own `data-part` names.
1344
+
1345
+ - **`Drawer`'s `header` slot** — content for the header row, after the title and before the close
1346
+ button: the logo and call to action a menu drawer repeats from the page header it covers
1347
+ (`NavMenu`'s `drawerHeader`). The spec's anatomy gives the row a title and the close button only.
1312
1348
 
1313
1349
  - **`narrowSymbol` on `Price`, and `Price` formatting through `formatCurrency`** — `false` by
1314
1350
  default, the same default `CurrencyInput` carries, so every currency this package renders is
@@ -1,9 +1,11 @@
1
1
  import { DrawerProps } from './types.js';
2
- declare var __VLS_1: {}, __VLS_3: {};
2
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
3
3
  type __VLS_Slots = {} & {
4
- default?: (props: typeof __VLS_1) => any;
4
+ header?: (props: typeof __VLS_1) => any;
5
5
  } & {
6
- footer?: (props: typeof __VLS_3) => any;
6
+ default?: (props: typeof __VLS_3) => any;
7
+ } & {
8
+ footer?: (props: typeof __VLS_5) => any;
7
9
  };
8
10
  declare const __VLS_base: import('vue').DefineComponent<DrawerProps, {
9
11
  close: (returnValue?: string) => void;
@@ -1,20 +1,22 @@
1
- import { ImageProps } from './types.js';
1
+ import { ImageCrop, ImageProps } from './types.js';
2
2
  declare const __VLS_export: import('vue').DefineComponent<ImageProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ImageProps> & Readonly<{}>, {
3
3
  caption: string | null;
4
4
  rounded: "none" | "lg" | "xl";
5
5
  zoom: number;
6
6
  classes: Partial<Record<import('./types.js').ImagePart, string>>;
7
7
  media: import('./types.js').ImageMedia | null;
8
+ focal: {
9
+ x: number;
10
+ y: number;
11
+ };
8
12
  decorative: boolean;
9
13
  alt: string;
10
14
  loading: boolean;
11
15
  sizes: string;
12
- ratio: import('./types.js').ImageRatio;
16
+ ratio: import('./types.js').ImageRatio | number;
13
17
  fit: "cover" | "contain";
14
- focal: {
15
- x: number;
16
- y: number;
17
- };
18
+ zoomOrigin: "band" | "focal";
19
+ crops: ImageCrop[];
18
20
  priority: boolean;
19
21
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
22
  declare const _default: typeof __VLS_export;
@@ -27,6 +27,19 @@ export interface ImageMedia {
27
27
  /** Renders a `<video>` instead of an `<img>`. Defaults to `'image'`. */
28
28
  type?: 'image' | 'video';
29
29
  }
30
+ /** One art-directed crop: where `media` matches, its fields replace the instance's own. */
31
+ export interface ImageCrop {
32
+ /** A media condition, as in `sizes`: `(max-width: 640px)`. The first crop that matches wins. */
33
+ media: string;
34
+ ratio?: ImageRatio | number;
35
+ focal?: {
36
+ x: number;
37
+ y: number;
38
+ };
39
+ zoom?: number;
40
+ /** `sizes` for the frame under this condition, scaled by this crop's zoom like the instance's. */
41
+ sizes?: string;
42
+ }
30
43
  /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. */
31
44
  export type ImagePart = 'root' | 'frame' | 'media' | 'placeholder' | 'caption' | 'skeleton';
32
45
  export interface ImageProps {
@@ -40,9 +53,9 @@ export interface ImageProps {
40
53
  /** Renders `alt=""` (and hides the live placeholder from assistive technology) regardless of
41
54
  * `alt`/`media.alt`. */
42
55
  decorative?: boolean;
43
- /** The frame's aspect preset. See `ImageRatio`. Defaults to `'4x3'` — a product-card caller
44
- * passes `'4x5'` itself, per the spec's own per-context default. */
45
- ratio?: ImageRatio;
56
+ /** The frame's aspect preset, or its width ÷ height (`6 / 5`). See `ImageRatio`. Defaults to
57
+ * `'4x3'` — a product-card caller passes `'4x5'` itself, per the spec's own per-context default. */
58
+ ratio?: ImageRatio | number;
46
59
  /**
47
60
  * How the media fills its frame: `'cover'` (default) crops to fill, matching the spec's own
48
61
  * "the frame always crops; it never stretches" rule for every card/grid context this component
@@ -64,6 +77,10 @@ export interface ImageProps {
64
77
  /** Static crop scale (≥ 1) around `focal`, applied as `transform: scale(zoom)`. Never animated —
65
78
  * a static crop, not a hover effect (spec "Image" → Behaviour & motion). Defaults to `1`. */
66
79
  zoom?: number;
80
+ /** Where `zoom` scales from: `'band'` (default) as the page builder frames, `'focal'` exactly. */
81
+ zoomOrigin?: 'band' | 'focal';
82
+ /** Art direction: a ratio, focal point, zoom and `sizes` per media condition, on one `<img>`. */
83
+ crops?: ImageCrop[];
67
84
  /** Frame corner radius: `none` (default), `lg` (`radius-lg`) or `xl` (`radius-xl`). */
68
85
  rounded?: 'none' | 'lg' | 'xl';
69
86
  /** Renders a `<figcaption>` under the frame and makes the root a `<figure>`. `null`/omitted
@@ -1,26 +1,28 @@
1
- import { NavMenuCollapse, NavMenuItem, NavMenuLink, NavMenuProps, NavMenuVariant } from './types.js';
1
+ import { NavMenuCollapse, NavMenuGroupHeadingSlotProps, NavMenuItem, NavMenuPanelItemSlotProps, NavMenuProps, NavMenuVariant } from './types.js';
2
2
  type __VLS_Slots = {
3
- /** The inside of one panel entry; the link around it stays the menu's. */
4
- panelItem?: (props: {
5
- link: NavMenuLink;
6
- item: NavMenuItem;
7
- }) => unknown;
8
- /** A column heading's text. */
9
- groupHeading?: (props: {
10
- group: string;
11
- links: NavMenuLink[];
12
- item: NavMenuItem;
13
- }) => unknown;
3
+ /** The inside of one panel entry, in the bar or the drawer; the link around it stays the menu's. */
4
+ panelItem?: (props: NavMenuPanelItemSlotProps) => unknown;
5
+ /** A column heading's text, in the bar or the drawer. */
6
+ groupHeading?: (props: NavMenuGroupHeadingSlotProps) => unknown;
14
7
  /** Extra content at the foot of every panel. */
15
8
  panelFooter?: (props: {
16
9
  item: NavMenuItem;
17
10
  index: number;
18
11
  close: () => void;
19
12
  }) => unknown;
13
+ /** A panel button's icon, replacing the chevron; it turns over while the panel is open. */
14
+ triggerIcon?: (props: {
15
+ item: NavMenuItem;
16
+ open: boolean;
17
+ }) => unknown;
20
18
  /** The menu button's inside, replacing the icon. */
21
19
  toggle?: (props: {
22
20
  open: boolean;
23
21
  }) => unknown;
22
+ /** The drawer's header row, before its close button: a logo, a call to action. */
23
+ drawerHeader?: (props: {
24
+ close: () => void;
25
+ }) => unknown;
24
26
  /** The drawer's fixed footer. */
25
27
  drawerFooter?: (props: {
26
28
  close: () => void;
@@ -46,6 +48,8 @@ declare const __VLS_base: import('vue').DefineComponent<NavMenuProps, {
46
48
  drawerOpen: boolean;
47
49
  collapseBelow: NavMenuCollapse;
48
50
  drawerSide: import('../../index.js').DrawerSide;
51
+ drawerLayout: import('./types.js').NavMenuDrawerLayout;
52
+ drawerItems: readonly NavMenuItem[];
49
53
  openOnHover: boolean;
50
54
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
51
55
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,25 +1,20 @@
1
1
  import { Component } from 'vue';
2
2
  import { UiMessages } from '../../composables/useMessages.js';
3
- import { NavMenuItem, NavMenuLink, NavMenuPart, NavMenuVariant } from './types.js';
3
+ import { NavMenuGroupHeadingSlotProps, NavMenuItem, NavMenuPanelItemSlotProps, NavMenuPart, NavMenuPlacement, NavMenuVariant } from './types.js';
4
4
  type __VLS_Props = {
5
5
  item: NavMenuItem;
6
6
  idPrefix: string;
7
- placement: 'bar' | 'drawer';
7
+ placement: NavMenuPlacement;
8
8
  variant: NavMenuVariant;
9
9
  messages: UiMessages;
10
10
  linkAs?: string | Component;
11
11
  classes?: Partial<Record<NavMenuPart, string>>;
12
+ /** Names a list that has no group heading of its own, such as a drawer section's. */
13
+ labelledBy?: string;
12
14
  };
13
15
  type __VLS_Slots = {
14
- panelItem?: (props: {
15
- link: NavMenuLink;
16
- item: NavMenuItem;
17
- }) => unknown;
18
- groupHeading?: (props: {
19
- group: string;
20
- links: NavMenuLink[];
21
- item: NavMenuItem;
22
- }) => unknown;
16
+ panelItem?: (props: NavMenuPanelItemSlotProps) => unknown;
17
+ groupHeading?: (props: NavMenuGroupHeadingSlotProps) => unknown;
23
18
  };
24
19
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
20
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -31,8 +31,29 @@ export interface NavMenuItem extends NavMenuLink {
31
31
  export type NavMenuCollapse = 'md' | 'lg' | 'xl' | '@tablet' | '@content' | '@wide' | 'never' | 'always';
32
32
  /** `ghost` fills an entry on hover, as `Button`'s ghost variant does; `muted` is `Link`'s muted tone. */
33
33
  export type NavMenuVariant = 'ghost' | 'muted';
34
+ /** `accordion` folds each panel into a row that opens; `sections` lists every panel's links open under its heading. */
35
+ export type NavMenuDrawerLayout = 'accordion' | 'sections';
36
+ /** Where a panel's content is drawn: under the bar, or in the narrow-screen drawer. */
37
+ export type NavMenuPlacement = 'bar' | 'drawer';
38
+ /** The parts of a panel's content; in the drawer each one is named with a `drawer` prefix. */
39
+ export type NavMenuPanelPart = 'overview' | 'columns' | 'group' | 'groupHeading' | 'panelList' | 'panelItem' | 'panelLink' | 'panelLabel' | 'description' | 'badge';
40
+ /** A panel part as the drawer names it: `panelLink` is `drawerPanelLink`. */
41
+ export type NavMenuDrawerPanelPart = `drawer${Capitalize<NavMenuPanelPart>}`;
42
+ /** What the `panelItem` slot is handed: the entry, the item whose panel holds it, and where it is drawn. */
43
+ export interface NavMenuPanelItemSlotProps {
44
+ link: NavMenuLink;
45
+ item: NavMenuItem;
46
+ placement: NavMenuPlacement;
47
+ }
48
+ /** What the `groupHeading` slot is handed: the heading, its entries, their item, and where it is drawn. */
49
+ export interface NavMenuGroupHeadingSlotProps {
50
+ group: string;
51
+ links: NavMenuLink[];
52
+ item: NavMenuItem;
53
+ placement: NavMenuPlacement;
54
+ }
34
55
  /** The parts a consumer can restyle through `classes`. */
35
- export type NavMenuPart = 'root' | 'nav' | 'list' | 'item' | 'link' | 'trigger' | 'triggerIcon' | 'panel' | 'content' | 'overview' | 'columns' | 'group' | 'groupHeading' | 'panelList' | 'panelItem' | 'panelLink' | 'panelLabel' | 'description' | 'badge' | 'footer' | 'toggle' | 'toggleIcon' | 'drawer' | 'drawerList' | 'drawerItem' | 'drawerLink' | 'drawerTrigger' | 'drawerPanel' | 'drawerFooter';
56
+ export type NavMenuPart = 'root' | 'nav' | 'list' | 'item' | 'link' | 'trigger' | 'triggerIcon' | 'panel' | 'content' | NavMenuPanelPart | 'footer' | 'toggle' | 'toggleIcon' | 'drawerRoot' | 'drawer' | 'drawerHeader' | 'drawerClose' | 'drawerBody' | 'drawerList' | 'drawerItem' | 'drawerLink' | 'drawerTrigger' | 'drawerPanel' | 'drawerSectionHeading' | NavMenuDrawerPanelPart | 'drawerFooter';
36
57
  export interface NavMenuProps {
37
58
  /** The top-level entries, in order. */
38
59
  items: readonly NavMenuItem[];
@@ -48,6 +69,10 @@ export interface NavMenuProps {
48
69
  collapseBelow?: NavMenuCollapse;
49
70
  /** The edge the drawer slides in from. Default `left`. */
50
71
  drawerSide?: DrawerSide;
72
+ /** How the drawer shows a panel: `accordion` (default) rows that open, or `sections` listed open. */
73
+ drawerLayout?: NavMenuDrawerLayout;
74
+ /** The drawer's entries when they differ from the bar's. Defaults to `items`. */
75
+ drawerItems?: readonly NavMenuItem[];
51
76
  /** Also open a panel when a mouse pointer rests 150ms on its trigger; leaving closes it again. */
52
77
  openOnHover?: boolean;
53
78
  /**
@@ -2653,6 +2653,10 @@
2653
2653
  padding-block: var(--spacing-3);
2654
2654
  }
2655
2655
 
2656
+ .py-3\.5 {
2657
+ padding-block: calc(var(--spacing) * 3.5);
2658
+ }
2659
+
2656
2660
  .py-4 {
2657
2661
  padding-block: var(--spacing-4);
2658
2662
  }
@@ -2793,6 +2797,10 @@
2793
2797
  padding-top: var(--spacing-4);
2794
2798
  }
2795
2799
 
2800
+ .pt-5 {
2801
+ padding-top: var(--spacing-5);
2802
+ }
2803
+
2796
2804
  .pt-6 {
2797
2805
  padding-top: var(--spacing-6);
2798
2806
  }
@@ -4104,6 +4112,10 @@
4104
4112
  background-color: var(--color-overlay);
4105
4113
  }
4106
4114
 
4115
+ .backdrop\:bg-transparent::backdrop {
4116
+ background-color: #0000;
4117
+ }
4118
+
4107
4119
  .before\:absolute:before {
4108
4120
  content: var(--tw-content);
4109
4121
  position: absolute;
@@ -4144,6 +4156,11 @@
4144
4156
  inset: 0;
4145
4157
  }
4146
4158
 
4159
+ .last\:border-b-0:last-child {
4160
+ border-bottom-style: var(--tw-border-style);
4161
+ border-bottom-width: 0;
4162
+ }
4163
+
4147
4164
  .open\:block:is([open], :popover-open, :open) {
4148
4165
  display: block;
4149
4166
  }
package/dist/index.d.ts CHANGED
@@ -74,14 +74,14 @@ export type { EditorPlaceholderPart, EditorPlaceholderProps, EmptyStatePart, Emp
74
74
  export type { FieldWrapperCounter, FieldWrapperPart, FieldWrapperProps, } from './components/field-wrapper/types.js';
75
75
  export type { FormLayoutHeadingLevel, FormLayoutPart, FormLayoutProps, FormLayoutSubmitPayload, FormLayoutVariant, } from './components/form-layout/types.js';
76
76
  export type { IconComponent, IconPart, IconProps, IconSize } from './components/icon/types.js';
77
- export type { ImageMedia, ImagePart, ImageProps, ImageRatio } from './components/image/types.js';
77
+ export type { ImageCrop, ImageMedia, ImagePart, ImageProps, ImageRatio, } from './components/image/types.js';
78
78
  export type { InputPart, InputProps, InputSize, InputType } from './components/input/types.js';
79
79
  export type { LightboxImage, LightboxPart, LightboxProps } from './components/lightbox/types.js';
80
80
  export type { LinkPart, LinkProps, LinkTone, LinkVariant } from './components/link/types.js';
81
81
  export type { LoadMorePart, LoadMoreProps } from './components/load-more/types.js';
82
82
  export type { LogoItemPart, LogoItemProps } from './components/logo-item/types.js';
83
83
  export type { MultiSelectPart, MultiSelectProps, SelectOption, SelectPart, SelectPlacement, SelectProps, SelectSize, } from './components/select/types.js';
84
- export type { NavMenuCollapse, NavMenuItem, NavMenuLink, NavMenuPanelLayout, NavMenuPart, NavMenuProps, NavMenuVariant, } from './components/nav-menu/types.js';
84
+ export type { NavMenuCollapse, NavMenuDrawerLayout, NavMenuDrawerPanelPart, NavMenuGroupHeadingSlotProps, NavMenuItem, NavMenuLink, NavMenuPanelItemSlotProps, NavMenuPanelLayout, NavMenuPanelPart, NavMenuPart, NavMenuPlacement, NavMenuProps, NavMenuVariant, } from './components/nav-menu/types.js';
85
85
  export type { PaginationPart, PaginationProps } from './components/pagination/types.js';
86
86
  export type { PopoverPart, PopoverProps } from './components/popover/types.js';
87
87
  export type { PricePart, PriceProps, PriceSize } from './components/price/types.js';