@nswds/ui 5.3.0 → 5.5.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/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +80 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/avatar.d.ts +13 -0
- package/dist/components/avatar.js +92 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +94 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.d.ts +15 -0
- package/dist/components/button-group.js +77 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +1 -1
- package/dist/components/carousel.d.ts +34 -0
- package/dist/components/carousel.js +186 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/checkbox.d.ts +6 -0
- package/dist/components/checkbox.js +31 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/combobox.d.ts +26 -0
- package/dist/components/combobox.js +242 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/direction.d.ts +1 -0
- package/dist/components/direction.js +4 -0
- package/dist/components/direction.js.map +1 -0
- package/dist/components/header.d.ts +1 -1
- package/dist/components/header.js +37 -9
- package/dist/components/header.js.map +1 -1
- package/dist/components/input-group.d.ts +23 -0
- package/dist/components/input-group.js +136 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +13 -0
- package/dist/components/input-otp.js +79 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +30 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/logo.d.ts +15 -1
- package/dist/components/logo.js +59 -50
- package/dist/components/logo.js.map +1 -1
- package/dist/components/masthead.d.ts +1 -1
- package/dist/components/native-select.d.ts +10 -0
- package/dist/components/native-select.js +60 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/pagination.d.ts +23 -0
- package/dist/components/pagination.js +112 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/progress.d.ts +10 -0
- package/dist/components/progress.js +67 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +8 -0
- package/dist/components/radio-group.js +41 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/select.d.ts +17 -0
- package/dist/components/select.js +177 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/skip-link.d.ts +1 -1
- package/dist/components/slider.d.ts +2 -82
- package/dist/components/slider.js +39 -106
- package/dist/components/slider.js.map +1 -1
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +34 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +87 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +14 -0
- package/dist/components/tabs.js +76 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +73 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +12 -0
- package/dist/components/toggle.js +45 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/index.d.ts +38 -1
- package/dist/index.js +22 -0
- package/dist/styles.css +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/header.tsx"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,YAAA,GAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,IAAA,EAAM,iFAAA;AAAA,EACN,KAAA,EACE,kIAAA;AAAA,EACF,KAAA,EACE,+HAAA;AAAA,EACF,IAAA,EAAM;AACR;AAMA,MAAM,oBAAA,GAAoC,OAAA;AAE1C,MAAM,cAAA,GAAiB,GAAA;AAA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AAS,QAAA,GAAW;AAClB,MAAA,aAAA,CAAc,MAAA,CAAO,UAAU,CAAC,CAAA;AAAA,IAClC;AAGA,IAAA,QAAA,EAAS;AACT,IAAA,MAAA,CAAO,iBAAiB,QAAA,EAAU,QAAA,EAAU,EAAE,OAAA,EAAS,MAAM,CAAA;AAC7D,IAAA,OAAO,MAAM,MAAA,CAAO,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AAAA,EAC5D,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAG,YAAA;AAAA,MACH,WAAA,EAAU,QAAA;AAAA,MACV,cAAY,KAAA,IAAS,oBAAA;AAAA,MAGrB,iBAAe,UAAA,IAAc,MAAA;AAAA,MAC5B,GAAG,KAAA;AAAA,MACJ,SAAA,EAAW,EAAA;AAAA,QACT,cAAA,CAAe,EAAE,KAAA,EAAO,CAAA;AAAA;AAAA;AAAA;AAAA,QAIxB,MAAA,IAAU,mBAAA;AAAA;AAAA,QAEV,MAAA,IAAU,mCAAA;AAAA;AAAA;AAAA,QAGV,MAAA,IACE,qFAAA;AAAA,QACF;AAAA,OACF;AAAA,MACA,GAAA;AAAA,MAEA,8BAAC,kBAAA,CAAmB,QAAA,EAAnB,EAA4B,KAAA,EAAO,SAAS,oBAAA,EAC3C,QAAA,kBAAA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,WAAA,EAAU,kBAAA;AAAA,UACV,WAAW,EAAA,CAAG,uBAAA,CAAwB,EAAE,SAAA,EAAW,GAAG,kBAAkB,CAAA;AAAA,UAEvE;AAAA;AAAA,OACH,EACF;AAAA;AAAA,GACF;AAEJ","file":"header.js","sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\n\nimport { cn } from '../lib/utils.js'\n\nimport { Badge, type BadgeProps } from '../components/badge.js'\nimport { Link } from '../components/link.js'\nimport { Logo } from '../components/logo.js'\n\n/**\n * Surface colours the header can be themed with, sharing the Masthead's and\n * SkipLink's four-name vocabulary (`dark`, `light`, `white`, `grey`) — the three\n * components stack at the top of the page and a service picks one word for the\n * whole chrome.\n *\n * Every pair is WCAG 2.2 AAA (1.4.6, 7:1), computed from the masterbrand oklch\n * tokens. Light mode: grey-800 on white 15.1:1, grey-800 on grey-100 13.8:1,\n * white on primary-800 14.4:1, white on grey-800 15.1:1. Dark mode deepens each\n * surface onto the same family's dark step and clears AAA more comfortably\n * still (17.2:1–20.2:1).\n *\n * Unlike the Masthead — a brand strip whose light/white/grey surfaces are frozen\n * across themes — the header is the page's own surface, so all four follow the\n * theme. Pair `Header color=\"dark\"` with `Masthead color=\"dark\"` when a service\n * wants the two to match in both modes.\n */\nconst headerColors = {\n // Ink values use the RAW masterbrand tokens (--grey-800) rather than\n // Tailwind's --color-* bridge aliases: Tailwind v4 tree-shakes an\n // unreferenced @theme key, and referencing one from inside an arbitrary\n // property is not a usage signal. Same reasoning as footer.tsx.\n // (--color-white is safe: `text-white` below is a real utility.)\n dark: 'bg-primary-800 text-white [--header-ink:var(--color-white)] dark:bg-primary-950',\n light:\n 'bg-grey-100 text-grey-800 [--header-ink:var(--grey-800)] dark:bg-grey-850 dark:text-white dark:[--header-ink:var(--color-white)]',\n white:\n 'bg-white text-grey-800 [--header-ink:var(--grey-800)] dark:bg-grey-900 dark:text-white dark:[--header-ink:var(--color-white)]',\n grey: 'bg-grey-800 text-white [--header-ink:var(--color-white)] dark:bg-grey-950',\n}\n\ntype HeaderColor = keyof typeof headerColors\n\n// Shared by cva's defaultVariants, the data-color attribute and the logo\n// context, so the four can't drift apart.\nconst DEFAULT_HEADER_COLOR: HeaderColor = 'white'\n\nconst headerVariants = cva(\n [\n 'w-full',\n // The hairline rule derives from the surface's own ink, so it follows every\n // colour variant and both themes from one value. Mirrors the color-mix\n // derivation in footer.tsx (--footer-border) and link.tsx (--link-halo).\n '[--header-border:color-mix(in_oklch,var(--header-ink)_15%,transparent)]',\n 'duration-300 motion-safe:transition-shadow',\n ],\n {\n variants: {\n color: headerColors,\n },\n defaultVariants: {\n color: DEFAULT_HEADER_COLOR,\n },\n },\n)\n\nconst headerContainerVariants = cva(\n [\n 'mx-auto flex w-full flex-wrap items-center justify-between gap-x-4 gap-y-3 max-sm:py-3 sm:max-lg:py-4 lg:py-5',\n // Lateral padding funnels through --header-padding-x so an app can retune it\n // once (via the `style` prop or a utility class) without a new variant. Same\n // mechanism, and the same 16px → 24px → 48px rhythm, as Masthead and Footer.\n 'px-(--header-padding-x)',\n '[--header-padding-x:--spacing(4)] sm:[--header-padding-x:--spacing(6)] lg:[--header-padding-x:--spacing(12)]',\n ],\n {\n variants: {\n container: {\n // Full-bleed (nswds-app parity). --header-max-width is still read so a\n // shell app can constrain the inner wrapper without switching variants.\n fluid: 'max-w-[var(--header-max-width,none)]',\n // Centred content column, legacy nsw-container parity (1200px).\n contained: 'max-w-[var(--header-max-width,75rem)]',\n },\n },\n defaultVariants: {\n container: 'fluid',\n },\n },\n)\n\n/**\n * Lets `HeaderBrand` adapt its artwork to the surface it is drawn on — the\n * default `Logo` paints its wordmark `nsw-blue-800` and the version `Badge`\n * paints itself `primary-800`, both of which disappear on the `dark`\n * (primary-800) surface. A `logo` node supplied by the consumer overrides the\n * lockup entirely; at that point the choice is theirs.\n */\nconst HeaderColorContext = React.createContext<HeaderColor>(DEFAULT_HEADER_COLOR)\n\n/** Surfaces dark enough to need light-on-dark artwork. */\nconst DARK_SURFACE_COLORS = new Set<HeaderColor>(['dark', 'grey'])\n\ntype HeaderBrandProps = React.ComponentPropsWithoutRef<'div'> & {\n /** Home-page target for the brand link. Defaults to `/`. */\n href?: React.ComponentPropsWithoutRef<typeof Link>['href']\n /** Service or site name shown beside the logo. */\n sitename?: React.ReactNode\n /**\n * Heading level for `sitename`. Omit (the default) to render a `<span>`,\n * which is usually right: the page's own `<h1>` belongs to its main content,\n * and a site name repeated in the header on every page is not the heading\n * that describes this page. Supply a level only when a service deliberately\n * places the site name in the document outline.\n *\n * `1` is excluded for the reason above; `6` is the deepest heading HTML\n * defines.\n */\n headingLevel?: 2 | 3 | 4 | 5 | 6\n /**\n * Version string shown in a Badge beside the brand. Sits outside the link,\n * so it never becomes part of the home link's accessible name.\n */\n version?: React.ReactNode\n /**\n * Visually-hidden prefix announced before `version`, giving the bare number\n * context for screen readers (\"2.1.0\" → \"Version 2.1.0\"). Pass an empty\n * string to suppress.\n */\n versionLabel?: string\n /**\n * Props forwarded to the version `Badge` — `size`, `color`, `variant`,\n * `className` and the rest of its API. Use it when the badge has to meet a\n * house rule the default does not, most often a minimum type size:\n *\n * ```tsx\n * <HeaderBrand version=\"2.1.0\" badgeProps={{ size: 'lg' }} />\n * ```\n *\n * An explicit value always wins — including `color`, whose surface-aware\n * default exists to stop the badge painting itself the same colour as a dark\n * header. Overriding it is the same trade as supplying your own `logo` node:\n * the contrast is then yours to check.\n *\n * `undefined` and `null` do *not* win: they fall back to the defaults, so a\n * conditional like `{ color: cond ? 'accent' : undefined }` keeps the\n * surface-aware colour on the falsy branch rather than dropping the badge to\n * cva's own `primary` default.\n *\n * `children` is excluded — the badge's content is `version` and\n * `versionLabel`.\n */\n badgeProps?: Omit<BadgeProps, 'children'>\n /**\n * `true` (default) renders the NSW Government waratah, `false` omits it, and\n * a node replaces it — pass an agency lockup here.\n */\n logo?: boolean | React.ReactNode\n /**\n * Accessible name for the brand link. Left unset by default: the link's name\n * is then its visible content — \"NSW Government\" (from `Logo`'s\n * visually-hidden text) plus `sitename` — which keeps the visible label\n * inside the accessible name (WCAG 2.2, 2.5.3 Label in Name). Overriding it\n * with something like \"Home page\" would break that, so set it only when the\n * brand renders no text at all.\n */\n label?: string\n ref?: React.Ref<HTMLDivElement>\n}\n\n/**\n * Dev-only guard, mirroring the icon-only Button check in button.tsx: the\n * default `Logo` carries a visually-hidden \"NSW Government\", so a brand with\n * neither it nor a `sitename` renders a link with no text at all, and reaches\n * assistive tech unnamed (WCAG 2.2, 4.1.2 Name, Role, Value). A consumer's own\n * logo node is assumed to carry its own text. No-op in production.\n */\nfunction warnIfBrandUnlabelled({\n logo,\n sitename,\n label,\n}: Pick<HeaderBrandProps, 'logo' | 'sitename' | 'label'>) {\n if (process.env.NODE_ENV === 'production') {\n return\n }\n if (!logo && !sitename && !label) {\n console.warn(\n '[nswds/ui] HeaderBrand has no logo and no sitename, so its home link has no accessible name — pass `label`.',\n )\n }\n}\n\n/**\n * Logo, site name and optional version badge, linked to the home page. Sits at\n * the start of the `Header` row.\n *\n * The link renders through `Link`, so it picks up the framework link component\n * from `LinkProvider` (next/link et al) rather than hardcoding one.\n */\nfunction HeaderBrand({\n className,\n href = '/',\n sitename,\n headingLevel,\n version,\n versionLabel = 'Version',\n badgeProps,\n logo = true,\n label,\n children,\n ref,\n ...props\n}: HeaderBrandProps) {\n const color = React.useContext(HeaderColorContext)\n const onDarkSurface = DARK_SURFACE_COLORS.has(color)\n const Sitename = headingLevel ? (`h${headingLevel}` as const) : 'span'\n\n warnIfBrandUnlabelled({ logo, sitename, label })\n\n const logoNode =\n logo === true ? (\n <Logo\n logoType={onDarkSurface ? 'reversed' : 'default'}\n // 64px from lg, 56px below it — 56px is the floor, so the lockup stays\n // legible on a phone. Written as mutually exclusive breakpoint ranges\n // rather than `h-14 lg:h-16`: a bare `h-14` a consumer also uses is\n // re-emitted after ours by their own Tailwind build, and a media query\n // adds no specificity, so it would outrank the lg step and freeze the\n // logo at 56px.\n className='w-auto max-lg:h-14 lg:h-16'\n />\n ) : (\n // `false` / `null` fall through as the falsy nodes they are; anything\n // else is the consumer's own lockup.\n logo\n )\n\n return (\n <div\n data-slot='header-brand'\n {...props}\n className={cn('flex grow basis-0 items-center max-sm:gap-3 sm:gap-4', className)}\n ref={ref}\n >\n {/* variant='unstyled' — a brand lockup takes no underline or link\n colour. outline-current resolves to the surface's ink on every\n variant, so the focus indicator contrasts with the header\n (WCAG 2.2, 2.4.13 Focus Appearance). The negative margin keeps the\n indicator from nudging the row. */}\n <Link\n variant='unstyled'\n href={href}\n aria-label={label}\n className='-m-1 flex items-center rounded-sm p-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current max-sm:gap-3 sm:gap-4'\n >\n {logoNode}\n {sitename ? (\n // Brand-blue ink on the light surfaces (14.4:1 on white, 13.2:1 on\n // grey-100 — both WCAG 2.2 AAA). The `dark` surface *is* primary-800\n // and `grey` is nearly as deep, so those keep the header's own white\n // ink; dark mode does the same, matching the `dark:text-white` the\n // light/white variants already set on the surface.\n <Sitename\n className={cn(\n 'font-bold text-balance max-sm:text-lg sm:text-xl',\n !onDarkSurface && 'text-primary-800 dark:text-white',\n )}\n >\n {sitename}\n </Sitename>\n ) : null}\n </Link>\n {version ? (\n // Badge's `primary` ink is primary-800 — the `dark` header's own\n // surface — so dark surfaces take the white badge instead.\n <Badge\n data-slot='header-version'\n {...badgeProps}\n // Derived after the spread rather than before it. Spreading last would\n // let a key that is merely *present* win, so\n // `badgeProps={{ color: cond ? 'accent' : undefined }}` would pass\n // `undefined` through to cva, which falls back to its own\n // `defaultVariants.color` of `primary` — and primary-800 is the dark\n // header's own background, so the badge would vanish into it. `??`\n // keeps explicit values winning while undefined (and null, which\n // cva's VariantProps permits and which would otherwise render an\n // unstyled badge) falls back to the surface-aware default.\n variant={badgeProps?.variant ?? 'soft'}\n color={badgeProps?.color ?? (onDarkSurface ? 'white' : 'primary')}\n >\n {versionLabel ? <span className='sr-only'>{versionLabel} </span> : null}\n {version}\n </Badge>\n ) : null}\n {children}\n </div>\n )\n}\n\ntype HeaderActionsProps = React.ComponentPropsWithoutRef<'div'> & {\n ref?: React.Ref<HTMLDivElement>\n}\n\n/**\n * Trailing cluster of header controls — search, theme switcher, sign-in, and\n * the like. Deliberately unopinionated about what goes in it: site search and\n * theme switching are app concerns (they need routing and a theme provider),\n * so the design system supplies the slot and its spacing rather than the\n * widgets.\n *\n * Not a `nav` landmark: a row of controls is not a set of navigation links, and\n * an extra landmark on every page buries the ones that matter. Wrap genuine\n * navigation in your own `<nav>` inside `Header`.\n */\nfunction HeaderActions({ className, ref, ...props }: HeaderActionsProps) {\n return (\n <div\n data-slot='header-actions'\n {...props}\n className={cn(\n 'flex basis-0 items-center justify-end max-sm:gap-2 sm:gap-4 md:grow',\n className,\n )}\n ref={ref}\n />\n )\n}\n\ntype HeaderProps = React.ComponentPropsWithoutRef<'header'> &\n VariantProps<typeof headerVariants> &\n VariantProps<typeof headerContainerVariants> & {\n /** Stick to the top of the viewport as the page scrolls. Defaults to `true`. */\n sticky?: boolean\n /** Hairline rule along the bottom edge. Defaults to `true`. */\n border?: boolean\n /** Raise the header with a shadow once the page is scrolled. Defaults to `true`. */\n shadow?: boolean\n /** Classes applied to the inner width-constraining wrapper. */\n containerClassName?: string\n ref?: React.Ref<HTMLElement>\n }\n\n/**\n * Top-of-page `banner` landmark: brand, site name and header controls. Render\n * it once in a shared layout, below `SkipLinks` and `Masthead`.\n *\n * - `color` themes the surface; all four pairs are WCAG 2.2 AAA and follow the\n * theme in dark mode (see `headerColors`). The bottom rule derives from the\n * surface's ink, so it follows automatically.\n * - `container` selects the inner wrapper layout: `fluid` (full-bleed,\n * nswds-app parity) or `contained` (centred 1200px column, legacy\n * `nsw-container` parity). Fine-tune either with the `--header-max-width`\n * and `--header-padding-x` custom properties.\n * - Scroll position is tracked and exposed as `data-scrolled`, which is what\n * the `shadow` treatment keys off. Style your own scrolled state with it.\n *\n * Compose the row from `HeaderBrand` and `HeaderActions`:\n *\n * ```tsx\n * <Header>\n * <HeaderBrand sitename=\"Design System\" version=\"2.1.0\" />\n * <HeaderActions>\n * <ThemeSwitcher />\n * </HeaderActions>\n * </Header>\n * ```\n *\n * The `banner` landmark comes from the native `<header>` element, which only\n * carries it outside `article`, `aside`, `main`, `nav` and `section` — wrapping\n * `div`s are fine. Keep it out of `<main>`.\n *\n * The default `id=\"nsw-header\"` is kept for compatibility with existing shells\n * that target it (override via the `id` prop).\n */\nfunction Header({\n className,\n color,\n container,\n containerClassName,\n sticky = true,\n border = true,\n shadow = true,\n children,\n ref,\n ...props\n}: HeaderProps) {\n const [isScrolled, setIsScrolled] = React.useState(false)\n\n React.useEffect(() => {\n function onScroll() {\n setIsScrolled(window.scrollY > 0)\n }\n // Read once on mount too: a page restored mid-scroll (back/forward, or a\n // deep link to a fragment) never fires a scroll event.\n onScroll()\n window.addEventListener('scroll', onScroll, { passive: true })\n return () => window.removeEventListener('scroll', onScroll)\n }, [])\n\n return (\n <header\n id='nsw-header'\n data-slot='header'\n data-color={color ?? DEFAULT_HEADER_COLOR}\n // Present-or-absent rather than \"true\"/\"false\", so it reads like Base\n // UI's data-disabled and Tailwind's bare `data-scrolled:` variant works.\n data-scrolled={isScrolled || undefined}\n {...props}\n className={cn(\n headerVariants({ color }),\n // z-40 sits below the z-50 SkipLinks: a sticky header at the same\n // level comes later in the DOM and would paint over a focused skip\n // link, hiding the page's bypass mechanism (WCAG 2.2, 2.4.1).\n sticky && 'sticky top-0 z-40',\n // Always drawn, so the scrolled state changes no box heights.\n border && 'border-b border-(--header-border)',\n // Shadows read as elevation on light surfaces only; in dark mode the\n // rule above carries the separation.\n shadow &&\n 'data-scrolled:shadow-md data-scrolled:shadow-black/5 dark:data-scrolled:shadow-none',\n className,\n )}\n ref={ref}\n >\n <HeaderColorContext.Provider value={color ?? DEFAULT_HEADER_COLOR}>\n <div\n data-slot='header-container'\n className={cn(headerContainerVariants({ container }), containerClassName)}\n >\n {children}\n </div>\n </HeaderColorContext.Provider>\n </header>\n )\n}\n\nexport { Header, HeaderActions, HeaderBrand, headerColors, headerContainerVariants, headerVariants }\nexport type { HeaderActionsProps, HeaderBrandProps, HeaderColor, HeaderProps }\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/header.tsx"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,YAAA,GAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,IAAA,EAAM,iFAAA;AAAA,EACN,KAAA,EACE,kIAAA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AAAA,QAIxB,MAAA,IAAU,mBAAA;AAAA;AAAA,QAEV,MAAA,IAAU,mCAAA;AAAA;AAAA;AAAA,QAGV,MAAA,IACE,qFAAA;AAAA,QACF;AAAA,OACF;AAAA,MACA,GAAA;AAAA,MAEA,8BAAC,kBAAA,CAAmB,QAAA,EAAnB,EAA4B,KAAA,EAAO,SAAS,oBAAA,EAC3C,QAAA,kBAAA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,WAAA,EAAU,kBAAA;AAAA,UACV,WAAW,EAAA,CAAG,uBAAA,CAAwB,EAAE,SAAA,EAAW,GAAG,kBAAkB,CAAA;AAAA,UAEvE;AAAA;AAAA,OACH,EACF;AAAA;AAAA,GACF;AAEJ","file":"header.js","sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\n\nimport { cn } from '../lib/utils.js'\n\nimport { Badge, type BadgeProps } from '../components/badge.js'\nimport { Link } from '../components/link.js'\nimport { Logo } from '../components/logo.js'\n\n/**\n * Surface colours the header can be themed with, sharing the Masthead's and\n * SkipLink's four-name vocabulary (`dark`, `light`, `white`, `grey`) — the three\n * components stack at the top of the page and a service picks one word for the\n * whole chrome.\n *\n * Every pair is WCAG 2.2 AAA (1.4.6, 7:1), computed from the masterbrand oklch\n * tokens. Light mode: grey-800 on white 15.1:1, grey-800 on grey-100 13.8:1,\n * white on primary-800 14.4:1, white on grey-800 15.1:1. Dark mode deepens each\n * surface onto the same family's dark step and clears AAA more comfortably\n * still (17.2:1–20.2:1).\n *\n * Unlike the Masthead — a brand strip whose light/white/grey surfaces are frozen\n * across themes — the header is the page's own surface, so all four follow the\n * theme. Pair `Header color=\"dark\"` with `Masthead color=\"dark\"` when a service\n * wants the two to match in both modes.\n */\nconst headerColors = {\n // Ink values use the RAW masterbrand tokens (--grey-800) rather than\n // Tailwind's --color-* bridge aliases: Tailwind v4 tree-shakes an\n // unreferenced @theme key, and referencing one from inside an arbitrary\n // property is not a usage signal. Same reasoning as footer.tsx.\n // (--color-white is safe: `text-white` below is a real utility.)\n dark: 'bg-primary-800 text-white [--header-ink:var(--color-white)] dark:bg-primary-950',\n light:\n 'bg-grey-100 text-grey-800 [--header-ink:var(--grey-800)] dark:bg-grey-850 dark:text-white dark:[--header-ink:var(--color-white)]',\n white:\n 'bg-white text-grey-800 [--header-ink:var(--grey-800)] dark:bg-grey-900 dark:text-white dark:[--header-ink:var(--color-white)]',\n grey: 'bg-grey-800 text-white [--header-ink:var(--color-white)] dark:bg-grey-950',\n}\n\ntype HeaderColor = keyof typeof headerColors\n\n// Shared by cva's defaultVariants, the data-color attribute and the logo\n// context, so the four can't drift apart.\nconst DEFAULT_HEADER_COLOR: HeaderColor = 'white'\n\nconst headerVariants = cva(\n [\n 'w-full',\n // The hairline rule derives from the surface's own ink, so it follows every\n // colour variant and both themes from one value. Mirrors the color-mix\n // derivation in footer.tsx (--footer-border) and link.tsx (--link-halo).\n '[--header-border:color-mix(in_oklch,var(--header-ink)_15%,transparent)]',\n 'duration-300 motion-safe:transition-shadow',\n ],\n {\n variants: {\n color: headerColors,\n },\n defaultVariants: {\n color: DEFAULT_HEADER_COLOR,\n },\n },\n)\n\nconst headerContainerVariants = cva(\n [\n 'mx-auto flex w-full flex-wrap items-center justify-between gap-x-4 gap-y-3 max-sm:py-3 sm:max-lg:py-4 lg:py-5',\n // Lateral padding funnels through --header-padding-x so an app can retune it\n // once (via the `style` prop or a utility class) without a new variant. Same\n // mechanism, and the same 16px → 24px → 48px rhythm, as Masthead and Footer.\n 'px-(--header-padding-x)',\n '[--header-padding-x:--spacing(4)] sm:[--header-padding-x:--spacing(6)] lg:[--header-padding-x:--spacing(12)]',\n ],\n {\n variants: {\n container: {\n // Full-bleed (nswds-app parity). --header-max-width is still read so a\n // shell app can constrain the inner wrapper without switching variants.\n fluid: 'max-w-[var(--header-max-width,none)]',\n // Centred content column, legacy nsw-container parity (1200px).\n contained: 'max-w-[var(--header-max-width,75rem)]',\n },\n },\n defaultVariants: {\n container: 'fluid',\n },\n },\n)\n\n/**\n * Lets `HeaderBrand` adapt its artwork to the surface it is drawn on — the\n * default `Logo` paints its wordmark `nsw-blue-800` and the version `Badge`\n * paints itself `primary-800`, both of which disappear on the `dark`\n * (primary-800) surface. A `logo` node supplied by the consumer overrides the\n * lockup entirely; at that point the choice is theirs.\n */\nconst HeaderColorContext = React.createContext<HeaderColor>(DEFAULT_HEADER_COLOR)\n\n/** Surfaces dark enough to need light-on-dark artwork. */\nconst DARK_SURFACE_COLORS = new Set<HeaderColor>(['dark', 'grey'])\n\ntype HeaderBrandProps = React.ComponentPropsWithoutRef<'div'> & {\n /** Home-page target for the brand link. Defaults to `/`. */\n href?: React.ComponentPropsWithoutRef<typeof Link>['href']\n /** Service or site name shown beside the logo. */\n sitename?: React.ReactNode\n /**\n * Heading level for `sitename`. Omit (the default) to render a `<span>`,\n * which is usually right: the page's own `<h1>` belongs to its main content,\n * and a site name repeated in the header on every page is not the heading\n * that describes this page. Supply a level only when a service deliberately\n * places the site name in the document outline.\n *\n * `1` is excluded for the reason above; `6` is the deepest heading HTML\n * defines.\n */\n headingLevel?: 2 | 3 | 4 | 5 | 6\n /**\n * Version string shown in a Badge beside the brand. Sits outside the link,\n * so it never becomes part of the home link's accessible name.\n */\n version?: React.ReactNode\n /**\n * Visually-hidden prefix announced before `version`, giving the bare number\n * context for screen readers (\"2.1.0\" → \"Version 2.1.0\"). Pass an empty\n * string to suppress.\n */\n versionLabel?: string\n /**\n * Props forwarded to the version `Badge` — `size`, `color`, `variant`,\n * `className` and the rest of its API. Use it when the badge has to meet a\n * house rule the default does not, most often a minimum type size:\n *\n * ```tsx\n * <HeaderBrand version=\"2.1.0\" badgeProps={{ size: 'lg' }} />\n * ```\n *\n * An explicit value always wins — including `color`, whose surface-aware\n * default exists to stop the badge painting itself the same colour as a dark\n * header. Overriding it is the same trade as supplying your own `logo` node:\n * the contrast is then yours to check.\n *\n * `undefined` and `null` do *not* win: they fall back to the defaults, so a\n * conditional like `{ color: cond ? 'accent' : undefined }` keeps the\n * surface-aware colour on the falsy branch rather than dropping the badge to\n * cva's own `primary` default.\n *\n * `children` is excluded — the badge's content is `version` and\n * `versionLabel`.\n */\n badgeProps?: Omit<BadgeProps, 'children'>\n /**\n * `true` (default) renders the NSW Government waratah, `false` omits it, and\n * a node replaces it — pass an agency lockup here.\n */\n logo?: boolean | React.ReactNode\n /**\n * Accessible name for the brand link. Left unset by default: the link's name\n * is then its visible content — \"NSW Government\" (from `Logo`'s\n * visually-hidden text) plus `sitename` — which keeps the visible label\n * inside the accessible name (WCAG 2.2, 2.5.3 Label in Name). Overriding it\n * with something like \"Home page\" would break that, so set it only when the\n * brand renders no text at all.\n */\n label?: string\n ref?: React.Ref<HTMLDivElement>\n}\n\n/**\n * Dev-only guard, mirroring the icon-only Button check in button.tsx: the\n * default `Logo` carries a visually-hidden \"NSW Government\", so a brand with\n * neither it nor a `sitename` renders a link with no text at all, and reaches\n * assistive tech unnamed (WCAG 2.2, 4.1.2 Name, Role, Value). A consumer's own\n * logo node is assumed to carry its own text. No-op in production.\n */\nfunction warnIfBrandUnlabelled({\n logo,\n sitename,\n label,\n}: Pick<HeaderBrandProps, 'logo' | 'sitename' | 'label'>) {\n if (process.env.NODE_ENV === 'production') {\n return\n }\n if (!logo && !sitename && !label) {\n console.warn(\n '[nswds/ui] HeaderBrand has no logo and no sitename, so its home link has no accessible name — pass `label`.',\n )\n }\n}\n\n/**\n * Logo, site name and optional version badge, linked to the home page. Sits at\n * the start of the `Header` row.\n *\n * The link renders through `Link`, so it picks up the framework link component\n * from `LinkProvider` (next/link et al) rather than hardcoding one.\n */\nfunction HeaderBrand({\n className,\n href = '/',\n sitename,\n headingLevel,\n version,\n versionLabel = 'Version',\n badgeProps,\n logo = true,\n label,\n children,\n ref,\n ...props\n}: HeaderBrandProps) {\n const color = React.useContext(HeaderColorContext)\n const onDarkSurface = DARK_SURFACE_COLORS.has(color)\n const Sitename = headingLevel ? (`h${headingLevel}` as const) : 'span'\n\n warnIfBrandUnlabelled({ logo, sitename, label })\n\n const logoNode =\n logo === true ? (\n // Two lockups, one shown per breakpoint. Below sm the phone has no room\n // for the full three-row mark, so it takes the compact `wordmark='nsw'`\n // lockup (waratah + \"NSW\", no \"Government\"); sm and up take the full mark.\n //\n // Each is wrapped in a span carrying the show/hide, not the Logo itself,\n // because Logo emits a visually-hidden \"NSW Government\" span beside its\n // (aria-hidden) svg. Hiding only the svg would leave that label in the\n // tree twice, so the home link's accessible name would read \"NSW\n // Government NSW Government …\". Toggling the wrapper drops the hidden\n // variant's label with it, leaving exactly one.\n //\n // The wrappers hide with a single conditional utility each (`sm:hidden` /\n // `max-sm:hidden`) rather than a `hidden`/`sm:block` pair: a bare `hidden`\n // a consumer also uses is re-emitted after ours by their own Tailwind\n // build and a media query carries no extra specificity, so the pair is\n // not cascade-safe (see AGENTS.md §4) — one conditional is.\n <>\n <span className='sm:hidden'>\n <Logo\n logoType={onDarkSurface ? 'reversed' : 'default'}\n wordmark='nsw'\n className='block h-14 w-auto'\n />\n </span>\n <span className='max-sm:hidden'>\n <Logo\n logoType={onDarkSurface ? 'reversed' : 'default'}\n // 64px from lg, 56px below it — 56px is the floor, so the lockup\n // stays legible. Written as mutually exclusive breakpoint ranges\n // rather than `h-14 lg:h-16`: a bare `h-14` a consumer also uses is\n // re-emitted after ours by their own Tailwind build, and a media\n // query adds no specificity, so it would outrank the lg step and\n // freeze the logo at 56px.\n className='block w-auto max-lg:h-14 lg:h-16'\n />\n </span>\n </>\n ) : (\n // `false` / `null` fall through as the falsy nodes they are; anything\n // else is the consumer's own lockup.\n logo\n )\n\n return (\n <div\n data-slot='header-brand'\n {...props}\n className={cn('flex grow basis-0 items-center max-sm:gap-3 sm:gap-4', className)}\n ref={ref}\n >\n {/* variant='unstyled' — a brand lockup takes no underline or link\n colour. outline-current resolves to the surface's ink on every\n variant, so the focus indicator contrasts with the header\n (WCAG 2.2, 2.4.13 Focus Appearance). The negative margin keeps the\n indicator from nudging the row. */}\n <Link\n variant='unstyled'\n href={href}\n aria-label={label}\n className='-m-1 flex items-center gap-4 rounded-sm p-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current'\n >\n {logoNode}\n {sitename ? (\n // Brand-blue ink on the light surfaces (14.4:1 on white, 13.2:1 on\n // grey-100 — both WCAG 2.2 AAA). The `dark` surface *is* primary-800\n // and `grey` is nearly as deep, so those keep the header's own white\n // ink; dark mode does the same, matching the `dark:text-white` the\n // light/white variants already set on the surface.\n <Sitename\n className={cn(\n 'font-bold text-balance max-sm:text-lg sm:max-lg:text-xl lg:text-2xl',\n !onDarkSurface && 'text-primary-800 dark:text-white',\n )}\n >\n {sitename}\n </Sitename>\n ) : null}\n </Link>\n {version ? (\n // Badge's `primary` ink is primary-800 — the `dark` header's own\n // surface — so dark surfaces take the white badge instead.\n <Badge\n data-slot='header-version'\n {...badgeProps}\n // Derived after the spread rather than before it. Spreading last would\n // let a key that is merely *present* win, so\n // `badgeProps={{ color: cond ? 'accent' : undefined }}` would pass\n // `undefined` through to cva, which falls back to its own\n // `defaultVariants.color` of `primary` — and primary-800 is the dark\n // header's own background, so the badge would vanish into it. `??`\n // keeps explicit values winning while undefined (and null, which\n // cva's VariantProps permits and which would otherwise render an\n // unstyled badge) falls back to the surface-aware default.\n variant={badgeProps?.variant ?? 'soft'}\n color={badgeProps?.color ?? (onDarkSurface ? 'white' : 'primary')}\n >\n {versionLabel ? <span className='sr-only'>{versionLabel} </span> : null}\n {version}\n </Badge>\n ) : null}\n {children}\n </div>\n )\n}\n\ntype HeaderActionsProps = React.ComponentPropsWithoutRef<'div'> & {\n ref?: React.Ref<HTMLDivElement>\n}\n\n/**\n * Trailing cluster of header controls — search, theme switcher, sign-in, and\n * the like. Deliberately unopinionated about what goes in it: site search and\n * theme switching are app concerns (they need routing and a theme provider),\n * so the design system supplies the slot and its spacing rather than the\n * widgets.\n *\n * Not a `nav` landmark: a row of controls is not a set of navigation links, and\n * an extra landmark on every page buries the ones that matter. Wrap genuine\n * navigation in your own `<nav>` inside `Header`.\n */\nfunction HeaderActions({ className, ref, ...props }: HeaderActionsProps) {\n return (\n <div\n data-slot='header-actions'\n {...props}\n className={cn(\n 'flex basis-0 items-center justify-end max-sm:gap-2 sm:gap-4 md:grow',\n className,\n )}\n ref={ref}\n />\n )\n}\n\ntype HeaderProps = React.ComponentPropsWithoutRef<'header'> &\n VariantProps<typeof headerVariants> &\n VariantProps<typeof headerContainerVariants> & {\n /** Stick to the top of the viewport as the page scrolls. Defaults to `true`. */\n sticky?: boolean\n /** Hairline rule along the bottom edge. Defaults to `true`. */\n border?: boolean\n /** Raise the header with a shadow once the page is scrolled. Defaults to `true`. */\n shadow?: boolean\n /** Classes applied to the inner width-constraining wrapper. */\n containerClassName?: string\n ref?: React.Ref<HTMLElement>\n }\n\n/**\n * Top-of-page `banner` landmark: brand, site name and header controls. Render\n * it once in a shared layout, below `SkipLinks` and `Masthead`.\n *\n * - `color` themes the surface; all four pairs are WCAG 2.2 AAA and follow the\n * theme in dark mode (see `headerColors`). The bottom rule derives from the\n * surface's ink, so it follows automatically.\n * - `container` selects the inner wrapper layout: `fluid` (full-bleed,\n * nswds-app parity) or `contained` (centred 1200px column, legacy\n * `nsw-container` parity). Fine-tune either with the `--header-max-width`\n * and `--header-padding-x` custom properties.\n * - Scroll position is tracked and exposed as `data-scrolled`, which is what\n * the `shadow` treatment keys off. Style your own scrolled state with it.\n *\n * Compose the row from `HeaderBrand` and `HeaderActions`:\n *\n * ```tsx\n * <Header>\n * <HeaderBrand sitename=\"Design System\" version=\"2.1.0\" />\n * <HeaderActions>\n * <ThemeSwitcher />\n * </HeaderActions>\n * </Header>\n * ```\n *\n * The `banner` landmark comes from the native `<header>` element, which only\n * carries it outside `article`, `aside`, `main`, `nav` and `section` — wrapping\n * `div`s are fine. Keep it out of `<main>`.\n *\n * The default `id=\"nsw-header\"` is kept for compatibility with existing shells\n * that target it (override via the `id` prop).\n */\nfunction Header({\n className,\n color,\n container,\n containerClassName,\n sticky = true,\n border = true,\n shadow = true,\n children,\n ref,\n ...props\n}: HeaderProps) {\n const [isScrolled, setIsScrolled] = React.useState(false)\n\n React.useEffect(() => {\n function onScroll() {\n setIsScrolled(window.scrollY > 0)\n }\n // Read once on mount too: a page restored mid-scroll (back/forward, or a\n // deep link to a fragment) never fires a scroll event.\n onScroll()\n window.addEventListener('scroll', onScroll, { passive: true })\n return () => window.removeEventListener('scroll', onScroll)\n }, [])\n\n return (\n <header\n id='nsw-header'\n data-slot='header'\n data-color={color ?? DEFAULT_HEADER_COLOR}\n // Present-or-absent rather than \"true\"/\"false\", so it reads like Base\n // UI's data-disabled and Tailwind's bare `data-scrolled:` variant works.\n data-scrolled={isScrolled || undefined}\n {...props}\n className={cn(\n headerVariants({ color }),\n // z-40 sits below the z-50 SkipLinks: a sticky header at the same\n // level comes later in the DOM and would paint over a focused skip\n // link, hiding the page's bypass mechanism (WCAG 2.2, 2.4.1).\n sticky && 'sticky top-0 z-40',\n // Always drawn, so the scrolled state changes no box heights.\n border && 'border-b border-(--header-border)',\n // Shadows read as elevation on light surfaces only; in dark mode the\n // rule above carries the separation.\n shadow &&\n 'data-scrolled:shadow-md data-scrolled:shadow-black/5 dark:data-scrolled:shadow-none',\n className,\n )}\n ref={ref}\n >\n <HeaderColorContext.Provider value={color ?? DEFAULT_HEADER_COLOR}>\n <div\n data-slot='header-container'\n className={cn(headerContainerVariants({ container }), containerClassName)}\n >\n {children}\n </div>\n </HeaderColorContext.Provider>\n </header>\n )\n}\n\nexport { Header, HeaderActions, HeaderBrand, headerColors, headerContainerVariants, headerVariants }\nexport type { HeaderActionsProps, HeaderBrandProps, HeaderColor, HeaderProps }\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Button } from './button.js';
|
|
5
|
+
import '@base-ui/react/button';
|
|
6
|
+
import './link.js';
|
|
7
|
+
|
|
8
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
9
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
10
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
13
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
14
|
+
size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
|
|
15
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
16
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, 'size' | 'type'> & VariantProps<typeof inputGroupButtonVariants> & {
|
|
17
|
+
type?: 'button' | 'submit' | 'reset';
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
20
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<'input'>): React.JSX.Element;
|
|
21
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<'textarea'>): React.JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../lib/utils.js';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
import { Input } from './input.js';
|
|
7
|
+
import { Textarea } from './textarea.js';
|
|
8
|
+
|
|
9
|
+
function InputGroup({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "input-group",
|
|
14
|
+
role: "group",
|
|
15
|
+
className: cn(
|
|
16
|
+
"group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
const inputGroupAddonVariants = cva(
|
|
24
|
+
"flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",
|
|
25
|
+
{
|
|
26
|
+
variants: {
|
|
27
|
+
align: {
|
|
28
|
+
"inline-start": "order-first ps-2 has-[>button]:ms-[-0.275rem] has-[>kbd]:ms-[-0.275rem]",
|
|
29
|
+
"inline-end": "order-last pe-2 has-[>button]:me-[-0.275rem] has-[>kbd]:me-[-0.275rem]",
|
|
30
|
+
"block-start": "order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
31
|
+
"block-end": "order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
align: "inline-start"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
function InputGroupAddon({
|
|
40
|
+
className,
|
|
41
|
+
align = "inline-start",
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
role: "group",
|
|
48
|
+
"data-slot": "input-group-addon",
|
|
49
|
+
"data-align": align,
|
|
50
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
51
|
+
onClick: (e) => {
|
|
52
|
+
if (e.target.closest("button")) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
56
|
+
},
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
const inputGroupButtonVariants = cva(
|
|
62
|
+
"flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",
|
|
63
|
+
{
|
|
64
|
+
variants: {
|
|
65
|
+
size: {
|
|
66
|
+
xs: "h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",
|
|
67
|
+
sm: "gap-1",
|
|
68
|
+
"icon-xs": "size-6 p-0 has-[>svg]:p-0",
|
|
69
|
+
"icon-sm": "size-7 p-0 has-[>svg]:p-0"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
size: "xs"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
function InputGroupButton({
|
|
78
|
+
className,
|
|
79
|
+
type = "button",
|
|
80
|
+
variant = "ghost",
|
|
81
|
+
size = "xs",
|
|
82
|
+
...props
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
Button,
|
|
86
|
+
{
|
|
87
|
+
type,
|
|
88
|
+
"data-size": size,
|
|
89
|
+
variant,
|
|
90
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
91
|
+
...props
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function InputGroupText({ className, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: cn(
|
|
100
|
+
"flex items-center gap-2 text-xs/relaxed text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
function InputGroupInput({ className, ...props }) {
|
|
108
|
+
return /* @__PURE__ */ jsx(
|
|
109
|
+
Input,
|
|
110
|
+
{
|
|
111
|
+
"data-slot": "input-group-control",
|
|
112
|
+
className: cn(
|
|
113
|
+
"flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
121
|
+
return /* @__PURE__ */ jsx(
|
|
122
|
+
Textarea,
|
|
123
|
+
{
|
|
124
|
+
"data-slot": "input-group-control",
|
|
125
|
+
className: cn(
|
|
126
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",
|
|
127
|
+
className
|
|
128
|
+
),
|
|
129
|
+
...props
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
135
|
+
//# sourceMappingURL=input-group.js.map
|
|
136
|
+
//# sourceMappingURL=input-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/input-group.tsx"],"names":[],"mappings":";;;;;;;AAUA,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACxE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,IAAA,EAAK,OAAA;AAAA,MACL,SAAA,EAAW,EAAA;AAAA,QACT,4nCAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,MAAM,uBAAA,GAA0B,GAAA;AAAA,EAC9B,oXAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,KAAA,EAAO;AAAA,QACL,cAAA,EAAgB,yEAAA;AAAA,QAChB,YAAA,EAAc,wEAAA;AAAA,QACd,aAAA,EACE,iGAAA;AAAA,QACF,WAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,KAAA,EAAO;AAAA;AACT;AAEJ,CAAA;AAEA,SAAS,eAAA,CAAgB;AAAA,EACvB,SAAA;AAAA,EACA,KAAA,GAAQ,cAAA;AAAA,EACR,GAAG;AACL,CAAA,EAA+E;AAC7E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,OAAA;AAAA,MACL,WAAA,EAAU,mBAAA;AAAA,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AAA,EAAW,EAAA;AAAA,QACT,gIAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,eAAA,CAAgB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAkC;AAC/E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,6HAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqC;AACrF,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,8IAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"input-group.js","sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../lib/utils.js'\nimport { Button } from './button.js'\nimport { Input } from './input.js'\nimport { Textarea } from './textarea.js'\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot='input-group'\n role='group'\n className={cn(\n 'group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5\",\n {\n variants: {\n align: {\n 'inline-start': 'order-first ps-2 has-[>button]:ms-[-0.275rem] has-[>kbd]:ms-[-0.275rem]',\n 'inline-end': 'order-last pe-2 has-[>button]:me-[-0.275rem] has-[>kbd]:me-[-0.275rem]',\n 'block-start':\n 'order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2',\n 'block-end':\n 'order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2',\n },\n },\n defaultVariants: {\n align: 'inline-start',\n },\n },\n)\n\nfunction InputGroupAddon({\n className,\n align = 'inline-start',\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role='group'\n data-slot='input-group-addon'\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest('button')) {\n return\n }\n e.currentTarget.parentElement?.querySelector('input')?.focus()\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = cva(\n 'flex items-center gap-2 rounded-md text-xs/relaxed shadow-none',\n {\n variants: {\n size: {\n xs: \"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3\",\n sm: 'gap-1',\n 'icon-xs': 'size-6 p-0 has-[>svg]:p-0',\n 'icon-sm': 'size-7 p-0 has-[>svg]:p-0',\n },\n },\n defaultVariants: {\n size: 'xs',\n },\n },\n)\n\nfunction InputGroupButton({\n className,\n type = 'button',\n variant = 'ghost',\n size = 'xs',\n ...props\n}: Omit<React.ComponentProps<typeof Button>, 'size' | 'type'> &\n VariantProps<typeof inputGroupButtonVariants> & {\n type?: 'button' | 'submit' | 'reset'\n }) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n className={cn(\n \"flex items-center gap-2 text-xs/relaxed text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({ className, ...props }: React.ComponentProps<'input'>) {\n return (\n <Input\n data-slot='input-group-control'\n className={cn(\n 'flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupTextarea({ className, ...props }: React.ComponentProps<'textarea'>) {\n return (\n <Textarea\n data-slot='input-group-control'\n className={cn(\n 'flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n InputGroupText,\n InputGroupTextarea,\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OTPInput } from 'input-otp';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
8
|
+
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<'div'> & {
|
|
9
|
+
index: number;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { IconRemove } from '../icons/remove.js';
|
|
6
|
+
import { cn } from '../lib/utils.js';
|
|
7
|
+
|
|
8
|
+
function InputOTP({
|
|
9
|
+
className,
|
|
10
|
+
containerClassName,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
OTPInput,
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "input-otp",
|
|
17
|
+
containerClassName: cn(
|
|
18
|
+
"cn-input-otp flex items-center has-disabled:opacity-50",
|
|
19
|
+
containerClassName
|
|
20
|
+
),
|
|
21
|
+
spellCheck: false,
|
|
22
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
23
|
+
...props
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function InputOTPGroup({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "input-otp-group",
|
|
32
|
+
className: cn(
|
|
33
|
+
"flex items-center rounded-md has-aria-invalid:border-destructive has-aria-invalid:ring-2 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function InputOTPSlot({
|
|
41
|
+
index,
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
46
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "input-otp-slot",
|
|
51
|
+
"data-active": isActive,
|
|
52
|
+
className: cn(
|
|
53
|
+
"relative flex size-7 items-center justify-center border-y border-e border-input bg-input/20 text-xs/relaxed transition-all outline-none first:rounded-s-md first:border-s last:rounded-e-md aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-2 data-[active=true]:ring-ring/30 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
...props,
|
|
57
|
+
children: [
|
|
58
|
+
char,
|
|
59
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function InputOTPSeparator({ ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
"data-slot": "input-otp-separator",
|
|
69
|
+
className: "flex items-center [&_svg:not([class*='size-'])]:size-4",
|
|
70
|
+
role: "separator",
|
|
71
|
+
...props,
|
|
72
|
+
children: /* @__PURE__ */ jsx(IconRemove, {})
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
78
|
+
//# sourceMappingURL=input-otp.js.map
|
|
79
|
+
//# sourceMappingURL=input-otp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/input-otp.tsx"],"names":[],"mappings":";;;;;;AAQA,SAAS,QAAA,CAAS;AAAA,EAChB,SAAA;AAAA,EACA,kBAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEG;AACD,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,kBAAA,EAAoB,EAAA;AAAA,QAClB,wDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,UAAA,EAAY,KAAA;AAAA,MACZ,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,SAAS,CAAA;AAAA,MACrD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,yKAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,YAAA,CAAa;AAAA,EACpB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEG;AACD,EAAA,MAAM,eAAA,GAAkB,KAAA,CAAM,UAAA,CAAW,eAAe,CAAA;AACxD,EAAA,MAAM,EAAE,MAAM,YAAA,EAAc,QAAA,KAAa,eAAA,EAAiB,KAAA,CAAM,KAAK,CAAA,IAAK,EAAC;AAE3E,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,gBAAA;AAAA,MACV,aAAA,EAAa,QAAA;AAAA,MACb,SAAA,EAAW,EAAA;AAAA,QACT,+fAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,IAAA;AAAA,QACA,YAAA,wBACE,KAAA,EAAA,EAAI,SAAA,EAAU,yEACb,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,0DAAA,EAA2D,CAAA,EAC5E;AAAA;AAAA;AAAA,GAEJ;AAEJ;AAEA,SAAS,iBAAA,CAAkB,EAAE,GAAG,KAAA,EAAM,EAAgC;AACpE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAU,wDAAA;AAAA,MACV,IAAA,EAAK,WAAA;AAAA,MACJ,GAAG,KAAA;AAAA,MAEJ,8BAAC,UAAA,EAAA,EAAW;AAAA;AAAA,GACd;AAEJ","file":"input-otp.js","sourcesContent":["'use client'\n\nimport { OTPInput, OTPInputContext } from 'input-otp'\nimport * as React from 'react'\n\nimport { IconRemove } from '../icons/remove.js'\nimport { cn } from '../lib/utils.js'\n\nfunction InputOTP({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string\n}) {\n return (\n <OTPInput\n data-slot='input-otp'\n containerClassName={cn(\n 'cn-input-otp flex items-center has-disabled:opacity-50',\n containerClassName,\n )}\n spellCheck={false}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot='input-otp-group'\n className={cn(\n 'flex items-center rounded-md has-aria-invalid:border-destructive has-aria-invalid:ring-2 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n index: number\n}) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot='input-otp-slot'\n data-active={isActive}\n className={cn(\n 'relative flex size-7 items-center justify-center border-y border-e border-input bg-input/20 text-xs/relaxed transition-all outline-none first:rounded-s-md first:border-s last:rounded-e-md aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-2 data-[active=true]:ring-ring/30 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className='pointer-events-none absolute inset-0 flex items-center justify-center'>\n <div className='h-4 w-px animate-caret-blink bg-foreground duration-1000' />\n </div>\n )}\n </div>\n )\n}\n\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot='input-otp-separator'\n className=\"flex items-center [&_svg:not([class*='size-'])]:size-4\"\n role='separator'\n {...props}\n >\n <IconRemove />\n </div>\n )\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../lib/utils.js';
|
|
3
|
+
|
|
4
|
+
function Kbd({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"kbd",
|
|
7
|
+
{
|
|
8
|
+
"data-slot": "kbd",
|
|
9
|
+
className: cn(
|
|
10
|
+
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-xs bg-muted px-1 font-sans text-[0.625rem] font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function KbdGroup({ className, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
"kbd",
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "kbd-group",
|
|
22
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
23
|
+
...props
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Kbd, KbdGroup };
|
|
29
|
+
//# sourceMappingURL=kbd.js.map
|
|
30
|
+
//# sourceMappingURL=kbd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/kbd.tsx"],"names":[],"mappings":";;;AAEA,SAAS,GAAA,CAAI,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACjE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,KAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,+WAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACtE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,gCAAA,EAAkC,SAAS,CAAA;AAAA,MACxD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"kbd.js","sourcesContent":["import { cn } from '../lib/utils.js'\n\nfunction Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {\n return (\n <kbd\n data-slot='kbd'\n className={cn(\n \"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-xs bg-muted px-1 font-sans text-[0.625rem] font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction KbdGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <kbd\n data-slot='kbd-group'\n className={cn('inline-flex items-center gap-1', className)}\n {...props}\n />\n )\n}\n\nexport { Kbd, KbdGroup }\n"]}
|
|
@@ -3,8 +3,22 @@ import { ComponentPropsWithoutRef, Ref } from 'react';
|
|
|
3
3
|
|
|
4
4
|
type LogoProps = ComponentPropsWithoutRef<'svg'> & {
|
|
5
5
|
logoType?: 'default' | 'reversed' | 'mono-white' | 'mono-black';
|
|
6
|
+
/**
|
|
7
|
+
* Which wordmark rows the lockup draws.
|
|
8
|
+
*
|
|
9
|
+
* - `'full'` (default) — the complete lockup: waratah, "NSW" and "Government".
|
|
10
|
+
* - `'nsw'` — drops the "Government" row, leaving the waratah and "NSW". The
|
|
11
|
+
* viewBox crops to the shorter mark (`0 0 259 247` vs `0 0 259 280`) so it
|
|
12
|
+
* still sits flush to every edge and `w-auto` keeps the narrower aspect
|
|
13
|
+
* ratio. Useful where horizontal space is tight, e.g. a mobile header.
|
|
14
|
+
*
|
|
15
|
+
* The visually-hidden accessible name stays "NSW Government" for both — the
|
|
16
|
+
* mark identifies the same organisation whichever rows are drawn, so screen
|
|
17
|
+
* readers announce it identically.
|
|
18
|
+
*/
|
|
19
|
+
wordmark?: 'full' | 'nsw';
|
|
6
20
|
ref?: Ref<SVGSVGElement>;
|
|
7
21
|
};
|
|
8
|
-
declare function Logo({ logoType, ref, ...props }: LogoProps): React.JSX.Element;
|
|
22
|
+
declare function Logo({ logoType, wordmark, ref, ...props }: LogoProps): React.JSX.Element;
|
|
9
23
|
|
|
10
24
|
export { Logo, type LogoProps };
|
package/dist/components/logo.js
CHANGED
|
@@ -1,59 +1,68 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
|
|
4
|
-
function Logo({ logoType = "default", ref, ...props }) {
|
|
4
|
+
function Logo({ logoType = "default", wordmark = "full", ref, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
6
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "NSW Government" }),
|
|
7
|
-
/* @__PURE__ */ jsxs(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
/* @__PURE__ */ jsxs(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
viewBox: wordmark === "nsw" ? "0 0 259 247" : "0 0 259 280",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
...props,
|
|
14
|
+
children: [
|
|
15
|
+
wordmark === "full" ? /* @__PURE__ */ jsx(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M24.208 270.207h-5.045v-4.277l11.15.054v13.676H26.08v-2.491c-.266.278-.553.556-.86.833-.673.585-1.49 1.07-2.433 1.434-.96.373-2.143.564-3.513.564-2.33 0-4.385-.539-6.109-1.6-1.727-1.065-3.073-2.594-4.007-4.538-.926-1.927-1.395-4.231-1.395-6.85 0-2.657.494-4.994 1.47-6.946.971-1.96 2.363-3.498 4.132-4.571 1.768-1.065 3.849-1.604 6.183-1.604 1.515 0 2.915.245 4.156.725 1.255.485 2.36 1.157 3.273 1.985a9.61 9.61 0 0 1 2.192 2.852 8.196 8.196 0 0 1 .872 3.319l.021.435h-6.038l-.062-.339a5.22 5.22 0 0 0-.814-1.981 4.562 4.562 0 0 0-1.537-1.43c-.614-.352-1.345-.531-2.175-.531-1.005 0-1.931.261-2.741.775-.806.51-1.458 1.351-1.935 2.495-.486 1.169-.731 2.74-.731 4.679 0 1.579.162 2.897.482 3.925.311 1.011.739 1.819 1.266 2.403.523.581 1.117.991 1.773 1.219a6.036 6.036 0 0 0 2.089.369c.669 0 1.27-.112 1.79-.328.523-.224.98-.514 1.354-.866.377-.356.676-.746.884-1.152.216-.41.349-.816.399-1.21l.14-1.028Zm20.878-16.312c2.354 0 4.435.534 6.179 1.587 1.752 1.061 3.13 2.59 4.086 4.546.947 1.935 1.428 4.281 1.428 6.967 0 2.648-.473 4.969-1.412 6.9-.946 1.948-2.317 3.469-4.073 4.521-1.744 1.053-3.837 1.583-6.212 1.583-2.396 0-4.502-.534-6.254-1.583-1.753-1.044-3.135-2.557-4.099-4.505-.947-1.927-1.428-4.252-1.428-6.912 0-2.673.486-5.015 1.449-6.954.968-1.956 2.355-3.486 4.12-4.551 1.764-1.061 3.853-1.599 6.216-1.599Zm0 21.185c1.117 0 2.093-.265 2.898-.787.802-.523 1.433-1.372 1.881-2.516.453-1.185.686-2.772.686-4.712 0-1.993-.237-3.618-.698-4.832-.444-1.181-1.08-2.056-1.885-2.603-.814-.543-1.782-.82-2.878-.82-1.1 0-2.072.277-2.886.82-.81.543-1.453 1.422-1.906 2.611-.47 1.223-.706 2.843-.706 4.82 0 1.944.237 3.531.702 4.712.452 1.148 1.092 1.997 1.902 2.515.81.527 1.781.792 2.89.792Zm23.764-2.93-6.162-17.829H57.09l8.654 25.251h6.195l8.73-25.251h-5.607L68.85 272.15Zm30.312-2.827H88.863v5.206l12.043.016v5.027H83.103v-25.251h17.632l-.016 4.99H88.892v5.089h10.27v4.923Zm22.482-1.529c.685-.613 1.246-1.401 1.678-2.341.419-.933.635-2.081.635-3.419 0-1.497-.311-2.835-.93-3.983-.619-1.169-1.599-2.093-2.919-2.756-1.3-.647-2.973-.974-4.975-.974h-10.738v25.243h5.759v-9.404h4.24l3.991 9.404h6.046l-4.651-10.456c.673-.357 1.3-.8 1.864-1.314Zm-3.513-5.64c0 .999-.336 1.79-1.025 2.428-.69.63-1.649.949-2.857.949h-4.095v-6.606h4.456c1.038 0 1.873.286 2.545.875.657.576.976 1.347.976 2.354Zm15.159-7.833 10.527 15.23v-15.23h5.776v25.251h-5.086l-10.98-15.86v15.86h-5.759v-25.251h5.522Zm33.949 16.461-5.29-16.461h-7.894v25.251h5.809v-16.266l5.124 16.266h4.485l5.162-16.357v16.357h5.826v-25.251h-7.878l-5.344 16.461Zm33.727-1.459h-10.298v5.206l12.046.016v5.027h-17.806v-25.251h17.636l-.021 4.99h-11.818v5.089h10.261v4.923Zm21.494.228-10.523-15.23h-5.527v25.251h5.756v-15.86l10.979 15.86h5.087v-25.251h-5.772v15.23Zm15.586-10.004h-7.388v-5.226h20.402v5.226h-7.217v20.025h-5.797v-20.025Z",
|
|
21
|
+
className: clsx(
|
|
22
|
+
logoType === "default" && "fill-nsw-blue-800 dark:fill-white",
|
|
23
|
+
(logoType === "reversed" || logoType === "mono-white") && "fill-white",
|
|
24
|
+
logoType === "mono-black" && "fill-black dark:fill-white"
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
) : null,
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
"path",
|
|
30
|
+
{
|
|
31
|
+
fillRule: "evenodd",
|
|
32
|
+
clipRule: "evenodd",
|
|
33
|
+
d: "M146.699 209.236c-1.482-2.395-3.717-4.571-6.64-6.465-2.919-1.894-6.897-3.34-11.81-4.297l-13.678-2.814c-4.132-.891-6.981-2.043-8.468-3.419-1.449-1.343-2.184-3.129-2.184-5.309 0-1.388.316-2.652.943-3.759.623-1.111 1.528-2.093 2.687-2.922 1.166-.828 2.616-1.483 4.306-1.943 1.711-.469 3.633-.705 5.714-.705 2.74 0 5.211.361 7.346 1.078 2.109.713 3.857 1.881 5.194 3.481 1.338 1.6 2.16 3.775 2.442 6.465l.038.373h16.971l-.008-.427c-.075-4.575-1.371-8.773-3.85-12.474-2.483-3.705-6.141-6.681-10.879-8.852-4.726-2.164-10.623-3.262-17.528-3.262-5.801 0-11.117 1.011-15.805 3.009-4.7 2.002-8.475 4.89-11.212 8.587-2.749 3.717-4.12 8.164-4.078 13.224.112 6.175 1.99 11.186 5.577 14.903 3.576 3.697 8.476 6.158 14.567 7.306l13.795 2.81c2.529.502 4.825 1.16 6.823 1.96 1.96.784 3.525 1.803 4.651 3.03 1.1 1.197 1.657 2.772 1.657 4.67 0 2.114-.694 3.9-2.06 5.301-1.4 1.434-3.301 2.515-5.643 3.224-2.388.721-5.058 1.086-7.936 1.086-2.807 0-5.394-.435-7.686-1.297-2.28-.85-4.194-2.093-5.689-3.693-1.491-1.591-2.513-3.585-3.04-5.918l-.075-.327H83.846l.045.46c.407 4.045 1.666 7.629 3.738 10.659 2.068 3.009 4.717 5.545 7.873 7.551 3.148 1.993 6.677 3.514 10.494 4.513a46.33 46.33 0 0 0 11.693 1.5c6.466 0 12.2-1.019 17.046-3.034 4.867-2.022 8.717-4.807 11.449-8.276 2.753-3.493 4.148-7.476 4.148-11.848 0-2.064-.232-4.36-.697-6.822-.478-2.482-1.466-4.948-2.936-7.327ZM25.937 191.763l36.916 53.312H77.87v-79.724H61.072v51.282L25.754 165.53l-.125-.179H9.19v79.724h16.748v-53.312Zm196.637 24.577 14.388-50.987h16.457l-23.587 79.724h-13.367l-14.554-50.469-14.659 50.469h-13.147l-23.533-79.724h16.511l14.384 50.979 14.389-50.979h12.167l14.551 50.987Z",
|
|
34
|
+
className: clsx(
|
|
35
|
+
logoType === "default" && "fill-nsw-blue-800 dark:fill-white",
|
|
36
|
+
(logoType === "reversed" || logoType === "mono-white") && "fill-white",
|
|
37
|
+
logoType === "mono-black" && "fill-black dark:fill-white"
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"path",
|
|
43
|
+
{
|
|
44
|
+
d: "M122.291 145.572c-19.75-2.424-38.934 3.904-72.69-5.263-3.447-.937-4.718 2.694-2.854 5.736 9.07 14.803 54.881 3.203 75.635 1.065.906-.095.814-1.426-.091-1.538ZM208.735 140.309c-33.756 9.167-52.941 2.839-72.691 5.263-.905.112-1 1.447-.091 1.538 20.759 2.138 66.566 13.738 75.635-1.065 1.864-3.042.594-6.673-2.853-5.736ZM59.882 119.132c-6.864-10.058-12.474-21.31-16.818-33.69-13.101 3.826-26.51 9.346-40.16 16.57a5.388 5.388 0 0 0-2.902 4.67 5.38 5.38 0 0 0 2.653 4.812c26.431 15.802 52.273 24.841 76.93 26.933-7.34-4.475-14.072-11.044-19.703-19.295ZM23.059 85.513a201.529 201.529 0 0 1 17.976-6.233c-2.126-6.896-3.87-14.12-5.249-21.658-6.827-.85-13.89-1.4-21.199-1.641-.062 0-.128-.004-.19-.004a5.391 5.391 0 0 0-4.647 2.602 5.383 5.383 0 0 0-.12 5.483c4.243 7.659 8.724 14.808 13.429 21.45ZM88.005 135.572c4.099 1.807 8.293 2.818 12.358 3.029-9.953-7.12-17.773-19.192-22.278-34.58-5.805-19.81-7.745-41.666-5.83-65.247-7.832-4.936-16.32-9.557-25.46-13.85a5.428 5.428 0 0 0-5.402.43 5.396 5.396 0 0 0-2.388 4.841c2.126 34.215 10.95 62.915 26.223 85.298 6.404 9.391 14.281 16.332 22.777 20.079ZM107.488 23.577A253.323 253.323 0 0 0 92.235 6.735c-1.063-1.078-2.433-1.65-3.85-1.65-.506 0-1.017.075-1.523.224-1.923.568-3.314 2.106-3.733 4.115-1.072 5.164-3.11 15.69-4.012 26.101 7.014 4.613 13.492 9.49 19.426 14.621 2.3-8.757 5.29-17.63 8.945-26.569ZM255.42 102.007c-13.65-7.223-27.058-12.744-40.16-16.569-4.343 12.38-9.953 23.631-16.818 33.689-5.63 8.255-12.362 14.82-19.708 19.296 24.658-2.093 50.5-11.132 76.931-26.934 1.715-1.024 2.707-2.822 2.653-4.811-.045-1.99-1.133-3.734-2.898-4.671ZM235.273 85.513c4.705-6.643 9.186-13.796 13.43-21.455.963-1.74.922-3.788-.121-5.483a5.4 5.4 0 0 0-4.837-2.598c-7.309.24-14.377.796-21.199 1.641-1.375 7.539-3.123 14.762-5.249 21.658a203.803 203.803 0 0 1 17.976 6.237ZM180.247 104.025c-4.505 15.384-12.329 27.46-22.278 34.58 4.065-.211 8.263-1.227 12.358-3.034 8.496-3.746 16.373-10.688 22.777-20.075 15.273-22.383 24.097-51.082 26.223-85.297a5.394 5.394 0 0 0-2.388-4.84 5.428 5.428 0 0 0-5.402-.432c-9.14 4.29-17.628 8.91-25.46 13.85 1.915 23.582-.029 45.434-5.83 65.248ZM179.214 35.52c-.901-10.406-2.94-20.932-4.011-26.1-.416-2.01-1.811-3.547-3.733-4.115a5.39 5.39 0 0 0-1.524-.224c-1.416 0-2.787.572-3.85 1.65-5.485 5.549-10.568 11.164-15.252 16.842 3.654 8.939 6.644 17.812 8.949 26.565 5.934-5.127 12.407-10.005 19.421-14.617ZM129.144 87.229c6.64-13.092 17.246-24.829 25.21-32.243-4.372-17.779-11.104-34.55-20.397-52.097C132.998 1.078 131.195 0 129.148 0s-3.845 1.082-4.808 2.889c-9.389 17.604-16.237 35.122-20.377 52.093 8.313 7.688 19.28 20.224 25.181 32.247Z",
|
|
45
|
+
className: clsx(
|
|
46
|
+
(logoType === "default" || logoType === "reversed") && "fill-nsw-red-600 dark:fill-white",
|
|
47
|
+
logoType === "mono-white" && "fill-white",
|
|
48
|
+
logoType === "mono-black" && "fill-black dark:fill-white"
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
"path",
|
|
54
|
+
{
|
|
55
|
+
d: "M153.541 133.686c6.885-4.833 13.77-13.254 18.139-24.97 8.458-22.681 9.334-47.945 8.122-65.823-15.331 10.215-39.665 31.55-47.975 54.36-3.911 10.734-5.734 25.355-2.72 33.511 1.259 3.411 3.401 5.997 6.345 7.227 4.46 1.865 11.312.456 18.089-4.305ZM125.713 95.261c-2.027-4.724-4.261-9.18-7.728-14.186-9.809-14.16-23.026-26.933-39.475-38.185-.17 2.652-2.57 31.297 5.851 59.304 6.408 21.302 17.354 29.98 23.354 33.333 6.038 3.369 11.561 4.165 18.039 2.557-6.565-8.935-5.747-27.27-.041-42.823Z",
|
|
56
|
+
className: clsx(
|
|
57
|
+
(logoType === "default" || logoType === "reversed") && "fill-nsw-red-600 dark:fill-white",
|
|
58
|
+
logoType === "mono-white" && "fill-white",
|
|
59
|
+
logoType === "mono-black" && "fill-black dark:fill-white"
|
|
60
|
+
)
|
|
61
|
+
}
|
|
18
62
|
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"path",
|
|
23
|
-
{
|
|
24
|
-
fillRule: "evenodd",
|
|
25
|
-
clipRule: "evenodd",
|
|
26
|
-
d: "M146.699 209.236c-1.482-2.395-3.717-4.571-6.64-6.465-2.919-1.894-6.897-3.34-11.81-4.297l-13.678-2.814c-4.132-.891-6.981-2.043-8.468-3.419-1.449-1.343-2.184-3.129-2.184-5.309 0-1.388.316-2.652.943-3.759.623-1.111 1.528-2.093 2.687-2.922 1.166-.828 2.616-1.483 4.306-1.943 1.711-.469 3.633-.705 5.714-.705 2.74 0 5.211.361 7.346 1.078 2.109.713 3.857 1.881 5.194 3.481 1.338 1.6 2.16 3.775 2.442 6.465l.038.373h16.971l-.008-.427c-.075-4.575-1.371-8.773-3.85-12.474-2.483-3.705-6.141-6.681-10.879-8.852-4.726-2.164-10.623-3.262-17.528-3.262-5.801 0-11.117 1.011-15.805 3.009-4.7 2.002-8.475 4.89-11.212 8.587-2.749 3.717-4.12 8.164-4.078 13.224.112 6.175 1.99 11.186 5.577 14.903 3.576 3.697 8.476 6.158 14.567 7.306l13.795 2.81c2.529.502 4.825 1.16 6.823 1.96 1.96.784 3.525 1.803 4.651 3.03 1.1 1.197 1.657 2.772 1.657 4.67 0 2.114-.694 3.9-2.06 5.301-1.4 1.434-3.301 2.515-5.643 3.224-2.388.721-5.058 1.086-7.936 1.086-2.807 0-5.394-.435-7.686-1.297-2.28-.85-4.194-2.093-5.689-3.693-1.491-1.591-2.513-3.585-3.04-5.918l-.075-.327H83.846l.045.46c.407 4.045 1.666 7.629 3.738 10.659 2.068 3.009 4.717 5.545 7.873 7.551 3.148 1.993 6.677 3.514 10.494 4.513a46.33 46.33 0 0 0 11.693 1.5c6.466 0 12.2-1.019 17.046-3.034 4.867-2.022 8.717-4.807 11.449-8.276 2.753-3.493 4.148-7.476 4.148-11.848 0-2.064-.232-4.36-.697-6.822-.478-2.482-1.466-4.948-2.936-7.327ZM25.937 191.763l36.916 53.312H77.87v-79.724H61.072v51.282L25.754 165.53l-.125-.179H9.19v79.724h16.748v-53.312Zm196.637 24.577 14.388-50.987h16.457l-23.587 79.724h-13.367l-14.554-50.469-14.659 50.469h-13.147l-23.533-79.724h16.511l14.384 50.979 14.389-50.979h12.167l14.551 50.987Z",
|
|
27
|
-
className: clsx(
|
|
28
|
-
logoType === "default" && "fill-nsw-blue-800 dark:fill-white",
|
|
29
|
-
(logoType === "reversed" || logoType === "mono-white") && "fill-white",
|
|
30
|
-
logoType === "mono-black" && "fill-black dark:fill-white"
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
),
|
|
34
|
-
/* @__PURE__ */ jsx(
|
|
35
|
-
"path",
|
|
36
|
-
{
|
|
37
|
-
d: "M122.291 145.572c-19.75-2.424-38.934 3.904-72.69-5.263-3.447-.937-4.718 2.694-2.854 5.736 9.07 14.803 54.881 3.203 75.635 1.065.906-.095.814-1.426-.091-1.538ZM208.735 140.309c-33.756 9.167-52.941 2.839-72.691 5.263-.905.112-1 1.447-.091 1.538 20.759 2.138 66.566 13.738 75.635-1.065 1.864-3.042.594-6.673-2.853-5.736ZM59.882 119.132c-6.864-10.058-12.474-21.31-16.818-33.69-13.101 3.826-26.51 9.346-40.16 16.57a5.388 5.388 0 0 0-2.902 4.67 5.38 5.38 0 0 0 2.653 4.812c26.431 15.802 52.273 24.841 76.93 26.933-7.34-4.475-14.072-11.044-19.703-19.295ZM23.059 85.513a201.529 201.529 0 0 1 17.976-6.233c-2.126-6.896-3.87-14.12-5.249-21.658-6.827-.85-13.89-1.4-21.199-1.641-.062 0-.128-.004-.19-.004a5.391 5.391 0 0 0-4.647 2.602 5.383 5.383 0 0 0-.12 5.483c4.243 7.659 8.724 14.808 13.429 21.45ZM88.005 135.572c4.099 1.807 8.293 2.818 12.358 3.029-9.953-7.12-17.773-19.192-22.278-34.58-5.805-19.81-7.745-41.666-5.83-65.247-7.832-4.936-16.32-9.557-25.46-13.85a5.428 5.428 0 0 0-5.402.43 5.396 5.396 0 0 0-2.388 4.841c2.126 34.215 10.95 62.915 26.223 85.298 6.404 9.391 14.281 16.332 22.777 20.079ZM107.488 23.577A253.323 253.323 0 0 0 92.235 6.735c-1.063-1.078-2.433-1.65-3.85-1.65-.506 0-1.017.075-1.523.224-1.923.568-3.314 2.106-3.733 4.115-1.072 5.164-3.11 15.69-4.012 26.101 7.014 4.613 13.492 9.49 19.426 14.621 2.3-8.757 5.29-17.63 8.945-26.569ZM255.42 102.007c-13.65-7.223-27.058-12.744-40.16-16.569-4.343 12.38-9.953 23.631-16.818 33.689-5.63 8.255-12.362 14.82-19.708 19.296 24.658-2.093 50.5-11.132 76.931-26.934 1.715-1.024 2.707-2.822 2.653-4.811-.045-1.99-1.133-3.734-2.898-4.671ZM235.273 85.513c4.705-6.643 9.186-13.796 13.43-21.455.963-1.74.922-3.788-.121-5.483a5.4 5.4 0 0 0-4.837-2.598c-7.309.24-14.377.796-21.199 1.641-1.375 7.539-3.123 14.762-5.249 21.658a203.803 203.803 0 0 1 17.976 6.237ZM180.247 104.025c-4.505 15.384-12.329 27.46-22.278 34.58 4.065-.211 8.263-1.227 12.358-3.034 8.496-3.746 16.373-10.688 22.777-20.075 15.273-22.383 24.097-51.082 26.223-85.297a5.394 5.394 0 0 0-2.388-4.84 5.428 5.428 0 0 0-5.402-.432c-9.14 4.29-17.628 8.91-25.46 13.85 1.915 23.582-.029 45.434-5.83 65.248ZM179.214 35.52c-.901-10.406-2.94-20.932-4.011-26.1-.416-2.01-1.811-3.547-3.733-4.115a5.39 5.39 0 0 0-1.524-.224c-1.416 0-2.787.572-3.85 1.65-5.485 5.549-10.568 11.164-15.252 16.842 3.654 8.939 6.644 17.812 8.949 26.565 5.934-5.127 12.407-10.005 19.421-14.617ZM129.144 87.229c6.64-13.092 17.246-24.829 25.21-32.243-4.372-17.779-11.104-34.55-20.397-52.097C132.998 1.078 131.195 0 129.148 0s-3.845 1.082-4.808 2.889c-9.389 17.604-16.237 35.122-20.377 52.093 8.313 7.688 19.28 20.224 25.181 32.247Z",
|
|
38
|
-
className: clsx(
|
|
39
|
-
(logoType === "default" || logoType === "reversed") && "fill-nsw-red-600 dark:fill-white",
|
|
40
|
-
logoType === "mono-white" && "fill-white",
|
|
41
|
-
logoType === "mono-black" && "fill-black dark:fill-white"
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
/* @__PURE__ */ jsx(
|
|
46
|
-
"path",
|
|
47
|
-
{
|
|
48
|
-
d: "M153.541 133.686c6.885-4.833 13.77-13.254 18.139-24.97 8.458-22.681 9.334-47.945 8.122-65.823-15.331 10.215-39.665 31.55-47.975 54.36-3.911 10.734-5.734 25.355-2.72 33.511 1.259 3.411 3.401 5.997 6.345 7.227 4.46 1.865 11.312.456 18.089-4.305ZM125.713 95.261c-2.027-4.724-4.261-9.18-7.728-14.186-9.809-14.16-23.026-26.933-39.475-38.185-.17 2.652-2.57 31.297 5.851 59.304 6.408 21.302 17.354 29.98 23.354 33.333 6.038 3.369 11.561 4.165 18.039 2.557-6.565-8.935-5.747-27.27-.041-42.823Z",
|
|
49
|
-
className: clsx(
|
|
50
|
-
(logoType === "default" || logoType === "reversed") && "fill-nsw-red-600 dark:fill-white",
|
|
51
|
-
logoType === "mono-white" && "fill-white",
|
|
52
|
-
logoType === "mono-black" && "fill-black dark:fill-white"
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
] })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
57
66
|
] });
|
|
58
67
|
}
|
|
59
68
|
|