@use-voltra/android 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 (81) hide show
  1. package/build/commonjs/index.js +20 -0
  2. package/build/commonjs/index.js.map +1 -1
  3. package/build/module/index.js +6 -0
  4. package/build/module/index.js.map +1 -1
  5. package/build/typescript/commonjs/index.d.ts +3 -0
  6. package/build/typescript/commonjs/index.d.ts.map +1 -1
  7. package/build/typescript/module/index.d.ts +3 -0
  8. package/build/typescript/module/index.d.ts.map +1 -1
  9. package/package.json +3 -2
  10. package/src/dynamic-colors.ts +33 -0
  11. package/src/index.ts +99 -0
  12. package/src/internal.ts +2 -0
  13. package/src/jsx/AreaMark.tsx +16 -0
  14. package/src/jsx/BarMark.tsx +18 -0
  15. package/src/jsx/Box.tsx +5 -0
  16. package/src/jsx/Button.tsx +5 -0
  17. package/src/jsx/Chart.tsx +123 -0
  18. package/src/jsx/CheckBox.tsx +5 -0
  19. package/src/jsx/CircleIconButton.tsx +14 -0
  20. package/src/jsx/CircularProgressIndicator.tsx +7 -0
  21. package/src/jsx/Column.tsx +5 -0
  22. package/src/jsx/FilledButton.tsx +14 -0
  23. package/src/jsx/Image.tsx +21 -0
  24. package/src/jsx/LazyColumn.tsx +5 -0
  25. package/src/jsx/LazyVerticalGrid.tsx +45 -0
  26. package/src/jsx/LineMark.tsx +17 -0
  27. package/src/jsx/LinearProgressIndicator.tsx +7 -0
  28. package/src/jsx/OutlineButton.tsx +14 -0
  29. package/src/jsx/PointMark.tsx +16 -0
  30. package/src/jsx/RadioButton.tsx +5 -0
  31. package/src/jsx/Row.tsx +5 -0
  32. package/src/jsx/RuleMark.tsx +15 -0
  33. package/src/jsx/Scaffold.tsx +5 -0
  34. package/src/jsx/SectorMark.tsx +17 -0
  35. package/src/jsx/Spacer.tsx +5 -0
  36. package/src/jsx/SquareIconButton.tsx +14 -0
  37. package/src/jsx/Switch.tsx +5 -0
  38. package/src/jsx/Text.tsx +10 -0
  39. package/src/jsx/TitleBar.tsx +18 -0
  40. package/src/jsx/baseProps.tsx +13 -0
  41. package/src/jsx/chart-types.ts +2 -0
  42. package/src/jsx/createVoltraComponent.ts +2 -0
  43. package/src/jsx/index.ts +1 -0
  44. package/src/jsx/primitives.ts +28 -0
  45. package/src/jsx/props/.generated +15 -0
  46. package/src/jsx/props/AndroidBox.ts +19 -0
  47. package/src/jsx/props/AndroidButton.ts +10 -0
  48. package/src/jsx/props/AndroidChart.ts +20 -0
  49. package/src/jsx/props/AndroidCheckBox.ts +20 -0
  50. package/src/jsx/props/AndroidCircleIconButton.ts +18 -0
  51. package/src/jsx/props/AndroidCircularProgressIndicator.ts +10 -0
  52. package/src/jsx/props/AndroidColumn.ts +12 -0
  53. package/src/jsx/props/AndroidFilledButton.ts +20 -0
  54. package/src/jsx/props/AndroidImage.ts +26 -0
  55. package/src/jsx/props/AndroidLazyColumn.ts +10 -0
  56. package/src/jsx/props/AndroidLazyVerticalGrid.ts +12 -0
  57. package/src/jsx/props/AndroidLinearProgressIndicator.ts +14 -0
  58. package/src/jsx/props/AndroidOutlineButton.ts +18 -0
  59. package/src/jsx/props/AndroidRadioButton.ts +22 -0
  60. package/src/jsx/props/AndroidRow.ts +12 -0
  61. package/src/jsx/props/AndroidScaffold.ts +12 -0
  62. package/src/jsx/props/AndroidSpacer.ts +7 -0
  63. package/src/jsx/props/AndroidSquareIconButton.ts +18 -0
  64. package/src/jsx/props/AndroidSwitch.ts +24 -0
  65. package/src/jsx/props/AndroidText.ts +14 -0
  66. package/src/jsx/props/AndroidTitleBar.ts +18 -0
  67. package/src/live-update/renderer.ts +36 -0
  68. package/src/live-update/types.ts +44 -0
  69. package/src/ongoing-notification/components.tsx +49 -0
  70. package/src/ongoing-notification/renderer.ts +360 -0
  71. package/src/ongoing-notification/types.ts +199 -0
  72. package/src/payload/component-ids.ts +89 -0
  73. package/src/preload-utils.ts +78 -0
  74. package/src/renderer/index.ts +6 -0
  75. package/src/renderer/renderer.ts +25 -0
  76. package/src/server.ts +19 -0
  77. package/src/styles/types.ts +114 -0
  78. package/src/types.ts +38 -0
  79. package/src/utils/index.ts +0 -0
  80. package/src/widgets/renderer.ts +90 -0
  81. package/src/widgets/types.ts +62 -0
