@0xsquid/ui 0.9.0 → 0.9.2

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 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-grey-100'
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 })) }), !!dropdownMenuItems && (jsxRuntime.jsx("button", { className: "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 group-hover/history-item:tw-opacity-100", onClick: openDropdown, ref: openDropdownButtonRef, children: jsxRuntime.jsx(DotGrid1x3HorizontalIcon, { size: "24" }) }))] }), 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,
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,25 @@ 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, label = '', onAddressButtonClick, isLoading, }) {
3353
+ const borderTypeClassMap = {
3354
+ border: 'tw-border tw-border-material-light-thin',
3355
+ outline: 'tw-outline tw-outline-1 -tw-outline-offset-[1px] tw-outline-material-light-thin',
3356
+ };
3357
+ function ModalContent({ children, addGap = false, borderType = 'border', }) {
3358
+ return (jsxRuntime.jsx("div", { className: cn('tw-flex tw-h-full tw-max-h-[535px] tw-w-full tw-flex-col tw-self-stretch tw-overflow-auto tw-rounded-squid-l tw-bg-grey-800 tw-text-grey-300', addGap && 'tw-gap-squid-xxs tw-pt-squid-xxs', borderTypeClassMap[borderType]), children: children }));
3359
+ }
3360
+
3361
+ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, actions, }) {
3354
3362
  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
3363
  ? '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(AddressButton, { isLoading: isLoading, onClick: onAddressButtonClick, className: displayButtonShadows
3357
- ? 'group-data-[squid-theme-type=dark]:tw-shadow-elevation-dark-2 group-data-[squid-theme-type=light]:tw-shadow-elevation-light-2'
3358
- : undefined, label: label }) })] }), 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] }));
3364
+ : 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'
3365
+ ? action.labelOrIcon
3366
+ : undefined, className: "tw-text-grey-300", icon: typeof action.labelOrIcon === 'string'
3367
+ ? null
3368
+ : 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
3369
  }
3360
3370
 
3361
3371
  function ProductCard({ children }) {
@@ -3434,12 +3444,12 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }) {
3434
3444
  };
3435
3445
  }, [isShowRouteAnimationRunning]);
3436
3446
  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: () => {
3447
+ 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
3448
  // mount route component and start animation
3439
3449
  setIsRouteVisible(true);
3440
3450
  setIsShowRouteAnimationRunning(true);
3441
- }, children: [newStepIndex > currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-animate-translate-to-bottom tw-absolute -tw-top-full tw-left-0 tw-w-full", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.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 && (jsxRuntime.jsx("div", { className: "tw-animate-translate-to-top tw-absolute tw-left-0 tw-top-full tw-w-full", 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
3451
+ }, 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 &&
3452
+ '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
3453
  ? 'tw-animate-fade-in'
3444
3454
  : '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
3455
  ? 'tw-animate-slide-to-top'
@@ -3541,6 +3551,7 @@ exports.LoadingSkeleton = LoadingSkeleton;
3541
3551
  exports.Menu = Menu;
3542
3552
  exports.MenuItem = MenuItem;
3543
3553
  exports.Modal = Modal;
3554
+ exports.ModalContent = ModalContent;
3544
3555
  exports.NavigationBar = NavigationBar;
3545
3556
  exports.NumericInput = NumericInput;
3546
3557
  exports.ProductCard = ProductCard;
@@ -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
- onAddressButtonClick?: () => void;
9
- label?: string;
10
- isLoading?: boolean;
13
+ actions?: ActionButton[];
11
14
  }
12
- export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, label, onAddressButtonClick, isLoading, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
13
16
  export {};
@@ -5,6 +5,7 @@ export * from './ErrorMessage';
5
5
  export * from './InfoBox';
6
6
  export * from './Menu';
7
7
  export * from './Modal';
8
+ export * from './ModalContent';
8
9
  export * from './NavigationBar';
9
10
  export * from './ProductCard';
10
11
  export * from './ProfileHeaderBackground';
