@popsure/dirty-swan 0.27.26 → 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/dist/index.js +13 -69
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
- package/src/lib/components/comparisonTable/components/TableArrows/index.tsx +1 -1
- package/src/lib/components/comparisonTable/components/TableArrows/style.module.scss +2 -0
- package/src/lib/components/comparisonTable/index.tsx +31 -27
- package/src/lib/components/input/index.tsx +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@popsure/dirty-swan",
|
|
3
|
-
"version": "0.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",
|
|
@@ -16,7 +16,7 @@ const TableArrows = (props: TableArrowsProps) => {
|
|
|
16
16
|
const handleButtonClick = (value: ArrowValues) => () => onClick(value);
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<div className={
|
|
19
|
+
<div className={styles.container}>
|
|
20
20
|
<button
|
|
21
21
|
onClick={handleButtonClick('prev')}
|
|
22
22
|
className={classNames(
|
|
@@ -186,39 +186,43 @@ const ComparisonTable = <T extends { id: number }>(
|
|
|
186
186
|
</ScrollSyncPane>
|
|
187
187
|
</AccordionItem>
|
|
188
188
|
) : (
|
|
189
|
-
<
|
|
190
|
-
<
|
|
191
|
-
className={classNames(
|
|
192
|
-
baseStyles.container,
|
|
193
|
-
styles?.container,
|
|
194
|
-
{
|
|
195
|
-
[baseStyles.noScrollBars]: hideScrollBars,
|
|
196
|
-
}
|
|
197
|
-
)}
|
|
198
|
-
>
|
|
189
|
+
<div key={idString}>
|
|
190
|
+
<ScrollSyncPane>
|
|
199
191
|
<div
|
|
200
192
|
className={classNames(
|
|
201
|
-
baseStyles
|
|
202
|
-
|
|
203
|
-
>
|
|
204
|
-
<div className={baseStyles['group-container']}>
|
|
193
|
+
baseStyles.container,
|
|
194
|
+
styles?.container,
|
|
205
195
|
{
|
|
206
|
-
|
|
207
|
-
* Print a table subheader if the `label` value is present
|
|
208
|
-
*/
|
|
209
|
-
headerGroup.label && !collapsibleSections && (
|
|
210
|
-
<div className={baseStyles['group-title']}>
|
|
211
|
-
<h4 className={`p-h4 ${baseStyles.sticky}`}>
|
|
212
|
-
{headerGroup.label}
|
|
213
|
-
</h4>
|
|
214
|
-
</div>
|
|
215
|
-
)
|
|
196
|
+
[baseStyles.noScrollBars]: hideScrollBars,
|
|
216
197
|
}
|
|
217
|
-
|
|
198
|
+
)}
|
|
199
|
+
>
|
|
200
|
+
<div
|
|
201
|
+
className={classNames(
|
|
202
|
+
baseStyles['overflow-container']
|
|
203
|
+
)}
|
|
204
|
+
>
|
|
205
|
+
<div className={baseStyles['group-container']}>
|
|
206
|
+
{
|
|
207
|
+
/**
|
|
208
|
+
* Print a table subheader if the `label` value is present
|
|
209
|
+
*/
|
|
210
|
+
headerGroup.label && !collapsibleSections && (
|
|
211
|
+
<div className={baseStyles['group-title']}>
|
|
212
|
+
<h4
|
|
213
|
+
className={`p-h4 ${baseStyles.sticky}`}
|
|
214
|
+
>
|
|
215
|
+
{headerGroup.label}
|
|
216
|
+
</h4>
|
|
217
|
+
</div>
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
{content}
|
|
221
|
+
</div>
|
|
218
222
|
</div>
|
|
219
223
|
</div>
|
|
220
|
-
</
|
|
221
|
-
</
|
|
224
|
+
</ScrollSyncPane>
|
|
225
|
+
</div>
|
|
222
226
|
)}
|
|
223
227
|
</>
|
|
224
228
|
);
|
|
@@ -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 ??
|
|
35
|
+
const [uniqueId] = useState(id ?? generateUniqueId());
|
|
33
36
|
return (
|
|
34
37
|
<div className={`${styles.container} ${className ?? ''}`}>
|
|
35
38
|
{label && (
|