Modules Common Library / tabs
tabs
Reusable React Components and styling utilities designed for use with SA Module Tabs
Components
AnimationCanvas()
function AnimationCanvas(props): Element;Defined in: lib/modules-lib/src/tabs/AnimationCanvas.tsx:22
React Component for displaying glAnimations. Uses WebGLCanvas internally.
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
AnimationError()
function AnimationError(__namedParameters): Element;Defined in: lib/modules-lib/src/tabs/AnimationError.tsx:11
React component for displaying errors related to animations
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
AutoLoopSwitch()
function AutoLoopSwitch(__namedParameters): Element;Defined in: lib/modules-lib/src/tabs/AutoLoopSwitch.tsx:11
A Switch component designed to be used as a toggle for auto playing
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
ButtonComponent()
function ButtonComponent(props): Element;Defined in: lib/modules-lib/src/tabs/ButtonComponent.tsx:21
Button Component that retains interactability even when disabled. Refer to https://blueprintjs.com/docs/#core/components/buttons.anchorbutton|this for more information
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
ModalDiv()
function ModalDiv(__namedParameters): Element;Defined in: lib/modules-lib/src/tabs/ModalDiv.tsx:53
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
MultiItemDisplay()
function MultiItemDisplay(props): Element;Defined in: lib/modules-lib/src/tabs/MultiItemDisplay/index.tsx:16
React Component for displaying multiple items 
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
NumberSelector()
function NumberSelector(__namedParameters): Element;Defined in: lib/modules-lib/src/tabs/NumberSelector.tsx:30
React component for wrapping around a EditableText to provide automatic validation for number values
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
PlayButton()
function PlayButton(__namedParameters): Element;Defined in: lib/modules-lib/src/tabs/PlayButton.tsx:43
A Button that toggles between two states: playing and not playing.
Parameters
| Parameter | Type |
|---|---|
|
Returns
Element
WebGLCanvas
const WebGLCanvas: ForwardRefExoticComponent<Omit<WebGLCanvasProps, "ref"> & RefAttributes<HTMLCanvasElement>>;Defined in: lib/modules-lib/src/tabs/WebGLCanvas.tsx:18
Canvas component used by the curve and rune modules. Standardizes the appearances of canvases for both modules.
Hooks
useAnimation()
function useAnimation(__namedParameters): AnimationHookResult;Defined in: lib/modules-lib/src/tabs/useAnimation.ts:137
Hook for animations based around the requestAnimationFrame function. Calls the provided callback periodically.
Parameters
| Parameter | Type |
|---|---|
|
Returns
Animation Hook utilities
Utilities
defineTab()
function defineTab<T>(tab): T;Defined in: lib/modules-lib/src/tabs/utils.ts:23
Helper for typing tabs
Type Parameters
| Type Parameter |
|---|
|
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
T
getModuleState()
function getModuleState<T>(debuggerContext, name): T | null;Defined in: lib/modules-lib/src/tabs/utils.ts:14
Helper function for extracting the state object for your bundle. If the your bundle state cannot be found or is still uninitialized, then it will return null.
Type Parameters
| Type Parameter | Description |
|---|---|
| The type of your bundle's state object |
Parameters
| Parameter | Type | Description |
|---|---|---|
| DebuggerContext as returned by the frontend | |
|
| Name of your bundle |
Returns
T | null
The state object of your bundle
Other
ACE_GUTTER_BACKGROUND_COLOR
const ACE_GUTTER_BACKGROUND_COLOR: "#34495E" = '#34495E';Defined in: lib/modules-lib/src/tabs/css_constants.ts:25
ACE_GUTTER_TEXT_COLOR
const ACE_GUTTER_TEXT_COLOR: "#8091A0" = '#8091A0';Defined in: lib/modules-lib/src/tabs/css_constants.ts:24
AnimationErrorProps
Defined in: lib/modules-lib/src/tabs/AnimationError.tsx:3
Properties
| Property | Type | Defined in |
|---|---|---|
|
AnimationHookResult
Defined in: lib/modules-lib/src/tabs/useAnimation.ts:71
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
| ( | Change current timestamp that the animation is at. | ||
| ( | Callback for manually drawing a frame to the canvas | ||
|
|
| ||
|
| Boolean value indicating if the animation is currently playing | ||
| () => | Resets the animation to the beginning, but doesn't start it or stop it | ||
| ( | Use this to set the canvas element that will be passed into the callback | ||
| () => | Start the animation | ||
| () => | Stop the animation | ||
|
| Current timestamp of the animation |
AnimationOptions
Defined in: lib/modules-lib/src/tabs/useAnimation.ts:33
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
| Total duration of the animation in milliseconds. Specify | ||
| Automatically go back to the start of the animation when its duration has elapsed. Has no effect if the animation duration is | ||
| Whether the animation should start playing automatically | ||
( | Callback that's called to draw each frame | ||
| The minimum duration of time between each frame in milliseconds. Because of how Specify | ||
| Value from which to begin the animation |
AnimCanvasProps
Defined in: lib/modules-lib/src/tabs/AnimationCanvas.tsx:12
Properties
| Property | Type | Defined in |
|---|---|---|
AutoLoopSwitchProps
type AutoLoopSwitchProps = Omit<SwitchProps, "checked" | "style"> & {
isAutoLooping: boolean;
};Defined in: lib/modules-lib/src/tabs/AutoLoopSwitch.tsx:3
Type Declaration
isAutoLooping
isAutoLooping: boolean;BP_CARD_BORDER_RADIUS
const BP_CARD_BORDER_RADIUS: "2px" = '2px';Defined in: lib/modules-lib/src/tabs/css_constants.ts:17
BP_ICON_COLOR
const BP_ICON_COLOR: "#A7B6C2" = '#A7B6C2';Defined in: lib/modules-lib/src/tabs/css_constants.ts:21
BP_TAB_BUTTON_MARGIN
const BP_TAB_BUTTON_MARGIN: "20px" = '20px';Defined in: lib/modules-lib/src/tabs/css_constants.ts:15
BP_TAB_PANEL_MARGIN
const BP_TAB_PANEL_MARGIN: "20px" = '20px';Defined in: lib/modules-lib/src/tabs/css_constants.ts:16
BP_TEXT_COLOR
const BP_TEXT_COLOR: "#FFFFFF" = '#FFFFFF';Defined in: lib/modules-lib/src/tabs/css_constants.ts:20
BP_TEXT_MARGIN
const BP_TEXT_MARGIN: "10px" = '10px';Defined in: lib/modules-lib/src/tabs/css_constants.ts:18
ButtonComponentProps
type ButtonComponentProps = AnchorButtonProps & ButtonProps;Defined in: lib/modules-lib/src/tabs/ButtonComponent.tsx:14
Refer to link for more details
CANVAS_MAX_WIDTH
const CANVAS_MAX_WIDTH: "max(70vh, 30vw)" = 'max(70vh, 30vw)';Defined in: lib/modules-lib/src/tabs/css_constants.ts:28
ModalProps
Defined in: lib/modules-lib/src/tabs/ModalDiv.tsx:42
Properties
| Property | Type | Defined in |
|---|---|---|
| ||
| ||
| ||
| ||
|
MultiItemDisplayProps
Defined in: lib/modules-lib/src/tabs/MultiItemDisplay/index.tsx:5
Properties
| Property | Type | Defined in |
|---|---|---|
| ||
( |
NumberSelectorProps
type NumberSelectorProps = {
maxValue: number;
minValue: number;
onValueChanged?: (newValue) => void;
value: number;
} & Omit<EditableTextProps, "alwaysRenderInput" | "value" | "type" | "isEditing">;Defined in: lib/modules-lib/src/tabs/NumberSelector.tsx:5
Type Declaration
maxValue
maxValue: number;Maximum value that the selector is allowed to take on
minValue
minValue: number;Minimum value that the selector is allowed to take on
onValueChanged?
optional onValueChanged?: (newValue) => void;Callback that is called with the value that the selector is changing to
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
void
value
value: number;Current value of the selector
PlayButtonProps
type PlayButtonProps = Omit<ButtonComponentProps, "text" | "icon"> & {
iconProps?: Omit<IconProps, "icon">;
isPlaying: boolean;
pausedIcon?: IconProps["icon"];
pausedText?: string;
playingIcon?: IconProps["icon"];
playingText?: string;
tooltipProps?: Omit<TooltipProps, "content">;
};Defined in: lib/modules-lib/src/tabs/PlayButton.tsx:4
Type Declaration
iconProps?
optional iconProps?: Omit<IconProps, "icon">;Props to be passed to the Icon component
isPlaying
isPlaying: boolean;pausedIcon?
optional pausedIcon?: IconProps["icon"];Icon for the button when isPlaying is false. Defaults to play.
pausedText?
optional pausedText?: string;Tooltip string for the button when isPlaying is false. Defaults to Play.
playingIcon?
optional playingIcon?: IconProps["icon"];Icon for the button when isPlaying is true. Defaults to pause.
playingText?
optional playingText?: string;Tooltip string for the button when isPlaying is true. Defaults to Pause.
tooltipProps?
optional tooltipProps?: Omit<TooltipProps, "content">;Props to be passed to the Tooltip component
SA_TAB_BUTTON_WIDTH
const SA_TAB_BUTTON_WIDTH: "40px" = '40px';Defined in: lib/modules-lib/src/tabs/css_constants.ts:11
SA_TAB_ICON_SIZE
const SA_TAB_ICON_SIZE: LARGE = IconSize.LARGE;Defined in: lib/modules-lib/src/tabs/css_constants.ts:12
WebGLCanvasProps
type WebGLCanvasProps = DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>;Defined in: lib/modules-lib/src/tabs/WebGLCanvas.tsx:10