@transferwise/components 0.0.0-experimental-81baec1 → 0.0.0-experimental-76a7e6a
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/{index.mjs → index.esm.js} +4 -15
- package/build/index.esm.js.map +1 -0
- package/build/index.js +7 -17
- package/build/index.js.map +1 -1
- package/build/{mocks.mjs → mocks.esm.js} +1 -1
- package/build/mocks.esm.js.map +1 -0
- package/build/types/common/hooks/useMedia.d.ts.map +1 -1
- package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
- package/package.json +6 -22
- package/src/common/hooks/useMedia.ts +1 -2
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +3 -2
- package/src/radio/Radio.story.tsx +3 -4
- package/src/segmentedControl/SegmentedControl.tsx +1 -0
- package/src/switch/Switch.story.tsx +4 -1
- package/build/index.mjs.map +0 -1
- package/build/mocks.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.esm.js","sources":["../src/mocks.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAe,iBAAQ,GAAE,CAAA,IAAA,EAAA,KAAa,KAAK;AAE3C,IAAA,MAAU,CAAgB,cAAA,CAAA,UAAA,EAAA,IAAA,EAAA;AACxB,QAAI;QACM,QAAG,EAAA,IAAA;AACd,QAAA,UAAA,EAAA,IAAA;AAWD,QAAgB,YAAA,EAAA,IAAA;AAoBhB,KAAgB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../../../src/common/hooks/useMedia.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../../../src/common/hooks/useMedia.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,uBAYrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/segmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";AAMA,KAAK,WAAW,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE,KAAK,OAAO,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAClD,KAAK,mBAAmB,GAAG,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,SAAS,OAAO,EAAE,GAAG,SAAS,mBAAmB,EAAE,CAAC;AAE3E,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAC1C,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAC3D,CAAC,yBAAyB,GAAG,0BAA0B,CAAC,CAAC;AAE3D,QAAA,MAAM,gBAAgB,sDAMnB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/segmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";AAMA,KAAK,WAAW,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE,KAAK,OAAO,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAClD,KAAK,mBAAmB,GAAG,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,SAAS,OAAO,EAAE,GAAG,SAAS,mBAAmB,EAAE,CAAC;AAE3E,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAC1C,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAC3D,CAAC,yBAAyB,GAAG,0BAA0B,CAAC,CAAC;AAE3D,QAAA,MAAM,gBAAgB,sDAMnB,qBAAqB,gCAsIvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-76a7e6a",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,24 +13,8 @@
|
|
|
13
13
|
"*.css"
|
|
14
14
|
],
|
|
15
15
|
"main": "./build/index.js",
|
|
16
|
-
"module": "./build/index.
|
|
16
|
+
"module": "./build/index.esm.js",
|
|
17
17
|
"types": "./build/types/index.d.ts",
|
|
18
|
-
"exports": {
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./build/types/index.d.ts",
|
|
21
|
-
"import": "./build/index.mjs",
|
|
22
|
-
"require": "./build/index.js"
|
|
23
|
-
},
|
|
24
|
-
"./mocks": {
|
|
25
|
-
"types": "./build/mocks.d.ts",
|
|
26
|
-
"import": "./build/mocks.mjs",
|
|
27
|
-
"require": "./build/mocks.js"
|
|
28
|
-
},
|
|
29
|
-
"./build/*": "./build/*.js",
|
|
30
|
-
"./build/*.css": "./build/*.css",
|
|
31
|
-
"./build/*.json": "./build/*.json",
|
|
32
|
-
"./build/i18n": "./build/i18n"
|
|
33
|
-
},
|
|
34
18
|
"files": [
|
|
35
19
|
"build/",
|
|
36
20
|
"src/",
|
|
@@ -91,18 +75,17 @@
|
|
|
91
75
|
"jest-fetch-mock": "^3.0.3",
|
|
92
76
|
"lodash.times": "^4.3.2",
|
|
93
77
|
"react-intl": "^5.10.0",
|
|
94
|
-
"react-merge-refs": "^1.1.0",
|
|
95
78
|
"rollup": "^3.28.1",
|
|
96
79
|
"storybook": "^7.6.17",
|
|
97
80
|
"@transferwise/less-config": "3.1.0",
|
|
98
81
|
"@transferwise/neptune-css": "14.9.6",
|
|
99
|
-
"@wise/components-theming": "
|
|
82
|
+
"@wise/components-theming": "1.0.0"
|
|
100
83
|
},
|
|
101
84
|
"peerDependencies": {
|
|
102
85
|
"@transferwise/icons": "^3.7.0",
|
|
103
86
|
"@transferwise/neptune-css": "^14.9.6",
|
|
104
87
|
"@wise/art": "^2.7.0",
|
|
105
|
-
"@wise/components-theming": "
|
|
88
|
+
"@wise/components-theming": "^1.0.0",
|
|
106
89
|
"react": ">=16.14",
|
|
107
90
|
"react-dom": ">=16.14",
|
|
108
91
|
"react-intl": "^5.10.0 || ^6"
|
|
@@ -118,7 +101,7 @@
|
|
|
118
101
|
"@react-aria/overlays": "^3.17.0",
|
|
119
102
|
"@react-spring/web": "~9.6.1",
|
|
120
103
|
"@transferwise/formatting": "^2.1.0",
|
|
121
|
-
"@transferwise/neptune-validation": "
|
|
104
|
+
"@transferwise/neptune-validation": "^3.1.0",
|
|
122
105
|
"classnames": "^2.2.6",
|
|
123
106
|
"commonmark": "0.29.1",
|
|
124
107
|
"core-js": "^3.8.0",
|
|
@@ -128,6 +111,7 @@
|
|
|
128
111
|
"lodash.topairs": "^4.3.0",
|
|
129
112
|
"merge-props": "^6.0.0",
|
|
130
113
|
"prop-types": "^15.7.2",
|
|
114
|
+
"react-merge-refs": "^1.1.0",
|
|
131
115
|
"react-popper": "^2.3.0",
|
|
132
116
|
"react-required-if": "^1.0.3",
|
|
133
117
|
"react-transition-group": "^4.4.2",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
|
|
1
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
3
2
|
|
|
4
3
|
export function useMedia(query: string) {
|
|
5
4
|
return useSyncExternalStore(
|
|
@@ -34,14 +34,15 @@ const Template = (args) => {
|
|
|
34
34
|
const placeholder = args.pattern;
|
|
35
35
|
const displayPattern = args.pattern;
|
|
36
36
|
const label = args.label;
|
|
37
|
+
const id = label.replaceAll(' ', '-').toLowerCase();
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
40
|
<>
|
|
40
|
-
<label id="template" htmlFor=
|
|
41
|
+
<label id="template" htmlFor={id}>
|
|
41
42
|
{label}
|
|
42
43
|
</label>
|
|
43
44
|
<InputWithDisplayFormat
|
|
44
|
-
id=
|
|
45
|
+
id={id}
|
|
45
46
|
placeholder={placeholder}
|
|
46
47
|
displayPattern={displayPattern}
|
|
47
48
|
className="form-control"
|
|
@@ -44,7 +44,7 @@ export const Basic = () => {
|
|
|
44
44
|
<Radio
|
|
45
45
|
label={label}
|
|
46
46
|
name="name"
|
|
47
|
-
id="
|
|
47
|
+
id="id1"
|
|
48
48
|
checked={checked}
|
|
49
49
|
disabled={disabled}
|
|
50
50
|
secondary={secondary}
|
|
@@ -61,7 +61,7 @@ export const Basic = () => {
|
|
|
61
61
|
<div className={`form-group ${hasError ? 'has-error' : ''}`}>
|
|
62
62
|
<Checkbox
|
|
63
63
|
label={label}
|
|
64
|
-
id="
|
|
64
|
+
id="id2"
|
|
65
65
|
checked={checked}
|
|
66
66
|
disabled={disabled}
|
|
67
67
|
secondary={secondary}
|
|
@@ -71,10 +71,9 @@ export const Basic = () => {
|
|
|
71
71
|
<div className={`form-group ${hasError ? 'has-error' : ''}`}>
|
|
72
72
|
<Checkbox
|
|
73
73
|
label={label}
|
|
74
|
-
id="
|
|
74
|
+
id="id3"
|
|
75
75
|
checked={checked}
|
|
76
76
|
disabled={disabled}
|
|
77
|
-
// secondary={secondary}
|
|
78
77
|
onChange={() => setChecked(!checked)}
|
|
79
78
|
/>
|
|
80
79
|
</div>
|
|
@@ -101,6 +101,7 @@ const SegmentedControl = ({
|
|
|
101
101
|
className={classNames('segmented-control__segments', {
|
|
102
102
|
'segmented-control__segments--no-animate': !animate,
|
|
103
103
|
})}
|
|
104
|
+
role={mode !== 'input' ? 'tablist' : undefined}
|
|
104
105
|
>
|
|
105
106
|
{segmentsWithRefs.map((segment) =>
|
|
106
107
|
mode === 'input' ? (
|
|
@@ -39,6 +39,9 @@ export const Disabled = () => {
|
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<div className="d-flex flex-column">
|
|
42
|
+
<label id="labelID" htmlFor="switchId">
|
|
43
|
+
A switch with a label
|
|
44
|
+
</label>
|
|
42
45
|
<Switch
|
|
43
46
|
checked={checked}
|
|
44
47
|
disabled
|
|
@@ -53,7 +56,7 @@ export const Disabled = () => {
|
|
|
53
56
|
disabled
|
|
54
57
|
className="a-class-name"
|
|
55
58
|
aria-labelledby="labelID"
|
|
56
|
-
id="
|
|
59
|
+
id="switchId1"
|
|
57
60
|
onClick={() => setCheck(!checked)}
|
|
58
61
|
/>
|
|
59
62
|
</div>
|