@use-voltra/ios 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/build/commonjs/index.js +13 -0
  2. package/build/commonjs/index.js.map +1 -1
  3. package/build/module/index.js +1 -0
  4. package/build/module/index.js.map +1 -1
  5. package/build/typescript/commonjs/index.d.ts +2 -0
  6. package/build/typescript/commonjs/index.d.ts.map +1 -1
  7. package/build/typescript/module/index.d.ts +2 -0
  8. package/build/typescript/module/index.d.ts.map +1 -1
  9. package/package.json +3 -2
  10. package/src/index.ts +36 -0
  11. package/src/jsx/AreaMark.tsx +14 -0
  12. package/src/jsx/BarMark.tsx +17 -0
  13. package/src/jsx/Button.tsx +5 -0
  14. package/src/jsx/Chart.tsx +153 -0
  15. package/src/jsx/CircularProgressView.tsx +5 -0
  16. package/src/jsx/Divider.tsx +5 -0
  17. package/src/jsx/Gauge.tsx +5 -0
  18. package/src/jsx/GlassContainer.tsx +5 -0
  19. package/src/jsx/GroupBox.tsx +5 -0
  20. package/src/jsx/HStack.tsx +5 -0
  21. package/src/jsx/Image.tsx +22 -0
  22. package/src/jsx/Label.tsx +8 -0
  23. package/src/jsx/LineMark.tsx +16 -0
  24. package/src/jsx/LinearGradient.tsx +108 -0
  25. package/src/jsx/LinearProgressView.tsx +5 -0
  26. package/src/jsx/Link.tsx +5 -0
  27. package/src/jsx/Mask.tsx +5 -0
  28. package/src/jsx/PointMark.tsx +15 -0
  29. package/src/jsx/RuleMark.tsx +14 -0
  30. package/src/jsx/SectorMark.tsx +16 -0
  31. package/src/jsx/Spacer.tsx +5 -0
  32. package/src/jsx/Symbol.tsx +5 -0
  33. package/src/jsx/Text.tsx +10 -0
  34. package/src/jsx/Timer.tsx +8 -0
  35. package/src/jsx/Toggle.tsx +5 -0
  36. package/src/jsx/VStack.tsx +5 -0
  37. package/src/jsx/View.tsx +5 -0
  38. package/src/jsx/ZStack.tsx +5 -0
  39. package/src/jsx/baseProps.tsx +9 -0
  40. package/src/jsx/chart-types.ts +2 -0
  41. package/src/jsx/createVoltraComponent.ts +2 -0
  42. package/src/jsx/font.ts +45 -0
  43. package/src/jsx/index.ts +2 -0
  44. package/src/jsx/primitives.ts +29 -0
  45. package/src/jsx/props/.generated +15 -0
  46. package/src/jsx/props/Button.ts +10 -0
  47. package/src/jsx/props/Chart.ts +22 -0
  48. package/src/jsx/props/CircularProgressView.ts +30 -0
  49. package/src/jsx/props/Divider.ts +7 -0
  50. package/src/jsx/props/Gauge.ts +36 -0
  51. package/src/jsx/props/GlassContainer.ts +10 -0
  52. package/src/jsx/props/GroupBox.ts +12 -0
  53. package/src/jsx/props/HStack.ts +14 -0
  54. package/src/jsx/props/Image.ts +18 -0
  55. package/src/jsx/props/Label.ts +12 -0
  56. package/src/jsx/props/LinearGradient.ts +18 -0
  57. package/src/jsx/props/LinearProgressView.ts +34 -0
  58. package/src/jsx/props/Link.ts +10 -0
  59. package/src/jsx/props/Mask.ts +12 -0
  60. package/src/jsx/props/Spacer.ts +10 -0
  61. package/src/jsx/props/Symbol.ts +34 -0
  62. package/src/jsx/props/Text.ts +12 -0
  63. package/src/jsx/props/Timer.ts +22 -0
  64. package/src/jsx/props/Toggle.ts +10 -0
  65. package/src/jsx/props/VStack.ts +14 -0
  66. package/src/jsx/props/View.ts +7 -0
  67. package/src/jsx/props/ZStack.ts +10 -0
  68. package/src/live-activity/renderer.ts +85 -0
  69. package/src/live-activity/types.ts +72 -0
  70. package/src/payload/component-ids.ts +87 -0
  71. package/src/payload/short-names.ts +1 -0
  72. package/src/payload.ts +1 -0
  73. package/src/renderer/index.ts +6 -0
  74. package/src/renderer/renderer.ts +25 -0
  75. package/src/server.ts +36 -0
  76. package/src/styles/index.ts +1 -0
  77. package/src/styles/types.ts +78 -0
  78. package/src/types.ts +42 -0
  79. package/src/widgets/renderer.ts +26 -0
  80. package/src/widgets/types.ts +49 -0
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { ToggleProps } from './props/Toggle.js'
3
+
4
+ export type { ToggleProps }
5
+ export const Toggle = createVoltraComponent<ToggleProps>('Toggle')
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { VStackProps } from './props/VStack.js'
3
+
4
+ export type { VStackProps }
5
+ export const VStack = createVoltraComponent<VStackProps>('VStack')
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { ViewProps } from './props/View.js'
3
+
4
+ export type { ViewProps }
5
+ export const View = createVoltraComponent<ViewProps>('View')
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { ZStackProps } from './props/ZStack.js'
3
+
4
+ export type { ZStackProps }
5
+ export const ZStack = createVoltraComponent<ZStackProps>('ZStack')
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react'
2
+
3
+ import type { VoltraStyleProp } from '../styles/index.js'
4
+
5
+ export type VoltraBaseProps = {
6
+ id?: string
7
+ style?: VoltraStyleProp
8
+ children?: ReactNode
9
+ }
@@ -0,0 +1,2 @@
1
+ export type ChartDataPoint = { x: string | number; y: number; series?: string }
2
+ export type SectorDataPoint = { value: number; category: string }
@@ -0,0 +1,2 @@
1
+ export { createVoltraComponent, isVoltraComponent, VOLTRA_COMPONENT_TAG } from '@use-voltra/core'
2
+ export type { VoltraComponent, VoltraComponentOptions } from '@use-voltra/core'
@@ -0,0 +1,45 @@
1
+ export type VoltraFont = {
2
+ readonly __voltraFontId: string
3
+ readonly name?: string
4
+ readonly size: number
5
+ readonly weight?: string
6
+ readonly family?: string
7
+ readonly smallCaps?: boolean
8
+ readonly monospacedDigit?: boolean
9
+ readonly italic?: boolean
10
+ }
11
+
12
+ let fontIdCounter = 0
13
+
14
+ export function createFont(options: {
15
+ name?: string
16
+ size: number
17
+ weight?: string
18
+ family?: string
19
+ smallCaps?: boolean
20
+ monospacedDigit?: boolean
21
+ italic?: boolean
22
+ }): VoltraFont {
23
+ // Use numeric ID (0, 1, 2, ...) for smallest payload size
24
+ const id = String(fontIdCounter++)
25
+
26
+ return {
27
+ __voltraFontId: id,
28
+ name: options.name,
29
+ size: options.size,
30
+ weight: options.weight,
31
+ family: options.family,
32
+ smallCaps: options.smallCaps,
33
+ monospacedDigit: options.monospacedDigit,
34
+ italic: options.italic,
35
+ }
36
+ }
37
+
38
+ export function isVoltraFont(value: unknown): value is VoltraFont {
39
+ return (
40
+ typeof value === 'object' &&
41
+ value !== null &&
42
+ '__voltraFontId' in value &&
43
+ typeof (value as any).__voltraFontId === 'string'
44
+ )
45
+ }
@@ -0,0 +1,2 @@
1
+ export type { VoltraBaseProps } from './baseProps'
2
+ export * from './createVoltraComponent.js'
@@ -0,0 +1,29 @@
1
+ export * from './AreaMark.js'
2
+ export * from './BarMark.js'
3
+ export * from './Button.js'
4
+ export * from './Chart.js'
5
+ export * from './chart-types.js'
6
+ export * from './CircularProgressView.js'
7
+ export * from './Divider.js'
8
+ export * from './Gauge.js'
9
+ export * from './GlassContainer.js'
10
+ export * from './GroupBox.js'
11
+ export * from './HStack.js'
12
+ export * from './Image.js'
13
+ export * from './Label.js'
14
+ export * from './LinearGradient.js'
15
+ export * from './LinearProgressView.js'
16
+ export * from './LineMark.js'
17
+ export * from './Link.js'
18
+ export * from './Mask.js'
19
+ export * from './PointMark.js'
20
+ export * from './RuleMark.js'
21
+ export * from './SectorMark.js'
22
+ export * from './Spacer.js'
23
+ export * from './Symbol.js'
24
+ export * from './Text.js'
25
+ export * from './Timer.js'
26
+ export * from './Toggle.js'
27
+ export * from './View.js'
28
+ export * from './VStack.js'
29
+ export * from './ZStack.js'
@@ -0,0 +1,15 @@
1
+ This directory contains auto-generated iOS component props type files.
2
+ DO NOT EDIT MANUALLY.
3
+
4
+ Generated from: data/components.json
5
+ Schema version: 1.0.0
6
+
7
+ To regenerate these files, run:
8
+ pnpm run generate
9
+
10
+ Users should create component files manually using createVoltraComponent with these types.
11
+ Example:
12
+ import { createVoltraComponent } from '../createVoltraComponent'
13
+ import type { ButtonProps } from './props/Button'
14
+
15
+ export const Button = createVoltraComponent<ButtonProps>('Button')
@@ -0,0 +1,10 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type ButtonProps = VoltraBaseProps & {
8
+ /** Visual style of the button */
9
+ buttonStyle?: 'automatic' | 'bordered' | 'borderedProminent' | 'plain' | 'borderless'
10
+ }
@@ -0,0 +1,22 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type ChartProps = VoltraBaseProps & {
8
+ /** Compact mark data encoded from children by toJSON */
9
+ marks?: string
10
+ /** Show or hide the x-axis */
11
+ xAxisVisibility?: 'automatic' | 'visible' | 'hidden'
12
+ /** Configure x-axis grid line style */
13
+ xAxisGridStyle?: Record<string, any>
14
+ /** Show or hide the y-axis */
15
+ yAxisVisibility?: 'automatic' | 'visible' | 'hidden'
16
+ /** Configure y-axis grid line style */
17
+ yAxisGridStyle?: Record<string, any>
18
+ /** Show or hide the chart legend */
19
+ legendVisibility?: 'automatic' | 'visible' | 'hidden'
20
+ /** Map of series name to color string */
21
+ foregroundStyleScale?: Record<string, any>
22
+ }
@@ -0,0 +1,30 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { ReactNode } from 'react'
6
+
7
+ import type { VoltraBaseProps } from '../baseProps'
8
+
9
+ export type CircularProgressViewProps = VoltraBaseProps & {
10
+ /** Current progress value */
11
+ value?: number
12
+ /** Whether to count down instead of up */
13
+ countDown?: boolean
14
+ /** Maximum progress value */
15
+ maximumValue?: number
16
+ /** End time in milliseconds since epoch */
17
+ endAtMs?: number
18
+ /** Start time in milliseconds since epoch */
19
+ startAtMs?: number
20
+ /** Color for the track (background) of the circular progress indicator */
21
+ trackColor?: string
22
+ /** Color for the progress fill */
23
+ progressColor?: string
24
+ /** Width of the stroke line */
25
+ lineWidth?: number
26
+ /** Label content for the progress indicator */
27
+ label?: ReactNode
28
+ /** Custom text for current value label */
29
+ currentValueLabel?: ReactNode
30
+ }
@@ -0,0 +1,7 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type DividerProps = VoltraBaseProps
@@ -0,0 +1,36 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { ReactNode } from 'react'
6
+
7
+ import type { VoltraBaseProps } from '../baseProps'
8
+
9
+ export type GaugeProps = VoltraBaseProps & {
10
+ /** Current gauge value */
11
+ value?: number
12
+ /** Minimum value of the gauge range */
13
+ minimumValue?: number
14
+ /** Maximum value of the gauge range */
15
+ maximumValue?: number
16
+ /** End time in milliseconds since epoch */
17
+ endAtMs?: number
18
+ /** Start time in milliseconds since epoch */
19
+ startAtMs?: number
20
+ /** Tint color for the gauge */
21
+ tintColor?: string
22
+ /** Visual style of the gauge */
23
+ gaugeStyle?:
24
+ | 'automatic'
25
+ | 'accessoryLinear'
26
+ | 'accessoryLinearCapacity'
27
+ | 'accessoryCircular'
28
+ | 'accessoryCircularCapacity'
29
+ | 'linearCapacity'
30
+ /** Custom text for current value label */
31
+ currentValueLabel?: ReactNode
32
+ /** Text for minimum value label */
33
+ minimumValueLabel?: ReactNode
34
+ /** Text for maximum value label */
35
+ maximumValueLabel?: ReactNode
36
+ }
@@ -0,0 +1,10 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type GlassContainerProps = VoltraBaseProps & {
8
+ /** Spacing between glass elements */
9
+ spacing?: number
10
+ }
@@ -0,0 +1,12 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { ReactNode } from 'react'
6
+
7
+ import type { VoltraBaseProps } from '../baseProps'
8
+
9
+ export type GroupBoxProps = VoltraBaseProps & {
10
+ /** Label content for the group box */
11
+ label?: ReactNode
12
+ }
@@ -0,0 +1,14 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type HStackProps = VoltraBaseProps & {
8
+ /** Vertical alignment */
9
+ alignment?: 'top' | 'center' | 'bottom'
10
+ /** Layout mode. 'stack' uses native SwiftUI stacks. 'flex' uses RN-like flexbox. */
11
+ layout?: 'stack' | 'flex'
12
+ /** Spacing between children. Takes precedence over gap style property. */
13
+ spacing?: number
14
+ }
@@ -0,0 +1,18 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { ReactNode } from 'react'
6
+
7
+ import type { VoltraBaseProps } from '../baseProps'
8
+
9
+ export type ImageProps = VoltraBaseProps & {
10
+ /** Image source - either { assetName: string } for asset catalog images or { base64: string } for base64 encoded images */
11
+ source?: Record<string, any>
12
+ /** How the image should be resized to fit its container */
13
+ resizeMode?: 'cover' | 'contain' | 'stretch' | 'repeat' | 'center'
14
+ /** iOS 18+ Home Screen widgets only. Controls how the image is rendered when the widget is in an accented (tinted) or vibrant rendering mode. Use 'fullColor' to opt the image out of the system's desaturation so it keeps its original colors on top of the tinted backdrop. No-op outside of accented/vibrant rendering modes. */
15
+ accentedRenderingMode?: 'fullColor' | 'accented' | 'accentedDesaturated' | 'desaturated'
16
+ /** Custom fallback content rendered when the image is missing */
17
+ fallback?: ReactNode
18
+ }
@@ -0,0 +1,12 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type LabelProps = VoltraBaseProps & {
8
+ /** Text content for the label */
9
+ title?: string
10
+ /** SF Symbol name for the label icon */
11
+ systemImage?: string
12
+ }
@@ -0,0 +1,18 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type LinearGradientProps = VoltraBaseProps & {
8
+ /** Pipe-separated color list (e.g., '#ff0000|#00ff00|#0000ff') */
9
+ colors?: string
10
+ /** Pipe-separated gradient stops (e.g., 'red@0|orange@0.5|yellow@1') */
11
+ stops?: string
12
+ /** Start point (e.g., 'topLeading', 'center', or 'x,y') */
13
+ startPoint?: string
14
+ /** End point (e.g., 'bottomTrailing', 'center', or 'x,y') */
15
+ endPoint?: string
16
+ /** Enable dithering (system-controlled) */
17
+ dither?: boolean
18
+ }
@@ -0,0 +1,34 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { ReactNode } from 'react'
6
+
7
+ import type { VoltraBaseProps } from '../baseProps'
8
+
9
+ export type LinearProgressViewProps = VoltraBaseProps & {
10
+ /** Current progress value */
11
+ value?: number
12
+ /** Whether to count down instead of up */
13
+ countDown?: boolean
14
+ /** Maximum progress value */
15
+ maximumValue?: number
16
+ /** End time in milliseconds since epoch */
17
+ endAtMs?: number
18
+ /** Start time in milliseconds since epoch */
19
+ startAtMs?: number
20
+ /** Color for the track (background) of the progress bar */
21
+ trackColor?: string
22
+ /** Color for the progress fill */
23
+ progressColor?: string
24
+ /** Corner radius for the progress bar */
25
+ cornerRadius?: number
26
+ /** Explicit height for the progress bar */
27
+ height?: number
28
+ /** Custom thumb component to display at progress position */
29
+ thumb?: ReactNode
30
+ /** Label content for the progress indicator */
31
+ label?: ReactNode
32
+ /** Custom text for current value label */
33
+ currentValueLabel?: ReactNode
34
+ }
@@ -0,0 +1,10 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type LinkProps = VoltraBaseProps & {
8
+ /** URL to navigate to when the link is tapped */
9
+ destination: string
10
+ }
@@ -0,0 +1,12 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { ReactNode } from 'react'
6
+
7
+ import type { VoltraBaseProps } from '../baseProps'
8
+
9
+ export type MaskProps = VoltraBaseProps & {
10
+ /** Voltra element used as the mask - alpha channel determines visibility */
11
+ maskElement: ReactNode
12
+ }
@@ -0,0 +1,10 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type SpacerProps = VoltraBaseProps & {
8
+ /** Minimum length */
9
+ minLength?: number
10
+ }
@@ -0,0 +1,34 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type SymbolProps = VoltraBaseProps & {
8
+ /** SF Symbol name */
9
+ name?: string
10
+ /** Symbol rendering type */
11
+ type?: 'monochrome' | 'hierarchical' | 'palette' | 'multicolor'
12
+ /** Symbol scale */
13
+ scale?: 'default' | 'unspecified' | 'small' | 'medium' | 'large'
14
+ /** Symbol weight */
15
+ weight?:
16
+ | 'unspecified'
17
+ | 'ultraLight'
18
+ | 'thin'
19
+ | 'light'
20
+ | 'regular'
21
+ | 'medium'
22
+ | 'semibold'
23
+ | 'bold'
24
+ | 'heavy'
25
+ | 'black'
26
+ /** Symbol size in points */
27
+ size?: number
28
+ /** Tint color for the symbol */
29
+ tintColor?: string
30
+ /** Pipe-separated colors for palette type */
31
+ colors?: string
32
+ /** Image resize mode */
33
+ resizeMode?: string
34
+ }
@@ -0,0 +1,12 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type TextProps = VoltraBaseProps & {
8
+ /** Maximum number of lines to display */
9
+ numberOfLines?: number
10
+ /** Text alignment for multiline text */
11
+ multilineTextAlignment?: 'left' | 'center' | 'right' | 'auto'
12
+ }
@@ -0,0 +1,22 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type TimerProps = VoltraBaseProps & {
8
+ /** End time in milliseconds since epoch */
9
+ endAtMs?: number
10
+ /** Start time in milliseconds since epoch */
11
+ startAtMs?: number
12
+ /** Duration in milliseconds */
13
+ durationMs?: number
14
+ /** Count direction */
15
+ direction?: 'up' | 'down'
16
+ /** Text formatting style */
17
+ textStyle?: 'timer' | 'relative'
18
+ /** JSON-encoded TextTemplates object with running/completed templates */
19
+ textTemplates?: string
20
+ /** Whether to show hours component when duration exceeds 60 minutes. If false, minutes will exceed 60 (e.g., 94:00 instead of 1:34:00) */
21
+ showHours?: boolean
22
+ }
@@ -0,0 +1,10 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type ToggleProps = VoltraBaseProps & {
8
+ /** Initial toggle state */
9
+ defaultValue?: boolean
10
+ }
@@ -0,0 +1,14 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type VStackProps = VoltraBaseProps & {
8
+ /** Horizontal alignment */
9
+ alignment?: 'leading' | 'center' | 'trailing'
10
+ /** Layout mode. 'stack' uses native SwiftUI stacks. 'flex' uses RN-like flexbox. */
11
+ layout?: 'stack' | 'flex'
12
+ /** Spacing between children. Takes precedence over gap style property. */
13
+ spacing?: number
14
+ }
@@ -0,0 +1,7 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type ViewProps = VoltraBaseProps
@@ -0,0 +1,10 @@
1
+ // 🤖 AUTO-GENERATED from data/components.json
2
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
3
+ // Schema version: 1.0.0
4
+
5
+ import type { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type ZStackProps = VoltraBaseProps & {
8
+ /** Child alignment */
9
+ alignment?: string
10
+ }
@@ -0,0 +1,85 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ import { createVoltraRenderer } from '../renderer/index.js'
4
+ import type { LiveActivityJson, LiveActivityVariants } from './types.js'
5
+
6
+ /**
7
+ * Renders Live Activity variants to JSON.
8
+ * Handles non-JSX properties like keylineTint and activityBackgroundTint separately.
9
+ */
10
+ export const renderLiveActivityToJson = (variants: LiveActivityVariants): LiveActivityJson => {
11
+ const renderer = createVoltraRenderer()
12
+
13
+ // Add lock screen variant
14
+ if (variants.lockScreen) {
15
+ const lockScreenVariant = variants.lockScreen
16
+ if (typeof lockScreenVariant === 'object' && lockScreenVariant !== null && 'content' in lockScreenVariant) {
17
+ if (lockScreenVariant.content) {
18
+ renderer.addRootNode('ls', lockScreenVariant.content)
19
+ }
20
+ } else {
21
+ renderer.addRootNode('ls', lockScreenVariant as ReactNode)
22
+ }
23
+ }
24
+
25
+ // Add island variants
26
+ if (variants.island) {
27
+ if (variants.island.expanded) {
28
+ if (variants.island.expanded.center) {
29
+ renderer.addRootNode('isl_exp_c', variants.island.expanded.center)
30
+ }
31
+ if (variants.island.expanded.leading) {
32
+ renderer.addRootNode('isl_exp_l', variants.island.expanded.leading)
33
+ }
34
+ if (variants.island.expanded.trailing) {
35
+ renderer.addRootNode('isl_exp_t', variants.island.expanded.trailing)
36
+ }
37
+ if (variants.island.expanded.bottom) {
38
+ renderer.addRootNode('isl_exp_b', variants.island.expanded.bottom)
39
+ }
40
+ }
41
+ if (variants.island.compact) {
42
+ if (variants.island.compact.leading) {
43
+ renderer.addRootNode('isl_cmp_l', variants.island.compact.leading)
44
+ }
45
+ if (variants.island.compact.trailing) {
46
+ renderer.addRootNode('isl_cmp_t', variants.island.compact.trailing)
47
+ }
48
+ }
49
+ if (variants.island.minimal) {
50
+ renderer.addRootNode('isl_min', variants.island.minimal)
51
+ }
52
+ }
53
+
54
+ // Add supplemental activity family variants (iOS 18+)
55
+ if (variants.supplementalActivityFamilies?.small) {
56
+ renderer.addRootNode('saf_sm', variants.supplementalActivityFamilies.small)
57
+ }
58
+
59
+ // Render all variants
60
+ const result = renderer.render() as LiveActivityJson
61
+
62
+ // Add non-JSX properties after rendering
63
+ if (
64
+ variants.lockScreen &&
65
+ typeof variants.lockScreen === 'object' &&
66
+ 'activityBackgroundTint' in variants.lockScreen
67
+ ) {
68
+ if (variants.lockScreen.activityBackgroundTint) {
69
+ result.ls_background_tint = variants.lockScreen.activityBackgroundTint
70
+ }
71
+ }
72
+
73
+ if (variants.island?.keylineTint) {
74
+ result.isl_keyline_tint = variants.island.keylineTint
75
+ }
76
+
77
+ return result
78
+ }
79
+
80
+ /**
81
+ * Renders Live Activity variants to a JSON string.
82
+ */
83
+ export const renderLiveActivityToString = (variants: LiveActivityVariants): string => {
84
+ return JSON.stringify(renderLiveActivityToJson(variants))
85
+ }