@0xsquid/ui 0.9.0 → 0.9.1
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 +14 -12
- package/dist/cjs/types/components/icons/Clock.d.ts +4 -0
- package/dist/cjs/types/components/layout/Modal.d.ts +2 -1
- package/dist/cjs/types/components/layout/ModalContent.d.ts +8 -0
- package/dist/cjs/types/components/layout/NavigationBar.d.ts +7 -4
- package/dist/cjs/types/stories/layout/ModalContent.stories.d.ts +8 -0
- package/dist/cjs/types/stories/layout/NavigationBar.stories.d.ts +1 -0
- package/dist/esm/index.js +14 -12
- package/dist/esm/types/components/icons/Clock.d.ts +4 -0
- package/dist/esm/types/components/layout/Modal.d.ts +2 -1
- package/dist/esm/types/components/layout/ModalContent.d.ts +8 -0
- package/dist/esm/types/components/layout/NavigationBar.d.ts +7 -4
- package/dist/esm/types/stories/layout/ModalContent.stories.d.ts +8 -0
- package/dist/esm/types/stories/layout/NavigationBar.stories.d.ts +1 -0
- package/dist/index.css +13 -8
- package/dist/index.d.ts +8 -5
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2986,7 +2986,7 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
|
2986
2986
|
switchCircleSizeClassMap[size],
|
|
2987
2987
|
// disabled and checked styles
|
|
2988
2988
|
checked
|
|
2989
|
-
? 'tw-translate-x-0 tw-bg-
|
|
2989
|
+
? 'tw-translate-x-0 tw-bg-[#FBFBFD]'
|
|
2990
2990
|
: '-tw-translate-x-full tw-bg-grey-500') })] }));
|
|
2991
2991
|
}
|
|
2992
2992
|
|
|
@@ -3226,8 +3226,8 @@ function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted,
|
|
|
3226
3226
|
setDropdownPosition('top');
|
|
3227
3227
|
}
|
|
3228
3228
|
}, [isDropdownOpen, menuRef, dropdownPosition, itemRef]);
|
|
3229
|
-
return (jsxRuntime.jsx("li", { ref: itemRef, className: "tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", children: jsxRuntime.jsxs("div", { className: "tw-group/history-item tw-relative tw-flex tw-flex-shrink-0 tw-cursor-pointer tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin", children: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [isPending ? (jsxRuntime.jsx("span", { className: "tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-30 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-grey-900 tw-bg-royal-400 tw-p-0.5", children: jsxRuntime.jsx(DotGrid1x3HorizontalIcon, {}) })) : null, jsxRuntime.jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsxRuntime.jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(CaptionText, { children: fromLabel }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronRightSmallIcon, {}) }), jsxRuntime.jsx(CaptionText, { children: toLabel })] }), jsxRuntime.jsx("div", { className: cn(!!dropdownMenuItems &&
|
|
3230
|
-
'tw-transition-opacity group-hover/history-item:tw-opacity-0'), children: isPending ? (jsxRuntime.jsx(CaptionText, { className: "tw-text-royal-400", children: pendingLabel })) : (jsxRuntime.jsx(CaptionText, { children: dateCompleted })) })
|
|
3229
|
+
return (jsxRuntime.jsx("li", { ref: itemRef, className: "tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", children: jsxRuntime.jsxs("div", { className: "tw-group/history-item tw-relative tw-flex tw-flex-shrink-0 tw-cursor-pointer tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin", children: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [isPending ? (jsxRuntime.jsx("span", { className: "tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-30 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-grey-900 tw-bg-royal-400 tw-p-0.5", children: jsxRuntime.jsx(DotGrid1x3HorizontalIcon, {}) })) : null, jsxRuntime.jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsxRuntime.jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(CaptionText, { children: fromLabel }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronRightSmallIcon, {}) }), jsxRuntime.jsx(CaptionText, { children: toLabel })] }), !!dropdownMenuItems && (jsxRuntime.jsx("button", { className: "tw-peer tw-absolute tw-right-squid-xxs tw-top-squid-xxs tw-flex tw-h-squid-xl tw-w-squid-xl tw-items-center tw-justify-center tw-rounded-squid-xs tw-bg-material-light-thin tw-p-2 tw-text-grey-300 tw-opacity-0 tw-transition-opacity focus:tw-opacity-100 group-hover/history-item:tw-opacity-100", onClick: openDropdown, ref: openDropdownButtonRef, children: jsxRuntime.jsx(DotGrid1x3HorizontalIcon, { size: "24" }) })), jsxRuntime.jsx("div", { className: cn(!!dropdownMenuItems &&
|
|
3230
|
+
'tw-transition-opacity group-hover/history-item:tw-opacity-0 peer-focus:tw-opacity-0'), children: isPending ? (jsxRuntime.jsx(CaptionText, { className: "tw-text-royal-400", children: pendingLabel })) : (jsxRuntime.jsx(CaptionText, { children: dateCompleted })) })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx(BodyText, { size: "small", children: fromAmount }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), jsxRuntime.jsx(BodyText, { size: "small", children: toAmount })] })] }), isDropdownOpen && !!dropdownMenuItems ? (jsxRuntime.jsx(DropdownMenu, { menuRef: menuRef,
|
|
3231
3231
|
// only show dropdown menu if there is a position defined for it
|
|
3232
3232
|
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] }) }));
|
|
3233
3233
|
}
|
|
@@ -3327,7 +3327,7 @@ function InfoBox({ title, description, icon }) {
|
|
|
3327
3327
|
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 })] })] }));
|
|
3328
3328
|
}
|
|
3329
3329
|
|
|
3330
|
-
function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, }) {
|
|
3330
|
+
function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, maxHeight = false, }) {
|
|
3331
3331
|
const [isOpen, setIsOpen] = react.useState(_isOpen);
|
|
3332
3332
|
react.useEffect(() => {
|
|
3333
3333
|
if (_isOpen)
|
|
@@ -3347,15 +3347,17 @@ function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, }
|
|
|
3347
3347
|
onBackdropClick();
|
|
3348
3348
|
}
|
|
3349
3349
|
}
|
|
3350
|
-
: undefined, className: cn('tw-absolute tw-inset-0 tw-z-40 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-transition-all', _isOpen ? 'tw-animate-blur-in' : 'tw-animate-blur-out'), children: jsxRuntime.jsx("div", { className: cn('tw-relative tw-flex tw-max-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className, _isOpen ? 'tw-animate-slide-to-top' : 'tw-animate-slide-to-bottom'), children: children }) })));
|
|
3350
|
+
: undefined, className: cn('tw-absolute tw-inset-0 tw-z-40 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-transition-all', _isOpen ? 'tw-animate-blur-in' : 'tw-animate-blur-out'), children: jsxRuntime.jsx("div", { className: cn('tw-relative tw-flex tw-max-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className, _isOpen ? 'tw-animate-slide-to-top' : 'tw-animate-slide-to-bottom', maxHeight && 'tw-h-full'), children: children }) })));
|
|
3351
3351
|
}
|
|
3352
3352
|
|
|
3353
|
-
function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick,
|
|
3353
|
+
function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, actions, }) {
|
|
3354
3354
|
return (jsxRuntime.jsxs("nav", { className: cn('tw-flex tw-max-h-[120px] tw-min-w-96 tw-flex-col tw-text-grey-300', transparent ? 'tw-bg-transparent' : 'tw-bg-grey-900'), children: [jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-squid-xxl tw-items-center tw-justify-end tw-gap-x-squid-xs', displayBackButton ? 'tw-px-squid-m' : 'tw-pl-squid-l tw-pr-squid-m'), children: [displayBackButton ? (jsxRuntime.jsx(Button, { className: displayButtonShadows
|
|
3355
3355
|
? 'group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-2 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-2'
|
|
3356
|
-
: undefined, variant: "tertiary", size: "md", icon: jsxRuntime.jsx(ArrowLeftIcon, {}), onClick: onBackButtonClick })) : null, logoUrl ? (jsxRuntime.jsx("img", { src: logoUrl, className: "tw-h-squid-xl tw-min-w-squid-xl" })) : null, jsxRuntime.jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end", children: jsxRuntime.jsx(
|
|
3357
|
-
?
|
|
3358
|
-
: undefined,
|
|
3356
|
+
: undefined, variant: "tertiary", size: "md", icon: jsxRuntime.jsx(ArrowLeftIcon, {}), onClick: onBackButtonClick })) : null, logoUrl ? (jsxRuntime.jsx("img", { src: logoUrl, className: "tw-h-squid-xl tw-min-w-squid-xl" })) : null, jsxRuntime.jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end tw-gap-squid-xxs", children: actions === null || actions === void 0 ? void 0 : actions.map((action) => (jsxRuntime.jsx(Button, { size: "md", variant: "tertiary", label: typeof action.labelOrIcon === 'string'
|
|
3357
|
+
? action.labelOrIcon
|
|
3358
|
+
: undefined, className: "tw-text-grey-300", icon: typeof action.labelOrIcon === 'string'
|
|
3359
|
+
? null
|
|
3360
|
+
: action.labelOrIcon, onClick: action.onClick }))) })] }), title ? (jsxRuntime.jsx("div", { className: "tw-flex tw-h-squid-xxl tw-items-center tw-px-squid-l tw-py-squid-xxs", children: jsxRuntime.jsx(HeadingText, { size: "small", children: title }) })) : null] }));
|
|
3359
3361
|
}
|
|
3360
3362
|
|
|
3361
3363
|
function ProductCard({ children }) {
|
|
@@ -3434,12 +3436,12 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }) {
|
|
|
3434
3436
|
};
|
|
3435
3437
|
}, [isShowRouteAnimationRunning]);
|
|
3436
3438
|
const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
|
|
3437
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { className: "tw-relative tw-max-h-button tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800", onClick: () => {
|
|
3439
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { className: "tw-relative tw-max-h-button tw-max-w-[400px] tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800", onClick: () => {
|
|
3438
3440
|
// mount route component and start animation
|
|
3439
3441
|
setIsRouteVisible(true);
|
|
3440
3442
|
setIsShowRouteAnimationRunning(true);
|
|
3441
|
-
}, children: [newStepIndex > currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-
|
|
3442
|
-
'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-
|
|
3443
|
+
}, children: [newStepIndex > currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-absolute -tw-top-full tw-left-0 tw-w-full tw-animate-translate-to-bottom", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx(CurrentStep, { className: cn(newStepIndex > currentStepIndex &&
|
|
3444
|
+
'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-absolute tw-left-0 tw-top-full tw-w-full tw-animate-translate-to-top", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx("span", { className: "tw-absolute tw-left-0 tw-top-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-b tw-from-grey-800" }), jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-0 tw-left-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-t tw-from-grey-800" })] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
|
|
3443
3445
|
? 'tw-animate-fade-in'
|
|
3444
3446
|
: 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
|
|
3445
3447
|
? 'tw-animate-slide-to-top'
|
|
@@ -6,3 +6,7 @@ export declare function ClockOutlineIcon({ className, size, }: {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
size?: string;
|
|
8
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const SettingsGearIcon: ({ size, className, }: {
|
|
10
|
+
className?: string;
|
|
11
|
+
size?: string;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,6 +4,7 @@ interface ModalProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
onBackdropClick?: () => void;
|
|
6
6
|
isOpen?: boolean;
|
|
7
|
+
maxHeight?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ModalContentBorderType = 'border' | 'outline';
|
|
3
|
+
export declare function ModalContent({ children, addGap, borderType, }: {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
addGap?: boolean;
|
|
6
|
+
borderType?: ModalContentBorderType;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ActionButton = {
|
|
3
|
+
labelOrIcon: string | React.ReactNode;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
};
|
|
1
6
|
interface NavigationBarProps {
|
|
2
7
|
title?: string;
|
|
3
8
|
displayBackButton?: boolean;
|
|
@@ -5,9 +10,7 @@ interface NavigationBarProps {
|
|
|
5
10
|
transparent?: boolean;
|
|
6
11
|
displayButtonShadows?: boolean;
|
|
7
12
|
onBackButtonClick?: () => void;
|
|
8
|
-
|
|
9
|
-
label?: string;
|
|
10
|
-
isLoading?: boolean;
|
|
13
|
+
actions?: ActionButton[];
|
|
11
14
|
}
|
|
12
|
-
export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick,
|
|
15
|
+
export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ModalContent } from '../../components/layout/ModalContent';
|
|
3
|
+
declare const meta: Meta<typeof ModalContent>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithBorder: Story;
|
|
8
|
+
export declare const WithOutline: Story;
|
|
@@ -7,5 +7,6 @@ export declare const Default: Story;
|
|
|
7
7
|
export declare const Title: Story;
|
|
8
8
|
export declare const BackButton: Story;
|
|
9
9
|
export declare const Logo: Story;
|
|
10
|
+
export declare const WithActions: Story;
|
|
10
11
|
export declare const AllProps: Story;
|
|
11
12
|
export declare const Transparent: Story;
|
package/dist/esm/index.js
CHANGED
|
@@ -2984,7 +2984,7 @@ function Switch({ checked = false, onChange, size, disabled = false, }) {
|
|
|
2984
2984
|
switchCircleSizeClassMap[size],
|
|
2985
2985
|
// disabled and checked styles
|
|
2986
2986
|
checked
|
|
2987
|
-
? 'tw-translate-x-0 tw-bg-
|
|
2987
|
+
? 'tw-translate-x-0 tw-bg-[#FBFBFD]'
|
|
2988
2988
|
: '-tw-translate-x-full tw-bg-grey-500') })] }));
|
|
2989
2989
|
}
|
|
2990
2990
|
|
|
@@ -3224,8 +3224,8 @@ function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted,
|
|
|
3224
3224
|
setDropdownPosition('top');
|
|
3225
3225
|
}
|
|
3226
3226
|
}, [isDropdownOpen, menuRef, dropdownPosition, itemRef]);
|
|
3227
|
-
return (jsx("li", { ref: itemRef, className: "tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", children: jsxs("div", { className: "tw-group/history-item tw-relative tw-flex tw-flex-shrink-0 tw-cursor-pointer tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin", children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [isPending ? (jsx("span", { className: "tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-30 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-grey-900 tw-bg-royal-400 tw-p-0.5", children: jsx(DotGrid1x3HorizontalIcon, {}) })) : null, jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), jsx("div", { className: cn(!!dropdownMenuItems &&
|
|
3228
|
-
'tw-transition-opacity group-hover/history-item:tw-opacity-0'), children: isPending ? (jsx(CaptionText, { className: "tw-text-royal-400", children: pendingLabel })) : (jsx(CaptionText, { children: dateCompleted })) })
|
|
3227
|
+
return (jsx("li", { ref: itemRef, className: "tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", children: jsxs("div", { className: "tw-group/history-item tw-relative tw-flex tw-flex-shrink-0 tw-cursor-pointer tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs hover:tw-bg-material-light-thin", children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [isPending ? (jsx("span", { className: "tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-30 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-grey-900 tw-bg-royal-400 tw-p-0.5", children: jsx(DotGrid1x3HorizontalIcon, {}) })) : null, jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), !!dropdownMenuItems && (jsx("button", { className: "tw-peer tw-absolute tw-right-squid-xxs tw-top-squid-xxs tw-flex tw-h-squid-xl tw-w-squid-xl tw-items-center tw-justify-center tw-rounded-squid-xs tw-bg-material-light-thin tw-p-2 tw-text-grey-300 tw-opacity-0 tw-transition-opacity focus:tw-opacity-100 group-hover/history-item:tw-opacity-100", onClick: openDropdown, ref: openDropdownButtonRef, children: jsx(DotGrid1x3HorizontalIcon, { size: "24" }) })), jsx("div", { className: cn(!!dropdownMenuItems &&
|
|
3228
|
+
'tw-transition-opacity group-hover/history-item:tw-opacity-0 peer-focus:tw-opacity-0'), children: isPending ? (jsx(CaptionText, { className: "tw-text-royal-400", children: pendingLabel })) : (jsx(CaptionText, { children: dateCompleted })) })] }), jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsx(BodyText, { size: "small", children: fromAmount }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronLargeRightIcon, {}) }), jsx(BodyText, { size: "small", children: toAmount })] })] }), isDropdownOpen && !!dropdownMenuItems ? (jsx(DropdownMenu, { menuRef: menuRef,
|
|
3229
3229
|
// only show dropdown menu if there is a position defined for it
|
|
3230
3230
|
isHidden: !dropdownPosition, className: cn(!!dropdownPosition && dropdownPositionClassMap[dropdownPosition]), dropdownRef: dropdownRef, items: dropdownMenuItems })) : null] }) }));
|
|
3231
3231
|
}
|
|
@@ -3325,7 +3325,7 @@ function InfoBox({ title, description, icon }) {
|
|
|
3325
3325
|
return (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, 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: [jsx(BodyText, { size: "small", className: "!tw-leading-[9px]", children: title }), jsx(CaptionText, { className: "tw-text-grey-500", children: description })] })] }));
|
|
3326
3326
|
}
|
|
3327
3327
|
|
|
3328
|
-
function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, }) {
|
|
3328
|
+
function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, maxHeight = false, }) {
|
|
3329
3329
|
const [isOpen, setIsOpen] = useState(_isOpen);
|
|
3330
3330
|
useEffect(() => {
|
|
3331
3331
|
if (_isOpen)
|
|
@@ -3345,15 +3345,17 @@ function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, }
|
|
|
3345
3345
|
onBackdropClick();
|
|
3346
3346
|
}
|
|
3347
3347
|
}
|
|
3348
|
-
: undefined, className: cn('tw-absolute tw-inset-0 tw-z-40 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-transition-all', _isOpen ? 'tw-animate-blur-in' : 'tw-animate-blur-out'), children: jsx("div", { className: cn('tw-relative tw-flex tw-max-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className, _isOpen ? 'tw-animate-slide-to-top' : 'tw-animate-slide-to-bottom'), children: children }) })));
|
|
3348
|
+
: undefined, className: cn('tw-absolute tw-inset-0 tw-z-40 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-transition-all', _isOpen ? 'tw-animate-blur-in' : 'tw-animate-blur-out'), children: jsx("div", { className: cn('tw-relative tw-flex tw-max-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className, _isOpen ? 'tw-animate-slide-to-top' : 'tw-animate-slide-to-bottom', maxHeight && 'tw-h-full'), children: children }) })));
|
|
3349
3349
|
}
|
|
3350
3350
|
|
|
3351
|
-
function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick,
|
|
3351
|
+
function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, actions, }) {
|
|
3352
3352
|
return (jsxs("nav", { className: cn('tw-flex tw-max-h-[120px] tw-min-w-96 tw-flex-col tw-text-grey-300', transparent ? 'tw-bg-transparent' : 'tw-bg-grey-900'), children: [jsxs("div", { className: cn('tw-flex tw-h-squid-xxl tw-items-center tw-justify-end tw-gap-x-squid-xs', displayBackButton ? 'tw-px-squid-m' : 'tw-pl-squid-l tw-pr-squid-m'), children: [displayBackButton ? (jsx(Button, { className: displayButtonShadows
|
|
3353
3353
|
? 'group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-2 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-2'
|
|
3354
|
-
: undefined, variant: "tertiary", size: "md", icon: jsx(ArrowLeftIcon, {}), onClick: onBackButtonClick })) : null, logoUrl ? (jsx("img", { src: logoUrl, className: "tw-h-squid-xl tw-min-w-squid-xl" })) : null, jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end", children: jsx(
|
|
3355
|
-
?
|
|
3356
|
-
: undefined,
|
|
3354
|
+
: undefined, variant: "tertiary", size: "md", icon: jsx(ArrowLeftIcon, {}), onClick: onBackButtonClick })) : null, logoUrl ? (jsx("img", { src: logoUrl, className: "tw-h-squid-xl tw-min-w-squid-xl" })) : null, jsx("span", { className: "tw-flex tw-flex-1 tw-items-center tw-justify-end tw-gap-squid-xxs", children: actions === null || actions === void 0 ? void 0 : actions.map((action) => (jsx(Button, { size: "md", variant: "tertiary", label: typeof action.labelOrIcon === 'string'
|
|
3355
|
+
? action.labelOrIcon
|
|
3356
|
+
: undefined, className: "tw-text-grey-300", icon: typeof action.labelOrIcon === 'string'
|
|
3357
|
+
? null
|
|
3358
|
+
: action.labelOrIcon, onClick: action.onClick }))) })] }), title ? (jsx("div", { className: "tw-flex tw-h-squid-xxl tw-items-center tw-px-squid-l tw-py-squid-xxs", children: jsx(HeadingText, { size: "small", children: title }) })) : null] }));
|
|
3357
3359
|
}
|
|
3358
3360
|
|
|
3359
3361
|
function ProductCard({ children }) {
|
|
@@ -3432,12 +3434,12 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }) {
|
|
|
3432
3434
|
};
|
|
3433
3435
|
}, [isShowRouteAnimationRunning]);
|
|
3434
3436
|
const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
|
|
3435
|
-
return (jsxs(Fragment, { children: [jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxs("button", { className: "tw-relative tw-max-h-button tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800", onClick: () => {
|
|
3437
|
+
return (jsxs(Fragment, { children: [jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxs("button", { className: "tw-relative tw-max-h-button tw-max-w-[400px] tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800", onClick: () => {
|
|
3436
3438
|
// mount route component and start animation
|
|
3437
3439
|
setIsRouteVisible(true);
|
|
3438
3440
|
setIsShowRouteAnimationRunning(true);
|
|
3439
|
-
}, children: [newStepIndex > currentStepIndex && (jsx("div", { className: "tw-
|
|
3440
|
-
'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsx("div", { className: "tw-
|
|
3441
|
+
}, children: [newStepIndex > currentStepIndex && (jsx("div", { className: "tw-absolute -tw-top-full tw-left-0 tw-w-full tw-animate-translate-to-bottom", children: jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsx(CurrentStep, { className: cn(newStepIndex > currentStepIndex &&
|
|
3442
|
+
'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsx("div", { className: "tw-absolute tw-left-0 tw-top-full tw-w-full tw-animate-translate-to-top", children: jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsx("span", { className: "tw-absolute tw-left-0 tw-top-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-b tw-from-grey-800" }), jsx("span", { className: "tw-absolute tw-bottom-0 tw-left-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-t tw-from-grey-800" })] }) }), isRouteVisible && (jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
|
|
3441
3443
|
? 'tw-animate-fade-in'
|
|
3442
3444
|
: 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
|
|
3443
3445
|
? 'tw-animate-slide-to-top'
|
|
@@ -6,3 +6,7 @@ export declare function ClockOutlineIcon({ className, size, }: {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
size?: string;
|
|
8
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const SettingsGearIcon: ({ size, className, }: {
|
|
10
|
+
className?: string;
|
|
11
|
+
size?: string;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,6 +4,7 @@ interface ModalProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
onBackdropClick?: () => void;
|
|
6
6
|
isOpen?: boolean;
|
|
7
|
+
maxHeight?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ModalContentBorderType = 'border' | 'outline';
|
|
3
|
+
export declare function ModalContent({ children, addGap, borderType, }: {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
addGap?: boolean;
|
|
6
|
+
borderType?: ModalContentBorderType;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ActionButton = {
|
|
3
|
+
labelOrIcon: string | React.ReactNode;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
};
|
|
1
6
|
interface NavigationBarProps {
|
|
2
7
|
title?: string;
|
|
3
8
|
displayBackButton?: boolean;
|
|
@@ -5,9 +10,7 @@ interface NavigationBarProps {
|
|
|
5
10
|
transparent?: boolean;
|
|
6
11
|
displayButtonShadows?: boolean;
|
|
7
12
|
onBackButtonClick?: () => void;
|
|
8
|
-
|
|
9
|
-
label?: string;
|
|
10
|
-
isLoading?: boolean;
|
|
13
|
+
actions?: ActionButton[];
|
|
11
14
|
}
|
|
12
|
-
export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick,
|
|
15
|
+
export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ModalContent } from '../../components/layout/ModalContent';
|
|
3
|
+
declare const meta: Meta<typeof ModalContent>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithBorder: Story;
|
|
8
|
+
export declare const WithOutline: Story;
|
|
@@ -7,5 +7,6 @@ export declare const Default: Story;
|
|
|
7
7
|
export declare const Title: Story;
|
|
8
8
|
export declare const BackButton: Story;
|
|
9
9
|
export declare const Logo: Story;
|
|
10
|
+
export declare const WithActions: Story;
|
|
10
11
|
export declare const AllProps: Story;
|
|
11
12
|
export declare const Transparent: Story;
|
package/dist/index.css
CHANGED
|
@@ -920,10 +920,6 @@ video {
|
|
|
920
920
|
height: 46px;
|
|
921
921
|
}
|
|
922
922
|
|
|
923
|
-
.tw-h-\[470px\] {
|
|
924
|
-
height: 470px;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
923
|
.tw-h-\[50px\] {
|
|
928
924
|
height: 50px;
|
|
929
925
|
}
|
|
@@ -1012,10 +1008,6 @@ video {
|
|
|
1012
1008
|
max-height: 540px;
|
|
1013
1009
|
}
|
|
1014
1010
|
|
|
1015
|
-
.tw-max-h-\[570px\] {
|
|
1016
|
-
max-height: 570px;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
1011
|
.tw-max-h-\[600px\] {
|
|
1020
1012
|
max-height: 600px;
|
|
1021
1013
|
}
|
|
@@ -1820,6 +1812,11 @@ video {
|
|
|
1820
1812
|
background-color: var(--squid-theme-royal-400) !important;
|
|
1821
1813
|
}
|
|
1822
1814
|
|
|
1815
|
+
.tw-bg-\[\#FBFBFD\] {
|
|
1816
|
+
--tw-bg-opacity: 1;
|
|
1817
|
+
background-color: rgb(251 251 253 / var(--tw-bg-opacity));
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1823
1820
|
.tw-bg-blue-950 {
|
|
1824
1821
|
--tw-bg-opacity: 1;
|
|
1825
1822
|
background-color: rgb(23 37 84 / var(--tw-bg-opacity));
|
|
@@ -2601,6 +2598,10 @@ li {
|
|
|
2601
2598
|
color: var(--squid-theme-royal-400);
|
|
2602
2599
|
}
|
|
2603
2600
|
|
|
2601
|
+
.focus\:tw-opacity-100:focus {
|
|
2602
|
+
opacity: 1;
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2604
2605
|
.focus\:tw-outline-none:focus {
|
|
2605
2606
|
outline: 2px solid transparent;
|
|
2606
2607
|
outline-offset: 2px;
|
|
@@ -2651,6 +2652,10 @@ li {
|
|
|
2651
2652
|
display: block;
|
|
2652
2653
|
}
|
|
2653
2654
|
|
|
2655
|
+
.tw-peer:focus ~ .peer-focus\:tw-opacity-0 {
|
|
2656
|
+
opacity: 0;
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2654
2659
|
.aria-disabled\:tw-bg-grey-600[aria-disabled="true"] {
|
|
2655
2660
|
background-color: var(--squid-theme-grey-600);
|
|
2656
2661
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -309,9 +309,14 @@ interface ModalProps {
|
|
|
309
309
|
className?: string;
|
|
310
310
|
onBackdropClick?: () => void;
|
|
311
311
|
isOpen?: boolean;
|
|
312
|
+
maxHeight?: boolean;
|
|
312
313
|
}
|
|
313
|
-
declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, }: ModalProps): false | react_jsx_runtime.JSX.Element;
|
|
314
|
+
declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, }: ModalProps): false | react_jsx_runtime.JSX.Element;
|
|
314
315
|
|
|
316
|
+
type ActionButton = {
|
|
317
|
+
labelOrIcon: string | React.ReactNode;
|
|
318
|
+
onClick?: () => void;
|
|
319
|
+
};
|
|
315
320
|
interface NavigationBarProps {
|
|
316
321
|
title?: string;
|
|
317
322
|
displayBackButton?: boolean;
|
|
@@ -319,11 +324,9 @@ interface NavigationBarProps {
|
|
|
319
324
|
transparent?: boolean;
|
|
320
325
|
displayButtonShadows?: boolean;
|
|
321
326
|
onBackButtonClick?: () => void;
|
|
322
|
-
|
|
323
|
-
label?: string;
|
|
324
|
-
isLoading?: boolean;
|
|
327
|
+
actions?: ActionButton[];
|
|
325
328
|
}
|
|
326
|
-
declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick,
|
|
329
|
+
declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): react_jsx_runtime.JSX.Element;
|
|
327
330
|
|
|
328
331
|
declare function ProductCard({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
329
332
|
|