@transferwise/components 45.17.1 → 45.19.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/index.esm.js +425 -368
- package/build/index.esm.js.map +1 -1
- package/build/index.js +425 -366
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/inputs/Input.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -1
- package/build/styles/inputs/TextArea.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/button/Button.d.ts.map +1 -1
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts +13 -0
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts.map +1 -0
- package/build/types/index.d.ts +2 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +18 -6
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.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/tooltip/Tooltip.d.ts +2 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/button/Button.story.tsx +6 -0
- package/src/button/Button.tsx +6 -1
- package/src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx +19 -0
- package/src/index.ts +9 -1
- package/src/inputs/Input.css +1 -1
- package/src/inputs/SelectInput.css +1 -1
- package/src/inputs/SelectInput.less +20 -5
- package/src/inputs/SelectInput.story.tsx +85 -35
- package/src/inputs/SelectInput.tsx +176 -106
- package/src/inputs/TextArea.css +1 -1
- package/src/inputs/_BottomSheet.tsx +47 -37
- package/src/inputs/_Popover.less +1 -1
- package/src/inputs/_Popover.tsx +30 -27
- package/src/inputs/_common.less +6 -0
- package/src/inputs/_common.ts +4 -4
- 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/processIndicator/ProcessIndicator.js +2 -2
- package/src/ssr.spec.js +1 -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/instructionsList/InstructionList.story.js +0 -27
- package/src/instructionsList/InstructionsList.spec.js +0 -29
package/build/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import React__default, { forwardRef, cloneElement, useState, useRef, useMemo, useEffect, useCallback, useLayoutEffect, createContext, useContext, PureComponent, createRef,
|
|
4
|
+
import React__default, { forwardRef, cloneElement, useState, useRef, useMemo, useEffect, useCallback, useLayoutEffect, createContext, useContext, Component, PureComponent, createRef, Children, Fragment as Fragment$1 } from 'react';
|
|
5
5
|
import { useId } from '@radix-ui/react-id';
|
|
6
6
|
import { ChevronUp, CrossCircleFill, Cross, NavigateAway, Check, Info as Info$1, Alert as Alert$2, ClockBorderless, CheckCircle, InfoCircle, Warning, CrossCircle, Clock, Briefcase, Person, ArrowLeft, QuestionMarkCircle, AlertCircle, Search, ChevronDown, CheckCircleFill, ArrowRight, Download, ClockFill, Upload as Upload$2, Document, Plus, PlusCircle, AlertCircleFill } from '@transferwise/icons';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -16,6 +16,7 @@ import mergeRefs from 'react-merge-refs';
|
|
|
16
16
|
import { isUndefined, isKey, isNumber, isEmpty, isNull, isArray } from '@transferwise/neptune-validation';
|
|
17
17
|
import { usePopper } from 'react-popper';
|
|
18
18
|
import { Transition, Listbox } from '@headlessui/react';
|
|
19
|
+
import mergeProps from 'merge-props';
|
|
19
20
|
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
20
21
|
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingFocusManager, offset, flip, shift, size, autoUpdate } from '@floating-ui/react';
|
|
21
22
|
import { usePreventScroll } from '@react-aria/overlays';
|
|
@@ -1505,7 +1506,6 @@ const FocusBoundary = ({
|
|
|
1505
1506
|
})
|
|
1506
1507
|
});
|
|
1507
1508
|
};
|
|
1508
|
-
var FocusBoundary$1 = FocusBoundary;
|
|
1509
1509
|
|
|
1510
1510
|
function withNextPortalWrapper(Component) {
|
|
1511
1511
|
return function (props) {
|
|
@@ -1647,7 +1647,7 @@ const Dimmer = ({
|
|
|
1647
1647
|
onExited: onExited,
|
|
1648
1648
|
children: /*#__PURE__*/jsx(DimmerContentWrapper, {
|
|
1649
1649
|
scrollBody: !transparent,
|
|
1650
|
-
children: /*#__PURE__*/jsx(FocusBoundary
|
|
1650
|
+
children: /*#__PURE__*/jsx(FocusBoundary, {
|
|
1651
1651
|
children: /*#__PURE__*/jsx("div", {
|
|
1652
1652
|
ref: dimmerReference,
|
|
1653
1653
|
className: classNames('dimmer', {
|
|
@@ -2093,6 +2093,129 @@ const BottomSheet$1 = props => {
|
|
|
2093
2093
|
};
|
|
2094
2094
|
var BottomSheet$2 = BottomSheet$1;
|
|
2095
2095
|
|
|
2096
|
+
const radius = {
|
|
2097
|
+
xxs: 6,
|
|
2098
|
+
xs: 11,
|
|
2099
|
+
sm: 22,
|
|
2100
|
+
xl: 61
|
|
2101
|
+
};
|
|
2102
|
+
const ANIMATION_DURATION_IN_MS = 1500;
|
|
2103
|
+
class ProcessIndicator extends Component {
|
|
2104
|
+
constructor(props) {
|
|
2105
|
+
super(props);
|
|
2106
|
+
this.state = {
|
|
2107
|
+
status: props.status,
|
|
2108
|
+
size: props.size
|
|
2109
|
+
};
|
|
2110
|
+
this.interval = null;
|
|
2111
|
+
this.timeout = null;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* Create interval for animation duration (1500ms)
|
|
2116
|
+
* Update state only at the end of every interval
|
|
2117
|
+
* (end of animation loop) if props changed before end of animation
|
|
2118
|
+
*/
|
|
2119
|
+
componentDidMount() {
|
|
2120
|
+
this.interval = setInterval(() => {
|
|
2121
|
+
const statusFromState = this.state.status;
|
|
2122
|
+
const sizeFromState = this.state.size;
|
|
2123
|
+
const statusFromProps = this.props.status;
|
|
2124
|
+
const sizeFromProps = this.props.size;
|
|
2125
|
+
if (statusFromState !== statusFromProps) {
|
|
2126
|
+
this.setState({
|
|
2127
|
+
status: statusFromProps
|
|
2128
|
+
}, this.runCallBack(statusFromProps));
|
|
2129
|
+
}
|
|
2130
|
+
if (sizeFromState !== sizeFromProps) {
|
|
2131
|
+
this.setState({
|
|
2132
|
+
size: sizeFromProps
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
}, ANIMATION_DURATION_IN_MS);
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
/**
|
|
2139
|
+
* Only trigger render if comopnent's state got
|
|
2140
|
+
* updated from interval callback
|
|
2141
|
+
*
|
|
2142
|
+
* @param nextProps
|
|
2143
|
+
* @param nextState
|
|
2144
|
+
*/
|
|
2145
|
+
shouldComponentUpdate(nextProps, nextState) {
|
|
2146
|
+
const isSameStatus = nextProps.status === nextState.status;
|
|
2147
|
+
const isSameSize = nextProps.size === nextState.size;
|
|
2148
|
+
return isSameStatus && isSameSize;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
// Clear interval before destroying component
|
|
2152
|
+
componentWillUnmount() {
|
|
2153
|
+
clearInterval(this.interval);
|
|
2154
|
+
clearTimeout(this.timeout);
|
|
2155
|
+
}
|
|
2156
|
+
runCallBack = statusFromProps => {
|
|
2157
|
+
const {
|
|
2158
|
+
onAnimationCompleted
|
|
2159
|
+
} = this.props;
|
|
2160
|
+
if (onAnimationCompleted) {
|
|
2161
|
+
this.timeouts = setTimeout(() => {
|
|
2162
|
+
onAnimationCompleted(statusFromProps);
|
|
2163
|
+
}, ANIMATION_DURATION_IN_MS);
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
render() {
|
|
2167
|
+
const {
|
|
2168
|
+
className,
|
|
2169
|
+
'data-testid': dataTestId
|
|
2170
|
+
} = this.props;
|
|
2171
|
+
const {
|
|
2172
|
+
size,
|
|
2173
|
+
status
|
|
2174
|
+
} = this.state;
|
|
2175
|
+
const classes = classNames(`process process-${size}`, className, {
|
|
2176
|
+
[`process-danger`]: status === Status.FAILED,
|
|
2177
|
+
[`process-stopped`]: status === Status.HIDDEN,
|
|
2178
|
+
[`process-success`]: status === Status.SUCCEEDED
|
|
2179
|
+
});
|
|
2180
|
+
return /*#__PURE__*/jsxs("span", {
|
|
2181
|
+
className: classes,
|
|
2182
|
+
"data-testid": dataTestId,
|
|
2183
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
2184
|
+
className: "process-icon-container",
|
|
2185
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
2186
|
+
className: "process-icon-horizontal"
|
|
2187
|
+
}), /*#__PURE__*/jsx("span", {
|
|
2188
|
+
className: "process-icon-vertical"
|
|
2189
|
+
})]
|
|
2190
|
+
}), /*#__PURE__*/jsx("svg", {
|
|
2191
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2192
|
+
children: /*#__PURE__*/jsx("circle", {
|
|
2193
|
+
className: "process-circle",
|
|
2194
|
+
cx: "50%",
|
|
2195
|
+
cy: "50%",
|
|
2196
|
+
r: radius[this.state.size],
|
|
2197
|
+
fillOpacity: "0.0"
|
|
2198
|
+
})
|
|
2199
|
+
})]
|
|
2200
|
+
});
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
ProcessIndicator.propTypes = {
|
|
2204
|
+
status: PropTypes.oneOf(['processing', 'failed', 'succeeded', 'hidden']),
|
|
2205
|
+
size: PropTypes.oneOf(['xxs', 'xs', 'sm', 'xl']),
|
|
2206
|
+
onAnimationCompleted: PropTypes.func,
|
|
2207
|
+
className: PropTypes.string,
|
|
2208
|
+
'data-testid': PropTypes.string
|
|
2209
|
+
};
|
|
2210
|
+
ProcessIndicator.defaultProps = {
|
|
2211
|
+
status: Status.PROCESSING,
|
|
2212
|
+
size: Size.SMALL,
|
|
2213
|
+
onAnimationCompleted: null,
|
|
2214
|
+
className: undefined,
|
|
2215
|
+
'data-testid': null
|
|
2216
|
+
};
|
|
2217
|
+
var ProcessIndicator$1 = ProcessIndicator;
|
|
2218
|
+
|
|
2096
2219
|
var messages$8 = defineMessages({
|
|
2097
2220
|
loadingAriaLabel: {
|
|
2098
2221
|
id: "neptune.Button.loadingAriaLabel"
|
|
@@ -2187,6 +2310,9 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
2187
2310
|
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
2188
2311
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2189
2312
|
priorityClassMap[newPriority], className);
|
|
2313
|
+
function processIndicatorSize() {
|
|
2314
|
+
return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';
|
|
2315
|
+
}
|
|
2190
2316
|
const Element = component ?? 'button';
|
|
2191
2317
|
let props;
|
|
2192
2318
|
if (Element === 'button') {
|
|
@@ -2210,10 +2336,9 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
2210
2336
|
...props,
|
|
2211
2337
|
"aria-live": loading ? 'polite' : 'off',
|
|
2212
2338
|
"aria-label": loading ? intl.formatMessage(messages$8.loadingAriaLabel) : undefined,
|
|
2213
|
-
children: [children, loading && /*#__PURE__*/jsx(
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
})
|
|
2339
|
+
children: [children, loading && /*#__PURE__*/jsx(ProcessIndicator$1, {
|
|
2340
|
+
size: processIndicatorSize(),
|
|
2341
|
+
className: "btn-loader"
|
|
2217
2342
|
})]
|
|
2218
2343
|
});
|
|
2219
2344
|
});
|
|
@@ -5361,12 +5486,15 @@ const Tooltip = ({
|
|
|
5361
5486
|
position = Position.TOP,
|
|
5362
5487
|
children = undefined,
|
|
5363
5488
|
label,
|
|
5489
|
+
id,
|
|
5364
5490
|
className
|
|
5365
5491
|
}) => {
|
|
5366
5492
|
const [open, setOpen] = useState(false);
|
|
5367
5493
|
const anchorReference = useRef(null);
|
|
5368
5494
|
const [arrowElement, setArrowElement] = useState(null);
|
|
5369
5495
|
const [popperElement, setPopperElement] = useState(null);
|
|
5496
|
+
const fallbackId = useId();
|
|
5497
|
+
const tooltipId = id ?? fallbackId;
|
|
5370
5498
|
const modifiers = [];
|
|
5371
5499
|
modifiers.push({
|
|
5372
5500
|
name: 'arrow',
|
|
@@ -5405,60 +5533,42 @@ const Tooltip = ({
|
|
|
5405
5533
|
forceUpdate();
|
|
5406
5534
|
}
|
|
5407
5535
|
}, [open]);
|
|
5408
|
-
return /*#__PURE__*/
|
|
5409
|
-
children:
|
|
5536
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
5537
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
5410
5538
|
ref: anchorReference,
|
|
5411
|
-
className: "
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
onMouseOut: () => {
|
|
5427
|
-
if (children?.props?.onMouseOver) {
|
|
5428
|
-
children.props.onMouseOver();
|
|
5429
|
-
}
|
|
5430
|
-
setOpen(false);
|
|
5539
|
+
className: "tw-tooltip-container",
|
|
5540
|
+
onMouseOver: () => setOpen(true),
|
|
5541
|
+
onFocus: () => setOpen(true),
|
|
5542
|
+
onMouseOut: () => setOpen(false),
|
|
5543
|
+
onBlur: () => setOpen(false),
|
|
5544
|
+
children: [children ? /*#__PURE__*/cloneElement(children, {
|
|
5545
|
+
'aria-describedby': `${tooltipId}-tooltip`
|
|
5546
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
5547
|
+
// @ts-expect-error
|
|
5548
|
+
ref: setPopperElement,
|
|
5549
|
+
className: classNames('np-tooltip', 'np-panel', open ? `np-panel--open np-tooltip--open` : null, className)
|
|
5550
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
5551
|
+
,
|
|
5552
|
+
style: {
|
|
5553
|
+
...styles.popper
|
|
5431
5554
|
},
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
...attributes.popper,
|
|
5450
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
5451
|
-
className: "np-panel__content tooltip-inner",
|
|
5452
|
-
children: [label, /*#__PURE__*/jsx("div", {
|
|
5453
|
-
// @ts-expect-error
|
|
5454
|
-
ref: setArrowElement,
|
|
5455
|
-
className: classNames('np-panel__arrow')
|
|
5456
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
5457
|
-
,
|
|
5458
|
-
style: styles.arrow
|
|
5459
|
-
})]
|
|
5460
|
-
})
|
|
5461
|
-
}) : null]
|
|
5555
|
+
...attributes.popper,
|
|
5556
|
+
"aria-hidden": !open,
|
|
5557
|
+
role: "tooltip",
|
|
5558
|
+
id: `${tooltipId}-tooltip`,
|
|
5559
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
5560
|
+
className: "np-panel__content tooltip-inner",
|
|
5561
|
+
children: [label, /*#__PURE__*/jsx("div", {
|
|
5562
|
+
// @ts-expect-error
|
|
5563
|
+
ref: setArrowElement,
|
|
5564
|
+
className: classNames('np-panel__arrow')
|
|
5565
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
5566
|
+
,
|
|
5567
|
+
style: styles.arrow
|
|
5568
|
+
})]
|
|
5569
|
+
})
|
|
5570
|
+
})]
|
|
5571
|
+
})
|
|
5462
5572
|
});
|
|
5463
5573
|
};
|
|
5464
5574
|
var Tooltip$1 = Tooltip;
|
|
@@ -6151,10 +6261,10 @@ function formControlClassNameBase({
|
|
|
6151
6261
|
return classNames('form-control',
|
|
6152
6262
|
// TODO: Deprecate
|
|
6153
6263
|
'np-form-control', {
|
|
6154
|
-
'np-form-control--size-auto
|
|
6155
|
-
'np-form-control--size-sm
|
|
6156
|
-
'np-form-control--size-md
|
|
6157
|
-
'np-form-control--size-lg
|
|
6264
|
+
'np-form-control--size-auto': size === 'auto',
|
|
6265
|
+
'np-form-control--size-sm': size === 'sm',
|
|
6266
|
+
'np-form-control--size-md': size === 'md',
|
|
6267
|
+
'np-form-control--size-lg': size === 'lg'
|
|
6158
6268
|
});
|
|
6159
6269
|
}
|
|
6160
6270
|
|
|
@@ -6219,6 +6329,20 @@ function useScreenSize(size) {
|
|
|
6219
6329
|
return useMedia(`(min-width: ${size}px)`);
|
|
6220
6330
|
}
|
|
6221
6331
|
|
|
6332
|
+
const PolymorphicWithOverrides = /*#__PURE__*/forwardRef(function PolymorphicWithOverrides({
|
|
6333
|
+
__overrides: {
|
|
6334
|
+
as: Element,
|
|
6335
|
+
...restOverrides
|
|
6336
|
+
},
|
|
6337
|
+
...restProps
|
|
6338
|
+
}, ref) {
|
|
6339
|
+
return /*#__PURE__*/jsx(Element, {
|
|
6340
|
+
ref: ref,
|
|
6341
|
+
...restProps,
|
|
6342
|
+
...restOverrides
|
|
6343
|
+
});
|
|
6344
|
+
});
|
|
6345
|
+
|
|
6222
6346
|
function wrapInFragment(value) {
|
|
6223
6347
|
return /*#__PURE__*/jsx(Fragment, {
|
|
6224
6348
|
children: value
|
|
@@ -6286,43 +6410,47 @@ function BottomSheet({
|
|
|
6286
6410
|
children: /*#__PURE__*/jsx("div", {
|
|
6287
6411
|
className: "np-bottom-sheet-v2-backdrop"
|
|
6288
6412
|
})
|
|
6289
|
-
}), /*#__PURE__*/jsx(
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
className: "np-bottom-sheet-v2-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
}),
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6413
|
+
}), /*#__PURE__*/jsx(FocusBoundary, {
|
|
6414
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
6415
|
+
context: context,
|
|
6416
|
+
initialFocus: initialFocusRef,
|
|
6417
|
+
guards: false,
|
|
6418
|
+
modal: false,
|
|
6419
|
+
children: /*#__PURE__*/jsx("div", {
|
|
6420
|
+
className: "np-bottom-sheet-v2",
|
|
6421
|
+
children: /*#__PURE__*/jsx(Transition.Child, {
|
|
6422
|
+
className: "np-bottom-sheet-v2-content",
|
|
6423
|
+
enter: "np-bottom-sheet-v2-content--enter",
|
|
6424
|
+
enterFrom: "np-bottom-sheet-v2-content--enter-from",
|
|
6425
|
+
leave: "np-bottom-sheet-v2-content--leave",
|
|
6426
|
+
leaveTo: "np-bottom-sheet-v2-content--leave-to",
|
|
6427
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
6428
|
+
// Force inner state invalidation on open
|
|
6429
|
+
ref: refs.setFloating,
|
|
6430
|
+
className: "np-bottom-sheet-v2-content-inner-container",
|
|
6431
|
+
...getFloatingProps(),
|
|
6432
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
6433
|
+
className: "np-bottom-sheet-v2-header",
|
|
6434
|
+
children: /*#__PURE__*/jsx(CloseButton, {
|
|
6435
|
+
size: Size.SMALL,
|
|
6436
|
+
onClick: () => {
|
|
6437
|
+
onClose?.();
|
|
6438
|
+
}
|
|
6439
|
+
})
|
|
6440
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
6441
|
+
className: classNames('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', {
|
|
6442
|
+
'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md'
|
|
6443
|
+
}),
|
|
6444
|
+
children: [title ? /*#__PURE__*/jsx("h2", {
|
|
6445
|
+
className: "np-bottom-sheet-v2-title np-text-title-body",
|
|
6446
|
+
children: title
|
|
6447
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
6448
|
+
className: "np-bottom-sheet-v2-body np-text-body-default",
|
|
6449
|
+
children: children
|
|
6450
|
+
})]
|
|
6323
6451
|
})]
|
|
6324
|
-
})
|
|
6325
|
-
}
|
|
6452
|
+
}, floatingKey)
|
|
6453
|
+
})
|
|
6326
6454
|
})
|
|
6327
6455
|
})
|
|
6328
6456
|
})]
|
|
@@ -6415,36 +6543,40 @@ function Popover({
|
|
|
6415
6543
|
theme: theme,
|
|
6416
6544
|
screenMode: screenMode,
|
|
6417
6545
|
isNotRootProvider: true,
|
|
6418
|
-
children: /*#__PURE__*/jsx(
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6546
|
+
children: /*#__PURE__*/jsx(Transition, {
|
|
6547
|
+
show: open,
|
|
6548
|
+
leave: "transition-opacity",
|
|
6549
|
+
leaveTo: "opacity-0",
|
|
6550
|
+
beforeEnter: () => {
|
|
6551
|
+
setFloatingKey(prev => prev + 1);
|
|
6552
|
+
},
|
|
6553
|
+
children: /*#__PURE__*/jsx(FocusBoundary, {
|
|
6554
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
6555
|
+
context: context,
|
|
6556
|
+
guards: false,
|
|
6557
|
+
modal: false,
|
|
6558
|
+
children: /*#__PURE__*/jsx("div", {
|
|
6559
|
+
// Force inner state invalidation on open
|
|
6560
|
+
ref: refs.setFloating,
|
|
6561
|
+
className: "np-popover-v2-container"
|
|
6562
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
6563
|
+
,
|
|
6564
|
+
style: floatingStyles,
|
|
6565
|
+
...getFloatingProps(),
|
|
6566
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
6567
|
+
className: classNames('np-popover-v2', title && 'np-popover-v2--has-title', {
|
|
6568
|
+
'np-popover-v2--padding-md': padding === 'md'
|
|
6569
|
+
}),
|
|
6570
|
+
children: [title ? /*#__PURE__*/jsx("h2", {
|
|
6571
|
+
className: "np-popover-v2-title np-text-title-body",
|
|
6572
|
+
children: title
|
|
6573
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
6574
|
+
className: "np-popover-v2-content np-text-body-default",
|
|
6575
|
+
children: children
|
|
6576
|
+
})]
|
|
6577
|
+
})
|
|
6578
|
+
}, floatingKey)
|
|
6579
|
+
})
|
|
6448
6580
|
})
|
|
6449
6581
|
})
|
|
6450
6582
|
})
|
|
@@ -6465,7 +6597,8 @@ function inferSearchableStrings(value) {
|
|
|
6465
6597
|
return [];
|
|
6466
6598
|
}
|
|
6467
6599
|
const SelectInputHasValueContext = /*#__PURE__*/createContext(false);
|
|
6468
|
-
const
|
|
6600
|
+
const SelectInputTriggerButtonPropsContext = /*#__PURE__*/createContext({});
|
|
6601
|
+
const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/createContext(false);
|
|
6469
6602
|
function dedupeSelectInputOptionItem(item, existingValues) {
|
|
6470
6603
|
if (existingValues.has(item.value)) {
|
|
6471
6604
|
return {
|
|
@@ -6495,22 +6628,78 @@ function dedupeSelectInputItems(items) {
|
|
|
6495
6628
|
return item;
|
|
6496
6629
|
});
|
|
6497
6630
|
}
|
|
6631
|
+
const defaultRenderTrigger = ({
|
|
6632
|
+
content,
|
|
6633
|
+
placeholderShown,
|
|
6634
|
+
clear,
|
|
6635
|
+
disabled,
|
|
6636
|
+
size,
|
|
6637
|
+
className
|
|
6638
|
+
}) => /*#__PURE__*/jsx(InputGroup, {
|
|
6639
|
+
addonEnd: {
|
|
6640
|
+
content: /*#__PURE__*/jsxs("span", {
|
|
6641
|
+
className: classNames('np-select-input-addon-container', disabled && 'disabled'),
|
|
6642
|
+
children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxs(Fragment, {
|
|
6643
|
+
children: [/*#__PURE__*/jsx(SelectInputClearButton, {
|
|
6644
|
+
onClick: event => {
|
|
6645
|
+
event.preventDefault();
|
|
6646
|
+
clear();
|
|
6647
|
+
}
|
|
6648
|
+
}), /*#__PURE__*/jsx("span", {
|
|
6649
|
+
className: "np-select-input-addon-separator"
|
|
6650
|
+
})]
|
|
6651
|
+
}) : null, /*#__PURE__*/jsx("span", {
|
|
6652
|
+
className: "np-select-input-addon",
|
|
6653
|
+
children: /*#__PURE__*/jsx(ChevronDown, {
|
|
6654
|
+
size: 16
|
|
6655
|
+
})
|
|
6656
|
+
})]
|
|
6657
|
+
}),
|
|
6658
|
+
padding: 'sm'
|
|
6659
|
+
},
|
|
6660
|
+
disabled: disabled,
|
|
6661
|
+
className: className,
|
|
6662
|
+
children: /*#__PURE__*/jsx(SelectInputTriggerButton, {
|
|
6663
|
+
as: ButtonInput,
|
|
6664
|
+
size: size,
|
|
6665
|
+
children: placeholderShown ? /*#__PURE__*/jsxs("span", {
|
|
6666
|
+
className: "np-select-input-placeholder",
|
|
6667
|
+
children: [" ", content]
|
|
6668
|
+
}) : content
|
|
6669
|
+
})
|
|
6670
|
+
});
|
|
6671
|
+
function SelectInputClearButton({
|
|
6672
|
+
className,
|
|
6673
|
+
onClick
|
|
6674
|
+
}) {
|
|
6675
|
+
const intl = useIntl();
|
|
6676
|
+
return /*#__PURE__*/jsx("button", {
|
|
6677
|
+
type: "button",
|
|
6678
|
+
"aria-label": intl.formatMessage(messages$5.ariaLabel),
|
|
6679
|
+
className: classNames(className, 'np-select-input-addon np-select-input-addon--interactive'),
|
|
6680
|
+
onClick: onClick,
|
|
6681
|
+
children: /*#__PURE__*/jsx(Cross, {
|
|
6682
|
+
size: 16
|
|
6683
|
+
})
|
|
6684
|
+
});
|
|
6685
|
+
}
|
|
6498
6686
|
function SelectInput({
|
|
6499
6687
|
name,
|
|
6500
6688
|
placeholder,
|
|
6501
6689
|
items,
|
|
6502
6690
|
defaultValue,
|
|
6503
6691
|
value: controlledValue,
|
|
6504
|
-
renderValue = wrapInFragment,
|
|
6505
6692
|
compareValues,
|
|
6693
|
+
renderValue = wrapInFragment,
|
|
6694
|
+
renderTrigger = defaultRenderTrigger,
|
|
6506
6695
|
filterable,
|
|
6507
6696
|
filterPlaceholder,
|
|
6508
6697
|
disabled,
|
|
6698
|
+
size = 'md',
|
|
6509
6699
|
className,
|
|
6510
6700
|
onChange,
|
|
6511
6701
|
onClear
|
|
6512
6702
|
}) {
|
|
6513
|
-
const intl = useIntl();
|
|
6514
6703
|
const [open, setOpen] = useState(false);
|
|
6515
6704
|
const triggerRef = useRef(null);
|
|
6516
6705
|
const screenSm = useScreenSize(Breakpoint.SMALL);
|
|
@@ -6536,87 +6725,76 @@ function SelectInput({
|
|
|
6536
6725
|
value
|
|
6537
6726
|
}) => /*#__PURE__*/jsx(SelectInputHasValueContext.Provider, {
|
|
6538
6727
|
value: value != null,
|
|
6539
|
-
children: /*#__PURE__*/jsx(
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
disabled: uiDisabled,
|
|
6548
|
-
className: "np-select-input-addon np-select-input-addon--interactive",
|
|
6549
|
-
onClick: event => {
|
|
6550
|
-
event.preventDefault();
|
|
6551
|
-
onClear();
|
|
6552
|
-
triggerRef.current?.focus({
|
|
6553
|
-
preventScroll: true
|
|
6554
|
-
});
|
|
6555
|
-
},
|
|
6556
|
-
children: /*#__PURE__*/jsx(Cross, {
|
|
6557
|
-
size: 16
|
|
6558
|
-
})
|
|
6559
|
-
}), /*#__PURE__*/jsx("span", {
|
|
6560
|
-
className: "np-select-input-addon-separator"
|
|
6561
|
-
})]
|
|
6562
|
-
}) : null, /*#__PURE__*/jsx("span", {
|
|
6563
|
-
className: "np-select-input-addon",
|
|
6564
|
-
children: /*#__PURE__*/jsx(ChevronDown, {
|
|
6565
|
-
size: 16
|
|
6566
|
-
})
|
|
6567
|
-
})]
|
|
6568
|
-
}),
|
|
6569
|
-
padding: 'sm'
|
|
6570
|
-
},
|
|
6571
|
-
className: className,
|
|
6572
|
-
children: /*#__PURE__*/jsx(OptionsOverlay, {
|
|
6573
|
-
open: open,
|
|
6574
|
-
renderTrigger: ({
|
|
6575
|
-
ref,
|
|
6576
|
-
getInteractionProps
|
|
6577
|
-
}) => /*#__PURE__*/jsx(Listbox.Button, {
|
|
6728
|
+
children: /*#__PURE__*/jsx(OptionsOverlay, {
|
|
6729
|
+
open: open,
|
|
6730
|
+
renderTrigger: ({
|
|
6731
|
+
ref,
|
|
6732
|
+
getInteractionProps
|
|
6733
|
+
}) => /*#__PURE__*/jsx(SelectInputTriggerButtonPropsContext.Provider, {
|
|
6734
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
6735
|
+
value: {
|
|
6578
6736
|
ref: mergeRefs([ref, triggerRef]),
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
},
|
|
6584
|
-
|
|
6737
|
+
...mergeProps({
|
|
6738
|
+
onClick: () => {
|
|
6739
|
+
setOpen(prev => !prev);
|
|
6740
|
+
}
|
|
6741
|
+
}, getInteractionProps())
|
|
6742
|
+
},
|
|
6743
|
+
children: renderTrigger({
|
|
6744
|
+
content: value != null ? /*#__PURE__*/jsx(SelectInputOptionContentWithinTriggerContext.Provider, {
|
|
6585
6745
|
value: true,
|
|
6586
6746
|
children: renderValue(value, true)
|
|
6587
|
-
}) :
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
items: items,
|
|
6599
|
-
renderValue: renderValue,
|
|
6600
|
-
filterable: filterable,
|
|
6601
|
-
filterPlaceholder: filterPlaceholder,
|
|
6602
|
-
searchInputRef: searchInputRef,
|
|
6603
|
-
listboxRef: listboxRef
|
|
6747
|
+
}) : placeholder,
|
|
6748
|
+
placeholderShown: value == null,
|
|
6749
|
+
clear: onClear != null ? () => {
|
|
6750
|
+
onClear();
|
|
6751
|
+
triggerRef.current?.focus({
|
|
6752
|
+
preventScroll: true
|
|
6753
|
+
});
|
|
6754
|
+
} : undefined,
|
|
6755
|
+
disabled: uiDisabled,
|
|
6756
|
+
size,
|
|
6757
|
+
className
|
|
6604
6758
|
})
|
|
6759
|
+
}),
|
|
6760
|
+
initialFocusRef: controllerRef,
|
|
6761
|
+
padding: "none",
|
|
6762
|
+
onClose: () => {
|
|
6763
|
+
setOpen(false);
|
|
6764
|
+
},
|
|
6765
|
+
children: /*#__PURE__*/jsx(SelectInputOptions, {
|
|
6766
|
+
items: items,
|
|
6767
|
+
renderValue: renderValue,
|
|
6768
|
+
filterable: filterable,
|
|
6769
|
+
filterPlaceholder: filterPlaceholder,
|
|
6770
|
+
searchInputRef: searchInputRef,
|
|
6771
|
+
listboxRef: listboxRef
|
|
6605
6772
|
})
|
|
6606
6773
|
})
|
|
6607
6774
|
})
|
|
6608
6775
|
});
|
|
6609
6776
|
}
|
|
6610
|
-
|
|
6611
|
-
|
|
6777
|
+
function SelectInputTriggerButton({
|
|
6778
|
+
as = 'button',
|
|
6612
6779
|
...restProps
|
|
6613
|
-
}
|
|
6614
|
-
|
|
6780
|
+
}) {
|
|
6781
|
+
const {
|
|
6782
|
+
ref,
|
|
6783
|
+
onClick,
|
|
6784
|
+
...interactionProps
|
|
6785
|
+
} = useContext(SelectInputTriggerButtonPropsContext);
|
|
6786
|
+
return /*#__PURE__*/jsx(Listbox.Button, {
|
|
6615
6787
|
ref: ref,
|
|
6616
|
-
|
|
6617
|
-
|
|
6788
|
+
as: PolymorphicWithOverrides,
|
|
6789
|
+
__overrides: {
|
|
6790
|
+
as,
|
|
6791
|
+
...interactionProps
|
|
6792
|
+
},
|
|
6793
|
+
...mergeProps({
|
|
6794
|
+
onClick
|
|
6795
|
+
}, restProps)
|
|
6618
6796
|
});
|
|
6619
|
-
}
|
|
6797
|
+
}
|
|
6620
6798
|
const SelectInputOptionsContainer = /*#__PURE__*/forwardRef(function SelectInputOptionsContainer({
|
|
6621
6799
|
'aria-orientation': ariaOrientation,
|
|
6622
6800
|
'aria-activedescendant': ariaActiveDescendant,
|
|
@@ -6745,8 +6923,7 @@ function SelectInputItemView({
|
|
|
6745
6923
|
{
|
|
6746
6924
|
if (needle == null) {
|
|
6747
6925
|
return /*#__PURE__*/jsx("hr", {
|
|
6748
|
-
className: "np-select-input-separator-item"
|
|
6749
|
-
"aria-hidden": true
|
|
6926
|
+
className: "np-select-input-separator-item"
|
|
6750
6927
|
});
|
|
6751
6928
|
}
|
|
6752
6929
|
break;
|
|
@@ -6799,18 +6976,19 @@ function SelectInputOption({
|
|
|
6799
6976
|
disabled: disabled,
|
|
6800
6977
|
className: ({
|
|
6801
6978
|
active,
|
|
6979
|
+
selected,
|
|
6802
6980
|
disabled: uiDisabled
|
|
6803
|
-
}) => classNames('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
6981
|
+
}) => classNames('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'),
|
|
6804
6982
|
children: ({
|
|
6805
6983
|
selected
|
|
6806
6984
|
}) => /*#__PURE__*/jsxs(Fragment, {
|
|
6807
|
-
children: [
|
|
6808
|
-
size: 16,
|
|
6809
|
-
className: classNames(!selected && 'np-select-input-option-check--not-selected')
|
|
6810
|
-
}) : null, /*#__PURE__*/jsx("div", {
|
|
6985
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
6811
6986
|
className: "np-select-input-option",
|
|
6812
6987
|
children: children
|
|
6813
|
-
})
|
|
6988
|
+
}), cachedParentHasValue ? /*#__PURE__*/jsx(Check, {
|
|
6989
|
+
size: 24,
|
|
6990
|
+
className: classNames('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
|
|
6991
|
+
}) : null]
|
|
6814
6992
|
})
|
|
6815
6993
|
});
|
|
6816
6994
|
}
|
|
@@ -6820,25 +6998,25 @@ function SelectInputOptionContent({
|
|
|
6820
6998
|
description,
|
|
6821
6999
|
icon
|
|
6822
7000
|
}) {
|
|
6823
|
-
const
|
|
7001
|
+
const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);
|
|
6824
7002
|
return /*#__PURE__*/jsxs("div", {
|
|
6825
|
-
className:
|
|
7003
|
+
className: classNames('np-select-input-option-content-container', (note || description) && 'np-text-body-large'),
|
|
6826
7004
|
children: [icon ? /*#__PURE__*/jsx("div", {
|
|
6827
|
-
className: classNames('np-select-input-option-content-icon', !
|
|
7005
|
+
className: classNames('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
6828
7006
|
children: icon
|
|
6829
7007
|
}) : null, /*#__PURE__*/jsxs("div", {
|
|
6830
7008
|
className: "np-select-input-option-content-text",
|
|
6831
7009
|
children: [/*#__PURE__*/jsxs("div", {
|
|
6832
|
-
className: classNames('np-select-input-option-content-text-line-1',
|
|
7010
|
+
className: classNames('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
6833
7011
|
children: [/*#__PURE__*/jsx("h4", {
|
|
6834
|
-
className: "
|
|
7012
|
+
className: "np-select-input-option-content-text-primary d-inline",
|
|
6835
7013
|
children: title
|
|
6836
7014
|
}), note ? /*#__PURE__*/jsx("span", {
|
|
6837
7015
|
className: "np-select-input-option-content-text-secondary np-text-body-default",
|
|
6838
7016
|
children: note
|
|
6839
7017
|
}) : null]
|
|
6840
7018
|
}), description ? /*#__PURE__*/jsx("div", {
|
|
6841
|
-
className: classNames('np-select-input-option-content-text-secondary np-text-body-default',
|
|
7019
|
+
className: classNames('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
6842
7020
|
children: description
|
|
6843
7021
|
}) : null]
|
|
6844
7022
|
})]
|
|
@@ -7288,47 +7466,48 @@ InputWithDisplayFormat.propTypes = {
|
|
|
7288
7466
|
};
|
|
7289
7467
|
var InputWithDisplayFormat$1 = InputWithDisplayFormat;
|
|
7290
7468
|
|
|
7291
|
-
const InstructionsList =
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
const {
|
|
7296
|
-
dos,
|
|
7297
|
-
donts
|
|
7298
|
-
} = props;
|
|
7299
|
-
const DontIcon = isModern ? CrossCircleFill : CrossCircle;
|
|
7300
|
-
const DoIcon = isModern ? CheckCircleFill : CheckCircle;
|
|
7469
|
+
const InstructionsList = ({
|
|
7470
|
+
dos,
|
|
7471
|
+
donts
|
|
7472
|
+
}) => {
|
|
7301
7473
|
return /*#__PURE__*/jsxs("div", {
|
|
7302
7474
|
className: "tw-instructions",
|
|
7303
7475
|
children: [dos && dos.map((doThis, index) =>
|
|
7304
7476
|
/*#__PURE__*/
|
|
7305
7477
|
// eslint-disable-next-line react/no-array-index-key
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
size: 24,
|
|
7310
|
-
className: "do"
|
|
7311
|
-
}), /*#__PURE__*/jsx(Body, {
|
|
7312
|
-
className: "text-primary",
|
|
7313
|
-
type: Typography.BODY_LARGE,
|
|
7314
|
-
children: doThis
|
|
7315
|
-
})]
|
|
7478
|
+
jsx(Instruction, {
|
|
7479
|
+
item: doThis,
|
|
7480
|
+
type: "do"
|
|
7316
7481
|
}, index)), donts && donts.map((dont, index) =>
|
|
7317
7482
|
/*#__PURE__*/
|
|
7318
7483
|
// eslint-disable-next-line react/no-array-index-key
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
size: 24,
|
|
7323
|
-
className: "dont"
|
|
7324
|
-
}), /*#__PURE__*/jsx(Body, {
|
|
7325
|
-
className: "text-primary",
|
|
7326
|
-
type: Typography.BODY_LARGE,
|
|
7327
|
-
children: dont
|
|
7328
|
-
})]
|
|
7484
|
+
jsx(Instruction, {
|
|
7485
|
+
item: dont,
|
|
7486
|
+
type: "dont"
|
|
7329
7487
|
}, index))]
|
|
7330
7488
|
});
|
|
7331
7489
|
};
|
|
7490
|
+
function Instruction({
|
|
7491
|
+
item,
|
|
7492
|
+
type
|
|
7493
|
+
}) {
|
|
7494
|
+
const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
|
|
7495
|
+
return /*#__PURE__*/jsxs("div", {
|
|
7496
|
+
className: "instruction",
|
|
7497
|
+
"aria-label": isInstructionNode ? item['aria-label'] : undefined,
|
|
7498
|
+
children: [type === 'do' ? /*#__PURE__*/jsx(CheckCircleFill, {
|
|
7499
|
+
size: 24,
|
|
7500
|
+
className: type
|
|
7501
|
+
}) : /*#__PURE__*/jsx(CrossCircleFill, {
|
|
7502
|
+
size: 24,
|
|
7503
|
+
className: type
|
|
7504
|
+
}), /*#__PURE__*/jsx(Body, {
|
|
7505
|
+
className: "text-primary",
|
|
7506
|
+
type: Typography.BODY_LARGE,
|
|
7507
|
+
children: isInstructionNode ? item.content : item
|
|
7508
|
+
})]
|
|
7509
|
+
});
|
|
7510
|
+
}
|
|
7332
7511
|
var InstructionsList$1 = InstructionsList;
|
|
7333
7512
|
|
|
7334
7513
|
const Loader = ({
|
|
@@ -10195,128 +10374,6 @@ PhoneNumberInput.defaultProps = {
|
|
|
10195
10374
|
};
|
|
10196
10375
|
var PhoneNumberInput$1 = PhoneNumberInput;
|
|
10197
10376
|
|
|
10198
|
-
const radius = {
|
|
10199
|
-
xs: 11,
|
|
10200
|
-
sm: 22,
|
|
10201
|
-
xl: 61
|
|
10202
|
-
};
|
|
10203
|
-
const ANIMATION_DURATION_IN_MS = 1500;
|
|
10204
|
-
class ProcessIndicator extends Component {
|
|
10205
|
-
constructor(props) {
|
|
10206
|
-
super(props);
|
|
10207
|
-
this.state = {
|
|
10208
|
-
status: props.status,
|
|
10209
|
-
size: props.size
|
|
10210
|
-
};
|
|
10211
|
-
this.interval = null;
|
|
10212
|
-
this.timeout = null;
|
|
10213
|
-
}
|
|
10214
|
-
|
|
10215
|
-
/**
|
|
10216
|
-
* Create interval for animation duration (1500ms)
|
|
10217
|
-
* Update state only at the end of every interval
|
|
10218
|
-
* (end of animation loop) if props changed before end of animation
|
|
10219
|
-
*/
|
|
10220
|
-
componentDidMount() {
|
|
10221
|
-
this.interval = setInterval(() => {
|
|
10222
|
-
const statusFromState = this.state.status;
|
|
10223
|
-
const sizeFromState = this.state.size;
|
|
10224
|
-
const statusFromProps = this.props.status;
|
|
10225
|
-
const sizeFromProps = this.props.size;
|
|
10226
|
-
if (statusFromState !== statusFromProps) {
|
|
10227
|
-
this.setState({
|
|
10228
|
-
status: statusFromProps
|
|
10229
|
-
}, this.runCallBack(statusFromProps));
|
|
10230
|
-
}
|
|
10231
|
-
if (sizeFromState !== sizeFromProps) {
|
|
10232
|
-
this.setState({
|
|
10233
|
-
size: sizeFromProps
|
|
10234
|
-
});
|
|
10235
|
-
}
|
|
10236
|
-
}, ANIMATION_DURATION_IN_MS);
|
|
10237
|
-
}
|
|
10238
|
-
|
|
10239
|
-
/**
|
|
10240
|
-
* Only trigger render if comopnent's state got
|
|
10241
|
-
* updated from interval callback
|
|
10242
|
-
*
|
|
10243
|
-
* @param nextProps
|
|
10244
|
-
* @param nextState
|
|
10245
|
-
*/
|
|
10246
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
10247
|
-
const isSameStatus = nextProps.status === nextState.status;
|
|
10248
|
-
const isSameSize = nextProps.size === nextState.size;
|
|
10249
|
-
return isSameStatus && isSameSize;
|
|
10250
|
-
}
|
|
10251
|
-
|
|
10252
|
-
// Clear interval before destroying component
|
|
10253
|
-
componentWillUnmount() {
|
|
10254
|
-
clearInterval(this.interval);
|
|
10255
|
-
clearTimeout(this.timeout);
|
|
10256
|
-
}
|
|
10257
|
-
runCallBack = statusFromProps => {
|
|
10258
|
-
const {
|
|
10259
|
-
onAnimationCompleted
|
|
10260
|
-
} = this.props;
|
|
10261
|
-
if (onAnimationCompleted) {
|
|
10262
|
-
this.timeouts = setTimeout(() => {
|
|
10263
|
-
onAnimationCompleted(statusFromProps);
|
|
10264
|
-
}, ANIMATION_DURATION_IN_MS);
|
|
10265
|
-
}
|
|
10266
|
-
};
|
|
10267
|
-
render() {
|
|
10268
|
-
const {
|
|
10269
|
-
className,
|
|
10270
|
-
'data-testid': dataTestId
|
|
10271
|
-
} = this.props;
|
|
10272
|
-
const {
|
|
10273
|
-
size,
|
|
10274
|
-
status
|
|
10275
|
-
} = this.state;
|
|
10276
|
-
const classes = classNames(`process process-${size}`, className, {
|
|
10277
|
-
[`process-danger`]: status === Status.FAILED,
|
|
10278
|
-
[`process-stopped`]: status === Status.HIDDEN,
|
|
10279
|
-
[`process-success`]: status === Status.SUCCEEDED
|
|
10280
|
-
});
|
|
10281
|
-
return /*#__PURE__*/jsxs("span", {
|
|
10282
|
-
className: classes,
|
|
10283
|
-
"data-testid": dataTestId,
|
|
10284
|
-
children: [/*#__PURE__*/jsxs("span", {
|
|
10285
|
-
className: "process-icon-container",
|
|
10286
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
10287
|
-
className: "process-icon-horizontal"
|
|
10288
|
-
}), /*#__PURE__*/jsx("span", {
|
|
10289
|
-
className: "process-icon-vertical"
|
|
10290
|
-
})]
|
|
10291
|
-
}), /*#__PURE__*/jsx("svg", {
|
|
10292
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10293
|
-
children: /*#__PURE__*/jsx("circle", {
|
|
10294
|
-
className: "process-circle",
|
|
10295
|
-
cx: "50%",
|
|
10296
|
-
cy: "50%",
|
|
10297
|
-
r: radius[this.state.size],
|
|
10298
|
-
fillOpacity: "0.0"
|
|
10299
|
-
})
|
|
10300
|
-
})]
|
|
10301
|
-
});
|
|
10302
|
-
}
|
|
10303
|
-
}
|
|
10304
|
-
ProcessIndicator.propTypes = {
|
|
10305
|
-
status: PropTypes.oneOf(['processing', 'failed', 'succeeded', 'hidden']),
|
|
10306
|
-
size: PropTypes.oneOf(['xs', 'sm', 'xl']),
|
|
10307
|
-
onAnimationCompleted: PropTypes.func,
|
|
10308
|
-
className: PropTypes.string,
|
|
10309
|
-
'data-testid': PropTypes.string
|
|
10310
|
-
};
|
|
10311
|
-
ProcessIndicator.defaultProps = {
|
|
10312
|
-
status: Status.PROCESSING,
|
|
10313
|
-
size: Size.SMALL,
|
|
10314
|
-
onAnimationCompleted: null,
|
|
10315
|
-
className: undefined,
|
|
10316
|
-
'data-testid': null
|
|
10317
|
-
};
|
|
10318
|
-
var ProcessIndicator$1 = ProcessIndicator;
|
|
10319
|
-
|
|
10320
10377
|
const Progress = ({
|
|
10321
10378
|
className,
|
|
10322
10379
|
id,
|
|
@@ -15084,5 +15141,5 @@ const translations = {
|
|
|
15084
15141
|
zh
|
|
15085
15142
|
};
|
|
15086
15143
|
|
|
15087
|
-
export { Accordion, ActionButton, ActionOption, Alert$1 as Alert, ArrowPosition as AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card as BaseCard, Body, BottomSheet$2 as BottomSheet, Breakpoint, Button, Card$2 as Card, Checkbox$1 as Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron$1 as Chevron, Chip, Chips, CircularButton$1 as CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput$1 as DateInput, DateLookup$1 as DateLookup, DateMode, Decision$1 as Decision, Presentation as DecisionPresentation, Type as DecisionType, DefinitionList$1 as DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, DynamicFieldDefinitionList$1 as DynamicFieldDefinitionList, Emphasis, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat$1 as InputWithDisplayFormat, InstructionsList$1 as InstructionsList, LanguageProvider, Layout$1 as Layout, Link, ListItem$1 as ListItem, Loader$1 as Loader, Logo$1 as Logo, LogoType, Markdown$1 as Markdown, MarkdownNodeType, Modal, Money$1 as Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList$1 as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput$1 as PhoneNumberInput, Popover$2 as Popover, Position, Priority, ProcessIndicator$1 as ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCard$1 as PromoCardGroup, Provider$1 as Provider, RTL_LANGUAGES, Radio$1 as Radio, RadioGroup$1 as RadioGroup, RadioOption$1 as RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, Select, SelectInput, SelectInputOptionContent, Sentiment, Size, SlidingPanel$1 as SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider$1 as SnackbarProvider, Status, StatusIcon, Stepper, Sticky$1 as Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat$1 as TextareaWithDisplayFormat, Theme, Title, Tooltip$1 as Tooltip, Type$1 as Type, Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useSnackbar };
|
|
15144
|
+
export { Accordion, ActionButton, ActionOption, Alert$1 as Alert, ArrowPosition as AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card as BaseCard, Body, BottomSheet$2 as BottomSheet, Breakpoint, Button, Card$2 as Card, Checkbox$1 as Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron$1 as Chevron, Chip, Chips, CircularButton$1 as CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput$1 as DateInput, DateLookup$1 as DateLookup, DateMode, Decision$1 as Decision, Presentation as DecisionPresentation, Type as DecisionType, DefinitionList$1 as DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, DynamicFieldDefinitionList$1 as DynamicFieldDefinitionList, Emphasis, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat$1 as InputWithDisplayFormat, InstructionsList$1 as InstructionsList, LanguageProvider, Layout$1 as Layout, Link, ListItem$1 as ListItem, Loader$1 as Loader, Logo$1 as Logo, LogoType, Markdown$1 as Markdown, MarkdownNodeType, Modal, Money$1 as Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList$1 as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput$1 as PhoneNumberInput, Popover$2 as Popover, Position, Priority, ProcessIndicator$1 as ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCard$1 as PromoCardGroup, Provider$1 as Provider, RTL_LANGUAGES, Radio$1 as Radio, RadioGroup$1 as RadioGroup, RadioOption$1 as RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel$1 as SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider$1 as SnackbarProvider, Status, StatusIcon, Stepper, Sticky$1 as Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat$1 as TextareaWithDisplayFormat, Theme, Title, Tooltip$1 as Tooltip, Type$1 as Type, Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useSnackbar };
|
|
15088
15145
|
//# sourceMappingURL=index.esm.js.map
|