repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useEffectEvent.spec.ts
packages/fuselage-hooks/src/useEffectEvent.spec.ts
import { useState } from 'react'; import { act, renderHook } from './testing'; import { useEffectEvent } from './useEffectEvent'; it('returns a stable callback', () => { const fn = jest.fn(); const { result, rerender } = renderHook(() => useEffectEvent(fn)); const stableCallbackA = result.current; rerender...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useButtonPattern.ts
packages/fuselage-hooks/src/useButtonPattern.ts
import type { MouseEvent, KeyboardEvent } from 'react'; import { useCallback } from 'react'; /** * A React hook to make any HTML element behave like an accessible button, * allowing it to be activated by both mouse clicks and keyboard (Enter/Spacebar). * * This hook is particularly useful when you need to use a no...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useDebouncedValue.spec.ts
packages/fuselage-hooks/src/useDebouncedValue.spec.ts
import { useReducer } from 'react'; import { renderHook, act } from './testing'; import { useDebouncedValue } from './useDebouncedValue'; beforeAll(() => { jest.useFakeTimers(); }); const delay = 100; it('returns the initial value', () => { const initialValue = Symbol(); const { result } = renderHook(() => u...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useDebouncedUpdates.ts
packages/fuselage-hooks/src/useDebouncedUpdates.ts
import type { Dispatch, DispatchWithoutAction } from 'react'; import { useDebouncedCallback } from './useDebouncedCallback'; /** * Hook to debounce the state dispatcher function returned by hooks like `useState()` and `useReducer()`. * * @param pair the state value and dispatcher function pair * @param delay the ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useSafely.server.spec.ts
packages/fuselage-hooks/src/useSafely.server.spec.ts
import { renderHook } from './testing'; import { useSafely } from './useSafely'; it('returns the initial state', () => { const initialState = Symbol(); const dispatcher = jest.fn(); const { result } = renderHook(() => useSafely([initialState, dispatcher])); const [state] = result.current; expect(state).toB...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePrefersColorScheme.spec.ts
packages/fuselage-hooks/src/usePrefersColorScheme.spec.ts
import { withMatchMediaMock } from 'testing-utils/mocks/withMatchMediaMock'; import { renderHook } from './testing'; import { usePrefersColorScheme } from './usePrefersColorScheme'; const setViewport = withMatchMediaMock(); it('should return false on the initial call', () => { const { result } = renderHook(() => u...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePrefersReducedData.server.spec.ts
packages/fuselage-hooks/src/usePrefersReducedData.server.spec.ts
import { renderHook } from './testing'; import { usePrefersReducedData } from './usePrefersReducedData'; it('should return false on the initial call', () => { const { result } = renderHook(() => usePrefersReducedData()); expect(result.current).toBe(false); });
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useMergedRefs.spec.ts
packages/fuselage-hooks/src/useMergedRefs.spec.ts
import { createRef } from 'react'; import { renderHook } from './testing'; import { useMergedRefs } from './useMergedRefs'; it('returns a callback ref', () => { const { result } = renderHook(() => useMergedRefs()); expect(result.current).toEqual(expect.any(Function)); }); it('works without any arguments', () =>...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePrefersReducedData.spec.ts
packages/fuselage-hooks/src/usePrefersReducedData.spec.ts
import { withMatchMediaMock } from 'testing-utils/mocks/withMatchMediaMock'; import { renderHook } from './testing'; import { usePrefersReducedData } from './usePrefersReducedData'; const setViewport = withMatchMediaMock(); it('should return false on the initial call', () => { const { result } = renderHook(() => u...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useDebouncedUpdates.spec.ts
packages/fuselage-hooks/src/useDebouncedUpdates.spec.ts
import { useState } from 'react'; import { renderHook, act } from './testing'; import { useDebouncedUpdates } from './useDebouncedUpdates'; beforeAll(() => { jest.useFakeTimers(); }); const delay = 100; it('returns a debounced state dispatcher', () => { const initialState = Symbol('initial'); const newState =...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useAutoFocus.spec.ts
packages/fuselage-hooks/src/useAutoFocus.spec.ts
import { useImperativeHandle, useState } from 'react'; import { renderHook, act } from './testing'; import { useAutoFocus } from './useAutoFocus'; const focus = jest.fn(); afterEach(() => { focus.mockClear(); }); it('invokes focus', async () => { renderHook(() => { const ref = useAutoFocus(); useImperat...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useLocalStorage.server.spec.ts
packages/fuselage-hooks/src/useLocalStorage.server.spec.ts
import { renderHook } from './testing'; import { useLocalStorage } from './useStorage'; it('returns a default value', () => { const { result } = renderHook(() => useLocalStorage('value-key', 'value-default'), ); const [value] = result.current; expect(value).toStrictEqual('value-default'); });
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useBreakpoints.spec.ts
packages/fuselage-hooks/src/useBreakpoints.spec.ts
import breakpoints from '@rocket.chat/fuselage-tokens/breakpoints.json'; import { withMatchMediaMock } from 'testing-utils/mocks/withMatchMediaMock'; import { renderHook, act } from './testing'; import { useBreakpoints } from './useBreakpoints'; const setViewport = withMatchMediaMock(); it('returns at least the smal...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/index.ts
packages/fuselage-hooks/src/index.ts
export * from './useAutoFocus'; export * from './useBorderBoxSize'; export * from './useBreakpoints'; export * from './useClipboard'; export * from './useDarkMode'; export * from './useContentBoxSize'; export * from './useDebouncedCallback'; export * from './useDebouncedReducer'; export * from './useDebouncedState'; ex...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useDebouncedValue.ts
packages/fuselage-hooks/src/useDebouncedValue.ts
import { useEffect, useState } from 'react'; /** * Hook to keep a debounced reference of a value. * * @param value - the value to be debounced * @param delay - the number of milliseconds to delay * @returns a debounced value * @public */ export const useDebouncedValue = <V>(value: V, delay: number): V => { co...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useLazyRef.ts
packages/fuselage-hooks/src/useLazyRef.ts
import type { MutableRefObject } from 'react'; import { useLayoutEffect, useRef } from 'react'; const EMPTY = Symbol('empty'); const useBrowserLazyRef = <T>(init: () => T): MutableRefObject<T> => { const ref = useRef<typeof EMPTY | T>(EMPTY); useLayoutEffect(() => { if (ref.current === EMPTY) { ref.cur...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePrevious.ts
packages/fuselage-hooks/src/usePrevious.ts
import { useEffect, useRef } from 'react'; export const usePrevious = <T>(value: T): T | undefined => { const ref = useRef<T>(); useEffect(() => { ref.current = value; }); return ref.current; };
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useResizeObserver.spec.ts
packages/fuselage-hooks/src/useResizeObserver.spec.ts
import { withResizeObserverMock } from 'testing-utils/mocks/withResizeObserverMock'; import { renderHook, act } from './testing'; import { useResizeObserver } from './useResizeObserver'; withResizeObserverMock(); beforeAll(() => { jest.useFakeTimers(); }); let element: HTMLElement; beforeEach(() => { element =...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useToggle.ts
packages/fuselage-hooks/src/useToggle.ts
import type { SetStateAction } from 'react'; import { useState } from 'react'; import { useEffectEvent } from './useEffectEvent'; /** * Hook to create a toggleable boolean state. * * @param initialValue - the initial value or the initial state generator function * @returns a state boolean value and a state toggle...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePrefersColorScheme.ts
packages/fuselage-hooks/src/usePrefersColorScheme.ts
import { useMediaQuery } from './useMediaQuery'; /** * Hook to get the prefers-color-scheme value. * * @returns `true` if the prefers-color-scheme matches * @public */ export const usePrefersColorScheme = (scheme?: string): boolean => useMediaQuery(`(prefers-color-scheme: ${!scheme ? 'light' : scheme})`);
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useUniqueId.ts
packages/fuselage-hooks/src/useUniqueId.ts
import { useDebugValue, useRef, useMemo } from 'react'; /** * Hook to keep a unique ID string. * * @returns the unique ID string * @public * @deprecated use `useId` from `react` instead */ export const useUniqueId = (): string => { const ref = useRef<string>(); const uniqueId = useMemo<string>(() => { i...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useMediaQuery.server.spec.ts
packages/fuselage-hooks/src/useMediaQuery.server.spec.ts
import { renderHook } from './testing'; import { useMediaQuery } from './useMediaQuery'; it('returns false for undefined media query', () => { const { result } = renderHook(() => useMediaQuery()); expect(result.current).toBe(false); }); it('returns false for defined media query', () => { const { result } = ren...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useEffectEvent.ts
packages/fuselage-hooks/src/useEffectEvent.ts
import { useRef } from 'react'; import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'; /** * Hook that lets you extract non-reactive logic into an *effect event*. * * An effect event is a function that is a part of an effect logic, but it behaves a lot more like * an event handler. The logic ins...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useAutoFocus.ts
packages/fuselage-hooks/src/useAutoFocus.ts
import type { Ref } from 'react'; import { useEffect, useRef } from 'react'; /** * Hook to automatically request focus for an DOM element. * * @param isFocused - if true, the focus will be requested * @param options - options of the focus request * @returns the ref which holds the element * @public */ export co...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useContentBoxSize.server.spec.ts
packages/fuselage-hooks/src/useContentBoxSize.server.spec.ts
import { useRef } from 'react'; import { renderHook } from './testing'; import { useContentBoxSize } from './useContentBoxSize'; it('immediately returns zero size', () => { const { result } = renderHook(() => useContentBoxSize(useRef(null))); expect(result.current.inlineSize).toStrictEqual(0); expect(result.cu...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useMediaQueries.spec.ts
packages/fuselage-hooks/src/useMediaQueries.spec.ts
import { withMatchMediaMock } from 'testing-utils/mocks/withMatchMediaMock'; import { renderHook, act } from './testing'; import { useMediaQueries } from './useMediaQueries'; const setViewport = withMatchMediaMock(); it('returns empty array if no query is given', () => { const { result } = renderHook(() => useMedi...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useClipboard.spec.ts
packages/fuselage-hooks/src/useClipboard.spec.ts
import { withClipboardMock } from 'testing-utils/mocks/withClipboardMock'; import { renderHook, act } from './testing'; import { useClipboard } from './useClipboard'; let container: Element | undefined; beforeAll(() => { jest.useFakeTimers(); }); beforeEach(() => { container = document.createElement('div'); d...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/PlacementVariant.ts
packages/fuselage-hooks/src/usePosition/PlacementVariant.ts
export type PlacementVariant = 'start' | 'middle' | 'end';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/useBoundingClientRectChanges.ts
packages/fuselage-hooks/src/usePosition/useBoundingClientRectChanges.ts
import type { RefObject } from 'react'; import { useEffect } from 'react'; function getAncestors(element: Element): Element[] { const ancestors: Element[] = []; for ( let el = element.parentElement; !!el && el !== document.documentElement; el = el.parentElement ) { ancestors.push(el); } retur...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/Placement.ts
packages/fuselage-hooks/src/usePosition/Placement.ts
import type { PlacementVariant } from './PlacementVariant'; import type { Position } from './Position'; export type Placement = `${Position}-${PlacementVariant}` | Position;
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/getVariantBoundaries.ts
packages/fuselage-hooks/src/usePosition/getVariantBoundaries.ts
export type VariantBoundaries = { vm: number; vs: number; ve: number; hs: number; he: number; hm: number; }; export function getVariantBoundaries({ anchorRect, targetRect, }: { anchorRect: DOMRect; targetRect: DOMRect; }): VariantBoundaries { return { vm: -targetRect.width / 2 + (anchorRect.l...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/getTargetBoundaries.ts
packages/fuselage-hooks/src/usePosition/getTargetBoundaries.ts
export type TargetBoundaries = { t: number; b: number; r: number; l: number; }; export function getTargetBoundaries({ anchorRect, targetRect, margin = 0, }: { anchorRect: DOMRect; targetRect: DOMRect; margin?: number; }): TargetBoundaries { return { t: anchorRect.top - targetRect.height - mar...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/getTargetBoundaries.spec.ts
packages/fuselage-hooks/src/usePosition/getTargetBoundaries.spec.ts
import { withResizeObserverMock } from 'testing-utils/mocks/withResizeObserverMock'; import { getTargetBoundaries } from './getTargetBoundaries'; withResizeObserverMock(); const anchorRect: DOMRect = { bottom: 300, height: 100, left: 0, right: 100, top: 200, width: 100, x: 0, y: 200, toJSON() { ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/index.spec.ts
packages/fuselage-hooks/src/usePosition/index.spec.ts
import { withResizeObserverMock } from 'testing-utils/mocks/withResizeObserverMock'; import { getPositionStyle } from '.'; import { getTargetBoundaries } from './getTargetBoundaries'; import { getVariantBoundaries } from './getVariantBoundaries'; // TODO: add tests targeting the hook itself withResizeObserverMock(); ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/index.ts
packages/fuselage-hooks/src/usePosition/index.ts
import type { RefObject, CSSProperties } from 'react'; import { useEffect, useRef, useState } from 'react'; import { useDebouncedCallback } from '../useDebouncedCallback'; import { useEffectEvent } from '../useEffectEvent'; import { useSafely } from '../useSafely'; import type { Placement } from './Placement'; import...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/usePosition/Position.ts
packages/fuselage-hooks/src/usePosition/Position.ts
export type Position = 'top' | 'left' | 'bottom' | 'right';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useSafeRefCallback/useSafeRefCallback.spec.tsx
packages/fuselage-hooks/src/useSafeRefCallback/useSafeRefCallback.spec.tsx
import { render } from '@testing-library/react'; import { useSafeRefCallback } from './useSafeRefCallback'; const TestComponent = ({ callback, renderSpan, }: { callback: any; renderSpan?: boolean; }) => { const cbRef = useSafeRefCallback(callback); if (renderSpan) { return <span ref={cbRef} />; } ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useSafeRefCallback/useSafeRefCallback.ts
packages/fuselage-hooks/src/useSafeRefCallback/useSafeRefCallback.ts
import { useMemo } from 'react'; type SafeCallbackRef<T> = (node: T) => (() => void) | void; /** * useSafeRefCallback will call a cleanup function (returned from the passed callback) * whenever the component is re-rendered ( similar to useEffect, but in a callbackRef ) * * Caveat: Usually, callback refs are calle...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage-hooks/src/useSafeRefCallback/index.ts
packages/fuselage-hooks/src/useSafeRefCallback/index.ts
export * from './useSafeRefCallback';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/jest.config.ts
packages/fuselage/jest.config.ts
import type { Config } from 'jest'; export default { preset: 'ts-jest', errorOnDeprecated: true, testMatch: ['<rootDir>/src/**/*.spec.[jt]s?(x)'], testEnvironment: 'jsdom', setupFilesAfterEnv: [ '<rootDir>/jest-setup.ts', 'testing-utils/setup/noErrorsLogged', ], moduleNameMapper: { '\\.scss$'...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/jest-setup.ts
packages/fuselage/jest-setup.ts
import '@testing-library/jest-dom'; import { toHaveNoViolations } from 'jest-axe'; const cssInJsClassRegex = /^rcx-css-[a-z0-9]+$/; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace jest { interface Matchers<R> { toHaveCssInJsClass(): R; } } } expect.extend({ ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/.storybook/helpers.tsx
packages/fuselage/.storybook/helpers.tsx
import type { ComponentProps, ComponentType } from 'react'; import { Box, Icon } from '../src'; import { dark } from '../src/components/PaletteStyleTag/lib/themePalettes'; type PropsVariationSectionProps<TComponent extends ComponentType<any>> = { component: TComponent; common: ComponentProps<TComponent>; xAxis?...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/.storybook/logo.svg.d.ts
packages/fuselage/.storybook/logo.svg.d.ts
declare const path: string; export = path;
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/.storybook/preview.tsx
packages/fuselage/.storybook/preview.tsx
import breakpointTokens from '@rocket.chat/fuselage-tokens/breakpoints.json'; import surface from '@rocket.chat/fuselage-tokens/dist/surface.json'; import type { Preview } from '@storybook/react-webpack5'; import { themes } from 'storybook/theming'; import { useDarkMode } from 'storybook-dark-mode'; import manifest fr...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/.storybook/main.ts
packages/fuselage/.storybook/main.ts
import { dirname, join } from 'path'; import type { StorybookConfig } from '@storybook/react-webpack5'; export default { addons: [ getAbsolutePath('@storybook/addon-a11y'), getAbsolutePath('storybook-dark-mode'), getAbsolutePath('@storybook/addon-webpack5-compiler-swc'), { name: getAbsolutePat...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/.storybook/PropsVariation.tsx
packages/fuselage/.storybook/PropsVariation.tsx
import type { ComponentType } from 'react'; import { Box } from '../src/components/Box'; function PropsVariation({ component: Component, common = {}, xAxis = {}, yAxis = {}, }: { component: ComponentType; common?: Record<string, unknown>; xAxis?: Record<string, Record<string, unknown>>; yAxis?: Record...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/.storybook/DocsContainer.tsx
packages/fuselage/.storybook/DocsContainer.tsx
import { DocsContainer as BaseContainer } from '@storybook/addon-docs/blocks'; import type { ComponentPropsWithoutRef } from 'react'; import { useEffect, useState } from 'react'; import { addons } from 'storybook/preview-api'; import { themes } from 'storybook/theming'; import { DARK_MODE_EVENT_NAME } from 'storybook-d...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/globals.d.ts
packages/fuselage/src/globals.d.ts
declare module '*.css' {} declare module '*.scss' {}
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/testing.ts
packages/fuselage/src/testing.ts
export { render } from '@testing-library/react';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/getPaletteColor.ts
packages/fuselage/src/getPaletteColor.ts
import tokenColors from '@rocket.chat/fuselage-tokens/colors.json'; import invariant from 'invariant'; const isPaletteColorRef = (ref: unknown): ref is keyof typeof tokenColors => typeof ref === 'string' && ref in tokenColors; const mapTypeToPrefix = { neutral: 'n', blue: 'b', green: 'g', yellow: 'y', red...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/Theme.ts
packages/fuselage/src/Theme.ts
import tokenColors from '@rocket.chat/fuselage-tokens/colors.json'; import { getPaletteColor } from './getPaletteColor'; import { toCSSColorValue } from './helpers/toCSSValue'; export class Var { private name: string; private value: string; constructor(name: string, value: string) { this.name = name; ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/styleTokens.ts
packages/fuselage/src/styleTokens.ts
import tokenTypography from '@rocket.chat/fuselage-tokens/typography.json'; import { memoize } from '@rocket.chat/memo'; import invariant from 'invariant'; import { isStatusBackgroundColor, isStatusColor, isStrokeColor, isSurfaceColor, isTextIconColor, neutral, statusBackgroundColors, strokeColors, s...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/index.ts
packages/fuselage/src/index.ts
import './index.scss'; export * from './components'; export * from './styleTokens'; export { Palette, __setThrowErrorOnInvalidToken__ } from './Theme'; export { useArrayLikeClassNameProp } from './hooks/useArrayLikeClassNameProp';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/appendClassName.ts
packages/fuselage/src/helpers/appendClassName.ts
type R<T> = T extends void ? string : T extends string ? string : string[]; export const appendClassName = <T extends string | string[] | undefined>( currentClassName: T, newClassName: string, ): R<T> => { if (currentClassName === undefined || currentClassName === '') { return newClassName as R<T>; } if...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/patchChildren.ts
packages/fuselage/src/helpers/patchChildren.ts
import type { ReactNode, Attributes } from 'react'; import { cloneElement, isValidElement } from 'react'; import { flattenChildren } from './flattenChildren'; import { shallowEqual } from './shallowEqual'; export const patchChildren = <TProps>( children: ReactNode, patch: (props: TProps) => TProps & Attributes, )...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/composeClassNames.ts
packages/fuselage/src/helpers/composeClassNames.ts
import type { Falsy } from '../types/Falsy'; import { exhaustiveCheck } from './exhaustiveCheck'; const withPrefix = (prefix?: string) => (modifier: string) => prefix ? `${prefix}--${modifier}` : modifier; export const composeClassNames = (prefix?: string) => (...args: unknown[]) => { const addPrefix = wit...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/toCSSValue.ts
packages/fuselage/src/helpers/toCSSValue.ts
type cssToValueType = <T extends string | { toString: () => string }>( label: string, value: T, ) => string; export const toCSSValue: cssToValueType = (label, value) => `var(${label}, ${value})`; export const toCSSFontValue = ((label: string, value: string) => toCSSValue(`--rcx-font-family-${label}`, value)) a...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/prependClassName.ts
packages/fuselage/src/helpers/prependClassName.ts
const isStringArray = ( value: string | string[] | undefined, ): value is string[] => Array.isArray(value); export const prependClassName: { (currentClassName: string[] | undefined, newClassName: string): string[]; (currentClassName: string | undefined, newClassName: string): string; } = ( currentClassName: st...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/prevent.ts
packages/fuselage/src/helpers/prevent.ts
import type { SyntheticEvent } from 'react'; export const prevent = (event: SyntheticEvent) => { event.preventDefault(); event.stopPropagation(); event.nativeEvent.stopImmediatePropagation(); };
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/flattenChildren.ts
packages/fuselage/src/helpers/flattenChildren.ts
export { default as flattenChildren } from 'react-keyed-flatten-children';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/shallowEqual.ts
packages/fuselage/src/helpers/shallowEqual.ts
const isObject = ( value: unknown, ): value is Record<string | number | symbol, unknown> => typeof value === 'object' && value !== null; const compareObjects = ( a: Record<string | number | symbol, unknown>, b: Record<string | number | symbol, unknown>, ) => { const keysA = Object.keys(a); const keysB = Ob...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/setStoryDescription.ts
packages/fuselage/src/helpers/setStoryDescription.ts
export const setStoryDescription = (description: string) => ({ docs: { description: { story: description, }, }, });
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/isForwardRefType.ts
packages/fuselage/src/helpers/isForwardRefType.ts
import type { ForwardRefExoticComponent } from 'react'; export const isForwardRefType = <P = any>( type: any, ): type is ForwardRefExoticComponent<P> => type.$$typeof === Symbol.for('react.forward_ref');
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/fromCamelToKebab.ts
packages/fuselage/src/helpers/fromCamelToKebab.ts
export const fromCamelToKebab = (string: string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/exhaustiveCheck.ts
packages/fuselage/src/helpers/exhaustiveCheck.ts
/** * Utility function to check exhaustiveness of a switch statement or if-else statements. * * In TypeScript, variables going through a sequence of conditionals, like cases in switch statements or if-else * statements, the variable type is incrementally narrowed as the conditionals are evaluated until it reaches t...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/helpers/WithErrorWrapper.tsx
packages/fuselage/src/helpers/WithErrorWrapper.tsx
import type { Context, ReactElement } from 'react'; import { useContext } from 'react'; type WithErrorWrapperProps<T> = { context: Context<T>; children: ReactElement; componentName: string; parentComponent: 'Field'; }; function WithErrorWrapper<T>({ context, componentName, children, parentComponent, }...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/hooks/useStyle.ts
packages/fuselage/src/hooks/useStyle.ts
import type { cssFn } from '@rocket.chat/css-in-js'; import { createClassName, escapeName, transpile, attachRules, } from '@rocket.chat/css-in-js'; import { useDebugValue, useInsertionEffect, useMemo } from 'react'; export const useStyle = (cssFn: cssFn | undefined, arg: unknown) => { const content = useMemo...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/hooks/useBoxOnlyProps.ts
packages/fuselage/src/hooks/useBoxOnlyProps.ts
import type { AllHTMLAttributes } from 'react'; import { prependClassName } from '../helpers/prependClassName'; export const useBoxOnlyProps = < T extends { className: string; }, >( props: T & { animated?: boolean; withRichContent?: boolean | 'inlineWithoutBreaks'; htmlSize?: AllHTMLAttributes<H...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/hooks/useArrayLikeClassNameProp.ts
packages/fuselage/src/hooks/useArrayLikeClassNameProp.ts
import type { cssFn } from '@rocket.chat/css-in-js'; import { css } from '@rocket.chat/css-in-js'; import { appendClassName } from '../helpers/appendClassName'; import type { Falsy } from '../types/Falsy'; import { useStyle } from './useStyle'; export const useArrayLikeClassNameProp = < T extends { className?:...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/index.ts
packages/fuselage/src/components/index.ts
export * from './Accordion'; export * from './AnimatedVisibility'; export * from './AudioPlayer'; export * from './AutoComplete'; export * from './Avatar'; export * from './Badge'; export * from './Banner'; export * from './Box'; export * from './Bubble'; export * from './Button'; export * from './ButtonGroup'; export ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FramedIcon/FramedIcon.spec.tsx
packages/fuselage/src/components/FramedIcon/FramedIcon.spec.tsx
import { composeStories } from '@storybook/react-webpack5'; import { axe } from 'jest-axe'; import { render } from '../../testing'; import * as stories from './FramedIcon.stories'; const testCases = Object.values(composeStories(stories)).map((Story) => [ Story.storyName || 'Story', Story, ]); describe('[FramedI...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FramedIcon/FramedIcon.tsx
packages/fuselage/src/components/FramedIcon/FramedIcon.tsx
import type { Keys } from '@rocket.chat/icons'; import type { AllHTMLAttributes } from 'react'; import { Icon } from '../Icon'; export type FramedIconProps = { info?: boolean; success?: boolean; warning?: boolean; danger?: boolean; neutral?: boolean; icon: Keys; } & Omit<AllHTMLAttributes<HTMLElement>, 'i...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FramedIcon/FramedIcon.stories.tsx
packages/fuselage/src/components/FramedIcon/FramedIcon.stories.tsx
import type { Meta, StoryFn } from '@storybook/react-webpack5'; import FramedIcon from './FramedIcon'; export default { title: 'Data Display/FramedIcon', component: FramedIcon, } satisfies Meta<typeof FramedIcon>; const Template: StoryFn<typeof FramedIcon> = (args) => ( <FramedIcon {...args} icon='rocket' /> )...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FramedIcon/index.ts
packages/fuselage/src/components/FramedIcon/index.ts
export { default as FramedIcon, type FramedIconProps } from './FramedIcon';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/useVisible.ts
packages/fuselage/src/components/Options/useVisible.ts
import { useEffectEvent, useDebouncedState } from '@rocket.chat/fuselage-hooks'; import { AnimatedVisibility } from '../AnimatedVisibility'; export const useVisible = ( initialVisibility: | typeof AnimatedVisibility.HIDDEN | typeof AnimatedVisibility.HIDING | typeof AnimatedVisibility.VISIBLE | type...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/Options.spec.tsx
packages/fuselage/src/components/Options/Options.spec.tsx
import { composeStories } from '@storybook/react-webpack5'; import { render } from '../../testing'; import * as stories from './Options.stories'; const { Default } = composeStories(stories); describe('[Message Component]', () => { it('renders without crashing', () => { render(<Default />); }); });
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/OptionsEmpty.tsx
packages/fuselage/src/components/Options/OptionsEmpty.tsx
import { memo } from 'react'; import { Option } from '../Option'; export type OptionsEmptyProps = { customEmpty?: string; }; const OptionsEmpty = ({ customEmpty }: OptionsEmptyProps) => ( <Option label={customEmpty || 'Empty'} /> ); export default memo(OptionsEmpty);
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/useCursor.ts
packages/fuselage/src/components/Options/useCursor.ts
import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import type { KeyboardEvent } from 'react'; import { useState } from 'react'; import { AnimatedVisibility } from '../AnimatedVisibility'; import type { OptionType } from './OptionType'; import { useVisible } from './useVisible'; const keyCodes = { ESC: ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/Options.stories.tsx
packages/fuselage/src/components/Options/Options.stories.tsx
import type { StoryFn, Meta } from '@storybook/react-webpack5'; import { createRef, type ReactNode } from 'react'; import { Box } from '../Box'; import { Option, CheckOption } from '../Option'; import { Options, type OptionType } from '.'; export default { title: 'Navigation/Options', component: Options, } satis...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/Options.tsx
packages/fuselage/src/components/Options/Options.tsx
import type { ComponentType, ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes, SyntheticEvent, } from 'react'; import { forwardRef, useLayoutEffect, useMemo, useRef } from 'react'; import { prevent } from '../../helpers/prevent'; import { Box, type BoxProps } from '../Box'; import { Opt...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/OptionContainer.tsx
packages/fuselage/src/components/Options/OptionContainer.tsx
import { forwardRef } from 'react'; import { Box, type BoxProps } from '../Box'; import { Scrollable } from '../Scrollable'; import { Tile } from '../Tile'; export type OptionContainerProps = BoxProps; const OptionContainer = forwardRef<HTMLElement, OptionContainerProps>( function OptionContainer({ children, ...pr...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/OptionType.tsx
packages/fuselage/src/components/Options/OptionType.tsx
import type { ReactNode } from 'react'; export type OptionType<TValue = string | number, TLabel = ReactNode> = [ value: TValue, label: TLabel, selected?: boolean, disabled?: boolean, type?: 'heading' | 'divider' | 'option', url?: string, ];
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Options/index.ts
packages/fuselage/src/components/Options/index.ts
export { default as Options, type OptionsProps } from './Options'; export { default as OptionContainer, type OptionContainerProps, } from './OptionContainer'; export type { OptionType } from './OptionType'; export { useCursor } from './useCursor';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Scrollable/Scrollable.stories.tsx
packages/fuselage/src/components/Scrollable/Scrollable.stories.tsx
import type { Meta } from '@storybook/react-webpack5'; import { action } from 'storybook/actions'; import { Box } from '../Box'; import { Tile } from '../Tile'; import Scrollable from './Scrollable'; export default { title: 'Layout/Scrollable', component: Scrollable, } satisfies Meta<typeof Scrollable>; export ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Scrollable/Scrollable.spec.tsx
packages/fuselage/src/components/Scrollable/Scrollable.spec.tsx
import { render } from '../../testing'; import Scrollable from './Scrollable'; describe('Scrollabe Component', () => { it('renders without crashing', () => { render(<Scrollable />); }); });
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Scrollable/index.ts
packages/fuselage/src/components/Scrollable/index.ts
export { default as Scrollable, type ScrollableProps } from './Scrollable';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Scrollable/Scrollable.tsx
packages/fuselage/src/components/Scrollable/Scrollable.tsx
import { css } from '@rocket.chat/css-in-js'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import type { PropsWithChildren, MouseEvent, MutableRefObject } from 'react'; import { useRef, useCallback } from 'react'; import { appendClassName } from '../../helpers/appendClassName'; import { useStyle } fro...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/RadioButton/RadioButton.tsx
packages/fuselage/src/components/RadioButton/RadioButton.tsx
import type { AllHTMLAttributes, ReactNode } from 'react'; import { forwardRef } from 'react'; import { Box, type BoxProps } from '../Box'; export type RadioButtonProps = BoxProps & AllHTMLAttributes<HTMLInputElement> & { labelChildren?: ReactNode; }; const RadioButton = forwardRef<HTMLInputElement, RadioBut...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/RadioButton/RadioButton.spec.tsx
packages/fuselage/src/components/RadioButton/RadioButton.spec.tsx
import { composeStories } from '@storybook/react-webpack5'; import { axe } from 'jest-axe'; import { render } from '../../testing'; import * as stories from './RadioButton.stories'; const testCases = Object.values(composeStories(stories)).map((Story) => [ Story.storyName || 'Story', Story, ]); const { Default, ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/RadioButton/index.ts
packages/fuselage/src/components/RadioButton/index.ts
export { default as RadioButton, type RadioButtonProps } from './RadioButton';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/RadioButton/RadioButton.stories.tsx
packages/fuselage/src/components/RadioButton/RadioButton.stories.tsx
import type { StoryFn, Meta } from '@storybook/react-webpack5'; import { action } from 'storybook/actions'; import { PropsVariationSection, DECORATOR_LABEL, } from '../../../.storybook/helpers'; import RadioButton from './RadioButton'; export default { title: 'Inputs/RadioButton', component: RadioButton, } s...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Popover/Popover.tsx
packages/fuselage/src/components/Popover/Popover.tsx
import type { ReactNode } from 'react'; import { useRef } from 'react'; import type { AriaPopoverProps } from 'react-aria'; import { usePopover, DismissButton, Overlay } from 'react-aria'; import type { OverlayTriggerState } from 'react-stately'; export interface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Popover/Popover.stories.tsx
packages/fuselage/src/components/Popover/Popover.stories.tsx
import type { StoryFn, Meta } from '@storybook/react-webpack5'; import { cloneElement, isValidElement, useRef } from 'react'; import { useOverlayTrigger } from 'react-aria'; import { useOverlayTriggerState } from 'react-stately'; import { Button } from '../Button'; import { Tile } from '../Tile'; import Popover from ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Popover/Popover.spec.tsx
packages/fuselage/src/components/Popover/Popover.spec.tsx
import { composeStories } from '@storybook/react-webpack5'; import { axe } from 'jest-axe'; import { render } from '../../testing'; import * as stories from './Popover.stories'; const testCases = Object.values(composeStories(stories)).map((Story) => [ Story.storyName || 'Story', Story, ]); describe('[Popover Re...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/Popover/index.ts
packages/fuselage/src/components/Popover/index.ts
export { default as Popover, type PopoverProps } from './Popover';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FieldGroup/FieldGroup.stories.tsx
packages/fuselage/src/components/FieldGroup/FieldGroup.stories.tsx
import type { StoryFn, Meta } from '@storybook/react-webpack5'; import { Field, FieldHint, FieldLabel, FieldRow } from '../Field'; import { InputBoxSkeleton } from '../InputBox'; import FieldGroup from './FieldGroup'; export default { title: 'Inputs/FieldGroup', component: FieldGroup, } satisfies Meta<typeof Fie...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FieldGroup/FieldGroup.spec.tsx
packages/fuselage/src/components/FieldGroup/FieldGroup.spec.tsx
import { composeStories } from '@storybook/react-webpack5'; import { render } from '../../testing'; import * as stories from './FieldGroup.stories'; const { Default } = composeStories(stories); describe('[FieldGroup Component]', () => { it('renders without crashing', () => { render(<Default />); }); });
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FieldGroup/index.ts
packages/fuselage/src/components/FieldGroup/index.ts
export { default as FieldGroup, type FieldGroupProps } from './FieldGroup';
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/FieldGroup/FieldGroup.tsx
packages/fuselage/src/components/FieldGroup/FieldGroup.tsx
import { appendClassName } from '../../helpers/appendClassName'; import { patchChildren } from '../../helpers/patchChildren'; import { Box, type BoxProps } from '../Box'; export type FieldGroupProps = BoxProps; /** * A container for grouping fields that semantically share a common data context. */ const FieldGroup ...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false
RocketChat/fuselage
https://github.com/RocketChat/fuselage/blob/28b7a4a51c6c5bf72182f3b708965b1abfc36b38/packages/fuselage/src/components/ContextualbarV2/ContextualbarSection.tsx
packages/fuselage/src/components/ContextualbarV2/ContextualbarSection.tsx
import { forwardRef, memo } from 'react'; import { Box, type BoxProps } from '../Box'; export type ContextualbarSectionProps = BoxProps; const ContextualbarSection = forwardRef<HTMLElement, ContextualbarSectionProps>( function ContextualbarSection(props, ref) { return ( <Box ref={ref} rcx...
typescript
MIT
28b7a4a51c6c5bf72182f3b708965b1abfc36b38
2026-01-05T04:58:51.149339Z
false