@transferwise/components 0.0.0-experimental-7709e0e → 0.0.0-experimental-f0d96b7
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.js +36 -52
- package/build/index.js.map +1 -1
- package/build/index.mjs +38 -54
- package/build/index.mjs.map +1 -1
- package/build/main.css +40 -58
- package/build/styles/inputs/SelectInput.css +38 -54
- package/build/styles/main.css +40 -58
- package/build/styles/statusIcon/StatusIcon.css +2 -4
- package/build/types/field/Field.d.ts +1 -6
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/inlineAlert/InlineAlert.d.ts +2 -2
- package/build/types/inlineAlert/InlineAlert.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/field/Field.story.tsx +36 -17
- package/src/field/Field.tsx +13 -23
- package/src/inlineAlert/InlineAlert.story.tsx +5 -13
- package/src/inlineAlert/InlineAlert.tsx +7 -14
- package/src/inputs/SelectInput.css +38 -54
- package/src/inputs/_BottomSheet.less +33 -52
- package/src/inputs/_BottomSheet.tsx +19 -28
- package/src/main.css +40 -58
- package/src/statusIcon/StatusIcon.css +2 -4
- package/src/statusIcon/StatusIcon.less +2 -4
- package/src/statusIcon/StatusIcon.tsx +1 -1
- package/src/field/Field.tests.story.tsx +0 -33
package/build/index.js
CHANGED
|
@@ -746,7 +746,7 @@ const StatusIcon = ({
|
|
|
746
746
|
const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';
|
|
747
747
|
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
748
748
|
"data-testid": "status-icon",
|
|
749
|
-
className: classNames__default.default('status-circle',
|
|
749
|
+
className: classNames__default.default('status-circle', 'status-circle-' + size, sentiment),
|
|
750
750
|
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
751
751
|
className: classNames__default.default('status-icon', iconColor)
|
|
752
752
|
})
|
|
@@ -4866,20 +4866,14 @@ function InlineAlert({
|
|
|
4866
4866
|
className,
|
|
4867
4867
|
children
|
|
4868
4868
|
}) {
|
|
4869
|
-
|
|
4869
|
+
const danger = type === 'negative' || type === 'error';
|
|
4870
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4870
4871
|
role: "alert",
|
|
4871
4872
|
id: id,
|
|
4872
|
-
className: classNames__default.default('alert alert-detach', `alert-${
|
|
4873
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
sentiment: type,
|
|
4877
|
-
size: exports.Size.SMALL
|
|
4878
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4879
|
-
className: "np-text-body-default",
|
|
4880
|
-
children: children
|
|
4881
|
-
})]
|
|
4882
|
-
})
|
|
4873
|
+
className: classNames__default.default('alert alert-detach', `alert-${danger ? 'danger' : type}`, className),
|
|
4874
|
+
children: [danger && /*#__PURE__*/jsxRuntime.jsx(icons.AlertCircle, {}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4875
|
+
children: children
|
|
4876
|
+
})]
|
|
4883
4877
|
});
|
|
4884
4878
|
}
|
|
4885
4879
|
|
|
@@ -4900,15 +4894,13 @@ const Label = ({
|
|
|
4900
4894
|
const Field = ({
|
|
4901
4895
|
id,
|
|
4902
4896
|
label,
|
|
4903
|
-
|
|
4904
|
-
|
|
4897
|
+
hint,
|
|
4898
|
+
error,
|
|
4905
4899
|
className,
|
|
4906
|
-
children
|
|
4907
|
-
...props
|
|
4900
|
+
children
|
|
4908
4901
|
}) => {
|
|
4909
|
-
const
|
|
4910
|
-
const
|
|
4911
|
-
const hasError = sentiment === exports.Sentiment.NEGATIVE;
|
|
4902
|
+
const hasError = Boolean(error);
|
|
4903
|
+
const hasHint = Boolean(hint) && !hasError;
|
|
4912
4904
|
const labelId = React.useId();
|
|
4913
4905
|
const fallbackInputId = React.useId();
|
|
4914
4906
|
const inputId = id !== null ? id ?? fallbackInputId : undefined;
|
|
@@ -4918,24 +4910,26 @@ const Field = ({
|
|
|
4918
4910
|
children: /*#__PURE__*/jsxRuntime.jsx(InputIdContextProvider, {
|
|
4919
4911
|
value: inputId,
|
|
4920
4912
|
children: /*#__PURE__*/jsxRuntime.jsx(InputDescribedByProvider, {
|
|
4921
|
-
value:
|
|
4913
|
+
value: hasError || hasHint ? descriptionId : undefined,
|
|
4922
4914
|
children: /*#__PURE__*/jsxRuntime.jsx(InputInvalidProvider, {
|
|
4923
4915
|
value: hasError,
|
|
4924
4916
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4925
4917
|
className: classNames__default.default('form-group d-block', {
|
|
4926
|
-
'has-success': sentiment === exports.Sentiment.POSITIVE,
|
|
4927
|
-
'has-warning': sentiment === exports.Sentiment.WARNING,
|
|
4928
4918
|
'has-error': hasError,
|
|
4929
|
-
'has-info':
|
|
4919
|
+
'has-info': hasHint
|
|
4930
4920
|
}, className),
|
|
4931
4921
|
children: [/*#__PURE__*/jsxRuntime.jsxs(Label, {
|
|
4932
4922
|
id: labelId,
|
|
4933
4923
|
htmlFor: inputId,
|
|
4934
4924
|
children: [label, children]
|
|
4935
|
-
}),
|
|
4936
|
-
type:
|
|
4925
|
+
}), hasHint && /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
|
|
4926
|
+
type: exports.Sentiment.NEUTRAL,
|
|
4937
4927
|
id: descriptionId,
|
|
4938
|
-
children:
|
|
4928
|
+
children: hint
|
|
4929
|
+
}), hasError && /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
|
|
4930
|
+
type: exports.Sentiment.NEGATIVE,
|
|
4931
|
+
id: descriptionId,
|
|
4932
|
+
children: error
|
|
4939
4933
|
})]
|
|
4940
4934
|
})
|
|
4941
4935
|
})
|
|
@@ -6319,29 +6313,21 @@ function BottomSheet({
|
|
|
6319
6313
|
},
|
|
6320
6314
|
afterLeave: onCloseEnd,
|
|
6321
6315
|
children: [/*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
|
|
6322
|
-
|
|
6323
|
-
enterFrom: "np-bottom-sheet-v2-backdrop
|
|
6324
|
-
|
|
6325
|
-
leaveTo: "np-bottom-sheet-v2-backdrop-container--leave-to",
|
|
6326
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6327
|
-
className: "np-bottom-sheet-v2-backdrop"
|
|
6328
|
-
})
|
|
6316
|
+
className: "np-bottom-sheet-v2-backdrop",
|
|
6317
|
+
enterFrom: "np-bottom-sheet-v2-backdrop--closed",
|
|
6318
|
+
leaveTo: "np-bottom-sheet-v2-backdrop--closed"
|
|
6329
6319
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6330
6320
|
className: "np-bottom-sheet-v2",
|
|
6331
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
children: /*#__PURE__*/jsxRuntime.jsx(focus.FocusScope, {
|
|
6338
|
-
children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
|
|
6339
|
-
context: context,
|
|
6340
|
-
initialFocus: initialFocusRef,
|
|
6341
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6342
|
-
// Force inner state invalidation on open
|
|
6321
|
+
children: /*#__PURE__*/jsxRuntime.jsx(focus.FocusScope, {
|
|
6322
|
+
children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
|
|
6323
|
+
context: context,
|
|
6324
|
+
initialFocus: initialFocusRef,
|
|
6325
|
+
children: /*#__PURE__*/jsxRuntime.jsx(React.Fragment, {
|
|
6326
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(react$1.Transition.Child, {
|
|
6343
6327
|
ref: refs.setFloating,
|
|
6344
|
-
className: "np-bottom-sheet-v2-content
|
|
6328
|
+
className: "np-bottom-sheet-v2-content",
|
|
6329
|
+
enterFrom: "np-bottom-sheet-v2-content--closed",
|
|
6330
|
+
leaveTo: "np-bottom-sheet-v2-content--closed",
|
|
6345
6331
|
...getFloatingProps(),
|
|
6346
6332
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6347
6333
|
className: "np-bottom-sheet-v2-header",
|
|
@@ -6352,9 +6338,7 @@ function BottomSheet({
|
|
|
6352
6338
|
}
|
|
6353
6339
|
})
|
|
6354
6340
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6355
|
-
className: classNames__default.default('np-bottom-sheet-v2-content-inner',
|
|
6356
|
-
'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md'
|
|
6357
|
-
}),
|
|
6341
|
+
className: classNames__default.default('np-bottom-sheet-v2-content-inner', padding === 'md' && 'np-bottom-sheet-v2-content-inner--padding-md'),
|
|
6358
6342
|
children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
6359
6343
|
className: "np-bottom-sheet-v2-title np-text-title-body",
|
|
6360
6344
|
children: title
|
|
@@ -6363,8 +6347,8 @@ function BottomSheet({
|
|
|
6363
6347
|
children: children
|
|
6364
6348
|
})]
|
|
6365
6349
|
})]
|
|
6366
|
-
}
|
|
6367
|
-
})
|
|
6350
|
+
})
|
|
6351
|
+
}, floatingKey)
|
|
6368
6352
|
})
|
|
6369
6353
|
})
|
|
6370
6354
|
})]
|