@gearbox-protocol/permissionless-ui 1.2.33 → 1.4.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/README.md +120 -1
- package/dist/cjs/components/asset-line.js +117 -0
- package/dist/cjs/components/assets-list-cell.js +73 -0
- package/dist/cjs/components/assets-ratio.js +98 -0
- package/dist/cjs/components/auth/siwe-provider.js +4 -4
- package/dist/cjs/components/base-link.js +61 -0
- package/dist/cjs/components/block-sync.js +118 -0
- package/dist/cjs/components/breadcrumbs.js +77 -0
- package/dist/cjs/components/buttons/back-button.js +37 -19
- package/dist/cjs/components/buttons/button.js +4 -4
- package/dist/cjs/components/buttons/filter-button.js +68 -0
- package/dist/cjs/components/buttons/index.js +4 -0
- package/dist/cjs/components/buttons/navigation-button.js +2 -2
- package/dist/cjs/components/buttons/range-buttons.js +63 -0
- package/dist/cjs/components/card-grid.js +127 -0
- package/dist/cjs/components/card.js +176 -0
- package/dist/cjs/components/checkbox-item.js +82 -0
- package/dist/cjs/components/compound-apy.js +232 -0
- package/dist/cjs/components/credit-session-status.js +67 -0
- package/dist/cjs/components/description.js +48 -0
- package/dist/cjs/components/detailed-page-title.js +96 -0
- package/dist/cjs/components/dialog/dialog-container.js +75 -0
- package/dist/cjs/components/dialog/dialog-content.js +66 -0
- package/dist/cjs/components/dialog/dialog-description.js +50 -0
- package/dist/cjs/components/dialog/dialog-footer.js +53 -0
- package/dist/cjs/components/dialog/dialog-header.js +53 -0
- package/dist/cjs/components/dialog/dialog-overlay.js +53 -0
- package/dist/cjs/components/dialog/dialog-title.js +50 -0
- package/dist/cjs/components/dialog/dialog.js +45 -0
- package/dist/cjs/components/dialog/index.js +36 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-checkbox-item.js +63 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-content.js +55 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-item.js +54 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-label.js +54 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-radio-item.js +58 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-separator.js +50 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-shortcut.js +52 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-sub-content.js +53 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu-sub-trigger.js +59 -0
- package/dist/cjs/components/dropdown-menu/dropdown-menu.js +54 -0
- package/dist/cjs/components/dropdown-menu/index.js +40 -0
- package/dist/cjs/components/error-message.js +70 -0
- package/dist/cjs/components/filter/filter-block.js +52 -0
- package/dist/cjs/components/filter/filter-checkbox-item.js +59 -0
- package/dist/cjs/components/filter/filter-chip.js +74 -0
- package/dist/cjs/components/filter/filter-chips.js +84 -0
- package/dist/cjs/components/filter/filter-dropdown-item.js +54 -0
- package/dist/cjs/components/filter/filter-group.js +43 -0
- package/dist/cjs/components/filter/filter-label.js +54 -0
- package/dist/cjs/components/filter/filter-modal-item.js +55 -0
- package/dist/cjs/components/filter/filter-modal.js +242 -0
- package/dist/cjs/components/filter/filter-radio-item.js +58 -0
- package/dist/cjs/components/filter/filter-separator.js +50 -0
- package/dist/cjs/components/filter/index.js +44 -0
- package/dist/cjs/components/filter/interface.js +16 -0
- package/dist/cjs/components/filter/variants.js +41 -0
- package/dist/cjs/components/form/form-field.js +67 -0
- package/dist/cjs/components/{editable-table → form}/index.js +4 -8
- package/dist/cjs/components/graph/default-config.js +158 -0
- package/dist/cjs/components/graph/formatters.js +175 -0
- package/dist/cjs/components/graph/graph-current-value.js +54 -0
- package/dist/cjs/components/graph/graph-tooltip.js +142 -0
- package/dist/cjs/components/graph/graph-view.js +233 -0
- package/dist/cjs/components/graph/graph.js +637 -0
- package/dist/cjs/components/graph/index.js +44 -0
- package/dist/cjs/components/graph/plugins/vertical-line.js +127 -0
- package/dist/cjs/components/guard.js +34 -0
- package/dist/cjs/components/health-factor.js +100 -0
- package/dist/cjs/components/help-center-container.js +107 -0
- package/dist/cjs/components/hide-on.js +66 -0
- package/dist/cjs/components/horizontal-indicator.js +63 -0
- package/dist/cjs/components/image.js +56 -0
- package/dist/cjs/components/index.js +93 -9
- package/dist/cjs/components/input.js +43 -21
- package/dist/cjs/components/label.js +29 -5
- package/dist/cjs/components/layout/app-logo.js +7 -17
- package/dist/cjs/components/layout/col.js +192 -0
- package/dist/cjs/components/layout/container.js +75 -0
- package/dist/cjs/components/layout/footer.js +137 -52
- package/dist/cjs/components/layout/grid.js +217 -0
- package/dist/cjs/components/layout/header.js +75 -13
- package/dist/cjs/components/layout/index.js +8 -0
- package/dist/cjs/components/layout/layout.js +65 -0
- package/dist/cjs/components/layout/legal-disclaimer.js +4 -14
- package/dist/cjs/components/liquidation/index.js +28 -0
- package/dist/cjs/components/liquidation/liquidation-assets-table.js +95 -0
- package/dist/cjs/components/liquidation/liquidation-graph-legend.js +41 -0
- package/dist/cjs/components/liquidation/liquidation-graph-tip.js +93 -0
- package/dist/cjs/components/liquidation/liquidation-graph.js +214 -0
- package/dist/cjs/components/loader-guard.js +47 -0
- package/dist/cjs/components/loading-guard.js +55 -0
- package/dist/cjs/components/markdown-viewer.js +4 -2
- package/dist/cjs/components/navbar-indicator-context.js +94 -0
- package/dist/cjs/components/navbar.js +131 -0
- package/dist/cjs/components/navitem.js +148 -0
- package/dist/cjs/components/next/back-button.js +43 -0
- package/dist/cjs/components/next/index.js +40 -0
- package/dist/cjs/components/next/siwe-provider.js +35 -0
- package/dist/cjs/components/next/token-icon.js +43 -0
- package/dist/cjs/components/next/web3-providers.js +116 -0
- package/dist/cjs/components/not-found.js +58 -0
- package/dist/cjs/components/options-list.js +88 -0
- package/dist/cjs/components/page-title.js +116 -0
- package/dist/cjs/components/percent-indicator.js +56 -0
- package/dist/cjs/components/pool-points-indicator.js +107 -0
- package/dist/cjs/components/search-bar.js +1 -0
- package/dist/cjs/components/search-line.js +225 -0
- package/dist/cjs/components/select.js +30 -9
- package/dist/cjs/components/short-string.js +58 -0
- package/dist/cjs/components/signatures/vertical-timeline.js +1 -0
- package/dist/cjs/components/skeleton.js +56 -3
- package/dist/cjs/components/stat-badge.js +189 -0
- package/dist/cjs/components/tab-control.js +254 -0
- package/dist/cjs/components/table/editable-grid-table.js +131 -0
- package/dist/cjs/components/{editable-table → table}/editable-table.js +1 -1
- package/dist/cjs/components/table/grid-error-line.js +60 -0
- package/dist/cjs/components/table/grid-loading-line.js +64 -0
- package/dist/cjs/components/table/grid-table-loader.js +56 -0
- package/dist/cjs/components/table/grid-table.js +203 -0
- package/dist/cjs/components/table/index.js +46 -0
- package/dist/cjs/components/table/sortable-head-cell.js +48 -0
- package/dist/cjs/components/table/table-loader-guard.js +55 -0
- package/dist/cjs/components/table/table-loader.js +46 -0
- package/dist/cjs/components/table/table-sm.js +93 -0
- package/dist/cjs/components/{table.js → table/table.js} +78 -22
- package/dist/cjs/components/textarea.js +27 -7
- package/dist/cjs/components/theme-provider.js +127 -0
- package/dist/cjs/components/theme-toggle.js +85 -0
- package/dist/cjs/components/token-icon.js +69 -20
- package/dist/cjs/components/token-symbol.js +84 -0
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/typed-intl/index.js +57 -0
- package/dist/cjs/components/vspace.js +31 -0
- package/dist/cjs/components/with-filter-button.js +84 -0
- package/dist/cjs/configs/design-tokens.js +109 -0
- package/dist/cjs/configs/index.js +48 -0
- package/dist/cjs/configs/tailwind-preset.js +162 -0
- package/dist/cjs/configs/tailwind.config.js +20 -67
- package/dist/cjs/configs/variants.js +58 -0
- package/dist/cjs/hooks/index.js +34 -0
- package/dist/cjs/hooks/use-controllable-state.js +50 -0
- package/dist/cjs/hooks/use-debounce.js +68 -0
- package/dist/cjs/hooks/use-filter.js +80 -0
- package/dist/cjs/hooks/use-hf.js +62 -0
- package/dist/cjs/hooks/use-liquidation/index.js +204 -0
- package/dist/cjs/hooks/use-liquidation/types.js +16 -0
- package/dist/cjs/hooks/use-liquidation/utils.js +253 -0
- package/dist/cjs/hooks/use-media-query.js +51 -0
- package/dist/cjs/hooks/use-previous.js +36 -0
- package/dist/cjs/index.js +157 -3
- package/dist/cjs/types/component-props.js +16 -0
- package/dist/cjs/types/filter.js +16 -0
- package/dist/cjs/types/footer.js +16 -0
- package/dist/cjs/types/graph.js +16 -0
- package/dist/cjs/types/help.js +16 -0
- package/dist/cjs/types/index.js +16 -0
- package/dist/cjs/types/range-item.js +16 -0
- package/dist/cjs/utils/a11y.js +39 -0
- package/dist/cjs/utils/bn-to-input-view.js +60 -0
- package/dist/cjs/utils/colors.js +96 -0
- package/dist/cjs/utils/format-asset-amount.js +43 -0
- package/dist/cjs/utils/format-money.js +68 -0
- package/dist/cjs/utils/index.js +29 -2
- package/dist/cjs/utils/interface.js +16 -0
- package/dist/cjs/utils/react.js +105 -0
- package/dist/cjs/utils/short-sha.js +28 -0
- package/dist/cjs/utils/sort.js +16 -0
- package/dist/cjs/utils/templates.js +50 -0
- package/dist/esm/components/asset-line.js +83 -0
- package/dist/esm/components/assets-list-cell.js +39 -0
- package/dist/esm/components/assets-ratio.js +64 -0
- package/dist/esm/components/auth/siwe-provider.js +4 -4
- package/dist/esm/components/base-link.js +27 -0
- package/dist/esm/components/block-sync.js +99 -0
- package/dist/esm/components/breadcrumbs.js +43 -0
- package/dist/esm/components/buttons/back-button.js +35 -8
- package/dist/esm/components/buttons/button.js +4 -4
- package/dist/esm/components/buttons/filter-button.js +34 -0
- package/dist/esm/components/buttons/index.js +2 -0
- package/dist/esm/components/buttons/navigation-button.js +2 -2
- package/dist/esm/components/buttons/range-buttons.js +29 -0
- package/dist/esm/components/card-grid.js +92 -0
- package/dist/esm/components/card.js +133 -0
- package/dist/esm/components/checkbox-item.js +48 -0
- package/dist/esm/components/compound-apy.js +203 -0
- package/dist/esm/components/credit-session-status.js +33 -0
- package/dist/esm/components/description.js +14 -0
- package/dist/esm/components/detailed-page-title.js +67 -0
- package/dist/esm/components/dialog/dialog-container.js +41 -0
- package/dist/esm/components/dialog/dialog-content.js +32 -0
- package/dist/esm/components/dialog/dialog-description.js +16 -0
- package/dist/esm/components/dialog/dialog-footer.js +19 -0
- package/dist/esm/components/dialog/dialog-header.js +19 -0
- package/dist/esm/components/dialog/dialog-overlay.js +19 -0
- package/dist/esm/components/dialog/dialog-title.js +16 -0
- package/dist/esm/components/dialog/dialog.js +9 -0
- package/dist/esm/components/dialog/index.js +8 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-checkbox-item.js +29 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-content.js +21 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-item.js +20 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-label.js +20 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-radio-item.js +24 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-separator.js +16 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-shortcut.js +18 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-sub-content.js +19 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu-sub-trigger.js +25 -0
- package/dist/esm/components/dropdown-menu/dropdown-menu.js +15 -0
- package/dist/esm/components/dropdown-menu/index.js +10 -0
- package/dist/esm/components/error-message.js +36 -0
- package/dist/esm/components/filter/filter-block.js +18 -0
- package/dist/esm/components/filter/filter-checkbox-item.js +25 -0
- package/dist/esm/components/filter/filter-chip.js +40 -0
- package/dist/esm/components/filter/filter-chips.js +50 -0
- package/dist/esm/components/filter/filter-dropdown-item.js +20 -0
- package/dist/esm/components/filter/filter-group.js +9 -0
- package/dist/esm/components/filter/filter-label.js +20 -0
- package/dist/esm/components/filter/filter-modal-item.js +21 -0
- package/dist/esm/components/filter/filter-modal.js +214 -0
- package/dist/esm/components/filter/filter-radio-item.js +24 -0
- package/dist/esm/components/filter/filter-separator.js +16 -0
- package/dist/esm/components/filter/index.js +12 -0
- package/dist/esm/components/filter/interface.js +0 -0
- package/dist/esm/components/filter/variants.js +17 -0
- package/dist/esm/components/form/form-field.js +43 -0
- package/dist/esm/components/form/index.js +1 -0
- package/dist/esm/components/graph/default-config.js +129 -0
- package/dist/esm/components/graph/formatters.js +150 -0
- package/dist/esm/components/graph/graph-current-value.js +30 -0
- package/dist/esm/components/graph/graph-tooltip.js +118 -0
- package/dist/esm/components/graph/graph-view.js +196 -0
- package/dist/esm/components/graph/graph.js +606 -0
- package/dist/esm/components/graph/index.js +15 -0
- package/dist/esm/components/graph/plugins/vertical-line.js +103 -0
- package/dist/esm/components/guard.js +10 -0
- package/dist/esm/components/health-factor.js +63 -0
- package/dist/esm/components/help-center-container.js +83 -0
- package/dist/esm/components/hide-on.js +41 -0
- package/dist/esm/components/horizontal-indicator.js +34 -0
- package/dist/esm/components/image.js +32 -0
- package/dist/esm/components/index.js +46 -4
- package/dist/esm/components/input.js +41 -20
- package/dist/esm/components/label.js +27 -4
- package/dist/esm/components/layout/app-logo.js +5 -5
- package/dist/esm/components/layout/col.js +158 -0
- package/dist/esm/components/layout/container.js +41 -0
- package/dist/esm/components/layout/footer.js +134 -52
- package/dist/esm/components/layout/grid.js +183 -0
- package/dist/esm/components/layout/header.js +65 -13
- package/dist/esm/components/layout/index.js +4 -0
- package/dist/esm/components/layout/layout.js +31 -0
- package/dist/esm/components/layout/legal-disclaimer.js +4 -4
- package/dist/esm/components/liquidation/index.js +4 -0
- package/dist/esm/components/liquidation/liquidation-assets-table.js +71 -0
- package/dist/esm/components/liquidation/liquidation-graph-legend.js +17 -0
- package/dist/esm/components/liquidation/liquidation-graph-tip.js +72 -0
- package/dist/esm/components/liquidation/liquidation-graph.js +191 -0
- package/dist/esm/components/loader-guard.js +23 -0
- package/dist/esm/components/loading-guard.js +31 -0
- package/dist/esm/components/markdown-viewer.js +4 -2
- package/dist/esm/components/navbar-indicator-context.js +76 -0
- package/dist/esm/components/navbar.js +98 -0
- package/dist/esm/components/navitem.js +113 -0
- package/dist/esm/components/next/back-button.js +11 -0
- package/dist/esm/components/next/index.js +12 -0
- package/dist/esm/components/next/siwe-provider.js +11 -0
- package/dist/esm/components/next/token-icon.js +11 -0
- package/dist/esm/components/next/web3-providers.js +92 -0
- package/dist/esm/components/not-found.js +24 -0
- package/dist/esm/components/options-list.js +53 -0
- package/dist/esm/components/page-title.js +80 -0
- package/dist/esm/components/percent-indicator.js +22 -0
- package/dist/esm/components/pool-points-indicator.js +73 -0
- package/dist/esm/components/search-bar.js +1 -0
- package/dist/esm/components/search-line.js +188 -0
- package/dist/esm/components/select.js +28 -8
- package/dist/esm/components/short-string.js +39 -0
- package/dist/esm/components/signatures/vertical-timeline.js +1 -0
- package/dist/esm/components/skeleton.js +54 -2
- package/dist/esm/components/stat-badge.js +155 -0
- package/dist/esm/components/tab-control.js +216 -0
- package/dist/esm/components/table/editable-grid-table.js +105 -0
- package/dist/esm/components/{editable-table → table}/editable-table.js +1 -1
- package/dist/esm/components/table/grid-error-line.js +36 -0
- package/dist/esm/components/table/grid-loading-line.js +30 -0
- package/dist/esm/components/table/grid-table-loader.js +22 -0
- package/dist/esm/components/table/grid-table.js +159 -0
- package/dist/esm/components/table/index.js +13 -0
- package/dist/esm/components/table/sortable-head-cell.js +24 -0
- package/dist/esm/components/table/table-loader-guard.js +31 -0
- package/dist/esm/components/table/table-loader.js +22 -0
- package/dist/esm/components/table/table-sm.js +58 -0
- package/dist/esm/components/{table.js → table/table.js} +74 -21
- package/dist/esm/components/textarea.js +25 -6
- package/dist/esm/components/theme-provider.js +108 -0
- package/dist/esm/components/theme-toggle.js +61 -0
- package/dist/esm/components/token-icon.js +70 -11
- package/dist/esm/components/token-symbol.js +50 -0
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/typed-intl/index.js +32 -0
- package/dist/esm/components/vspace.js +7 -0
- package/dist/esm/components/with-filter-button.js +50 -0
- package/dist/esm/configs/design-tokens.js +85 -0
- package/dist/esm/configs/index.js +9 -0
- package/dist/esm/configs/tailwind-preset.js +128 -0
- package/dist/esm/configs/tailwind.config.js +16 -57
- package/dist/esm/configs/variants.js +31 -0
- package/dist/esm/hooks/index.js +7 -0
- package/dist/esm/hooks/use-controllable-state.js +26 -0
- package/dist/esm/hooks/use-debounce.js +43 -0
- package/dist/esm/hooks/use-filter.js +52 -0
- package/dist/esm/hooks/use-hf.js +38 -0
- package/dist/esm/hooks/use-liquidation/index.js +188 -0
- package/dist/esm/hooks/use-liquidation/types.js +0 -0
- package/dist/esm/hooks/use-liquidation/utils.js +215 -0
- package/dist/esm/hooks/use-media-query.js +24 -0
- package/dist/esm/hooks/use-previous.js +12 -0
- package/dist/esm/index.js +84 -1
- package/dist/esm/types/component-props.js +0 -0
- package/dist/esm/types/filter.js +0 -0
- package/dist/esm/types/footer.js +0 -0
- package/dist/esm/types/graph.js +0 -0
- package/dist/esm/types/help.js +0 -0
- package/dist/esm/types/index.js +0 -0
- package/dist/esm/types/range-item.js +0 -0
- package/dist/esm/utils/a11y.js +14 -0
- package/dist/esm/utils/bn-to-input-view.js +36 -0
- package/dist/esm/utils/colors.js +69 -0
- package/dist/esm/utils/format-asset-amount.js +19 -0
- package/dist/esm/utils/format-money.js +40 -0
- package/dist/esm/utils/index.js +21 -1
- package/dist/esm/utils/interface.js +0 -0
- package/dist/esm/utils/react.js +70 -0
- package/dist/esm/utils/short-sha.js +4 -0
- package/dist/esm/utils/sort.js +0 -0
- package/dist/esm/utils/templates.js +24 -0
- package/dist/globals.css +230 -52
- package/dist/grid-safelist.css +264 -0
- package/dist/types/components/asset-line.d.ts +59 -0
- package/dist/types/components/assets-list-cell.d.ts +48 -0
- package/dist/types/components/assets-ratio.d.ts +9 -0
- package/dist/types/components/auth/signin-required.d.ts +1 -1
- package/dist/types/components/auth/siwe-provider.d.ts +2 -1
- package/dist/types/components/badge.d.ts +1 -1
- package/dist/types/components/base-link.d.ts +58 -0
- package/dist/types/components/block-sync.d.ts +8 -0
- package/dist/types/components/breadcrumbs.d.ts +24 -0
- package/dist/types/components/buttons/back-button.d.ts +15 -20
- package/dist/types/components/buttons/button.d.ts +37 -3
- package/dist/types/components/buttons/filter-button.d.ts +52 -0
- package/dist/types/components/buttons/index.d.ts +2 -0
- package/dist/types/components/buttons/range-buttons.d.ts +49 -0
- package/dist/types/components/card-grid.d.ts +25 -0
- package/dist/types/components/card.d.ts +116 -0
- package/dist/types/components/cards/card.d.ts +2 -2
- package/dist/types/components/checkbox-item.d.ts +56 -0
- package/dist/types/components/compound-apy.d.ts +80 -0
- package/dist/types/components/credit-session-status.d.ts +7 -0
- package/dist/types/components/description.d.ts +26 -0
- package/dist/types/components/detailed-page-title.d.ts +31 -0
- package/dist/types/components/dialog/dialog-container.d.ts +12 -0
- package/dist/types/components/dialog/dialog-content.d.ts +4 -0
- package/dist/types/components/dialog/dialog-description.d.ts +4 -0
- package/dist/types/components/dialog/dialog-footer.d.ts +6 -0
- package/dist/types/components/dialog/dialog-header.d.ts +6 -0
- package/dist/types/components/dialog/dialog-overlay.d.ts +4 -0
- package/dist/types/components/dialog/dialog-title.d.ts +4 -0
- package/dist/types/components/dialog/dialog.d.ts +5 -0
- package/dist/types/components/dialog/index.d.ts +8 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +22 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-content.d.ts +4 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-item.d.ts +6 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-label.d.ts +6 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-radio-item.d.ts +4 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-separator.d.ts +4 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-shortcut.d.ts +6 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-sub-content.d.ts +4 -0
- package/dist/types/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +6 -0
- package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +8 -0
- package/dist/types/components/dropdown-menu/index.d.ts +10 -0
- package/dist/types/components/error-message.d.ts +21 -0
- package/dist/types/components/filter/filter-block.d.ts +17 -0
- package/dist/types/components/filter/filter-checkbox-item.d.ts +23 -0
- package/dist/types/components/filter/filter-chip.d.ts +34 -0
- package/dist/types/components/filter/filter-chips.d.ts +42 -0
- package/dist/types/components/filter/filter-dropdown-item.d.ts +24 -0
- package/dist/types/components/filter/filter-group.d.ts +22 -0
- package/dist/types/components/filter/filter-label.d.ts +21 -0
- package/dist/types/components/filter/filter-modal-item.d.ts +31 -0
- package/dist/types/components/filter/filter-modal.d.ts +123 -0
- package/dist/types/components/filter/filter-radio-item.d.ts +19 -0
- package/dist/types/components/filter/filter-separator.d.ts +22 -0
- package/dist/types/components/filter/index.d.ts +109 -0
- package/dist/types/components/filter/interface.d.ts +24 -0
- package/dist/types/components/filter/variants.d.ts +3 -0
- package/dist/types/components/form/form-field.d.ts +38 -0
- package/dist/types/components/form/index.d.ts +1 -0
- package/dist/types/components/graph/default-config.d.ts +20 -0
- package/dist/types/components/graph/formatters.d.ts +16 -0
- package/dist/types/components/graph/graph-current-value.d.ts +13 -0
- package/dist/types/components/graph/graph-tooltip.d.ts +24 -0
- package/dist/types/components/graph/graph-view.d.ts +198 -0
- package/dist/types/components/graph/graph.d.ts +49 -0
- package/dist/types/components/graph/index.d.ts +7 -0
- package/dist/types/components/guard.d.ts +34 -0
- package/dist/types/components/health-factor.d.ts +63 -0
- package/dist/types/components/help-center-container.d.ts +22 -0
- package/dist/types/components/hide-on.d.ts +32 -0
- package/dist/types/components/horizontal-indicator.d.ts +22 -0
- package/dist/types/components/image.d.ts +35 -0
- package/dist/types/components/index.d.ts +44 -1
- package/dist/types/components/input.d.ts +26 -9
- package/dist/types/components/label.d.ts +26 -5
- package/dist/types/components/layout/app-logo.d.ts +1 -0
- package/dist/types/components/layout/col.d.ts +43 -0
- package/dist/types/components/layout/container.d.ts +37 -0
- package/dist/types/components/layout/footer.d.ts +44 -5
- package/dist/types/components/layout/grid.d.ts +48 -0
- package/dist/types/components/layout/header.d.ts +68 -12
- package/dist/types/components/layout/index.d.ts +4 -0
- package/dist/types/components/layout/layout.d.ts +12 -0
- package/dist/types/components/liquidation/index.d.ts +4 -0
- package/dist/types/components/liquidation/liquidation-assets-table.d.ts +14 -0
- package/dist/types/components/liquidation/liquidation-graph-legend.d.ts +2 -0
- package/dist/types/components/liquidation/liquidation-graph-tip.d.ts +13 -0
- package/dist/types/components/liquidation/liquidation-graph.d.ts +19 -0
- package/dist/types/components/loader-guard.d.ts +17 -0
- package/dist/types/components/loading-guard.d.ts +18 -0
- package/dist/types/components/navbar-indicator-context.d.ts +13 -0
- package/dist/types/components/navbar.d.ts +25 -0
- package/dist/types/components/navitem.d.ts +67 -0
- package/dist/types/components/next/back-button.d.ts +3 -0
- package/dist/types/components/next/index.d.ts +10 -0
- package/dist/types/components/next/siwe-provider.d.ts +7 -0
- package/dist/types/components/next/token-icon.d.ts +3 -0
- package/dist/types/components/next/web3-providers.d.ts +29 -0
- package/dist/types/components/not-found.d.ts +18 -0
- package/dist/types/components/options-list.d.ts +15 -0
- package/dist/types/components/page-title.d.ts +69 -0
- package/dist/types/components/percent-indicator.d.ts +28 -0
- package/dist/types/components/pool-points-indicator.d.ts +41 -0
- package/dist/types/components/search-line.d.ts +117 -0
- package/dist/types/components/select.d.ts +9 -2
- package/dist/types/components/short-string.d.ts +39 -0
- package/dist/types/components/skeleton.d.ts +28 -3
- package/dist/types/components/stat-badge.d.ts +169 -0
- package/dist/types/components/tab-control.d.ts +39 -0
- package/dist/types/components/table/editable-grid-table.d.ts +120 -0
- package/dist/types/components/table/grid-error-line.d.ts +49 -0
- package/dist/types/components/table/grid-loading-line.d.ts +36 -0
- package/dist/types/components/table/grid-table-loader.d.ts +25 -0
- package/dist/types/components/table/grid-table.d.ts +158 -0
- package/dist/types/components/table/index.d.ts +13 -0
- package/dist/types/components/table/sortable-head-cell.d.ts +36 -0
- package/dist/types/components/table/table-loader-guard.d.ts +45 -0
- package/dist/types/components/table/table-loader.d.ts +46 -0
- package/dist/types/components/table/table-sm.d.ts +94 -0
- package/dist/types/components/{table.d.ts → table/table.d.ts} +39 -12
- package/dist/types/components/{editable-table → table}/updated-value.d.ts +3 -0
- package/dist/types/components/textarea.d.ts +24 -5
- package/dist/types/components/theme-provider.d.ts +34 -0
- package/dist/types/components/theme-toggle.d.ts +5 -0
- package/dist/types/components/token-icon.d.ts +8 -6
- package/dist/types/components/token-symbol.d.ts +71 -0
- package/dist/types/components/typed-intl/index.d.ts +19 -0
- package/dist/types/components/vspace.d.ts +27 -0
- package/dist/types/components/with-filter-button.d.ts +54 -0
- package/dist/types/configs/design-tokens.d.ts +73 -0
- package/dist/types/configs/index.d.ts +4 -0
- package/dist/types/configs/tailwind-preset.d.ts +126 -0
- package/dist/types/configs/tailwind.config.d.ts +29 -0
- package/dist/types/configs/variants.d.ts +28 -0
- package/dist/types/hooks/index.d.ts +7 -0
- package/dist/types/hooks/use-controllable-state.d.ts +24 -0
- package/dist/types/hooks/use-debounce.d.ts +31 -0
- package/dist/types/hooks/use-filter.d.ts +37 -0
- package/dist/types/hooks/use-hf.d.ts +15 -0
- package/dist/types/hooks/use-liquidation/index.d.ts +52 -0
- package/dist/types/hooks/use-liquidation/types.d.ts +16 -0
- package/dist/types/hooks/use-liquidation/utils.d.ts +66 -0
- package/dist/types/hooks/use-media-query.d.ts +25 -0
- package/dist/types/hooks/use-previous.d.ts +10 -0
- package/dist/types/index.d.ts +71 -2
- package/dist/types/types/component-props.d.ts +16 -0
- package/dist/types/types/filter.d.ts +8 -0
- package/dist/types/types/footer.d.ts +30 -0
- package/dist/types/types/graph.d.ts +22 -0
- package/dist/types/types/help.d.ts +4 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/range-item.d.ts +9 -0
- package/dist/types/utils/a11y.d.ts +24 -0
- package/dist/types/utils/bn-to-input-view.d.ts +17 -0
- package/dist/types/utils/colors.d.ts +29 -0
- package/dist/types/utils/format-asset-amount.d.ts +16 -0
- package/dist/types/utils/format-money.d.ts +64 -0
- package/dist/types/utils/index.d.ts +10 -0
- package/dist/types/utils/interface.d.ts +9 -0
- package/dist/types/utils/react.d.ts +31 -0
- package/dist/types/utils/short-sha.d.ts +9 -0
- package/dist/types/utils/sort.d.ts +5 -0
- package/dist/types/utils/templates.d.ts +61 -0
- package/package.json +66 -28
- package/dist/cjs/components/dialog.js +0 -137
- package/dist/cjs/components/dropdown-menu.js +0 -200
- package/dist/esm/components/dialog.js +0 -97
- package/dist/esm/components/dropdown-menu.js +0 -152
- package/dist/esm/components/editable-table/index.js +0 -3
- package/dist/types/components/dialog.d.ts +0 -38
- package/dist/types/components/dropdown-menu.d.ts +0 -59
- package/dist/types/components/editable-table/index.d.ts +0 -3
- /package/dist/cjs/components/{editable-table → table}/edit-button.js +0 -0
- /package/dist/cjs/components/{editable-table → table}/updated-value.js +0 -0
- /package/dist/esm/components/{editable-table → table}/edit-button.js +0 -0
- /package/dist/esm/components/{editable-table → table}/updated-value.js +0 -0
- /package/dist/types/components/{editable-table → table}/edit-button.d.ts +0 -0
- /package/dist/types/components/{editable-table → table}/editable-table.d.ts +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var legal_disclaimer_exports = {};
|
|
30
20
|
__export(legal_disclaimer_exports, {
|
|
@@ -32,13 +22,13 @@ __export(legal_disclaimer_exports, {
|
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(legal_disclaimer_exports);
|
|
34
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var
|
|
25
|
+
var import_base_link = require('../base-link.js');
|
|
36
26
|
function LegalDisclaimer({ hrefs }) {
|
|
37
27
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground max-w-md", children: [
|
|
38
28
|
"Any use of and/or interaction with the Permissionless Interface is subject to the",
|
|
39
29
|
" ",
|
|
40
30
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
-
|
|
31
|
+
import_base_link.BaseLink,
|
|
42
32
|
{
|
|
43
33
|
href: hrefs.termsOfService,
|
|
44
34
|
className: "underline hover:text-foreground transition-colors",
|
|
@@ -49,7 +39,7 @@ function LegalDisclaimer({ hrefs }) {
|
|
|
49
39
|
"and",
|
|
50
40
|
" ",
|
|
51
41
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
-
|
|
42
|
+
import_base_link.BaseLink,
|
|
53
43
|
{
|
|
54
44
|
href: hrefs.privacyNotice,
|
|
55
45
|
className: "underline hover:text-foreground transition-colors",
|
|
@@ -59,7 +49,7 @@ function LegalDisclaimer({ hrefs }) {
|
|
|
59
49
|
", and acceptance of risks described in the",
|
|
60
50
|
" ",
|
|
61
51
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
-
|
|
52
|
+
import_base_link.BaseLink,
|
|
63
53
|
{
|
|
64
54
|
href: hrefs.riskDisclosure,
|
|
65
55
|
className: "underline hover:text-foreground transition-colors",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var liquidation_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(liquidation_exports);
|
|
18
|
+
__reExport(liquidation_exports, require('./liquidation-assets-table.js'), module.exports);
|
|
19
|
+
__reExport(liquidation_exports, require('./liquidation-graph.js'), module.exports);
|
|
20
|
+
__reExport(liquidation_exports, require('./liquidation-graph-legend.js'), module.exports);
|
|
21
|
+
__reExport(liquidation_exports, require('./liquidation-graph-tip.js'), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require('./liquidation-assets-table.js'),
|
|
25
|
+
...require('./liquidation-graph.js'),
|
|
26
|
+
...require('./liquidation-graph-legend.js'),
|
|
27
|
+
...require('./liquidation-graph-tip.js')
|
|
28
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var liquidation_assets_table_exports = {};
|
|
20
|
+
__export(liquidation_assets_table_exports, {
|
|
21
|
+
LiquidationModellingAssetsTable: () => LiquidationModellingAssetsTable
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(liquidation_assets_table_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_sdk = require("@gearbox-protocol/sdk");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_token_symbol = require('../token-symbol.js');
|
|
28
|
+
var import_typed_intl = require('../typed-intl/index.js');
|
|
29
|
+
const lineHeight = 51;
|
|
30
|
+
function LiquidationModellingAssetsTable({
|
|
31
|
+
tokensList,
|
|
32
|
+
graphParams,
|
|
33
|
+
data,
|
|
34
|
+
prices,
|
|
35
|
+
editedPrices
|
|
36
|
+
}) {
|
|
37
|
+
const { fixedBalances } = graphParams;
|
|
38
|
+
const fixedBalancesRecord = (0, import_react.useMemo)(() => {
|
|
39
|
+
return import_sdk.AssetUtils.constructAssetRecord(fixedBalances);
|
|
40
|
+
}, [fixedBalances]);
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full", children: [
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: "grid w-full px-4 gap-2 items-center h-[30px] relative after:absolute after:bottom-0 after:left-2 after:right-2 after:h-px after:border-b after:border-border",
|
|
46
|
+
style: { gridTemplateColumns: "1fr 1fr 1fr" },
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-left text-sm font-medium text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.asset" }) }),
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-right text-sm font-medium text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.currentPrice" }) }),
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-right text-sm font-medium text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.modelPrice" }) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
data.map((c, num, arr) => {
|
|
55
|
+
const isLast = arr.length - 1 === num;
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: `grid w-full px-4 gap-2 items-center relative ${isLast ? "" : "after:absolute after:bottom-0 after:left-2 after:right-2 after:h-px after:border-b after:border-border"}`,
|
|
60
|
+
style: {
|
|
61
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
62
|
+
height: `${lineHeight}px`
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-left", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
import_token_symbol.TokenSymbol,
|
|
67
|
+
{
|
|
68
|
+
size: 24,
|
|
69
|
+
token: tokensList[c.token],
|
|
70
|
+
showSymbol: true,
|
|
71
|
+
maxLength: 8
|
|
72
|
+
}
|
|
73
|
+
) }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-right", children: [
|
|
75
|
+
"$",
|
|
76
|
+
formatPrice(prices[c.token])
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-right", children: fixedBalancesRecord[c.token] ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.seeGraph" }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
|
|
79
|
+
"$",
|
|
80
|
+
formatPrice(editedPrices[c.token] || prices[c.token])
|
|
81
|
+
] }) })
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
c.token
|
|
85
|
+
);
|
|
86
|
+
})
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
function formatPrice(price) {
|
|
90
|
+
return (Number(price || 0n) / Number(import_sdk.PRICE_DECIMALS)).toFixed(2);
|
|
91
|
+
}
|
|
92
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
+
0 && (module.exports = {
|
|
94
|
+
LiquidationModellingAssetsTable
|
|
95
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var liquidation_graph_legend_exports = {};
|
|
20
|
+
__export(liquidation_graph_legend_exports, {
|
|
21
|
+
LiquidationGraphLegend: () => LiquidationGraphLegend
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(liquidation_graph_legend_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_typed_intl = require('../typed-intl/index.js');
|
|
26
|
+
function LiquidationGraphLegend() {
|
|
27
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-center gap-8 w-full", children: [
|
|
28
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-[9px] h-[9px] bg-white" }),
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.graph.legend.point" }) })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-[9px] h-[9px] bg-[rgb(244,67,54)]" }),
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.graph.legend.area" }) })
|
|
35
|
+
] })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
LiquidationGraphLegend
|
|
41
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var liquidation_graph_tip_exports = {};
|
|
20
|
+
__export(liquidation_graph_tip_exports, {
|
|
21
|
+
LiquidationGraphTip: () => LiquidationGraphTip
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(liquidation_graph_tip_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_use_liquidation = require('../../hooks/use-liquidation/index.js');
|
|
26
|
+
var import_health_factor = require('../health-factor.js');
|
|
27
|
+
var import_short_string = require('../short-string.js');
|
|
28
|
+
var import_token_symbol = require('../token-symbol.js');
|
|
29
|
+
var import_typed_intl = require('../typed-intl/index.js');
|
|
30
|
+
function LiquidationGraphTip({
|
|
31
|
+
activePointX,
|
|
32
|
+
activePointY,
|
|
33
|
+
xAxis,
|
|
34
|
+
yAxis,
|
|
35
|
+
hf,
|
|
36
|
+
underlyingToken,
|
|
37
|
+
maxLabelLength
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex w-full justify-between items-center", children: [
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
41
|
+
xAxis && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
PriceLine,
|
|
43
|
+
{
|
|
44
|
+
underlyingToken,
|
|
45
|
+
token: xAxis.label,
|
|
46
|
+
value: activePointX,
|
|
47
|
+
order: xAxis.order,
|
|
48
|
+
maxLabelLength
|
|
49
|
+
}
|
|
50
|
+
) }),
|
|
51
|
+
yAxis && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
PriceLine,
|
|
53
|
+
{
|
|
54
|
+
underlyingToken,
|
|
55
|
+
token: yAxis.label,
|
|
56
|
+
value: activePointY,
|
|
57
|
+
order: yAxis.order,
|
|
58
|
+
maxLabelLength
|
|
59
|
+
}
|
|
60
|
+
) })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm text-muted-foreground", children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.graph.tip.hf" }),
|
|
65
|
+
":"
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_health_factor.HealthFactor, { value: hf, debt: 1n }) })
|
|
68
|
+
] })
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
function PriceLine({
|
|
72
|
+
token,
|
|
73
|
+
underlyingToken,
|
|
74
|
+
value = 0,
|
|
75
|
+
order = "straight",
|
|
76
|
+
maxLabelLength = 13
|
|
77
|
+
}) {
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_token_symbol.TokenSymbol, { token, size: 12 }),
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm text-foreground", children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_short_string.ShortString, { maxLength: maxLabelLength, children: (0, import_use_liquidation.formatAxisTipLabel)(token, underlyingToken, order) }),
|
|
82
|
+
" ",
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_typed_intl.FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.graph.tip.price" }),
|
|
84
|
+
": ",
|
|
85
|
+
underlyingToken ? "" : "$",
|
|
86
|
+
(0, import_use_liquidation.formatAxisTipPrice)(value)
|
|
87
|
+
] })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
LiquidationGraphTip
|
|
93
|
+
});
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var liquidation_graph_exports = {};
|
|
30
|
+
__export(liquidation_graph_exports, {
|
|
31
|
+
LiquidationGraph: () => LiquidationGraph
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(liquidation_graph_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_ColorHeatmap = __toESM(require("reactochart/ColorHeatmap"));
|
|
37
|
+
var import_XAxis = __toESM(require("reactochart/XAxis"));
|
|
38
|
+
var import_XLine = __toESM(require("reactochart/XLine"));
|
|
39
|
+
var import_XYPlot = __toESM(require("reactochart/XYPlot"));
|
|
40
|
+
var import_YAxis = __toESM(require("reactochart/YAxis"));
|
|
41
|
+
var import_YLine = __toESM(require("reactochart/YLine"));
|
|
42
|
+
var import_use_hf = require('../../hooks/use-hf.js');
|
|
43
|
+
var import_use_liquidation = require('../../hooks/use-liquidation/index.js');
|
|
44
|
+
var import_vspace = require('../vspace.js');
|
|
45
|
+
var import_liquidation_graph_legend = require('./liquidation-graph-legend.js');
|
|
46
|
+
var import_liquidation_graph_tip = require('./liquidation-graph-tip.js');
|
|
47
|
+
const WIDTH = 300;
|
|
48
|
+
const HEIGHT = 300;
|
|
49
|
+
const CROSSHAIR_X = "rct-crosshair-x";
|
|
50
|
+
const CROSSHAIR_Y = "rct-crosshair-y";
|
|
51
|
+
function LiquidationGraph({
|
|
52
|
+
graphParams,
|
|
53
|
+
assets,
|
|
54
|
+
liquidationThresholds,
|
|
55
|
+
quotas,
|
|
56
|
+
quotasInfo,
|
|
57
|
+
underlyingToken: underlyingTokenAddress,
|
|
58
|
+
debt,
|
|
59
|
+
prices,
|
|
60
|
+
tokensList,
|
|
61
|
+
width = WIDTH,
|
|
62
|
+
height = HEIGHT,
|
|
63
|
+
maxLabelLength
|
|
64
|
+
}) {
|
|
65
|
+
const { xAxis, yAxis, currentPoint } = graphParams;
|
|
66
|
+
const {
|
|
67
|
+
min: xMin = import_use_liquidation.DEFAULT_AXIS_MIN,
|
|
68
|
+
max: xMax = import_use_liquidation.DEFAULT_AXIS_MAX,
|
|
69
|
+
label: xLabel,
|
|
70
|
+
order: xOrder = "straight",
|
|
71
|
+
nextOrder: nextOrderX
|
|
72
|
+
} = xAxis || {};
|
|
73
|
+
const {
|
|
74
|
+
min: yMin = import_use_liquidation.DEFAULT_AXIS_MIN,
|
|
75
|
+
max: yMax = import_use_liquidation.DEFAULT_AXIS_MAX,
|
|
76
|
+
label: yLabel,
|
|
77
|
+
order: yOrder = "straight",
|
|
78
|
+
nextOrder: nextOrderY
|
|
79
|
+
} = yAxis || {};
|
|
80
|
+
const heatmap = (0, import_use_liquidation.useLiquidationHeatmap)({
|
|
81
|
+
xMin,
|
|
82
|
+
xMax,
|
|
83
|
+
yMin,
|
|
84
|
+
yMax,
|
|
85
|
+
xLabel,
|
|
86
|
+
yLabel,
|
|
87
|
+
assets,
|
|
88
|
+
quotas,
|
|
89
|
+
prices,
|
|
90
|
+
liquidationThresholds,
|
|
91
|
+
underlyingTokenAddress,
|
|
92
|
+
debt,
|
|
93
|
+
quotasInfo,
|
|
94
|
+
tokensList
|
|
95
|
+
});
|
|
96
|
+
const { activePoint, handleMouseLeave, handleMouseMove } = (0, import_use_liquidation.useLiquidationGraphCurrentActiveValue)();
|
|
97
|
+
const [activePointX, activePointY] = activePoint || [];
|
|
98
|
+
const activePrices = (0, import_use_liquidation.useWithLiquidationGraphActivePrices)({
|
|
99
|
+
prices,
|
|
100
|
+
activePoint,
|
|
101
|
+
xLabel,
|
|
102
|
+
yLabel
|
|
103
|
+
});
|
|
104
|
+
const hf = (0, import_use_hf.useHF)({
|
|
105
|
+
quotas,
|
|
106
|
+
quotasInfo,
|
|
107
|
+
assets,
|
|
108
|
+
prices: activePrices,
|
|
109
|
+
liquidationThresholds,
|
|
110
|
+
underlyingToken: underlyingTokenAddress,
|
|
111
|
+
debt,
|
|
112
|
+
tokensList
|
|
113
|
+
});
|
|
114
|
+
const underlyingPrice = prices[underlyingTokenAddress] || 1n;
|
|
115
|
+
const underlyingToken = tokensList[underlyingTokenAddress];
|
|
116
|
+
const xRelative = (0, import_use_liquidation.useIsAxisInRelativeUnits)(xLabel, underlyingToken);
|
|
117
|
+
const yRelative = (0, import_use_liquidation.useIsAxisInRelativeUnits)(yLabel, underlyingToken);
|
|
118
|
+
const activePriceX = (0, import_use_liquidation.useLiquidationGraphActivePrice)(
|
|
119
|
+
activePointX || currentPoint[0],
|
|
120
|
+
underlyingPrice,
|
|
121
|
+
xRelative,
|
|
122
|
+
xOrder
|
|
123
|
+
);
|
|
124
|
+
const activePriceY = (0, import_use_liquidation.useLiquidationGraphActivePrice)(
|
|
125
|
+
activePointY || currentPoint[1],
|
|
126
|
+
underlyingPrice,
|
|
127
|
+
yRelative,
|
|
128
|
+
yOrder
|
|
129
|
+
);
|
|
130
|
+
const labelXFormatter = (0, import_react.useCallback)(
|
|
131
|
+
(0, import_use_liquidation.formatAxisLabel)(underlyingPrice, xRelative, xOrder),
|
|
132
|
+
[]
|
|
133
|
+
);
|
|
134
|
+
const labelYFormatter = (0, import_react.useCallback)(
|
|
135
|
+
(0, import_use_liquidation.formatAxisLabel)(underlyingPrice, yRelative, yOrder),
|
|
136
|
+
[]
|
|
137
|
+
);
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mx-auto", style: { width: `${width}px`, maxWidth: "100%" }, children: [
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
+
import_liquidation_graph_tip.LiquidationGraphTip,
|
|
141
|
+
{
|
|
142
|
+
underlyingToken,
|
|
143
|
+
hf: hf.hf,
|
|
144
|
+
xAxis,
|
|
145
|
+
yAxis,
|
|
146
|
+
activePointX: activePriceX,
|
|
147
|
+
activePointY: activePriceY,
|
|
148
|
+
maxLabelLength
|
|
149
|
+
}
|
|
150
|
+
) }),
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vspace.VSpace, { height: 16 }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full liquidation-graph-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
153
|
+
import_XYPlot.default,
|
|
154
|
+
{
|
|
155
|
+
width,
|
|
156
|
+
height,
|
|
157
|
+
xDomain: [xMin, xMax],
|
|
158
|
+
yDomain: [yMin, yMax],
|
|
159
|
+
onMouseMove: handleMouseMove,
|
|
160
|
+
onMouseLeave: handleMouseLeave,
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
+
import_XAxis.default,
|
|
164
|
+
{
|
|
165
|
+
showLine: false,
|
|
166
|
+
title: (0, import_use_liquidation.formatAxisTipLabel)(xLabel, underlyingToken, xOrder),
|
|
167
|
+
titleAlign: "right",
|
|
168
|
+
tickCount: 5,
|
|
169
|
+
labelFormat: labelXFormatter,
|
|
170
|
+
showLabels: !!xLabel,
|
|
171
|
+
showTicks: !!xLabel,
|
|
172
|
+
onMouseClickAxis: nextOrderX,
|
|
173
|
+
nice: false
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
177
|
+
import_YAxis.default,
|
|
178
|
+
{
|
|
179
|
+
showLine: false,
|
|
180
|
+
title: (0, import_use_liquidation.formatAxisTipLabel)(yLabel, underlyingToken, yOrder),
|
|
181
|
+
titleAlign: "top",
|
|
182
|
+
tickCount: 5,
|
|
183
|
+
labelFormat: labelYFormatter,
|
|
184
|
+
showLabels: !!yLabel,
|
|
185
|
+
showTicks: !!yLabel,
|
|
186
|
+
onMouseClickAxis: nextOrderY,
|
|
187
|
+
nice: false
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
+
import_ColorHeatmap.default,
|
|
192
|
+
{
|
|
193
|
+
data: heatmap,
|
|
194
|
+
value: (d) => d.value,
|
|
195
|
+
x: (d) => d.x,
|
|
196
|
+
xEnd: (d) => d.xEnd,
|
|
197
|
+
y: (d) => d.y,
|
|
198
|
+
yEnd: (d) => d.yEnd,
|
|
199
|
+
rectClassName: (p) => (0, import_use_liquidation.getCellClass)(p, currentPoint, activePointX, activePointY)
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
activePointX !== void 0 && activePointX !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_XLine.default, { value: activePointX, className: CROSSHAIR_X }),
|
|
203
|
+
activePointY !== void 0 && activePointY !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_YLine.default, { value: activePointY, className: CROSSHAIR_Y })
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
) }),
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vspace.VSpace, { height: 12 }),
|
|
208
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_liquidation_graph_legend.LiquidationGraphLegend, {}) })
|
|
209
|
+
] });
|
|
210
|
+
}
|
|
211
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
212
|
+
0 && (module.exports = {
|
|
213
|
+
LiquidationGraph
|
|
214
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var loader_guard_exports = {};
|
|
20
|
+
__export(loader_guard_exports, {
|
|
21
|
+
LoaderGuard: () => LoaderGuard
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(loader_guard_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_guard = require('./guard.js');
|
|
26
|
+
var import_layout = require('./layout/index.js');
|
|
27
|
+
var import_skeleton = require('./skeleton.js');
|
|
28
|
+
function LoaderGuard({
|
|
29
|
+
showGuard: show,
|
|
30
|
+
children,
|
|
31
|
+
loader
|
|
32
|
+
}) {
|
|
33
|
+
const defaultLoader = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_layout.Container, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-8 w-64" }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-full" }),
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-full" }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-3/4" })
|
|
39
|
+
] })
|
|
40
|
+
] }) });
|
|
41
|
+
const showGuard = show;
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_guard.Guard, { showGuard, guard: showGuard && (loader || defaultLoader), children });
|
|
43
|
+
}
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
LoaderGuard
|
|
47
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var loading_guard_exports = {};
|
|
20
|
+
__export(loading_guard_exports, {
|
|
21
|
+
LoadingGuard: () => LoadingGuard
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(loading_guard_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_layout = require('./layout/index.js');
|
|
26
|
+
var import_skeleton = require('./skeleton.js');
|
|
27
|
+
function LoadingGuard({
|
|
28
|
+
showGuard,
|
|
29
|
+
children,
|
|
30
|
+
fallback
|
|
31
|
+
}) {
|
|
32
|
+
if (showGuard) {
|
|
33
|
+
if (fallback) {
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: fallback });
|
|
35
|
+
}
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_layout.Container, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-8 w-64" }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-full" }),
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-full" }),
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-3/4" })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-4", children: [
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-32 w-full" }),
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-32 w-full" }),
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-32 w-full" })
|
|
47
|
+
] })
|
|
48
|
+
] }) });
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
LoadingGuard
|
|
55
|
+
});
|
|
@@ -51,8 +51,10 @@ function getTextContent(children) {
|
|
|
51
51
|
if (Array.isArray(children)) {
|
|
52
52
|
return children.map(getTextContent).join("");
|
|
53
53
|
}
|
|
54
|
-
if (children && typeof children === "object" && "props" in children) {
|
|
55
|
-
return getTextContent(
|
|
54
|
+
if (children && typeof children === "object" && "props" in children && typeof children.props === "object" && children.props !== null && "children" in children.props) {
|
|
55
|
+
return getTextContent(
|
|
56
|
+
children.props.children
|
|
57
|
+
);
|
|
56
58
|
}
|
|
57
59
|
return "";
|
|
58
60
|
}
|