@avalabs/k2-alpine 0.0.0-main-94bbb8c → 0.0.0-main-e579735

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.
@@ -0,0 +1,28 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { default as React } from 'react';
3
+ export type BannerSeverity = 'info' | 'warning' | 'error';
4
+ export type BannerAction = {
5
+ readonly label: string;
6
+ /** When set, renders an anchor that opens in a new tab. */
7
+ readonly href?: string;
8
+ readonly onClick?: () => void;
9
+ };
10
+ export type BannerProps = {
11
+ /** Drives the icon + accent color. @default 'info' */
12
+ readonly severity?: BannerSeverity;
13
+ /** Message content (shown in the accent color). */
14
+ readonly children: React.ReactNode;
15
+ /** Override the leading icon. */
16
+ readonly icon?: React.ReactNode;
17
+ /** Optional trailing CTA button. */
18
+ readonly action?: BannerAction;
19
+ readonly 'data-testid'?: string;
20
+ readonly sx?: SxProps<Theme>;
21
+ };
22
+ /**
23
+ * A rounded notice bar: leading icon + message + optional CTA button. Used for
24
+ * region/geo restrictions and other inline notices. Theme-driven — `info` uses
25
+ * the neutral text color, `warning` the theme warning color, `error` the theme
26
+ * error color.
27
+ */
28
+ export declare function Banner({ severity, children, icon, action, sx, ...rest }: BannerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ButtonProps } from '@mui/material';
2
+ export type SegmentedButtonSegment = 'solo' | 'left' | 'right' | 'top' | 'bottom';
3
+ export type SegmentedButtonProps = ButtonProps & {
4
+ /** Position within a joined group — controls which corners are rounded vs squared. @default 'solo' */
5
+ segment?: SegmentedButtonSegment;
6
+ /** Rounded (outer) corner radius. @default 20 */
7
+ outerRadius?: number | string;
8
+ /** Squared (inner) corner radius where buttons join. @default 4 */
9
+ innerRadius?: number | string;
10
+ };
11
+ /**
12
+ * A `Button` whose border-radius adapts to its position in a joined group, so
13
+ * adjacent buttons read as one shape (e.g. a Withdraw / Deposit or Market /
14
+ * Limit close pair). `segment="solo"` is a normal fully-rounded pill. All other
15
+ * `Button` props (`variant`, `color`, `size`, `sx`, …) behave as usual.
16
+ */
17
+ export declare function SegmentedButton({ segment, outerRadius, innerRadius, sx, ...rest }: SegmentedButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ export interface ChecklistItem {
4
+ /** Title shown next to the index. */
5
+ readonly title: string;
6
+ /** Supporting copy shown beneath the title. */
7
+ readonly description: string;
8
+ /**
9
+ * When `true`, the row's action button is replaced by the completion icon
10
+ * (defaults to {@link TaskAlt} in `successAlt.main`). The leading index
11
+ * never changes — only the trailing slot reflects state.
12
+ */
13
+ readonly done: boolean;
14
+ /** Label of the action button while the item is pending. */
15
+ readonly actionLabel: string;
16
+ /** Click handler for the action button. */
17
+ readonly onAction: () => void;
18
+ /**
19
+ * Disable the action button without marking the item complete. Used to
20
+ * gate later steps on earlier ones (e.g. step 2 unlocks once step 1 flips
21
+ * to `done`).
22
+ */
23
+ readonly actionDisabled?: boolean;
24
+ /** Optional `data-testid` for the pending-state action button. */
25
+ readonly actionTestId?: string;
26
+ }
27
+ export interface ChecklistProps {
28
+ /** Items rendered top-down. The 1-based index is derived from array order. */
29
+ readonly items: readonly ChecklistItem[];
30
+ /** Optional override for the icon shown when an item is `done`. */
31
+ readonly completedIcon?: ReactNode;
32
+ readonly sx?: SxProps<Theme>;
33
+ }
34
+ /**
35
+ * Vertical list of completable items with a numeric index, title,
36
+ * description, and an action button or completion icon at the trailing
37
+ * edge. Designed for one-time setup flows (e.g. the perps "Set up trading
38
+ * account" panel) where each item maps to a single user-driven action.
39
+ *
40
+ * Uses theme tokens (`background.paper`, `divider`, `text.primary`, …) so it
41
+ * blends into both light and dark modes.
42
+ */
43
+ export declare const Checklist: ({ items, completedIcon, sx }: ChecklistProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Checklist';
@@ -0,0 +1,54 @@
1
+ /**
2
+ * A preset chip below the dial. `fraction` is multiplied across the
3
+ * `[min, max]` range — e.g. `{ label: '50%', fraction: 0.5 }` on a dial
4
+ * with `min = 0`, `max = 100` snaps the value to 50.
5
+ */
6
+ export type PresetButton = {
7
+ readonly label: string;
8
+ readonly fraction: number;
9
+ };
10
+ export type CircularDialProps = {
11
+ /** Controlled value. */
12
+ readonly value: number;
13
+ readonly onChange: (next: number) => void;
14
+ /** Required upper bound. */
15
+ readonly max: number;
16
+ /** Lower bound. Default `0`. Values below render with a danger style. */
17
+ readonly min?: number;
18
+ /** Snap step. Default `0.01`. */
19
+ readonly step?: number;
20
+ /** Cap manual-input precision; default derived from `step`. */
21
+ readonly maxDecimals?: number;
22
+ /** Small line above the readout (e.g. `"Market"`). */
23
+ readonly label?: string;
24
+ /** Secondary line below the readout (e.g. fiat conversion). */
25
+ readonly caption?: string;
26
+ /** Allow click-to-edit text input over the readout. */
27
+ readonly enableManualInput?: boolean;
28
+ /** Preset chips rendered below the dial. */
29
+ readonly presets?: readonly PresetButton[];
30
+ /** Prefix for the readout (e.g. `"$"`). */
31
+ readonly prefix?: string;
32
+ /** Suffix for the readout (e.g. `" AVAX"`). */
33
+ readonly suffix?: string;
34
+ /** Outer width in px. Default `210` (Figma frame). */
35
+ readonly size?: number;
36
+ /** Override arc color. Default: `theme.palette.success.main`. */
37
+ readonly accentColor?: string;
38
+ /** Disable interaction. */
39
+ readonly disabled?: boolean;
40
+ };
41
+ /**
42
+ * Half-circle gauge dial used for amount selection (e.g. partial close
43
+ * size, leverage adjustment). The user can:
44
+ * - Drag anywhere on the dial — the closest point on the arc snaps to.
45
+ * - Click anywhere on the arc — same as drag start.
46
+ * - Tap a preset chip (e.g. 25/50/75/Max).
47
+ * - Click the readout to type an exact value (when `enableManualInput`).
48
+ * - Use ↑/→ to step up, ↓/← to step down, `Home`/`End` to jump to bounds
49
+ * when the dial has keyboard focus.
50
+ *
51
+ * Web equivalent of `core-mobile`'s `CircularDial` (PR #3802) — same API,
52
+ * no Skia/Reanimated/haptics dependency.
53
+ */
54
+ export declare function CircularDial({ value, onChange, max, min, step, maxDecimals, label, caption, enableManualInput, presets, prefix, suffix, size, accentColor, disabled, }: CircularDialProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { CircularDial, type CircularDialProps, type PresetButton } from './CircularDial';
@@ -0,0 +1,2 @@
1
+ import { IconBaseProps } from 'react-icons';
2
+ export declare const CandlestickChart: ({ size, ...rest }: IconBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { IconBaseProps } from 'react-icons';
2
+ /**
3
+ * "Task / completed" icon (rounded check inside an open circle). Used to
4
+ * mark a step in a setup flow as completed; pair with `successAlt.main`
5
+ * (`#3AC489`) to match the design system's "done" state. Colour comes from
6
+ * `currentColor` so consumers can recolour via `sx={{ color }}`.
7
+ */
8
+ export declare const TaskAlt: ({ size, ...rest }: IconBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -85,6 +85,9 @@ export declare const AvaGptLightIcon: import('react').ComponentType<IconBaseProp
85
85
  /**
86
86
  * Sidebar Icons
87
87
  */
88
+ export declare const CandlestickChartIcon: import('react').ComponentType<IconBaseProps & {
89
+ sx?: SxProps;
90
+ } & import('../..').WithSxProps>;
88
91
  export declare const ContactsIcon: import('react').ComponentType<IconBaseProps & {
89
92
  sx?: SxProps;
90
93
  } & import('../..').WithSxProps>;
@@ -391,3 +394,9 @@ export declare const CheckCircleIcon: import('react').ComponentType<IconBaseProp
391
394
  export declare const PaceClockIcon: import('react').ComponentType<IconBaseProps & {
392
395
  sx?: SxProps;
393
396
  } & import('../..').WithSxProps>;
397
+ /**
398
+ * Status Icons
399
+ */
400
+ export declare const TaskAltIcon: import('react').ComponentType<IconBaseProps & {
401
+ sx?: SxProps;
402
+ } & import('../..').WithSxProps>;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * A preset chip below the price input. Clicking it sets the value to
3
+ * `reference * (1 + pct)`. Use a negative `pct` for "below reference"
4
+ * presets (e.g. closing a short above mark).
5
+ */
6
+ export type LimitPricePreset = {
7
+ /** Display label, e.g. "+5%" or "−10%". */
8
+ readonly label: string;
9
+ /** Percentage offset applied to `reference`. `0.05` = +5%, `-0.10` = −10%. */
10
+ readonly pct: number;
11
+ };
12
+ export type LimitPriceInputProps = {
13
+ /** Controlled value. `0` is treated as "empty" — placeholder is shown. */
14
+ readonly value: number;
15
+ readonly onChange: (next: number) => void;
16
+ /**
17
+ * Reference price the percentage presets compute against (e.g. mark price).
18
+ * If `undefined`, presets are rendered disabled.
19
+ */
20
+ readonly reference?: number;
21
+ /** Snap step for committed values. Default `0.01`. */
22
+ readonly step?: number;
23
+ /** Cap manual-input precision; defaults to whatever `step` allows. */
24
+ readonly maxDecimals?: number;
25
+ /** Small line above the input (e.g. `"Set limit price"`). */
26
+ readonly label?: string;
27
+ /** Secondary line below the input (e.g. fiat conversion). */
28
+ readonly caption?: string;
29
+ /** Prefix prepended to the readout (e.g. `"$"`). */
30
+ readonly prefix?: string;
31
+ /** Suffix appended to the readout (e.g. `" USDC"`). */
32
+ readonly suffix?: string;
33
+ /** Placeholder shown when the value is empty/zero. Default `"0.00"`. */
34
+ readonly placeholder?: string;
35
+ /** Preset chips. Hidden if empty / undefined. */
36
+ readonly presets?: readonly LimitPricePreset[];
37
+ /** Auto-focus the input on mount. Default `false`. */
38
+ readonly autoFocus?: boolean;
39
+ /** Disable interaction. */
40
+ readonly disabled?: boolean;
41
+ };
42
+ /**
43
+ * Big numeric price input styled like the `CircularDial` readout, with
44
+ * optional preset chips that bump the value by a percentage of a reference
45
+ * price (e.g. mark price). Designed for "close at limit" / "edit limit
46
+ * price" flows where the user enters a target price relative to a market.
47
+ *
48
+ * The component is essentially a `CircularDial` variant with the arc /
49
+ * handle hidden — same label-on-top, value-in-the-middle, presets-below
50
+ * vertical rhythm and the same Aeonik / Inter type stack.
51
+ */
52
+ export declare function LimitPriceInput({ value, onChange, reference, step, maxDecimals, label, caption, prefix, suffix, placeholder, presets, autoFocus, disabled, }: LimitPriceInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { LimitPriceInput, type LimitPriceInputProps, type LimitPricePreset } from './LimitPriceInput';
@@ -0,0 +1,25 @@
1
+ import { SxProps } from '@mui/material';
2
+ export type PillToggleItem<T extends string | number> = {
3
+ readonly value: T;
4
+ readonly label: string;
5
+ };
6
+ export type PillToggleProps<T extends string | number> = {
7
+ readonly items: readonly PillToggleItem<T>[];
8
+ readonly value: T;
9
+ readonly onChange: (value: T) => void;
10
+ /** 'small' renders a 27px compact toggle (Figma K2-Alpine-Tab-Menu). */
11
+ readonly size?: 'small';
12
+ /** 'dark' uses white pill / white text for dark backgrounds. Default is light context. */
13
+ readonly colorScheme?: 'light' | 'dark';
14
+ /**
15
+ * When false, the control sizes to its tabs (e.g. beside another control in a row).
16
+ * Default `true` fills the container width.
17
+ */
18
+ readonly fullWidth?: boolean;
19
+ readonly sx?: SxProps;
20
+ /** Merged into each `Tab` (e.g. `fontSize` for larger pill menus). */
21
+ readonly tabSx?: SxProps;
22
+ /** Optional E2E hook on the root `Tabs` element. */
23
+ readonly 'data-testid'?: string;
24
+ };
25
+ export declare function PillToggle<T extends string | number>({ items, value, onChange, size, colorScheme, fullWidth, sx, tabSx, 'data-testid': dataTestId, }: PillToggleProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { PillToggle, type PillToggleProps, type PillToggleItem } from './PillToggle';
@@ -4,7 +4,7 @@ export type TabBarItemProps = {
4
4
  label: string;
5
5
  to?: string;
6
6
  } & TabProps;
7
- export type TabBarProps = TabsProps & {
7
+ export type TabBarProps = Omit<TabsProps, 'size'> & {
8
8
  tabBarItems: TabBarItemProps[];
9
9
  size?: 'extension';
10
10
  };
@@ -11,12 +11,17 @@ export { ThemeInvert } from './components/ThemeInvert';
11
11
  export * from './theme';
12
12
  export * from './components/Icons';
13
13
  export { Accordion, type AccordionProps } from './components/Accordion/Accordion';
14
+ export { Banner, type BannerProps, type BannerSeverity, type BannerAction } from './components/Banner/Banner';
15
+ export { CircularDial, type CircularDialProps, type PresetButton } from './components/CircularDial';
16
+ export { LimitPriceInput, type LimitPriceInputProps, type LimitPricePreset } from './components/LimitPriceInput';
14
17
  export { AccordionActions, type AccordionActionsProps } from './components/Accordion/AccordionActions';
15
18
  export { AccordionDetails, type AccordionDetailsProps } from './components/Accordion/AccordionDetails';
16
19
  export { AccordionSummary, type AccordionSummaryProps } from './components/Accordion/AccordionSummary';
17
20
  export { Accordions, type AccordionsProps } from './components/Accordion/Accordions';
18
21
  export { Avatar as AvatarHex } from './components/Avatar/Avatar';
19
22
  export { SquareButton, type SquareButtonProps } from './components/Button/SquareButton';
23
+ export { SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegment, } from './components/Button/SegmentedButton';
24
+ export { PillToggle, type PillToggleProps, type PillToggleItem } from './components/PillToggle';
20
25
  export { ContentfulJsonRenderer, type ContentfulJsonRendererProps, } from './components/ContentfulJsonRender/ContentfulJsonRender';
21
26
  export { CustomDialog, type CustomDialogProps } from './components/CustomDialog/CustomDialog';
22
27
  export { Popover, type PopoverProps } from './components/Popover/Popover';
@@ -31,6 +36,7 @@ export { TruncateText, type TruncateTextProps } from './components/TruncateText/
31
36
  export { Typography, type TypographyProps } from './components/Typography/Typography';
32
37
  export { truncateAddress, truncateLabel } from './components/TruncateText/TruncateText';
33
38
  export { Glow, type GlowProps } from './components/Glow/Glow';
39
+ export { Checklist, type ChecklistProps, type ChecklistItem } from './components/Checklist';
34
40
  export { Stepper, type StepperProps } from './components/Stepper/Stepper';
35
41
  export { DateTimePicker, type DateTimePickerProps, type UseDayPickerContextProps, } from './components/DateTimePicker';
36
42
  export * from './theme/logos';
@@ -302,4 +302,10 @@ declare module '@mui/material/Button' {
302
302
  xsmall: true;
303
303
  }
304
304
  }
305
+ declare module '@mui/material/Tabs' {
306
+ interface TabsOwnProps {
307
+ size?: 'small';
308
+ colorScheme?: 'light' | 'dark';
309
+ }
310
+ }
305
311
  export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@avalabs/k2-alpine",
3
3
  "author": "Ava Labs",
4
4
  "license": "Limited Ecosystem License",
5
- "version": "0.0.0-main-94bbb8c",
5
+ "version": "0.0.0-main-e579735",
6
6
  "type": "module",
7
7
  "main": "dist/index.cjs",
8
8
  "module": "dist/index.js",