@transferwise/components 45.17.0 → 45.18.0
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/i18n/en.json +1 -0
- package/build/index.esm.js +391 -350
- package/build/index.esm.js.map +1 -1
- package/build/index.js +391 -349
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/common/Option/Option.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -1
- package/build/styles/instructionsList/InstructionsList.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/styles/tooltip/Tooltip.css +1 -1
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.messages.d.ts +9 -0
- package/build/types/button/Button.messages.d.ts.map +1 -0
- package/build/types/common/index.d.ts +1 -0
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts +13 -0
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts.map +1 -0
- package/build/types/common/randomId.d.ts +13 -0
- package/build/types/common/randomId.d.ts.map +1 -0
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +16 -6
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/instructionsList/InstructionsList.d.ts +10 -3
- package/build/types/instructionsList/InstructionsList.d.ts.map +1 -1
- package/build/types/processIndicator/ProcessIndicator.d.ts +1 -1
- package/build/types/promoCard/PromoCard.d.ts.map +1 -1
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/select/searchBox/SearchBox.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts +2 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/accordion/AccordionItem/AccordionItem.spec.js +1 -0
- package/src/accordion/AccordionItem/AccordionItem.tsx +19 -11
- package/src/accordion/AccordionItem/__snapshots__/AccordionItem.spec.js.snap +18 -4
- package/src/button/Button.messages.js +9 -0
- package/src/button/Button.spec.js +1 -2
- package/src/button/Button.story.tsx +6 -0
- package/src/button/Button.tsx +17 -2
- package/src/button/__snapshots__/Button.spec.js.snap +22 -15
- package/src/common/Option/Option.css +1 -1
- package/src/common/Option/Option.less +0 -5
- package/src/common/index.js +1 -0
- package/src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx +19 -0
- package/src/common/randomId.ts +14 -0
- package/src/dateInput/DateInput.story.tsx +0 -3
- package/src/i18n/en.json +1 -0
- package/src/index.ts +3 -0
- package/src/inputs/SelectInput.css +1 -1
- package/src/inputs/SelectInput.less +8 -2
- package/src/inputs/SelectInput.story.tsx +52 -5
- package/src/inputs/SelectInput.tsx +165 -104
- package/src/inputs/_Popover.less +1 -1
- package/src/instructionsList/InstructionList.story.tsx +39 -0
- package/src/instructionsList/InstructionsList.css +1 -1
- package/src/instructionsList/InstructionsList.less +3 -15
- package/src/instructionsList/InstructionsList.spec.tsx +35 -0
- package/src/instructionsList/InstructionsList.tsx +40 -25
- package/src/main.css +1 -1
- package/src/moneyInput/MoneyInput.story.tsx +0 -3
- package/src/phoneNumberInput/PhoneNumberInput.story.js +0 -3
- package/src/processIndicator/ProcessIndicator.js +2 -2
- package/src/promoCard/PromoCard.tsx +1 -16
- package/src/select/Select.js +2 -0
- package/src/select/Select.story.js +0 -6
- package/src/select/searchBox/SearchBox.spec.js +3 -7
- package/src/select/searchBox/SearchBox.tsx +2 -0
- package/src/stepper/Stepper.css +1 -1
- package/src/stepper/Stepper.less +1 -1
- package/src/tooltip/Tooltip.css +1 -1
- package/src/tooltip/Tooltip.less +13 -0
- package/src/tooltip/Tooltip.spec.tsx +97 -29
- package/src/tooltip/Tooltip.tsx +24 -31
- package/src/tooltip/__snapshots__/Tooltip.spec.tsx.snap +31 -0
- package/src/upload/Upload.spec.js +2 -0
- package/src/instructionsList/InstructionList.story.js +0 -27
- package/src/instructionsList/InstructionsList.spec.js +0 -29
- package/src/select/searchBox/__snapshots__/SearchBox.spec.js.snap +0 -46
package/build/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var classNames = require('classnames');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var reactId = require('@radix-ui/react-id');
|
|
6
7
|
var icons = require('@transferwise/icons');
|
|
7
8
|
var PropTypes = require('prop-types');
|
|
8
9
|
var reactIntl = require('react-intl');
|
|
@@ -16,7 +17,7 @@ var mergeRefs = require('react-merge-refs');
|
|
|
16
17
|
var neptuneValidation = require('@transferwise/neptune-validation');
|
|
17
18
|
var reactPopper = require('react-popper');
|
|
18
19
|
var react$1 = require('@headlessui/react');
|
|
19
|
-
var
|
|
20
|
+
var mergeProps = require('merge-props');
|
|
20
21
|
var shim = require('use-sync-external-store/shim');
|
|
21
22
|
var react = require('@floating-ui/react');
|
|
22
23
|
var overlays = require('@react-aria/overlays');
|
|
@@ -54,6 +55,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
54
55
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
55
56
|
var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
56
57
|
var mergeRefs__default = /*#__PURE__*/_interopDefault(mergeRefs);
|
|
58
|
+
var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
|
|
57
59
|
var clamp__default = /*#__PURE__*/_interopDefault(clamp$2);
|
|
58
60
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
59
61
|
var requiredIf__default = /*#__PURE__*/_interopDefault(requiredIf);
|
|
@@ -490,6 +492,21 @@ function getDirectionFromLocale(locale) {
|
|
|
490
492
|
}
|
|
491
493
|
}
|
|
492
494
|
|
|
495
|
+
/**
|
|
496
|
+
* generateRandomId() function
|
|
497
|
+
*
|
|
498
|
+
* This function generates a random string of characters that can be used as
|
|
499
|
+
* an ID.
|
|
500
|
+
*
|
|
501
|
+
* @returns {string} A random string of characters.
|
|
502
|
+
* @example
|
|
503
|
+
* const id = generateRandomId();
|
|
504
|
+
* // id will be a random string of characters, such as "id-4711".
|
|
505
|
+
*/
|
|
506
|
+
const generateRandomId = () => {
|
|
507
|
+
return `id-${Math.random().toString(36).slice(7)}`;
|
|
508
|
+
};
|
|
509
|
+
|
|
493
510
|
const DEFAULT_TYPE$1 = exports.Typography.TITLE_GROUP;
|
|
494
511
|
const titleTypeMapping = {
|
|
495
512
|
[exports.Typography.TITLE_SCREEN]: 'h1',
|
|
@@ -673,8 +690,10 @@ const AccordionItem = ({
|
|
|
673
690
|
const iconElement = icon ? /*#__PURE__*/React.cloneElement(icon, {
|
|
674
691
|
size: 24
|
|
675
692
|
}) : null;
|
|
693
|
+
const fallbackId = reactId.useId();
|
|
694
|
+
const accordionId = id ?? fallbackId;
|
|
676
695
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
677
|
-
id:
|
|
696
|
+
id: accordionId,
|
|
678
697
|
className: classNames__default.default('np-accordion-item', iconElement ? 'np-accordion-item--with-icon' : null, {
|
|
679
698
|
'np-accordion-item--open': open
|
|
680
699
|
}),
|
|
@@ -688,14 +707,22 @@ const AccordionItem = ({
|
|
|
688
707
|
size: exports.Size.MEDIUM
|
|
689
708
|
}),
|
|
690
709
|
inverseMediaCircle: false,
|
|
710
|
+
"aria-expanded": open,
|
|
711
|
+
"aria-controls": `${accordionId}-section`,
|
|
712
|
+
id: `${accordionId}-control`,
|
|
691
713
|
onClick: onClick
|
|
692
|
-
}), open && /*#__PURE__*/jsxRuntime.jsx(
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
714
|
+
}), open && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
715
|
+
id: `${accordionId}-section`,
|
|
716
|
+
role: "region",
|
|
717
|
+
"aria-labelledby": `${accordionId}-control`,
|
|
718
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
719
|
+
as: "span",
|
|
720
|
+
type: exports.Typography.BODY_LARGE,
|
|
721
|
+
className: classNames__default.default('np-accordion-item__content', 'd-block', {
|
|
722
|
+
'has-icon': icon
|
|
723
|
+
}),
|
|
724
|
+
children: content
|
|
725
|
+
})
|
|
699
726
|
})]
|
|
700
727
|
});
|
|
701
728
|
};
|
|
@@ -796,7 +823,7 @@ const ActionOption = ({
|
|
|
796
823
|
});
|
|
797
824
|
};
|
|
798
825
|
|
|
799
|
-
var messages$
|
|
826
|
+
var messages$a = reactIntl.defineMessages({
|
|
800
827
|
ariaLabel: {
|
|
801
828
|
id: "neptune.CloseButton.ariaLabel"
|
|
802
829
|
}
|
|
@@ -812,7 +839,7 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
|
|
|
812
839
|
testId
|
|
813
840
|
}, reference) {
|
|
814
841
|
const intl = reactIntl.useIntl();
|
|
815
|
-
ariaLabel ??= intl.formatMessage(messages$
|
|
842
|
+
ariaLabel ??= intl.formatMessage(messages$a.ariaLabel);
|
|
816
843
|
const Icon = filled ? icons.CrossCircleFill : icons.Cross;
|
|
817
844
|
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
818
845
|
ref: reference,
|
|
@@ -832,7 +859,7 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
|
|
|
832
859
|
});
|
|
833
860
|
});
|
|
834
861
|
|
|
835
|
-
var messages$
|
|
862
|
+
var messages$9 = reactIntl.defineMessages({
|
|
836
863
|
opensInNewTab: {
|
|
837
864
|
id: "neptune.Link.opensInNewTab"
|
|
838
865
|
}
|
|
@@ -861,7 +888,7 @@ const Link = ({
|
|
|
861
888
|
onClick: onClick,
|
|
862
889
|
...props,
|
|
863
890
|
children: [children, " ", isBlank && /*#__PURE__*/jsxRuntime.jsx(icons.NavigateAway, {
|
|
864
|
-
title: formatMessage(messages$
|
|
891
|
+
title: formatMessage(messages$9.opensInNewTab)
|
|
865
892
|
})]
|
|
866
893
|
});
|
|
867
894
|
};
|
|
@@ -2101,6 +2128,135 @@ const BottomSheet$1 = props => {
|
|
|
2101
2128
|
};
|
|
2102
2129
|
var BottomSheet$2 = BottomSheet$1;
|
|
2103
2130
|
|
|
2131
|
+
const radius = {
|
|
2132
|
+
xxs: 6,
|
|
2133
|
+
xs: 11,
|
|
2134
|
+
sm: 22,
|
|
2135
|
+
xl: 61
|
|
2136
|
+
};
|
|
2137
|
+
const ANIMATION_DURATION_IN_MS = 1500;
|
|
2138
|
+
class ProcessIndicator extends React.Component {
|
|
2139
|
+
constructor(props) {
|
|
2140
|
+
super(props);
|
|
2141
|
+
this.state = {
|
|
2142
|
+
status: props.status,
|
|
2143
|
+
size: props.size
|
|
2144
|
+
};
|
|
2145
|
+
this.interval = null;
|
|
2146
|
+
this.timeout = null;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* Create interval for animation duration (1500ms)
|
|
2151
|
+
* Update state only at the end of every interval
|
|
2152
|
+
* (end of animation loop) if props changed before end of animation
|
|
2153
|
+
*/
|
|
2154
|
+
componentDidMount() {
|
|
2155
|
+
this.interval = setInterval(() => {
|
|
2156
|
+
const statusFromState = this.state.status;
|
|
2157
|
+
const sizeFromState = this.state.size;
|
|
2158
|
+
const statusFromProps = this.props.status;
|
|
2159
|
+
const sizeFromProps = this.props.size;
|
|
2160
|
+
if (statusFromState !== statusFromProps) {
|
|
2161
|
+
this.setState({
|
|
2162
|
+
status: statusFromProps
|
|
2163
|
+
}, this.runCallBack(statusFromProps));
|
|
2164
|
+
}
|
|
2165
|
+
if (sizeFromState !== sizeFromProps) {
|
|
2166
|
+
this.setState({
|
|
2167
|
+
size: sizeFromProps
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
}, ANIMATION_DURATION_IN_MS);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* Only trigger render if comopnent's state got
|
|
2175
|
+
* updated from interval callback
|
|
2176
|
+
*
|
|
2177
|
+
* @param nextProps
|
|
2178
|
+
* @param nextState
|
|
2179
|
+
*/
|
|
2180
|
+
shouldComponentUpdate(nextProps, nextState) {
|
|
2181
|
+
const isSameStatus = nextProps.status === nextState.status;
|
|
2182
|
+
const isSameSize = nextProps.size === nextState.size;
|
|
2183
|
+
return isSameStatus && isSameSize;
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
// Clear interval before destroying component
|
|
2187
|
+
componentWillUnmount() {
|
|
2188
|
+
clearInterval(this.interval);
|
|
2189
|
+
clearTimeout(this.timeout);
|
|
2190
|
+
}
|
|
2191
|
+
runCallBack = statusFromProps => {
|
|
2192
|
+
const {
|
|
2193
|
+
onAnimationCompleted
|
|
2194
|
+
} = this.props;
|
|
2195
|
+
if (onAnimationCompleted) {
|
|
2196
|
+
this.timeouts = setTimeout(() => {
|
|
2197
|
+
onAnimationCompleted(statusFromProps);
|
|
2198
|
+
}, ANIMATION_DURATION_IN_MS);
|
|
2199
|
+
}
|
|
2200
|
+
};
|
|
2201
|
+
render() {
|
|
2202
|
+
const {
|
|
2203
|
+
className,
|
|
2204
|
+
'data-testid': dataTestId
|
|
2205
|
+
} = this.props;
|
|
2206
|
+
const {
|
|
2207
|
+
size,
|
|
2208
|
+
status
|
|
2209
|
+
} = this.state;
|
|
2210
|
+
const classes = classNames__default.default(`process process-${size}`, className, {
|
|
2211
|
+
[`process-danger`]: status === exports.Status.FAILED,
|
|
2212
|
+
[`process-stopped`]: status === exports.Status.HIDDEN,
|
|
2213
|
+
[`process-success`]: status === exports.Status.SUCCEEDED
|
|
2214
|
+
});
|
|
2215
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2216
|
+
className: classes,
|
|
2217
|
+
"data-testid": dataTestId,
|
|
2218
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2219
|
+
className: "process-icon-container",
|
|
2220
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2221
|
+
className: "process-icon-horizontal"
|
|
2222
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2223
|
+
className: "process-icon-vertical"
|
|
2224
|
+
})]
|
|
2225
|
+
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
2226
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2227
|
+
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
2228
|
+
className: "process-circle",
|
|
2229
|
+
cx: "50%",
|
|
2230
|
+
cy: "50%",
|
|
2231
|
+
r: radius[this.state.size],
|
|
2232
|
+
fillOpacity: "0.0"
|
|
2233
|
+
})
|
|
2234
|
+
})]
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
ProcessIndicator.propTypes = {
|
|
2239
|
+
status: PropTypes__default.default.oneOf(['processing', 'failed', 'succeeded', 'hidden']),
|
|
2240
|
+
size: PropTypes__default.default.oneOf(['xxs', 'xs', 'sm', 'xl']),
|
|
2241
|
+
onAnimationCompleted: PropTypes__default.default.func,
|
|
2242
|
+
className: PropTypes__default.default.string,
|
|
2243
|
+
'data-testid': PropTypes__default.default.string
|
|
2244
|
+
};
|
|
2245
|
+
ProcessIndicator.defaultProps = {
|
|
2246
|
+
status: exports.Status.PROCESSING,
|
|
2247
|
+
size: exports.Size.SMALL,
|
|
2248
|
+
onAnimationCompleted: null,
|
|
2249
|
+
className: undefined,
|
|
2250
|
+
'data-testid': null
|
|
2251
|
+
};
|
|
2252
|
+
var ProcessIndicator$1 = ProcessIndicator;
|
|
2253
|
+
|
|
2254
|
+
var messages$8 = reactIntl.defineMessages({
|
|
2255
|
+
loadingAriaLabel: {
|
|
2256
|
+
id: "neptune.Button.loadingAriaLabel"
|
|
2257
|
+
}
|
|
2258
|
+
});
|
|
2259
|
+
|
|
2104
2260
|
const typeClassMap$1 = {
|
|
2105
2261
|
[exports.ControlType.ACCENT]: 'btn-accent',
|
|
2106
2262
|
[exports.ControlType.POSITIVE]: 'btn-positive',
|
|
@@ -2167,6 +2323,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
2167
2323
|
type = exports.ControlType.ACCENT,
|
|
2168
2324
|
...rest
|
|
2169
2325
|
}, reference) => {
|
|
2326
|
+
const intl = reactIntl.useIntl();
|
|
2170
2327
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2171
2328
|
logDeprecationNotices({
|
|
2172
2329
|
size,
|
|
@@ -2188,6 +2345,9 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
2188
2345
|
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
2189
2346
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2190
2347
|
priorityClassMap[newPriority], className);
|
|
2348
|
+
function processIndicatorSize() {
|
|
2349
|
+
return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';
|
|
2350
|
+
}
|
|
2191
2351
|
const Element = component ?? 'button';
|
|
2192
2352
|
let props;
|
|
2193
2353
|
if (Element === 'button') {
|
|
@@ -2209,10 +2369,11 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
2209
2369
|
ref: reference,
|
|
2210
2370
|
className: classes,
|
|
2211
2371
|
...props,
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2372
|
+
"aria-live": loading ? 'polite' : 'off',
|
|
2373
|
+
"aria-label": loading ? intl.formatMessage(messages$8.loadingAriaLabel) : undefined,
|
|
2374
|
+
children: [children, loading && /*#__PURE__*/jsxRuntime.jsx(ProcessIndicator$1, {
|
|
2375
|
+
size: processIndicatorSize(),
|
|
2376
|
+
className: "btn-loader"
|
|
2216
2377
|
})]
|
|
2217
2378
|
});
|
|
2218
2379
|
});
|
|
@@ -5360,12 +5521,15 @@ const Tooltip = ({
|
|
|
5360
5521
|
position = exports.Position.TOP,
|
|
5361
5522
|
children = undefined,
|
|
5362
5523
|
label,
|
|
5524
|
+
id,
|
|
5363
5525
|
className
|
|
5364
5526
|
}) => {
|
|
5365
5527
|
const [open, setOpen] = React.useState(false);
|
|
5366
5528
|
const anchorReference = React.useRef(null);
|
|
5367
5529
|
const [arrowElement, setArrowElement] = React.useState(null);
|
|
5368
5530
|
const [popperElement, setPopperElement] = React.useState(null);
|
|
5531
|
+
const fallbackId = reactId.useId();
|
|
5532
|
+
const tooltipId = id ?? fallbackId;
|
|
5369
5533
|
const modifiers = [];
|
|
5370
5534
|
modifiers.push({
|
|
5371
5535
|
name: 'arrow',
|
|
@@ -5404,60 +5568,42 @@ const Tooltip = ({
|
|
|
5404
5568
|
forceUpdate();
|
|
5405
5569
|
}
|
|
5406
5570
|
}, [open]);
|
|
5407
|
-
return /*#__PURE__*/jsxRuntime.
|
|
5408
|
-
children:
|
|
5571
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
5572
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
5409
5573
|
ref: anchorReference,
|
|
5410
|
-
className: "
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
onMouseOut: () => {
|
|
5426
|
-
if (children?.props?.onMouseOver) {
|
|
5427
|
-
children.props.onMouseOver();
|
|
5428
|
-
}
|
|
5429
|
-
setOpen(false);
|
|
5574
|
+
className: "tw-tooltip-container",
|
|
5575
|
+
onMouseOver: () => setOpen(true),
|
|
5576
|
+
onFocus: () => setOpen(true),
|
|
5577
|
+
onMouseOut: () => setOpen(false),
|
|
5578
|
+
onBlur: () => setOpen(false),
|
|
5579
|
+
children: [children ? /*#__PURE__*/React.cloneElement(children, {
|
|
5580
|
+
'aria-describedby': `${tooltipId}-tooltip`
|
|
5581
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5582
|
+
// @ts-expect-error
|
|
5583
|
+
ref: setPopperElement,
|
|
5584
|
+
className: classNames__default.default('np-tooltip', 'np-panel', open ? `np-panel--open np-tooltip--open` : null, className)
|
|
5585
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
5586
|
+
,
|
|
5587
|
+
style: {
|
|
5588
|
+
...styles.popper
|
|
5430
5589
|
},
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
...attributes.popper,
|
|
5449
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
5450
|
-
className: "np-panel__content tooltip-inner",
|
|
5451
|
-
children: [label, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5452
|
-
// @ts-expect-error
|
|
5453
|
-
ref: setArrowElement,
|
|
5454
|
-
className: classNames__default.default('np-panel__arrow')
|
|
5455
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
5456
|
-
,
|
|
5457
|
-
style: styles.arrow
|
|
5458
|
-
})]
|
|
5459
|
-
})
|
|
5460
|
-
}) : null]
|
|
5590
|
+
...attributes.popper,
|
|
5591
|
+
"aria-hidden": !open,
|
|
5592
|
+
role: "tooltip",
|
|
5593
|
+
id: `${tooltipId}-tooltip`,
|
|
5594
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
5595
|
+
className: "np-panel__content tooltip-inner",
|
|
5596
|
+
children: [label, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5597
|
+
// @ts-expect-error
|
|
5598
|
+
ref: setArrowElement,
|
|
5599
|
+
className: classNames__default.default('np-panel__arrow')
|
|
5600
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
5601
|
+
,
|
|
5602
|
+
style: styles.arrow
|
|
5603
|
+
})]
|
|
5604
|
+
})
|
|
5605
|
+
})]
|
|
5606
|
+
})
|
|
5461
5607
|
});
|
|
5462
5608
|
};
|
|
5463
5609
|
var Tooltip$1 = Tooltip;
|
|
@@ -6218,6 +6364,20 @@ function useScreenSize(size) {
|
|
|
6218
6364
|
return useMedia(`(min-width: ${size}px)`);
|
|
6219
6365
|
}
|
|
6220
6366
|
|
|
6367
|
+
const PolymorphicWithOverrides = /*#__PURE__*/React.forwardRef(function PolymorphicWithOverrides({
|
|
6368
|
+
__overrides: {
|
|
6369
|
+
as: Element,
|
|
6370
|
+
...restOverrides
|
|
6371
|
+
},
|
|
6372
|
+
...restProps
|
|
6373
|
+
}, ref) {
|
|
6374
|
+
return /*#__PURE__*/jsxRuntime.jsx(Element, {
|
|
6375
|
+
ref: ref,
|
|
6376
|
+
...restProps,
|
|
6377
|
+
...restOverrides
|
|
6378
|
+
});
|
|
6379
|
+
});
|
|
6380
|
+
|
|
6221
6381
|
function wrapInFragment(value) {
|
|
6222
6382
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
6223
6383
|
children: value
|
|
@@ -6464,7 +6624,8 @@ function inferSearchableStrings(value) {
|
|
|
6464
6624
|
return [];
|
|
6465
6625
|
}
|
|
6466
6626
|
const SelectInputHasValueContext = /*#__PURE__*/React.createContext(false);
|
|
6467
|
-
const
|
|
6627
|
+
const SelectInputTriggerButtonPropsContext = /*#__PURE__*/React.createContext({});
|
|
6628
|
+
const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/React.createContext(false);
|
|
6468
6629
|
function dedupeSelectInputOptionItem(item, existingValues) {
|
|
6469
6630
|
if (existingValues.has(item.value)) {
|
|
6470
6631
|
return {
|
|
@@ -6494,14 +6655,68 @@ function dedupeSelectInputItems(items) {
|
|
|
6494
6655
|
return item;
|
|
6495
6656
|
});
|
|
6496
6657
|
}
|
|
6658
|
+
const defaultRenderTrigger = ({
|
|
6659
|
+
content,
|
|
6660
|
+
placeholderShown,
|
|
6661
|
+
clear,
|
|
6662
|
+
disabled,
|
|
6663
|
+
className
|
|
6664
|
+
}) => /*#__PURE__*/jsxRuntime.jsx(InputGroup, {
|
|
6665
|
+
addonEnd: {
|
|
6666
|
+
content: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
6667
|
+
className: classNames__default.default('np-select-input-addon-container', disabled && 'disabled'),
|
|
6668
|
+
children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6669
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SelectInputClearButton, {
|
|
6670
|
+
onClick: event => {
|
|
6671
|
+
event.preventDefault();
|
|
6672
|
+
clear();
|
|
6673
|
+
}
|
|
6674
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6675
|
+
className: "np-select-input-addon-separator"
|
|
6676
|
+
})]
|
|
6677
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6678
|
+
className: "np-select-input-addon",
|
|
6679
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronDown, {
|
|
6680
|
+
size: 16
|
|
6681
|
+
})
|
|
6682
|
+
})]
|
|
6683
|
+
}),
|
|
6684
|
+
padding: 'sm'
|
|
6685
|
+
},
|
|
6686
|
+
disabled: disabled,
|
|
6687
|
+
className: className,
|
|
6688
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SelectInputTriggerButton, {
|
|
6689
|
+
as: ButtonInput,
|
|
6690
|
+
children: placeholderShown ? /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
6691
|
+
className: "np-select-input-placeholder",
|
|
6692
|
+
children: [" ", content]
|
|
6693
|
+
}) : content
|
|
6694
|
+
})
|
|
6695
|
+
});
|
|
6696
|
+
function SelectInputClearButton({
|
|
6697
|
+
className,
|
|
6698
|
+
onClick
|
|
6699
|
+
}) {
|
|
6700
|
+
const intl = reactIntl.useIntl();
|
|
6701
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
6702
|
+
type: "button",
|
|
6703
|
+
"aria-label": intl.formatMessage(messages$5.ariaLabel),
|
|
6704
|
+
className: classNames__default.default(className, 'np-select-input-addon np-select-input-addon--interactive'),
|
|
6705
|
+
onClick: onClick,
|
|
6706
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {
|
|
6707
|
+
size: 16
|
|
6708
|
+
})
|
|
6709
|
+
});
|
|
6710
|
+
}
|
|
6497
6711
|
function SelectInput({
|
|
6498
6712
|
name,
|
|
6499
6713
|
placeholder,
|
|
6500
6714
|
items,
|
|
6501
6715
|
defaultValue,
|
|
6502
6716
|
value: controlledValue,
|
|
6503
|
-
renderValue = wrapInFragment,
|
|
6504
6717
|
compareValues,
|
|
6718
|
+
renderValue = wrapInFragment,
|
|
6719
|
+
renderTrigger = defaultRenderTrigger,
|
|
6505
6720
|
filterable,
|
|
6506
6721
|
filterPlaceholder,
|
|
6507
6722
|
disabled,
|
|
@@ -6509,7 +6724,6 @@ function SelectInput({
|
|
|
6509
6724
|
onChange,
|
|
6510
6725
|
onClear
|
|
6511
6726
|
}) {
|
|
6512
|
-
const intl = reactIntl.useIntl();
|
|
6513
6727
|
const [open, setOpen] = React.useState(false);
|
|
6514
6728
|
const triggerRef = React.useRef(null);
|
|
6515
6729
|
const screenSm = useScreenSize(exports.Breakpoint.SMALL);
|
|
@@ -6535,87 +6749,75 @@ function SelectInput({
|
|
|
6535
6749
|
value
|
|
6536
6750
|
}) => /*#__PURE__*/jsxRuntime.jsx(SelectInputHasValueContext.Provider, {
|
|
6537
6751
|
value: value != null,
|
|
6538
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
disabled: uiDisabled,
|
|
6547
|
-
className: "np-select-input-addon np-select-input-addon--interactive",
|
|
6548
|
-
onClick: event => {
|
|
6549
|
-
event.preventDefault();
|
|
6550
|
-
onClear();
|
|
6551
|
-
triggerRef.current?.focus({
|
|
6552
|
-
preventScroll: true
|
|
6553
|
-
});
|
|
6554
|
-
},
|
|
6555
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {
|
|
6556
|
-
size: 16
|
|
6557
|
-
})
|
|
6558
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6559
|
-
className: "np-select-input-addon-separator"
|
|
6560
|
-
})]
|
|
6561
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6562
|
-
className: "np-select-input-addon",
|
|
6563
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronDown, {
|
|
6564
|
-
size: 16
|
|
6565
|
-
})
|
|
6566
|
-
})]
|
|
6567
|
-
}),
|
|
6568
|
-
padding: 'sm'
|
|
6569
|
-
},
|
|
6570
|
-
className: className,
|
|
6571
|
-
children: /*#__PURE__*/jsxRuntime.jsx(OptionsOverlay, {
|
|
6572
|
-
open: open,
|
|
6573
|
-
renderTrigger: ({
|
|
6574
|
-
ref,
|
|
6575
|
-
getInteractionProps
|
|
6576
|
-
}) => /*#__PURE__*/jsxRuntime.jsx(react$1.Listbox.Button, {
|
|
6752
|
+
children: /*#__PURE__*/jsxRuntime.jsx(OptionsOverlay, {
|
|
6753
|
+
open: open,
|
|
6754
|
+
renderTrigger: ({
|
|
6755
|
+
ref,
|
|
6756
|
+
getInteractionProps
|
|
6757
|
+
}) => /*#__PURE__*/jsxRuntime.jsx(SelectInputTriggerButtonPropsContext.Provider, {
|
|
6758
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
6759
|
+
value: {
|
|
6577
6760
|
ref: mergeRefs__default.default([ref, triggerRef]),
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
},
|
|
6583
|
-
|
|
6761
|
+
...mergeProps__default.default({
|
|
6762
|
+
onClick: () => {
|
|
6763
|
+
setOpen(prev => !prev);
|
|
6764
|
+
}
|
|
6765
|
+
}, getInteractionProps())
|
|
6766
|
+
},
|
|
6767
|
+
children: renderTrigger({
|
|
6768
|
+
content: value != null ? /*#__PURE__*/jsxRuntime.jsx(SelectInputOptionContentWithinTriggerContext.Provider, {
|
|
6584
6769
|
value: true,
|
|
6585
6770
|
children: renderValue(value, true)
|
|
6586
|
-
}) :
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
children: /*#__PURE__*/jsxRuntime.jsx(SelectInputOptions, {
|
|
6597
|
-
items: items,
|
|
6598
|
-
renderValue: renderValue,
|
|
6599
|
-
filterable: filterable,
|
|
6600
|
-
filterPlaceholder: filterPlaceholder,
|
|
6601
|
-
searchInputRef: searchInputRef,
|
|
6602
|
-
listboxRef: listboxRef
|
|
6771
|
+
}) : placeholder,
|
|
6772
|
+
placeholderShown: value == null,
|
|
6773
|
+
clear: onClear != null ? () => {
|
|
6774
|
+
onClear();
|
|
6775
|
+
triggerRef.current?.focus({
|
|
6776
|
+
preventScroll: true
|
|
6777
|
+
});
|
|
6778
|
+
} : undefined,
|
|
6779
|
+
disabled: uiDisabled,
|
|
6780
|
+
className: classNames__default.default(className, 'np-text-body-large')
|
|
6603
6781
|
})
|
|
6782
|
+
}),
|
|
6783
|
+
initialFocusRef: controllerRef,
|
|
6784
|
+
padding: "none",
|
|
6785
|
+
onClose: () => {
|
|
6786
|
+
setOpen(false);
|
|
6787
|
+
},
|
|
6788
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SelectInputOptions, {
|
|
6789
|
+
items: items,
|
|
6790
|
+
renderValue: renderValue,
|
|
6791
|
+
filterable: filterable,
|
|
6792
|
+
filterPlaceholder: filterPlaceholder,
|
|
6793
|
+
searchInputRef: searchInputRef,
|
|
6794
|
+
listboxRef: listboxRef
|
|
6604
6795
|
})
|
|
6605
6796
|
})
|
|
6606
6797
|
})
|
|
6607
6798
|
});
|
|
6608
6799
|
}
|
|
6609
|
-
|
|
6610
|
-
|
|
6800
|
+
function SelectInputTriggerButton({
|
|
6801
|
+
as = 'button',
|
|
6611
6802
|
...restProps
|
|
6612
|
-
}
|
|
6613
|
-
|
|
6803
|
+
}) {
|
|
6804
|
+
const {
|
|
6805
|
+
ref,
|
|
6806
|
+
onClick,
|
|
6807
|
+
...interactionProps
|
|
6808
|
+
} = React.useContext(SelectInputTriggerButtonPropsContext);
|
|
6809
|
+
return /*#__PURE__*/jsxRuntime.jsx(react$1.Listbox.Button, {
|
|
6614
6810
|
ref: ref,
|
|
6615
|
-
|
|
6616
|
-
|
|
6811
|
+
as: PolymorphicWithOverrides,
|
|
6812
|
+
__overrides: {
|
|
6813
|
+
as,
|
|
6814
|
+
...interactionProps
|
|
6815
|
+
},
|
|
6816
|
+
...mergeProps__default.default({
|
|
6817
|
+
onClick
|
|
6818
|
+
}, restProps)
|
|
6617
6819
|
});
|
|
6618
|
-
}
|
|
6820
|
+
}
|
|
6619
6821
|
const SelectInputOptionsContainer = /*#__PURE__*/React.forwardRef(function SelectInputOptionsContainer({
|
|
6620
6822
|
'aria-orientation': ariaOrientation,
|
|
6621
6823
|
'aria-activedescendant': ariaActiveDescendant,
|
|
@@ -6744,8 +6946,7 @@ function SelectInputItemView({
|
|
|
6744
6946
|
{
|
|
6745
6947
|
if (needle == null) {
|
|
6746
6948
|
return /*#__PURE__*/jsxRuntime.jsx("hr", {
|
|
6747
|
-
className: "np-select-input-separator-item"
|
|
6748
|
-
"aria-hidden": true
|
|
6949
|
+
className: "np-select-input-separator-item"
|
|
6749
6950
|
});
|
|
6750
6951
|
}
|
|
6751
6952
|
break;
|
|
@@ -6798,18 +6999,19 @@ function SelectInputOption({
|
|
|
6798
6999
|
disabled: disabled,
|
|
6799
7000
|
className: ({
|
|
6800
7001
|
active,
|
|
7002
|
+
selected,
|
|
6801
7003
|
disabled: uiDisabled
|
|
6802
|
-
}) => classNames__default.default('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
7004
|
+
}) => classNames__default.default('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', selected && 'np-select-input-option-container--selected', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
6803
7005
|
children: ({
|
|
6804
7006
|
selected
|
|
6805
7007
|
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6806
|
-
children: [
|
|
6807
|
-
size: 16,
|
|
6808
|
-
className: classNames__default.default(!selected && 'np-select-input-option-check--not-selected')
|
|
6809
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7008
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6810
7009
|
className: "np-select-input-option",
|
|
6811
7010
|
children: children
|
|
6812
|
-
})
|
|
7011
|
+
}), cachedParentHasValue ? /*#__PURE__*/jsxRuntime.jsx(icons.Check, {
|
|
7012
|
+
size: 24,
|
|
7013
|
+
className: classNames__default.default('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
|
|
7014
|
+
}) : null]
|
|
6813
7015
|
})
|
|
6814
7016
|
});
|
|
6815
7017
|
}
|
|
@@ -6819,16 +7021,16 @@ function SelectInputOptionContent({
|
|
|
6819
7021
|
description,
|
|
6820
7022
|
icon
|
|
6821
7023
|
}) {
|
|
6822
|
-
const
|
|
7024
|
+
const withinTrigger = React.useContext(SelectInputOptionContentWithinTriggerContext);
|
|
6823
7025
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6824
7026
|
className: "np-select-input-option-content-container np-text-body-large",
|
|
6825
7027
|
children: [icon ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6826
|
-
className: classNames__default.default('np-select-input-option-content-icon', !
|
|
7028
|
+
className: classNames__default.default('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
6827
7029
|
children: icon
|
|
6828
7030
|
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6829
7031
|
className: "np-select-input-option-content-text",
|
|
6830
7032
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6831
|
-
className: classNames__default.default('np-select-input-option-content-text-line-1',
|
|
7033
|
+
className: classNames__default.default('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
6832
7034
|
children: [/*#__PURE__*/jsxRuntime.jsx("h4", {
|
|
6833
7035
|
className: "d-inline np-text-body-large",
|
|
6834
7036
|
children: title
|
|
@@ -6837,7 +7039,7 @@ function SelectInputOptionContent({
|
|
|
6837
7039
|
children: note
|
|
6838
7040
|
}) : null]
|
|
6839
7041
|
}), description ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6840
|
-
className: classNames__default.default('np-select-input-option-content-text-secondary np-text-body-default',
|
|
7042
|
+
className: classNames__default.default('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
6841
7043
|
children: description
|
|
6842
7044
|
}) : null]
|
|
6843
7045
|
})]
|
|
@@ -7287,47 +7489,48 @@ InputWithDisplayFormat.propTypes = {
|
|
|
7287
7489
|
};
|
|
7288
7490
|
var InputWithDisplayFormat$1 = InputWithDisplayFormat;
|
|
7289
7491
|
|
|
7290
|
-
const InstructionsList =
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
const {
|
|
7295
|
-
dos,
|
|
7296
|
-
donts
|
|
7297
|
-
} = props;
|
|
7298
|
-
const DontIcon = isModern ? icons.CrossCircleFill : icons.CrossCircle;
|
|
7299
|
-
const DoIcon = isModern ? icons.CheckCircleFill : icons.CheckCircle;
|
|
7492
|
+
const InstructionsList = ({
|
|
7493
|
+
dos,
|
|
7494
|
+
donts
|
|
7495
|
+
}) => {
|
|
7300
7496
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7301
7497
|
className: "tw-instructions",
|
|
7302
7498
|
children: [dos && dos.map((doThis, index) =>
|
|
7303
7499
|
/*#__PURE__*/
|
|
7304
7500
|
// eslint-disable-next-line react/no-array-index-key
|
|
7305
|
-
jsxRuntime.
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
size: 24,
|
|
7309
|
-
className: "do"
|
|
7310
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
7311
|
-
className: "text-primary",
|
|
7312
|
-
type: exports.Typography.BODY_LARGE,
|
|
7313
|
-
children: doThis
|
|
7314
|
-
})]
|
|
7501
|
+
jsxRuntime.jsx(Instruction, {
|
|
7502
|
+
item: doThis,
|
|
7503
|
+
type: "do"
|
|
7315
7504
|
}, index)), donts && donts.map((dont, index) =>
|
|
7316
7505
|
/*#__PURE__*/
|
|
7317
7506
|
// eslint-disable-next-line react/no-array-index-key
|
|
7318
|
-
jsxRuntime.
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
size: 24,
|
|
7322
|
-
className: "dont"
|
|
7323
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
7324
|
-
className: "text-primary",
|
|
7325
|
-
type: exports.Typography.BODY_LARGE,
|
|
7326
|
-
children: dont
|
|
7327
|
-
})]
|
|
7507
|
+
jsxRuntime.jsx(Instruction, {
|
|
7508
|
+
item: dont,
|
|
7509
|
+
type: "dont"
|
|
7328
7510
|
}, index))]
|
|
7329
7511
|
});
|
|
7330
7512
|
};
|
|
7513
|
+
function Instruction({
|
|
7514
|
+
item,
|
|
7515
|
+
type
|
|
7516
|
+
}) {
|
|
7517
|
+
const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
|
|
7518
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7519
|
+
className: "instruction",
|
|
7520
|
+
"aria-label": isInstructionNode ? item['aria-label'] : undefined,
|
|
7521
|
+
children: [type === 'do' ? /*#__PURE__*/jsxRuntime.jsx(icons.CheckCircleFill, {
|
|
7522
|
+
size: 24,
|
|
7523
|
+
className: type
|
|
7524
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(icons.CrossCircleFill, {
|
|
7525
|
+
size: 24,
|
|
7526
|
+
className: type
|
|
7527
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
7528
|
+
className: "text-primary",
|
|
7529
|
+
type: exports.Typography.BODY_LARGE,
|
|
7530
|
+
children: isInstructionNode ? item.content : item
|
|
7531
|
+
})]
|
|
7532
|
+
});
|
|
7533
|
+
}
|
|
7331
7534
|
var InstructionsList$1 = InstructionsList;
|
|
7332
7535
|
|
|
7333
7536
|
const Loader = ({
|
|
@@ -7493,6 +7696,8 @@ const SearchBox = /*#__PURE__*/React.forwardRef(({
|
|
|
7493
7696
|
}), /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
7494
7697
|
ref: reference,
|
|
7495
7698
|
id: id,
|
|
7699
|
+
role: "searchbox",
|
|
7700
|
+
inputMode: "search",
|
|
7496
7701
|
className: classNames__default.default(style('np-select-filter')),
|
|
7497
7702
|
placeholder: placeholder,
|
|
7498
7703
|
value: value,
|
|
@@ -7783,6 +7988,8 @@ function Select({
|
|
|
7783
7988
|
ref: optionsListReference,
|
|
7784
7989
|
id: listboxId,
|
|
7785
7990
|
role: "listbox",
|
|
7991
|
+
"aria-orientation": "vertical",
|
|
7992
|
+
"aria-activedescendant": getUniqueIdForOption(id, selected),
|
|
7786
7993
|
tabIndex: "-1",
|
|
7787
7994
|
className: dropdownClass,
|
|
7788
7995
|
...dropdownProps,
|
|
@@ -10190,128 +10397,6 @@ PhoneNumberInput.defaultProps = {
|
|
|
10190
10397
|
};
|
|
10191
10398
|
var PhoneNumberInput$1 = PhoneNumberInput;
|
|
10192
10399
|
|
|
10193
|
-
const radius = {
|
|
10194
|
-
xs: 11,
|
|
10195
|
-
sm: 22,
|
|
10196
|
-
xl: 61
|
|
10197
|
-
};
|
|
10198
|
-
const ANIMATION_DURATION_IN_MS = 1500;
|
|
10199
|
-
class ProcessIndicator extends React.Component {
|
|
10200
|
-
constructor(props) {
|
|
10201
|
-
super(props);
|
|
10202
|
-
this.state = {
|
|
10203
|
-
status: props.status,
|
|
10204
|
-
size: props.size
|
|
10205
|
-
};
|
|
10206
|
-
this.interval = null;
|
|
10207
|
-
this.timeout = null;
|
|
10208
|
-
}
|
|
10209
|
-
|
|
10210
|
-
/**
|
|
10211
|
-
* Create interval for animation duration (1500ms)
|
|
10212
|
-
* Update state only at the end of every interval
|
|
10213
|
-
* (end of animation loop) if props changed before end of animation
|
|
10214
|
-
*/
|
|
10215
|
-
componentDidMount() {
|
|
10216
|
-
this.interval = setInterval(() => {
|
|
10217
|
-
const statusFromState = this.state.status;
|
|
10218
|
-
const sizeFromState = this.state.size;
|
|
10219
|
-
const statusFromProps = this.props.status;
|
|
10220
|
-
const sizeFromProps = this.props.size;
|
|
10221
|
-
if (statusFromState !== statusFromProps) {
|
|
10222
|
-
this.setState({
|
|
10223
|
-
status: statusFromProps
|
|
10224
|
-
}, this.runCallBack(statusFromProps));
|
|
10225
|
-
}
|
|
10226
|
-
if (sizeFromState !== sizeFromProps) {
|
|
10227
|
-
this.setState({
|
|
10228
|
-
size: sizeFromProps
|
|
10229
|
-
});
|
|
10230
|
-
}
|
|
10231
|
-
}, ANIMATION_DURATION_IN_MS);
|
|
10232
|
-
}
|
|
10233
|
-
|
|
10234
|
-
/**
|
|
10235
|
-
* Only trigger render if comopnent's state got
|
|
10236
|
-
* updated from interval callback
|
|
10237
|
-
*
|
|
10238
|
-
* @param nextProps
|
|
10239
|
-
* @param nextState
|
|
10240
|
-
*/
|
|
10241
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
10242
|
-
const isSameStatus = nextProps.status === nextState.status;
|
|
10243
|
-
const isSameSize = nextProps.size === nextState.size;
|
|
10244
|
-
return isSameStatus && isSameSize;
|
|
10245
|
-
}
|
|
10246
|
-
|
|
10247
|
-
// Clear interval before destroying component
|
|
10248
|
-
componentWillUnmount() {
|
|
10249
|
-
clearInterval(this.interval);
|
|
10250
|
-
clearTimeout(this.timeout);
|
|
10251
|
-
}
|
|
10252
|
-
runCallBack = statusFromProps => {
|
|
10253
|
-
const {
|
|
10254
|
-
onAnimationCompleted
|
|
10255
|
-
} = this.props;
|
|
10256
|
-
if (onAnimationCompleted) {
|
|
10257
|
-
this.timeouts = setTimeout(() => {
|
|
10258
|
-
onAnimationCompleted(statusFromProps);
|
|
10259
|
-
}, ANIMATION_DURATION_IN_MS);
|
|
10260
|
-
}
|
|
10261
|
-
};
|
|
10262
|
-
render() {
|
|
10263
|
-
const {
|
|
10264
|
-
className,
|
|
10265
|
-
'data-testid': dataTestId
|
|
10266
|
-
} = this.props;
|
|
10267
|
-
const {
|
|
10268
|
-
size,
|
|
10269
|
-
status
|
|
10270
|
-
} = this.state;
|
|
10271
|
-
const classes = classNames__default.default(`process process-${size}`, className, {
|
|
10272
|
-
[`process-danger`]: status === exports.Status.FAILED,
|
|
10273
|
-
[`process-stopped`]: status === exports.Status.HIDDEN,
|
|
10274
|
-
[`process-success`]: status === exports.Status.SUCCEEDED
|
|
10275
|
-
});
|
|
10276
|
-
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
10277
|
-
className: classes,
|
|
10278
|
-
"data-testid": dataTestId,
|
|
10279
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
10280
|
-
className: "process-icon-container",
|
|
10281
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
10282
|
-
className: "process-icon-horizontal"
|
|
10283
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
10284
|
-
className: "process-icon-vertical"
|
|
10285
|
-
})]
|
|
10286
|
-
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
10287
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10288
|
-
children: /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
10289
|
-
className: "process-circle",
|
|
10290
|
-
cx: "50%",
|
|
10291
|
-
cy: "50%",
|
|
10292
|
-
r: radius[this.state.size],
|
|
10293
|
-
fillOpacity: "0.0"
|
|
10294
|
-
})
|
|
10295
|
-
})]
|
|
10296
|
-
});
|
|
10297
|
-
}
|
|
10298
|
-
}
|
|
10299
|
-
ProcessIndicator.propTypes = {
|
|
10300
|
-
status: PropTypes__default.default.oneOf(['processing', 'failed', 'succeeded', 'hidden']),
|
|
10301
|
-
size: PropTypes__default.default.oneOf(['xs', 'sm', 'xl']),
|
|
10302
|
-
onAnimationCompleted: PropTypes__default.default.func,
|
|
10303
|
-
className: PropTypes__default.default.string,
|
|
10304
|
-
'data-testid': PropTypes__default.default.string
|
|
10305
|
-
};
|
|
10306
|
-
ProcessIndicator.defaultProps = {
|
|
10307
|
-
status: exports.Status.PROCESSING,
|
|
10308
|
-
size: exports.Size.SMALL,
|
|
10309
|
-
onAnimationCompleted: null,
|
|
10310
|
-
className: undefined,
|
|
10311
|
-
'data-testid': null
|
|
10312
|
-
};
|
|
10313
|
-
var ProcessIndicator$1 = ProcessIndicator;
|
|
10314
|
-
|
|
10315
10400
|
const Progress = ({
|
|
10316
10401
|
className,
|
|
10317
10402
|
id,
|
|
@@ -10425,50 +10510,6 @@ const PromoCardIndicator = ({
|
|
|
10425
10510
|
});
|
|
10426
10511
|
};
|
|
10427
10512
|
|
|
10428
|
-
const generateRandomId = () => {
|
|
10429
|
-
return `id-${Math.random().toString(36).slice(7)}`;
|
|
10430
|
-
};
|
|
10431
|
-
/**
|
|
10432
|
-
* PromoCard component.
|
|
10433
|
-
*
|
|
10434
|
-
* PromoCard is a marketing style component that is used to group marketing
|
|
10435
|
-
* product related information (such as choosing Card types). It can be used to
|
|
10436
|
-
* display information in a structured way, and can be customized with various
|
|
10437
|
-
* props to suit different use cases.
|
|
10438
|
-
*
|
|
10439
|
-
* @component
|
|
10440
|
-
* @param {string} className - Additional class name for the PromoCard.
|
|
10441
|
-
* @param {string} description - Description text for the PromoCard.
|
|
10442
|
-
* @param {boolean} defaultChecked - Initial checked state for checkboxes and radios.
|
|
10443
|
-
* @param {string} download - Download file name for links.
|
|
10444
|
-
* @param {string} href - URL for links.
|
|
10445
|
-
* @param {string} hrefLang - Language code for linked URL.
|
|
10446
|
-
* @param {string} id - ID of the PromoCard.
|
|
10447
|
-
* @param {string} imageAlt - Alt text for the image.
|
|
10448
|
-
* @param {string} imageSource - Source URL of the image.
|
|
10449
|
-
* @param {string} indicatorLabel - Label for the indicator icon.
|
|
10450
|
-
* @param {boolean} isChecked - Checked state for checkboxes and radios.
|
|
10451
|
-
* @param {boolean} isDisabled - Whether the PromoCard is disabled.
|
|
10452
|
-
* @param {Function} onClick - Click event handler for the PromoCard.
|
|
10453
|
-
* @param {string} rel - Relationship between the URL and the current page.
|
|
10454
|
-
* @param {number} tabIndex - Tab index for keyboard navigation.
|
|
10455
|
-
* @param {string} target - Target window for links.
|
|
10456
|
-
* @param {string} testId - ID used for testing.
|
|
10457
|
-
* @param {string} title - Title text of the PromoCard.
|
|
10458
|
-
* @param {('checkbox'|'radio')} type - Type of the PromoCard (checkbox, radio).
|
|
10459
|
-
* @param {string} value - Value for checkboxes and radios.
|
|
10460
|
-
* @returns {JSX.Element} The rendered PromoCard component.
|
|
10461
|
-
* @example
|
|
10462
|
-
* <PromoCard
|
|
10463
|
-
* title="Example PromoCard"
|
|
10464
|
-
* description="This is an example PromoCard with a link variation."
|
|
10465
|
-
* href="https://example.com"
|
|
10466
|
-
* target="_blank"
|
|
10467
|
-
* imageSource="https://example.com/image.png"
|
|
10468
|
-
* imageAlt="Example Image"
|
|
10469
|
-
* indicatorLabel="Learn More"
|
|
10470
|
-
* />
|
|
10471
|
-
*/
|
|
10472
10513
|
const PromoCard = /*#__PURE__*/React.forwardRef(({
|
|
10473
10514
|
className,
|
|
10474
10515
|
description,
|
|
@@ -10643,6 +10684,7 @@ const LanguageProvider = ({
|
|
|
10643
10684
|
};
|
|
10644
10685
|
|
|
10645
10686
|
var en = {
|
|
10687
|
+
"neptune.Button.loadingAriaLabel": "loading",
|
|
10646
10688
|
"neptune.Chips.ariaLabel": "Clear {choice}",
|
|
10647
10689
|
"neptune.ClearButton.ariaLabel": "Clear",
|
|
10648
10690
|
"neptune.CloseButton.ariaLabel": "Close",
|