open-index/open-npm huggingface dataset:
npm package: @lattice-trading/sdk
Description: Lattice API SDK
Latest version: 0.1.0

# @lattice-trading/sdk

TypeScript-first SDK for the Lattice API (Node and browser).

## Install
```bash
npm install @lattice-trading/sdk
```

## Quickstart
```ts
import { LatticeClient } from '@lattice-trading/sdk';

const client = new LatticeClient({
  baseUrl: 'http://lattice-staging-alb-1844776229.us-west-1.elb.amazonaws.com',
  apiKey: process.env.LATTICE_API_KEY,
  tenantId: process.env.LATTICE_TENANT,
});

const markets = await client.markets.listPage({ limit: 25, offset: 0 });
console.log(markets.total, markets.markets[0]);
```

## Pagination (async iterator)
```ts
for await (const order of client.orders.list({ status: 'open', limit: 50 })) {
  console.log(order.id, order.status);
}
```

## Mutations with idempotency
```ts
const order = await client.orders.create(
  {
    marketId: 'market-id',
    outcomeId: 'outcome-id',
    side: 'buy',
    type: 'limit',
    price: 55,
    quantity: 10,
  },
  { idempotencyKey: 'order-001' }
);
```

## WebSocket
```ts
import { LatticeWebSocket } from '@lattice-trading/sdk';

const ws = new LatticeWebSocket({
  baseUrl: 'http://lattice-staging-alb-1844776229.us-west-1.elb.amazonaws.com',
  token: 'ws_token',
  tenantId: 'tenant-id',
  reconnect: true,
});

await ws.connect();
ws.subscribe('orderbook', { marketId: 'market-id', outcomeId: 'outcome-id' });
ws.on('orderbook.snapshot', (payload) => {
  console.log(payload);
});
```

## Error handling
```ts
import { LatticeError, RateLimitError } from '@lattice-trading/sdk';

try {
  await client.orders.listPage({ limit: 100 });
} catch (err) {
  if (err instanceof RateLimitError) {
    console.log('retry after', err.retryAfterSeconds);
  } else if (err instanceof LatticeError) {
    console.log(err.code, err.message);
  }
}
```

## Notes
- `baseUrl` should be the API host (no `/api/v1` suffix).
- `price` and `amount` values are integers in cents.
- Use `idempotencyKey` for all state-changing requests.
npm package: @lattice-ui/accordion
Description: Headless accordion primitives for Roblox UI with single and multiple disclosure modes.
Latest version: 0.5.0-next.1

# @lattice-ui/accordion

Headless accordion primitives for Roblox UI with single and multiple disclosure modes.

## Exports

- `Accordion`
- `Accordion.Root`
- `Accordion.Item`
- `Accordion.Header`
- `Accordion.Trigger`
- `Accordion.Content`

## Notes

- Supports `type="single" | "multiple"`.
- Supports controlled/uncontrolled `value`.
npm package: @lattice-ui/avatar
Description: Headless avatar primitives for Roblox UI with delayed fallback rendering.
Latest version: 0.5.0-next.1

# @lattice-ui/avatar

Headless avatar primitives for Roblox UI with delayed fallback rendering.

## Exports

- `Avatar`
- `Avatar.Root`
- `Avatar.Image`
- `Avatar.Fallback`

## Notes

- `delayMs` controls fallback reveal timing (default: `250`).
- Missing image sources immediately show fallback content.
- Fallback visibility logic is exported for unit testing.
npm package: @lattice-ui/combobox
Description: Headless combobox primitives for Roblox UI with typed filtering and enforced option selection.
Latest version: 0.5.0-next.1

# @lattice-ui/combobox

Headless combobox primitives for Roblox UI with typed filtering and enforced option selection.

## Exports

- `Combobox`
- `Combobox.Root`
- `Combobox.Trigger`
- `Combobox.Input`
- `Combobox.Value`
- `Combobox.Portal`
- `Combobox.Content`
- `Combobox.Item`
- `Combobox.Group`
- `Combobox.Label`
- `Combobox.Separator`

## Notes

- Supports controlled/uncontrolled `value`, `inputValue`, and `open`.
- Input text is synchronized back to selected option text when the list closes.
- Filtering defaults to case-insensitive substring matching and can be customized with `filterFn`.
npm package: @lattice-ui/focus
Description: Focus management primitives for Roblox UI.
Latest version: 0.5.0-next.1

# @lattice-ui/focus

Focus management primitives for Roblox UI.

## Current status

- `FocusScope` can trap `GuiService.SelectedObject` and restore captured focus on scope teardown.

## FocusScope behavior

- `active` defaults to `true`.
- `asChild` keeps caller tree structure; without it, `FocusScope` renders a transparent full-size frame wrapper.
- When `trapped` is true, outside selections are redirected to:
  1. last focused selectable object inside the scope, then
  2. first selectable descendant inside the scope.
- Nested trapped scopes use stack order; only the top-most active trapped scope redirects focus.
- When `restoreFocus` is true, captured focus is restored on unmount/deactivation if the target is still valid.

## Known limits

