@nswds/ui 5.5.4 → 5.7.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/README.md +46 -5
- package/dist/components/breadcrumb.d.ts +10 -0
- package/dist/components/breadcrumb.js +0 -2
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/carousel.d.ts +15 -3
- package/dist/components/carousel.js +100 -16
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/combobox.d.ts +8 -1
- package/dist/components/combobox.js +2 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/main-nav.d.ts +4 -1
- package/dist/components/main-nav.js.map +1 -1
- package/dist/components/sheet.d.ts +6 -1
- package/dist/components/sheet.js +2 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/tabs.d.ts +6 -3
- package/dist/components/tabs.js +90 -23
- package/dist/components/tabs.js.map +1 -1
- package/dist/hooks/use-chrome-height.d.ts +4 -1
- package/dist/hooks/use-chrome-height.js +39 -4
- package/dist/hooks/use-chrome-height.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +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"]}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-chr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UAAA,CAAW,OAAO,QAAQ,CAAA;AAE1B,MAAA,IAAI,UAAA,CAAW,SAAS,CAAA,EAAG;AAGzB,QAAA,UAAA,EAAY,OAAO,QAAQ,CAAA;AAC3B,QAAA,IAAA,CAAK,KAAA,CAAM,eAAe,QAAQ,CAAA;AAClC,QAAA;AAAA,MACF;AAOA,MAAA,MAAM,SAAA,GAAY,CAAC,GAAG,UAAA,CAAW,QAAQ,CAAA;AACzC,MAAA,SAAA,CAAU,SAAA,CAAU,MAAA,GAAS,CAAC,CAAA,IAAI;AAAA,IACpC,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\n/**\n * The live publishers of each custom property, keyed by `<html>` element, then\n * by property name, then by hook instance. The value is a callback that\n * re-measures and republishes.\n *\n * Two instances CAN legitimately share a property name — the default one, most\n * obviously, on a page with a sticky header and a sticky sub-nav that both\n * want to publish. Without this registry, ANY unmount removes the property,\n * and no ResizeObserver fires on the survivor afterwards to put it back\n * (its element has not resized): the offset silently reverts to the CSS\n * fallback and anchor targets start landing behind the chrome.\n *\n * Tracking only the LAST writer is not enough, and looks like it is — it fixes\n * the case where a non-owner unmounts and leaves the owner's unmount doing the\n * same damage as before. So the registry holds every live publisher, and an\n * unmount removes the property only when the last one goes; while any remain,\n * the most recent survivor is asked to republish. That is what makes the\n * promise in the JSDoc below (\"unmounting one never blanks the value another\n * still owns\") actually true rather than true half the time.\n *\n * Insertion order is publish recency: `publish` deletes before it sets, so the\n * final entry is always the instance whose value is currently on the element.\n *\n * Keyed by document so an instance rendered into a portal in another document\n * (a popped-out window) does not collide with the main one. A WeakMap because\n * a torn-down document must stay collectable.\n */\nconst propertyPublishers = new WeakMap<HTMLElement, Map<string, Map<symbol, () => void>>>()\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. Two instances may safely share one\n * property name: the property is cleared only when the LAST of them\n * unmounts, and while any remain a survivor republishes, so unmounting one\n * never blanks the value another still owns.\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 // Identity for this hook instance, used to decide whether it is still the\n // property's owner at cleanup time. Created lazily INSIDE the effect, not\n // during render: it is only ever read there, and a render-phase ref write\n // would be a side effect in render for no benefit. `??=` keeps the same\n // symbol across the effect's re-runs (a changed element or property), which\n // is what makes ownership survive them.\n const instanceRef = React.useRef<symbol | null>(null)\n\n React.useEffect(() => {\n if (!element) {\n return\n }\n\n const root = element.ownerDocument.documentElement\n const instance = (instanceRef.current ??= Symbol('useChromeHeight'))\n\n function publish(next: number) {\n setHeight(next)\n if (!property) {\n return\n }\n let byProperty = propertyPublishers.get(root)\n if (!byProperty) {\n byProperty = new Map()\n propertyPublishers.set(root, byProperty)\n }\n let publishers = byProperty.get(property)\n if (!publishers) {\n publishers = new Map()\n byProperty.set(property, publishers)\n }\n // Delete before set so re-publishing moves this instance to the END of\n // the Map's insertion order. Order is how the cleanup below identifies\n // the instance whose value is actually on the element.\n publishers.delete(instance)\n publishers.set(instance, republish)\n // Last writer wins, matching what the CSS custom property itself does.\n root.style.setProperty(property, `${next}px`)\n }\n\n /**\n * Re-measure and republish, for when a neighbour sharing this property\n * unmounts and would otherwise leave the value cleared.\n *\n * Reads `offsetHeight` rather than the ResizeObserver's `borderBoxSize`,\n * because there is no observer entry here — this runs from another\n * instance's cleanup, not from a resize. Both describe the untransformed\n * border box; offsetHeight is rounded to an integer where blockSize is\n * fractional, so a republished value can differ from an observed one by\n * under a pixel. That is the correct trade against leaving the property\n * unset entirely.\n */\n function republish() {\n // The neighbour's cleanup may run in the same commit that unmounts this\n // instance too. A detached element measures 0, and publishing 0 would be\n // worse than doing nothing; this instance's own cleanup is next anyway.\n if (!element || !element.isConnected) {\n return\n }\n publish(element.offsetHeight)\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 // and reads `offsetHeight`, NOT `contentRect.height`, because the latter\n // is the CONTENT box: on a chrome element with padding or a border the\n // two disagree by exactly that amount, so the fallback would publish a\n // height smaller than the space the element occupies. offsetHeight is\n // border-box and untransformed, which is what borderBoxSize reports.\n const box = entry.borderBoxSize?.[0]\n publish(box ? box.blockSize : element.offsetHeight)\n })\n\n observer.observe(element)\n\n return () => {\n observer.disconnect()\n if (!property) {\n return\n }\n const byProperty = propertyPublishers.get(root)\n const publishers = byProperty?.get(property)\n if (!publishers) {\n return\n }\n publishers.delete(instance)\n\n if (publishers.size === 0) {\n // Nobody left: this really is the \"chrome element went away\" case the\n // JSDoc describes, so clear the property.\n byProperty?.delete(property)\n root.style.removeProperty(property)\n return\n }\n\n // A live instance still publishes here. Whether the value on the element\n // is theirs or ours we cannot clear it — and if it is OURS, theirs has to\n // be restored, because nothing else will: their element has not resized,\n // so no observer callback is coming. Ask the most recent survivor (the\n // last insertion) to re-measure.\n const survivors = [...publishers.values()]\n survivors[survivors.length - 1]?.()\n }\n }, [element, property])\n\n return { ref, height }\n}\n\nexport { useChromeHeight }\nexport type { UseChromeHeightOptions, UseChromeHeightResult }\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export { Step, StepIndicator, StepIndicatorProps, StepNav, StepNavProps, StepNav
|
|
|
54
54
|
export { Switch } from './components/switch.js';
|
|
55
55
|
export { TabNav, TabNavLink, TabNavLinkProps, TabNavProps, tabNavLinkVariants, tabNavListVariants } from './components/tab-nav.js';
|
|
56
56
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './components/table.js';
|
|
57
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants } from './components/tabs.js';
|
|
57
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants, tabsTriggerVariants } from './components/tabs.js';
|
|
58
58
|
export { Textarea } from './components/textarea.js';
|
|
59
59
|
export { ThemeSwitcher, ThemeSwitcherProps, ThemeSwitcherTheme } from './components/theme-switcher.js';
|
|
60
60
|
export { ToggleGroup, ToggleGroupItem } from './components/toggle-group.js';
|