@roku-sdk/components 0.0.0-stage → 2.18.0
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.
- package/BREAKING_CHANGES.md +84 -0
- package/LICENSE +21 -0
- package/README.md +19 -2
- package/core-jsx.d.ts +53 -0
- package/eslint.config.mjs +3 -0
- package/jsx.d.ts +273 -0
- package/package.json +84 -3
- package/src/__tests__/container.test.tsx +150 -0
- package/src/__tests__/glyphs.test.ts +202 -0
- package/src/__tests__/modal-boundary-export.test.ts +12 -0
- package/src/__tests__/native-modal.test.tsx +224 -0
- package/src/__tests__/tween-release.test.tsx +125 -0
- package/src/__tests__/tween-stops-shape.test.tsx +165 -0
- package/src/__tests__/tween-without-compat.test.tsx +64 -0
- package/src/__tests__/tween.test.tsx +195 -0
- package/src/blended-busy-spinner.props.ts +37 -0
- package/src/blended-busy-spinner.tsx +13 -0
- package/src/bounding-tracker.props.ts +18 -0
- package/src/bounding-tracker.tsx +13 -0
- package/src/button-row.tsx +126 -0
- package/src/channel-store.props.ts +425 -0
- package/src/channel-store.tsx +76 -0
- package/src/container.tsx +130 -0
- package/src/core/jsx-runtime.ts +39 -0
- package/src/focusable-group.props.ts +8 -0
- package/src/focusable-group.tsx +17 -0
- package/src/focusable.props.ts +14 -0
- package/src/focusable.tsx +17 -0
- package/src/glyphs.ts +116 -0
- package/src/helpers/index.tsx +4 -0
- package/src/helpers/resolution-context.tsx +68 -0
- package/src/helpers/scale-for-device-resolution.ts +31 -0
- package/src/index.tsx +70 -0
- package/src/jsx-props.ts +87 -0
- package/src/kdfs.d.ts +14 -0
- package/src/kdfs.ts +15 -0
- package/src/key-handler.props.ts +33 -0
- package/src/key-handler.tsx +24 -0
- package/src/modal-dialog.props.ts +38 -0
- package/src/modal-dialog.tsx +41 -0
- package/src/retain-asset.ts +24 -0
- package/src/sg-intrinsics.json +1153 -0
- package/src/sg-nodes/__tests__/__snapshots__/font.test.tsx.snap +13 -0
- package/src/sg-nodes/__tests__/__snapshots__/prop-forwarding.test.tsx.snap +4409 -0
- package/src/sg-nodes/__tests__/core-props.test.ts +301 -0
- package/src/sg-nodes/__tests__/font.test.tsx +141 -0
- package/src/sg-nodes/__tests__/imperative-methods.test.ts +268 -0
- package/src/sg-nodes/__tests__/prop-forwarding.test.tsx +1049 -0
- package/src/sg-nodes/__tests__/solid-integration.test.tsx +719 -0
- package/src/sg-nodes/animated-image.props.ts +64 -0
- package/src/sg-nodes/animated-image.tsx +23 -0
- package/src/sg-nodes/animation.props.ts +292 -0
- package/src/sg-nodes/animation.tsx +190 -0
- package/src/sg-nodes/array-grid.ts +602 -0
- package/src/sg-nodes/audio.props.ts +302 -0
- package/src/sg-nodes/audio.tsx +57 -0
- package/src/sg-nodes/busy-spinner.props.ts +59 -0
- package/src/sg-nodes/busy-spinner.tsx +84 -0
- package/src/sg-nodes/button-group.props.ts +141 -0
- package/src/sg-nodes/button-group.tsx +30 -0
- package/src/sg-nodes/button.props.ts +119 -0
- package/src/sg-nodes/button.tsx +31 -0
- package/src/sg-nodes/check-list.props.ts +71 -0
- package/src/sg-nodes/check-list.tsx +55 -0
- package/src/sg-nodes/content-node.props.ts +1316 -0
- package/src/sg-nodes/content-node.tsx +153 -0
- package/src/sg-nodes/core-props.ts +197 -0
- package/src/sg-nodes/custom-keyboard.props.ts +108 -0
- package/src/sg-nodes/custom-keyboard.tsx +48 -0
- package/src/sg-nodes/dialog.props.ts +159 -0
- package/src/sg-nodes/dialog.tsx +36 -0
- package/src/sg-nodes/dynamic-key-grid.props.ts +22 -0
- package/src/sg-nodes/dynamic-key-grid.tsx +16 -0
- package/src/sg-nodes/dynamic-keyboard.props.ts +30 -0
- package/src/sg-nodes/dynamic-keyboard.tsx +18 -0
- package/src/sg-nodes/dynamic-mini-keyboard.props.ts +22 -0
- package/src/sg-nodes/dynamic-mini-keyboard.tsx +18 -0
- package/src/sg-nodes/dynamic-pinpad.props.ts +57 -0
- package/src/sg-nodes/dynamic-pinpad.tsx +18 -0
- package/src/sg-nodes/effect.props.ts +116 -0
- package/src/sg-nodes/effect.tsx +39 -0
- package/src/sg-nodes/font.props.ts +45 -0
- package/src/sg-nodes/font.tsx +80 -0
- package/src/sg-nodes/group.props.ts +105 -0
- package/src/sg-nodes/group.tsx +30 -0
- package/src/sg-nodes/label-list.props.ts +86 -0
- package/src/sg-nodes/label-list.tsx +64 -0
- package/src/sg-nodes/label.props.ts +207 -0
- package/src/sg-nodes/label.tsx +56 -0
- package/src/sg-nodes/layout-group.props.ts +69 -0
- package/src/sg-nodes/layout-group.tsx +75 -0
- package/src/sg-nodes/list-panel.props.ts +104 -0
- package/src/sg-nodes/list-panel.tsx +49 -0
- package/src/sg-nodes/markup-grid.props.ts +78 -0
- package/src/sg-nodes/markup-grid.tsx +38 -0
- package/src/sg-nodes/markup-list.props.ts +68 -0
- package/src/sg-nodes/markup-list.tsx +38 -0
- package/src/sg-nodes/mask-group.props.ts +78 -0
- package/src/sg-nodes/mask-group.tsx +59 -0
- package/src/sg-nodes/media-playback-methods.ts +20 -0
- package/src/sg-nodes/node.ts +77 -0
- package/src/sg-nodes/overhang.props.ts +169 -0
- package/src/sg-nodes/overhang.tsx +29 -0
- package/src/sg-nodes/panel-set.props.ts +71 -0
- package/src/sg-nodes/panel-set.tsx +53 -0
- package/src/sg-nodes/panel.props.ts +176 -0
- package/src/sg-nodes/panel.tsx +56 -0
- package/src/sg-nodes/poster-grid.props.ts +277 -0
- package/src/sg-nodes/poster-grid.tsx +45 -0
- package/src/sg-nodes/poster.props.ts +125 -0
- package/src/sg-nodes/poster.tsx +44 -0
- package/src/sg-nodes/radio-button-list.props.ts +59 -0
- package/src/sg-nodes/radio-button-list.tsx +68 -0
- package/src/sg-nodes/rectangle.props.ts +29 -0
- package/src/sg-nodes/rectangle.tsx +27 -0
- package/src/sg-nodes/row-list.props.ts +288 -0
- package/src/sg-nodes/row-list.tsx +47 -0
- package/src/sg-nodes/scene.props.ts +65 -0
- package/src/sg-nodes/scene.tsx +15 -0
- package/src/sg-nodes/scrollable-text.props.ts +133 -0
- package/src/sg-nodes/scrollable-text.tsx +64 -0
- package/src/sg-nodes/scrolling-label.props.ts +106 -0
- package/src/sg-nodes/scrolling-label.tsx +42 -0
- package/src/sg-nodes/simple-label.props.ts +156 -0
- package/src/sg-nodes/simple-label.tsx +59 -0
- package/src/sg-nodes/sound-effect.props.ts +130 -0
- package/src/sg-nodes/sound-effect.tsx +65 -0
- package/src/sg-nodes/standard-dialog.props.ts +520 -0
- package/src/sg-nodes/standard-dialog.tsx +428 -0
- package/src/sg-nodes/standard-keyboard-dialog.props.ts +84 -0
- package/src/sg-nodes/standard-keyboard-dialog.tsx +59 -0
- package/src/sg-nodes/standard-message-dialog.props.ts +56 -0
- package/src/sg-nodes/standard-message-dialog.tsx +48 -0
- package/src/sg-nodes/standard-pinpad-dialog.props.ts +64 -0
- package/src/sg-nodes/standard-pinpad-dialog.tsx +46 -0
- package/src/sg-nodes/standard-progress-dialog.props.ts +30 -0
- package/src/sg-nodes/standard-progress-dialog.tsx +43 -0
- package/src/sg-nodes/target-group.props.ts +278 -0
- package/src/sg-nodes/target-group.tsx +63 -0
- package/src/sg-nodes/target-list.props.ts +128 -0
- package/src/sg-nodes/target-list.tsx +66 -0
- package/src/sg-nodes/target-set.props.ts +63 -0
- package/src/sg-nodes/target-set.tsx +42 -0
- package/src/sg-nodes/time-grid.props.ts +646 -0
- package/src/sg-nodes/time-grid.tsx +87 -0
- package/src/sg-nodes/tween.props.ts +115 -0
- package/src/sg-nodes/types.ts +150 -0
- package/src/sg-nodes/video.props.ts +573 -0
- package/src/sg-nodes/video.tsx +73 -0
- package/src/sg-nodes/voice-text-edit-box.props.ts +91 -0
- package/src/sg-nodes/voice-text-edit-box.tsx +15 -0
- package/src/sg-nodes/zoom-row-list.props.ts +416 -0
- package/src/sg-nodes/zoom-row-list.tsx +42 -0
- package/src/standard-dialog-next/__tests__/standard-dialog-next.test.tsx +186 -0
- package/src/standard-dialog-next/index.ts +5 -0
- package/src/standard-dialog-next/standard-dialog-next.props.ts +80 -0
- package/src/standard-dialog-next/standard-dialog-next.tsx +326 -0
- package/src/test-helpers/tween-test-setup.ts +78 -0
- package/src/tween.tsx +173 -0
- package/src/types.ts +8 -0
- package/src/xml-components/blended-busy-spinner/BlendedBusySpinner.brs +13 -0
- package/src/xml-components/blended-busy-spinner/BlendedBusySpinner.xml +10 -0
- package/src/xml-components/blended-busy-spinner/BlendedBusySpinner.xml.d.ts +42 -0
- package/src/xml-components/bounding-tracker/BoundingTracker.brs +26 -0
- package/src/xml-components/bounding-tracker/BoundingTracker.xml +14 -0
- package/src/xml-components/bounding-tracker/BoundingTracker.xml.d.ts +42 -0
- package/src/xml-components/channel-store/channelStoreExt.brs +159 -0
- package/src/xml-components/channel-store/channelStoreExt.xml +29 -0
- package/src/xml-components/channel-store/channelStoreExt.xml.d.ts +57 -0
- package/src/xml-components/focus/focusable-group.brs +251 -0
- package/src/xml-components/focus/focusable-group.xml +15 -0
- package/src/xml-components/focus/focusable-group.xml.d.ts +42 -0
- package/src/xml-components/focus/focusable.xml +18 -0
- package/src/xml-components/focus/focusable.xml.d.ts +48 -0
- package/src/xml-components/keyboards/CustomAddressKDF.keyboard.json +547 -0
- package/src/xml-components/keyboards/CustomKeyboard.brs +322 -0
- package/src/xml-components/keyboards/CustomKeyboard.xml +45 -0
- package/src/xml-components/keyboards/CustomKeyboard.xml.d.ts +73 -0
- package/src/xml-components/keyboards/KeyGridExt.xml +4 -0
- package/src/xml-components/keyboards/KeyGridExt.xml.d.ts +37 -0
- package/src/xml-components/keyboards/KeyboardExt.xml +4 -0
- package/src/xml-components/keyboards/KeyboardExt.xml.d.ts +37 -0
- package/src/xml-components/keyboards/MOPPinPadCustomKDF.keyboard.json +151 -0
- package/src/xml-components/keyboards/MiniKeyboardExt.xml +4 -0
- package/src/xml-components/keyboards/MiniKeyboardExt.xml.d.ts +37 -0
- package/src/xml-components/keyboards/PhonePadCustomKDF.keyboard.json +42 -0
- package/src/xml-components/keyboards/PinPadExt.brs +102 -0
- package/src/xml-components/keyboards/PinPadExt.xml +17 -0
- package/src/xml-components/keyboards/PinPadExt.xml.d.ts +49 -0
- package/src/xml-components/keyboards/WifiCustomKDF.keyboard.json +1242 -0
- package/src/xml-components/keyhandler/KeyHandler.brs +30 -0
- package/src/xml-components/keyhandler/KeyHandler.xml +16 -0
- package/src/xml-components/keyhandler/KeyHandler.xml.d.ts +45 -0
- package/src/xml-components/managed-list-panel/ManagedListPanel.brs +137 -0
- package/src/xml-components/managed-list-panel/ManagedListPanel.xml +10 -0
- package/src/xml-components/managed-list-panel/ManagedListPanel.xml.d.ts +37 -0
- package/src/xml-components/modal/Modal.brs +105 -0
- package/src/xml-components/modal/Modal.xml +22 -0
- package/src/xml-components/modal/Modal.xml.d.ts +54 -0
- package/src/xml-components/modal/StandardDialogExt.xml +10 -0
- package/src/xml-components/modal/StandardDialogExt.xml.d.ts +37 -0
- package/src/xml-components/modal/StandardKeyboardDialogExt.xml +10 -0
- package/src/xml-components/modal/StandardKeyboardDialogExt.xml.d.ts +37 -0
- package/src/xml-components/modal/StandardMessageDialogExt.xml +10 -0
- package/src/xml-components/modal/StandardMessageDialogExt.xml.d.ts +37 -0
- package/src/xml-components/modal/StandardPinPadDialogExt.xml +10 -0
- package/src/xml-components/modal/StandardPinPadDialogExt.xml.d.ts +37 -0
- package/src/xml-components/modal/StandardProgressDialogExt.xml +10 -0
- package/src/xml-components/modal/StandardProgressDialogExt.xml.d.ts +37 -0
- package/src/xml-components/modal/tests/Modal.test.brs +195 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright (c) 2026 Roku, Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { IPosterGridProps } from "./poster-grid.props";
|
|
5
|
+
import { Component } from "./types";
|
|
6
|
+
export type { CaptionVertAlignment, IPosterGridProps } from "./poster-grid.props";
|
|
7
|
+
|
|
8
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
// Caption Vertical Alignment Type
|
|
10
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
// PosterGrid Properties
|
|
14
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
// PosterGrid Component
|
|
18
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* PosterGrid is a simple grid class that can be used to display two-dimensional grids of posters.
|
|
22
|
+
* In addition to the poster, each item in the grid can include up to two lines of captions.
|
|
23
|
+
*
|
|
24
|
+
* The number of columns in the PosterGrid is fixed and the number of rows varies. The items in the
|
|
25
|
+
* grid fill each row from left to right, then top to bottom.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link https://developer.roku.com/dev/docs/postergrid}
|
|
28
|
+
*
|
|
29
|
+
* @example Simple PosterGrid setup
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <posterGrid
|
|
32
|
+
* basePosterSize={[240, 240]}
|
|
33
|
+
* itemSpacing={[32, 32]}
|
|
34
|
+
* caption1NumLines={1}
|
|
35
|
+
* caption2NumLines={1}
|
|
36
|
+
* numColumns={4}
|
|
37
|
+
* numRows={3}
|
|
38
|
+
* content={gridContent}
|
|
39
|
+
* onItemSelected={(index) => handleSelection(index)}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export const PosterGrid: Component<IPosterGridProps> = props => {
|
|
44
|
+
return <posterGrid {...props}></posterGrid>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Copyright (c) 2026 Roku, Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { IGroupProps } from "./group.props";
|
|
5
|
+
import type { EventHandler, JSX, ResType, Uri } from "./types";
|
|
6
|
+
|
|
7
|
+
export type PosterDisplayMode = "noScale" | "scaleToFit" | "scaleToFill" | "scaleToZoom";
|
|
8
|
+
|
|
9
|
+
export type LoadDisplayMode = PosterDisplayMode | "limitSize";
|
|
10
|
+
|
|
11
|
+
export type PosterLoadStatus = "none" | "loading" | "ready" | "failed";
|
|
12
|
+
|
|
13
|
+
export interface BitmapMargins {
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
right: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Properties for the Poster node.
|
|
22
|
+
*
|
|
23
|
+
* Poster is a renderable node that displays bitmap images. It is one of the most widely used nodes
|
|
24
|
+
* in SceneGraph applications for displaying images, thumbnails, and graphics with support for scaling,
|
|
25
|
+
* loading states, and fallback images.
|
|
26
|
+
*
|
|
27
|
+
* Images can be imported directly in TypeScript, which provides automatic resolution handling and
|
|
28
|
+
* dimension information. See the Static Image Management documentation for details.
|
|
29
|
+
*
|
|
30
|
+
* @see {@link https://developer.roku.com/dev/docs/poster}
|
|
31
|
+
* @see **Static Image Management** at documentation/guides/images/static-image-management.md for image import details
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // Import image with resolution substitutes
|
|
35
|
+
* import { uri as logo } from "./images/logo-*.png";
|
|
36
|
+
* <Poster width={200} height={100} uri={logo} />
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Use static URI path
|
|
40
|
+
* <Poster width={1920} height={1080} uri="pkg:/images/background.jpg" />
|
|
41
|
+
*/
|
|
42
|
+
export interface IPosterProps extends IGroupProps {
|
|
43
|
+
/**
|
|
44
|
+
* Specifies the width of the poster bitmap in local coordinates.
|
|
45
|
+
* If set to 0.0, the width of the bitmap from the image file is used.
|
|
46
|
+
* If set to a value greater than 0.0, the bitmap is scaled to that width.
|
|
47
|
+
*/
|
|
48
|
+
width?: ResType<number>;
|
|
49
|
+
/**
|
|
50
|
+
* Specifies the height of the poster bitmap in local coordinates.
|
|
51
|
+
* If set to 0.0, the height of the bitmap from the image file is used.
|
|
52
|
+
* If set to a value greater than 0.0, the bitmap is scaled to that height.
|
|
53
|
+
*/
|
|
54
|
+
height?: ResType<number>;
|
|
55
|
+
/**
|
|
56
|
+
* Controls whether the image is loaded synchronously or asynchronously.
|
|
57
|
+
* If true and the uri specifies a local file (pkg:/images), the image loads synchronously and appears immediately.
|
|
58
|
+
* If false, or if the uri specifies a remote URL (http/https), the image loads asynchronously in a background thread.
|
|
59
|
+
* Be careful when setting to true as it might cause brief glitches in rendering.
|
|
60
|
+
*/
|
|
61
|
+
loadSync?: boolean;
|
|
62
|
+
/** Specifies the width of the bitmap to be loaded. Used for scaling during load. */
|
|
63
|
+
loadWidth?: ResType<number>;
|
|
64
|
+
/** Specifies the height of the bitmap to be loaded. Used for scaling during load. */
|
|
65
|
+
loadHeight?: ResType<number>;
|
|
66
|
+
/**
|
|
67
|
+
* Specifies how the bitmap should be scaled to fit the poster dimensions.
|
|
68
|
+
* - "noScale": Bitmap loaded at original resolution. If Poster's width/height differ, it will be scaled to fill (aspect ratio not preserved)
|
|
69
|
+
* - "scaleToFit": Scale to fit within dimensions, preserving aspect ratio with letterboxing/pillarboxing
|
|
70
|
+
* - "scaleToFill": Stretch to fill dimensions, distorting if aspect ratios differ
|
|
71
|
+
* - "scaleToZoom": Scale to fill dimensions, preserving aspect ratio but cropping parts of the image
|
|
72
|
+
* - "limitSize": Scale while loading so max width/height doesn't exceed loadWidth/loadHeight, preserving aspect ratio
|
|
73
|
+
*/
|
|
74
|
+
loadDisplayMode?: LoadDisplayMode;
|
|
75
|
+
/** Color value to blend with the bitmap. */
|
|
76
|
+
blendColor?: string;
|
|
77
|
+
/** URI of the bitmap to display while the main image is loading. */
|
|
78
|
+
loadingBitmapUri?: Uri;
|
|
79
|
+
/** Opacity of the loading bitmap (0.0 to 1.0). */
|
|
80
|
+
loadingBitmapOpacity?: number;
|
|
81
|
+
/** URI of the bitmap to display if the main image fails to load. */
|
|
82
|
+
failedBitmapUri?: Uri;
|
|
83
|
+
/** Opacity of the failed bitmap (0.0 to 1.0). */
|
|
84
|
+
failedBitmapOpacity?: number;
|
|
85
|
+
/** Text to be spoken by the audio guide for accessibility. */
|
|
86
|
+
audioGuideText?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Event handler called when the load status changes.
|
|
89
|
+
* - "none": No load operation in progress
|
|
90
|
+
* - "loading": Image is currently loading
|
|
91
|
+
* - "ready": Image loaded successfully
|
|
92
|
+
* - "failed": Image failed to load
|
|
93
|
+
*/
|
|
94
|
+
onLoadStatus?: EventHandler<PosterLoadStatus>;
|
|
95
|
+
/** Event handler called when the bitmap width is determined. Provides the actual width of the loaded bitmap. */
|
|
96
|
+
onBitmapWidth?: EventHandler<number>;
|
|
97
|
+
/** Event handler called when the bitmap height is determined. Provides the actual height of the loaded bitmap. */
|
|
98
|
+
onBitmapHeight?: EventHandler<number>;
|
|
99
|
+
/** Event handler called when bitmap margins are determined. Provides margin information for 9-patch images. */
|
|
100
|
+
onBitmapMargins?: EventHandler<BitmapMargins>;
|
|
101
|
+
/**
|
|
102
|
+
* Specifies the URI of the bitmap image file to be displayed.
|
|
103
|
+
* Can use static paths (e.g., "pkg:/images/icon.png") or imported URIs from TypeScript.
|
|
104
|
+
* Images included as part of the application package can be referenced using the pkg:/images prefix.
|
|
105
|
+
*
|
|
106
|
+
* **Important**: Set `uri` as the last property in your JSX to avoid timing issues. If the image is
|
|
107
|
+
* already cached or loads quickly from local storage, it may render before other properties
|
|
108
|
+
* (such as `loadDisplayMode` or event handlers) are applied. Placing `uri` last ensures all
|
|
109
|
+
* configuration properties are set before the image loading process begins.
|
|
110
|
+
*/
|
|
111
|
+
uri?: Uri;
|
|
112
|
+
/**
|
|
113
|
+
* An Effect node to apply shader-based rendering (rounded corners, borders, gradients).
|
|
114
|
+
* On platforms that do not support effects, this is silently ignored.
|
|
115
|
+
*/
|
|
116
|
+
effect?: JSX.Element;
|
|
117
|
+
/**
|
|
118
|
+
* If true, requests that the bitmap is loaded in a format that can be used with shaders, which
|
|
119
|
+
* includes any poster that will have an Effect node attached.
|
|
120
|
+
* Note that setting this to false does not guarantee that the resulting poster cannot be used
|
|
121
|
+
* with Effects.
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
shaderCompatible?: boolean;
|
|
125
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright (c) 2026 Roku, Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { IPosterProps } from "./poster.props";
|
|
5
|
+
import { Component } from "./types";
|
|
6
|
+
export type { PosterDisplayMode, LoadDisplayMode, PosterLoadStatus, BitmapMargins, IPosterProps } from "./poster.props";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Poster is a renderable node that displays bitmap images. It is one of the most widely used nodes
|
|
10
|
+
* in SceneGraph applications for displaying images, thumbnails, and graphics with support for scaling,
|
|
11
|
+
* loading states, and fallback images.
|
|
12
|
+
*
|
|
13
|
+
* Images can be imported directly in TypeScript, which provides automatic resolution handling and
|
|
14
|
+
* dimension information. See the Static Image Management documentation for details.
|
|
15
|
+
*
|
|
16
|
+
* **Attribute ordering pitfall:** When using `<poster>` as a JSX intrinsic,
|
|
17
|
+
* write event handlers (`onLoadStatus`, etc.) **before** `uri` and other props that trigger
|
|
18
|
+
* synchronous events on assignment. If `uri` is set first and the image is already cached,
|
|
19
|
+
* the load event fires before your handler is registered and is silently dropped.
|
|
20
|
+
* Writing handlers first is good practice regardless.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Wrong: onLoadStatus may be missed if image is cached
|
|
24
|
+
* <poster uri={src} onLoadStatus={handleLoad} />
|
|
25
|
+
*
|
|
26
|
+
* // Correct: handler registered before the prop that fires it
|
|
27
|
+
* <poster onLoadStatus={handleLoad} uri={src} />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @see {@link https://developer.roku.com/dev/docs/poster}
|
|
31
|
+
* @see **Static Image Management** at documentation/guides/images/static-image-management.md for image import details
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // Import image with resolution substitutes - note uri is last
|
|
35
|
+
* import { uri as logo } from "./images/logo-*.png";
|
|
36
|
+
* <poster width={200} height={100} uri={logo} />
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Use static URI path - note uri is last
|
|
40
|
+
* <poster width={1920} height={1080} uri="pkg:/images/background.jpg" />
|
|
41
|
+
*/
|
|
42
|
+
export const Poster: Component<IPosterProps> = props => {
|
|
43
|
+
return <poster {...props}></poster>;
|
|
44
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) 2026 Roku, Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { ILabelListProps } from "./label-list.props";
|
|
5
|
+
import type { JSX, Uri } from "./types";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Properties for the RadioButtonList component.
|
|
9
|
+
*
|
|
10
|
+
* Extends {@link ILabelListProps} with single-selection radio button state
|
|
11
|
+
* management and custom radio icon options.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://developer.roku.com/dev/docs/radiobuttonlist}
|
|
14
|
+
*/
|
|
15
|
+
export interface IRadioButtonListProps extends ILabelListProps {
|
|
16
|
+
/**
|
|
17
|
+
* The data model for the list. Should be a ContentNode with child
|
|
18
|
+
* ContentNodes, one for each item in the list.
|
|
19
|
+
*/
|
|
20
|
+
content: JSX.Element;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Specifies the index of the currently selected (checked) radio button item.
|
|
24
|
+
* Only one item can be selected at a time.
|
|
25
|
+
*
|
|
26
|
+
* Set to `-1` to indicate no item is selected.
|
|
27
|
+
*
|
|
28
|
+
* @default -1
|
|
29
|
+
*/
|
|
30
|
+
checkedItem?: number;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Controls whether pressing OK automatically sets `checkedItem` to the
|
|
34
|
+
* focused item index.
|
|
35
|
+
*
|
|
36
|
+
* When `false`, developer must manage selection manually via `checkedItem`.
|
|
37
|
+
*
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
checkOnSelect?: boolean;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* URI for the radio button icon when item is selected and not focused.
|
|
44
|
+
* Typically shows a filled circle indicator.
|
|
45
|
+
* Only set to specify a custom bitmap different from default.
|
|
46
|
+
*
|
|
47
|
+
* @example "pkg:/images/radio-checked.png"
|
|
48
|
+
*/
|
|
49
|
+
checkedIconUri?: Uri;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* URI for the radio button icon when item is selected and has focus.
|
|
53
|
+
* Typically shows a filled circle indicator with focus highlight.
|
|
54
|
+
* Only set to specify a custom bitmap different from default.
|
|
55
|
+
*
|
|
56
|
+
* @example "pkg:/images/radio-checked-focused.png"
|
|
57
|
+
*/
|
|
58
|
+
focusedCheckedIconUri?: Uri;
|
|
59
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright (c) 2026 Roku, Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { IRadioButtonListProps } from "./radio-button-list.props";
|
|
5
|
+
import { Component } from "./types";
|
|
6
|
+
export type { IRadioButtonListProps } from "./radio-button-list.props";
|
|
7
|
+
|
|
8
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
// RadioButtonList Properties
|
|
10
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* RadioButtonList displays a list of items with radio buttons for single selection.
|
|
14
|
+
*
|
|
15
|
+
* Each item shows a text string and a radio button icon positioned to the left.
|
|
16
|
+
* Unlike CheckList which allows multiple selections, RadioButtonList enforces
|
|
17
|
+
* single selection - selecting one item automatically deselects the previous.
|
|
18
|
+
*
|
|
19
|
+
* ## Data Binding
|
|
20
|
+
*
|
|
21
|
+
* The `content` field should be set to a ContentNode with one child ContentNode
|
|
22
|
+
* for each item. Each child ContentNode should have a `TITLE` attribute (string)
|
|
23
|
+
* that specifies the label text for that item.
|
|
24
|
+
*
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <contentNode>
|
|
27
|
+
* <contentNode title="Option A" />
|
|
28
|
+
* <contentNode title="Option B" />
|
|
29
|
+
* <contentNode title="Option C" />
|
|
30
|
+
* </contentNode>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example Basic usage
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <radioButtonList
|
|
36
|
+
* itemSize={[440, 48]}
|
|
37
|
+
* checkedItem={0}
|
|
38
|
+
* checkOnSelect={true}
|
|
39
|
+
* content={
|
|
40
|
+
* <contentNode>
|
|
41
|
+
* <contentNode title="Low Quality" />
|
|
42
|
+
* <contentNode title="Medium Quality" />
|
|
43
|
+
* <contentNode title="High Quality" />
|
|
44
|
+
* </contentNode>
|
|
45
|
+
* }
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example With custom icons
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <radioButtonList
|
|
52
|
+
* itemSize={[440, 48]}
|
|
53
|
+
* checkedIconUri="pkg:/images/radio-on.png"
|
|
54
|
+
* focusedCheckedIconUri="pkg:/images/radio-on-focused.png"
|
|
55
|
+
* content={
|
|
56
|
+
* <contentNode>
|
|
57
|
+
* <contentNode title="English" />
|
|
58
|
+
* <contentNode title="Spanish" />
|
|
59
|
+
* </contentNode>
|
|
60
|
+
* }
|
|
61
|
+
* />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @see {@link https://developer.roku.com/dev/docs/radiobuttonlist}
|
|
65
|
+
*/
|
|
66
|
+
export const RadioButtonList: Component<IRadioButtonListProps> = props => {
|
|
67
|
+
return <radioButtonList {...props}></radioButtonList>;
|
|
68
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright (c) 2026 Roku, Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { IGroupProps } from "./group.props";
|
|
5
|
+
import type { JSX, ResType } from "./types";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Properties for the Rectangle node.
|
|
9
|
+
*
|
|
10
|
+
* Rectangle is a renderable node that draws a solid colored rectangle. It is one of the three
|
|
11
|
+
* basic renderable nodes in SceneGraph and is commonly used for backgrounds, borders, and simple UI elements.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://developer.roku.com/dev/docs/rectangle}
|
|
14
|
+
*/
|
|
15
|
+
export interface IRectangleProps extends IGroupProps {
|
|
16
|
+
/** Specifies the width of the rectangle in local coordinates. @default 0.0 */
|
|
17
|
+
width?: ResType<number>;
|
|
18
|
+
/** Specifies the height of rectangle in local coordinates. @default 0.0 */
|
|
19
|
+
height?: ResType<number>;
|
|
20
|
+
/** Specifies the color of the rectangle (string containing hex value e.g. RGBA). @default "0xFFFFFFFF" */
|
|
21
|
+
color?: string;
|
|
22
|
+
/** Specifies if the rectangle should be alpha blended with the nodes that are behind it. @default true */
|
|
23
|
+
blendingEnabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* An Effect node to apply shader-based rendering (rounded corners, borders, gradients).
|
|
26
|
+
* On platforms that do not support effects, this is silently ignored.
|
|
27
|
+
*/
|
|
28
|
+
effect?: JSX.Element;
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) 2026 Roku, Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { IRectangleProps } from "./rectangle.props";
|
|
5
|
+
import { Component } from "./types";
|
|
6
|
+
export type { IRectangleProps } from "./rectangle.props";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Rectangle component for rendering solid colored rectangles.
|
|
10
|
+
*
|
|
11
|
+
* Rectangle is a renderable node that draws a solid colored rectangle. It is one of the three
|
|
12
|
+
* basic renderable nodes in SceneGraph and is commonly used for backgrounds, borders, and simple UI elements.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <rectangle
|
|
17
|
+
* width={400}
|
|
18
|
+
* height={200}
|
|
19
|
+
* color="#FF0000FF"
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @see {@link https://developer.roku.com/dev/docs/rectangle}
|
|
24
|
+
*/
|
|
25
|
+
export const Rectangle: Component<IRectangleProps> = props => {
|
|
26
|
+
return <rectangle {...props}></rectangle>;
|
|
27
|
+
};
|