diff --git a/package-lock.json b/package-lock.json index 11dbdb50..27159976 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,7 @@ "lodash-es": ">=4", "matcher": "^5.0.0", "react-transition-state": "^2.1.2", - "usehooks-ts": "^3.1.0", - "uuid": "^10.0.0" + "usehooks-ts": "^3.1.0" }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", @@ -106,8 +105,8 @@ }, "peerDependencies": { "@linzjs/lui": ">=21", - "ag-grid-community": "^31", - "ag-grid-react": "^31", + "ag-grid-community": "^32.1.0", + "ag-grid-react": "^32.1.0", "lodash-es": ">=4", "react": ">=18", "react-dom": ">=18" @@ -30308,18 +30307,6 @@ "node": ">= 0.4.0" } }, - "node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", diff --git a/package.json b/package.json index 7514c576..b6720728 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,7 @@ "lodash-es": ">=4", "matcher": "^5.0.0", "react-transition-state": "^2.1.2", - "usehooks-ts": "^3.1.0", - "uuid": "^10.0.0" + "usehooks-ts": "^3.1.0" }, "scripts": { "build": "run-s clean stylelint lint css bundle", diff --git a/src/lui/TextAreaInput.tsx b/src/lui/TextAreaInput.tsx index 47c1d3ea..ef960e8f 100644 --- a/src/lui/TextAreaInput.tsx +++ b/src/lui/TextAreaInput.tsx @@ -1,15 +1,9 @@ import clsx from "clsx"; import { omit } from "lodash-es"; -import { InputHTMLAttributes, ReactElement, useState } from "react"; -import { v4 as uuidVersion4 } from "uuid"; +import { InputHTMLAttributes, ReactElement, useId } from "react"; import { FormError } from "./FormError"; -export const useGenerateOrDefaultId = (idFromProps?: string) => { - const [id] = useState(idFromProps ? idFromProps : uuidVersion4()); - return id; -}; - export interface LuiTextAreaInputProps extends InputHTMLAttributes { // overrides value in base class to be string type only value: string; @@ -23,7 +17,8 @@ export interface LuiTextAreaInputProps extends InputHTMLAttributes { - const id = useGenerateOrDefaultId(props?.id); + const reactId = useId(); + const id = props?.id ?? reactId; return (