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
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/app/dynamic/auto/page.tsx
tests/base/app/dynamic/auto/page.tsx
import { getPathname } from "@nimpl/getters/get-pathname"; import { getPageConfig } from "@nimpl/getters/get-page-config"; import { getParams } from "@nimpl/getters/get-params"; import Nav from "../../../components/Nav"; export default function Page() { const pathname = getPathname(); const pageConfig = getPag...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/app/dynamic-segment/catch-all/[...segments]/dynamic-segment-one.spec.ts
tests/base/app/dynamic-segment/catch-all/[...segments]/dynamic-segment-one.spec.ts
import { test, expect } from "@playwright/test"; test("should return correct pathname and params for catch-all page with segments", async ({ page }) => { await page.goto('/dynamic-segment/catch-all/segment1/segment2'); page.waitForSelector('#dynamic-segment-catch-all-page'); const pathname = await page.$('#get-...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/app/dynamic-segment/catch-all/[...segments]/page.tsx
tests/base/app/dynamic-segment/catch-all/[...segments]/page.tsx
import { getPathname } from '@nimpl/getters/get-pathname'; import { getParams } from '@nimpl/getters/get-params'; import Nav from "../../../../components/Nav"; export default function Page() { const pathname = getPathname(); const params = getParams(); return ( <div id="dynamic-segment-catch-all-page"> ...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/app/dynamic-segment/optional-catch-all/[[...segments]]/page.tsx
tests/base/app/dynamic-segment/optional-catch-all/[[...segments]]/page.tsx
import { getPathname } from '@nimpl/getters/get-pathname'; import { getParams } from '@nimpl/getters/get-params'; import Nav from "../../../../components/Nav"; export default function Page() { const pathname = getPathname(); const params = getParams(); return ( <div id="dynamic-segment-optional-catch-all-pa...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/app/dynamic-segment/optional-catch-all/[[...segments]]/dynamic-segment-optional-catch-all.spec.ts
tests/base/app/dynamic-segment/optional-catch-all/[[...segments]]/dynamic-segment-optional-catch-all.spec.ts
import { test, expect } from "@playwright/test"; test("should return correct pathname and params for optional-catch-all page with segments", async ({ page }) => { await page.goto('/dynamic-segment/optional-catch-all/segment1/segment2'); page.waitForSelector('#dynamic-segment-optional-catch-all-page'); const pat...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/app/dynamic-segment/one/[segment]/dynamic-segment-one.spec.ts
tests/base/app/dynamic-segment/one/[segment]/dynamic-segment-one.spec.ts
import { test, expect } from "@playwright/test"; test("should return correct pathname and params for one page with segments", async ({ page }) => { await page.goto("/dynamic-segment/one/segment1"); page.waitForSelector("#dynamic-segment-one-page"); const pathname = await page.$("#get-pathname"); expec...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/app/dynamic-segment/one/[segment]/page.tsx
tests/base/app/dynamic-segment/one/[segment]/page.tsx
import { getPathname } from '@nimpl/getters/get-pathname'; import { getParams } from '@nimpl/getters/get-params'; import Nav from "../../../../components/Nav"; export default function Page() { const pathname = getPathname(); const params = getParams(); return ( <div id="dynamic-segment-one-page"> <Nav...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/tests/base/components/Nav/index.tsx
tests/base/components/Nav/index.tsx
import Link from "next/link"; export default function Nav() { return ( <nav> <Link href="/dynamic/auto" id="to-dynamic-auto"> dynamic/auto </Link> <Link href="/intercepted" id="to-intercepted"> intercepted </Link> <...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/package/src/get-params.ts
package/src/get-params.ts
import { workAsyncStorage } from "next/dist/server/app-render/work-async-storage.external"; import { workUnitAsyncStorage } from "next/dist/server/app-render/work-unit-async-storage.external"; import { serverGetterInClientComponentError } from "./server-getter-in-client-component-error"; import { INVALID_PARSE, parsePa...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/package/src/get-app-params.ts
package/src/get-app-params.ts
import { workAsyncStorage } from "next/dist/server/app-render/work-async-storage.external"; import { serverGetterInClientComponentError } from "./server-getter-in-client-component-error"; import { INVALID_PARSE, parseParams } from "./utils"; import { getAppPathname } from "./get-app-pathname"; type GetParamsOptions = ...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/package/src/utils.ts
package/src/utils.ts
export const normalizePathname = (pathname: string) => { const cleanPathname = pathname && new URL(pathname, "http://n").pathname; const pathnameWithoutTrailingSlash = cleanPathname?.replace(/^(\/.*)\/$/, "$1"); const pathnameWithoutFileType = pathnameWithoutTrailingSlash?.replace(/\/_not-found$/, ""); ...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/package/src/get-page-config.ts
package/src/get-page-config.ts
import { workAsyncStorage } from "next/dist/server/app-render/work-async-storage.external"; import { serverGetterInClientComponentError } from "./server-getter-in-client-component-error"; export const getPageConfig = () => { serverGetterInClientComponentError("getPageConfig"); const store = workAsyncStorage.g...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/package/src/server-getter-in-client-component-error.ts
package/src/server-getter-in-client-component-error.ts
import React from "react"; export function serverGetterInClientComponentError(getterName: string): void | never { if (process.env.NODE_ENV !== "production") { // If useState is defined we're in a client component if (Boolean(React.useState)) { throw new Error(`${getterName} only works i...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/package/src/get-pathname.ts
package/src/get-pathname.ts
import { workAsyncStorage } from "next/dist/server/app-render/work-async-storage.external"; import { workUnitAsyncStorage } from "next/dist/server/app-render/work-unit-async-storage.external"; import { hasBasePath } from "next/dist/client/has-base-path"; import { removeBasePath } from "next/dist/client/remove-base-path...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
alexdln/nimpl-getters
https://github.com/alexdln/nimpl-getters/blob/e7425b8ece0a025b1d7d205a18a056baaa6eb3d1/package/src/get-app-pathname.ts
package/src/get-app-pathname.ts
import { workUnitAsyncStorage } from "next/dist/server/app-render/work-unit-async-storage.external"; import { serverGetterInClientComponentError } from "./server-getter-in-client-component-error"; export function getAppPathname() { serverGetterInClientComponentError("getAppPathname"); // eslint-disable-next-l...
typescript
MIT
e7425b8ece0a025b1d7d205a18a056baaa6eb3d1
2026-01-05T04:59:32.981997Z
false
inversify/inversify-inject-decorators
https://github.com/inversify/inversify-inject-decorators/blob/c59533f21b0e30949d76203da31bc2211b0d29dd/src/decorators.ts
src/decorators.ts
import { interfaces } from "inversify"; const INJECTION = Symbol.for("INJECTION"); function _proxyGetter( proto: any, key: string, resolve: () => any, doCache: boolean ) { function getter() { if (doCache && !Reflect.hasMetadata(INJECTION, this, key)) { Reflect.defineMetadata(IN...
typescript
MIT
c59533f21b0e30949d76203da31bc2211b0d29dd
2026-01-05T04:59:33.777940Z
false
inversify/inversify-inject-decorators
https://github.com/inversify/inversify-inject-decorators/blob/c59533f21b0e30949d76203da31bc2211b0d29dd/src/index.ts
src/index.ts
import { interfaces } from "inversify"; import { makePropertyInjectDecorator, makePropertyMultiInjectDecorator, makePropertyInjectTaggedDecorator, makePropertyInjectNamedDecorator } from "./decorators"; function getDecorators(container: interfaces.Container, doCache = true) { let lazyInject = ma...
typescript
MIT
c59533f21b0e30949d76203da31bc2211b0d29dd
2026-01-05T04:59:33.777940Z
false
inversify/inversify-inject-decorators
https://github.com/inversify/inversify-inject-decorators/blob/c59533f21b0e30949d76203da31bc2211b0d29dd/test/index.test.ts
test/index.test.ts
import { expect } from "chai"; import getDecorators from "../src/index"; import { Container, injectable, tagged, named } from "inversify"; describe("inversify-inject-decorators", () => { let TYPES = { Weapon: Symbol.for("Weapon") }; interface Weapon { name: string; durability: num...
typescript
MIT
c59533f21b0e30949d76203da31bc2211b0d29dd
2026-01-05T04:59:33.777940Z
false
inversify/inversify-inject-decorators
https://github.com/inversify/inversify-inject-decorators/blob/c59533f21b0e30949d76203da31bc2211b0d29dd/test/issue-685.test.ts
test/issue-685.test.ts
import { expect } from "chai"; import getDecorators from "../src/index"; import { Container, injectable, inject } from "inversify"; describe("Issue inversify/InversifyJS/issues/685", () => { it("Should throw exception if circular dependencies are declared in a single file", () => { const container = new ...
typescript
MIT
c59533f21b0e30949d76203da31bc2211b0d29dd
2026-01-05T04:59:33.777940Z
false
inversify/inversify-inject-decorators
https://github.com/inversify/inversify-inject-decorators/blob/c59533f21b0e30949d76203da31bc2211b0d29dd/test/issue-730.test.ts
test/issue-730.test.ts
import { expect } from "chai"; import getDecorators from "../src/index"; import { interfaces, Container, ContainerModule, injectable, named, tagged } from "inversify"; describe("Issue inversify/InversifyJS/issues/730 - with doCache set to false", () => { describe("when binding/unbinding", () => { it("Sho...
typescript
MIT
c59533f21b0e30949d76203da31bc2211b0d29dd
2026-01-05T04:59:33.777940Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/DropdownToggle.tsx
src/DropdownToggle.tsx
import { useContext, useCallback, useId } from 'react'; import * as React from 'react'; import DropdownContext, { type DropdownContextValue, } from './DropdownContext.js'; export const isRoleMenu = (el: HTMLElement) => el.getAttribute('role')?.toLowerCase() === 'menu'; export interface UseDropdownToggleProps { ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useClickOutside.ts
src/useClickOutside.ts
import contains from 'dom-helpers/contains'; import listen from 'dom-helpers/listen'; import ownerDocument from 'dom-helpers/ownerDocument'; import { useCallback, useEffect, useRef } from 'react'; import useEventCallback from '@restart/hooks/useEventCallback'; import warning from 'warning'; import { getWindowEvent } f...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/DropdownContext.ts
src/DropdownContext.ts
import * as React from 'react'; import type { Placement } from './usePopper.js'; export type DropdownContextValue = { toggle: ( nextShow: boolean, event?: React.SyntheticEvent | KeyboardEvent | MouseEvent, ) => void; menuElement: HTMLElement | null; toggleElement: HTMLElement | null; setMenu: (ref: H...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/ModalManager.ts
src/ModalManager.ts
import css from 'dom-helpers/css'; import { dataAttr } from './DataKey.js'; import getBodyScrollbarWidth from './getScrollbarWidth.js'; export interface ModalInstance { dialog: Element; backdrop: Element; } export interface ModalManagerOptions { ownerDocument?: Document; handleContainerOverflow?: boolean; i...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Portal.tsx
src/Portal.tsx
import ReactDOM from 'react-dom'; import * as React from 'react'; import useWaitForDOMRef, { type DOMContainer } from './useWaitForDOMRef.js'; export interface PortalProps { children: React.ReactElement; /** * A DOM element, Ref to an element, or function that returns either. The `container` will have the Por...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useScrollParent.tsx
src/useScrollParent.tsx
import useIsomorphicEffect from '@restart/hooks/useIsomorphicEffect'; import getScrollParent from 'dom-helpers/scrollParent'; import { useState } from 'react'; export default function useScrollParent(element: null | Element) { const [parent, setParent] = useState<Element | Document | null | undefined>( null, )...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useWaitForDOMRef.ts
src/useWaitForDOMRef.ts
import ownerDocument from 'dom-helpers/ownerDocument'; import canUseDOM from 'dom-helpers/canUseDOM'; import { useState, useEffect } from 'react'; import useWindow from './useWindow.js'; import type { VirtualElement } from './usePopper.js'; export type DOMContainer<T extends HTMLElement | VirtualElement = HTMLElement>...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Anchor.tsx
src/Anchor.tsx
import * as React from 'react'; import useEventCallback from '@restart/hooks/useEventCallback'; import { useButtonProps } from './Button.js'; export function isTrivialHref(href?: string) { return !href || href.trim() === '#'; } export interface AnchorProps extends React.HTMLAttributes<HTMLElement> { href?: strin...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Dropdown.tsx
src/Dropdown.tsx
import qsa from 'dom-helpers/querySelectorAll'; import addEventListener from 'dom-helpers/addEventListener'; import { useCallback, useRef, useEffect, useMemo, useContext } from 'react'; import * as React from 'react'; import { useUncontrolledProp } from 'uncontrollable'; import usePrevious from '@restart/hooks/usePrevi...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/TabContext.tsx
src/TabContext.tsx
import * as React from 'react'; import type { EventKey, SelectCallback, TransitionComponent } from './types.js'; export interface TabContextType { onSelect: SelectCallback; activeKey?: EventKey; transition?: TransitionComponent; mountOnEnter: boolean; unmountOnExit: boolean; getControlledId: (key: EventKey...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/utils.ts
src/utils.ts
import * as React from 'react'; export function isEscKey(e: KeyboardEvent) { return e.code === 'Escape' || e.keyCode === 27; } export function getReactVersion() { const parts = React.version.split('.'); return { major: +parts[0], minor: +parts[1], patch: +parts[2], }; } export function getChildRe...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/DropdownItem.tsx
src/DropdownItem.tsx
import * as React from 'react'; import { useContext } from 'react'; import useEventCallback from '@restart/hooks/useEventCallback'; import SelectableContext, { makeEventKey } from './SelectableContext.js'; import NavContext from './NavContext.js'; import type { EventKey, DynamicRefForwardingComponent } from './types....
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/TabPanel.tsx
src/TabPanel.tsx
import * as React from 'react'; import { useContext } from 'react'; import TabContext from './TabContext.js'; import SelectableContext, { makeEventKey } from './SelectableContext.js'; import type { EventKey, DynamicRefForwardingComponent, TransitionCallbacks, TransitionComponent, } from './types.js'; import No...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useRootClose.ts
src/useRootClose.ts
import listen from 'dom-helpers/listen'; import ownerDocument from 'dom-helpers/ownerDocument'; import { useEffect } from 'react'; import useEventCallback from '@restart/hooks/useEventCallback'; import useClickOutside, { type ClickOutsideOptions, getRefTarget, } from './useClickOutside.js'; import { isEscKey } fro...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/usePopper.ts
src/usePopper.ts
import * as Popper from '@popperjs/core'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { dequal } from 'dequal'; import useSafeState from '@restart/hooks/useSafeState'; import { createPopper } from './popper.js'; const disabledApplyStylesModifier = { name: 'applyStyles', enable...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/mergeOptionsWithPopperConfig.ts
src/mergeOptionsWithPopperConfig.ts
import type { UsePopperOptions, Offset, Placement, Modifiers, } from './usePopper.js'; export type Config = { flip?: boolean; fixed?: boolean; alignEnd?: boolean; enabled?: boolean; containerPadding?: number; arrowElement?: Element | null; enableEvents?: boolean; offset?: Offset; placement?: ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useRTGTransitionProps.ts
src/useRTGTransitionProps.ts
import { cloneElement, useCallback, useRef } from 'react'; import useMergedRefs from '@restart/hooks/useMergedRefs'; import type { TransitionProps as RTGTransitionProps, TransitionStatus, } from 'react-transition-group/Transition.js'; import { getChildRef } from './utils.js'; export type TransitionProps = RTGTrans...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useWaypoint.tsx
src/useWaypoint.tsx
import useEventCallback from '@restart/hooks/useEventCallback'; import useIntersectionObserver from '@restart/hooks/useIntersectionObserver'; import { useMemo, useRef } from 'react'; import getScrollParent from 'dom-helpers/scrollParent'; export interface WaypointEvent { position: Position; previousPosition: Posit...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/RTGTransition.tsx
src/RTGTransition.tsx
import * as React from 'react'; import useRTGTransitionProps, { type TransitionProps, } from './useRTGTransitionProps.js'; export type RTGTransitionProps = TransitionProps & { component: React.ElementType; }; // Normalizes Transition callbacks when nodeRef is used. const RTGTransition = React.forwardRef<any, RTGT...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/DropdownMenu.tsx
src/DropdownMenu.tsx
import { useContext, useRef } from 'react'; import * as React from 'react'; import useCallbackRef from '@restart/hooks/useCallbackRef'; import DropdownContext, { type DropdownContextValue, } from './DropdownContext.js'; import usePopper, { type UsePopperOptions, type Placement, type Offset, type UsePopperStat...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/popper.ts
src/popper.ts
// Since tsconfig is set for nodenext, these imports are resolving with a { default: ... } object, which // messes up the types. // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-nocheck import arrow from '@popperjs/core/lib/modifiers/arrow.js'; import computeStyles from '@popperjs/core/lib/modifiers...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/NavContext.tsx
src/NavContext.tsx
import * as React from 'react'; import type { EventKey } from './types.js'; interface NavContextType { role?: string; // used by NavItem to determine it's role activeKey: EventKey | null; getControlledId: (key: EventKey | null) => string; getControllerId: (key: EventKey | null) => string; } const NavContext =...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useWindow.ts
src/useWindow.ts
import { createContext, useContext } from 'react'; import canUseDOM from 'dom-helpers/canUseDOM'; const Context = createContext(canUseDOM ? window : undefined); export const WindowProvider = Context.Provider; /** * The document "window" placed in React context. Helpful for determining * SSR context, or when render...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/SelectableContext.tsx
src/SelectableContext.tsx
import * as React from 'react'; import type { EventKey, SelectCallback } from './types.js'; const SelectableContext = React.createContext<SelectCallback | null>(null); export const makeEventKey = ( eventKey?: EventKey | null, href: string | null = null, ): string | null => { if (eventKey != null) return String(...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/ImperativeTransition.tsx
src/ImperativeTransition.tsx
import useMergedRefs from '@restart/hooks/useMergedRefs'; import useEventCallback from '@restart/hooks/useEventCallback'; import useIsomorphicEffect from '@restart/hooks/useIsomorphicEffect'; import { useRef, cloneElement, useState } from 'react'; import type { TransitionComponent, TransitionProps } from './types.js'; ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Nav.tsx
src/Nav.tsx
import qsa from 'dom-helpers/querySelectorAll'; import * as React from 'react'; import { useContext, useEffect, useRef } from 'react'; import useForceUpdate from '@restart/hooks/useForceUpdate'; import useMergedRefs from '@restart/hooks/useMergedRefs'; import NavContext from './NavContext.js'; import SelectableContext,...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/tabbable.ts
src/tabbable.ts
function isInput(node: Element | null): node is HTMLInputElement { return node?.tagName === 'INPUT'; } function isTabbableRadio(node: HTMLInputElement) { if (!node.name) { return true; } const radioScope = node.form || node.ownerDocument; const radioSet = Array.from( radioScope.querySelectorAll( ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Modal.tsx
src/Modal.tsx
import activeElement from 'dom-helpers/activeElement'; import contains from 'dom-helpers/contains'; import canUseDOM from 'dom-helpers/canUseDOM'; import listen from 'dom-helpers/listen'; import { useState, useRef, useCallback, useImperativeHandle, forwardRef, useEffect, } from 'react'; import * as React fr...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/NavItem.tsx
src/NavItem.tsx
import * as React from 'react'; import { useContext } from 'react'; import useEventCallback from '@restart/hooks/useEventCallback'; import NavContext from './NavContext.js'; import SelectableContext, { makeEventKey } from './SelectableContext.js'; import type { EventKey, DynamicRefForwardingComponent } from './types.j...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Tabs.tsx
src/Tabs.tsx
import * as React from 'react'; import { useId, useMemo } from 'react'; import { useUncontrolledProp } from 'uncontrollable'; import TabContext, { type TabContextType } from './TabContext.js'; import SelectableContext from './SelectableContext.js'; import { EventKey, SelectCallback, TransitionComponent } from './types...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Button.tsx
src/Button.tsx
import * as React from 'react'; export type ButtonType = 'button' | 'reset' | 'submit'; export interface AnchorOptions { href?: string; rel?: string; target?: string; } export interface UseButtonPropsOptions extends AnchorOptions { type?: ButtonType; disabled?: boolean; onClick?: React.EventHandler<React...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/useFocusTrap.tsx
src/useFocusTrap.tsx
import { useCallback, useMemo } from 'react'; import { useRef } from 'react'; import useWindow from './useWindow.js'; import useMounted from '@restart/hooks/useMounted'; import useEventCallback from '@restart/hooks/useEventCallback'; import { getTabbableElementsOrSelf } from './tabbable.js'; import activeElement from '...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/types.ts
src/types.ts
import * as React from 'react'; export type EventKey = string | number; export type IntrinsicElementTypes = keyof React.JSX.IntrinsicElements; export type AssignPropsWithRef< Inner extends string | React.ComponentType<any>, P, > = Omit< React.ComponentPropsWithRef<Inner extends React.ElementType ? Inner : neve...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Waypoint.tsx
src/Waypoint.tsx
import useCallbackRef from '@restart/hooks/useCallbackRef'; import * as React from 'react'; import useWaypoint, { Position, type WaypointOptions, type WaypointEvent, } from './useWaypoint.js'; export { Position }; export type { WaypointEvent }; const defaultRenderComponent = (ref: React.RefCallback<any>) => ( ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/DataKey.tsx
src/DataKey.tsx
export const ATTRIBUTE_PREFIX = `data-rr-ui-` as const; export const PROPERTY_PREFIX = `rrUi` as const; export function dataAttr<T extends string>(property: T) { return `${ATTRIBUTE_PREFIX}${property}` as const; } export function dataProp<T extends string>(property: T) { return `${PROPERTY_PREFIX}${property}` as...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/index.ts
src/index.ts
export { default as Dropdown, type DropdownProps, type DropdownMenuProps, type UseDropdownMenuMetadata, type UseDropdownMenuOptions, type DropdownToggleProps, type UseDropdownToggleMetadata, type DropdownItemProps, } from './Dropdown.js'; export { useDropdownMenu } from './DropdownMenu.js'; export { use...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/Overlay.tsx
src/Overlay.tsx
import * as React from 'react'; import ReactDOM from 'react-dom'; import useCallbackRef from '@restart/hooks/useCallbackRef'; import useMergedRefs from '@restart/hooks/useMergedRefs'; import { useState } from 'react'; import usePopper, { type Offset, type Placement, type UsePopperOptions, type UsePopperState, ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/getScrollbarWidth.ts
src/getScrollbarWidth.ts
/** * Get the width of the vertical window scrollbar if it's visible */ export default function getBodyScrollbarWidth(ownerDocument = document) { const window = ownerDocument.defaultView!; return Math.abs( window.innerWidth - ownerDocument.documentElement.clientWidth, ); }
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/NoopTransition.tsx
src/NoopTransition.tsx
import useEventCallback from '@restart/hooks/useEventCallback'; import useMergedRefs from '@restart/hooks/useMergedRefs'; import { cloneElement, useEffect, useRef } from 'react'; import type { TransitionProps } from './types.js'; import { getChildRef } from './utils.js'; function NoopTransition({ children, in: inP...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/src/getWindowEvent.ts
src/getWindowEvent.ts
export function getWindowEvent(ownerWindow?: Window | null) { const win = ownerWindow || window; // Store the current event to avoid triggering handlers immediately // For things rendered in an iframe, the event might originate on the parent window // so we should fall back to that global event if the local on...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/ModalManagerSpec.ts
test/ModalManagerSpec.ts
import css from 'dom-helpers/css'; import { expect, describe, it, beforeEach, afterEach, vi } from 'vitest'; import { waitFor } from '@testing-library/react'; import ModalManager, { ModalInstance } from '../src/ModalManager'; import { injectCss } from './helpers'; vi.mock('../src/getScrollbarWidth', () => ({ defaul...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/WaitForContainerSpec.tsx
test/WaitForContainerSpec.tsx
import { render } from '@testing-library/react'; import { expect, describe, it, vi } from 'vitest'; import React, { useRef } from 'react'; import useWaitForDOMRef from '../src/useWaitForDOMRef'; describe('useWaitForDOMRef', () => { it('should resolve on first render if possible (element)', () => { let renderCo...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/ModalSpec.tsx
test/ModalSpec.tsx
import * as React from 'react'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { expect, vi, describe, it, beforeEach, afterEach } from 'vitest'; import Modal, { ModalHandle } from '../src/Modal'; import { OPEN_DATA_ATTRIBUTE } ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/AnchorSpec.tsx
test/AnchorSpec.tsx
import { render, fireEvent } from '@testing-library/react'; import { expect, describe, it, vi } from 'vitest'; import Anchor from '../src/Anchor'; describe('Anchor', () => { it('renders an anchor tag', () => { const { container } = render(<Anchor data-testid="anchor" />); expect(container.firstElementChil...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/NavItemSpec.tsx
test/NavItemSpec.tsx
import * as React from 'react'; import { render, fireEvent } from '@testing-library/react'; import { expect, describe, it, vi } from 'vitest'; import NavContext from '../src/NavContext'; import NavItem from '../src/NavItem'; import SelectableContext from '../src/SelectableContext'; describe('<NavItem>', () => { it(...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/useRootCloseSpec.tsx
test/useRootCloseSpec.tsx
import { useRef } from 'react'; import { render, fireEvent } from '@testing-library/react'; import { expect, describe, it, vi, beforeEach, afterEach } from 'vitest'; import useRootClose from '../src/useRootClose'; const escapeKeyCode = 27; describe('useRootClose', () => { let attachTo: HTMLElement; beforeEach((...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/ButtonSpec.tsx
test/ButtonSpec.tsx
import * as React from 'react'; import { render, fireEvent } from '@testing-library/react'; import { vi, expect, describe, it } from 'vitest'; import Button from '../src/Button'; describe('<Button>', () => { it('Should output a button', () => { const { container } = render(<Button>Title</Button>); expect(c...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/setup.ts
test/setup.ts
import { cleanup } from '@testing-library/react'; import { afterEach } from 'vitest'; afterEach(cleanup);
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/TabPanelSpec.tsx
test/TabPanelSpec.tsx
import React, { useRef } from 'react'; import { fireEvent, render, waitFor } from '@testing-library/react'; import { expect, vi, describe, it } from 'vitest'; import Transition from 'react-transition-group/Transition'; import TabContext from '../src/TabContext'; import TabPanel, { useTabPanel } from '../src/TabPanel';...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/DropdownSpec.tsx
test/DropdownSpec.tsx
import { render, fireEvent, screen, waitFor } from '@testing-library/react'; import { expect, describe, it, afterEach, beforeEach, vi } from 'vitest'; import userEvent from '@testing-library/user-event'; import Dropdown from '../src/Dropdown'; import DropdownItem from '../src/DropdownItem'; describe('<Dropdown>', () ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/helpers.ts
test/helpers.ts
let style: any; let seen: string[] = []; export function injectCss(rules: string) { if (seen.indexOf(rules) !== -1) { return; } style = style || (function iife() { const _style = document.createElement('style'); _style.appendChild(document.createTextNode('')); document.head.appendC...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/usePopperSpec.tsx
test/usePopperSpec.tsx
import { renderHook, waitFor } from '@testing-library/react'; import { expect, describe, it, beforeEach, afterEach } from 'vitest'; import usePopper from '../src/usePopper'; describe('usePopper', () => { const elements: Record<string, HTMLElement> = {}; beforeEach(() => { elements.mount = document.createEleme...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/types.test.tsx
test/types.test.tsx
import { Button } from '../src'; const _1 = <Button href="hi" />; const _2 = <Button href="hi" as="button" />;
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/DropdownItemSpec.tsx
test/DropdownItemSpec.tsx
import * as React from 'react'; import { render, fireEvent } from '@testing-library/react'; import { vi, expect, describe, it } from 'vitest'; import DropdownItem from '../src/DropdownItem'; import SelectableContext from '../src/SelectableContext'; describe('<DropdownItem>', () => { it('should output a nav item as ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/NavSpec.tsx
test/NavSpec.tsx
import { fireEvent, render, screen } from '@testing-library/react'; import { expect, describe, beforeEach, afterEach, it } from 'vitest'; import Tabs from '../src/Tabs'; import Nav from '../src/Nav'; import NavItem from '../src/NavItem'; describe('<Nav>', () => { let focusableContainer: HTMLElement; beforeEach(()...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/TabContainerSpec.tsx
test/TabContainerSpec.tsx
import { render, fireEvent } from '@testing-library/react'; import { expect, vi, describe, it } from 'vitest'; import Nav from '../src/Nav'; import NavItem from '../src/NavItem'; import TabPanel from '../src/TabPanel'; import Tabs from '../src/Tabs'; describe('<Tabs>', () => { it('should not propagate context past T...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/PortalSpec.tsx
test/PortalSpec.tsx
import { render } from '@testing-library/react'; import { expect, describe, it } from 'vitest'; import React from 'react'; import { Portal } from '../src'; describe('Portal', () => { it('should render overlay into container (document)', () => { render( /* @ts-expect-error missing required props */ <...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/test/utilsSpec.tsx
test/utilsSpec.tsx
import { describe, expect, it } from 'vitest'; import { getChildRef } from '../src/utils'; describe('utils', () => { describe('getChildRef', () => { it('should return null if ref is null', () => { expect(getChildRef(null)).to.equal(null); }); it('should return null if ref is undefined', () => { ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/www/src/LiveCodeblock.tsx
www/src/LiveCodeblock.tsx
// @ts-ignore import BrowserOnly from '@docusaurus/BrowserOnly'; import clsx from 'clsx'; import { Editor, Error, ImportResolver, InfoMessage, Preview, Provider, } from 'jarle'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import * as RestartUi from '@restart/ui'; import Button fr...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/www/src/Dropdown.tsx
www/src/Dropdown.tsx
import clsx from 'clsx'; import Button from '@restart/ui/Button'; import BaseDropdown, { DropdownProps } from '@restart/ui/Dropdown'; import { useDropdownMenu } from '@restart/ui/DropdownMenu'; import { useDropdownToggle } from '@restart/ui/DropdownToggle'; import { useDropdownItem } from '@restart/ui/DropdownItem'; i...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/www/src/WaypointExample.tsx
www/src/WaypointExample.tsx
import useCallbackRef from '@restart/hooks/useCallbackRef'; import useIsomorphicEffect from '@restart/hooks/useIsomorphicEffect'; import Waypoint, { Position } from '@restart/ui/Waypoint'; import clsx from 'clsx'; import { useState } from 'react'; interface Props { horizontal?: boolean; scrollIntoView?: boolean; ...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/www/src/Button.tsx
www/src/Button.tsx
import * as React from 'react'; import { Button as BaseButton, ButtonProps } from '@restart/ui'; import clsx from 'clsx'; const Button = React.forwardRef((props: ButtonProps, ref) => ( <BaseButton ref={ref} {...props} className={clsx( props.className, 'transition text-md', 'h-10 cursor-...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/www/src/Tooltip.tsx
www/src/Tooltip.tsx
import clsx from 'clsx'; import React from 'react'; const Tooltip = React.forwardRef( ({ children, arrowProps, popper, show: _, ...props }: any, ref: any) => ( <div ref={ref} {...props} className={clsx(props.className, 'absolute')}> <div {...arrowProps} style={arrowProps.style} clas...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
react-restart/ui
https://github.com/react-restart/ui/blob/518cd4fc0e416c9b9cf8fe5839822db47bda1395/www/src/theme/CodeBlock/index.tsx
www/src/theme/CodeBlock/index.tsx
import { type ReactNode } from 'react'; import { usePrismTheme } from '@docusaurus/theme-common'; // @ts-ignore import CodeBlock from '@theme-original/CodeBlock'; // @ts-ignore import type CodeBlockType from '@theme/CodeBlock'; import type { WrapperProps } from '@docusaurus/types'; import { LiveCodeblock } from '../../...
typescript
MIT
518cd4fc0e416c9b9cf8fe5839822db47bda1395
2026-01-05T04:59:09.526519Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/vitest.workspace.ts
vitest.workspace.ts
import { defineWorkspace } from 'vitest/config'; import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'; export default defineWorkspace([ { extends: './vite.config.ts', test: { name: 'unit', dir: './src/', environment: 'happy-dom', globals: true, }, }, { ext...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/vite.config.ts
vite.config.ts
/// <reference types="vitest" /> import { defineConfig } from 'vite'; import { svelte } from '@sveltejs/vite-plugin-svelte'; import inspect from 'vite-plugin-inspect'; import path from 'path'; export default defineConfig((configEnv) => ({ plugins: [ svelte(), inspect({ dev: true, build: true, ...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/.storybook/vitest.setup.ts
.storybook/vitest.setup.ts
import { beforeAll } from 'vitest'; import { setProjectAnnotations } from '@storybook/svelte'; // This is an important step to apply the right configuration when testing your stories. // More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations const project = setPr...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/.storybook/main.ts
.storybook/main.ts
import type { StorybookConfig } from '@storybook/svelte-vite'; const examplesOnly = process.env.EXAMPLES_ONLY === 'true'; const config: StorybookConfig = { stories: [ '../**/*.mdx', { directory: '../examples', files: '**/*.stories.@(ts|svelte)', titlePrefix: examplesOnly ? undefined : 'Exa...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/index.test.ts
src/index.test.ts
/** * @vitest-environment happy-dom */ import { createRawSnippet, mount, type ComponentProps, type Snippet } from 'svelte'; import type { StoryContext as StorybookStoryContext } from 'storybook/internal/types'; import { describe, expectTypeOf, it } from 'vitest'; import StoryComponent from './runtime/Story.svelte';...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/estree.d.ts
src/estree.d.ts
// Copied & modified from: https://github.com/sveltejs/language-tools/blob/master/packages%2Fsvelte2tsx%2Fsrc%2Festree.d.ts import 'estree'; // estree does not have start/end in their public Node interface, // but the AST returned by svelte/compiler does. // We add the those properties here and add Node as an interfac...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/svelte.d.ts
src/svelte.d.ts
declare module 'svelte/compiler' { import { Node as ESTreeNode } from 'estree'; declare namespace AST { export interface BaseNode { // NOTE: We are overriding the type here, because we don't need those start?: number; end?: number; [propName: string]: any; } // FIXME: Those typ...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/types.test.ts
src/types.test.ts
import type { StoryContext } from 'storybook/internal/types'; import { createRawSnippet, type Component, type ComponentProps } from 'svelte'; import { describe, expectTypeOf, it } from 'vitest'; import type { SvelteRenderer, ComponentAnnotations } from '$lib/types.js'; import Button from '../examples/components/Butto...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/constants.ts
src/constants.ts
export const SVELTE_CSF_TAG_PREFIX = 'svelte-csf'; export const SVELTE_CSF_V4_TAG = `${SVELTE_CSF_TAG_PREFIX}-v4`; export const SVELTE_CSF_V5_TAG = `${SVELTE_CSF_TAG_PREFIX}-v5`; export const STORYBOOK_INTERNAL_PREFIX = '$__'; export const STORYBOOK_META_IDENTIFIER = `${STORYBOOK_INTERNAL_PREFIX}meta`; export const RUN...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/legacy-types.d.ts
src/legacy-types.d.ts
// TODO: Remove this file in next major release import type { SvelteComponent } from 'svelte'; import type { Addon_BaseMeta as BaseMeta, Addon_BaseAnnotations as BaseAnnotations, StoryContext, WebRenderer, } from 'storybook/internal/types'; type DecoratorReturnType = | void | SvelteComponent | { C...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/preset.ts
src/preset.ts
import type { StorybookConfig } from '@storybook/svelte-vite'; import type { Options } from 'storybook/internal/types'; import { transformPlugin, preTransformPlugin } from '$lib/compiler/plugins.js'; import { createIndexer } from '$lib/indexer/index.js'; export interface StorybookAddonSvelteCsFOptions extends Options...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/types.ts
src/types.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import type { ComponentAnnotations as BaseComponentAnnotations, StoryAnnotations as BaseStoryAnnotations, StoryContext as BaseStoryContext, WebRenderer, } from 'storybook/internal/types'; import type { Component, ComponentProps } from 'svelte'; export typ...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/index.ts
src/index.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import StoryComponent from './runtime/Story.svelte'; // TODO: Remove in next major release import LegacyMetaComponent from './runtime/LegacyMeta.svelte'; // TODO: Remove in next major release import LegacyStoryComponent from './runtime/LegacyStory.svelte'; // TODO...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/indexer/index.ts
src/indexer/index.ts
import type { IndexInput, Indexer } from 'storybook/internal/types'; import { parseForIndexer } from '$lib/indexer/parser.js'; import { GetDefineMetaFirstArgumentError, IndexerParseError, MissingModuleTagError, NoStoryComponentDestructuredError, } from '$lib/utils/error/parser/extract/svelte.js'; import { Lega...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/indexer/parser.ts
src/indexer/parser.ts
import fs from 'node:fs/promises'; import pkg from '@storybook/addon-svelte-csf/package.json' with { type: 'json' }; import { preprocess } from 'svelte/compiler'; import type { IndexInput } from 'storybook/internal/types'; import { getSvelteAST, type ESTreeAST, type SvelteAST } from '$lib/parser/ast.js'; import { ext...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false
storybookjs/addon-svelte-csf
https://github.com/storybookjs/addon-svelte-csf/blob/e73febc7d099593e41148793e023d1ce39fbaecc/src/runtime/emit-code.test.ts
src/runtime/emit-code.test.ts
import { describe, expect, it, vi } from 'vitest'; import dedent from 'dedent'; import { generateCodeToEmit } from './emit-code.js'; describe('Emit Code', () => { it('should replace short spread args with single-line props', () => { expect( generateCodeToEmit({ code: '<MyComponent {...args} />', ...
typescript
MIT
e73febc7d099593e41148793e023d1ce39fbaecc
2026-01-05T04:59:35.061502Z
false