@lucian-seo/lucian-ui 0.2.1 → 0.2.2
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/lib/{Input-DzJm1Kv4.js → Input-Bv2FRGIe.js} +2 -2
- package/dist/lib/{Input-DzJm1Kv4.js.map → Input-Bv2FRGIe.js.map} +1 -1
- package/dist/lib/{Pagination-AWL5k5zG.js → Popover-Cq6yhJaK.js} +193 -132
- package/dist/lib/Popover-Cq6yhJaK.js.map +1 -0
- package/dist/lib/{Switch-DyKAqvde.js → Switch-DmKcoBT0.js} +3 -3
- package/dist/lib/Switch-DmKcoBT0.js.map +1 -0
- package/dist/lib/{Tag-Z8PjnJFt.js → Tag-CnNuj4nV.js} +2 -2
- package/dist/lib/{Tag-Z8PjnJFt.js.map → Tag-CnNuj4nV.js.map} +1 -1
- package/dist/lib/{TagInput-CeA0n7ax.js → TagInput-BcSSnJY_.js} +4 -4
- package/dist/lib/{TagInput-CeA0n7ax.js.map → TagInput-BcSSnJY_.js.map} +1 -1
- package/dist/lib/{ToggleButton-r73bokux.js → ToggleButton-CcST9ch9.js} +3 -3
- package/dist/lib/{ToggleButton-r73bokux.js.map → ToggleButton-CcST9ch9.js.map} +1 -1
- package/dist/lib/{Toolbar-DDOaxG3B.js → Toolbar-Cq2wF4Yg.js} +67 -127
- package/dist/lib/Toolbar-Cq2wF4Yg.js.map +1 -0
- package/dist/lib/{Tooltip-BW1-aVDg.js → Tooltip-1flxtzgM.js} +2 -2
- package/dist/lib/{Tooltip-BW1-aVDg.js.map → Tooltip-1flxtzgM.js.map} +1 -1
- package/dist/lib/{VisuallyHidden-DcE0EFpo.js → VisuallyHidden-Bht2-rdy.js} +16 -14
- package/dist/lib/VisuallyHidden-Bht2-rdy.js.map +1 -0
- package/dist/lib/{VoiceControlBar-Bx016mmz.js → VoiceControlBar-iWzq7jiw.js} +1754 -1494
- package/dist/lib/VoiceControlBar-iWzq7jiw.js.map +1 -0
- package/dist/lib/{Waveform-EahaE6uD.js → Waveform-CtI9GetQ.js} +3 -3
- package/dist/lib/Waveform-CtI9GetQ.js.map +1 -0
- package/dist/lib/components/common/Badge/Badge.d.ts +1 -9
- package/dist/lib/components/common/Glass/Glass.d.ts +1 -3
- package/dist/lib/components/common/index.js +5 -5
- package/dist/lib/components/composed/index.js +3 -3
- package/dist/lib/components/derived/index.js +3 -3
- package/dist/lib/components/extended/DataGrid/DataGrid.clipboard.d.ts +2 -0
- package/dist/lib/components/extended/DataGrid/DataGrid.d.ts +6 -0
- package/dist/lib/components/extended/DataGrid/DataGrid.features.d.ts +2 -0
- package/dist/lib/components/extended/index.js +1 -1
- package/dist/lib/index.js +12 -12
- package/dist/lib/styles.css +1 -1
- package/dist/lib/tokens.css +29 -34
- package/docs/DATAGRID.md +106 -0
- package/package.json +1 -1
- package/dist/lib/Pagination-AWL5k5zG.js.map +0 -1
- package/dist/lib/Switch-DyKAqvde.js.map +0 -1
- package/dist/lib/Toolbar-DDOaxG3B.js.map +0 -1
- package/dist/lib/VisuallyHidden-DcE0EFpo.js.map +0 -1
- package/dist/lib/VoiceControlBar-Bx016mmz.js.map +0 -1
- package/dist/lib/Waveform-EahaE6uD.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VisuallyHidden-DcE0EFpo.js","names":[],"sources":["../../src/components/common/Icon/Icon.tsx","../../src/components/common/Glass/refraction.ts","../../src/components/common/Spinner/Spinner.tsx","../../src/components/common/Button/Button.tsx","../../src/components/common/IconButton/IconButton.tsx","../../src/components/common/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport \"./Icon.css\";\n\nexport type IconSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type IconTone =\n | \"inherit\" | \"default\" | \"muted\" | \"subtle\"\n | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"on-fill\";\n\nexport type IconProps = {\n /**\n * The icon itself, as a component rather than a name.\n *\n * A name would need a registry, and a registry is either every icon in the set — 1,500 of\n * them in the bundle whether or not a page uses six — or a hand-maintained list that is\n * always missing the one someone needs. Passing the component means the bundler drops\n * what nobody imported.\n */\n icon: LucideIcon;\n size?: IconSize;\n tone?: IconTone;\n /**\n * What the icon says, for a reader who cannot see it.\n *\n * Omitted is the honest default: most icons sit beside a label that already says it, and\n * announcing it twice is worse than not announcing it at all. Without a label the icon is\n * `aria-hidden` — declared decorative rather than left ambiguous.\n */\n label?: string;\n className?: string;\n style?: CSSProperties;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * An icon at a size and a tone the system knows.\n *\n * Nothing numeric reaches Lucide. Its components render `width`, `height` and `stroke-width`\n * as presentation attributes, and a CSS property beats a presentation attribute — so the\n * size and the weight of the stroke are set in the stylesheet from tokens, and this file\n * passes none of them. That is what keeps an icon following a density change instead of\n * carrying a number that was right once.\n */\nexport function Icon({\n icon: Glyph,\n size = \"md\",\n tone = \"inherit\",\n label,\n className,\n style,\n ...rest\n}: IconProps) {\n return (\n <Glyph\n {...rest}\n className={`icon ${className ?? \"\"}`.trim()}\n data-size={size}\n data-tone={tone}\n style={style}\n role={label ? \"img\" : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n focusable=\"false\"\n />\n );\n}\n","import { useCallback, useEffect, useState, type Ref, type RefObject } from \"react\";\n\n/**\n * The caller's ref and the lens's, on one node.\n *\n * Written against a real failure and a bad one. `Button` took the lens ref by spreading the\n * caller's props first and writing `ref` after, which silently threw away the ref it had just\n * been handed. Radix passes its trigger's ref exactly that way — `asChild` clones the child\n * with one — so every menu and popover opened by a `Button` lost its anchor. Floating UI never\n * positioned, and Radix left the panel parked at its unpositioned `translate(0, -200%)`: the\n * menu rendered off screen, at minus twice its own height, with no error anywhere.\n *\n * `Card` and `Glass` had the same collision the other way round, writing `ref` before the\n * spread, where an incoming ref turned the lens off instead. Neither order is right. A node\n * two things need is a node both of them get.\n */\nexport function useComposedRef<T extends HTMLElement>(\n mine: RefObject<T | null>,\n theirs: Ref<T> | undefined,\n): (node: T | null) => void {\n return useCallback(\n (node: T | null) => {\n mine.current = node;\n if (typeof theirs === \"function\") theirs(node);\n else if (theirs) (theirs as { current: T | null }).current = node;\n },\n [mine, theirs],\n );\n}\n\n/**\n * The lens, made available to any surface rather than only to `Glass`.\n *\n * Refraction needs a displacement map shaped like the pane, and `backdrop-filter` cannot see\n * the pane it is filtering: inside it `SourceGraphic` is the backdrop, so the element's own\n * outline is not available anywhere in the filter graph. The map therefore has to be drawn\n * from outside at the element's real size — which is why this is a hook with a\n * `ResizeObserver` and not three more lines in `tokens.css`.\n *\n * Two things keep that from being expensive on a page with fifty cards:\n *\n * The maps are CACHED by shape. A grid of identical cards draws one map and shares one\n * filter — the id is the shape, so sameness is free rather than something a caller arranges.\n *\n * The size is SNAPPED to a step. A drag-resize crosses a hundred widths and would otherwise\n * redraw a canvas at each of them.\n *\n * Measured rather than assumed, because the shape of this loop invites a guess and the guess\n * is wrong. Chromium, the four pane shapes this library actually draws under the glass look:\n *\n * 704x256 16.0ms 9 kB the largest, and the one frame it costs\n * 704x136 6.7ms 6 kB\n * 344x104 2.7ms 4 kB\n * 56x40 0.2ms 2 kB a button face\n * ----- -----\n * 25.6ms 21 kB a whole page, once, including the PNG encode\n *\n * Drawing the map at half scale and letting `feImage` stretch it (it already carries\n * `preserveAspectRatio=\"none\"`) takes the total to 6.8ms. That is a real saving and it is NOT\n * worth taking: it buys 19ms that are spent once, after mount, on a cache that never redraws\n * the same shape, and it pays in a bend whose fidelity is the entire point of the component.\n * If a pane ever appears that is much larger than 704x256, re-measure before assuming this\n * still holds.\n *\n * The filters live in one node appended to the document rather than inside each pane, because\n * a filter referenced by id has to be findable and a pane that unmounts must not take the\n * filter its neighbours are using with it. They are never removed: a page's set of pane shapes\n * is small and bounded, and a cache that evicts would redraw the shape a reader just scrolled\n * past.\n */\n\nconst STEP = 8;\nconst snap = (value: number) => Math.max(STEP, Math.round(value / STEP) * STEP);\n\nconst made = new Map<string, string>();\nlet host: SVGSVGElement | null = null;\n\nfunction drawMap(width: number, height: number, radius: number, band: number) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n const context = canvas.getContext(\"2d\");\n if (!context) return null;\n\n const image = context.createImageData(width, height);\n /* Signed distance to a rounded rectangle: negative inside, zero on the edge. */\n const distance = (x: number, y: number) => {\n const qx = Math.abs(x - width / 2) - (width / 2 - radius);\n const qy = Math.abs(y - height / 2) - (height / 2 - radius);\n return Math.hypot(Math.max(qx, 0), Math.max(qy, 0)) + Math.min(Math.max(qx, qy), 0) - radius;\n };\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const here = distance(x + 0.5, y + 0.5);\n /* The normal is the gradient of the distance field, as a central difference. */\n const nx = (distance(x + 1.5, y + 0.5) - distance(x - 0.5, y + 0.5)) / 2;\n const ny = (distance(x + 0.5, y + 1.5) - distance(x + 0.5, y - 0.5)) / 2;\n const length = Math.hypot(nx, ny) || 1;\n /*\n * Zero through the middle, one at the rim, and CUBED rather than squared.\n *\n * This exponent is the volume. A gentle ramp bends a wide part of the pane a little and\n * reads as a warp in the picture; a steep one leaves the middle alone and crushes the\n * bend into a band at the rim, which is what an edge of actual thickness does to what\n * is behind it. The band is wider than the corner radius for the same reason — a slab\n * refracts along its whole thickness, not only where it curves.\n */\n const ramp = here > 0 ? 0 : Math.min(1, Math.max(0, 1 + here / band));\n const weight = ramp * ramp * ramp;\n\n const i = (y * width + x) * 4;\n image.data[i] = 128 + (nx / length) * 127 * weight;\n image.data[i + 1] = 128 + (ny / length) * 127 * weight;\n image.data[i + 2] = 0;\n image.data[i + 3] = 255;\n }\n }\n context.putImageData(image, 0, 0);\n return canvas.toDataURL();\n}\n\nfunction filterFor(width: number, height: number, radius: number, scale: number) {\n const id = `lens-${width}x${height}r${Math.round(radius)}s${scale}`;\n if (made.has(id)) return made.get(id)!;\n\n const href = drawMap(width, height, radius, Math.max(radius * 1.8, STEP * 4));\n if (!href) return \"\";\n\n if (!host) {\n host = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n host.setAttribute(\"aria-hidden\", \"true\");\n host.setAttribute(\"width\", \"0\");\n host.setAttribute(\"height\", \"0\");\n host.style.position = \"absolute\";\n document.body.append(host);\n }\n\n const NS = \"http://www.w3.org/2000/svg\";\n const node = document.createElementNS(NS, \"filter\");\n node.setAttribute(\"id\", id);\n /* The lens reaches past the pane: a bend pulls in backdrop from outside the box, and a\n * filter region clipped to the box would cut the very thing it went to fetch. */\n node.setAttribute(\"x\", \"-30%\");\n node.setAttribute(\"y\", \"-30%\");\n node.setAttribute(\"width\", \"160%\");\n node.setAttribute(\"height\", \"160%\");\n node.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n\n const image = document.createElementNS(NS, \"feImage\");\n image.setAttribute(\"href\", href);\n image.setAttribute(\"width\", String(width));\n image.setAttribute(\"height\", String(height));\n image.setAttribute(\"preserveAspectRatio\", \"none\");\n image.setAttribute(\"result\", \"map\");\n const displace = document.createElementNS(NS, \"feDisplacementMap\");\n displace.setAttribute(\"in\", \"SourceGraphic\");\n displace.setAttribute(\"in2\", \"map\");\n displace.setAttribute(\"scale\", String(scale));\n displace.setAttribute(\"xChannelSelector\", \"R\");\n displace.setAttribute(\"yChannelSelector\", \"G\");\n node.append(image, displace);\n host.append(node);\n\n made.set(id, id);\n return id;\n}\n\n/**\n * Returns the `filter()` value for a pane, or an empty string.\n *\n * Empty rather than `none` on purpose: the caller writes it into a custom property that sits\n * inside a `backdrop-filter` list, and a list containing `none` is invalid CSS — the whole\n * declaration would be dropped and the pane would lose its blur along with its lens.\n */\nexport function useRefraction(pane: RefObject<HTMLElement | null>, scale = 96) {\n const [id, setId] = useState(\"\");\n\n useEffect(() => {\n const element = pane.current;\n if (!element) return;\n if (typeof CSS === \"undefined\" || !CSS.supports(\"backdrop-filter\", \"url(#x)\")) return;\n\n let width = 0;\n let height = 0;\n const read = () => {\n const style = getComputedStyle(element);\n /* Outside the glass look there is nothing to bend, and drawing a map for it would be a\n * canvas per card for a filter nothing can see. */\n if (style.getPropertyValue(\"--surface-lens\").trim() === \"none\") {\n /* The remembered size goes with it. It is the guard below that makes this necessary:\n * leaving it set means the pane comes back at the size it left at, the guard reads\n * that as \"nothing changed\", and the lens never returns. Toggling the look off and on\n * lost the bend until something happened to resize the pane. */\n width = 0;\n height = 0;\n setId(\"\");\n return;\n }\n const box = element.getBoundingClientRect();\n const w = snap(box.width);\n const h = snap(box.height);\n if (w === width && h === height) return;\n width = w;\n height = h;\n const radius = Number.parseFloat(style.borderStartStartRadius) || 0;\n setId(filterFor(w, h, radius, scale));\n };\n\n read();\n const observer = new ResizeObserver(read);\n observer.observe(element);\n /* The look is a root attribute, so it changes without the pane resizing. */\n const watcher = new MutationObserver(read);\n watcher.observe(document.documentElement, { attributes: true, attributeFilter: [\"data-look\", \"data-theme\"] });\n return () => {\n observer.disconnect();\n watcher.disconnect();\n };\n }, [pane, scale]);\n\n return id ? `url(#${id})` : \"\";\n}\n","import \"./Spinner.css\";\n\nexport type SpinnerSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\nexport type SpinnerTone = \"inherit\" | \"accent\" | \"muted\" | \"on-fill\";\n\nexport type SpinnerProps = {\n size?: SpinnerSize;\n tone?: SpinnerTone;\n /**\n * What is being waited for.\n *\n * Given, the spinner is a live region that says it. Omitted, it is `aria-hidden` — which\n * is right when the text beside it already says \"저장하는 중\" and wrong when nothing does.\n * There is no third option where the spinner is announced as \"spinner\".\n */\n label?: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * Something is still happening.\n *\n * It turns on `--duration-loop`. Under reduced motion the stylesheet switches that infinite\n * animation off instead of collapsing its duration, which would make it strobe. The\n * incomplete ring remains visible and the label still states what is happening.\n */\nexport function Spinner({ size = \"md\", tone = \"inherit\", label, className, ...rest }: SpinnerProps) {\n return (\n <span\n {...rest}\n className={`spinner ${className ?? \"\"}`.trim()}\n data-size={size}\n data-tone={tone}\n role={label ? \"status\" : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n >\n <span className=\"spinner__ring\" />\n </span>\n );\n}\n","import { forwardRef, useRef, type CSSProperties, type MouseEvent, type ReactNode, type Ref } from \"react\";\nimport { useComposedRef, useRefraction } from \"../Glass/refraction\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../Icon\";\nimport { Spinner } from \"../Spinner\";\nimport \"./Button.css\";\n\nexport type ButtonVariant = \"solid\" | \"soft\" | \"outline\" | \"ghost\" | \"plain\";\nexport type ButtonTone = \"accent\" | \"neutral\" | \"success\" | \"warning\" | \"danger\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\nexport type ButtonShape = \"rounded\" | \"pill\";\n\nexport type ButtonProps = {\n children: ReactNode;\n variant?: ButtonVariant;\n tone?: ButtonTone;\n size?: ButtonSize;\n shape?: ButtonShape;\n iconStart?: LucideIcon;\n iconEnd?: LucideIcon;\n /**\n * Work is in flight.\n *\n * Not the `disabled` attribute. A disabled button leaves the tab order, so a reader who was\n * standing on it is dropped somewhere else the moment it starts working, and hears nothing\n * about why. `aria-disabled` keeps it where it was and `aria-busy` says what changed; the\n * click is refused in the handler instead.\n */\n loading?: boolean;\n disabled?: boolean;\n fullWidth?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n /** Renders an anchor instead. A link that looks like a button is still a link. */\n href?: string;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n className?: string;\n /** Declared because Radix hands one to an `asChild` trigger, and the lens needs the same\n * node. Both get it; see `useComposedRef`. */\n ref?: Ref<HTMLElement>;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\nexport const Button = forwardRef<HTMLElement, ButtonProps>(function Button({\n children,\n variant = \"solid\",\n tone = \"accent\",\n size = \"md\",\n shape = \"rounded\",\n iconStart,\n iconEnd,\n loading,\n disabled,\n fullWidth,\n type = \"button\",\n href,\n onClick,\n className,\n ...rest\n}: ButtonProps, ref) {\n const inert = Boolean(disabled || loading);\n const iconSize = size === \"lg\" ? \"md\" : \"sm\";\n\n /* Only the outline variant's fill is a surface, but the hook is cheap when there is nothing\n * to bend — outside the glass look it draws no map and returns an empty string — and the\n * two return paths below would otherwise need the ref twice. */\n const face = useRef<HTMLElement>(null);\n const lens = useRefraction(face, 40);\n const hold = useComposedRef(face, ref);\n\n const shared = {\n ...rest,\n ref: hold as never,\n style: lens ? ({ \"--glass-refraction\": lens } as CSSProperties) : undefined,\n className: `button ${className ?? \"\"}`.trim(),\n \"data-variant\": variant,\n \"data-tone\": tone,\n \"data-size\": size,\n \"data-shape\": shape,\n \"data-loading\": loading ? \"\" : undefined,\n \"data-full\": fullWidth ? \"\" : undefined,\n \"aria-disabled\": inert || undefined,\n \"aria-busy\": loading || undefined,\n onClick: (event: MouseEvent<HTMLElement>) => {\n if (inert) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n },\n };\n\n const content = (\n <>\n {iconStart ? <Icon icon={iconStart} size={iconSize} /> : null}\n <span className=\"button__label\">{children}</span>\n {iconEnd ? <Icon icon={iconEnd} size={iconSize} /> : null}\n {/* Laid over the label rather than replacing it, so the button does not change width\n * the moment it starts working and move whatever is beside it. */}\n {loading ? (\n <span className=\"button__busy\">\n <Spinner size={size === \"lg\" ? \"md\" : \"sm\"} />\n </span>\n ) : null}\n </>\n );\n\n if (href !== undefined) {\n return (\n <a {...shared} href={inert ? undefined : href} role={inert ? \"link\" : undefined}>\n {content}\n </a>\n );\n }\n\n return (\n <button {...shared} type={type}>\n {content}\n </button>\n );\n});\n","import { forwardRef, type MouseEvent, type Ref } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../Icon\";\nimport { Spinner } from \"../Spinner\";\nimport type { ButtonShape, ButtonTone, ButtonVariant } from \"../Button\";\nimport \"./IconButton.css\";\n\nexport type IconButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport type IconButtonProps = {\n icon: LucideIcon;\n /**\n * What it does. Required, and there is no version of this component without it.\n *\n * An icon-only control with no name reaches assistive technology as \"button\" and nothing\n * else. Making the label optional would mean shipping a component whose most likely use is\n * broken, so it is not optional.\n */\n label: string;\n variant?: ButtonVariant;\n tone?: ButtonTone;\n size?: IconButtonSize;\n shape?: ButtonShape | \"circle\";\n loading?: boolean;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n href?: string;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n className?: string;\n /** The button or anchor node, including when Radix supplies a trigger ref. */\n ref?: Ref<HTMLButtonElement | HTMLAnchorElement>;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/**\n * A button that is only its icon, and therefore only its label.\n */\nexport const IconButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, IconButtonProps>(function IconButton({\n icon,\n label,\n variant = \"ghost\",\n tone = \"neutral\",\n size = \"md\",\n shape = \"rounded\",\n loading,\n disabled,\n type = \"button\",\n href,\n onClick,\n className,\n ...rest\n}: IconButtonProps, ref) {\n const inert = Boolean(disabled || loading);\n const glyph = size === \"lg\" ? \"md\" : \"sm\";\n\n const shared = {\n ...rest,\n className: `icon-button ${className ?? \"\"}`.trim(),\n \"data-variant\": variant,\n \"data-tone\": tone,\n \"data-size\": size,\n \"data-shape\": shape,\n \"data-loading\": loading ? \"\" : undefined,\n \"aria-label\": label,\n \"aria-disabled\": inert || undefined,\n \"aria-busy\": loading || undefined,\n onClick: (event: MouseEvent<HTMLElement>) => {\n if (inert) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n },\n };\n\n /* The glyph is decorative: the control is already named, and announcing the icon as well\n * would say the same thing twice. */\n const content = loading ? <Spinner size={glyph} /> : <Icon icon={icon} size={glyph} />;\n\n if (href !== undefined) {\n return <a {...shared} ref={ref as Ref<HTMLAnchorElement>} href={inert ? undefined : href}>{content}</a>;\n }\n return <button {...shared} ref={ref as Ref<HTMLButtonElement>} type={type}>{content}</button>;\n});\n","import type { ElementType, ReactNode } from \"react\";\nimport \"./VisuallyHidden.css\";\n\nexport type VisuallyHiddenProps = {\n children: ReactNode;\n as?: ElementType;\n /**\n * Becomes visible when focused, for a skip link — the one case where hidden text has to\n * be reachable by the reader who needs it most.\n */\n focusable?: boolean;\n className?: string;\n};\n\n/**\n * Present to assistive technology, absent from the screen.\n *\n * Not `display: none` and not `visibility: hidden` — both remove it from the accessibility\n * tree as well, which is the opposite of the point. Not `text-indent: -9999px` either: that\n * leaves a 9999px box that a right-to-left layout scrolls to.\n */\nexport function VisuallyHidden({\n children,\n as: Element = \"span\",\n focusable,\n className,\n}: VisuallyHiddenProps) {\n return (\n <Element\n className={`visually-hidden ${className ?? \"\"}`.trim()}\n data-focusable={focusable ? \"\" : undefined}\n >\n {children}\n </Element>\n );\n}\n"],"mappings":";;;AA2CA,SAAgB,EAAK,EACnB,MAAM,GACN,UAAO,MACP,UAAO,WACP,UACA,cACA,UACA,GAAG,KACS;CACZ,OACE,kBAAC,GAAD;EACE,GAAI;EACJ,WAAW,QAAQ,KAAa,KAAK,KAAK;EAC1C,aAAW;EACX,aAAW;EACJ;EACP,MAAM,IAAQ,QAAQ,KAAA;EACtB,cAAY;EACZ,eAAa,MAAQ,KAAA;EACrB,WAAU;CACX,CAAA;AAEL;;;ACjDA,SAAgB,EACd,GACA,GAC0B;CAC1B,OAAO,GACJ,MAAmB;EAElB,AADA,EAAK,UAAU,GACX,OAAO,KAAW,aAAY,EAAO,CAAI,IACpC,MAAQ,EAAkC,UAAU;CAC/D,GACA,CAAC,GAAM,CAAM,CACf;AACF;AA2CA,IAAM,IAAO,GACP,KAAQ,MAAkB,KAAK,IAAI,GAAM,KAAK,MAAM,IAAQ,CAAI,IAAI,CAAI,GAExE,oBAAO,IAAI,IAAoB,GACjC,IAA6B;AAEjC,SAAS,EAAQ,GAAe,GAAgB,GAAgB,GAAc;CAC5E,IAAM,IAAS,SAAS,cAAc,QAAQ;CAE9C,AADA,EAAO,QAAQ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