react-headings 3.3.2 → 3.3.4

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- declare type Level = 1 | 2 | 3 | 4 | 5 | 6;
3
- declare type Heading = `h${Level}`;
4
- declare type LevelContextValue = {
2
+ type Level = 1 | 2 | 3 | 4 | 5 | 6;
3
+ type Heading = `h${Level}`;
4
+ type LevelContextValue = {
5
5
  level: Level;
6
6
  Component: Heading;
7
7
  };
@@ -9,14 +9,14 @@ declare type LevelContextValue = {
9
9
  * Returns the current heading and level.
10
10
  */
11
11
  export declare function useLevel(): LevelContextValue;
12
- declare type HProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> & {
12
+ type HProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> & {
13
13
  render?: (context: LevelContextValue) => React.ReactElement;
14
14
  };
15
15
  /**
16
16
  * Renders a dynamic HTML heading (h1, h2, etc.) or custom component according to the current level.
17
17
  */
18
- export declare const H: React.ForwardRefExoticComponent<Pick<HProps, "render" | "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & React.RefAttributes<HTMLHeadingElement>>;
19
- declare type SectionProps = {
18
+ export declare const H: React.ForwardRefExoticComponent<Omit<HProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
19
+ type SectionProps = {
20
20
  component: React.ReactNode;
21
21
  children?: React.ReactNode;
22
22
  };
package/dist/index.js CHANGED
@@ -61,7 +61,7 @@ function Section(_a) {
61
61
  var nextLevel = Math.min(level + 1, 6);
62
62
  var value = {
63
63
  level: nextLevel,
64
- Component: "h" + nextLevel,
64
+ Component: "h".concat(nextLevel),
65
65
  };
66
66
  return (react_1.default.createElement(react_1.default.Fragment, null,
67
67
  component,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-headings",
3
- "version": "3.3.2",
3
+ "version": "3.3.4",
4
4
  "description": "HTML headings with auto-incrementing levels for WCAG compliance.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,22 +36,22 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@size-limit/preset-small-lib": "^7.0.8",
39
- "@testing-library/react": "^13.0.1",
40
- "@types/react": "^18.0.3",
41
- "@types/react-dom": "^18.0.0",
39
+ "@testing-library/react": "^13.4.0",
40
+ "@types/react": "^18.3.28",
41
+ "@types/react-dom": "^18.3.7",
42
42
  "@typescript-eslint/eslint-plugin": "^4.33.0",
43
43
  "@typescript-eslint/parser": "^4.33.0",
44
44
  "@vitest/coverage-c8": "^0.30.1",
45
- "conventional-changelog-conventionalcommits": "^4.6.1",
45
+ "conventional-changelog-conventionalcommits": "^8.0.0",
46
46
  "eslint": "^7.32.0",
47
- "eslint-config-prettier": "^8.3.0",
48
- "jsdom": "^21.1.1",
49
- "prettier": "^2.7.1",
50
- "react": "^18.0.0",
51
- "react-dom": "^18.0.0",
52
- "semantic-release": "^21.0.1",
47
+ "eslint-config-prettier": "^8.10.2",
48
+ "jsdom": "^21.1.2",
49
+ "prettier": "^2.8.8",
50
+ "react": "^18.3.1",
51
+ "react-dom": "^18.3.1",
52
+ "semantic-release": "^25.0.3",
53
53
  "size-limit": "^7.0.8",
54
- "typescript": "^4.4.3",
54
+ "typescript": "^4.9.5",
55
55
  "vitest": "^0.30.1"
56
56
  }
57
57
  }