Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(native): Swift theme generator turns every Astryx theme into a typed Theme.<name> (#8265)

Cindy Zhanga01297473369
diff --git a/packages/native/README.md b/packages/native/README.md
index 2ef9e92fce..c6f36dfdcb 100644
--- a/packages/native/README.md
+++ b/packages/native/README.md
@@ -132,7 +132,7 @@ pnpm -F @astryxdesign/native typecheck # source and tests
pnpm -F @astryxdesign/native build # dist/, including platform types
pnpm -F @astryxdesign/native typecheck:types # every platform's types, after build
pnpm -F @astryxdesign/native generate:apple # regenerate apple/Sources/.../Generated
-pnpm -F @astryxdesign/native generate:swift-ios # regenerate the Astryx product's default theme and strings
+pnpm -F @astryxdesign/native generate:swift-ios # regenerate the Astryx product's typed tokens, every published theme, and strings
pnpm vitest run --project node packages/native
```
diff --git a/packages/native/apple/README.md b/packages/native/apple/README.md
index a3f87268bb..8ecae2ae85 100644
--- a/packages/native/apple/README.md
+++ b/packages/native/apple/README.md
@@ -23,7 +23,7 @@ apple/
├── Sources/
│ ├── Astryx/ # SwiftUI views (module Astryx)
│ │ ├── Theme/ # tokens, the theme environment, Dynamic Type
-│ │ │ └── Generated/ # core's default theme, generated; do not edit
+│ │ │ └── Generated/ # typed tokens and every published theme, generated; do not edit
│ │ ├── Resources/ # core's messages per locale, generated; do not edit
│ │ ├── Localization/
│ │ ├── Text/ # AstryxText
@@ -93,24 +93,66 @@ size.
## Theme tokens
Components read every color, size, and font from the `astryx` environment
-value, never from a constant of their own. Token names are core's, without
-the leading `--` (`color-accent`, `spacing-4`, `size-element-md`). Text sizes
-grow with Dynamic Type.
+value, never from a constant of their own. `astryx.tokens` holds the theme's
+tokens in the current mode as typed members (`tokens.color.textPrimary`,
+`tokens.space.s4`, `tokens.font.bodySize`), so a misspelled token fails to
+compile. Text sizes grow with Dynamic Type. The components still read some
+tokens by core's name (`astryx.color("color-accent")`); moving them onto the
+typed members comes next.
Font families come from the theme's `font-family-*` stacks: the first family
the device has wins, and a system family such as `-apple-system` or
`sans-serif` is the system font. Icons use core's shared icon names
(`success`, `warning`, …), drawn as an SF Symbol by default; a theme replaces
-one with `AstryxTheme(…, icons: ["success": "checkmark.seal.fill"])`.
+one with `Theme(…, icons: ["success": "checkmark.seal.fill"])`.
-`Sources/Astryx/Theme/Generated/DefaultTheme.swift` is core's default theme
-run through core's own resolver, light and dark. Regenerate it after a core
-token change:
+`Sources/Astryx/Theme/Generated/` is written by the Swift theme generator
+(`../specs/swift/library/theme-generator.md`) from core's own resolver, light
+and dark:
+
+- `Tokens.swift`: the typed token surface, from core's token names.
+- One `<Name>Theme.swift` per theme, declaring `Theme.<name>`: core's
+ defaults (`.default`) and every published theme package (`.butter`,
+ `.chocolate`, `.gothic`, `.matcha`, `.neutral`, `.stone`, `.y2k`).
+
+```swift
+LoginTemplate().astryxTheme(.neutral)
+```
+
+Regenerate after a theme or core token change:
```sh
pnpm -F @astryxdesign/native generate:swift-ios
```
+A product generates its own theme the same way, from its theme's module and
+export:
+
+```sh
+node packages/native/scripts/swift-ios-theme.mjs --theme ./src/acmeTheme.ts#acmeTheme --out ./Sources/Theme
+```
+
+A theme's local tokens are not generated yet; the generator names each one it
+leaves out.
+
+**Fonts.** A theme's font families are carried as data. Astryx never bundles
+a font: a component walks the theme's family list in order and uses the first
+family the app has registered; a system family in the list (such as
+`-apple-system` or `sans-serif`) is the system font, and a list with no
+registered family falls back to the system font. To draw a theme's brand face, bundle and register it
+in the app. Faces the published themes name (body, heading, code):
+
+| Theme | Faces to bundle |
+| ------------ | ------------------------------------------ |
+| `.default` | none (system fonts) |
+| `.butter` | Outfit, JetBrains Mono |
+| `.chocolate` | Albert Sans, Fraunces, JetBrains Mono |
+| `.gothic` | Fustat, JetBrains Mono |
+| `.matcha` | DM Sans, Playwrite US Trad, JetBrains Mono |
+| `.neutral` | Figtree |
+| `.stone` | Figtree, Montserrat, JetBrains Mono |
+| `.y2k` | Poppins, JetBrains Mono |
+
The same command writes
`Sources/Astryx/Resources/<locale>.lproj/Localizable.strings` from core's
locale catalogs, so words the components speak to assistive technology, such
@@ -142,5 +184,5 @@ core's prop names, read its tokens from `astryx`, and add tests under
- The views do not use the generated contract types in `AstryxNative` yet.
Moving them onto those types is how a core prop change reaches Swift.
- Pixel and behavior parity with the web components has not been measured.
-- Only the default theme is generated; named themes, Increase Contrast, and
- platform theme entries (`defineNativeTheme`) are not wired in.
+- Increase Contrast, theme-local tokens, and platform theme entries
+ (`defineNativeTheme`, reserved as `Theme.native`) are not wired in.
diff --git a/packages/native/apple/Sources/Astryx/Theme/AstryxIcons.swift b/packages/native/apple/Sources/Astryx/Theme/AstryxIcons.swift
index b2ab68c75a..ef1cc7210d 100644
--- a/packages/native/apple/Sources/Astryx/Theme/AstryxIcons.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/AstryxIcons.swift
@@ -3,7 +3,7 @@
/// The SF Symbol each of Astryx's built-in icon names draws by default on
/// Apple platforms (AST-082 FR17). A test keeps this map equal to
/// `NATIVE_ICON_DEFAULTS` in `@astryxdesign/native`; a theme replaces any
-/// entry through `AstryxTheme(icons:)`.
+/// entry through `Theme(icons:)`.
let astryxDefaultIcons: [String: String] = [
"close": "xmark",
"chevronDown": "chevron.down",
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift
new file mode 100644
index 0000000000..ac8b2a5177
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift
@@ -0,0 +1,493 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/theme-butter, theme "butter".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+extension Theme {
+ /// The `butter` theme from @astryxdesign/theme-butter, in light and dark.
+ public static let butter = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x225BFFFF),
+ accentMuted: Color(astryxRGBA: 0x225BFF33),
+ backgroundBlue: Color(astryxRGBA: 0xDBE1FFFF),
+ backgroundBody: Color(astryxRGBA: 0xFDFBE4FF),
+ backgroundCard: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundCyan: Color(astryxRGBA: 0xA9EFF0FF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0xF0EDD4FF),
+ backgroundGreen: Color(astryxRGBA: 0xCAEEC8FF),
+ backgroundInverted: Color(astryxRGBA: 0x1D1C11FF),
+ backgroundMuted: Color(astryxRGBA: 0xF3F2E2FF),
+ backgroundOrange: Color(astryxRGBA: 0xFFDCB6FF),
+ backgroundPink: Color(astryxRGBA: 0xFFD5FBFF),
+ backgroundPopover: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundPurple: Color(astryxRGBA: 0xF2DAFFFF),
+ backgroundRed: Color(astryxRGBA: 0xFFD9CFFF),
+ backgroundSurface: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundTeal: Color(astryxRGBA: 0xB0F0D7FF),
+ backgroundYellow: Color(astryxRGBA: 0xF0DF72FF),
+ border: Color(astryxRGBA: 0xE5E3D4FF),
+ borderBlue: Color(astryxRGBA: 0xBDC5EBFF),
+ borderCyan: Color(astryxRGBA: 0x8DD2D3FF),
+ borderEmphasized: Color(astryxRGBA: 0xC7C4B2FF),
+ borderGray: Color(astryxRGBA: 0xD6D3B8FF),
+ borderGreen: Color(astryxRGBA: 0xA2D7A0FF),
+ borderOrange: Color(astryxRGBA: 0xF2BD81FF),
+ borderPink: Color(astryxRGBA: 0xF0B3E8FF),
+ borderPurple: Color(astryxRGBA: 0xDDB9F6FF),
+ borderRed: Color(astryxRGBA: 0xFFB09BFF),
+ borderTeal: Color(astryxRGBA: 0x94D3BBFF),
+ borderYellow: Color(astryxRGBA: 0xBFAE35FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0x821B00FF),
+ errorMuted: Color(astryxRGBA: 0x821B0033),
+ iconAccent: Color(astryxRGBA: 0x225BFFFF),
+ iconBlue: Color(astryxRGBA: 0x203A6CFF),
+ iconCyan: Color(astryxRGBA: 0x004649FF),
+ iconDisabled: Color(astryxRGBA: 0xADAC9EFF),
+ iconGray: Color(astryxRGBA: 0x4A4732FF),
+ iconGreen: Color(astryxRGBA: 0x004A05FF),
+ iconOrange: Color(astryxRGBA: 0x622E00FF),
+ iconPink: Color(astryxRGBA: 0x6C0A68FF),
+ iconPrimary: Color(astryxRGBA: 0x1D1C11FF),
+ iconPurple: Color(astryxRGBA: 0x52237BFF),
+ iconRed: Color(astryxRGBA: 0x6F1400FF),
+ iconSecondary: Color(astryxRGBA: 0x605F52FF),
+ iconTeal: Color(astryxRGBA: 0x00482DFF),
+ iconYellow: Color(astryxRGBA: 0x443C00FF),
+ neutral: Color(astryxRGBA: 0x1D1C110F),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0xFFECE7FF),
+ onLight: Color(astryxRGBA: 0x1D1C11FF),
+ onSuccess: Color(astryxRGBA: 0xB6E3B4FF),
+ onWarning: Color(astryxRGBA: 0xFFF7C0FF),
+ overlay: Color(astryxRGBA: 0x1D1C1180),
+ overlayHover: Color(astryxRGBA: 0x1D1C110D),
+ overlayPressed: Color(astryxRGBA: 0x1D1C111A),
+ shadow: Color(astryxRGBA: 0x1D1C111A),
+ skeleton: Color(astryxRGBA: 0xE5E3D4FF),
+ success: Color(astryxRGBA: 0x004A05FF),
+ successMuted: Color(astryxRGBA: 0x004A0533),
+ syntaxAdded: Color(astryxRGBA: 0x004A050D),
+ syntaxAddedMarker: Color(astryxRGBA: 0x605F52FF),
+ syntaxAttribute: Color(astryxRGBA: 0x443C00FF),
+ syntaxBackground: Color(astryxRGBA: 0xFDFBE4FF),
+ syntaxComment: Color(astryxRGBA: 0x605F52FF),
+ syntaxConstant: Color(astryxRGBA: 0x622E00FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x203A6CFF),
+ syntaxKeyword: Color(astryxRGBA: 0x52237BFF),
+ syntaxNumber: Color(astryxRGBA: 0x622E00FF),
+ syntaxOperator: Color(astryxRGBA: 0x605F52FF),
+ syntaxProperty: Color(astryxRGBA: 0x00482DFF),
+ syntaxPunctuation: Color(astryxRGBA: 0x605F52FF),
+ syntaxRemoved: Color(astryxRGBA: 0x821B000D),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x605F52FF),
+ syntaxString: Color(astryxRGBA: 0x004A05FF),
+ syntaxTag: Color(astryxRGBA: 0x6F1400FF),
+ syntaxType: Color(astryxRGBA: 0x52237BFF),
+ syntaxVariable: Color(astryxRGBA: 0x605F52FF),
+ textAccent: Color(astryxRGBA: 0x225BFFFF),
+ textBlue: Color(astryxRGBA: 0x203A6CFF),
+ textCyan: Color(astryxRGBA: 0x004649FF),
+ textDisabled: Color(astryxRGBA: 0xADAC9EFF),
+ textGray: Color(astryxRGBA: 0x4A4732FF),
+ textGreen: Color(astryxRGBA: 0x004A05FF),
+ textOrange: Color(astryxRGBA: 0x622E00FF),
+ textPink: Color(astryxRGBA: 0x6C0A68FF),
+ textPrimary: Color(astryxRGBA: 0x1D1C11FF),
+ textPurple: Color(astryxRGBA: 0x52237BFF),
+ textRed: Color(astryxRGBA: 0x6F1400FF),
+ textSecondary: Color(astryxRGBA: 0x605F52FF),
+ textTeal: Color(astryxRGBA: 0x00482DFF),
+ textYellow: Color(astryxRGBA: 0x443C00FF),
+ tintHover: Color(astryxRGBA: 0x000000FF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0x514700FF),
+ warningMuted: Color(astryxRGBA: 0x51470033)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 48,
+ elementMd: 40,
+ elementSm: 32
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Outfit", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Outfit", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 27,
+ heading1Weight: 600,
+ heading2Leading: 1.4545,
+ heading2Size: 22,
+ heading2Weight: 600,
+ heading3Leading: 1.5556,
+ heading3Size: 18,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.4545,
+ heading5Size: 11,
+ heading5Weight: 600,
+ heading6Leading: 1.7778,
+ heading6Size: 9,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.5556,
+ largeSize: 18,
+ largeWeight: 600,
+ size2xl: 27,
+ size2xs: 7,
+ size3xl: 34,
+ size3xs: 6,
+ size4xl: 43,
+ size4xs: 5,
+ size5xl: 53,
+ sizeBase: 14,
+ sizeLg: 18,
+ sizeSm: 11,
+ sizeXl: 22,
+ sizeXs: 9,
+ supportingLeading: 1.4545,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xFDEE8CFF),
+ accentMuted: Color(astryxRGBA: 0xFDEE8C40),
+ backgroundBlue: Color(astryxRGBA: 0xDBE1FFFF),
+ backgroundBody: Color(astryxRGBA: 0x261A13FF),
+ backgroundCard: Color(astryxRGBA: 0x3A2A1FFF),
+ backgroundCyan: Color(astryxRGBA: 0xA9EFF0FF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0xF0EDD4FF),
+ backgroundGreen: Color(astryxRGBA: 0xCDEDCCFF),
+ backgroundInverted: Color(astryxRGBA: 0xFDFBE4FF),
+ backgroundMuted: Color(astryxRGBA: 0x3A2A1FFF),
+ backgroundOrange: Color(astryxRGBA: 0xFFDCB6FF),
+ backgroundPink: Color(astryxRGBA: 0xFFD5FBFF),
+ backgroundPopover: Color(astryxRGBA: 0x3A2A1FFF),
+ backgroundPurple: Color(astryxRGBA: 0xF2DAFFFF),
+ backgroundRed: Color(astryxRGBA: 0xFFD9CFFF),
+ backgroundSurface: Color(astryxRGBA: 0x2E2117FF),
+ backgroundTeal: Color(astryxRGBA: 0xB0F0D7FF),
+ backgroundYellow: Color(astryxRGBA: 0xEEDF75FF),
+ border: Color(astryxRGBA: 0xF3F2E21A),
+ borderBlue: Color(astryxRGBA: 0xBDC5EBFF),
+ borderCyan: Color(astryxRGBA: 0x8DD2D3FF),
+ borderEmphasized: Color(astryxRGBA: 0x939184FF),
+ borderGray: Color(astryxRGBA: 0xD6D3B8FF),
+ borderGreen: Color(astryxRGBA: 0xA8D4A6FF),
+ borderOrange: Color(astryxRGBA: 0xF2BD81FF),
+ borderPink: Color(astryxRGBA: 0xF0B3E8FF),
+ borderPurple: Color(astryxRGBA: 0xDDB9F6FF),
+ borderRed: Color(astryxRGBA: 0xFFB09BFF),
+ borderTeal: Color(astryxRGBA: 0x94D3BBFF),
+ borderYellow: Color(astryxRGBA: 0xBCAE4EFF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFFC5B5FF),
+ errorMuted: Color(astryxRGBA: 0xFFC5B540),
+ iconAccent: Color(astryxRGBA: 0xFDEE8CFF),
+ iconBlue: Color(astryxRGBA: 0x203A6CFF),
+ iconCyan: Color(astryxRGBA: 0x004649FF),
+ iconDisabled: Color(astryxRGBA: 0x605F52FF),
+ iconGray: Color(astryxRGBA: 0x4A4732FF),
+ iconGreen: Color(astryxRGBA: 0x063C0AFF),
+ iconOrange: Color(astryxRGBA: 0x622E00FF),
+ iconPink: Color(astryxRGBA: 0x6C0A68FF),
+ iconPrimary: Color(astryxRGBA: 0xF3F2E2FF),
+ iconPurple: Color(astryxRGBA: 0x52237BFF),
+ iconRed: Color(astryxRGBA: 0x6F1400FF),
+ iconSecondary: Color(astryxRGBA: 0xADAC9EFF),
+ iconTeal: Color(astryxRGBA: 0x00482DFF),
+ iconYellow: Color(astryxRGBA: 0x443C00FF),
+ neutral: Color(astryxRGBA: 0xF3F2E21A),
+ onAccent: Color(astryxRGBA: 0x1D1C11FF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0x4C0700FF),
+ onLight: Color(astryxRGBA: 0x1D1C11FF),
+ onSuccess: Color(astryxRGBA: 0x013004FF),
+ onWarning: Color(astryxRGBA: 0x2C2600FF),
+ overlay: Color(astryxRGBA: 0x261A13CC),
+ overlayHover: Color(astryxRGBA: 0xF3F2E20D),
+ overlayPressed: Color(astryxRGBA: 0xF3F2E21A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x49473BFF),
+ success: Color(astryxRGBA: 0x83BC82FF),
+ successMuted: Color(astryxRGBA: 0x83BC8240),
+ syntaxAdded: Color(astryxRGBA: 0x83BC8210),
+ syntaxAddedMarker: Color(astryxRGBA: 0xADAC9EFF),
+ syntaxAttribute: Color(astryxRGBA: 0xBCAE4EFF),
+ syntaxBackground: Color(astryxRGBA: 0x131107FF),
+ syntaxComment: Color(astryxRGBA: 0xADAC9EFF),
+ syntaxConstant: Color(astryxRGBA: 0xF2BD81FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0xBDC5EBFF),
+ syntaxKeyword: Color(astryxRGBA: 0xDDB9F6FF),
+ syntaxNumber: Color(astryxRGBA: 0xF2BD81FF),
+ syntaxOperator: Color(astryxRGBA: 0xADAC9EFF),
+ syntaxProperty: Color(astryxRGBA: 0x94D3BBFF),
+ syntaxPunctuation: Color(astryxRGBA: 0xADAC9EFF),
+ syntaxRemoved: Color(astryxRGBA: 0xFFC5B510),
+ syntaxRemovedMarker: Color(astryxRGBA: 0xADAC9EFF),
+ syntaxString: Color(astryxRGBA: 0xA8D4A6FF),
+ syntaxTag: Color(astryxRGBA: 0xFFB09BFF),
+ syntaxType: Color(astryxRGBA: 0xDDB9F6FF),
+ syntaxVariable: Color(astryxRGBA: 0xADAC9EFF),
+ textAccent: Color(astryxRGBA: 0xFDEE8CFF),
+ textBlue: Color(astryxRGBA: 0x203A6CFF),
+ textCyan: Color(astryxRGBA: 0x004649FF),
+ textDisabled: Color(astryxRGBA: 0x605F52FF),
+ textGray: Color(astryxRGBA: 0x4A4732FF),
+ textGreen: Color(astryxRGBA: 0x063C0AFF),
+ textOrange: Color(astryxRGBA: 0x622E00FF),
+ textPink: Color(astryxRGBA: 0x6C0A68FF),
+ textPrimary: Color(astryxRGBA: 0xF3F2E2FF),
+ textPurple: Color(astryxRGBA: 0x52237BFF),
+ textRed: Color(astryxRGBA: 0x6F1400FF),
+ textSecondary: Color(astryxRGBA: 0xADAC9EFF),
+ textTeal: Color(astryxRGBA: 0x00482DFF),
+ textYellow: Color(astryxRGBA: 0x443C00FF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xCDBE59FF),
+ warningMuted: Color(astryxRGBA: 0xCDBE5940)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 48,
+ elementMd: 40,
+ elementSm: 32
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Outfit", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Outfit", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 27,
+ heading1Weight: 600,
+ heading2Leading: 1.4545,
+ heading2Size: 22,
+ heading2Weight: 600,
+ heading3Leading: 1.5556,
+ heading3Size: 18,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.4545,
+ heading5Size: 11,
+ heading5Weight: 600,
+ heading6Leading: 1.7778,
+ heading6Size: 9,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.5556,
+ largeSize: 18,
+ largeWeight: 600,
+ size2xl: 27,
+ size2xs: 7,
+ size3xl: 34,
+ size3xs: 6,
+ size4xl: 43,
+ size4xs: 5,
+ size5xl: 53,
+ sizeBase: 14,
+ sizeLg: 18,
+ sizeSm: 11,
+ sizeXl: 22,
+ sizeXs: 9,
+ supportingLeading: 1.4545,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
+ )
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift
new file mode 100644
index 0000000000..69e95e4080
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift
@@ -0,0 +1,493 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/theme-chocolate, theme "chocolate".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+extension Theme {
+ /// The `chocolate` theme from @astryxdesign/theme-chocolate, in light and dark.
+ public static let chocolate = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x8C5927FF),
+ accentMuted: Color(astryxRGBA: 0x8C592714),
+ backgroundBlue: Color(astryxRGBA: 0x3A5E8C33),
+ backgroundBody: Color(astryxRGBA: 0xFFFCF7FF),
+ backgroundCard: Color(astryxRGBA: 0xEDE4D4FF),
+ backgroundCyan: Color(astryxRGBA: 0x3A7C7C33),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0xB8885933),
+ backgroundGreen: Color(astryxRGBA: 0x70990033),
+ backgroundInverted: Color(astryxRGBA: 0x4A3520FF),
+ backgroundMuted: Color(astryxRGBA: 0xEDE4D4FF),
+ backgroundOrange: Color(astryxRGBA: 0xC4762033),
+ backgroundPink: Color(astryxRGBA: 0xC44A7033),
+ backgroundPopover: Color(astryxRGBA: 0xFFFCF7FF),
+ backgroundPurple: Color(astryxRGBA: 0x6B4A8C33),
+ backgroundRed: Color(astryxRGBA: 0xFD000033),
+ backgroundSurface: Color(astryxRGBA: 0xFFFCF7FF),
+ backgroundTeal: Color(astryxRGBA: 0x2E6B5A33),
+ backgroundYellow: Color(astryxRGBA: 0xFFB60033),
+ border: Color(astryxRGBA: 0xC4AC95FF),
+ borderBlue: Color(astryxRGBA: 0x3A5E8CFF),
+ borderCyan: Color(astryxRGBA: 0x3A7C7CFF),
+ borderEmphasized: Color(astryxRGBA: 0xB88859FF),
+ borderGray: Color(astryxRGBA: 0xB88859FF),
+ borderGreen: Color(astryxRGBA: 0x709900FF),
+ borderOrange: Color(astryxRGBA: 0xC47620FF),
+ borderPink: Color(astryxRGBA: 0xC44A70FF),
+ borderPurple: Color(astryxRGBA: 0x6B4A8CFF),
+ borderRed: Color(astryxRGBA: 0xFD0000FF),
+ borderTeal: Color(astryxRGBA: 0x2E6B5AFF),
+ borderYellow: Color(astryxRGBA: 0xFFB600FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFD0000FF),
+ errorMuted: Color(astryxRGBA: 0xFD000020),
+ iconAccent: Color(astryxRGBA: 0x8C5927FF),
+ iconBlue: Color(astryxRGBA: 0x3A5E8CFF),
+ iconCyan: Color(astryxRGBA: 0x3A7C7CFF),
+ iconDisabled: Color(astryxRGBA: 0xC4AC95FF),
+ iconGray: Color(astryxRGBA: 0xB88859FF),
+ iconGreen: Color(astryxRGBA: 0x709900FF),
+ iconOrange: Color(astryxRGBA: 0xC47620FF),
+ iconPink: Color(astryxRGBA: 0xC44A70FF),
+ iconPrimary: Color(astryxRGBA: 0x4A3520FF),
+ iconPurple: Color(astryxRGBA: 0x6B4A8CFF),
+ iconRed: Color(astryxRGBA: 0xFD0000FF),
+ iconSecondary: Color(astryxRGBA: 0xB88859FF),
+ iconTeal: Color(astryxRGBA: 0x2E6B5AFF),
+ iconYellow: Color(astryxRGBA: 0xFFB600FF),
+ neutral: Color(astryxRGBA: 0x8C59270F),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFCF7FF),
+ onError: Color(astryxRGBA: 0xFFFFFFFF),
+ onLight: Color(astryxRGBA: 0x4A3520FF),
+ onSuccess: Color(astryxRGBA: 0xFFFFFFFF),
+ onWarning: Color(astryxRGBA: 0x4A3520FF),
+ overlay: Color(astryxRGBA: 0x4A352080),
+ overlayHover: Color(astryxRGBA: 0x4A35200D),
+ overlayPressed: Color(astryxRGBA: 0x4A35201A),
+ shadow: Color(astryxRGBA: 0x4A35201A),
+ skeleton: Color(astryxRGBA: 0xC4AC95FF),
+ success: Color(astryxRGBA: 0x709900FF),
+ successMuted: Color(astryxRGBA: 0x70990020),
+ syntaxAdded: Color(astryxRGBA: 0x70990008),
+ syntaxAddedMarker: Color(astryxRGBA: 0x9E622EFF),
+ syntaxAttribute: Color(astryxRGBA: 0x8C5927FF),
+ syntaxBackground: Color(astryxRGBA: 0xFFFCF7FF),
+ syntaxComment: Color(astryxRGBA: 0xB88859FF),
+ syntaxConstant: Color(astryxRGBA: 0xA06018FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x3A5E8CFF),
+ syntaxKeyword: Color(astryxRGBA: 0x8C5927FF),
+ syntaxNumber: Color(astryxRGBA: 0xA06018FF),
+ syntaxOperator: Color(astryxRGBA: 0xB88859FF),
+ syntaxProperty: Color(astryxRGBA: 0x3A7C6BFF),
+ syntaxPunctuation: Color(astryxRGBA: 0x9E622EFF),
+ syntaxRemoved: Color(astryxRGBA: 0xFD000008),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x9E622EFF),
+ syntaxString: Color(astryxRGBA: 0x2E6B4AFF),
+ syntaxTag: Color(astryxRGBA: 0x8C3A3AFF),
+ syntaxType: Color(astryxRGBA: 0x6B4A8CFF),
+ syntaxVariable: Color(astryxRGBA: 0x4A3520FF),
+ textAccent: Color(astryxRGBA: 0x8C5927FF),
+ textBlue: Color(astryxRGBA: 0x2E4A6EFF),
+ textCyan: Color(astryxRGBA: 0x2E6060FF),
+ textDisabled: Color(astryxRGBA: 0xC4AC95FF),
+ textGray: Color(astryxRGBA: 0x4A3520FF),
+ textGreen: Color(astryxRGBA: 0x5A7A00FF),
+ textOrange: Color(astryxRGBA: 0xA06018FF),
+ textPink: Color(astryxRGBA: 0xA03A5AFF),
+ textPrimary: Color(astryxRGBA: 0x4A3520FF),
+ textPurple: Color(astryxRGBA: 0x553A70FF),
+ textRed: Color(astryxRGBA: 0xCC0000FF),
+ textSecondary: Color(astryxRGBA: 0xB88859FF),
+ textTeal: Color(astryxRGBA: 0x245546FF),
+ textYellow: Color(astryxRGBA: 0xCC9200FF),
+ tintHover: Color(astryxRGBA: 0x000000FF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0xFFB600FF),
+ warningMuted: Color(astryxRGBA: 0xFFB60020)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 10,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Albert Sans", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Fraunces", "Georgia", "Times New Roman", "Times", "serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 24,
+ heading1Weight: 600,
+ heading2Leading: 1.4,
+ heading2Size: 20,
+ heading2Weight: 600,
+ heading3Leading: 1.4118,
+ heading3Size: 17,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.6667,
+ heading5Size: 12,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.4118,
+ largeSize: 17,
+ largeWeight: 600,
+ size2xl: 24,
+ size2xs: 8,
+ size3xl: 29,
+ size3xs: 7,
+ size4xl: 35,
+ size4xs: 6,
+ size5xl: 42,
+ sizeBase: 14,
+ sizeLg: 17,
+ sizeSm: 12,
+ sizeXl: 20,
+ sizeXs: 10,
+ supportingLeading: 1.6667,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xD4A06AFF),
+ accentMuted: Color(astryxRGBA: 0xD4A06A20),
+ backgroundBlue: Color(astryxRGBA: 0x3A5E8C33),
+ backgroundBody: Color(astryxRGBA: 0x141010FF),
+ backgroundCard: Color(astryxRGBA: 0x2A2018FF),
+ backgroundCyan: Color(astryxRGBA: 0x3A7C7C33),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0x6B554033),
+ backgroundGreen: Color(astryxRGBA: 0x96BF2A33),
+ backgroundInverted: Color(astryxRGBA: 0xEDE4D4FF),
+ backgroundMuted: Color(astryxRGBA: 0x2A2018FF),
+ backgroundOrange: Color(astryxRGBA: 0xD4903A33),
+ backgroundPink: Color(astryxRGBA: 0xE07A9A33),
+ backgroundPopover: Color(astryxRGBA: 0x2A2018FF),
+ backgroundPurple: Color(astryxRGBA: 0xB08ED433),
+ backgroundRed: Color(astryxRGBA: 0xFF5C5C33),
+ backgroundSurface: Color(astryxRGBA: 0x1C1610FF),
+ backgroundTeal: Color(astryxRGBA: 0x5AB89833),
+ backgroundYellow: Color(astryxRGBA: 0xFFC94033),
+ border: Color(astryxRGBA: 0xEDE4D41A),
+ borderBlue: Color(astryxRGBA: 0x7BA8D4FF),
+ borderCyan: Color(astryxRGBA: 0x70C4C4FF),
+ borderEmphasized: Color(astryxRGBA: 0x6B5540FF),
+ borderGray: Color(astryxRGBA: 0xB88859FF),
+ borderGreen: Color(astryxRGBA: 0x96BF2AFF),
+ borderOrange: Color(astryxRGBA: 0xD4903AFF),
+ borderPink: Color(astryxRGBA: 0xE07A9AFF),
+ borderPurple: Color(astryxRGBA: 0xB08ED4FF),
+ borderRed: Color(astryxRGBA: 0xFF5C5CFF),
+ borderTeal: Color(astryxRGBA: 0x5AB898FF),
+ borderYellow: Color(astryxRGBA: 0xFFC940FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFF5C5CFF),
+ errorMuted: Color(astryxRGBA: 0xFF5C5C20),
+ iconAccent: Color(astryxRGBA: 0xD4A06AFF),
+ iconBlue: Color(astryxRGBA: 0x7BA8D4FF),
+ iconCyan: Color(astryxRGBA: 0x70C4C4FF),
+ iconDisabled: Color(astryxRGBA: 0x6B5540FF),
+ iconGray: Color(astryxRGBA: 0xC4A882FF),
+ iconGreen: Color(astryxRGBA: 0x96BF2AFF),
+ iconOrange: Color(astryxRGBA: 0xD4903AFF),
+ iconPink: Color(astryxRGBA: 0xE07A9AFF),
+ iconPrimary: Color(astryxRGBA: 0xEDE4D4FF),
+ iconPurple: Color(astryxRGBA: 0xB08ED4FF),
+ iconRed: Color(astryxRGBA: 0xFF5C5CFF),
+ iconSecondary: Color(astryxRGBA: 0xC4A882FF),
+ iconTeal: Color(astryxRGBA: 0x5AB898FF),
+ iconYellow: Color(astryxRGBA: 0xFFC940FF),
+ neutral: Color(astryxRGBA: 0xEDE4D41A),
+ onAccent: Color(astryxRGBA: 0x4A3520FF),
+ onDark: Color(astryxRGBA: 0xFFFCF7FF),
+ onError: Color(astryxRGBA: 0x4A3520FF),
+ onLight: Color(astryxRGBA: 0x4A3520FF),
+ onSuccess: Color(astryxRGBA: 0x4A3520FF),
+ onWarning: Color(astryxRGBA: 0x4A3520FF),
+ overlay: Color(astryxRGBA: 0x140E0ACC),
+ overlayHover: Color(astryxRGBA: 0xEDE4D40D),
+ overlayPressed: Color(astryxRGBA: 0xEDE4D41A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x6B5540FF),
+ success: Color(astryxRGBA: 0x96BF2AFF),
+ successMuted: Color(astryxRGBA: 0x96BF2A20),
+ syntaxAdded: Color(astryxRGBA: 0x96BF2A08),
+ syntaxAddedMarker: Color(astryxRGBA: 0xCB884DFF),
+ syntaxAttribute: Color(astryxRGBA: 0xD4A06AFF),
+ syntaxBackground: Color(astryxRGBA: 0x1C1610FF),
+ syntaxComment: Color(astryxRGBA: 0xB88859FF),
+ syntaxConstant: Color(astryxRGBA: 0xD4B870FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x7BA8D4FF),
+ syntaxKeyword: Color(astryxRGBA: 0xD4A06AFF),
+ syntaxNumber: Color(astryxRGBA: 0xD4B870FF),
+ syntaxOperator: Color(astryxRGBA: 0xC4A882FF),
+ syntaxProperty: Color(astryxRGBA: 0x70C4B0FF),
+ syntaxPunctuation: Color(astryxRGBA: 0xCB884DFF),
+ syntaxRemoved: Color(astryxRGBA: 0xFF5C5C08),
+ syntaxRemovedMarker: Color(astryxRGBA: 0xCB884DFF),
+ syntaxString: Color(astryxRGBA: 0x7BC49EFF),
+ syntaxTag: Color(astryxRGBA: 0xD47A7AFF),
+ syntaxType: Color(astryxRGBA: 0xB08ED4FF),
+ syntaxVariable: Color(astryxRGBA: 0xEDE4D4FF),
+ textAccent: Color(astryxRGBA: 0xD4A06AFF),
+ textBlue: Color(astryxRGBA: 0x8DBCE0FF),
+ textCyan: Color(astryxRGBA: 0x82D4D4FF),
+ textDisabled: Color(astryxRGBA: 0x6B5540FF),
+ textGray: Color(astryxRGBA: 0xEDE4D4FF),
+ textGreen: Color(astryxRGBA: 0xA8D43AFF),
+ textOrange: Color(astryxRGBA: 0xE0A04AFF),
+ textPink: Color(astryxRGBA: 0xF08AAAFF),
+ textPrimary: Color(astryxRGBA: 0xEDE4D4FF),
+ textPurple: Color(astryxRGBA: 0xC0A0E0FF),
+ textRed: Color(astryxRGBA: 0xFF7A7AFF),
+ textSecondary: Color(astryxRGBA: 0xC4A882FF),
+ textTeal: Color(astryxRGBA: 0x6CCAAAFF),
+ textYellow: Color(astryxRGBA: 0xFFD960FF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xFFC940FF),
+ warningMuted: Color(astryxRGBA: 0xFFC94020)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 10,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Albert Sans", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Fraunces", "Georgia", "Times New Roman", "Times", "serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 24,
+ heading1Weight: 600,
+ heading2Leading: 1.4,
+ heading2Size: 20,
+ heading2Weight: 600,
+ heading3Leading: 1.4118,
+ heading3Size: 17,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.6667,
+ heading5Size: 12,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.4118,
+ largeSize: 17,
+ largeWeight: 600,
+ size2xl: 24,
+ size2xs: 8,
+ size3xl: 29,
+ size3xs: 7,
+ size4xl: 35,
+ size4xs: 6,
+ size5xl: 42,
+ sizeBase: 14,
+ sizeLg: 17,
+ sizeSm: 12,
+ sizeXl: 20,
+ sizeXs: 10,
+ supportingLeading: 1.6667,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
+ )
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift
index 37c7af3bfc..58539b7591 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift
@@ -1,482 +1,493 @@
-// Generated by @astryxdesign/native from core's theme resolver. Do not edit.
-// Run `pnpm -F @astryxdesign/native generate:swift-ios` after a core token change.
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/core, theme "astryx".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
-extension AstryxTokens {
- /// Core's default theme, light mode.
- public static let defaultLight = AstryxTokens(
- colors: [
- "color-accent": "#0064E0FF",
- "color-accent-muted": "#0082FB33",
- "color-background-blue": "#0171E333",
- "color-background-body": "#F1F4F7FF",
- "color-background-card": "#FFFFFFFF",
- "color-background-cyan": "#03A7D733",
- "color-background-error-inverted": "#AA071EFF",
- "color-background-gray": "#0A131733",
- "color-background-green": "#24BB5E33",
- "color-background-inverted": "#0A1317FF",
- "color-background-muted": "#0536590C",
- "color-background-orange": "#F2790233",
- "color-background-pink": "#E638B333",
- "color-background-popover": "#FFFFFFFF",
- "color-background-purple": "#7952FF33",
- "color-background-red": "#E3193B33",
- "color-background-surface": "#FFFFFFFF",
- "color-background-teal": "#0DB7AF33",
- "color-background-yellow": "#E2A40033",
- "color-border": "#05365919",
- "color-border-blue": "#0064E0FF",
- "color-border-cyan": "#089DD0FF",
- "color-border-emphasized": "#CCD3DBFF",
- "color-border-gray": "#647685FF",
- "color-border-green": "#0D8626FF",
- "color-border-orange": "#EB6E00FF",
- "color-border-pink": "#F351C0FF",
- "color-border-purple": "#9081FFFF",
- "color-border-red": "#E3193BFF",
- "color-border-teal": "#08A3A3FF",
- "color-border-yellow": "#C58600FF",
- "color-data-blue-1": "#DBECFFFF",
- "color-data-blue-2": "#78BEFFFF",
- "color-data-blue-3": "#2694FEFF",
- "color-data-blue-4": "#004CBCFF",
- "color-data-blue-5": "#02165EFF",
- "color-data-categorical-blue": "#0171E3FF",
- "color-data-categorical-brown": "#965E03FF",
- "color-data-categorical-cyan": "#0171A4FF",
- "color-data-categorical-green": "#0B991FFF",
- "color-data-categorical-indigo": "#6F8AFFFF",
- "color-data-categorical-orange": "#EB6E00FF",
- "color-data-categorical-pink": "#F351C0FF",
- "color-data-categorical-purple": "#6B1EFDFF",
- "color-data-categorical-red": "#F5394FFF",
- "color-data-categorical-teal": "#08A3A3FF",
- "color-data-gray-1": "#F1F4F7FF",
- "color-data-gray-2": "#CCD3DBFF",
- "color-data-gray-3": "#AFB9C4FF",
- "color-data-gray-4": "#5D6C7BFF",
- "color-data-gray-5": "#25363FFF",
- "color-data-neutral": "#8494A3FF",
- "color-data-orange-1": "#FFE6CFFF",
- "color-data-orange-2": "#FDB876FF",
- "color-data-orange-3": "#FD9537FF",
- "color-data-orange-4": "#D66100FF",
- "color-data-orange-5": "#A13F04FF",
- "color-data-pink-1": "#FCE3F4FF",
- "color-data-pink-2": "#FEADE3FF",
- "color-data-pink-3": "#F989D3FF",
- "color-data-pink-4": "#D123A1FF",
- "color-data-pink-5": "#8E1073FF",
- "color-data-purple-1": "#E8E8FBFF",
- "color-data-purple-2": "#B3B0FEFF",
- "color-data-purple-3": "#9081FFFF",
- "color-data-purple-4": "#6B1EFDFF",
- "color-data-purple-5": "#3E0697FF",
- "color-data-red-1": "#FEE4E6FF",
- "color-data-red-2": "#FFB2B8FF",
- "color-data-red-3": "#FB7D87FF",
- "color-data-red-4": "#D31130FF",
- "color-data-red-5": "#9D0519FF",
- "color-data-shamrock-1": "#D6FEE4FF",
- "color-data-shamrock-2": "#8EF7AAFF",
- "color-data-shamrock-3": "#24BB5EFF",
- "color-data-shamrock-4": "#138546FF",
- "color-data-shamrock-5": "#0B603DFF",
- "color-data-teal-1": "#D7FCF8FF",
- "color-data-teal-2": "#6CE6D8FF",
- "color-data-teal-3": "#0DB7AFFF",
- "color-data-teal-4": "#0C9293FF",
- "color-data-teal-5": "#08767DFF",
- "color-data-yellow-1": "#FDF6BAFF",
- "color-data-yellow-2": "#FCEC85FF",
- "color-data-yellow-3": "#FBCE03FF",
- "color-data-yellow-4": "#D69804FF",
- "color-data-yellow-5": "#8A5001FF",
- "color-error": "#E3193BFF",
- "color-error-muted": "#E3193B33",
- "color-icon-accent": "#0064E0FF",
- "color-icon-blue": "#0064E0FF",
- "color-icon-cyan": "#00ACC1FF",
- "color-icon-disabled": "#A4B0BCFF",
- "color-icon-gray": "#4E606FFF",
- "color-icon-green": "#0D8626FF",
- "color-icon-orange": "#E9690BFF",
- "color-icon-pink": "#C2185BFF",
- "color-icon-primary": "#0A1317FF",
- "color-icon-purple": "#5B08D8FF",
- "color-icon-red": "#D31130FF",
- "color-icon-secondary": "#4E606FFF",
- "color-icon-teal": "#009688FF",
- "color-icon-yellow": "#FBC02DFF",
- "color-neutral": "#0536591A",
- "color-on-accent": "#FFFFFFFF",
- "color-on-dark": "#FFFFFFFF",
- "color-on-error": "#FFFFFFFF",
- "color-on-light": "#000000FF",
- "color-on-success": "#FFFFFFFF",
- "color-on-warning": "#0A1317FF",
- "color-overlay": "#01122866",
- "color-overlay-hover": "#0536590C",
- "color-overlay-pressed": "#05365919",
- "color-shadow": "#0536591A",
- "color-skeleton": "#CCD3DBFF",
- "color-success": "#0D8626FF",
- "color-success-muted": "#0B991F33",
- "color-syntax-added": "#0B991F0D",
- "color-syntax-added-marker": "#09441FFF",
- "color-syntax-attribute": "#083943FF",
- "color-syntax-background": "#0536590C",
- "color-syntax-comment": "#4E606FFF",
- "color-syntax-constant": "#6B2203FF",
- "color-syntax-diff-header": "#0536590C",
- "color-syntax-function": "#042F97FF",
- "color-syntax-keyword": "#0064E0FF",
- "color-syntax-number": "#6B2203FF",
- "color-syntax-operator": "#014975FF",
- "color-syntax-property": "#014975FF",
- "color-syntax-punctuation": "#4E606FFF",
- "color-syntax-removed": "#E3193B0D",
- "color-syntax-removed-marker": "#7B0210FF",
- "color-syntax-string": "#09441FFF",
- "color-syntax-tag": "#7B0210FF",
- "color-syntax-type": "#3E0697FF",
- "color-syntax-variable": "#0A1317FF",
- "color-text-accent": "#0064E0FF",
- "color-text-blue": "#042F97FF",
- "color-text-cyan": "#014975FF",
- "color-text-disabled": "#A4B0BCFF",
- "color-text-gray": "#0A1317FF",
- "color-text-green": "#09441FFF",
- "color-text-orange": "#6B2203FF",
- "color-text-pink": "#650053FF",
- "color-text-primary": "#0A1317FF",
- "color-text-purple": "#3E0697FF",
- "color-text-red": "#7B0210FF",
- "color-text-secondary": "#4E606FFF",
- "color-text-teal": "#083943FF",
- "color-text-yellow": "#753F07FF",
- "color-tint-hover": "#000000FF",
- "color-track": "#CCD3DBFF",
- "color-warning": "#E9AF08FF",
- "color-warning-muted": "#E2A40033",
- ],
- sizes: [
- "border-width": 1,
- "font-size-2xl": 24,
- "font-size-2xs": 8,
- "font-size-3xl": 29,
- "font-size-3xs": 7,
- "font-size-4xl": 35,
- "font-size-4xs": 6,
- "font-size-5xl": 42,
- "font-size-base": 14,
- "font-size-lg": 17,
- "font-size-sm": 12,
- "font-size-xl": 20,
- "font-size-xs": 10,
- "font-weight-bold": 700,
- "font-weight-medium": 500,
- "font-weight-normal": 400,
- "font-weight-semibold": 600,
- "radius-chat": 28,
- "radius-container": 12,
- "radius-element": 8,
- "radius-full": 9999,
- "radius-inner": 4,
- "radius-none": 0,
- "radius-page": 28,
- "size-element-lg": 36,
- "size-element-md": 32,
- "size-element-sm": 28,
- "spacing-0": 0,
- "spacing-0-5": 2,
- "spacing-1": 4,
- "spacing-1-5": 6,
- "spacing-10": 40,
- "spacing-11": 44,
- "spacing-12": 48,
- "spacing-2": 8,
- "spacing-3": 12,
- "spacing-4": 16,
- "spacing-5": 20,
- "spacing-6": 24,
- "spacing-7": 28,
- "spacing-8": 32,
- "spacing-9": 36,
- "text-body-leading": 1.4286,
- "text-body-size": 14,
- "text-body-weight": 400,
- "text-heading-1-leading": 1.3333,
- "text-heading-1-size": 24,
- "text-heading-1-weight": 600,
- "text-heading-2-leading": 1.4,
- "text-heading-2-size": 20,
- "text-heading-2-weight": 600,
- "text-heading-3-leading": 1.4118,
- "text-heading-3-size": 17,
- "text-heading-3-weight": 600,
- "text-heading-4-leading": 1.4286,
- "text-heading-4-size": 14,
- "text-heading-4-weight": 600,
- "text-heading-5-leading": 1.6667,
- "text-heading-5-size": 12,
- "text-heading-5-weight": 600,
- "text-heading-6-leading": 1.6,
- "text-heading-6-size": 10,
- "text-heading-6-weight": 600,
- "text-label-leading": 1.4286,
- "text-label-size": 14,
- "text-label-weight": 500,
- "text-large-leading": 1.4118,
- "text-large-size": 17,
- "text-large-weight": 600,
- "text-supporting-leading": 1.6667,
- "text-supporting-size": 12,
- "text-supporting-weight": 400,
- ],
- fonts: [
- "font-family-body": ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
- "font-family-code": ["SF Mono", "Monaco", "Consolas", "monospace"],
- "font-family-heading": ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
- ]
- )
+import SwiftUI
- /// Core's default theme, dark mode.
- public static let defaultDark = AstryxTokens(
- colors: [
- "color-accent": "#2694FEFF",
- "color-accent-muted": "#0082FB3F",
- "color-background-blue": "#0171E333",
- "color-background-body": "#111112FF",
- "color-background-card": "#1F1F22FF",
- "color-background-cyan": "#03A7D733",
- "color-background-error-inverted": "#E3193BFF",
- "color-background-gray": "#666A724C",
- "color-background-green": "#24BB5E33",
- "color-background-inverted": "#FFFFFFFF",
- "color-background-muted": "#1111127F",
- "color-background-orange": "#F2790233",
- "color-background-pink": "#E638B333",
- "color-background-popover": "#28292CFF",
- "color-background-purple": "#7952FF33",
- "color-background-red": "#E3193B33",
- "color-background-surface": "#1F1F22FF",
- "color-background-teal": "#0DB7AF33",
- "color-background-yellow": "#E2A40033",
- "color-border": "#F2F4F619",
- "color-border-blue": "#2694FEFF",
- "color-border-cyan": "#0171A4FF",
- "color-border-emphasized": "#494D53FF",
- "color-border-gray": "#748695FF",
- "color-border-green": "#0B991FFF",
- "color-border-orange": "#B34A01FF",
- "color-border-pink": "#C02294FF",
- "color-border-purple": "#7340FEFF",
- "color-border-red": "#F5394FFF",
- "color-border-teal": "#08767DFF",
- "color-border-yellow": "#B47700FF",
- "color-data-blue-1": "#DBECFFFF",
- "color-data-blue-2": "#78BEFFFF",
- "color-data-blue-3": "#2694FEFF",
- "color-data-blue-4": "#004CBCFF",
- "color-data-blue-5": "#02165EFF",
- "color-data-categorical-blue": "#0171E3FF",
- "color-data-categorical-brown": "#965E03FF",
- "color-data-categorical-cyan": "#0171A4FF",
- "color-data-categorical-green": "#0B991FFF",
- "color-data-categorical-indigo": "#6F8AFFFF",
- "color-data-categorical-orange": "#EB6E00FF",
- "color-data-categorical-pink": "#F351C0FF",
- "color-data-categorical-purple": "#6B1EFDFF",
- "color-data-categorical-red": "#F5394FFF",
- "color-data-categorical-teal": "#08A3A3FF",
- "color-data-gray-1": "#F2F4F6FF",
- "color-data-gray-2": "#D0D3D6FF",
- "color-data-gray-3": "#B2B8BEFF",
- "color-data-gray-4": "#666A72FF",
- "color-data-gray-5": "#333338FF",
- "color-data-neutral": "#8C939BFF",
- "color-data-orange-1": "#FFE6CFFF",
- "color-data-orange-2": "#FDB876FF",
- "color-data-orange-3": "#FD9537FF",
- "color-data-orange-4": "#D66100FF",
- "color-data-orange-5": "#A13F04FF",
- "color-data-pink-1": "#FCE3F4FF",
- "color-data-pink-2": "#FEADE3FF",
- "color-data-pink-3": "#F989D3FF",
- "color-data-pink-4": "#D123A1FF",
- "color-data-pink-5": "#8E1073FF",
- "color-data-purple-1": "#E8E8FBFF",
- "color-data-purple-2": "#B3B0FEFF",
- "color-data-purple-3": "#9081FFFF",
- "color-data-purple-4": "#6B1EFDFF",
- "color-data-purple-5": "#3E0697FF",
- "color-data-red-1": "#FEE4E6FF",
- "color-data-red-2": "#FFB2B8FF",
- "color-data-red-3": "#FB7D87FF",
- "color-data-red-4": "#D31130FF",
- "color-data-red-5": "#9D0519FF",
- "color-data-shamrock-1": "#D6FEE4FF",
- "color-data-shamrock-2": "#8EF7AAFF",
- "color-data-shamrock-3": "#24BB5EFF",
- "color-data-shamrock-4": "#138546FF",
- "color-data-shamrock-5": "#0B603DFF",
- "color-data-teal-1": "#D7FCF8FF",
- "color-data-teal-2": "#6CE6D8FF",
- "color-data-teal-3": "#0DB7AFFF",
- "color-data-teal-4": "#0C9293FF",
- "color-data-teal-5": "#08767DFF",
- "color-data-yellow-1": "#FDF6BAFF",
- "color-data-yellow-2": "#FCEC85FF",
- "color-data-yellow-3": "#FBCE03FF",
- "color-data-yellow-4": "#D69804FF",
- "color-data-yellow-5": "#8A5001FF",
- "color-error": "#F5394FFF",
- "color-error-muted": "#F5394F3F",
- "color-icon-accent": "#2694FEFF",
- "color-icon-blue": "#2694FEFF",
- "color-icon-cyan": "#26C6DAFF",
- "color-icon-disabled": "#6F747CFF",
- "color-icon-gray": "#AAAFB5FF",
- "color-icon-green": "#26A756FF",
- "color-icon-orange": "#FB8C00FF",
- "color-icon-pink": "#EC407AFF",
- "color-icon-primary": "#DFE2E5FF",
- "color-icon-purple": "#7952FFFF",
- "color-icon-red": "#E3193BFF",
- "color-icon-secondary": "#AAAFB5FF",
- "color-icon-teal": "#26A69AFF",
- "color-icon-yellow": "#FFEE58FF",
- "color-neutral": "#DFE2E533",
- "color-on-accent": "#FFFFFFFF",
- "color-on-dark": "#FFFFFFFF",
- "color-on-error": "#FFFFFFFF",
- "color-on-light": "#000000FF",
- "color-on-success": "#FFFFFFFF",
- "color-on-warning": "#0A1317FF",
- "color-overlay": "#11111299",
- "color-overlay-hover": "#FFFFFF0C",
- "color-overlay-pressed": "#FFFFFF19",
- "color-shadow": "#0000004D",
- "color-skeleton": "#5A5E66FF",
- "color-success": "#0D8626FF",
- "color-success-muted": "#0B991F3F",
- "color-syntax-added": "#0B991F10",
- "color-syntax-added-marker": "#A5F690FF",
- "color-syntax-attribute": "#40DCCDFF",
- "color-syntax-background": "#1111127F",
- "color-syntax-comment": "#AAAFB5FF",
- "color-syntax-constant": "#FDB876FF",
- "color-syntax-diff-header": "#1111127F",
- "color-syntax-function": "#AFD7FFFF",
- "color-syntax-keyword": "#3E9EFBFF",
- "color-syntax-number": "#FDB876FF",
- "color-syntax-operator": "#A1EEF9FF",
- "color-syntax-property": "#A1EEF9FF",
- "color-syntax-punctuation": "#AAAFB5FF",
- "color-syntax-removed": "#F5394F10",
- "color-syntax-removed-marker": "#FFB2B8FF",
- "color-syntax-string": "#A5F690FF",
- "color-syntax-tag": "#FFB2B8FF",
- "color-syntax-type": "#B3B0FEFF",
- "color-syntax-variable": "#DFE2E5FF",
- "color-text-accent": "#3E9EFBFF",
- "color-text-blue": "#AFD7FFFF",
- "color-text-cyan": "#A1EEF9FF",
- "color-text-disabled": "#6F747CFF",
- "color-text-gray": "#E7EAEDFF",
- "color-text-green": "#A5F690FF",
- "color-text-orange": "#FDB876FF",
- "color-text-pink": "#FEADE3FF",
- "color-text-primary": "#DFE2E5FF",
- "color-text-purple": "#B3B0FEFF",
- "color-text-red": "#FFB2B8FF",
- "color-text-secondary": "#AAAFB5FF",
- "color-text-teal": "#40DCCDFF",
- "color-text-yellow": "#FBCE03FF",
- "color-tint-hover": "#FFFFFFFF",
- "color-track": "#5A5E66FF",
- "color-warning": "#F2C00BFF",
- "color-warning-muted": "#E2A4003F",
- ],
- sizes: [
- "border-width": 1,
- "font-size-2xl": 24,
- "font-size-2xs": 8,
- "font-size-3xl": 29,
- "font-size-3xs": 7,
- "font-size-4xl": 35,
- "font-size-4xs": 6,
- "font-size-5xl": 42,
- "font-size-base": 14,
- "font-size-lg": 17,
- "font-size-sm": 12,
- "font-size-xl": 20,
- "font-size-xs": 10,
- "font-weight-bold": 700,
- "font-weight-medium": 500,
- "font-weight-normal": 400,
- "font-weight-semibold": 600,
- "radius-chat": 28,
- "radius-container": 12,
- "radius-element": 8,
- "radius-full": 9999,
- "radius-inner": 4,
- "radius-none": 0,
- "radius-page": 28,
- "size-element-lg": 36,
- "size-element-md": 32,
- "size-element-sm": 28,
- "spacing-0": 0,
- "spacing-0-5": 2,
- "spacing-1": 4,
- "spacing-1-5": 6,
- "spacing-10": 40,
- "spacing-11": 44,
- "spacing-12": 48,
- "spacing-2": 8,
- "spacing-3": 12,
- "spacing-4": 16,
- "spacing-5": 20,
- "spacing-6": 24,
- "spacing-7": 28,
- "spacing-8": 32,
- "spacing-9": 36,
- "text-body-leading": 1.4286,
- "text-body-size": 14,
- "text-body-weight": 400,
- "text-heading-1-leading": 1.3333,
- "text-heading-1-size": 24,
- "text-heading-1-weight": 600,
- "text-heading-2-leading": 1.4,
- "text-heading-2-size": 20,
- "text-heading-2-weight": 600,
- "text-heading-3-leading": 1.4118,
- "text-heading-3-size": 17,
- "text-heading-3-weight": 600,
- "text-heading-4-leading": 1.4286,
- "text-heading-4-size": 14,
- "text-heading-4-weight": 600,
- "text-heading-5-leading": 1.6667,
- "text-heading-5-size": 12,
- "text-heading-5-weight": 600,
- "text-heading-6-leading": 1.6,
- "text-heading-6-size": 10,
- "text-heading-6-weight": 600,
- "text-label-leading": 1.4286,
- "text-label-size": 14,
- "text-label-weight": 500,
- "text-large-leading": 1.4118,
- "text-large-size": 17,
- "text-large-weight": 600,
- "text-supporting-leading": 1.6667,
- "text-supporting-size": 12,
- "text-supporting-weight": 400,
- ],
- fonts: [
- "font-family-body": ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
- "font-family-code": ["SF Mono", "Monaco", "Consolas", "monospace"],
- "font-family-heading": ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
- ]
+extension Theme {
+ /// The `astryx` theme from @astryxdesign/core, in light and dark.
+ public static let `default` = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x0064E0FF),
+ accentMuted: Color(astryxRGBA: 0x0082FB33),
+ backgroundBlue: Color(astryxRGBA: 0x0171E333),
+ backgroundBody: Color(astryxRGBA: 0xF1F4F7FF),
+ backgroundCard: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundCyan: Color(astryxRGBA: 0x03A7D733),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0x0A131733),
+ backgroundGreen: Color(astryxRGBA: 0x24BB5E33),
+ backgroundInverted: Color(astryxRGBA: 0x0A1317FF),
+ backgroundMuted: Color(astryxRGBA: 0x0536590C),
+ backgroundOrange: Color(astryxRGBA: 0xF2790233),
+ backgroundPink: Color(astryxRGBA: 0xE638B333),
+ backgroundPopover: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundPurple: Color(astryxRGBA: 0x7952FF33),
+ backgroundRed: Color(astryxRGBA: 0xE3193B33),
+ backgroundSurface: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundTeal: Color(astryxRGBA: 0x0DB7AF33),
+ backgroundYellow: Color(astryxRGBA: 0xE2A40033),
+ border: Color(astryxRGBA: 0x05365919),
+ borderBlue: Color(astryxRGBA: 0x0064E0FF),
+ borderCyan: Color(astryxRGBA: 0x089DD0FF),
+ borderEmphasized: Color(astryxRGBA: 0xCCD3DBFF),
+ borderGray: Color(astryxRGBA: 0x647685FF),
+ borderGreen: Color(astryxRGBA: 0x0D8626FF),
+ borderOrange: Color(astryxRGBA: 0xEB6E00FF),
+ borderPink: Color(astryxRGBA: 0xF351C0FF),
+ borderPurple: Color(astryxRGBA: 0x9081FFFF),
+ borderRed: Color(astryxRGBA: 0xE3193BFF),
+ borderTeal: Color(astryxRGBA: 0x08A3A3FF),
+ borderYellow: Color(astryxRGBA: 0xC58600FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xE3193BFF),
+ errorMuted: Color(astryxRGBA: 0xE3193B33),
+ iconAccent: Color(astryxRGBA: 0x0064E0FF),
+ iconBlue: Color(astryxRGBA: 0x0064E0FF),
+ iconCyan: Color(astryxRGBA: 0x00ACC1FF),
+ iconDisabled: Color(astryxRGBA: 0xA4B0BCFF),
+ iconGray: Color(astryxRGBA: 0x4E606FFF),
+ iconGreen: Color(astryxRGBA: 0x0D8626FF),
+ iconOrange: Color(astryxRGBA: 0xE9690BFF),
+ iconPink: Color(astryxRGBA: 0xC2185BFF),
+ iconPrimary: Color(astryxRGBA: 0x0A1317FF),
+ iconPurple: Color(astryxRGBA: 0x5B08D8FF),
+ iconRed: Color(astryxRGBA: 0xD31130FF),
+ iconSecondary: Color(astryxRGBA: 0x4E606FFF),
+ iconTeal: Color(astryxRGBA: 0x009688FF),
+ iconYellow: Color(astryxRGBA: 0xFBC02DFF),
+ neutral: Color(astryxRGBA: 0x0536591A),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0xFFFFFFFF),
+ onLight: Color(astryxRGBA: 0x000000FF),
+ onSuccess: Color(astryxRGBA: 0xFFFFFFFF),
+ onWarning: Color(astryxRGBA: 0x0A1317FF),
+ overlay: Color(astryxRGBA: 0x01122866),
+ overlayHover: Color(astryxRGBA: 0x0536590C),
+ overlayPressed: Color(astryxRGBA: 0x05365919),
+ shadow: Color(astryxRGBA: 0x0536591A),
+ skeleton: Color(astryxRGBA: 0xCCD3DBFF),
+ success: Color(astryxRGBA: 0x0D8626FF),
+ successMuted: Color(astryxRGBA: 0x0B991F33),
+ syntaxAdded: Color(astryxRGBA: 0x0B991F0D),
+ syntaxAddedMarker: Color(astryxRGBA: 0x09441FFF),
+ syntaxAttribute: Color(astryxRGBA: 0x083943FF),
+ syntaxBackground: Color(astryxRGBA: 0x0536590C),
+ syntaxComment: Color(astryxRGBA: 0x4E606FFF),
+ syntaxConstant: Color(astryxRGBA: 0x6B2203FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x0536590C),
+ syntaxFunction: Color(astryxRGBA: 0x042F97FF),
+ syntaxKeyword: Color(astryxRGBA: 0x0064E0FF),
+ syntaxNumber: Color(astryxRGBA: 0x6B2203FF),
+ syntaxOperator: Color(astryxRGBA: 0x014975FF),
+ syntaxProperty: Color(astryxRGBA: 0x014975FF),
+ syntaxPunctuation: Color(astryxRGBA: 0x4E606FFF),
+ syntaxRemoved: Color(astryxRGBA: 0xE3193B0D),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x7B0210FF),
+ syntaxString: Color(astryxRGBA: 0x09441FFF),
+ syntaxTag: Color(astryxRGBA: 0x7B0210FF),
+ syntaxType: Color(astryxRGBA: 0x3E0697FF),
+ syntaxVariable: Color(astryxRGBA: 0x0A1317FF),
+ textAccent: Color(astryxRGBA: 0x0064E0FF),
+ textBlue: Color(astryxRGBA: 0x042F97FF),
+ textCyan: Color(astryxRGBA: 0x014975FF),
+ textDisabled: Color(astryxRGBA: 0xA4B0BCFF),
+ textGray: Color(astryxRGBA: 0x0A1317FF),
+ textGreen: Color(astryxRGBA: 0x09441FFF),
+ textOrange: Color(astryxRGBA: 0x6B2203FF),
+ textPink: Color(astryxRGBA: 0x650053FF),
+ textPrimary: Color(astryxRGBA: 0x0A1317FF),
+ textPurple: Color(astryxRGBA: 0x3E0697FF),
+ textRed: Color(astryxRGBA: 0x7B0210FF),
+ textSecondary: Color(astryxRGBA: 0x4E606FFF),
+ textTeal: Color(astryxRGBA: 0x083943FF),
+ textYellow: Color(astryxRGBA: 0x753F07FF),
+ tintHover: Color(astryxRGBA: 0x000000FF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0xE9AF08FF),
+ warningMuted: Color(astryxRGBA: 0xE2A40033)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 4,
+ none: 0,
+ page: 28
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 24,
+ heading1Weight: 600,
+ heading2Leading: 1.4,
+ heading2Size: 20,
+ heading2Weight: 600,
+ heading3Leading: 1.4118,
+ heading3Size: 17,
+ heading3Weight: 600,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 600,
+ heading5Leading: 1.6667,
+ heading5Size: 12,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.4118,
+ largeSize: 17,
+ largeWeight: 600,
+ size2xl: 24,
+ size2xs: 8,
+ size3xl: 29,
+ size3xs: 7,
+ size4xl: 35,
+ size4xs: 6,
+ size5xl: 42,
+ sizeBase: 14,
+ sizeLg: 17,
+ sizeSm: 12,
+ sizeXl: 20,
+ sizeXs: 10,
+ supportingLeading: 1.6667,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x2694FEFF),
+ accentMuted: Color(astryxRGBA: 0x0082FB3F),
+ backgroundBlue: Color(astryxRGBA: 0x0171E333),
+ backgroundBody: Color(astryxRGBA: 0x111112FF),
+ backgroundCard: Color(astryxRGBA: 0x1F1F22FF),
+ backgroundCyan: Color(astryxRGBA: 0x03A7D733),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0x666A724C),
+ backgroundGreen: Color(astryxRGBA: 0x24BB5E33),
+ backgroundInverted: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundMuted: Color(astryxRGBA: 0x1111127F),
+ backgroundOrange: Color(astryxRGBA: 0xF2790233),
+ backgroundPink: Color(astryxRGBA: 0xE638B333),
+ backgroundPopover: Color(astryxRGBA: 0x28292CFF),
+ backgroundPurple: Color(astryxRGBA: 0x7952FF33),
+ backgroundRed: Color(astryxRGBA: 0xE3193B33),
+ backgroundSurface: Color(astryxRGBA: 0x1F1F22FF),
+ backgroundTeal: Color(astryxRGBA: 0x0DB7AF33),
+ backgroundYellow: Color(astryxRGBA: 0xE2A40033),
+ border: Color(astryxRGBA: 0xF2F4F619),
+ borderBlue: Color(astryxRGBA: 0x2694FEFF),
+ borderCyan: Color(astryxRGBA: 0x0171A4FF),
+ borderEmphasized: Color(astryxRGBA: 0x494D53FF),
+ borderGray: Color(astryxRGBA: 0x748695FF),
+ borderGreen: Color(astryxRGBA: 0x0B991FFF),
+ borderOrange: Color(astryxRGBA: 0xB34A01FF),
+ borderPink: Color(astryxRGBA: 0xC02294FF),
+ borderPurple: Color(astryxRGBA: 0x7340FEFF),
+ borderRed: Color(astryxRGBA: 0xF5394FFF),
+ borderTeal: Color(astryxRGBA: 0x08767DFF),
+ borderYellow: Color(astryxRGBA: 0xB47700FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xF5394FFF),
+ errorMuted: Color(astryxRGBA: 0xF5394F3F),
+ iconAccent: Color(astryxRGBA: 0x2694FEFF),
+ iconBlue: Color(astryxRGBA: 0x2694FEFF),
+ iconCyan: Color(astryxRGBA: 0x26C6DAFF),
+ iconDisabled: Color(astryxRGBA: 0x6F747CFF),
+ iconGray: Color(astryxRGBA: 0xAAAFB5FF),
+ iconGreen: Color(astryxRGBA: 0x26A756FF),
+ iconOrange: Color(astryxRGBA: 0xFB8C00FF),
+ iconPink: Color(astryxRGBA: 0xEC407AFF),
+ iconPrimary: Color(astryxRGBA: 0xDFE2E5FF),
+ iconPurple: Color(astryxRGBA: 0x7952FFFF),
+ iconRed: Color(astryxRGBA: 0xE3193BFF),
+ iconSecondary: Color(astryxRGBA: 0xAAAFB5FF),
+ iconTeal: Color(astryxRGBA: 0x26A69AFF),
+ iconYellow: Color(astryxRGBA: 0xFFEE58FF),
+ neutral: Color(astryxRGBA: 0xDFE2E533),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0xFFFFFFFF),
+ onLight: Color(astryxRGBA: 0x000000FF),
+ onSuccess: Color(astryxRGBA: 0xFFFFFFFF),
+ onWarning: Color(astryxRGBA: 0x0A1317FF),
+ overlay: Color(astryxRGBA: 0x11111299),
+ overlayHover: Color(astryxRGBA: 0xFFFFFF0C),
+ overlayPressed: Color(astryxRGBA: 0xFFFFFF19),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x5A5E66FF),
+ success: Color(astryxRGBA: 0x0D8626FF),
+ successMuted: Color(astryxRGBA: 0x0B991F3F),
+ syntaxAdded: Color(astryxRGBA: 0x0B991F10),
+ syntaxAddedMarker: Color(astryxRGBA: 0xA5F690FF),
+ syntaxAttribute: Color(astryxRGBA: 0x40DCCDFF),
+ syntaxBackground: Color(astryxRGBA: 0x1111127F),
+ syntaxComment: Color(astryxRGBA: 0xAAAFB5FF),
+ syntaxConstant: Color(astryxRGBA: 0xFDB876FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x1111127F),
+ syntaxFunction: Color(astryxRGBA: 0xAFD7FFFF),
+ syntaxKeyword: Color(astryxRGBA: 0x3E9EFBFF),
+ syntaxNumber: Color(astryxRGBA: 0xFDB876FF),
+ syntaxOperator: Color(astryxRGBA: 0xA1EEF9FF),
+ syntaxProperty: Color(astryxRGBA: 0xA1EEF9FF),
+ syntaxPunctuation: Color(astryxRGBA: 0xAAAFB5FF),
+ syntaxRemoved: Color(astryxRGBA: 0xF5394F10),
+ syntaxRemovedMarker: Color(astryxRGBA: 0xFFB2B8FF),
+ syntaxString: Color(astryxRGBA: 0xA5F690FF),
+ syntaxTag: Color(astryxRGBA: 0xFFB2B8FF),
+ syntaxType: Color(astryxRGBA: 0xB3B0FEFF),
+ syntaxVariable: Color(astryxRGBA: 0xDFE2E5FF),
+ textAccent: Color(astryxRGBA: 0x3E9EFBFF),
+ textBlue: Color(astryxRGBA: 0xAFD7FFFF),
+ textCyan: Color(astryxRGBA: 0xA1EEF9FF),
+ textDisabled: Color(astryxRGBA: 0x6F747CFF),
+ textGray: Color(astryxRGBA: 0xE7EAEDFF),
+ textGreen: Color(astryxRGBA: 0xA5F690FF),
+ textOrange: Color(astryxRGBA: 0xFDB876FF),
+ textPink: Color(astryxRGBA: 0xFEADE3FF),
+ textPrimary: Color(astryxRGBA: 0xDFE2E5FF),
+ textPurple: Color(astryxRGBA: 0xB3B0FEFF),
+ textRed: Color(astryxRGBA: 0xFFB2B8FF),
+ textSecondary: Color(astryxRGBA: 0xAAAFB5FF),
+ textTeal: Color(astryxRGBA: 0x40DCCDFF),
+ textYellow: Color(astryxRGBA: 0xFBCE03FF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xF2C00BFF),
+ warningMuted: Color(astryxRGBA: 0xE2A4003F)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 4,
+ none: 0,
+ page: 28
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 24,
+ heading1Weight: 600,
+ heading2Leading: 1.4,
+ heading2Size: 20,
+ heading2Weight: 600,
+ heading3Leading: 1.4118,
+ heading3Size: 17,
+ heading3Weight: 600,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 600,
+ heading5Leading: 1.6667,
+ heading5Size: 12,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.4118,
+ largeSize: 17,
+ largeWeight: 600,
+ size2xl: 24,
+ size2xs: 8,
+ size3xl: 29,
+ size3xs: 7,
+ size4xl: 35,
+ size4xs: 6,
+ size5xl: 42,
+ sizeBase: 14,
+ sizeLg: 17,
+ sizeSm: 12,
+ sizeXl: 20,
+ sizeXs: 10,
+ supportingLeading: 1.6667,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
)
}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift
new file mode 100644
index 0000000000..d0b2a1e985
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift
@@ -0,0 +1,493 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/theme-gothic, theme "gothic".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+extension Theme {
+ /// The `gothic` theme from @astryxdesign/theme-gothic, in light and dark.
+ public static let gothic = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xE8F1F6FF),
+ accentMuted: Color(astryxRGBA: 0xE8F1F620),
+ backgroundBlue: Color(astryxRGBA: 0xA3B5D6FF),
+ backgroundBody: Color(astryxRGBA: 0x101314FF),
+ backgroundCard: Color(astryxRGBA: 0x191D20FF),
+ backgroundCyan: Color(astryxRGBA: 0xA3C2CFFF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0x3E454BFF),
+ backgroundGreen: Color(astryxRGBA: 0xB3C79AFF),
+ backgroundInverted: Color(astryxRGBA: 0xE8F1F6FF),
+ backgroundMuted: Color(astryxRGBA: 0x24292DFF),
+ backgroundOrange: Color(astryxRGBA: 0xD3B89AFF),
+ backgroundPink: Color(astryxRGBA: 0xC89AABFF),
+ backgroundPopover: Color(astryxRGBA: 0x24292DFF),
+ backgroundPurple: Color(astryxRGBA: 0xB29BC4FF),
+ backgroundRed: Color(astryxRGBA: 0xC6A6A2FF),
+ backgroundSurface: Color(astryxRGBA: 0x101314FF),
+ backgroundTeal: Color(astryxRGBA: 0xA3C2B6FF),
+ backgroundYellow: Color(astryxRGBA: 0xD3C490FF),
+ border: Color(astryxRGBA: 0xE8F1F61A),
+ borderBlue: Color(astryxRGBA: 0x8696B8FF),
+ borderCyan: Color(astryxRGBA: 0x86A4B1FF),
+ borderEmphasized: Color(astryxRGBA: 0x495056FF),
+ borderGray: Color(astryxRGBA: 0x5E676EFF),
+ borderGreen: Color(astryxRGBA: 0x96A880FF),
+ borderOrange: Color(astryxRGBA: 0xB6987DFF),
+ borderPink: Color(astryxRGBA: 0xAA7D8EFF),
+ borderPurple: Color(astryxRGBA: 0x947DA6FF),
+ borderRed: Color(astryxRGBA: 0xA48581FF),
+ borderTeal: Color(astryxRGBA: 0x86A499FF),
+ borderYellow: Color(astryxRGBA: 0xB6A775FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xC6A6A2FF),
+ errorMuted: Color(astryxRGBA: 0xC6A6A2FF),
+ iconAccent: Color(astryxRGBA: 0xE8F1F6FF),
+ iconBlue: Color(astryxRGBA: 0x2A3B6EFF),
+ iconCyan: Color(astryxRGBA: 0x2A5E75FF),
+ iconDisabled: Color(astryxRGBA: 0x495056FF),
+ iconGray: Color(astryxRGBA: 0xE8F1F6FF),
+ iconGreen: Color(astryxRGBA: 0x3A5E2CFF),
+ iconOrange: Color(astryxRGBA: 0x8A4818FF),
+ iconPink: Color(astryxRGBA: 0x8D2D4CFF),
+ iconPrimary: Color(astryxRGBA: 0xE8F1F6FF),
+ iconPurple: Color(astryxRGBA: 0x5A2370FF),
+ iconRed: Color(astryxRGBA: 0x5E3A35FF),
+ iconSecondary: Color(astryxRGBA: 0x96A0ABFF),
+ iconTeal: Color(astryxRGBA: 0x1F5E52FF),
+ iconYellow: Color(astryxRGBA: 0x876515FF),
+ neutral: Color(astryxRGBA: 0xE8F1F61A),
+ onAccent: Color(astryxRGBA: 0x101314FF),
+ onDark: Color(astryxRGBA: 0xE8F1F6FF),
+ onError: Color(astryxRGBA: 0x101314FF),
+ onLight: Color(astryxRGBA: 0x101314FF),
+ onSuccess: Color(astryxRGBA: 0x101314FF),
+ onWarning: Color(astryxRGBA: 0x101314FF),
+ overlay: Color(astryxRGBA: 0x101314CC),
+ overlayHover: Color(astryxRGBA: 0xE8F1F60D),
+ overlayPressed: Color(astryxRGBA: 0xE8F1F61A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x495056FF),
+ success: Color(astryxRGBA: 0xB3C79AFF),
+ successMuted: Color(astryxRGBA: 0xB3C79AFF),
+ syntaxAdded: Color(astryxRGBA: 0x071607FF),
+ syntaxAddedMarker: Color(astryxRGBA: 0xA3C987FF),
+ syntaxAttribute: Color(astryxRGBA: 0xDEC074FF),
+ syntaxBackground: Color(astryxRGBA: 0x101314FF),
+ syntaxComment: Color(astryxRGBA: 0x7E8791FF),
+ syntaxConstant: Color(astryxRGBA: 0xE6B85EFF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x8AA1D8FF),
+ syntaxKeyword: Color(astryxRGBA: 0xC39ADBFF),
+ syntaxNumber: Color(astryxRGBA: 0xDEC074FF),
+ syntaxOperator: Color(astryxRGBA: 0x96A0ABFF),
+ syntaxProperty: Color(astryxRGBA: 0x7CC5B3FF),
+ syntaxPunctuation: Color(astryxRGBA: 0x7E8791FF),
+ syntaxRemoved: Color(astryxRGBA: 0x220806FF),
+ syntaxRemovedMarker: Color(astryxRGBA: 0xD97580FF),
+ syntaxString: Color(astryxRGBA: 0xA3C987FF),
+ syntaxTag: Color(astryxRGBA: 0xD97580FF),
+ syntaxType: Color(astryxRGBA: 0xC39ADBFF),
+ syntaxVariable: Color(astryxRGBA: 0xE8F1F6FF),
+ textAccent: Color(astryxRGBA: 0xE8F1F6FF),
+ textBlue: Color(astryxRGBA: 0x1F2C54FF),
+ textCyan: Color(astryxRGBA: 0x204858FF),
+ textDisabled: Color(astryxRGBA: 0x495056FF),
+ textGray: Color(astryxRGBA: 0xE8F1F6FF),
+ textGreen: Color(astryxRGBA: 0x244023FF),
+ textOrange: Color(astryxRGBA: 0x6E3812FF),
+ textPink: Color(astryxRGBA: 0x5C182FFF),
+ textPrimary: Color(astryxRGBA: 0xE8F1F6FF),
+ textPurple: Color(astryxRGBA: 0x481B58FF),
+ textRed: Color(astryxRGBA: 0x4A2520FF),
+ textSecondary: Color(astryxRGBA: 0x96A0ABFF),
+ textTeal: Color(astryxRGBA: 0x174A40FF),
+ textYellow: Color(astryxRGBA: 0x573F0BFF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0xD3C490FF),
+ warningMuted: Color(astryxRGBA: 0xD3C490FF)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 4,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.5,
+ bodySize: 16,
+ bodyWeight: 400,
+ familyBody: ["Fustat", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Fustat", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.4194,
+ heading1Size: 31,
+ heading1Weight: 600,
+ heading2Leading: 1.44,
+ heading2Size: 25,
+ heading2Weight: 600,
+ heading3Leading: 1.4,
+ heading3Size: 20,
+ heading3Weight: 700,
+ heading4Leading: 1.5,
+ heading4Size: 16,
+ heading4Weight: 700,
+ heading5Leading: 1.5385,
+ heading5Size: 13,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.5,
+ labelSize: 16,
+ labelWeight: 500,
+ largeLeading: 1.4,
+ largeSize: 20,
+ largeWeight: 600,
+ size2xl: 31,
+ size2xs: 8,
+ size3xl: 39,
+ size3xs: 7,
+ size4xl: 49,
+ size4xs: 5,
+ size5xl: 61,
+ sizeBase: 16,
+ sizeLg: 20,
+ sizeSm: 13,
+ sizeXl: 25,
+ sizeXs: 10,
+ supportingLeading: 1.5385,
+ supportingSize: 13,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xE8F1F6FF),
+ accentMuted: Color(astryxRGBA: 0xE8F1F620),
+ backgroundBlue: Color(astryxRGBA: 0xA3B5D6FF),
+ backgroundBody: Color(astryxRGBA: 0x101314FF),
+ backgroundCard: Color(astryxRGBA: 0x191D20FF),
+ backgroundCyan: Color(astryxRGBA: 0xA3C2CFFF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0x3E454BFF),
+ backgroundGreen: Color(astryxRGBA: 0xB3C79AFF),
+ backgroundInverted: Color(astryxRGBA: 0xE8F1F6FF),
+ backgroundMuted: Color(astryxRGBA: 0x24292DFF),
+ backgroundOrange: Color(astryxRGBA: 0xD3B89AFF),
+ backgroundPink: Color(astryxRGBA: 0xC89AABFF),
+ backgroundPopover: Color(astryxRGBA: 0x24292DFF),
+ backgroundPurple: Color(astryxRGBA: 0xB29BC4FF),
+ backgroundRed: Color(astryxRGBA: 0xC6A6A2FF),
+ backgroundSurface: Color(astryxRGBA: 0x101314FF),
+ backgroundTeal: Color(astryxRGBA: 0xA3C2B6FF),
+ backgroundYellow: Color(astryxRGBA: 0xD3C490FF),
+ border: Color(astryxRGBA: 0xE8F1F61A),
+ borderBlue: Color(astryxRGBA: 0x8696B8FF),
+ borderCyan: Color(astryxRGBA: 0x86A4B1FF),
+ borderEmphasized: Color(astryxRGBA: 0x495056FF),
+ borderGray: Color(astryxRGBA: 0x5E676EFF),
+ borderGreen: Color(astryxRGBA: 0x96A880FF),
+ borderOrange: Color(astryxRGBA: 0xB6987DFF),
+ borderPink: Color(astryxRGBA: 0xAA7D8EFF),
+ borderPurple: Color(astryxRGBA: 0x947DA6FF),
+ borderRed: Color(astryxRGBA: 0xA48581FF),
+ borderTeal: Color(astryxRGBA: 0x86A499FF),
+ borderYellow: Color(astryxRGBA: 0xB6A775FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xC6A6A2FF),
+ errorMuted: Color(astryxRGBA: 0xC6A6A2FF),
+ iconAccent: Color(astryxRGBA: 0xE8F1F6FF),
+ iconBlue: Color(astryxRGBA: 0x2A3B6EFF),
+ iconCyan: Color(astryxRGBA: 0x2A5E75FF),
+ iconDisabled: Color(astryxRGBA: 0x495056FF),
+ iconGray: Color(astryxRGBA: 0xE8F1F6FF),
+ iconGreen: Color(astryxRGBA: 0x3A5E2CFF),
+ iconOrange: Color(astryxRGBA: 0x8A4818FF),
+ iconPink: Color(astryxRGBA: 0x8D2D4CFF),
+ iconPrimary: Color(astryxRGBA: 0xE8F1F6FF),
+ iconPurple: Color(astryxRGBA: 0x5A2370FF),
+ iconRed: Color(astryxRGBA: 0x5E3A35FF),
+ iconSecondary: Color(astryxRGBA: 0x96A0ABFF),
+ iconTeal: Color(astryxRGBA: 0x1F5E52FF),
+ iconYellow: Color(astryxRGBA: 0x876515FF),
+ neutral: Color(astryxRGBA: 0xE8F1F61A),
+ onAccent: Color(astryxRGBA: 0x101314FF),
+ onDark: Color(astryxRGBA: 0xE8F1F6FF),
+ onError: Color(astryxRGBA: 0x101314FF),
+ onLight: Color(astryxRGBA: 0x101314FF),
+ onSuccess: Color(astryxRGBA: 0x101314FF),
+ onWarning: Color(astryxRGBA: 0x101314FF),
+ overlay: Color(astryxRGBA: 0x101314CC),
+ overlayHover: Color(astryxRGBA: 0xE8F1F60D),
+ overlayPressed: Color(astryxRGBA: 0xE8F1F61A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x495056FF),
+ success: Color(astryxRGBA: 0xB3C79AFF),
+ successMuted: Color(astryxRGBA: 0xB3C79AFF),
+ syntaxAdded: Color(astryxRGBA: 0x071607FF),
+ syntaxAddedMarker: Color(astryxRGBA: 0xA3C987FF),
+ syntaxAttribute: Color(astryxRGBA: 0xDEC074FF),
+ syntaxBackground: Color(astryxRGBA: 0x101314FF),
+ syntaxComment: Color(astryxRGBA: 0x7E8791FF),
+ syntaxConstant: Color(astryxRGBA: 0xE6B85EFF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x8AA1D8FF),
+ syntaxKeyword: Color(astryxRGBA: 0xC39ADBFF),
+ syntaxNumber: Color(astryxRGBA: 0xDEC074FF),
+ syntaxOperator: Color(astryxRGBA: 0x96A0ABFF),
+ syntaxProperty: Color(astryxRGBA: 0x7CC5B3FF),
+ syntaxPunctuation: Color(astryxRGBA: 0x7E8791FF),
+ syntaxRemoved: Color(astryxRGBA: 0x220806FF),
+ syntaxRemovedMarker: Color(astryxRGBA: 0xD97580FF),
+ syntaxString: Color(astryxRGBA: 0xA3C987FF),
+ syntaxTag: Color(astryxRGBA: 0xD97580FF),
+ syntaxType: Color(astryxRGBA: 0xC39ADBFF),
+ syntaxVariable: Color(astryxRGBA: 0xE8F1F6FF),
+ textAccent: Color(astryxRGBA: 0xE8F1F6FF),
+ textBlue: Color(astryxRGBA: 0x1F2C54FF),
+ textCyan: Color(astryxRGBA: 0x204858FF),
+ textDisabled: Color(astryxRGBA: 0x495056FF),
+ textGray: Color(astryxRGBA: 0xE8F1F6FF),
+ textGreen: Color(astryxRGBA: 0x244023FF),
+ textOrange: Color(astryxRGBA: 0x6E3812FF),
+ textPink: Color(astryxRGBA: 0x5C182FFF),
+ textPrimary: Color(astryxRGBA: 0xE8F1F6FF),
+ textPurple: Color(astryxRGBA: 0x481B58FF),
+ textRed: Color(astryxRGBA: 0x4A2520FF),
+ textSecondary: Color(astryxRGBA: 0x96A0ABFF),
+ textTeal: Color(astryxRGBA: 0x174A40FF),
+ textYellow: Color(astryxRGBA: 0x573F0BFF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xD3C490FF),
+ warningMuted: Color(astryxRGBA: 0xD3C490FF)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 4,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.5,
+ bodySize: 16,
+ bodyWeight: 400,
+ familyBody: ["Fustat", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Fustat", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.4194,
+ heading1Size: 31,
+ heading1Weight: 600,
+ heading2Leading: 1.44,
+ heading2Size: 25,
+ heading2Weight: 600,
+ heading3Leading: 1.4,
+ heading3Size: 20,
+ heading3Weight: 700,
+ heading4Leading: 1.5,
+ heading4Size: 16,
+ heading4Weight: 700,
+ heading5Leading: 1.5385,
+ heading5Size: 13,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.5,
+ labelSize: 16,
+ labelWeight: 500,
+ largeLeading: 1.4,
+ largeSize: 20,
+ largeWeight: 600,
+ size2xl: 31,
+ size2xs: 8,
+ size3xl: 39,
+ size3xs: 7,
+ size4xl: 49,
+ size4xs: 5,
+ size5xl: 61,
+ sizeBase: 16,
+ sizeLg: 20,
+ sizeSm: 13,
+ sizeXl: 25,
+ sizeXs: 10,
+ supportingLeading: 1.5385,
+ supportingSize: 13,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
+ )
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift
new file mode 100644
index 0000000000..9257b09ccb
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift
@@ -0,0 +1,493 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/theme-matcha, theme "matcha".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+extension Theme {
+ /// The `matcha` theme from @astryxdesign/theme-matcha, in light and dark.
+ public static let matcha = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x3E481DFF),
+ accentMuted: Color(astryxRGBA: 0x3E481D14),
+ backgroundBlue: Color(astryxRGBA: 0x3A5E8C33),
+ backgroundBody: Color(astryxRGBA: 0xF0F0E0FF),
+ backgroundCard: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundCyan: Color(astryxRGBA: 0x3A7C7C33),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0x707E4633),
+ backgroundGreen: Color(astryxRGBA: 0x4D990033),
+ backgroundInverted: Color(astryxRGBA: 0x3E481DFF),
+ backgroundMuted: Color(astryxRGBA: 0xF0F0E0FF),
+ backgroundOrange: Color(astryxRGBA: 0xC4762033),
+ backgroundPink: Color(astryxRGBA: 0xC44A7033),
+ backgroundPopover: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundPurple: Color(astryxRGBA: 0x6B4A8C33),
+ backgroundRed: Color(astryxRGBA: 0xFD000033),
+ backgroundSurface: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundTeal: Color(astryxRGBA: 0x2E6B5A33),
+ backgroundYellow: Color(astryxRGBA: 0xF2C00033),
+ border: Color(astryxRGBA: 0xDCE3CEFF),
+ borderBlue: Color(astryxRGBA: 0x3A5E8CFF),
+ borderCyan: Color(astryxRGBA: 0x3A7C7CFF),
+ borderEmphasized: Color(astryxRGBA: 0xB7C29EFF),
+ borderGray: Color(astryxRGBA: 0x707E46FF),
+ borderGreen: Color(astryxRGBA: 0x4D9900FF),
+ borderOrange: Color(astryxRGBA: 0xC47620FF),
+ borderPink: Color(astryxRGBA: 0xC44A70FF),
+ borderPurple: Color(astryxRGBA: 0x6B4A8CFF),
+ borderRed: Color(astryxRGBA: 0xFD0000FF),
+ borderTeal: Color(astryxRGBA: 0x2E6B5AFF),
+ borderYellow: Color(astryxRGBA: 0xF2C000FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFD0000FF),
+ errorMuted: Color(astryxRGBA: 0xFD000020),
+ iconAccent: Color(astryxRGBA: 0x3E481DFF),
+ iconBlue: Color(astryxRGBA: 0x3A5E8CFF),
+ iconCyan: Color(astryxRGBA: 0x3A7C7CFF),
+ iconDisabled: Color(astryxRGBA: 0xC0CBA9FF),
+ iconGray: Color(astryxRGBA: 0x707E46FF),
+ iconGreen: Color(astryxRGBA: 0x4D9900FF),
+ iconOrange: Color(astryxRGBA: 0xC47620FF),
+ iconPink: Color(astryxRGBA: 0xC44A70FF),
+ iconPrimary: Color(astryxRGBA: 0x3E481DFF),
+ iconPurple: Color(astryxRGBA: 0x6B4A8CFF),
+ iconRed: Color(astryxRGBA: 0xFD0000FF),
+ iconSecondary: Color(astryxRGBA: 0x707E46FF),
+ iconTeal: Color(astryxRGBA: 0x2E6B5AFF),
+ iconYellow: Color(astryxRGBA: 0xF2C000FF),
+ neutral: Color(astryxRGBA: 0x3E481D0F),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0xFFFFFFFF),
+ onLight: Color(astryxRGBA: 0x3E481DFF),
+ onSuccess: Color(astryxRGBA: 0xFFFFFFFF),
+ onWarning: Color(astryxRGBA: 0x3E481DFF),
+ overlay: Color(astryxRGBA: 0x3E481D80),
+ overlayHover: Color(astryxRGBA: 0x3E481D0D),
+ overlayPressed: Color(astryxRGBA: 0x3E481D1A),
+ shadow: Color(astryxRGBA: 0x3E481D1A),
+ skeleton: Color(astryxRGBA: 0xC0CBA9FF),
+ success: Color(astryxRGBA: 0x4D9900FF),
+ successMuted: Color(astryxRGBA: 0x4D990020),
+ syntaxAdded: Color(astryxRGBA: 0x4D990008),
+ syntaxAddedMarker: Color(astryxRGBA: 0x5A6B2AFF),
+ syntaxAttribute: Color(astryxRGBA: 0x7C5E3AFF),
+ syntaxBackground: Color(astryxRGBA: 0xF0F0E0FF),
+ syntaxComment: Color(astryxRGBA: 0x707E46FF),
+ syntaxConstant: Color(astryxRGBA: 0x836700FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x3A5E8CFF),
+ syntaxKeyword: Color(astryxRGBA: 0x5A6B2AFF),
+ syntaxNumber: Color(astryxRGBA: 0x836700FF),
+ syntaxOperator: Color(astryxRGBA: 0x707E46FF),
+ syntaxProperty: Color(astryxRGBA: 0x3A7C6BFF),
+ syntaxPunctuation: Color(astryxRGBA: 0x5A6B2AFF),
+ syntaxRemoved: Color(astryxRGBA: 0xFD000008),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x5A6B2AFF),
+ syntaxString: Color(astryxRGBA: 0x2E6B5AFF),
+ syntaxTag: Color(astryxRGBA: 0x8C3A3AFF),
+ syntaxType: Color(astryxRGBA: 0x6B4A8CFF),
+ syntaxVariable: Color(astryxRGBA: 0x3E481DFF),
+ textAccent: Color(astryxRGBA: 0x3E481DFF),
+ textBlue: Color(astryxRGBA: 0x2E4A6EFF),
+ textCyan: Color(astryxRGBA: 0x2E6060FF),
+ textDisabled: Color(astryxRGBA: 0xC0CBA9FF),
+ textGray: Color(astryxRGBA: 0x3E481DFF),
+ textGreen: Color(astryxRGBA: 0x3D7A00FF),
+ textOrange: Color(astryxRGBA: 0xA06018FF),
+ textPink: Color(astryxRGBA: 0xA03A5AFF),
+ textPrimary: Color(astryxRGBA: 0x3E481DFF),
+ textPurple: Color(astryxRGBA: 0x553A70FF),
+ textRed: Color(astryxRGBA: 0xCC0000FF),
+ textSecondary: Color(astryxRGBA: 0x707E46FF),
+ textTeal: Color(astryxRGBA: 0x245546FF),
+ textYellow: Color(astryxRGBA: 0xC19800FF),
+ tintHover: Color(astryxRGBA: 0x000000FF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0xF2C000FF),
+ warningMuted: Color(astryxRGBA: 0xF2C00020)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 3,
+ s1: 6,
+ s1_5: 9,
+ s10: 60,
+ s11: 66,
+ s12: 72,
+ s2: 12,
+ s3: 18,
+ s4: 24,
+ s5: 30,
+ s6: 36,
+ s7: 42,
+ s8: 48,
+ s9: 54
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 18,
+ element: 12,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 42
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 44,
+ elementMd: 40,
+ elementSm: 36
+ ),
+ font: FontTokens(
+ bodyLeading: 1.5,
+ bodySize: 16,
+ bodyWeight: 400,
+ familyBody: ["DM Sans", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Playwrite US Trad", "Georgia", "Times New Roman", "Times", "serif"],
+ heading1Leading: 1.4194,
+ heading1Size: 31,
+ heading1Weight: 600,
+ heading2Leading: 1.44,
+ heading2Size: 25,
+ heading2Weight: 600,
+ heading3Leading: 1.4,
+ heading3Size: 20,
+ heading3Weight: 600,
+ heading4Leading: 1.5,
+ heading4Size: 16,
+ heading4Weight: 600,
+ heading5Leading: 1.5385,
+ heading5Size: 13,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.5,
+ labelSize: 16,
+ labelWeight: 500,
+ largeLeading: 1.4,
+ largeSize: 20,
+ largeWeight: 600,
+ size2xl: 31,
+ size2xs: 8,
+ size3xl: 39,
+ size3xs: 7,
+ size4xl: 49,
+ size4xs: 5,
+ size5xl: 61,
+ sizeBase: 16,
+ sizeLg: 20,
+ sizeSm: 13,
+ sizeXl: 25,
+ sizeXs: 10,
+ supportingLeading: 1.5385,
+ supportingSize: 13,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xC0CBA9FF),
+ accentMuted: Color(astryxRGBA: 0xC0CBA920),
+ backgroundBlue: Color(astryxRGBA: 0x3A5E8C33),
+ backgroundBody: Color(astryxRGBA: 0x12140EFF),
+ backgroundCard: Color(astryxRGBA: 0x1E2016FF),
+ backgroundCyan: Color(astryxRGBA: 0x3A7C7C33),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0x5A644033),
+ backgroundGreen: Color(astryxRGBA: 0x6DBF2A33),
+ backgroundInverted: Color(astryxRGBA: 0xC0CBA9FF),
+ backgroundMuted: Color(astryxRGBA: 0x3E481DFF),
+ backgroundOrange: Color(astryxRGBA: 0xD4903A33),
+ backgroundPink: Color(astryxRGBA: 0xE07A9A33),
+ backgroundPopover: Color(astryxRGBA: 0x3E481DFF),
+ backgroundPurple: Color(astryxRGBA: 0xB08ED433),
+ backgroundRed: Color(astryxRGBA: 0xFF5C5C33),
+ backgroundSurface: Color(astryxRGBA: 0x1A1C14FF),
+ backgroundTeal: Color(astryxRGBA: 0x5AB89833),
+ backgroundYellow: Color(astryxRGBA: 0xF6D06633),
+ border: Color(astryxRGBA: 0xC0CBA91A),
+ borderBlue: Color(astryxRGBA: 0x7BA8D4FF),
+ borderCyan: Color(astryxRGBA: 0x70C4C4FF),
+ borderEmphasized: Color(astryxRGBA: 0x5A6440FF),
+ borderGray: Color(astryxRGBA: 0x707E46FF),
+ borderGreen: Color(astryxRGBA: 0x6DBF2AFF),
+ borderOrange: Color(astryxRGBA: 0xD4903AFF),
+ borderPink: Color(astryxRGBA: 0xE07A9AFF),
+ borderPurple: Color(astryxRGBA: 0xB08ED4FF),
+ borderRed: Color(astryxRGBA: 0xFF5C5CFF),
+ borderTeal: Color(astryxRGBA: 0x5AB898FF),
+ borderYellow: Color(astryxRGBA: 0xF6D066FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFF5C5CFF),
+ errorMuted: Color(astryxRGBA: 0xFF5C5C20),
+ iconAccent: Color(astryxRGBA: 0xC0CBA9FF),
+ iconBlue: Color(astryxRGBA: 0x7BA8D4FF),
+ iconCyan: Color(astryxRGBA: 0x70C4C4FF),
+ iconDisabled: Color(astryxRGBA: 0x5A6440FF),
+ iconGray: Color(astryxRGBA: 0x94A468FF),
+ iconGreen: Color(astryxRGBA: 0x6DBF2AFF),
+ iconOrange: Color(astryxRGBA: 0xD4903AFF),
+ iconPink: Color(astryxRGBA: 0xE07A9AFF),
+ iconPrimary: Color(astryxRGBA: 0xC0CBA9FF),
+ iconPurple: Color(astryxRGBA: 0xB08ED4FF),
+ iconRed: Color(astryxRGBA: 0xFF5C5CFF),
+ iconSecondary: Color(astryxRGBA: 0x94A468FF),
+ iconTeal: Color(astryxRGBA: 0x5AB898FF),
+ iconYellow: Color(astryxRGBA: 0xF6D066FF),
+ neutral: Color(astryxRGBA: 0xC0CBA91A),
+ onAccent: Color(astryxRGBA: 0x3E481DFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0x3E481DFF),
+ onLight: Color(astryxRGBA: 0x3E481DFF),
+ onSuccess: Color(astryxRGBA: 0x3E481DFF),
+ onWarning: Color(astryxRGBA: 0x3E481DFF),
+ overlay: Color(astryxRGBA: 0x3E481DCC),
+ overlayHover: Color(astryxRGBA: 0xC0CBA90D),
+ overlayPressed: Color(astryxRGBA: 0xC0CBA91A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x5A6440FF),
+ success: Color(astryxRGBA: 0x6DBF2AFF),
+ successMuted: Color(astryxRGBA: 0x6DBF2A20),
+ syntaxAdded: Color(astryxRGBA: 0x6DBF2A08),
+ syntaxAddedMarker: Color(astryxRGBA: 0x92AF6AFF),
+ syntaxAttribute: Color(astryxRGBA: 0xD1A500FF),
+ syntaxBackground: Color(astryxRGBA: 0x1A1C14FF),
+ syntaxComment: Color(astryxRGBA: 0x707E46FF),
+ syntaxConstant: Color(astryxRGBA: 0xE0B318FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x7BA8D4FF),
+ syntaxKeyword: Color(astryxRGBA: 0xA8BF6AFF),
+ syntaxNumber: Color(astryxRGBA: 0xE0B318FF),
+ syntaxOperator: Color(astryxRGBA: 0x94A468FF),
+ syntaxProperty: Color(astryxRGBA: 0x6CCAAAFF),
+ syntaxPunctuation: Color(astryxRGBA: 0x92AF6AFF),
+ syntaxRemoved: Color(astryxRGBA: 0xFF5C5C08),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x92AF6AFF),
+ syntaxString: Color(astryxRGBA: 0x6CCAAAFF),
+ syntaxTag: Color(astryxRGBA: 0xD47A7AFF),
+ syntaxType: Color(astryxRGBA: 0xB08ED4FF),
+ syntaxVariable: Color(astryxRGBA: 0xC0CBA9FF),
+ textAccent: Color(astryxRGBA: 0xC0CBA9FF),
+ textBlue: Color(astryxRGBA: 0x8DBCE0FF),
+ textCyan: Color(astryxRGBA: 0x82D4D4FF),
+ textDisabled: Color(astryxRGBA: 0x5A6440FF),
+ textGray: Color(astryxRGBA: 0xC0CBA9FF),
+ textGreen: Color(astryxRGBA: 0x80D43AFF),
+ textOrange: Color(astryxRGBA: 0xE0A04AFF),
+ textPink: Color(astryxRGBA: 0xF08AAAFF),
+ textPrimary: Color(astryxRGBA: 0xC0CBA9FF),
+ textPurple: Color(astryxRGBA: 0xC0A0E0FF),
+ textRed: Color(astryxRGBA: 0xFF7A7AFF),
+ textSecondary: Color(astryxRGBA: 0x94A468FF),
+ textTeal: Color(astryxRGBA: 0x6CCAAAFF),
+ textYellow: Color(astryxRGBA: 0xFFE08BFF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xF6D066FF),
+ warningMuted: Color(astryxRGBA: 0xF6D06620)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 3,
+ s1: 6,
+ s1_5: 9,
+ s10: 60,
+ s11: 66,
+ s12: 72,
+ s2: 12,
+ s3: 18,
+ s4: 24,
+ s5: 30,
+ s6: 36,
+ s7: 42,
+ s8: 48,
+ s9: 54
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 18,
+ element: 12,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 42
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 44,
+ elementMd: 40,
+ elementSm: 36
+ ),
+ font: FontTokens(
+ bodyLeading: 1.5,
+ bodySize: 16,
+ bodyWeight: 400,
+ familyBody: ["DM Sans", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Playwrite US Trad", "Georgia", "Times New Roman", "Times", "serif"],
+ heading1Leading: 1.4194,
+ heading1Size: 31,
+ heading1Weight: 600,
+ heading2Leading: 1.44,
+ heading2Size: 25,
+ heading2Weight: 600,
+ heading3Leading: 1.4,
+ heading3Size: 20,
+ heading3Weight: 600,
+ heading4Leading: 1.5,
+ heading4Size: 16,
+ heading4Weight: 600,
+ heading5Leading: 1.5385,
+ heading5Size: 13,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.5,
+ labelSize: 16,
+ labelWeight: 500,
+ largeLeading: 1.4,
+ largeSize: 20,
+ largeWeight: 600,
+ size2xl: 31,
+ size2xs: 8,
+ size3xl: 39,
+ size3xs: 7,
+ size4xl: 49,
+ size4xs: 5,
+ size5xl: 61,
+ sizeBase: 16,
+ sizeLg: 20,
+ sizeSm: 13,
+ sizeXl: 25,
+ sizeXs: 10,
+ supportingLeading: 1.5385,
+ supportingSize: 13,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
+ )
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift
new file mode 100644
index 0000000000..d142046e9c
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift
@@ -0,0 +1,493 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/theme-neutral, theme "neutral".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+extension Theme {
+ /// The `neutral` theme from @astryxdesign/theme-neutral, in light and dark.
+ public static let neutral = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x1B1B1BFF),
+ accentMuted: Color(astryxRGBA: 0xF1F1F1FF),
+ backgroundBlue: Color(astryxRGBA: 0xB9D7FFFF),
+ backgroundBody: Color(astryxRGBA: 0xF1F1F1FF),
+ backgroundCard: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundCyan: Color(astryxRGBA: 0x9AE2F4FF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0xE2E2E2FF),
+ backgroundGreen: Color(astryxRGBA: 0xBCE0BBFF),
+ backgroundInverted: Color(astryxRGBA: 0x0A1317FF),
+ backgroundMuted: Color(astryxRGBA: 0xF1F1F1FF),
+ backgroundOrange: Color(astryxRGBA: 0xFFC7A1FF),
+ backgroundPink: Color(astryxRGBA: 0xFFC0D7FF),
+ backgroundPopover: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundPurple: Color(astryxRGBA: 0xF7D5FFFF),
+ backgroundRed: Color(astryxRGBA: 0xFFC4BEFF),
+ backgroundSurface: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundTeal: Color(astryxRGBA: 0xA9E2D6FF),
+ backgroundYellow: Color(astryxRGBA: 0xFAE19EFF),
+ border: Color(astryxRGBA: 0x00000014),
+ borderBlue: Color(astryxRGBA: 0xA1CAFFFF),
+ borderCyan: Color(astryxRGBA: 0x85D5E9FF),
+ borderEmphasized: Color(astryxRGBA: 0xD4D4D4FF),
+ borderGray: Color(astryxRGBA: 0xD4D4D4FF),
+ borderGreen: Color(astryxRGBA: 0xAAD4A9FF),
+ borderOrange: Color(astryxRGBA: 0xFFC7A1FF),
+ borderPink: Color(astryxRGBA: 0xFFC0D7FF),
+ borderPurple: Color(astryxRGBA: 0xF3BFFFFF),
+ borderRed: Color(astryxRGBA: 0xFFAEA7FF),
+ borderTeal: Color(astryxRGBA: 0x90D7C8FF),
+ borderYellow: Color(astryxRGBA: 0xE3C36CFF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0x76000CFF),
+ errorMuted: Color(astryxRGBA: 0xFFC4BEFF),
+ iconAccent: Color(astryxRGBA: 0x1B1B1BFF),
+ iconBlue: Color(astryxRGBA: 0x003978FF),
+ iconCyan: Color(astryxRGBA: 0x004351FF),
+ iconDisabled: Color(astryxRGBA: 0x919191FF),
+ iconGray: Color(astryxRGBA: 0x474747FF),
+ iconGreen: Color(astryxRGBA: 0x00490BFF),
+ iconOrange: Color(astryxRGBA: 0x622700FF),
+ iconPink: Color(astryxRGBA: 0x70003FFF),
+ iconPrimary: Color(astryxRGBA: 0x000000FF),
+ iconPurple: Color(astryxRGBA: 0x5C0E6CFF),
+ iconRed: Color(astryxRGBA: 0x76000CFF),
+ iconSecondary: Color(astryxRGBA: 0x6A6A6AFF),
+ iconTeal: Color(astryxRGBA: 0x00463DFF),
+ iconYellow: Color(astryxRGBA: 0x4B3900FF),
+ neutral: Color(astryxRGBA: 0x0000000F),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0xFFFFFFFF),
+ onLight: Color(astryxRGBA: 0x111111FF),
+ onSuccess: Color(astryxRGBA: 0xFFFFFFFF),
+ onWarning: Color(astryxRGBA: 0x111111FF),
+ overlay: Color(astryxRGBA: 0x00000080),
+ overlayHover: Color(astryxRGBA: 0x0000000D),
+ overlayPressed: Color(astryxRGBA: 0x0000001A),
+ shadow: Color(astryxRGBA: 0x0000001A),
+ skeleton: Color(astryxRGBA: 0xF1F1F1FF),
+ success: Color(astryxRGBA: 0x00490BFF),
+ successMuted: Color(astryxRGBA: 0xBCE0BBFF),
+ syntaxAdded: Color(astryxRGBA: 0xBCE0BB40),
+ syntaxAddedMarker: Color(astryxRGBA: 0x6A6A6AFF),
+ syntaxAttribute: Color(astryxRGBA: 0x584400FF),
+ syntaxBackground: Color(astryxRGBA: 0xFFFFFFFF),
+ syntaxComment: Color(astryxRGBA: 0x6A6A6AFF),
+ syntaxConstant: Color(astryxRGBA: 0x733100FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x00458CFF),
+ syntaxKeyword: Color(astryxRGBA: 0x6B187CFF),
+ syntaxNumber: Color(astryxRGBA: 0x733100FF),
+ syntaxOperator: Color(astryxRGBA: 0x6A6A6AFF),
+ syntaxProperty: Color(astryxRGBA: 0x005348FF),
+ syntaxPunctuation: Color(astryxRGBA: 0x6A6A6AFF),
+ syntaxRemoved: Color(astryxRGBA: 0xFFC4BE40),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x6A6A6AFF),
+ syntaxString: Color(astryxRGBA: 0x0B5615FF),
+ syntaxTag: Color(astryxRGBA: 0x8A0011FF),
+ syntaxType: Color(astryxRGBA: 0x6B187CFF),
+ syntaxVariable: Color(astryxRGBA: 0x111111FF),
+ textAccent: Color(astryxRGBA: 0x1B1B1BFF),
+ textBlue: Color(astryxRGBA: 0x003978FF),
+ textCyan: Color(astryxRGBA: 0x004351FF),
+ textDisabled: Color(astryxRGBA: 0x919191FF),
+ textGray: Color(astryxRGBA: 0x1B1B1BFF),
+ textGreen: Color(astryxRGBA: 0x00490BFF),
+ textOrange: Color(astryxRGBA: 0x622700FF),
+ textPink: Color(astryxRGBA: 0x70003FFF),
+ textPrimary: Color(astryxRGBA: 0x000000FF),
+ textPurple: Color(astryxRGBA: 0x5C0E6CFF),
+ textRed: Color(astryxRGBA: 0x76000CFF),
+ textSecondary: Color(astryxRGBA: 0x474747FF),
+ textTeal: Color(astryxRGBA: 0x00463DFF),
+ textYellow: Color(astryxRGBA: 0x4B3900FF),
+ tintHover: Color(astryxRGBA: 0x000000FF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0x4B3900FF),
+ warningMuted: Color(astryxRGBA: 0xFAE19EFF)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 10,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 28
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["ui-monospace", "SF Mono", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"],
+ familyHeading: ["Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 24,
+ heading1Weight: 600,
+ heading2Leading: 1.4,
+ heading2Size: 20,
+ heading2Weight: 600,
+ heading3Leading: 1.4118,
+ heading3Size: 17,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.6667,
+ heading5Size: 12,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.4118,
+ largeSize: 17,
+ largeWeight: 600,
+ size2xl: 24,
+ size2xs: 8,
+ size3xl: 29,
+ size3xs: 7,
+ size4xl: 35,
+ size4xs: 6,
+ size5xl: 42,
+ sizeBase: 14,
+ sizeLg: 17,
+ sizeSm: 12,
+ sizeXl: 20,
+ sizeXs: 10,
+ supportingLeading: 1.6667,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xF1F1F1FF),
+ accentMuted: Color(astryxRGBA: 0x262626FF),
+ backgroundBlue: Color(astryxRGBA: 0x253C5AFF),
+ backgroundBody: Color(astryxRGBA: 0x1B1B1BFF),
+ backgroundCard: Color(astryxRGBA: 0x1B1B1BFF),
+ backgroundCyan: Color(astryxRGBA: 0x274046FF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0x303030FF),
+ backgroundGreen: Color(astryxRGBA: 0x2B422BFF),
+ backgroundInverted: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundMuted: Color(astryxRGBA: 0x1B1B1BFF),
+ backgroundOrange: Color(astryxRGBA: 0x503424FF),
+ backgroundPink: Color(astryxRGBA: 0x572B3DFF),
+ backgroundPopover: Color(astryxRGBA: 0x1B1B1BFF),
+ backgroundPurple: Color(astryxRGBA: 0x4A2F51FF),
+ backgroundRed: Color(astryxRGBA: 0x5B2B28FF),
+ backgroundSurface: Color(astryxRGBA: 0x262626FF),
+ backgroundTeal: Color(astryxRGBA: 0x28413CFF),
+ backgroundYellow: Color(astryxRGBA: 0x453A1CFF),
+ border: Color(astryxRGBA: 0xFFFFFF1A),
+ borderBlue: Color(astryxRGBA: 0x5AA0F8FF),
+ borderCyan: Color(astryxRGBA: 0x49ADC4FF),
+ borderEmphasized: Color(astryxRGBA: 0x525252FF),
+ borderGray: Color(astryxRGBA: 0x262626FF),
+ borderGreen: Color(astryxRGBA: 0x6AB26BFF),
+ borderOrange: Color(astryxRGBA: 0xDF843FFF),
+ borderPink: Color(astryxRGBA: 0xFC78B1FF),
+ borderPurple: Color(astryxRGBA: 0xD885EBFF),
+ borderRed: Color(astryxRGBA: 0xFA6762FF),
+ borderTeal: Color(astryxRGBA: 0x4FB1A0FF),
+ borderYellow: Color(astryxRGBA: 0xC29900FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFFC4BEFF),
+ errorMuted: Color(astryxRGBA: 0xFF98903D),
+ iconAccent: Color(astryxRGBA: 0xF1F1F1FF),
+ iconBlue: Color(astryxRGBA: 0x88BCFFFF),
+ iconCyan: Color(astryxRGBA: 0x71C7DDFF),
+ iconDisabled: Color(astryxRGBA: 0x525252FF),
+ iconGray: Color(astryxRGBA: 0x9E9E9EFF),
+ iconGreen: Color(astryxRGBA: 0x90CA90FF),
+ iconOrange: Color(astryxRGBA: 0xFF9E55FF),
+ iconPink: Color(astryxRGBA: 0xFD92BDFF),
+ iconPrimary: Color(astryxRGBA: 0xFFFFFFFF),
+ iconPurple: Color(astryxRGBA: 0xE496F6FF),
+ iconRed: Color(astryxRGBA: 0xFF9890FF),
+ iconSecondary: Color(astryxRGBA: 0x9E9E9EFF),
+ iconTeal: Color(astryxRGBA: 0x81C9BBFF),
+ iconYellow: Color(astryxRGBA: 0xE2B623FF),
+ neutral: Color(astryxRGBA: 0xFFFFFF1A),
+ onAccent: Color(astryxRGBA: 0x111111FF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0x111111FF),
+ onLight: Color(astryxRGBA: 0x111111FF),
+ onSuccess: Color(astryxRGBA: 0x111111FF),
+ onWarning: Color(astryxRGBA: 0x111111FF),
+ overlay: Color(astryxRGBA: 0x000000CC),
+ overlayHover: Color(astryxRGBA: 0xFFFFFF0D),
+ overlayPressed: Color(astryxRGBA: 0xFFFFFF1A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x525252FF),
+ success: Color(astryxRGBA: 0xA4D6A3FF),
+ successMuted: Color(astryxRGBA: 0x90CA903D),
+ syntaxAdded: Color(astryxRGBA: 0x90CA900F),
+ syntaxAddedMarker: Color(astryxRGBA: 0x9E9E9EFF),
+ syntaxAttribute: Color(astryxRGBA: 0xEEC448FF),
+ syntaxBackground: Color(astryxRGBA: 0x111111FF),
+ syntaxComment: Color(astryxRGBA: 0x9E9E9EFF),
+ syntaxConstant: Color(astryxRGBA: 0xFFB37EFF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0xA1CAFFFF),
+ syntaxKeyword: Color(astryxRGBA: 0xEFA8FFFF),
+ syntaxNumber: Color(astryxRGBA: 0xFFB37EFF),
+ syntaxOperator: Color(astryxRGBA: 0x9E9E9EFF),
+ syntaxProperty: Color(astryxRGBA: 0x90D7C8FF),
+ syntaxPunctuation: Color(astryxRGBA: 0x9E9E9EFF),
+ syntaxRemoved: Color(astryxRGBA: 0xFF98900F),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x9E9E9EFF),
+ syntaxString: Color(astryxRGBA: 0xA4D6A3FF),
+ syntaxTag: Color(astryxRGBA: 0xFFAEA7FF),
+ syntaxType: Color(astryxRGBA: 0xEFA8FFFF),
+ syntaxVariable: Color(astryxRGBA: 0xE2E2E2FF),
+ textAccent: Color(astryxRGBA: 0xF1F1F1FF),
+ textBlue: Color(astryxRGBA: 0xA1CAFFFF),
+ textCyan: Color(astryxRGBA: 0x85D5E9FF),
+ textDisabled: Color(astryxRGBA: 0x525252FF),
+ textGray: Color(astryxRGBA: 0xD4D4D4FF),
+ textGreen: Color(astryxRGBA: 0x90CA90FF),
+ textOrange: Color(astryxRGBA: 0xFFB37EFF),
+ textPink: Color(astryxRGBA: 0xFFA9CAFF),
+ textPrimary: Color(astryxRGBA: 0xFFFFFFFF),
+ textPurple: Color(astryxRGBA: 0xEAACF8FF),
+ textRed: Color(astryxRGBA: 0xFFAEA7FF),
+ textSecondary: Color(astryxRGBA: 0x9E9E9EFF),
+ textTeal: Color(astryxRGBA: 0x90D7C8FF),
+ textYellow: Color(astryxRGBA: 0xEEC448FF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xF8D36AFF),
+ warningMuted: Color(astryxRGBA: 0xE2B6233D)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 10,
+ full: 9999,
+ inner: 6,
+ none: 0,
+ page: 28
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["ui-monospace", "SF Mono", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"],
+ familyHeading: ["Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 24,
+ heading1Weight: 600,
+ heading2Leading: 1.4,
+ heading2Size: 20,
+ heading2Weight: 600,
+ heading3Leading: 1.4118,
+ heading3Size: 17,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.6667,
+ heading5Size: 12,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.4118,
+ largeSize: 17,
+ largeWeight: 600,
+ size2xl: 24,
+ size2xs: 8,
+ size3xl: 29,
+ size3xs: 7,
+ size4xl: 35,
+ size4xs: 6,
+ size5xl: 42,
+ sizeBase: 14,
+ sizeLg: 17,
+ sizeSm: 12,
+ sizeXl: 20,
+ sizeXs: 10,
+ supportingLeading: 1.6667,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
+ )
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift
new file mode 100644
index 0000000000..aa1cdf2e76
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift
@@ -0,0 +1,493 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/theme-stone, theme "stone".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+extension Theme {
+ /// The `stone` theme from @astryxdesign/theme-stone, in light and dark.
+ public static let stone = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x25252AFF),
+ accentMuted: Color(astryxRGBA: 0x25252A14),
+ backgroundBlue: Color(astryxRGBA: 0xD3E4FCFF),
+ backgroundBody: Color(astryxRGBA: 0xF0F0F7FF),
+ backgroundCard: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundCyan: Color(astryxRGBA: 0xCBE9F0FF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0xE2E2E8FF),
+ backgroundGreen: Color(astryxRGBA: 0xD2ECCFFF),
+ backgroundInverted: Color(astryxRGBA: 0x25252AFF),
+ backgroundMuted: Color(astryxRGBA: 0xE2E2E8FF),
+ backgroundOrange: Color(astryxRGBA: 0xFFDCBBFF),
+ backgroundPink: Color(astryxRGBA: 0xF5D9EAFF),
+ backgroundPopover: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundPurple: Color(astryxRGBA: 0xE7DEF5FF),
+ backgroundRed: Color(astryxRGBA: 0xFBDAD4FF),
+ backgroundSurface: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundTeal: Color(astryxRGBA: 0xD4E8E1FF),
+ backgroundYellow: Color(astryxRGBA: 0xF4E1B7FF),
+ border: Color(astryxRGBA: 0xE2E2E8FF),
+ borderBlue: Color(astryxRGBA: 0xC2D6F1FF),
+ borderCyan: Color(astryxRGBA: 0xBADBE4FF),
+ borderEmphasized: Color(astryxRGBA: 0x848489FF),
+ borderGray: Color(astryxRGBA: 0xD4D3DDFF),
+ borderGreen: Color(astryxRGBA: 0xBFDFBBFF),
+ borderOrange: Color(astryxRGBA: 0xF2CDAAFF),
+ borderPink: Color(astryxRGBA: 0xE9CADCFF),
+ borderPurple: Color(astryxRGBA: 0xD9CFEAFF),
+ borderRed: Color(astryxRGBA: 0xF0CAC4FF),
+ borderTeal: Color(astryxRGBA: 0xC3DBD2FF),
+ borderYellow: Color(astryxRGBA: 0xE7D3A4FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0x603C37FF),
+ errorMuted: Color(astryxRGBA: 0xFBDAD4FF),
+ iconAccent: Color(astryxRGBA: 0x25252AFF),
+ iconBlue: Color(astryxRGBA: 0x344861FF),
+ iconCyan: Color(astryxRGBA: 0x264D57FF),
+ iconDisabled: Color(astryxRGBA: 0xD4D3DDFF),
+ iconGray: Color(astryxRGBA: 0x46464EFF),
+ iconGreen: Color(astryxRGBA: 0x354F31FF),
+ iconOrange: Color(astryxRGBA: 0x5E3F27FF),
+ iconPink: Color(astryxRGBA: 0x5A3C4FFF),
+ iconPrimary: Color(astryxRGBA: 0x25252AFF),
+ iconPurple: Color(astryxRGBA: 0x4C405BFF),
+ iconRed: Color(astryxRGBA: 0x603C37FF),
+ iconSecondary: Color(astryxRGBA: 0x848489FF),
+ iconTeal: Color(astryxRGBA: 0x2C4F44FF),
+ iconYellow: Color(astryxRGBA: 0x524818FF),
+ neutral: Color(astryxRGBA: 0x25252A0F),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0x603C37FF),
+ onLight: Color(astryxRGBA: 0x25252AFF),
+ onSuccess: Color(astryxRGBA: 0x354F31FF),
+ onWarning: Color(astryxRGBA: 0x524818FF),
+ overlay: Color(astryxRGBA: 0x25252A80),
+ overlayHover: Color(astryxRGBA: 0x25252A0D),
+ overlayPressed: Color(astryxRGBA: 0x25252A1A),
+ shadow: Color(astryxRGBA: 0x25252A1A),
+ skeleton: Color(astryxRGBA: 0xD4D3DDFF),
+ success: Color(astryxRGBA: 0x354F31FF),
+ successMuted: Color(astryxRGBA: 0xD2ECCFFF),
+ syntaxAdded: Color(astryxRGBA: 0xD2ECCF40),
+ syntaxAddedMarker: Color(astryxRGBA: 0x354F31FF),
+ syntaxAttribute: Color(astryxRGBA: 0x736419FF),
+ syntaxBackground: Color(astryxRGBA: 0xF0F0F7FF),
+ syntaxComment: Color(astryxRGBA: 0x5F5F64FF),
+ syntaxConstant: Color(astryxRGBA: 0x745752FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x516074FF),
+ syntaxKeyword: Color(astryxRGBA: 0x635A70FF),
+ syntaxNumber: Color(astryxRGBA: 0x745752FF),
+ syntaxOperator: Color(astryxRGBA: 0x5F5F64FF),
+ syntaxProperty: Color(astryxRGBA: 0x40675CFF),
+ syntaxPunctuation: Color(astryxRGBA: 0x5F5F64FF),
+ syntaxRemoved: Color(astryxRGBA: 0xFBDAD440),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x603C37FF),
+ syntaxString: Color(astryxRGBA: 0x40675CFF),
+ syntaxTag: Color(astryxRGBA: 0x745752FF),
+ syntaxType: Color(astryxRGBA: 0x635A70FF),
+ syntaxVariable: Color(astryxRGBA: 0x5F5F64FF),
+ textAccent: Color(astryxRGBA: 0x25252AFF),
+ textBlue: Color(astryxRGBA: 0x344861FF),
+ textCyan: Color(astryxRGBA: 0x264D57FF),
+ textDisabled: Color(astryxRGBA: 0xD4D3DDFF),
+ textGray: Color(astryxRGBA: 0x46464EFF),
+ textGreen: Color(astryxRGBA: 0x354F31FF),
+ textOrange: Color(astryxRGBA: 0x5E3F27FF),
+ textPink: Color(astryxRGBA: 0x5A3C4FFF),
+ textPrimary: Color(astryxRGBA: 0x25252AFF),
+ textPurple: Color(astryxRGBA: 0x4C405BFF),
+ textRed: Color(astryxRGBA: 0x603C37FF),
+ textSecondary: Color(astryxRGBA: 0x5F5F64FF),
+ textTeal: Color(astryxRGBA: 0x2C4F44FF),
+ textYellow: Color(astryxRGBA: 0x524818FF),
+ tintHover: Color(astryxRGBA: 0x000000FF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0x524818FF),
+ warningMuted: Color(astryxRGBA: 0xF4E1B7FF)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 4,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Montserrat", "Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 27,
+ heading1Weight: 600,
+ heading2Leading: 1.4545,
+ heading2Size: 22,
+ heading2Weight: 600,
+ heading3Leading: 1.5556,
+ heading3Size: 18,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.4545,
+ heading5Size: 11,
+ heading5Weight: 600,
+ heading6Leading: 1.7778,
+ heading6Size: 9,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.5556,
+ largeSize: 18,
+ largeWeight: 600,
+ size2xl: 27,
+ size2xs: 7,
+ size3xl: 34,
+ size3xs: 6,
+ size4xl: 43,
+ size4xs: 5,
+ size5xl: 53,
+ sizeBase: 14,
+ sizeLg: 18,
+ sizeSm: 11,
+ sizeXl: 22,
+ sizeXs: 9,
+ supportingLeading: 1.4545,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xF0F0F9FF),
+ accentMuted: Color(astryxRGBA: 0xF0F0F920),
+ backgroundBlue: Color(astryxRGBA: 0x445469FF),
+ backgroundBody: Color(astryxRGBA: 0x101018FF),
+ backgroundCard: Color(astryxRGBA: 0x25252AFF),
+ backgroundCyan: Color(astryxRGBA: 0x345761FF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0x525159FF),
+ backgroundGreen: Color(astryxRGBA: 0x3E5D38FF),
+ backgroundInverted: Color(astryxRGBA: 0xF0F0F9FF),
+ backgroundMuted: Color(astryxRGBA: 0x3A3A42FF),
+ backgroundOrange: Color(astryxRGBA: 0x684C34FF),
+ backgroundPink: Color(astryxRGBA: 0x624A59FF),
+ backgroundPopover: Color(astryxRGBA: 0x302F36FF),
+ backgroundPurple: Color(astryxRGBA: 0x574E64FF),
+ backgroundRed: Color(astryxRGBA: 0x684A45FF),
+ backgroundSurface: Color(astryxRGBA: 0x1B1B21FF),
+ backgroundTeal: Color(astryxRGBA: 0x3A5B50FF),
+ backgroundYellow: Color(astryxRGBA: 0x615620FF),
+ border: Color(astryxRGBA: 0xF0F0F91A),
+ borderBlue: Color(astryxRGBA: 0x2C3C52FF),
+ borderCyan: Color(astryxRGBA: 0x234048FF),
+ borderEmphasized: Color(astryxRGBA: 0x5E5E64FF),
+ borderGray: Color(astryxRGBA: 0x3A3A42FF),
+ borderGreen: Color(astryxRGBA: 0x2F412CFF),
+ borderOrange: Color(astryxRGBA: 0x4E3522FF),
+ borderPink: Color(astryxRGBA: 0x4B3242FF),
+ borderPurple: Color(astryxRGBA: 0x3F374CFF),
+ borderRed: Color(astryxRGBA: 0x50332EFF),
+ borderTeal: Color(astryxRGBA: 0x274239FF),
+ borderYellow: Color(astryxRGBA: 0x433B1BFF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xE0BDB8FF),
+ errorMuted: Color(astryxRGBA: 0xE0BDB8FF),
+ iconAccent: Color(astryxRGBA: 0xF0F0F9FF),
+ iconBlue: Color(astryxRGBA: 0xD5E4F8FF),
+ iconCyan: Color(astryxRGBA: 0xCFE8EEFF),
+ iconDisabled: Color(astryxRGBA: 0x5E5E64FF),
+ iconGray: Color(astryxRGBA: 0xE2E2E8FF),
+ iconGreen: Color(astryxRGBA: 0xD5E9D2FF),
+ iconOrange: Color(astryxRGBA: 0xFFDCBBFF),
+ iconPink: Color(astryxRGBA: 0xF2DBE8FF),
+ iconPrimary: Color(astryxRGBA: 0xF0F0F9FF),
+ iconPurple: Color(astryxRGBA: 0xE6DEF3FF),
+ iconRed: Color(astryxRGBA: 0xF7DBD7FF),
+ iconSecondary: Color(astryxRGBA: 0x9D9EA5FF),
+ iconTeal: Color(astryxRGBA: 0xD6E7E1FF),
+ iconYellow: Color(astryxRGBA: 0xF1E1B9FF),
+ neutral: Color(astryxRGBA: 0xF0F0F91A),
+ onAccent: Color(astryxRGBA: 0x25252AFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0xF7DBD7FF),
+ onLight: Color(astryxRGBA: 0x25252AFF),
+ onSuccess: Color(astryxRGBA: 0xD5E9D2FF),
+ onWarning: Color(astryxRGBA: 0xF1E1B9FF),
+ overlay: Color(astryxRGBA: 0x25252ACC),
+ overlayHover: Color(astryxRGBA: 0xF0F0F90D),
+ overlayPressed: Color(astryxRGBA: 0xF0F0F91A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x5E5E64FF),
+ success: Color(astryxRGBA: 0xB3D0AFFF),
+ successMuted: Color(astryxRGBA: 0xB3D0AFFF),
+ syntaxAdded: Color(astryxRGBA: 0xB3D0AF33),
+ syntaxAddedMarker: Color(astryxRGBA: 0xD5E9D2FF),
+ syntaxAttribute: Color(astryxRGBA: 0xC2AF6EFF),
+ syntaxBackground: Color(astryxRGBA: 0x101018FF),
+ syntaxComment: Color(astryxRGBA: 0xABABB3FF),
+ syntaxConstant: Color(astryxRGBA: 0xC9A382FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x9AADC7FF),
+ syntaxKeyword: Color(astryxRGBA: 0xB0A5C0FF),
+ syntaxNumber: Color(astryxRGBA: 0xC9A382FF),
+ syntaxOperator: Color(astryxRGBA: 0xABABB3FF),
+ syntaxProperty: Color(astryxRGBA: 0x94B3A9FF),
+ syntaxPunctuation: Color(astryxRGBA: 0xABABB3FF),
+ syntaxRemoved: Color(astryxRGBA: 0xE0BDB833),
+ syntaxRemovedMarker: Color(astryxRGBA: 0xF7DBD7FF),
+ syntaxString: Color(astryxRGBA: 0x90BA8AFF),
+ syntaxTag: Color(astryxRGBA: 0xC6A29CFF),
+ syntaxType: Color(astryxRGBA: 0xB0A5C0FF),
+ syntaxVariable: Color(astryxRGBA: 0xABABB3FF),
+ textAccent: Color(astryxRGBA: 0xF0F0F9FF),
+ textBlue: Color(astryxRGBA: 0xD5E4F8FF),
+ textCyan: Color(astryxRGBA: 0xCFE8EEFF),
+ textDisabled: Color(astryxRGBA: 0x5E5E64FF),
+ textGray: Color(astryxRGBA: 0xE2E2E8FF),
+ textGreen: Color(astryxRGBA: 0xD5E9D2FF),
+ textOrange: Color(astryxRGBA: 0xFFDCBBFF),
+ textPink: Color(astryxRGBA: 0xF2DBE8FF),
+ textPrimary: Color(astryxRGBA: 0xF0F0F9FF),
+ textPurple: Color(astryxRGBA: 0xE6DEF3FF),
+ textRed: Color(astryxRGBA: 0xF7DBD7FF),
+ textSecondary: Color(astryxRGBA: 0xABABB3FF),
+ textTeal: Color(astryxRGBA: 0xD6E7E1FF),
+ textYellow: Color(astryxRGBA: 0xF1E1B9FF),
+ tintHover: Color(astryxRGBA: 0xFFFFFFFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xD9C794FF),
+ warningMuted: Color(astryxRGBA: 0xD9C794FF)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 2,
+ s1: 4,
+ s1_5: 6,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 8,
+ s3: 12,
+ s4: 16,
+ s5: 20,
+ s6: 24,
+ s7: 28,
+ s8: 32,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 28,
+ container: 12,
+ element: 8,
+ full: 9999,
+ inner: 4,
+ none: 0,
+ page: 24
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 36,
+ elementMd: 32,
+ elementSm: 28
+ ),
+ font: FontTokens(
+ bodyLeading: 1.4286,
+ bodySize: 14,
+ bodyWeight: 400,
+ familyBody: ["Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Montserrat", "Figtree", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.3333,
+ heading1Size: 27,
+ heading1Weight: 600,
+ heading2Leading: 1.4545,
+ heading2Size: 22,
+ heading2Weight: 600,
+ heading3Leading: 1.5556,
+ heading3Size: 18,
+ heading3Weight: 700,
+ heading4Leading: 1.4286,
+ heading4Size: 14,
+ heading4Weight: 700,
+ heading5Leading: 1.4545,
+ heading5Size: 11,
+ heading5Weight: 600,
+ heading6Leading: 1.7778,
+ heading6Size: 9,
+ heading6Weight: 600,
+ labelLeading: 1.4286,
+ labelSize: 14,
+ labelWeight: 500,
+ largeLeading: 1.5556,
+ largeSize: 18,
+ largeWeight: 600,
+ size2xl: 27,
+ size2xs: 7,
+ size3xl: 34,
+ size3xs: 6,
+ size4xl: 43,
+ size4xs: 5,
+ size5xl: 53,
+ sizeBase: 14,
+ sizeLg: 18,
+ sizeSm: 11,
+ sizeXl: 22,
+ sizeXs: 9,
+ supportingLeading: 1.4545,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
+ )
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift
new file mode 100644
index 0000000000..2ef0c7ebb0
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift
@@ -0,0 +1,1260 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from core's token names.
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+/// One mode of a theme: every token Swift keeps, as typed members.
+public struct Tokens: Equatable, Sendable {
+ public var color: ColorTokens
+ public var space: SpaceTokens
+ public var radius: RadiusTokens
+ public var size: SizeTokens
+ public var font: FontTokens
+
+ public init(
+ color: ColorTokens,
+ space: SpaceTokens,
+ radius: RadiusTokens,
+ size: SizeTokens,
+ font: FontTokens
+ ) {
+ self.color = color
+ self.space = space
+ self.radius = radius
+ self.size = size
+ self.font = font
+ }
+}
+
+/// The theme's `color` tokens, one typed member per token.
+public struct ColorTokens: Equatable, Sendable {
+ /// `--color-accent`
+ public var accent: Color
+ /// `--color-accent-muted`
+ public var accentMuted: Color
+ /// `--color-background-blue`
+ public var backgroundBlue: Color
+ /// `--color-background-body`
+ public var backgroundBody: Color
+ /// `--color-background-card`
+ public var backgroundCard: Color
+ /// `--color-background-cyan`
+ public var backgroundCyan: Color
+ /// `--color-background-error-inverted`
+ public var backgroundErrorInverted: Color
+ /// `--color-background-gray`
+ public var backgroundGray: Color
+ /// `--color-background-green`
+ public var backgroundGreen: Color
+ /// `--color-background-inverted`
+ public var backgroundInverted: Color
+ /// `--color-background-muted`
+ public var backgroundMuted: Color
+ /// `--color-background-orange`
+ public var backgroundOrange: Color
+ /// `--color-background-pink`
+ public var backgroundPink: Color
+ /// `--color-background-popover`
+ public var backgroundPopover: Color
+ /// `--color-background-purple`
+ public var backgroundPurple: Color
+ /// `--color-background-red`
+ public var backgroundRed: Color
+ /// `--color-background-surface`
+ public var backgroundSurface: Color
+ /// `--color-background-teal`
+ public var backgroundTeal: Color
+ /// `--color-background-yellow`
+ public var backgroundYellow: Color
+ /// `--color-border`
+ public var border: Color
+ /// `--color-border-blue`
+ public var borderBlue: Color
+ /// `--color-border-cyan`
+ public var borderCyan: Color
+ /// `--color-border-emphasized`
+ public var borderEmphasized: Color
+ /// `--color-border-gray`
+ public var borderGray: Color
+ /// `--color-border-green`
+ public var borderGreen: Color
+ /// `--color-border-orange`
+ public var borderOrange: Color
+ /// `--color-border-pink`
+ public var borderPink: Color
+ /// `--color-border-purple`
+ public var borderPurple: Color
+ /// `--color-border-red`
+ public var borderRed: Color
+ /// `--color-border-teal`
+ public var borderTeal: Color
+ /// `--color-border-yellow`
+ public var borderYellow: Color
+ /// `--color-data-blue-1`
+ public var dataBlue1: Color
+ /// `--color-data-blue-2`
+ public var dataBlue2: Color
+ /// `--color-data-blue-3`
+ public var dataBlue3: Color
+ /// `--color-data-blue-4`
+ public var dataBlue4: Color
+ /// `--color-data-blue-5`
+ public var dataBlue5: Color
+ /// `--color-data-categorical-blue`
+ public var dataCategoricalBlue: Color
+ /// `--color-data-categorical-brown`
+ public var dataCategoricalBrown: Color
+ /// `--color-data-categorical-cyan`
+ public var dataCategoricalCyan: Color
+ /// `--color-data-categorical-green`
+ public var dataCategoricalGreen: Color
+ /// `--color-data-categorical-indigo`
+ public var dataCategoricalIndigo: Color
+ /// `--color-data-categorical-orange`
+ public var dataCategoricalOrange: Color
+ /// `--color-data-categorical-pink`
+ public var dataCategoricalPink: Color
+ /// `--color-data-categorical-purple`
+ public var dataCategoricalPurple: Color
+ /// `--color-data-categorical-red`
+ public var dataCategoricalRed: Color
+ /// `--color-data-categorical-teal`
+ public var dataCategoricalTeal: Color
+ /// `--color-data-gray-1`
+ public var dataGray1: Color
+ /// `--color-data-gray-2`
+ public var dataGray2: Color
+ /// `--color-data-gray-3`
+ public var dataGray3: Color
+ /// `--color-data-gray-4`
+ public var dataGray4: Color
+ /// `--color-data-gray-5`
+ public var dataGray5: Color
+ /// `--color-data-neutral`
+ public var dataNeutral: Color
+ /// `--color-data-orange-1`
+ public var dataOrange1: Color
+ /// `--color-data-orange-2`
+ public var dataOrange2: Color
+ /// `--color-data-orange-3`
+ public var dataOrange3: Color
+ /// `--color-data-orange-4`
+ public var dataOrange4: Color
+ /// `--color-data-orange-5`
+ public var dataOrange5: Color
+ /// `--color-data-pink-1`
+ public var dataPink1: Color
+ /// `--color-data-pink-2`
+ public var dataPink2: Color
+ /// `--color-data-pink-3`
+ public var dataPink3: Color
+ /// `--color-data-pink-4`
+ public var dataPink4: Color
+ /// `--color-data-pink-5`
+ public var dataPink5: Color
+ /// `--color-data-purple-1`
+ public var dataPurple1: Color
+ /// `--color-data-purple-2`
+ public var dataPurple2: Color
+ /// `--color-data-purple-3`
+ public var dataPurple3: Color
+ /// `--color-data-purple-4`
+ public var dataPurple4: Color
+ /// `--color-data-purple-5`
+ public var dataPurple5: Color
+ /// `--color-data-red-1`
+ public var dataRed1: Color
+ /// `--color-data-red-2`
+ public var dataRed2: Color
+ /// `--color-data-red-3`
+ public var dataRed3: Color
+ /// `--color-data-red-4`
+ public var dataRed4: Color
+ /// `--color-data-red-5`
+ public var dataRed5: Color
+ /// `--color-data-shamrock-1`
+ public var dataShamrock1: Color
+ /// `--color-data-shamrock-2`
+ public var dataShamrock2: Color
+ /// `--color-data-shamrock-3`
+ public var dataShamrock3: Color
+ /// `--color-data-shamrock-4`
+ public var dataShamrock4: Color
+ /// `--color-data-shamrock-5`
+ public var dataShamrock5: Color
+ /// `--color-data-teal-1`
+ public var dataTeal1: Color
+ /// `--color-data-teal-2`
+ public var dataTeal2: Color
+ /// `--color-data-teal-3`
+ public var dataTeal3: Color
+ /// `--color-data-teal-4`
+ public var dataTeal4: Color
+ /// `--color-data-teal-5`
+ public var dataTeal5: Color
+ /// `--color-data-yellow-1`
+ public var dataYellow1: Color
+ /// `--color-data-yellow-2`
+ public var dataYellow2: Color
+ /// `--color-data-yellow-3`
+ public var dataYellow3: Color
+ /// `--color-data-yellow-4`
+ public var dataYellow4: Color
+ /// `--color-data-yellow-5`
+ public var dataYellow5: Color
+ /// `--color-error`
+ public var error: Color
+ /// `--color-error-muted`
+ public var errorMuted: Color
+ /// `--color-icon-accent`
+ public var iconAccent: Color
+ /// `--color-icon-blue`
+ public var iconBlue: Color
+ /// `--color-icon-cyan`
+ public var iconCyan: Color
+ /// `--color-icon-disabled`
+ public var iconDisabled: Color
+ /// `--color-icon-gray`
+ public var iconGray: Color
+ /// `--color-icon-green`
+ public var iconGreen: Color
+ /// `--color-icon-orange`
+ public var iconOrange: Color
+ /// `--color-icon-pink`
+ public var iconPink: Color
+ /// `--color-icon-primary`
+ public var iconPrimary: Color
+ /// `--color-icon-purple`
+ public var iconPurple: Color
+ /// `--color-icon-red`
+ public var iconRed: Color
+ /// `--color-icon-secondary`
+ public var iconSecondary: Color
+ /// `--color-icon-teal`
+ public var iconTeal: Color
+ /// `--color-icon-yellow`
+ public var iconYellow: Color
+ /// `--color-neutral`
+ public var neutral: Color
+ /// `--color-on-accent`
+ public var onAccent: Color
+ /// `--color-on-dark`
+ public var onDark: Color
+ /// `--color-on-error`
+ public var onError: Color
+ /// `--color-on-light`
+ public var onLight: Color
+ /// `--color-on-success`
+ public var onSuccess: Color
+ /// `--color-on-warning`
+ public var onWarning: Color
+ /// `--color-overlay`
+ public var overlay: Color
+ /// `--color-overlay-hover`
+ public var overlayHover: Color
+ /// `--color-overlay-pressed`
+ public var overlayPressed: Color
+ /// `--color-shadow`
+ public var shadow: Color
+ /// `--color-skeleton`
+ public var skeleton: Color
+ /// `--color-success`
+ public var success: Color
+ /// `--color-success-muted`
+ public var successMuted: Color
+ /// `--color-syntax-added`
+ public var syntaxAdded: Color
+ /// `--color-syntax-added-marker`
+ public var syntaxAddedMarker: Color
+ /// `--color-syntax-attribute`
+ public var syntaxAttribute: Color
+ /// `--color-syntax-background`
+ public var syntaxBackground: Color
+ /// `--color-syntax-comment`
+ public var syntaxComment: Color
+ /// `--color-syntax-constant`
+ public var syntaxConstant: Color
+ /// `--color-syntax-diff-header`
+ public var syntaxDiffHeader: Color
+ /// `--color-syntax-function`
+ public var syntaxFunction: Color
+ /// `--color-syntax-keyword`
+ public var syntaxKeyword: Color
+ /// `--color-syntax-number`
+ public var syntaxNumber: Color
+ /// `--color-syntax-operator`
+ public var syntaxOperator: Color
+ /// `--color-syntax-property`
+ public var syntaxProperty: Color
+ /// `--color-syntax-punctuation`
+ public var syntaxPunctuation: Color
+ /// `--color-syntax-removed`
+ public var syntaxRemoved: Color
+ /// `--color-syntax-removed-marker`
+ public var syntaxRemovedMarker: Color
+ /// `--color-syntax-string`
+ public var syntaxString: Color
+ /// `--color-syntax-tag`
+ public var syntaxTag: Color
+ /// `--color-syntax-type`
+ public var syntaxType: Color
+ /// `--color-syntax-variable`
+ public var syntaxVariable: Color
+ /// `--color-text-accent`
+ public var textAccent: Color
+ /// `--color-text-blue`
+ public var textBlue: Color
+ /// `--color-text-cyan`
+ public var textCyan: Color
+ /// `--color-text-disabled`
+ public var textDisabled: Color
+ /// `--color-text-gray`
+ public var textGray: Color
+ /// `--color-text-green`
+ public var textGreen: Color
+ /// `--color-text-orange`
+ public var textOrange: Color
+ /// `--color-text-pink`
+ public var textPink: Color
+ /// `--color-text-primary`
+ public var textPrimary: Color
+ /// `--color-text-purple`
+ public var textPurple: Color
+ /// `--color-text-red`
+ public var textRed: Color
+ /// `--color-text-secondary`
+ public var textSecondary: Color
+ /// `--color-text-teal`
+ public var textTeal: Color
+ /// `--color-text-yellow`
+ public var textYellow: Color
+ /// `--color-tint-hover`
+ public var tintHover: Color
+ /// `--color-track`
+ public var track: Color
+ /// `--color-warning`
+ public var warning: Color
+ /// `--color-warning-muted`
+ public var warningMuted: Color
+
+ public init(
+ accent: Color,
+ accentMuted: Color,
+ backgroundBlue: Color,
+ backgroundBody: Color,
+ backgroundCard: Color,
+ backgroundCyan: Color,
+ backgroundErrorInverted: Color,
+ backgroundGray: Color,
+ backgroundGreen: Color,
+ backgroundInverted: Color,
+ backgroundMuted: Color,
+ backgroundOrange: Color,
+ backgroundPink: Color,
+ backgroundPopover: Color,
+ backgroundPurple: Color,
+ backgroundRed: Color,
+ backgroundSurface: Color,
+ backgroundTeal: Color,
+ backgroundYellow: Color,
+ border: Color,
+ borderBlue: Color,
+ borderCyan: Color,
+ borderEmphasized: Color,
+ borderGray: Color,
+ borderGreen: Color,
+ borderOrange: Color,
+ borderPink: Color,
+ borderPurple: Color,
+ borderRed: Color,
+ borderTeal: Color,
+ borderYellow: Color,
+ dataBlue1: Color,
+ dataBlue2: Color,
+ dataBlue3: Color,
+ dataBlue4: Color,
+ dataBlue5: Color,
+ dataCategoricalBlue: Color,
+ dataCategoricalBrown: Color,
+ dataCategoricalCyan: Color,
+ dataCategoricalGreen: Color,
+ dataCategoricalIndigo: Color,
+ dataCategoricalOrange: Color,
+ dataCategoricalPink: Color,
+ dataCategoricalPurple: Color,
+ dataCategoricalRed: Color,
+ dataCategoricalTeal: Color,
+ dataGray1: Color,
+ dataGray2: Color,
+ dataGray3: Color,
+ dataGray4: Color,
+ dataGray5: Color,
+ dataNeutral: Color,
+ dataOrange1: Color,
+ dataOrange2: Color,
+ dataOrange3: Color,
+ dataOrange4: Color,
+ dataOrange5: Color,
+ dataPink1: Color,
+ dataPink2: Color,
+ dataPink3: Color,
+ dataPink4: Color,
+ dataPink5: Color,
+ dataPurple1: Color,
+ dataPurple2: Color,
+ dataPurple3: Color,
+ dataPurple4: Color,
+ dataPurple5: Color,
+ dataRed1: Color,
+ dataRed2: Color,
+ dataRed3: Color,
+ dataRed4: Color,
+ dataRed5: Color,
+ dataShamrock1: Color,
+ dataShamrock2: Color,
+ dataShamrock3: Color,
+ dataShamrock4: Color,
+ dataShamrock5: Color,
+ dataTeal1: Color,
+ dataTeal2: Color,
+ dataTeal3: Color,
+ dataTeal4: Color,
+ dataTeal5: Color,
+ dataYellow1: Color,
+ dataYellow2: Color,
+ dataYellow3: Color,
+ dataYellow4: Color,
+ dataYellow5: Color,
+ error: Color,
+ errorMuted: Color,
+ iconAccent: Color,
+ iconBlue: Color,
+ iconCyan: Color,
+ iconDisabled: Color,
+ iconGray: Color,
+ iconGreen: Color,
+ iconOrange: Color,
+ iconPink: Color,
+ iconPrimary: Color,
+ iconPurple: Color,
+ iconRed: Color,
+ iconSecondary: Color,
+ iconTeal: Color,
+ iconYellow: Color,
+ neutral: Color,
+ onAccent: Color,
+ onDark: Color,
+ onError: Color,
+ onLight: Color,
+ onSuccess: Color,
+ onWarning: Color,
+ overlay: Color,
+ overlayHover: Color,
+ overlayPressed: Color,
+ shadow: Color,
+ skeleton: Color,
+ success: Color,
+ successMuted: Color,
+ syntaxAdded: Color,
+ syntaxAddedMarker: Color,
+ syntaxAttribute: Color,
+ syntaxBackground: Color,
+ syntaxComment: Color,
+ syntaxConstant: Color,
+ syntaxDiffHeader: Color,
+ syntaxFunction: Color,
+ syntaxKeyword: Color,
+ syntaxNumber: Color,
+ syntaxOperator: Color,
+ syntaxProperty: Color,
+ syntaxPunctuation: Color,
+ syntaxRemoved: Color,
+ syntaxRemovedMarker: Color,
+ syntaxString: Color,
+ syntaxTag: Color,
+ syntaxType: Color,
+ syntaxVariable: Color,
+ textAccent: Color,
+ textBlue: Color,
+ textCyan: Color,
+ textDisabled: Color,
+ textGray: Color,
+ textGreen: Color,
+ textOrange: Color,
+ textPink: Color,
+ textPrimary: Color,
+ textPurple: Color,
+ textRed: Color,
+ textSecondary: Color,
+ textTeal: Color,
+ textYellow: Color,
+ tintHover: Color,
+ track: Color,
+ warning: Color,
+ warningMuted: Color
+ ) {
+ self.accent = accent
+ self.accentMuted = accentMuted
+ self.backgroundBlue = backgroundBlue
+ self.backgroundBody = backgroundBody
+ self.backgroundCard = backgroundCard
+ self.backgroundCyan = backgroundCyan
+ self.backgroundErrorInverted = backgroundErrorInverted
+ self.backgroundGray = backgroundGray
+ self.backgroundGreen = backgroundGreen
+ self.backgroundInverted = backgroundInverted
+ self.backgroundMuted = backgroundMuted
+ self.backgroundOrange = backgroundOrange
+ self.backgroundPink = backgroundPink
+ self.backgroundPopover = backgroundPopover
+ self.backgroundPurple = backgroundPurple
+ self.backgroundRed = backgroundRed
+ self.backgroundSurface = backgroundSurface
+ self.backgroundTeal = backgroundTeal
+ self.backgroundYellow = backgroundYellow
+ self.border = border
+ self.borderBlue = borderBlue
+ self.borderCyan = borderCyan
+ self.borderEmphasized = borderEmphasized
+ self.borderGray = borderGray
+ self.borderGreen = borderGreen
+ self.borderOrange = borderOrange
+ self.borderPink = borderPink
+ self.borderPurple = borderPurple
+ self.borderRed = borderRed
+ self.borderTeal = borderTeal
+ self.borderYellow = borderYellow
+ self.dataBlue1 = dataBlue1
+ self.dataBlue2 = dataBlue2
+ self.dataBlue3 = dataBlue3
+ self.dataBlue4 = dataBlue4
+ self.dataBlue5 = dataBlue5
+ self.dataCategoricalBlue = dataCategoricalBlue
+ self.dataCategoricalBrown = dataCategoricalBrown
+ self.dataCategoricalCyan = dataCategoricalCyan
+ self.dataCategoricalGreen = dataCategoricalGreen
+ self.dataCategoricalIndigo = dataCategoricalIndigo
+ self.dataCategoricalOrange = dataCategoricalOrange
+ self.dataCategoricalPink = dataCategoricalPink
+ self.dataCategoricalPurple = dataCategoricalPurple
+ self.dataCategoricalRed = dataCategoricalRed
+ self.dataCategoricalTeal = dataCategoricalTeal
+ self.dataGray1 = dataGray1
+ self.dataGray2 = dataGray2
+ self.dataGray3 = dataGray3
+ self.dataGray4 = dataGray4
+ self.dataGray5 = dataGray5
+ self.dataNeutral = dataNeutral
+ self.dataOrange1 = dataOrange1
+ self.dataOrange2 = dataOrange2
+ self.dataOrange3 = dataOrange3
+ self.dataOrange4 = dataOrange4
+ self.dataOrange5 = dataOrange5
+ self.dataPink1 = dataPink1
+ self.dataPink2 = dataPink2
+ self.dataPink3 = dataPink3
+ self.dataPink4 = dataPink4
+ self.dataPink5 = dataPink5
+ self.dataPurple1 = dataPurple1
+ self.dataPurple2 = dataPurple2
+ self.dataPurple3 = dataPurple3
+ self.dataPurple4 = dataPurple4
+ self.dataPurple5 = dataPurple5
+ self.dataRed1 = dataRed1
+ self.dataRed2 = dataRed2
+ self.dataRed3 = dataRed3
+ self.dataRed4 = dataRed4
+ self.dataRed5 = dataRed5
+ self.dataShamrock1 = dataShamrock1
+ self.dataShamrock2 = dataShamrock2
+ self.dataShamrock3 = dataShamrock3
+ self.dataShamrock4 = dataShamrock4
+ self.dataShamrock5 = dataShamrock5
+ self.dataTeal1 = dataTeal1
+ self.dataTeal2 = dataTeal2
+ self.dataTeal3 = dataTeal3
+ self.dataTeal4 = dataTeal4
+ self.dataTeal5 = dataTeal5
+ self.dataYellow1 = dataYellow1
+ self.dataYellow2 = dataYellow2
+ self.dataYellow3 = dataYellow3
+ self.dataYellow4 = dataYellow4
+ self.dataYellow5 = dataYellow5
+ self.error = error
+ self.errorMuted = errorMuted
+ self.iconAccent = iconAccent
+ self.iconBlue = iconBlue
+ self.iconCyan = iconCyan
+ self.iconDisabled = iconDisabled
+ self.iconGray = iconGray
+ self.iconGreen = iconGreen
+ self.iconOrange = iconOrange
+ self.iconPink = iconPink
+ self.iconPrimary = iconPrimary
+ self.iconPurple = iconPurple
+ self.iconRed = iconRed
+ self.iconSecondary = iconSecondary
+ self.iconTeal = iconTeal
+ self.iconYellow = iconYellow
+ self.neutral = neutral
+ self.onAccent = onAccent
+ self.onDark = onDark
+ self.onError = onError
+ self.onLight = onLight
+ self.onSuccess = onSuccess
+ self.onWarning = onWarning
+ self.overlay = overlay
+ self.overlayHover = overlayHover
+ self.overlayPressed = overlayPressed
+ self.shadow = shadow
+ self.skeleton = skeleton
+ self.success = success
+ self.successMuted = successMuted
+ self.syntaxAdded = syntaxAdded
+ self.syntaxAddedMarker = syntaxAddedMarker
+ self.syntaxAttribute = syntaxAttribute
+ self.syntaxBackground = syntaxBackground
+ self.syntaxComment = syntaxComment
+ self.syntaxConstant = syntaxConstant
+ self.syntaxDiffHeader = syntaxDiffHeader
+ self.syntaxFunction = syntaxFunction
+ self.syntaxKeyword = syntaxKeyword
+ self.syntaxNumber = syntaxNumber
+ self.syntaxOperator = syntaxOperator
+ self.syntaxProperty = syntaxProperty
+ self.syntaxPunctuation = syntaxPunctuation
+ self.syntaxRemoved = syntaxRemoved
+ self.syntaxRemovedMarker = syntaxRemovedMarker
+ self.syntaxString = syntaxString
+ self.syntaxTag = syntaxTag
+ self.syntaxType = syntaxType
+ self.syntaxVariable = syntaxVariable
+ self.textAccent = textAccent
+ self.textBlue = textBlue
+ self.textCyan = textCyan
+ self.textDisabled = textDisabled
+ self.textGray = textGray
+ self.textGreen = textGreen
+ self.textOrange = textOrange
+ self.textPink = textPink
+ self.textPrimary = textPrimary
+ self.textPurple = textPurple
+ self.textRed = textRed
+ self.textSecondary = textSecondary
+ self.textTeal = textTeal
+ self.textYellow = textYellow
+ self.tintHover = tintHover
+ self.track = track
+ self.warning = warning
+ self.warningMuted = warningMuted
+ }
+
+ /// A token by its CSS name, for code that only has the name. Components
+ /// read the typed members instead.
+ func value(named token: String) -> Color? {
+ switch token {
+ case "color-accent": accent
+ case "color-accent-muted": accentMuted
+ case "color-background-blue": backgroundBlue
+ case "color-background-body": backgroundBody
+ case "color-background-card": backgroundCard
+ case "color-background-cyan": backgroundCyan
+ case "color-background-error-inverted": backgroundErrorInverted
+ case "color-background-gray": backgroundGray
+ case "color-background-green": backgroundGreen
+ case "color-background-inverted": backgroundInverted
+ case "color-background-muted": backgroundMuted
+ case "color-background-orange": backgroundOrange
+ case "color-background-pink": backgroundPink
+ case "color-background-popover": backgroundPopover
+ case "color-background-purple": backgroundPurple
+ case "color-background-red": backgroundRed
+ case "color-background-surface": backgroundSurface
+ case "color-background-teal": backgroundTeal
+ case "color-background-yellow": backgroundYellow
+ case "color-border": border
+ case "color-border-blue": borderBlue
+ case "color-border-cyan": borderCyan
+ case "color-border-emphasized": borderEmphasized
+ case "color-border-gray": borderGray
+ case "color-border-green": borderGreen
+ case "color-border-orange": borderOrange
+ case "color-border-pink": borderPink
+ case "color-border-purple": borderPurple
+ case "color-border-red": borderRed
+ case "color-border-teal": borderTeal
+ case "color-border-yellow": borderYellow
+ case "color-data-blue-1": dataBlue1
+ case "color-data-blue-2": dataBlue2
+ case "color-data-blue-3": dataBlue3
+ case "color-data-blue-4": dataBlue4
+ case "color-data-blue-5": dataBlue5
+ case "color-data-categorical-blue": dataCategoricalBlue
+ case "color-data-categorical-brown": dataCategoricalBrown
+ case "color-data-categorical-cyan": dataCategoricalCyan
+ case "color-data-categorical-green": dataCategoricalGreen
+ case "color-data-categorical-indigo": dataCategoricalIndigo
+ case "color-data-categorical-orange": dataCategoricalOrange
+ case "color-data-categorical-pink": dataCategoricalPink
+ case "color-data-categorical-purple": dataCategoricalPurple
+ case "color-data-categorical-red": dataCategoricalRed
+ case "color-data-categorical-teal": dataCategoricalTeal
+ case "color-data-gray-1": dataGray1
+ case "color-data-gray-2": dataGray2
+ case "color-data-gray-3": dataGray3
+ case "color-data-gray-4": dataGray4
+ case "color-data-gray-5": dataGray5
+ case "color-data-neutral": dataNeutral
+ case "color-data-orange-1": dataOrange1
+ case "color-data-orange-2": dataOrange2
+ case "color-data-orange-3": dataOrange3
+ case "color-data-orange-4": dataOrange4
+ case "color-data-orange-5": dataOrange5
+ case "color-data-pink-1": dataPink1
+ case "color-data-pink-2": dataPink2
+ case "color-data-pink-3": dataPink3
+ case "color-data-pink-4": dataPink4
+ case "color-data-pink-5": dataPink5
+ case "color-data-purple-1": dataPurple1
+ case "color-data-purple-2": dataPurple2
+ case "color-data-purple-3": dataPurple3
+ case "color-data-purple-4": dataPurple4
+ case "color-data-purple-5": dataPurple5
+ case "color-data-red-1": dataRed1
+ case "color-data-red-2": dataRed2
+ case "color-data-red-3": dataRed3
+ case "color-data-red-4": dataRed4
+ case "color-data-red-5": dataRed5
+ case "color-data-shamrock-1": dataShamrock1
+ case "color-data-shamrock-2": dataShamrock2
+ case "color-data-shamrock-3": dataShamrock3
+ case "color-data-shamrock-4": dataShamrock4
+ case "color-data-shamrock-5": dataShamrock5
+ case "color-data-teal-1": dataTeal1
+ case "color-data-teal-2": dataTeal2
+ case "color-data-teal-3": dataTeal3
+ case "color-data-teal-4": dataTeal4
+ case "color-data-teal-5": dataTeal5
+ case "color-data-yellow-1": dataYellow1
+ case "color-data-yellow-2": dataYellow2
+ case "color-data-yellow-3": dataYellow3
+ case "color-data-yellow-4": dataYellow4
+ case "color-data-yellow-5": dataYellow5
+ case "color-error": error
+ case "color-error-muted": errorMuted
+ case "color-icon-accent": iconAccent
+ case "color-icon-blue": iconBlue
+ case "color-icon-cyan": iconCyan
+ case "color-icon-disabled": iconDisabled
+ case "color-icon-gray": iconGray
+ case "color-icon-green": iconGreen
+ case "color-icon-orange": iconOrange
+ case "color-icon-pink": iconPink
+ case "color-icon-primary": iconPrimary
+ case "color-icon-purple": iconPurple
+ case "color-icon-red": iconRed
+ case "color-icon-secondary": iconSecondary
+ case "color-icon-teal": iconTeal
+ case "color-icon-yellow": iconYellow
+ case "color-neutral": neutral
+ case "color-on-accent": onAccent
+ case "color-on-dark": onDark
+ case "color-on-error": onError
+ case "color-on-light": onLight
+ case "color-on-success": onSuccess
+ case "color-on-warning": onWarning
+ case "color-overlay": overlay
+ case "color-overlay-hover": overlayHover
+ case "color-overlay-pressed": overlayPressed
+ case "color-shadow": shadow
+ case "color-skeleton": skeleton
+ case "color-success": success
+ case "color-success-muted": successMuted
+ case "color-syntax-added": syntaxAdded
+ case "color-syntax-added-marker": syntaxAddedMarker
+ case "color-syntax-attribute": syntaxAttribute
+ case "color-syntax-background": syntaxBackground
+ case "color-syntax-comment": syntaxComment
+ case "color-syntax-constant": syntaxConstant
+ case "color-syntax-diff-header": syntaxDiffHeader
+ case "color-syntax-function": syntaxFunction
+ case "color-syntax-keyword": syntaxKeyword
+ case "color-syntax-number": syntaxNumber
+ case "color-syntax-operator": syntaxOperator
+ case "color-syntax-property": syntaxProperty
+ case "color-syntax-punctuation": syntaxPunctuation
+ case "color-syntax-removed": syntaxRemoved
+ case "color-syntax-removed-marker": syntaxRemovedMarker
+ case "color-syntax-string": syntaxString
+ case "color-syntax-tag": syntaxTag
+ case "color-syntax-type": syntaxType
+ case "color-syntax-variable": syntaxVariable
+ case "color-text-accent": textAccent
+ case "color-text-blue": textBlue
+ case "color-text-cyan": textCyan
+ case "color-text-disabled": textDisabled
+ case "color-text-gray": textGray
+ case "color-text-green": textGreen
+ case "color-text-orange": textOrange
+ case "color-text-pink": textPink
+ case "color-text-primary": textPrimary
+ case "color-text-purple": textPurple
+ case "color-text-red": textRed
+ case "color-text-secondary": textSecondary
+ case "color-text-teal": textTeal
+ case "color-text-yellow": textYellow
+ case "color-tint-hover": tintHover
+ case "color-track": track
+ case "color-warning": warning
+ case "color-warning-muted": warningMuted
+ default: nil
+ }
+ }
+}
+
+/// The theme's `space` tokens, one typed member per token.
+public struct SpaceTokens: Equatable, Sendable {
+ /// `--spacing-0`
+ public var s0: CGFloat
+ /// `--spacing-0-5`
+ public var s0_5: CGFloat
+ /// `--spacing-1`
+ public var s1: CGFloat
+ /// `--spacing-1-5`
+ public var s1_5: CGFloat
+ /// `--spacing-10`
+ public var s10: CGFloat
+ /// `--spacing-11`
+ public var s11: CGFloat
+ /// `--spacing-12`
+ public var s12: CGFloat
+ /// `--spacing-2`
+ public var s2: CGFloat
+ /// `--spacing-3`
+ public var s3: CGFloat
+ /// `--spacing-4`
+ public var s4: CGFloat
+ /// `--spacing-5`
+ public var s5: CGFloat
+ /// `--spacing-6`
+ public var s6: CGFloat
+ /// `--spacing-7`
+ public var s7: CGFloat
+ /// `--spacing-8`
+ public var s8: CGFloat
+ /// `--spacing-9`
+ public var s9: CGFloat
+
+ public init(
+ s0: CGFloat,
+ s0_5: CGFloat,
+ s1: CGFloat,
+ s1_5: CGFloat,
+ s10: CGFloat,
+ s11: CGFloat,
+ s12: CGFloat,
+ s2: CGFloat,
+ s3: CGFloat,
+ s4: CGFloat,
+ s5: CGFloat,
+ s6: CGFloat,
+ s7: CGFloat,
+ s8: CGFloat,
+ s9: CGFloat
+ ) {
+ self.s0 = s0
+ self.s0_5 = s0_5
+ self.s1 = s1
+ self.s1_5 = s1_5
+ self.s10 = s10
+ self.s11 = s11
+ self.s12 = s12
+ self.s2 = s2
+ self.s3 = s3
+ self.s4 = s4
+ self.s5 = s5
+ self.s6 = s6
+ self.s7 = s7
+ self.s8 = s8
+ self.s9 = s9
+ }
+
+ /// A token by its CSS name, for code that only has the name. Components
+ /// read the typed members instead.
+ func value(named token: String) -> CGFloat? {
+ switch token {
+ case "spacing-0": s0
+ case "spacing-0-5": s0_5
+ case "spacing-1": s1
+ case "spacing-1-5": s1_5
+ case "spacing-10": s10
+ case "spacing-11": s11
+ case "spacing-12": s12
+ case "spacing-2": s2
+ case "spacing-3": s3
+ case "spacing-4": s4
+ case "spacing-5": s5
+ case "spacing-6": s6
+ case "spacing-7": s7
+ case "spacing-8": s8
+ case "spacing-9": s9
+ default: nil
+ }
+ }
+}
+
+/// The theme's `radius` tokens, one typed member per token.
+public struct RadiusTokens: Equatable, Sendable {
+ /// `--radius-chat`
+ public var chat: CGFloat
+ /// `--radius-container`
+ public var container: CGFloat
+ /// `--radius-element`
+ public var element: CGFloat
+ /// `--radius-full`
+ public var full: CGFloat
+ /// `--radius-inner`
+ public var inner: CGFloat
+ /// `--radius-none`
+ public var none: CGFloat
+ /// `--radius-page`
+ public var page: CGFloat
+
+ public init(
+ chat: CGFloat,
+ container: CGFloat,
+ element: CGFloat,
+ full: CGFloat,
+ inner: CGFloat,
+ none: CGFloat,
+ page: CGFloat
+ ) {
+ self.chat = chat
+ self.container = container
+ self.element = element
+ self.full = full
+ self.inner = inner
+ self.none = none
+ self.page = page
+ }
+
+ /// A token by its CSS name, for code that only has the name. Components
+ /// read the typed members instead.
+ func value(named token: String) -> CGFloat? {
+ switch token {
+ case "radius-chat": chat
+ case "radius-container": container
+ case "radius-element": element
+ case "radius-full": full
+ case "radius-inner": inner
+ case "radius-none": none
+ case "radius-page": page
+ default: nil
+ }
+ }
+}
+
+/// The theme's `size` tokens, one typed member per token.
+public struct SizeTokens: Equatable, Sendable {
+ /// `--border-width`
+ public var borderWidth: CGFloat
+ /// `--size-element-lg`
+ public var elementLg: CGFloat
+ /// `--size-element-md`
+ public var elementMd: CGFloat
+ /// `--size-element-sm`
+ public var elementSm: CGFloat
+
+ public init(
+ borderWidth: CGFloat,
+ elementLg: CGFloat,
+ elementMd: CGFloat,
+ elementSm: CGFloat
+ ) {
+ self.borderWidth = borderWidth
+ self.elementLg = elementLg
+ self.elementMd = elementMd
+ self.elementSm = elementSm
+ }
+
+ /// A token by its CSS name, for code that only has the name. Components
+ /// read the typed members instead.
+ func value(named token: String) -> CGFloat? {
+ switch token {
+ case "border-width": borderWidth
+ case "size-element-lg": elementLg
+ case "size-element-md": elementMd
+ case "size-element-sm": elementSm
+ default: nil
+ }
+ }
+}
+
+/// The theme's `font` tokens, one typed member per token.
+public struct FontTokens: Equatable, Sendable {
+ /// `--text-body-leading`
+ public var bodyLeading: CGFloat
+ /// `--text-body-size`
+ public var bodySize: CGFloat
+ /// `--text-body-weight`
+ public var bodyWeight: CGFloat
+ /// `--font-family-body`
+ public var familyBody: [String]
+ /// `--font-family-code`
+ public var familyCode: [String]
+ /// `--font-family-heading`
+ public var familyHeading: [String]
+ /// `--text-heading-1-leading`
+ public var heading1Leading: CGFloat
+ /// `--text-heading-1-size`
+ public var heading1Size: CGFloat
+ /// `--text-heading-1-weight`
+ public var heading1Weight: CGFloat
+ /// `--text-heading-2-leading`
+ public var heading2Leading: CGFloat
+ /// `--text-heading-2-size`
+ public var heading2Size: CGFloat
+ /// `--text-heading-2-weight`
+ public var heading2Weight: CGFloat
+ /// `--text-heading-3-leading`
+ public var heading3Leading: CGFloat
+ /// `--text-heading-3-size`
+ public var heading3Size: CGFloat
+ /// `--text-heading-3-weight`
+ public var heading3Weight: CGFloat
+ /// `--text-heading-4-leading`
+ public var heading4Leading: CGFloat
+ /// `--text-heading-4-size`
+ public var heading4Size: CGFloat
+ /// `--text-heading-4-weight`
+ public var heading4Weight: CGFloat
+ /// `--text-heading-5-leading`
+ public var heading5Leading: CGFloat
+ /// `--text-heading-5-size`
+ public var heading5Size: CGFloat
+ /// `--text-heading-5-weight`
+ public var heading5Weight: CGFloat
+ /// `--text-heading-6-leading`
+ public var heading6Leading: CGFloat
+ /// `--text-heading-6-size`
+ public var heading6Size: CGFloat
+ /// `--text-heading-6-weight`
+ public var heading6Weight: CGFloat
+ /// `--text-label-leading`
+ public var labelLeading: CGFloat
+ /// `--text-label-size`
+ public var labelSize: CGFloat
+ /// `--text-label-weight`
+ public var labelWeight: CGFloat
+ /// `--text-large-leading`
+ public var largeLeading: CGFloat
+ /// `--text-large-size`
+ public var largeSize: CGFloat
+ /// `--text-large-weight`
+ public var largeWeight: CGFloat
+ /// `--font-size-2xl`
+ public var size2xl: CGFloat
+ /// `--font-size-2xs`
+ public var size2xs: CGFloat
+ /// `--font-size-3xl`
+ public var size3xl: CGFloat
+ /// `--font-size-3xs`
+ public var size3xs: CGFloat
+ /// `--font-size-4xl`
+ public var size4xl: CGFloat
+ /// `--font-size-4xs`
+ public var size4xs: CGFloat
+ /// `--font-size-5xl`
+ public var size5xl: CGFloat
+ /// `--font-size-base`
+ public var sizeBase: CGFloat
+ /// `--font-size-lg`
+ public var sizeLg: CGFloat
+ /// `--font-size-sm`
+ public var sizeSm: CGFloat
+ /// `--font-size-xl`
+ public var sizeXl: CGFloat
+ /// `--font-size-xs`
+ public var sizeXs: CGFloat
+ /// `--text-supporting-leading`
+ public var supportingLeading: CGFloat
+ /// `--text-supporting-size`
+ public var supportingSize: CGFloat
+ /// `--text-supporting-weight`
+ public var supportingWeight: CGFloat
+ /// `--font-weight-bold`
+ public var weightBold: CGFloat
+ /// `--font-weight-medium`
+ public var weightMedium: CGFloat
+ /// `--font-weight-normal`
+ public var weightNormal: CGFloat
+ /// `--font-weight-semibold`
+ public var weightSemibold: CGFloat
+
+ public init(
+ bodyLeading: CGFloat,
+ bodySize: CGFloat,
+ bodyWeight: CGFloat,
+ familyBody: [String],
+ familyCode: [String],
+ familyHeading: [String],
+ heading1Leading: CGFloat,
+ heading1Size: CGFloat,
+ heading1Weight: CGFloat,
+ heading2Leading: CGFloat,
+ heading2Size: CGFloat,
+ heading2Weight: CGFloat,
+ heading3Leading: CGFloat,
+ heading3Size: CGFloat,
+ heading3Weight: CGFloat,
+ heading4Leading: CGFloat,
+ heading4Size: CGFloat,
+ heading4Weight: CGFloat,
+ heading5Leading: CGFloat,
+ heading5Size: CGFloat,
+ heading5Weight: CGFloat,
+ heading6Leading: CGFloat,
+ heading6Size: CGFloat,
+ heading6Weight: CGFloat,
+ labelLeading: CGFloat,
+ labelSize: CGFloat,
+ labelWeight: CGFloat,
+ largeLeading: CGFloat,
+ largeSize: CGFloat,
+ largeWeight: CGFloat,
+ size2xl: CGFloat,
+ size2xs: CGFloat,
+ size3xl: CGFloat,
+ size3xs: CGFloat,
+ size4xl: CGFloat,
+ size4xs: CGFloat,
+ size5xl: CGFloat,
+ sizeBase: CGFloat,
+ sizeLg: CGFloat,
+ sizeSm: CGFloat,
+ sizeXl: CGFloat,
+ sizeXs: CGFloat,
+ supportingLeading: CGFloat,
+ supportingSize: CGFloat,
+ supportingWeight: CGFloat,
+ weightBold: CGFloat,
+ weightMedium: CGFloat,
+ weightNormal: CGFloat,
+ weightSemibold: CGFloat
+ ) {
+ self.bodyLeading = bodyLeading
+ self.bodySize = bodySize
+ self.bodyWeight = bodyWeight
+ self.familyBody = familyBody
+ self.familyCode = familyCode
+ self.familyHeading = familyHeading
+ self.heading1Leading = heading1Leading
+ self.heading1Size = heading1Size
+ self.heading1Weight = heading1Weight
+ self.heading2Leading = heading2Leading
+ self.heading2Size = heading2Size
+ self.heading2Weight = heading2Weight
+ self.heading3Leading = heading3Leading
+ self.heading3Size = heading3Size
+ self.heading3Weight = heading3Weight
+ self.heading4Leading = heading4Leading
+ self.heading4Size = heading4Size
+ self.heading4Weight = heading4Weight
+ self.heading5Leading = heading5Leading
+ self.heading5Size = heading5Size
+ self.heading5Weight = heading5Weight
+ self.heading6Leading = heading6Leading
+ self.heading6Size = heading6Size
+ self.heading6Weight = heading6Weight
+ self.labelLeading = labelLeading
+ self.labelSize = labelSize
+ self.labelWeight = labelWeight
+ self.largeLeading = largeLeading
+ self.largeSize = largeSize
+ self.largeWeight = largeWeight
+ self.size2xl = size2xl
+ self.size2xs = size2xs
+ self.size3xl = size3xl
+ self.size3xs = size3xs
+ self.size4xl = size4xl
+ self.size4xs = size4xs
+ self.size5xl = size5xl
+ self.sizeBase = sizeBase
+ self.sizeLg = sizeLg
+ self.sizeSm = sizeSm
+ self.sizeXl = sizeXl
+ self.sizeXs = sizeXs
+ self.supportingLeading = supportingLeading
+ self.supportingSize = supportingSize
+ self.supportingWeight = supportingWeight
+ self.weightBold = weightBold
+ self.weightMedium = weightMedium
+ self.weightNormal = weightNormal
+ self.weightSemibold = weightSemibold
+ }
+
+ /// A size, weight, or line-height token by its CSS name, for code that
+ /// only has the name. Components read the typed members instead.
+ func number(named token: String) -> CGFloat? {
+ switch token {
+ case "text-body-leading": bodyLeading
+ case "text-body-size": bodySize
+ case "text-body-weight": bodyWeight
+ case "text-heading-1-leading": heading1Leading
+ case "text-heading-1-size": heading1Size
+ case "text-heading-1-weight": heading1Weight
+ case "text-heading-2-leading": heading2Leading
+ case "text-heading-2-size": heading2Size
+ case "text-heading-2-weight": heading2Weight
+ case "text-heading-3-leading": heading3Leading
+ case "text-heading-3-size": heading3Size
+ case "text-heading-3-weight": heading3Weight
+ case "text-heading-4-leading": heading4Leading
+ case "text-heading-4-size": heading4Size
+ case "text-heading-4-weight": heading4Weight
+ case "text-heading-5-leading": heading5Leading
+ case "text-heading-5-size": heading5Size
+ case "text-heading-5-weight": heading5Weight
+ case "text-heading-6-leading": heading6Leading
+ case "text-heading-6-size": heading6Size
+ case "text-heading-6-weight": heading6Weight
+ case "text-label-leading": labelLeading
+ case "text-label-size": labelSize
+ case "text-label-weight": labelWeight
+ case "text-large-leading": largeLeading
+ case "text-large-size": largeSize
+ case "text-large-weight": largeWeight
+ case "font-size-2xl": size2xl
+ case "font-size-2xs": size2xs
+ case "font-size-3xl": size3xl
+ case "font-size-3xs": size3xs
+ case "font-size-4xl": size4xl
+ case "font-size-4xs": size4xs
+ case "font-size-5xl": size5xl
+ case "font-size-base": sizeBase
+ case "font-size-lg": sizeLg
+ case "font-size-sm": sizeSm
+ case "font-size-xl": sizeXl
+ case "font-size-xs": sizeXs
+ case "text-supporting-leading": supportingLeading
+ case "text-supporting-size": supportingSize
+ case "text-supporting-weight": supportingWeight
+ case "font-weight-bold": weightBold
+ case "font-weight-medium": weightMedium
+ case "font-weight-normal": weightNormal
+ case "font-weight-semibold": weightSemibold
+ default: nil
+ }
+ }
+
+ /// A font family token by its CSS name, for code that only has the name.
+ func families(named token: String) -> [String]? {
+ switch token {
+ case "font-family-body": familyBody
+ case "font-family-code": familyCode
+ case "font-family-heading": familyHeading
+ default: nil
+ }
+ }
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift
new file mode 100644
index 0000000000..29fb1d8c48
--- /dev/null
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift
@@ -0,0 +1,493 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from @astryxdesign/theme-y2k, theme "y2k".
+// Do not edit. Run `pnpm -F @astryxdesign/native generate:swift-ios` after a theme or core token change.
+
+import SwiftUI
+
+extension Theme {
+ /// The `y2k` theme from @astryxdesign/theme-y2k, in light and dark.
+ public static let y2k = Theme(
+ light: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0x2D241BFF),
+ accentMuted: Color(astryxRGBA: 0x2D241B14),
+ backgroundBlue: Color(astryxRGBA: 0xADDBFFFF),
+ backgroundBody: Color(astryxRGBA: 0xCCCFFAFF),
+ backgroundCard: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundCyan: Color(astryxRGBA: 0xB2F0EDFF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xAA071EFF),
+ backgroundGray: Color(astryxRGBA: 0xF1E6DBFF),
+ backgroundGreen: Color(astryxRGBA: 0xC5E17AFF),
+ backgroundInverted: Color(astryxRGBA: 0x2D241BFF),
+ backgroundMuted: Color(astryxRGBA: 0xF1E6DBFF),
+ backgroundOrange: Color(astryxRGBA: 0xFFC89DFF),
+ backgroundPink: Color(astryxRGBA: 0xFFBFD9FF),
+ backgroundPopover: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundPurple: Color(astryxRGBA: 0xD5CDFFFF),
+ backgroundRed: Color(astryxRGBA: 0xFFC3C3FF),
+ backgroundSurface: Color(astryxRGBA: 0xFFFFFFFF),
+ backgroundTeal: Color(astryxRGBA: 0xB6F2D7FF),
+ backgroundYellow: Color(astryxRGBA: 0xFFE08AFF),
+ border: Color(astryxRGBA: 0x382E24FF),
+ borderBlue: Color(astryxRGBA: 0x70C1FFFF),
+ borderCyan: Color(astryxRGBA: 0x73DBD7FF),
+ borderEmphasized: Color(astryxRGBA: 0x382E24FF),
+ borderGray: Color(astryxRGBA: 0xDFD5C9FF),
+ borderGreen: Color(astryxRGBA: 0xB5D360FF),
+ borderOrange: Color(astryxRGBA: 0xFFB477FF),
+ borderPink: Color(astryxRGBA: 0xFFA8CDFF),
+ borderPurple: Color(astryxRGBA: 0xBBAAFFFF),
+ borderRed: Color(astryxRGBA: 0xFF969AFF),
+ borderTeal: Color(astryxRGBA: 0x81DCB6FF),
+ borderYellow: Color(astryxRGBA: 0xF9D059FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF1F4F7FF),
+ dataGray2: Color(astryxRGBA: 0xCCD3DBFF),
+ dataGray3: Color(astryxRGBA: 0xAFB9C4FF),
+ dataGray4: Color(astryxRGBA: 0x5D6C7BFF),
+ dataGray5: Color(astryxRGBA: 0x25363FFF),
+ dataNeutral: Color(astryxRGBA: 0x8494A3FF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFFC3C3FF),
+ errorMuted: Color(astryxRGBA: 0xFFC3C3FF),
+ iconAccent: Color(astryxRGBA: 0x2D241BFF),
+ iconBlue: Color(astryxRGBA: 0x003454FF),
+ iconCyan: Color(astryxRGBA: 0x005250FF),
+ iconDisabled: Color(astryxRGBA: 0xD1C5B8FF),
+ iconGray: Color(astryxRGBA: 0x4F453BFF),
+ iconGreen: Color(astryxRGBA: 0x3F4E00FF),
+ iconOrange: Color(astryxRGBA: 0x703400FF),
+ iconPink: Color(astryxRGBA: 0x82004FFF),
+ iconPrimary: Color(astryxRGBA: 0x2D241BFF),
+ iconPurple: Color(astryxRGBA: 0x431A88FF),
+ iconRed: Color(astryxRGBA: 0x880023FF),
+ iconSecondary: Color(astryxRGBA: 0x675D52FF),
+ iconTeal: Color(astryxRGBA: 0x00553BFF),
+ iconYellow: Color(astryxRGBA: 0x584400FF),
+ neutral: Color(astryxRGBA: 0x2D241B10),
+ onAccent: Color(astryxRGBA: 0xFFFFFFFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0x880023FF),
+ onLight: Color(astryxRGBA: 0x2D241BFF),
+ onSuccess: Color(astryxRGBA: 0x3F4E00FF),
+ onWarning: Color(astryxRGBA: 0x584400FF),
+ overlay: Color(astryxRGBA: 0x2D241B80),
+ overlayHover: Color(astryxRGBA: 0x2D241B0D),
+ overlayPressed: Color(astryxRGBA: 0x2D241B1A),
+ shadow: Color(astryxRGBA: 0x2D241B1A),
+ skeleton: Color(astryxRGBA: 0xD1C5B8FF),
+ success: Color(astryxRGBA: 0xC5E17AFF),
+ successMuted: Color(astryxRGBA: 0xC5E17AFF),
+ syntaxAdded: Color(astryxRGBA: 0xC5E17A40),
+ syntaxAddedMarker: Color(astryxRGBA: 0x3F4E00FF),
+ syntaxAttribute: Color(astryxRGBA: 0x745B00FF),
+ syntaxBackground: Color(astryxRGBA: 0xFFF6EDFF),
+ syntaxComment: Color(astryxRGBA: 0x675D52FF),
+ syntaxConstant: Color(astryxRGBA: 0x904800FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x00649BFF),
+ syntaxKeyword: Color(astryxRGBA: 0x663EBDFF),
+ syntaxNumber: Color(astryxRGBA: 0x904800FF),
+ syntaxOperator: Color(astryxRGBA: 0x675D52FF),
+ syntaxProperty: Color(astryxRGBA: 0x007050FF),
+ syntaxPunctuation: Color(astryxRGBA: 0x675D52FF),
+ syntaxRemoved: Color(astryxRGBA: 0xFFC3C340),
+ syntaxRemovedMarker: Color(astryxRGBA: 0x880023FF),
+ syntaxString: Color(astryxRGBA: 0x546800FF),
+ syntaxTag: Color(astryxRGBA: 0x9D002AFF),
+ syntaxType: Color(astryxRGBA: 0x663EBDFF),
+ syntaxVariable: Color(astryxRGBA: 0x675D52FF),
+ textAccent: Color(astryxRGBA: 0x2D241BFF),
+ textBlue: Color(astryxRGBA: 0x003454FF),
+ textCyan: Color(astryxRGBA: 0x005250FF),
+ textDisabled: Color(astryxRGBA: 0xD1C5B8FF),
+ textGray: Color(astryxRGBA: 0x4F453BFF),
+ textGreen: Color(astryxRGBA: 0x3F4E00FF),
+ textOrange: Color(astryxRGBA: 0x703400FF),
+ textPink: Color(astryxRGBA: 0x82004FFF),
+ textPrimary: Color(astryxRGBA: 0x2D241BFF),
+ textPurple: Color(astryxRGBA: 0x431A88FF),
+ textRed: Color(astryxRGBA: 0x880023FF),
+ textSecondary: Color(astryxRGBA: 0x675D52FF),
+ textTeal: Color(astryxRGBA: 0x00553BFF),
+ textYellow: Color(astryxRGBA: 0x584400FF),
+ tintHover: Color(astryxRGBA: 0x2D241BFF),
+ track: Color(astryxRGBA: 0xCCD3DBFF),
+ warning: Color(astryxRGBA: 0xFFE08AFF),
+ warningMuted: Color(astryxRGBA: 0xFFE08AFF)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 3,
+ s1: 6,
+ s1_5: 9,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 12,
+ s3: 18,
+ s4: 24,
+ s5: 30,
+ s6: 36,
+ s7: 42,
+ s8: 48,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 0,
+ container: 0,
+ element: 0,
+ full: 0,
+ inner: 0,
+ none: 0,
+ page: 0
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 48,
+ elementMd: 40,
+ elementSm: 32
+ ),
+ font: FontTokens(
+ bodyLeading: 1.5,
+ bodySize: 16,
+ bodyWeight: 400,
+ familyBody: ["Poppins", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Poppins", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.4194,
+ heading1Size: 31,
+ heading1Weight: 600,
+ heading2Leading: 1.44,
+ heading2Size: 25,
+ heading2Weight: 600,
+ heading3Leading: 1.4,
+ heading3Size: 20,
+ heading3Weight: 600,
+ heading4Leading: 1.5,
+ heading4Size: 16,
+ heading4Weight: 600,
+ heading5Leading: 1.5385,
+ heading5Size: 13,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.5,
+ labelSize: 16,
+ labelWeight: 500,
+ largeLeading: 1.4,
+ largeSize: 20,
+ largeWeight: 600,
+ size2xl: 31,
+ size2xs: 8,
+ size3xl: 39,
+ size3xs: 7,
+ size4xl: 49,
+ size4xs: 5,
+ size5xl: 61,
+ sizeBase: 16,
+ sizeLg: 20,
+ sizeSm: 13,
+ sizeXl: 25,
+ sizeXs: 10,
+ supportingLeading: 1.5385,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ ),
+ dark: Tokens(
+ color: ColorTokens(
+ accent: Color(astryxRGBA: 0xEDEFFCFF),
+ accentMuted: Color(astryxRGBA: 0xEDEFFC20),
+ backgroundBlue: Color(astryxRGBA: 0xADDBFFFF),
+ backgroundBody: Color(astryxRGBA: 0x0E0F1AFF),
+ backgroundCard: Color(astryxRGBA: 0x16182BFF),
+ backgroundCyan: Color(astryxRGBA: 0xBAEEECFF),
+ backgroundErrorInverted: Color(astryxRGBA: 0xE3193BFF),
+ backgroundGray: Color(astryxRGBA: 0xDFE2F3FF),
+ backgroundGreen: Color(astryxRGBA: 0xC5E17AFF),
+ backgroundInverted: Color(astryxRGBA: 0xEDEFFCFF),
+ backgroundMuted: Color(astryxRGBA: 0x1F2238FF),
+ backgroundOrange: Color(astryxRGBA: 0xFFC89DFF),
+ backgroundPink: Color(astryxRGBA: 0xFFBFD9FF),
+ backgroundPopover: Color(astryxRGBA: 0x1F2238FF),
+ backgroundPurple: Color(astryxRGBA: 0xD5CDFFFF),
+ backgroundRed: Color(astryxRGBA: 0xFFC3C3FF),
+ backgroundSurface: Color(astryxRGBA: 0x16182BFF),
+ backgroundTeal: Color(astryxRGBA: 0xA6E5C9FF),
+ backgroundYellow: Color(astryxRGBA: 0xFDE08FFF),
+ border: Color(astryxRGBA: 0xEDEFFC1A),
+ borderBlue: Color(astryxRGBA: 0x70C1FFFF),
+ borderCyan: Color(astryxRGBA: 0x84D8D4FF),
+ borderEmphasized: Color(astryxRGBA: 0x636889FF),
+ borderGray: Color(astryxRGBA: 0xD0D4EBFF),
+ borderGreen: Color(astryxRGBA: 0xB5D263FF),
+ borderOrange: Color(astryxRGBA: 0xFFB477FF),
+ borderPink: Color(astryxRGBA: 0xFFA8CDFF),
+ borderPurple: Color(astryxRGBA: 0xBBAAFFFF),
+ borderRed: Color(astryxRGBA: 0xFF969AFF),
+ borderTeal: Color(astryxRGBA: 0x8ED9B9FF),
+ borderYellow: Color(astryxRGBA: 0xF3D172FF),
+ dataBlue1: Color(astryxRGBA: 0xDBECFFFF),
+ dataBlue2: Color(astryxRGBA: 0x78BEFFFF),
+ dataBlue3: Color(astryxRGBA: 0x2694FEFF),
+ dataBlue4: Color(astryxRGBA: 0x004CBCFF),
+ dataBlue5: Color(astryxRGBA: 0x02165EFF),
+ dataCategoricalBlue: Color(astryxRGBA: 0x0171E3FF),
+ dataCategoricalBrown: Color(astryxRGBA: 0x965E03FF),
+ dataCategoricalCyan: Color(astryxRGBA: 0x0171A4FF),
+ dataCategoricalGreen: Color(astryxRGBA: 0x0B991FFF),
+ dataCategoricalIndigo: Color(astryxRGBA: 0x6F8AFFFF),
+ dataCategoricalOrange: Color(astryxRGBA: 0xEB6E00FF),
+ dataCategoricalPink: Color(astryxRGBA: 0xF351C0FF),
+ dataCategoricalPurple: Color(astryxRGBA: 0x6B1EFDFF),
+ dataCategoricalRed: Color(astryxRGBA: 0xF5394FFF),
+ dataCategoricalTeal: Color(astryxRGBA: 0x08A3A3FF),
+ dataGray1: Color(astryxRGBA: 0xF2F4F6FF),
+ dataGray2: Color(astryxRGBA: 0xD0D3D6FF),
+ dataGray3: Color(astryxRGBA: 0xB2B8BEFF),
+ dataGray4: Color(astryxRGBA: 0x666A72FF),
+ dataGray5: Color(astryxRGBA: 0x333338FF),
+ dataNeutral: Color(astryxRGBA: 0x8C939BFF),
+ dataOrange1: Color(astryxRGBA: 0xFFE6CFFF),
+ dataOrange2: Color(astryxRGBA: 0xFDB876FF),
+ dataOrange3: Color(astryxRGBA: 0xFD9537FF),
+ dataOrange4: Color(astryxRGBA: 0xD66100FF),
+ dataOrange5: Color(astryxRGBA: 0xA13F04FF),
+ dataPink1: Color(astryxRGBA: 0xFCE3F4FF),
+ dataPink2: Color(astryxRGBA: 0xFEADE3FF),
+ dataPink3: Color(astryxRGBA: 0xF989D3FF),
+ dataPink4: Color(astryxRGBA: 0xD123A1FF),
+ dataPink5: Color(astryxRGBA: 0x8E1073FF),
+ dataPurple1: Color(astryxRGBA: 0xE8E8FBFF),
+ dataPurple2: Color(astryxRGBA: 0xB3B0FEFF),
+ dataPurple3: Color(astryxRGBA: 0x9081FFFF),
+ dataPurple4: Color(astryxRGBA: 0x6B1EFDFF),
+ dataPurple5: Color(astryxRGBA: 0x3E0697FF),
+ dataRed1: Color(astryxRGBA: 0xFEE4E6FF),
+ dataRed2: Color(astryxRGBA: 0xFFB2B8FF),
+ dataRed3: Color(astryxRGBA: 0xFB7D87FF),
+ dataRed4: Color(astryxRGBA: 0xD31130FF),
+ dataRed5: Color(astryxRGBA: 0x9D0519FF),
+ dataShamrock1: Color(astryxRGBA: 0xD6FEE4FF),
+ dataShamrock2: Color(astryxRGBA: 0x8EF7AAFF),
+ dataShamrock3: Color(astryxRGBA: 0x24BB5EFF),
+ dataShamrock4: Color(astryxRGBA: 0x138546FF),
+ dataShamrock5: Color(astryxRGBA: 0x0B603DFF),
+ dataTeal1: Color(astryxRGBA: 0xD7FCF8FF),
+ dataTeal2: Color(astryxRGBA: 0x6CE6D8FF),
+ dataTeal3: Color(astryxRGBA: 0x0DB7AFFF),
+ dataTeal4: Color(astryxRGBA: 0x0C9293FF),
+ dataTeal5: Color(astryxRGBA: 0x08767DFF),
+ dataYellow1: Color(astryxRGBA: 0xFDF6BAFF),
+ dataYellow2: Color(astryxRGBA: 0xFCEC85FF),
+ dataYellow3: Color(astryxRGBA: 0xFBCE03FF),
+ dataYellow4: Color(astryxRGBA: 0xD69804FF),
+ dataYellow5: Color(astryxRGBA: 0x8A5001FF),
+ error: Color(astryxRGBA: 0xFFC3C3FF),
+ errorMuted: Color(astryxRGBA: 0xFFC3C3FF),
+ iconAccent: Color(astryxRGBA: 0xEDEFFCFF),
+ iconBlue: Color(astryxRGBA: 0x003454FF),
+ iconCyan: Color(astryxRGBA: 0x002D2CFF),
+ iconDisabled: Color(astryxRGBA: 0x4A4F6BFF),
+ iconGray: Color(astryxRGBA: 0x16182BFF),
+ iconGreen: Color(astryxRGBA: 0x2A3600FF),
+ iconOrange: Color(astryxRGBA: 0x411800FF),
+ iconPink: Color(astryxRGBA: 0x5D0037FF),
+ iconPrimary: Color(astryxRGBA: 0xEDEFFCFF),
+ iconPurple: Color(astryxRGBA: 0x2A1159FF),
+ iconRed: Color(astryxRGBA: 0x610016FF),
+ iconSecondary: Color(astryxRGBA: 0xA6ACD6FF),
+ iconTeal: Color(astryxRGBA: 0x002F1EFF),
+ iconYellow: Color(astryxRGBA: 0x3D2E00FF),
+ neutral: Color(astryxRGBA: 0xEDEFFC1A),
+ onAccent: Color(astryxRGBA: 0x16182BFF),
+ onDark: Color(astryxRGBA: 0xFFFFFFFF),
+ onError: Color(astryxRGBA: 0x610016FF),
+ onLight: Color(astryxRGBA: 0x2D241BFF),
+ onSuccess: Color(astryxRGBA: 0x2A3600FF),
+ onWarning: Color(astryxRGBA: 0x3D2E00FF),
+ overlay: Color(astryxRGBA: 0x0E0F1ACC),
+ overlayHover: Color(astryxRGBA: 0xEDEFFC0D),
+ overlayPressed: Color(astryxRGBA: 0xEDEFFC1A),
+ shadow: Color(astryxRGBA: 0x0000004D),
+ skeleton: Color(astryxRGBA: 0x2C3048FF),
+ success: Color(astryxRGBA: 0xC5E17AFF),
+ successMuted: Color(astryxRGBA: 0xC5E17AFF),
+ syntaxAdded: Color(astryxRGBA: 0xC5E17A33),
+ syntaxAddedMarker: Color(astryxRGBA: 0x95B041FF),
+ syntaxAttribute: Color(astryxRGBA: 0xD0A601FF),
+ syntaxBackground: Color(astryxRGBA: 0x0E0F1AFF),
+ syntaxComment: Color(astryxRGBA: 0xA6ACD6FF),
+ syntaxConstant: Color(astryxRGBA: 0xFFB477FF),
+ syntaxDiffHeader: Color(astryxRGBA: 0x00000000),
+ syntaxFunction: Color(astryxRGBA: 0x70C1FFFF),
+ syntaxKeyword: Color(astryxRGBA: 0xBBAAFFFF),
+ syntaxNumber: Color(astryxRGBA: 0xFFB477FF),
+ syntaxOperator: Color(astryxRGBA: 0xA6ACD6FF),
+ syntaxProperty: Color(astryxRGBA: 0x5BC29AFF),
+ syntaxPunctuation: Color(astryxRGBA: 0xA6ACD6FF),
+ syntaxRemoved: Color(astryxRGBA: 0xFFC3C333),
+ syntaxRemovedMarker: Color(astryxRGBA: 0xFF969AFF),
+ syntaxString: Color(astryxRGBA: 0x95B041FF),
+ syntaxTag: Color(astryxRGBA: 0xFF969AFF),
+ syntaxType: Color(astryxRGBA: 0xBBAAFFFF),
+ syntaxVariable: Color(astryxRGBA: 0xA6ACD6FF),
+ textAccent: Color(astryxRGBA: 0xEDEFFCFF),
+ textBlue: Color(astryxRGBA: 0x003454FF),
+ textCyan: Color(astryxRGBA: 0x002D2CFF),
+ textDisabled: Color(astryxRGBA: 0x4A4F6BFF),
+ textGray: Color(astryxRGBA: 0x16182BFF),
+ textGreen: Color(astryxRGBA: 0x2A3600FF),
+ textOrange: Color(astryxRGBA: 0x411800FF),
+ textPink: Color(astryxRGBA: 0x5D0037FF),
+ textPrimary: Color(astryxRGBA: 0xEDEFFCFF),
+ textPurple: Color(astryxRGBA: 0x2A1159FF),
+ textRed: Color(astryxRGBA: 0x610016FF),
+ textSecondary: Color(astryxRGBA: 0xA6ACD6FF),
+ textTeal: Color(astryxRGBA: 0x002F1EFF),
+ textYellow: Color(astryxRGBA: 0x3D2E00FF),
+ tintHover: Color(astryxRGBA: 0xEDEFFCFF),
+ track: Color(astryxRGBA: 0x5A5E66FF),
+ warning: Color(astryxRGBA: 0xFDE08FFF),
+ warningMuted: Color(astryxRGBA: 0xFDE08FFF)
+ ),
+ space: SpaceTokens(
+ s0: 0,
+ s0_5: 3,
+ s1: 6,
+ s1_5: 9,
+ s10: 40,
+ s11: 44,
+ s12: 48,
+ s2: 12,
+ s3: 18,
+ s4: 24,
+ s5: 30,
+ s6: 36,
+ s7: 42,
+ s8: 48,
+ s9: 36
+ ),
+ radius: RadiusTokens(
+ chat: 0,
+ container: 0,
+ element: 0,
+ full: 0,
+ inner: 0,
+ none: 0,
+ page: 0
+ ),
+ size: SizeTokens(
+ borderWidth: 1,
+ elementLg: 48,
+ elementMd: 40,
+ elementSm: 32
+ ),
+ font: FontTokens(
+ bodyLeading: 1.5,
+ bodySize: 16,
+ bodyWeight: 400,
+ familyBody: ["Poppins", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ familyCode: ["JetBrains Mono", "SF Mono", "Monaco", "Consolas", "monospace"],
+ familyHeading: ["Poppins", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", "sans-serif"],
+ heading1Leading: 1.4194,
+ heading1Size: 31,
+ heading1Weight: 600,
+ heading2Leading: 1.44,
+ heading2Size: 25,
+ heading2Weight: 600,
+ heading3Leading: 1.4,
+ heading3Size: 20,
+ heading3Weight: 600,
+ heading4Leading: 1.5,
+ heading4Size: 16,
+ heading4Weight: 600,
+ heading5Leading: 1.5385,
+ heading5Size: 13,
+ heading5Weight: 600,
+ heading6Leading: 1.6,
+ heading6Size: 10,
+ heading6Weight: 600,
+ labelLeading: 1.5,
+ labelSize: 16,
+ labelWeight: 500,
+ largeLeading: 1.4,
+ largeSize: 20,
+ largeWeight: 600,
+ size2xl: 31,
+ size2xs: 8,
+ size3xl: 39,
+ size3xs: 7,
+ size4xl: 49,
+ size4xs: 5,
+ size5xl: 61,
+ sizeBase: 16,
+ sizeLg: 20,
+ sizeSm: 13,
+ sizeXl: 25,
+ sizeXs: 10,
+ supportingLeading: 1.5385,
+ supportingSize: 12,
+ supportingWeight: 400,
+ weightBold: 700,
+ weightMedium: 500,
+ weightNormal: 400,
+ weightSemibold: 600
+ )
+ )
+ )
+}
diff --git a/packages/native/apple/Sources/Astryx/Theme/AstryxTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Theme.swift
similarity index 71%
rename from packages/native/apple/Sources/Astryx/Theme/AstryxTheme.swift
rename to packages/native/apple/Sources/Astryx/Theme/Theme.swift
index 69120b2acc..522cedd999 100644
--- a/packages/native/apple/Sources/Astryx/Theme/AstryxTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Theme.swift
@@ -9,68 +9,64 @@ import UIKit
import AppKit
#endif
-/// One mode of a theme, resolved: colors as `#RRGGBBAA`, sizes in points, and
-/// font families as their CSS stacks, first choice first, keyed by core's
-/// token names without the leading `--`.
-public struct AstryxTokens: Equatable, Sendable {
- public var colors: [String: String]
- public var sizes: [String: Double]
- public var fonts: [String: [String]]
-
- public init(colors: [String: String], sizes: [String: Double], fonts: [String: [String]] = [:]) {
- self.colors = colors
- self.sizes = sizes
- self.fonts = fonts
- }
-}
-
-/// A theme's light and dark tokens. `AstryxTheme.default` is core's default
-/// theme, generated from core's own resolver.
-public struct AstryxTheme: Equatable, Sendable {
- public var light: AstryxTokens
- public var dark: AstryxTokens
+/// A theme's light and dark tokens, as typed members (`Generated/Tokens.swift`).
+/// Every `Theme.<name>` is generated from an Astryx theme by core's own
+/// resolver (`Generated/`); `Theme.default` is core's defaults. An app
+/// generates its own theme the same way.
+public struct Theme: Equatable, Sendable {
+ public var light: Tokens
+ public var dark: Tokens
/// SF Symbols that replace the defaults for shared icon names, such as
/// `["success": "checkmark.seal.fill"]` (AST-082 FR17).
public var icons: [String: String]
+ /// Native visual intent from `defineNativeTheme`. Reserved: empty until a
+ /// component reads it.
+ public var native: NativeIntent
- public init(light: AstryxTokens, dark: AstryxTokens, icons: [String: String] = [:]) {
+ public init(light: Tokens, dark: Tokens, icons: [String: String] = [:], native: NativeIntent = .init()) {
self.light = light
self.dark = dark
self.icons = icons
+ self.native = native
}
+}
- public static let `default` = AstryxTheme(
- light: .defaultLight,
- dark: .defaultDark
- )
+/// Native visual intent a theme carries beside its tokens (durable `material`,
+/// platform entries), resolved for the running OS version. Reserved and empty
+/// until the first component reads it.
+public struct NativeIntent: Equatable, Sendable {
+ public init() {}
}
/// The tokens a component paints with: one mode of the theme, grown by the
/// person's Dynamic Type setting. Components read every color, size, and font
/// from here, never from a constant of their own.
public struct AstryxStyle: Sendable {
- public let tokens: AstryxTokens
+ /// The theme's tokens in the current mode, as typed members
+ /// (`tokens.color.textPrimary`).
+ public let tokens: Tokens
/// How much Dynamic Type grows text at the person's setting (1 at Large).
public let textScale: CGFloat
/// The theme's replacements for shared icon names.
public let icons: [String: String]
- public init(tokens: AstryxTokens, textScale: CGFloat = 1, icons: [String: String] = [:]) {
+ public init(tokens: Tokens, textScale: CGFloat = 1, icons: [String: String] = [:]) {
self.tokens = tokens
self.textScale = textScale
self.icons = icons
}
- /// A token color. A token the theme does not define draws clear, so a
- /// missing token shows up in review instead of a guessed color.
+ /// A token color by its CSS name, for code that only has the name. A name
+ /// the theme does not define draws clear. New code reads the typed members.
public func color(_ token: String) -> Color {
- guard let hex = tokens.colors[token] else { return .clear }
- return Color(astryxHex: hex)
+ tokens.color.value(named: token) ?? .clear
}
- /// A token size in points, or `fallback` when the theme does not define it.
+ /// A token size in points by its CSS name, or `fallback` when the theme does
+ /// not define it. New code reads the typed members.
public func size(_ token: String, _ fallback: CGFloat) -> CGFloat {
- tokens.sizes[token].map { CGFloat($0) } ?? fallback
+ tokens.space.value(named: token) ?? tokens.radius.value(named: token)
+ ?? tokens.size.value(named: token) ?? tokens.font.number(named: token) ?? fallback
}
/// A step on the spacing ladder: `space(4)` reads `spacing-4`.
@@ -93,7 +89,7 @@ public struct AstryxStyle: Sendable {
family: String = "font-family-body"
) -> Font {
astryxFont(
- families: tokens.fonts[family] ?? [],
+ families: tokens.font.families(named: family) ?? [],
size: fontSize(token, fallback),
weight: fontWeight(size(weight, 400))
)
@@ -121,8 +117,19 @@ public struct AstryxStyle: Sendable {
}
extension Color {
- /// A color from `#RRGGBBAA`, the form the generated tokens use. `#RRGGBB`
- /// and `#RGB` also read; anything else is clear.
+ /// A color from `0xRRGGBBAA` in sRGB, the form the generated themes use.
+ public init(astryxRGBA value: UInt32) {
+ self.init(
+ .sRGB,
+ red: Double((value >> 24) & 0xFF) / 255,
+ green: Double((value >> 16) & 0xFF) / 255,
+ blue: Double((value >> 8) & 0xFF) / 255,
+ opacity: Double(value & 0xFF) / 255
+ )
+ }
+
+ /// A color from `#RRGGBBAA`. `#RRGGBB` and `#RGB` also read; anything else
+ /// is clear.
public init(astryxHex hex: String) {
var digits = hex.hasPrefix("#") ? String(hex.dropFirst()) : hex
if digits.count == 3 { digits = digits.map { "\($0)\($0)" }.joined() }
@@ -194,12 +201,12 @@ func astryxTextScale(for size: DynamicTypeSize) -> CGFloat {
}
private struct AstryxThemeKey: EnvironmentKey {
- static let defaultValue = AstryxTheme.default
+ static let defaultValue = Theme.default
}
extension EnvironmentValues {
/// The theme `astryxTheme(_:)` sets; core's default theme without it.
- public var astryxTheme: AstryxTheme {
+ public var astryxTheme: Theme {
get { self[AstryxThemeKey.self] }
set { self[AstryxThemeKey.self] = newValue }
}
@@ -220,7 +227,7 @@ extension EnvironmentValues {
extension View {
/// Paints this subtree with a theme. Components follow the color scheme and
/// the person's text size either way.
- public func astryxTheme(_ theme: AstryxTheme = .default) -> some View {
+ public func astryxTheme(_ theme: Theme = .default) -> some View {
environment(\.astryxTheme, theme)
}
}
diff --git a/packages/native/apple/Tests/AstryxTests/BannerTests.swift b/packages/native/apple/Tests/AstryxTests/BannerTests.swift
index 91f7e4e1de..babf7fc184 100644
--- a/packages/native/apple/Tests/AstryxTests/BannerTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/BannerTests.swift
@@ -5,25 +5,25 @@ import Testing
@testable import Astryx
@Test func bannerStatusesUseSharedIconNamesAndCoreTokens() {
- let style = AstryxStyle(tokens: .defaultLight)
+ let style = AstryxStyle(tokens: Theme.default.light)
#expect(AstryxBannerStatus.allCases.map(\.iconName) == ["info", "warning", "error", "success"])
for status in AstryxBannerStatus.allCases {
#expect(style.icon(status.iconName) != nil)
- #expect(style.tokens.colors[status.groundToken] != nil)
- #expect(style.tokens.colors[status.iconToken] != nil)
+ #expect(style.tokens.color.value(named: status.groundToken) != nil)
+ #expect(style.tokens.color.value(named: status.iconToken) != nil)
}
}
@Test func aThemeReplacesASharedIcon() {
- let style = AstryxStyle(tokens: .defaultLight, icons: ["success": "checkmark.seal.fill"])
+ let style = AstryxStyle(tokens: Theme.default.light, icons: ["success": "checkmark.seal.fill"])
#expect(style.icon("success") == "checkmark.seal.fill")
#expect(style.icon("error") == "exclamationmark.circle.fill")
}
@MainActor
@Test func aBannerPaintsItsStatusGround() {
- var theme = AstryxTheme.default
- theme.light.colors["color-success-muted"] = "#FDE68AFF"
+ var theme = Theme.default
+ theme.light.color.successMuted = Color(astryxRGBA: 0xFDE68AFF)
let banner = AstryxBanner(status: .success, title: "Saved").frame(width: 240)
let pixels = Pixels(banner, theme: theme)
#expect(close(pixels.at(pixels.width - 6, pixels.height / 2), rgba("#FDE68AFF")))
diff --git a/packages/native/apple/Tests/AstryxTests/ButtonTests.swift b/packages/native/apple/Tests/AstryxTests/ButtonTests.swift
index 1c57f5cd6a..dba9c4435e 100644
--- a/packages/native/apple/Tests/AstryxTests/ButtonTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/ButtonTests.swift
@@ -23,7 +23,7 @@ import Testing
@MainActor
@Test func aLoadingButtonIsNotDimmedAndKeepsItsWidth() {
- let accent = rgba(AstryxTokens.defaultLight.colors["color-accent"]!)
+ let accent = rgba(Theme.default.light.color.accent)
let loading = Pixels(AstryxButton(label: "Continue", variant: .primary, isLoading: true) {}.fixedSize())
let ready = Pixels(AstryxButton(label: "Continue", variant: .primary) {}.fixedSize())
#expect(close(loading.at(8, loading.height / 2), accent))
@@ -32,7 +32,7 @@ import Testing
@MainActor
@Test func aDisabledButtonIsDimmed() {
- let accent = rgba(AstryxTokens.defaultLight.colors["color-accent"]!)
+ let accent = rgba(Theme.default.light.color.accent)
let disabled = Pixels(AstryxButton(label: "Continue", variant: .primary, isDisabled: true) {}.fixedSize())
#expect(!close(disabled.at(8, disabled.height / 2), accent))
}
@@ -60,8 +60,8 @@ import Testing
}
@Test func buttonIconsUseSharedNamesAndTheTheme() {
- #expect(AstryxStyle(tokens: .defaultLight).icon("search") == "magnifyingglass")
- #expect(AstryxStyle(tokens: .defaultLight, icons: ["search": "sparkle.magnifyingglass"]).icon("search") == "sparkle.magnifyingglass")
+ #expect(AstryxStyle(tokens: Theme.default.light).icon("search") == "magnifyingglass")
+ #expect(AstryxStyle(tokens: Theme.default.light, icons: ["search": "sparkle.magnifyingglass"]).icon("search") == "sparkle.magnifyingglass")
}
@MainActor
diff --git a/packages/native/apple/Tests/AstryxTests/EnvironmentTests.swift b/packages/native/apple/Tests/AstryxTests/EnvironmentTests.swift
index d935326517..d0acb80fd0 100644
--- a/packages/native/apple/Tests/AstryxTests/EnvironmentTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/EnvironmentTests.swift
@@ -12,8 +12,8 @@ import Testing
let card = AstryxCard { Color.clear.frame(width: 80, height: 40) }.frame(width: 120)
let light = Pixels(card, scheme: .light)
let dark = Pixels(card, scheme: .dark)
- #expect(close(light.at(60, light.height / 2), rgba(AstryxTokens.defaultLight.colors["color-background-card"]!)))
- #expect(close(dark.at(60, dark.height / 2), rgba(AstryxTokens.defaultDark.colors["color-background-card"]!)))
+ #expect(close(light.at(60, light.height / 2), rgba(Theme.default.light.color.backgroundCard)))
+ #expect(close(dark.at(60, dark.height / 2), rgba(Theme.default.dark.color.backgroundCard)))
}
@MainActor
@@ -31,6 +31,6 @@ import Testing
}
@Test func theDefaultThemeCarriesCoresFontFamilies() {
- #expect(AstryxTokens.defaultLight.fonts["font-family-body"]?.first == "-apple-system")
- #expect(AstryxTokens.defaultLight.fonts["font-family-heading"] != nil)
+ #expect(Theme.default.light.font.familyBody.first == "-apple-system")
+ #expect(Theme.default.light.font.familyHeading.isEmpty == false)
}
diff --git a/packages/native/apple/Tests/AstryxTests/HeadingTests.swift b/packages/native/apple/Tests/AstryxTests/HeadingTests.swift
index d22213f720..845b598175 100644
--- a/packages/native/apple/Tests/AstryxTests/HeadingTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/HeadingTests.swift
@@ -26,9 +26,9 @@ import Testing
let largest = Pixels(AstryxHeading("Settings").fixedSize(), typeSize: .accessibility5)
#expect(largest.width > large.width * 2)
- var theme = AstryxTheme.default
- theme.light.sizes["text-heading-2-size"] = 48
- theme.light.colors["color-text-primary"] = "#FF0000FF"
+ var theme = Theme.default
+ theme.light.font.heading2Size = 48
+ theme.light.color.textPrimary = Color(astryxRGBA: 0xFF0000FF)
let themed = Pixels(AstryxHeading("Settings").fixedSize(), theme: theme)
#expect(themed.width > large.width)
#expect(themed.contains { $0[0] > 200 && $0[1] < 60 && $0[2] < 60 && $0[3] > 200 })
diff --git a/packages/native/apple/Tests/AstryxTests/Pixels.swift b/packages/native/apple/Tests/AstryxTests/Pixels.swift
index 9d5a027fd7..916cf571da 100644
--- a/packages/native/apple/Tests/AstryxTests/Pixels.swift
+++ b/packages/native/apple/Tests/AstryxTests/Pixels.swift
@@ -14,7 +14,7 @@ struct Pixels {
@MainActor
init<V: View>(
_ view: V,
- theme: AstryxTheme? = nil,
+ theme: Theme? = nil,
scheme: ColorScheme = .light,
typeSize: DynamicTypeSize = .large
) {
@@ -57,6 +57,12 @@ func rgba(_ hex: String) -> [Int] {
return [24, 16, 8, 0].map { Int((value >> UInt32($0)) & 0xFF) }
}
+/// The components of a theme color, resolved in sRGB.
+func rgba(_ color: Color) -> [Int] {
+ let r = color.resolve(in: EnvironmentValues())
+ return [r.red, r.green, r.blue, r.opacity].map { Int(($0 * 255).rounded()) }
+}
+
func close(_ a: [Int], _ b: [Int], within tolerance: Int = 8) -> Bool {
zip(a, b).allSatisfy { abs($0 - $1) <= tolerance }
}
diff --git a/packages/native/apple/Tests/AstryxTests/TextInputTests.swift b/packages/native/apple/Tests/AstryxTests/TextInputTests.swift
index 87d99e4fc9..45bd2de702 100644
--- a/packages/native/apple/Tests/AstryxTests/TextInputTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/TextInputTests.swift
@@ -16,8 +16,8 @@ import Testing
@MainActor
@Test func aFieldLabelUsesTheSecondaryTextColor() {
- var theme = AstryxTheme.default
- theme.light.colors["color-text-secondary"] = "#FF0000FF"
+ var theme = Theme.default
+ theme.light.color.textSecondary = Color(astryxRGBA: 0xFF0000FF)
let pixels = Pixels(AstryxTextInput(label: "Email", value: .constant("")).frame(width: 240), theme: theme)
#expect(pixels.contains { $0[0] > 200 && $0[1] < 60 && $0[2] < 60 && $0[3] > 200 })
}
diff --git a/packages/native/apple/Tests/AstryxTests/ThemeTests.swift b/packages/native/apple/Tests/AstryxTests/ThemeTests.swift
index 1882f24bc3..7fd32951fa 100644
--- a/packages/native/apple/Tests/AstryxTests/ThemeTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/ThemeTests.swift
@@ -5,28 +5,34 @@ import Testing
@testable import Astryx
@Test func defaultThemeCarriesCoreTokensInBothModes() {
- for tokens in [AstryxTokens.defaultLight, AstryxTokens.defaultDark] {
- for color in ["color-accent", "color-on-accent", "color-text-primary", "color-background-card"] {
- #expect(tokens.colors[color] != nil, "missing \(color)")
- }
- #expect(tokens.sizes["size-element-md"] == 32)
- #expect(tokens.sizes["radius-element"] == 8)
+ for tokens in [Theme.default.light, Theme.default.dark] {
+ #expect(tokens.size.elementMd == 32)
+ #expect(tokens.radius.element == 8)
+ #expect(tokens.font.familyBody.isEmpty == false)
}
- #expect(AstryxTokens.defaultLight.colors["color-text-primary"] != AstryxTokens.defaultDark.colors["color-text-primary"])
+ #expect(Theme.default.light.color.textPrimary != Theme.default.dark.color.textPrimary)
}
-@Test func styleReadsTokensAndFallsBackOnlyForSizes() {
- let style = AstryxStyle(
- tokens: AstryxTokens(colors: ["color-accent": "#0064E0FF"], sizes: ["spacing-4": 16]),
- textScale: 1.5
- )
- #expect(style.space(4) == 16)
- #expect(style.space(3) == 12)
- #expect(style.size("radius-element", 8) == 8)
- #expect(style.fontSize("spacing-4", 0) == 24)
+@Test func everyPublishedThemeIsGenerated() {
+ let themes: [Theme] = [.default, .butter, .chocolate, .gothic, .matcha, .neutral, .stone, .y2k]
+ #expect(Set(themes.map(\.light.color.accent.description)).count > 1)
+ #expect(Theme.neutral.native == NativeIntent())
+}
+
+@Test func styleReadsTokensByNameAndFallsBackOnlyForSizes() {
+ let style = AstryxStyle(tokens: Theme.default.light, textScale: 1.5)
+ #expect(style.space(4) == Theme.default.light.space.s4)
+ #expect(style.size("radius-element", 0) == 8)
+ #expect(style.size("size-missing", 7) == 7)
+ #expect(style.fontSize("text-body-size", 0) == Theme.default.light.font.bodySize * 1.5)
+ #expect(style.color("color-accent") == Theme.default.light.color.accent)
#expect(style.color("color-missing") == .clear)
}
+@Test func rgbaColorsRead() {
+ #expect(Color(astryxRGBA: 0x0064E0FF) == Color(.sRGB, red: 0, green: 100 / 255, blue: 224 / 255, opacity: 1))
+}
+
@Test func hexColorsRead() {
#expect(Color(astryxHex: "#0064E0FF") == Color(.sRGB, red: 0, green: 100 / 255, blue: 224 / 255, opacity: 1))
#expect(Color(astryxHex: "#FFF") == Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1))
diff --git a/packages/native/apple/Tests/AstryxTests/TwoThemeTests.swift b/packages/native/apple/Tests/AstryxTests/TwoThemeTests.swift
index 70cdc1b7c4..a675c02f9e 100644
--- a/packages/native/apple/Tests/AstryxTests/TwoThemeTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/TwoThemeTests.swift
@@ -11,19 +11,19 @@ import Testing
/// Core's default tokens with a different accent, card, text color, type
/// size, and corner shape, in both modes.
-private let secondTheme: AstryxTheme = {
- func restyle(_ base: AstryxTokens) -> AstryxTokens {
+private let secondTheme: Theme = {
+ func restyle(_ base: Tokens) -> Tokens {
var tokens = base
- tokens.colors["color-accent"] = "#C2410CFF"
- tokens.colors["color-background-card"] = "#FDE68AFF"
- tokens.colors["color-text-primary"] = "#FF0000FF"
- tokens.sizes["text-label-size"] = 28
- tokens.sizes["text-body-size"] = 30
- tokens.sizes["radius-container"] = 0
- tokens.sizes["radius-element"] = 0
+ tokens.color.accent = Color(astryxRGBA: 0xC2410CFF)
+ tokens.color.backgroundCard = Color(astryxRGBA: 0xFDE68AFF)
+ tokens.color.textPrimary = Color(astryxRGBA: 0xFF0000FF)
+ tokens.font.labelSize = 28
+ tokens.font.bodySize = 30
+ tokens.radius.container = 0
+ tokens.radius.element = 0
return tokens
}
- return AstryxTheme(light: restyle(.defaultLight), dark: restyle(.defaultDark))
+ return Theme(light: restyle(Theme.default.light), dark: restyle(Theme.default.dark))
}()
@MainActor
@@ -33,7 +33,7 @@ private let secondTheme: AstryxTheme = {
let second = Pixels(card, theme: secondTheme)
let center = (second.width / 2, second.height / 2)
- #expect(close(standard.at(center.0, center.1), rgba(AstryxTokens.defaultLight.colors["color-background-card"]!)))
+ #expect(close(standard.at(center.0, center.1), rgba(Theme.default.light.color.backgroundCard)))
#expect(close(second.at(center.0, center.1), rgba("#FDE68AFF")))
// Corner shape: the default container radius leaves the corner empty;
// a radius of 0 fills it.
@@ -47,7 +47,7 @@ private let secondTheme: AstryxTheme = {
let standard = Pixels(button, theme: .default)
let second = Pixels(button, theme: secondTheme)
- #expect(close(standard.at(8, standard.height / 2), rgba(AstryxTokens.defaultLight.colors["color-accent"]!)))
+ #expect(close(standard.at(8, standard.height / 2), rgba(Theme.default.light.color.accent)))
#expect(close(second.at(8, second.height / 2), rgba("#C2410CFF")))
// A larger label size makes the same label wider.
#expect(second.width > standard.width)
diff --git a/packages/native/scripts/swift-ios-theme.d.mts b/packages/native/scripts/swift-ios-theme.d.mts
index bb62e26787..c32085f44e 100644
--- a/packages/native/scripts/swift-ios-theme.d.mts
+++ b/packages/native/scripts/swift-ios-theme.d.mts
@@ -1,7 +1,48 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-export declare const SWIFT_IOS_THEME_FILE: string;
+import type {DefinedTheme} from '@astryxdesign/core/theme';
+
+export type TokenGroup = 'color' | 'space' | 'radius' | 'size' | 'font';
+export interface SwiftMember {
+ group: TokenGroup;
+ member: string;
+}
+export interface PublishedThemePackage {
+ packageName: string;
+ dir: string;
+ exportName: string;
+ sourceFile: string;
+}
+export type ThemeLoader = (file: string) => Promise<Record<string, unknown>>;
+
+export declare const SWIFT_THEME_DIR: string;
+export declare const SWIFT_TOKENS_FILE: string;
+export declare function swiftMember(token: string): SwiftMember | null;
+export declare function swiftThemeName(themeName: string): string;
+export declare function themeFileName(swiftName: string): string;
export declare function toHexColor(value: string): string | null;
export declare function toPoints(value: string): number | null;
-export declare function toFontFamilies(value: string): string[];
-export declare function renderSwiftIOSTheme(): Promise<string>;
+export declare function toFamilies(value: string): string[] | null;
+export declare function valueForMode(
+ value: string,
+ mode: 'light' | 'dark',
+): string;
+export declare const CORE_DEFAULTS: DefinedTheme;
+export declare function localTokensLeftOut(theme: DefinedTheme): string[];
+export declare function tokenSurface(
+ resolved: Record<string, SwiftMember>,
+): Record<TokenGroup, {token: string; member: string; type: string}[]>;
+export declare function defaultTheme(): Promise<DefinedTheme>;
+export declare function defineTheme(input: {
+ name: string;
+ tokens: Record<string, string | [string, string]>;
+ localTokens?: Record<string, string | [string, string]>;
+}): Promise<DefinedTheme>;
+export declare function renderSwiftTheme(
+ theme: DefinedTheme,
+ options?: {source?: string; regenerate?: string},
+): Promise<string>;
+export declare function publishedThemePackages(): PublishedThemePackage[];
+export declare function renderAll(
+ load: ThemeLoader,
+): Promise<Record<string, string>>;
diff --git a/packages/native/scripts/swift-ios-theme.mjs b/packages/native/scripts/swift-ios-theme.mjs
index 7fa6230cdc..f3ba686a91 100644
--- a/packages/native/scripts/swift-ios-theme.mjs
+++ b/packages/native/scripts/swift-ios-theme.mjs
@@ -2,10 +2,17 @@
/**
* @file scripts/swift-ios-theme.mjs
- * @input Core's theme resolver, run over the default theme in light and dark
- * @output apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift
- * @position Run by `generate:swift-ios`; the Swift output is committed and a
- * test fails when it drifts from core's tokens
+ * @input Any Astryx theme (a defineTheme result), resolved by core's
+ * resolveThemeTokens in light and dark; the published theme packages under
+ * packages/themes/
+ * @output apple/Sources/Astryx/Theme/Generated/Tokens.swift (the typed token
+ * surface) and one <SwiftName>Theme.swift per theme declaring
+ * Theme.<swiftName>
+ * @position Implements the Swift theme generator spec
+ * (specs/swift/library/theme-generator.md). Run by `generate:swift-ios`; the
+ * Swift output is committed and a test fails when any file drifts.
+ *
+ * SYNC: When modified, update this header and the theme generator spec.
*/
import fs from 'node:fs';
@@ -16,22 +23,101 @@ const PACKAGE_ROOT = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
'..',
);
-export const SWIFT_IOS_THEME_FILE = path.join(
+const REPO_ROOT = path.resolve(PACKAGE_ROOT, '..', '..');
+export const SWIFT_THEME_DIR = path.join(
PACKAGE_ROOT,
'apple',
'Sources',
'Astryx',
'Theme',
'Generated',
- 'DefaultTheme.swift',
);
+export const SWIFT_TOKENS_FILE = path.join(SWIFT_THEME_DIR, 'Tokens.swift');
+const THEMES_DIR = path.join(REPO_ROOT, 'packages', 'themes');
+const REGENERATE = 'pnpm -F @astryxdesign/native generate:swift-ios';
-// The token groups the Swift components read. Everything else (shadows,
-// motion, layout breakpoints) stays out until a component needs it.
+// G5: the token groups Swift keeps. Everything else (shadows, motion, layout
+// breakpoints) stays out until a component needs it.
const KEEP =
- /^--(color-|spacing-|radius-|size-element-|border-width$|font-family-|font-size-|font-weight-|text-(heading-\d|body|large|label|supporting)-)/;
+ /^--(color-|spacing-|radius-|size-element-|border-width$|font-size-|font-weight-|font-family-|text-(heading-\d|body|large|label|supporting)-)/;
const REM = 16;
+// Words Swift reserves as identifiers. A member or theme name that equals one
+// fails the run (G3, G6).
+const SWIFT_KEYWORDS = new Set(
+ 'associatedtype class deinit enum extension fileprivate func import init inout internal let open operator private precedencegroup protocol public rethrows static struct subscript typealias var break case catch continue default defer do else fallthrough for guard if in repeat return throw switch where while as false is nil self Self super throws true try Any Type'.split(
+ ' ',
+ ),
+);
+
+// ---------------------------------------------------------------------------
+// Names (G6)
+// ---------------------------------------------------------------------------
+
+const capitalize = s => (s ? s[0].toUpperCase() + s.slice(1) : s);
+
+/** Lower camel case of dash-separated parts; a dash between two digits is `_`. */
+function camel(parts) {
+ let out = '';
+ parts.forEach((part, i) => {
+ if (i === 0) {
+ out = part;
+ return;
+ }
+ const prev = parts[i - 1];
+ if (/\d$/.test(prev) && /^\d/.test(part)) out += `_${part}`;
+ else out += capitalize(part);
+ });
+ return out;
+}
+
+/**
+ * The group and Swift member for a kept token name (without `--`), per G6.
+ * Returns null for a name outside the G5 groups.
+ */
+export function swiftMember(token) {
+ const name = token.replace(/^--/, '');
+ let m;
+ if ((m = /^color-(.+)$/.exec(name))) {
+ return {group: 'color', member: camel(m[1].split('-'))};
+ }
+ if ((m = /^spacing-(.+)$/.exec(name))) {
+ return {group: 'space', member: `s${camel(m[1].split('-'))}`};
+ }
+ if ((m = /^radius-(.+)$/.exec(name))) {
+ return {group: 'radius', member: camel(m[1].split('-'))};
+ }
+ if ((m = /^size-element-(.+)$/.exec(name))) {
+ return {group: 'size', member: camel(['element', ...m[1].split('-')])};
+ }
+ if (name === 'border-width') return {group: 'size', member: 'borderWidth'};
+ if ((m = /^font-(size|weight|family)-(.+)$/.exec(name))) {
+ return {group: 'font', member: camel([m[1], ...m[2].split('-')])};
+ }
+ if ((m = /^text-(.+)-(size|weight|leading)$/.exec(name))) {
+ return {group: 'font', member: camel([...m[1].split('-'), m[2]])};
+ }
+ return null;
+}
+
+/** A theme's Swift static name, per G3. */
+export function swiftThemeName(themeName) {
+ if (themeName === 'astryx') return 'default';
+ const name = camel(themeName.replace(/^astryx-/, '').split('-'));
+ if (!/^[a-z][A-Za-z0-9_]*$/.test(name) || SWIFT_KEYWORDS.has(name)) {
+ throw new Error(
+ `theme "${themeName}" has no valid Swift name (got "${name}")`,
+ );
+ }
+ return name;
+}
+
+const swiftIdent = name => (SWIFT_KEYWORDS.has(name) ? `\`${name}\`` : name);
+
+// ---------------------------------------------------------------------------
+// Values (G7)
+// ---------------------------------------------------------------------------
+
function hex2(n) {
return Math.round(n).toString(16).padStart(2, '0').toUpperCase();
}
@@ -66,15 +152,56 @@ export function toHexColor(value) {
: parseFloat(m[4]);
return `#${hex2(+m[1])}${hex2(+m[2])}${hex2(+m[3])}${hex2(alpha * 255)}`;
}
+ m =
+ /^hsla?\(\s*(-?[\d.]+)(?:deg)?[,\s]+([\d.]+)%[,\s]+([\d.]+)%(?:[,\s/]+([\d.]+%?))?\s*\)$/i.exec(
+ v,
+ );
+ if (m) {
+ // Exact sRGB, then each channel rounded to the nearest of 256 steps,
+ // halves up (G7).
+ const h = (((+m[1] % 360) + 360) % 360) / 360;
+ const sat = +m[2] / 100;
+ const l = +m[3] / 100;
+ const q = l < 0.5 ? l * (1 + sat) : l + sat - l * sat;
+ const p = 2 * l - q;
+ const channel = t => {
+ const u = t < 0 ? t + 1 : t > 1 ? t - 1 : t;
+ if (u < 1 / 6) return p + (q - p) * 6 * u;
+ if (u < 1 / 2) return q;
+ if (u < 2 / 3) return p + (q - p) * (2 / 3 - u) * 6;
+ return p;
+ };
+ const alpha =
+ m[4] === undefined
+ ? 1
+ : m[4].endsWith('%')
+ ? parseFloat(m[4]) / 100
+ : parseFloat(m[4]);
+ // Round away float noise first so an exact half rounds up.
+ const byte = c => hex2(Math.round(c * 255 * 1e6) / 1e6);
+ return `#${byte(channel(h + 1 / 3))}${byte(channel(h))}${byte(channel(h - 1 / 3))}${byte(alpha)}`;
+ }
return NAMED_COLORS[v.toLowerCase()] ?? null;
}
-/** A CSS font-family stack as its family names, first choice first. */
-export function toFontFamilies(value) {
- return value
- .split(',')
- .map(family => family.trim().replace(/^(["'])(.*)\1$/, '$2'))
- .filter(Boolean);
+/**
+ * The value of a token in one mode: a whole-value `light-dark(a, b)` is `a` in
+ * light and `b` in dark (G1); any other value is returned unchanged.
+ */
+export function valueForMode(value, mode) {
+ const m = /^\s*light-dark\((.*)\)\s*$/s.exec(value);
+ if (!m) return value;
+ let depth = 0;
+ for (let i = 0; i < m[1].length; i++) {
+ const c = m[1][i];
+ if (c === '(') depth++;
+ else if (c === ')') depth--;
+ else if (c === ',' && depth === 0) {
+ const part = mode === 'light' ? m[1].slice(0, i) : m[1].slice(i + 1);
+ return part.trim();
+ }
+ }
+ return value;
}
/** A CSS length or unitless number as points, or null. */
@@ -84,84 +211,418 @@ export function toPoints(value) {
return m[2] === 'rem' ? parseFloat(m[1]) * REM : parseFloat(m[1]);
}
-async function resolveMode(mode) {
- const {defineTheme} = await import('@astryxdesign/core/theme');
- const {resolveThemeTokens} = await import('@astryxdesign/core/theme/tokens');
- const theme = defineTheme({name: 'astryx', tokens: {}});
- const colors = {};
- const sizes = {};
- const fonts = {};
- for (const [name, value] of Object.entries(
- resolveThemeTokens(theme, {mode}),
+/** A CSS font-family stack as family names in order, or null. */
+export function toFamilies(value) {
+ const families = [];
+ const re = /\s*("([^"]*)"|'([^']*)'|([^,]+?))\s*(,|$)/gy;
+ let m;
+ const v = value.trim();
+ if (!v || /var\(|calc\(/.test(v)) return null;
+ while (re.lastIndex < v.length && (m = re.exec(v))) {
+ const name = (m[2] ?? m[3] ?? m[4] ?? '').trim();
+ if (!name) return null;
+ families.push(name);
+ if (m[5] === '') break;
+ }
+ return families.length ? families : null;
+}
+
+const GROUP_TYPES = {
+ color: 'Color',
+ space: 'CGFloat',
+ radius: 'CGFloat',
+ size: 'CGFloat',
+ font: null, // per member: [String] for families, CGFloat otherwise
+};
+const GROUP_STRUCTS = {
+ color: 'ColorTokens',
+ space: 'SpaceTokens',
+ radius: 'RadiusTokens',
+ size: 'SizeTokens',
+ font: 'FontTokens',
+};
+const GROUPS = Object.keys(GROUP_STRUCTS);
+
+const isFamily = token => token.startsWith('--font-family-');
+const memberType = (group, token) =>
+ GROUP_TYPES[group] ?? (isFamily(token) ? '[String]' : 'CGFloat');
+
+/** Shortest exact decimal for a number, as Swift reads it. */
+function swiftNumber(n) {
+ return Number.isInteger(n) ? String(n) : String(Number(n.toPrecision(12)));
+}
+
+// ---------------------------------------------------------------------------
+// Resolution (G1)
+// ---------------------------------------------------------------------------
+
+let coreModules;
+async function core() {
+ coreModules ??= {
+ ...(await import('@astryxdesign/core/theme')),
+ ...(await import('@astryxdesign/core/theme/tokens')),
+ };
+ return coreModules;
+}
+
+/** Core's `defineTheme`, for callers that cannot import core themselves. */
+export async function defineTheme(input) {
+ return (await core()).defineTheme(input);
+}
+
+/**
+ * Core's defaults, which core resolves with no theme. It generates as
+ * `Theme.default` (G3).
+ */
+export const CORE_DEFAULTS = Object.freeze({name: 'astryx', tokens: {}});
+
+/** Core's defaults, for callers that render every generated theme. */
+export async function defaultTheme() {
+ return CORE_DEFAULTS;
+}
+
+/**
+ * A theme's local tokens, which no Swift file carries until core's resolver
+ * returns them per mode (G8), sorted.
+ */
+export function localTokensLeftOut(theme) {
+ return Object.keys(theme.localTokens ?? {}).sort();
+}
+
+/**
+ * Every kept token of a theme in one mode, read only from core's resolver:
+ * `{token: {group, member, value}}` with typed values (G1, G5, G7).
+ */
+async function resolveMode(theme, mode) {
+ const {resolveThemeTokens} = await core();
+ const out = {};
+ for (let [token, value] of Object.entries(
+ resolveThemeTokens(theme === CORE_DEFAULTS ? null : theme, {mode}),
)) {
- if (!KEEP.test(name) || typeof value !== 'string') continue;
- const key = name.slice(2);
- // A kept token that cannot be read fails the run, so no token goes
- // missing from the Swift theme without a message.
- if (key.startsWith('font-family-')) {
- const families = toFontFamilies(value);
- if (families.length === 0) {
- throw new Error(`${mode}: ${name} names no font family: ${value}`);
- }
- fonts[key] = families;
- } else if (key.startsWith('color-')) {
- const color = toHexColor(value);
- if (color === null) {
- throw new Error(
- `${mode}: ${name} is not a color Swift can read: ${value}`,
- );
- }
- colors[key] = color;
- } else {
- const points = toPoints(value);
- if (points === null) {
- throw new Error(
- `${mode}: ${name} is not a size Swift can read: ${value}`,
- );
- }
- sizes[key] = points;
+ if (!KEEP.test(token) || typeof value !== 'string') continue;
+ value = valueForMode(value, mode);
+ const {group, member} = swiftMember(token);
+ const fail = kind => {
+ throw new Error(
+ `${theme.name} ${mode}: ${token} is not a ${kind} Swift can read: ${value}`,
+ );
+ };
+ let typed;
+ if (group === 'color') typed = toHexColor(value) ?? fail('color');
+ else if (isFamily(token)) typed = toFamilies(value) ?? fail('font family');
+ else typed = toPoints(value) ?? fail('size');
+ out[token] = {group, member, value: typed};
+ }
+ return out;
+}
+
+/** Light and dark tokens of a theme, checked for matching names (G7). */
+export async function resolveTheme(theme) {
+ const light = await resolveMode(theme, 'light');
+ const dark = await resolveMode(theme, 'dark');
+ for (const token of new Set([...Object.keys(light), ...Object.keys(dark)])) {
+ if (!(token in light) || !(token in dark)) {
+ const missing = token in light ? 'dark' : 'light';
+ throw new Error(`${theme.name} ${missing}: ${token} is missing`);
}
}
- return {colors, sizes, fonts};
+ return {light, dark};
}
-function swiftDictionary(entries, format) {
- const keys = Object.keys(entries).sort();
- return keys.map(key => ` "${key}": ${format(entries[key])},`).join('\n');
+/** The typed token surface: `{group: [{token, member, type}]}`, sorted (G4). */
+export function tokenSurface(resolved) {
+ const surface = Object.fromEntries(GROUPS.map(g => [g, []]));
+ const seen = new Map();
+ for (const [token, {group, member}] of Object.entries(resolved)) {
+ const key = `${group}.${member}`;
+ if (seen.has(key)) {
+ throw new Error(
+ `${seen.get(key)} and ${token} both become ${key} in Swift`,
+ );
+ }
+ if (!/^[a-z][A-Za-z0-9_]*$/.test(member) || SWIFT_KEYWORDS.has(member)) {
+ throw new Error(`${token} becomes ${key}, which Swift cannot name`);
+ }
+ seen.set(key, token);
+ surface[group].push({token, member, type: memberType(group, token)});
+ }
+ for (const g of GROUPS)
+ surface[g].sort((a, b) => a.member.localeCompare(b.member, 'en'));
+ return surface;
}
-function swiftTokens(name, mode, {colors, sizes, fonts}) {
- return ` /// Core's default theme, ${mode} mode.
- public static let ${name} = AstryxTokens(
- colors: [
-${swiftDictionary(colors, v => `"${v}"`)}
- ],
- sizes: [
-${swiftDictionary(sizes, v => String(v))}
- ],
- fonts: [
-${swiftDictionary(fonts, v => `[${v.map(f => JSON.stringify(f)).join(', ')}]`)}
- ]
- )`;
+// ---------------------------------------------------------------------------
+// Swift output (G3, G4, G11)
+// ---------------------------------------------------------------------------
+
+const GENERATED_NOTE = `// Do not edit. Run \`${REGENERATE}\` after a theme or core token change.`;
+
+/** The generated Tokens.swift for a token surface. */
+export function renderTokenTypes(surface) {
+ const structs = GROUPS.map(group => {
+ const members = surface[group];
+ const props = members
+ .map(
+ m =>
+ ` /// \`--${m.token.replace(/^--/, '')}\`\n public var ${m.member}: ${m.type}`,
+ )
+ .join('\n');
+ const params = members.map(m => ` ${m.member}: ${m.type}`).join(',\n');
+ const assigns = members
+ .map(m => ` self.${m.member} = ${m.member}`)
+ .join('\n');
+ const lookupType =
+ group === 'color' ? 'Color' : group === 'font' ? null : 'CGFloat';
+ const lookup =
+ lookupType === null
+ ? ` /// A size, weight, or line-height token by its CSS name, for code that
+ /// only has the name. Components read the typed members instead.
+ func number(named token: String) -> CGFloat? {
+ switch token {
+${members
+ .filter(m => m.type === 'CGFloat')
+ .map(m => ` case "${m.token.replace(/^--/, '')}": ${m.member}`)
+ .join('\n')}
+ default: nil
+ }
+ }
+
+ /// A font family token by its CSS name, for code that only has the name.
+ func families(named token: String) -> [String]? {
+ switch token {
+${members
+ .filter(m => m.type === '[String]')
+ .map(m => ` case "${m.token.replace(/^--/, '')}": ${m.member}`)
+ .join('\n')}
+ default: nil
+ }
+ }`
+ : ` /// A token by its CSS name, for code that only has the name. Components
+ /// read the typed members instead.
+ func value(named token: String) -> ${lookupType}? {
+ switch token {
+${members.map(m => ` case "${m.token.replace(/^--/, '')}": ${m.member}`).join('\n')}
+ default: nil
+ }
+ }`;
+ return `/// The theme's \`${group}\` tokens, one typed member per token.
+public struct ${GROUP_STRUCTS[group]}: Equatable, Sendable {
+${props}
+
+ public init(
+${params}
+ ) {
+${assigns}
+ }
+
+${lookup}
+}`;
+ }).join('\n\n');
+ return `// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from core's token names.
+${GENERATED_NOTE}
+
+import SwiftUI
+
+/// One mode of a theme: every token Swift keeps, as typed members.
+public struct Tokens: Equatable, Sendable {
+${GROUPS.map(g => ` public var ${g}: ${GROUP_STRUCTS[g]}`).join('\n')}
+
+ public init(
+${GROUPS.map(g => ` ${g}: ${GROUP_STRUCTS[g]}`).join(',\n')}
+ ) {
+${GROUPS.map(g => ` self.${g} = ${g}`).join('\n')}
+ }
}
-/** The generated Swift source for core's default theme. */
-export async function renderSwiftIOSTheme() {
- const light = await resolveMode('light');
- const dark = await resolveMode('dark');
- return `// Generated by @astryxdesign/native from core's theme resolver. Do not edit.
-// Run \`pnpm -F @astryxdesign/native generate:swift-ios\` after a core token change.
+${structs}
+`;
+}
-extension AstryxTokens {
-${swiftTokens('defaultLight', 'light', light)}
+function swiftValue(type, value) {
+ if (type === 'Color') return `Color(astryxRGBA: 0x${value.slice(1)})`;
+ if (type === '[String]')
+ return `[${value.map(v => JSON.stringify(v)).join(', ')}]`;
+ return swiftNumber(value);
+}
-${swiftTokens('defaultDark', 'dark', dark)}
+function renderMode(surface, resolved, indent) {
+ const pad = ' '.repeat(indent);
+ const groups = GROUPS.map(group => {
+ const args = surface[group]
+ .map(
+ m =>
+ `${pad} ${m.member}: ${swiftValue(m.type, resolved[m.token].value)}`,
+ )
+ .join(',\n');
+ return `${pad} ${group}: ${GROUP_STRUCTS[group]}(\n${args}\n${pad} )`;
+ }).join(',\n');
+ return `Tokens(\n${groups}\n${pad})`;
}
+
+/** Swift file name for a theme's static name. */
+export const themeFileName = swiftName => `${capitalize(swiftName)}Theme.swift`;
+
+/**
+ * The generated Swift file for one theme (G3). `source` names where the theme
+ * comes from, such as `@astryxdesign/theme-neutral`. A product theme
+ * (`regenerate` set) lives in the app's own target, so it imports `Astryx` and
+ * its header names the app's own regenerate command.
+ */
+export async function renderSwiftTheme(
+ theme,
+ {source = 'a product theme', regenerate} = {},
+) {
+ const swiftName = swiftThemeName(theme.name);
+ const {light, dark} = await resolveTheme(theme);
+ const surface = tokenSurface(light);
+ const header =
+ regenerate === undefined
+ ? `// Copyright (c) Meta Platforms, Inc. and affiliates.
+// Generated by @astryxdesign/native from ${source}, theme "${theme.name}".
+${GENERATED_NOTE}
+
+import SwiftUI
+`
+ : `// Generated by @astryxdesign/native from ${source}, theme "${theme.name}".
+// Do not edit. Run \`${regenerate}\` after a theme change.
+
+import Astryx
+import SwiftUI
`;
+ return `${header}
+extension Theme {
+ /// The \`${theme.name}\` theme from ${source}, in light and dark.
+ public static let ${swiftIdent(swiftName)} = Theme(
+ light: ${renderMode(surface, light, 4)},
+ dark: ${renderMode(surface, dark, 4)}
+ )
+}
+`;
+}
+
+// ---------------------------------------------------------------------------
+// Published themes (G12)
+// ---------------------------------------------------------------------------
+
+/**
+ * Every published theme package: `{packageName, dir, exportName}` for each
+ * non-private package under packages/themes/, sorted by directory.
+ */
+export function publishedThemePackages() {
+ return fs
+ .readdirSync(THEMES_DIR)
+ .sort()
+ .map(dir => path.join(THEMES_DIR, dir))
+ .filter(dir => fs.existsSync(path.join(dir, 'package.json')))
+ .map(dir => ({
+ dir,
+ pkg: JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8')),
+ }))
+ .filter(({pkg}) => !pkg.private)
+ .map(({dir, pkg}) => ({
+ packageName: pkg.name,
+ dir,
+ exportName: `${path.basename(dir)}Theme`,
+ sourceFile: path.join(dir, 'src', 'source.ts'),
+ }));
+}
+
+/**
+ * Every theme this package generates, with its file: core's default plus each
+ * published theme. `load(file)` imports a theme package's TypeScript source.
+ */
+export async function generatedThemes(load) {
+ const themes = [{theme: await defaultTheme(), source: '@astryxdesign/core'}];
+ for (const p of publishedThemePackages()) {
+ const module = await load(p.sourceFile);
+ const theme = module[p.exportName];
+ if (!theme) {
+ throw new Error(`${p.packageName} does not export ${p.exportName}`);
+ }
+ themes.push({theme, source: p.packageName});
+ }
+ const names = new Map();
+ for (const {theme} of themes) {
+ const swiftName = swiftThemeName(theme.name);
+ if (names.has(swiftName)) {
+ throw new Error(
+ `themes "${names.get(swiftName)}" and "${theme.name}" both become Theme.${swiftName}`,
+ );
+ }
+ names.set(swiftName, theme.name);
+ }
+ return themes;
+}
+
+/** Every generated file as `{file: contents}`, keyed by absolute path. */
+export async function renderAll(load) {
+ const themes = await generatedThemes(load);
+ const files = {};
+ const {light} = await resolveTheme(themes[0].theme);
+ files[SWIFT_TOKENS_FILE] = renderTokenTypes(tokenSurface(light));
+ for (const {theme, source} of themes) {
+ const file = path.join(
+ SWIFT_THEME_DIR,
+ themeFileName(swiftThemeName(theme.name)),
+ );
+ files[file] = await renderSwiftTheme(theme, {source});
+ }
+ return files;
+}
+
+/** Loads a TypeScript module from plain Node through Vite's module runner. */
+async function viteLoad(file) {
+ const {runnerImport} = await import('vite');
+ const {module} = await runnerImport(file, {
+ root: REPO_ROOT,
+ configFile: false,
+ logLevel: 'error',
+ });
+ return module;
+}
+
+async function main(argv) {
+ const at = argv.indexOf('--theme');
+ if (at !== -1) {
+ // A product's own theme: `--theme <module>#<export> [--out <dir>]`.
+ const [modulePath, exportName] = argv[at + 1].split('#');
+ const module = await viteLoad(path.resolve(modulePath));
+ const theme = module[exportName];
+ if (!theme) throw new Error(`${modulePath} does not export ${exportName}`);
+ const outAt = argv.indexOf('--out');
+ const outDir = outAt === -1 ? process.cwd() : path.resolve(argv[outAt + 1]);
+ const file = path.join(outDir, themeFileName(swiftThemeName(theme.name)));
+ const regenerate = `node packages/native/scripts/swift-ios-theme.mjs --theme ${argv[at + 1]}${outAt === -1 ? '' : ` --out ${argv[outAt + 1]}`}`;
+ fs.writeFileSync(
+ file,
+ await renderSwiftTheme(theme, {source: modulePath, regenerate}),
+ );
+ for (const token of localTokensLeftOut(theme)) {
+ console.warn(`left out: ${theme.name} local token ${token}`);
+ }
+ console.log(`wrote ${file}`);
+ return;
+ }
+ const files = await renderAll(viteLoad);
+ for (const {theme} of await generatedThemes(viteLoad)) {
+ for (const token of localTokensLeftOut(theme)) {
+ console.warn(
+ `left out: ${theme.name} local token ${token} (core's resolver does not return local tokens per mode yet)`,
+ );
+ }
+ }
+ fs.mkdirSync(SWIFT_THEME_DIR, {recursive: true});
+ for (const existing of fs.readdirSync(SWIFT_THEME_DIR)) {
+ const file = path.join(SWIFT_THEME_DIR, existing);
+ if (existing.endsWith('.swift') && !(file in files)) fs.rmSync(file);
+ }
+ for (const [file, contents] of Object.entries(files)) {
+ fs.writeFileSync(file, contents);
+ console.log(`wrote ${path.relative(PACKAGE_ROOT, file)}`);
+ }
}
if (process.argv[1] === fileURLToPath(import.meta.url)) {
- fs.mkdirSync(path.dirname(SWIFT_IOS_THEME_FILE), {recursive: true});
- fs.writeFileSync(SWIFT_IOS_THEME_FILE, await renderSwiftIOSTheme());
- console.log(`wrote ${path.relative(PACKAGE_ROOT, SWIFT_IOS_THEME_FILE)}`);
+ await main(process.argv.slice(2));
}
diff --git a/packages/native/src/theme/swiftIOSTheme.test.ts b/packages/native/src/theme/swiftIOSTheme.test.ts
index a5297810b1..044a02632b 100644
--- a/packages/native/src/theme/swiftIOSTheme.test.ts
+++ b/packages/native/src/theme/swiftIOSTheme.test.ts
@@ -1,49 +1,223 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import fs from 'node:fs';
+import path from 'node:path';
import {describe, expect, it} from 'vitest';
import {
- SWIFT_IOS_THEME_FILE,
- renderSwiftIOSTheme,
- toFontFamilies,
+ CORE_DEFAULTS,
+ SWIFT_THEME_DIR,
+ SWIFT_TOKENS_FILE,
+ defineTheme,
+ localTokensLeftOut,
+ publishedThemePackages,
+ renderAll,
+ renderSwiftTheme,
+ swiftMember,
+ swiftThemeName,
+ toFamilies,
toHexColor,
toPoints,
+ tokenSurface,
+ valueForMode,
} from '../../scripts/swift-ios-theme.mjs';
-describe('swift-ios default theme', () => {
- it('reads CSS colors and lengths as Swift values', () => {
+// Imports a theme package's TypeScript source through Vitest.
+const load = (file: string) => import(/* @vite-ignore */ file);
+const REGENERATE = 'pnpm -F @astryxdesign/native generate:swift-ios';
+
+describe('swift theme generator: names (G6)', () => {
+ it('maps every token group to one Swift member', () => {
+ const cases = {
+ '--color-text-primary': 'color.textPrimary',
+ '--color-data-blue-1': 'color.dataBlue1',
+ '--spacing-4': 'space.s4',
+ '--spacing-0-5': 'space.s0_5',
+ '--radius-element': 'radius.element',
+ '--size-element-md': 'size.elementMd',
+ '--border-width': 'size.borderWidth',
+ '--font-size-2xl': 'font.size2xl',
+ '--font-weight-semibold': 'font.weightSemibold',
+ '--font-family-body': 'font.familyBody',
+ '--text-body-size': 'font.bodySize',
+ '--text-heading-1-weight': 'font.heading1Weight',
+ };
+ for (const [token, expected] of Object.entries(cases)) {
+ const mapped = swiftMember(token);
+ expect(mapped && `${mapped.group}.${mapped.member}`, token).toBe(
+ expected,
+ );
+ }
+ });
+
+ it('fails when two tokens become one member, naming both', () => {
+ expect(() =>
+ tokenSurface({
+ '--color-a-1': {group: 'color', member: 'a1'},
+ '--color-a1': {group: 'color', member: 'a1'},
+ }),
+ ).toThrow(/--color-a-1 and --color-a1 both become color.a1/);
+ });
+
+ it('names themes as the spec says', () => {
+ expect(swiftThemeName('astryx')).toBe('default');
+ expect(swiftThemeName('astryx-neutral')).toBe('neutral');
+ expect(swiftThemeName('neutral')).toBe('neutral');
+ expect(swiftThemeName('acme-brand')).toBe('acmeBrand');
+ expect(() => swiftThemeName('2fast')).toThrow(/no valid Swift name/);
+ expect(() => swiftThemeName('class')).toThrow(/no valid Swift name/);
+ });
+});
+
+describe('swift theme generator: values (G7)', () => {
+ it('reads CSS colors, lengths, and font stacks as Swift values', () => {
expect(toHexColor('#0064E0')).toBe('#0064E0FF');
expect(toHexColor('#fff')).toBe('#FFFFFFFF');
expect(toHexColor('rgba(5, 54, 89, 0.1)')).toBe('#0536591A');
expect(toHexColor('transparent')).toBe('#00000000');
- expect(toHexColor('black')).toBe('#000000FF');
- expect(toHexColor('white')).toBe('#FFFFFFFF');
+ expect(toHexColor('oklch(0 0 0 / 5%)')).toBeNull();
expect(toHexColor('light-dark(#000, #fff)')).toBeNull();
+ expect(toHexColor('hsl(0 100% 50%)')).toBe('#FF0000FF');
+ expect(toHexColor('hsl(210 100% 50%)')).toBe('#0080FFFF');
+ expect(toHexColor('hsla(120, 100%, 25%, 0.5)')).toBe('#00800080');
expect(toPoints('0.875rem')).toBe(14);
expect(toPoints('32px')).toBe(32);
expect(toPoints('600')).toBe(600);
- expect(toPoints('cubic-bezier(0, 0, 1, 1)')).toBeNull();
+ expect(toPoints('calc(1px + 1rem)')).toBeNull();
+ expect(toFamilies('"Figtree", -apple-system, sans-serif')).toEqual([
+ 'Figtree',
+ '-apple-system',
+ 'sans-serif',
+ ]);
+ expect(toFamilies('var(--font-family-body)')).toBeNull();
});
- it('reads font stacks as family names, first choice first', async () => {
+ it('takes light-dark() per mode (G1)', async () => {
+ expect(valueForMode('light-dark(#000, #fff)', 'light')).toBe('#000');
+ expect(valueForMode('light-dark(#000, #fff)', 'dark')).toBe('#fff');
expect(
- toFontFamilies('-apple-system, "Segoe UI", \'Inter\', sans-serif'),
- ).toEqual(['-apple-system', 'Segoe UI', 'Inter', 'sans-serif']);
- expect(await renderSwiftIOSTheme()).toContain(
- '"font-family-heading": ["-apple-system",',
- );
+ valueForMode('light-dark(rgb(0, 0, 0), rgb(255, 255, 255))', 'dark'),
+ ).toBe('rgb(255, 255, 255)');
+ expect(valueForMode('#123', 'dark')).toBe('#123');
+ const theme = await defineTheme({
+ name: 'acme-brand',
+ tokens: {'--color-accent': 'light-dark(#000, #fff)'},
+ });
+ const swift = await renderSwiftTheme(theme);
+ expect(swift).toContain('accent: Color(astryxRGBA: 0x000000FF)');
+ expect(swift).toContain('accent: Color(astryxRGBA: 0xFFFFFFFF)');
});
- it('keeps every color token, keywords included', async () => {
- expect(await renderSwiftIOSTheme()).toContain(
- '"color-tint-hover": "#000000FF"',
+ it('fails on a value Swift cannot read, naming theme, mode, token, and value', async () => {
+ const theme = await defineTheme({
+ name: 'acme-brand',
+ tokens: {'--color-accent': 'oklch(0.6 0.2 250)'},
+ });
+ await expect(renderSwiftTheme(theme)).rejects.toThrow(
+ 'acme-brand light: --color-accent is not a color Swift can read: oklch(0.6 0.2 250)',
);
});
+});
- it('keeps the committed Swift theme in sync with core tokens', async () => {
- expect(
- fs.readFileSync(SWIFT_IOS_THEME_FILE, 'utf8'),
- 'DefaultTheme.swift is stale; run pnpm -F @astryxdesign/native generate:swift-ios',
- ).toBe(await renderSwiftIOSTheme());
+describe('swift theme generator: local tokens (G8)', () => {
+ it('generates no local token and reports each one it leaves out', async () => {
+ const theme = await defineTheme({
+ name: 'acme-brand',
+ tokens: {},
+ localTokens: {'--acme-brand-fill': ['#111111', '#EEEEEE']},
+ });
+ expect(localTokensLeftOut(theme)).toEqual(['--acme-brand-fill']);
+ expect(await renderSwiftTheme(theme)).not.toContain('acmeBrandFill');
+ expect(localTokensLeftOut(CORE_DEFAULTS)).toEqual([]);
+ });
+});
+
+describe('swift theme generator: themes (G3, G4, G12)', () => {
+ it('generates core defaults from no theme as Theme.default', async () => {
+ const swift = await renderSwiftTheme(CORE_DEFAULTS, {
+ source: '@astryxdesign/core',
+ });
+ expect(swift).toContain('public static let `default` = Theme(');
+ });
+
+ it('generates a product theme through the same function', async () => {
+ const theme = await defineTheme({
+ name: 'acme-brand',
+ tokens: {'--color-accent': ['#C2410C', '#FB923C']},
+ });
+ const swift = await renderSwiftTheme(theme, {source: 'acme'});
+ expect(swift).toContain('public static let acmeBrand = Theme(');
+ expect(swift).toContain('accent: Color(astryxRGBA: 0xC2410CFF)');
+ expect(swift).toContain('accent: Color(astryxRGBA: 0xFB923CFF)');
+ expect(swift).toContain('from acme, theme "acme-brand"');
+ expect(swift).not.toMatch(/\d+\.\d+\.\d+/);
+ expect(await renderSwiftTheme(theme, {source: 'acme'})).toBe(swift);
+ });
+
+ it('imports Astryx in a product theme, with its own regenerate command', async () => {
+ const theme = await defineTheme({name: 'acme-brand', tokens: {}});
+ const regenerate =
+ 'node packages/native/scripts/swift-ios-theme.mjs --theme ./src/acme.ts#acmeTheme --out ./Sources/Theme';
+ const product = await renderSwiftTheme(theme, {source: 'acme', regenerate});
+ expect(product).toContain('import Astryx\nimport SwiftUI\n');
+ expect(product).toContain(`Run \`${regenerate}\``);
+ const packaged = await renderSwiftTheme(theme, {source: 'acme'});
+ expect(packaged).not.toContain('import Astryx');
+ });
+
+ it('orders members the same in every locale', async () => {
+ const theme = await defineTheme({name: 'acme-brand', tokens: {}});
+ const before = await renderSwiftTheme(theme);
+ const compare = String.prototype.localeCompare;
+ String.prototype.localeCompare = function (
+ that: string,
+ locales?: string | string[],
+ options?: Intl.CollatorOptions,
+ ) {
+ return compare.call(this, that, locales ?? 'th-TH', options);
+ };
+ try {
+ expect(await renderSwiftTheme(theme)).toBe(before);
+ } finally {
+ String.prototype.localeCompare = compare;
+ }
+ });
+
+ it('generates core default and every published theme package', async () => {
+ const files = await renderAll(load);
+ const names = Object.keys(files).map(f => path.basename(f));
+ expect(names).toContain('DefaultTheme.swift');
+ for (const p of publishedThemePackages()) {
+ const theme = (await load(p.sourceFile))[p.exportName] as {name: string};
+ expect(names, p.packageName).toContain(
+ `${swiftThemeName(theme.name)[0].toUpperCase()}${swiftThemeName(theme.name).slice(1)}Theme.swift`,
+ );
+ }
+ });
+});
+
+describe('swift theme generator: drift (G13)', () => {
+ it('keeps every committed Swift theme file in sync', async () => {
+ const files = await renderAll(load);
+ expect(Object.keys(files)).toContain(SWIFT_TOKENS_FILE);
+ for (const [file, contents] of Object.entries(files)) {
+ expect(
+ fs.existsSync(file),
+ `${path.basename(file)} is missing; run ${REGENERATE}`,
+ ).toBe(true);
+ expect(
+ fs.readFileSync(file, 'utf8'),
+ `${path.basename(file)} is stale; run ${REGENERATE}`,
+ ).toBe(contents);
+ }
+ const committed = fs
+ .readdirSync(SWIFT_THEME_DIR)
+ .filter(f => f.endsWith('.swift'))
+ .map(f => path.join(SWIFT_THEME_DIR, f));
+ for (const file of committed) {
+ expect(
+ files,
+ `${path.basename(file)} has no theme; run ${REGENERATE}`,
+ ).toHaveProperty([file]);
+ }
});
});