@alfadocs/ui-kit-debug 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/email-input-DKN5JERd.js +396 -0
- package/dist/_chunks/email-input-DKN5JERd.js.map +1 -0
- package/dist/_chunks/{public-header.agent-BIBQzkeV.js → public-header.agent-BQ3r6Hgq.js} +6 -4
- package/dist/_chunks/public-header.agent-BQ3r6Hgq.js.map +1 -0
- package/dist/_chunks/{use-password-requirements-BOgFsoIe.js → use-password-requirements-C9vKBSVn.js} +92 -81
- package/dist/_chunks/{use-password-requirements-BOgFsoIe.js.map → use-password-requirements-C9vKBSVn.js.map} +1 -1
- package/dist/agent-catalog.json +31 -1
- package/dist/components/email-input/email-input.agent.d.ts +13 -0
- package/dist/components/email-input/email-input.agent.d.ts.map +1 -0
- package/dist/components/email-input/email-input.d.ts +28 -0
- package/dist/components/email-input/email-input.d.ts.map +1 -0
- package/dist/components/email-input/index.d.ts +5 -0
- package/dist/components/email-input/index.d.ts.map +1 -0
- package/dist/components/email-input/index.js +6 -0
- package/dist/components/email-input/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/password-input/use-password-requirements.d.ts +9 -1
- package/dist/components/password-input/use-password-requirements.d.ts.map +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts.map +1 -1
- package/dist/i18n/config.js +12 -0
- package/dist/i18n/config.js.map +1 -1
- package/dist/i18n/resources.d.ts +12 -0
- package/dist/i18n/resources.d.ts.map +1 -1
- package/dist/index.js +448 -445
- package/dist/index.js.map +1 -1
- package/dist/locales/de.json +4 -0
- package/dist/locales/en.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/tokens.css +1 -1
- package/package.json +8 -2
- package/dist/_chunks/public-header.agent-BIBQzkeV.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-header.agent-BQ3r6Hgq.js","sources":["../../src/components/public-header/public-header.tsx","../../src/components/public-header/public-header.agent.ts"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* PublicHeader — anonymous / pre-auth site header. */\n/* */\n/* Distinct from the kit's `<Header>` (authenticated app shell): this */\n/* one is for booking-website, signature-website, marketing surfaces — */\n/* anywhere the chrome should read as continuous with `alfadocs.com`, */\n/* not as the logged-in app. */\n/* */\n/* DOM (default / transparent / dark variants): */\n/* <header role=banner data-component=public-header data-stuck=…> */\n/* <a aria-label=homeLabel>{logo}</a> */\n/* <Radix.NavigationMenu>…{navSlot}</Radix.NavigationMenu> ≥ md */\n/* <div class=actions>{actionsSlot}</div> ≥ md only */\n/* <IconButton menu trigger /> ↔ Sheet (partial drawer) < md only */\n/* </header> */\n/* */\n/* DOM (pill variant — matches alfadocs.com floating-pill header): */\n/* <header role=banner data-component=public-header> transparent */\n/* <div data-component=public-header-container> rounded */\n/* …same children as flat variants… */\n/* </div> */\n/* </header> */\n/* ------------------------------------------------------------------ */\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { ChevronDown, Menu, X } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';\nimport { IconButton } from '../button/icon-button';\nimport { Sheet } from '../sheet';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface PublicHeaderHandle {\n openMenu: () => void;\n closeMenu: () => void;\n getMenuOpen: () => boolean;\n}\n\nexport interface PublicHeaderProps\n extends\n Omit<ComponentPropsWithoutRef<'header'>, 'children'>,\n VariantProps<typeof rootVariants> {\n /** Logo lockup, typically `<Logo variant=\"wordmark\" tone=\"primary\" size=\"md\" />`. */\n logo: ReactNode;\n /** Optional href for the logo link. Defaults to `/`. */\n homeHref?: string;\n /** Accessible label for the logo link (falls back to `t('publicHeader.homeLabel')`). */\n homeLabel?: string;\n /** Primary nav links rendered inline ≥ md, collapsed into the mobile sheet below md. */\n navSlot?: ReactNode;\n /** Right-side actions (sign-in / register / role-switch CTAs). */\n actionsSlot?: ReactNode;\n /** Sticky behaviour. Default `none`. */\n sticky?: 'none' | 'top' | 'scroll-up';\n /** Pixel offset above which `sticky=\"scroll-up\"` engages and `transparent` fades to default. */\n stickyOffset?: number;\n /** Override the mobile menu trigger's accessible label (`t('publicHeader.openMenu')`). */\n menuLabel?: string;\n /** Override the navigation landmark label (`t('publicHeader.primaryNavLabel')`). */\n navLabel?: string;\n /** Consumer-supplied instance id, surfaced as `data-component-id`. */\n id?: string;\n}\n\nexport interface PublicHeaderNavLinkProps extends Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n 'children'\n> {\n href: string;\n active?: boolean;\n children: ReactNode;\n}\n\nexport interface PublicHeaderNavDropdownProps {\n /** Trigger label (the visible nav item text). */\n label: ReactNode;\n /**\n * `false` (default) renders a single-card dropdown anchored near the trigger\n * (Settori-style). `true` renders a wide multi-card mega-menu spanning the\n * pill's full inline width (Soluzioni-style).\n */\n wide?: boolean;\n /** Cards / content inside the dropdown panel. */\n children: ReactNode;\n /** Optional id; not required — used only for analytics / test selectors. */\n id?: string;\n}\n\nexport interface PublicHeaderDropdownCardProps {\n /**\n * Optional href — when provided the card title becomes a clickable\n * anchor with a `→` arrow indicator. Without href, the title is\n * a static heading (Settori-style).\n */\n href?: string;\n title: ReactNode;\n /** Optional subtitle / muted helper text under the title. */\n subtitle?: ReactNode;\n /** Sub-list contents (typically PublicHeader.DropdownLink children). */\n children?: ReactNode;\n}\n\nexport interface PublicHeaderDropdownLinkProps extends Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n 'children'\n> {\n href: string;\n active?: boolean;\n children: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Context — drives the rendering surface for nav subcomponents. */\n/* */\n/* The same navSlot is rendered twice: once inside the desktop Radix */\n/* NavigationMenu (≥ md, flyout mode) and once inside the mobile Sheet */\n/* drawer (< md, disclosure mode). NavLink / NavDropdown / DropdownCard */\n/* / DropdownLink switch their rendering off this flag so the mobile */\n/* tree doesn't depend on the Radix Root being present. */\n/* ------------------------------------------------------------------ */\n\ntype PublicHeaderSurface = 'desktop' | 'mobile';\n\nconst PublicHeaderSurfaceContext =\n createContext<PublicHeaderSurface>('desktop');\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n [\n 'ds:w-full ds:z-[var(--z-sticky)]',\n 'ds:transition-[background-color,box-shadow,transform] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n ].join(' '),\n {\n variants: {\n variant: {\n // Transparent fades to a solid pill chrome once data-stuck=\"true\"\n // (set by the rAF scroll listener). The fade is handled via the\n // same background utility so `data-stuck` swaps cleanly between\n // states.\n transparent: [\n 'ds:flex ds:items-center ds:gap-[var(--spacing-md)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]',\n 'ds:h-14 ds:md:h-16',\n 'ds:bg-transparent ds:text-[var(--foreground)]',\n 'ds:data-[stuck=true]:bg-[var(--card)]',\n 'ds:data-[stuck=true]:shadow-[var(--shadow-md)]',\n 'ds:forced-colors:border-b ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n // `dark` flips its own scope into the dark token set so nav\n // links + buttons inside read off-white text on the blue-800\n // surface. Without the `theme-dark` scope the children inherit\n // the light-theme `--foreground` (blue-500) and fail\n // color-contrast at ~1.3:1.\n dark: [\n 'ds:flex ds:items-center ds:gap-[var(--spacing-md)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]',\n 'ds:h-14 ds:md:h-16',\n 'theme-dark ds:bg-[var(--color-blue-800)] ds:text-[var(--foreground)]',\n ].join(' '),\n // `pill` matches alfadocs.com's floating rounded-pill header.\n // The outer header is fully transparent (no border, no bg) and\n // simply provides a top-side gutter so the inner container reads\n // as floating. The inner `data-component=\"public-header-container\"`\n // div is the visible chrome — border, rounded, card background.\n pill: [\n 'ds:bg-transparent',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-md)]',\n 'ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)] ds:sm:pt-[var(--spacing-md)]',\n ].join(' '),\n },\n sticky: {\n none: '',\n top: 'ds:sticky ds:top-0',\n // `scroll-up` is sticky but translates off-screen when scrolling\n // down past `stickyOffset` (handled by data-hidden=\"true\") and\n // slides back in when scrolling up.\n 'scroll-up': [\n 'ds:sticky ds:top-0',\n 'ds:data-[hidden=true]:-translate-y-full',\n ].join(' '),\n },\n },\n defaultVariants: { variant: 'pill', sticky: 'none' },\n },\n);\n\n// Inner pill chrome — only rendered when variant === 'pill'. The actual\n// \"header look\" (rounded, border, card surface) lives here so the outer\n// <header> can stay transparent and provide just the floating offset.\nconst pillContainerClasses = [\n 'ds:flex ds:items-center ds:gap-[var(--spacing-md)]',\n 'ds:w-full ds:max-w-[1400px] ds:mx-auto',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]',\n // 76px isn't a kit token; the closest is h-16 (64px) which reads tight\n // against alfadocs.com's chrome — keep an explicit min-block-size so\n // the pill reads as substantial without bloating beyond live reference.\n 'ds:min-h-16 ds:md:min-h-[76px]',\n 'ds:bg-[var(--card)] ds:text-[var(--foreground)]',\n 'ds:rounded-[var(--radius-lg)]',\n // Surface-border hairline shared with `Card`. Tuned to ~14% black\n // (light) / 16% white (dark) at the token level so the edge stays\n // visible against tinted page backgrounds — see `--card-border` in\n // `src/tokens/index.css`. Matches alfadocs.com's slate-200 reference\n // pill border without introducing a pill-specific token.\n 'ds:border ds:border-[color:var(--card-border)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n].join(' ');\n\nconst navLinkVariants = cva(\n [\n 'ds:inline-flex ds:items-center',\n 'type-body-sm ds:font-medium',\n // Muted-foreground reads as secondary text and matches alfadocs.com's\n // nav-link colour (`#545875`). `--foreground` was too dark vs the ref.\n 'ds:text-[var(--muted-foreground)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-xs)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:hover:text-[var(--primary)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:data-[active=true]:text-[var(--primary)]',\n 'ds:data-[active=true]:[box-shadow:inset_0_-2px_0_var(--primary)]',\n ].join(' '),\n);\n\n// Trigger styling shares the link look + adds the chevron rotation hook.\nconst dropdownTriggerClasses = [\n 'ds:group ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'type-body-sm ds:font-medium',\n // Mirror the navLinkVariants colour + inline padding so triggers and\n // plain links share weight, colour and target size.\n 'ds:text-[var(--muted-foreground)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:bg-transparent ds:border-0 ds:cursor-pointer',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-xs)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:hover:text-[var(--primary)]',\n 'ds:data-[state=open]:text-[var(--primary)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\nconst dropdownChevronClasses = [\n 'ds:size-3 ds:shrink-0',\n 'ds:transition-transform ds:duration-[var(--animation-duration)]',\n 'ds:group-data-[state=open]:rotate-180',\n 'ds:motion-reduce:transition-none',\n].join(' ');\n\nconst dropdownContentVariants = cva(\n [\n // Radix portals Content into the Viewport; sizing + position is\n // governed by the Viewport — keep Content's own paint to padding\n // + inner layout so motion / position stay consistent across\n // trigger placements.\n 'ds:data-[motion=from-start]:animate-in ds:data-[motion=from-start]:fade-in-0',\n 'ds:data-[motion=from-end]:animate-in ds:data-[motion=from-end]:fade-in-0',\n 'ds:data-[motion=to-start]:animate-out ds:data-[motion=to-start]:fade-out-0',\n 'ds:data-[motion=to-end]:animate-out ds:data-[motion=to-end]:fade-out-0',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n {\n variants: {\n wide: {\n true: [\n 'ds:grid ds:grid-cols-2 ds:lg:grid-cols-4',\n 'ds:gap-[var(--spacing-lg)]',\n 'ds:p-[var(--spacing-lg)]',\n 'ds:w-screen ds:max-w-[1400px]',\n ].join(' '),\n false: ['ds:p-[var(--spacing-md)]', 'ds:min-w-[280px]'].join(' '),\n },\n },\n defaultVariants: { wide: false },\n },\n);\n\nconst viewportClasses = [\n // Position the Viewport flush below the pill / nav row. Radix sets\n // `--radix-navigation-menu-viewport-width` and `…-height` so the\n // panel sizes itself to whichever Content is currently active.\n 'ds:absolute ds:top-full ds:start-1/2 ds:-translate-x-1/2',\n 'ds:mt-[var(--spacing-sm)]',\n 'ds:w-[var(--radix-navigation-menu-viewport-width)]',\n 'ds:h-[var(--radix-navigation-menu-viewport-height)]',\n 'ds:overflow-hidden',\n 'ds:bg-[var(--card)] ds:text-[var(--foreground)]',\n 'ds:rounded-[var(--radius-lg)] ds:border ds:border-[color:var(--border)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=open]:fade-in-0 ds:data-[state=closed]:fade-out-0',\n 'ds:data-[state=open]:zoom-in-95 ds:data-[state=closed]:zoom-out-95',\n 'ds:origin-top ds:transition-[width,height] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:animate-none ds:motion-reduce:transition-none',\n].join(' ');\n\nconst cardLinkClasses = [\n 'ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]',\n 'ds:no-underline ds:text-[var(--foreground)]',\n 'ds:pb-[var(--spacing-sm)]',\n // alfadocs.com renders the card header flush against the sub-list with\n // no separator rule — match that by dropping the border-b that earlier\n // versions of this component carried.\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:hover:[&_[data-card-title]]:text-[var(--primary)]',\n 'ds:hover:[&_[data-card-arrow]]:text-[var(--primary)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:group/cardlink',\n].join(' ');\n\nconst cardHeaderStaticClasses = [\n 'ds:pb-[var(--spacing-sm)]',\n // Match the linked-card variant: no separator rule under the title.\n].join(' ');\n\nconst subLinkClasses = [\n 'ds:block ds:no-underline',\n 'type-body-sm ds:font-medium ds:text-[var(--muted-foreground)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]',\n 'ds:hover:bg-[var(--muted)]/30 ds:hover:text-[var(--primary)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:data-[active=true]:text-[var(--primary)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Reduced motion */\n/* ------------------------------------------------------------------ */\n\nfunction usePrefersReducedMotion(): boolean {\n const [reduced, setReduced] = useState(() => {\n if (typeof window === 'undefined' || !window.matchMedia) return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n });\n useEffect(() => {\n if (typeof window === 'undefined' || !window.matchMedia) return;\n const mq = window.matchMedia('(prefers-reduced-motion: reduce)');\n const onChange = (): void => setReduced(mq.matches);\n mq.addEventListener('change', onChange);\n return () => mq.removeEventListener('change', onChange);\n }, []);\n return reduced;\n}\n\n/* ------------------------------------------------------------------ */\n/* Scroll listener */\n/* */\n/* rAF-throttled tracker for two flags on the header root: */\n/* - `data-stuck`: scrollY > stickyOffset (drives the transparent → */\n/* solid fade + the scroll-up shadow lift). */\n/* - `data-hidden`: scrolling DOWN past stickyOffset hides the header */\n/* via transform; scrolling UP slides it back. Only emitted when */\n/* `sticky === 'scroll-up'`. */\n/* ------------------------------------------------------------------ */\n\nfunction useHeaderScrollState(\n enabled: boolean,\n sticky: NonNullable<PublicHeaderProps['sticky']>,\n stickyOffset: number,\n): {\n stuck: boolean;\n hidden: boolean;\n} {\n const [stuck, setStuck] = useState(false);\n const [hidden, setHidden] = useState(false);\n const lastYRef = useRef(0);\n const tickingRef = useRef(false);\n\n useEffect(() => {\n if (!enabled || typeof window === 'undefined') return;\n lastYRef.current = window.scrollY;\n\n const update = (): void => {\n const y = window.scrollY;\n setStuck(y > stickyOffset);\n if (sticky === 'scroll-up') {\n const delta = y - lastYRef.current;\n // Hide on a meaningful downward delta past the offset; show on\n // any upward delta. 4px deadband keeps minor wheel inertia from\n // flapping the bar.\n if (delta > 4 && y > stickyOffset) setHidden(true);\n else if (delta < -4 || y <= stickyOffset) setHidden(false);\n }\n lastYRef.current = y;\n tickingRef.current = false;\n };\n const onScroll = (): void => {\n if (tickingRef.current) return;\n tickingRef.current = true;\n window.requestAnimationFrame(update);\n };\n window.addEventListener('scroll', onScroll, { passive: true });\n // Initial sync so we don't miss state when mounted past the offset.\n update();\n return () => {\n window.removeEventListener('scroll', onScroll);\n };\n }, [enabled, sticky, stickyOffset]);\n\n return { stuck, hidden };\n}\n\n/* ------------------------------------------------------------------ */\n/* Inner content (shared between flat + pill variants) */\n/* ------------------------------------------------------------------ */\n\ninterface InnerContentProps {\n logo: ReactNode;\n homeHref: string;\n resolvedHomeLabel: string;\n resolvedNavLabel: string;\n resolvedMenuLabel: string;\n navSlot?: ReactNode;\n actionsSlot?: ReactNode;\n menuOpen: boolean;\n setMenuOpen: (open: boolean) => void;\n sheetId: string;\n}\n\nfunction InnerContent({\n logo,\n homeHref,\n resolvedHomeLabel,\n resolvedNavLabel,\n resolvedMenuLabel,\n navSlot,\n actionsSlot,\n menuOpen,\n setMenuOpen,\n sheetId,\n}: InnerContentProps): React.JSX.Element {\n return (\n <>\n <a\n href={homeHref}\n aria-label={resolvedHomeLabel}\n className=\"ds:inline-flex ds:items-center ds:rounded-[var(--radius-sm)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]\"\n >\n {logo}\n </a>\n\n {navSlot ? (\n <PublicHeaderSurfaceContext.Provider value=\"desktop\">\n <NavigationMenuPrimitive.Root\n aria-label={resolvedNavLabel}\n // Radix wraps the List in an unstyled `<div>` between Root and\n // <ul>. The `[&>div:first-of-type]:flex` arbitrary selector\n // forces that wrapper into flex so the List's flex-1 actually\n // stretches it across the available width.\n className=\"ds:hidden ds:md:flex ds:relative ds:items-center ds:ms-[var(--spacing-lg)] ds:flex-1 ds:[&>div:first-of-type]:flex ds:[&>div:first-of-type]:flex-1\"\n delayDuration={150}\n >\n <NavigationMenuPrimitive.List className=\"ds:flex ds:flex-1 ds:items-center ds:justify-center ds:gap-[var(--spacing-md)] ds:list-none ds:m-0 ds:ps-0\">\n {navSlot}\n </NavigationMenuPrimitive.List>\n {/* Viewport renders the active panel below the nav row. The\n wrapper centres it horizontally relative to the trigger row;\n Radix sets viewport-width/-height vars so the panel sizes\n to whichever Content is open. */}\n <div className=\"ds:absolute ds:top-full ds:start-0 ds:end-0 ds:flex ds:justify-center ds:pointer-events-none\">\n <div className=\"ds:pointer-events-auto\">\n <NavigationMenuPrimitive.Viewport className={viewportClasses} />\n </div>\n </div>\n </NavigationMenuPrimitive.Root>\n </PublicHeaderSurfaceContext.Provider>\n ) : null}\n\n {actionsSlot ? (\n <div className=\"ds:hidden ds:md:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:ms-auto\">\n {actionsSlot}\n </div>\n ) : null}\n\n {/* Mobile menu trigger (< md). Wired to a Sheet (partial drawer\n from inline-end) so navSlot + actionsSlot collapse there. */}\n <Sheet open={menuOpen} onOpenChange={setMenuOpen}>\n <Sheet.Trigger asChild>\n <IconButton\n size=\"md\"\n intent=\"ghost\"\n className=\"ds:ms-auto ds:md:hidden\"\n icon={\n menuOpen ? <X aria-hidden=\"true\" /> : <Menu aria-hidden=\"true\" />\n }\n aria-controls={sheetId}\n aria-expanded={menuOpen}\n aria-label={resolvedMenuLabel}\n />\n </Sheet.Trigger>\n <Sheet.Content side=\"end\" size=\"md\" id={sheetId}>\n <Sheet.Header>\n <Sheet.Title>{resolvedNavLabel}</Sheet.Title>\n </Sheet.Header>\n <Sheet.Body>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {navSlot ? (\n <PublicHeaderSurfaceContext.Provider value=\"mobile\">\n <nav\n aria-label={resolvedNavLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n data-mobile-nav=\"true\"\n >\n {navSlot}\n </nav>\n </PublicHeaderSurfaceContext.Provider>\n ) : null}\n {actionsSlot ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:mt-[var(--spacing-md)]\">\n {actionsSlot}\n </div>\n ) : null}\n </div>\n </Sheet.Body>\n </Sheet.Content>\n </Sheet>\n </>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nconst PublicHeaderRoot = forwardRef<HTMLElement, PublicHeaderProps>(\n (\n {\n logo,\n homeHref = '/',\n homeLabel,\n navSlot,\n actionsSlot,\n variant = 'pill',\n sticky = 'none',\n stickyOffset = 80,\n menuLabel,\n navLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const reduced = usePrefersReducedMotion();\n const autoId = useId();\n const sheetId = `${id ?? autoId}-sheet`;\n const [menuOpen, setMenuOpen] = useState(false);\n\n // Scroll listener is only active when `transparent` or `scroll-up`\n // need it. Hidden state is disabled under reduced motion (the bar\n // stays visible — translating off-screen is precisely the motion\n // class of user the preference targets).\n const scrollEnabled = variant === 'transparent' || sticky === 'scroll-up';\n const { stuck, hidden } = useHeaderScrollState(\n scrollEnabled,\n sticky,\n stickyOffset,\n );\n const effectiveHidden = reduced ? false : hidden;\n\n const openMenu = useCallback((): void => setMenuOpen(true), []);\n const closeMenu = useCallback((): void => setMenuOpen(false), []);\n\n useImperativeHandle(\n ref as React.Ref<PublicHeaderHandle> | null | undefined,\n () => ({\n openMenu,\n closeMenu,\n getMenuOpen: () => menuOpen,\n }),\n [openMenu, closeMenu, menuOpen],\n );\n\n const resolvedHomeLabel =\n homeLabel ?? t('publicHeader.homeLabel', 'AlfaDocs — home');\n const resolvedNavLabel =\n navLabel ?? t('publicHeader.primaryNavLabel', 'Primary');\n const resolvedMenuLabel =\n menuLabel ??\n (menuOpen\n ? t('publicHeader.closeMenu', 'Close menu')\n : t('publicHeader.openMenu', 'Open menu'));\n\n const innerProps: InnerContentProps = {\n logo,\n homeHref,\n resolvedHomeLabel,\n resolvedNavLabel,\n resolvedMenuLabel,\n navSlot,\n actionsSlot,\n menuOpen,\n setMenuOpen,\n sheetId,\n };\n\n return (\n <header\n {...rest}\n data-component=\"public-header\"\n data-component-id={id}\n data-variant={variant}\n data-stuck={stuck ? 'true' : undefined}\n data-hidden={effectiveHidden ? 'true' : undefined}\n data-state={reduced ? 'reduced-motion' : undefined}\n className={rootVariants({ variant, sticky, className })}\n >\n {variant === 'pill' ? (\n <div\n data-component=\"public-header-container\"\n className={pillContainerClasses}\n >\n <InnerContent {...innerProps} />\n </div>\n ) : (\n <InnerContent {...innerProps} />\n )}\n </header>\n );\n },\n);\nPublicHeaderRoot.displayName = 'PublicHeader';\n\n/* ------------------------------------------------------------------ */\n/* NavLink */\n/* ------------------------------------------------------------------ */\n\nconst PublicHeaderNavLink = forwardRef<\n HTMLAnchorElement,\n PublicHeaderNavLinkProps\n>(({ active, className, children, ...rest }, ref) => {\n const surface = useContext(PublicHeaderSurfaceContext);\n // Desktop: NavigationMenu.Item + .Link give Radix the keyboard / focus\n // semantics across the trigger row. We render the actual <a> via\n // asChild so consumers can swap in router links transparently.\n // Mobile: plain <a> inside the Sheet's <nav> — no Radix Root in scope,\n // so we render outside the NavigationMenu primitive.\n if (surface === 'mobile') {\n return (\n <a\n ref={ref}\n {...rest}\n data-active={active ? 'true' : undefined}\n aria-current={active ? 'page' : undefined}\n className={[\n 'ds:block ds:no-underline',\n 'type-body-sm ds:font-medium',\n 'ds:text-[var(--foreground)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]',\n 'ds:hover:bg-[var(--muted)]/30 ds:hover:text-[var(--primary)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:data-[active=true]:text-[var(--primary)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </a>\n );\n }\n return (\n <NavigationMenuPrimitive.Item>\n <NavigationMenuPrimitive.Link asChild active={active}>\n <a\n ref={ref}\n {...rest}\n data-active={active ? 'true' : undefined}\n aria-current={active ? 'page' : undefined}\n className={[navLinkVariants(), className].filter(Boolean).join(' ')}\n >\n {children}\n </a>\n </NavigationMenuPrimitive.Link>\n </NavigationMenuPrimitive.Item>\n );\n});\nPublicHeaderNavLink.displayName = 'PublicHeader.NavLink';\n\n/* ------------------------------------------------------------------ */\n/* NavDropdown */\n/* ------------------------------------------------------------------ */\n\nconst PublicHeaderNavDropdown = forwardRef<\n ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n PublicHeaderNavDropdownProps\n>(({ label, wide = false, children, id }, ref) => {\n const surface = useContext(PublicHeaderSurfaceContext);\n if (surface === 'mobile') {\n // <details>/<summary> gives semantic disclosure for free —\n // Enter/Space toggles, summary is focusable, content collapses\n // when not open. No JS needed.\n return (\n <details\n id={id}\n data-component=\"public-header-nav-dropdown\"\n className=\"ds:group ds:border-b ds:border-[color:var(--border)]\"\n >\n <summary\n className={[\n 'ds:flex ds:items-center ds:justify-between ds:cursor-pointer',\n 'type-body-sm ds:font-medium ds:text-[var(--foreground)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:list-none ds:[&::-webkit-details-marker]:hidden',\n ].join(' ')}\n >\n <span>{label}</span>\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ds:size-3 ds:shrink-0 ds:transition-transform ds:duration-[var(--animation-duration)] ds:group-[[open]]:rotate-180 ds:motion-reduce:transition-none\"\n />\n </summary>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]\">\n {children}\n </div>\n </details>\n );\n }\n return (\n <NavigationMenuPrimitive.Item data-component=\"public-header-nav-dropdown\">\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n id={id}\n className={dropdownTriggerClasses}\n // Radix already wires aria-expanded + aria-controls. The\n // group / data-state hooks let the chevron rotate via Tailwind.\n >\n {label}\n <ChevronDown aria-hidden=\"true\" className={dropdownChevronClasses} />\n </NavigationMenuPrimitive.Trigger>\n <NavigationMenuPrimitive.Content\n className={dropdownContentVariants({ wide })}\n >\n {children}\n </NavigationMenuPrimitive.Content>\n </NavigationMenuPrimitive.Item>\n );\n});\nPublicHeaderNavDropdown.displayName = 'PublicHeader.NavDropdown';\n\n/* ------------------------------------------------------------------ */\n/* DropdownCard */\n/* ------------------------------------------------------------------ */\n\nconst PublicHeaderDropdownCard = forwardRef<\n HTMLDivElement,\n PublicHeaderDropdownCardProps\n>(({ href, title, subtitle, children }, ref) => {\n const surface = useContext(PublicHeaderSurfaceContext);\n // The Card header. In mobile we render a plain <a> when href is set —\n // no Radix Link wrapper because the NavigationMenu root isn't in scope\n // inside the Sheet.\n const titleNode = (\n <span\n data-card-title\n className=\"type-title-card ds:text-[var(--foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none\"\n >\n {title}\n </span>\n );\n const subtitleNode = subtitle ? (\n <span className=\"type-body-sm ds:text-[var(--muted-foreground)]\">\n {subtitle}\n </span>\n ) : null;\n\n const arrow = (\n <span\n data-card-arrow\n aria-hidden=\"true\"\n className=\"ds:flex-none ds:text-[var(--muted-foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:rtl:-scale-x-100\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n </span>\n );\n\n const linkInner = (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {titleNode}\n {subtitleNode}\n </div>\n {arrow}\n </>\n );\n\n let header: React.JSX.Element;\n if (href) {\n if (surface === 'mobile') {\n header = (\n <a href={href} className={cardLinkClasses}>\n {linkInner}\n </a>\n );\n } else {\n header = (\n <NavigationMenuPrimitive.Link asChild>\n <a href={href} className={cardLinkClasses}>\n {linkInner}\n </a>\n </NavigationMenuPrimitive.Link>\n );\n }\n } else {\n header = (\n <div className={cardHeaderStaticClasses}>\n {titleNode}\n {subtitle ? (\n <span className=\"ds:block type-body-sm ds:text-[var(--muted-foreground)] ds:mt-[var(--spacing-xs)]\">\n {subtitle}\n </span>\n ) : null}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n data-component=\"public-header-dropdown-card\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n {header}\n {children ? (\n <ul className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:list-none ds:m-0 ds:ps-0\">\n {children}\n </ul>\n ) : null}\n </div>\n );\n});\nPublicHeaderDropdownCard.displayName = 'PublicHeader.DropdownCard';\n\n/* ------------------------------------------------------------------ */\n/* DropdownLink */\n/* ------------------------------------------------------------------ */\n\nconst PublicHeaderDropdownLink = forwardRef<\n HTMLAnchorElement,\n PublicHeaderDropdownLinkProps\n>(({ active, className, children, ...rest }, ref) => {\n const surface = useContext(PublicHeaderSurfaceContext);\n const anchor = (\n <a\n ref={ref}\n {...rest}\n data-active={active ? 'true' : undefined}\n aria-current={active ? 'page' : undefined}\n className={[subLinkClasses, className].filter(Boolean).join(' ')}\n >\n {children}\n </a>\n );\n return (\n <li data-component=\"public-header-dropdown-link\">\n {surface === 'mobile' ? (\n anchor\n ) : (\n <NavigationMenuPrimitive.Link asChild active={active}>\n {anchor}\n </NavigationMenuPrimitive.Link>\n )}\n </li>\n );\n});\nPublicHeaderDropdownLink.displayName = 'PublicHeader.DropdownLink';\n\n/* ------------------------------------------------------------------ */\n/* Public surface */\n/* ------------------------------------------------------------------ */\n\nexport const PublicHeader = Object.assign(PublicHeaderRoot, {\n NavLink: PublicHeaderNavLink,\n NavDropdown: PublicHeaderNavDropdown,\n DropdownCard: PublicHeaderDropdownCard,\n DropdownLink: PublicHeaderDropdownLink,\n});\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PublicHeaderHandle } from './public-header';\n\nexport const publicHeaderAgent: AgentAdapter<PublicHeaderHandle> = {\n id: 'public-header',\n capabilities: ['open', 'close'],\n state: {\n menuOpen: {\n type: 'boolean',\n description: 'Whether the mobile drawer is currently open.',\n read: (handle) => handle.getMenuOpen(),\n },\n },\n actions: {\n open_menu: {\n safety: 'read',\n description: 'Open the mobile drawer.',\n invoke: (handle) => {\n handle.openMenu();\n },\n },\n close_menu: {\n safety: 'read',\n description: 'Close the mobile drawer.',\n invoke: (handle) => {\n handle.closeMenu();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'public-header' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop on PublicHeader.',\n },\n },\n};\n"],"names":["PublicHeaderSurfaceContext","createContext","rootVariants","cva","pillContainerClasses","navLinkVariants","dropdownTriggerClasses","dropdownChevronClasses","dropdownContentVariants","viewportClasses","cardLinkClasses","cardHeaderStaticClasses","subLinkClasses","usePrefersReducedMotion","reduced","setReduced","useState","useEffect","mq","onChange","useHeaderScrollState","enabled","sticky","stickyOffset","stuck","setStuck","hidden","setHidden","lastYRef","useRef","tickingRef","update","y","delta","onScroll","InnerContent","logo","homeHref","resolvedHomeLabel","resolvedNavLabel","resolvedMenuLabel","navSlot","actionsSlot","menuOpen","setMenuOpen","sheetId","jsxs","Fragment","jsx","NavigationMenuPrimitive","Sheet","IconButton","X","Menu","PublicHeaderRoot","forwardRef","homeLabel","variant","menuLabel","navLabel","id","className","rest","ref","t","useTranslation","autoId","useId","scrollEnabled","effectiveHidden","openMenu","useCallback","closeMenu","useImperativeHandle","innerProps","PublicHeaderNavLink","active","children","useContext","PublicHeaderNavDropdown","label","wide","ChevronDown","PublicHeaderDropdownCard","href","title","subtitle","surface","titleNode","linkInner","header","PublicHeaderDropdownLink","anchor","PublicHeader","publicHeaderAgent","handle"],"mappings":";;;;;;;;;;AA6IA,MAAMA,IACJC,EAAmC,SAAS,GAMxCC,KAAeC;AAAA,EACnB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,QAKP,aAAa;AAAA,UACX;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMV,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMV,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,MAAA;AAAA,MAEZ,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA;AAAA;AAAA;AAAA,QAIL,aAAa;AAAA,UACX;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,iBAAiB,EAAE,SAAS,QAAQ,QAAQ,OAAA;AAAA,EAAO;AAEvD,GAKMC,KAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG,GAEJC,KAAkBF;AAAA,EACtB;AAAA,IACE;AAAA,IACA;AAAA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,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,SAASqB;AAAA,EACT,aAAaI;AAAA,EACb,cAAcI;AAAA,EACd,cAAcQ;AAChB,CAAC,GCx5BYG,KAAsD;AAAA,EACjE,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,OAAO;AAAA,EAC9B,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,EACvC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,SAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,YAAY;AAAA,MACV,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,UAAA;AAAA,MACT;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,MAAM,EAAE,MAAM,kBAAkB,OAAO,gBAAA;AAAA,IACvC,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ;"}
|
package/dist/_chunks/{use-password-requirements-BOgFsoIe.js → use-password-requirements-C9vKBSVn.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as g, jsx as
|
|
2
|
-
import { forwardRef as ts, useRef as as, useState as C, useEffect as is, useCallback as p, useMemo as
|
|
3
|
-
import { c as
|
|
1
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ts, useRef as as, useState as C, useEffect as is, useCallback as p, useMemo as L } from "react";
|
|
3
|
+
import { c as I } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as W } from "react-i18next";
|
|
5
5
|
import { T as rs } from "./text-input-CakysYnD.js";
|
|
6
6
|
import { u as ns } from "./form-field-context-B3APVHKx.js";
|
|
@@ -100,7 +100,7 @@ const fs = [
|
|
|
100
100
|
sm: "ds:size-4",
|
|
101
101
|
md: "ds:size-[18px]",
|
|
102
102
|
lg: "ds:size-5"
|
|
103
|
-
}, bs =
|
|
103
|
+
}, bs = I(
|
|
104
104
|
[
|
|
105
105
|
"ds:absolute ds:inset-y-0 ds:end-0 ds:ps-2 ds:pe-3",
|
|
106
106
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
@@ -114,9 +114,9 @@ const fs = [
|
|
|
114
114
|
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
115
115
|
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
|
|
116
116
|
].join(" ")
|
|
117
|
-
), vs =
|
|
117
|
+
), vs = I(
|
|
118
118
|
"ds:h-1 ds:w-full ds:overflow-hidden ds:rounded-[var(--radius-full)] ds:bg-muted"
|
|
119
|
-
), ys =
|
|
119
|
+
), ys = I(
|
|
120
120
|
[
|
|
121
121
|
"ds:h-full ds:rounded-[var(--radius-full)]",
|
|
122
122
|
"ds:transition-all ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
@@ -137,7 +137,7 @@ const fs = [
|
|
|
137
137
|
1: "fair",
|
|
138
138
|
2: "good",
|
|
139
139
|
3: "strong"
|
|
140
|
-
}, ks =
|
|
140
|
+
}, ks = I(
|
|
141
141
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-meta",
|
|
142
142
|
{
|
|
143
143
|
variants: {
|
|
@@ -157,128 +157,128 @@ const fs = [
|
|
|
157
157
|
deriveStrength: u = !1,
|
|
158
158
|
autoComplete: w,
|
|
159
159
|
size: h = "md",
|
|
160
|
-
disabled:
|
|
161
|
-
name:
|
|
162
|
-
id:
|
|
163
|
-
onKeyDown:
|
|
164
|
-
onKeyUp:
|
|
165
|
-
onBlur:
|
|
166
|
-
onInput:
|
|
160
|
+
disabled: b,
|
|
161
|
+
name: o,
|
|
162
|
+
id: t,
|
|
163
|
+
onKeyDown: v,
|
|
164
|
+
onKeyUp: y,
|
|
165
|
+
onBlur: x,
|
|
166
|
+
onInput: k,
|
|
167
167
|
defaultValue: T,
|
|
168
168
|
value: m,
|
|
169
169
|
className: $,
|
|
170
170
|
...B
|
|
171
171
|
}, G) => {
|
|
172
|
-
const { t: f } = W(), M = ns().disabled ||
|
|
172
|
+
const { t: f } = W(), M = ns().disabled || b, N = as(null), J = os(G, N), [c, j] = C(!1), [Q, A] = C(!1), [_, H] = C(() => typeof m == "string" ? m : typeof T == "string" ? T : "");
|
|
173
173
|
is(() => {
|
|
174
174
|
typeof m == "string" && H(m);
|
|
175
175
|
}, [m]);
|
|
176
176
|
const X = p(
|
|
177
177
|
(s) => {
|
|
178
|
-
H(s.currentTarget.value),
|
|
178
|
+
H(s.currentTarget.value), k == null || k(s);
|
|
179
179
|
},
|
|
180
|
-
[
|
|
180
|
+
[k]
|
|
181
181
|
), z = p((s) => {
|
|
182
182
|
var R;
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
185
|
-
const
|
|
186
|
-
|
|
183
|
+
const a = N.current;
|
|
184
|
+
if (!a) return;
|
|
185
|
+
const O = Object.getPrototypeOf(a), P = (R = Object.getOwnPropertyDescriptor(O, "value")) == null ? void 0 : R.set;
|
|
186
|
+
P == null || P.call(a, s), a.dispatchEvent(new Event("input", { bubbles: !0 })), a.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
187
187
|
}, []), Y = p(() => {
|
|
188
188
|
j((s) => {
|
|
189
|
-
const
|
|
190
|
-
return e == null || e(
|
|
189
|
+
const a = !s;
|
|
190
|
+
return e == null || e(a), a;
|
|
191
191
|
});
|
|
192
|
-
}, [e]),
|
|
192
|
+
}, [e]), V = p((s) => {
|
|
193
193
|
typeof s.getModifierState == "function" && A(s.getModifierState("CapsLock"));
|
|
194
194
|
}, []), Z = p(
|
|
195
195
|
(s) => {
|
|
196
|
-
|
|
196
|
+
V(s), v == null || v(s);
|
|
197
197
|
},
|
|
198
|
-
[
|
|
199
|
-
),
|
|
198
|
+
[V, v]
|
|
199
|
+
), q = p(
|
|
200
200
|
(s) => {
|
|
201
|
-
|
|
201
|
+
V(s), y == null || y(s);
|
|
202
202
|
},
|
|
203
|
-
[
|
|
204
|
-
),
|
|
203
|
+
[V, y]
|
|
204
|
+
), D = p(
|
|
205
205
|
(s) => {
|
|
206
|
-
A(!1),
|
|
206
|
+
A(!1), x == null || x(s);
|
|
207
207
|
},
|
|
208
|
-
[
|
|
209
|
-
), U =
|
|
208
|
+
[x]
|
|
209
|
+
), U = L(
|
|
210
210
|
() => ({
|
|
211
211
|
getValue: () => {
|
|
212
212
|
var s;
|
|
213
|
-
return ((s =
|
|
213
|
+
return ((s = N.current) == null ? void 0 : s.value) ?? "";
|
|
214
214
|
},
|
|
215
215
|
setValue: (s) => z(s),
|
|
216
216
|
clear: () => z(""),
|
|
217
217
|
focus: () => {
|
|
218
218
|
var s;
|
|
219
|
-
return (s =
|
|
219
|
+
return (s = N.current) == null ? void 0 : s.focus();
|
|
220
220
|
},
|
|
221
221
|
isRevealed: () => c,
|
|
222
222
|
toggleVisibility: () => {
|
|
223
223
|
j((s) => {
|
|
224
|
-
const
|
|
225
|
-
return e == null || e(
|
|
224
|
+
const a = !s;
|
|
225
|
+
return e == null || e(a), a;
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
}),
|
|
229
229
|
[e, c, z]
|
|
230
230
|
);
|
|
231
|
-
ds(hs, U,
|
|
231
|
+
ds(hs, U, t);
|
|
232
232
|
const F = ws[h], ss = f(
|
|
233
233
|
c ? "inputs.password.toggleHide" : "inputs.password.toggleShow",
|
|
234
234
|
c ? "Hide password" : "Show password"
|
|
235
|
-
),
|
|
235
|
+
), d = L(
|
|
236
236
|
() => (l == null ? void 0 : l.map((s) => ({
|
|
237
237
|
...s,
|
|
238
238
|
met: s.test(_)
|
|
239
239
|
}))) ?? null,
|
|
240
240
|
[l, _]
|
|
241
|
-
), es =
|
|
242
|
-
if (!u || !(
|
|
243
|
-
const s =
|
|
244
|
-
return Math.min(3, Math.floor(s /
|
|
245
|
-
}, [u,
|
|
246
|
-
`inputs.password.strength.${
|
|
247
|
-
|
|
241
|
+
), es = L(() => {
|
|
242
|
+
if (!u || !(d != null && d.length)) return 0;
|
|
243
|
+
const s = d.filter((O) => O.met).length, a = d.length;
|
|
244
|
+
return Math.min(3, Math.floor(s / a * 4));
|
|
245
|
+
}, [u, d]), E = n !== void 0 ? n : u ? es : 0, S = xs[E], K = f(
|
|
246
|
+
`inputs.password.strength.${S}`,
|
|
247
|
+
S.charAt(0).toUpperCase() + S.slice(1)
|
|
248
248
|
);
|
|
249
249
|
return /* @__PURE__ */ g(
|
|
250
250
|
"div",
|
|
251
251
|
{
|
|
252
252
|
"data-component": "password-input",
|
|
253
|
-
"data-component-id":
|
|
253
|
+
"data-component-id": t,
|
|
254
254
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
255
255
|
children: [
|
|
256
256
|
/* @__PURE__ */ g("div", { className: "ds:relative", children: [
|
|
257
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ i(
|
|
258
258
|
rs,
|
|
259
259
|
{
|
|
260
260
|
ref: J,
|
|
261
|
-
id:
|
|
261
|
+
id: t,
|
|
262
262
|
type: c ? "text" : "password",
|
|
263
263
|
autoComplete: w ?? "current-password",
|
|
264
|
-
name:
|
|
264
|
+
name: o ?? "password",
|
|
265
265
|
spellCheck: !1,
|
|
266
266
|
autoCapitalize: "none",
|
|
267
267
|
autoCorrect: "off",
|
|
268
268
|
size: h,
|
|
269
269
|
disabled: M,
|
|
270
270
|
onKeyDown: Z,
|
|
271
|
-
onKeyUp:
|
|
272
|
-
onBlur:
|
|
271
|
+
onKeyUp: q,
|
|
272
|
+
onBlur: D,
|
|
273
273
|
onInput: X,
|
|
274
274
|
value: m,
|
|
275
275
|
defaultValue: T,
|
|
276
|
-
endAdornment: /* @__PURE__ */
|
|
276
|
+
endAdornment: /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "ds:block ds:size-4" }),
|
|
277
277
|
className: $,
|
|
278
278
|
...B
|
|
279
279
|
}
|
|
280
280
|
),
|
|
281
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ i(
|
|
282
282
|
"button",
|
|
283
283
|
{
|
|
284
284
|
type: "button",
|
|
@@ -287,11 +287,11 @@ const fs = [
|
|
|
287
287
|
disabled: M,
|
|
288
288
|
onClick: Y,
|
|
289
289
|
className: bs(),
|
|
290
|
-
children: c ? /* @__PURE__ */
|
|
290
|
+
children: c ? /* @__PURE__ */ i(ls, { "aria-hidden": "true", className: F }) : /* @__PURE__ */ i(gs, { "aria-hidden": "true", className: F })
|
|
291
291
|
}
|
|
292
292
|
)
|
|
293
293
|
] }),
|
|
294
|
-
|
|
294
|
+
d && d.length > 0 ? (
|
|
295
295
|
// `role="list"` / `role="listitem"` are set explicitly even
|
|
296
296
|
// though they're the implicit roles on <ul>/<li> — Safari
|
|
297
297
|
// VoiceOver strips the implicit list role when CSS sets
|
|
@@ -305,14 +305,14 @@ const fs = [
|
|
|
305
305
|
// alone wouldn't trigger an announcement — the sr-only span
|
|
306
306
|
// is the load-bearing piece for AT users.
|
|
307
307
|
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ i(
|
|
309
309
|
"ul",
|
|
310
310
|
{
|
|
311
311
|
role: "list",
|
|
312
312
|
"aria-live": "polite",
|
|
313
313
|
"data-component": "password-requirements",
|
|
314
314
|
className: "ds:list-none ds:m-0 ds:p-0 ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
315
|
-
children:
|
|
315
|
+
children: d.map((s) => (
|
|
316
316
|
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
317
317
|
/* @__PURE__ */ g(
|
|
318
318
|
"li",
|
|
@@ -321,20 +321,20 @@ const fs = [
|
|
|
321
321
|
"data-state": s.met ? "met" : "unmet",
|
|
322
322
|
className: ks({ met: s.met }),
|
|
323
323
|
children: [
|
|
324
|
-
s.met ? /* @__PURE__ */
|
|
324
|
+
s.met ? /* @__PURE__ */ i(
|
|
325
325
|
ps,
|
|
326
326
|
{
|
|
327
327
|
"aria-hidden": "true",
|
|
328
328
|
className: "ds:size-3.5 ds:text-success ds:shrink-0"
|
|
329
329
|
}
|
|
330
|
-
) : /* @__PURE__ */
|
|
330
|
+
) : /* @__PURE__ */ i(
|
|
331
331
|
us,
|
|
332
332
|
{
|
|
333
333
|
"aria-hidden": "true",
|
|
334
334
|
className: "ds:size-3.5 ds:shrink-0"
|
|
335
335
|
}
|
|
336
336
|
),
|
|
337
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ i("span", { children: s.label }),
|
|
338
338
|
/* @__PURE__ */ g("span", { className: "ds:sr-only", children: [
|
|
339
339
|
" — ",
|
|
340
340
|
s.met ? f("inputs.password.requirements.met", "met") : f("inputs.password.requirements.unmet", "not yet met")
|
|
@@ -354,13 +354,13 @@ const fs = [
|
|
|
354
354
|
"aria-live": "polite",
|
|
355
355
|
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-meta ds:text-warning",
|
|
356
356
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ i(ms, { "aria-hidden": "true", className: "ds:size-3.5" }),
|
|
358
358
|
f("inputs.password.capsLock", "Caps Lock is on")
|
|
359
359
|
]
|
|
360
360
|
}
|
|
361
361
|
) : null,
|
|
362
362
|
r ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
363
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ i(
|
|
364
364
|
"div",
|
|
365
365
|
{
|
|
366
366
|
role: "progressbar",
|
|
@@ -373,7 +373,7 @@ const fs = [
|
|
|
373
373
|
),
|
|
374
374
|
"aria-valuetext": K,
|
|
375
375
|
className: vs(),
|
|
376
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ i(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
379
379
|
className: ys({ level: E })
|
|
@@ -381,7 +381,7 @@ const fs = [
|
|
|
381
381
|
)
|
|
382
382
|
}
|
|
383
383
|
),
|
|
384
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ i(
|
|
385
385
|
"span",
|
|
386
386
|
{
|
|
387
387
|
"aria-hidden": "true",
|
|
@@ -397,47 +397,58 @@ const fs = [
|
|
|
397
397
|
);
|
|
398
398
|
Ns.displayName = "PasswordInput";
|
|
399
399
|
function Hs(e = {}) {
|
|
400
|
-
const { t: r } = W(), { minLength: n, uppercase: l, lowercase: u, digit: w, symbol: h } = e;
|
|
401
|
-
return
|
|
402
|
-
const
|
|
403
|
-
return typeof n == "number" && n > 0 &&
|
|
400
|
+
const { t: r } = W(), { minLength: n, uppercase: l, lowercase: u, digit: w, symbol: h, noSpaces: b } = e;
|
|
401
|
+
return L(() => {
|
|
402
|
+
const o = [];
|
|
403
|
+
return typeof n == "number" && n > 0 && o.push({
|
|
404
404
|
id: "length",
|
|
405
405
|
label: r("inputs.password.requirements.length", {
|
|
406
406
|
count: n,
|
|
407
407
|
defaultValue: `At least ${n} characters`
|
|
408
408
|
}),
|
|
409
|
-
test: (
|
|
410
|
-
}), l &&
|
|
409
|
+
test: (t) => t.length >= n
|
|
410
|
+
}), l && o.push({
|
|
411
411
|
id: "uppercase",
|
|
412
412
|
label: r(
|
|
413
413
|
"inputs.password.requirements.uppercase",
|
|
414
414
|
"One uppercase letter"
|
|
415
415
|
),
|
|
416
|
-
test: (
|
|
417
|
-
}), u &&
|
|
416
|
+
test: (t) => new RegExp("\\p{Lu}", "u").test(t)
|
|
417
|
+
}), u && o.push({
|
|
418
418
|
id: "lowercase",
|
|
419
419
|
label: r(
|
|
420
420
|
"inputs.password.requirements.lowercase",
|
|
421
421
|
"One lowercase letter"
|
|
422
422
|
),
|
|
423
|
-
test: (
|
|
424
|
-
}), w &&
|
|
423
|
+
test: (t) => new RegExp("\\p{Ll}", "u").test(t)
|
|
424
|
+
}), w && o.push({
|
|
425
425
|
id: "digit",
|
|
426
426
|
label: r("inputs.password.requirements.digit", "One number"),
|
|
427
|
-
test: (
|
|
428
|
-
}), h &&
|
|
427
|
+
test: (t) => new RegExp("\\p{Nd}", "u").test(t)
|
|
428
|
+
}), h && o.push({
|
|
429
429
|
id: "symbol",
|
|
430
430
|
label: r("inputs.password.requirements.symbol", "One symbol"),
|
|
431
431
|
// Anything that isn't a letter, number, or whitespace counts.
|
|
432
432
|
// `\p{L}` + `\p{N}` keep this Unicode-aware so non-Latin
|
|
433
433
|
// alphabets (Arabic, Chinese, …) aren't mis-classified as
|
|
434
434
|
// symbols.
|
|
435
|
-
test: (
|
|
436
|
-
}),
|
|
437
|
-
|
|
435
|
+
test: (t) => /[^\p{L}\p{N}\s]/u.test(t)
|
|
436
|
+
}), b && o.push({
|
|
437
|
+
id: "no-spaces",
|
|
438
|
+
label: r("inputs.password.requirements.noSpaces", "No spaces"),
|
|
439
|
+
// `\s` covers ASCII space + tab + newline. The explicit
|
|
440
|
+
// U+00A0 (non-breaking space) and U+202F (narrow no-break
|
|
441
|
+
// space) catch the two paste-time characters credential
|
|
442
|
+
// managers and rich-text editors most often inject without
|
|
443
|
+
// the user noticing — those are NOT always in `\s`.
|
|
444
|
+
// Authored via hex escapes (not literal characters) so the
|
|
445
|
+
// source file passes `no-irregular-whitespace`.
|
|
446
|
+
test: (t) => !/[\s\u00A0\u202F]/.test(t)
|
|
447
|
+
}), o;
|
|
448
|
+
}, [r, n, l, u, w, h, b]);
|
|
438
449
|
}
|
|
439
450
|
export {
|
|
440
451
|
Ns as P,
|
|
441
452
|
Hs as u
|
|
442
453
|
};
|
|
443
|
-
//# sourceMappingURL=use-password-requirements-
|
|
454
|
+
//# sourceMappingURL=use-password-requirements-C9vKBSVn.js.map
|