@gearbox-protocol/permissionless-ui 1.17.8 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/ResizeObserver.es.cjs +1 -0
- package/dist/cjs/_virtual/_commonjsHelpers.cjs +1 -1
- package/dist/cjs/_virtual/arrows.cjs +1 -0
- package/dist/cjs/_virtual/default-props.cjs +1 -0
- package/dist/cjs/_virtual/dots.cjs +1 -0
- package/dist/cjs/_virtual/index2.cjs +1 -0
- package/dist/cjs/_virtual/index3.cjs +1 -0
- package/dist/cjs/_virtual/index4.cjs +1 -0
- package/dist/cjs/_virtual/initial-state.cjs +1 -0
- package/dist/cjs/_virtual/inner-slider.cjs +1 -0
- package/dist/cjs/_virtual/innerSliderUtils.cjs +1 -0
- package/dist/cjs/_virtual/slider.cjs +1 -0
- package/dist/cjs/_virtual/track.cjs +1 -0
- package/dist/cjs/components/address/address.cjs +1 -0
- package/dist/cjs/components/address/index.cjs +1 -0
- package/dist/cjs/components/alert-modal/alert-modal.cjs +1 -0
- package/dist/cjs/components/alert-modal/index.cjs +1 -0
- package/dist/cjs/components/apy/apy.cjs +1 -0
- package/dist/cjs/components/apy/index.cjs +1 -0
- package/dist/cjs/components/arc-loader/arc-loader.cjs +1 -0
- package/dist/cjs/components/arc-loader/index.cjs +1 -0
- package/dist/cjs/components/breadcrumbs/breadcrumbs.cjs +1 -1
- package/dist/cjs/components/button-checkbox/button-checkbox.cjs +1 -0
- package/dist/cjs/components/button-checkbox/index.cjs +1 -0
- package/dist/cjs/components/carousel/carousel.cjs +5 -0
- package/dist/cjs/components/carousel/index.cjs +1 -0
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -0
- package/dist/cjs/components/complex-input/index.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/confirm-menu/confirm-menu.cjs +1 -0
- package/dist/cjs/components/confirm-menu/index.cjs +1 -0
- package/dist/cjs/components/currency-button/currency-button.cjs +1 -0
- package/dist/cjs/components/currency-button/index.cjs +1 -0
- package/dist/cjs/components/detailed-apy/detailed-apy.cjs +1 -0
- package/dist/cjs/components/detailed-apy/index.cjs +1 -0
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/dropdown-label/dropdown-label.cjs +1 -0
- package/dist/cjs/components/dropdown-label/index.cjs +1 -0
- package/dist/cjs/components/edit-input/edit-input.cjs +1 -0
- package/dist/cjs/components/edit-input/index.cjs +1 -0
- package/dist/cjs/components/explorer-links-dropdown/explorer-links-dropdown.cjs +1 -0
- package/dist/cjs/components/explorer-links-dropdown/index.cjs +1 -0
- package/dist/cjs/components/filter/filter-block.cjs +1 -1
- package/dist/cjs/components/filter/filter-dropdown-item.cjs +1 -1
- package/dist/cjs/components/filter/filter-modal-item.cjs +1 -1
- package/dist/cjs/components/formatted-number/formatted-number.cjs +1 -0
- package/dist/cjs/components/formatted-number/index.cjs +1 -0
- package/dist/cjs/components/general-asset-list/general-asset-list.cjs +1 -0
- package/dist/cjs/components/general-asset-list/index.cjs +1 -0
- package/dist/cjs/components/graph/formatters.cjs +1 -1
- package/dist/cjs/components/graph/graph-current-value.cjs +1 -1
- package/dist/cjs/components/graph/graph-tooltip.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/grid-td-cell/grid-td-cell.cjs +1 -0
- package/dist/cjs/components/grid-td-cell/index.cjs +1 -0
- package/dist/cjs/components/help-sections/help-sections.cjs +1 -0
- package/dist/cjs/components/help-sections/index.cjs +1 -0
- package/dist/cjs/components/hide-on/hide-on.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/col/col.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/navbar-logo/index.cjs +1 -0
- package/dist/cjs/components/navbar-logo/navbar-logo.cjs +1 -0
- package/dist/cjs/components/network-icon/index.cjs +1 -0
- package/dist/cjs/components/network-icon/network-icon.cjs +1 -0
- package/dist/cjs/components/overflow/index.cjs +1 -0
- package/dist/cjs/components/overflow/overflow.cjs +1 -0
- package/dist/cjs/components/overflow-container/index.cjs +1 -0
- package/dist/cjs/components/overflow-container/overflow-container.cjs +1 -0
- package/dist/cjs/components/pool-apy-tooltip/index.cjs +1 -0
- package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -0
- package/dist/cjs/components/pool-indicator-icon/index.cjs +1 -0
- package/dist/cjs/components/pool-indicator-icon/pool-indicator-icon.cjs +1 -0
- package/dist/cjs/components/rounded-image/index.cjs +1 -0
- package/dist/cjs/components/rounded-image/rounded-image.cjs +1 -0
- package/dist/cjs/components/row/index.cjs +1 -0
- package/dist/cjs/components/row/row.cjs +1 -0
- package/dist/cjs/components/segmented-control/segmented-control.cjs +1 -1
- package/dist/cjs/components/slider/slider.cjs +1 -1
- package/dist/cjs/components/slider-token/index.cjs +1 -0
- package/dist/cjs/components/slider-token/slider-token.cjs +1 -0
- package/dist/cjs/components/smart-number-input/smart-number-input.cjs +1 -1
- package/dist/cjs/components/split-list/index.cjs +1 -0
- package/dist/cjs/components/split-list/split-list.cjs +1 -0
- package/dist/cjs/components/stat-badge/stat-badge.cjs +1 -1
- package/dist/cjs/components/status-triangle/status-triangle.cjs +1 -1
- package/dist/cjs/components/styled-dropdown/index.cjs +1 -0
- package/dist/cjs/components/styled-dropdown/styled-dropdown.cjs +1 -0
- package/dist/cjs/components/table/grid-table.cjs +1 -1
- package/dist/cjs/components/text-button/index.cjs +1 -0
- package/dist/cjs/components/text-button/text-button.cjs +1 -0
- package/dist/cjs/components/time-to-liquidation/index.cjs +1 -0
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -0
- package/dist/cjs/components/tokens-list-cell/index.cjs +1 -0
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -0
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/components/with-filter-button/with-filter-button.cjs +1 -1
- package/dist/cjs/components/with-title/index.cjs +1 -0
- package/dist/cjs/components/with-title/with-title.cjs +1 -0
- package/dist/cjs/hooks/index.cjs +1 -1
- package/dist/cjs/hooks/use-debounce-call.cjs +1 -0
- package/dist/cjs/hooks/use-debounce.cjs +1 -1
- package/dist/cjs/hooks/use-pool-points-tips.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs +5 -0
- package/dist/cjs/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/MediaQuery.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/MediaQueryDispatch.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/QueryHandler.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/Util.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/index.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/json2mq@0.2.0/node_modules/json2mq/index.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash.debounce@4.0.8/node_modules/lodash.debounce/index.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/arrows.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/default-props.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/dots.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/index.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/initial-state.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/inner-slider.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/slider.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/track.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/utils/innerSliderUtils.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.cjs +1 -0
- package/dist/cjs/node_modules/.pnpm/string-convert@0.2.1/node_modules/string-convert/camel2hyphen.cjs +1 -0
- package/dist/cjs/utils/bn-to-pretty-view.cjs +1 -0
- package/dist/cjs/utils/format-money.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/network-icons.cjs +1 -0
- package/dist/cjs/utils/parse-input-to-bn.cjs +1 -0
- package/dist/cjs/utils/plural.cjs +1 -0
- package/dist/cjs/utils/ranges.cjs +1 -0
- package/dist/cjs/utils/search.cjs +1 -0
- package/dist/cjs/utils/shorten-string.cjs +1 -0
- package/dist/cjs/utils/ttl.cjs +1 -1
- package/dist/cjs/utils/window.cjs +1 -0
- package/dist/esm/_virtual/ResizeObserver.es.js +6 -0
- package/dist/esm/_virtual/_commonjsHelpers.js +25 -3
- package/dist/esm/_virtual/arrows.js +4 -0
- package/dist/esm/_virtual/default-props.js +4 -0
- package/dist/esm/_virtual/dots.js +4 -0
- package/dist/esm/_virtual/index2.js +7 -0
- package/dist/esm/_virtual/index3.js +4 -0
- package/dist/esm/_virtual/index4.js +4 -0
- package/dist/esm/_virtual/initial-state.js +4 -0
- package/dist/esm/_virtual/inner-slider.js +4 -0
- package/dist/esm/_virtual/innerSliderUtils.js +4 -0
- package/dist/esm/_virtual/slider.js +4 -0
- package/dist/esm/_virtual/track.js +4 -0
- package/dist/esm/components/address/address.js +21 -0
- package/dist/esm/components/address/index.js +4 -0
- package/dist/esm/components/alert-modal/alert-modal.js +32 -0
- package/dist/esm/components/alert-modal/index.js +4 -0
- package/dist/esm/components/apy/apy.js +32 -0
- package/dist/esm/components/apy/index.js +4 -0
- package/dist/esm/components/arc-loader/arc-loader.js +45 -0
- package/dist/esm/components/arc-loader/index.js +4 -0
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +60 -30
- package/dist/esm/components/button-checkbox/button-checkbox.js +53 -0
- package/dist/esm/components/button-checkbox/index.js +4 -0
- package/dist/esm/components/carousel/carousel.js +65 -0
- package/dist/esm/components/carousel/index.js +4 -0
- package/dist/esm/components/complex-input/complex-input.js +85 -0
- package/dist/esm/components/complex-input/index.js +4 -0
- package/dist/esm/components/compound-apy/compound-apy.js +91 -74
- package/dist/esm/components/confirm-menu/confirm-menu.js +31 -0
- package/dist/esm/components/confirm-menu/index.js +4 -0
- package/dist/esm/components/currency-button/currency-button.js +84 -0
- package/dist/esm/components/currency-button/index.js +4 -0
- package/dist/esm/components/detailed-apy/detailed-apy.js +73 -0
- package/dist/esm/components/detailed-apy/index.js +4 -0
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +11 -11
- package/dist/esm/components/dropdown-label/dropdown-label.js +44 -0
- package/dist/esm/components/dropdown-label/index.js +4 -0
- package/dist/esm/components/edit-input/edit-input.js +96 -0
- package/dist/esm/components/edit-input/index.js +4 -0
- package/dist/esm/components/explorer-links-dropdown/explorer-links-dropdown.js +80 -0
- package/dist/esm/components/explorer-links-dropdown/index.js +4 -0
- package/dist/esm/components/filter/filter-block.js +14 -11
- package/dist/esm/components/filter/filter-dropdown-item.js +47 -17
- package/dist/esm/components/filter/filter-modal-item.js +53 -18
- package/dist/esm/components/formatted-number/formatted-number.js +15 -0
- package/dist/esm/components/formatted-number/index.js +4 -0
- package/dist/esm/components/general-asset-list/general-asset-list.js +42 -0
- package/dist/esm/components/general-asset-list/index.js +4 -0
- package/dist/esm/components/graph/formatters.js +1 -1
- package/dist/esm/components/graph/graph-current-value.js +14 -13
- package/dist/esm/components/graph/graph-tooltip.js +36 -35
- package/dist/esm/components/graph/graph-view.js +97 -84
- package/dist/esm/components/graph/graph.js +124 -111
- package/dist/esm/components/grid-td-cell/grid-td-cell.js +11 -0
- package/dist/esm/components/grid-td-cell/index.js +4 -0
- package/dist/esm/components/help-sections/help-sections.js +18 -0
- package/dist/esm/components/help-sections/index.js +5 -0
- package/dist/esm/components/hide-on/hide-on.js +50 -26
- package/dist/esm/components/index.js +530 -468
- package/dist/esm/components/layout/col/col.js +4 -4
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +71 -68
- package/dist/esm/components/navbar-logo/index.js +4 -0
- package/dist/esm/components/navbar-logo/navbar-logo.js +30 -0
- package/dist/esm/components/network-icon/index.js +4 -0
- package/dist/esm/components/network-icon/network-icon.js +48 -0
- package/dist/esm/components/overflow/index.js +5 -0
- package/dist/esm/components/overflow/overflow.js +20 -0
- package/dist/esm/components/overflow-container/index.js +4 -0
- package/dist/esm/components/overflow-container/overflow-container.js +38 -0
- package/dist/esm/components/pool-apy-tooltip/index.js +4 -0
- package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +83 -0
- package/dist/esm/components/pool-indicator-icon/index.js +4 -0
- package/dist/esm/components/pool-indicator-icon/pool-indicator-icon.js +25 -0
- package/dist/esm/components/rounded-image/index.js +4 -0
- package/dist/esm/components/rounded-image/rounded-image.js +32 -0
- package/dist/esm/components/row/index.js +4 -0
- package/dist/esm/components/row/row.js +55 -0
- package/dist/esm/components/segmented-control/segmented-control.js +64 -63
- package/dist/esm/components/slider/slider.js +123 -41
- package/dist/esm/components/slider-token/index.js +4 -0
- package/dist/esm/components/slider-token/slider-token.js +68 -0
- package/dist/esm/components/smart-number-input/smart-number-input.js +113 -67
- package/dist/esm/components/split-list/index.js +4 -0
- package/dist/esm/components/split-list/split-list.js +39 -0
- package/dist/esm/components/stat-badge/stat-badge.js +63 -53
- package/dist/esm/components/status-triangle/status-triangle.js +20 -13
- package/dist/esm/components/styled-dropdown/index.js +4 -0
- package/dist/esm/components/styled-dropdown/styled-dropdown.js +106 -0
- package/dist/esm/components/table/grid-table.js +132 -92
- package/dist/esm/components/text-button/index.js +4 -0
- package/dist/esm/components/text-button/text-button.js +55 -0
- package/dist/esm/components/time-to-liquidation/index.js +4 -0
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +45 -0
- package/dist/esm/components/tokens-list-cell/index.js +4 -0
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +72 -0
- package/dist/esm/components/trading-view/trading-view.js +30 -28
- package/dist/esm/components/with-filter-button/with-filter-button.js +53 -44
- package/dist/esm/components/with-title/index.js +4 -0
- package/dist/esm/components/with-title/with-title.js +30 -0
- package/dist/esm/hooks/index.js +42 -39
- package/dist/esm/hooks/use-debounce-call.js +17 -0
- package/dist/esm/hooks/use-debounce.js +14 -25
- package/dist/esm/hooks/use-pool-points-tips.js +17 -0
- package/dist/esm/index.js +660 -575
- package/dist/esm/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +42 -0
- package/dist/esm/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/MediaQuery.js +71 -0
- package/dist/esm/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/MediaQueryDispatch.js +46 -0
- package/dist/esm/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/QueryHandler.js +57 -0
- package/dist/esm/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/Util.js +24 -0
- package/dist/esm/node_modules/.pnpm/enquire.js@2.1.6/node_modules/enquire.js/src/index.js +11 -0
- package/dist/esm/node_modules/.pnpm/json2mq@0.2.0/node_modules/json2mq/index.js +25 -0
- package/dist/esm/node_modules/.pnpm/lodash.debounce@4.0.8/node_modules/lodash.debounce/index.js +85 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/arrows.js +216 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/default-props.js +80 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/dots.js +176 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/index.js +18 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/initial-state.js +44 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/inner-slider.js +549 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/slider.js +261 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/track.js +240 -0
- package/dist/esm/node_modules/.pnpm/react-slick@0.30.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-slick/lib/utils/innerSliderUtils.js +385 -0
- package/dist/esm/node_modules/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +290 -0
- package/dist/esm/node_modules/.pnpm/string-convert@0.2.1/node_modules/string-convert/camel2hyphen.js +14 -0
- package/dist/esm/utils/bn-to-pretty-view.js +6 -0
- package/dist/esm/utils/format-money.js +41 -24
- package/dist/esm/utils/index.js +73 -51
- package/dist/esm/utils/network-icons.js +56 -0
- package/dist/esm/utils/parse-input-to-bn.js +20 -0
- package/dist/esm/utils/plural.js +11 -0
- package/dist/esm/utils/ranges.js +24 -0
- package/dist/esm/utils/search.js +6 -0
- package/dist/esm/utils/shorten-string.js +6 -0
- package/dist/esm/utils/ttl.js +13 -3
- package/dist/esm/utils/window.js +6 -0
- package/dist/globals.css +1 -1
- package/dist/permissionless-ui.css +1 -0
- package/dist/types/components/address/address.d.ts +56 -0
- package/dist/types/components/address/index.d.ts +1 -0
- package/dist/types/components/alert-modal/alert-modal.d.ts +78 -0
- package/dist/types/components/alert-modal/index.d.ts +1 -0
- package/dist/types/components/apy/apy.d.ts +35 -0
- package/dist/types/components/apy/index.d.ts +1 -0
- package/dist/types/components/arc-loader/arc-loader.d.ts +31 -0
- package/dist/types/components/arc-loader/index.d.ts +1 -0
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +40 -3
- package/dist/types/components/button-checkbox/button-checkbox.d.ts +39 -0
- package/dist/types/components/button-checkbox/index.d.ts +1 -0
- package/dist/types/components/card-grid/card-grid.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +30 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/colored-text/colored-text.d.ts +1 -1
- package/dist/types/components/complex-input/complex-input.d.ts +78 -0
- package/dist/types/components/complex-input/index.d.ts +1 -0
- package/dist/types/components/compound-apy/compound-apy.d.ts +38 -2
- package/dist/types/components/confirm-menu/confirm-menu.d.ts +27 -0
- package/dist/types/components/confirm-menu/index.d.ts +1 -0
- package/dist/types/components/currency-button/currency-button.d.ts +79 -0
- package/dist/types/components/currency-button/index.d.ts +1 -0
- package/dist/types/components/detailed-apy/detailed-apy.d.ts +54 -0
- package/dist/types/components/detailed-apy/index.d.ts +1 -0
- package/dist/types/components/detailed-page-title/detailed-page-title.d.ts +3 -5
- package/dist/types/components/dropdown-label/dropdown-label.d.ts +47 -0
- package/dist/types/components/dropdown-label/index.d.ts +1 -0
- package/dist/types/components/edit-input/edit-input.d.ts +55 -0
- package/dist/types/components/edit-input/index.d.ts +1 -0
- package/dist/types/components/explorer-links-dropdown/explorer-links-dropdown.d.ts +82 -0
- package/dist/types/components/explorer-links-dropdown/index.d.ts +1 -0
- package/dist/types/components/filter/filter-block.d.ts +22 -0
- package/dist/types/components/filter/filter-dropdown-item.d.ts +40 -2
- package/dist/types/components/filter/filter-modal-item.d.ts +26 -2
- package/dist/types/components/formatted-number/formatted-number.d.ts +11 -0
- package/dist/types/components/formatted-number/index.d.ts +1 -0
- package/dist/types/components/general-asset-list/general-asset-list.d.ts +59 -0
- package/dist/types/components/general-asset-list/index.d.ts +1 -0
- package/dist/types/components/graph/formatters.d.ts +1 -1
- package/dist/types/components/graph/graph-current-value.d.ts +6 -1
- package/dist/types/components/graph/graph-tooltip.d.ts +6 -1
- package/dist/types/components/graph/graph-view.d.ts +19 -3
- package/dist/types/components/graph/graph.d.ts +6 -1
- package/dist/types/components/grid-td-cell/grid-td-cell.d.ts +8 -0
- package/dist/types/components/grid-td-cell/index.d.ts +1 -0
- package/dist/types/components/help-sections/help-sections.d.ts +33 -0
- package/dist/types/components/help-sections/index.d.ts +1 -0
- package/dist/types/components/hide-on/hide-on.d.ts +61 -12
- package/dist/types/components/index.d.ts +30 -0
- package/dist/types/components/layout/col/col.d.ts +1 -1
- package/dist/types/components/markdown-viewer/markdown-viewer.d.ts +4 -1
- package/dist/types/components/navbar-logo/index.d.ts +1 -0
- package/dist/types/components/navbar-logo/navbar-logo.d.ts +11 -0
- package/dist/types/components/network-icon/index.d.ts +2 -0
- package/dist/types/components/network-icon/network-icon.d.ts +21 -0
- package/dist/types/components/overflow/index.d.ts +1 -0
- package/dist/types/components/overflow/overflow.d.ts +19 -0
- package/dist/types/components/overflow-container/index.d.ts +1 -0
- package/dist/types/components/overflow-container/overflow-container.d.ts +47 -0
- package/dist/types/components/pool-apy-tooltip/index.d.ts +1 -0
- package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +59 -0
- package/dist/types/components/pool-indicator-icon/index.d.ts +1 -0
- package/dist/types/components/pool-indicator-icon/pool-indicator-icon.d.ts +20 -0
- package/dist/types/components/rounded-image/index.d.ts +1 -0
- package/dist/types/components/rounded-image/rounded-image.d.ts +11 -0
- package/dist/types/components/row/index.d.ts +1 -0
- package/dist/types/components/row/row.d.ts +59 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +49 -32
- package/dist/types/components/skeleton/skeleton.d.ts +1 -1
- package/dist/types/components/slider/slider.d.ts +66 -2
- package/dist/types/components/slider-token/index.d.ts +1 -0
- package/dist/types/components/slider-token/slider-token.d.ts +70 -0
- package/dist/types/components/smart-number-input/smart-number-input.d.ts +70 -8
- package/dist/types/components/split-list/index.d.ts +1 -0
- package/dist/types/components/split-list/split-list.d.ts +37 -0
- package/dist/types/components/stat-badge/stat-badge.d.ts +17 -3
- package/dist/types/components/status-triangle/status-triangle.d.ts +11 -4
- package/dist/types/components/styled-dropdown/index.d.ts +1 -0
- package/dist/types/components/styled-dropdown/styled-dropdown.d.ts +95 -0
- package/dist/types/components/table/grid-table.d.ts +13 -1
- package/dist/types/components/text-button/index.d.ts +1 -0
- package/dist/types/components/text-button/text-button.d.ts +48 -0
- package/dist/types/components/time-to-liquidation/index.d.ts +1 -0
- package/dist/types/components/time-to-liquidation/time-to-liquidation.d.ts +20 -0
- package/dist/types/components/tokens-list-cell/index.d.ts +1 -0
- package/dist/types/components/tokens-list-cell/tokens-list-cell.d.ts +92 -0
- package/dist/types/components/trading-view/trading-view.d.ts +6 -1
- package/dist/types/components/typed-intl/index.d.ts +2 -0
- package/dist/types/components/vertical-indicator/vertical-indicator.d.ts +1 -1
- package/dist/types/components/with-filter-button/with-filter-button.d.ts +30 -1
- package/dist/types/components/with-title/index.d.ts +1 -0
- package/dist/types/components/with-title/with-title.d.ts +31 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/use-debounce-call.d.ts +19 -0
- package/dist/types/hooks/use-debounce.d.ts +0 -14
- package/dist/types/hooks/use-pool-points-tips.d.ts +40 -0
- package/dist/types/index.d.ts +29 -0
- package/dist/types/types/graph.d.ts +3 -1
- package/dist/types/utils/bn-to-pretty-view.d.ts +15 -0
- package/dist/types/utils/format-money.d.ts +16 -0
- package/dist/types/utils/index.d.ts +9 -1
- package/dist/types/utils/network-icons.d.ts +47 -0
- package/dist/types/utils/parse-input-to-bn.d.ts +16 -0
- package/dist/types/utils/plural.d.ts +36 -0
- package/dist/types/utils/ranges.d.ts +17 -0
- package/dist/types/utils/search.d.ts +15 -0
- package/dist/types/utils/shorten-string.d.ts +15 -0
- package/dist/types/utils/ttl.d.ts +24 -0
- package/dist/types/utils/window.d.ts +15 -0
- package/package.json +8 -3
- package/src/styles/theme.css +85 -0
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cva as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cva as k } from "class-variance-authority";
|
|
3
|
+
import * as z from "react";
|
|
4
4
|
import { cn as s } from "../../utils/cn.js";
|
|
5
5
|
import "sonner";
|
|
6
6
|
import "@gearbox-protocol/sdk";
|
|
7
|
-
const
|
|
7
|
+
const C = k(
|
|
8
8
|
"relative flex flex-row flex-nowrap items-center bg-muted rounded-md",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
12
12
|
xs: "h-6 text-[10px]",
|
|
13
13
|
sm: "h-7 text-xs",
|
|
14
|
+
md: "h-10 text-sm",
|
|
14
15
|
default: "h-8 text-xs sm:h-10 sm:text-sm",
|
|
15
16
|
lg: "h-10 text-sm sm:h-12 sm:text-base"
|
|
16
17
|
},
|
|
@@ -20,79 +21,79 @@ const v = w(
|
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
defaultVariants: {
|
|
23
|
-
size: "
|
|
24
|
+
size: "md",
|
|
24
25
|
fullWidth: !0
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
),
|
|
28
|
-
({
|
|
29
|
-
|
|
30
|
-
name: i,
|
|
31
|
-
items: r,
|
|
32
|
-
value: a,
|
|
33
|
-
size: u = "default",
|
|
34
|
-
fullWidth: o = !0,
|
|
35
|
-
minItemWidth: d,
|
|
36
|
-
onChange: m,
|
|
37
|
-
...x
|
|
38
|
-
}, p) => {
|
|
39
|
-
const t = r.findIndex((e) => e.value === a), l = r.length, h = {
|
|
28
|
+
), N = z.forwardRef(
|
|
29
|
+
({ className: u, name: h, items: a, size: m, fullWidth: f, minItemWidth: d, ...x }, p) => {
|
|
30
|
+
const n = m ?? "md", o = f ?? !0, t = a.findIndex((e) => e.checked), l = a.length, g = {
|
|
40
31
|
xs: "rounded-sm",
|
|
41
32
|
sm: "rounded-sm",
|
|
33
|
+
md: "rounded-md",
|
|
42
34
|
default: "rounded-md",
|
|
43
35
|
lg: "rounded-md"
|
|
44
36
|
}, b = d ? { minWidth: d, flex: "0 0 auto" } : {};
|
|
45
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ i(
|
|
46
38
|
"div",
|
|
47
39
|
{
|
|
48
40
|
ref: p,
|
|
49
|
-
className: s(
|
|
41
|
+
className: s(
|
|
42
|
+
C({
|
|
43
|
+
size: n,
|
|
44
|
+
fullWidth: o
|
|
45
|
+
}),
|
|
46
|
+
u
|
|
47
|
+
),
|
|
50
48
|
...x,
|
|
51
49
|
children: [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"data-checked": e.value === a,
|
|
62
|
-
"data-disabled": e.disabled,
|
|
63
|
-
children: [
|
|
64
|
-
/* @__PURE__ */ n(
|
|
65
|
-
"input",
|
|
66
|
-
{
|
|
67
|
-
type: "radio",
|
|
68
|
-
name: i,
|
|
69
|
-
value: e.value,
|
|
70
|
-
checked: e.value === a,
|
|
71
|
-
disabled: e.disabled,
|
|
72
|
-
onChange: () => m?.(e.value),
|
|
73
|
-
className: "absolute h-0 w-0 opacity-0 cursor-pointer"
|
|
74
|
-
}
|
|
50
|
+
a.map((e, w) => {
|
|
51
|
+
const v = e.switchLabel ?? e.label, y = e.onChange ?? e.onSelect, c = typeof e.value == "string" ? e.value : void 0;
|
|
52
|
+
return /* @__PURE__ */ i(
|
|
53
|
+
"label",
|
|
54
|
+
{
|
|
55
|
+
className: s(
|
|
56
|
+
"relative z-10 m-0 p-0 flex h-full cursor-pointer select-none",
|
|
57
|
+
o ? "flex-1" : "shrink-0",
|
|
58
|
+
e.disabled && "cursor-not-allowed opacity-50"
|
|
75
59
|
),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
60
|
+
style: b,
|
|
61
|
+
"data-checked": e.checked,
|
|
62
|
+
"data-disabled": e.disabled,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ r(
|
|
65
|
+
"input",
|
|
66
|
+
{
|
|
67
|
+
type: "radio",
|
|
68
|
+
name: h,
|
|
69
|
+
value: c,
|
|
70
|
+
checked: e.checked,
|
|
71
|
+
disabled: e.disabled,
|
|
72
|
+
onChange: y,
|
|
73
|
+
className: "absolute h-0 w-0 opacity-0 cursor-pointer"
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ r(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
className: s(
|
|
80
|
+
"flex h-full w-full items-center justify-center px-2 sm:px-3 whitespace-nowrap",
|
|
81
|
+
e.checked ? "text-foreground" : "text-muted-foreground"
|
|
82
|
+
),
|
|
83
|
+
children: v
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
c ?? w
|
|
89
|
+
);
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ r(
|
|
91
92
|
"div",
|
|
92
93
|
{
|
|
93
94
|
className: s(
|
|
94
|
-
"absolute z-0 h-full bg-
|
|
95
|
-
|
|
95
|
+
"absolute z-0 h-full bg-gray-600 shadow transition-all duration-200 ease-in-out",
|
|
96
|
+
g[n]
|
|
96
97
|
),
|
|
97
98
|
style: o ? {
|
|
98
99
|
width: l > 0 ? `${100 / l}%` : "0%",
|
|
@@ -108,8 +109,8 @@ const v = w(
|
|
|
108
109
|
);
|
|
109
110
|
}
|
|
110
111
|
);
|
|
111
|
-
|
|
112
|
+
N.displayName = "SegmentedControl";
|
|
112
113
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
N as SegmentedControl,
|
|
115
|
+
C as segmentedControlVariants
|
|
115
116
|
};
|
|
@@ -1,48 +1,130 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { cn as
|
|
1
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "@radix-ui/react-slider";
|
|
3
|
+
import * as D from "react";
|
|
4
|
+
import { useMemo as v } from "react";
|
|
5
|
+
import { cn as x } from "../../utils/cn.js";
|
|
6
6
|
import "sonner";
|
|
7
7
|
import "@gearbox-protocol/sdk";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
function A(r) {
|
|
9
|
+
return {
|
|
10
|
+
start: r.start ?? r.from ?? 0,
|
|
11
|
+
end: r.end ?? r.to ?? 0
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function E(r, a) {
|
|
15
|
+
if (a)
|
|
16
|
+
for (const o of a) {
|
|
17
|
+
const { start: c, end: f } = A(o);
|
|
18
|
+
if (r >= c && r <= f)
|
|
19
|
+
return o.color;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const G = D.forwardRef(
|
|
23
|
+
({
|
|
24
|
+
className: r,
|
|
25
|
+
variant: a = "default",
|
|
26
|
+
// New API
|
|
27
|
+
value: o,
|
|
28
|
+
onValueChange: c,
|
|
29
|
+
min: f,
|
|
30
|
+
max: k,
|
|
31
|
+
step: R,
|
|
32
|
+
// Legacy API
|
|
33
|
+
from: M,
|
|
34
|
+
to: V,
|
|
35
|
+
colorIntervals: p,
|
|
36
|
+
precision: u,
|
|
37
|
+
markerStep: d,
|
|
38
|
+
onChangeValue: y,
|
|
39
|
+
onSubmitValue: w,
|
|
40
|
+
...j
|
|
41
|
+
}, T) => {
|
|
42
|
+
const n = f ?? M ?? 0, s = k ?? V ?? 100, N = Array.isArray(u) ? u[0] : u, B = R ?? (N ? 10 ** -N : 1), m = v(() => {
|
|
43
|
+
if (Array.isArray(o)) return o;
|
|
44
|
+
if (typeof o == "number") return [o];
|
|
45
|
+
}, [o]), F = (e) => {
|
|
46
|
+
c?.(e), y && e.length > 0 && y(e[0]);
|
|
47
|
+
}, K = (e) => {
|
|
48
|
+
w && e.length > 0 && w(e[0]);
|
|
49
|
+
}, P = m?.[0] ?? 0, S = E(P, p), C = (m ?? [0]).length, _ = v(
|
|
50
|
+
() => Array.from({ length: C }, (e, t) => `thumb-${t}`),
|
|
51
|
+
[C]
|
|
52
|
+
), h = v(() => {
|
|
53
|
+
if (!d) return;
|
|
54
|
+
const e = [];
|
|
55
|
+
for (let t = n; t <= s; t += d)
|
|
56
|
+
e.push(t);
|
|
57
|
+
return e;
|
|
58
|
+
}, [n, s, d]);
|
|
59
|
+
return /* @__PURE__ */ g("div", { className: "relative w-full", children: [
|
|
60
|
+
/* @__PURE__ */ g(
|
|
61
|
+
l.Root,
|
|
62
|
+
{
|
|
63
|
+
ref: T,
|
|
64
|
+
className: x(
|
|
65
|
+
"relative flex w-full touch-none select-none items-center",
|
|
66
|
+
r
|
|
67
|
+
),
|
|
68
|
+
min: n,
|
|
69
|
+
max: s,
|
|
70
|
+
step: B,
|
|
71
|
+
value: m,
|
|
72
|
+
onValueChange: F,
|
|
73
|
+
onValueCommit: K,
|
|
74
|
+
...j,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ g(l.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: [
|
|
77
|
+
p?.map((e, t) => {
|
|
78
|
+
const { start: b, end: $ } = A(e), q = (b - n) / (s - n) * 100, z = ($ - b) / (s - n) * 100;
|
|
79
|
+
return /* @__PURE__ */ i(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: "absolute h-full",
|
|
83
|
+
style: {
|
|
84
|
+
left: `${q}%`,
|
|
85
|
+
width: `${z}%`,
|
|
86
|
+
backgroundColor: e.color ?? "var(--primary)",
|
|
87
|
+
opacity: 0.3
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
`interval-${t}-${b}-${$}`
|
|
91
|
+
);
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ i(
|
|
94
|
+
l.Range,
|
|
95
|
+
{
|
|
96
|
+
className: x("absolute h-full"),
|
|
97
|
+
style: {
|
|
98
|
+
backgroundColor: S ?? void 0
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }),
|
|
103
|
+
_.map((e) => /* @__PURE__ */ i(
|
|
104
|
+
l.Thumb,
|
|
105
|
+
{
|
|
106
|
+
className: "block h-5 w-5 rounded-full border-2 border-primary bg-background shadow-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab active:cursor-grabbing hover:bg-accent"
|
|
107
|
+
},
|
|
108
|
+
e
|
|
109
|
+
))
|
|
110
|
+
]
|
|
111
|
+
}
|
|
25
112
|
),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
className: i("absolute h-full", c[n])
|
|
32
|
-
}
|
|
33
|
-
) }),
|
|
34
|
-
u.map((a) => /* @__PURE__ */ o(
|
|
35
|
-
e.Thumb,
|
|
113
|
+
h && h.length > 0 && /* @__PURE__ */ i("div", { className: "relative w-full h-2 mt-1", children: h.map((e) => {
|
|
114
|
+
const t = (e - n) / (s - n) * 100;
|
|
115
|
+
return /* @__PURE__ */ i(
|
|
116
|
+
"div",
|
|
36
117
|
{
|
|
37
|
-
className: "
|
|
118
|
+
className: "absolute w-0.5 h-1 bg-muted-foreground/50",
|
|
119
|
+
style: { left: `${t}%` }
|
|
38
120
|
},
|
|
39
|
-
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
121
|
+
`mark-${e}`
|
|
122
|
+
);
|
|
123
|
+
}) })
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
G.displayName = "Slider";
|
|
46
128
|
export {
|
|
47
|
-
|
|
129
|
+
G as Slider
|
|
48
130
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Slider as b } from "../slider/slider.js";
|
|
3
|
+
import { TokenSymbol as v } from "../token-symbol/token-symbol.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { cn as N } from "../../utils/cn.js";
|
|
6
|
+
import "sonner";
|
|
7
|
+
import "@gearbox-protocol/sdk";
|
|
8
|
+
function z({
|
|
9
|
+
from: s = 0,
|
|
10
|
+
to: r = 100,
|
|
11
|
+
value: m = 0,
|
|
12
|
+
token: c,
|
|
13
|
+
step: p = 1,
|
|
14
|
+
setValue: h,
|
|
15
|
+
additionalMarkers: t,
|
|
16
|
+
additionalMarkersLabels: x,
|
|
17
|
+
epsilon_inPer: i,
|
|
18
|
+
children: f,
|
|
19
|
+
className: u
|
|
20
|
+
}) {
|
|
21
|
+
const d = (e) => {
|
|
22
|
+
let n = e[0];
|
|
23
|
+
if (i && t) {
|
|
24
|
+
const g = (r - s) * i / 100;
|
|
25
|
+
for (const a of t)
|
|
26
|
+
if (Math.abs(n - a) <= g) {
|
|
27
|
+
n = a;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
h?.(n);
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ l("div", { className: N("space-y-2", u), children: [
|
|
34
|
+
c && /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
35
|
+
/* @__PURE__ */ o(v, { token: c, size: 20, showSymbol: !0 }),
|
|
36
|
+
/* @__PURE__ */ l("span", { className: "text-sm text-muted-foreground", children: [
|
|
37
|
+
m.toFixed(2),
|
|
38
|
+
"%"
|
|
39
|
+
] })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ o(
|
|
42
|
+
b,
|
|
43
|
+
{
|
|
44
|
+
min: s,
|
|
45
|
+
max: r,
|
|
46
|
+
step: p,
|
|
47
|
+
value: [m],
|
|
48
|
+
onValueChange: d
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
t && t.length > 0 && /* @__PURE__ */ o("div", { className: "relative h-4", children: t.map((e) => {
|
|
52
|
+
const n = (e - s) / (r - s) * 100;
|
|
53
|
+
return /* @__PURE__ */ o(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "absolute transform -translate-x-1/2 text-xs text-muted-foreground",
|
|
57
|
+
style: { left: `${n}%` },
|
|
58
|
+
children: x?.[e] ?? `${e}%`
|
|
59
|
+
},
|
|
60
|
+
e
|
|
61
|
+
);
|
|
62
|
+
}) }),
|
|
63
|
+
f
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
z as SliderToken
|
|
68
|
+
};
|
|
@@ -1,91 +1,135 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { X as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsx as s, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { X as G } from "lucide-react";
|
|
3
|
+
import * as H from "react";
|
|
4
4
|
import "../buttons/back-button/back-button.js";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as J } from "../buttons/button/button.js";
|
|
6
6
|
import "../buttons/copy-button/copy-button.js";
|
|
7
7
|
import "../buttons/external-button/external-button.js";
|
|
8
8
|
import "../buttons/filter-button/filter-button.js";
|
|
9
9
|
import "../buttons/navigation-button/navigation-button.js";
|
|
10
|
-
import { cn as
|
|
10
|
+
import { cn as g } from "../../utils/cn.js";
|
|
11
11
|
import "sonner";
|
|
12
12
|
import "@gearbox-protocol/sdk";
|
|
13
13
|
import "../buttons/tab-button/tab-button.js";
|
|
14
|
-
|
|
14
|
+
import { TokenIcon as K } from "../token-icon/token-icon.js";
|
|
15
|
+
function Q(o, r) {
|
|
16
|
+
let t = o.replace(/^0+(?=\d)/, "");
|
|
17
|
+
if ((t === "" || t === ".") && (t = "0"), !/^[0-9]*\.?[0-9]*$/.test(t))
|
|
18
|
+
return [null, null];
|
|
19
|
+
try {
|
|
20
|
+
const e = t.split("."), l = e[0] || "0", p = (e[1] || "").slice(0, r).padEnd(r, "0");
|
|
21
|
+
return [BigInt(l + p), t];
|
|
22
|
+
} catch {
|
|
23
|
+
return [null, null];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function T(o, r) {
|
|
27
|
+
const t = o.toString().padStart(r + 1, "0"), e = t.slice(0, -r) || "0", l = t.slice(-r).replace(/0+$/, "");
|
|
28
|
+
return l ? `${e}.${l}` : e;
|
|
29
|
+
}
|
|
30
|
+
function U(o, r) {
|
|
31
|
+
const t = T(o, r), e = Number.parseFloat(t);
|
|
32
|
+
return e === 0 ? "0" : e < 1e-4 ? "< 0.0001" : e.toLocaleString(void 0, { maximumFractionDigits: 4 });
|
|
33
|
+
}
|
|
34
|
+
const W = H.forwardRef(
|
|
15
35
|
({
|
|
16
|
-
amount:
|
|
17
|
-
tokenSymbol:
|
|
18
|
-
tokenIcon:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
amount: o,
|
|
37
|
+
tokenSymbol: r,
|
|
38
|
+
tokenIcon: t,
|
|
39
|
+
token: e,
|
|
40
|
+
label: l = "Amount",
|
|
41
|
+
maxBalance: p,
|
|
42
|
+
maxAmount: n,
|
|
43
|
+
maxAmountLimit: m,
|
|
44
|
+
maxButtonLabel: $ = "Max",
|
|
45
|
+
showMaxButton: j,
|
|
46
|
+
maxButton: M,
|
|
47
|
+
chainId: Y,
|
|
48
|
+
network: Z,
|
|
49
|
+
disabled: a = !1,
|
|
50
|
+
active: y = !1,
|
|
51
|
+
size: N = "default",
|
|
52
|
+
onAmountChange: b,
|
|
53
|
+
onSetAmount: c,
|
|
54
|
+
onMaxClick: h,
|
|
55
|
+
onTokenSelect: P,
|
|
56
|
+
onShowSelectDialog: S,
|
|
57
|
+
onRemove: w,
|
|
58
|
+
onFocus: z,
|
|
59
|
+
onBlur: F,
|
|
60
|
+
className: V
|
|
61
|
+
}, _) => {
|
|
62
|
+
const D = j ?? M ?? !0, x = r ?? e?.symbol, I = t ?? (e?.symbol ? /* @__PURE__ */ s(K, { symbol: e.symbol, size: 24 }) : void 0), v = e?.decimals ?? 18, B = p ?? (n !== void 0 ? U(n, v) : void 0), f = P ?? S, E = {
|
|
33
63
|
sm: "p-3",
|
|
64
|
+
md: "p-3.5",
|
|
34
65
|
default: "p-4",
|
|
35
66
|
lg: "p-5"
|
|
36
|
-
},
|
|
67
|
+
}, O = {
|
|
37
68
|
sm: "text-lg",
|
|
69
|
+
md: "text-xl",
|
|
38
70
|
default: "text-2xl",
|
|
39
71
|
lg: "text-3xl"
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
(
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
}, R = (u) => {
|
|
73
|
+
const i = u.target.value;
|
|
74
|
+
if (!(!/^[0-9]*\.?[0-9]*$/.test(i) && i !== "") && (b && b(i), c)) {
|
|
75
|
+
const [C, k] = Q(i, v);
|
|
76
|
+
C !== null && k !== null && c(C, k);
|
|
77
|
+
}
|
|
78
|
+
}, X = () => {
|
|
79
|
+
if (h) {
|
|
80
|
+
h();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (c && n !== void 0) {
|
|
84
|
+
const u = n && m && n > m ? m : n, i = T(u, v);
|
|
85
|
+
c(u, i);
|
|
86
|
+
}
|
|
87
|
+
}, q = D && (h || c && n !== void 0);
|
|
88
|
+
return /* @__PURE__ */ d(
|
|
45
89
|
"div",
|
|
46
90
|
{
|
|
47
|
-
ref:
|
|
48
|
-
className:
|
|
91
|
+
ref: _,
|
|
92
|
+
className: g(
|
|
49
93
|
"relative rounded-xl border bg-card transition-colors border-border",
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
94
|
+
y && "border-primary",
|
|
95
|
+
a && "opacity-50 cursor-not-allowed",
|
|
96
|
+
E[N],
|
|
97
|
+
V
|
|
54
98
|
),
|
|
55
|
-
"data-active":
|
|
56
|
-
"data-disabled":
|
|
99
|
+
"data-active": y,
|
|
100
|
+
"data-disabled": a,
|
|
57
101
|
children: [
|
|
58
|
-
|
|
102
|
+
w && /* @__PURE__ */ s(
|
|
59
103
|
"button",
|
|
60
104
|
{
|
|
61
105
|
type: "button",
|
|
62
|
-
onClick:
|
|
106
|
+
onClick: w,
|
|
63
107
|
className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",
|
|
64
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ s(G, { className: "h-3 w-3" })
|
|
65
109
|
}
|
|
66
110
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-2", children: [
|
|
112
|
+
/* @__PURE__ */ s("span", { className: "text-sm text-muted-foreground", children: l }),
|
|
113
|
+
B !== void 0 && /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
114
|
+
/* @__PURE__ */ d("span", { className: "text-sm text-muted-foreground", children: [
|
|
71
115
|
"Balance: ",
|
|
72
|
-
|
|
116
|
+
B
|
|
73
117
|
] }),
|
|
74
|
-
|
|
75
|
-
|
|
118
|
+
q && /* @__PURE__ */ s(
|
|
119
|
+
J,
|
|
76
120
|
{
|
|
77
121
|
variant: "ghost",
|
|
78
122
|
size: "xs",
|
|
79
|
-
onClick:
|
|
80
|
-
disabled:
|
|
123
|
+
onClick: X,
|
|
124
|
+
disabled: a,
|
|
81
125
|
className: "text-primary hover:text-primary/80",
|
|
82
|
-
children:
|
|
126
|
+
children: $
|
|
83
127
|
}
|
|
84
128
|
)
|
|
85
129
|
] })
|
|
86
130
|
] }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
|
|
132
|
+
/* @__PURE__ */ s(
|
|
89
133
|
"input",
|
|
90
134
|
{
|
|
91
135
|
type: "text",
|
|
@@ -95,29 +139,31 @@ const B = z.forwardRef(
|
|
|
95
139
|
spellCheck: "false",
|
|
96
140
|
pattern: "^[0-9]*[.,]?[0-9]*$",
|
|
97
141
|
placeholder: "0",
|
|
98
|
-
value:
|
|
99
|
-
onChange:
|
|
100
|
-
|
|
101
|
-
|
|
142
|
+
value: o,
|
|
143
|
+
onChange: R,
|
|
144
|
+
onFocus: z,
|
|
145
|
+
onBlur: F,
|
|
146
|
+
disabled: a || !b && !c,
|
|
147
|
+
className: g(
|
|
102
148
|
"flex-1 bg-transparent border-none outline-none text-foreground font-medium placeholder:text-muted-foreground",
|
|
103
|
-
|
|
149
|
+
O[N]
|
|
104
150
|
)
|
|
105
151
|
}
|
|
106
152
|
),
|
|
107
|
-
(
|
|
153
|
+
(x || I) && /* @__PURE__ */ d(
|
|
108
154
|
"button",
|
|
109
155
|
{
|
|
110
156
|
type: "button",
|
|
111
|
-
onClick:
|
|
112
|
-
disabled:
|
|
113
|
-
className:
|
|
157
|
+
onClick: f,
|
|
158
|
+
disabled: a || !f,
|
|
159
|
+
className: g(
|
|
114
160
|
"flex items-center gap-2 rounded-full bg-secondary px-3 py-1.5 text-sm font-medium transition-colors",
|
|
115
|
-
|
|
116
|
-
!
|
|
161
|
+
f && !a && "hover:bg-secondary/80 cursor-pointer",
|
|
162
|
+
!f && "cursor-default"
|
|
117
163
|
),
|
|
118
164
|
children: [
|
|
119
|
-
|
|
120
|
-
|
|
165
|
+
I,
|
|
166
|
+
x && /* @__PURE__ */ s("span", { children: x })
|
|
121
167
|
]
|
|
122
168
|
}
|
|
123
169
|
)
|
|
@@ -127,7 +173,7 @@ const B = z.forwardRef(
|
|
|
127
173
|
);
|
|
128
174
|
}
|
|
129
175
|
);
|
|
130
|
-
|
|
176
|
+
W.displayName = "SmartNumberInput";
|
|
131
177
|
export {
|
|
132
|
-
|
|
178
|
+
W as SmartNumberInput
|
|
133
179
|
};
|