@nswds/ui 5.1.2 → 5.3.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.
Files changed (44) hide show
  1. package/README.md +36 -1
  2. package/dist/components/badge.d.ts +1 -1
  3. package/dist/components/button.d.ts +1 -1
  4. package/dist/components/callout.d.ts +60 -0
  5. package/dist/components/callout.js +65 -0
  6. package/dist/components/callout.js.map +1 -0
  7. package/dist/components/container.d.ts +36 -0
  8. package/dist/components/container.js +54 -0
  9. package/dist/components/container.js.map +1 -0
  10. package/dist/components/description-list.d.ts +72 -0
  11. package/dist/components/description-list.js +67 -0
  12. package/dist/components/description-list.js.map +1 -0
  13. package/dist/components/footer.d.ts +10 -6
  14. package/dist/components/footer.js.map +1 -1
  15. package/dist/components/header.d.ts +1 -1
  16. package/dist/components/link-card.d.ts +54 -0
  17. package/dist/components/link-card.js +82 -0
  18. package/dist/components/link-card.js.map +1 -0
  19. package/dist/components/masthead.d.ts +1 -1
  20. package/dist/components/on-this-page.d.ts +89 -0
  21. package/dist/components/on-this-page.js +127 -0
  22. package/dist/components/on-this-page.js.map +1 -0
  23. package/dist/components/section.d.ts +53 -0
  24. package/dist/components/section.js +44 -0
  25. package/dist/components/section.js.map +1 -0
  26. package/dist/components/skip-link.d.ts +1 -1
  27. package/dist/components/slider.d.ts +86 -0
  28. package/dist/components/slider.js +122 -0
  29. package/dist/components/slider.js.map +1 -0
  30. package/dist/components/tab-nav.d.ts +186 -0
  31. package/dist/components/tab-nav.js +100 -0
  32. package/dist/components/tab-nav.js.map +1 -0
  33. package/dist/hooks/use-chrome-height.d.ts +82 -0
  34. package/dist/hooks/use-chrome-height.js +45 -0
  35. package/dist/hooks/use-chrome-height.js.map +1 -0
  36. package/dist/icons/brands/index.d.ts +13 -0
  37. package/dist/icons/brands/index.js +56 -0
  38. package/dist/icons/brands/index.js.map +1 -0
  39. package/dist/icons/client.d.ts +1 -0
  40. package/dist/icons/client.js +2 -0
  41. package/dist/index.d.ts +10 -0
  42. package/dist/index.js +9 -0
  43. package/dist/styles.css +1 -1
  44. package/package.json +5 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/tab-nav.tsx"],"names":[],"mappings":";;;;;;AAiBA,MAAM,aAAA,GAAgB,KAAA,CAAM,aAAA,CAA0D,IAAI,CAAA;AAiB1F,MAAM,kBAAA,GAAqB,IAAI,6BAAA,EAA+B;AAAA,EAC5D,QAAA,EAAU;AAAA;AAAA;AAAA;AAAA;AAAA,IAKR,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,wBAAA;AAAA,MACN,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,MAAA,EAAQ;AAAA;AAEZ,CAAC;AAsBD,MAAM,kBAAA,GAAqB,GAAA;AAAA,EACzB;AAAA,IACE,uEAAA;AAAA,IACA,QAAA;AAAA,IACA,mCAAA;AAAA,IACA,+BAAA;AAAA,IACA,wCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,6BAAA;AAAA,QACN,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ;AAwGA,SAAS,MAAA,CAAO;AAAA,EACd,SAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAc,SAAA,GAAY,uBAAA;AAAA,EAC1B,GAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAgB;AAGd,EAAA,MAAM,OAAA,GAAU,MAAM,OAAA,CAAQ,OAAO,EAAE,WAAA,EAAY,CAAA,EAAI,CAAC,WAAW,CAAC,CAAA;AAEpE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,GAAA;AAAA,MACA,WAAA,EAAU,SAAA;AAAA,MACV,YAAA,EAAY,SAAA;AAAA,MACZ,SAAA,EAAW,EAAA;AAAA,QACT,WAAA;AAAA,QACA,sEAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,QAAG,IAAA,EAAK,MAAA,EAAO,aAAU,cAAA,EAAe,SAAA,EAAW,GAAG,kBAAA,CAAmB,EAAE,QAAQ,CAAC,GACnF,QAAA,kBAAA,GAAA,CAAC,aAAA,CAAc,UAAd,EAAuB,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS,CAAA,EACpD;AAAA;AAAA,GACF;AAEJ;AA0CA,SAAS,eAAe,UAAA,EAAqB;AAC3C,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,IAAgB,UAAA,EAAY;AACvD,IAAA;AAAA,EACF;AACA,EAAA,OAAA,CAAQ,IAAA;AAAA,IACN;AAAA,GACF;AACF;AAUA,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,QAAA,EAAU,SAAS,IAAA,EAAM,GAAG,OAAM,EAAoB;AACrF,EAAA,MAAM,OAAA,GAAU,KAAA,CAAM,UAAA,CAAW,aAAa,CAAA;AAE9C,EAAA,cAAA,CAAe,YAAY,IAAI,CAAA;AAI/B,EAAA,MAAM,SAAA,GACJ,YACC,OAAA,EAAS,WAAA,KAAgB,UAAa,OAAO,IAAA,KAAS,QAAA,IAAY,IAAA,KAAS,OAAA,CAAQ,WAAA,CAAA;AAEtF,EAAA,uBACE,GAAA,CAAC,IAAA,EAAA,EAAG,WAAA,EAAU,cAAA,EAAe,WAAU,MAAA,EAOrC,QAAA,kBAAA,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,OAAA,EAAQ,UAAA;AAAA,MACR,WAAA,EAAU,cAAA;AAAA,MACV,aAAA,EAAa,YAAY,EAAA,GAAK,MAAA;AAAA,MAC9B,IAAA;AAAA,MACA,cAAA,EAAc,YAAY,MAAA,GAAS,MAAA;AAAA,MACnC,SAAA,EAAW,GAAG,kBAAA,CAAmB,EAAE,SAAS,SAAA,EAAW,GAAG,SAAS,CAAA;AAAA,MAElE;AAAA;AAAA,GACH,EACF,CAAA;AAEJ","file":"tab-nav.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'\n\nimport { Link, type LinkProps } from '../components/link.js'\n\n/**\n * Carries the bar's `currentHref` down to the links without threading it\n * through every call site.\n *\n * `null` means a link is rendering outside a `TabNav` — a real mistake, since\n * nothing would ever be marked current. `warnIfOrphaned` names it in\n * development.\n */\nconst TabNavContext = React.createContext<{ currentHref: string | undefined } | null>(null)\n\n/**\n * The bar itself: a horizontal scroll container with the rule the tabs sit on.\n *\n * The rule is on the LIST, not on the `<nav>`. The nav is the scroll container,\n * so a rule there spans only the visible width and stops dead at the right edge\n * while the tabs keep going — the bar looks broken exactly when it overflows,\n * which is the case that matters. `min-w-max` on the list makes it as wide as\n * its tabs, so the rule runs the full scrollable width instead.\n *\n * The scrollbar is suppressed on the nav, the element that actually scrolls: a\n * visible bar would sit on top of the tabs. The clipped final tab is what\n * signals there is more to the right. Scrolling itself is untouched, so pointer\n * drag, shift-wheel and keyboard all still reach the overflow — the same\n * treatment `OnThisPage` gives its horizontal bar.\n */\nconst tabNavListVariants = cva('flex min-w-max items-center', {\n variants: {\n /**\n * The rule the tabs sit on. Off for a bar inside a `Card` or panel that\n * already draws its own edge, where a second rule reads as a double border.\n */\n border: {\n true: 'border-b border-border',\n false: '',\n },\n },\n defaultVariants: {\n border: true,\n },\n})\n\n/**\n * One tab.\n *\n * `-mb-px` pulls the 2px marker down over the list's 1px rule so the two merge\n * into a single edge, rather than the marker floating a hairline above it.\n *\n * Idle and current ink live in separate branches rather than in the base\n * string. Both are single-class selectors, so with both on the element at once\n * the winner comes down to Tailwind's internal sort order — the same reason\n * `OnThisPage` splits them.\n *\n * The current tab changes colour AND draws the marker rule, so the state is\n * never signalled by colour alone (WCAG 2.2, 1.4.1). The rule is always drawn,\n * `transparent` when idle, so becoming current never changes the tab's size and\n * the bar cannot reflow under the pointer.\n *\n * Floored at 44px on coarse pointers, the promise DESIGN.md makes and\n * `Button`/`PushMenu` hold. `p-4` over a 24px line box already clears it on\n * most type scales; the floor makes that independent of the consumer's scale.\n */\nconst tabNavLinkVariants = cva(\n [\n 'flex shrink-0 items-center border-b-2 p-4 font-bold whitespace-nowrap',\n '-mb-px',\n '[@media(pointer:coarse)]:min-h-11',\n 'motion-safe:transition-colors',\n 'hover:bg-primary/10 hover:text-primary',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring',\n ],\n {\n variants: {\n current: {\n true: 'border-primary text-primary',\n false: 'border-transparent text-foreground',\n },\n },\n defaultVariants: {\n current: false,\n },\n },\n)\n\ntype TabNavProps = React.ComponentPropsWithoutRef<'nav'> &\n VariantProps<typeof tabNavListVariants> & {\n /**\n * The current page's href. The `TabNavLink` whose `href` matches it exactly\n * gets `aria-current='page'` and the marker rule.\n *\n * Matching is EXACT, deliberately. Prefix matching (`pathname.startsWith`)\n * is the obvious shortcut and it is wrong in two directions: `/colour`\n * matches `/colour-blind-safe`, and every parent in a nested set matches at\n * once, so several tabs claim the page. Matching rules beyond equality are\n * the caller's to define — set `current` on the link directly and the bar\n * will not second-guess it.\n *\n * Frameworkless replacement for `usePathname()` — pass your router's\n * pathname in, as with `SideNav`.\n */\n currentHref?: string\n ref?: React.Ref<HTMLElement>\n }\n\n/**\n * Flat horizontal navigation between the pages of one section — the bar that\n * sits under the site header and lists a section's peer pages.\n *\n * **Where it sits among the other navigation components**, none of which it\n * overlaps:\n *\n * | Component | Moves you |\n * | ------------ | ------------------------------------------------ |\n * | `MainNav` | between sites/sections, mega menu |\n * | `SideNav` | between pages, as a tree |\n * | `TabNav` | between the pages of one section, as a flat bar |\n * | `StepNav` | through a multi-page journey |\n * | `OnThisPage` | within the page you are on |\n *\n * The closest neighbours are `SideNav` and `OnThisPage`. `SideNav` does the\n * same job — peer-page navigation — but as a vertical tree with arbitrary\n * nesting; this is the flat horizontal form, for a section whose pages have no\n * hierarchy worth drawing. `OnThisPage` looks nearly identical and is not\n * related: its entries are anchors into the current page, which is why it marks\n * `aria-current='location'` where this marks `'page'`.\n *\n * **These are not ARIA tabs, and must never become them.** The name describes\n * the visual idiom, which is what a designer reaching for this will search for.\n * The semantics are a `<nav>` landmark over a list of links: each one navigates\n * to a different URL, so a reader gets a page load, not a panel swap. Adding\n * `role='tablist'`/`role='tab'` would promise `aria-controls` panels that do\n * not exist and hand the arrow keys a selection model the browser cannot honour\n * across a navigation. `OnThisPage` documents the mirror-image decision about\n * `aria-current`; this is the same care applied to `role`.\n *\n * **No Base UI primitive is involved, and none is missing.** The house rule is\n * never to hand-roll ARIA, focus or keyboard behaviour — but these are plain\n * anchors, which have all three natively, and a link list needs no roving\n * tabindex. Nothing is hand-rolled here because there is nothing to hand-roll.\n *\n * Accessibility contract:\n *\n * - The landmark is named (`aria-label`, default \"Subsection navigation\") so it\n * is distinguishable from the page's other navigation landmarks (WCAG 2.2,\n * 1.3.1). Name it after the section it navigates — \"Colour\", \"Get started\" —\n * whenever you know it; the default only guarantees the landmark is not\n * anonymous.\n * - The current page is marked `aria-current='page'`.\n * - `role='list'` is explicit on the `<ul>`: `list-style: none` strips list\n * semantics in Safari/VoiceOver, the same reason `SideNav`, `StepIndicator`\n * and `OnThisPage` set it.\n * - The current state carries colour AND a marker rule, never colour alone\n * (1.4.1), and the rule occupies its space when idle so nothing reflows.\n * - Focus is always visible via the house outline pattern (2.4.13).\n *\n * Departures from the nswds-app `TabNavigation` source, all deliberate:\n *\n * - **The current tab comes from `currentHref`, not from internal state.** The\n * source tracked the last-clicked tab in a `useState`, which is a click\n * highlighter, not page navigation: on a fresh page load nothing is marked,\n * and after a real navigation the state is gone. Marking the current page is\n * the entire job of this component, so it reads the router's pathname the way\n * `SideNav` does.\n * - **Tabs are identified by `href`, not by a `tabId`.** The source defaulted\n * every link's id to the literal string `'unique-id'`, so any two links\n * without an explicit id shared one identity. Keying off the destination\n * removes the id from the API entirely.\n * - **No hover-pill animation, and no `motion` dependency.** The source\n * animated a floating background between tabs via `motion/react`. The hover\n * state here is a colour derivation per DESIGN.md's Derived State Rule; a\n * design system taking on an animation runtime to decorate one hover is a\n * cost every consumer pays.\n * - Radix `NavigationMenu` → plain semantics. The source used it purely as\n * markup scaffolding, and its `onSelect` is what made the active tab\n * click-driven in the first place.\n * - Links render through `Link`, so frameworks inject their own anchor via\n * `LinkProvider` (`next/link` et al) — as in `SideNav`.\n *\n * @example\n * ```tsx\n * <TabNav currentHref={pathname} aria-label='Colour'>\n * <TabNavLink href='/colour/brand'>Brand palette</TabNavLink>\n * <TabNavLink href='/colour/semantic'>Semantic palette</TabNavLink>\n * </TabNav>\n * ```\n */\nfunction TabNav({\n className,\n children,\n currentHref,\n border,\n 'aria-label': ariaLabel = 'Subsection navigation',\n ref,\n ...props\n}: TabNavProps) {\n // Memoised so every tab does not re-render whenever the consuming page does\n // for an unrelated reason; `currentHref` is the only thing that should move.\n const context = React.useMemo(() => ({ currentHref }), [currentHref])\n\n return (\n <nav\n {...props}\n ref={ref}\n data-slot='tab-nav'\n aria-label={ariaLabel}\n className={cn(\n 'text-base',\n '[scrollbar-width:none] overflow-x-auto [&::-webkit-scrollbar]:hidden',\n className,\n )}\n >\n <ul role='list' data-slot='tab-nav-list' className={cn(tabNavListVariants({ border }))}>\n <TabNavContext.Provider value={context}>{children}</TabNavContext.Provider>\n </ul>\n </nav>\n )\n}\n\n/**\n * `as` is omitted deliberately, not by oversight.\n *\n * `Link` strips `href` from any non-anchor intrinsic element, so `as='button'`\n * typechecked and rendered `<button href=null aria-current='page'>` — a control\n * that cannot navigate, announcing itself as the current *page*. That is a\n * name/role/value mismatch (WCAG 2.2, 4.1.2), not merely a dead link, and it\n * contradicts the nav-over-links contract this component documents.\n *\n * Nothing is lost. A bar whose tabs render as different element types is\n * incoherent by construction, and framework links still arrive the documented\n * way — wrap the bar in `<LinkProvider component={NextLink}>`. `SideNav` sets\n * the same precedent: it renders `Link` internally and never forwards `as`.\n */\ntype TabNavLinkProps = Omit<LinkProps, 'variant' | 'as'> & {\n /**\n * Force the current state, overriding the bar's `currentHref` comparison.\n *\n * The escape hatch for any matching rule other than equality — prefix\n * matching for a nested route, ignoring a query string, treating an index\n * page as current for its children. Compute it from your router and set it\n * here; `TabNav` does not guess.\n *\n * Also the only way to mark the current tab when `href` is a url object,\n * which cannot be compared to a pathname string.\n */\n current?: boolean\n}\n\n/**\n * Dev-only guard, mirroring the misshapen-item check in `SideNav`: a link\n * outside a `TabNav` gets no context and renders an `<li>` with no list around\n * it. No-op in production.\n *\n * The message is careful about what is actually lost. An orphan can still be\n * marked by passing `current` directly — `current ?? …` short-circuits before\n * the context is read — so claiming no tab will be marked would be false\n * exactly when a caller has reached for that escape hatch. What an orphan\n * cannot do is derive the current tab from `currentHref`.\n */\nfunction warnIfOrphaned(hasContext: boolean) {\n if (process.env.NODE_ENV === 'production' || hasContext) {\n return\n }\n console.warn(\n '[nswds/ui] TabNavLink rendered outside a TabNav — it cannot read currentHref, so the current tab is never derived automatically (only an explicit `current` still applies), and its <li> sits outside any list. Wrap the links in <TabNav>.',\n )\n}\n\n/**\n * One tab: a link to a peer page, marked `aria-current='page'` when it is the\n * one being read.\n *\n * Renders its own `<li>`, so `TabNav`'s children are tabs rather than list\n * items — the compound shape `Header`/`HeaderBrand` and `Footer`/`FooterNav`\n * already use.\n */\nfunction TabNavLink({ className, children, current, href, ...props }: TabNavLinkProps) {\n const context = React.useContext(TabNavContext)\n\n warnIfOrphaned(context !== null)\n\n // Exact match only, and only for string hrefs — see `TabNav`'s `currentHref`\n // for why prefix matching is not offered, and `current` for url objects.\n const isCurrent =\n current ??\n (context?.currentHref !== undefined && typeof href === 'string' && href === context.currentHref)\n\n return (\n <li data-slot='tab-nav-item' className='flex'>\n {/* variant='unstyled' — the bar supplies the complete tab treatment, and\n Link's underline/colour variants would fight it. Rendering through\n Link still picks up the framework link component from LinkProvider. */}\n {/* `{...props}` spreads FIRST so the computed state below always wins. A\n consumer passing their own `aria-current` would otherwise silently\n beat the `current` prop, leaving two sources of truth for one state. */}\n <Link\n {...props}\n variant='unstyled'\n data-slot='tab-nav-link'\n data-active={isCurrent ? '' : undefined}\n href={href}\n aria-current={isCurrent ? 'page' : undefined}\n className={cn(tabNavLinkVariants({ current: isCurrent }), className)}\n >\n {children}\n </Link>\n </li>\n )\n}\n\nexport { TabNav, TabNavLink, tabNavLinkVariants, tabNavListVariants }\nexport type { TabNavLinkProps, TabNavProps }\n"]}
@@ -0,0 +1,82 @@
1
+ import * as React from 'react';
2
+
3
+ type UseChromeHeightOptions = {
4
+ /**
5
+ * Custom property to publish the measured height to, on `<html>`. Pass
6
+ * `null` to publish nothing and use the returned number only.
7
+ *
8
+ * @default '--chrome-height'
9
+ */
10
+ property?: string | null;
11
+ };
12
+ type UseChromeHeightResult<T extends HTMLElement> = {
13
+ /**
14
+ * Attach to the element whose height should be tracked.
15
+ *
16
+ * A CALLBACK ref, not a ref object, for two reasons. It re-attaches the
17
+ * observer when the element itself changes — a chrome wrapper that unmounts
18
+ * and remounts, or swaps between two elements, would otherwise leave the
19
+ * observer watching the detached node, because an effect keyed on a ref
20
+ * object never re-runs when only `.current` changes. And it keeps the
21
+ * returned value readable during render: React Compiler's lint rejects
22
+ * reading a ref there, which a consumer doing `ref={chrome.ref}` would
23
+ * otherwise trip on every use.
24
+ */
25
+ ref: React.RefCallback<T>;
26
+ /** Live measured height in CSS pixels. `0` until the first measurement. */
27
+ height: number;
28
+ };
29
+ /**
30
+ * Measures a sticky chrome element and publishes its height as a CSS custom
31
+ * property on `<html>`, keeping it current as the element resizes.
32
+ *
33
+ * **Why this belongs in the package.** Several components already need the
34
+ * height of the chrome above them and have no way to ask for it: `MainNav`
35
+ * documents that a consumer stacking it under a sticky `Header` must set
36
+ * `--main-nav-top` to the header's height, and any page with anchor links
37
+ * needs the same number for `scroll-padding-top` or its targets land behind
38
+ * the chrome. Every consumer was therefore writing the same `ResizeObserver`,
39
+ * and the failure it prevents only appears at the widths where the header
40
+ * wraps to a second line — which is exactly where hand-written versions were
41
+ * hardcoding a constant instead.
42
+ *
43
+ * ```tsx
44
+ * const { ref, height } = useChromeHeight({ property: '--site-chrome-height' })
45
+ *
46
+ * return (
47
+ * <div ref={ref} className='sticky top-0 z-40'>
48
+ * <Header sticky={false} />
49
+ * <MainNav navigation={nav} />
50
+ * </div>
51
+ * )
52
+ * ```
53
+ *
54
+ * ```css
55
+ * html {
56
+ * scroll-padding-top: calc(var(--site-chrome-height, 0px) + 1.5rem);
57
+ * }
58
+ * ```
59
+ *
60
+ * Notes:
61
+ *
62
+ * - **Destructure the result, as above — do not hold it as one object.**
63
+ * `const chrome = useChromeHeight(); chrome.height` fails React Compiler's
64
+ * lint with *"Cannot access refs during render"*: the returned object carries
65
+ * a `ref`, so the compiler treats reading any property off it as reading a
66
+ * ref. Destructuring at the call site gives two plain bindings and the rule
67
+ * does not apply. Projects without that lint are unaffected either way.
68
+ * - **The number is `0` until after mount.** It is measured in an effect, so
69
+ * the server render and the first client render agree — reading the DOM
70
+ * during render would be a hydration mismatch. Give the custom property a
71
+ * fallback in CSS (`var(--site-chrome-height, 0px)`) for that first paint.
72
+ * - **The property is removed on unmount**, and whenever the tracked element
73
+ * changes, so a chrome element that goes away does not leave a stale offset
74
+ * behind for whatever renders next.
75
+ * - Height comes from `borderBoxSize`, not `getBoundingClientRect()`: the
76
+ * latter reports the *transformed* size, so a chrome element that animates
77
+ * with a transform would publish a height that does not match the space it
78
+ * occupies in layout.
79
+ */
80
+ declare function useChromeHeight<T extends HTMLElement = HTMLElement>({ property, }?: UseChromeHeightOptions): UseChromeHeightResult<T>;
81
+
82
+ export { type UseChromeHeightOptions, type UseChromeHeightResult, useChromeHeight };
@@ -0,0 +1,45 @@
1
+ "use client"
2
+ import * as React from 'react';
3
+
4
+ const DEFAULT_PROPERTY = "--chrome-height";
5
+ function useChromeHeight({
6
+ property = DEFAULT_PROPERTY
7
+ } = {}) {
8
+ const [element, setElement] = React.useState(null);
9
+ const [height, setHeight] = React.useState(0);
10
+ const ref = React.useCallback((node) => {
11
+ setElement(node);
12
+ }, []);
13
+ React.useEffect(() => {
14
+ if (!element) {
15
+ return;
16
+ }
17
+ const root = element.ownerDocument.documentElement;
18
+ function publish(next) {
19
+ setHeight(next);
20
+ if (property) {
21
+ root.style.setProperty(property, `${next}px`);
22
+ }
23
+ }
24
+ const observer = new ResizeObserver((entries) => {
25
+ const entry = entries[0];
26
+ if (!entry) {
27
+ return;
28
+ }
29
+ const box = entry.borderBoxSize?.[0];
30
+ publish(box ? box.blockSize : entry.contentRect.height);
31
+ });
32
+ observer.observe(element);
33
+ return () => {
34
+ observer.disconnect();
35
+ if (property) {
36
+ root.style.removeProperty(property);
37
+ }
38
+ };
39
+ }, [element, property]);
40
+ return { ref, height };
41
+ }
42
+
43
+ export { useChromeHeight };
44
+ //# sourceMappingURL=use-chrome-height.js.map
45
+ //# sourceMappingURL=use-chrome-height.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/hooks/use-chrome-height.ts"],"names":[],"mappings":";;AAKA,MAAM,gBAAA,GAAmB,iBAAA;AAiFzB,SAAS,eAAA,CAAqD;AAAA,EAC5D,QAAA,GAAW;AACb,CAAA,GAA4B,EAAC,EAA6B;AAGxD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAmB,IAAI,CAAA;AAC3D,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,KAAA,CAAM,SAAS,CAAC,CAAA;AAO5C,EAAA,MAAM,GAAA,GAAM,KAAA,CAAM,WAAA,CAAkC,CAAC,IAAA,KAAS;AAC5D,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,KAAA,CAAM,UAAU,MAAM;AACpB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,IAAA,GAAO,QAAQ,aAAA,CAAc,eAAA;AAEnC,IAAA,SAAS,QAAQ,IAAA,EAAc;AAC7B,MAAA,SAAA,CAAU,IAAI,CAAA;AACd,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,IAAA,CAAK,KAAA,CAAM,WAAA,CAAY,QAAA,EAAU,CAAA,EAAG,IAAI,CAAA,EAAA,CAAI,CAAA;AAAA,MAC9C;AAAA,IACF;AAEA,IAAA,MAAM,QAAA,GAAW,IAAI,cAAA,CAAe,CAAC,OAAA,KAAY;AAC/C,MAAA,MAAM,KAAA,GAAQ,QAAQ,CAAC,CAAA;AACvB,MAAA,IAAI,CAAC,KAAA,EAAO;AACV,QAAA;AAAA,MACF;AAMA,MAAA,MAAM,GAAA,GAAM,KAAA,CAAM,aAAA,GAAgB,CAAC,CAAA;AACnC,MAAA,OAAA,CAAQ,GAAA,GAAM,GAAA,CAAI,SAAA,GAAY,KAAA,CAAM,YAAY,MAAM,CAAA;AAAA,IACxD,CAAC,CAAA;AAED,IAAA,QAAA,CAAS,QAAQ,OAAO,CAAA;AAExB,IAAA,OAAO,MAAM;AACX,MAAA,QAAA,CAAS,UAAA,EAAW;AACpB,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,IAAA,CAAK,KAAA,CAAM,eAAe,QAAQ,CAAA;AAAA,MACpC;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,OAAA,EAAS,QAAQ,CAAC,CAAA;AAEtB,EAAA,OAAO,EAAE,KAAK,MAAA,EAAO;AACvB","file":"use-chrome-height.js","sourcesContent":["'use client'\n\nimport * as React from 'react'\n\n/** Default custom property the measured height is published to. */\nconst DEFAULT_PROPERTY = '--chrome-height'\n\ntype UseChromeHeightOptions = {\n /**\n * Custom property to publish the measured height to, on `<html>`. Pass\n * `null` to publish nothing and use the returned number only.\n *\n * @default '--chrome-height'\n */\n property?: string | null\n}\n\ntype UseChromeHeightResult<T extends HTMLElement> = {\n /**\n * Attach to the element whose height should be tracked.\n *\n * A CALLBACK ref, not a ref object, for two reasons. It re-attaches the\n * observer when the element itself changes — a chrome wrapper that unmounts\n * and remounts, or swaps between two elements, would otherwise leave the\n * observer watching the detached node, because an effect keyed on a ref\n * object never re-runs when only `.current` changes. And it keeps the\n * returned value readable during render: React Compiler's lint rejects\n * reading a ref there, which a consumer doing `ref={chrome.ref}` would\n * otherwise trip on every use.\n */\n ref: React.RefCallback<T>\n /** Live measured height in CSS pixels. `0` until the first measurement. */\n height: number\n}\n\n/**\n * Measures a sticky chrome element and publishes its height as a CSS custom\n * property on `<html>`, keeping it current as the element resizes.\n *\n * **Why this belongs in the package.** Several components already need the\n * height of the chrome above them and have no way to ask for it: `MainNav`\n * documents that a consumer stacking it under a sticky `Header` must set\n * `--main-nav-top` to the header's height, and any page with anchor links\n * needs the same number for `scroll-padding-top` or its targets land behind\n * the chrome. Every consumer was therefore writing the same `ResizeObserver`,\n * and the failure it prevents only appears at the widths where the header\n * wraps to a second line — which is exactly where hand-written versions were\n * hardcoding a constant instead.\n *\n * ```tsx\n * const { ref, height } = useChromeHeight({ property: '--site-chrome-height' })\n *\n * return (\n * <div ref={ref} className='sticky top-0 z-40'>\n * <Header sticky={false} />\n * <MainNav navigation={nav} />\n * </div>\n * )\n * ```\n *\n * ```css\n * html {\n * scroll-padding-top: calc(var(--site-chrome-height, 0px) + 1.5rem);\n * }\n * ```\n *\n * Notes:\n *\n * - **Destructure the result, as above — do not hold it as one object.**\n * `const chrome = useChromeHeight(); chrome.height` fails React Compiler's\n * lint with *\"Cannot access refs during render\"*: the returned object carries\n * a `ref`, so the compiler treats reading any property off it as reading a\n * ref. Destructuring at the call site gives two plain bindings and the rule\n * does not apply. Projects without that lint are unaffected either way.\n * - **The number is `0` until after mount.** It is measured in an effect, so\n * the server render and the first client render agree — reading the DOM\n * during render would be a hydration mismatch. Give the custom property a\n * fallback in CSS (`var(--site-chrome-height, 0px)`) for that first paint.\n * - **The property is removed on unmount**, and whenever the tracked element\n * changes, so a chrome element that goes away does not leave a stale offset\n * behind for whatever renders next.\n * - Height comes from `borderBoxSize`, not `getBoundingClientRect()`: the\n * latter reports the *transformed* size, so a chrome element that animates\n * with a transform would publish a height that does not match the space it\n * occupies in layout.\n */\nfunction useChromeHeight<T extends HTMLElement = HTMLElement>({\n property = DEFAULT_PROPERTY,\n}: UseChromeHeightOptions = {}): UseChromeHeightResult<T> {\n // The measured element is STATE, not a ref: the effect below has to re-run\n // when it changes, and a ref mutation does not re-render or re-run anything.\n const [element, setElement] = React.useState<T | null>(null)\n const [height, setHeight] = React.useState(0)\n\n // Wrapped rather than handing back `setElement` directly. A state setter also\n // accepts an updater FUNCTION, so its type is wider than a ref callback's and\n // its contract subtly different; this is exactly `RefCallback<T>` and nothing\n // more. `useCallback` keeps it stable, so React does not detach and reattach\n // the ref on every render.\n const ref = React.useCallback<React.RefCallback<T>>((node) => {\n setElement(node)\n }, [])\n\n React.useEffect(() => {\n if (!element) {\n return\n }\n\n const root = element.ownerDocument.documentElement\n\n function publish(next: number) {\n setHeight(next)\n if (property) {\n root.style.setProperty(property, `${next}px`)\n }\n }\n\n const observer = new ResizeObserver((entries) => {\n const entry = entries[0]\n if (!entry) {\n return\n }\n\n // `borderBoxSize` is the layout size, unaffected by any transform on the\n // element. It is an array to allow for fragmented boxes; the first entry\n // is the whole box for everything this hook is used on. The fallback\n // covers the (now historical) browsers that reported only contentRect.\n const box = entry.borderBoxSize?.[0]\n publish(box ? box.blockSize : entry.contentRect.height)\n })\n\n observer.observe(element)\n\n return () => {\n observer.disconnect()\n if (property) {\n root.style.removeProperty(property)\n }\n }\n }, [element, property])\n\n return { ref, height }\n}\n\nexport { useChromeHeight }\nexport type { UseChromeHeightOptions, UseChromeHeightResult }\n"]}
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { SVGProps } from 'react';
3
+
4
+ type IconProps = SVGProps<SVGSVGElement>;
5
+
6
+ declare function IconFacebook(props: IconProps): React.JSX.Element;
7
+ declare function IconX(props: IconProps): React.JSX.Element;
8
+ declare function IconYouTube(props: IconProps): React.JSX.Element;
9
+ declare function IconLinkedIn(props: IconProps): React.JSX.Element;
10
+ declare function IconInstagram(props: IconProps): React.JSX.Element;
11
+ declare function IconGitHub(props: IconProps): React.JSX.Element;
12
+
13
+ export { IconFacebook, IconGitHub, IconInstagram, IconLinkedIn, IconX, IconYouTube };
@@ -0,0 +1,56 @@
1
+ "use client"
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ function BrandGlyph({ children, ...props }) {
5
+ return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", "data-slot": "icon", ...props, children });
6
+ }
7
+ function IconFacebook(props) {
8
+ return /* @__PURE__ */ jsx(BrandGlyph, { ...props, children: /* @__PURE__ */ jsx(
9
+ "path",
10
+ {
11
+ fillRule: "evenodd",
12
+ clipRule: "evenodd",
13
+ d: "M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z"
14
+ }
15
+ ) });
16
+ }
17
+ function IconX(props) {
18
+ return /* @__PURE__ */ jsx(BrandGlyph, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M13.6823 10.6218 20.2391 3H18.6854L12.9921 9.61788 8.44486 3H3.2002L10.0765 13.0074 3.2002 21H4.75404L10.7663 14.0113 15.5685 21H20.8131L13.6819 10.6218H13.6823ZM11.5541 13.0956 10.8574 12.0991 5.31391 4.16971H7.70053L12.1742 10.5689 12.8709 11.5655 18.6861 19.8835H16.2995L11.5541 13.096V13.0956Z" }) });
19
+ }
20
+ function IconYouTube(props) {
21
+ return /* @__PURE__ */ jsx(BrandGlyph, { ...props, children: /* @__PURE__ */ jsx(
22
+ "path",
23
+ {
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd",
26
+ d: "M19.812 5.418c.861.23 1.538.907 1.768 1.768C21.998 8.746 22 12 22 12s0 3.255-.418 4.814a2.504 2.504 0 0 1-1.768 1.768c-1.56.419-7.814.419-7.814.419s-6.255 0-7.814-.419a2.505 2.505 0 0 1-1.768-1.768C2 15.255 2 12 2 12s0-3.255.417-4.814a2.507 2.507 0 0 1 1.768-1.768C5.744 5 11.998 5 11.998 5s6.255 0 7.814.418ZM15.194 12 10 15V9l5.194 3Z"
27
+ }
28
+ ) });
29
+ }
30
+ function IconLinkedIn(props) {
31
+ return /* @__PURE__ */ jsx(BrandGlyph, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M19 3A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3H19M18.5 18.5V13.2A3.26 3.26 0 0 0 15.24 9.94C14.39 9.94 13.4 10.46 12.92 11.24V10.13H10.13V18.5H12.92V13.57C12.92 12.8 13.54 12.17 14.31 12.17A1.4 1.4 0 0 1 15.71 13.57V18.5H18.5M6.88 8.56A1.68 1.68 0 0 0 8.56 6.88C8.56 5.95 7.81 5.19 6.88 5.19A1.69 1.69 0 0 0 5.19 6.88C5.19 7.81 5.95 8.56 6.88 8.56M8.27 18.5V10.13H5.5V18.5H8.27Z" }) });
32
+ }
33
+ function IconInstagram(props) {
34
+ return /* @__PURE__ */ jsx(BrandGlyph, { ...props, children: /* @__PURE__ */ jsx(
35
+ "path",
36
+ {
37
+ fillRule: "evenodd",
38
+ clipRule: "evenodd",
39
+ d: "M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z"
40
+ }
41
+ ) });
42
+ }
43
+ function IconGitHub(props) {
44
+ return /* @__PURE__ */ jsx(BrandGlyph, { ...props, children: /* @__PURE__ */ jsx(
45
+ "path",
46
+ {
47
+ fillRule: "evenodd",
48
+ clipRule: "evenodd",
49
+ d: "M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
50
+ }
51
+ ) });
52
+ }
53
+
54
+ export { IconFacebook, IconGitHub, IconInstagram, IconLinkedIn, IconX, IconYouTube };
55
+ //# sourceMappingURL=index.js.map
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/icons/brands/index.tsx"],"names":[],"mappings":";;AAoDA,SAAS,UAAA,CAAW,EAAE,QAAA,EAAU,GAAG,OAAM,EAAc;AACrD,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,OAAA,EAAQ,WAAA,EAAY,IAAA,EAAK,gBAAe,WAAA,EAAU,MAAA,EAAQ,GAAG,KAAA,EAC/D,QAAA,EACH,CAAA;AAEJ;AAEO,SAAS,aAAa,KAAA,EAAkB;AAC7C,EAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAS,SAAA;AAAA,MACT,QAAA,EAAS,SAAA;AAAA,MACT,CAAA,EAAE;AAAA;AAAA,GACJ,EACF,CAAA;AAEJ;AAEO,SAAS,MAAM,KAAA,EAAkB;AACtC,EAAA,uBACE,GAAA,CAAC,cAAY,GAAG,KAAA,EACd,8BAAC,MAAA,EAAA,EAAK,CAAA,EAAE,6SAA4S,CAAA,EACtT,CAAA;AAEJ;AAEO,SAAS,YAAY,KAAA,EAAkB;AAC5C,EAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAS,SAAA;AAAA,MACT,QAAA,EAAS,SAAA;AAAA,MACT,CAAA,EAAE;AAAA;AAAA,GACJ,EACF,CAAA;AAEJ;AAEO,SAAS,aAAa,KAAA,EAAkB;AAC7C,EAAA,uBACE,GAAA,CAAC,cAAY,GAAG,KAAA,EACd,8BAAC,MAAA,EAAA,EAAK,CAAA,EAAE,wZAAuZ,CAAA,EACja,CAAA;AAEJ;AAEO,SAAS,cAAc,KAAA,EAAkB;AAC9C,EAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAS,SAAA;AAAA,MACT,QAAA,EAAS,SAAA;AAAA,MACT,CAAA,EAAE;AAAA;AAAA,GACJ,EACF,CAAA;AAEJ;AAEO,SAAS,WAAW,KAAA,EAAkB;AAC3C,EAAA,uBACE,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EACd,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAS,SAAA;AAAA,MACT,QAAA,EAAS,SAAA;AAAA,MACT,CAAA,EAAE;AAAA;AAAA,GACJ,EACF,CAAA;AAEJ","file":"index.js","sourcesContent":["'use client'\n\nimport type { IconProps } from '../types.js'\n\n/**\n * Third-party brand marks, for the footer's social row.\n *\n * **Why these are not in the main icon set.** That set is Material\n * Symbols — 3,900+ glyphs, generated from a dump by\n * `scripts/generate-icons.mjs`, and containing no brand marks at all. But\n * `FooterSocialLinkItem` REQUIRES an `icon`, so the footer could not be\n * completed from the package alone and every NSW site hand-copied the same six\n * SVG paths. They then drift independently: X replaced Twitter once already,\n * and each site absorbed that on its own schedule.\n *\n * They live in a subdirectory rather than beside the generated modules for two\n * concrete reasons:\n *\n * - `generate-icons.mjs regenerate` **deletes everything** in `src/icons/`\n * before writing, so a hand-authored module there is lost on the next\n * regeneration.\n * - `check:icons` requires every `*.tsx` directly in `src/icons/` to be listed\n * in the generated barrel and to export `Icon<PascalCasedFilename>`. It reads\n * that directory non-recursively, so this subdirectory is correctly invisible\n * to it.\n *\n * **These are client references, unlike the generated set.** They are handed to\n * `FooterSocialLink` — a client component — as a prop, and a plain server\n * module's function cannot cross that boundary (\"Functions cannot be passed\n * directly to Client Components\"). The `'use client'` directive makes each\n * export serialisable, so the component form works from a server page.\n *\n * The cost is that the module ships to the browser, where a plain icon module\n * rendered as an element (`<IconLinkedIn />`) would ship nothing. That trade is\n * deliberate here and not in the generated set: brand marks exist for the\n * footer's social row, which renders through `ButtonLink` — already a client\n * component — so the marks were bound for the client anyway, and six small\n * paths is a fair price for the component form working. Consumers who want the\n * zero-JavaScript path can still pass an element. The `icons/client` entry\n * point makes the same trade for the Material Symbols set, and its source has\n * the fuller explanation.\n *\n * Each mark is a `currentColor` glyph on a 24×24 grid, so `FooterSocialLink`\n * sizes and colours it through `ButtonLink`'s icon slot, which also supplies\n * the 44px touch target and the accessible name.\n *\n * Marks are reproduced from each platform's published brand assets. They are\n * the trademarks of their respective owners and are included solely to link to\n * an official NSW Government presence on those platforms; they carry no NSW\n * Government endorsement of the platform, and must not be restyled beyond\n * colour.\n */\nfunction BrandGlyph({ children, ...props }: IconProps) {\n return (\n <svg viewBox='0 0 24 24' fill='currentColor' data-slot='icon' {...props}>\n {children}\n </svg>\n )\n}\n\nexport function IconFacebook(props: IconProps) {\n return (\n <BrandGlyph {...props}>\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z'\n />\n </BrandGlyph>\n )\n}\n\nexport function IconX(props: IconProps) {\n return (\n <BrandGlyph {...props}>\n <path d='M13.6823 10.6218 20.2391 3H18.6854L12.9921 9.61788 8.44486 3H3.2002L10.0765 13.0074 3.2002 21H4.75404L10.7663 14.0113 15.5685 21H20.8131L13.6819 10.6218H13.6823ZM11.5541 13.0956 10.8574 12.0991 5.31391 4.16971H7.70053L12.1742 10.5689 12.8709 11.5655 18.6861 19.8835H16.2995L11.5541 13.096V13.0956Z' />\n </BrandGlyph>\n )\n}\n\nexport function IconYouTube(props: IconProps) {\n return (\n <BrandGlyph {...props}>\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M19.812 5.418c.861.23 1.538.907 1.768 1.768C21.998 8.746 22 12 22 12s0 3.255-.418 4.814a2.504 2.504 0 0 1-1.768 1.768c-1.56.419-7.814.419-7.814.419s-6.255 0-7.814-.419a2.505 2.505 0 0 1-1.768-1.768C2 15.255 2 12 2 12s0-3.255.417-4.814a2.507 2.507 0 0 1 1.768-1.768C5.744 5 11.998 5 11.998 5s6.255 0 7.814.418ZM15.194 12 10 15V9l5.194 3Z'\n />\n </BrandGlyph>\n )\n}\n\nexport function IconLinkedIn(props: IconProps) {\n return (\n <BrandGlyph {...props}>\n <path d='M19 3A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3H19M18.5 18.5V13.2A3.26 3.26 0 0 0 15.24 9.94C14.39 9.94 13.4 10.46 12.92 11.24V10.13H10.13V18.5H12.92V13.57C12.92 12.8 13.54 12.17 14.31 12.17A1.4 1.4 0 0 1 15.71 13.57V18.5H18.5M6.88 8.56A1.68 1.68 0 0 0 8.56 6.88C8.56 5.95 7.81 5.19 6.88 5.19A1.69 1.69 0 0 0 5.19 6.88C5.19 7.81 5.95 8.56 6.88 8.56M8.27 18.5V10.13H5.5V18.5H8.27Z' />\n </BrandGlyph>\n )\n}\n\nexport function IconInstagram(props: IconProps) {\n return (\n <BrandGlyph {...props}>\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z'\n />\n </BrandGlyph>\n )\n}\n\nexport function IconGitHub(props: IconProps) {\n return (\n <BrandGlyph {...props}>\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z'\n />\n </BrandGlyph>\n )\n}\n"]}
@@ -0,0 +1 @@
1
+ export * from './index.js'
@@ -0,0 +1,2 @@
1
+ "use client"
2
+ export * from './index.js';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  export { AspectRatio } from './components/aspect-ratio.js';
2
2
  export { Badge, BadgeButton, BadgeButtonProps, BadgeLink, BadgeLinkProps, BadgeProps, badgeVariants } from './components/badge.js';
3
3
  export { Button, ButtonLink, ButtonLinkProps, ButtonProps, IconSlot, TouchTarget, buttonVariants } from './components/button.js';
4
+ export { Callout, CalloutProps, CalloutStatus, calloutVariants } from './components/callout.js';
4
5
  export { Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps } from './components/card.js';
5
6
  export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './components/collapsible.js';
7
+ export { Container, ContainerProps, containerVariants } from './components/container.js';
8
+ export { DescriptionDetails, DescriptionDetailsProps, DescriptionList, DescriptionListProps, DescriptionTerm, DescriptionTermProps, descriptionListVariants } from './components/description-list.js';
6
9
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './components/drawer.js';
7
10
  export { ExpandableSearch, ExpandableSearchButtonProps, ExpandableSearchField, ExpandableSearchFieldProps, ExpandableSearchProps, ExpandableSearchVariant, expandableSearchVariants } from './components/expandable-search.js';
8
11
  export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps } from './components/field.js';
@@ -12,24 +15,30 @@ export { HoverCard, HoverCardContent, HoverCardTrigger } from './components/hove
12
15
  export { Input, InputProps } from './components/input.js';
13
16
  export { Label, LabelProps } from './components/label.js';
14
17
  export { LabeledSeparator, LabeledSeparatorProps } from './components/labeled-separator.js';
18
+ export { LinkCard, LinkCardProps } from './components/link-card.js';
15
19
  export { ExternalLink, ExternalLinkProps, Link, LinkComponent, LinkProps, LinkProvider, LinkUrlObject, linkVariants } from './components/link.js';
16
20
  export { Logo, LogoProps } from './components/logo.js';
17
21
  export { MainNav, MainNavColor, MainNavItem, MainNavLinkItem, MainNavProps, mainNavColors, mainNavContainerVariants, mainNavPanelVariants, mainNavVariants } from './components/main-nav.js';
18
22
  export { Masthead, MastheadColor, MastheadProps, mastheadContainerVariants, mastheadVariants } from './components/masthead.js';
23
+ export { OnThisPage, OnThisPageItem, OnThisPageProps } from './components/on-this-page.js';
19
24
  export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from './components/popover.js';
20
25
  export { PUSH_MENU_DURATION_MS, PushMenu, PushMenuItem, PushMenuLevel, PushMenuProps, generatePushMenuBreadcrumb } from './components/push-menu.js';
21
26
  export { ResizableHandle, ResizablePanel, ResizablePanelGroup } from './components/resizable.js';
22
27
  export { ScrollArea, ScrollBar } from './components/scroll-area.js';
28
+ export { Section, SectionProps, sectionVariants } from './components/section.js';
23
29
  export { Separator, SeparatorProps } from './components/separator.js';
24
30
  export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from './components/sheet.js';
25
31
  export { SideNav, SideNavItem, SideNavProps, SideNavRowVariantProps, sideNavRowVariants } from './components/side-nav.js';
26
32
  export { SiteSearch, SiteSearchGroup, SiteSearchItem, SiteSearchProps } from './components/site-search.js';
27
33
  export { SkipLink, SkipLinkProps, SkipLinks, SkipLinksProps, skipLinkVariants } from './components/skip-link.js';
34
+ export { Slider, SliderControl, SliderIndicator, SliderLabel, SliderProps, SliderRoot, SliderThumb, SliderTrack, SliderValue } from './components/slider.js';
28
35
  export { Toaster } from './components/sonner.js';
29
36
  export { Spinner, SpinnerProps } from './components/spinner.js';
30
37
  export { Step, StepIndicator, StepIndicatorProps, StepNav, StepNavProps, StepNavSection, StepStatus, stepStatusStyles } from './components/step-indicator.js';
38
+ export { TabNav, TabNavLink, TabNavLinkProps, TabNavProps, tabNavLinkVariants, tabNavListVariants } from './components/tab-nav.js';
31
39
  export { ThemeSwitcher, ThemeSwitcherProps, ThemeSwitcherTheme } from './components/theme-switcher.js';
32
40
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './components/tooltip.js';
41
+ export { UseChromeHeightOptions, UseChromeHeightResult, useChromeHeight } from './hooks/use-chrome-height.js';
33
42
  export { cn } from './lib/utils.js';
34
43
  import 'react';
35
44
  import 'class-variance-authority/types';
@@ -44,6 +53,7 @@ import 'react-resizable-panels';
44
53
  import '@base-ui/react/scroll-area';
45
54
  import '@base-ui/react/separator';
46
55
  import '@base-ui/react/dialog';
56
+ import '@base-ui/react/slider';
47
57
  import 'sonner';
48
58
  import '@base-ui/react/tooltip';
49
59
  import 'clsx';
package/dist/index.js CHANGED
@@ -1,8 +1,11 @@
1
1
  export * from './components/aspect-ratio.js';
2
2
  export * from './components/badge.js';
3
3
  export * from './components/button.js';
4
+ export * from './components/callout.js';
4
5
  export * from './components/card.js';
5
6
  export * from './components/collapsible.js';
7
+ export * from './components/container.js';
8
+ export * from './components/description-list.js';
6
9
  export * from './components/drawer.js';
7
10
  export * from './components/expandable-search.js';
8
11
  export * from './components/field.js';
@@ -12,24 +15,30 @@ export * from './components/hover-card.js';
12
15
  export * from './components/input.js';
13
16
  export * from './components/label.js';
14
17
  export * from './components/labeled-separator.js';
18
+ export * from './components/link-card.js';
15
19
  export * from './components/link.js';
16
20
  export * from './components/logo.js';
17
21
  export * from './components/main-nav.js';
18
22
  export * from './components/masthead.js';
23
+ export * from './components/on-this-page.js';
19
24
  export * from './components/popover.js';
20
25
  export * from './components/push-menu.js';
21
26
  export * from './components/resizable.js';
22
27
  export * from './components/scroll-area.js';
28
+ export * from './components/section.js';
23
29
  export * from './components/separator.js';
24
30
  export * from './components/sheet.js';
25
31
  export * from './components/side-nav.js';
26
32
  export * from './components/site-search.js';
27
33
  export * from './components/skip-link.js';
34
+ export * from './components/slider.js';
28
35
  export * from './components/sonner.js';
29
36
  export * from './components/spinner.js';
30
37
  export * from './components/step-indicator.js';
38
+ export * from './components/tab-nav.js';
31
39
  export * from './components/theme-switcher.js';
32
40
  export * from './components/tooltip.js';
41
+ export * from './hooks/use-chrome-height.js';
33
42
  export * from './lib/utils.js';
34
43
  //# sourceMappingURL=index.js.map
35
44
  //# sourceMappingURL=index.js.map