@dreamboard-games/sdk 0.2.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/LICENSE.md +96 -0
- package/README.md +12 -0
- package/dist/HandView-ncJIVLhN.d.ts +193 -0
- package/dist/ResourceCounter-CTREyF73.d.ts +102 -0
- package/dist/ThemeProvider-fy0_QzgO.d.ts +99 -0
- package/dist/bundle-TIZcw8LB.d.ts +281 -0
- package/dist/cards-Sl3b40Mv.d.ts +13 -0
- package/dist/chunk-7YAHLYBR.js +481 -0
- package/dist/chunk-7YAHLYBR.js.map +1 -0
- package/dist/chunk-FDNZTDD6.js +8085 -0
- package/dist/chunk-FDNZTDD6.js.map +1 -0
- package/dist/chunk-GKKBPPSW.js +598 -0
- package/dist/chunk-GKKBPPSW.js.map +1 -0
- package/dist/chunk-I46YJSOD.js +1 -0
- package/dist/chunk-I46YJSOD.js.map +1 -0
- package/dist/chunk-KAELH4KC.js +104 -0
- package/dist/chunk-KAELH4KC.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-T3ZKNUZ7.js +1 -0
- package/dist/chunk-T3ZKNUZ7.js.map +1 -0
- package/dist/chunk-T52J5RMF.js +1 -0
- package/dist/chunk-T52J5RMF.js.map +1 -0
- package/dist/chunk-TDSWKVZ4.js +5401 -0
- package/dist/chunk-TDSWKVZ4.js.map +1 -0
- package/dist/chunk-U5C6BONG.js +34 -0
- package/dist/chunk-U5C6BONG.js.map +1 -0
- package/dist/chunk-VDXOF4FW.js +69 -0
- package/dist/chunk-VDXOF4FW.js.map +1 -0
- package/dist/chunk-VFTAA4WO.js +115 -0
- package/dist/chunk-VFTAA4WO.js.map +1 -0
- package/dist/chunk-WN74KVNY.js +17 -0
- package/dist/chunk-WN74KVNY.js.map +1 -0
- package/dist/chunk-WYPQ3GG5.js +10990 -0
- package/dist/chunk-WYPQ3GG5.js.map +1 -0
- package/dist/components-D5ZRE2Hl.d.ts +1451 -0
- package/dist/generated/runtime/primitives.d.ts +12 -0
- package/dist/generated/runtime/primitives.js +180 -0
- package/dist/generated/runtime/primitives.js.map +1 -0
- package/dist/generated/runtime-api.d.ts +3 -0
- package/dist/generated/runtime-api.js +2 -0
- package/dist/generated/runtime-api.js.map +1 -0
- package/dist/generated/runtime.d.ts +14 -0
- package/dist/generated/runtime.js +18 -0
- package/dist/generated/runtime.js.map +1 -0
- package/dist/generated/workspace-contract.d.ts +14 -0
- package/dist/generated/workspace-contract.js +14 -0
- package/dist/generated/workspace-contract.js.map +1 -0
- package/dist/hex-board-view-D_07hO6O.d.ts +933 -0
- package/dist/hex-color-MhOyuY-o.d.ts +8 -0
- package/dist/index-BwqPQtBu.d.ts +1433 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/reducer-bundle-abi.d.ts +1083 -0
- package/dist/infrastructure/reducer-bundle-abi.js +14 -0
- package/dist/infrastructure/reducer-bundle-abi.js.map +1 -0
- package/dist/infrastructure/workspace-codegen.d.ts +53 -0
- package/dist/infrastructure/workspace-codegen.js +44 -0
- package/dist/infrastructure/workspace-codegen.js.map +1 -0
- package/dist/manifest-contract-BNHVGFtU.d.ts +9 -0
- package/dist/package-set.d.ts +13 -0
- package/dist/package-set.js +12 -0
- package/dist/package-set.js.map +1 -0
- package/dist/primitive-props-DpKs-GCr.d.ts +11 -0
- package/dist/reducer.d.ts +3786 -0
- package/dist/reducer.js +8131 -0
- package/dist/reducer.js.map +1 -0
- package/dist/runtime/primitives.d.ts +226 -0
- package/dist/runtime/primitives.js +180 -0
- package/dist/runtime/primitives.js.map +1 -0
- package/dist/runtime/types/runtime-api.d.ts +1 -0
- package/dist/runtime/types/runtime-api.js +2 -0
- package/dist/runtime/types/runtime-api.js.map +1 -0
- package/dist/runtime/workspace-contract.d.ts +172 -0
- package/dist/runtime/workspace-contract.js +14 -0
- package/dist/runtime/workspace-contract.js.map +1 -0
- package/dist/runtime-api-3dshj6kK.d.ts +101 -0
- package/dist/runtime-api-DWxvTr-O.d.ts +379 -0
- package/dist/runtime.d.ts +58 -0
- package/dist/runtime.js +13 -0
- package/dist/runtime.js.map +1 -0
- package/dist/slots-1GPGihk8.d.ts +8 -0
- package/dist/testing.d.ts +149 -0
- package/dist/testing.js +513 -0
- package/dist/testing.js.map +1 -0
- package/dist/types.d.ts +496 -0
- package/dist/types.js +28 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/components.d.ts +16 -0
- package/dist/ui/components.js +192 -0
- package/dist/ui/components.js.map +1 -0
- package/dist/ui/defaults.d.ts +19 -0
- package/dist/ui/defaults.js +104 -0
- package/dist/ui/defaults.js.map +1 -0
- package/dist/ui/plugin-styles.css +250 -0
- package/dist/ui/types/player-state.d.ts +365 -0
- package/dist/ui/types/player-state.js +1 -0
- package/dist/ui/types/player-state.js.map +1 -0
- package/dist/ui-contract-iQfTtUSL.d.ts +1161 -0
- package/dist/ui.d.ts +320 -0
- package/dist/ui.js +253 -0
- package/dist/ui.js.map +1 -0
- package/package.json +199 -0
- package/src/generated/reducer-contract/builders.ts +90 -0
- package/src/generated/reducer-contract/version.ts +9 -0
- package/src/generated/reducer-contract/wire.ts +100 -0
- package/src/generated/reducer-contract/zod.ts +101 -0
- package/src/generated/runtime/primitives.ts +2 -0
- package/src/generated/runtime-api.ts +5 -0
- package/src/generated/runtime.ts +35 -0
- package/src/generated/workspace-contract.ts +2 -0
- package/src/index.ts +7 -0
- package/src/infrastructure/reducer-bundle-abi.ts +8 -0
- package/src/infrastructure/reducer-contract/bundle.ts +37 -0
- package/src/infrastructure/workspace-codegen/hex-geometry.ts +69 -0
- package/src/infrastructure/workspace-codegen/index.ts +64 -0
- package/src/infrastructure/workspace-codegen/manifest-contract.ts +6632 -0
- package/src/infrastructure/workspace-codegen/manifest-validation.ts +795 -0
- package/src/infrastructure/workspace-codegen/ownership.ts +131 -0
- package/src/infrastructure/workspace-codegen/preset-card-sets.ts +169 -0
- package/src/infrastructure/workspace-codegen/seeds.ts +1705 -0
- package/src/infrastructure/workspace-codegen.ts +1 -0
- package/src/package-set.ts +19 -0
- package/src/reducer/authoring/contract.ts +157 -0
- package/src/reducer/authoring/effect.ts +224 -0
- package/src/reducer/authoring/game.ts +23 -0
- package/src/reducer/authoring/interaction.ts +98 -0
- package/src/reducer/authoring/phase.ts +300 -0
- package/src/reducer/authoring/types.ts +70 -0
- package/src/reducer/authoring/validation.ts +382 -0
- package/src/reducer/authoring/view-stage.ts +68 -0
- package/src/reducer/authoring.ts +29 -0
- package/src/reducer/bundle/ingress-bundle.ts +491 -0
- package/src/reducer/bundle/trusted/engine-instruction-resolver.ts +254 -0
- package/src/reducer/bundle/trusted/flow-instruction-resolver.ts +73 -0
- package/src/reducer/bundle/trusted/instruction-runner.ts +414 -0
- package/src/reducer/bundle/trusted/interaction-authorization.ts +137 -0
- package/src/reducer/bundle/trusted/interaction-collectors.ts +859 -0
- package/src/reducer/bundle/trusted/interaction-decision.ts +747 -0
- package/src/reducer/bundle/trusted/interaction-resolver.ts +95 -0
- package/src/reducer/bundle/trusted/interaction-types.ts +171 -0
- package/src/reducer/bundle/trusted/lifecycle-runner.ts +427 -0
- package/src/reducer/bundle/trusted/projection-builder.ts +356 -0
- package/src/reducer/bundle/trusted/projection-context.ts +39 -0
- package/src/reducer/bundle/trusted/rng-sampler.ts +150 -0
- package/src/reducer/bundle/trusted/runtime-registry.ts +120 -0
- package/src/reducer/bundle/trusted/runtime-scope.ts +336 -0
- package/src/reducer/bundle/trusted/simultaneous-player.ts +97 -0
- package/src/reducer/bundle/trusted/stage-resolver.ts +87 -0
- package/src/reducer/bundle/trusted/static-projection.ts +116 -0
- package/src/reducer/bundle/trusted/trusted-runtime-args.ts +97 -0
- package/src/reducer/bundle/trusted/trusted-runtime-result.ts +39 -0
- package/src/reducer/bundle/trusted/trusted-setup-profiles.ts +43 -0
- package/src/reducer/bundle/trusted/trusted-state-codec.ts +48 -0
- package/src/reducer/bundle/trusted-bundle.ts +97 -0
- package/src/reducer/bundle/types.ts +171 -0
- package/src/reducer/bundle.ts +2 -0
- package/src/reducer/client-param-schemas.ts +57 -0
- package/src/reducer/compose.ts +34 -0
- package/src/reducer/core/runtime-input.ts +30 -0
- package/src/reducer/core/runtime-instruction.ts +59 -0
- package/src/reducer/core/types.ts +62 -0
- package/src/reducer/definition-index.ts +277 -0
- package/src/reducer/derived.ts +106 -0
- package/src/reducer/effects.ts +92 -0
- package/src/reducer/engine/runtime-instruction-engine.ts +155 -0
- package/src/reducer/ingress/decode-runtime-input.ts +7 -0
- package/src/reducer/ingress/decode-session-state.ts +9 -0
- package/src/reducer/ingress/encode-session-state.ts +6 -0
- package/src/reducer/ingress/input-codec.ts +18 -0
- package/src/reducer/ingress/phase-schemas.ts +62 -0
- package/src/reducer/ingress/raw-types.ts +107 -0
- package/src/reducer/ingress/runtime-codec.ts +14 -0
- package/src/reducer/ingress/runtime-payload.ts +13 -0
- package/src/reducer/ingress/session-codec.ts +392 -0
- package/src/reducer/ingress/types.ts +6 -0
- package/src/reducer/inputs/boardInput.ts +217 -0
- package/src/reducer/inputs/boardTarget.ts +190 -0
- package/src/reducer/inputs/cardInput.ts +86 -0
- package/src/reducer/inputs/cardTarget.ts +101 -0
- package/src/reducer/inputs/choiceTarget.ts +104 -0
- package/src/reducer/inputs/defineInputs.ts +71 -0
- package/src/reducer/inputs/formInput.ts +809 -0
- package/src/reducer/inputs/many.ts +120 -0
- package/src/reducer/inputs/promptInput.ts +87 -0
- package/src/reducer/inputs/rngInput.ts +58 -0
- package/src/reducer/inputs/targetRule.ts +123 -0
- package/src/reducer/inputs.ts +41 -0
- package/src/reducer/model/definition.ts +1072 -0
- package/src/reducer/model/extract.ts +745 -0
- package/src/reducer/model/manifest.ts +570 -0
- package/src/reducer/model/queries.ts +641 -0
- package/src/reducer/model/runtime.ts +264 -0
- package/src/reducer/model/spec.ts +1386 -0
- package/src/reducer/model/table.ts +260 -0
- package/src/reducer/model.ts +7 -0
- package/src/reducer/ops.ts +1034 -0
- package/src/reducer/parse-utils.ts +28 -0
- package/src/reducer/per-player.ts +422 -0
- package/src/reducer/rng.ts +69 -0
- package/src/reducer/schema-helpers.ts +185 -0
- package/src/reducer/setup-bootstrap-helpers.ts +171 -0
- package/src/reducer/setup-bootstrap.ts +481 -0
- package/src/reducer/table-ops.ts +2671 -0
- package/src/reducer/table-queries.ts +372 -0
- package/src/reducer/transaction.ts +120 -0
- package/src/reducer.ts +314 -0
- package/src/runtime/primitives.ts +1 -0
- package/src/runtime/types/runtime-api.ts +1 -0
- package/src/runtime/workspace-contract.ts +32 -0
- package/src/runtime-internal/components/InteractionForm.tsx +1309 -0
- package/src/runtime-internal/components/PluginRuntime.tsx +103 -0
- package/src/runtime-internal/components/board/target-layer.ts +70 -0
- package/src/runtime-internal/context/ClientParamSchemaContext.tsx +44 -0
- package/src/runtime-internal/context/InteractionDraftContext.tsx +279 -0
- package/src/runtime-internal/context/PluginSessionContext.tsx +47 -0
- package/src/runtime-internal/context/PluginStateContext.tsx +262 -0
- package/src/runtime-internal/context/RuntimeContext.tsx +96 -0
- package/src/runtime-internal/defaults/components.tsx +409 -0
- package/src/runtime-internal/defaults/index.ts +11 -0
- package/src/runtime-internal/errors/ValidationError.ts +29 -0
- package/src/runtime-internal/hooks/useActivePlayers.ts +33 -0
- package/src/runtime-internal/hooks/useBoardInteractions.ts +665 -0
- package/src/runtime-internal/hooks/useGameSelector.ts +105 -0
- package/src/runtime-internal/hooks/useGameView.ts +9 -0
- package/src/runtime-internal/hooks/useInteractionByKey.ts +354 -0
- package/src/runtime-internal/hooks/useInteractionHandle.ts +438 -0
- package/src/runtime-internal/hooks/useIsMyTurn.ts +20 -0
- package/src/runtime-internal/hooks/useLobby.ts +76 -0
- package/src/runtime-internal/hooks/useMe.ts +48 -0
- package/src/runtime-internal/hooks/usePlayerInfo.ts +28 -0
- package/src/runtime-internal/hooks/usePlayerTurnOrder.ts +23 -0
- package/src/runtime-internal/hooks/usePluginRuntime.ts +147 -0
- package/src/runtime-internal/hooks/useSeatInbox.ts +61 -0
- package/src/runtime-internal/hooks/useSimultaneousPhase.ts +10 -0
- package/src/runtime-internal/index.ts +42 -0
- package/src/runtime-internal/internal.ts +43 -0
- package/src/runtime-internal/plugin-styles.css +250 -0
- package/src/runtime-internal/primitives/board.tsx +459 -0
- package/src/runtime-internal/primitives/dialog-lifecycle.ts +58 -0
- package/src/runtime-internal/primitives/dice.tsx +79 -0
- package/src/runtime-internal/primitives/game-ui-provider.tsx +35 -0
- package/src/runtime-internal/primitives/game.tsx +387 -0
- package/src/runtime-internal/primitives/hand-intent-adapter.ts +147 -0
- package/src/runtime-internal/primitives/hand-surface.tsx +594 -0
- package/src/runtime-internal/primitives/index.ts +196 -0
- package/src/runtime-internal/primitives/interaction-form-binding.tsx +56 -0
- package/src/runtime-internal/primitives/interaction-submit.ts +90 -0
- package/src/runtime-internal/primitives/interaction.tsx +987 -0
- package/src/runtime-internal/primitives/phase.tsx +43 -0
- package/src/runtime-internal/primitives/player-roster.tsx +302 -0
- package/src/runtime-internal/primitives/primitive-props.tsx +101 -0
- package/src/runtime-internal/primitives/prompt.tsx +255 -0
- package/src/runtime-internal/primitives/ui.tsx +60 -0
- package/src/runtime-internal/primitives/zone.tsx +791 -0
- package/src/runtime-internal/reducer.ts +30 -0
- package/src/runtime-internal/runtime/createPluginRuntimeAPI.ts +605 -0
- package/src/runtime-internal/types/plugin-state.ts +508 -0
- package/src/runtime-internal/types/reducer-state.ts +24 -0
- package/src/runtime-internal/types/runtime-api.ts +114 -0
- package/src/runtime-internal/ui-contract.ts +519 -0
- package/src/runtime-internal/utils/card-intent-adapter.ts +546 -0
- package/src/runtime-internal/utils/interaction-inputs.ts +492 -0
- package/src/runtime-internal/utils/interaction-labels.ts +23 -0
- package/src/runtime-internal/utils/interaction-router.ts +273 -0
- package/src/runtime-internal/utils/interaction-status.ts +74 -0
- package/src/runtime-internal/workspace-contract.ts +1170 -0
- package/src/runtime.ts +34 -0
- package/src/testing/create-expect-api.ts +352 -0
- package/src/testing/create-test-runtime.ts +381 -0
- package/src/testing/definitions.ts +127 -0
- package/src/testing/index.ts +3 -0
- package/src/testing.ts +1 -0
- package/src/type-stubs/manifest-contract.d.ts +42 -0
- package/src/type-stubs/manifest-contract.js +72 -0
- package/src/type-stubs/ui-contract.d.ts +5 -0
- package/src/type-stubs/ui-contract.js +1 -0
- package/src/types/authoring-card-properties.type-test.ts +266 -0
- package/src/types/authoring.ts +1282 -0
- package/src/types/cards.ts +19 -0
- package/src/types/contracts.ts +1550 -0
- package/src/types/generated-helpers.ts +35 -0
- package/src/types/index.ts +147 -0
- package/src/types/slots.ts +11 -0
- package/src/types.ts +1 -0
- package/src/ui/components/ActionButton.tsx +97 -0
- package/src/ui/components/ActionPanel.tsx +315 -0
- package/src/ui/components/Card.tsx +378 -0
- package/src/ui/components/CardDragSurface.tsx +1076 -0
- package/src/ui/components/ChromeSuppressionContext.tsx +70 -0
- package/src/ui/components/CostDisplay.tsx +145 -0
- package/src/ui/components/DiceRoller.tsx +581 -0
- package/src/ui/components/Drawer.tsx +180 -0
- package/src/ui/components/ErrorBoundary.tsx +275 -0
- package/src/ui/components/GameEndDisplay.tsx +398 -0
- package/src/ui/components/GameSkeleton.tsx +260 -0
- package/src/ui/components/Hand.tsx +468 -0
- package/src/ui/components/HandDock.tsx +299 -0
- package/src/ui/components/HandView.tsx +441 -0
- package/src/ui/components/MobileHandTray.tsx +381 -0
- package/src/ui/components/MoreActions.tsx +143 -0
- package/src/ui/components/PhaseIndicator.tsx +341 -0
- package/src/ui/components/PlayArea.tsx +146 -0
- package/src/ui/components/PrimaryActionButton.tsx +336 -0
- package/src/ui/components/PrimaryButton.tsx +45 -0
- package/src/ui/components/ResourceCounter.tsx +270 -0
- package/src/ui/components/StagingZone.tsx +134 -0
- package/src/ui/components/ThemedButton.tsx +113 -0
- package/src/ui/components/Toast.tsx +264 -0
- package/src/ui/components/board/HexGrid.tsx +1294 -0
- package/src/ui/components/board/NetworkGraph.tsx +476 -0
- package/src/ui/components/board/SlotSystem.tsx +388 -0
- package/src/ui/components/board/SquareGrid.tsx +1165 -0
- package/src/ui/components/board/TrackBoard.tsx +496 -0
- package/src/ui/components/board/ZoneMap.tsx +448 -0
- package/src/ui/components/board/hex-board-view.ts +123 -0
- package/src/ui/components/board/index.ts +142 -0
- package/src/ui/components/board/interaction-accessibility.ts +21 -0
- package/src/ui/components/board/target-layer.ts +66 -0
- package/src/ui/components/card-render-content.type-test.ts +27 -0
- package/src/ui/components/hand-layout-math.ts +163 -0
- package/src/ui/components/hand-pointer-engine.ts +413 -0
- package/src/ui/components/index.ts +245 -0
- package/src/ui/components.ts +1 -0
- package/src/ui/defaults/components.tsx +106 -0
- package/src/ui/defaults/index.ts +8 -0
- package/src/ui/defaults.ts +1 -0
- package/src/ui/errors/ValidationError.ts +29 -0
- package/src/ui/helpers/cards.ts +19 -0
- package/src/ui/helpers/track-board.ts +211 -0
- package/src/ui/hooks/useBoardTopology.ts +316 -0
- package/src/ui/hooks/useCards.ts +10 -0
- package/src/ui/hooks/useHandCardPointer.ts +381 -0
- package/src/ui/hooks/useHandLayout.ts +378 -0
- package/src/ui/hooks/useHandPresentation.ts +121 -0
- package/src/ui/hooks/useHexBoard.ts +74 -0
- package/src/ui/hooks/useHexGrid.ts +185 -0
- package/src/ui/hooks/useIsMobile.ts +35 -0
- package/src/ui/hooks/usePanZoom.ts +278 -0
- package/src/ui/hooks/useSquareBoard.ts +124 -0
- package/src/ui/hooks/useSquareGrid.ts +328 -0
- package/src/ui/index.ts +98 -0
- package/src/ui/internal/ui/alert.tsx +51 -0
- package/src/ui/internal/ui/button.tsx +58 -0
- package/src/ui/internal/ui/dialog.tsx +134 -0
- package/src/ui/internal/ui/input.tsx +21 -0
- package/src/ui/internal/ui/label.tsx +21 -0
- package/src/ui/internal/ui/select.tsx +129 -0
- package/src/ui/internal/ui/tooltip.tsx +54 -0
- package/src/ui/internal/ui/utils.ts +5 -0
- package/src/ui/plugin-styles.css +250 -0
- package/src/ui/primitives/dialog-lifecycle.ts +58 -0
- package/src/ui/primitives/dice.tsx +79 -0
- package/src/ui/primitives/primitive-props.tsx +101 -0
- package/src/ui/theme/ThemeProvider.tsx +252 -0
- package/src/ui/theme/board.ts +61 -0
- package/src/ui/theme/css-vars.ts +105 -0
- package/src/ui/theme/derive.ts +240 -0
- package/src/ui/theme/index.ts +61 -0
- package/src/ui/theme/presets/arcade.ts +261 -0
- package/src/ui/theme/presets/studio.ts +261 -0
- package/src/ui/theme/presets/tabletop.ts +266 -0
- package/src/ui/theme/tokens.ts +392 -0
- package/src/ui/types/hex-color.ts +20 -0
- package/src/ui/types/player-state.ts +463 -0
- package/src/ui/types/tiled-board.ts +785 -0
- package/src/ui/types/visual-state.ts +137 -0
- package/src/ui.ts +1 -0
|
@@ -0,0 +1,1451 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { V as ViewCard } from './cards-Sl3b40Mv.js';
|
|
3
|
+
import { I as InteractionVisualState, a as CardIntent, C as CardDropTargetVisualState } from './HandView-ncJIVLhN.js';
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
import { ReactNode, CSSProperties, RefObject, Component, ErrorInfo, ComponentType, ButtonHTMLAttributes, ElementType, ComponentProps } from 'react';
|
|
6
|
+
import { Transition } from 'framer-motion';
|
|
7
|
+
import './ResourceCounter-CTREyF73.js';
|
|
8
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
9
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
10
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
11
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
12
|
+
import { _ as Theme, I as IntentColor, V as PlayerColor, a as AnySquareBoardInput, S as NormalizedSquareEdgeOf, U as NormalizedSquareVertexOf, T as NormalizedSquarePieceOf, J as InteractiveTargetLayer, R as NormalizedSquareCellOf, K as InteractiveTargetRenderState, n as GeneratedSquareBoardInput, c as AuthoredSquareBoardInput } from './hex-board-view-D_07hO6O.js';
|
|
13
|
+
import { V as ViewSlotOccupant } from './slots-1GPGihk8.js';
|
|
14
|
+
import { SquarePieceState } from './ui/types/player-state.js';
|
|
15
|
+
|
|
16
|
+
interface TrackSpace<SpaceIdValue extends string = string, Data = unknown> {
|
|
17
|
+
id: SpaceIdValue;
|
|
18
|
+
index: number;
|
|
19
|
+
name?: string;
|
|
20
|
+
type?: string;
|
|
21
|
+
/** Override next spaces (for branching) */
|
|
22
|
+
nextSpaces?: readonly SpaceIdValue[];
|
|
23
|
+
/** Jump to another space (snakes/ladders) */
|
|
24
|
+
jumpTo?: SpaceIdValue;
|
|
25
|
+
position: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
data?: Data;
|
|
30
|
+
}
|
|
31
|
+
interface TrackPiece<PieceIdValue extends string = string, SpaceIdValue extends string = string, OwnerIdValue extends string = string, Data = unknown> {
|
|
32
|
+
id: PieceIdValue;
|
|
33
|
+
spaceId: SpaceIdValue;
|
|
34
|
+
owner: OwnerIdValue;
|
|
35
|
+
type?: string;
|
|
36
|
+
data?: Data;
|
|
37
|
+
}
|
|
38
|
+
interface TrackBoardProps {
|
|
39
|
+
spaces: TrackSpace[];
|
|
40
|
+
pieces: TrackPiece[];
|
|
41
|
+
type?: "linear" | "circular" | "branching";
|
|
42
|
+
renderSpace: (space: TrackSpace, pieces: TrackPiece[]) => ReactNode;
|
|
43
|
+
renderConnection?: (from: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
}, to: {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
}, fromSpace: TrackSpace, toSpace: TrackSpace) => ReactNode;
|
|
50
|
+
renderJump?: (from: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
}, to: {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
}, fromSpace: TrackSpace, toSpace: TrackSpace, isUp: boolean) => ReactNode;
|
|
57
|
+
width?: number | string;
|
|
58
|
+
height?: number | string;
|
|
59
|
+
enablePanZoom?: boolean;
|
|
60
|
+
initialZoom?: number;
|
|
61
|
+
minZoom?: number;
|
|
62
|
+
maxZoom?: number;
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
interface DefaultTrackSpaceProps {
|
|
66
|
+
space: TrackSpace;
|
|
67
|
+
size?: number;
|
|
68
|
+
fill?: string;
|
|
69
|
+
stroke?: string;
|
|
70
|
+
strokeWidth?: number;
|
|
71
|
+
isHighlighted?: boolean;
|
|
72
|
+
isSelected?: boolean;
|
|
73
|
+
showJumpIndicator?: boolean;
|
|
74
|
+
onClick?: () => void;
|
|
75
|
+
onHover?: (hovering: boolean) => void;
|
|
76
|
+
className?: string;
|
|
77
|
+
children?: ReactNode;
|
|
78
|
+
}
|
|
79
|
+
declare function DefaultTrackSpace({ space, size, fill, stroke, strokeWidth, isHighlighted, isSelected, showJumpIndicator, onClick, onHover, className, children, }: DefaultTrackSpaceProps): react_jsx_runtime.JSX.Element;
|
|
80
|
+
interface DefaultTrackPieceProps {
|
|
81
|
+
piece: TrackPiece;
|
|
82
|
+
index?: number;
|
|
83
|
+
total?: number;
|
|
84
|
+
radius?: number;
|
|
85
|
+
color?: string;
|
|
86
|
+
onClick?: () => void;
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
declare function DefaultTrackPiece({ piece, index, total, radius, color, onClick, className, }: DefaultTrackPieceProps): react_jsx_runtime.JSX.Element;
|
|
90
|
+
interface DefaultTrackConnectionProps {
|
|
91
|
+
from: {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
};
|
|
95
|
+
to: {
|
|
96
|
+
x: number;
|
|
97
|
+
y: number;
|
|
98
|
+
};
|
|
99
|
+
stroke?: string;
|
|
100
|
+
strokeWidth?: number;
|
|
101
|
+
className?: string;
|
|
102
|
+
}
|
|
103
|
+
declare function DefaultTrackConnection({ from, to, stroke, strokeWidth, className, }: DefaultTrackConnectionProps): react_jsx_runtime.JSX.Element;
|
|
104
|
+
interface DefaultTrackJumpProps {
|
|
105
|
+
from: {
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
};
|
|
109
|
+
to: {
|
|
110
|
+
x: number;
|
|
111
|
+
y: number;
|
|
112
|
+
};
|
|
113
|
+
/** Whether the jump goes forward or backward */
|
|
114
|
+
isUp: boolean;
|
|
115
|
+
spaceSize?: number;
|
|
116
|
+
upColor?: string;
|
|
117
|
+
downColor?: string;
|
|
118
|
+
strokeWidth?: number;
|
|
119
|
+
className?: string;
|
|
120
|
+
}
|
|
121
|
+
declare function DefaultTrackJump({ from, to, isUp, spaceSize, upColor, downColor, strokeWidth, className, }: DefaultTrackJumpProps): react_jsx_runtime.JSX.Element;
|
|
122
|
+
declare function TrackBoard({ spaces, pieces, type, renderSpace, renderConnection, renderJump, width, height, enablePanZoom, initialZoom, minZoom, maxZoom, className, }: TrackBoardProps): react_jsx_runtime.JSX.Element;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Helpers that derive component-specific style fragments from a
|
|
126
|
+
* resolved {@link Theme}. They live alongside the theme module (rather
|
|
127
|
+
* than in each component) so that:
|
|
128
|
+
*
|
|
129
|
+
* - There is one canonical mapping of "intent → button style", "intent →
|
|
130
|
+
* chip style", etc.
|
|
131
|
+
* - Component visuals stay aligned automatically when an author tweaks
|
|
132
|
+
* the theme; nobody has to remember to update a bespoke calc inside
|
|
133
|
+
* `<CardFace>` or `<ThemedButton>`.
|
|
134
|
+
*
|
|
135
|
+
* Each helper returns a plain {@link CSSProperties} fragment so the
|
|
136
|
+
* caller can spread it into an inline style (or pass it through to
|
|
137
|
+
* Framer Motion's `style` prop).
|
|
138
|
+
*/
|
|
139
|
+
/** Button visual variants derived from semantic intent slots. */
|
|
140
|
+
type ButtonVariant$1 = "primary" | "secondary" | "danger" | "submitted" | "success" | "warning" | "info" | "ghost";
|
|
141
|
+
type ButtonSize$1 = "sm" | "md" | "lg";
|
|
142
|
+
/**
|
|
143
|
+
* Compute the inline style for a button in `variant`/`size` from the
|
|
144
|
+
* theme. `disabled` and `pressed` are visual-only — they affect colour
|
|
145
|
+
* intensity and elevation but never touch interactivity (the consuming
|
|
146
|
+
* component owns `aria-disabled` and event wiring).
|
|
147
|
+
*/
|
|
148
|
+
declare function buttonStyle(theme: Theme, options?: {
|
|
149
|
+
variant?: ButtonVariant$1;
|
|
150
|
+
size?: ButtonSize$1;
|
|
151
|
+
disabled?: boolean;
|
|
152
|
+
pressed?: boolean;
|
|
153
|
+
}): CSSProperties;
|
|
154
|
+
/**
|
|
155
|
+
* Soft-intent chip ("Your turn", "Largest army", "Waiting…"). Reads
|
|
156
|
+
* `intent.<variant>.soft` for background and `.onSoft` for text.
|
|
157
|
+
*/
|
|
158
|
+
declare function chipStyle(theme: Theme, options?: {
|
|
159
|
+
variant?: Exclude<ButtonVariant$1, "ghost">;
|
|
160
|
+
size?: "sm" | "md";
|
|
161
|
+
}): CSSProperties;
|
|
162
|
+
/**
|
|
163
|
+
* Standard surface card (player card, action panel, hand drawer). The
|
|
164
|
+
* `tone` selects which `surface.*` slot to read; `interactive` adds
|
|
165
|
+
* the hover-elevation transition baseline.
|
|
166
|
+
*/
|
|
167
|
+
declare function surfaceStyle(theme: Theme, options?: {
|
|
168
|
+
tone?: keyof Theme["semantic"]["surface"];
|
|
169
|
+
interactive?: boolean;
|
|
170
|
+
/** Override radius to one of the theme tokens. Defaults to `lg`. */
|
|
171
|
+
radius?: keyof Theme["radius"];
|
|
172
|
+
}): CSSProperties;
|
|
173
|
+
/** Resolve a {@link ButtonVariant} to its underlying {@link IntentColor}. */
|
|
174
|
+
declare function intentForVariant(theme: Theme, variant: ButtonVariant$1): IntentColor;
|
|
175
|
+
/**
|
|
176
|
+
* Pick a {@link Theme.player} entry by 0-based seat slot, wrapping
|
|
177
|
+
* around when there are more players than palette entries (so a
|
|
178
|
+
* 7-player game cycles back to player 1's palette).
|
|
179
|
+
*/
|
|
180
|
+
declare function playerColor(theme: Theme, slot: number): PlayerColor;
|
|
181
|
+
/**
|
|
182
|
+
* Returns `theme.motion.duration.<key>` zeroed out when the theme has
|
|
183
|
+
* `motion.reducedMotion === "true"`. Use this in any component that
|
|
184
|
+
* starts an animation so `prefers-reduced-motion` is honoured uniformly.
|
|
185
|
+
*/
|
|
186
|
+
declare function motionDuration(theme: Theme, key: keyof Theme["motion"]["duration"]): string;
|
|
187
|
+
|
|
188
|
+
interface CardFaceProps<CardData extends ViewCard = ViewCard> extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, InteractionVisualState {
|
|
189
|
+
card: CardData;
|
|
190
|
+
size?: "sm" | "md" | "lg";
|
|
191
|
+
faceDown?: boolean;
|
|
192
|
+
renderContent?: (card: CardData) => React.ReactNode;
|
|
193
|
+
children?: React.ReactNode;
|
|
194
|
+
}
|
|
195
|
+
declare function CardFace<CardData extends ViewCard = ViewCard>({ card, eligible, selected, disabled, invalid, submitted, previewing, intentProgress, size, faceDown, renderContent, children, className, style, ...props }: CardFaceProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
197
|
+
type CardSize = "sm" | "md" | "lg";
|
|
198
|
+
type HandLayout = "spread" | "stack" | "overlap";
|
|
199
|
+
interface CardPositionProps {
|
|
200
|
+
/** X position (left offset) */
|
|
201
|
+
x: number;
|
|
202
|
+
/** Y position (vertical offset for hover/selected) */
|
|
203
|
+
y: number;
|
|
204
|
+
/** Z-index for layering */
|
|
205
|
+
zIndex: number;
|
|
206
|
+
/** CSS transform origin */
|
|
207
|
+
transformOrigin: string;
|
|
208
|
+
}
|
|
209
|
+
interface UseHandLayoutOptions {
|
|
210
|
+
/** Number of cards in the hand */
|
|
211
|
+
cardCount: number;
|
|
212
|
+
/** Card size variant */
|
|
213
|
+
cardSize?: CardSize;
|
|
214
|
+
/** Layout style */
|
|
215
|
+
layout?: HandLayout;
|
|
216
|
+
/** Padding to subtract from container width */
|
|
217
|
+
containerPadding?: number;
|
|
218
|
+
}
|
|
219
|
+
interface UseHandLayoutReturn {
|
|
220
|
+
/** Ref to attach to the container element */
|
|
221
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
222
|
+
/** Ref to attach to the cards container element (for mouse/touch tracking) */
|
|
223
|
+
cardsContainerRef: RefObject<HTMLDivElement | null>;
|
|
224
|
+
/** Measured container width */
|
|
225
|
+
containerWidth: number;
|
|
226
|
+
/** Calculated offset between cards */
|
|
227
|
+
cardOffset: number;
|
|
228
|
+
/** Total width of all cards */
|
|
229
|
+
totalWidth: number;
|
|
230
|
+
/** Whether drawer mode should be used */
|
|
231
|
+
useDrawerMode: boolean;
|
|
232
|
+
/** Card dimensions for the current size */
|
|
233
|
+
cardDimensions: {
|
|
234
|
+
width: number;
|
|
235
|
+
height: number;
|
|
236
|
+
};
|
|
237
|
+
/** Constants for positioning */
|
|
238
|
+
constants: {
|
|
239
|
+
hoverLift: number;
|
|
240
|
+
selectedLift: number;
|
|
241
|
+
};
|
|
242
|
+
/** Currently hovered card index */
|
|
243
|
+
hoveredIndex: number | null;
|
|
244
|
+
/** Mouse move handler for the cards container */
|
|
245
|
+
handleMouseMove: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
246
|
+
/** Mouse leave handler for the cards container */
|
|
247
|
+
handleMouseLeave: () => void;
|
|
248
|
+
/** Touch move handler for the cards container (mirrors mouse hover lift on touch) */
|
|
249
|
+
handleTouchMove: (e: React.TouchEvent<HTMLDivElement>) => void;
|
|
250
|
+
/** Touch end handler for the cards container */
|
|
251
|
+
handleTouchEnd: () => void;
|
|
252
|
+
/** Get position props for a card at the given index */
|
|
253
|
+
getCardPosition: (index: number, isHovered: boolean, isSelected: boolean) => CardPositionProps;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Hook for managing hand layout calculations and interactions.
|
|
257
|
+
*
|
|
258
|
+
* Provides container measurement, overlap calculations, drawer mode detection,
|
|
259
|
+
* and hover state management for card hand displays.
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```tsx
|
|
263
|
+
* function MyHand({ cards, selectedIds }) {
|
|
264
|
+
* const {
|
|
265
|
+
* containerRef,
|
|
266
|
+
* cardsContainerRef,
|
|
267
|
+
* totalWidth,
|
|
268
|
+
* useDrawerMode,
|
|
269
|
+
* cardDimensions,
|
|
270
|
+
* hoveredIndex,
|
|
271
|
+
* handleMouseMove,
|
|
272
|
+
* handleMouseLeave,
|
|
273
|
+
* getCardPosition,
|
|
274
|
+
* constants,
|
|
275
|
+
* } = useHandLayout({
|
|
276
|
+
* cardCount: cards.length,
|
|
277
|
+
* cardSize: "md",
|
|
278
|
+
* layout: "overlap",
|
|
279
|
+
* });
|
|
280
|
+
*
|
|
281
|
+
* if (useDrawerMode) {
|
|
282
|
+
* return <MyDrawerUI cards={cards} />;
|
|
283
|
+
* }
|
|
284
|
+
*
|
|
285
|
+
* return (
|
|
286
|
+
* <div ref={containerRef}>
|
|
287
|
+
* <div
|
|
288
|
+
* ref={cardsContainerRef}
|
|
289
|
+
* style={{ width: totalWidth, height: cardDimensions.height + constants.hoverLift }}
|
|
290
|
+
* onMouseMove={handleMouseMove}
|
|
291
|
+
* onMouseLeave={handleMouseLeave}
|
|
292
|
+
* >
|
|
293
|
+
* {cards.map((card, index) => {
|
|
294
|
+
* const isHovered = hoveredIndex === index;
|
|
295
|
+
* const isSelected = selectedIds.includes(card.id);
|
|
296
|
+
* const position = getCardPosition(index, isHovered, isSelected);
|
|
297
|
+
*
|
|
298
|
+
* return (
|
|
299
|
+
* <div
|
|
300
|
+
* key={card.id}
|
|
301
|
+
* style={{
|
|
302
|
+
* position: "absolute",
|
|
303
|
+
* left: position.x,
|
|
304
|
+
* transform: `translateY(${position.y}px)`,
|
|
305
|
+
* zIndex: position.zIndex,
|
|
306
|
+
* }}
|
|
307
|
+
* >
|
|
308
|
+
* <MyCard card={card} />
|
|
309
|
+
* </div>
|
|
310
|
+
* );
|
|
311
|
+
* })}
|
|
312
|
+
* </div>
|
|
313
|
+
* </div>
|
|
314
|
+
* );
|
|
315
|
+
* }
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
318
|
+
declare function useHandLayout({ cardCount, cardSize, layout, containerPadding, }: UseHandLayoutOptions): UseHandLayoutReturn;
|
|
319
|
+
|
|
320
|
+
interface HandCardRenderProps<CardData extends ViewCard = ViewCard> {
|
|
321
|
+
card: CardData;
|
|
322
|
+
index: number;
|
|
323
|
+
isHovered: boolean;
|
|
324
|
+
isSelected: boolean;
|
|
325
|
+
x: number;
|
|
326
|
+
y: number;
|
|
327
|
+
zIndex: number;
|
|
328
|
+
cardDimensions: {
|
|
329
|
+
width: number;
|
|
330
|
+
height: number;
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
interface HandDrawerRenderProps<CardData extends ViewCard = ViewCard> {
|
|
334
|
+
cards: readonly CardData[];
|
|
335
|
+
selectedIds: readonly string[];
|
|
336
|
+
cardCount: number;
|
|
337
|
+
selectedCount: number;
|
|
338
|
+
disabled: boolean;
|
|
339
|
+
cardDimensions: {
|
|
340
|
+
width: number;
|
|
341
|
+
height: number;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
interface HandEmptyRenderProps {
|
|
345
|
+
layout: HandLayout;
|
|
346
|
+
}
|
|
347
|
+
interface HandContainerRenderProps {
|
|
348
|
+
totalWidth: number;
|
|
349
|
+
totalHeight: number;
|
|
350
|
+
cardDimensions: {
|
|
351
|
+
width: number;
|
|
352
|
+
height: number;
|
|
353
|
+
};
|
|
354
|
+
children: ReactNode;
|
|
355
|
+
onMouseMove: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
356
|
+
onMouseLeave: () => void;
|
|
357
|
+
}
|
|
358
|
+
interface HandProps<CardData extends ViewCard = ViewCard> {
|
|
359
|
+
cards: readonly CardData[];
|
|
360
|
+
selectedIds?: readonly string[];
|
|
361
|
+
disabled?: boolean;
|
|
362
|
+
cardSize?: CardSize;
|
|
363
|
+
layout?: HandLayout;
|
|
364
|
+
"aria-label"?: string;
|
|
365
|
+
/**
|
|
366
|
+
* Called when a card is clicked. Wired into the default `renderCard`;
|
|
367
|
+
* ignored when the caller supplies a custom `renderCard`.
|
|
368
|
+
*/
|
|
369
|
+
onCardClick?: (cardId: string) => void;
|
|
370
|
+
/** Per-card content renderer forwarded to the default `<CardFace>`. */
|
|
371
|
+
renderCardContent?: (card: CardData) => ReactNode;
|
|
372
|
+
/** Defaults to a positioned `<CardFace>` honouring click/selection state. */
|
|
373
|
+
renderCard?: (props: HandCardRenderProps<CardData>) => ReactNode;
|
|
374
|
+
/**
|
|
375
|
+
* Custom drawer fallback for large hands (when `useHandLayout` switches
|
|
376
|
+
* to drawer mode). When omitted, `Hand` renders a `HandDock` bottom drawer
|
|
377
|
+
* automatically.
|
|
378
|
+
*/
|
|
379
|
+
renderDrawer?: (props: HandDrawerRenderProps<CardData>) => ReactNode;
|
|
380
|
+
/** Defaults to a subtle "No cards in hand" placeholder. */
|
|
381
|
+
renderEmpty?: (props: HandEmptyRenderProps) => ReactNode;
|
|
382
|
+
renderContainer?: (props: HandContainerRenderProps) => ReactNode;
|
|
383
|
+
className?: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Hand component with customizable rendering via render props.
|
|
387
|
+
*
|
|
388
|
+
* `renderCard`, `renderDrawer`, and `renderEmpty` are all optional — the
|
|
389
|
+
* defaults render the built-in `<CardFace>` with the supplied `onCardClick` /
|
|
390
|
+
* `renderCardContent`, a compact drawer fallback on small screens, and a
|
|
391
|
+
* muted empty placeholder. Override any of them when you need a different
|
|
392
|
+
* visual treatment.
|
|
393
|
+
*
|
|
394
|
+
* For complete control over layout and interactions, use the
|
|
395
|
+
* `useHandLayout` hook directly.
|
|
396
|
+
*
|
|
397
|
+
* @example Zero-config
|
|
398
|
+
* ```tsx
|
|
399
|
+
* <Hand cards={cards} onCardClick={(id) => play(id)} />
|
|
400
|
+
* ```
|
|
401
|
+
*
|
|
402
|
+
* @example Custom card content
|
|
403
|
+
* ```tsx
|
|
404
|
+
* <Hand
|
|
405
|
+
* cards={cards}
|
|
406
|
+
* onCardClick={(id) => play(id)}
|
|
407
|
+
* renderCardContent={(card) => <DevCardFace card={card} />}
|
|
408
|
+
* />
|
|
409
|
+
* ```
|
|
410
|
+
*/
|
|
411
|
+
declare function Hand<CardData extends ViewCard = ViewCard>({ cards, selectedIds, disabled, cardSize, layout, "aria-label": ariaLabel, onCardClick, renderCardContent, renderCard, renderDrawer, renderEmpty, renderContainer, className, }: HandProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
412
|
+
|
|
413
|
+
interface StagingZoneProps<CardData extends ViewCard = ViewCard> {
|
|
414
|
+
/** Cards currently staged, in order. */
|
|
415
|
+
cards: readonly CardData[];
|
|
416
|
+
/** Total number of slots to render (e.g. the collector's selection max). */
|
|
417
|
+
slotCount: number;
|
|
418
|
+
/** Card size; empty-slot dimensions match the SDK `CardFace` sizes. */
|
|
419
|
+
size?: "sm" | "md" | "lg";
|
|
420
|
+
/** Visual for a staged card (typically a `CardFace`). */
|
|
421
|
+
renderCard: (card: CardData) => ReactNode;
|
|
422
|
+
/** Fires when a staged card is activated — remove it from the collection. */
|
|
423
|
+
onRemove?: (cardId: string) => void;
|
|
424
|
+
/** Custom empty-slot content. Defaults to an empty dashed placeholder. */
|
|
425
|
+
renderEmptySlot?: (index: number) => ReactNode;
|
|
426
|
+
/** Optional heading rendered above the slots. */
|
|
427
|
+
label?: ReactNode;
|
|
428
|
+
/** Accessible label for the region. */
|
|
429
|
+
"aria-label"?: string;
|
|
430
|
+
className?: string;
|
|
431
|
+
}
|
|
432
|
+
declare function StagingZone<CardData extends ViewCard = ViewCard>({ cards, slotCount, size, renderCard, onRemove, renderEmptySlot, label, "aria-label": ariaLabel, className, }: StagingZoneProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
433
|
+
|
|
434
|
+
interface RegisteredDropTarget {
|
|
435
|
+
targetId: string;
|
|
436
|
+
disabled: boolean;
|
|
437
|
+
eligible: boolean;
|
|
438
|
+
element: HTMLElement;
|
|
439
|
+
/** Plain-text label used for the live a11y announcement. */
|
|
440
|
+
label: string | null;
|
|
441
|
+
/** Order hint for keyboard target traversal (lower numbers focus first). */
|
|
442
|
+
order: number;
|
|
443
|
+
}
|
|
444
|
+
type DragPhase = "idle" | "inspecting" | "dragging" | "settling" | "returning";
|
|
445
|
+
interface CardDragSurfaceController {
|
|
446
|
+
/** Identity of the card currently in the drag-lifecycle, if any. */
|
|
447
|
+
activeCardId: string | null;
|
|
448
|
+
/** Source of the active drag, if any. */
|
|
449
|
+
activeSource: "pointer" | "keyboard" | null;
|
|
450
|
+
/** Drag-lifecycle phase. */
|
|
451
|
+
phase: DragPhase;
|
|
452
|
+
/** Currently highlighted drop target id, if any. */
|
|
453
|
+
overTargetId: string | null;
|
|
454
|
+
/** Currently keyboard-focused target id, if any. */
|
|
455
|
+
keyboardFocusedTargetId: string | null;
|
|
456
|
+
/**
|
|
457
|
+
* Begin a pointer drag session. Returns `true` if the session started.
|
|
458
|
+
*/
|
|
459
|
+
startPointerDrag: (input: PointerDragInput) => boolean;
|
|
460
|
+
/** Update the pointer coordinates of an active pointer drag. */
|
|
461
|
+
updatePointer: (point: {
|
|
462
|
+
x: number;
|
|
463
|
+
y: number;
|
|
464
|
+
}) => void;
|
|
465
|
+
/**
|
|
466
|
+
* Commit the active pointer drag at the supplied release position. Emits
|
|
467
|
+
* a `drop` intent if the pointer is over an eligible target, or schedules
|
|
468
|
+
* a snap back otherwise.
|
|
469
|
+
*/
|
|
470
|
+
releasePointer: (point: {
|
|
471
|
+
x: number;
|
|
472
|
+
y: number;
|
|
473
|
+
}) => void;
|
|
474
|
+
/** Cancel the active drag (pointer or keyboard) without committing. */
|
|
475
|
+
cancelDrag: () => void;
|
|
476
|
+
/**
|
|
477
|
+
* Begin a keyboard drag session. The first eligible registered target is
|
|
478
|
+
* focused automatically.
|
|
479
|
+
*/
|
|
480
|
+
startKeyboardDrag: (input: KeyboardDragInput) => boolean;
|
|
481
|
+
/** Move keyboard focus across registered eligible targets. */
|
|
482
|
+
moveKeyboardFocus: (direction: "next" | "prev") => void;
|
|
483
|
+
/** Commit the active keyboard drag on the focused target. */
|
|
484
|
+
commitKeyboardDrop: () => void;
|
|
485
|
+
/**
|
|
486
|
+
* Record a tap that did not produce a lift. The surface holds the
|
|
487
|
+
* `inspecting` phase until another lift, drop, or external dismissal.
|
|
488
|
+
*/
|
|
489
|
+
recordTap: (input: TapInput) => void;
|
|
490
|
+
/**
|
|
491
|
+
* Record a `previewStart` intent. Surface owns canonical intent emission
|
|
492
|
+
* so consumers subscribe in one place.
|
|
493
|
+
*/
|
|
494
|
+
recordPreviewStart: (cardId: string) => void;
|
|
495
|
+
/** Record a `previewEnd` intent. */
|
|
496
|
+
recordPreviewEnd: (cardId: string) => void;
|
|
497
|
+
/**
|
|
498
|
+
* Record a desktop/keyboard `activate` intent under the `direct-activate`
|
|
499
|
+
* policy. Drag-to-target policy never calls this; it is centralized here
|
|
500
|
+
* so that the surface remains the only ingress for `CardIntent`.
|
|
501
|
+
*/
|
|
502
|
+
recordActivate: (cardId: string, source: "tap" | "keyboard") => void;
|
|
503
|
+
/** Clear the `inspecting` phase. */
|
|
504
|
+
clearInspect: () => void;
|
|
505
|
+
/** Total number of currently registered eligible targets. */
|
|
506
|
+
eligibleTargetCount: number;
|
|
507
|
+
}
|
|
508
|
+
interface TapInput {
|
|
509
|
+
cardId: string;
|
|
510
|
+
cardEligible: boolean;
|
|
511
|
+
cardDisabled: boolean;
|
|
512
|
+
sourceFocus?: HTMLElement | null;
|
|
513
|
+
}
|
|
514
|
+
interface PointerDragInput {
|
|
515
|
+
cardId: string;
|
|
516
|
+
cardLabel?: string | null;
|
|
517
|
+
pointerId: number;
|
|
518
|
+
startX: number;
|
|
519
|
+
startY: number;
|
|
520
|
+
pointerX: number;
|
|
521
|
+
pointerY: number;
|
|
522
|
+
grabOffsetX: number;
|
|
523
|
+
grabOffsetY: number;
|
|
524
|
+
sourceRect: {
|
|
525
|
+
left: number;
|
|
526
|
+
top: number;
|
|
527
|
+
width: number;
|
|
528
|
+
height: number;
|
|
529
|
+
};
|
|
530
|
+
content: ReactNode;
|
|
531
|
+
sourceFocus?: HTMLElement | null;
|
|
532
|
+
}
|
|
533
|
+
interface KeyboardDragInput {
|
|
534
|
+
cardId: string;
|
|
535
|
+
cardLabel?: string | null;
|
|
536
|
+
cardEligible: boolean;
|
|
537
|
+
sourceRect: {
|
|
538
|
+
left: number;
|
|
539
|
+
top: number;
|
|
540
|
+
width: number;
|
|
541
|
+
height: number;
|
|
542
|
+
};
|
|
543
|
+
content: ReactNode;
|
|
544
|
+
sourceFocus?: HTMLElement | null;
|
|
545
|
+
}
|
|
546
|
+
interface CardDragSurfaceContextValue {
|
|
547
|
+
registerTarget: (target: RegisteredDropTarget) => () => void;
|
|
548
|
+
updateTarget: (targetId: string, patch: Partial<Omit<RegisteredDropTarget, "targetId" | "element">>) => void;
|
|
549
|
+
controller: CardDragSurfaceController;
|
|
550
|
+
/** Expose the most recent active card id for visual-state computation. */
|
|
551
|
+
activeCardId: string | null;
|
|
552
|
+
/** Expose the highlighted target id for visual-state computation. */
|
|
553
|
+
overTargetId: string | null;
|
|
554
|
+
/** Expose whether any drag is in progress. */
|
|
555
|
+
dragActive: boolean;
|
|
556
|
+
keyboardFocusedTargetId: string | null;
|
|
557
|
+
}
|
|
558
|
+
declare function useCardDragSurface(): CardDragSurfaceContextValue | null;
|
|
559
|
+
interface CardDragSurfaceProps {
|
|
560
|
+
onCardIntent?: (intent: CardIntent) => void;
|
|
561
|
+
/**
|
|
562
|
+
* Approximate inset (px) used for the deterministic hit test. Defaults to
|
|
563
|
+
* `8`. Lowering this lets edges register more aggressively; raising it
|
|
564
|
+
* makes overlapping targets less ambiguous.
|
|
565
|
+
*/
|
|
566
|
+
hitTestInsetPx?: number;
|
|
567
|
+
/** Suppress the live a11y announcement (for environments providing their own). */
|
|
568
|
+
suppressLiveAnnouncement?: boolean;
|
|
569
|
+
/** Animation transition tunable for settle/return. */
|
|
570
|
+
motionTransition?: Transition;
|
|
571
|
+
className?: string;
|
|
572
|
+
style?: CSSProperties;
|
|
573
|
+
children: ReactNode;
|
|
574
|
+
}
|
|
575
|
+
declare function CardDragSurface({ onCardIntent, hitTestInsetPx, suppressLiveAnnouncement, motionTransition, className, style, children, }: CardDragSurfaceProps): react_jsx_runtime.JSX.Element;
|
|
576
|
+
interface CardDropTargetViewProps {
|
|
577
|
+
targetId: string;
|
|
578
|
+
state?: CardDropTargetVisualState;
|
|
579
|
+
/** Plain-text label used in live announcements ("Selected cards", etc.). */
|
|
580
|
+
label?: string;
|
|
581
|
+
renderTarget: (state: CardDropTargetVisualState) => ReactNode;
|
|
582
|
+
className?: string;
|
|
583
|
+
style?: CSSProperties;
|
|
584
|
+
/** Tab order hint (lower numbers focus first). */
|
|
585
|
+
order?: number;
|
|
586
|
+
/** ARIA role override; defaults to `button`. */
|
|
587
|
+
role?: string;
|
|
588
|
+
}
|
|
589
|
+
declare function CardDropTargetView({ targetId, state, label, renderTarget, className, style, order, role, }: CardDropTargetViewProps): react_jsx_runtime.JSX.Element;
|
|
590
|
+
|
|
591
|
+
type HandDockMode = "inline" | "drawer" | "hidden";
|
|
592
|
+
type HandDockPlacement = "bottom-left" | "bottom-center" | "bottom-right";
|
|
593
|
+
interface HandDockToggleContext {
|
|
594
|
+
label: string;
|
|
595
|
+
count: number;
|
|
596
|
+
open: boolean;
|
|
597
|
+
}
|
|
598
|
+
interface HandDockPresentation {
|
|
599
|
+
/**
|
|
600
|
+
* `inline` preserves the normal shell hand strip. `drawer` collapses the
|
|
601
|
+
* zone behind a viewport-safe toggle. `hidden` suppresses the zone entirely.
|
|
602
|
+
*/
|
|
603
|
+
mode?: HandDockMode;
|
|
604
|
+
/** Initial drawer state. Defaults to closed. */
|
|
605
|
+
defaultOpen?: boolean;
|
|
606
|
+
/** Where the drawer toggle/tray docks in the viewport. */
|
|
607
|
+
placement?: HandDockPlacement;
|
|
608
|
+
/** Toggle label override. Receives card count and open state. */
|
|
609
|
+
toggleLabel?: ReactNode | ((context: HandDockToggleContext) => ReactNode);
|
|
610
|
+
/** Width of the opened tray. */
|
|
611
|
+
maxWidth?: CSSProperties["maxWidth"];
|
|
612
|
+
/** Height of the opened tray before it scrolls. */
|
|
613
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
614
|
+
/** Extra style escape hatch for the outer dock. */
|
|
615
|
+
style?: CSSProperties;
|
|
616
|
+
}
|
|
617
|
+
interface HandDockProps {
|
|
618
|
+
label: string;
|
|
619
|
+
count: number;
|
|
620
|
+
presentation?: HandDockPresentation;
|
|
621
|
+
children: ReactNode;
|
|
622
|
+
}
|
|
623
|
+
declare function HandDock({ label, count, presentation, children, }: HandDockProps): react_jsx_runtime.JSX.Element | null;
|
|
624
|
+
|
|
625
|
+
interface PlayAreaProps<CardData extends ViewCard = ViewCard> {
|
|
626
|
+
cards: readonly CardData[];
|
|
627
|
+
filter?: (card: CardData) => boolean;
|
|
628
|
+
cardSize?: CardFaceProps["size"];
|
|
629
|
+
renderCard?: CardFaceProps<CardData>["renderContent"];
|
|
630
|
+
layout?: "grid" | "row";
|
|
631
|
+
interactive?: boolean;
|
|
632
|
+
onCardClick?: (cardId: string) => void;
|
|
633
|
+
"aria-label"?: string;
|
|
634
|
+
className?: string;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* @example
|
|
638
|
+
* ```tsx
|
|
639
|
+
* <PlayArea cards={trickCards} layout="row" renderCard={(card) => <PlayingCard card={card} />} />
|
|
640
|
+
* ```
|
|
641
|
+
*/
|
|
642
|
+
declare function PlayArea<CardData extends ViewCard = ViewCard>({ cards, filter, cardSize, renderCard, layout, interactive, onCardClick, "aria-label": ariaLabel, className, }: PlayAreaProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
643
|
+
|
|
644
|
+
declare function ChromeSuppressionProvider({ children, onSuppressedChange, }: {
|
|
645
|
+
children: ReactNode;
|
|
646
|
+
onSuppressedChange: (suppressed: boolean) => void;
|
|
647
|
+
}): react_jsx_runtime.JSX.Element;
|
|
648
|
+
declare function useChromeSuppression(id: string, suppressed: boolean): void;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* GameSkeleton - Loading state component
|
|
652
|
+
*
|
|
653
|
+
* Displays animated placeholders while game content loads
|
|
654
|
+
*/
|
|
655
|
+
interface GameSkeletonProps {
|
|
656
|
+
variant?: "default" | "cards" | "players" | "minimal";
|
|
657
|
+
message?: string;
|
|
658
|
+
className?: string;
|
|
659
|
+
}
|
|
660
|
+
declare function GameSkeleton({ variant, message, className, }: GameSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
661
|
+
|
|
662
|
+
type ToastType = "success" | "error" | "info" | "warning";
|
|
663
|
+
interface ToastNotification {
|
|
664
|
+
id: string;
|
|
665
|
+
type: ToastType;
|
|
666
|
+
message: string;
|
|
667
|
+
duration?: number;
|
|
668
|
+
}
|
|
669
|
+
interface ToastContextValue {
|
|
670
|
+
toasts: ToastNotification[];
|
|
671
|
+
show: (message: string, type?: ToastType, duration?: number) => void;
|
|
672
|
+
dismiss: (id: string) => void;
|
|
673
|
+
success: (message: string, duration?: number) => void;
|
|
674
|
+
error: (message: string, duration?: number) => void;
|
|
675
|
+
info: (message: string, duration?: number) => void;
|
|
676
|
+
warning: (message: string, duration?: number) => void;
|
|
677
|
+
}
|
|
678
|
+
type ToastActionsValue = ToastContextValue;
|
|
679
|
+
interface ToastProviderProps {
|
|
680
|
+
children: ReactNode;
|
|
681
|
+
}
|
|
682
|
+
declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
683
|
+
interface ToastActionsProps {
|
|
684
|
+
children: (actions: ToastActionsValue) => ReactNode;
|
|
685
|
+
}
|
|
686
|
+
declare function ToastActions({ children }: ToastActionsProps): react_jsx_runtime.JSX.Element;
|
|
687
|
+
declare const Toast: {
|
|
688
|
+
readonly Actions: typeof ToastActions;
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
interface ErrorBoundaryProps {
|
|
692
|
+
children: ReactNode;
|
|
693
|
+
fallback?: (error: Error, reset: () => void) => ReactNode;
|
|
694
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
695
|
+
}
|
|
696
|
+
interface ErrorBoundaryState {
|
|
697
|
+
hasError: boolean;
|
|
698
|
+
error: Error | null;
|
|
699
|
+
}
|
|
700
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
701
|
+
constructor(props: ErrorBoundaryProps);
|
|
702
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
703
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
704
|
+
handleReset: () => void;
|
|
705
|
+
render(): ReactNode;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
declare function Drawer({ ...props }: react.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
|
|
709
|
+
declare function DrawerTrigger({ ...props }: react.ComponentProps<typeof Drawer$1.Trigger>): react_jsx_runtime.JSX.Element;
|
|
710
|
+
declare function DrawerPortal({ ...props }: react.ComponentProps<typeof Drawer$1.Portal>): react_jsx_runtime.JSX.Element;
|
|
711
|
+
declare function DrawerClose({ ...props }: react.ComponentProps<typeof Drawer$1.Close>): react_jsx_runtime.JSX.Element;
|
|
712
|
+
declare function DrawerOverlay({ className, style, ...props }: react.ComponentProps<typeof Drawer$1.Overlay>): react_jsx_runtime.JSX.Element;
|
|
713
|
+
interface DrawerContentProps extends react.ComponentPropsWithoutRef<typeof Drawer$1.Content> {
|
|
714
|
+
showHandle?: boolean;
|
|
715
|
+
children?: react.ReactNode;
|
|
716
|
+
}
|
|
717
|
+
declare function DrawerContent({ className, children, showHandle, ...props }: DrawerContentProps): react_jsx_runtime.JSX.Element;
|
|
718
|
+
declare function DrawerHeader({ className, ...props }: react.ComponentPropsWithoutRef<"div">): react_jsx_runtime.JSX.Element;
|
|
719
|
+
declare function DrawerFooter({ className, ...props }: react.ComponentPropsWithoutRef<"div">): react_jsx_runtime.JSX.Element;
|
|
720
|
+
declare function DrawerTitle({ className, ...props }: react.ComponentProps<typeof Drawer$1.Title>): react_jsx_runtime.JSX.Element;
|
|
721
|
+
declare function DrawerDescription({ className, ...props }: react.ComponentProps<typeof Drawer$1.Description>): react_jsx_runtime.JSX.Element;
|
|
722
|
+
|
|
723
|
+
declare function Dialog(props: react.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
724
|
+
declare function DialogTrigger(props: react.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
725
|
+
declare function DialogPortal(props: react.ComponentProps<typeof DialogPrimitive.Portal>): react_jsx_runtime.JSX.Element;
|
|
726
|
+
declare function DialogClose(props: react.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
|
|
727
|
+
declare function DialogOverlay({ className, ...props }: react.ComponentProps<typeof DialogPrimitive.Overlay>): react_jsx_runtime.JSX.Element;
|
|
728
|
+
declare function DialogContent({ className, children, showCloseButton, overlayClassName, ...props }: react.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
729
|
+
showCloseButton?: boolean;
|
|
730
|
+
overlayClassName?: string;
|
|
731
|
+
}): react_jsx_runtime.JSX.Element;
|
|
732
|
+
declare function DialogHeader({ className, ...props }: react.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
733
|
+
declare function DialogFooter({ className, ...props }: react.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
734
|
+
declare function DialogTitle({ className, ...props }: react.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
735
|
+
declare function DialogDescription({ className, ...props }: react.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
|
|
736
|
+
|
|
737
|
+
declare function Input({ className, type, ...props }: react.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
|
|
738
|
+
|
|
739
|
+
declare function Label({ className, ...props }: react.ComponentProps<typeof LabelPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
740
|
+
|
|
741
|
+
declare function Select(props: react.ComponentProps<typeof SelectPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
742
|
+
declare function SelectTrigger({ className, size, children, ...props }: react.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
743
|
+
size?: "sm" | "default";
|
|
744
|
+
}): react_jsx_runtime.JSX.Element;
|
|
745
|
+
declare function SelectContent({ className, children, position, align, ...props }: react.ComponentProps<typeof SelectPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
746
|
+
declare function SelectItem({ className, children, ...props }: react.ComponentProps<typeof SelectPrimitive.Item>): react_jsx_runtime.JSX.Element;
|
|
747
|
+
|
|
748
|
+
interface ResourceDefinition {
|
|
749
|
+
type: string;
|
|
750
|
+
label: string;
|
|
751
|
+
icon?: ComponentType<{
|
|
752
|
+
className?: string;
|
|
753
|
+
}>;
|
|
754
|
+
color?: string;
|
|
755
|
+
}
|
|
756
|
+
interface CostDisplayProps {
|
|
757
|
+
/** Cost requirements keyed by resource type */
|
|
758
|
+
cost: Record<string, number>;
|
|
759
|
+
/** Current resources to check affordability */
|
|
760
|
+
currentResources?: Record<string, number>;
|
|
761
|
+
resourceDefs: ResourceDefinition[];
|
|
762
|
+
size?: "sm" | "md";
|
|
763
|
+
layout?: "inline" | "stacked";
|
|
764
|
+
className?: string;
|
|
765
|
+
}
|
|
766
|
+
declare function CostDisplay({ cost, currentResources, resourceDefs, size, layout, className, }: CostDisplayProps): react_jsx_runtime.JSX.Element | null;
|
|
767
|
+
|
|
768
|
+
interface ActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">, InteractionVisualState {
|
|
769
|
+
label?: ReactNode;
|
|
770
|
+
description?: ReactNode;
|
|
771
|
+
icon?: ElementType<{
|
|
772
|
+
className?: string;
|
|
773
|
+
}>;
|
|
774
|
+
cost?: Record<string, number>;
|
|
775
|
+
currentResources?: Record<string, number>;
|
|
776
|
+
resourceDefs?: ResourceDefinition[];
|
|
777
|
+
available?: boolean;
|
|
778
|
+
disabledReason?: string;
|
|
779
|
+
loading?: boolean;
|
|
780
|
+
variant?: ButtonVariant$1;
|
|
781
|
+
size?: ButtonSize$1;
|
|
782
|
+
children?: ReactNode;
|
|
783
|
+
}
|
|
784
|
+
declare function ActionButton({ label, description, icon, cost, currentResources, resourceDefs, available, disabledReason, loading, disabled, eligible, selected, invalid, submitted, previewing, intentProgress, title, variant, size, children, onClick, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
785
|
+
|
|
786
|
+
interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, InteractionVisualState {
|
|
787
|
+
/** Intent slot — defaults to `primary`. */
|
|
788
|
+
variant?: ButtonVariant$1;
|
|
789
|
+
/** Sizing token — defaults to `md`. */
|
|
790
|
+
size?: ButtonSize$1;
|
|
791
|
+
}
|
|
792
|
+
declare function PrimaryButton({ children, disabled, style, variant, size, ...rest }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
793
|
+
|
|
794
|
+
type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
795
|
+
type ButtonSize = "default" | "sm" | "lg" | "icon";
|
|
796
|
+
interface ButtonProps extends react.ComponentProps<"button"> {
|
|
797
|
+
variant?: ButtonVariant;
|
|
798
|
+
size?: ButtonSize;
|
|
799
|
+
asChild?: boolean;
|
|
800
|
+
}
|
|
801
|
+
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
802
|
+
|
|
803
|
+
type ShadcnButtonProps = ComponentProps<typeof Button>;
|
|
804
|
+
interface ThemedButtonProps extends Omit<ShadcnButtonProps, "variant" | "size">, InteractionVisualState {
|
|
805
|
+
variant?: ButtonVariant$1;
|
|
806
|
+
size?: ButtonSize$1;
|
|
807
|
+
/** Renders the pressed/active visual treatment without changing variant. */
|
|
808
|
+
pressed?: boolean;
|
|
809
|
+
/** Render the in-flight loading state and disable activation. */
|
|
810
|
+
loading?: boolean;
|
|
811
|
+
}
|
|
812
|
+
declare function ThemedButton({ variant, size, pressed, loading, eligible, selected, disabled, invalid, submitted, previewing, intentProgress, className, style, ...props }: ThemedButtonProps): react_jsx_runtime.JSX.Element;
|
|
813
|
+
|
|
814
|
+
/** Attention-pulse policy for the trailing halo. */
|
|
815
|
+
type PrimaryActionAttention = "auto" | "always" | "off";
|
|
816
|
+
interface SubmittedActionConfig {
|
|
817
|
+
label?: ReactNode;
|
|
818
|
+
icon?: ReactNode;
|
|
819
|
+
variant?: ButtonVariant$1;
|
|
820
|
+
}
|
|
821
|
+
interface PrimaryActionButtonProps extends InteractionVisualState {
|
|
822
|
+
/**
|
|
823
|
+
* Override the visual variant. Defaults to `primary` (which maps
|
|
824
|
+
* to `intent.primary` regardless of the descriptor's `emphasis`
|
|
825
|
+
* hint — the shell's primary slot is, by definition, primary).
|
|
826
|
+
*/
|
|
827
|
+
variant?: ButtonVariant$1;
|
|
828
|
+
/**
|
|
829
|
+
* Sizing. Defaults to `lg` so the dock target is comfortable on
|
|
830
|
+
* touch and visually outranks panel buttons sized `md`.
|
|
831
|
+
*/
|
|
832
|
+
size?: ButtonSize$1;
|
|
833
|
+
/**
|
|
834
|
+
* Override the label inferred from `descriptor.label`. Use only
|
|
835
|
+
* when the descriptor's label needs phase-specific copy that the
|
|
836
|
+
* authoring layer can't express.
|
|
837
|
+
*/
|
|
838
|
+
label?: ReactNode;
|
|
839
|
+
/** Client-side draft readiness. Reducer availability remains authoritative. */
|
|
840
|
+
ready?: boolean;
|
|
841
|
+
/** Whether the action is currently available according to the caller. */
|
|
842
|
+
available?: boolean;
|
|
843
|
+
/** Optional reason rendered as the disabled tooltip. */
|
|
844
|
+
unavailableReason?: string;
|
|
845
|
+
/** External submission state. */
|
|
846
|
+
submitting?: boolean;
|
|
847
|
+
/** External submitted state. */
|
|
848
|
+
submitted?: boolean;
|
|
849
|
+
/** Copy and visual overrides once this interaction has been submitted. */
|
|
850
|
+
whenSubmitted?: SubmittedActionConfig;
|
|
851
|
+
/**
|
|
852
|
+
* Optional leading icon override. When omitted, falls back to
|
|
853
|
+
* `descriptor.icon` (an emoji glyph from the authoring spec).
|
|
854
|
+
*/
|
|
855
|
+
icon?: ReactNode;
|
|
856
|
+
/** Stable identifier for diagnostics and tests. */
|
|
857
|
+
actionId?: string;
|
|
858
|
+
/** Called when the controlled action is activated. */
|
|
859
|
+
onAction?: () => void | Promise<void>;
|
|
860
|
+
/**
|
|
861
|
+
* Attention-halo policy. `auto` (default) pulses the halo for one
|
|
862
|
+
* breath when the button transitions from disabled → enabled (so
|
|
863
|
+
* the user sees the moment the action becomes available), then
|
|
864
|
+
* settles into a slow ambient breath while the action remains
|
|
865
|
+
* available. `always` keeps the breath running unconditionally.
|
|
866
|
+
* `off` suppresses the halo entirely.
|
|
867
|
+
*
|
|
868
|
+
* Ignored when `theme.motion.reducedMotion === "true"`.
|
|
869
|
+
*/
|
|
870
|
+
attention?: PrimaryActionAttention;
|
|
871
|
+
/** Additional inline style merged after the resolved button style. */
|
|
872
|
+
style?: CSSProperties;
|
|
873
|
+
/** Optional className for downstream styling hooks. */
|
|
874
|
+
className?: string;
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* @see PrimaryActionButtonProps
|
|
878
|
+
*/
|
|
879
|
+
declare function PrimaryActionButton({ variant, size, label, ready, available: availableProp, unavailableReason, submitting: submittingProp, submitted, whenSubmitted, icon, actionId, onAction, attention, style, className, }: PrimaryActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
880
|
+
|
|
881
|
+
interface ActionPanelProps {
|
|
882
|
+
title?: string;
|
|
883
|
+
/** Current game state/phase for context display */
|
|
884
|
+
state?: string;
|
|
885
|
+
/** Human-readable state labels */
|
|
886
|
+
stateLabels?: Record<string, string>;
|
|
887
|
+
collapsible?: boolean;
|
|
888
|
+
defaultExpanded?: boolean;
|
|
889
|
+
children: ReactNode;
|
|
890
|
+
className?: string;
|
|
891
|
+
}
|
|
892
|
+
declare function ActionPanel({ title, state, stateLabels, collapsible, defaultExpanded, children, className, }: ActionPanelProps): react_jsx_runtime.JSX.Element;
|
|
893
|
+
interface ActionGroupProps {
|
|
894
|
+
title: string;
|
|
895
|
+
description?: string;
|
|
896
|
+
visible?: boolean;
|
|
897
|
+
/** Highlight style for special phases. Maps directly onto theme intent slots. */
|
|
898
|
+
variant?: "default" | "warning" | "danger" | "success";
|
|
899
|
+
children: ReactNode;
|
|
900
|
+
className?: string;
|
|
901
|
+
}
|
|
902
|
+
declare function ActionGroup({ title, description, visible, variant, children, className, }: ActionGroupProps): react_jsx_runtime.JSX.Element | null;
|
|
903
|
+
|
|
904
|
+
interface MoreActionsProps {
|
|
905
|
+
/**
|
|
906
|
+
* Items rendered inside the disclosure when expanded. Typically
|
|
907
|
+
* `<DefaultInteractionButton>` instances for `salience: "tertiary"`
|
|
908
|
+
* descriptors, but any `ReactNode` works (custom panel cards, etc.).
|
|
909
|
+
*/
|
|
910
|
+
children: ReactNode;
|
|
911
|
+
/**
|
|
912
|
+
* Toggle label. Defaults to `"More"`. The descriptor count gets
|
|
913
|
+
* appended automatically when {@link count} is supplied.
|
|
914
|
+
*/
|
|
915
|
+
label?: string;
|
|
916
|
+
/**
|
|
917
|
+
* Number of hidden items, used to render the trailing "(N)" badge.
|
|
918
|
+
* Omit when the count is irrelevant or already implied (e.g. when
|
|
919
|
+
* the panel only has a fixed set of disclosed items).
|
|
920
|
+
*/
|
|
921
|
+
count?: number;
|
|
922
|
+
/**
|
|
923
|
+
* Initial open state. Defaults to `false` — the disclosure is the
|
|
924
|
+
* point. Authors who want it open by default for a specific seat
|
|
925
|
+
* (e.g. tutorial mode) should pass `true`.
|
|
926
|
+
*/
|
|
927
|
+
defaultOpen?: boolean;
|
|
928
|
+
/** Additional inline style merged after the default container. */
|
|
929
|
+
style?: CSSProperties;
|
|
930
|
+
}
|
|
931
|
+
declare function MoreActions({ children, label, count, defaultOpen, style, }: MoreActionsProps): react_jsx_runtime.JSX.Element;
|
|
932
|
+
|
|
933
|
+
type DiceValue = number | null | undefined;
|
|
934
|
+
|
|
935
|
+
interface DiceRollerRenderProps {
|
|
936
|
+
values: ReadonlyArray<number | undefined> | undefined;
|
|
937
|
+
/** Undefined if any die hasn't been rolled */
|
|
938
|
+
sum: number | undefined;
|
|
939
|
+
diceCount: number;
|
|
940
|
+
allRolled: boolean;
|
|
941
|
+
}
|
|
942
|
+
interface DiceRollerRollAction {
|
|
943
|
+
/** Controlled action callback supplied by the runtime or application. */
|
|
944
|
+
onRoll?: () => void | Promise<void>;
|
|
945
|
+
available?: boolean;
|
|
946
|
+
disabledReason?: string;
|
|
947
|
+
title?: ReactNode;
|
|
948
|
+
description?: ReactNode;
|
|
949
|
+
rollLabel?: ReactNode;
|
|
950
|
+
resultLabel?: ReactNode;
|
|
951
|
+
minSpinMs?: number;
|
|
952
|
+
revealHoldMs?: number;
|
|
953
|
+
}
|
|
954
|
+
interface DiceRollerProps {
|
|
955
|
+
values?: readonly DiceValue[] | null;
|
|
956
|
+
/** Used when values not provided */
|
|
957
|
+
diceCount?: number;
|
|
958
|
+
render?: (props: DiceRollerRenderProps) => ReactNode;
|
|
959
|
+
/** Optional controlled dialog flow for actions such as `rollDice`. */
|
|
960
|
+
rollAction?: DiceRollerRollAction;
|
|
961
|
+
className?: string;
|
|
962
|
+
}
|
|
963
|
+
declare function DiceRoller({ values, diceCount, render, rollAction, className, }: DiceRollerProps): react_jsx_runtime.JSX.Element;
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Surfaces the dominant turn-state question — "is this me?" / "who am I
|
|
967
|
+
* waiting for?" — as a single headline, with the phase label demoted to
|
|
968
|
+
* secondary copy underneath.
|
|
969
|
+
*
|
|
970
|
+
* The previous design rendered three peer chips (`Waiting`, `Roll dice`,
|
|
971
|
+
* `Player 3`) which fragmented one piece of information across three
|
|
972
|
+
* UI atoms. The redesign collapses them into a single status line:
|
|
973
|
+
*
|
|
974
|
+
* ◐ Waiting for Player 3…
|
|
975
|
+
* Roll dice
|
|
976
|
+
*
|
|
977
|
+
* ● Your turn
|
|
978
|
+
* Build, trade, or end your turn.
|
|
979
|
+
*
|
|
980
|
+
* Both states get a leading status indicator that animates so the eye
|
|
981
|
+
* picks up the "live" cue immediately. Animations are skipped when the
|
|
982
|
+
* theme reports `motion.reducedMotion === "true"`.
|
|
983
|
+
*
|
|
984
|
+
* Prop API is unchanged so existing callers (Catan, Things-in-Rings,
|
|
985
|
+
* tests) keep working without edits. The `variant` knob still toggles
|
|
986
|
+
* surface treatment (`badge` is layout-only, `bar` wraps the headline
|
|
987
|
+
* in an inset HUD strip, `minimal` collapses to a single underlined
|
|
988
|
+
* label for tight HUDs).
|
|
989
|
+
*/
|
|
990
|
+
interface PhaseIndicatorProps {
|
|
991
|
+
currentPhase: string;
|
|
992
|
+
phaseLabels?: Record<string, string>;
|
|
993
|
+
isMyTurn?: boolean;
|
|
994
|
+
activePlayerNames?: string[];
|
|
995
|
+
variant?: "badge" | "bar" | "minimal";
|
|
996
|
+
className?: string;
|
|
997
|
+
}
|
|
998
|
+
declare function PhaseIndicator({ currentPhase, phaseLabels, isMyTurn, activePlayerNames, variant, className, }: PhaseIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* End-of-game winner display and scoreboard overlay.
|
|
1002
|
+
*
|
|
1003
|
+
* Visual styling derives entirely from the active {@link useTheme}
|
|
1004
|
+
* (semantic + intent + elevation tokens). The win moment is the
|
|
1005
|
+
* Peak-end anchor of the session, so the surface intentionally pushes
|
|
1006
|
+
* the loudest theme signals (display typeface, primary intent,
|
|
1007
|
+
* elevation.overlay) without inventing one-off colours.
|
|
1008
|
+
*/
|
|
1009
|
+
interface PlayerScore {
|
|
1010
|
+
playerId: string;
|
|
1011
|
+
name: string;
|
|
1012
|
+
score: number;
|
|
1013
|
+
isWinner?: boolean;
|
|
1014
|
+
details?: Record<string, number>;
|
|
1015
|
+
}
|
|
1016
|
+
interface GameEndDisplayProps {
|
|
1017
|
+
isGameOver: boolean;
|
|
1018
|
+
/** Sorted by rank */
|
|
1019
|
+
scores: PlayerScore[];
|
|
1020
|
+
winnerMessage?: string;
|
|
1021
|
+
showDetails?: boolean;
|
|
1022
|
+
onReturnToLobby?: () => void;
|
|
1023
|
+
className?: string;
|
|
1024
|
+
}
|
|
1025
|
+
declare function GameEndDisplay({ isGameOver, scores, winnerMessage, showDetails, onReturnToLobby, className, }: GameEndDisplayProps): react_jsx_runtime.JSX.Element | null;
|
|
1026
|
+
|
|
1027
|
+
interface NetworkNode {
|
|
1028
|
+
id: string;
|
|
1029
|
+
label?: string;
|
|
1030
|
+
position: {
|
|
1031
|
+
x: number;
|
|
1032
|
+
y: number;
|
|
1033
|
+
};
|
|
1034
|
+
type?: string;
|
|
1035
|
+
data?: Record<string, unknown>;
|
|
1036
|
+
}
|
|
1037
|
+
interface NetworkEdge {
|
|
1038
|
+
id: string;
|
|
1039
|
+
from: string;
|
|
1040
|
+
to: string;
|
|
1041
|
+
label?: string | number;
|
|
1042
|
+
owner?: string;
|
|
1043
|
+
type?: string;
|
|
1044
|
+
data?: Record<string, unknown>;
|
|
1045
|
+
}
|
|
1046
|
+
interface NetworkPiece {
|
|
1047
|
+
id: string;
|
|
1048
|
+
nodeId: string;
|
|
1049
|
+
owner?: string;
|
|
1050
|
+
type?: string;
|
|
1051
|
+
data?: Record<string, unknown>;
|
|
1052
|
+
}
|
|
1053
|
+
interface NetworkGraphProps {
|
|
1054
|
+
nodes: NetworkNode[];
|
|
1055
|
+
edges: NetworkEdge[];
|
|
1056
|
+
pieces: NetworkPiece[];
|
|
1057
|
+
/** Receives node centered at its position */
|
|
1058
|
+
renderNode: (node: NetworkNode, pieces: NetworkPiece[]) => ReactNode;
|
|
1059
|
+
renderEdge: (edge: NetworkEdge, fromNode: NetworkNode, toNode: NetworkNode) => ReactNode;
|
|
1060
|
+
renderPiece: (piece: NetworkPiece, position: {
|
|
1061
|
+
x: number;
|
|
1062
|
+
y: number;
|
|
1063
|
+
}) => ReactNode;
|
|
1064
|
+
width?: number | string;
|
|
1065
|
+
height?: number | string;
|
|
1066
|
+
nodeRadius?: number;
|
|
1067
|
+
enablePanZoom?: boolean;
|
|
1068
|
+
initialZoom?: number;
|
|
1069
|
+
minZoom?: number;
|
|
1070
|
+
maxZoom?: number;
|
|
1071
|
+
padding?: number;
|
|
1072
|
+
className?: string;
|
|
1073
|
+
}
|
|
1074
|
+
interface DefaultNetworkNodeProps {
|
|
1075
|
+
radius?: number;
|
|
1076
|
+
fill?: string;
|
|
1077
|
+
stroke?: string;
|
|
1078
|
+
strokeWidth?: number;
|
|
1079
|
+
isSelected?: boolean;
|
|
1080
|
+
isHighlighted?: boolean;
|
|
1081
|
+
label?: string;
|
|
1082
|
+
maxLabelLength?: number;
|
|
1083
|
+
onClick?: () => void;
|
|
1084
|
+
onPointerEnter?: () => void;
|
|
1085
|
+
onPointerLeave?: () => void;
|
|
1086
|
+
className?: string;
|
|
1087
|
+
}
|
|
1088
|
+
/** Pre-built network node for use in `renderNode`. */
|
|
1089
|
+
declare function DefaultNetworkNode({ radius, fill, stroke, strokeWidth, isSelected, isHighlighted, label, maxLabelLength, onClick, onPointerEnter, onPointerLeave, className, }: DefaultNetworkNodeProps): react_jsx_runtime.JSX.Element;
|
|
1090
|
+
interface DefaultNetworkEdgeProps {
|
|
1091
|
+
from: {
|
|
1092
|
+
x: number;
|
|
1093
|
+
y: number;
|
|
1094
|
+
};
|
|
1095
|
+
to: {
|
|
1096
|
+
x: number;
|
|
1097
|
+
y: number;
|
|
1098
|
+
};
|
|
1099
|
+
color?: string;
|
|
1100
|
+
strokeWidth?: number;
|
|
1101
|
+
isSelected?: boolean;
|
|
1102
|
+
isHighlighted?: boolean;
|
|
1103
|
+
/** Displayed at midpoint */
|
|
1104
|
+
label?: string | number;
|
|
1105
|
+
onClick?: () => void;
|
|
1106
|
+
onPointerEnter?: () => void;
|
|
1107
|
+
onPointerLeave?: () => void;
|
|
1108
|
+
className?: string;
|
|
1109
|
+
}
|
|
1110
|
+
/** Pre-built network edge for use in `renderEdge`. */
|
|
1111
|
+
declare function DefaultNetworkEdge({ from, to, color, strokeWidth, isSelected, isHighlighted, label, onClick, onPointerEnter, onPointerLeave, className, }: DefaultNetworkEdgeProps): react_jsx_runtime.JSX.Element;
|
|
1112
|
+
interface DefaultNetworkPieceProps {
|
|
1113
|
+
color?: string;
|
|
1114
|
+
radius?: number;
|
|
1115
|
+
shape?: "circle" | "square";
|
|
1116
|
+
onClick?: () => void;
|
|
1117
|
+
className?: string;
|
|
1118
|
+
}
|
|
1119
|
+
declare function DefaultNetworkPiece({ color, radius, shape, onClick, className, }: DefaultNetworkPieceProps): react_jsx_runtime.JSX.Element;
|
|
1120
|
+
declare function NetworkGraph({ nodes, edges, pieces, renderNode, renderEdge, renderPiece, width, height, nodeRadius, enablePanZoom, initialZoom, minZoom, maxZoom, padding, className, }: NetworkGraphProps): react_jsx_runtime.JSX.Element;
|
|
1121
|
+
|
|
1122
|
+
interface ZoneShape {
|
|
1123
|
+
type: "polygon" | "path" | "circle";
|
|
1124
|
+
points?: Array<{
|
|
1125
|
+
x: number;
|
|
1126
|
+
y: number;
|
|
1127
|
+
}>;
|
|
1128
|
+
/** SVG path data */
|
|
1129
|
+
path?: string;
|
|
1130
|
+
center?: {
|
|
1131
|
+
x: number;
|
|
1132
|
+
y: number;
|
|
1133
|
+
};
|
|
1134
|
+
radius?: number;
|
|
1135
|
+
}
|
|
1136
|
+
interface ZoneDefinition {
|
|
1137
|
+
id: string;
|
|
1138
|
+
name: string;
|
|
1139
|
+
adjacentTo: string[];
|
|
1140
|
+
shape?: ZoneShape;
|
|
1141
|
+
value?: number;
|
|
1142
|
+
type?: string;
|
|
1143
|
+
data?: Record<string, unknown>;
|
|
1144
|
+
}
|
|
1145
|
+
interface ZonePiece {
|
|
1146
|
+
id: string;
|
|
1147
|
+
zoneId: string;
|
|
1148
|
+
type: string;
|
|
1149
|
+
owner?: string;
|
|
1150
|
+
/** Count for stackable pieces (armies) */
|
|
1151
|
+
count?: number;
|
|
1152
|
+
data?: Record<string, unknown>;
|
|
1153
|
+
}
|
|
1154
|
+
interface ZoneMapProps {
|
|
1155
|
+
zones: ZoneDefinition[];
|
|
1156
|
+
pieces: ZonePiece[];
|
|
1157
|
+
renderZone: (zone: ZoneDefinition, pieces: ZonePiece[]) => ReactNode;
|
|
1158
|
+
backgroundImage?: string;
|
|
1159
|
+
width?: number | string;
|
|
1160
|
+
height?: number | string;
|
|
1161
|
+
enablePanZoom?: boolean;
|
|
1162
|
+
initialZoom?: number;
|
|
1163
|
+
minZoom?: number;
|
|
1164
|
+
maxZoom?: number;
|
|
1165
|
+
className?: string;
|
|
1166
|
+
}
|
|
1167
|
+
type ZoneHighlightType = "valid" | "selected" | "attack" | "defend" | "neutral";
|
|
1168
|
+
interface DefaultZoneProps {
|
|
1169
|
+
zone: ZoneDefinition;
|
|
1170
|
+
fill?: string;
|
|
1171
|
+
stroke?: string;
|
|
1172
|
+
strokeWidth?: number;
|
|
1173
|
+
isHighlighted?: boolean;
|
|
1174
|
+
highlightType?: ZoneHighlightType;
|
|
1175
|
+
isSelected?: boolean;
|
|
1176
|
+
showLabel?: boolean;
|
|
1177
|
+
showValue?: boolean;
|
|
1178
|
+
onClick?: () => void;
|
|
1179
|
+
onHover?: (hovering: boolean) => void;
|
|
1180
|
+
className?: string;
|
|
1181
|
+
children?: ReactNode;
|
|
1182
|
+
}
|
|
1183
|
+
declare function DefaultZone({ zone, fill, stroke, strokeWidth, isHighlighted, highlightType, isSelected, showLabel, showValue, onClick, onHover, className, children, }: DefaultZoneProps): react_jsx_runtime.JSX.Element;
|
|
1184
|
+
interface DefaultZonePiecesProps {
|
|
1185
|
+
pieces: ZonePiece[];
|
|
1186
|
+
zone: ZoneDefinition;
|
|
1187
|
+
playerColors?: Record<string, string>;
|
|
1188
|
+
radius?: number;
|
|
1189
|
+
spacing?: number;
|
|
1190
|
+
yOffset?: number;
|
|
1191
|
+
className?: string;
|
|
1192
|
+
}
|
|
1193
|
+
declare function DefaultZonePieces({ pieces, zone, playerColors, radius, spacing, yOffset, className, }: DefaultZonePiecesProps): react_jsx_runtime.JSX.Element | null;
|
|
1194
|
+
interface DefaultZonePieceProps {
|
|
1195
|
+
piece: ZonePiece;
|
|
1196
|
+
x?: number;
|
|
1197
|
+
y?: number;
|
|
1198
|
+
radius?: number;
|
|
1199
|
+
color?: string;
|
|
1200
|
+
onClick?: () => void;
|
|
1201
|
+
className?: string;
|
|
1202
|
+
}
|
|
1203
|
+
declare function DefaultZonePiece({ piece, x, y, radius, color, onClick, className, }: DefaultZonePieceProps): react_jsx_runtime.JSX.Element;
|
|
1204
|
+
declare function ZoneMap({ zones, pieces, renderZone, backgroundImage, width, height, enablePanZoom, initialZoom, minZoom, maxZoom, className, }: ZoneMapProps): react_jsx_runtime.JSX.Element;
|
|
1205
|
+
|
|
1206
|
+
interface SlotDefinition {
|
|
1207
|
+
id: string;
|
|
1208
|
+
name: string;
|
|
1209
|
+
description?: string;
|
|
1210
|
+
capacity: number;
|
|
1211
|
+
/** One player per round */
|
|
1212
|
+
exclusive?: boolean;
|
|
1213
|
+
/** Personal action space owner */
|
|
1214
|
+
owner?: string;
|
|
1215
|
+
group?: string;
|
|
1216
|
+
cost?: Record<string, number>;
|
|
1217
|
+
reward?: Record<string, number>;
|
|
1218
|
+
type?: string;
|
|
1219
|
+
position?: {
|
|
1220
|
+
x: number;
|
|
1221
|
+
y: number;
|
|
1222
|
+
};
|
|
1223
|
+
data?: Record<string, unknown>;
|
|
1224
|
+
}
|
|
1225
|
+
type SlotOccupant = ViewSlotOccupant;
|
|
1226
|
+
interface SlotSystemProps {
|
|
1227
|
+
slots: readonly SlotDefinition[];
|
|
1228
|
+
occupants: readonly SlotOccupant[];
|
|
1229
|
+
renderSlot: (slot: SlotDefinition, occupants: readonly SlotOccupant[]) => ReactNode;
|
|
1230
|
+
layout?: "grid" | "list" | "grouped";
|
|
1231
|
+
width?: number | string;
|
|
1232
|
+
height?: number | string;
|
|
1233
|
+
/** Minimum slot width for responsive grid */
|
|
1234
|
+
minSlotWidth?: number;
|
|
1235
|
+
className?: string;
|
|
1236
|
+
}
|
|
1237
|
+
interface DefaultSlotItemProps {
|
|
1238
|
+
name: string;
|
|
1239
|
+
description?: string;
|
|
1240
|
+
capacity: number;
|
|
1241
|
+
occupantCount: number;
|
|
1242
|
+
isExclusive?: boolean;
|
|
1243
|
+
isAvailable?: boolean;
|
|
1244
|
+
isHighlighted?: boolean;
|
|
1245
|
+
isSelected?: boolean;
|
|
1246
|
+
costLabel?: string;
|
|
1247
|
+
rewardLabel?: string;
|
|
1248
|
+
renderOccupants?: () => ReactNode;
|
|
1249
|
+
onClick?: () => void;
|
|
1250
|
+
onPointerEnter?: () => void;
|
|
1251
|
+
onPointerLeave?: () => void;
|
|
1252
|
+
className?: string;
|
|
1253
|
+
}
|
|
1254
|
+
/** Pre-built slot item for use in `renderSlot`. */
|
|
1255
|
+
declare function DefaultSlotItem({ name, description, capacity, occupantCount, isExclusive, isAvailable, isHighlighted, isSelected, costLabel, rewardLabel, renderOccupants, onClick, onPointerEnter, onPointerLeave, className, }: DefaultSlotItemProps): react_jsx_runtime.JSX.Element;
|
|
1256
|
+
interface DefaultSlotOccupantProps {
|
|
1257
|
+
color?: string;
|
|
1258
|
+
size?: number;
|
|
1259
|
+
shape?: "circle" | "square";
|
|
1260
|
+
label?: string;
|
|
1261
|
+
onClick?: () => void;
|
|
1262
|
+
className?: string;
|
|
1263
|
+
}
|
|
1264
|
+
declare function DefaultSlotOccupant({ color, size, shape, label, onClick, className, }: DefaultSlotOccupantProps): react_jsx_runtime.JSX.Element;
|
|
1265
|
+
interface DefaultEmptySlotProps {
|
|
1266
|
+
size?: number;
|
|
1267
|
+
className?: string;
|
|
1268
|
+
}
|
|
1269
|
+
declare function DefaultEmptySlot({ size, className, }: DefaultEmptySlotProps): react_jsx_runtime.JSX.Element;
|
|
1270
|
+
declare function SlotSystem({ slots, occupants, renderSlot, layout, width, height, minSlotWidth, className, }: SlotSystemProps): react_jsx_runtime.JSX.Element;
|
|
1271
|
+
|
|
1272
|
+
interface SquareEdgePosition {
|
|
1273
|
+
x1: number;
|
|
1274
|
+
y1: number;
|
|
1275
|
+
x2: number;
|
|
1276
|
+
y2: number;
|
|
1277
|
+
midX: number;
|
|
1278
|
+
midY: number;
|
|
1279
|
+
angle: number;
|
|
1280
|
+
}
|
|
1281
|
+
interface SquareVertexPosition {
|
|
1282
|
+
x: number;
|
|
1283
|
+
y: number;
|
|
1284
|
+
}
|
|
1285
|
+
interface InteractiveSquareEdge<TBoard extends AnySquareBoardInput = AnySquareBoardInput> extends NormalizedSquareEdgeOf<TBoard> {
|
|
1286
|
+
position: SquareEdgePosition;
|
|
1287
|
+
}
|
|
1288
|
+
interface InteractiveSquareVertex<TBoard extends AnySquareBoardInput = AnySquareBoardInput> extends NormalizedSquareVertexOf<TBoard> {
|
|
1289
|
+
position: SquareVertexPosition;
|
|
1290
|
+
}
|
|
1291
|
+
type InteractiveSquareSpace<TBoard extends AnySquareBoardInput = AnySquareBoardInput> = NormalizedSquareCellOf<TBoard>;
|
|
1292
|
+
interface SquareGeneratedGridInputProps {
|
|
1293
|
+
id?: string;
|
|
1294
|
+
layout?: "square";
|
|
1295
|
+
spaces: Extract<AnySquareBoardInput, {
|
|
1296
|
+
spaces: unknown;
|
|
1297
|
+
}>["spaces"];
|
|
1298
|
+
pieces?: AnySquareBoardInput["pieces"];
|
|
1299
|
+
edges?: AnySquareBoardInput["edges"];
|
|
1300
|
+
vertices?: AnySquareBoardInput["vertices"];
|
|
1301
|
+
}
|
|
1302
|
+
interface SquareAuthoredGridInputProps {
|
|
1303
|
+
id?: string;
|
|
1304
|
+
layout?: "square";
|
|
1305
|
+
rows?: number;
|
|
1306
|
+
cols?: number;
|
|
1307
|
+
cells: Extract<AnySquareBoardInput, {
|
|
1308
|
+
cells: unknown;
|
|
1309
|
+
}>["cells"];
|
|
1310
|
+
pieces?: readonly SquarePieceState[];
|
|
1311
|
+
edges?: AnySquareBoardInput["edges"];
|
|
1312
|
+
vertices?: AnySquareBoardInput["vertices"];
|
|
1313
|
+
}
|
|
1314
|
+
type SquareGridInputProps = SquareGeneratedGridInputProps | SquareAuthoredGridInputProps;
|
|
1315
|
+
type ResolvedSquareArrayProp<Value> = Exclude<Value, undefined> extends readonly unknown[] ? Exclude<Value, undefined> : readonly [];
|
|
1316
|
+
type SquareBoardLikeOfProps<TProps extends SquareGridInputProps> = TProps extends {
|
|
1317
|
+
id?: infer Id;
|
|
1318
|
+
layout?: infer Layout;
|
|
1319
|
+
spaces: infer Spaces;
|
|
1320
|
+
pieces?: infer Pieces;
|
|
1321
|
+
edges?: infer Edges;
|
|
1322
|
+
vertices?: infer Vertices;
|
|
1323
|
+
} ? {
|
|
1324
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
1325
|
+
layout?: Extract<Layout, "square">;
|
|
1326
|
+
spaces: Spaces;
|
|
1327
|
+
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
1328
|
+
edges: ResolvedSquareArrayProp<Edges>;
|
|
1329
|
+
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
1330
|
+
} & GeneratedSquareBoardInput : TProps extends {
|
|
1331
|
+
id?: infer Id;
|
|
1332
|
+
layout?: infer Layout;
|
|
1333
|
+
rows?: infer Rows;
|
|
1334
|
+
cols?: infer Cols;
|
|
1335
|
+
cells: infer Cells;
|
|
1336
|
+
pieces?: infer Pieces;
|
|
1337
|
+
edges?: infer Edges;
|
|
1338
|
+
vertices?: infer Vertices;
|
|
1339
|
+
} ? {
|
|
1340
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
1341
|
+
layout?: Extract<Layout, "square">;
|
|
1342
|
+
rows: Extract<Rows, number> extends never ? number : Extract<Rows, number>;
|
|
1343
|
+
cols: Extract<Cols, number> extends never ? number : Extract<Cols, number>;
|
|
1344
|
+
cells: Cells;
|
|
1345
|
+
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
1346
|
+
edges: ResolvedSquareArrayProp<Edges>;
|
|
1347
|
+
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
1348
|
+
} & AuthoredSquareBoardInput : never;
|
|
1349
|
+
type SquareGridProps<TProps extends SquareGridInputProps = SquareGridInputProps> = TProps & {
|
|
1350
|
+
cellSize?: number;
|
|
1351
|
+
/** Receives row/col with transform centered at cell position */
|
|
1352
|
+
renderCell: (row: number, col: number) => ReactNode;
|
|
1353
|
+
/** Receives piece with transform centered at cell center */
|
|
1354
|
+
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<SquareBoardLikeOfProps<TProps>>>) => ReactNode;
|
|
1355
|
+
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition) => ReactNode;
|
|
1356
|
+
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition) => ReactNode;
|
|
1357
|
+
showCoordinates?: boolean;
|
|
1358
|
+
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
1359
|
+
width?: number | string;
|
|
1360
|
+
height?: number | string;
|
|
1361
|
+
enablePanZoom?: boolean;
|
|
1362
|
+
initialZoom?: number;
|
|
1363
|
+
minZoom?: number;
|
|
1364
|
+
maxZoom?: number;
|
|
1365
|
+
className?: string;
|
|
1366
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
1367
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
1368
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
1369
|
+
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<SquareBoardLikeOfProps<TProps>>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
1370
|
+
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
1371
|
+
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
1372
|
+
};
|
|
1373
|
+
interface SquareGridBoardProps<TBoard extends AnySquareBoardInput = AnySquareBoardInput> {
|
|
1374
|
+
board: TBoard;
|
|
1375
|
+
cellSize?: number;
|
|
1376
|
+
renderCell: (row: number, col: number) => ReactNode;
|
|
1377
|
+
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<TBoard>>) => ReactNode;
|
|
1378
|
+
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<TBoard>>, position: SquareEdgePosition) => ReactNode;
|
|
1379
|
+
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<TBoard>>, position: SquareVertexPosition) => ReactNode;
|
|
1380
|
+
showCoordinates?: boolean;
|
|
1381
|
+
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
1382
|
+
width?: number | string;
|
|
1383
|
+
height?: number | string;
|
|
1384
|
+
enablePanZoom?: boolean;
|
|
1385
|
+
initialZoom?: number;
|
|
1386
|
+
minZoom?: number;
|
|
1387
|
+
maxZoom?: number;
|
|
1388
|
+
className?: string;
|
|
1389
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
1390
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
1391
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
1392
|
+
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<TBoard>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
1393
|
+
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<TBoard>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
1394
|
+
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<TBoard>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
1395
|
+
}
|
|
1396
|
+
interface DefaultGridCellProps {
|
|
1397
|
+
size: number;
|
|
1398
|
+
isLight?: boolean;
|
|
1399
|
+
lightColor?: string;
|
|
1400
|
+
darkColor?: string;
|
|
1401
|
+
isHighlighted?: boolean;
|
|
1402
|
+
highlightColor?: string;
|
|
1403
|
+
isSelected?: boolean;
|
|
1404
|
+
selectedColor?: string;
|
|
1405
|
+
isValidMove?: boolean;
|
|
1406
|
+
isCapture?: boolean;
|
|
1407
|
+
onClick?: () => void;
|
|
1408
|
+
onPointerEnter?: () => void;
|
|
1409
|
+
onPointerLeave?: () => void;
|
|
1410
|
+
className?: string;
|
|
1411
|
+
}
|
|
1412
|
+
/** Pre-built grid cell component for use in `renderCell`. */
|
|
1413
|
+
declare function DefaultGridCell({ size, isLight, lightColor, darkColor, isHighlighted, highlightColor, isSelected, selectedColor, isValidMove, isCapture, onClick, onPointerEnter, onPointerLeave, className, }: DefaultGridCellProps): react_jsx_runtime.JSX.Element;
|
|
1414
|
+
interface DefaultGridPieceProps {
|
|
1415
|
+
size: number;
|
|
1416
|
+
color?: string;
|
|
1417
|
+
strokeColor?: string;
|
|
1418
|
+
label?: string;
|
|
1419
|
+
isDragging?: boolean;
|
|
1420
|
+
onClick?: () => void;
|
|
1421
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
1422
|
+
className?: string;
|
|
1423
|
+
}
|
|
1424
|
+
/** Pre-built grid piece component for use in `renderPiece`. */
|
|
1425
|
+
declare function DefaultGridPiece({ size, color, strokeColor, label, isDragging, onClick, onPointerDown, className, }: DefaultGridPieceProps): react_jsx_runtime.JSX.Element;
|
|
1426
|
+
interface DefaultChessPieceProps {
|
|
1427
|
+
size: number;
|
|
1428
|
+
type: string;
|
|
1429
|
+
owner: "white" | "black";
|
|
1430
|
+
onClick?: () => void;
|
|
1431
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
1432
|
+
className?: string;
|
|
1433
|
+
}
|
|
1434
|
+
/** Pre-built chess piece component using Unicode symbols. */
|
|
1435
|
+
declare function DefaultChessPiece({ size, type, owner, onClick, onPointerDown, className, }: DefaultChessPieceProps): react_jsx_runtime.JSX.Element;
|
|
1436
|
+
/**
|
|
1437
|
+
* Convert row/col to algebraic notation (a1, b2, etc.)
|
|
1438
|
+
*/
|
|
1439
|
+
declare function toAlgebraic(row: number, col: number, totalRows: number): string;
|
|
1440
|
+
/**
|
|
1441
|
+
* Convert row/col to numeric notation (1,1, 2,3, etc.)
|
|
1442
|
+
*/
|
|
1443
|
+
declare function toNumeric(row: number, col: number): string;
|
|
1444
|
+
interface SquareGridComponent {
|
|
1445
|
+
<const TBoard extends AnySquareBoardInput>(props: SquareGridBoardProps<TBoard>): ReactNode;
|
|
1446
|
+
<const TProps extends SquareGeneratedGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
1447
|
+
<const TProps extends SquareAuthoredGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
1448
|
+
}
|
|
1449
|
+
declare const SquareGrid: SquareGridComponent;
|
|
1450
|
+
|
|
1451
|
+
export { Dialog as $, ActionButton as A, type ButtonSize$1 as B, CardDragSurface as C, DefaultChessPiece as D, type DefaultNetworkEdgeProps as E, DefaultNetworkNode as F, type DefaultNetworkNodeProps as G, DefaultNetworkPiece as H, type DefaultNetworkPieceProps as I, DefaultSlotItem as J, type DefaultSlotItemProps as K, DefaultSlotOccupant as L, type DefaultSlotOccupantProps as M, DefaultTrackConnection as N, type DefaultTrackConnectionProps as O, DefaultTrackJump as P, type DefaultTrackJumpProps as Q, DefaultTrackPiece as R, type DefaultTrackPieceProps as S, DefaultTrackSpace as T, type DefaultTrackSpaceProps as U, DefaultZone as V, DefaultZonePiece as W, type DefaultZonePieceProps as X, DefaultZonePieces as Y, type DefaultZonePiecesProps as Z, type DefaultZoneProps as _, type ActionButtonProps as a, type SlotDefinition as a$, DialogClose as a0, DialogContent as a1, DialogDescription as a2, DialogFooter as a3, DialogHeader as a4, DialogOverlay as a5, DialogPortal as a6, DialogTitle as a7, DialogTrigger as a8, DiceRoller as a9, type HandProps as aA, Input as aB, type InteractiveSquareEdge as aC, type InteractiveSquareVertex as aD, Label as aE, MoreActions as aF, type MoreActionsProps as aG, type NetworkEdge as aH, NetworkGraph as aI, type NetworkGraphProps as aJ, type NetworkNode as aK, type NetworkPiece as aL, PhaseIndicator as aM, type PhaseIndicatorProps as aN, PlayArea as aO, type PlayAreaProps as aP, type PlayerScore as aQ, type PrimaryActionAttention as aR, PrimaryActionButton as aS, type PrimaryActionButtonProps as aT, PrimaryButton as aU, type PrimaryButtonProps as aV, type ResourceDefinition as aW, Select as aX, SelectContent as aY, SelectItem as aZ, SelectTrigger as a_, type DiceRollerProps as aa, type DragPhase as ab, Drawer as ac, DrawerClose as ad, DrawerContent as ae, DrawerDescription as af, DrawerFooter as ag, DrawerHeader as ah, DrawerOverlay as ai, DrawerPortal as aj, DrawerTitle as ak, DrawerTrigger as al, ErrorBoundary as am, type ErrorBoundaryProps as an, GameEndDisplay as ao, type GameEndDisplayProps as ap, GameSkeleton as aq, type GameSkeletonProps as ar, Hand as as, HandDock as at, type HandDockMode as au, type HandDockPlacement as av, type HandDockPresentation as aw, type HandDockProps as ax, type HandDockToggleContext as ay, type HandLayout as az, ActionGroup as b, type SlotOccupant as b0, SlotSystem as b1, type SlotSystemProps as b2, type SquareEdgePosition as b3, SquareGrid as b4, type SquareGridBoardProps as b5, type SquareGridProps as b6, type SquareVertexPosition as b7, StagingZone as b8, type StagingZoneProps as b9, surfaceStyle as bA, toAlgebraic as bB, toNumeric as bC, useCardDragSurface as bD, useChromeSuppression as bE, useHandLayout as bF, ThemedButton as ba, type ThemedButtonProps as bb, Toast as bc, ToastActions as bd, type ToastActionsProps as be, type ToastActionsValue as bf, type ToastNotification as bg, ToastProvider as bh, type ToastType as bi, TrackBoard as bj, type TrackBoardProps as bk, type TrackPiece as bl, type TrackSpace as bm, type UseHandLayoutOptions as bn, type UseHandLayoutReturn as bo, type ZoneDefinition as bp, type ZoneHighlightType as bq, ZoneMap as br, type ZoneMapProps as bs, type ZonePiece as bt, type ZoneShape as bu, buttonStyle as bv, chipStyle as bw, intentForVariant as bx, motionDuration as by, playerColor as bz, type ActionGroupProps as c, ActionPanel as d, type ActionPanelProps as e, type ButtonVariant$1 as f, type CardDragSurfaceContextValue as g, type CardDragSurfaceController as h, type CardDragSurfaceProps as i, CardDropTargetView as j, type CardDropTargetViewProps as k, CardFace as l, type CardFaceProps as m, type CardPositionProps as n, type CardSize as o, ChromeSuppressionProvider as p, CostDisplay as q, type CostDisplayProps as r, type DefaultChessPieceProps as s, DefaultEmptySlot as t, type DefaultEmptySlotProps as u, DefaultGridCell as v, type DefaultGridCellProps as w, DefaultGridPiece as x, type DefaultGridPieceProps as y, DefaultNetworkEdge as z };
|