@simple-parlay/components 1.30.6-pre.10 → 1.30.6-pre.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +653 -467
- package/dist/react/components/CallPayoutTable.d.ts +7 -1
- package/dist/react/components/EntrySubmission.d.ts +1 -1
- package/dist/react/components/EventSwipeModal.d.ts +4 -0
- package/dist/react/components/GameCardParts.d.ts +28 -0
- package/dist/react/components/GameModeCard.d.ts +6 -2
- package/dist/react/components/GameSelector.d.ts +1 -27
- package/dist/react/components/GameShowcaseCatalogue.d.ts +3 -1
- package/dist/react/components/GameSkeletons.d.ts +24 -0
- package/dist/react/components/HowToPlayButton.d.ts +2 -1
- package/dist/react/components/LoadingIndicators.d.ts +27 -10
- package/dist/react/components/MatchRail.d.ts +23 -1
- package/dist/react/components/MatchTopBar.d.ts +19 -0
- package/dist/react/components/MultiLegTable.d.ts +3 -1
- package/dist/react/components/PageBackButton.d.ts +28 -7
- package/dist/react/components/PageSkeletons.d.ts +24 -0
- package/dist/react/components/PickGroupSection.d.ts +37 -0
- package/dist/react/components/PickerBrand.d.ts +0 -5
- package/dist/react/components/PicksSkeletons.d.ts +30 -0
- package/dist/react/components/PlaceEntryProvider.d.ts +34 -3
- package/dist/react/components/PropositionFilters.d.ts +0 -1
- package/dist/react/components/PropositionParts.d.ts +38 -0
- package/dist/react/components/QuickPickButton.d.ts +24 -1
- package/dist/react/components/QuickPickMenu.d.ts +19 -1
- package/dist/react/components/SafetyNetPage.d.ts +19 -0
- package/dist/react/components/SelectionsPage.d.ts +7 -2
- package/dist/react/components/ShelfKit.d.ts +43 -0
- package/dist/react/components/SportRail.d.ts +1 -1
- package/dist/react/components/SportSelector.d.ts +1 -36
- package/dist/react/components/SuccessPage.d.ts +4 -2
- package/dist/react/components/SwipeDeck.d.ts +32 -3
- package/dist/react/components/YesNoMultiLogo.d.ts +13 -0
- package/dist/react/components/_primitives/index.d.ts +47 -12
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.ts +10 -2
- package/dist/react/index.mjs +653 -467
- package/dist/react/utils/themes.d.ts +1 -1
- package/dist/react-native/components/CallGameCatalogue.d.ts +1 -0
- package/dist/react-native/components/CallPayoutTable.d.ts +7 -1
- package/dist/react-native/components/DenseUi.d.ts +2 -9
- package/dist/react-native/components/EntrySubmission.d.ts +1 -1
- package/dist/react-native/components/EventSwipeModal.d.ts +5 -0
- package/dist/react-native/components/GameCardParts.d.ts +29 -0
- package/dist/react-native/components/GameModeCard.d.ts +3 -1
- package/dist/react-native/components/GameSelector.d.ts +0 -27
- package/dist/react-native/components/GameShelfCatalogue.d.ts +0 -5
- package/dist/react-native/components/GameSkeletons.d.ts +23 -0
- package/dist/react-native/components/HowToPlayButton.d.ts +2 -1
- package/dist/react-native/components/LoadingIndicators.d.ts +22 -10
- package/dist/react-native/components/MatchRail.d.ts +23 -2
- package/dist/react-native/components/MatchTopBar.d.ts +17 -0
- package/dist/react-native/components/MultiLegTable.d.ts +3 -1
- package/dist/react-native/components/PageBackButton.d.ts +26 -10
- package/dist/react-native/components/PageSkeletons.d.ts +23 -0
- package/dist/react-native/components/PickGroupSection.d.ts +37 -0
- package/dist/react-native/components/PickerBrand.d.ts +0 -4
- package/dist/react-native/components/PicksSkeletons.d.ts +31 -0
- package/dist/react-native/components/PlaceEntryProvider.d.ts +34 -3
- package/dist/react-native/components/PropositionFilters.d.ts +0 -1
- package/dist/react-native/components/PropositionParts.d.ts +35 -0
- package/dist/react-native/components/QuickPickButton.d.ts +24 -1
- package/dist/react-native/components/QuickPickMenu.d.ts +20 -1
- package/dist/react-native/components/SafetyNetPage.d.ts +17 -0
- package/dist/react-native/components/SelectionsPage.d.ts +6 -2
- package/dist/react-native/components/ShelfKit.d.ts +62 -0
- package/dist/react-native/components/SportRail.d.ts +1 -1
- package/dist/react-native/components/SportSelector.d.ts +1 -33
- package/dist/react-native/components/SuccessPage.d.ts +4 -2
- package/dist/react-native/components/SwipeDeck.d.ts +37 -3
- package/dist/react-native/components/YesNoMultiLogo.d.ts +12 -0
- package/dist/react-native/components/_primitives/index.d.ts +83 -10
- package/dist/react-native/index.cjs +1 -1
- package/dist/react-native/index.d.ts +10 -2
- package/dist/react-native/index.mjs +561 -438
- package/dist/react-native/utils/themes.d.ts +1 -1
- package/dist/shared/button-ui.d.ts +62 -0
- package/dist/shared/call-presentation.d.ts +9 -1
- package/dist/shared/canvas.d.ts +14 -0
- package/dist/shared/correlation-steering.d.ts +7 -0
- package/dist/shared/date-filters.d.ts +0 -23
- package/dist/shared/entry-progress.d.ts +38 -0
- package/dist/shared/game-artwork.d.ts +2 -0
- package/dist/shared/game-flow.d.ts +20 -0
- package/dist/shared/game-icons.d.ts +2 -1
- package/dist/shared/game-shelf-presentation.d.ts +38 -2
- package/dist/shared/hooks.d.ts +1 -1
- package/dist/shared/selection-actions.d.ts +70 -3
- package/dist/shared/selection-caps.d.ts +66 -10
- package/dist/shared/selection-variants.d.ts +5 -0
- package/dist/shared/shelf-covers.d.ts +92 -0
- package/dist/shared/shelf-ui.d.ts +47 -0
- package/dist/shared/swipe-deck.d.ts +10 -0
- package/dist/shared/themes.d.ts +48 -8
- package/dist/shared/tokens.d.ts +7 -0
- package/dist/shared/types.d.ts +6 -1
- package/dist/shared/ui-system.d.ts +4 -3
- package/dist/shared/utils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { BladeTheme } from '../types';
|
|
2
3
|
export interface QuickPickButtonProps {
|
|
3
4
|
onPress: () => void;
|
|
@@ -9,5 +10,27 @@ export interface QuickPickButtonProps {
|
|
|
9
10
|
theme?: BladeTheme;
|
|
10
11
|
menu?: boolean;
|
|
11
12
|
expanded?: boolean;
|
|
13
|
+
/** What a press will do, e.g. "Fill 6 for me". Shown by the deck style. */
|
|
14
|
+
hint?: string;
|
|
12
15
|
}
|
|
13
|
-
export
|
|
16
|
+
export interface QuickPickDeckButtonProps {
|
|
17
|
+
onPress: () => void;
|
|
18
|
+
onDoubleClick?: () => void;
|
|
19
|
+
/** What a press will do, e.g. "Fill 6 for me". */
|
|
20
|
+
hint?: string;
|
|
21
|
+
/** solid on its own; paper beside a main button, so that one stays the first choice. */
|
|
22
|
+
tone?: 'solid' | 'paper';
|
|
23
|
+
theme?: BladeTheme;
|
|
24
|
+
menu?: boolean;
|
|
25
|
+
expanded?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
}
|
|
29
|
+
/** QuickPick's shuffle mark. Decorative unless given a role and label. */
|
|
30
|
+
export declare function QuickPickIcon({ size, color, ...rest }: {
|
|
31
|
+
size?: number;
|
|
32
|
+
color?: string;
|
|
33
|
+
} & React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
/** QuickPick as a small deck: the game icons' stacked tiles, an accent shuffle tile and a line saying what it will do. */
|
|
35
|
+
export declare function QuickPickDeckButton({ onPress, onDoubleClick, hint, tone, theme: themeProp, menu, expanded, disabled, style, }: QuickPickDeckButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function QuickPickButton({ onPress, onDoubleClick, label, size, yesColor, noColor, theme: themeProp, menu, expanded, hint, }: QuickPickButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BladeTheme } from '../../shared/themes';
|
|
1
3
|
export interface QuickPickMenuColors {
|
|
2
4
|
background: string;
|
|
3
5
|
backgroundAlt: string;
|
|
@@ -6,6 +8,8 @@ export interface QuickPickMenuColors {
|
|
|
6
8
|
}
|
|
7
9
|
export interface QuickPickMenuProps {
|
|
8
10
|
counts: number[];
|
|
11
|
+
/** The size the card is on now, marked in the Shelf menu. */
|
|
12
|
+
current?: number;
|
|
9
13
|
onPick: (count: number) => void;
|
|
10
14
|
onDoubleAction?: () => void;
|
|
11
15
|
colors: QuickPickMenuColors;
|
|
@@ -13,5 +17,19 @@ export interface QuickPickMenuProps {
|
|
|
13
17
|
direction?: 'down' | 'up';
|
|
14
18
|
/** Themed elevation for the dropdown (pass `elevatedShadow(theme)`). */
|
|
15
19
|
menuShadow?: string;
|
|
20
|
+
/** Rounds the menu's corners to the theme's radius when set. */
|
|
21
|
+
theme?: BladeTheme;
|
|
22
|
+
/** What the trigger will do, shown by the deck QuickPick style. */
|
|
23
|
+
hint?: string;
|
|
24
|
+
/** "Fill the other 6": keep the player's picks, fill the empty slots. */
|
|
25
|
+
onFill?: () => void;
|
|
26
|
+
fillLabel?: string;
|
|
27
|
+
/** "Randomise all 8": throw the card away and pick it afresh. */
|
|
28
|
+
onRandomise?: () => void;
|
|
29
|
+
randomiseLabel?: string;
|
|
16
30
|
}
|
|
17
|
-
|
|
31
|
+
/** A list / menu row: the shared hoverTint over the row, nothing else. RN twin: MenuRow in the RN QuickPickMenu. */
|
|
32
|
+
export declare function MenuRow({ theme: themeProp, style, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
33
|
+
theme?: BladeTheme;
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function QuickPickMenu({ counts, current, onPick, onDoubleAction, colors, align, direction, menuShadow, theme, hint, onFill, fillLabel, onRandomise, randomiseLabel }: QuickPickMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SafetyNetConfig } from '../../shared/safety-net';
|
|
3
|
+
export interface SafetyNetPageProps {
|
|
4
|
+
onQuickPick?: () => void;
|
|
5
|
+
onPickYourOwn?: () => void;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
hideTitle?: boolean;
|
|
8
|
+
config?: SafetyNetConfig | null;
|
|
9
|
+
backLabel?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Replace the default game heading; pass null when the host supplies a header. */
|
|
12
|
+
header?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function SafetyNetPageTitle({ className, onBack, hideActions, }: {
|
|
15
|
+
className?: string;
|
|
16
|
+
onBack?: () => void;
|
|
17
|
+
hideActions?: boolean;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function SafetyNetPage({ onQuickPick, onPickYourOwn, onBack, hideTitle, header, config: configOverride, backLabel, className, }: SafetyNetPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ export interface SelectionsPageProps {
|
|
|
6
6
|
onBack?: () => void;
|
|
7
7
|
/** Hide the built-in title section (use `<SelectionsPageTitle />` separately) */
|
|
8
8
|
hideTitle?: boolean;
|
|
9
|
-
/** Hide the built-in action buttons (use `<SelectionsPageActions />` separately) */
|
|
9
|
+
/** Hide the built-in action buttons (use `<SelectionsPageActions />` separately, with `<SelectionUndoSnackbar />` just above it) */
|
|
10
10
|
hideActions?: boolean;
|
|
11
11
|
defaultView?: SelectionsView;
|
|
12
12
|
view?: SelectionsView;
|
|
@@ -21,7 +21,12 @@ export declare function SelectionsPageTitle({ className, onBack, onNext, hideAct
|
|
|
21
21
|
onNext?: () => void;
|
|
22
22
|
hideActions?: boolean;
|
|
23
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* What the last QuickPick or Clear picks did, with Undo: a white bar just above the dock, gone after 6s
|
|
26
|
+
* (held while hovered or focused). Game Shelf picks only. Hosts that render `<SelectionsPageActions />`
|
|
27
|
+
* themselves mount this just above their dock, inside the same sticky block.
|
|
28
|
+
*/
|
|
29
|
+
export declare function SelectionUndoSnackbar(): import("react/jsx-runtime").JSX.Element | null;
|
|
25
30
|
export declare function SelectionsPageActions({ onNext, onBack, hideButtons, className, }: {
|
|
26
31
|
onNext?: () => void;
|
|
27
32
|
onBack?: () => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BladeTheme } from '../types';
|
|
3
|
+
import { DrawnCover } from '../../shared/shelf-covers';
|
|
4
|
+
import { ShelfPipState } from '../../shared/shelf-ui';
|
|
5
|
+
export declare function useShelfTheme(theme?: BladeTheme): BladeTheme;
|
|
6
|
+
type DivProps = React.HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
/** A white card on the light page: hairline border, soft shadow, radius 16. */
|
|
8
|
+
export declare function ShelfCard({ theme: themeProp, padded, style, ...rest }: DivProps & {
|
|
9
|
+
theme?: BladeTheme;
|
|
10
|
+
padded?: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/** The one action bar: a white card docked to the bottom of the page (sticky on web when asked). */
|
|
13
|
+
export declare function ShelfDock({ theme: themeProp, sticky, style, ...rest }: DivProps & {
|
|
14
|
+
theme?: BladeTheme;
|
|
15
|
+
sticky?: boolean;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type OptionProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'> & {
|
|
18
|
+
theme?: BladeTheme;
|
|
19
|
+
selected: boolean;
|
|
20
|
+
/** A second, smaller line (a count or a detail); makes the option 52 tall. */
|
|
21
|
+
sub?: React.ReactNode;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
};
|
|
24
|
+
/** Every chip, filter, tab and option: teal with light text when chosen, white with a hairline when not. */
|
|
25
|
+
export declare function ShelfOption({ theme: themeProp, selected, sub, children, disabled, type, style, onMouseEnter, onMouseLeave, onPointerDown, onPointerUp, onFocus, onBlur, ...rest }: OptionProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
/** One progress mark per pick: right fills teal, a miss is outlined, still to play is a hairline grey. */
|
|
27
|
+
export declare function ShelfPips({ theme: themeProp, states, label, style }: {
|
|
28
|
+
theme?: BladeTheme;
|
|
29
|
+
states: readonly ShelfPipState[];
|
|
30
|
+
label?: string;
|
|
31
|
+
style?: React.CSSProperties;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* A cover or banner's drawn art (`theme.shelf.coverStyle`): its pattern, tiles and mark. `frame` places
|
|
35
|
+
* the art box in any CSS lengths; inside it everything is a share of the box, so it scales with it. Sits over a
|
|
36
|
+
* `position: relative` surface. RN twin: DrawnArt in the RN ShelfKit.
|
|
37
|
+
*/
|
|
38
|
+
export declare function DrawnArt({ drawn, frame, className }: {
|
|
39
|
+
drawn: DrawnCover;
|
|
40
|
+
frame: React.CSSProperties;
|
|
41
|
+
className?: string;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -4,7 +4,7 @@ export interface SportRailProps {
|
|
|
4
4
|
label?: string | null;
|
|
5
5
|
/** Line under the heading. Pass `null` to drop it; omit for the default hint. */
|
|
6
6
|
sublabel?: string | null;
|
|
7
|
-
/** Controls
|
|
7
|
+
/** Controls under the track — search and Swipe on the picks screen. */
|
|
8
8
|
actions?: React.ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SportSelectorProps, Proposition, RenderTeamLogo } from '../../shared/types';
|
|
3
|
-
/** A header key names two teams when it splits on " vs " — `MatchupTeams`' own test. */
|
|
4
|
-
export declare function isMatchupKey(key?: string | null): boolean;
|
|
5
|
-
/** The runner's silk, for single-event rows; under an "A vs B" header the logos are already up top. */
|
|
6
|
-
export declare function runnerLogo(prop: Proposition, renderTeamLogo: SportSelectorProps['renderTeamLogo'], headerKey?: string | null): React.ReactNode;
|
|
1
|
+
import { SportSelectorProps } from '../../shared/types';
|
|
7
2
|
/** "A vs B" as a header — names stack beside the "vs" on a phone, one line from `sm` up. */
|
|
8
3
|
export declare function MatchupTeams({ matchup, renderTeamLogo, altText, mutedColor, size, }: {
|
|
9
4
|
matchup: string;
|
|
@@ -12,34 +7,4 @@ export declare function MatchupTeams({ matchup, renderTeamLogo, altText, mutedCo
|
|
|
12
7
|
mutedColor: string;
|
|
13
8
|
size?: 'sm' | 'md';
|
|
14
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare function CompositePropositionText({ prop, colors: c, size, componentById, textClass: textClassOverride, textColor, eventLabels, renderTeamLogo, }: {
|
|
16
|
-
prop: Proposition;
|
|
17
|
-
colors: {
|
|
18
|
-
primary: string;
|
|
19
|
-
text: string;
|
|
20
|
-
textMuted?: string;
|
|
21
|
-
textAltMuted?: string;
|
|
22
|
-
backgroundAlt?: string;
|
|
23
|
-
border?: string;
|
|
24
|
-
};
|
|
25
|
-
size?: 'sm' | 'md';
|
|
26
|
-
componentById?: ReadonlyMap<number, Proposition>;
|
|
27
|
-
/** Replaces the size-derived type classes — the variant layouts set their own. */
|
|
28
|
-
textClass?: string;
|
|
29
|
-
/** Replaces `colors.text` on the question itself, legs included. */
|
|
30
|
-
textColor?: string;
|
|
31
|
-
/**
|
|
32
|
-
* How a leg names its fixture. `show` stacks the label above each leg —
|
|
33
|
-
* right where rows have room. `hover` keeps the legs on one line and puts
|
|
34
|
-
* the fixture in the tooltip instead, for compact rows like the slip and
|
|
35
|
-
* the confirm list. Either way the title attribute carries it.
|
|
36
|
-
*/
|
|
37
|
-
eventLabels?: 'show' | 'hover';
|
|
38
|
-
/**
|
|
39
|
-
* Supplied, a leg names its fixture with the two club badges instead of a
|
|
40
|
-
* text chip — far lighter in a row, and the full matchup stays in the
|
|
41
|
-
* tooltip. Falls back to the text chip when the host renders no logos.
|
|
42
|
-
*/
|
|
43
|
-
renderTeamLogo?: RenderTeamLogo;
|
|
44
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
45
10
|
export declare function SportSelector({ game, propositions, selections, onToggleSelection, onNext, onBack, loading, error, theme: themeProp, colorScheme, hideActions, initialSport, renderTeamLogo, disableQuickPick, selectedPropositionCount, onPropositionCountChange, gameCategory, headerExtra, railSlot, variant, disableEventSwipe, }: SportSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,12 +12,14 @@ export interface SuccessPageProps {
|
|
|
12
12
|
hideActions?: boolean;
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare function SuccessPageTitle({ className, onBack, hideActions, }: {
|
|
15
|
+
export declare function SuccessPageTitle({ className, onBack, onDone, hideActions, }: {
|
|
16
16
|
className?: string;
|
|
17
17
|
onBack?: () => void;
|
|
18
|
+
/** Non-shelf systems: the header's × (shelf's lives in its dock as "View my entries"). */
|
|
19
|
+
onDone?: () => void;
|
|
18
20
|
hideActions?: boolean;
|
|
19
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
/** Renders Place Another
|
|
22
|
+
/** Renders Place Another (shelf: View my entries + Play again). Must be inside `<PlaceEntryProvider>`. */
|
|
21
23
|
export declare function SuccessPageActions({ onPlayAgain, onDone, onShare, className, }: {
|
|
22
24
|
onPlayAgain?: () => void;
|
|
23
25
|
onDone?: () => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { BladeTheme } from '../utils/themes';
|
|
3
|
-
import { FlyDirection } from '../../shared/swipe-deck';
|
|
3
|
+
import { FlyDirection, SwipeVariant } from '../../shared/swipe-deck';
|
|
4
4
|
import { Proposition } from '../../shared/types';
|
|
5
|
-
export type { FlyDirection };
|
|
5
|
+
export type { FlyDirection, SwipeVariant };
|
|
6
6
|
export interface SwipeCardApi {
|
|
7
7
|
fly: (direction: FlyDirection) => void;
|
|
8
8
|
}
|
|
@@ -13,16 +13,45 @@ export interface SwipeCardProps {
|
|
|
13
13
|
depth?: number;
|
|
14
14
|
enterFrom?: FlyDirection | null;
|
|
15
15
|
canSkip?: boolean;
|
|
16
|
+
/** `run` shows only the top card and fades it instead of stamping it. @default 'stack' */
|
|
17
|
+
variant?: SwipeVariant;
|
|
16
18
|
onResolve: (id: number, answer: 'yes' | 'no' | null) => void;
|
|
17
19
|
registerApi?: (api: SwipeCardApi | null) => void;
|
|
18
20
|
onDragStateChange?: (dragging: boolean) => void;
|
|
19
21
|
children: React.ReactNode;
|
|
20
22
|
}
|
|
21
|
-
export declare function SwipeCard({ prop, theme: themeProp, depth, enterFrom, canSkip, onResolve, registerApi, onDragStateChange, children, }: SwipeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function SwipeCard({ prop, theme: themeProp, depth, enterFrom, canSkip, variant, onResolve, registerApi, onDragStateChange, children, }: SwipeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
22
24
|
export interface SwipeCardFaceProps {
|
|
23
25
|
prop: Proposition;
|
|
24
26
|
}
|
|
25
27
|
export declare function SwipeCardFace({ prop }: SwipeCardFaceProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Set by {@link SwipeRunControls}: flies a copy of a new pick's tile from the
|
|
30
|
+
* pad that made it onto `tile`. Returns a cancel, or null when it can't fly.
|
|
31
|
+
*/
|
|
32
|
+
export type RunLaunch = (answer: 'yes' | 'no', tile: HTMLElement) => (() => void) | null;
|
|
33
|
+
/**
|
|
34
|
+
* The run's picks, numbered top-down beside the question — 1 is the first. A pick
|
|
35
|
+
* made here flies in from its pad when `launch` is wired to the controls;
|
|
36
|
+
* the rest drop in. Tapping one hands it to `onRecall` to be answered again.
|
|
37
|
+
*/
|
|
38
|
+
export declare function SwipeRunStack({ launch, onRecall, canRecall }: {
|
|
39
|
+
launch?: React.MutableRefObject<RunLaunch | null>;
|
|
40
|
+
onRecall?: (id: number) => void;
|
|
41
|
+
canRecall?: (id: number) => boolean;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export interface SwipeRunControlsProps {
|
|
44
|
+
onFly: (direction: FlyDirection) => void;
|
|
45
|
+
onUndo: () => void;
|
|
46
|
+
canUndo: boolean;
|
|
47
|
+
canSkip: boolean;
|
|
48
|
+
/** Whether the top card can take this answer right now. */
|
|
49
|
+
canAnswer: (answer: 'yes' | 'no') => boolean;
|
|
50
|
+
/** Shared with {@link SwipeRunStack} so new picks fly from these pads. */
|
|
51
|
+
launch?: React.MutableRefObject<RunLaunch | null>;
|
|
52
|
+
}
|
|
53
|
+
/** The run's controls: tall Yes/No pads with the gesture spelt out, then Undo and Skip. */
|
|
54
|
+
export declare function SwipeRunControls({ onFly, onUndo, canUndo, canSkip, canAnswer, launch }: SwipeRunControlsProps): import("react/jsx-runtime").JSX.Element;
|
|
26
55
|
export interface SwipeDeckProps {
|
|
27
56
|
onBack?: () => void;
|
|
28
57
|
onNext?: () => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface YesNoMultiLogoProps {
|
|
2
|
+
/** Wordmark font size in px; the tiles and pipe scale with it. @default 22 */
|
|
3
|
+
size?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The YESNO Multi horizontal logo: YESNO wordmark, the stacked-tile mark, a pipe, Multi®.
|
|
8
|
+
* Drawn in type and shapes from the brand master (62_YESNO_Multi_Horizontal.svg) so it
|
|
9
|
+
* follows the theme ink. RN twin: src/react-native/components/YesNoMultiLogo.tsx.
|
|
10
|
+
*/
|
|
11
|
+
export declare function YesNoMultiLogo({ size, className }: YesNoMultiLogoProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/** The page sign-off every page ends with: the logo, small and quiet, centred under the content. */
|
|
13
|
+
export declare function YesNoMultiFooter(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React, CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { BladeTheme } from '../../../shared/themes';
|
|
3
|
+
import { ButtonVariant, ButtonSize } from '../../../shared/button-ui';
|
|
3
4
|
import { YesNoLabels } from '../../../shared/utils';
|
|
4
5
|
/** Minimum hit area for anything tappable, in px (Apple 44pt / Material 48dp). Shrink the paint, never the target. */
|
|
5
6
|
export declare const TOUCH_TARGET = 44;
|
|
@@ -32,23 +33,57 @@ export declare function Stack({ gap, align, justify, className, style, children,
|
|
|
32
33
|
export declare function Row({ gap, align, justify, wrap, className, style, children, as, }: StackProps & {
|
|
33
34
|
wrap?: boolean;
|
|
34
35
|
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
type PressHandlers = Pick<React.DOMAttributes<HTMLElement>, 'onMouseEnter' | 'onMouseLeave' | 'onPointerDown' | 'onPointerUp' | 'onFocus' | 'onBlur'>;
|
|
37
|
+
/**
|
|
38
|
+
* The one hover / press / keyboard-focus tracker behind every tappable control.
|
|
39
|
+
* Pass the caller's own handlers so both run. RN twin: `usePress` in RN _primitives.
|
|
40
|
+
*/
|
|
41
|
+
export declare function usePress(theirs?: PressHandlers): {
|
|
42
|
+
hovered: boolean;
|
|
43
|
+
pressed: boolean;
|
|
44
|
+
focused: boolean;
|
|
45
|
+
handlers: PressHandlers;
|
|
46
|
+
};
|
|
47
|
+
/** The shared transition + press sink for anything built on `usePress`. */
|
|
48
|
+
export declare function pressMotion(theme: BladeTheme, pressed: boolean, disabled?: boolean): CSSProperties;
|
|
49
|
+
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
37
50
|
theme: BladeTheme;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
/** primary: the screen's main action. secondary: the filled alternative. quiet: a tint pill for small actions. */
|
|
52
|
+
variant?: ButtonVariant;
|
|
53
|
+
/** lg (52) for the page's main action; md (44) everywhere else. */
|
|
54
|
+
size?: ButtonSize;
|
|
41
55
|
block?: boolean;
|
|
42
|
-
|
|
56
|
+
/** onClick without the event. */
|
|
43
57
|
onPress?: () => void;
|
|
44
|
-
onDoubleClick?: () => void;
|
|
45
|
-
type?: 'button' | 'submit';
|
|
46
|
-
className?: string;
|
|
47
58
|
style?: CSSProperties;
|
|
48
|
-
children?: ReactNode;
|
|
49
|
-
ariaLabel?: string;
|
|
50
59
|
}
|
|
51
|
-
|
|
60
|
+
/** The kit's one action button. Chips, icon buttons and Yes/No have their own components. */
|
|
61
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
export interface PressCardProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
63
|
+
theme: BladeTheme;
|
|
64
|
+
/** Hold the primary ring: the chosen card, or a keyboard-focused row. */
|
|
65
|
+
lit?: boolean;
|
|
66
|
+
/** The card's own shape. Give its border as borderWidth / borderStyle — the card owns borderColor. */
|
|
67
|
+
style?: CSSProperties;
|
|
68
|
+
}
|
|
69
|
+
/** A whole card that is one button. It keeps its own shape; its hairline turns primary on hover and it sinks on press. */
|
|
70
|
+
export declare const PressCard: React.ForwardRefExoticComponent<PressCardProps & React.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
export type IconButtonProps = Omit<ButtonProps, 'variant' | 'size' | 'block'> & {
|
|
72
|
+
'aria-label': string;
|
|
73
|
+
size?: number;
|
|
74
|
+
tone?: 'default' | 'danger';
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Icon-only button (back, close, remove, previous / next): a round disc with a
|
|
78
|
+
* hairline ring and the shared hover tint. `size` is the painted disc; the hit
|
|
79
|
+
* area never drops below 44 — a smaller disc keeps its own footprint in the
|
|
80
|
+
* layout and reaches out with negative margins.
|
|
81
|
+
*/
|
|
82
|
+
export declare const IconButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "variant" | "size" | "block"> & {
|
|
83
|
+
'aria-label': string;
|
|
84
|
+
size?: number;
|
|
85
|
+
tone?: "default" | "danger";
|
|
86
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
52
87
|
export interface TextProps {
|
|
53
88
|
theme: BladeTheme;
|
|
54
89
|
variant?: 'display' | 'heading' | 'subheading' | 'body' | 'caption' | 'eyebrow';
|