@transferwise/components 0.0.0-experimental-2fa5e3f → 0.0.0-experimental-c09cb11
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/dateLookup/dateTrigger/DateTrigger.js +8 -4
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +8 -4
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
- package/build/field/Field.js +34 -7
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +34 -7
- package/build/field/Field.mjs.map +1 -1
- package/build/i18n/en.json +1 -0
- package/build/i18n/en.json.js +1 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +1 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +13 -6
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +13 -6
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/label/Label.js +49 -5
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.messages.js +12 -0
- package/build/label/Label.messages.js.map +1 -0
- package/build/label/Label.messages.mjs +10 -0
- package/build/label/Label.messages.mjs.map +1 -0
- package/build/label/Label.mjs +50 -6
- package/build/label/Label.mjs.map +1 -1
- package/build/main.css +4 -8
- package/build/styles/dateLookup/dateTrigger/DateTrigger.css +0 -8
- package/build/styles/field/Field.css +4 -0
- package/build/styles/main.css +4 -8
- package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts.map +1 -1
- package/build/types/field/Field.d.ts +4 -2
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inlineAlert/InlineAlert.d.ts +9 -0
- package/build/types/inlineAlert/InlineAlert.d.ts.map +1 -1
- package/build/types/label/Label.d.ts +39 -3
- package/build/types/label/Label.d.ts.map +1 -1
- package/build/types/label/Label.messages.d.ts +8 -0
- package/build/types/label/Label.messages.d.ts.map +1 -0
- package/build/types/label/index.d.ts +3 -0
- package/build/types/label/index.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/dateInput/DateInput.tests.story.tsx +6 -41
- package/src/dateLookup/DateLookup.rtl.spec.tsx +1 -1
- package/src/dateLookup/dateTrigger/DateTrigger.css +0 -8
- package/src/dateLookup/dateTrigger/DateTrigger.less +0 -8
- package/src/dateLookup/dateTrigger/DateTrigger.spec.js +1 -1
- package/src/dateLookup/dateTrigger/DateTrigger.tsx +9 -4
- package/src/field/Field.css +4 -0
- package/src/field/Field.less +5 -0
- package/src/field/Field.spec.tsx +41 -5
- package/src/field/Field.story.tsx +105 -7
- package/src/field/Field.tsx +33 -9
- package/src/i18n/en.json +1 -0
- package/src/index.ts +1 -1
- package/src/inlineAlert/InlineAlert.story.tsx +7 -72
- package/src/inlineAlert/InlineAlert.tsx +14 -3
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +5 -10
- package/src/inputs/InputGroup.spec.tsx +1 -1
- package/src/inputs/SearchInput.spec.tsx +1 -1
- package/src/inputs/SelectInput.spec.tsx +1 -1
- package/src/label/Label.messages.tsx +8 -0
- package/src/label/Label.spec.tsx +42 -7
- package/src/label/Label.story.tsx +30 -25
- package/src/label/Label.tsx +66 -8
- package/src/label/index.ts +2 -0
- package/src/main.css +4 -8
- package/src/main.less +1 -0
- package/src/moneyInput/MoneyInput.story.tsx +11 -11
- package/src/radioGroup/RadioGroup.rtl.spec.tsx +1 -1
- package/src/select/Select.rtl.spec.tsx +1 -1
- package/src/switch/Switch.spec.tsx +1 -1
- package/src/switch/Switch.story.tsx +19 -21
- package/src/field/Field.tests.story.tsx +0 -33
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.messages.mjs","sources":["../../src/label/Label.messages.tsx"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n optionalLabel: {\n id: 'neptune.Label.optional',\n defaultMessage: '(Optional)',\n },\n});\n"],"names":["defineMessages","optionalLabel","id"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,aAAa,EAAE;IACbC,EAAE,EAAA,wBAAA;AAEH,GAAA;AACF,CAAA,CAAC;;;;"}
|
package/build/label/Label.mjs
CHANGED
|
@@ -1,19 +1,63 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import
|
|
2
|
+
import messages from './Label.messages.mjs';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import Body from '../body/Body.mjs';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
6
|
|
|
4
7
|
const Label = ({
|
|
5
|
-
id,
|
|
6
|
-
htmlFor,
|
|
7
8
|
className,
|
|
8
9
|
children
|
|
9
10
|
}) => {
|
|
10
|
-
return /*#__PURE__*/jsx("
|
|
11
|
+
return /*#__PURE__*/jsx("div", {
|
|
12
|
+
className: clsx('np-label d-flex flex-column', className),
|
|
13
|
+
children: children
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Avoid wrapping form control with `<Label.Text >`, always connect label and control via `htmlFor` + `id` props
|
|
18
|
+
*
|
|
19
|
+
* Example:
|
|
20
|
+
* ```
|
|
21
|
+
* <Label>
|
|
22
|
+
* <Label.Text htmlFor="foo">Money input with label</Label.Text>
|
|
23
|
+
* <CustomComponent id="foo" />
|
|
24
|
+
* </Label>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
// eslint-disable-next-line functional/immutable-data
|
|
28
|
+
Label.Text = function Text({
|
|
29
|
+
id,
|
|
30
|
+
children,
|
|
31
|
+
required = false,
|
|
32
|
+
htmlFor,
|
|
33
|
+
className
|
|
34
|
+
}) {
|
|
35
|
+
const {
|
|
36
|
+
formatMessage
|
|
37
|
+
} = useIntl();
|
|
38
|
+
return /*#__PURE__*/jsxs("label", {
|
|
11
39
|
id: id,
|
|
12
40
|
htmlFor: htmlFor,
|
|
13
|
-
className:
|
|
14
|
-
children: children
|
|
41
|
+
className: "np-text-body-default-bold text-primary m-b-0",
|
|
42
|
+
children: [children, required ? null : /*#__PURE__*/jsx(Body, {
|
|
43
|
+
as: "span",
|
|
44
|
+
className: clsx('text-secondary', 'm-l-1', className),
|
|
45
|
+
children: formatMessage(messages.optionalLabel)
|
|
46
|
+
})]
|
|
15
47
|
});
|
|
16
48
|
};
|
|
49
|
+
// eslint-disable-next-line functional/immutable-data
|
|
50
|
+
Label.Description = function Description({
|
|
51
|
+
id,
|
|
52
|
+
children,
|
|
53
|
+
className
|
|
54
|
+
}) {
|
|
55
|
+
return children ? /*#__PURE__*/jsx(Body, {
|
|
56
|
+
id: id,
|
|
57
|
+
className: clsx('text-secondary', className),
|
|
58
|
+
children: children
|
|
59
|
+
}) : null;
|
|
60
|
+
};
|
|
17
61
|
|
|
18
62
|
export { Label };
|
|
19
63
|
//# sourceMappingURL=Label.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.mjs","sources":["../../src/label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nexport type LabelProps = {\n
|
|
1
|
+
{"version":3,"file":"Label.mjs","sources":["../../src/label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../body';\nimport { CommonProps } from '../common';\nimport { PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = ({ className, children }: LabelProps) => {\n return <div className={clsx('np-label d-flex flex-column', className)}>{children}</div>;\n};\n\nexport type LabelOptionalProps = PropsWithChildren<CommonProps> & {\n id?: string;\n required?: boolean;\n /**\n * Connect label with form control via `htmlFor` prop, or `id` + `aria-labelledby`\n */\n htmlFor?: string | undefined;\n};\n\n/**\n * Avoid wrapping form control with `<Label.Text >`, always connect label and control via `htmlFor` + `id` props\n *\n * Example:\n * ```\n * <Label>\n * <Label.Text htmlFor=\"foo\">Money input with label</Label.Text>\n * <CustomComponent id=\"foo\" />\n * </Label>\n * ```\n */\n// eslint-disable-next-line functional/immutable-data\nLabel.Text = function Text({\n id,\n children,\n required = false,\n htmlFor,\n className,\n}: LabelOptionalProps) {\n const { formatMessage } = useIntl();\n return (\n <label id={id} htmlFor={htmlFor} className=\"np-text-body-default-bold text-primary m-b-0\">\n {children}\n {required ? null : (\n <Body as=\"span\" className={clsx('text-secondary', 'm-l-1', className)}>\n {formatMessage(messages.optionalLabel)}\n </Body>\n )}\n </label>\n );\n};\n\nexport type LabelDescriptionProps = PropsWithChildren<CommonProps> & { id?: string };\n\n// eslint-disable-next-line functional/immutable-data\nLabel.Description = function Description({ id, children, className }: LabelDescriptionProps) {\n return children ? (\n <Body id={id} className={clsx('text-secondary', className)}>\n {children}\n </Body>\n ) : null;\n};\n\nexport { Label };\n"],"names":["Label","className","children","_jsx","clsx","Text","id","required","htmlFor","formatMessage","useIntl","_jsxs","Body","as","messages","optionalLabel","Description"],"mappings":";;;;;;AAqBMA,MAAAA,KAAK,GAAGA,CAAC;EAAEC,SAAS;AAAEC,EAAAA,QAAAA;AAAsB,CAAA,KAAI;AACpD,EAAA,oBAAOC,GAAA,CAAA,KAAA,EAAA;AAAKF,IAAAA,SAAS,EAAEG,IAAI,CAAC,6BAA6B,EAAEH,SAAS,CAAE;AAAAC,IAAAA,QAAA,EAAEA,QAAAA;AAAQ,GAAM,CAAC,CAAA;AACzF,EAAC;AAWD;;;;;;;;;;AAUG;AACH;AACAF,KAAK,CAACK,IAAI,GAAG,SAASA,IAAIA,CAAC;EACzBC,EAAE;EACFJ,QAAQ;AACRK,EAAAA,QAAQ,GAAG,KAAK;EAChBC,OAAO;AACPP,EAAAA,SAAAA;AACmB,CAAA,EAAA;EACnB,MAAM;AAAEQ,IAAAA,aAAAA;GAAe,GAAGC,OAAO,EAAE,CAAA;AACnC,EAAA,oBACEC,IAAA,CAAA,OAAA,EAAA;AAAOL,IAAAA,EAAE,EAAEA,EAAG;AAACE,IAAAA,OAAO,EAAEA,OAAQ;AAACP,IAAAA,SAAS,EAAC,8CAA8C;IAAAC,QAAA,EAAA,CACtFA,QAAQ,EACRK,QAAQ,GAAG,IAAI,gBACdJ,GAAA,CAACS,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACZ,SAAS,EAAEG,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAEH,SAAS,CAAE;AAAAC,MAAAA,QAAA,EACnEO,aAAa,CAACK,QAAQ,CAACC,aAAa,CAAA;AAAC,KAClC,CACP,CAAA;AAAA,GACI,CAAC,CAAA;AAEZ,CAAC,CAAA;AAID;AACAf,KAAK,CAACgB,WAAW,GAAG,SAASA,WAAWA,CAAC;EAAEV,EAAE;EAAEJ,QAAQ;AAAED,EAAAA,SAAAA;AAAkC,CAAA,EAAA;AACzF,EAAA,OAAOC,QAAQ,gBACbC,GAAA,CAACS,IAAI,EAAA;AAACN,IAAAA,EAAE,EAAEA,EAAG;AAACL,IAAAA,SAAS,EAAEG,IAAI,CAAC,gBAAgB,EAAEH,SAAS,CAAE;AAAAC,IAAAA,QAAA,EACxDA,QAAAA;GACG,CAAC,GACL,IAAI,CAAA;AACV,CAAC;;;;"}
|
package/build/main.css
CHANGED
|
@@ -1719,18 +1719,10 @@ button.np-option {
|
|
|
1719
1719
|
white-space: nowrap;
|
|
1720
1720
|
width: 100%;
|
|
1721
1721
|
}
|
|
1722
|
-
.np-date-trigger .control-label {
|
|
1723
|
-
font-weight: 400;
|
|
1724
|
-
font-weight: var(--font-weight-regular);
|
|
1725
|
-
}
|
|
1726
1722
|
.np-theme-personal .np-date-trigger {
|
|
1727
1723
|
padding-left: 16px;
|
|
1728
1724
|
padding-left: var(--size-16);
|
|
1729
1725
|
}
|
|
1730
|
-
.np-theme-personal .np-date-trigger .control-label + span {
|
|
1731
|
-
font-weight: 400;
|
|
1732
|
-
font-weight: var(--font-weight-regular);
|
|
1733
|
-
}
|
|
1734
1726
|
.clear-btn {
|
|
1735
1727
|
transition: color 0.15s ease-in-out;
|
|
1736
1728
|
color: #c9cbce;
|
|
@@ -2385,6 +2377,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2385
2377
|
border-radius: 9999px !important;
|
|
2386
2378
|
border-radius: var(--radius-full) !important;
|
|
2387
2379
|
}
|
|
2380
|
+
.np-field-control {
|
|
2381
|
+
margin-top: 4px;
|
|
2382
|
+
margin-top: var(--size-4);
|
|
2383
|
+
}
|
|
2388
2384
|
.np-input-group {
|
|
2389
2385
|
display: inline-grid;
|
|
2390
2386
|
width: 100%;
|
|
@@ -4,18 +4,10 @@
|
|
|
4
4
|
white-space: nowrap;
|
|
5
5
|
width: 100%;
|
|
6
6
|
}
|
|
7
|
-
.np-date-trigger .control-label {
|
|
8
|
-
font-weight: 400;
|
|
9
|
-
font-weight: var(--font-weight-regular);
|
|
10
|
-
}
|
|
11
7
|
.np-theme-personal .np-date-trigger {
|
|
12
8
|
padding-left: 16px;
|
|
13
9
|
padding-left: var(--size-16);
|
|
14
10
|
}
|
|
15
|
-
.np-theme-personal .np-date-trigger .control-label + span {
|
|
16
|
-
font-weight: 400;
|
|
17
|
-
font-weight: var(--font-weight-regular);
|
|
18
|
-
}
|
|
19
11
|
.clear-btn {
|
|
20
12
|
transition: color 0.15s ease-in-out;
|
|
21
13
|
color: #c9cbce;
|
package/build/styles/main.css
CHANGED
|
@@ -1719,18 +1719,10 @@ button.np-option {
|
|
|
1719
1719
|
white-space: nowrap;
|
|
1720
1720
|
width: 100%;
|
|
1721
1721
|
}
|
|
1722
|
-
.np-date-trigger .control-label {
|
|
1723
|
-
font-weight: 400;
|
|
1724
|
-
font-weight: var(--font-weight-regular);
|
|
1725
|
-
}
|
|
1726
1722
|
.np-theme-personal .np-date-trigger {
|
|
1727
1723
|
padding-left: 16px;
|
|
1728
1724
|
padding-left: var(--size-16);
|
|
1729
1725
|
}
|
|
1730
|
-
.np-theme-personal .np-date-trigger .control-label + span {
|
|
1731
|
-
font-weight: 400;
|
|
1732
|
-
font-weight: var(--font-weight-regular);
|
|
1733
|
-
}
|
|
1734
1726
|
.clear-btn {
|
|
1735
1727
|
transition: color 0.15s ease-in-out;
|
|
1736
1728
|
color: #c9cbce;
|
|
@@ -2385,6 +2377,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2385
2377
|
border-radius: 9999px !important;
|
|
2386
2378
|
border-radius: var(--radius-full) !important;
|
|
2387
2379
|
}
|
|
2380
|
+
.np-field-control {
|
|
2381
|
+
margin-top: 4px;
|
|
2382
|
+
margin-top: var(--size-4);
|
|
2383
|
+
}
|
|
2388
2384
|
.np-input-group {
|
|
2389
2385
|
display: inline-grid;
|
|
2390
2386
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTrigger.d.ts","sourceRoot":"","sources":["../../../../src/dateLookup/dateTrigger/DateTrigger.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAkB,SAAS,EAAE,UAAU,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"DateTrigger.d.ts","sourceRoot":"","sources":["../../../../src/dateLookup/dateTrigger/DateTrigger.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAkB,SAAS,EAAE,UAAU,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAQ5F,UAAU,gBAAgB;IACxB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmE3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -4,14 +4,16 @@ export type FieldProps = {
|
|
|
4
4
|
id?: string | null;
|
|
5
5
|
/** Should be specified unless the wrapped control has its own labeling mechanism, e.g. `Checkbox`. */
|
|
6
6
|
label?: React.ReactNode;
|
|
7
|
-
|
|
7
|
+
required?: boolean;
|
|
8
|
+
/** @deprecated use `description` prop instead */
|
|
8
9
|
hint?: React.ReactNode;
|
|
9
10
|
message?: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode;
|
|
10
12
|
/** @deprecated use `message` and `type={Sentiment.NEGATIVE}` prop instead */
|
|
11
13
|
error?: React.ReactNode;
|
|
12
14
|
sentiment?: `${Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.POSITIVE | Sentiment.WARNING}`;
|
|
13
15
|
className?: string;
|
|
14
16
|
children?: React.ReactNode;
|
|
15
17
|
};
|
|
16
|
-
export declare const Field: ({ id, label, message: propMessage, sentiment: propType, className, children, ...props }: FieldProps) => import("react").JSX.Element;
|
|
18
|
+
export declare const Field: ({ id, label, required, message: propMessage, hint, description, sentiment: propType, className, children, ...props }: FieldProps) => import("react").JSX.Element;
|
|
17
19
|
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAUtC,MAAM,MAAM,UAAU,GAAG;IACvB,6IAA6I;IAC7I,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,sGAAsG;IACtG,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAUtC,MAAM,MAAM,UAAU,GAAG;IACvB,6IAA6I;IAC7I,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,sGAAsG;IACtG,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,6EAA6E;IAC7E,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IACjG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,KAAK,yHAWf,UAAU,gCAoEZ,CAAC"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type { SearchInputProps } from './inputs/SearchInput';
|
|
|
29
29
|
export type { SelectInputGroupItem, SelectInputItem, SelectInputOptionContentProps, SelectInputOptionItem, SelectInputProps, SelectInputSeparatorItem, SelectInputTriggerButtonProps, } from './inputs/SelectInput';
|
|
30
30
|
export type { TextAreaProps } from './inputs/TextArea';
|
|
31
31
|
export type { InstructionsListProps } from './instructionsList';
|
|
32
|
-
export type { LabelProps } from './label/Label';
|
|
32
|
+
export type { LabelProps, LabelOptionalProps, LabelDescriptionProps } from './label/Label';
|
|
33
33
|
export type { LoaderProps } from './loader';
|
|
34
34
|
export type { MarkdownProps } from './markdown';
|
|
35
35
|
export type { ModalProps } from './modal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjG,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,YAAY,EACZ,eAAe,EACf,SAAS,EACT,UAAU,EACV,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACtF,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AA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EACT,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,MAAM,EACN,SAAS,EACT,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EACP,KAAK,GACN,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;GAEG;AACH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,EACT,YAAY,GACb,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -6,5 +6,14 @@ export interface InlineAlertProps {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Avoid using `<InlineAlert>` component directly
|
|
11
|
+
* it's for edge cases when `<Field />` isn't suitable for some reasons.
|
|
12
|
+
*
|
|
13
|
+
* Example:
|
|
14
|
+
* ```
|
|
15
|
+
* <Field sentiment={..} message={..}>..</Field>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
9
18
|
export default function InlineAlert({ id, type, className, children, }: InlineAlertProps): import("react").JSX.Element;
|
|
10
19
|
//# sourceMappingURL=InlineAlert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineAlert.d.ts","sourceRoot":"","sources":["../../../src/inlineAlert/InlineAlert.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,SAAS,EAAQ,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"InlineAlert.d.ts","sourceRoot":"","sources":["../../../src/inlineAlert/InlineAlert.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,SAAS,EAAQ,MAAM,WAAW,CAAC;AAI5C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAUD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,EAAE,EACF,IAAgB,EAChB,SAAS,EACT,QAAQ,GACT,EAAE,gBAAgB,+BAgBlB"}
|
|
@@ -1,8 +1,44 @@
|
|
|
1
|
+
import { CommonProps } from '../common';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
1
3
|
export type LabelProps = {
|
|
2
|
-
id?: string;
|
|
3
|
-
htmlFor?: string;
|
|
4
4
|
className?: string;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Avoid using `<Label>` component directly
|
|
9
|
+
* it's for edge cases when `<Field />` isn't suitable for some reasons.
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* ```
|
|
13
|
+
* <Field label={..} description={..} required={..}>..</Field>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare const Label: {
|
|
17
|
+
({ className, children }: LabelProps): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Avoid wrapping form control with `<Label.Text >`, always connect label and control via `htmlFor` + `id` props
|
|
20
|
+
*
|
|
21
|
+
* Example:
|
|
22
|
+
* ```
|
|
23
|
+
* <Label>
|
|
24
|
+
* <Label.Text htmlFor="foo">Money input with label</Label.Text>
|
|
25
|
+
* <CustomComponent id="foo" />
|
|
26
|
+
* </Label>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
Text({ id, children, required, htmlFor, className, }: LabelOptionalProps): import("react").JSX.Element;
|
|
30
|
+
Description({ id, children, className }: LabelDescriptionProps): import("react").JSX.Element | null;
|
|
31
|
+
};
|
|
32
|
+
export type LabelOptionalProps = PropsWithChildren<CommonProps> & {
|
|
33
|
+
id?: string;
|
|
34
|
+
required?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Connect label with form control via `htmlFor` prop, or `id` + `aria-labelledby`
|
|
37
|
+
*/
|
|
38
|
+
htmlFor?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
export type LabelDescriptionProps = PropsWithChildren<CommonProps> & {
|
|
41
|
+
id?: string;
|
|
42
|
+
};
|
|
43
|
+
export { Label };
|
|
8
44
|
//# sourceMappingURL=Label.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/label/Label.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/label/Label.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,QAAA,MAAM,KAAK;8BAA6B,UAAU;IAalD;;;;;;;;;;OAUG;0DAQA,kBAAkB;6CAiBiD,qBAAqB;CA9C1F,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,WAAW,CAAC,GAAG;IAChE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAkCF,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,WAAW,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAWrF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.messages.d.ts","sourceRoot":"","sources":["../../../src/label/Label.messages.tsx"],"names":[],"mappings":";;;;;;AAEA,wBAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/label/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,SAAS,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-c09cb11",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -93,12 +93,12 @@
|
|
|
93
93
|
"rollup-preserve-directives": "^1.1.1",
|
|
94
94
|
"storybook": "^8.2.2",
|
|
95
95
|
"@transferwise/less-config": "3.1.0",
|
|
96
|
-
"@transferwise/neptune-css": "
|
|
96
|
+
"@transferwise/neptune-css": "0.0.0-experimental-c09cb11",
|
|
97
97
|
"@wise/components-theming": "1.5.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@transferwise/icons": "^3.7.0",
|
|
101
|
-
"@transferwise/neptune-css": "
|
|
101
|
+
"@transferwise/neptune-css": "0.0.0-experimental-c09cb11",
|
|
102
102
|
"@wise/art": "^2.7.0",
|
|
103
103
|
"@wise/components-theming": "^1.0.0",
|
|
104
104
|
"react": ">=18",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { userEvent, within, fn } from '@storybook/test';
|
|
3
3
|
|
|
4
|
-
import { DateInput,
|
|
4
|
+
import { DateInput, Field, InlineAlert, Label } from '..';
|
|
5
5
|
import { lorem10, storyConfig } from '../test-utils';
|
|
6
6
|
|
|
7
7
|
import Provider from '../provider/Provider';
|
|
@@ -38,45 +38,10 @@ export const WithLabel = {
|
|
|
38
38
|
onChange: fn(),
|
|
39
39
|
},
|
|
40
40
|
render: (args) => {
|
|
41
|
-
const id1 = 'date-input-group-label-1';
|
|
42
|
-
const label = 'Date of Birth';
|
|
43
|
-
|
|
44
41
|
return (
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
<code>aria-labelledby</code> prop
|
|
49
|
-
</Title>
|
|
50
|
-
<div className="control-label" id={id1}>
|
|
51
|
-
Date of Delivery
|
|
52
|
-
</div>
|
|
53
|
-
<DateInput {...args} aria-labelledby={id1} />
|
|
54
|
-
|
|
55
|
-
<br />
|
|
56
|
-
|
|
57
|
-
<Title type={Typography.TITLE_SUBSECTION}>
|
|
58
|
-
label (as <code>div</code> element) is detached but <code>DateInput</code> has same label
|
|
59
|
-
via <code>aria-label</code> attribute
|
|
60
|
-
</Title>
|
|
61
|
-
<div className="control-label">
|
|
62
|
-
{label}{' '}
|
|
63
|
-
<Info aria-label="Fast transfer hint" title="Fast transfer hint" content={lorem10} />
|
|
64
|
-
</div>
|
|
65
|
-
<DateInput {...args} aria-label={label} />
|
|
66
|
-
|
|
67
|
-
<br />
|
|
68
|
-
|
|
69
|
-
<Title type={Typography.TITLE_SUBSECTION}>
|
|
70
|
-
<code>DateInput</code> wrapped in <code>fieldset</code> + using <code>legend</code> as
|
|
71
|
-
label (rare use case)
|
|
72
|
-
</Title>
|
|
73
|
-
<fieldset>
|
|
74
|
-
<legend className="control-label">
|
|
75
|
-
Expiry Date for Credit Card (example of MONTH_YEAR mode)
|
|
76
|
-
</legend>
|
|
77
|
-
<DateInput {...args} mode={DateMode.MONTH_YEAR} />
|
|
78
|
-
</fieldset>
|
|
79
|
-
</>
|
|
42
|
+
<Field label="Date of Delivery">
|
|
43
|
+
<DateInput {...args} />
|
|
44
|
+
</Field>
|
|
80
45
|
);
|
|
81
46
|
},
|
|
82
47
|
} satisfies Story;
|
|
@@ -84,10 +49,10 @@ export const WithLabel = {
|
|
|
84
49
|
export const InputError = {
|
|
85
50
|
...Basic,
|
|
86
51
|
render: (args) => (
|
|
87
|
-
<
|
|
52
|
+
<Field sentiment="negative">
|
|
88
53
|
<DateInput {...args} value={new Date('2010-04-05')} />
|
|
89
54
|
<InlineAlert type="error">{lorem10}</InlineAlert>
|
|
90
|
-
</
|
|
55
|
+
</Field>
|
|
91
56
|
),
|
|
92
57
|
} satisfies Story;
|
|
93
58
|
|
|
@@ -28,7 +28,7 @@ describe('DateLookup', () => {
|
|
|
28
28
|
</Field>,
|
|
29
29
|
);
|
|
30
30
|
// TODO: Replace with `.toHaveAttribute('aria-haspopup')`
|
|
31
|
-
expect(screen.getByLabelText(
|
|
31
|
+
expect(screen.getByLabelText(/Date of birth/)).toHaveTextContent(
|
|
32
32
|
initialValue.getFullYear().toString(),
|
|
33
33
|
);
|
|
34
34
|
});
|
|
@@ -4,18 +4,10 @@
|
|
|
4
4
|
white-space: nowrap;
|
|
5
5
|
width: 100%;
|
|
6
6
|
}
|
|
7
|
-
.np-date-trigger .control-label {
|
|
8
|
-
font-weight: 400;
|
|
9
|
-
font-weight: var(--font-weight-regular);
|
|
10
|
-
}
|
|
11
7
|
.np-theme-personal .np-date-trigger {
|
|
12
8
|
padding-left: 16px;
|
|
13
9
|
padding-left: var(--size-16);
|
|
14
10
|
}
|
|
15
|
-
.np-theme-personal .np-date-trigger .control-label + span {
|
|
16
|
-
font-weight: 400;
|
|
17
|
-
font-weight: var(--font-weight-regular);
|
|
18
|
-
}
|
|
19
11
|
.clear-btn {
|
|
20
12
|
transition: color 0.15s ease-in-out;
|
|
21
13
|
color: #c9cbce;
|
|
@@ -7,16 +7,8 @@
|
|
|
7
7
|
white-space: nowrap;
|
|
8
8
|
width: 100%;
|
|
9
9
|
|
|
10
|
-
.control-label {
|
|
11
|
-
font-weight: var(--font-weight-regular);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
10
|
.np-theme-personal & {
|
|
15
11
|
padding-left: var(--size-16);
|
|
16
|
-
|
|
17
|
-
.control-label + span {
|
|
18
|
-
font-weight: var(--font-weight-regular);
|
|
19
|
-
}
|
|
20
12
|
}
|
|
21
13
|
}
|
|
22
14
|
|
|
@@ -119,5 +119,5 @@ describe('DateTrigger', () => {
|
|
|
119
119
|
const button = () => component.find('.np-date-trigger');
|
|
120
120
|
const clearButton = () => component.find('.clear-btn');
|
|
121
121
|
const chevron = () => component.find(Chevron);
|
|
122
|
-
const label = () => component.find('.
|
|
122
|
+
const label = () => component.find('.np-date-trigger-label');
|
|
123
123
|
});
|
|
@@ -2,12 +2,13 @@ import { formatDate } from '@transferwise/formatting';
|
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
|
|
4
4
|
import Chevron from '../../chevron';
|
|
5
|
-
import { Size, Position, SizeSmall, SizeMedium, SizeLarge } from '../../common';
|
|
5
|
+
import { Size, Position, SizeSmall, SizeMedium, SizeLarge, Typography } from '../../common';
|
|
6
6
|
import { CloseButton } from '../../common/closeButton/CloseButton';
|
|
7
7
|
|
|
8
8
|
import messages from './DateTrigger.messages';
|
|
9
9
|
import { useContext } from 'react';
|
|
10
10
|
import { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';
|
|
11
|
+
import Body from '../../body';
|
|
11
12
|
|
|
12
13
|
interface DateTriggerProps {
|
|
13
14
|
selectedDate: Date | null;
|
|
@@ -45,15 +46,19 @@ const DateTrigger: React.FC<DateTriggerProps> = ({
|
|
|
45
46
|
type="button"
|
|
46
47
|
onClick={onClick}
|
|
47
48
|
>
|
|
48
|
-
{label &&
|
|
49
|
+
{label && (
|
|
50
|
+
<Body as="span" className="np-date-trigger-label m-r-1">
|
|
51
|
+
{label}
|
|
52
|
+
</Body>
|
|
53
|
+
)}
|
|
49
54
|
{selectedDate ? (
|
|
50
|
-
<
|
|
55
|
+
<Body as="span" type={Typography.BODY_LARGE}>
|
|
51
56
|
{formatDate(selectedDate, locale, {
|
|
52
57
|
day: 'numeric',
|
|
53
58
|
month: monthFormat,
|
|
54
59
|
year: 'numeric',
|
|
55
60
|
})}
|
|
56
|
-
</
|
|
61
|
+
</Body>
|
|
57
62
|
) : (
|
|
58
63
|
<span
|
|
59
64
|
className="form-control-placeholder visible-xs-inline visible-sm-inline
|
package/src/field/Field.spec.tsx
CHANGED
|
@@ -14,7 +14,7 @@ describe('Field', () => {
|
|
|
14
14
|
</Field>,
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
expect(screen.getByLabelText(
|
|
17
|
+
expect(screen.getByLabelText(/Phone number/)).toBeInTheDocument();
|
|
18
18
|
expect(screen.getByRole('textbox')).not.toHaveAttribute('aria-describedby');
|
|
19
19
|
});
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ describe('Field', () => {
|
|
|
25
25
|
</Field>,
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
const textbox = screen.getByRole('textbox', { description:
|
|
28
|
+
const textbox = screen.getByRole('textbox', { description: /This is help text/ });
|
|
29
29
|
expect(textbox).toBeInTheDocument();
|
|
30
30
|
expect(textbox).not.toBeInvalid();
|
|
31
31
|
});
|
|
@@ -42,15 +42,51 @@ describe('Field', () => {
|
|
|
42
42
|
expect(textbox).toBeInvalid();
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
it('should
|
|
45
|
+
it('should shows error text and help text when both are provided', () => {
|
|
46
46
|
render(
|
|
47
47
|
<Field label="Phone number" error="This is error text" hint="This is help text">
|
|
48
48
|
<Input />
|
|
49
49
|
</Field>,
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
expect(screen.getByRole('textbox', { description:
|
|
53
|
-
expect(screen.
|
|
52
|
+
expect(screen.getByRole('textbox', { description: /This is error text/ })).toBeInTheDocument();
|
|
53
|
+
expect(screen.getByText('This is help text')).toBeInTheDocument();
|
|
54
|
+
expect(screen.getByLabelText(/Phone number/)).toHaveAttribute('aria-describedby');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should shows message and description when both are provided', () => {
|
|
58
|
+
render(
|
|
59
|
+
<Field
|
|
60
|
+
label="Phone number"
|
|
61
|
+
description="This is help text"
|
|
62
|
+
sentiment="negative"
|
|
63
|
+
message="This is error text"
|
|
64
|
+
>
|
|
65
|
+
<Input />
|
|
66
|
+
</Field>,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
expect(screen.getByRole('textbox', { description: /This is error text/ })).toBeInTheDocument();
|
|
70
|
+
expect(screen.getByText('This is help text')).toBeInTheDocument();
|
|
71
|
+
expect(screen.getByLabelText(/Phone number/)).toHaveAttribute('aria-describedby');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should show or hide (Optional) suffix depending on required prop', () => {
|
|
75
|
+
render(
|
|
76
|
+
<Field label="Phone number" description="This is help text">
|
|
77
|
+
<Input />
|
|
78
|
+
</Field>,
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
expect(screen.getByText('(Optional)')).toBeInTheDocument();
|
|
82
|
+
|
|
83
|
+
render(
|
|
84
|
+
<Field label="Phone number" description="This is help text" required>
|
|
85
|
+
<Input />
|
|
86
|
+
</Field>,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
expect(screen.getByLabelText('Phone number')).toBeInTheDocument();
|
|
54
90
|
});
|
|
55
91
|
|
|
56
92
|
it('avoids triggering button within label inadvertently', async () => {
|