@popsure/dirty-swan 0.27.27 → 0.27.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popsure/dirty-swan",
3
- "version": "0.27.27",
3
+ "version": "0.27.28",
4
4
  "author": "Vincent Audoire <vincent@getpopsure.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -34,8 +34,7 @@
34
34
  "react-scroll-sync": "^0.9.0",
35
35
  "remark-directive": "^2.0.1",
36
36
  "sass": "^1.35.1",
37
- "signature_pad": "^3.0.0-beta.3",
38
- "uuid": "^9.0.0"
37
+ "signature_pad": "^3.0.0-beta.3"
39
38
  },
40
39
  "peerDependencies": {
41
40
  "react": "^16.12.0",
@@ -1,9 +1,12 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import classnames from 'classnames';
3
- import { v4 as uuidv4 } from 'uuid';
4
3
 
5
4
  import styles from './style.module.scss';
6
5
 
6
+ const generateUniqueId = () => {
7
+ return `input-id-${Math.floor(Math.random() * 10000000)}`;
8
+ };
9
+
7
10
  // Something weird is going on with enterKeyHint that makes it a required field under certain circumstances. The & Omit<…> and & Pick<…> is a hacky way to go around that.
8
11
  export type InputProps = {
9
12
  error?: string;
@@ -29,7 +32,7 @@ export default React.forwardRef(
29
32
  }: InputProps,
30
33
  ref?: React.ForwardedRef<HTMLInputElement>
31
34
  ) => {
32
- const uniqueId = id ?? uuidv4();
35
+ const [uniqueId] = useState(id ?? generateUniqueId());
33
36
  return (
34
37
  <div className={`${styles.container} ${className ?? ''}`}>
35
38
  {label && (