@eldrajs/ui 0.2.6 → 0.2.7
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 +8 -0
- package/README.md +25 -16
- package/dist/{VariantPicker-C56GlM1e.js → VariantPicker-BV_wKwMS.js} +17 -3
- package/dist/components/nav-menu/NavMenuPanel.vue.d.ts +2 -0
- package/dist/components/nav-menu/navLinks.d.ts +2 -2
- package/dist/components/nav-menu/types.d.ts +19 -3
- package/dist/components/search-bar/SearchBar.vue.d.ts +1 -1
- package/dist/components.css +47 -27
- package/dist/composables/useDialog.d.ts +9 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +98 -42
- package/dist/style.css +47 -27
- package/dist/tailwind.css +43 -0
- package/dist/vee-validate.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,9 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
7
7
|
|
|
8
8
|
### Added
|
|
9
9
|
|
|
10
|
+
- **`NavMenu`'s `groups`**: a column heading with a page of its own, `[{ label, href?, newTab?, current? }]` matched to the children's `group` by label, is a link in the bar and in the drawer (the new `groupLink` part) with no `groupHeading` slot. New type `NavMenuGroup`.
|
|
11
|
+
- **Phone menu variables.** `--eldra-nav-menu-drawer-row-height` (default `3.5rem`), every top-level row in `NavMenu`'s drawer; `--eldra-nav-menu-drawer-indent` (default `var(--eldra-space-4)`), how far a panel's links sit in from their row. `Drawer` takes `--eldra-drawer-header-height` (default `4rem`), `--eldra-drawer-header-padding` (default `var(--eldra-space-4)`; `0px` gives the row exactly the header height) and `--eldra-drawer-gutter` (default `1.5rem`), and adds the device's safe areas around its header, body and footer, so a full-screen drawer clears a notch and the home indicator under `viewport-fit=cover`.
|
|
12
|
+
|
|
10
13
|
- **`TablerIcon`** — any Tabler icon by the name a `tabler-icon` CMS field holds: Tabler's kebab-case name (`cash-register`), which Studio and the MCP store, or the older export name (`IconCashRegister`) that content saved before 17 Oct 2026 may hold, stega tolerated. `Icon`'s `size`, `label` and `classes`, plus `strokeWidth`; filled icons are filled. The icon is in the server HTML and hydration loads nothing; a page rendered in the browser loads only the data file holding each icon it draws (512 lazy chunks, every `@tabler/icons-vue` 3.48.0 export). An unknown name draws an empty box and warns once, never throws. New exports `tablerIconName` and `preloadTablerIcons`, types `TablerIconProps` and `TablerIconPart`; `<EldraTablerIcon>` through the resolver.
|
|
11
14
|
- **`SiteForm`** draws any form built in Studio from its definition (`definition`, or `formKey` read in the browser) and submits it through the SDK's `client.forms`: every field type with its own control, labels for `locale`, the platform's own checks and wording before sending, the honeypot, Cloudflare Turnstile when the form has a site key (and nothing third-party when it has none), a `422`'s messages under their fields and in an error summary, `429`, `413` and network failures in the summary, the success panel or the merchant's redirect (`navigate`), and the "check your inbox" state of a subscribing form. `layout`, `heading`, `submitLabel`, `classes` (`SiteFormPart`), slots `submit`, `success`, `loading`, `failed`, events `success` and `error`. **`useSiteForm`** is the state it is drawn from, for markup of your own. New messages `formSubmit`, `formSubmitting`, `formLoading`, `formLoadFailed`, `formRequired`, `formRequiredCheckbox`, `formInvalidEmail`, `formInvalidNumber`, `formInvalidUrl`, `formInvalidOption`, `formInvalidFormat`, `formTooShort`, `formTooLong`, `formRefused`, `formRateLimited`, `formTooLarge`, `formUnavailable`, `formSpamCheckRequired`, `formSpamCheckFailed`, `formSuccessTitle`, `formPendingTitle`, `formPendingMessage`, in English and Icelandic. New types `SiteFormClient`, `SiteFormDefinition`, `SiteFormField`, `SiteFormValue`, `SiteFormStatus`, `SiteFormSuccess`, `SiteFormFailure`, `SiteFormFailureReason`, `SiteFormSubmitOutcome`, `SiteFormLayout`, `SiteFormPart`, `SiteFormProps`, `UseSiteFormOptions`, `UseSiteFormReturn`.
|
|
12
15
|
- **`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`.
|
|
@@ -39,6 +42,8 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
39
42
|
|
|
40
43
|
### Changed
|
|
41
44
|
|
|
45
|
+
- **`NavMenu`'s phone menu reads as two levels.** In both layouts a panel's links sit indented under a rule beneath their row (the new `drawerNest` part), and the top-level rows, links, accordion rows and section headings, are one height and type. `sections` headings are rows like the plain links rather than small capitals, so a section's last page and the next top-level link can no longer be mistaken for one list; a heading whose entry has a page is that link, and its panel then has no "overview" row. The drawer list no longer draws a top border under the header's own. Below 48rem, where a `Drawer` covers the screen, it no longer draws its inner-edge border either.
|
|
46
|
+
|
|
42
47
|
- **`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.
|
|
43
48
|
- **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.
|
|
44
49
|
- **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.
|
|
@@ -91,6 +96,9 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
91
96
|
|
|
92
97
|
### Fixed
|
|
93
98
|
|
|
99
|
+
- **A dialog opened by a tap or click focuses itself, not its first control** (`Dialog`, `Drawer`, `Lightbox`, `SearchModal`, and `NavMenu`'s phone menu). Safari draws a focus ring on a control that script focuses after a tap, so opening the phone menu ringed its first link (or a logo in its header) as if the keyboard had moved there. A tap or click now focuses the dialog itself, ringed by nothing, and `Tab` goes on from there; a text field or a control marked `autofocus` still takes focus, and a dialog opened from the keyboard focuses its first control as before.
|
|
100
|
+
- **`Image` crops with `zoomOrigin: 'focal'` position the picture absolutely**, so the offsets resolve against the frame on every engine. Older Safari ignored a relatively positioned picture's percentage `top` inside a frame sized by `aspect-ratio`, drawing the top of the picture (a house's roof) instead of the cropped region.
|
|
101
|
+
|
|
94
102
|
- **`Textarea` hydrates without a mismatch.** It rendered `rows="3"` on the server, where `field-sizing` cannot be detected, and no `rows` in a browser that supports it, so every server-rendered page with a `Textarea` logged a hydration mismatch. It now renders `rows="3"` everywhere; `field-sizing: content` ignores it, so the box sizes as before.
|
|
95
103
|
- **`Image` with a `zoom` above 1 is sharp.** Under `fit: 'cover'` (the default) it multiplies every length in its effective `sizes` (the prop, else `media.sizes`) by the zoom, so the browser picks a `srcset` candidate for the magnified crop rather than for the frame, whose variant was up to `zoom` times too narrow. Write `sizes` for the frame as before; `fit: 'contain'` and a zoom of 1 leave it unchanged. See `docs/images.md`, "An art-directed crop".
|
|
96
104
|
- **A weight utility beside a type style now applies.** Most `text-*` type styles set the `font` shorthand, which Tailwind cannot place in its property order and so emits after every `font-*` weight utility: `text-body font-medium` rendered at 400. The type styles now set longhands and read their weight as `var(--tw-font-weight, <token>)`, so the weight utility wins in any order, a consumer's `classes` weight override included. Visible changes, each now the weight the component asks for: `NavMenu`'s bar entries and panel labels (500) and panel overview link (600); `Breadcrumb`'s current page (500) and ellipsis (600); `Rating`'s value, `Toast`'s action, `EditorPlaceholder`'s label, the search results' **See all** row, a selected single-`Select` option and a warning/danger option meta, `FilterPanel`'s checked colour and list labels (600); `SearchModal`'s **Cancel** and a selected `MultiSelect` option (500). `tabular-nums` beside a type style is no longer reset either: `QuantityStepper`'s value, `RadioGroup`'s card meta, the compact `Pagination` and the `CurrencyInput`/`UnitInput`/`RangeSlider` fields now print tabular figures. `LoadMore`'s button drops a `font-medium` the shorthand used to hide, so it stays at the outline button's 600.
|
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
147
147
|
| `ContentCard` | `--eldra-content-card-title-size` (default `1.25rem`) and `--eldra-content-card-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own; `--eldra-content-card-excerpt-size` (default `0.9375rem`) and `--eldra-content-card-excerpt-line` (default `1.5`) — the excerpt's own size and line ratio, shared by `FeatureCard`'s `body` (`text-content-card-excerpt` in `tailwind.css`), since both read the same spec number |
|
|
148
148
|
| `CurrencyInput` | `UnitInput`'s exactly (it renders a `UnitInput` with `isCurrency` always on) — see the `UnitInput` row |
|
|
149
149
|
| `Dialog` | `--eldra-dialog-title-size` (default `1.25rem`), `--eldra-dialog-title-line` (default `1.3`) — the title's own size/line, no token of its own; `--eldra-dialog-width` (default `32rem`), `--eldra-dialog-width-sm` (default `24rem`) — the panel's own width, always capped at `100vw - 2rem` inside the utility itself; `--eldra-dialog-max-height` (default `calc(100vh - 4rem)`) |
|
|
150
|
-
| `Drawer` | `--eldra-drawer-title-size` (default `1.25rem`), `--eldra-drawer-title-line` (default `1.3`) — the title's own size/line, no token of its own (the same numbers as `Dialog`'s, but its own variable pair); `--eldra-drawer-width` (default `28rem`) — the panel's own maximum width, capped at the viewport inside the utility itself, which also carries the full-screen-below-a-48rem-_viewport_ media query
|
|
150
|
+
| `Drawer` | `--eldra-drawer-title-size` (default `1.25rem`), `--eldra-drawer-title-line` (default `1.3`) — the title's own size/line, no token of its own (the same numbers as `Dialog`'s, but its own variable pair); `--eldra-drawer-width` (default `28rem`) — the panel's own maximum width, capped at the viewport inside the utility itself, which also carries the full-screen-below-a-48rem-_viewport_ media query; `--eldra-drawer-header-height` (default `4rem`) — the header row's least height, with `--eldra-drawer-header-padding` (default `var(--eldra-space-4)`) — its top and bottom padding, `0px` to centre the row's content in exactly that height, such as a site header's; `--eldra-drawer-gutter` (default `1.5rem`) — the header's, body's and footer's side padding. The device's safe areas (`env(safe-area-inset-*)`) are added around both, so a full-screen drawer clears a notch and the home indicator on a page with `viewport-fit=cover` |
|
|
151
151
|
| `EditorPlaceholder` | `--eldra-editor-placeholder-border-width` (default `1.5px`) — the dashed boundary's width, distinct from `EmptyState`'s own stock `border` (1px) |
|
|
152
152
|
| `EmptyState` | `--eldra-empty-state-title-size` (default `1.25rem`) and `--eldra-empty-state-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own |
|
|
153
153
|
| `FeatureCard` | Shares `ContentCard`'s `--eldra-content-card-excerpt-size`/`-line` for its own `body` text (`text-content-card-excerpt`); its `title` reads `text-h4` directly, no variable of its own |
|
|
@@ -161,7 +161,7 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
161
161
|
| `Link` | `--eldra-link-radius` (default `2px`) — the focus ring's corner radius on every variant |
|
|
162
162
|
| `LoadMore` | none — the status/meter/button sizes all reuse shared tokens (`text-body-sm`, `control-h`, `text-button-md`), no per-component variable |
|
|
163
163
|
| `LogoItem` | `--eldra-logo-image-max-height` (default `2.5rem`), `--eldra-logo-image-max-width` (default `9rem`) — the logo image's contain box; `--eldra-logo-wordmark-size` (default `1.25rem`) — the wordmark fallback's font size (its weight, line-height and letter-spacing reuse `h2`/`h3` tokens directly, see `text-logo-wordmark` in `tailwind.css`) |
|
|
164
|
-
| `NavMenu` | `--eldra-nav-menu-offset` (default `var(--eldra-space-2)`) — the gap between the bar and a panel, drawn as the panel's own top padding so a hovering pointer never leaves the menu; `--eldra-nav-menu-dropdown-min`/`-max` (defaults `14rem`/`24rem`, capped at `100vw - 2rem`) — a dropdown panel's width; `--eldra-nav-menu-column-min` (default `12rem`) — the narrowest a mega panel's column gets before the grid wraps (`classes.columns: 'grid-cols-5'` fixes the count instead).
|
|
164
|
+
| `NavMenu` | `--eldra-nav-menu-offset` (default `var(--eldra-space-2)`) — the gap between the bar and a panel, drawn as the panel's own top padding so a hovering pointer never leaves the menu; `--eldra-nav-menu-dropdown-min`/`-max` (defaults `14rem`/`24rem`, capped at `100vw - 2rem`) — a dropdown panel's width; `--eldra-nav-menu-column-min` (default `12rem`) — the narrowest a mega panel's column gets before the grid wraps (`classes.columns: 'grid-cols-5'` fixes the count instead). `--eldra-nav-menu-drawer-row-height` (default `3.5rem`) — every top-level row in the drawer, link, accordion row or section heading; `--eldra-nav-menu-drawer-indent` (default `var(--eldra-space-4)`) — how far a panel's links sit in from their row. The drawer itself and the badges are `Drawer` and `Badge`, each restyled through its own row |
|
|
165
165
|
| `MultiSelect` | everything `Select` reads, plus `--eldra-select-pill-line` (the "+N" pill's line box) and `--eldra-checkbox-radius`/`--eldra-checkbox-border-width`, shared with `Checkbox` so a consumer restyles both at once |
|
|
166
166
|
| `Pagination` | none — every size (the 2.5rem page link/`control-h` previous-next, the `target-touch` compact arrows, the 0.9375rem `text-control` compact status) reuses a shared token or a shared arbitrary spacing multiple, no per-component variable |
|
|
167
167
|
| `Popover` | `--eldra-z-popover` (default `30`), shared with the other popover panels — no per-component variable of its own: it has no fixed size to clamp, unlike `Select`'s panel |
|
|
@@ -564,11 +564,13 @@ spec's own non-negotiable 2):
|
|
|
564
564
|
tree, and `provide`/`inject` cannot connect two siblings, so the hand-off is a plain shared
|
|
565
565
|
reference both sides read and write, exactly the same reasoning `usePopover`'s `topLayerDialog()`
|
|
566
566
|
already uses to teleport a panel into a dialog it did not render;
|
|
567
|
-
- **initial focus** — `initialFocus`, else the first focusable that is not `[data-part="close"]`
|
|
567
|
+
- **initial focus** — `initialFocus`, else a reachable `[autofocus]` control, else the first focusable that is not `[data-part="close"]`
|
|
568
568
|
(this package's own "every part carries `data-part`" convention doubling as the composable's
|
|
569
569
|
exclusion rule, so any modal built on this contract needs no second constant to stay in sync),
|
|
570
570
|
else the close button itself, applied a tick after `showModal()` so slot content mounted alongside
|
|
571
|
-
the dialog (a form's first field) already exists to focus;
|
|
571
|
+
the dialog (a form's first field) already exists to focus; opened by a tap or click, the dialog
|
|
572
|
+
focuses itself instead unless that target is a text field or marked `autofocus`, so Safari draws
|
|
573
|
+
no focus ring on a control the visitor did not reach with the keyboard;
|
|
572
574
|
- **focus return** — whatever had focus immediately before `showModal()`, refocused the moment the
|
|
573
575
|
dialog actually closes, by any route — the page's own opener at the bottom of the stack, or,
|
|
574
576
|
for a modal opened from inside another one, whichever control still had focus in the modal
|
|
@@ -1384,13 +1386,16 @@ aria-pressed>` that fills `primary`/`primary-contrast` when `selected`, the same
|
|
|
1384
1386
|
it, and touch never hovers.
|
|
1385
1387
|
|
|
1386
1388
|
**Data.** `items` takes `{ label, href?, newTab?, description?, badge?, group?, current?,
|
|
1387
|
-
children?, layout? }`, one level of children. Children sharing a `group` form a column
|
|
1388
|
-
heading, and grouped children default the panel to `mega`.
|
|
1389
|
+
children?, layout?, groups? }`, one level of children. Children sharing a `group` form a column
|
|
1390
|
+
under that heading, and grouped children default the panel to `mega`. `groups` gives a heading a
|
|
1391
|
+
page of its own, `[{ label, href?, newTab?, current? }]` matched to the children's `group` by
|
|
1392
|
+
label: that heading is a link (the `groupLink` part) in the bar and in the drawer, with no slot. The shape is the one
|
|
1389
1393
|
`@eldrajs/theme-core`'s `resolveLink` returns for a Studio link tree — `href`, `label` and `group`
|
|
1390
1394
|
may be `null`, a heading with no `href` opens a panel and links nowhere, an entry without a label
|
|
1391
1395
|
is skipped — so a resolved tree is passed in as it is, with no dependency on the theme packages
|
|
1392
1396
|
(`navLinks.spec.ts` asserts the assignability). A top-level entry with both `href` and children
|
|
1393
|
-
gets its own page as the panel's first link ("Journal: overview")
|
|
1397
|
+
gets its own page as the panel's first link ("Journal: overview"); in the drawer's `sections`
|
|
1398
|
+
layout the section heading is that link instead. A `panelFooter` that renders
|
|
1394
1399
|
nothing for a panel takes no room in it (`empty:hidden`), and a menu with no entry to show draws
|
|
1395
1400
|
no empty `<nav>`.
|
|
1396
1401
|
|
|
@@ -1404,16 +1409,20 @@ children?, layout? }`, one level of children. Children sharing a `group` form a
|
|
|
1404
1409
|
closes both, for a router's navigation hook.
|
|
1405
1410
|
|
|
1406
1411
|
**The phone menu.** `drawerLayout` picks how the drawer shows a panel: `accordion` (default)
|
|
1407
|
-
folds each into an `AccordionItem` row,
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1412
|
+
folds each into an `AccordionItem` row, its links indented beneath once it opens; `sections` lists
|
|
1413
|
+
each open under a heading row, its links indented beneath. Plain entries are rows of the same
|
|
1414
|
+
height and type as those headings in both, so the whole top level reads as one level and the
|
|
1415
|
+
indent shows what belongs to it. A section heading whose entry has a page links to it (and the
|
|
1416
|
+
panel then has no "overview" row); one without is text. The indent is the `drawerNest` part, the
|
|
1417
|
+
section heading `drawerSectionHeading`, and a panel's group headings are kept inside the indent.
|
|
1418
|
+
A phone menu rarely wants the bar's exact entries — a mega panel's sixteen links may be five
|
|
1419
|
+
area pages on a phone, and the links in a bar panel's footer still need a row somewhere — so
|
|
1420
|
+
`drawerItems`, when given, is what the drawer draws instead of `items` (same shape, same rules;
|
|
1421
|
+
the bar keeps `items`). The `drawerHeader` slot fills the drawer's header row before its close button — a logo
|
|
1414
1422
|
and a call to action, so the open menu keeps the header's own row — and is handed `close`, since
|
|
1415
|
-
only the menu's own links close the drawer when followed.
|
|
1416
|
-
|
|
1423
|
+
only the menu's own links close the drawer when followed. Opened from the keyboard, the drawer
|
|
1424
|
+
focuses its first control, the header's first link when the slot holds one; opened by a tap or
|
|
1425
|
+
click it focuses itself, so no control shows a focus ring. `panelItem` and
|
|
1417
1426
|
`groupHeading` are handed `placement` (`bar` or `drawer`), for content that differs between the
|
|
1418
1427
|
two, and `triggerIcon` replaces the panel buttons' chevron inside the `triggerIcon` part, which
|
|
1419
1428
|
keeps its size and turns over while its panel is open.
|
|
@@ -102,8 +102,16 @@ var twMerge = extendTailwindMerge({ extend: {
|
|
|
102
102
|
"control-h-lg",
|
|
103
103
|
"eldra-range-track"
|
|
104
104
|
],
|
|
105
|
-
"min-h": [
|
|
106
|
-
|
|
105
|
+
"min-h": [
|
|
106
|
+
"eldra-range-rail",
|
|
107
|
+
"eldra-drawer-header-height",
|
|
108
|
+
"eldra-nav-menu-drawer-row"
|
|
109
|
+
],
|
|
110
|
+
px: [
|
|
111
|
+
"eldra-range-gutter",
|
|
112
|
+
"eldra-range-gutter-thumb",
|
|
113
|
+
"eldra-drawer-gutter"
|
|
114
|
+
],
|
|
107
115
|
w: [
|
|
108
116
|
"eldra-dialog-width",
|
|
109
117
|
"eldra-dialog-width-sm",
|
|
@@ -183,9 +191,15 @@ var twMerge = extendTailwindMerge({ extend: {
|
|
|
183
191
|
"eldra-range-thumb": ["eldra-range-thumb"],
|
|
184
192
|
"eldra-filter-swatch-edge": ["eldra-filter-swatch-edge"],
|
|
185
193
|
"eldra-filter-histogram-bar": ["eldra-filter-histogram-bar"],
|
|
186
|
-
pt: ["eldra-nav-menu-panel"],
|
|
194
|
+
pt: ["eldra-nav-menu-panel", "eldra-drawer-header-top"],
|
|
187
195
|
"grid-cols": ["eldra-nav-menu-columns"],
|
|
188
196
|
"eldra-nav-menu-dropdown": ["eldra-nav-menu-dropdown"],
|
|
197
|
+
ps: ["eldra-nav-menu-drawer-nest"],
|
|
198
|
+
pb: [
|
|
199
|
+
"eldra-drawer-header-bottom",
|
|
200
|
+
"eldra-drawer-body-bottom",
|
|
201
|
+
"eldra-drawer-footer-bottom"
|
|
202
|
+
],
|
|
189
203
|
animate: [
|
|
190
204
|
"animate-eldra-spin",
|
|
191
205
|
"animate-eldra-pulse",
|
|
@@ -11,6 +11,8 @@ type __VLS_Props = {
|
|
|
11
11
|
classes?: Partial<Record<NavMenuPart, string>>;
|
|
12
12
|
/** Names a list that has no group heading of its own, such as a drawer section's. */
|
|
13
13
|
labelledBy?: string;
|
|
14
|
+
/** Leaves out the link to the item's own page, when its drawer heading already is that link. */
|
|
15
|
+
omitOverview?: boolean;
|
|
14
16
|
};
|
|
15
17
|
type __VLS_Slots = {
|
|
16
18
|
panelItem?: (props: NavMenuPanelItemSlotProps) => unknown;
|
|
@@ -3,7 +3,7 @@ import { NavMenuItem, NavMenuLink, NavMenuPanelLayout } from './types.js';
|
|
|
3
3
|
/** How the page the visitor is on is marked, on every kind of link the menu draws. */
|
|
4
4
|
export declare const CURRENT_PAGE = "aria-[current=page]:underline aria-[current=page]:decoration-2 aria-[current=page]:underline-offset-[0.2em]";
|
|
5
5
|
/** A run of panel entries under one column heading; `group` is `null` for entries without one. */
|
|
6
|
-
export interface
|
|
6
|
+
export interface NavMenuLinkRun {
|
|
7
7
|
group: string | null;
|
|
8
8
|
links: NavMenuLink[];
|
|
9
9
|
}
|
|
@@ -14,7 +14,7 @@ export declare function panelLinks(item: NavMenuItem): NavMenuLink[];
|
|
|
14
14
|
/** Whether a top-level entry opens a panel rather than being a plain link. */
|
|
15
15
|
export declare function hasPanel(item: NavMenuItem): boolean;
|
|
16
16
|
/** Groups entries by their `group`, keeping the order each group first appears in. */
|
|
17
|
-
export declare function groupLinks(links: readonly NavMenuLink[]):
|
|
17
|
+
export declare function groupLinks(links: readonly NavMenuLink[]): NavMenuLinkRun[];
|
|
18
18
|
/** The panel's layout: the item's own, else `mega` when its entries are grouped into columns. */
|
|
19
19
|
export declare function panelLayout(item: NavMenuItem): NavMenuPanelLayout;
|
|
20
20
|
/** Whether the item, or an entry in its panel, is the page the visitor is on. */
|
|
@@ -20,10 +20,23 @@ export interface NavMenuLink {
|
|
|
20
20
|
}
|
|
21
21
|
/** `dropdown` hangs a compact panel under its trigger; `mega` spans the menu's positioning box. */
|
|
22
22
|
export type NavMenuPanelLayout = 'dropdown' | 'mega';
|
|
23
|
+
/** A column heading in a panel, matched to its entries by `label`; with an `href` it links to its own page. */
|
|
24
|
+
export interface NavMenuGroup {
|
|
25
|
+
/** The heading, as the entries' `group` names it. */
|
|
26
|
+
label: string;
|
|
27
|
+
/** The heading's own page. Without one the heading is plain text. */
|
|
28
|
+
href?: string | null;
|
|
29
|
+
/** Opens in a new tab, with the hidden "opens in a new tab" text. */
|
|
30
|
+
newTab?: boolean;
|
|
31
|
+
/** Marks the page the visitor is on (`aria-current="page"`). */
|
|
32
|
+
current?: boolean;
|
|
33
|
+
}
|
|
23
34
|
/** One top-level entry: a link when it has no children, a button opening a panel when it has. */
|
|
24
35
|
export interface NavMenuItem extends NavMenuLink {
|
|
25
36
|
/** The panel's entries, one level deep. */
|
|
26
37
|
children?: readonly NavMenuLink[];
|
|
38
|
+
/** The panel's column headings, for those that link to a page of their own. */
|
|
39
|
+
groups?: readonly NavMenuGroup[];
|
|
27
40
|
/** Default `mega` when any child has a `group`, else `dropdown`. */
|
|
28
41
|
layout?: NavMenuPanelLayout;
|
|
29
42
|
}
|
|
@@ -31,12 +44,15 @@ export interface NavMenuItem extends NavMenuLink {
|
|
|
31
44
|
export type NavMenuCollapse = 'md' | 'lg' | 'xl' | '@tablet' | '@content' | '@wide' | 'never' | 'always';
|
|
32
45
|
/** `ghost` fills an entry on hover, as `Button`'s ghost variant does; `muted` is `Link`'s muted tone. */
|
|
33
46
|
export type NavMenuVariant = 'ghost' | 'muted';
|
|
34
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* `accordion` folds each panel into a row that opens, its links indented beneath; `sections` lists every panel
|
|
49
|
+
* open under a heading row (a link when the entry has a page), its links indented beneath.
|
|
50
|
+
*/
|
|
35
51
|
export type NavMenuDrawerLayout = 'accordion' | 'sections';
|
|
36
52
|
/** Where a panel's content is drawn: under the bar, or in the narrow-screen drawer. */
|
|
37
53
|
export type NavMenuPlacement = 'bar' | 'drawer';
|
|
38
54
|
/** 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';
|
|
55
|
+
export type NavMenuPanelPart = 'overview' | 'columns' | 'group' | 'groupHeading' | 'panelList' | 'panelItem' | 'groupLink' | 'panelLink' | 'panelLabel' | 'description' | 'badge';
|
|
40
56
|
/** A panel part as the drawer names it: `panelLink` is `drawerPanelLink`. */
|
|
41
57
|
export type NavMenuDrawerPanelPart = `drawer${Capitalize<NavMenuPanelPart>}`;
|
|
42
58
|
/** What the `panelItem` slot is handed: the entry, the item whose panel holds it, and where it is drawn. */
|
|
@@ -53,7 +69,7 @@ export interface NavMenuGroupHeadingSlotProps {
|
|
|
53
69
|
placement: NavMenuPlacement;
|
|
54
70
|
}
|
|
55
71
|
/** The parts a consumer can restyle through `classes`. */
|
|
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';
|
|
72
|
+
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' | 'drawerNest' | NavMenuDrawerPanelPart | 'drawerFooter';
|
|
57
73
|
export interface NavMenuProps {
|
|
58
74
|
/** The top-level entries, in order. */
|
|
59
75
|
items: readonly NavMenuItem[];
|
|
@@ -28,6 +28,7 @@ declare const __VLS_base: import('vue').DefineComponent<SearchBarProps, {}, {},
|
|
|
28
28
|
loading: boolean;
|
|
29
29
|
pill: boolean;
|
|
30
30
|
messages: Partial<import('../../index.js').UiMessages>;
|
|
31
|
+
autofocus: boolean;
|
|
31
32
|
action: string;
|
|
32
33
|
teleport: boolean | string;
|
|
33
34
|
recent: string[];
|
|
@@ -35,7 +36,6 @@ declare const __VLS_base: import('vue').DefineComponent<SearchBarProps, {}, {},
|
|
|
35
36
|
showRecent: boolean;
|
|
36
37
|
resultTypes: SearchResultType[];
|
|
37
38
|
shortcut: boolean;
|
|
38
|
-
autofocus: boolean;
|
|
39
39
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
package/dist/components.css
CHANGED
|
@@ -1288,6 +1288,14 @@
|
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
|
+
.eldra-drawer-header-height {
|
|
1292
|
+
min-height: calc(var(--eldra-drawer-header-height, var(--eldra-space-16)) + env(safe-area-inset-top, 0px));
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
.eldra-nav-menu-drawer-row {
|
|
1296
|
+
min-height: var(--eldra-nav-menu-drawer-row-height, calc(var(--spacing) * 14));
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1291
1299
|
.min-h-0 {
|
|
1292
1300
|
min-height: 0;
|
|
1293
1301
|
}
|
|
@@ -1336,10 +1344,6 @@
|
|
|
1336
1344
|
min-height: calc(var(--spacing) * 96);
|
|
1337
1345
|
}
|
|
1338
1346
|
|
|
1339
|
-
.min-h-144 {
|
|
1340
|
-
min-height: calc(var(--spacing) * 144);
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
1347
|
.min-h-\[var\(--eldra-textarea-min-height\)\] {
|
|
1344
1348
|
min-height: var(--eldra-textarea-min-height);
|
|
1345
1349
|
}
|
|
@@ -2305,6 +2309,11 @@
|
|
|
2305
2309
|
border-width: var(--eldra-variant-swatch-ring-width, 2px);
|
|
2306
2310
|
}
|
|
2307
2311
|
|
|
2312
|
+
.border-s {
|
|
2313
|
+
border-inline-start-style: var(--tw-border-style);
|
|
2314
|
+
border-inline-start-width: 1px;
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2308
2317
|
.border-t {
|
|
2309
2318
|
border-top-style: var(--tw-border-style);
|
|
2310
2319
|
border-top-width: 1px;
|
|
@@ -2549,6 +2558,10 @@
|
|
|
2549
2558
|
}
|
|
2550
2559
|
}
|
|
2551
2560
|
|
|
2561
|
+
.eldra-drawer-gutter {
|
|
2562
|
+
padding-inline: calc(var(--eldra-drawer-gutter, var(--eldra-space-6)) + max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2552
2565
|
.eldra-range-gutter-thumb {
|
|
2553
2566
|
padding-inline: calc(var(--eldra-range-thumb-size, 1.25rem) / 2 + var(--eldra-focus-offset) + var(--eldra-focus-width));
|
|
2554
2567
|
}
|
|
@@ -2665,18 +2678,10 @@
|
|
|
2665
2678
|
padding-block: var(--spacing-3);
|
|
2666
2679
|
}
|
|
2667
2680
|
|
|
2668
|
-
.py-3\.5 {
|
|
2669
|
-
padding-block: calc(var(--spacing) * 3.5);
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
2681
|
.py-4 {
|
|
2673
2682
|
padding-block: var(--spacing-4);
|
|
2674
2683
|
}
|
|
2675
2684
|
|
|
2676
|
-
.py-5 {
|
|
2677
|
-
padding-block: var(--spacing-5);
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
2685
|
.py-6 {
|
|
2681
2686
|
padding-block: var(--spacing-6);
|
|
2682
2687
|
}
|
|
@@ -2689,6 +2694,10 @@
|
|
|
2689
2694
|
padding-block: calc(var(--eldra-focus-offset) + var(--eldra-focus-width));
|
|
2690
2695
|
}
|
|
2691
2696
|
|
|
2697
|
+
.eldra-nav-menu-drawer-nest {
|
|
2698
|
+
padding-inline-start: var(--eldra-nav-menu-drawer-indent, var(--eldra-space-4));
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2692
2701
|
.ps-2\.5 {
|
|
2693
2702
|
padding-inline-start: calc(var(--spacing) * 2.5);
|
|
2694
2703
|
}
|
|
@@ -2777,6 +2786,10 @@
|
|
|
2777
2786
|
padding-top: var(--spacing-12) !important;
|
|
2778
2787
|
}
|
|
2779
2788
|
|
|
2789
|
+
.eldra-drawer-header-top {
|
|
2790
|
+
padding-top: calc(var(--eldra-drawer-header-padding, var(--eldra-space-4)) + env(safe-area-inset-top, 0px));
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2780
2793
|
.eldra-nav-menu-panel {
|
|
2781
2794
|
padding-top: var(--eldra-nav-menu-offset, var(--eldra-space-2));
|
|
2782
2795
|
}
|
|
@@ -2837,6 +2850,18 @@
|
|
|
2837
2850
|
padding-top: var(--eldra-section-sm);
|
|
2838
2851
|
}
|
|
2839
2852
|
|
|
2853
|
+
.eldra-drawer-body-bottom {
|
|
2854
|
+
padding-bottom: calc(var(--eldra-space-6) + env(safe-area-inset-bottom, 0px));
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
.eldra-drawer-footer-bottom {
|
|
2858
|
+
padding-bottom: calc(var(--eldra-space-5) + env(safe-area-inset-bottom, 0px));
|
|
2859
|
+
}
|
|
2860
|
+
|
|
2861
|
+
.eldra-drawer-header-bottom {
|
|
2862
|
+
padding-bottom: var(--eldra-drawer-header-padding, var(--eldra-space-4));
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2840
2865
|
.pb-0 {
|
|
2841
2866
|
padding-bottom: 0;
|
|
2842
2867
|
}
|
|
@@ -4168,11 +4193,6 @@
|
|
|
4168
4193
|
inset: 0;
|
|
4169
4194
|
}
|
|
4170
4195
|
|
|
4171
|
-
.last\:border-b-0:last-child {
|
|
4172
|
-
border-bottom-style: var(--tw-border-style);
|
|
4173
|
-
border-bottom-width: 0;
|
|
4174
|
-
}
|
|
4175
|
-
|
|
4176
4196
|
.open\:block:is([open], :popover-open, :open) {
|
|
4177
4197
|
display: block;
|
|
4178
4198
|
}
|
|
@@ -4272,10 +4292,6 @@
|
|
|
4272
4292
|
background-color: var(--color-surface-strong);
|
|
4273
4293
|
}
|
|
4274
4294
|
|
|
4275
|
-
.hover\:text-primary:hover {
|
|
4276
|
-
color: var(--color-primary);
|
|
4277
|
-
}
|
|
4278
|
-
|
|
4279
4295
|
.hover\:text-text:hover {
|
|
4280
4296
|
color: var(--color-text);
|
|
4281
4297
|
}
|
|
@@ -4622,12 +4638,6 @@
|
|
|
4622
4638
|
}
|
|
4623
4639
|
}
|
|
4624
4640
|
|
|
4625
|
-
@media not all and (min-width: 64rem) {
|
|
4626
|
-
.max-lg\:hidden {
|
|
4627
|
-
display: none;
|
|
4628
|
-
}
|
|
4629
|
-
}
|
|
4630
|
-
|
|
4631
4641
|
@media not all and (min-width: 48rem) {
|
|
4632
4642
|
.max-md\:end-20 {
|
|
4633
4643
|
inset-inline-end: calc(var(--spacing) * 20);
|
|
@@ -4655,6 +4665,16 @@
|
|
|
4655
4665
|
border-width: 0;
|
|
4656
4666
|
}
|
|
4657
4667
|
|
|
4668
|
+
.max-md\:border-r-0 {
|
|
4669
|
+
border-right-style: var(--tw-border-style);
|
|
4670
|
+
border-right-width: 0;
|
|
4671
|
+
}
|
|
4672
|
+
|
|
4673
|
+
.max-md\:border-l-0 {
|
|
4674
|
+
border-left-style: var(--tw-border-style);
|
|
4675
|
+
border-left-width: 0;
|
|
4676
|
+
}
|
|
4677
|
+
|
|
4658
4678
|
.max-md\:pe-30 {
|
|
4659
4679
|
padding-inline-end: calc(var(--spacing) * 30);
|
|
4660
4680
|
}
|
|
@@ -9,7 +9,10 @@ export interface UseDialogOptions {
|
|
|
9
9
|
dialog: Ref<HTMLDialogElement | null>;
|
|
10
10
|
/** Whether a backdrop click closes the dialog. `Esc` and `close()` always do. Default `true`. */
|
|
11
11
|
dismissable?: MaybeRefOrGetter<boolean>;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Focused when the dialog opens from the keyboard, instead of the first meaningful control. After a tap or click
|
|
14
|
+
* it is focused only when it is a text field or marked `autofocus`; otherwise the dialog itself takes focus.
|
|
15
|
+
*/
|
|
13
16
|
initialFocus?: Ref<HTMLElement | null>;
|
|
14
17
|
/** Ran when `Esc` is pressed (the native `cancel` event), before the dialog actually closes. */
|
|
15
18
|
onCancel?: () => void;
|
|
@@ -47,9 +50,11 @@ export interface UseDialogReturn {
|
|
|
47
50
|
* composable): the page behind does not scroll while the stack is non-empty (released only once
|
|
48
51
|
* every open modal has closed), and `TOAST_HOST_KEY` tracks the **topmost** dialog a `Toaster`
|
|
49
52
|
* should render into.
|
|
50
|
-
* - **Initial focus**: `initialFocus`, else
|
|
51
|
-
* see `firstMeaningfulControl` above), else the close
|
|
52
|
-
* whatever the platform already focused.
|
|
53
|
+
* - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else the first
|
|
54
|
+
* meaningful control (never the close button — see `firstMeaningfulControl` above), else the close
|
|
55
|
+
* button itself as a last resort, else whatever the platform already focused. Opened by a tap or
|
|
56
|
+
* click, the dialog focuses itself instead unless that target is a text field or marked
|
|
57
|
+
* `autofocus`, because Safari rings a control script focuses after a tap. Applied a tick after `showModal()`, so slot content that
|
|
53
58
|
* mounts alongside the dialog (a form's first field) already exists in the DOM to focus.
|
|
54
59
|
* - **Focus return**: whatever had focus immediately before `showModal()` gets it back the moment
|
|
55
60
|
* the dialog actually closes, by any route — the page's own opener for the bottom of the stack,
|
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export type { LinkPart, LinkProps, LinkTone, LinkVariant } from './components/li
|
|
|
83
83
|
export type { LoadMorePart, LoadMoreProps } from './components/load-more/types.js';
|
|
84
84
|
export type { LogoItemPart, LogoItemProps } from './components/logo-item/types.js';
|
|
85
85
|
export type { MultiSelectPart, MultiSelectProps, SelectOption, SelectPart, SelectPlacement, SelectProps, SelectSize, } from './components/select/types.js';
|
|
86
|
-
export type { NavMenuCollapse, NavMenuDrawerLayout, NavMenuDrawerPanelPart, NavMenuGroupHeadingSlotProps, NavMenuItem, NavMenuLink, NavMenuPanelItemSlotProps, NavMenuPanelLayout, NavMenuPanelPart, NavMenuPart, NavMenuPlacement, NavMenuProps, NavMenuVariant, } from './components/nav-menu/types.js';
|
|
86
|
+
export type { NavMenuCollapse, NavMenuDrawerLayout, NavMenuDrawerPanelPart, NavMenuGroup, NavMenuGroupHeadingSlotProps, NavMenuItem, NavMenuLink, NavMenuPanelItemSlotProps, NavMenuPanelLayout, NavMenuPanelPart, NavMenuPart, NavMenuPlacement, NavMenuProps, NavMenuVariant, } from './components/nav-menu/types.js';
|
|
87
87
|
export type { PaginationPart, PaginationProps } from './components/pagination/types.js';
|
|
88
88
|
export type { PopoverPart, PopoverProps } from './components/popover/types.js';
|
|
89
89
|
export type { PricePart, PriceProps, PriceSize } from './components/price/types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as useEldraUiLocale, A as FIELD_BASE, B as formatCurrency, C as filterNumericBeforeInput, Ct as partClass, D as stripMask, E as defaultCharacterMeaning, F as FIELD_SIZE, G as useSlotPresence, H as formatUnit, I as createNumberFormat, J as DEFAULT_UI_LOCALE, K as useHeadingTag, L as currencyFractionDigits, M as FIELD_DISABLED, N as FIELD_LIVE, O as CurrencyInput_default, P as FIELD_SEARCH_APPEARANCE, Q as useEldraUiCurrency, R as currencySymbol, S as VisuallyHidden_default, St as cx, T as applyMask, U as localeSeparators, V as formatNumber, W as parseLocaleNumber, X as provideEldraUiCurrency, Y as LOCALE_KEY, Z as provideEldraUiLocale, _ as normalizeText, _t as useMessages, a as claimShortcut, at as FieldError_default, b as focusInvalid, bt as joinIds, c as SearchResultsPanel_default, ct as Button_default, d as MultiSelect_default, dt as ICON_SIZE_CLASS, et as TAG_FILL, f as usePopover, ft as ICON_STROKE_WIDTH$4, g as matchRange, gt as provideEldraUiMessages, h as useFloating, ht as MESSAGES_KEY, i as SearchBar_default, it as CheckboxGroup_default, j as FIELD_CLEAR_BUTTON, k as UnitInput_default, l as RadioGroup_default, lt as Spinner_default, m as useTeleportTarget, mt as FORM_SUBMITTING_KEY, n as Textarea_default, nt as TAG_SHAPE, o as ownsShortcut, ot as Checkbox_default, p as useOverlay, pt as FORM_LAYOUT_KEY, q as CURRENCY_KEY, r as Select_default, rt as tagPadding, s as releaseShortcut, st as FIELD_KEY, t as VariantPicker_default, tt as TAG_REMOVE_BUTTON, u as QuantityStepper_default, ut as Icon_default, v as useListbox, vt as enUS, w as Input_default, x as Switch_default, xt as useUiId, y as FormLayout_default, yt as useControllableModel, z as defaultUnitFormat } from "./VariantPicker-
|
|
1
|
+
import { $ as useEldraUiLocale, A as FIELD_BASE, B as formatCurrency, C as filterNumericBeforeInput, Ct as partClass, D as stripMask, E as defaultCharacterMeaning, F as FIELD_SIZE, G as useSlotPresence, H as formatUnit, I as createNumberFormat, J as DEFAULT_UI_LOCALE, K as useHeadingTag, L as currencyFractionDigits, M as FIELD_DISABLED, N as FIELD_LIVE, O as CurrencyInput_default, P as FIELD_SEARCH_APPEARANCE, Q as useEldraUiCurrency, R as currencySymbol, S as VisuallyHidden_default, St as cx, T as applyMask, U as localeSeparators, V as formatNumber, W as parseLocaleNumber, X as provideEldraUiCurrency, Y as LOCALE_KEY, Z as provideEldraUiLocale, _ as normalizeText, _t as useMessages, a as claimShortcut, at as FieldError_default, b as focusInvalid, bt as joinIds, c as SearchResultsPanel_default, ct as Button_default, d as MultiSelect_default, dt as ICON_SIZE_CLASS, et as TAG_FILL, f as usePopover, ft as ICON_STROKE_WIDTH$4, g as matchRange, gt as provideEldraUiMessages, h as useFloating, ht as MESSAGES_KEY, i as SearchBar_default, it as CheckboxGroup_default, j as FIELD_CLEAR_BUTTON, k as UnitInput_default, l as RadioGroup_default, lt as Spinner_default, m as useTeleportTarget, mt as FORM_SUBMITTING_KEY, n as Textarea_default, nt as TAG_SHAPE, o as ownsShortcut, ot as Checkbox_default, p as useOverlay, pt as FORM_LAYOUT_KEY, q as CURRENCY_KEY, r as Select_default, rt as tagPadding, s as releaseShortcut, st as FIELD_KEY, t as VariantPicker_default, tt as TAG_REMOVE_BUTTON, u as QuantityStepper_default, ut as Icon_default, v as useListbox, vt as enUS, w as Input_default, x as Switch_default, xt as useUiId, y as FormLayout_default, yt as useControllableModel, z as defaultUnitFormat } from "./VariantPicker-BV_wKwMS.js";
|
|
2
2
|
import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onServerPrefetch, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useSlots, useTemplateRef, vModelText, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
3
|
import { dateTimeFormat } from "@eldrajs/sdk/format/date";
|
|
4
4
|
//#region src/components/accordion/context.ts
|
|
@@ -2238,7 +2238,7 @@ var _hoisted_3$16 = {
|
|
|
2238
2238
|
};
|
|
2239
2239
|
var _hoisted_4$11 = ["disabled", "aria-label"];
|
|
2240
2240
|
var _hoisted_5$8 = ["disabled", "aria-label"];
|
|
2241
|
-
var _hoisted_6$
|
|
2241
|
+
var _hoisted_6$2 = ["tabindex", "aria-label"];
|
|
2242
2242
|
var _hoisted_7$2 = {
|
|
2243
2243
|
key: 2,
|
|
2244
2244
|
class: "flex items-center justify-between gap-4"
|
|
@@ -2534,7 +2534,7 @@ var Carousel_default = /* @__PURE__ */ defineComponent({
|
|
|
2534
2534
|
class: normalizeClass(trackClass.value),
|
|
2535
2535
|
style: normalizeStyle(trackStyle.value),
|
|
2536
2536
|
onKeydown: _cache[2] || (_cache[2] = (...args) => unref(onTrackKeydown) && unref(onTrackKeydown)(...args))
|
|
2537
|
-
}, [renderSlot(_ctx.$slots, "default")], 46, _hoisted_6$
|
|
2537
|
+
}, [renderSlot(_ctx.$slots, "default")], 46, _hoisted_6$2),
|
|
2538
2538
|
showBelowRow.value ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
|
|
2539
2539
|
showPause.value ? (openBlock(), createElementBlock("button", {
|
|
2540
2540
|
key: 0,
|
|
@@ -3279,7 +3279,7 @@ var Image_default = /* @__PURE__ */ defineComponent({
|
|
|
3279
3279
|
if (zoom <= 1 && !rule) return style;
|
|
3280
3280
|
const scale = Math.max(1, zoom);
|
|
3281
3281
|
return Object.assign(style, {
|
|
3282
|
-
position: "
|
|
3282
|
+
position: "absolute",
|
|
3283
3283
|
left: percent(focal.x * (1 - scale)),
|
|
3284
3284
|
top: percent(focal.y * (1 - scale)),
|
|
3285
3285
|
width: percent(scale * 100),
|
|
@@ -3974,6 +3974,26 @@ function isReachable(element) {
|
|
|
3974
3974
|
* (`Dialog` today; `Drawer`/`Lightbox`/`SearchModal` next) names its own close button the same way,
|
|
3975
3975
|
* so this exclusion works for all of them without a second constant to keep in sync.
|
|
3976
3976
|
*/
|
|
3977
|
+
var lastInputWasPointer = false;
|
|
3978
|
+
var trackingInput = false;
|
|
3979
|
+
function trackInputModality() {
|
|
3980
|
+
if (trackingInput || typeof document === "undefined") return;
|
|
3981
|
+
trackingInput = true;
|
|
3982
|
+
document.addEventListener("pointerdown", () => lastInputWasPointer = true, true);
|
|
3983
|
+
document.addEventListener("keydown", () => lastInputWasPointer = false, true);
|
|
3984
|
+
}
|
|
3985
|
+
trackInputModality();
|
|
3986
|
+
var TEXT_ENTRY = "input:not([type=\"button\"], [type=\"submit\"], [type=\"reset\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"range\"], [type=\"color\"], [type=\"file\"], [type=\"image\"]), textarea, [contenteditable]:not([contenteditable=\"false\"])";
|
|
3987
|
+
function takesFocusOnTap(element) {
|
|
3988
|
+
return element != null && (element.hasAttribute("autofocus") || element.matches(TEXT_ENTRY));
|
|
3989
|
+
}
|
|
3990
|
+
function focusSurface(dialog) {
|
|
3991
|
+
if (!dialog.hasAttribute("tabindex")) dialog.setAttribute("tabindex", "-1");
|
|
3992
|
+
dialog.focus({ preventScroll: true });
|
|
3993
|
+
}
|
|
3994
|
+
function autofocusControl(root) {
|
|
3995
|
+
return [...root.querySelectorAll("[autofocus]")].find(isReachable);
|
|
3996
|
+
}
|
|
3977
3997
|
function firstMeaningfulControl(root) {
|
|
3978
3998
|
return [...root.querySelectorAll(FOCUSABLE)].find((element) => isReachable(element) && element.closest("[data-part=\"close\"]") === null);
|
|
3979
3999
|
}
|
|
@@ -4001,9 +4021,11 @@ function firstMeaningfulControl(root) {
|
|
|
4001
4021
|
* composable): the page behind does not scroll while the stack is non-empty (released only once
|
|
4002
4022
|
* every open modal has closed), and `TOAST_HOST_KEY` tracks the **topmost** dialog a `Toaster`
|
|
4003
4023
|
* should render into.
|
|
4004
|
-
* - **Initial focus**: `initialFocus`, else
|
|
4005
|
-
* see `firstMeaningfulControl` above), else the close
|
|
4006
|
-
* whatever the platform already focused.
|
|
4024
|
+
* - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else the first
|
|
4025
|
+
* meaningful control (never the close button — see `firstMeaningfulControl` above), else the close
|
|
4026
|
+
* button itself as a last resort, else whatever the platform already focused. Opened by a tap or
|
|
4027
|
+
* click, the dialog focuses itself instead unless that target is a text field or marked
|
|
4028
|
+
* `autofocus`, because Safari rings a control script focuses after a tap. Applied a tick after `showModal()`, so slot content that
|
|
4007
4029
|
* mounts alongside the dialog (a form's first field) already exists in the DOM to focus.
|
|
4008
4030
|
* - **Focus return**: whatever had focus immediately before `showModal()` gets it back the moment
|
|
4009
4031
|
* the dialog actually closes, by any route — the page's own opener for the bottom of the stack,
|
|
@@ -4043,12 +4065,13 @@ function useDialog(options) {
|
|
|
4043
4065
|
function focusInitial() {
|
|
4044
4066
|
const el = dialog.value;
|
|
4045
4067
|
if (el === null) return;
|
|
4046
|
-
const
|
|
4047
|
-
if (
|
|
4048
|
-
|
|
4068
|
+
const target = options.initialFocus?.value ?? autofocusControl(el) ?? firstMeaningfulControl(el) ?? el.querySelector("[data-part=\"close\"]");
|
|
4069
|
+
if (lastInputWasPointer && !takesFocusOnTap(target)) {
|
|
4070
|
+
focusSurface(el);
|
|
4049
4071
|
return;
|
|
4050
4072
|
}
|
|
4051
|
-
|
|
4073
|
+
target?.focus();
|
|
4074
|
+
if (target != null && document.activeElement !== target) focusSurface(el);
|
|
4052
4075
|
}
|
|
4053
4076
|
function show() {
|
|
4054
4077
|
const el = dialog.value;
|
|
@@ -4203,7 +4226,7 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
4203
4226
|
close,
|
|
4204
4227
|
isTop
|
|
4205
4228
|
});
|
|
4206
|
-
const rootClass = computed(() => partClass(cx("hidden open:block m-auto border-0 bg-transparent p-0 text-text", "backdrop:bg-overlay", "animate-eldra-dialog-in motion-reduce:animate-eldra-dialog-in-reduced"), props.classes, "root"));
|
|
4229
|
+
const rootClass = computed(() => partClass(cx("hidden open:block m-auto border-0 bg-transparent p-0 text-text", "backdrop:bg-overlay focus:outline-none", "animate-eldra-dialog-in motion-reduce:animate-eldra-dialog-in-reduced"), props.classes, "root"));
|
|
4207
4230
|
/**
|
|
4208
4231
|
* The visible box (spec "Dialog" → Sizes): the `<dialog>` itself stays transparent and unsized
|
|
4209
4232
|
* above, so this inner flex column carries the border/shadow/radius and the width/max-height
|
|
@@ -4397,19 +4420,20 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
4397
4420
|
* for a closed `<dialog>` loses to *any* author `display` utility regardless of specificity, so
|
|
4398
4421
|
* `flex` alone painted the box even with the `open` attribute gone.
|
|
4399
4422
|
*/
|
|
4400
|
-
const rootClass = computed(() => partClass(cx("fixed inset-0 m-0 hidden open:flex h-auto max-h-none w-full max-w-none border-0 bg-transparent p-0 text-text", props.side === "left" ? "justify-start" : "justify-end", "backdrop:bg-overlay", props.side === "left" ? "animate-eldra-drawer-in-left motion-reduce:animate-eldra-dialog-in-reduced" : "animate-eldra-drawer-in-right motion-reduce:animate-eldra-dialog-in-reduced"), props.classes, "root"));
|
|
4423
|
+
const rootClass = computed(() => partClass(cx("fixed inset-0 m-0 hidden open:flex h-auto max-h-none w-full max-w-none border-0 bg-transparent p-0 text-text", props.side === "left" ? "justify-start" : "justify-end", "backdrop:bg-overlay focus:outline-none", props.side === "left" ? "animate-eldra-drawer-in-left motion-reduce:animate-eldra-dialog-in-reduced" : "animate-eldra-drawer-in-right motion-reduce:animate-eldra-dialog-in-reduced"), props.classes, "root"));
|
|
4401
4424
|
/**
|
|
4402
4425
|
* The visible sheet (spec "Drawer" → Sizes): full viewport height pinned to its edge, the width
|
|
4403
4426
|
* variable clamp (`eldra-drawer-width`, which also carries the full-screen-below-48rem-viewport
|
|
4404
4427
|
* media query — see its own comment in `tailwind.css`), radius none, `shadow-md`, and a 1px
|
|
4405
4428
|
* `border` on the *inner* edge only — the left edge for a right drawer, the right edge for a left
|
|
4406
|
-
* one, since the outer edge is the viewport boundary itself
|
|
4429
|
+
* one, since the outer edge is the viewport boundary itself — and none below 48rem, where the
|
|
4430
|
+
* sheet covers the screen and that edge is the viewport's too.
|
|
4407
4431
|
*/
|
|
4408
|
-
const panelClass = computed(() => partClass(cx("flex h-full max-h-full min-w-0 flex-col bg-background text-text shadow-md", "eldra-drawer-width", props.side === "left" ? "border-r border-border" : "border-l border-border"), props.classes, "panel"));
|
|
4432
|
+
const panelClass = computed(() => partClass(cx("flex h-full max-h-full min-w-0 flex-col bg-background text-text shadow-md", "eldra-drawer-width", props.side === "left" ? "border-r border-border max-md:border-r-0" : "border-l border-border max-md:border-l-0"), props.classes, "panel"));
|
|
4409
4433
|
/** `--eldra-drawer-width` from the `width` prop, left unset so the utility's own literal default
|
|
4410
4434
|
* (28rem) applies when the prop is omitted. */
|
|
4411
4435
|
const panelStyle = computed(() => props.width === void 0 ? void 0 : { "--eldra-drawer-width": props.width });
|
|
4412
|
-
const headerClass = computed(() => partClass("flex
|
|
4436
|
+
const headerClass = computed(() => partClass(cx("flex shrink-0 items-center gap-4 border-b border-border", "eldra-drawer-header-height eldra-drawer-gutter eldra-drawer-header-top eldra-drawer-header-bottom"), props.classes, "header"));
|
|
4413
4437
|
/** A plain layout spacer, not a named part: `flex-1` so it claims every pixel the title does not
|
|
4414
4438
|
* need, which is what pushes the close button to the row's end even when there is no `title` to
|
|
4415
4439
|
* share the row with (the menu drawer, `ariaLabel` only) — simpler than an `ms-auto` on the close
|
|
@@ -4427,8 +4451,8 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
4427
4451
|
* active state is a 2% scale instead of a translate).
|
|
4428
4452
|
*/
|
|
4429
4453
|
const closeClass = computed(() => partClass(cx("inline-flex size-10 max-md:size-11 shrink-0 cursor-pointer items-center justify-center rounded-sm", "text-text eldra-focus", "hover:bg-[color-mix(in_oklab,var(--eldra-color-text),transparent_94%)]", "active:scale-[0.98] active:bg-[color-mix(in_oklab,var(--eldra-color-text),transparent_89%)]"), props.classes, "close"));
|
|
4430
|
-
const bodyClass = computed(() => partClass("min-h-0 flex-1 overflow-y-auto
|
|
4431
|
-
const footerClass = computed(() => partClass("flex shrink-0 flex-wrap items-center gap-3 border-t border-border bg-background
|
|
4454
|
+
const bodyClass = computed(() => partClass(cx("min-h-0 flex-1 overflow-y-auto pt-6 eldra-drawer-gutter eldra-drawer-body-bottom"), props.classes, "body"));
|
|
4455
|
+
const footerClass = computed(() => partClass(cx("flex shrink-0 flex-wrap items-center gap-3 border-t border-border bg-background pt-5", "eldra-drawer-gutter eldra-drawer-footer-bottom"), props.classes, "footer"));
|
|
4432
4456
|
return (_ctx, _cache) => {
|
|
4433
4457
|
return openBlock(), createElementBlock("dialog", {
|
|
4434
4458
|
ref_key: "dialogEl",
|
|
@@ -8293,7 +8317,7 @@ var _hoisted_2$10 = { key: 1 };
|
|
|
8293
8317
|
var _hoisted_3$6 = ["aria-label"];
|
|
8294
8318
|
var _hoisted_4$5 = ["disabled", "aria-label"];
|
|
8295
8319
|
var _hoisted_5$5 = ["aria-label"];
|
|
8296
|
-
var _hoisted_6$
|
|
8320
|
+
var _hoisted_6$1 = ["disabled", "aria-label"];
|
|
8297
8321
|
var _hoisted_7$1 = [
|
|
8298
8322
|
"aria-current",
|
|
8299
8323
|
"aria-label",
|
|
@@ -8459,7 +8483,7 @@ var Lightbox_default = /* @__PURE__ */ defineComponent({
|
|
|
8459
8483
|
close,
|
|
8460
8484
|
isTop
|
|
8461
8485
|
});
|
|
8462
|
-
const rootClass = computed(() => partClass(cx("hidden open:block fixed inset-0 m-0 h-full max-h-none w-full max-w-none border-0 bg-transparent p-0 text-background", "backdrop:bg-overlay", "animate-eldra-lightbox-in motion-reduce:animate-eldra-dialog-in-reduced"), props.classes, "root"));
|
|
8486
|
+
const rootClass = computed(() => partClass(cx("hidden open:block fixed inset-0 m-0 h-full max-h-none w-full max-w-none border-0 bg-transparent p-0 text-background", "backdrop:bg-overlay focus:outline-none", "animate-eldra-lightbox-in motion-reduce:animate-eldra-dialog-in-reduced"), props.classes, "root"));
|
|
8463
8487
|
/**
|
|
8464
8488
|
* The viewer ground (spec "States": "Viewer ground: `text` at 94% (near-opaque ink) background;
|
|
8465
8489
|
* text/icon: `background`") — an inverted, near-black fill the rest of the anatomy sits on. The
|
|
@@ -8666,7 +8690,7 @@ var Lightbox_default = /* @__PURE__ */ defineComponent({
|
|
|
8666
8690
|
"stroke-linejoin": "round",
|
|
8667
8691
|
"aria-hidden": "true",
|
|
8668
8692
|
focusable: "false"
|
|
8669
|
-
}, [createElementVNode("path", { d: "M9 6l6 6l-6 6" })], -1)])], 10, _hoisted_6$
|
|
8693
|
+
}, [createElementVNode("path", { d: "M9 6l6 6l-6 6" })], -1)])], 10, _hoisted_6$1)) : createCommentVNode("", true)
|
|
8670
8694
|
], 2),
|
|
8671
8695
|
showThumbnails.value && unref(model) ? (openBlock(), createElementBlock("div", {
|
|
8672
8696
|
key: 0,
|
|
@@ -8986,7 +9010,7 @@ function panelLayout(item) {
|
|
|
8986
9010
|
}
|
|
8987
9011
|
/** Whether the item, or an entry in its panel, is the page the visitor is on. */
|
|
8988
9012
|
function containsCurrent(item) {
|
|
8989
|
-
return item.current === true || panelLinks(item).some((link) => link.current === true);
|
|
9013
|
+
return item.current === true || panelLinks(item).some((link) => link.current === true) || (item.groups ?? []).some((group) => group.current === true);
|
|
8990
9014
|
}
|
|
8991
9015
|
/** Whether an entry goes somewhere; one without a destination renders as plain text. */
|
|
8992
9016
|
function hasHref(link) {
|
|
@@ -9014,7 +9038,7 @@ var _hoisted_2$7 = ["data-part"];
|
|
|
9014
9038
|
var _hoisted_3$4 = ["id", "data-part"];
|
|
9015
9039
|
var _hoisted_4$4 = ["data-part", "aria-labelledby"];
|
|
9016
9040
|
var _hoisted_5$4 = ["data-part"];
|
|
9017
|
-
var _hoisted_6
|
|
9041
|
+
var _hoisted_6 = ["data-part"];
|
|
9018
9042
|
var _hoisted_7 = ["data-part"];
|
|
9019
9043
|
//#endregion
|
|
9020
9044
|
//#region src/components/nav-menu/NavMenuPanel.vue
|
|
@@ -9028,7 +9052,8 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
9028
9052
|
messages: {},
|
|
9029
9053
|
linkAs: {},
|
|
9030
9054
|
classes: {},
|
|
9031
|
-
labelledBy: {}
|
|
9055
|
+
labelledBy: {},
|
|
9056
|
+
omitOverview: { type: Boolean }
|
|
9032
9057
|
},
|
|
9033
9058
|
setup(__props) {
|
|
9034
9059
|
const props = __props;
|
|
@@ -9061,6 +9086,10 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
9061
9086
|
if (!grouped.value) return panelPartClass("", "columns");
|
|
9062
9087
|
return panelPartClass(bar.value ? "grid eldra-nav-menu-columns gap-6" : "flex flex-col gap-4", "columns");
|
|
9063
9088
|
});
|
|
9089
|
+
function groupMeta(name) {
|
|
9090
|
+
return name === null ? void 0 : props.item.groups?.find((group) => group.label === name);
|
|
9091
|
+
}
|
|
9092
|
+
const groupLinkClass = computed(() => panelPartClass(cx("rounded-sm eldra-focus hover:text-text", CURRENT_PAGE), "groupLink"));
|
|
9064
9093
|
const groupClass = computed(() => panelPartClass("flex min-w-0 flex-col", "group"));
|
|
9065
9094
|
const groupHeadingClass = computed(() => panelPartClass(cx("pb-1 text-overline text-muted", bar.value && "px-3"), "groupHeading"));
|
|
9066
9095
|
const panelListClass = computed(() => panelPartClass(mega.value && !grouped.value ? "grid eldra-nav-menu-columns gap-x-6 gap-y-0.5" : "flex flex-col gap-0.5", "panelList"));
|
|
@@ -9078,7 +9107,7 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
9078
9107
|
return group !== null ? headingId(index) : props.labelledBy;
|
|
9079
9108
|
}
|
|
9080
9109
|
return (_ctx, _cache) => {
|
|
9081
|
-
return openBlock(), createElementBlock(Fragment, null, [unref(hasHref)(__props.item) ? (openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(__props.item, __props.linkAs)), mergeProps({
|
|
9110
|
+
return openBlock(), createElementBlock(Fragment, null, [unref(hasHref)(__props.item) && !__props.omitOverview ? (openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(__props.item, __props.linkAs)), mergeProps({
|
|
9082
9111
|
key: 0,
|
|
9083
9112
|
"data-eldra-ui": "",
|
|
9084
9113
|
"data-part": part("overview"),
|
|
@@ -9108,7 +9137,17 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
9108
9137
|
links: group.links,
|
|
9109
9138
|
item: __props.item,
|
|
9110
9139
|
placement: __props.placement
|
|
9111
|
-
}, () => [
|
|
9140
|
+
}, () => [groupMeta(group.group) && unref(hasHref)(groupMeta(group.group)) ? (openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(groupMeta(group.group), __props.linkAs)), mergeProps({
|
|
9141
|
+
key: 0,
|
|
9142
|
+
"data-part": part("groupLink"),
|
|
9143
|
+
class: groupLinkClass.value
|
|
9144
|
+
}, { ref_for: true }, unref(navLinkAttrs)(groupMeta(group.group), __props.linkAs)), {
|
|
9145
|
+
default: withCtx(() => [createTextVNode(toDisplayString(group.group) + " ", 1), groupMeta(group.group).newTab ? (openBlock(), createBlock(VisuallyHidden_default, { key: 0 }, {
|
|
9146
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.messages.opensInNewTab), 1)]),
|
|
9147
|
+
_: 1
|
|
9148
|
+
})) : createCommentVNode("", true)]),
|
|
9149
|
+
_: 2
|
|
9150
|
+
}, 1040, ["data-part", "class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(group.group), 1)], 64))])], 10, _hoisted_3$4)) : createCommentVNode("", true), createElementVNode("ul", {
|
|
9112
9151
|
"data-part": part("panelList"),
|
|
9113
9152
|
class: normalizeClass(panelListClass.value),
|
|
9114
9153
|
"aria-labelledby": listLabel(group.group, index)
|
|
@@ -9132,7 +9171,7 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
9132
9171
|
key: 0,
|
|
9133
9172
|
label: link.badge,
|
|
9134
9173
|
classes: badgeClasses.value
|
|
9135
|
-
}, null, 8, ["label", "classes"])) : createCommentVNode("", true)], 10, _hoisted_6
|
|
9174
|
+
}, null, 8, ["label", "classes"])) : createCommentVNode("", true)], 10, _hoisted_6), link.description ? (openBlock(), createElementBlock("span", {
|
|
9136
9175
|
key: 0,
|
|
9137
9176
|
"data-part": part("description"),
|
|
9138
9177
|
class: normalizeClass(descriptionClass.value)
|
|
@@ -9277,11 +9316,11 @@ var _hoisted_4$3 = [
|
|
|
9277
9316
|
"aria-controls"
|
|
9278
9317
|
];
|
|
9279
9318
|
var _hoisted_5$3 = ["aria-label"];
|
|
9280
|
-
var _hoisted_6 = ["id"];
|
|
9281
9319
|
var HOVER_INTENT_MS = 150;
|
|
9282
9320
|
var HOVER_FILL = "hover:bg-[color-mix(in_oklab,var(--eldra-color-text),transparent_94%)]";
|
|
9283
9321
|
/** A top-level entry's colours at rest, hovered, open (`aria-expanded`) and current. */
|
|
9284
9322
|
var TOP_LEVEL = "inline-flex min-h-10 cursor-pointer items-center gap-1 rounded-md px-3 text-body font-medium eldra-focus";
|
|
9323
|
+
var DRAWER_ROW = "eldra-nav-menu-drawer-row";
|
|
9285
9324
|
//#endregion
|
|
9286
9325
|
//#region src/components/nav-menu/NavMenu.vue
|
|
9287
9326
|
var NavMenu_default = /* @__PURE__ */ defineComponent({
|
|
@@ -9496,16 +9535,19 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
9496
9535
|
footer: props.classes?.drawerFooter
|
|
9497
9536
|
}));
|
|
9498
9537
|
const sections = computed(() => props.drawerLayout === "sections");
|
|
9499
|
-
const drawerListClass = computed(() => partClass("flex flex-col
|
|
9538
|
+
const drawerListClass = computed(() => partClass("flex flex-col", props.classes, "drawerList"));
|
|
9500
9539
|
function drawerItemClass(item) {
|
|
9501
9540
|
if (!hasPanel(item)) return partClass("border-b border-border", props.classes, "drawerItem");
|
|
9502
|
-
const section = sections.value ? "flex flex-col border-b border-border
|
|
9541
|
+
const section = sections.value ? "flex flex-col border-b border-border pb-4" : "";
|
|
9503
9542
|
return partClass(section, props.classes, "drawerItem");
|
|
9504
9543
|
}
|
|
9505
|
-
|
|
9506
|
-
|
|
9544
|
+
function drawerSectionHeadingClass(item) {
|
|
9545
|
+
return partClass(cx(DRAWER_ROW, "flex w-full items-center rounded-sm py-4 text-accordion-title text-text", hasHref(item) && cx("eldra-focus", "aria-[current=page]:underline aria-[current=page]:decoration-2 aria-[current=page]:underline-offset-[0.2em]")), props.classes, "drawerSectionHeading");
|
|
9546
|
+
}
|
|
9547
|
+
const drawerLinkClass = computed(() => partClass(cx(DRAWER_ROW, "flex w-full items-center rounded-sm py-4", "text-accordion-title text-text eldra-focus", CURRENT_PAGE), props.classes, "drawerLink"));
|
|
9548
|
+
const drawerNestClass = computed(() => partClass("flex flex-col ms-1 border-s border-border eldra-nav-menu-drawer-nest", props.classes, "drawerNest"));
|
|
9507
9549
|
const accordionClasses = computed(() => ({
|
|
9508
|
-
summary: props.classes?.drawerTrigger,
|
|
9550
|
+
summary: cx(DRAWER_ROW, props.classes?.drawerTrigger),
|
|
9509
9551
|
panel: cx("max-w-none pb-4 text-text", props.classes?.drawerPanel)
|
|
9510
9552
|
}));
|
|
9511
9553
|
return (_ctx, _cache) => {
|
|
@@ -9661,11 +9703,20 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
9661
9703
|
key: index,
|
|
9662
9704
|
"data-part": "drawerItem",
|
|
9663
9705
|
class: normalizeClass(drawerItemClass(item))
|
|
9664
|
-
}, [unref(hasPanel)(item) && sections.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
9706
|
+
}, [unref(hasPanel)(item) && sections.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [(openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(item, __props.linkAs)), mergeProps({
|
|
9665
9707
|
id: `${panelId(index)}-drawer-heading`,
|
|
9666
9708
|
"data-part": "drawerSectionHeading",
|
|
9667
|
-
class:
|
|
9668
|
-
},
|
|
9709
|
+
class: drawerSectionHeadingClass(item)
|
|
9710
|
+
}, { ref_for: true }, unref(navLinkAttrs)(item, __props.linkAs)), {
|
|
9711
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label) + " ", 1), item.newTab && unref(hasHref)(item) ? (openBlock(), createBlock(VisuallyHidden_default, { key: 0 }, {
|
|
9712
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(m).opensInNewTab), 1)]),
|
|
9713
|
+
_: 1
|
|
9714
|
+
})) : createCommentVNode("", true)]),
|
|
9715
|
+
_: 2
|
|
9716
|
+
}, 1040, ["id", "class"])), createElementVNode("div", {
|
|
9717
|
+
"data-part": "drawerNest",
|
|
9718
|
+
class: normalizeClass(drawerNestClass.value)
|
|
9719
|
+
}, [createVNode(NavMenuPanel_default, {
|
|
9669
9720
|
item,
|
|
9670
9721
|
"id-prefix": `${panelId(index)}-drawer`,
|
|
9671
9722
|
placement: "drawer",
|
|
@@ -9673,7 +9724,8 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
9673
9724
|
messages: unref(m),
|
|
9674
9725
|
"link-as": __props.linkAs,
|
|
9675
9726
|
classes: __props.classes,
|
|
9676
|
-
"labelled-by": `${panelId(index)}-drawer-heading
|
|
9727
|
+
"labelled-by": `${panelId(index)}-drawer-heading`,
|
|
9728
|
+
"omit-overview": unref(hasHref)(item)
|
|
9677
9729
|
}, createSlots({ _: 2 }, [unref(slots).panelItem ? {
|
|
9678
9730
|
name: "panelItem",
|
|
9679
9731
|
fn: withCtx((scope) => [renderSlot(_ctx.$slots, "panelItem", mergeProps({ ref_for: true }, scope))]),
|
|
@@ -9689,13 +9741,17 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
9689
9741
|
"messages",
|
|
9690
9742
|
"link-as",
|
|
9691
9743
|
"classes",
|
|
9692
|
-
"labelled-by"
|
|
9693
|
-
|
|
9744
|
+
"labelled-by",
|
|
9745
|
+
"omit-overview"
|
|
9746
|
+
])], 2)], 64)) : unref(hasPanel)(item) ? (openBlock(), createBlock(AccordionItem_default, {
|
|
9694
9747
|
key: 1,
|
|
9695
9748
|
title: item.label ?? "",
|
|
9696
9749
|
classes: accordionClasses.value
|
|
9697
9750
|
}, {
|
|
9698
|
-
default: withCtx(() => [
|
|
9751
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
9752
|
+
"data-part": "drawerNest",
|
|
9753
|
+
class: normalizeClass(drawerNestClass.value)
|
|
9754
|
+
}, [createVNode(NavMenuPanel_default, {
|
|
9699
9755
|
item,
|
|
9700
9756
|
"id-prefix": `${panelId(index)}-drawer`,
|
|
9701
9757
|
placement: "drawer",
|
|
@@ -9718,7 +9774,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
9718
9774
|
"messages",
|
|
9719
9775
|
"link-as",
|
|
9720
9776
|
"classes"
|
|
9721
|
-
])]),
|
|
9777
|
+
])], 2)]),
|
|
9722
9778
|
_: 2
|
|
9723
9779
|
}, 1032, ["title", "classes"])) : (openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(item, __props.linkAs)), mergeProps({
|
|
9724
9780
|
key: 2,
|
|
@@ -12159,7 +12215,7 @@ var SearchModal_default = /* @__PURE__ */ defineComponent({
|
|
|
12159
12215
|
* own rootClass comment for the full mechanism): the same author-beats-UA-origin trap left a closed
|
|
12160
12216
|
* `SearchModal` painting its full box.
|
|
12161
12217
|
*/
|
|
12162
|
-
const rootClass = computed(() => part(cx("hidden open:flex max-w-none flex-col overflow-hidden border-0 bg-background p-0 text-text", "eldra-search-modal-position", "eldra-search-modal-width", "eldra-search-modal-max-height", "max-md:h-screen", "rounded-lg border border-border shadow-md", "max-md:rounded-none max-md:border-0 max-md:shadow-none", "backdrop:bg-overlay", "animate-eldra-dialog-in motion-reduce:animate-eldra-dialog-in-reduced"), "root"));
|
|
12218
|
+
const rootClass = computed(() => part(cx("hidden open:flex max-w-none flex-col overflow-hidden border-0 bg-background p-0 text-text", "eldra-search-modal-position", "eldra-search-modal-width", "eldra-search-modal-max-height", "max-md:h-screen", "rounded-lg border border-border shadow-md", "max-md:rounded-none max-md:border-0 max-md:shadow-none", "backdrop:bg-overlay focus:outline-none", "animate-eldra-dialog-in motion-reduce:animate-eldra-dialog-in-reduced"), "root"));
|
|
12163
12219
|
const formClass = computed(() => part("relative flex h-14 shrink-0 items-center border-b border-border", "form"));
|
|
12164
12220
|
/**
|
|
12165
12221
|
* The field (spec "Search modal" → Sizes, Field row): "no border or radius of its own, transparent
|
package/dist/style.css
CHANGED
|
@@ -1426,6 +1426,14 @@
|
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
|
+
.eldra-drawer-header-height {
|
|
1430
|
+
min-height: calc(var(--eldra-drawer-header-height, var(--eldra-space-16)) + env(safe-area-inset-top, 0px));
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
.eldra-nav-menu-drawer-row {
|
|
1434
|
+
min-height: var(--eldra-nav-menu-drawer-row-height, calc(var(--spacing) * 14));
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1429
1437
|
.min-h-0 {
|
|
1430
1438
|
min-height: 0;
|
|
1431
1439
|
}
|
|
@@ -1474,10 +1482,6 @@
|
|
|
1474
1482
|
min-height: calc(var(--spacing) * 96);
|
|
1475
1483
|
}
|
|
1476
1484
|
|
|
1477
|
-
.min-h-144 {
|
|
1478
|
-
min-height: calc(var(--spacing) * 144);
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
1485
|
.min-h-\[var\(--eldra-textarea-min-height\)\] {
|
|
1482
1486
|
min-height: var(--eldra-textarea-min-height);
|
|
1483
1487
|
}
|
|
@@ -2443,6 +2447,11 @@
|
|
|
2443
2447
|
border-width: var(--eldra-variant-swatch-ring-width, 2px);
|
|
2444
2448
|
}
|
|
2445
2449
|
|
|
2450
|
+
.border-s {
|
|
2451
|
+
border-inline-start-style: var(--tw-border-style);
|
|
2452
|
+
border-inline-start-width: 1px;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2446
2455
|
.border-t {
|
|
2447
2456
|
border-top-style: var(--tw-border-style);
|
|
2448
2457
|
border-top-width: 1px;
|
|
@@ -2687,6 +2696,10 @@
|
|
|
2687
2696
|
}
|
|
2688
2697
|
}
|
|
2689
2698
|
|
|
2699
|
+
.eldra-drawer-gutter {
|
|
2700
|
+
padding-inline: calc(var(--eldra-drawer-gutter, var(--eldra-space-6)) + max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2690
2703
|
.eldra-range-gutter-thumb {
|
|
2691
2704
|
padding-inline: calc(var(--eldra-range-thumb-size, 1.25rem) / 2 + var(--eldra-focus-offset) + var(--eldra-focus-width));
|
|
2692
2705
|
}
|
|
@@ -2803,18 +2816,10 @@
|
|
|
2803
2816
|
padding-block: var(--spacing-3);
|
|
2804
2817
|
}
|
|
2805
2818
|
|
|
2806
|
-
.py-3\.5 {
|
|
2807
|
-
padding-block: calc(var(--spacing) * 3.5);
|
|
2808
|
-
}
|
|
2809
|
-
|
|
2810
2819
|
.py-4 {
|
|
2811
2820
|
padding-block: var(--spacing-4);
|
|
2812
2821
|
}
|
|
2813
2822
|
|
|
2814
|
-
.py-5 {
|
|
2815
|
-
padding-block: var(--spacing-5);
|
|
2816
|
-
}
|
|
2817
|
-
|
|
2818
2823
|
.py-6 {
|
|
2819
2824
|
padding-block: var(--spacing-6);
|
|
2820
2825
|
}
|
|
@@ -2827,6 +2832,10 @@
|
|
|
2827
2832
|
padding-block: calc(var(--eldra-focus-offset) + var(--eldra-focus-width));
|
|
2828
2833
|
}
|
|
2829
2834
|
|
|
2835
|
+
.eldra-nav-menu-drawer-nest {
|
|
2836
|
+
padding-inline-start: var(--eldra-nav-menu-drawer-indent, var(--eldra-space-4));
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2830
2839
|
.ps-2\.5 {
|
|
2831
2840
|
padding-inline-start: calc(var(--spacing) * 2.5);
|
|
2832
2841
|
}
|
|
@@ -2915,6 +2924,10 @@
|
|
|
2915
2924
|
padding-top: var(--spacing-12) !important;
|
|
2916
2925
|
}
|
|
2917
2926
|
|
|
2927
|
+
.eldra-drawer-header-top {
|
|
2928
|
+
padding-top: calc(var(--eldra-drawer-header-padding, var(--eldra-space-4)) + env(safe-area-inset-top, 0px));
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2918
2931
|
.eldra-nav-menu-panel {
|
|
2919
2932
|
padding-top: var(--eldra-nav-menu-offset, var(--eldra-space-2));
|
|
2920
2933
|
}
|
|
@@ -2975,6 +2988,18 @@
|
|
|
2975
2988
|
padding-top: var(--eldra-section-sm);
|
|
2976
2989
|
}
|
|
2977
2990
|
|
|
2991
|
+
.eldra-drawer-body-bottom {
|
|
2992
|
+
padding-bottom: calc(var(--eldra-space-6) + env(safe-area-inset-bottom, 0px));
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
.eldra-drawer-footer-bottom {
|
|
2996
|
+
padding-bottom: calc(var(--eldra-space-5) + env(safe-area-inset-bottom, 0px));
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2999
|
+
.eldra-drawer-header-bottom {
|
|
3000
|
+
padding-bottom: var(--eldra-drawer-header-padding, var(--eldra-space-4));
|
|
3001
|
+
}
|
|
3002
|
+
|
|
2978
3003
|
.pb-0 {
|
|
2979
3004
|
padding-bottom: 0;
|
|
2980
3005
|
}
|
|
@@ -4306,11 +4331,6 @@
|
|
|
4306
4331
|
inset: 0;
|
|
4307
4332
|
}
|
|
4308
4333
|
|
|
4309
|
-
.last\:border-b-0:last-child {
|
|
4310
|
-
border-bottom-style: var(--tw-border-style);
|
|
4311
|
-
border-bottom-width: 0;
|
|
4312
|
-
}
|
|
4313
|
-
|
|
4314
4334
|
.open\:block:is([open], :popover-open, :open) {
|
|
4315
4335
|
display: block;
|
|
4316
4336
|
}
|
|
@@ -4410,10 +4430,6 @@
|
|
|
4410
4430
|
background-color: var(--color-surface-strong);
|
|
4411
4431
|
}
|
|
4412
4432
|
|
|
4413
|
-
.hover\:text-primary:hover {
|
|
4414
|
-
color: var(--color-primary);
|
|
4415
|
-
}
|
|
4416
|
-
|
|
4417
4433
|
.hover\:text-text:hover {
|
|
4418
4434
|
color: var(--color-text);
|
|
4419
4435
|
}
|
|
@@ -4760,12 +4776,6 @@
|
|
|
4760
4776
|
}
|
|
4761
4777
|
}
|
|
4762
4778
|
|
|
4763
|
-
@media not all and (min-width: 64rem) {
|
|
4764
|
-
.max-lg\:hidden {
|
|
4765
|
-
display: none;
|
|
4766
|
-
}
|
|
4767
|
-
}
|
|
4768
|
-
|
|
4769
4779
|
@media not all and (min-width: 48rem) {
|
|
4770
4780
|
.max-md\:end-20 {
|
|
4771
4781
|
inset-inline-end: calc(var(--spacing) * 20);
|
|
@@ -4793,6 +4803,16 @@
|
|
|
4793
4803
|
border-width: 0;
|
|
4794
4804
|
}
|
|
4795
4805
|
|
|
4806
|
+
.max-md\:border-r-0 {
|
|
4807
|
+
border-right-style: var(--tw-border-style);
|
|
4808
|
+
border-right-width: 0;
|
|
4809
|
+
}
|
|
4810
|
+
|
|
4811
|
+
.max-md\:border-l-0 {
|
|
4812
|
+
border-left-style: var(--tw-border-style);
|
|
4813
|
+
border-left-width: 0;
|
|
4814
|
+
}
|
|
4815
|
+
|
|
4796
4816
|
.max-md\:pe-30 {
|
|
4797
4817
|
padding-inline-end: calc(var(--spacing) * 30);
|
|
4798
4818
|
}
|
package/dist/tailwind.css
CHANGED
|
@@ -1665,6 +1665,40 @@
|
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
1667
|
|
|
1668
|
+
/* Drawer: the side gutter and the header row's least height from their variables, and the edge paddings, each with
|
|
1669
|
+
the device's safe area added (zero unless the page sets `viewport-fit=cover`). One property per utility, so a
|
|
1670
|
+
consumer's `px-*`, `pt-*`, `pb-*` or `min-h-*` replaces exactly the one it names. */
|
|
1671
|
+
@utility eldra-drawer-gutter {
|
|
1672
|
+
padding-inline: calc(
|
|
1673
|
+
var(--eldra-drawer-gutter, var(--eldra-space-6)) +
|
|
1674
|
+
max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))
|
|
1675
|
+
);
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
@utility eldra-drawer-header-height {
|
|
1679
|
+
min-height: calc(
|
|
1680
|
+
var(--eldra-drawer-header-height, var(--eldra-space-16)) + env(safe-area-inset-top, 0px)
|
|
1681
|
+
);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
@utility eldra-drawer-header-top {
|
|
1685
|
+
padding-top: calc(
|
|
1686
|
+
var(--eldra-drawer-header-padding, var(--eldra-space-4)) + env(safe-area-inset-top, 0px)
|
|
1687
|
+
);
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
@utility eldra-drawer-header-bottom {
|
|
1691
|
+
padding-bottom: var(--eldra-drawer-header-padding, var(--eldra-space-4));
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
@utility eldra-drawer-body-bottom {
|
|
1695
|
+
padding-bottom: calc(var(--eldra-space-6) + env(safe-area-inset-bottom, 0px));
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
@utility eldra-drawer-footer-bottom {
|
|
1699
|
+
padding-bottom: calc(var(--eldra-space-5) + env(safe-area-inset-bottom, 0px));
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1668
1702
|
/* The drawer's own entrance (spec "Drawer" → Behaviour & motion): "Enter: slides in from its edge
|
|
1669
1703
|
(translateX(100%) -> 0 for right, -100% -> 0 for left), duration-slow (250ms) ease-out. Exit:
|
|
1670
1704
|
instant." Applied to the `<dialog>` root itself (`Drawer.vue`: `animate-eldra-drawer-in-{side}
|
|
@@ -2159,3 +2193,12 @@
|
|
|
2159
2193
|
minmax(min(100%, var(--eldra-nav-menu-column-min, 12rem)), 1fr)
|
|
2160
2194
|
);
|
|
2161
2195
|
}
|
|
2196
|
+
|
|
2197
|
+
/* NavMenu's phone menu: every top-level row's least height, and a panel's links indented beneath their row. */
|
|
2198
|
+
@utility eldra-nav-menu-drawer-row {
|
|
2199
|
+
min-height: var(--eldra-nav-menu-drawer-row-height, calc(var(--spacing) * 14));
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
@utility eldra-nav-menu-drawer-nest {
|
|
2203
|
+
padding-inline-start: var(--eldra-nav-menu-drawer-indent, var(--eldra-space-4));
|
|
2204
|
+
}
|
package/dist/vee-validate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as CurrencyInput_default, _t as useMessages, b as focusInvalid, d as MultiSelect_default, i as SearchBar_default, it as CheckboxGroup_default, k as UnitInput_default, l as RadioGroup_default, n as Textarea_default, ot as Checkbox_default, r as Select_default, st as FIELD_KEY, t as VariantPicker_default, u as QuantityStepper_default, w as Input_default, x as Switch_default, xt as useUiId, y as FormLayout_default } from "./VariantPicker-
|
|
1
|
+
import { O as CurrencyInput_default, _t as useMessages, b as focusInvalid, d as MultiSelect_default, i as SearchBar_default, it as CheckboxGroup_default, k as UnitInput_default, l as RadioGroup_default, n as Textarea_default, ot as Checkbox_default, r as Select_default, st as FIELD_KEY, t as VariantPicker_default, u as QuantityStepper_default, w as Input_default, x as Switch_default, xt as useUiId, y as FormLayout_default } from "./VariantPicker-BV_wKwMS.js";
|
|
2
2
|
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createSlots, createTextVNode, defineComponent, guardReactiveProps, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, onScopeDispose, openBlock, provide, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
|
|
3
3
|
import { FormContextKey, useField, useForm } from "vee-validate";
|
|
4
4
|
//#region src/vee-validate/context.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Accessible Vue 3 core components for Eldra storefronts: buttons, forms, selects, cards, overlays and navigation, themed through CSS design tokens.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessible",
|