@agg-market/ui 5.0.0 → 7.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 +42 -27
- package/dist/chunk-6I474QXG.mjs +2736 -0
- package/dist/chunk-AVHMI47G.mjs +2409 -0
- package/dist/chunk-BXW3VIKV.mjs +90 -0
- package/dist/{chunk-5K7VXAYM.mjs → chunk-EEQPPN7N.mjs} +2 -4
- package/dist/chunk-EERL6BZF.mjs +997 -0
- package/dist/chunk-KQKLLL4D.mjs +730 -0
- package/dist/chunk-KZOQW6NT.mjs +0 -0
- package/dist/chunk-L5U7RGJV.mjs +1211 -0
- package/dist/{connect-button.js → chunk-MUB7NYWZ.mjs} +1039 -876
- package/dist/chunk-OAJBTVZT.mjs +119 -0
- package/dist/{chunk-QDMHLRDY.mjs → chunk-OVQVAUAI.mjs} +167 -40
- package/dist/chunk-ZYUJ7YEJ.mjs +645 -0
- package/dist/events.d.mts +1 -0
- package/dist/events.d.ts +1 -0
- package/dist/{event-market-page.js → events.js} +5552 -5315
- package/dist/events.mjs +16 -0
- package/dist/index.d.mts +1 -79
- package/dist/index.d.ts +1 -79
- package/dist/index.js +9186 -8374
- package/dist/index.mjs +644 -170
- package/dist/modals.d.mts +1 -0
- package/dist/modals.d.ts +1 -0
- package/dist/{onboarding-modal.js → modals.js} +3472 -1335
- package/dist/modals.mjs +24 -0
- package/dist/pages.d.mts +1 -0
- package/dist/pages.d.ts +1 -0
- package/dist/pages.js +8590 -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} +3914 -3741
- package/dist/{icon.mjs → primitives.mjs} +70 -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} +2404 -1409
- package/dist/trading.mjs +65 -0
- package/dist/types/auth/connect-button-view/connect-button-view.constants.d.mts +31 -0
- package/dist/types/auth/connect-button-view/connect-button-view.constants.d.ts +31 -0
- package/dist/types/auth/connect-button-view/connect-button-view.types.d.mts +83 -0
- package/dist/types/auth/connect-button-view/connect-button-view.types.d.ts +83 -0
- package/dist/types/auth/connect-button-view/index.d.mts +7 -0
- package/dist/types/auth/connect-button-view/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/types/primitives/chart/chart-type-switch.d.mts +10 -0
- package/dist/types/primitives/chart/chart-type-switch.d.ts +10 -0
- package/dist/{chart.d.mts → types/primitives/chart/index.d.mts} +14 -11
- package/dist/{chart.d.ts → types/primitives/chart/index.d.ts} +14 -11
- 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 +53 -0
- package/dist/types/primitives/icon/index.d.ts +53 -0
- package/dist/types/primitives/icon/registry.d.mts +194 -0
- package/dist/types/primitives/icon/registry.d.ts +194 -0
- package/dist/types/primitives/icon/svg/apple.d.mts +5 -0
- package/dist/types/primitives/icon/svg/apple.d.ts +5 -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/chart-candlestick.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chart-candlestick.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chart-line.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chart-line.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/error-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/error-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/ethereum.d.mts +5 -0
- package/dist/types/primitives/icon/svg/ethereum.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/google.d.mts +5 -0
- package/dist/types/primitives/icon/svg/google.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/solana.d.mts +5 -0
- package/dist/types/primitives/icon/svg/solana.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 +18 -0
- package/dist/types/primitives/index.d.ts +18 -0
- package/dist/types/primitives/inline-alert/index.d.mts +16 -0
- package/dist/types/primitives/inline-alert/index.d.ts +16 -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/{state-message.d.mts → types/primitives/state-message/index.d.mts} +2 -3
- package/dist/{state-message.d.ts → types/primitives/state-message/index.d.ts} +2 -3
- 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-limitless.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-limitless.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-BImwqY4o.d.ts → types/trading/types.d.mts} +61 -64
- package/dist/{types-BImwqY4o.d.mts → types/trading/types.d.ts} +61 -64
- 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 +29 -291
- 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.js +0 -438
- package/dist/chart.mjs +0 -8
- package/dist/chunk-34IRJYSU.mjs +0 -146
- package/dist/chunk-3QLOUBDJ.mjs +0 -483
- package/dist/chunk-3W7NBJLU.mjs +0 -371
- package/dist/chunk-4343LYSH.mjs +0 -45
- package/dist/chunk-4S3I6X7F.mjs +0 -855
- package/dist/chunk-4VUDTWH7.mjs +0 -42
- package/dist/chunk-5ADMXO3Y.mjs +0 -456
- package/dist/chunk-6JG6I5AY.mjs +0 -654
- package/dist/chunk-BNDFQPHF.mjs +0 -9
- package/dist/chunk-CTYJVVHJ.mjs +0 -334
- package/dist/chunk-DHBHKIJR.mjs +0 -1049
- package/dist/chunk-ERGNR6UQ.mjs +0 -67
- package/dist/chunk-FO263M3V.mjs +0 -10
- package/dist/chunk-FO2QCB4Z.mjs +0 -35
- package/dist/chunk-GFBF2J3Y.mjs +0 -328
- package/dist/chunk-GJ4U5NCE.mjs +0 -134
- package/dist/chunk-IGPNIM2B.mjs +0 -83
- package/dist/chunk-K6IJ4WBM.mjs +0 -67
- package/dist/chunk-KAGYJ4XT.mjs +0 -126
- package/dist/chunk-KIYMVWL4.mjs +0 -280
- package/dist/chunk-LCZKSITC.mjs +0 -162
- package/dist/chunk-M4RJHRFT.mjs +0 -445
- package/dist/chunk-MJHKBCXQ.mjs +0 -379
- package/dist/chunk-MKVGQ7AS.mjs +0 -168
- package/dist/chunk-NDG43KGL.mjs +0 -44
- package/dist/chunk-NH2G3POM.mjs +0 -470
- package/dist/chunk-OBCHURW5.mjs +0 -64
- package/dist/chunk-OJVTGNIF.mjs +0 -230
- package/dist/chunk-PORVP72S.mjs +0 -277
- package/dist/chunk-PZTHM6WG.mjs +0 -1340
- package/dist/chunk-Q6DGDBPV.mjs +0 -774
- package/dist/chunk-QLMVKLNJ.mjs +0 -669
- package/dist/chunk-S3H63TQ5.mjs +0 -537
- package/dist/chunk-T7TATHPD.mjs +0 -313
- package/dist/chunk-XUCS575S.mjs +0 -65
- package/dist/chunk-YJA5VQW6.mjs +0 -167
- package/dist/chunk-ZFMCCBP6.mjs +0 -25
- package/dist/connect-button.d.mts +0 -40
- package/dist/connect-button.d.ts +0 -40
- package/dist/connect-button.mjs +0 -14
- package/dist/deposit-modal.js +0 -2801
- 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 -3711
- package/dist/event-list-item-details.mjs +0 -23
- 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 -2821
- package/dist/event-list-item.mjs +0 -20
- 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 -3802
- package/dist/event-list.mjs +0 -23
- 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 -30
- 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 -4066
- package/dist/home-page.mjs +0 -24
- 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 -24
- 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.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 -1957
- package/dist/search.mjs +0 -13
- 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/state-message.js +0 -1629
- package/dist/state-message.mjs +0 -14
- 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-S3H63TQ5.mjs
DELETED
|
@@ -1,537 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Select
|
|
3
|
-
} from "./chunk-YJA5VQW6.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__spreadProps,
|
|
6
|
-
__spreadValues,
|
|
7
|
-
cn,
|
|
8
|
-
getMotionClassName,
|
|
9
|
-
getScrollBehavior
|
|
10
|
-
} from "./chunk-GJ4U5NCE.mjs";
|
|
11
|
-
|
|
12
|
-
// src/primitives/tabs/index.tsx
|
|
13
|
-
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
14
|
-
import { useLabels, useSdkUiConfig } from "@agg-market/hooks";
|
|
15
|
-
|
|
16
|
-
// src/primitives/tabs/tabs.utils.ts
|
|
17
|
-
var findNextEnabledIndex = (items, startIndex, direction) => {
|
|
18
|
-
var _a;
|
|
19
|
-
if (items.length === 0)
|
|
20
|
-
return -1;
|
|
21
|
-
for (let step = 1; step <= items.length; step += 1) {
|
|
22
|
-
const nextIndex = (startIndex + direction * step + items.length) % items.length;
|
|
23
|
-
if (!((_a = items[nextIndex]) == null ? void 0 : _a.disabled))
|
|
24
|
-
return nextIndex;
|
|
25
|
-
}
|
|
26
|
-
return -1;
|
|
27
|
-
};
|
|
28
|
-
var findEdgeEnabledIndex = (items, direction) => {
|
|
29
|
-
var _a;
|
|
30
|
-
if (direction === 1) {
|
|
31
|
-
return items.findIndex((item) => !item.disabled);
|
|
32
|
-
}
|
|
33
|
-
for (let index = items.length - 1; index >= 0; index -= 1) {
|
|
34
|
-
if (!((_a = items[index]) == null ? void 0 : _a.disabled))
|
|
35
|
-
return index;
|
|
36
|
-
}
|
|
37
|
-
return -1;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// src/primitives/tabs/index.tsx
|
|
41
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
42
|
-
var mobileTabsMediaQuery = "(max-width: 512px)";
|
|
43
|
-
var getTabButtonClassName = ({
|
|
44
|
-
enableAnimations,
|
|
45
|
-
isBarVariant,
|
|
46
|
-
isActive,
|
|
47
|
-
isDisabled,
|
|
48
|
-
size
|
|
49
|
-
}) => {
|
|
50
|
-
const isSmall = size === "s";
|
|
51
|
-
return cn(
|
|
52
|
-
"cursor-pointer disabled:cursor-not-allowed",
|
|
53
|
-
"relative inline-flex h-full shrink-0 items-center justify-center gap-2 font-agg-sans",
|
|
54
|
-
isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-bold",
|
|
55
|
-
getMotionClassName(
|
|
56
|
-
enableAnimations,
|
|
57
|
-
"transition-[colors] duration-300 ease-in-out motion-reduce:transition-none"
|
|
58
|
-
),
|
|
59
|
-
isBarVariant ? cn(
|
|
60
|
-
"min-w-20 overflow-hidden border-r border-agg-separator last:border-r-0",
|
|
61
|
-
isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
|
|
62
|
-
) : cn(isSmall ? "px-4 text-agg-sm leading-agg-5" : "px-5 text-agg-base leading-agg-6"),
|
|
63
|
-
isBarVariant && isActive && "font-agg-bold text-agg-primary",
|
|
64
|
-
isBarVariant && !isActive && "font-agg-normal text-agg-foreground",
|
|
65
|
-
!isBarVariant && isActive && "font-agg-bold text-agg-primary",
|
|
66
|
-
!isBarVariant && !isActive && "font-agg-normal text-agg-foreground",
|
|
67
|
-
isDisabled && "cursor-not-allowed opacity-60"
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
var Tabs = ({
|
|
71
|
-
items,
|
|
72
|
-
value,
|
|
73
|
-
onChange,
|
|
74
|
-
variant = "bar",
|
|
75
|
-
size = "m",
|
|
76
|
-
overflowBehavior,
|
|
77
|
-
ariaLabel,
|
|
78
|
-
className,
|
|
79
|
-
classNames
|
|
80
|
-
}) => {
|
|
81
|
-
const labels = useLabels();
|
|
82
|
-
const { enableAnimations } = useSdkUiConfig();
|
|
83
|
-
const buttonRefs = useRef([]);
|
|
84
|
-
const dragStateRef = useRef({
|
|
85
|
-
isPointerDown: false,
|
|
86
|
-
isDragging: false,
|
|
87
|
-
pointerId: null,
|
|
88
|
-
startClientX: 0,
|
|
89
|
-
startClientY: 0,
|
|
90
|
-
startScrollLeft: 0
|
|
91
|
-
});
|
|
92
|
-
const suppressClickRef = useRef(false);
|
|
93
|
-
const resolvedAriaLabel = ariaLabel != null ? ariaLabel : labels.common.tabsAria;
|
|
94
|
-
const [isMobileViewport, setIsMobileViewport] = useState(false);
|
|
95
|
-
const [isDraggingTabs, setIsDraggingTabs] = useState(false);
|
|
96
|
-
const [activeUnderlineStyle, setActiveUnderlineStyle] = useState({
|
|
97
|
-
transform: "translateX(0px)",
|
|
98
|
-
width: 0,
|
|
99
|
-
opacity: 0
|
|
100
|
-
});
|
|
101
|
-
const [scrollAffordanceState, setScrollAffordanceState] = useState({
|
|
102
|
-
showStart: false,
|
|
103
|
-
showEnd: false
|
|
104
|
-
});
|
|
105
|
-
const tabListRef = useRef(null);
|
|
106
|
-
const isBarVariant = variant === "bar";
|
|
107
|
-
const resolvedOverflowBehavior = useMemo(() => {
|
|
108
|
-
if (overflowBehavior)
|
|
109
|
-
return overflowBehavior;
|
|
110
|
-
if (!isBarVariant)
|
|
111
|
-
return "scroll";
|
|
112
|
-
return isMobileViewport ? "select" : "scroll";
|
|
113
|
-
}, [isBarVariant, isMobileViewport, overflowBehavior]);
|
|
114
|
-
const shouldUseOverflowScroll = resolvedOverflowBehavior === "scroll";
|
|
115
|
-
const shouldUseOverflowSelect = resolvedOverflowBehavior === "select";
|
|
116
|
-
useEffect(() => {
|
|
117
|
-
if (typeof window === "undefined")
|
|
118
|
-
return;
|
|
119
|
-
const mediaQueryList = window.matchMedia(mobileTabsMediaQuery);
|
|
120
|
-
const handleMediaQueryChange = (event) => {
|
|
121
|
-
setIsMobileViewport(event.matches);
|
|
122
|
-
};
|
|
123
|
-
handleMediaQueryChange(mediaQueryList);
|
|
124
|
-
if (typeof mediaQueryList.addEventListener === "function") {
|
|
125
|
-
mediaQueryList.addEventListener("change", handleMediaQueryChange);
|
|
126
|
-
return () => {
|
|
127
|
-
mediaQueryList.removeEventListener("change", handleMediaQueryChange);
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
mediaQueryList.addListener(handleMediaQueryChange);
|
|
131
|
-
return () => {
|
|
132
|
-
mediaQueryList.removeListener(handleMediaQueryChange);
|
|
133
|
-
};
|
|
134
|
-
}, []);
|
|
135
|
-
const updateScrollAffordances = useCallback(() => {
|
|
136
|
-
if (!shouldUseOverflowScroll) {
|
|
137
|
-
setScrollAffordanceState({
|
|
138
|
-
showStart: false,
|
|
139
|
-
showEnd: false
|
|
140
|
-
});
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
const tabListElement = tabListRef.current;
|
|
144
|
-
if (!tabListElement)
|
|
145
|
-
return;
|
|
146
|
-
const maxScrollLeft = tabListElement.scrollWidth - tabListElement.clientWidth;
|
|
147
|
-
setScrollAffordanceState({
|
|
148
|
-
showStart: tabListElement.scrollLeft > 4,
|
|
149
|
-
showEnd: maxScrollLeft - tabListElement.scrollLeft > 4
|
|
150
|
-
});
|
|
151
|
-
}, [shouldUseOverflowScroll]);
|
|
152
|
-
const renderedItems = items;
|
|
153
|
-
const selectItems = useMemo(() => {
|
|
154
|
-
return items.map((item) => ({
|
|
155
|
-
value: item.value,
|
|
156
|
-
label: item.label,
|
|
157
|
-
disabled: item.disabled
|
|
158
|
-
}));
|
|
159
|
-
}, [items]);
|
|
160
|
-
const isSelectDisabled = !items.some((item) => !item.disabled);
|
|
161
|
-
const handleSelect = (nextValue) => {
|
|
162
|
-
if (nextValue === value)
|
|
163
|
-
return;
|
|
164
|
-
onChange(nextValue);
|
|
165
|
-
};
|
|
166
|
-
const handleMoveFocus = (index) => {
|
|
167
|
-
var _a;
|
|
168
|
-
if (index < 0)
|
|
169
|
-
return;
|
|
170
|
-
const nextItem = renderedItems[index];
|
|
171
|
-
if (!nextItem)
|
|
172
|
-
return;
|
|
173
|
-
handleSelect(nextItem.value);
|
|
174
|
-
(_a = buttonRefs.current[index]) == null ? void 0 : _a.focus();
|
|
175
|
-
};
|
|
176
|
-
const handleKeyDown = (event, index) => {
|
|
177
|
-
switch (event == null ? void 0 : event.key) {
|
|
178
|
-
case "ArrowRight": {
|
|
179
|
-
event == null ? void 0 : event.preventDefault();
|
|
180
|
-
handleMoveFocus(findNextEnabledIndex(renderedItems, index, 1));
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
case "ArrowLeft": {
|
|
184
|
-
event == null ? void 0 : event.preventDefault();
|
|
185
|
-
handleMoveFocus(findNextEnabledIndex(renderedItems, index, -1));
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
case "Home": {
|
|
189
|
-
event == null ? void 0 : event.preventDefault();
|
|
190
|
-
handleMoveFocus(findEdgeEnabledIndex(renderedItems, 1));
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
case "End": {
|
|
194
|
-
event == null ? void 0 : event.preventDefault();
|
|
195
|
-
handleMoveFocus(findEdgeEnabledIndex(renderedItems, -1));
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
default:
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
const tabListClassName = cn(
|
|
203
|
-
"inline-flex items-stretch bg-agg-secondary",
|
|
204
|
-
shouldUseOverflowScroll ? cn(
|
|
205
|
-
"overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
206
|
-
getMotionClassName(enableAnimations, "scroll-smooth")
|
|
207
|
-
) : "overflow-x-auto",
|
|
208
|
-
isBarVariant ? "h-8 rounded-agg-sm border border-agg-separator" : "h-12 border-b border-agg-separator -mb-[1px]",
|
|
209
|
-
shouldUseOverflowScroll && "select-none",
|
|
210
|
-
shouldUseOverflowScroll && !isBarVariant && "snap-x snap-mandatory",
|
|
211
|
-
shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab")
|
|
212
|
-
);
|
|
213
|
-
const handleTabListWheel = (event) => {
|
|
214
|
-
if (!shouldUseOverflowScroll)
|
|
215
|
-
return;
|
|
216
|
-
const tabListElement = event.currentTarget;
|
|
217
|
-
if (tabListElement.scrollWidth <= tabListElement.clientWidth)
|
|
218
|
-
return;
|
|
219
|
-
if (Math.abs(event.deltaX) > Math.abs(event.deltaY))
|
|
220
|
-
return;
|
|
221
|
-
event.preventDefault();
|
|
222
|
-
tabListElement.scrollLeft += event.deltaY;
|
|
223
|
-
};
|
|
224
|
-
const handleTabListPointerDown = (event) => {
|
|
225
|
-
if (!shouldUseOverflowScroll)
|
|
226
|
-
return;
|
|
227
|
-
if (event.pointerType !== "mouse")
|
|
228
|
-
return;
|
|
229
|
-
if (event.button !== 0)
|
|
230
|
-
return;
|
|
231
|
-
const tabListElement = tabListRef.current;
|
|
232
|
-
if (!tabListElement)
|
|
233
|
-
return;
|
|
234
|
-
if (tabListElement.scrollWidth <= tabListElement.clientWidth)
|
|
235
|
-
return;
|
|
236
|
-
dragStateRef.current = {
|
|
237
|
-
isPointerDown: true,
|
|
238
|
-
isDragging: false,
|
|
239
|
-
pointerId: event.pointerId,
|
|
240
|
-
startClientX: event.clientX,
|
|
241
|
-
startClientY: event.clientY,
|
|
242
|
-
startScrollLeft: tabListElement.scrollLeft
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
const handleTabListPointerMove = (event) => {
|
|
246
|
-
if (!shouldUseOverflowScroll)
|
|
247
|
-
return;
|
|
248
|
-
const dragState = dragStateRef.current;
|
|
249
|
-
const tabListElement = tabListRef.current;
|
|
250
|
-
if (!dragState.isPointerDown)
|
|
251
|
-
return;
|
|
252
|
-
if (dragState.pointerId !== event.pointerId)
|
|
253
|
-
return;
|
|
254
|
-
if (!tabListElement)
|
|
255
|
-
return;
|
|
256
|
-
const deltaX = event.clientX - dragState.startClientX;
|
|
257
|
-
const deltaY = event.clientY - dragState.startClientY;
|
|
258
|
-
const horizontalDistance = Math.abs(deltaX);
|
|
259
|
-
const verticalDistance = Math.abs(deltaY);
|
|
260
|
-
const hasExceededDragThreshold = horizontalDistance > 10 && horizontalDistance > verticalDistance;
|
|
261
|
-
if (hasExceededDragThreshold && !dragState.isDragging) {
|
|
262
|
-
dragState.isDragging = true;
|
|
263
|
-
setIsDraggingTabs(true);
|
|
264
|
-
tabListElement.setPointerCapture(event.pointerId);
|
|
265
|
-
}
|
|
266
|
-
if (!dragState.isDragging)
|
|
267
|
-
return;
|
|
268
|
-
event.preventDefault();
|
|
269
|
-
tabListElement.scrollLeft = dragState.startScrollLeft - deltaX;
|
|
270
|
-
};
|
|
271
|
-
const handleEndTabListDrag = (event) => {
|
|
272
|
-
const dragState = dragStateRef.current;
|
|
273
|
-
const tabListElement = tabListRef.current;
|
|
274
|
-
if (!dragState.isPointerDown)
|
|
275
|
-
return;
|
|
276
|
-
if (dragState.pointerId !== event.pointerId)
|
|
277
|
-
return;
|
|
278
|
-
if (tabListElement == null ? void 0 : tabListElement.hasPointerCapture(event.pointerId)) {
|
|
279
|
-
tabListElement.releasePointerCapture(event.pointerId);
|
|
280
|
-
}
|
|
281
|
-
if (dragState.isDragging) {
|
|
282
|
-
suppressClickRef.current = true;
|
|
283
|
-
window.setTimeout(() => {
|
|
284
|
-
suppressClickRef.current = false;
|
|
285
|
-
}, 0);
|
|
286
|
-
}
|
|
287
|
-
dragStateRef.current = {
|
|
288
|
-
isPointerDown: false,
|
|
289
|
-
isDragging: false,
|
|
290
|
-
pointerId: null,
|
|
291
|
-
startClientX: 0,
|
|
292
|
-
startClientY: 0,
|
|
293
|
-
startScrollLeft: 0
|
|
294
|
-
};
|
|
295
|
-
setIsDraggingTabs(false);
|
|
296
|
-
};
|
|
297
|
-
const handleTabListClickCapture = (event) => {
|
|
298
|
-
if (!suppressClickRef.current)
|
|
299
|
-
return;
|
|
300
|
-
event == null ? void 0 : event.preventDefault();
|
|
301
|
-
event == null ? void 0 : event.stopPropagation();
|
|
302
|
-
suppressClickRef.current = false;
|
|
303
|
-
};
|
|
304
|
-
const updateActiveUnderline = useCallback(() => {
|
|
305
|
-
if (isBarVariant) {
|
|
306
|
-
setActiveUnderlineStyle({
|
|
307
|
-
transform: "translateX(0px)",
|
|
308
|
-
width: 0,
|
|
309
|
-
opacity: 0
|
|
310
|
-
});
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
const activeIndex = renderedItems.findIndex((item) => item.value === value);
|
|
314
|
-
const activeButton = activeIndex >= 0 ? buttonRefs.current[activeIndex] : null;
|
|
315
|
-
if (!activeButton || !tabListRef.current) {
|
|
316
|
-
setActiveUnderlineStyle((currentStyle) => __spreadProps(__spreadValues({}, currentStyle), {
|
|
317
|
-
opacity: 0
|
|
318
|
-
}));
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
setActiveUnderlineStyle({
|
|
322
|
-
transform: `translateX(${activeButton.offsetLeft}px)`,
|
|
323
|
-
width: activeButton.offsetWidth,
|
|
324
|
-
opacity: 1
|
|
325
|
-
});
|
|
326
|
-
}, [isBarVariant, renderedItems, value]);
|
|
327
|
-
useLayoutEffect(() => {
|
|
328
|
-
updateActiveUnderline();
|
|
329
|
-
}, [updateActiveUnderline]);
|
|
330
|
-
useEffect(() => {
|
|
331
|
-
if (isBarVariant || !shouldUseOverflowScroll)
|
|
332
|
-
return;
|
|
333
|
-
const tabListElement = tabListRef.current;
|
|
334
|
-
if (!tabListElement)
|
|
335
|
-
return;
|
|
336
|
-
const handleScroll = () => {
|
|
337
|
-
updateActiveUnderline();
|
|
338
|
-
updateScrollAffordances();
|
|
339
|
-
};
|
|
340
|
-
tabListElement.addEventListener("scroll", handleScroll, { passive: true });
|
|
341
|
-
updateScrollAffordances();
|
|
342
|
-
return () => {
|
|
343
|
-
tabListElement.removeEventListener("scroll", handleScroll);
|
|
344
|
-
};
|
|
345
|
-
}, [isBarVariant, shouldUseOverflowScroll, updateActiveUnderline, updateScrollAffordances]);
|
|
346
|
-
useEffect(() => {
|
|
347
|
-
if (!shouldUseOverflowScroll)
|
|
348
|
-
return;
|
|
349
|
-
updateScrollAffordances();
|
|
350
|
-
}, [renderedItems, shouldUseOverflowScroll, updateScrollAffordances, value]);
|
|
351
|
-
useEffect(() => {
|
|
352
|
-
if (isBarVariant && !shouldUseOverflowScroll)
|
|
353
|
-
return;
|
|
354
|
-
if (typeof ResizeObserver === "undefined")
|
|
355
|
-
return;
|
|
356
|
-
const tabListElement = tabListRef.current;
|
|
357
|
-
if (!tabListElement)
|
|
358
|
-
return;
|
|
359
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
360
|
-
updateActiveUnderline();
|
|
361
|
-
updateScrollAffordances();
|
|
362
|
-
});
|
|
363
|
-
resizeObserver.observe(tabListElement);
|
|
364
|
-
return () => {
|
|
365
|
-
resizeObserver.disconnect();
|
|
366
|
-
};
|
|
367
|
-
}, [isBarVariant, shouldUseOverflowScroll, updateActiveUnderline, updateScrollAffordances]);
|
|
368
|
-
useEffect(() => {
|
|
369
|
-
if (!shouldUseOverflowScroll)
|
|
370
|
-
return;
|
|
371
|
-
const tabListElement = tabListRef.current;
|
|
372
|
-
if (!tabListElement)
|
|
373
|
-
return;
|
|
374
|
-
const activeIndex = renderedItems.findIndex((item) => item.value === value);
|
|
375
|
-
const activeButton = activeIndex >= 0 ? buttonRefs.current[activeIndex] : null;
|
|
376
|
-
if (!activeButton)
|
|
377
|
-
return;
|
|
378
|
-
if (tabListElement.scrollWidth - tabListElement.clientWidth <= 1)
|
|
379
|
-
return;
|
|
380
|
-
const currentScrollLeft = tabListElement.scrollLeft;
|
|
381
|
-
const currentScrollRight = currentScrollLeft + tabListElement.clientWidth;
|
|
382
|
-
const activeButtonLeft = activeButton.offsetLeft;
|
|
383
|
-
const activeButtonRight = activeButtonLeft + activeButton.offsetWidth;
|
|
384
|
-
let nextScrollLeft = currentScrollLeft;
|
|
385
|
-
if (activeButtonLeft < currentScrollLeft) {
|
|
386
|
-
nextScrollLeft = activeButtonLeft;
|
|
387
|
-
} else if (activeButtonRight > currentScrollRight) {
|
|
388
|
-
nextScrollLeft = activeButtonRight - tabListElement.clientWidth;
|
|
389
|
-
}
|
|
390
|
-
if (Math.abs(nextScrollLeft - currentScrollLeft) < 1)
|
|
391
|
-
return;
|
|
392
|
-
tabListElement.scrollTo({
|
|
393
|
-
left: Math.max(0, nextScrollLeft),
|
|
394
|
-
behavior: getScrollBehavior(enableAnimations)
|
|
395
|
-
});
|
|
396
|
-
}, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
|
|
397
|
-
if (shouldUseOverflowSelect) {
|
|
398
|
-
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsx(
|
|
399
|
-
Select,
|
|
400
|
-
{
|
|
401
|
-
ariaLabel,
|
|
402
|
-
className: "w-full",
|
|
403
|
-
disabled: isSelectDisabled,
|
|
404
|
-
items: selectItems,
|
|
405
|
-
onChange: handleSelect,
|
|
406
|
-
value
|
|
407
|
-
}
|
|
408
|
-
) });
|
|
409
|
-
}
|
|
410
|
-
return /* @__PURE__ */ jsxs(
|
|
411
|
-
"div",
|
|
412
|
-
{
|
|
413
|
-
className: cn(
|
|
414
|
-
"group/agg-tabs",
|
|
415
|
-
"relative max-w-full items-stretch font-agg-sans bg-agg-secondary",
|
|
416
|
-
"inline-flex",
|
|
417
|
-
className,
|
|
418
|
-
classNames == null ? void 0 : classNames.root
|
|
419
|
-
),
|
|
420
|
-
children: [
|
|
421
|
-
/* @__PURE__ */ jsxs(
|
|
422
|
-
"div",
|
|
423
|
-
{
|
|
424
|
-
ref: tabListRef,
|
|
425
|
-
role: "tablist",
|
|
426
|
-
"aria-label": resolvedAriaLabel,
|
|
427
|
-
className: cn("relative", tabListClassName, classNames == null ? void 0 : classNames.tabList),
|
|
428
|
-
onClickCapture: handleTabListClickCapture,
|
|
429
|
-
onPointerCancel: handleEndTabListDrag,
|
|
430
|
-
onPointerDown: handleTabListPointerDown,
|
|
431
|
-
onPointerMove: handleTabListPointerMove,
|
|
432
|
-
onPointerUp: handleEndTabListDrag,
|
|
433
|
-
onWheel: handleTabListWheel,
|
|
434
|
-
children: [
|
|
435
|
-
renderedItems.map((item, index) => {
|
|
436
|
-
const isActive = item.value === value;
|
|
437
|
-
return /* @__PURE__ */ jsxs(
|
|
438
|
-
"button",
|
|
439
|
-
{
|
|
440
|
-
ref: (buttonElement) => {
|
|
441
|
-
buttonRefs.current[index] = buttonElement;
|
|
442
|
-
},
|
|
443
|
-
type: "button",
|
|
444
|
-
role: "tab",
|
|
445
|
-
tabIndex: isActive ? 0 : -1,
|
|
446
|
-
"aria-selected": isActive,
|
|
447
|
-
"aria-label": item.label,
|
|
448
|
-
disabled: item.disabled,
|
|
449
|
-
onClick: (e) => {
|
|
450
|
-
e.preventDefault();
|
|
451
|
-
e.stopPropagation();
|
|
452
|
-
handleSelect(item.value);
|
|
453
|
-
},
|
|
454
|
-
onKeyDown: (event) => handleKeyDown(event, index),
|
|
455
|
-
className: cn(
|
|
456
|
-
getTabButtonClassName({
|
|
457
|
-
enableAnimations,
|
|
458
|
-
isBarVariant,
|
|
459
|
-
isActive,
|
|
460
|
-
isDisabled: !!item.disabled,
|
|
461
|
-
size
|
|
462
|
-
}),
|
|
463
|
-
shouldUseOverflowScroll && !isBarVariant && "snap-start"
|
|
464
|
-
),
|
|
465
|
-
children: [
|
|
466
|
-
isBarVariant ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
467
|
-
"span",
|
|
468
|
-
{
|
|
469
|
-
"aria-hidden": true,
|
|
470
|
-
className: cn(
|
|
471
|
-
"pointer-events-none absolute inset-px origin-bottom rounded-[2px] bg-agg-secondary-hover",
|
|
472
|
-
getMotionClassName(
|
|
473
|
-
enableAnimations,
|
|
474
|
-
"transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none"
|
|
475
|
-
),
|
|
476
|
-
isActive ? "scale-y-100 opacity-100" : "scale-y-0 opacity-0"
|
|
477
|
-
)
|
|
478
|
-
}
|
|
479
|
-
) }) : null,
|
|
480
|
-
item.icon ? /* @__PURE__ */ jsx("span", { className: "relative z-10 inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
|
|
481
|
-
/* @__PURE__ */ jsx("span", { className: "relative z-10 truncate whitespace-nowrap [&::first-letter]:uppercase", children: item.label })
|
|
482
|
-
]
|
|
483
|
-
},
|
|
484
|
-
item.value
|
|
485
|
-
);
|
|
486
|
-
}),
|
|
487
|
-
!isBarVariant ? /* @__PURE__ */ jsx(
|
|
488
|
-
"span",
|
|
489
|
-
{
|
|
490
|
-
"aria-hidden": true,
|
|
491
|
-
className: cn(
|
|
492
|
-
"pointer-events-none absolute bottom-0 left-0 rounded-t-agg-sm bg-agg-primary",
|
|
493
|
-
getMotionClassName(
|
|
494
|
-
enableAnimations,
|
|
495
|
-
"transition-[transform,width,opacity] duration-300 ease-in-out"
|
|
496
|
-
),
|
|
497
|
-
"h-[3px]"
|
|
498
|
-
),
|
|
499
|
-
style: activeUnderlineStyle
|
|
500
|
-
}
|
|
501
|
-
) : null
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
),
|
|
505
|
-
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
506
|
-
/* @__PURE__ */ jsx(
|
|
507
|
-
"span",
|
|
508
|
-
{
|
|
509
|
-
"aria-hidden": true,
|
|
510
|
-
className: cn(
|
|
511
|
-
"pointer-events-none absolute top-0 bottom-0 left-8 z-10 w-12 md:w-18 bg-linear-to-r from-agg-secondary via-agg-secondary to-transparent",
|
|
512
|
-
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
513
|
-
scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
|
|
514
|
-
)
|
|
515
|
-
}
|
|
516
|
-
),
|
|
517
|
-
/* @__PURE__ */ jsx(
|
|
518
|
-
"span",
|
|
519
|
-
{
|
|
520
|
-
"aria-hidden": true,
|
|
521
|
-
className: cn(
|
|
522
|
-
"pointer-events-none absolute top-0 right-8 bottom-0 z-10 w-12 md:w-18 bg-linear-to-l from-agg-secondary via-agg-secondary to-transparent",
|
|
523
|
-
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
524
|
-
scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
|
|
525
|
-
)
|
|
526
|
-
}
|
|
527
|
-
)
|
|
528
|
-
] }) : null
|
|
529
|
-
]
|
|
530
|
-
}
|
|
531
|
-
);
|
|
532
|
-
};
|
|
533
|
-
Tabs.displayName = "Tabs";
|
|
534
|
-
|
|
535
|
-
export {
|
|
536
|
-
Tabs
|
|
537
|
-
};
|