@inseefr/lunatic 3.0.1-rc.0 → 3.0.2

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.
@@ -4,5 +4,4 @@ type Props = PropsWithChildren<{
4
4
  tooltip?: ReactNode;
5
5
  }>;
6
6
  export declare const MarkdownLink: import("react").ComponentType<Props>;
7
- export declare function generateUniqueId(): string;
8
7
  export {};
@@ -1,20 +1,14 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
2
+ import { useId } from 'react';
3
3
  import { Tooltip } from 'react-tooltip';
4
4
  import { RouterLink } from './RouterLink';
5
5
  import { slottableComponent } from '../HOC/slottableComponent';
6
6
  export const MarkdownLink = slottableComponent('MarkdownLink', ({ href, children, tooltip }) => {
7
- // Must be replace by useId when queen move to React 18.
8
- const [id] = useState(() => generateUniqueId());
7
+ const id = useId();
9
8
  const extraProps = tooltip
10
9
  ? { 'data-tooltip-id': `tooltip-${id}`, className: 'link-md' }
11
10
  : {};
12
11
  const isAbsoluteLink = href.trim().startsWith('/');
13
12
  return (_jsxs(_Fragment, { children: [isAbsoluteLink ? (_jsx(RouterLink, { to: href, id: id, ...extraProps, children: children })) : (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", id: id, ...extraProps, children: children })), tooltip && (_jsx(Tooltip, { className: "tooltip-content", id: `tooltip-${id}`, children: tooltip }))] }));
14
13
  });
15
- export function generateUniqueId() {
16
- const timestamp = Date.now().toString(36);
17
- const randomPart = Math.random().toString(36).substring(2, 8);
18
- return `${timestamp}-${randomPart}`;
19
- }
20
14
  //# sourceMappingURL=MarkdownLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownLink.js","sourceRoot":"","sources":["../../../../src/components/shared/MDLabel/MarkdownLink.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAA0C,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,O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OAAO,GACC,CACV,IACC,CACH,CAAC;AACH,CAAC,CACD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inseefr/lunatic",
3
- "version": "3.0.1-rc.0",
3
+ "version": "3.0.2",
4
4
  "description": "Library of questionnaire components",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=generateUniqueId.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateUniqueId.js","sourceRoot":"","sources":["../../../../src/components/shared/MDLabel/generateUniqueId.ts"],"names":[],"mappings":""}