@transferwise/components 0.0.0-experimental-4f00ba7 → 0.0.0-experimental-cd38ca2
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/build/field/Field.js +4 -4
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +4 -4
- package/build/field/Field.mjs.map +1 -1
- package/build/inputs/contexts.js +1 -2
- package/build/inputs/contexts.js.map +1 -1
- package/build/inputs/contexts.mjs +1 -2
- package/build/inputs/contexts.mjs.map +1 -1
- package/build/main.css +0 -3
- package/build/segmentedControl/SegmentedControl.js +1 -6
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +1 -6
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/styles/main.css +0 -3
- package/build/styles/segmentedControl/SegmentedControl.css +0 -3
- package/build/tabs/TabList.js +11 -3
- package/build/tabs/TabList.js.map +1 -1
- package/build/tabs/TabList.mjs +7 -3
- package/build/tabs/TabList.mjs.map +1 -1
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/inputs/contexts.d.ts.map +1 -1
- package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
- package/build/types/tabs/TabList.d.ts +8 -3
- package/build/types/tabs/TabList.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/uploadInput/UploadInput.js +6 -0
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +6 -0
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/package.json +3 -3
- package/src/field/Field.tsx +7 -5
- package/src/inputs/contexts.tsx +1 -2
- package/src/main.css +0 -3
- package/src/segmentedControl/SegmentedControl.css +0 -3
- package/src/segmentedControl/SegmentedControl.less +0 -4
- package/src/segmentedControl/SegmentedControl.spec.tsx +0 -10
- package/src/segmentedControl/SegmentedControl.story.tsx +4 -42
- package/src/segmentedControl/SegmentedControl.tsx +1 -5
- package/src/tabs/TabList.js +15 -0
- package/src/tabs/Tabs.story.js +135 -0
- package/src/uploadInput/UploadInput.spec.tsx +14 -1
- package/src/uploadInput/UploadInput.story.tsx +11 -0
- package/src/uploadInput/UploadInput.tsx +8 -1
- package/src/tabs/TabList.tsx +0 -11
- package/src/tabs/Tabs.story.tsx +0 -76
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { StoryFn, Meta } from '@storybook/react';
|
|
2
2
|
|
|
3
|
+
import { Field } from '../field/Field';
|
|
4
|
+
|
|
3
5
|
import UploadInput, { UploadInputProps } from './UploadInput';
|
|
4
6
|
import { UploadResponse } from './types';
|
|
5
7
|
|
|
@@ -44,3 +46,12 @@ SingleFile.args = { ...props };
|
|
|
44
46
|
|
|
45
47
|
export const MultipleFiles: Story = Template.bind({});
|
|
46
48
|
MultipleFiles.args = { ...props, multiple: true };
|
|
49
|
+
|
|
50
|
+
export const WithinField: Story = Template.bind({});
|
|
51
|
+
WithinField.decorators = [
|
|
52
|
+
(Story) => (
|
|
53
|
+
<Field message="Something went wrong" sentiment="negative">
|
|
54
|
+
<Story />
|
|
55
|
+
</Field>
|
|
56
|
+
),
|
|
57
|
+
];
|
|
@@ -4,6 +4,7 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
|
|
5
5
|
import Button from '../button';
|
|
6
6
|
import { CommonProps, ControlType, Priority, Status } from '../common';
|
|
7
|
+
import { useInputAttributes } from '../inputs/contexts';
|
|
7
8
|
import Modal from '../modal';
|
|
8
9
|
import { isSizeValid } from '../upload/utils/isSizeValid';
|
|
9
10
|
import { isTypeValid } from '../upload/utils/isTypeValid';
|
|
@@ -127,6 +128,8 @@ const UploadInput = ({
|
|
|
127
128
|
sizeLimitErrorMessage,
|
|
128
129
|
uploadButtonTitle,
|
|
129
130
|
}: UploadInputProps) => {
|
|
131
|
+
const inputAttributes = useInputAttributes({ nonLabelable: true });
|
|
132
|
+
|
|
130
133
|
const [markedFileForDelete, setMarkedFileForDelete] = useState<UploadedFile | null>(null);
|
|
131
134
|
const [mounted, setMounted] = useState(false);
|
|
132
135
|
const { formatMessage } = useIntl();
|
|
@@ -299,7 +302,11 @@ const UploadInput = ({
|
|
|
299
302
|
|
|
300
303
|
return (
|
|
301
304
|
<>
|
|
302
|
-
<div
|
|
305
|
+
<div
|
|
306
|
+
role="group"
|
|
307
|
+
className={classNames('np-upload-input', className, { disabled })}
|
|
308
|
+
{...inputAttributes}
|
|
309
|
+
>
|
|
303
310
|
{uploadedFiles.map((file) => (
|
|
304
311
|
<UploadItem
|
|
305
312
|
key={file.id}
|
package/src/tabs/TabList.tsx
DELETED
package/src/tabs/Tabs.story.tsx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import { Size, Width } from '../common';
|
|
5
|
-
|
|
6
|
-
import Tabs from './Tabs';
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
component: Tabs,
|
|
10
|
-
title: 'Navigation/Tabs',
|
|
11
|
-
} satisfies Meta<typeof Tabs>;
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
export const Basic = {
|
|
17
|
-
args: {
|
|
18
|
-
tabs: [
|
|
19
|
-
{
|
|
20
|
-
title: 'Title 1',
|
|
21
|
-
disabled: false,
|
|
22
|
-
content: (
|
|
23
|
-
<div className="p-a-2">
|
|
24
|
-
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Cum totam debitis similique
|
|
25
|
-
</div>
|
|
26
|
-
),
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
title: 'Title 2',
|
|
30
|
-
disabled: false,
|
|
31
|
-
content: (
|
|
32
|
-
<div className="p-a-2">Lorem ipsum dolor, sit amet consectetur adipisicing elit.</div>
|
|
33
|
-
),
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: 'Title 3',
|
|
37
|
-
disabled: true,
|
|
38
|
-
content: (
|
|
39
|
-
<div className="p-a-2">
|
|
40
|
-
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Cum totam debitis similique
|
|
41
|
-
</div>
|
|
42
|
-
),
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
render: function Render(args) {
|
|
47
|
-
const [selected, setSelected] = useState(0);
|
|
48
|
-
return (
|
|
49
|
-
<Tabs
|
|
50
|
-
className="tabs-custom-class"
|
|
51
|
-
name="tabs-docs"
|
|
52
|
-
transitionSpacing={Size.MEDIUM}
|
|
53
|
-
selected={selected}
|
|
54
|
-
animatePanelsOnClick
|
|
55
|
-
onTabSelect={(index: number) => setSelected(index)}
|
|
56
|
-
{...args}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
} satisfies Story;
|
|
61
|
-
|
|
62
|
-
export const AutoTabHeaderWidth = {
|
|
63
|
-
...Basic,
|
|
64
|
-
args: {
|
|
65
|
-
...Basic.args,
|
|
66
|
-
headerWidth: Width.AUTO,
|
|
67
|
-
},
|
|
68
|
-
} satisfies Story;
|
|
69
|
-
|
|
70
|
-
export const NoPanelAnimation = {
|
|
71
|
-
...Basic,
|
|
72
|
-
args: {
|
|
73
|
-
...Basic.args,
|
|
74
|
-
animatePanelsOnClick: false,
|
|
75
|
-
},
|
|
76
|
-
} satisfies Story;
|