- Trap and restore currently use `GuiService.SelectedObject` only.
- This phase does not manage `NextSelection*` graph rewrites.
npm package: @lattice-ui/progress
Description: Headless progress and spinner primitives for Roblox UI.
Latest version: 0.5.0-next.1

# @lattice-ui/progress

Headless progress and spinner primitives for Roblox UI.

## Exports

- `Progress`
- `Progress.Root`
- `Progress.Indicator`
- `Progress.Spinner`

## Notes

- `Progress` supports `value`/`max` and clamps out-of-range values.
- `indeterminate` mode uses a fixed indicator ratio.
- `Spinner` defaults to `spinning=true` and rotates on heartbeat.
npm package: @lattice-ui/scroll-area
Description: Headless scroll area primitives for Roblox UI with custom scrollbars and thumbs.
Latest version: 0.5.0-next.1

# @lattice-ui/scroll-area

Headless scroll area primitives for Roblox UI with custom scrollbars and thumbs.

## Exports

- `ScrollArea`
- `ScrollArea.Root`
- `ScrollArea.Viewport`
- `ScrollArea.Scrollbar`
- `ScrollArea.Thumb`
- `ScrollArea.Corner`

## Notes

- Supports vertical and horizontal scrollbar primitives.
- `type` supports `auto`, `always`, and `scroll` visibility policies.
- Clicking a scrollbar track and dragging a thumb both update the viewport canvas position.
- Thumb/canvas math helpers are exported for unit testing.
npm package: @lattice-ui/select
Description: Headless single-select primitives built for Roblox UI.
Latest version: 0.5.0-next.1

# @lattice-ui/select

Headless single-select primitives built for Roblox UI.

## Exports

- `Select`
- `Select.Root`
- `Select.Trigger`
- `Select.Value`
- `Select.Portal`
- `Select.Content`
- `Select.Item`
- `Select.Group`
- `Select.Label`
- `Select.Separator`

## Notes

- Single value only in this release.
- Supports controlled/uncontrolled `value` and `open`.
- Content uses dismissable-layer semantics (outside pointer dismiss).
- No built-in Roblox native selection or directional keyboard navigation.
npm package: @lattice-ui/slider
Description: Headless single-thumb slider primitives for Roblox UI.
Latest version: 0.5.0-next.1

# @lattice-ui/slider

Headless single-thumb slider primitives for Roblox UI.

## Exports

- `Slider`
- `Slider.Root`
- `Slider.Track`
- `Slider.Range`
- `Slider.Thumb`

## Notes

- Single-thumb only in this release.
- Supports controlled/uncontrolled `value`.
- Pointer drag and keyboard adjustments are both supported.
- Values are clamped to `[min, max]` and snapped to `step`.
npm package: @lattice-ui/tabs
Description: Behavior-only Tabs primitives for Roblox UI, aligned with the lattice compound pattern.
Latest version: 0.5.0-next.1

# @lattice-ui/tabs

Behavior-only Tabs primitives for Roblox UI, aligned with the lattice compound pattern.

## Exports

- `Tabs`
- `Tabs.Root`
- `Tabs.List`
- `Tabs.Trigger`
- `Tabs.Content`

## Notes

- `orientation` supports `horizontal` and `vertical` trigger navigation.
- Enabled triggers are selectable and activate immediately when selection focus moves onto them.
npm package: @lattice-ui/text-field
Description: Headless text input primitives for Roblox UI with controlled/uncontrolled state and commit events.
Latest version: 0.5.0-next.1

# @lattice-ui/text-field

Headless text input primitives for Roblox UI with controlled/uncontrolled state and commit events.

## Exports

- `TextField`
- `TextField.Root`
- `TextField.Input`
- `TextField.Label`
- `TextField.Description`
- `TextField.Message`

## Notes

- `onValueChange` runs when input text changes.
- `onValueCommit` runs on `FocusLost`/enter-style commit moments.
- `disabled` and `readOnly` are enforced at the root context and reflected by `TextFieldInput`.
npm package: @lattice-ui/textarea
Description: Headless multi-line text input primitives for Roblox UI with optional auto-resize behavior.
Latest version: 0.5.0-next.1

# @lattice-ui/textarea

Headless multi-line text input primitives for Roblox UI with optional auto-resize behavior.

## Exports

- `Textarea`
- `Textarea.Root`
- `Textarea.Input`
- `Textarea.Label`
- `Textarea.Description`
- `Textarea.Message`

## Notes

- Supports controlled/uncontrolled `value`.
- `autoResize` is enabled by default and respects `minRows`/`maxRows`.
- `onValueCommit` fires on `FocusLost` commit moments.
npm package: @lattice-ui/toast
Description: Headless toast primitives for Roblox UI with queue-based visibility and automatic dismissal.
Latest version: 0.5.0-next.1

# @lattice-ui/toast

Headless toast primitives for Roblox UI with queue-based visibility and automatic dismissal.

## Exports

- `Toast`
- `Toast.Provider`
- `Toast.Viewport`
- `Toast.Root`
- `Toast.Title`
- `Toast.Description`
- `Toast.Action`
- `Toast.Close`
- `useToast`

## Notes

- Imperative API is provided through `useToast()`.
- Default toast timing is `durationMs=4000` with `maxVisible=3`.
- Queue helpers are exported for deterministic unit testing.