@efolusi/meridian 1.21.8 → 1.21.9

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/components.css CHANGED
@@ -1459,6 +1459,15 @@ input.ef-input-group__control{height:34px;padding:0 11px}textarea.ef-input-group
1459
1459
  @media(max-width:767px){.ef-sidebar:not([data-collapsible=none]){display:none}.ef-sidebar-provider{min-height:100%}}
1460
1460
  @media(min-width:768px){.ef-sidebar-mobile-backdrop,.ef-sidebar-mobile{display:none}}
1461
1461
  @media(prefers-reduced-motion:reduce){.ef-sidebar,.ef-sidebar__panel{transition:none}}
1462
+ /* components/navigation/SkipLink.jsx */
1463
+ /* Off-screen rather than display:none or visibility:hidden: both of those
1464
+ remove the link from the focus order entirely, which is the one thing a skip
1465
+ link must never do. Clip-path keeps it reachable by Tab while invisible. */
1466
+ .ef-skip{position:absolute;inset-inline-start:var(--space-4);inset-block-start:var(--space-4);z-index:var(--z-modal);display:inline-flex;align-items:center;height:var(--control-h-md);min-height:var(--tap-min);padding:0 14px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);background:var(--surface-card);color:var(--text-primary);font-family:var(--font-sans);font-size:var(--text-md);font-weight:var(--weight-semibold);text-decoration:none;box-shadow:var(--shadow-md);clip-path:inset(50%);white-space:nowrap}
1467
+ .ef-skip:focus-visible{clip-path:none;outline:none;box-shadow:var(--focus-ring),var(--shadow-md)}
1468
+ /* Some browsers still focus a link on click without :focus-visible; keep the
1469
+ plain :focus reveal so a pointer user never hits an invisible target. */
1470
+ .ef-skip:focus{clip-path:none}
1462
1471
  /* components/navigation/Steps.jsx */
1463
1472
  .ef-steps{display:flex;flex-direction:column;gap:0}
1464
1473
  .ef-steps__item{display:flex;gap:12px}
package/index.d.ts CHANGED
@@ -109,6 +109,7 @@ export * from './navigation/Pagination.js';
109
109
  export * from './navigation/SegmentedControl.js';
110
110
  export * from './navigation/SideNav.js';
111
111
  export * from './navigation/Sidebar.js';
112
+ export * from './navigation/SkipLink.js';
112
113
  export * from './navigation/Steps.js';
113
114
  export * from './navigation/Tabs.js';
114
115
  export * from './navigation/TopNav.js';
package/index.js CHANGED
@@ -109,6 +109,7 @@ export { Pagination, PaginationContent, PaginationItem, PaginationLink, Paginati
109
109
  export { SegmentedControl } from './navigation/SegmentedControl.js';
110
110
  export { SideNav } from './navigation/SideNav.js';
111
111
  export { useSidebar, SidebarProvider, Sidebar, SidebarTrigger, SidebarRail, SidebarInset, SidebarHeader, SidebarFooter, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubItem, SidebarInput, SidebarSeparator, SidebarGroupLabel, SidebarGroupAction, SidebarMenuButton, SidebarMenuAction, SidebarMenuBadge, SidebarMenuSubButton, SidebarMenuSkeleton } from './navigation/Sidebar.js';
112
+ export { SkipLink } from './navigation/SkipLink.js';
112
113
  export { Steps } from './navigation/Steps.js';
113
114
  export { Tabs, TabsList, TabsTrigger, TabsContent } from './navigation/Tabs.js';
114
115
  export { TopNav } from './navigation/TopNav.js';
@@ -0,0 +1,8 @@
1
+ export interface SkipLinkProps {
2
+ /** Target landmark; it needs tabIndex={-1} to receive focus @default '#main' */
3
+ href?: string;
4
+ children?: React.ReactNode;
5
+ style?: React.CSSProperties;
6
+ className?: string;
7
+ }
8
+ export declare function SkipLink(props: SkipLinkProps): React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ import React from 'react';
4
+ /**
5
+ * First focusable element on the page: one Tab press moves a keyboard user past
6
+ * the whole header into the content.
7
+ *
8
+ * The target must be focusable for the jump to move focus, not just scroll:
9
+ * give the landmark `tabIndex={-1}` (`<main id="main" tabIndex={-1}>`). Without
10
+ * it Safari and Firefox scroll the page but leave focus in the header, so the
11
+ * next Tab returns to the navigation the user just skipped.
12
+ */
13
+ export function SkipLink({
14
+ href = '#main',
15
+ children = 'Skip to content',
16
+ style,
17
+ className,
18
+ ...rest
19
+ }) {
20
+ return /*#__PURE__*/React.createElement("a", _extends({}, rest, {
21
+ href: href,
22
+ className: `ef-skip${className ? ' ' + className : ''}`,
23
+ style: style
24
+ }), children);
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@efolusi/meridian",
3
- "version": "1.21.8",
3
+ "version": "1.21.9",
4
4
  "description": "A general-purpose open-source design system by Efolusi: accessible React components, design tokens, blocks and example apps.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://meridian.efolusi.com",