@purpurds/visually-hidden 5.10.1 → 5.11.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visually-hidden.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js","../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.3.1_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.3.1_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.1_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-visually-hidden@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.1_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs","../src/visually-hidden.tsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import $4q5Fq$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement} from \"react\";\nimport {flushSync as $4q5Fq$flushSync} from \"react-dom\";\nimport {Slot as $4q5Fq$Slot} from \"@radix-ui/react-slot\";\n\n\n\n\n\nconst $8927f6f2acc4f386$var$NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul'\n]; // Temporary while we await merge of this fix:\n// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396\n// prettier-ignore\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{\n const Node = /*#__PURE__*/ $4q5Fq$forwardRef((props, forwardedRef)=>{\n const { asChild: asChild , ...primitiveProps } = props;\n const Comp = asChild ? $4q5Fq$Slot : node;\n $4q5Fq$useEffect(()=>{\n window[Symbol.for('radix-ui')] = true;\n }, []);\n return /*#__PURE__*/ $4q5Fq$createElement(Comp, $4q5Fq$babelruntimehelpersesmextends({}, primitiveProps, {\n ref: forwardedRef\n }));\n });\n Node.displayName = `Primitive.${node}`;\n return {\n ...primitive,\n [node]: Node\n };\n}, {});\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/ /**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {\n if (target) $4q5Fq$flushSync(()=>target.dispatchEvent(event)\n );\n}\n/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = $8927f6f2acc4f386$export$250ffa63cdc0d034;\n\n\n\n\nexport {$8927f6f2acc4f386$export$250ffa63cdc0d034 as Primitive, $8927f6f2acc4f386$export$be92b6f5f03c0fe9 as Root, $8927f6f2acc4f386$export$6d1a0317bde7de7f as dispatchDiscreteCustomEvent};\n//# sourceMappingURL=index.mjs.map\n","import $kVwnw$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $kVwnw$forwardRef, createElement as $kVwnw$createElement} from \"react\";\nimport {Primitive as $kVwnw$Primitive} from \"@radix-ui/react-primitive\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * VisuallyHidden\n * -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$var$NAME = 'VisuallyHidden';\nconst $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ $kVwnw$forwardRef((props, forwardedRef)=>{\n return /*#__PURE__*/ $kVwnw$createElement($kVwnw$Primitive.span, $kVwnw$babelruntimehelpersesmextends({}, props, {\n ref: forwardedRef,\n style: {\n // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style\n }\n }));\n});\n/*#__PURE__*/ Object.assign($ea1ef594cf570d83$export$439d29a4e110a164, {\n displayName: $ea1ef594cf570d83$var$NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$export$be92b6f5f03c0fe9 = $ea1ef594cf570d83$export$439d29a4e110a164;\n\n\n\n\nexport {$ea1ef594cf570d83$export$439d29a4e110a164 as VisuallyHidden, $ea1ef594cf570d83$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import React, { ReactNode } from \"react\";\nimport * as RadixVisuallyHidden from \"@radix-ui/react-visually-hidden\";\n\nexport type VisuallyHiddenProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * */\n asChild?: boolean;\n children: ReactNode;\n className?: string;\n [\"data-testid\"]?: string;\n};\n\nexport const VisuallyHidden = ({\n asChild,\n children,\n className = \"\",\n [\"data-testid\"]: dataTestid,\n}: VisuallyHiddenProps) => (\n <RadixVisuallyHidden.Root asChild={asChild} data-testid={dataTestid} className={className}>\n {children}\n </RadixVisuallyHidden.Root>\n);\n"],"names":["_extends","target","i","source","key","$6ed0406888f73fc4$var$setRef","ref","value","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","node","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","props","forwardedRef","children","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","newChildren","child","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","propName","slotPropValue","childPropValue","args","$8927f6f2acc4f386$var$NODES","$8927f6f2acc4f386$export$250ffa63cdc0d034","primitive","Node","$4q5Fq$forwardRef","asChild","primitiveProps","Comp","$4q5Fq$Slot","$4q5Fq$useEffect","$4q5Fq$createElement","$4q5Fq$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$439d29a4e110a164","$kVwnw$forwardRef","$kVwnw$createElement","$kVwnw$Primitive","$kVwnw$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$be92b6f5f03c0fe9","VisuallyHidden","className","dataTestid","jsx","RadixVisuallyHidden.Root"],"mappings":"6JAAe,SAASA,GAAW,CACjC,OAAAA,EAAW,OAAO,OAAS,OAAO,OAAO,KAAI,EAAK,SAAUC,EAAQ,CAClE,QAASC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CACzC,IAAIC,EAAS,UAAUD,CAAC,EACxB,QAASE,KAAOD,EACV,OAAO,UAAU,eAAe,KAAKA,EAAQC,CAAG,I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Ac,EAAKhC,EAC3CiC,EAAOF,EAAUG,EAAcrC,EACrCsC,OAAAA,EAAAA,UAAiB,IAAI,CACjB,OAAO,OAAO,IAAI,UAAU,CAAC,EAAI,EACpC,EAAE,CAAE,CAAA,EACgBC,EAAoB,cAACH,EAAMI,EAAqC,CAAA,EAAIL,EAAgB,CACrG,IAAK/B,CACR,CAAA,CAAC,CACV,CAAK,EACD,OAAA4B,EAAK,YAAc,aAAahC,CAAI,GAC7B,CACH,GAAG+B,EACH,CAAC/B,CAAI,EAAGgC,CAChB,CACA,EAAG,EAAE,ECrCCS,EAA0DC,EAAiB,WAAC,CAACvC,EAAOC,IACjEuC,EAAAA,cAAqBC,EAAiB,KAAMC,EAAqC,CAAA,EAAI1C,EAAO,CAC7G,IAAKC,EACL,MAAO,CAEH,SAAU,WACV,OAAQ,EACR,MAAO,EACP,OAAQ,EACR,QAAS,EACT,OAAQ,GACR,SAAU,SACV,KAAM,mBACN,WAAY,SACZ,SAAU,SACV,GAAGD,EAAM,KACZ,CACJ,CAAA,CAAC,CACL,EAI0G2C,EAA4CL,ECnB1IM,EAAiB,CAAC,CAC7B,QAAAb,EACA,SAAA7B,EACA,UAAA2C,EAAY,GACZ,CAAC,eAAgBC,CACnB,IACEC,EAAAA,IAACC,EAAA,CAAyB,QAAAjB,EAAkB,cAAae,EAAY,UAAAD,EAClE,SAAA3C,CACH,CAAA","x_google_ignoreList":[0,1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"visually-hidden.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js","../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-visually-hidden@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs","../src/visually-hidden.tsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import $4q5Fq$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement} from \"react\";\nimport {flushSync as $4q5Fq$flushSync} from \"react-dom\";\nimport {Slot as $4q5Fq$Slot} from \"@radix-ui/react-slot\";\n\n\n\n\n\nconst $8927f6f2acc4f386$var$NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul'\n]; // Temporary while we await merge of this fix:\n// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396\n// prettier-ignore\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{\n const Node = /*#__PURE__*/ $4q5Fq$forwardRef((props, forwardedRef)=>{\n const { asChild: asChild , ...primitiveProps } = props;\n const Comp = asChild ? $4q5Fq$Slot : node;\n $4q5Fq$useEffect(()=>{\n window[Symbol.for('radix-ui')] = true;\n }, []);\n return /*#__PURE__*/ $4q5Fq$createElement(Comp, $4q5Fq$babelruntimehelpersesmextends({}, primitiveProps, {\n ref: forwardedRef\n }));\n });\n Node.displayName = `Primitive.${node}`;\n return {\n ...primitive,\n [node]: Node\n };\n}, {});\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/ /**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {\n if (target) $4q5Fq$flushSync(()=>target.dispatchEvent(event)\n );\n}\n/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = $8927f6f2acc4f386$export$250ffa63cdc0d034;\n\n\n\n\nexport {$8927f6f2acc4f386$export$250ffa63cdc0d034 as Primitive, $8927f6f2acc4f386$export$be92b6f5f03c0fe9 as Root, $8927f6f2acc4f386$export$6d1a0317bde7de7f as dispatchDiscreteCustomEvent};\n//# sourceMappingURL=index.mjs.map\n","import $kVwnw$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $kVwnw$forwardRef, createElement as $kVwnw$createElement} from \"react\";\nimport {Primitive as $kVwnw$Primitive} from \"@radix-ui/react-primitive\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * VisuallyHidden\n * -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$var$NAME = 'VisuallyHidden';\nconst $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ $kVwnw$forwardRef((props, forwardedRef)=>{\n return /*#__PURE__*/ $kVwnw$createElement($kVwnw$Primitive.span, $kVwnw$babelruntimehelpersesmextends({}, props, {\n ref: forwardedRef,\n style: {\n // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style\n }\n }));\n});\n/*#__PURE__*/ Object.assign($ea1ef594cf570d83$export$439d29a4e110a164, {\n displayName: $ea1ef594cf570d83$var$NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$export$be92b6f5f03c0fe9 = $ea1ef594cf570d83$export$439d29a4e110a164;\n\n\n\n\nexport {$ea1ef594cf570d83$export$439d29a4e110a164 as VisuallyHidden, $ea1ef594cf570d83$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import React, { ReactNode } from \"react\";\nimport * as RadixVisuallyHidden from \"@radix-ui/react-visually-hidden\";\n\nexport type VisuallyHiddenProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * */\n asChild?: boolean;\n children: ReactNode;\n className?: string;\n [\"data-testid\"]?: string;\n};\n\nexport const VisuallyHidden = ({\n asChild,\n children,\n className = \"\",\n [\"data-testid\"]: dataTestid,\n}: VisuallyHiddenProps) => (\n <RadixVisuallyHidden.Root asChild={asChild} data-testid={dataTestid} className={className}>\n {children}\n </RadixVisuallyHidden.Root>\n);\n"],"names":["_extends","target","i","source","key","$6ed0406888f73fc4$var$setRef","ref","value","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","node","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","props","forwardedRef","children","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","newChildren","child","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","propName","slotPropValue","childPropValue","args","$8927f6f2acc4f386$var$NODES","$8927f6f2acc4f386$export$250ffa63cdc0d034","primitive","Node","$4q5Fq$forwardRef","asChild","primitiveProps","Comp","$4q5Fq$Slot","$4q5Fq$useEffect","$4q5Fq$createElement","$4q5Fq$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$439d29a4e110a164","$kVwnw$forwardRef","$kVwnw$createElement","$kVwnw$Primitive","$kVwnw$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$be92b6f5f03c0fe9","VisuallyHidden","className","dataTestid","jsx","RadixVisuallyHidden.Root"],"mappings":"6JAAe,SAASA,GAAW,CACjC,OAAAA,EAAW,OAAO,OAAS,OAAO,OAAO,KAAI,EAAK,SAAUC,EAAQ,CAClE,QAASC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CACzC,IAAIC,EAAS,UAAUD,CAAC,EACxB,QAASE,KAAOD,EACV,OAAO,UAAU,eAAe,KAAKA,EAAQC,CAAG,IAClDH,EAAOG,CAAG,EAAID,EAAOC,CAAG,EAG7B,CACD,OAAOH,CACX,EACSD,EAAS,MAAM,KAAM,SAAS,CACvC,CCPI,SAASK,EAA6BC,EAAKC,EAAO,CAC9C,OAAOD,GAAQ,WAAYA,EAAIC,CAAK,EAC/BD,GAAQ,OAA2BA,EAAI,QAAUC,EAC9D,CAII,SAASC,KAA6CC,EAAM,CAC5D,OAAQC,GAAOD,EAAK,QAASH,GAAMD,EAA6BC,EAAKI,CAAI,CACpE,CAET,CCRqG,MAAMC,EAA0DC,EAAAA,WAAkB,CAACC,EAAOC,IAAe,CAC1M,KAAM,CAAE,SAAUC,EAAW,GAAGC,CAAS,EAAKH,EACxCI,EAAgBC,EAAAA,SAAgB,QAAQH,CAAQ,EAChDI,E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ACL,MAAO,CAEH,SAAU,WACV,OAAQ,EACR,MAAO,EACP,OAAQ,EACR,QAAS,EACT,OAAQ,GACR,SAAU,SACV,KAAM,mBACN,WAAY,SACZ,SAAU,SACV,GAAGD,EAAM,KACZ,CACJ,CAAA,CAAC,CACL,EAI0G2C,EAA4CL,ECnB1IM,EAAiB,CAAC,CAC7B,QAAAb,EACA,SAAA7B,EACA,UAAA2C,EAAY,GACZ,CAAC,eAAgBC,CACnB,IACEC,EAAAA,IAACC,EAAA,CAAyB,QAAAjB,EAAkB,cAAae,EAAY,UAAAD,EAClE,SAAA3C,CACH,CAAA","x_google_ignoreList":[0,1,2,3,4]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visually-hidden.es.js","sources":["../../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js","../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.3.1_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.3.1_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.1_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-visually-hidden@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.1_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs","../src/visually-hidden.tsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import $4q5Fq$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement} from \"react\";\nimport {flushSync as $4q5Fq$flushSync} from \"react-dom\";\nimport {Slot as $4q5Fq$Slot} from \"@radix-ui/react-slot\";\n\n\n\n\n\nconst $8927f6f2acc4f386$var$NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul'\n]; // Temporary while we await merge of this fix:\n// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396\n// prettier-ignore\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{\n const Node = /*#__PURE__*/ $4q5Fq$forwardRef((props, forwardedRef)=>{\n const { asChild: asChild , ...primitiveProps } = props;\n const Comp = asChild ? $4q5Fq$Slot : node;\n $4q5Fq$useEffect(()=>{\n window[Symbol.for('radix-ui')] = true;\n }, []);\n return /*#__PURE__*/ $4q5Fq$createElement(Comp, $4q5Fq$babelruntimehelpersesmextends({}, primitiveProps, {\n ref: forwardedRef\n }));\n });\n Node.displayName = `Primitive.${node}`;\n return {\n ...primitive,\n [node]: Node\n };\n}, {});\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/ /**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {\n if (target) $4q5Fq$flushSync(()=>target.dispatchEvent(event)\n );\n}\n/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = $8927f6f2acc4f386$export$250ffa63cdc0d034;\n\n\n\n\nexport {$8927f6f2acc4f386$export$250ffa63cdc0d034 as Primitive, $8927f6f2acc4f386$export$be92b6f5f03c0fe9 as Root, $8927f6f2acc4f386$export$6d1a0317bde7de7f as dispatchDiscreteCustomEvent};\n//# sourceMappingURL=index.mjs.map\n","import $kVwnw$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $kVwnw$forwardRef, createElement as $kVwnw$createElement} from \"react\";\nimport {Primitive as $kVwnw$Primitive} from \"@radix-ui/react-primitive\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * VisuallyHidden\n * -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$var$NAME = 'VisuallyHidden';\nconst $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ $kVwnw$forwardRef((props, forwardedRef)=>{\n return /*#__PURE__*/ $kVwnw$createElement($kVwnw$Primitive.span, $kVwnw$babelruntimehelpersesmextends({}, props, {\n ref: forwardedRef,\n style: {\n // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style\n }\n }));\n});\n/*#__PURE__*/ Object.assign($ea1ef594cf570d83$export$439d29a4e110a164, {\n displayName: $ea1ef594cf570d83$var$NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$export$be92b6f5f03c0fe9 = $ea1ef594cf570d83$export$439d29a4e110a164;\n\n\n\n\nexport {$ea1ef594cf570d83$export$439d29a4e110a164 as VisuallyHidden, $ea1ef594cf570d83$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import React, { ReactNode } from \"react\";\nimport * as RadixVisuallyHidden from \"@radix-ui/react-visually-hidden\";\n\nexport type VisuallyHiddenProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * */\n asChild?: boolean;\n children: ReactNode;\n className?: string;\n [\"data-testid\"]?: string;\n};\n\nexport const VisuallyHidden = ({\n asChild,\n children,\n className = \"\",\n [\"data-testid\"]: dataTestid,\n}: VisuallyHiddenProps) => (\n <RadixVisuallyHidden.Root asChild={asChild} data-testid={dataTestid} className={className}>\n {children}\n </RadixVisuallyHidden.Root>\n);\n"],"names":["_extends","target","i","source","key","$6ed0406888f73fc4$var$setRef","ref","value","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","node","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","props","forwardedRef","children","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","newChildren","child","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","propName","slotPropValue","childPropValue","args","$8927f6f2acc4f386$var$NODES","$8927f6f2acc4f386$export$250ffa63cdc0d034","primitive","Node","$4q5Fq$forwardRef","asChild","primitiveProps","Comp","$4q5Fq$Slot","$4q5Fq$useEffect","$4q5Fq$createElement","$4q5Fq$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$439d29a4e110a164","$kVwnw$forwardRef","$kVwnw$createElement","$kVwnw$Primitive","$kVwnw$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$be92b6f5f03c0f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;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,GAAGD,EAAM;AAAA,EACZ;AACJ,CAAA,CAAC,CACL,GAI0G2C,IAA4CL,GCnB1IM,IAAiB,CAAC;AAAA,EAC7B,SAAAb;AAAA,EACA,UAAA7B;AAAA,EACA,WAAA2C,IAAY;AAAA,EACZ,CAAC,gBAAgBC;AACnB,MACE,gBAAAC,EAACC,GAAA,EAAyB,SAAAjB,GAAkB,eAAae,GAAY,WAAAD,GAClE,UAAA3C,EACH,CAAA;","x_google_ignoreList":[0,1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"visually-hidden.es.js","sources":["../../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js","../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-visually-hidden@1.0.3_@types+react-dom@18.3.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs","../src/visually-hidden.tsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import $4q5Fq$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement} from \"react\";\nimport {flushSync as $4q5Fq$flushSync} from \"react-dom\";\nimport {Slot as $4q5Fq$Slot} from \"@radix-ui/react-slot\";\n\n\n\n\n\nconst $8927f6f2acc4f386$var$NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul'\n]; // Temporary while we await merge of this fix:\n// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396\n// prettier-ignore\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{\n const Node = /*#__PURE__*/ $4q5Fq$forwardRef((props, forwardedRef)=>{\n const { asChild: asChild , ...primitiveProps } = props;\n const Comp = asChild ? $4q5Fq$Slot : node;\n $4q5Fq$useEffect(()=>{\n window[Symbol.for('radix-ui')] = true;\n }, []);\n return /*#__PURE__*/ $4q5Fq$createElement(Comp, $4q5Fq$babelruntimehelpersesmextends({}, primitiveProps, {\n ref: forwardedRef\n }));\n });\n Node.displayName = `Primitive.${node}`;\n return {\n ...primitive,\n [node]: Node\n };\n}, {});\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/ /**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {\n if (target) $4q5Fq$flushSync(()=>target.dispatchEvent(event)\n );\n}\n/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = $8927f6f2acc4f386$export$250ffa63cdc0d034;\n\n\n\n\nexport {$8927f6f2acc4f386$export$250ffa63cdc0d034 as Primitive, $8927f6f2acc4f386$export$be92b6f5f03c0fe9 as Root, $8927f6f2acc4f386$export$6d1a0317bde7de7f as dispatchDiscreteCustomEvent};\n//# sourceMappingURL=index.mjs.map\n","import $kVwnw$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $kVwnw$forwardRef, createElement as $kVwnw$createElement} from \"react\";\nimport {Primitive as $kVwnw$Primitive} from \"@radix-ui/react-primitive\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * VisuallyHidden\n * -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$var$NAME = 'VisuallyHidden';\nconst $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ $kVwnw$forwardRef((props, forwardedRef)=>{\n return /*#__PURE__*/ $kVwnw$createElement($kVwnw$Primitive.span, $kVwnw$babelruntimehelpersesmextends({}, props, {\n ref: forwardedRef,\n style: {\n // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style\n }\n }));\n});\n/*#__PURE__*/ Object.assign($ea1ef594cf570d83$export$439d29a4e110a164, {\n displayName: $ea1ef594cf570d83$var$NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $ea1ef594cf570d83$export$be92b6f5f03c0fe9 = $ea1ef594cf570d83$export$439d29a4e110a164;\n\n\n\n\nexport {$ea1ef594cf570d83$export$439d29a4e110a164 as VisuallyHidden, $ea1ef594cf570d83$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","import React, { ReactNode } from \"react\";\nimport * as RadixVisuallyHidden from \"@radix-ui/react-visually-hidden\";\n\nexport type VisuallyHiddenProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * */\n asChild?: boolean;\n children: ReactNode;\n className?: string;\n [\"data-testid\"]?: string;\n};\n\nexport const VisuallyHidden = ({\n asChild,\n children,\n className = \"\",\n [\"data-testid\"]: dataTestid,\n}: VisuallyHiddenProps) => (\n <RadixVisuallyHidden.Root asChild={asChild} data-testid={dataTestid} className={className}>\n {children}\n </RadixVisuallyHidden.Root>\n);\n"],"names":["_extends","target","i","source","key","$6ed0406888f73fc4$var$setRef","ref","value","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","node","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","props","forwardedRef","children","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","newChildren","child","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","propName","slotPropValue","childPropValue","args","$8927f6f2acc4f386$var$NODES","$8927f6f2acc4f386$export$250ffa63cdc0d034","primitive","Node","$4q5Fq$forwardRef","asChild","primitiveProps","Comp","$4q5Fq$Slot","$4q5Fq$useEffect","$4q5Fq$createElement","$4q5Fq$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$439d29a4e110a164","$kVwnw$forwardRef","$kVwnw$createElement","$kVwnw$Primitive","$kVwnw$babelruntimehelpersesmextends","$ea1ef594cf570d83$export$be92b6f5f03c0fe9","VisuallyHidden","className","dataTestid","jsx","RadixVisuall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AAA,IACN,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,GAAGD,EAAM;AAAA,EACZ;AACJ,CAAA,CAAC,CACL,GAI0G2C,IAA4CL,GCnB1IM,IAAiB,CAAC;AAAA,EAC7B,SAAAb;AAAA,EACA,UAAA7B;AAAA,EACA,WAAA2C,IAAY;AAAA,EACZ,CAAC,gBAAgBC;AACnB,MACE,gBAAAC,EAACC,GAAA,EAAyB,SAAAjB,GAAkB,eAAae,GAAY,WAAAD,GAClE,UAAA3C,EACH,CAAA;","x_google_ignoreList":[0,1,2,3,4]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/visually-hidden",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.1",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/visually-hidden.cjs.js",
|
|
6
6
|
"types": "./dist/visually-hidden.d.ts",
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@rushstack/eslint-patch": "~1.10.0",
|
|
20
|
-
"@storybook/
|
|
21
|
-
"
|
|
20
|
+
"@storybook/react": "^8.2.6",
|
|
21
|
+
"storybook": "^8.2.6",
|
|
22
22
|
"@telia/base-rig": "~8.2.0",
|
|
23
23
|
"@telia/react-rig": "~3.2.0",
|
|
24
24
|
"@testing-library/dom": "~9.3.3",
|
|
25
25
|
"@testing-library/jest-dom": "~6.4.0",
|
|
26
26
|
"@testing-library/react": "~14.3.0",
|
|
27
27
|
"@types/node": "20.12.12",
|
|
28
|
-
"@types/react-dom": "
|
|
29
|
-
"@types/react": "
|
|
28
|
+
"@types/react-dom": "^18.3.0",
|
|
29
|
+
"@types/react": "^18.3.3",
|
|
30
30
|
"eslint-plugin-testing-library": "~6.2.0",
|
|
31
|
-
"eslint": "
|
|
31
|
+
"eslint": "^8.57.0",
|
|
32
32
|
"jsdom": "~22.1.0",
|
|
33
33
|
"lint-staged": "~10.5.3",
|
|
34
34
|
"prettier": "~2.8.8",
|
|
35
|
-
"react-dom": "
|
|
36
|
-
"react": "
|
|
37
|
-
"typescript": "
|
|
38
|
-
"vite": "
|
|
35
|
+
"react-dom": "^18.3.1",
|
|
36
|
+
"react": "^18.3.1",
|
|
37
|
+
"typescript": "^5.5.4",
|
|
38
|
+
"vite": "5.3.4",
|
|
39
39
|
"vitest": "~1.5.0",
|
|
40
40
|
"@purpurds/component-rig": "1.0.0"
|
|
41
41
|
},
|
|
@@ -2,13 +2,27 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
|
|
3
3
|
import { VisuallyHidden } from "./visually-hidden";
|
|
4
4
|
|
|
5
|
-
const meta
|
|
5
|
+
const meta = {
|
|
6
6
|
title: "Utils/VisuallyHidden",
|
|
7
7
|
component: VisuallyHidden,
|
|
8
8
|
argTypes: {
|
|
9
9
|
children: { control: { type: "text" } },
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: `
|
|
15
|
+
Component provides text only for screen readers. This is used to explain content or situation which is not explainable without clear text. Component is designed to be hidden, but shown when screen reader makes focus.
|
|
16
|
+
|
|
17
|
+
Example use cases:
|
|
18
|
+
|
|
19
|
+
- There is content being loaded
|
|
20
|
+
- When visual style is not understood by screen reader, like with Price component`,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
} satisfies Meta<typeof VisuallyHidden>;
|
|
25
|
+
|
|
12
26
|
export default meta;
|
|
13
27
|
|
|
14
28
|
type Story = StoryObj<typeof VisuallyHidden>;
|
package/readme.mdx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";
|
|
2
|
-
|
|
3
|
-
import * as VisuallyHiddenStories from "./src/visually-hidden.stories";
|
|
4
|
-
import packageInfo from "./package.json";
|
|
5
|
-
|
|
6
|
-
<Meta name="Docs" title="Components/VisuallyHidden" of={VisuallyHiddenStories} />
|
|
7
|
-
|
|
8
|
-
# VisuallyHidden
|
|
9
|
-
|
|
10
|
-
<Subtitle>Version {packageInfo.version}</Subtitle>
|
|
11
|
-
|
|
12
|
-
Component provides text only for screen readers. This is used to explain content or situation which is not explainable without clear text. Component is designed to be hidden, but shown when screen reader makes focus.
|
|
13
|
-
|
|
14
|
-
Example use cases:
|
|
15
|
-
|
|
16
|
-
- There is content being loaded
|
|
17
|
-
- When visual style is not understood by screen reader, like with Price component
|
|
18
|
-
|
|
19
|
-
### Showcase
|
|
20
|
-
|
|
21
|
-
<Primary />
|
|
22
|
-
|
|
23
|
-
### Properties
|
|
24
|
-
|
|
25
|
-
<ArgTypes />
|
|
26
|
-
|
|
27
|
-
### Installation
|
|
28
|
-
|
|
29
|
-
#### Via NPM
|
|
30
|
-
|
|
31
|
-
Add the dependency to your consumer app like `"@purpurds/purpur": "^x.y.z"`
|
|
32
|
-
|
|
33
|
-
In MyComponent.tsx
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import { VisuallyHidden } from "@purpurds/purpur";
|
|
37
|
-
|
|
38
|
-
export const MyComponent = () => {
|
|
39
|
-
return (
|
|
40
|
-
<div>
|
|
41
|
-
<VisuallyHidden {...someProps}>Some content</VisuallyHidden>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
```
|