@spark-ui/visually-hidden 8.0.2 → 8.1.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/CHANGELOG.md +10 -0
- package/dist/VisuallyHidden.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +8 -4
- package/dist/public/docgen.json +17 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [8.1.0](https://github.com/adevinta/spark/compare/v8.0.3...v8.1.0) (2025-01-16)
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
- **visually-hidden:** added asChild prop to VisuallyHidden ([1c2b96d](https://github.com/adevinta/spark/commit/1c2b96da6201b12a6b49da9636170d899822204a))
|
11
|
+
|
12
|
+
## [8.0.3](https://github.com/adevinta/spark/compare/v8.0.2...v8.0.3) (2025-01-16)
|
13
|
+
|
14
|
+
**Note:** Version bump only for package @spark-ui/visually-hidden
|
15
|
+
|
6
16
|
## [8.0.2](https://github.com/adevinta/spark/compare/v8.0.1...v8.0.2) (2025-01-15)
|
7
17
|
|
8
18
|
**Note:** Version bump only for package @spark-ui/visually-hidden
|
package/dist/VisuallyHidden.d.ts
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
import { HTMLAttributes, PropsWithChildren, Ref } from 'react';
|
2
2
|
export type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
|
3
|
+
/**
|
4
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
5
|
+
*/
|
6
|
+
asChild?: boolean;
|
3
7
|
ref?: Ref<HTMLElement>;
|
4
8
|
};
|
5
9
|
export declare const VisuallyHidden: {
|
6
|
-
({ ref, ...props }: VisuallyHiddenProps): import("react").JSX.Element;
|
10
|
+
({ asChild, ref, ...props }: VisuallyHiddenProps): import("react").JSX.Element;
|
7
11
|
displayName: string;
|
8
12
|
};
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),d=require("@spark-ui/slot"),r=({asChild:t=!1,ref:i,...e})=>{const a=t?d.Slot:"span";return l.createElement(a,{...e,ref:i,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})};r.displayName="VisuallyHidden",exports.VisuallyHidden=r;
|
package/dist/index.mjs
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
1
|
+
import o from "react";
|
2
|
+
import { Slot as i } from "@spark-ui/slot";
|
3
|
+
const l = ({ asChild: r = !1, ref: t, ...e }) => {
|
4
|
+
const a = r ? i : "span";
|
5
|
+
return o.createElement(a, { ...e, ref: t, style: { position: "absolute", border: 0, width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", wordWrap: "normal", ...e.style } });
|
6
|
+
};
|
7
|
+
l.displayName = "VisuallyHidden";
|
4
8
|
export {
|
5
|
-
|
9
|
+
l as VisuallyHidden
|
6
10
|
};
|
package/dist/public/docgen.json
CHANGED
@@ -5,6 +5,23 @@
|
|
5
5
|
"displayName": "VisuallyHidden",
|
6
6
|
"methods": [],
|
7
7
|
"props": {
|
8
|
+
"asChild": {
|
9
|
+
"defaultValue": {
|
10
|
+
"value": false
|
11
|
+
},
|
12
|
+
"description": "Change the default rendered element for the one passed as a child, merging their props and behavior.",
|
13
|
+
"name": "asChild",
|
14
|
+
"declarations": [
|
15
|
+
{
|
16
|
+
"fileName": "visually-hidden/src/VisuallyHidden.tsx",
|
17
|
+
"name": "TypeLiteral"
|
18
|
+
}
|
19
|
+
],
|
20
|
+
"required": false,
|
21
|
+
"type": {
|
22
|
+
"name": "boolean"
|
23
|
+
}
|
24
|
+
},
|
8
25
|
"ref": {
|
9
26
|
"defaultValue": null,
|
10
27
|
"description": "",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spark-ui/visually-hidden",
|
3
|
-
"version": "8.0
|
3
|
+
"version": "8.1.0",
|
4
4
|
"description": "Hides content from the screen in an accessible way",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -23,6 +23,9 @@
|
|
23
23
|
"scripts": {
|
24
24
|
"build": "vite build"
|
25
25
|
},
|
26
|
+
"dependencies": {
|
27
|
+
"@spark-ui/slot": "^8.1.0"
|
28
|
+
},
|
26
29
|
"peerDependencies": {
|
27
30
|
"react": "^19.0",
|
28
31
|
"react-dom": "^19.0",
|
@@ -42,5 +45,5 @@
|
|
42
45
|
},
|
43
46
|
"homepage": "https://sparkui.vercel.app",
|
44
47
|
"license": "MIT",
|
45
|
-
"gitHead": "
|
48
|
+
"gitHead": "60082d84045b716bbb39e00cb29045d68c543346"
|
46
49
|
}
|