> ## Documentation Index
> Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# @servicetitan/anvil2-swift

> Release notes for @servicetitan/anvil2-swift, newest first.

Current version: **0.0.4**. Source: [`packages/anvil2-swift/CHANGELOG.md`](https://github.com/servicetitan/hammer/blob/main/packages/anvil2-swift/CHANGELOG.md).

## 0.0.4

### Patch Changes

* [#3290](https://github.com/servicetitan/hammer/pull/3290) [`14c9b27`](https://github.com/servicetitan/hammer/commit/14c9b2746c73b69219aba011b827da6c6c7182aa) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Icon, Anvil2Status] Replace the icon's `status:` parameter with `color: Color?`, and add `.anvil2IconColor(_:)` to set the color of every tintable `Anvil2Icon` in a subtree. A tintable glyph now draws in `color`, then `.anvil2IconColor(_:)`, then `semantic.foreground.color.standard`; it no longer reads the surrounding `foregroundStyle`. Remove `Anvil2Status` and `.anvil2Status(_:)`. To migrate, replace `status: .danger` with `color: theme.semantic.foreground.color.critical` (or the color you need), replace `.anvil2Status(_:)` with `.anvil2IconColor(_:)`, and replace `.foregroundStyle(_:)` used to tint icons with `.anvil2IconColor(_:)`

* [#3224](https://github.com/servicetitan/hammer/pull/3224) [`44d88f1`](https://github.com/servicetitan/hammer/commit/44d88f1d55189fe58b2de9e4e1ce6a96ffa78688) Thanks [@AdamLantz](https://github.com/AdamLantz)! - \[Anvil2TokensNext] Add the `Anvil2TokensNext` library as a preview: its token values are placeholders and may change in any release. It is generated from `@servicetitan/anvil2-tokens`, so apps can adopt the new tokens before `Anvil2Tokens` switches to them in a later breaking release. It keeps `Anvil2Theme` and `\.anvil2Theme`, adds the `.classic`, `.carto` and `.cartoMobile` themes and `theme.variant`, and renames tokens (e.g. `foreground.color.standard` → `foreground.color.base`). Import it instead of `Anvil2Tokens` in a file; components still read `Anvil2Tokens`

* [#3161](https://github.com/servicetitan/hammer/pull/3161) [`8cf10cc`](https://github.com/servicetitan/hammer/commit/8cf10ccb4304f555defaea2b3e5fcfdf50d87dba) Thanks [@jpex](https://github.com/jpex)! - \[Anvil2Icons] Update the Atlas logo icon to the new Atlas brand mark

* [#3287](https://github.com/servicetitan/hammer/pull/3287) [`5c81ed8`](https://github.com/servicetitan/hammer/commit/5c81ed8a3d95adaedd9dc1f06eef8a8f5fa6fcc9) Thanks [@AdamLantz](https://github.com/AdamLantz)! - \[Anvil2TokensNext] Add border and inverse colors to every category hue

* [#3287](https://github.com/servicetitan/hammer/pull/3287) [`5c81ed8`](https://github.com/servicetitan/hammer/commit/5c81ed8a3d95adaedd9dc1f06eef8a8f5fa6fcc9) Thanks [@AdamLantz](https://github.com/AdamLantz)! - \[Anvil2TokensNext] Fix `.carto` and `.cartoMobile` dark colors that Carto gives no dark value of its own: they now match classic dark instead of Carto light

* [#3287](https://github.com/servicetitan/hammer/pull/3287) [`5c81ed8`](https://github.com/servicetitan/hammer/commit/5c81ed8a3d95adaedd9dc1f06eef8a8f5fa6fcc9) Thanks [@AdamLantz](https://github.com/AdamLantz)! - \[Anvil2TokensNext] Add component tokens under `theme.component`

* Updated dependencies \[[`5c81ed8`](https://github.com/servicetitan/hammer/commit/5c81ed8a3d95adaedd9dc1f06eef8a8f5fa6fcc9), [`5c81ed8`](https://github.com/servicetitan/hammer/commit/5c81ed8a3d95adaedd9dc1f06eef8a8f5fa6fcc9), [`5c81ed8`](https://github.com/servicetitan/hammer/commit/5c81ed8a3d95adaedd9dc1f06eef8a8f5fa6fcc9)]:
  * @servicetitan/anvil2-tokens\@0.1.1

## 0.0.3

### Patch Changes

* [#3177](https://github.com/servicetitan/hammer/pull/3177) [`90a5582`](https://github.com/servicetitan/hammer/commit/90a55827390361037513d614153a43c3246cef21) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Icon] Add `Anvil2Icon`, a SwiftUI view that draws an `Anvil2IconAsset` (or a caller-supplied `Image`) at `small`/`medium`/`large` (16/24/32 pt). Tintable glyphs inherit the surrounding `foregroundStyle` unless a status is set. Adds `Anvil2Status` (`info`/`success`/`warning`/`danger`), shared by status-aware components: pass `status:`, or set it for a subtree with `.anvil2Status(_:)`. Callers choose `init(decorative:)` or `init(_:accessibilityLabel:)` for accessibility, and `.anvil2IconStyle(size:)` sets a default size for a subtree

* [#3178](https://github.com/servicetitan/hammer/pull/3178) [`b57b018`](https://github.com/servicetitan/hammer/commit/b57b01877663246552f93e76ea1e885017a2c399) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2IconAsset] Rename the `Anvil2Icon` enum to `Anvil2IconAsset`. Replace `Anvil2Icon` with `Anvil2IconAsset` at each use site (e.g. `Anvil2Icon.arrowDown.image` → `Anvil2IconAsset.arrowDown.image`); cases are unchanged

* [#3150](https://github.com/servicetitan/hammer/pull/3150) [`70ad407`](https://github.com/servicetitan/hammer/commit/70ad407384f1e7ecd2cbb98ea2f0db33975a8ba3) Thanks [@tounsoo](https://github.com/tounsoo)! - \[Anvil2Illustration] Fix invalid `NaN` plant leaf paths in `emptyStateCommercialInteriorsNoSearchResults` and `emptyStateCommercialPropertyCareUserCleared`, restoring the missing leaf in `emptyStateCommercialPropertyCareUserCleared`

* [#3170](https://github.com/servicetitan/hammer/pull/3170) [`38263d0`](https://github.com/servicetitan/hammer/commit/38263d0d1ee0acd255444a0816e7d1e0a1ba01bb) Thanks [@ericag1985](https://github.com/ericag1985)! - \[Anvil2Theme] Add `motion.duration.cycle` as a 1s repeating-motion duration

* [#3189](https://github.com/servicetitan/hammer/pull/3189) [`0f9b0bf`](https://github.com/servicetitan/hammer/commit/0f9b0bf91046eb238521d5a4de328ac5272aa246) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Button] Add `Anvil2Button`, a SwiftUI pill button in six appearances (`primary`/`secondary`/`ghost`/`danger`/`dangerSecondary`/`dangerGhost`) at `medium`/`large` (48/64 pt minimum height, growing with Dynamic Type). It takes an optional `Anvil2IconAsset` placed `.leading` or `.trailing`, and `isLoading`, which keeps the button's width, shows a spinner in place of the content and ignores taps; disable it with `.disabled(_:)`. `init(iconOnly:accessibilityLabel:)` draws a circular icon-only button whose accessibility label is required. `.anvil2ButtonStyle(appearance:size:sizing:)` sets a default appearance and size for a subtree, and `sizing: .flexible` fills the offered width. `Anvil2ButtonButtonStyle` (`.buttonStyle(.anvil2(_:size:))`) gives any SwiftUI `Button` the same look and pressed, hover, focus and disabled states, without the loading state

* [#3187](https://github.com/servicetitan/hammer/pull/3187) [`a734331`](https://github.com/servicetitan/hammer/commit/a734331dac32c9b4d1815a43f42464cb750e8231) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Spinner] Add `Anvil2Spinner`, a SwiftUI view that shows an indeterminate loading arc at `small`/`medium`/`large` (16/40/80 pt). The arc is `semantic.border.color.accent` by default; `tint: .inherited` takes the surrounding `foregroundStyle` instead, for a spinner on a filled background. Callers choose `init(decorative:tint:)` or `init(accessibilityLabel:size:tint:)` for accessibility (labeled spinners are announced as a progress indicator), and `.anvil2SpinnerStyle(size:tint:)` sets a default size and tint for a subtree. With Reduce Motion on, the arc stops at rest

* [#3192](https://github.com/servicetitan/hammer/pull/3192) [`acf451d`](https://github.com/servicetitan/hammer/commit/acf451d6612829a76b7d4faa7af4980c2a9e1c0d) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Components] Ship a resource bundle with a String Catalog for library-authored strings, with English as the package's default localization

* [#3171](https://github.com/servicetitan/hammer/pull/3171) [`ef97d69`](https://github.com/servicetitan/hammer/commit/ef97d69857fc9c0301ab26d7242e41f0dc7435da) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Package] Raise the minimum iOS version from 17.4 to 18.4. Apps that depend on Anvil2 must set their iOS deployment target to 18.4 or later

* [#3196](https://github.com/servicetitan/hammer/pull/3196) [`e073fb0`](https://github.com/servicetitan/hammer/commit/e073fb007895441f2ef6794413a1d1c2dc138a72) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Checkbox] Add `Anvil2Checkbox`, a SwiftUI checkbox whose whole row (box, label and optional `description`) is one control and one accessibility element. The two-state initializers bind `isOn`; the `allowingMixed:` initializers take an `Anvil2Checkbox.MixableState` (`unchecked`/`checked`/`indeterminate`) and call `action`, leaving the next state to the caller. `hasError` colors the box critical, and `.disabled(_:)` disables it. `init(accessibilityLabel:…)` draws a box with no visible label whose accessibility label is required. VoiceOver reads the state as "checked", "unchecked" or "mixed", localized in English, French and Spanish in the Anvil2Components String Catalog. `.toggleStyle(.anvil2Checkbox)` (`Anvil2CheckboxToggleStyle`) gives any SwiftUI `Toggle` the same look, including mixed `Toggle(sources:isOn:)`, without the error state

* Updated dependencies \[[`38263d0`](https://github.com/servicetitan/hammer/commit/38263d0d1ee0acd255444a0816e7d1e0a1ba01bb)]:
  * @servicetitan/carto-tokens\@0.4.8

## 0.0.2

### Patch Changes

* [#3074](https://github.com/servicetitan/hammer/pull/3074) [`9ea5560`](https://github.com/servicetitan/hammer/commit/9ea55607e50921ef54cae8c71d992ef51891c9bd) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Icon, Anvil2Illustration] Add the `Anvil2Icons` and `Anvil2Illustrations` libraries, generated from `@servicetitan/anvil2-icons` and `@servicetitan/anvil2-illustrations`

  * `Anvil2Icon` has one case per web `Icon*` export; tintable icons take the foreground style, and multicolour ones (`isTintable == false`) keep their own colours
  * `Anvil2Illustration` has one case per illustration; each image resolves to its light or dark variant from the current appearance
  * Both ship as SVG asset catalogs with preserved vector data, and `Anvil2Components` depends on both

## 0.0.1

### Patch Changes

* [#3064](https://github.com/servicetitan/hammer/pull/3064) [`3e36538`](https://github.com/servicetitan/hammer/commit/3e36538671898869a4298df2fd7563490338dcd2) Thanks [@rollsroyc3](https://github.com/rollsroyc3)! - \[Tokens] Add `text.highlight.backgroundFallback`, a solid stand-in for `text.highlight.background` (web's gradient) on React Native, Swift, and Kotlin, which cannot render it.

  \[Text] Consume `backgroundFallback` for the `highlighted` prop's background instead of a hardcoded `rgba(188, 226, 234, 0.4)` literal.

* [#3011](https://github.com/servicetitan/hammer/pull/3011) [`1b48f54`](https://github.com/servicetitan/hammer/commit/1b48f543c4406f7033db3e29344b7860a091548e) Thanks [@andrewking1235](https://github.com/andrewking1235)! - \[Anvil2Theme] Add initial prerelease of the injectable native theme, replacing the static `Anvil2Tokens` namespace

  * Components read tokens from `@Environment(\.anvil2Theme)`; the default is `Anvil2Theme.carto`
  * A theme built from a modified lower tier re-derives every tier above it
  * Easing tokens are a SwiftUI `UnitCurve`, passed straight to `Animation.timingCurve(_:duration:)`
  * Font-family and breakpoint tokens are no longer emitted

* Updated dependencies \[[`3e36538`](https://github.com/servicetitan/hammer/commit/3e36538671898869a4298df2fd7563490338dcd2)]:
  * @servicetitan/carto-tokens\@0.4.7


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.