@agg-market/ui 4.0.0 → 6.0.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 +26 -26
- package/dist/auth.d.mts +1 -0
- package/dist/auth.d.ts +1 -0
- package/dist/{connect-button.js → auth.js} +6 -4
- package/dist/auth.mjs +8 -0
- package/dist/chunk-2ICOSP7N.mjs +1211 -0
- package/dist/chunk-5ZKPBMRK.mjs +2411 -0
- package/dist/{chunk-5K7VXAYM.mjs → chunk-ADGL6RFX.mjs} +2 -4
- package/dist/chunk-BXW3VIKV.mjs +90 -0
- package/dist/{chart.js → chunk-CN7GI2RJ.mjs} +250 -103
- package/dist/chunk-G6YKGVQR.mjs +769 -0
- package/dist/{chunk-PZTHM6WG.mjs → chunk-HI4EEDN5.mjs} +897 -357
- package/dist/{chunk-5ADMXO3Y.mjs → chunk-INRG3D4M.mjs} +5 -11
- package/dist/{chunk-DCORNTCY.mjs → chunk-JE3Z52FD.mjs} +85 -64
- package/dist/chunk-KZOQW6NT.mjs +0 -0
- package/dist/chunk-LMOJKJOY.mjs +2616 -0
- package/dist/{chunk-YJA5VQW6.mjs → chunk-MHCHR65A.mjs} +2 -4
- package/dist/{chunk-IGPNIM2B.mjs → chunk-PASXFYKQ.mjs} +2 -4
- package/dist/chunk-UBBOLLOS.mjs +999 -0
- package/dist/events.d.mts +1 -0
- package/dist/events.d.ts +1 -0
- package/dist/{event-market-page.js → events.js} +5128 -5274
- package/dist/events.mjs +17 -0
- package/dist/index.d.mts +1 -78
- package/dist/index.d.ts +1 -78
- package/dist/index.js +8738 -8534
- package/dist/index.mjs +68 -167
- package/dist/modals.d.mts +1 -0
- package/dist/modals.d.ts +1 -0
- package/dist/{deposit-modal.js → modals.js} +1771 -6
- package/dist/modals.mjs +25 -0
- package/dist/pages.d.mts +1 -0
- package/dist/pages.d.ts +1 -0
- package/dist/pages.js +7928 -0
- package/dist/pages.mjs +16 -0
- package/dist/primitives.d.mts +1 -0
- package/dist/primitives.d.ts +1 -0
- package/dist/{market-details.js → primitives.js} +2980 -3153
- package/dist/{icon.mjs → primitives.mjs} +56 -9
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.d.mts +1 -0
- package/dist/trading.d.ts +1 -0
- package/dist/{place-order.js → trading.js} +1907 -1394
- package/dist/trading.mjs +65 -0
- package/dist/types/auth/connect-button/connect-button.constants.d.mts +10 -0
- package/dist/types/auth/connect-button/connect-button.constants.d.ts +10 -0
- package/dist/{connect-button.d.mts → types/auth/connect-button/connect-button.types.d.mts} +5 -12
- package/dist/{connect-button.d.ts → types/auth/connect-button/connect-button.types.d.ts} +5 -12
- package/dist/types/auth/connect-button/index.d.mts +7 -0
- package/dist/types/auth/connect-button/index.d.ts +7 -0
- package/dist/types/auth/index.d.mts +1 -0
- package/dist/types/auth/index.d.ts +1 -0
- package/dist/types/constants.d.mts +1 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/deposit/deposit-modal.constants.d.mts +9 -0
- package/dist/types/deposit/deposit-modal.constants.d.ts +9 -0
- package/dist/{deposit-modal.d.mts → types/deposit/deposit-modal.types.d.mts} +3 -10
- package/dist/{deposit-modal.d.ts → types/deposit/deposit-modal.types.d.ts} +3 -10
- package/dist/types/deposit/index.d.mts +6 -0
- package/dist/types/deposit/index.d.ts +6 -0
- package/dist/types/deposit/steps/card-deposit.d.mts +7 -0
- package/dist/types/deposit/steps/card-deposit.d.ts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.mts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.ts +7 -0
- package/dist/types/deposit/steps/deposit-method.d.mts +7 -0
- package/dist/types/deposit/steps/deposit-method.d.ts +7 -0
- package/dist/types/deposit/steps/kalshi-deposit.d.mts +5 -0
- package/dist/types/deposit/steps/kalshi-deposit.d.ts +5 -0
- package/dist/types/deposit/steps/venue-selection.d.mts +7 -0
- package/dist/types/deposit/steps/venue-selection.d.ts +7 -0
- package/dist/types/events/index.d.mts +4 -0
- package/dist/types/events/index.d.ts +4 -0
- package/dist/types/events/item/event-list-item.constants.d.mts +1 -0
- package/dist/types/events/item/event-list-item.constants.d.ts +1 -0
- package/dist/types/events/item/event-list-item.types.d.mts +46 -0
- package/dist/types/events/item/event-list-item.types.d.ts +46 -0
- package/dist/types/events/item/event-list-item.utils.d.mts +23 -0
- package/dist/types/events/item/event-list-item.utils.d.ts +23 -0
- package/dist/types/events/item/index.d.mts +6 -0
- package/dist/types/events/item/index.d.ts +6 -0
- package/dist/types/events/item-details/event-list-item-details.constants.d.mts +10 -0
- package/dist/types/events/item-details/event-list-item-details.constants.d.ts +10 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +53 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +53 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +26 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +26 -0
- package/dist/types/events/item-details/index.d.mts +6 -0
- package/dist/types/events/item-details/index.d.ts +6 -0
- package/dist/types/events/list/event-list.constants.d.mts +3 -0
- package/dist/types/events/list/event-list.constants.d.ts +3 -0
- package/dist/types/events/list/event-list.types.d.mts +21 -0
- package/dist/types/events/list/event-list.types.d.ts +21 -0
- package/dist/types/events/list/event-list.utils.d.mts +6 -0
- package/dist/types/events/list/event-list.utils.d.ts +6 -0
- package/dist/types/events/list/index.d.mts +6 -0
- package/dist/types/events/list/index.d.ts +6 -0
- package/dist/types/events/market-details/index.d.mts +6 -0
- package/dist/types/events/market-details/index.d.ts +6 -0
- package/dist/types/events/market-details/market-details.constants.d.mts +9 -0
- package/dist/types/events/market-details/market-details.constants.d.ts +9 -0
- package/dist/types/events/market-details/market-details.types.d.mts +63 -0
- package/dist/types/events/market-details/market-details.types.d.ts +63 -0
- package/dist/types/events/market-details/market-details.utils.d.mts +46 -0
- package/dist/types/events/market-details/market-details.utils.d.ts +46 -0
- package/dist/types/index.d.mts +9 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/modals/index.d.mts +4 -0
- package/dist/types/modals/index.d.ts +4 -0
- package/dist/types/onboarding/index.d.mts +11 -0
- package/dist/types/onboarding/index.d.ts +11 -0
- package/dist/types/onboarding/onboarding-modal.constants.d.mts +10 -0
- package/dist/types/onboarding/onboarding-modal.constants.d.ts +10 -0
- package/dist/types/onboarding/onboarding-modal.types.d.mts +55 -0
- package/dist/types/onboarding/onboarding-modal.types.d.ts +55 -0
- package/dist/types/onboarding/steps/connect-accounts.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-accounts.d.ts +5 -0
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +5 -0
- package/dist/types/onboarding/steps/connect-onchain-modal.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-onchain-modal.d.ts +5 -0
- package/dist/types/onboarding/steps/how-it-works.d.mts +5 -0
- package/dist/types/onboarding/steps/how-it-works.d.ts +5 -0
- package/dist/types/onboarding/steps/profile-setup.d.mts +5 -0
- package/dist/types/onboarding/steps/profile-setup.d.ts +5 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +42 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +42 -0
- package/dist/types/pages/event-market/index.d.mts +6 -0
- package/dist/types/pages/event-market/index.d.ts +6 -0
- package/dist/types/pages/home/home.constants.d.mts +8 -0
- package/dist/types/pages/home/home.constants.d.ts +8 -0
- package/dist/{home-page.d.ts → types/pages/home/home.types.d.mts} +8 -18
- package/dist/{home-page.d.mts → types/pages/home/home.types.d.ts} +8 -18
- package/dist/types/pages/home/home.utils.d.mts +3 -0
- package/dist/types/pages/home/home.utils.d.ts +3 -0
- package/dist/types/pages/home/index.d.mts +6 -0
- package/dist/types/pages/home/index.d.ts +6 -0
- package/dist/types/pages/index.d.mts +3 -0
- package/dist/types/pages/index.d.ts +3 -0
- package/dist/types/pages/user-profile/components/activity-row.d.mts +10 -0
- package/dist/types/pages/user-profile/components/activity-row.d.ts +10 -0
- package/dist/types/pages/user-profile/components/balance-display.d.mts +12 -0
- package/dist/types/pages/user-profile/components/balance-display.d.ts +12 -0
- package/dist/types/pages/user-profile/components/balances-card.d.mts +12 -0
- package/dist/types/pages/user-profile/components/balances-card.d.ts +12 -0
- package/dist/types/pages/user-profile/components/default-avatar.d.mts +8 -0
- package/dist/types/pages/user-profile/components/default-avatar.d.ts +8 -0
- package/dist/types/pages/user-profile/components/empty-state.d.mts +10 -0
- package/dist/types/pages/user-profile/components/empty-state.d.ts +10 -0
- package/dist/types/pages/user-profile/components/position-row.d.mts +10 -0
- package/dist/types/pages/user-profile/components/position-row.d.ts +10 -0
- package/dist/types/pages/user-profile/components/positions-activity.d.mts +14 -0
- package/dist/types/pages/user-profile/components/positions-activity.d.ts +14 -0
- package/dist/types/pages/user-profile/components/user-info-card.d.mts +11 -0
- package/dist/types/pages/user-profile/components/user-info-card.d.ts +11 -0
- package/dist/types/pages/user-profile/index.d.mts +6 -0
- package/dist/types/pages/user-profile/index.d.ts +6 -0
- package/dist/types/pages/user-profile/user-profile.constants.d.mts +9 -0
- package/dist/types/pages/user-profile/user-profile.constants.d.ts +9 -0
- package/dist/{user-profile-page.d.ts → types/pages/user-profile/user-profile.types.d.mts} +12 -22
- package/dist/{user-profile-page.d.mts → types/pages/user-profile/user-profile.types.d.ts} +12 -22
- package/dist/types/primitives/badge/badge.constants.d.mts +4 -0
- package/dist/types/primitives/badge/badge.constants.d.ts +4 -0
- package/dist/types/primitives/badge/badge.types.d.mts +18 -0
- package/dist/types/primitives/badge/badge.types.d.ts +18 -0
- package/dist/types/primitives/badge/index.d.mts +7 -0
- package/dist/types/primitives/badge/index.d.ts +7 -0
- package/dist/types/primitives/button/button.constants.d.mts +6 -0
- package/dist/types/primitives/button/button.constants.d.ts +6 -0
- package/dist/types/primitives/button/button.types.d.mts +12 -0
- package/dist/types/primitives/button/button.types.d.ts +12 -0
- package/dist/types/primitives/button/index.d.mts +6 -0
- package/dist/types/primitives/button/index.d.ts +6 -0
- package/dist/types/primitives/card/card.types.d.mts +3 -0
- package/dist/types/primitives/card/card.types.d.ts +3 -0
- package/dist/types/primitives/card/index.d.mts +6 -0
- package/dist/types/primitives/card/index.d.ts +6 -0
- package/dist/{chart.d.mts → types/primitives/chart/index.d.mts} +7 -10
- package/dist/{chart.d.ts → types/primitives/chart/index.d.ts} +7 -10
- package/dist/types/primitives/hello-world.d.mts +4 -0
- package/dist/types/primitives/hello-world.d.ts +4 -0
- package/dist/types/primitives/icon/icon.constants.d.mts +2 -0
- package/dist/types/primitives/icon/icon.constants.d.ts +2 -0
- package/dist/types/primitives/icon/icon.types.d.mts +9 -0
- package/dist/types/primitives/icon/icon.types.d.ts +9 -0
- package/dist/types/primitives/icon/icon.utils.d.mts +2 -0
- package/dist/types/primitives/icon/icon.utils.d.ts +2 -0
- package/dist/types/primitives/icon/index.d.mts +46 -0
- package/dist/types/primitives/icon/index.d.ts +46 -0
- package/dist/types/primitives/icon/registry.d.mts +166 -0
- package/dist/types/primitives/icon/registry.d.ts +166 -0
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.mts +5 -0
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.ts +5 -0
- package/dist/types/primitives/icon/svg/bank.d.mts +5 -0
- package/dist/types/primitives/icon/svg/bank.d.ts +5 -0
- package/dist/types/primitives/icon/svg/best-prices.d.mts +5 -0
- package/dist/types/primitives/icon/svg/best-prices.d.ts +5 -0
- package/dist/types/primitives/icon/svg/bolt.d.mts +5 -0
- package/dist/types/primitives/icon/svg/bolt.d.ts +5 -0
- package/dist/types/primitives/icon/svg/check-badge.d.mts +5 -0
- package/dist/types/primitives/icon/svg/check-badge.d.ts +5 -0
- package/dist/types/primitives/icon/svg/check-circle.d.mts +5 -0
- package/dist/types/primitives/icon/svg/check-circle.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-down.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-down.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-left.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-left.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-right.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-right.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/close.d.mts +5 -0
- package/dist/types/primitives/icon/svg/close.d.ts +5 -0
- package/dist/types/primitives/icon/svg/copy.d.mts +5 -0
- package/dist/types/primitives/icon/svg/copy.d.ts +5 -0
- package/dist/types/primitives/icon/svg/create-account.d.mts +5 -0
- package/dist/types/primitives/icon/svg/create-account.d.ts +5 -0
- package/dist/types/primitives/icon/svg/credit-card.d.mts +5 -0
- package/dist/types/primitives/icon/svg/credit-card.d.ts +5 -0
- package/dist/types/primitives/icon/svg/disconnect.d.mts +5 -0
- package/dist/types/primitives/icon/svg/disconnect.d.ts +5 -0
- package/dist/types/primitives/icon/svg/discord.d.mts +5 -0
- package/dist/types/primitives/icon/svg/discord.d.ts +5 -0
- package/dist/types/primitives/icon/svg/document.d.mts +5 -0
- package/dist/types/primitives/icon/svg/document.d.ts +5 -0
- package/dist/types/primitives/icon/svg/dots-horizontal.d.mts +5 -0
- package/dist/types/primitives/icon/svg/dots-horizontal.d.ts +5 -0
- package/dist/types/primitives/icon/svg/download.d.mts +5 -0
- package/dist/types/primitives/icon/svg/download.d.ts +5 -0
- package/dist/types/primitives/icon/svg/email.d.mts +5 -0
- package/dist/types/primitives/icon/svg/email.d.ts +5 -0
- package/dist/types/primitives/icon/svg/external-link.d.mts +5 -0
- package/dist/types/primitives/icon/svg/external-link.d.ts +5 -0
- package/dist/types/primitives/icon/svg/info.d.mts +5 -0
- package/dist/types/primitives/icon/svg/info.d.ts +5 -0
- package/dist/types/primitives/icon/svg/link-accounts.d.mts +5 -0
- package/dist/types/primitives/icon/svg/link-accounts.d.ts +5 -0
- package/dist/types/primitives/icon/svg/pencil.d.mts +5 -0
- package/dist/types/primitives/icon/svg/pencil.d.ts +5 -0
- package/dist/types/primitives/icon/svg/play-square.d.mts +5 -0
- package/dist/types/primitives/icon/svg/play-square.d.ts +5 -0
- package/dist/types/primitives/icon/svg/profile.d.mts +5 -0
- package/dist/types/primitives/icon/svg/profile.d.ts +5 -0
- package/dist/types/primitives/icon/svg/revenue-alt.d.mts +5 -0
- package/dist/types/primitives/icon/svg/revenue-alt.d.ts +5 -0
- package/dist/types/primitives/icon/svg/search.d.mts +5 -0
- package/dist/types/primitives/icon/svg/search.d.ts +5 -0
- package/dist/types/primitives/icon/svg/shield-trust.d.mts +5 -0
- package/dist/types/primitives/icon/svg/shield-trust.d.ts +5 -0
- package/dist/types/primitives/icon/svg/stay-in-control.d.mts +5 -0
- package/dist/types/primitives/icon/svg/stay-in-control.d.ts +5 -0
- package/dist/types/primitives/icon/svg/telegram.d.mts +5 -0
- package/dist/types/primitives/icon/svg/telegram.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-down.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-down.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/twitter.d.mts +5 -0
- package/dist/types/primitives/icon/svg/twitter.d.ts +5 -0
- package/dist/types/primitives/icon/svg/upload.d.mts +5 -0
- package/dist/types/primitives/icon/svg/upload.d.ts +5 -0
- package/dist/types/primitives/icon/svg/wallet-avatar.d.mts +5 -0
- package/dist/types/primitives/icon/svg/wallet-avatar.d.ts +5 -0
- package/dist/types/primitives/icon/svg/wallet.d.mts +5 -0
- package/dist/types/primitives/icon/svg/wallet.d.ts +5 -0
- package/dist/types/primitives/icon/svg/warning-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/warning-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/warning.d.mts +5 -0
- package/dist/types/primitives/icon/svg/warning.d.ts +5 -0
- package/dist/types/primitives/icon/types.d.mts +5 -0
- package/dist/types/primitives/icon/types.d.ts +5 -0
- package/dist/types/primitives/index.d.mts +17 -0
- package/dist/types/primitives/index.d.ts +17 -0
- package/dist/types/primitives/loading-icon/index.d.mts +11 -0
- package/dist/types/primitives/loading-icon/index.d.ts +11 -0
- package/dist/types/primitives/modal/index.d.mts +10 -0
- package/dist/types/primitives/modal/index.d.ts +10 -0
- package/dist/types/primitives/modal/modal.types.d.mts +54 -0
- package/dist/types/primitives/modal/modal.types.d.ts +54 -0
- package/dist/{number-value.d.mts → types/primitives/number-value.d.mts} +3 -5
- package/dist/{number-value.d.ts → types/primitives/number-value.d.ts} +3 -5
- package/dist/types/primitives/search/index.d.mts +6 -0
- package/dist/types/primitives/search/index.d.ts +6 -0
- package/dist/types/primitives/search/search-empty-icon.d.mts +5 -0
- package/dist/types/primitives/search/search-empty-icon.d.ts +5 -0
- package/dist/types/primitives/search/search.types.d.mts +96 -0
- package/dist/types/primitives/search/search.types.d.ts +96 -0
- package/dist/{select.d.mts → types/primitives/select/index.d.mts} +3 -5
- package/dist/{select.d.ts → types/primitives/select/index.d.ts} +3 -5
- package/dist/types/primitives/skeleton/index.d.mts +7 -0
- package/dist/types/primitives/skeleton/index.d.ts +7 -0
- package/dist/types/primitives/skeleton/skeleton-block.d.mts +8 -0
- package/dist/types/primitives/skeleton/skeleton-block.d.ts +8 -0
- package/dist/{skeleton.d.mts → types/primitives/skeleton/skeleton.types.d.mts} +6 -9
- package/dist/{skeleton.d.ts → types/primitives/skeleton/skeleton.types.d.ts} +6 -9
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.mts +9 -0
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.ts +9 -0
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.mts +12 -0
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.ts +12 -0
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/state-message/index.d.mts +15 -0
- package/dist/types/primitives/state-message/index.d.ts +15 -0
- package/dist/{switch-button.d.mts → types/primitives/switch-button/index.d.mts} +4 -7
- package/dist/{switch-button.d.ts → types/primitives/switch-button/index.d.ts} +4 -7
- package/dist/types/primitives/tabs/index.d.mts +6 -0
- package/dist/types/primitives/tabs/index.d.ts +6 -0
- package/dist/types/primitives/tabs/tabs.types.d.mts +24 -0
- package/dist/types/primitives/tabs/tabs.types.d.ts +24 -0
- package/dist/types/primitives/tabs/tabs.utils.d.mts +14 -0
- package/dist/types/primitives/tabs/tabs.utils.d.ts +14 -0
- package/dist/types/primitives/typography/index.d.mts +7 -0
- package/dist/types/primitives/typography/index.d.ts +7 -0
- package/dist/types/primitives/typography/typography.constants.d.mts +3 -0
- package/dist/types/primitives/typography/typography.constants.d.ts +3 -0
- package/dist/types/primitives/typography/typography.types.d.mts +8 -0
- package/dist/types/primitives/typography/typography.types.d.ts +8 -0
- package/dist/types/primitives/venue-logo/index.d.mts +8 -0
- package/dist/types/primitives/venue-logo/index.d.ts +8 -0
- package/dist/types/primitives/venue-logo/logo-props.d.mts +10 -0
- package/dist/types/primitives/venue-logo/logo-props.d.ts +10 -0
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.ts +5 -0
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.mts +9 -0
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.ts +9 -0
- package/dist/types/primitives/venue-logo/venue-logo.types.d.mts +17 -0
- package/dist/types/primitives/venue-logo/venue-logo.types.d.ts +17 -0
- package/dist/types/profile/index.d.mts +6 -0
- package/dist/types/profile/index.d.ts +6 -0
- package/dist/types/profile/profile-modal.constants.d.mts +17 -0
- package/dist/types/profile/profile-modal.constants.d.ts +17 -0
- package/dist/{profile-modal.d.mts → types/profile/profile-modal.types.d.mts} +4 -11
- package/dist/{profile-modal.d.ts → types/profile/profile-modal.types.d.ts} +4 -11
- package/dist/types/profile/tabs/about-tab.d.mts +16 -0
- package/dist/types/profile/tabs/about-tab.d.ts +16 -0
- package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +18 -0
- package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +18 -0
- package/dist/types/shared/constants.d.mts +23 -0
- package/dist/types/shared/constants.d.ts +23 -0
- package/dist/types/shared/query-error.d.mts +2 -0
- package/dist/types/shared/query-error.d.ts +2 -0
- package/dist/types/shared/types.d.mts +1 -0
- package/dist/types/shared/types.d.ts +1 -0
- package/dist/types/shared/utils.d.mts +15 -0
- package/dist/types/shared/utils.d.ts +15 -0
- package/dist/types/trading/index.d.mts +4 -0
- package/dist/types/trading/index.d.ts +4 -0
- package/dist/{place-order.d.ts → types/trading/place-order/index.d.mts} +3 -7
- package/dist/{place-order.d.mts → types/trading/place-order/index.d.ts} +3 -7
- package/dist/{settlement.d.ts → types/trading/settlement/index.d.mts} +3 -7
- package/dist/{settlement.d.mts → types/trading/settlement/index.d.ts} +3 -7
- package/dist/{types-DkGlbmXq.d.ts → types/trading/types.d.mts} +35 -38
- package/dist/{types-DkGlbmXq.d.mts → types/trading/types.d.ts} +35 -38
- package/dist/types/trading/utils.d.mts +16 -0
- package/dist/types/trading/utils.d.ts +16 -0
- package/dist/types/withdraw/index.d.mts +6 -0
- package/dist/types/withdraw/index.d.ts +6 -0
- package/dist/types/withdraw/steps/kalshi-withdraw.d.mts +5 -0
- package/dist/types/withdraw/steps/kalshi-withdraw.d.ts +5 -0
- package/dist/types/withdraw/steps/venue-selection.d.mts +6 -0
- package/dist/types/withdraw/steps/venue-selection.d.ts +6 -0
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +8 -0
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +8 -0
- package/dist/types/withdraw/steps/withdraw-method.d.mts +7 -0
- package/dist/types/withdraw/steps/withdraw-method.d.ts +7 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.mts +9 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.ts +9 -0
- package/dist/{withdraw-modal.d.mts → types/withdraw/withdraw-modal.types.d.mts} +3 -10
- package/dist/{withdraw-modal.d.ts → types/withdraw/withdraw-modal.types.d.ts} +3 -10
- package/package.json +35 -273
- package/dist/badge.d.mts +0 -28
- package/dist/badge.d.ts +0 -28
- package/dist/badge.js +0 -110
- package/dist/badge.mjs +0 -9
- package/dist/button.d.mts +0 -20
- package/dist/button.d.ts +0 -20
- package/dist/button.js +0 -183
- package/dist/button.mjs +0 -8
- package/dist/card.d.mts +0 -10
- package/dist/card.d.ts +0 -10
- package/dist/card.js +0 -88
- package/dist/card.mjs +0 -7
- package/dist/chart.mjs +0 -8
- package/dist/chunk-3QLOUBDJ.mjs +0 -483
- package/dist/chunk-3W7NBJLU.mjs +0 -371
- package/dist/chunk-4S3I6X7F.mjs +0 -855
- package/dist/chunk-4VUDTWH7.mjs +0 -42
- package/dist/chunk-6JG6I5AY.mjs +0 -654
- package/dist/chunk-BNDFQPHF.mjs +0 -9
- package/dist/chunk-ERGNR6UQ.mjs +0 -67
- package/dist/chunk-FO263M3V.mjs +0 -10
- package/dist/chunk-FO2QCB4Z.mjs +0 -35
- package/dist/chunk-GJ4U5NCE.mjs +0 -134
- package/dist/chunk-GNSPZ53C.mjs +0 -991
- package/dist/chunk-HOXTJ742.mjs +0 -146
- package/dist/chunk-JNH64AKR.mjs +0 -720
- package/dist/chunk-K6IJ4WBM.mjs +0 -67
- package/dist/chunk-KAGYJ4XT.mjs +0 -126
- package/dist/chunk-LA3FBBSJ.mjs +0 -311
- package/dist/chunk-LCZKSITC.mjs +0 -162
- package/dist/chunk-M4RJHRFT.mjs +0 -445
- package/dist/chunk-MBHTXNHX.mjs +0 -289
- package/dist/chunk-MJHKBCXQ.mjs +0 -379
- package/dist/chunk-NDG43KGL.mjs +0 -44
- package/dist/chunk-NH2G3POM.mjs +0 -470
- package/dist/chunk-OBCHURW5.mjs +0 -64
- package/dist/chunk-OH56VUYK.mjs +0 -321
- package/dist/chunk-OJVTGNIF.mjs +0 -230
- package/dist/chunk-P2PJBO5C.mjs +0 -280
- package/dist/chunk-PORVP72S.mjs +0 -277
- package/dist/chunk-QLMVKLNJ.mjs +0 -669
- package/dist/chunk-QM7CGMFG.mjs +0 -156
- package/dist/chunk-S3H63TQ5.mjs +0 -537
- package/dist/chunk-ZFMCCBP6.mjs +0 -25
- package/dist/connect-button.mjs +0 -14
- package/dist/deposit-modal.mjs +0 -15
- package/dist/event-list-item-details.d.mts +0 -11
- package/dist/event-list-item-details.d.ts +0 -11
- package/dist/event-list-item-details.js +0 -2254
- package/dist/event-list-item-details.mjs +0 -19
- package/dist/event-list-item-details.types-CMbXOrT-.d.ts +0 -53
- package/dist/event-list-item-details.types-DekJKeMD.d.mts +0 -53
- package/dist/event-list-item.d.mts +0 -10
- package/dist/event-list-item.d.ts +0 -10
- package/dist/event-list-item.js +0 -2600
- package/dist/event-list-item.mjs +0 -17
- package/dist/event-list-item.types-Y6IeJ4e4.d.mts +0 -46
- package/dist/event-list-item.types-Y6IeJ4e4.d.ts +0 -46
- package/dist/event-list.d.mts +0 -9
- package/dist/event-list.d.ts +0 -9
- package/dist/event-list.js +0 -3578
- package/dist/event-list.mjs +0 -20
- package/dist/event-list.types-CkAAUqwW.d.mts +0 -13
- package/dist/event-list.types-CkAAUqwW.d.ts +0 -13
- package/dist/event-market-page.d.mts +0 -52
- package/dist/event-market-page.d.ts +0 -52
- package/dist/event-market-page.mjs +0 -28
- package/dist/hello-world.d.mts +0 -8
- package/dist/hello-world.d.ts +0 -8
- package/dist/hello-world.js +0 -92
- package/dist/hello-world.mjs +0 -8
- package/dist/home-page.js +0 -3842
- package/dist/home-page.mjs +0 -21
- package/dist/icon.d.mts +0 -193
- package/dist/icon.d.ts +0 -193
- package/dist/icon.js +0 -1465
- package/dist/loading-icon.d.mts +0 -14
- package/dist/loading-icon.d.ts +0 -14
- package/dist/loading-icon.js +0 -112
- package/dist/loading-icon.mjs +0 -8
- package/dist/market-details.d.mts +0 -73
- package/dist/market-details.d.ts +0 -73
- package/dist/market-details.mjs +0 -21
- package/dist/modal.d.mts +0 -66
- package/dist/modal.d.ts +0 -66
- package/dist/modal.js +0 -321
- package/dist/modal.mjs +0 -9
- package/dist/number-value.js +0 -67
- package/dist/number-value.mjs +0 -7
- package/dist/onboarding-modal.d.mts +0 -88
- package/dist/onboarding-modal.d.ts +0 -88
- package/dist/onboarding-modal.js +0 -2836
- package/dist/onboarding-modal.mjs +0 -24
- package/dist/place-order.mjs +0 -18
- package/dist/profile-modal.js +0 -2447
- package/dist/profile-modal.mjs +0 -14
- package/dist/registry-DfSCFAdC.d.mts +0 -178
- package/dist/registry-DfSCFAdC.d.ts +0 -178
- package/dist/search.d.mts +0 -51
- package/dist/search.d.ts +0 -51
- package/dist/search.js +0 -1954
- package/dist/search.mjs +0 -12
- package/dist/select.js +0 -1552
- package/dist/select.mjs +0 -11
- package/dist/settlement.js +0 -2445
- package/dist/settlement.mjs +0 -15
- package/dist/skeleton.js +0 -490
- package/dist/skeleton.mjs +0 -10
- package/dist/switch-button.js +0 -191
- package/dist/switch-button.mjs +0 -7
- package/dist/tabs.d.mts +0 -31
- package/dist/tabs.d.ts +0 -31
- package/dist/tabs.js +0 -2078
- package/dist/tabs.mjs +0 -12
- package/dist/types-BVj9ky9P.d.mts +0 -3
- package/dist/types-BVj9ky9P.d.ts +0 -3
- package/dist/typography.d.mts +0 -18
- package/dist/typography.d.ts +0 -18
- package/dist/typography.js +0 -93
- package/dist/typography.mjs +0 -9
- package/dist/user-profile-page.js +0 -3081
- package/dist/user-profile-page.mjs +0 -15
- package/dist/venue-logo.d.mts +0 -13
- package/dist/venue-logo.d.ts +0 -13
- package/dist/venue-logo.js +0 -323
- package/dist/venue-logo.mjs +0 -10
- package/dist/venue-logo.types-CGUc22ly.d.mts +0 -19
- package/dist/venue-logo.types-Dqr39S1-.d.ts +0 -19
- package/dist/withdraw-modal.js +0 -2449
- package/dist/withdraw-modal.mjs +0 -14
package/dist/chunk-OH56VUYK.mjs
DELETED
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EventListItem
|
|
3
|
-
} from "./chunk-LA3FBBSJ.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Tabs
|
|
6
|
-
} from "./chunk-S3H63TQ5.mjs";
|
|
7
|
-
import {
|
|
8
|
-
Skeleton
|
|
9
|
-
} from "./chunk-M4RJHRFT.mjs";
|
|
10
|
-
import {
|
|
11
|
-
VenueLogo
|
|
12
|
-
} from "./chunk-PORVP72S.mjs";
|
|
13
|
-
import {
|
|
14
|
-
Icon
|
|
15
|
-
} from "./chunk-PZTHM6WG.mjs";
|
|
16
|
-
import {
|
|
17
|
-
Typography
|
|
18
|
-
} from "./chunk-ERGNR6UQ.mjs";
|
|
19
|
-
import {
|
|
20
|
-
cn
|
|
21
|
-
} from "./chunk-GJ4U5NCE.mjs";
|
|
22
|
-
|
|
23
|
-
// src/events/list/index.tsx
|
|
24
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
25
|
-
import { useEvents, useLabels } from "@agg-market/hooks";
|
|
26
|
-
|
|
27
|
-
// src/events/list/event-list.constants.ts
|
|
28
|
-
var POLYMARKET_VENUE = "polymarket";
|
|
29
|
-
var KALSHI_VENUE = "kalshi";
|
|
30
|
-
var POLYMARKET_VENUE_LOGO = "polymarket";
|
|
31
|
-
var KALSHI_VENUE_LOGO = "kalshi";
|
|
32
|
-
var getDefaultEventListTabs = (labels) => {
|
|
33
|
-
return [
|
|
34
|
-
{
|
|
35
|
-
value: "matched",
|
|
36
|
-
label: labels.eventList.matchedTab,
|
|
37
|
-
iconName: "arrows-to-dot"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
value: "polymarket",
|
|
41
|
-
label: labels.venues.polymarket,
|
|
42
|
-
venueLogo: POLYMARKET_VENUE_LOGO,
|
|
43
|
-
venues: [POLYMARKET_VENUE]
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
value: "kalshi",
|
|
47
|
-
label: labels.venues.kalshi,
|
|
48
|
-
venueLogo: KALSHI_VENUE_LOGO,
|
|
49
|
-
venues: [KALSHI_VENUE]
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// src/events/list/event-list.utils.ts
|
|
55
|
-
var mapEventToEventListItemEvent = (event) => {
|
|
56
|
-
const mergedVenueMarkets = event.markets.flatMap((m) => m.venueMarkets);
|
|
57
|
-
if (mergedVenueMarkets.length === 0)
|
|
58
|
-
return null;
|
|
59
|
-
return event;
|
|
60
|
-
};
|
|
61
|
-
var filterEventsByTabValue = (events, _tabValue) => {
|
|
62
|
-
return events;
|
|
63
|
-
};
|
|
64
|
-
var resolveTabVenus = (tab) => {
|
|
65
|
-
if (!tab)
|
|
66
|
-
return void 0;
|
|
67
|
-
if (tab.venues && tab.venues.length > 0)
|
|
68
|
-
return tab.venues;
|
|
69
|
-
if (tab.value === "polymarket" || tab.value === "kalshi") {
|
|
70
|
-
return [tab.value];
|
|
71
|
-
}
|
|
72
|
-
return void 0;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// src/events/list/index.tsx
|
|
76
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
77
|
-
var renderTabIcon = (tab, isActive) => {
|
|
78
|
-
if (tab.venueLogo) {
|
|
79
|
-
return /* @__PURE__ */ jsx(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
80
|
-
}
|
|
81
|
-
if (!tab.iconName)
|
|
82
|
-
return null;
|
|
83
|
-
return /* @__PURE__ */ jsx(
|
|
84
|
-
Icon,
|
|
85
|
-
{
|
|
86
|
-
name: tab.iconName,
|
|
87
|
-
size: "small",
|
|
88
|
-
color: isActive ? "var(--agg-color-primary)" : "var(--agg-color-foreground)"
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
};
|
|
92
|
-
var TAB_MIN_WIDTH = 80;
|
|
93
|
-
var TAB_HORIZONTAL_PADDING = 32;
|
|
94
|
-
var TAB_ICON_AND_GAP_WIDTH = 24;
|
|
95
|
-
var TAB_OUTER_BORDER_WIDTH = 2;
|
|
96
|
-
var TAB_INNER_BORDER_WIDTH = 1;
|
|
97
|
-
var measureTabLabelWidth = (label) => {
|
|
98
|
-
if (typeof document === "undefined")
|
|
99
|
-
return label.length * 9;
|
|
100
|
-
const canvas = document.createElement("canvas");
|
|
101
|
-
const context = canvas.getContext("2d");
|
|
102
|
-
if (!context)
|
|
103
|
-
return label.length * 9;
|
|
104
|
-
context.font = "700 16px Inter";
|
|
105
|
-
return context.measureText(label).width;
|
|
106
|
-
};
|
|
107
|
-
var estimateTabsWidth = (items) => {
|
|
108
|
-
if (items.length === 0)
|
|
109
|
-
return 0;
|
|
110
|
-
const tabsWidth = items.reduce((sum, item) => {
|
|
111
|
-
const textWidth = Math.ceil(measureTabLabelWidth(item.label));
|
|
112
|
-
const iconWidth = item.icon ? TAB_ICON_AND_GAP_WIDTH : 0;
|
|
113
|
-
const buttonWidth = Math.max(TAB_MIN_WIDTH, textWidth + iconWidth + TAB_HORIZONTAL_PADDING);
|
|
114
|
-
return sum + buttonWidth;
|
|
115
|
-
}, 0);
|
|
116
|
-
return tabsWidth + TAB_OUTER_BORDER_WIDTH + (items.length - 1) * TAB_INNER_BORDER_WIDTH;
|
|
117
|
-
};
|
|
118
|
-
var EventList = ({
|
|
119
|
-
title,
|
|
120
|
-
maxItemsPerRow = 3,
|
|
121
|
-
limit = 3,
|
|
122
|
-
maxVisibleItems,
|
|
123
|
-
showVenueLogo = true,
|
|
124
|
-
search,
|
|
125
|
-
categoryIds
|
|
126
|
-
}) => {
|
|
127
|
-
var _a, _b;
|
|
128
|
-
const labels = useLabels();
|
|
129
|
-
const defaultEventListTabs = useMemo(() => {
|
|
130
|
-
return getDefaultEventListTabs(labels);
|
|
131
|
-
}, [labels]);
|
|
132
|
-
const [activeTabValue, setActiveTabValue] = useState(
|
|
133
|
-
(_b = (_a = defaultEventListTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
|
|
134
|
-
);
|
|
135
|
-
const [_shouldUseSelectOverflow, setShouldUseSelectOverflow] = useState(false);
|
|
136
|
-
const activeTab = useMemo(() => {
|
|
137
|
-
return defaultEventListTabs.find((tab) => tab.value === activeTabValue);
|
|
138
|
-
}, [activeTabValue]);
|
|
139
|
-
const venues = useMemo(() => {
|
|
140
|
-
return resolveTabVenus(activeTab);
|
|
141
|
-
}, [activeTab]);
|
|
142
|
-
const resolvedMaxVisibleItems = useMemo(() => {
|
|
143
|
-
if (!Number.isFinite(maxVisibleItems))
|
|
144
|
-
return void 0;
|
|
145
|
-
return Math.max(1, Math.floor(maxVisibleItems));
|
|
146
|
-
}, [maxVisibleItems]);
|
|
147
|
-
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
148
|
-
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
149
|
-
const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = useEvents({
|
|
150
|
-
venues,
|
|
151
|
-
search,
|
|
152
|
-
categoryIds,
|
|
153
|
-
limit: requestLimit
|
|
154
|
-
});
|
|
155
|
-
const filteredEvents = useMemo(() => {
|
|
156
|
-
return filterEventsByTabValue(events, activeTabValue);
|
|
157
|
-
}, [events, activeTabValue]);
|
|
158
|
-
const tileEvents = useMemo(() => {
|
|
159
|
-
const normalizedEvents = filteredEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
|
|
160
|
-
if (resolvedMaxVisibleItems == null)
|
|
161
|
-
return normalizedEvents;
|
|
162
|
-
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
163
|
-
}, [filteredEvents, resolvedMaxVisibleItems]);
|
|
164
|
-
const tabsItems = useMemo(() => {
|
|
165
|
-
return defaultEventListTabs.map((tab) => {
|
|
166
|
-
const isActive = tab.value === activeTabValue;
|
|
167
|
-
return {
|
|
168
|
-
value: tab.value,
|
|
169
|
-
label: tab.label,
|
|
170
|
-
icon: renderTabIcon(tab, isActive),
|
|
171
|
-
disabled: tab.disabled
|
|
172
|
-
};
|
|
173
|
-
});
|
|
174
|
-
}, [activeTabValue]);
|
|
175
|
-
const headerRef = useRef(null);
|
|
176
|
-
const titleRef = useRef(null);
|
|
177
|
-
const updateTabsOverflowBehavior = useCallback(() => {
|
|
178
|
-
if (typeof window === "undefined")
|
|
179
|
-
return;
|
|
180
|
-
const headerElement = headerRef.current;
|
|
181
|
-
const titleElement = titleRef.current;
|
|
182
|
-
if (!headerElement || !titleElement)
|
|
183
|
-
return;
|
|
184
|
-
const isDesktop = window.matchMedia("(min-width: 768px)").matches;
|
|
185
|
-
if (!isDesktop) {
|
|
186
|
-
setShouldUseSelectOverflow(false);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
const headerStyles = window.getComputedStyle(headerElement);
|
|
190
|
-
const rawGap = headerStyles.columnGap || headerStyles.gap || "0";
|
|
191
|
-
const horizontalGap = Number.parseFloat(rawGap) || 0;
|
|
192
|
-
const availableTabsWidth = headerElement.clientWidth - titleElement.getBoundingClientRect().width - horizontalGap;
|
|
193
|
-
const estimatedTabsWidth = estimateTabsWidth(tabsItems);
|
|
194
|
-
setShouldUseSelectOverflow(availableTabsWidth > 0 && estimatedTabsWidth > availableTabsWidth);
|
|
195
|
-
}, [tabsItems]);
|
|
196
|
-
useEffect(() => {
|
|
197
|
-
updateTabsOverflowBehavior();
|
|
198
|
-
}, [updateTabsOverflowBehavior]);
|
|
199
|
-
useEffect(() => {
|
|
200
|
-
if (typeof ResizeObserver === "undefined")
|
|
201
|
-
return;
|
|
202
|
-
const headerElement = headerRef.current;
|
|
203
|
-
const titleElement = titleRef.current;
|
|
204
|
-
if (!headerElement || !titleElement)
|
|
205
|
-
return;
|
|
206
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
207
|
-
updateTabsOverflowBehavior();
|
|
208
|
-
});
|
|
209
|
-
resizeObserver.observe(headerElement);
|
|
210
|
-
resizeObserver.observe(titleElement);
|
|
211
|
-
return () => {
|
|
212
|
-
resizeObserver.disconnect();
|
|
213
|
-
};
|
|
214
|
-
}, [updateTabsOverflowBehavior]);
|
|
215
|
-
const resolvedMaxItemsPerRow = Number.isFinite(maxItemsPerRow) ? Math.max(1, Math.floor(maxItemsPerRow)) : 1;
|
|
216
|
-
const loadingPlaceholderCount = isFetchingNextPage ? Math.min(resolvedMaxItemsPerRow, resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : Infinity) : 0;
|
|
217
|
-
const shouldRenderLoadingState = isLoading && tileEvents.length === 0;
|
|
218
|
-
const loadMoreRef = useRef(null);
|
|
219
|
-
useEffect(() => {
|
|
220
|
-
if (!shouldPaginate)
|
|
221
|
-
return;
|
|
222
|
-
if (!hasNextPage)
|
|
223
|
-
return;
|
|
224
|
-
const target = loadMoreRef.current;
|
|
225
|
-
if (!target)
|
|
226
|
-
return;
|
|
227
|
-
const observer = new IntersectionObserver(
|
|
228
|
-
(entries) => {
|
|
229
|
-
const entry = entries[0];
|
|
230
|
-
if (!(entry == null ? void 0 : entry.isIntersecting))
|
|
231
|
-
return;
|
|
232
|
-
if (isLoading || isFetchingNextPage || !hasNextPage)
|
|
233
|
-
return;
|
|
234
|
-
void fetchNextPage();
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
rootMargin: "320px 0px"
|
|
238
|
-
}
|
|
239
|
-
);
|
|
240
|
-
observer.observe(target);
|
|
241
|
-
return () => {
|
|
242
|
-
observer.disconnect();
|
|
243
|
-
};
|
|
244
|
-
}, [fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, shouldPaginate]);
|
|
245
|
-
const gridStyle = {
|
|
246
|
-
["--agg-event-list-columns"]: String(resolvedMaxItemsPerRow)
|
|
247
|
-
};
|
|
248
|
-
const gridClassName = cn(
|
|
249
|
-
"grid grid-cols-1 gap-5",
|
|
250
|
-
"md:[grid-template-columns:repeat(var(--agg-event-list-columns),minmax(0,1fr))]"
|
|
251
|
-
);
|
|
252
|
-
if (shouldRenderLoadingState) {
|
|
253
|
-
return /* @__PURE__ */ jsx(Skeleton, { view: "event-list", ariaLabel: labels.eventList.loading(title) });
|
|
254
|
-
}
|
|
255
|
-
return /* @__PURE__ */ jsxs("section", { className: "flex w-full flex-col gap-5", children: [
|
|
256
|
-
/* @__PURE__ */ jsxs(
|
|
257
|
-
"header",
|
|
258
|
-
{
|
|
259
|
-
ref: headerRef,
|
|
260
|
-
className: "flex flex-col sm:flex-row w-full flex-nowrap items-start sm:items-center justify-between gap-2 sm:gap-4",
|
|
261
|
-
children: [
|
|
262
|
-
/* @__PURE__ */ jsx("div", { ref: titleRef, className: "min-w-0", children: /* @__PURE__ */ jsx(Typography, { as: "h2", variant: "title", className: "truncate [&::first-letter]:uppercase", children: title }) }),
|
|
263
|
-
/* @__PURE__ */ jsx(
|
|
264
|
-
Tabs,
|
|
265
|
-
{
|
|
266
|
-
ariaLabel: labels.eventList.tabsAria(title),
|
|
267
|
-
items: tabsItems,
|
|
268
|
-
value: activeTabValue,
|
|
269
|
-
onChange: setActiveTabValue
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
]
|
|
273
|
-
}
|
|
274
|
-
),
|
|
275
|
-
/* @__PURE__ */ jsxs("div", { className: gridClassName, style: gridStyle, children: [
|
|
276
|
-
tileEvents.map((event) => /* @__PURE__ */ jsx(
|
|
277
|
-
EventListItem,
|
|
278
|
-
{
|
|
279
|
-
event,
|
|
280
|
-
showVenueLogo,
|
|
281
|
-
classNames: {
|
|
282
|
-
root: "w-full min-w-0 max-w-none"
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
event.id
|
|
286
|
-
)),
|
|
287
|
-
Array.from({ length: loadingPlaceholderCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
288
|
-
EventListItem,
|
|
289
|
-
{
|
|
290
|
-
isLoading: true,
|
|
291
|
-
classNames: {
|
|
292
|
-
root: "w-full min-w-0 max-w-none"
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
`loading-${index}`
|
|
296
|
-
)),
|
|
297
|
-
!isLoading && !isError && (tileEvents == null ? void 0 : tileEvents.length) === 0 ? /* @__PURE__ */ jsx(
|
|
298
|
-
Typography,
|
|
299
|
-
{
|
|
300
|
-
variant: "body",
|
|
301
|
-
className: "w-full col-span-full flex flex-col items-center justify-center h-32",
|
|
302
|
-
children: labels.eventList.empty
|
|
303
|
-
}
|
|
304
|
-
) : null,
|
|
305
|
-
isError ? /* @__PURE__ */ jsx(
|
|
306
|
-
Typography,
|
|
307
|
-
{
|
|
308
|
-
variant: "body",
|
|
309
|
-
className: "w-full col-span-full flex flex-col items-center justify-center h-32",
|
|
310
|
-
children: labels.eventList.error
|
|
311
|
-
}
|
|
312
|
-
) : null
|
|
313
|
-
] }),
|
|
314
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */ jsx("div", { ref: loadMoreRef, className: "h-px w-full", "aria-hidden": true }) : null
|
|
315
|
-
] });
|
|
316
|
-
};
|
|
317
|
-
EventList.displayName = "EventList";
|
|
318
|
-
|
|
319
|
-
export {
|
|
320
|
-
EventList
|
|
321
|
-
};
|
package/dist/chunk-OJVTGNIF.mjs
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SwitchButton
|
|
3
|
-
} from "./chunk-LCZKSITC.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__spreadProps,
|
|
6
|
-
__spreadValues,
|
|
7
|
-
cn
|
|
8
|
-
} from "./chunk-GJ4U5NCE.mjs";
|
|
9
|
-
|
|
10
|
-
// src/primitives/chart/index.tsx
|
|
11
|
-
import dayjs from "dayjs";
|
|
12
|
-
import { useLabels, useSdkUiConfig } from "@agg-market/hooks";
|
|
13
|
-
import { useEffect, useMemo, useState } from "react";
|
|
14
|
-
import { Liveline } from "liveline";
|
|
15
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
var normalizeSeries = (series) => {
|
|
17
|
-
return series.map((seriesItem) => {
|
|
18
|
-
const pointsByTime = /* @__PURE__ */ new Map();
|
|
19
|
-
seriesItem.points.forEach((point) => {
|
|
20
|
-
if (!Number.isFinite(point.time) || !Number.isFinite(point.value)) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
pointsByTime.set(Math.floor(point.time), point.value);
|
|
24
|
-
});
|
|
25
|
-
const sortedPoints = [...pointsByTime.entries()].sort((left, right) => left[0] - right[0]).map(([time, value]) => ({
|
|
26
|
-
time,
|
|
27
|
-
value
|
|
28
|
-
}));
|
|
29
|
-
return __spreadProps(__spreadValues({}, seriesItem), {
|
|
30
|
-
points: sortedPoints
|
|
31
|
-
});
|
|
32
|
-
}).filter((seriesItem) => seriesItem.points.length > 0);
|
|
33
|
-
};
|
|
34
|
-
var defaultValueFormatter = (value) => {
|
|
35
|
-
return `${Math.round(value)}%`;
|
|
36
|
-
};
|
|
37
|
-
var resolveTimeFormatter = (windowSeconds) => {
|
|
38
|
-
return (timestamp) => {
|
|
39
|
-
if (!Number.isFinite(timestamp))
|
|
40
|
-
return "";
|
|
41
|
-
if (windowSeconds <= 48 * 60 * 60) {
|
|
42
|
-
return dayjs.unix(timestamp).format("HH:mm");
|
|
43
|
-
}
|
|
44
|
-
if (windowSeconds <= 14 * 24 * 60 * 60) {
|
|
45
|
-
return dayjs.unix(timestamp).format("MMM D HH:mm");
|
|
46
|
-
}
|
|
47
|
-
return dayjs.unix(timestamp).format("MMM D");
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
var toLivelinePoints = (points) => {
|
|
51
|
-
return points.map((point) => ({
|
|
52
|
-
time: point.time,
|
|
53
|
-
value: point.value
|
|
54
|
-
}));
|
|
55
|
-
};
|
|
56
|
-
var resolveWindowSeconds = (normalizedSeries) => {
|
|
57
|
-
const timestamps = normalizedSeries.flatMap(
|
|
58
|
-
(seriesItem) => seriesItem.points.map((point) => point.time)
|
|
59
|
-
);
|
|
60
|
-
if (timestamps.length <= 1)
|
|
61
|
-
return 30;
|
|
62
|
-
const minTimestamp = Math.min(...timestamps);
|
|
63
|
-
const maxTimestamp = Math.max(...timestamps);
|
|
64
|
-
const span = maxTimestamp - minTimestamp;
|
|
65
|
-
if (!Number.isFinite(span) || span <= 0)
|
|
66
|
-
return 30;
|
|
67
|
-
return Math.max(1, Math.floor(span));
|
|
68
|
-
};
|
|
69
|
-
var resolveLatestValue = (points) => {
|
|
70
|
-
const latestPoint = points[points.length - 1];
|
|
71
|
-
if (!latestPoint)
|
|
72
|
-
return 0;
|
|
73
|
-
return latestPoint.value;
|
|
74
|
-
};
|
|
75
|
-
var resolveActiveSeriesId = (series, activeSeriesId) => {
|
|
76
|
-
var _a, _b;
|
|
77
|
-
if (activeSeriesId) {
|
|
78
|
-
const matchingSeries = series.find((seriesItem) => seriesItem.id === activeSeriesId);
|
|
79
|
-
if (matchingSeries) {
|
|
80
|
-
return matchingSeries.id;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return (_b = (_a = series[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
84
|
-
};
|
|
85
|
-
var formatDefaultSeriesLabel = (seriesItem) => {
|
|
86
|
-
return seriesItem.id.charAt(0).toUpperCase() + seriesItem.id.slice(1);
|
|
87
|
-
};
|
|
88
|
-
var renderDefaultSeriesControls = ({
|
|
89
|
-
series,
|
|
90
|
-
activeSeriesId,
|
|
91
|
-
handleSeriesChange,
|
|
92
|
-
defaultSeriesSwitchClassName,
|
|
93
|
-
seriesSwitchAriaLabel,
|
|
94
|
-
formatSeriesOptionAriaLabel
|
|
95
|
-
}) => {
|
|
96
|
-
return /* @__PURE__ */ jsx(
|
|
97
|
-
SwitchButton,
|
|
98
|
-
{
|
|
99
|
-
ariaLabel: seriesSwitchAriaLabel,
|
|
100
|
-
className: defaultSeriesSwitchClassName,
|
|
101
|
-
options: series.map((seriesItem) => ({
|
|
102
|
-
value: seriesItem.id,
|
|
103
|
-
label: formatDefaultSeriesLabel(seriesItem),
|
|
104
|
-
ariaLabel: formatSeriesOptionAriaLabel(formatDefaultSeriesLabel(seriesItem))
|
|
105
|
-
})),
|
|
106
|
-
value: activeSeriesId,
|
|
107
|
-
onValueChange: handleSeriesChange
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
var resolveSelectedSeries = (series, activeSeriesId) => {
|
|
112
|
-
const availableSeriesIds = new Set(series.map((seriesItem) => seriesItem.id));
|
|
113
|
-
if (!availableSeriesIds.has(activeSeriesId)) {
|
|
114
|
-
return series[0];
|
|
115
|
-
}
|
|
116
|
-
return series.find((seriesItem) => seriesItem.id === activeSeriesId);
|
|
117
|
-
};
|
|
118
|
-
var LineChart = ({
|
|
119
|
-
series,
|
|
120
|
-
height = 280,
|
|
121
|
-
width,
|
|
122
|
-
classNames,
|
|
123
|
-
isLoading = false,
|
|
124
|
-
showSeriesControls = true,
|
|
125
|
-
renderSeriesControls
|
|
126
|
-
}) => {
|
|
127
|
-
var _a, _b;
|
|
128
|
-
const labels = useLabels();
|
|
129
|
-
const { theme } = useSdkUiConfig();
|
|
130
|
-
const normalizedSeries = useMemo(() => {
|
|
131
|
-
return normalizeSeries(series);
|
|
132
|
-
}, [series]);
|
|
133
|
-
const [activeSeriesId, setActiveSeriesId] = useState(
|
|
134
|
-
() => resolveActiveSeriesId(normalizedSeries, null)
|
|
135
|
-
);
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
setActiveSeriesId(
|
|
138
|
-
(currentActiveSeriesId) => resolveActiveSeriesId(normalizedSeries, currentActiveSeriesId)
|
|
139
|
-
);
|
|
140
|
-
}, [normalizedSeries]);
|
|
141
|
-
const livelineTheme = theme;
|
|
142
|
-
const handleSeriesChange = (seriesId) => {
|
|
143
|
-
setActiveSeriesId(seriesId);
|
|
144
|
-
};
|
|
145
|
-
const primarySeries = useMemo(() => {
|
|
146
|
-
return resolveSelectedSeries(normalizedSeries, activeSeriesId);
|
|
147
|
-
}, [activeSeriesId, normalizedSeries]);
|
|
148
|
-
const primaryData = useMemo(() => {
|
|
149
|
-
if (!primarySeries) {
|
|
150
|
-
return [];
|
|
151
|
-
}
|
|
152
|
-
return toLivelinePoints(primarySeries.points);
|
|
153
|
-
}, [primarySeries]);
|
|
154
|
-
const primaryValue = useMemo(() => {
|
|
155
|
-
if (!primarySeries) {
|
|
156
|
-
return 0;
|
|
157
|
-
}
|
|
158
|
-
return resolveLatestValue(primarySeries.points);
|
|
159
|
-
}, [primarySeries]);
|
|
160
|
-
const livelineSeries = useMemo(() => {
|
|
161
|
-
return normalizedSeries.map((seriesItem) => ({
|
|
162
|
-
id: seriesItem.id,
|
|
163
|
-
color: seriesItem.color,
|
|
164
|
-
data: toLivelinePoints(seriesItem.points),
|
|
165
|
-
value: resolveLatestValue(seriesItem.points)
|
|
166
|
-
}));
|
|
167
|
-
}, [normalizedSeries]);
|
|
168
|
-
const windowSeconds = useMemo(() => {
|
|
169
|
-
return resolveWindowSeconds(normalizedSeries);
|
|
170
|
-
}, [normalizedSeries]);
|
|
171
|
-
const timeFormatter = useMemo(() => {
|
|
172
|
-
return resolveTimeFormatter(windowSeconds);
|
|
173
|
-
}, [windowSeconds]);
|
|
174
|
-
const seriesControls = showSeriesControls && normalizedSeries.length > 0 ? (_a = renderSeriesControls == null ? void 0 : renderSeriesControls({
|
|
175
|
-
series: normalizedSeries,
|
|
176
|
-
activeSeriesId,
|
|
177
|
-
handleSeriesChange
|
|
178
|
-
})) != null ? _a : normalizedSeries.length > 1 ? renderDefaultSeriesControls({
|
|
179
|
-
series: normalizedSeries,
|
|
180
|
-
activeSeriesId,
|
|
181
|
-
handleSeriesChange,
|
|
182
|
-
defaultSeriesSwitchClassName: classNames == null ? void 0 : classNames.defaultSeriesSwitch,
|
|
183
|
-
seriesSwitchAriaLabel: labels.common.lineChartSeriesSwitchAria,
|
|
184
|
-
formatSeriesOptionAriaLabel: labels.common.lineChartSeriesOptionAria
|
|
185
|
-
}) : null : null;
|
|
186
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("group/agg-chart", "w-full", classNames == null ? void 0 : classNames.root), style: { width }, children: [
|
|
187
|
-
!isLoading && seriesControls ? /* @__PURE__ */ jsx("div", { className: cn("mb-3", classNames == null ? void 0 : classNames.controls), children: seriesControls }) : null,
|
|
188
|
-
/* @__PURE__ */ jsx(
|
|
189
|
-
"div",
|
|
190
|
-
{
|
|
191
|
-
className: cn(
|
|
192
|
-
"overflow-hidden [&>div:not(.agg-livechart):first-of-type]:hidden!",
|
|
193
|
-
classNames == null ? void 0 : classNames.chartViewport
|
|
194
|
-
),
|
|
195
|
-
style: { height },
|
|
196
|
-
role: "img",
|
|
197
|
-
"aria-label": labels.common.lineChartAria,
|
|
198
|
-
children: /* @__PURE__ */ jsx(
|
|
199
|
-
Liveline,
|
|
200
|
-
{
|
|
201
|
-
className: cn("h-full w-full agg-livechart", classNames == null ? void 0 : classNames.liveline),
|
|
202
|
-
data: primaryData,
|
|
203
|
-
value: primaryValue,
|
|
204
|
-
series: livelineSeries,
|
|
205
|
-
color: (_b = primarySeries == null ? void 0 : primarySeries.color) != null ? _b : "var(--agg-color-primary)",
|
|
206
|
-
theme: livelineTheme,
|
|
207
|
-
grid: true,
|
|
208
|
-
momentum: false,
|
|
209
|
-
pulse: false,
|
|
210
|
-
window: windowSeconds,
|
|
211
|
-
formatValue: defaultValueFormatter,
|
|
212
|
-
formatTime: timeFormatter,
|
|
213
|
-
padding: {
|
|
214
|
-
top: 12,
|
|
215
|
-
right: 80,
|
|
216
|
-
bottom: 28,
|
|
217
|
-
left: 12
|
|
218
|
-
},
|
|
219
|
-
loading: isLoading
|
|
220
|
-
}
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
)
|
|
224
|
-
] });
|
|
225
|
-
};
|
|
226
|
-
LineChart.displayName = "LineChart";
|
|
227
|
-
|
|
228
|
-
export {
|
|
229
|
-
LineChart
|
|
230
|
-
};
|