@@ -0,0 +1,16 @@
1
+ import { createElement } from 'react'
2
+
3
+ import type { AndroidColorValue } from '../dynamic-colors.js'
4
+ import { VOLTRA_MARK_TAG } from './BarMark.js'
5
+ import type { ChartDataPoint } from './chart-types.js'
6
+
7
+ export type PointMarkProps = {
8
+ data: ChartDataPoint[]
9
+ color?: AndroidColorValue
10
+ symbol?: string
11
+ symbolSize?: number
12
+ }
13
+
14
+ export const PointMark = (props: PointMarkProps) => createElement('VoltraPointMark', props as any)
15
+ PointMark.displayName = 'PointMark'
16
+ PointMark[VOLTRA_MARK_TAG] = 'point' as const
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { AndroidRadioButtonProps as RadioButtonProps } from './props/AndroidRadioButton.js'
3
+
4
+ export type { RadioButtonProps }
5
+ export const RadioButton = createVoltraComponent<RadioButtonProps>('AndroidRadioButton')
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { AndroidRowProps as RowProps } from './props/AndroidRow.js'
3
+
4
+ export type { RowProps }
5
+ export const Row = createVoltraComponent<RowProps>('AndroidRow')
@@ -0,0 +1,15 @@
1
+ import { createElement } from 'react'
2
+
3
+ import type { AndroidColorValue } from '../dynamic-colors.js'
4
+ import { VOLTRA_MARK_TAG } from './BarMark.js'
5
+
6
+ export type RuleMarkProps = {
7
+ xValue?: string | number
8
+ yValue?: number
9
+ color?: AndroidColorValue
10
+ lineWidth?: number
11
+ }
12
+
13
+ export const RuleMark = (props: RuleMarkProps) => createElement('VoltraRuleMark', props as any)
14
+ RuleMark.displayName = 'RuleMark'
15
+ RuleMark[VOLTRA_MARK_TAG] = 'rule' as const
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { AndroidScaffoldProps as ScaffoldProps } from './props/AndroidScaffold.js'
3
+
4
+ export type { ScaffoldProps }
5
+ export const Scaffold = createVoltraComponent<ScaffoldProps>('AndroidScaffold')
@@ -0,0 +1,17 @@
1
+ import { createElement } from 'react'
2
+
3
+ import type { AndroidColorValue } from '../dynamic-colors.js'
4
+ import { VOLTRA_MARK_TAG } from './BarMark.js'
5
+ import type { SectorDataPoint } from './chart-types.js'
6
+
7
+ export type SectorMarkProps = {
8
+ data: SectorDataPoint[]
9
+ color?: AndroidColorValue
10
+ innerRadius?: number
11
+ outerRadius?: number
12
+ angularInset?: number
13
+ }
14
+
15
+ export const SectorMark = (props: SectorMarkProps) => createElement('VoltraSectorMark', props as any)
16
+ SectorMark.displayName = 'SectorMark'
17
+ SectorMark[VOLTRA_MARK_TAG] = 'sector' as const
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { AndroidSpacerProps as SpacerProps } from './props/AndroidSpacer.js'
3
+
4
+ export type { SpacerProps }
5
+ export const Spacer = createVoltraComponent<SpacerProps>('AndroidSpacer')
@@ -0,0 +1,14 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { AndroidSquareIconButtonProps as SquareIconButtonProps } from './props/AndroidSquareIconButton.js'
3
+
4
+ export type { SquareIconButtonProps }
5
+ export const SquareIconButton = createVoltraComponent<SquareIconButtonProps>('AndroidSquareIconButton', {
6
+ toJSON: (props) => {
7
+ const { icon, ...rest } = props
8
+
9
+ return {
10
+ ...rest,
11
+ ...(icon ? { icon: JSON.stringify(icon) } : {}),
12
+ }
13
+ },
14
+ })
@@ -0,0 +1,5 @@
1
+ import { createVoltraComponent } from './createVoltraComponent.js'
2
+ import type { AndroidSwitchProps as SwitchProps } from './props/AndroidSwitch.js'
3
+
4
+ export type { SwitchProps }
5
+ export const Switch = createVoltraComponent<SwitchProps>('AndroidSwitch')
@@ -0,0 +1,10 @@
1
+ import { VoltraAndroidTextStyleProp } from '../styles/types.js'
2
+ import { createVoltraComponent } from './createVoltraComponent.js'
3
+ import type { AndroidTextProps } from './props/AndroidText.js'
4
+
5
+ // Update 'style' to use Android text style prop
6
+ export type TextProps = Omit<AndroidTextProps, 'style'> & {
7
+ style?: VoltraAndroidTextStyleProp
8
+ }
9
+
10
+ export const Text = createVoltraComponent<TextProps>('AndroidText')
@@ -0,0 +1,18 @@
1
+ import type { ImageSource } from './Image.js'
2
+ import { createVoltraComponent } from './createVoltraComponent.js'
3
+ import type { AndroidTitleBarProps } from './props/AndroidTitleBar.js'
4
+
5
+ export type TitleBarProps = Omit<AndroidTitleBarProps, 'startIcon'> & {
6
+ startIcon: ImageSource
7
+ }
8
+
9
+ export const TitleBar = createVoltraComponent<TitleBarProps>('AndroidTitleBar', {
10
+ toJSON: (props) => {
11
+ const { startIcon, ...rest } = props
12
+
13
+ return {
14
+ ...rest,
15
+ startIcon: JSON.stringify(startIcon),
16
+ }
17
+ },
18
+ })
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react'
2
+
3
+ import type { VoltraAndroidStyleProp } from '../styles/types.js'
4
+
5
+ export type VoltraAndroidBaseProps = {
6
+ id?: string
7
+ deepLinkUrl?: string
8
+ style?: VoltraAndroidStyleProp
9
+ children?: ReactNode
10
+ }
11
+
12
+ /** Alias used by generated `props/*.ts` component types */
13
+ export type VoltraBaseProps = VoltraAndroidBaseProps
@@ -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 @@
1
+ export * from './primitives.js'
@@ -0,0 +1,28 @@
1
+ export * from './AreaMark.js'
2
+ export * from './BarMark.js'
3
+ export * from './Box.js'
4
+ export * from './Button.js'
5
+ export * from './Chart.js'
6
+ export * from './chart-types.js'
7
+ export * from './CheckBox.js'
8
+ export * from './CircleIconButton.js'
9
+ export * from './CircularProgressIndicator.js'
10
+ export * from './Column.js'
11
+ export * from './FilledButton.js'
12
+ export * from './Image.js'
13
+ export * from './LazyColumn.js'
14
+ export * from './LazyVerticalGrid.js'
15
+ export * from './LinearProgressIndicator.js'
16
+ export * from './LineMark.js'
17
+ export * from './OutlineButton.js'
18
+ export * from './PointMark.js'
19
+ export * from './RadioButton.js'
20
+ export * from './Row.js'
21
+ export * from './RuleMark.js'
22
+ export * from './Scaffold.js'
23
+ export * from './SectorMark.js'
24
+ export * from './Spacer.js'
25
+ export * from './SquareIconButton.js'
26
+ export * from './Switch.js'
27
+ export * from './Text.js'
28
+ export * from './TitleBar.js'
@@ -0,0 +1,15 @@
1
+ This directory contains auto-generated Android 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,19 @@
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 AndroidBoxProps = VoltraBaseProps & {
8
+ /** Content alignment within the box */
9
+ contentAlignment?:
10
+ | 'top-start'
11
+ | 'top-center'
12
+ | 'top-end'
13
+ | 'center-start'
14
+ | 'center'
15
+ | 'center-end'
16
+ | 'bottom-start'
17
+ | 'bottom-center'
18
+ | 'bottom-end'
19
+ }
@@ -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 AndroidButtonProps = VoltraBaseProps & {
8
+ /** Whether the button is enabled */
9
+ enabled?: boolean
10
+ }
@@ -0,0 +1,20 @@
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 AndroidChartProps = 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
+ /** Show or hide the y-axis */
13
+ yAxisVisibility?: 'automatic' | 'visible' | 'hidden'
14
+ /** Show or hide the chart legend */
15
+ legendVisibility?: 'automatic' | 'visible' | 'hidden'
16
+ /** Map of series name to color string */
17
+ foregroundStyleScale?: Record<string, any>
18
+ /** Enable scrolling on the given axis */
19
+ chartScrollableAxes?: 'horizontal' | 'vertical'
20
+ }
@@ -0,0 +1,20 @@
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 AndroidCheckBoxProps = VoltraBaseProps & {
8
+ /** Unique identifier for interaction events */
9
+ id: string
10
+ /** Initial checked state */
11
+ checked?: boolean
12
+ /** Text label */
13
+ text?: string
14
+ /** Checked color */
15
+ checkedColor?: string
16
+ /** Unchecked color */
17
+ uncheckedColor?: string
18
+ /** Maximum lines for text */
19
+ maxLines?: number
20
+ }
@@ -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 AndroidCircleIconButtonProps = VoltraBaseProps & {
8
+ /** Icon source */
9
+ icon: Record<string, any>
10
+ /** Accessibility description */
11
+ contentDescription?: string
12
+ /** Whether the button is enabled */
13
+ enabled?: boolean
14
+ /** Background color */
15
+ backgroundColor?: string
16
+ /** Icon color */
17
+ contentColor?: string
18
+ }
@@ -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 AndroidCircularProgressIndicatorProps = VoltraBaseProps & {
8
+ /** Progress color */
9
+ color?: 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 { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type AndroidColumnProps = VoltraBaseProps & {
8
+ /** Horizontal alignment of children */
9
+ horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
10
+ /** Vertical alignment of children */
11
+ verticalAlignment?: 'top' | 'center-vertically' | 'bottom'
12
+ }
@@ -0,0 +1,20 @@
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 AndroidFilledButtonProps = VoltraBaseProps & {
8
+ /** Text to display */
9
+ text: string
10
+ /** Whether the button is enabled */
11
+ enabled?: boolean
12
+ /** Optional icon */
13
+ icon?: Record<string, any>
14
+ /** Background color */
15
+ backgroundColor?: string
16
+ /** Text/icon color */
17
+ contentColor?: string
18
+ /** Maximum lines for text */
19
+ maxLines?: number
20
+ }
@@ -0,0 +1,26 @@
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 AndroidImageProps = VoltraBaseProps & {
10
+ /** Image source */
11
+ source: Record<string, any>
12
+ /** Resizing mode */
13
+ resizeMode?: 'cover' | 'contain' | 'stretch' | 'repeat' | 'center'
14
+ /** Accessibility description */
15
+ contentDescription?: string
16
+ /** How the image should scale within its bounds */
17
+ contentScale?: 'crop' | 'cover' | 'fit' | 'contain' | 'fill-bounds' | 'stretch'
18
+ /** Image opacity from 0 to 1 */
19
+ alpha?: number
20
+ /** Tint color filter */
21
+ colorFilter?: string
22
+ /** Legacy tint color alias for colorFilter */
23
+ tintColor?: string
24
+ /** Custom fallback content rendered when the image is missing */
25
+ fallback?: ReactNode
26
+ }
@@ -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 AndroidLazyColumnProps = VoltraBaseProps & {
8
+ /** Horizontal alignment of children */
9
+ horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
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 { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type AndroidLazyVerticalGridProps = VoltraBaseProps & {
8
+ /** Number of fixed grid columns */
9
+ columns?: number
10
+ /** Horizontal alignment of children */
11
+ horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
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 AndroidLinearProgressIndicatorProps = VoltraBaseProps & {
8
+ /** Progress value from 0 to 1 */
9
+ progress?: number
10
+ /** Progress color */
11
+ color?: string
12
+ /** Track background color */
13
+ backgroundColor?: string
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 { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type AndroidOutlineButtonProps = VoltraBaseProps & {
8
+ /** Text to display */
9
+ text: string
10
+ /** Whether the button is enabled */
11
+ enabled?: boolean
12
+ /** Optional icon */
13
+ icon?: Record<string, any>
14
+ /** Text/icon color */
15
+ contentColor?: string
16
+ /** Maximum lines for text */
17
+ maxLines?: number
18
+ }
@@ -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 AndroidRadioButtonProps = VoltraBaseProps & {
8
+ /** Unique identifier for interaction events */
9
+ id: string
10
+ /** Initial checked state */
11
+ checked?: boolean
12
+ /** Whether the radio button is enabled */
13
+ enabled?: boolean
14
+ /** Text label */
15
+ text?: string
16
+ /** Checked color */
17
+ checkedColor?: string
18
+ /** Unchecked color */
19
+ uncheckedColor?: string
20
+ /** Maximum lines for text */
21
+ maxLines?: number
22
+ }
@@ -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 AndroidRowProps = VoltraBaseProps & {
8
+ /** Horizontal alignment of children */
9
+ horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
10
+ /** Vertical alignment of children */
11
+ verticalAlignment?: 'top' | 'center-vertically' | 'bottom'
12
+ }
@@ -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 AndroidScaffoldProps = VoltraBaseProps & {
8
+ /** Background color */
9
+ backgroundColor?: string
10
+ /** Horizontal padding */
11
+ horizontalPadding?: number
12
+ }
@@ -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 AndroidSpacerProps = VoltraBaseProps
@@ -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 AndroidSquareIconButtonProps = VoltraBaseProps & {
8
+ /** Icon source */
9
+ icon: Record<string, any>
10
+ /** Accessibility description */
11
+ contentDescription?: string
12
+ /** Whether the button is enabled */
13
+ enabled?: boolean
14
+ /** Background color */
15
+ backgroundColor?: string
16
+ /** Icon color */
17
+ contentColor?: string
18
+ }
@@ -0,0 +1,24 @@
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 AndroidSwitchProps = VoltraBaseProps & {
8
+ /** Unique identifier for interaction events */
9
+ id: string
10
+ /** Initial checked state */
11
+ checked?: boolean
12
+ /** Text label */
13
+ text?: string
14
+ /** Checked thumb color */
15
+ thumbCheckedColor?: string
16
+ /** Unchecked thumb color */
17
+ thumbUncheckedColor?: string
18
+ /** Checked track color */
19
+ trackCheckedColor?: string
20
+ /** Unchecked track color */
21
+ trackUncheckedColor?: string
22
+ /** Maximum lines for text */
23
+ maxLines?: number
24
+ }
@@ -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 AndroidTextProps = VoltraBaseProps & {
8
+ /** Text color */
9
+ color?: string
10
+ /** Font size */
11
+ fontSize?: number
12
+ /** Maximum lines */
13
+ maxLines?: 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 { VoltraBaseProps } from '../baseProps'
6
+
7
+ export type AndroidTitleBarProps = VoltraBaseProps & {
8
+ /** Title text */
9
+ title: string
10
+ /** Leading icon */
11
+ startIcon: Record<string, any>
12
+ /** Leading icon tint color */
13
+ iconColor?: string
14
+ /** Title text color */
15
+ textColor?: string
16
+ /** Title font family */
17
+ fontFamily?: 'monospace' | 'serif' | 'sans-serif' | 'cursive'
18
+ }
@@ -0,0 +1,36 @@
1
+ import { getAndroidComponentId } from '../payload/component-ids.js'
2
+ import type { ComponentRegistry } from '../renderer/index.js'
3
+ import { createVoltraRenderer } from '../renderer/index.js'
4
+ import type { AndroidLiveUpdateJson, AndroidLiveUpdateVariants } from './types.js'
5
+
6
+ const androidComponentRegistry: ComponentRegistry = {
7
+ getComponentId: (name: string) => getAndroidComponentId(name),
8
+ }
9
+
10
+ export const renderAndroidLiveUpdateToJson = (variants: AndroidLiveUpdateVariants): AndroidLiveUpdateJson => {
11
+ const renderer = createVoltraRenderer(androidComponentRegistry)
12
+
13
+ if (variants.collapsed) {
14
+ renderer.addRootNode('collapsed', variants.collapsed)
15
+ }
16
+
17
+ if (variants.expanded) {
18
+ renderer.addRootNode('expanded', variants.expanded)
19
+ }
20
+
21
+ const result = renderer.render() as AndroidLiveUpdateJson
22
+
23
+ if (variants.smallIcon) {
24
+ result.smallIcon = variants.smallIcon
25
+ }
26
+
27
+ if (variants.channelId) {
28
+ result.channelId = variants.channelId
29
+ }
30
+
31
+ return result
32
+ }
33
+
34
+ export const renderAndroidLiveUpdateToString = (variants: AndroidLiveUpdateVariants): string => {
35
+ return JSON.stringify(renderAndroidLiveUpdateToJson(variants))
36
+ }
@@ -0,0 +1,44 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ import type { VoltraNodeJson } from '../types.js'
4
+
5
+ export type AndroidLiveUpdateVariants = {
6
+ collapsed?: ReactNode
7
+ expanded?: ReactNode
8
+ smallIcon?: string
9
+ channelId?: string
10
+ }
11
+
12
+ export type AndroidLiveUpdateVariantsJson = {
13
+ v: number
14
+ s?: Record<string, unknown>[]
15
+ e?: VoltraNodeJson[]
16
+ collapsed?: VoltraNodeJson
17
+ expanded?: VoltraNodeJson
18
+ smallIcon?: string
19
+ channelId?: string
20
+ }
21
+
22
+ export type AndroidLiveUpdateJson = AndroidLiveUpdateVariantsJson
23
+
24
+ export type StartAndroidLiveUpdateOptions = {
25
+ updateName?: string
26
+ channelId?: string
27
+ }
28
+
29
+ export type UpdateAndroidLiveUpdateOptions = {
30
+ // Currently no additional options, but keeping for future extensibility
31
+ }
32
+
33
+ export type UseAndroidLiveUpdateOptions = {
34
+ updateName?: string
35
+ autoStart?: boolean
36
+ autoUpdate?: boolean
37
+ }
38
+
39
+ export type UseAndroidLiveUpdateResult = {
40
+ start: (options?: StartAndroidLiveUpdateOptions) => Promise<void>
41
+ update: (options?: UpdateAndroidLiveUpdateOptions) => Promise<void>
42
+ end: () => Promise<void>
43
+ isActive: boolean
44
+ }