@@ -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-grey-100'
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 })) }), !!dropdownMenuItems && (jsx("button", { className: "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 group-hover/history-item:tw-opacity-100", onClick: openDropdown, ref: openDropdownButtonRef, children: jsx(DotGrid1x3HorizontalIcon, { size: "24" }) }))] }), 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,
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,25 @@ 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, label = '', onAddressButtonClick, isLoading, }) {
3351
+ const borderTypeClassMap = {
3352
+ border: 'tw-border tw-border-material-light-thin',
3353
+ outline: 'tw-outline tw-outline-1 -tw-outline-offset-[1px] tw-outline-material-light-thin',
3354
+ };
3355
+ function ModalContent({ children, addGap = false, borderType = 'border', }) {
3356
+ return (jsx("div", { className: cn('tw-flex tw-h-full tw-max-h-[535px] tw-w-full tw-flex-col tw-self-stretch tw-overflow-auto tw-rounded-squid-l tw-bg-grey-800 tw-text-grey-300', addGap && 'tw-gap-squid-xxs tw-pt-squid-xxs', borderTypeClassMap[borderType]), children: children }));
3357
+ }
3358
+
3359
+ function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, actions, }) {
3352
3360
  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
3361
  ? '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(AddressButton, { isLoading: isLoading, onClick: onAddressButtonClick, className: displayButtonShadows
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, label: label }) })] }), 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] }));
3362
+ : 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'
3363
+ ? action.labelOrIcon
3364
+ : undefined, className: "tw-text-grey-300", icon: typeof action.labelOrIcon === 'string'
3365
+ ? null
3366
+ : 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
3367
  }
3358
3368
 
3359
3369
  function ProductCard({ children }) {
@@ -3432,12 +3442,12 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }) {
3432
3442
  };
3433
3443
  }, [isShowRouteAnimationRunning]);
3434
3444
  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: () => {
3445
+ 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
3446
  // mount route component and start animation
3437
3447
  setIsRouteVisible(true);
3438
3448
  setIsShowRouteAnimationRunning(true);
3439
- }, children: [newStepIndex > currentStepIndex && (jsx("div", { className: "tw-animate-translate-to-bottom tw-absolute -tw-top-full tw-left-0 tw-w-full", children: jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsx(CurrentStep, { className: cn(newStepIndex > currentStepIndex &&
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-animate-translate-to-top tw-absolute tw-left-0 tw-top-full tw-w-full", 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
3449
+ }, 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 &&
3450
+ '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
3451
  ? 'tw-animate-fade-in'
3442
3452
  : '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
3453
  ? 'tw-animate-slide-to-top'
@@ -3515,4 +3525,4 @@ function SquidConfigProvider({ theme, children, themeType = 'light', }) {
3515
3525
  return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-font-geist", children: children }));
3516
3526
  }
3517
3527
 
3518
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
3528
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
@@ -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
- onAddressButtonClick?: () => void;
9
- label?: string;
10
- isLoading?: boolean;
13
+ actions?: ActionButton[];
11
14
  }
12
- export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, label, onAddressButtonClick, isLoading, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
13
16
  export {};
@@ -5,6 +5,7 @@ export * from './ErrorMessage';
5
5
  export * from './InfoBox';
6
6
  export * from './Menu';
7
7
  export * from './Modal';
8
+ export * from './ModalContent';
8
9
  export * from './NavigationBar';
9
10
  export * from './ProductCard';
10
11
  export * from './ProfileHeaderBackground';
@@ -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,21 @@ 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 ModalContentBorderType = 'border' | 'outline';
317
+ declare function ModalContent({ children, addGap, borderType, }: {
318
+ children?: React.ReactNode;
319
+ addGap?: boolean;
320
+ borderType?: ModalContentBorderType;
321
+ }): react_jsx_runtime.JSX.Element;
322
+
323
+ type ActionButton = {
324
+ labelOrIcon: string | React.ReactNode;
325
+ onClick?: () => void;
326
+ };
315
327
  interface NavigationBarProps {
316
328
  title?: string;
317
329
  displayBackButton?: boolean;
@@ -319,11 +331,9 @@ interface NavigationBarProps {
319
331
  transparent?: boolean;
320
332
  displayButtonShadows?: boolean;
321
333
  onBackButtonClick?: () => void;
322
- onAddressButtonClick?: () => void;
323
- label?: string;
324
- isLoading?: boolean;
334
+ actions?: ActionButton[];
325
335
  }
326
- declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, label, onAddressButtonClick, isLoading, }: NavigationBarProps): react_jsx_runtime.JSX.Element;
336
+ declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, }: NavigationBarProps): react_jsx_runtime.JSX.Element;
327
337
 
328
338
  declare function ProductCard({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
329
339
 
@@ -454,4 +464,4 @@ declare function useDropdownMenu(props?: {
454
464
  openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
455
465
  };
456
466
 
457
- export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
467
+ export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/squid-ui.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.9.0",
8
+ "version": "0.9.2",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "scripts": {