@0xsquid/ui 0.20.3 → 0.21.1-beta.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/dist/cjs/index.js +160 -26
- package/dist/cjs/types/components/buttons/Button.d.ts +3 -1
- package/dist/cjs/types/components/buttons/Chip.d.ts +1 -2
- package/dist/cjs/types/components/controls/Input.d.ts +3 -1
- package/dist/cjs/types/components/controls/RangeInput.d.ts +10 -0
- package/dist/cjs/types/components/controls/index.d.ts +1 -0
- package/dist/cjs/types/components/icons/Arrow.d.ts +4 -0
- package/dist/cjs/types/components/icons/Checkmark.d.ts +10 -1
- package/dist/cjs/types/components/icons/CompassRound.d.ts +8 -0
- package/dist/cjs/types/components/icons/index.d.ts +0 -1
- package/dist/cjs/types/components/layout/Modal.d.ts +3 -1
- package/dist/cjs/types/components/layout/NavigationBar.d.ts +3 -1
- package/dist/cjs/types/components/lists/SettingsItem.d.ts +7 -0
- package/dist/cjs/types/stories/buttons/Button.stories.d.ts +2 -0
- package/dist/cjs/types/stories/controls/Input.stories.d.ts +1 -0
- package/dist/cjs/types/stories/controls/RangeInput.stories.d.ts +7 -0
- package/dist/esm/index.js +156 -27
- package/dist/esm/types/components/buttons/Button.d.ts +3 -1
- package/dist/esm/types/components/buttons/Chip.d.ts +1 -2
- package/dist/esm/types/components/controls/Input.d.ts +3 -1
- package/dist/esm/types/components/controls/RangeInput.d.ts +10 -0
- package/dist/esm/types/components/controls/index.d.ts +1 -0
- package/dist/esm/types/components/icons/Arrow.d.ts +4 -0
- package/dist/esm/types/components/icons/Checkmark.d.ts +10 -1
- package/dist/esm/types/components/icons/CompassRound.d.ts +8 -0
- package/dist/esm/types/components/icons/index.d.ts +0 -1
- package/dist/esm/types/components/layout/Modal.d.ts +3 -1
- package/dist/esm/types/components/layout/NavigationBar.d.ts +3 -1
- package/dist/esm/types/components/lists/SettingsItem.d.ts +7 -0
- package/dist/esm/types/stories/buttons/Button.stories.d.ts +2 -0
- package/dist/esm/types/stories/controls/Input.stories.d.ts +1 -0
- package/dist/esm/types/stories/controls/RangeInput.stories.d.ts +7 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +54 -11
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2792,8 +2792,11 @@ function BlockSkeleton(_a) {
|
|
|
2792
2792
|
return (jsxRuntime.jsx("div", Object.assign({ className: cn('loading-gradient tw-rounded-squid-s', className) }, props)));
|
|
2793
2793
|
}
|
|
2794
2794
|
|
|
2795
|
-
function Checkmark1Icon() {
|
|
2796
|
-
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width:
|
|
2795
|
+
function Checkmark1Icon({ className, size = '16', }) {
|
|
2796
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.8809 2.82977C13.3432 3.13201 13.4729 3.75174 13.1706 4.21399L7.50398 12.8807C7.3318 13.144 7.04572 13.3109 6.73174 13.3313C6.41777 13.3517 6.11252 13.2231 5.90775 12.9842L2.90775 9.4842C2.54833 9.06487 2.59689 8.43357 3.01622 8.07415C3.43554 7.71473 4.06684 7.76329 4.42627 8.18262L6.55918 10.671L11.4967 3.11949C11.7989 2.65725 12.4187 2.52753 12.8809 2.82977Z", fill: "currentColor" }) }));
|
|
2797
|
+
}
|
|
2798
|
+
function Checkmark2Icon({ className, size = '16', style, }) {
|
|
2799
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM15.774 10.1333C16.1237 9.70582 16.0607 9.0758 15.6332 8.72607C15.2058 8.37635 14.5758 8.43935 14.226 8.86679L10.4258 13.5116L9.20711 12.2929C8.81658 11.9024 8.18342 11.9024 7.79289 12.2929C7.40237 12.6834 7.40237 13.3166 7.79289 13.7071L9.79289 15.7071C9.99267 15.9069 10.2676 16.0129 10.5498 15.9988C10.832 15.9847 11.095 15.8519 11.274 15.6333L15.774 10.1333Z", fill: "none", className: className, style: style }) }));
|
|
2797
2800
|
}
|
|
2798
2801
|
|
|
2799
2802
|
function DotGrid1x3HorizontalIcon({ className, size = '16', }) {
|
|
@@ -2941,6 +2944,9 @@ function ArrowsSwapIcon({ size = '24', className, }) {
|
|
|
2941
2944
|
function ArrowUpIcon() {
|
|
2942
2945
|
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "14", fill: "none", viewBox: "0 0 10 14", children: jsxRuntime.jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M1 5.667l4-4 4 4M5 2.334v10" }) }));
|
|
2943
2946
|
}
|
|
2947
|
+
function ArrowCornerDownRightIcon({ size = '24', className, }) {
|
|
2948
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M4 4C4.55228 4 5 4.44772 5 5V13C5 13.5523 5.44772 14 6 14H17.5858L15.2929 11.7071C14.9024 11.3166 14.9024 10.6834 15.2929 10.2929C15.6834 9.90237 16.3166 9.90237 16.7071 10.2929L20.7071 14.2929C21.0976 14.6834 21.0976 15.3166 20.7071 15.7071L16.7071 19.7071C16.3166 20.0976 15.6834 20.0976 15.2929 19.7071C14.9024 19.3166 14.9024 18.6834 15.2929 18.2929L17.5858 16H6C4.34315 16 3 14.6569 3 13V5C3 4.44772 3.44772 4 4 4Z", fill: "currentColor" }) }));
|
|
2949
|
+
}
|
|
2944
2950
|
|
|
2945
2951
|
function Copy(_a) {
|
|
2946
2952
|
var { size = '24', strokeWidth = '2' } = _a, props = __rest$1(_a, ["size", "strokeWidth"]);
|
|
@@ -2955,6 +2961,11 @@ function WalletLink({ imageURI, address }) {
|
|
|
2955
2961
|
return (jsxRuntime.jsx(IconLabel, { src: imageURI, variant: "round", children: jsxRuntime.jsx(HashLink, { hash: address, showCopyButton: true, children: jsxRuntime.jsx(BodyText, { size: "small", children: truncateHash(address) }) }) }));
|
|
2956
2962
|
}
|
|
2957
2963
|
|
|
2964
|
+
function Chip(_a) {
|
|
2965
|
+
var { label, icon } = _a, props = __rest$1(_a, ["label", "icon"]);
|
|
2966
|
+
return (jsxRuntime.jsx("div", Object.assign({}, props, { className: cn('tw-flex tw-h-squid-m tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-grey-500 tw-text-grey-900', icon && 'tw-w-squid-m', props.className), children: label ? (jsxRuntime.jsx(CaptionText, { className: "tw-min-w-squid-xl tw-text-nowrap tw-px-squid-xxs tw-text-center", children: label })) : (icon) })));
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2958
2969
|
const baseButtonClassName = 'tw-border tw-relative tw-overflow-hidden tw-group/base-button tw-flex tw-items-center tw-justify-center';
|
|
2959
2970
|
const buttonSizeClassMap = {
|
|
2960
2971
|
md: 'tw-px-squid-xs tw-py-squid-xxs tw-min-w-[60px] tw-h-squid-xl',
|
|
@@ -2974,7 +2985,8 @@ const buttonVariantClassMap = {
|
|
|
2974
2985
|
const buttonDisabledClass = '!tw-bg-grey-800 !tw-text-grey-600 tw-cursor-not-allowed';
|
|
2975
2986
|
const loadingClassname = 'tw-invisible tw-opacity-0';
|
|
2976
2987
|
function Button$1(_a) {
|
|
2977
|
-
var { label, disabled, size, variant, icon, link, isLoading = false } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading"]);
|
|
2988
|
+
var { label, disabled, size, variant, icon, link, isLoading = false, chip } = _a, props = __rest$1(_a, ["label", "disabled", "size", "variant", "icon", "link", "isLoading", "chip"]);
|
|
2989
|
+
const chipElement = chip ? (jsxRuntime.jsx(Chip, Object.assign({}, chip, { className: cn('tw-absolute -tw-right-squid-xxs -tw-top-squid-xxs tw-z-10', chip.className) }))) : null;
|
|
2978
2990
|
const children = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!disabled && !isLoading && (jsxRuntime.jsx(ButtonHoverOverlay, { className: roundedClassMap[size] })), jsxRuntime.jsx("div", { className: "tw-relative tw-z-[5] tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", children: !label && !icon ? (props.children) : size === 'lg' ? (jsxRuntime.jsx("span", { className: "tw-px-squid-m", children: jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : '', size: "medium", children: label }) })) : size === 'md' ? (label && !icon ? (
|
|
2979
2991
|
// label only
|
|
2980
2992
|
jsxRuntime.jsx(BodyText, { className: isLoading ? loadingClassname : '', size: "small", children: label })) : !label && icon ? (
|
|
@@ -2988,9 +3000,9 @@ function Button$1(_a) {
|
|
|
2988
3000
|
// custom classes from props
|
|
2989
3001
|
props.className);
|
|
2990
3002
|
if (link) {
|
|
2991
|
-
return (jsxRuntime.jsx("a", { "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, children: children }));
|
|
3003
|
+
return (jsxRuntime.jsxs("div", { className: "tw-relative tw-w-full", children: [jsxRuntime.jsx("a", { "aria-disabled": disabled, href: disabled ? undefined : link, target: "_blank", className: className, children: children }), chipElement] }));
|
|
2992
3004
|
}
|
|
2993
|
-
return (jsxRuntime.jsx("button", Object.assign({}, props, { "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })));
|
|
3005
|
+
return (jsxRuntime.jsxs("div", { className: "tw-relative tw-w-full", children: [jsxRuntime.jsx("button", Object.assign({}, props, { "aria-disabled": disabled || isLoading, className: className, disabled: disabled || isLoading, children: children })), chipElement] }));
|
|
2994
3006
|
}
|
|
2995
3007
|
const ButtonHoverOverlay = ({ className }) => {
|
|
2996
3008
|
return (jsxRuntime.jsx("span", { className: cn('tw-absolute tw-inset-0 tw-z-0 tw-hidden tw-h-full tw-w-full tw-bg-material-light-thin group-hover/base-button:tw-block', className) }));
|
|
@@ -3086,9 +3098,10 @@ function SearchIcon() {
|
|
|
3086
3098
|
}
|
|
3087
3099
|
|
|
3088
3100
|
function Input(_a) {
|
|
3089
|
-
var { placeholder = 'Search', showIcon = true, className, icon, isError = false, containerClassName, actionButtonProps, autoFocusTimeout } = _a, props = __rest$1(_a, ["placeholder", "showIcon", "className", "icon", "isError", "containerClassName", "actionButtonProps", "autoFocusTimeout"]);
|
|
3101
|
+
var { placeholder = 'Search', showIcon = true, className, icon, isError = false, isWarning = false, containerClassName, actionButtonProps, autoFocusTimeout, inputRef: inputRefProp } = _a, props = __rest$1(_a, ["placeholder", "showIcon", "className", "icon", "isError", "isWarning", "containerClassName", "actionButtonProps", "autoFocusTimeout", "inputRef"]);
|
|
3090
3102
|
const showActionButton = !!actionButtonProps;
|
|
3091
|
-
const
|
|
3103
|
+
const localInputRef = React.useRef(null);
|
|
3104
|
+
const inputRef = inputRefProp !== null && inputRefProp !== void 0 ? inputRefProp : localInputRef;
|
|
3092
3105
|
React.useEffect(() => {
|
|
3093
3106
|
if (!autoFocusTimeout)
|
|
3094
3107
|
return;
|
|
@@ -3098,7 +3111,7 @@ function Input(_a) {
|
|
|
3098
3111
|
}, autoFocusTimeout);
|
|
3099
3112
|
return () => clearTimeout(timeoutId);
|
|
3100
3113
|
}, [autoFocusTimeout]);
|
|
3101
|
-
return (jsxRuntime.jsxs("div", { className: cn('tw-relative tw-w-full tw-text-grey-600', containerClassName), children: [jsxRuntime.jsx("input", Object.assign({}, props, { ref: inputRef, "aria-invalid": isError, className: cn('tw-relative tw-h-10 tw-w-full tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-900 tw-text-body-small tw-font-typography-regular tw-text-grey-300 placeholder:tw-text-grey-600 invalid:tw-outline-status-negative', showIcon ? 'tw-pl-[40px]' : 'tw-px-
|
|
3114
|
+
return (jsxRuntime.jsxs("div", { className: cn('tw-relative tw-w-full tw-text-grey-600', containerClassName), children: [jsxRuntime.jsx("input", Object.assign({}, props, { ref: inputRef, "aria-invalid": isError, className: cn('tw-relative tw-h-10 tw-w-full tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-900 tw-text-body-small tw-font-typography-regular tw-text-grey-300 placeholder:tw-text-grey-600 invalid:tw-outline-status-negative', showIcon ? 'tw-pl-[40px]' : 'tw-px-squid-s', showActionButton ? 'tw-pr-[70px]' : 'tw-pr-2.5', isError && '!tw-outline-status-negative', className, isWarning && 'focus-visible:tw-outline-status-partial'), placeholder: placeholder })), showIcon ? (jsxRuntime.jsx("div", { className: "tw-absolute tw-inset-y-0 tw-left-0 tw-flex tw-h-full tw-w-[44px] tw-items-center tw-justify-center tw-px-squid-xs", children: icon || jsxRuntime.jsx(SearchIcon, {}) })) : null, showActionButton ? (jsxRuntime.jsx("div", { className: "tw-absolute tw-inset-y-0 tw-right-1.5 tw-flex tw-items-center tw-justify-center", children: jsxRuntime.jsx(InputActionButton, Object.assign({}, actionButtonProps)) })) : null] }));
|
|
3102
3115
|
}
|
|
3103
3116
|
const InputActionButton = ({ onClick, variant = 'tertiary', label = 'Paste', }) => {
|
|
3104
3117
|
return (jsxRuntime.jsx(Button$1, { size: "md", variant: variant, onClick: onClick, className: "!tw-h-[30px] !tw-w-fit !tw-min-w-0", children: jsxRuntime.jsx(CaptionText, { children: label }) }));
|
|
@@ -16702,11 +16715,6 @@ function generateMarkerLines(count) {
|
|
|
16702
16715
|
return allShadows.join(', ');
|
|
16703
16716
|
}
|
|
16704
16717
|
|
|
16705
|
-
function Chip(_a) {
|
|
16706
|
-
var { label, icon } = _a, props = __rest$1(_a, ["label", "icon"]);
|
|
16707
|
-
return (jsxRuntime.jsx("div", Object.assign({}, props, { className: cn('tw-flex tw-h-squid-m tw-items-center tw-justify-center tw-rounded-squid-m tw-bg-grey-500 tw-text-grey-900', icon && 'tw-w-squid-m', props.className), children: label ? (jsxRuntime.jsx(CaptionText, { className: "tw-min-w-squid-xl tw-text-nowrap tw-px-squid-xxs tw-text-center", children: label })) : (icon) })));
|
|
16708
|
-
}
|
|
16709
|
-
|
|
16710
16718
|
function Boost({ boostMode, onToggleBoostMode, estimatedTime, canToggleBoostMode = true, tooltip, }) {
|
|
16711
16719
|
const boostIndicatorRef = React.useRef(null);
|
|
16712
16720
|
function handleToggleBoostMode() {
|
|
@@ -17166,7 +17174,7 @@ function SettingsItem({ icon, label, control, link, transparent = false, helpToo
|
|
|
17166
17174
|
const showDetailsBorder = !!control && !link && !(control.type === 'switch');
|
|
17167
17175
|
return (jsxRuntime.jsx("li", { className: cn('tw-h-[50px] tw-self-stretch tw-px-squid-xs', transparent ? 'tw-bg-transparent' : 'tw-bg-grey-800'), children: jsxRuntime.jsxs(ContentTag, Object.assign({ className: cn('tw-flex tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xs tw-text-grey-300', link && 'hover:tw-bg-material-light-thin') }, contentTagProps, { children: [icon, jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: [jsxRuntime.jsx(BodyText, { size: "small", children: label }), helpTooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, helpTooltip, { children: helpIcon }))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: helpIcon }))] }), jsxRuntime.jsx("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-rounded-squid-xs', showDetailsBorder &&
|
|
17168
17176
|
'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsxRuntime.jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (!!control && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [control.type === 'amount' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { onClick: () => control.onChange(control.resetValueControl.value), label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value }), control.options.map(({ value }, index, _controls) => (jsxRuntime.jsx(SettingsButton, { label: '$' + value, isSelected: control.value === value, onClick: () => control.onChange(value) }, index))), jsxRuntime.jsx(SettingsSlider, { type: control.type, value: control.value, isSelected: control.value !== control.resetValueControl.value, onChange: control.onChange, decimalsFormat: control.decimalsFormat, max: 999 })] })), control.type === 'switch' &&
|
|
17169
|
-
(control.tooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsxRuntime.jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", isSelected: control.value !== control.resetValueControl.value, decimalsFormat: control.decimalsFormat, max: control.max, min: control.min })] }))] }))) })] })) }));
|
|
17177
|
+
(control.tooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsxRuntime.jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", isSelected: control.value !== control.resetValueControl.value, decimalsFormat: control.decimalsFormat, max: control.max, min: control.min })] })), control.type === 'options' && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: control.options.map(({ label, onSelect }, index) => (jsxRuntime.jsx(SettingsButton, { label: label, isSelected: control.selectedLabel === label, onClick: onSelect }, index))) }))] }))) })] })) }));
|
|
17170
17178
|
}
|
|
17171
17179
|
|
|
17172
17180
|
function SwapStepSeparator() {
|
|
@@ -17447,7 +17455,11 @@ function InfoBox({ title, description, icon }) {
|
|
|
17447
17455
|
return (jsxRuntime.jsxs("div", { className: "tw-align-self-stretch tw-flex tw-flex-col tw-items-center tw-gap-squid-xs tw-px-squid-m tw-pb-squid-l tw-pt-squid-xs tw-text-royal-400", children: [icon, jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xxs tw-text-center", children: [jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[9px]", children: title }), jsxRuntime.jsx(CaptionText, { className: "tw-text-grey-500", children: description })] })] }));
|
|
17448
17456
|
}
|
|
17449
17457
|
|
|
17450
|
-
|
|
17458
|
+
const modalWidthClassMap = {
|
|
17459
|
+
large: 'mobile-lg:tw-w-modal-large',
|
|
17460
|
+
'extra-large': 'mobile-lg:tw-w-modal-extra-large',
|
|
17461
|
+
};
|
|
17462
|
+
function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, maxHeight = false, width = 'large', }) {
|
|
17451
17463
|
const [isOpen, setIsOpen] = React.useState(_isOpen);
|
|
17452
17464
|
React.useEffect(() => {
|
|
17453
17465
|
if (_isOpen)
|
|
@@ -17473,7 +17485,7 @@ function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, m
|
|
|
17473
17485
|
}, className: cn('tw-absolute tw-inset-0 tw-z-40 tw-flex tw-items-start tw-justify-center tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m', _isOpen ? 'tw-animate-blur-in' : 'tw-animate-blur-out'), children: jsxRuntime.jsx("div", { style: {
|
|
17474
17486
|
[CSS_VARS.SLIDE_TO_TOP_DURATION]: `${ANIMATION_DURATIONS.SHOW_MODAL}ms`,
|
|
17475
17487
|
[CSS_VARS.SLIDE_TO_BOTTOM_DURATION]: `${ANIMATION_DURATIONS.HIDE_MODAL}ms`,
|
|
17476
|
-
}, className: cn('
|
|
17488
|
+
}, className: cn('tw-relative tw-flex tw-max-h-modal-compact tw-w-modal-compact tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end mobile-lg:tw-max-h-modal-large', className, _isOpen ? 'tw-animate-slide-to-top' : 'tw-animate-slide-to-bottom', maxHeight && 'tw-h-full', modalWidthClassMap[width]), children: children }) })));
|
|
17477
17489
|
}
|
|
17478
17490
|
|
|
17479
17491
|
const borderTypeClassMap = {
|
|
@@ -17497,7 +17509,7 @@ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent
|
|
|
17497
17509
|
? action.labelOrIcon
|
|
17498
17510
|
: undefined, className: "tw-text-grey-300", icon: typeof action.labelOrIcon === 'string'
|
|
17499
17511
|
? null
|
|
17500
|
-
: action.labelOrIcon, onClick: action.onClick }) }), action.id))) })] }), title ? (jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xxl tw-items-center tw-px-squid-m tw-py-squid-xxs mobile-lg:tw-px-squid-l", children: jsxRuntime.jsx(HeadingText, { size: "small", children: title }) })) : null] }));
|
|
17512
|
+
: action.labelOrIcon, onClick: action.onClick, chip: action.chip }) }), action.id))) })] }), title ? (jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xxl tw-items-center tw-px-squid-m tw-py-squid-xxs mobile-lg:tw-px-squid-l", children: jsxRuntime.jsx(HeadingText, { size: "small", children: title }) })) : null] }));
|
|
17501
17513
|
}
|
|
17502
17514
|
|
|
17503
17515
|
const createStoreImpl = (createState) => {
|
|
@@ -24566,7 +24578,7 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSel
|
|
|
24566
24578
|
const handleCloseInput = React.useCallback(() => {
|
|
24567
24579
|
setIsInputVisible(false);
|
|
24568
24580
|
}, []);
|
|
24569
|
-
return (jsxRuntime.jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.jsxs("button", { className: cn('tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin
|
|
24581
|
+
return (jsxRuntime.jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.jsxs("button", { className: cn('tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] -tw-outline-offset-2 placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin', value === 0 || value === undefined
|
|
24570
24582
|
? 'tw-text-grey-600'
|
|
24571
24583
|
: 'tw-text-grey-300', isInputVisible ? 'tw-bg-material-light-thin' : 'tw-bg-transparent', isSelected && 'tw-outline tw-outline-2 tw-outline-royal-500'), children: [value !== null && value !== void 0 ? value : 0, jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === 'percentage' ? '%' : '$' })] }), jsxRuntime.jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(Chip, { icon: jsxRuntime.jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsxRuntime.jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsxRuntime.jsx("form", { onSubmit: (e) => {
|
|
24572
24584
|
e.preventDefault();
|
|
@@ -24623,6 +24635,130 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
|
24623
24635
|
: 'tw-bg-grey-500') })] }));
|
|
24624
24636
|
}
|
|
24625
24637
|
|
|
24638
|
+
function CompassRound({ size = '20', className, }) {
|
|
24639
|
+
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsxRuntime.jsx("path", { d: "M17.7087 9.99996C17.7087 14.2572 14.2575 17.7083 10.0003 17.7083C5.74313 17.7083 2.29199 14.2572 2.29199 9.99996C2.29199 5.74276 5.74313 2.29163 10.0003 2.29163C14.2575 2.29163 17.7087 5.74276 17.7087 9.99996Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M12.2135 7.27515L8.79307 8.208C8.5084 8.28564 8.286 8.50803 8.20837 8.7927L7.27552 12.2132C7.19069 12.5242 7.47609 12.8096 7.78713 12.7248L11.2076 11.7919C11.4923 11.7143 11.7146 11.4919 11.7923 11.2072L12.7251 7.78677C12.81 7.47573 12.5246 7.19032 12.2135 7.27515Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" })] }));
|
|
24640
|
+
}
|
|
24641
|
+
function CircleX({ size = '20', className, }) {
|
|
24642
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M12.5003 7.49996L7.50033 12.5M12.5003 12.5L7.50033 7.49996M17.7087 9.99996C17.7087 14.2572 14.2575 17.7083 10.0003 17.7083C5.74313 17.7083 2.29199 14.2572 2.29199 9.99996C2.29199 5.74276 5.74313 2.29163 10.0003 2.29163C14.2575 2.29163 17.7087 5.74276 17.7087 9.99996Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }));
|
|
24643
|
+
}
|
|
24644
|
+
function CircleMinusIcon({ size = '24', className, }) {
|
|
24645
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16 12.9999C16.5523 12.9999 17 12.5522 17 11.9999C17 11.4476 16.5523 10.9999 16 10.9999L7.99997 11.0001C7.44769 11.0001 6.99998 11.4479 7 12.0001C7.00002 12.5524 7.44774 13.0001 8.00003 13.0001L16 12.9999Z", fill: "currentColor" }) }));
|
|
24646
|
+
}
|
|
24647
|
+
function CirclePlusIcon({ size = '24', className, }) {
|
|
24648
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16 12.9999C16.5523 12.9999 17 12.5522 17 11.9999C17 11.4476 16.5523 10.9999 16 10.9999L13 11V8.00012C13 7.44784 12.5523 7.00012 12 7.00012C11.4477 7.00012 11 7.44784 11 8.00012V11L7.99997 11.0001C7.44769 11.0001 6.99998 11.4479 7 12.0001C7.00002 12.5524 7.44774 13.0001 8.00003 13.0001L11 13V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V13L16 12.9999Z", fill: "currentColor" }) }));
|
|
24649
|
+
}
|
|
24650
|
+
|
|
24651
|
+
function RangeInput({ label, initialValue, onChange, min = 0, max = 99, isWarning = false, }) {
|
|
24652
|
+
const [pressedButton, setPressedButton] = React.useState(null);
|
|
24653
|
+
const inputRef = React.useRef(null);
|
|
24654
|
+
const mousePressedTimeoutRef = React.useRef(null);
|
|
24655
|
+
const inputDecoratorRef = React.useRef(null);
|
|
24656
|
+
// reset input value to initial value on mount
|
|
24657
|
+
React.useEffect(() => {
|
|
24658
|
+
if (!inputRef.current)
|
|
24659
|
+
return;
|
|
24660
|
+
inputRef.current.value = initialValue || '';
|
|
24661
|
+
}, [initialValue]);
|
|
24662
|
+
const handleDecrement = React.useCallback(() => {
|
|
24663
|
+
var _a;
|
|
24664
|
+
if (!inputRef.current || !inputDecoratorRef.current)
|
|
24665
|
+
return;
|
|
24666
|
+
const inputValue = new BigNumber(((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || 0);
|
|
24667
|
+
const newValue = inputValue.minus(0.1);
|
|
24668
|
+
if (newValue.isLessThan(min))
|
|
24669
|
+
return;
|
|
24670
|
+
updateInputAndDecorator(newValue.toString());
|
|
24671
|
+
}, [min]);
|
|
24672
|
+
const handleIncrement = React.useCallback(() => {
|
|
24673
|
+
var _a;
|
|
24674
|
+
if (!inputRef.current || !inputDecoratorRef.current)
|
|
24675
|
+
return;
|
|
24676
|
+
const inputValue = new BigNumber(((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || 0);
|
|
24677
|
+
const newValue = inputValue.plus(0.1);
|
|
24678
|
+
if (newValue.isGreaterThan(max))
|
|
24679
|
+
return;
|
|
24680
|
+
updateInputAndDecorator(newValue.toString());
|
|
24681
|
+
}, [max]);
|
|
24682
|
+
// updates input and decorator value
|
|
24683
|
+
const updateInputAndDecorator = React.useCallback((value) => {
|
|
24684
|
+
if (!inputRef.current || !inputDecoratorRef.current)
|
|
24685
|
+
return;
|
|
24686
|
+
inputDecoratorRef.current.textContent = String(value || 0);
|
|
24687
|
+
inputRef.current.value = String(value || 0);
|
|
24688
|
+
}, []);
|
|
24689
|
+
// When a button is pressed, we set an interval to update the input and decorator value
|
|
24690
|
+
React.useEffect(() => {
|
|
24691
|
+
if (!pressedButton || !inputRef.current)
|
|
24692
|
+
return;
|
|
24693
|
+
const timer = setInterval(() => {
|
|
24694
|
+
if (pressedButton === 'increment') {
|
|
24695
|
+
handleIncrement();
|
|
24696
|
+
}
|
|
24697
|
+
if (pressedButton === 'decrement') {
|
|
24698
|
+
handleDecrement();
|
|
24699
|
+
}
|
|
24700
|
+
}, 50);
|
|
24701
|
+
return () => {
|
|
24702
|
+
clearInterval(timer);
|
|
24703
|
+
};
|
|
24704
|
+
}, [pressedButton]);
|
|
24705
|
+
const handleUpdateValue = React.useCallback(() => {
|
|
24706
|
+
var _a, _b;
|
|
24707
|
+
setPressedButton(null);
|
|
24708
|
+
onChange === null || onChange === void 0 ? void 0 : onChange((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '');
|
|
24709
|
+
if (mousePressedTimeoutRef.current) {
|
|
24710
|
+
clearTimeout(mousePressedTimeoutRef.current);
|
|
24711
|
+
mousePressedTimeoutRef.current = null;
|
|
24712
|
+
}
|
|
24713
|
+
}, [onChange]);
|
|
24714
|
+
// Returns event handler for mouse down event
|
|
24715
|
+
const getMouseDownHandler = React.useCallback((pressed) => () => {
|
|
24716
|
+
if (pressed === 'increment') {
|
|
24717
|
+
handleIncrement();
|
|
24718
|
+
}
|
|
24719
|
+
if (pressed === 'decrement') {
|
|
24720
|
+
handleDecrement();
|
|
24721
|
+
}
|
|
24722
|
+
mousePressedTimeoutRef.current = setTimeout(() => {
|
|
24723
|
+
setPressedButton(pressed);
|
|
24724
|
+
}, 180);
|
|
24725
|
+
}, [handleDecrement, handleIncrement]);
|
|
24726
|
+
return (jsxRuntime.jsx("li", { className: "tw-h-[50px] tw-self-stretch tw-bg-grey-800 tw-px-squid-xs", children: jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xs tw-text-grey-500", children: [jsxRuntime.jsx(ArrowCornerDownRightIcon, {}), jsxRuntime.jsx("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: jsxRuntime.jsx(BodyText, { size: "small", className: "tw-leading-[0]", children: label }) }), jsxRuntime.jsxs("div", { className: cn('tw-relative tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-gap-squid-xxs tw-rounded-squid-xs tw-text-grey-300'), children: [jsxRuntime.jsx("button", { onMouseDown: getMouseDownHandler('decrement'), onMouseUp: handleUpdateValue, onKeyDown: (event) => {
|
|
24727
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
24728
|
+
handleDecrement();
|
|
24729
|
+
}
|
|
24730
|
+
}, onKeyUp: (event) => {
|
|
24731
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
24732
|
+
handleUpdateValue();
|
|
24733
|
+
}
|
|
24734
|
+
}, onMouseLeave: handleUpdateValue, className: cn('tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xxs tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin'), children: jsxRuntime.jsx(CircleMinusIcon, {}) }), jsxRuntime.jsxs("div", { className: "tw-relative", children: [jsxRuntime.jsx(Input, { step: 0.1, min: min, max: max, isWarning: isWarning, defaultValue: initialValue || '0', placeholder: "0", showIcon: false, type: "number", inputRef: inputRef, onChange: (event) => {
|
|
24735
|
+
var _a;
|
|
24736
|
+
if (!inputDecoratorRef.current || !inputRef.current)
|
|
24737
|
+
return;
|
|
24738
|
+
const value = event.target.value;
|
|
24739
|
+
const isWithinRange = Number(value) <= max && Number(value) >= min;
|
|
24740
|
+
const [integer = '', decimal = ''] = value.split('.');
|
|
24741
|
+
const isInvalid = integer.length > 2 || decimal.length > 1;
|
|
24742
|
+
// prevent updating input value if the value is invalid
|
|
24743
|
+
if (!isWithinRange || isInvalid) {
|
|
24744
|
+
event.preventDefault();
|
|
24745
|
+
inputRef.current.value =
|
|
24746
|
+
(_a = inputDecoratorRef.current.textContent) !== null && _a !== void 0 ? _a : '';
|
|
24747
|
+
return;
|
|
24748
|
+
}
|
|
24749
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event.target.value);
|
|
24750
|
+
updateInputAndDecorator(event.target.value);
|
|
24751
|
+
}, className: "tw-max-w-[80px] tw-select-none" }), jsxRuntime.jsxs("div", { className: "tw-pointer-events-none tw-absolute tw-bottom-0 tw-left-squid-s tw-top-0 tw-flex tw-items-center tw-justify-center tw-text-body-small", children: [jsxRuntime.jsx("span", { className: "tw-opacity-0", ref: inputDecoratorRef, children: initialValue || '0' }), jsxRuntime.jsx("span", { className: "tw-text-grey-500", children: "%" })] })] }), jsxRuntime.jsx("button", { onMouseDown: getMouseDownHandler('increment'), onMouseUp: handleUpdateValue, onKeyDown: (event) => {
|
|
24752
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
24753
|
+
handleIncrement();
|
|
24754
|
+
}
|
|
24755
|
+
}, onKeyUp: (event) => {
|
|
24756
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
24757
|
+
handleUpdateValue();
|
|
24758
|
+
}
|
|
24759
|
+
}, onMouseLeave: handleUpdateValue, className: cn('tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xxs tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin'), children: jsxRuntime.jsx(CirclePlusIcon, {}) })] })] }) }));
|
|
24760
|
+
}
|
|
24761
|
+
|
|
24626
24762
|
function PlusIcon() {
|
|
24627
24763
|
return (jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M12 17V12M12 12V7M12 12H17M12 12H7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
|
|
24628
24764
|
}
|
|
@@ -24680,7 +24816,7 @@ function FilterButton({ selected, numApplied = 0, onClick, }) {
|
|
|
24680
24816
|
}
|
|
24681
24817
|
|
|
24682
24818
|
function SettingsButton({ label, isSelected = false, onClick, }) {
|
|
24683
|
-
return (jsxRuntime.jsx("button", { onClick: onClick, className: cn('tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs
|
|
24819
|
+
return (jsxRuntime.jsx("button", { onClick: onClick, className: cn('tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs -tw-outline-offset-2 hover:tw-bg-material-light-thin', isSelected && 'tw-outline tw-outline-2 tw-outline-royal-500'), children: jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
|
|
24684
24820
|
}
|
|
24685
24821
|
|
|
24686
24822
|
function ArrowRotate() {
|
|
@@ -24695,13 +24831,6 @@ function BankIcon() {
|
|
|
24695
24831
|
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.59645 1.2195C8.22108 1.03181 7.77925 1.03181 7.40388 1.2195L2.07054 3.88617C1.61883 4.11202 1.3335 4.57371 1.3335 5.07874V5.33338C1.3335 6.06976 1.93045 6.66671 2.66683 6.66671V10.7564C2.30367 10.8969 2.01131 11.1933 1.88298 11.5783L1.66075 12.245C1.37296 13.1084 2.01559 14 2.92566 14H13.0758C13.9858 14 14.6285 13.1084 14.3407 12.245L14.1185 11.5783C13.99 11.1929 13.6972 10.8963 13.3335 10.7559V6.66671C14.0699 6.66671 14.6668 6.06976 14.6668 5.33338V5.07874C14.6668 4.57371 14.3815 4.11202 13.9298 3.88617L8.59645 1.2195ZM12.0002 6.66671H10.6668V10.6666H12.0002V6.66671ZM9.3335 10.6666V6.66671H6.66683V10.6666H9.3335ZM5.3335 10.6666V6.66671H4.00016V10.6666H5.3335Z", fill: "currentColor" }) }));
|
|
24696
24832
|
}
|
|
24697
24833
|
|
|
24698
|
-
function CompassRound({ size = '20', className, }) {
|
|
24699
|
-
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsxRuntime.jsx("path", { d: "M17.7087 9.99996C17.7087 14.2572 14.2575 17.7083 10.0003 17.7083C5.74313 17.7083 2.29199 14.2572 2.29199 9.99996C2.29199 5.74276 5.74313 2.29163 10.0003 2.29163C14.2575 2.29163 17.7087 5.74276 17.7087 9.99996Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M12.2135 7.27515L8.79307 8.208C8.5084 8.28564 8.286 8.50803 8.20837 8.7927L7.27552 12.2132C7.19069 12.5242 7.47609 12.8096 7.78713 12.7248L11.2076 11.7919C11.4923 11.7143 11.7146 11.4919 11.7923 11.2072L12.7251 7.78677C12.81 7.47573 12.5246 7.19032 12.2135 7.27515Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" })] }));
|
|
24700
|
-
}
|
|
24701
|
-
function CircleX({ size = '20', className, }) {
|
|
24702
|
-
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M12.5003 7.49996L7.50033 12.5M12.5003 12.5L7.50033 7.49996M17.7087 9.99996C17.7087 14.2572 14.2575 17.7083 10.0003 17.7083C5.74313 17.7083 2.29199 14.2572 2.29199 9.99996C2.29199 5.74276 5.74313 2.29163 10.0003 2.29163C14.2575 2.29163 17.7087 5.74276 17.7087 9.99996Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }));
|
|
24703
|
-
}
|
|
24704
|
-
|
|
24705
24834
|
function DashboardFast({ size = '24', className, }) {
|
|
24706
24835
|
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M15 10L12.25 15.5M19.5 16H4.5M21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
24707
24836
|
}
|
|
@@ -60310,6 +60439,7 @@ exports.Approve = Approve;
|
|
|
60310
60439
|
exports.ApproveAction = ApproveAction;
|
|
60311
60440
|
exports.ArrowBottomTopIcon = ArrowBottomTopIcon;
|
|
60312
60441
|
exports.ArrowButton = ArrowButton;
|
|
60442
|
+
exports.ArrowCornerDownRightIcon = ArrowCornerDownRightIcon;
|
|
60313
60443
|
exports.ArrowLeftIcon = ArrowLeftIcon;
|
|
60314
60444
|
exports.ArrowOutOfBoxIcon = ArrowOutOfBoxIcon;
|
|
60315
60445
|
exports.ArrowRightDownCircleIcon = ArrowRightDownCircleIcon;
|
|
@@ -60347,6 +60477,7 @@ exports.Calendar = Calendar;
|
|
|
60347
60477
|
exports.CaptionText = CaptionText;
|
|
60348
60478
|
exports.ChainLink = ChainLink;
|
|
60349
60479
|
exports.Checkmark1Icon = Checkmark1Icon;
|
|
60480
|
+
exports.Checkmark2Icon = Checkmark2Icon;
|
|
60350
60481
|
exports.ChevronArrowIcon = ChevronArrowIcon;
|
|
60351
60482
|
exports.ChevronGrabberVerticalIcon = ChevronGrabberVerticalIcon;
|
|
60352
60483
|
exports.ChevronLargeDownIcon = ChevronLargeDownIcon;
|
|
@@ -60355,6 +60486,8 @@ exports.ChevronRightSmallIcon = ChevronRightSmallIcon;
|
|
|
60355
60486
|
exports.ChevronTopIcon = ChevronTopIcon;
|
|
60356
60487
|
exports.ChevronTopSmallIcon = ChevronTopSmallIcon;
|
|
60357
60488
|
exports.Chip = Chip;
|
|
60489
|
+
exports.CircleMinusIcon = CircleMinusIcon;
|
|
60490
|
+
exports.CirclePlusIcon = CirclePlusIcon;
|
|
60358
60491
|
exports.CircleX = CircleX;
|
|
60359
60492
|
exports.ClockIcon = ClockIcon;
|
|
60360
60493
|
exports.ClockOutlineIcon = ClockOutlineIcon;
|
|
@@ -60433,6 +60566,7 @@ exports.ProfileHeaderBackground = ProfileHeaderBackground;
|
|
|
60433
60566
|
exports.PropertiesLayout = PropertiesLayout;
|
|
60434
60567
|
exports.PropertyListItem = PropertyListItem;
|
|
60435
60568
|
exports.PunkIcon = PunkIcon;
|
|
60569
|
+
exports.RangeInput = RangeInput;
|
|
60436
60570
|
exports.ReceiptBillIcon = ReceiptBillIcon;
|
|
60437
60571
|
exports.ReceiveNFTAction = ReceiveNFTAction;
|
|
60438
60572
|
exports.ReceiveTokensAction = ReceiveTokensAction;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ButtonSize, ButtonVariant } from '../../types/components';
|
|
3
|
+
import { ChipProps } from './Chip';
|
|
3
4
|
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
label?: string;
|
|
5
6
|
icon?: React.ReactNode;
|
|
@@ -8,6 +9,7 @@ interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
link?: string;
|
|
10
11
|
isLoading?: boolean;
|
|
12
|
+
chip?: ChipProps;
|
|
11
13
|
}
|
|
12
|
-
export declare function Button({ label, disabled, size, variant, icon, link, isLoading, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function Button({ label, disabled, size, variant, icon, link, isLoading, chip, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
export interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
label?: string;
|
|
4
4
|
icon?: React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function Chip({ label, icon, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -5,11 +5,13 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
5
5
|
showIcon?: boolean;
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
isError?: boolean;
|
|
8
|
+
isWarning?: boolean;
|
|
8
9
|
containerClassName?: string;
|
|
9
10
|
actionButtonProps?: InputActionButtonProps;
|
|
10
11
|
autoFocusTimeout?: number;
|
|
12
|
+
inputRef?: React.RefObject<HTMLInputElement>;
|
|
11
13
|
}
|
|
12
|
-
export declare function Input({ placeholder, showIcon, className, icon, isError, containerClassName, actionButtonProps, autoFocusTimeout, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function Input({ placeholder, showIcon, className, icon, isError, isWarning, containerClassName, actionButtonProps, autoFocusTimeout, inputRef: inputRefProp, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
type InputActionButtonProps = {
|
|
14
16
|
onClick?: () => void;
|
|
15
17
|
variant?: ButtonVariant;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface RangeInputProps {
|
|
2
|
+
label: string;
|
|
3
|
+
initialValue?: string;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
isWarning?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function RangeInput({ label, initialValue, onChange, min, max, isWarning, }: RangeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -57,3 +57,7 @@ export declare function ArrowsSwapIcon({ size, className, }: {
|
|
|
57
57
|
className?: string;
|
|
58
58
|
}): import("react/jsx-runtime").JSX.Element;
|
|
59
59
|
export declare function ArrowUpIcon(): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export declare function ArrowCornerDownRightIcon({ size, className, }: {
|
|
61
|
+
size?: string;
|
|
62
|
+
className?: string;
|
|
63
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function Checkmark1Icon({ className, size, }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
size?: string;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function Checkmark2Icon({ className, size, style, }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
size?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,3 +6,11 @@ export declare function CircleX({ size, className, }: {
|
|
|
6
6
|
size?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function CircleMinusIcon({ size, className, }: {
|
|
10
|
+
size?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function CirclePlusIcon({ size, className, }: {
|
|
14
|
+
size?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
type ModalWidth = 'large' | 'extra-large';
|
|
2
3
|
interface ModalProps {
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
className?: string;
|
|
5
6
|
onBackdropClick?: () => void;
|
|
6
7
|
isOpen?: boolean;
|
|
7
8
|
maxHeight?: boolean;
|
|
9
|
+
width?: ModalWidth;
|
|
8
10
|
}
|
|
9
|
-
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, width, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ChipProps } from '../buttons';
|
|
2
3
|
import { TooltipProps } from '../controls';
|
|
3
|
-
type ActionButton = {
|
|
4
|
+
export type ActionButton = {
|
|
4
5
|
labelOrIcon: string | React.ReactNode;
|
|
5
6
|
onClick?: () => void;
|
|
6
7
|
id: React.Key;
|
|
7
8
|
tooltip?: Omit<TooltipProps, 'children'>;
|
|
9
|
+
chip?: ChipProps;
|
|
8
10
|
};
|
|
9
11
|
interface NavigationBarProps {
|
|
10
12
|
title?: string;
|
|
@@ -30,6 +30,13 @@ export type SettingsControl = {
|
|
|
30
30
|
onChange: (checked: boolean) => void;
|
|
31
31
|
tooltip?: Omit<TooltipProps, 'children'>;
|
|
32
32
|
disabled?: boolean;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'options';
|
|
35
|
+
selectedLabel: string;
|
|
36
|
+
options: {
|
|
37
|
+
label: string;
|
|
38
|
+
onSelect: () => void;
|
|
39
|
+
}[];
|
|
33
40
|
};
|
|
34
41
|
export interface SettingsItemProps {
|
|
35
42
|
icon: React.ReactNode;
|
|
@@ -28,3 +28,5 @@ export declare const MediumWithLabelLoading: Story;
|
|
|
28
28
|
export declare const MediumWithLongLabelLoading: Story;
|
|
29
29
|
export declare const LargeWithLabelLoading: Story;
|
|
30
30
|
export declare const LargeWithLongLabelLoading: Story;
|
|
31
|
+
export declare const MediumWithChip: Story;
|
|
32
|
+
export declare const LargeWithChip: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { RangeInput } from '../../components/controls/RangeInput';
|
|
3
|
+
declare const meta: Meta<typeof RangeInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Warning10: Story;
|