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
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/StyleSheetManager.tsx
packages/styled-components/src/models/StyleSheetManager.tsx
import React, { useContext, useEffect, useMemo, useState } from 'react'; import shallowequal from 'shallowequal'; import type stylis from 'stylis'; import StyleSheet from '../sheet'; import { InsertionTarget, ShouldForwardProp, Stringifier } from '../types'; import createStylisInstance from '../utils/stylis'; export c...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/GlobalStyle.ts
packages/styled-components/src/models/GlobalStyle.ts
import StyleSheet from '../sheet'; import { ExecutionContext, RuleSet, Stringifier } from '../types'; import flatten from '../utils/flatten'; import isStaticRules from '../utils/isStaticRules'; import { joinStringArray } from '../utils/joinStrings'; export default class GlobalStyle<Props extends object> { componentI...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/StyledNativeComponent.ts
packages/styled-components/src/models/StyledNativeComponent.ts
import React, { createElement, Ref, useMemo } from 'react'; import type { Attrs, BaseObject, Dict, ExecutionContext, ExecutionProps, IInlineStyleConstructor, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, OmitNever, RuleSet, StyledOptions, } from '../types'; import de...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/ComponentStyle.ts
packages/styled-components/src/models/ComponentStyle.ts
import { SC_VERSION } from '../constants'; import StyleSheet from '../sheet'; import { ExecutionContext, RuleSet, Stringifier } from '../types'; import flatten from '../utils/flatten'; import generateName from '../utils/generateAlphabeticName'; import { hash, phash } from '../utils/hash'; import isStaticRules from '../...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/ThemeProvider.tsx
packages/styled-components/src/models/ThemeProvider.tsx
import React, { useContext, useMemo } from 'react'; import styledError from '../utils/error'; import isFunction from '../utils/isFunction'; // Helper type for the `DefaultTheme` interface that enforces an object type & exclusively allows // for typed keys. type DefaultThemeAsObject<T = object> = Record<keyof T, any>; ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/InlineStyle.ts
packages/styled-components/src/models/InlineStyle.ts
import transformDeclPairs from 'css-to-react-native'; import { parse } from 'postcss'; import { Dict, ExecutionContext, IInlineStyle, IInlineStyleConstructor, RuleSet, StyleSheet, } from '../types'; import flatten from '../utils/flatten'; import generateComponentId from '../utils/generateComponentId'; impor...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/StyledComponent.ts
packages/styled-components/src/models/StyledComponent.ts
import isPropValid from '@emotion/is-prop-valid'; import React, { createElement, PropsWithoutRef, Ref, useDebugValue } from 'react'; import { SC_VERSION } from '../constants'; import type { AnyComponent, Attrs, BaseObject, Dict, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/Keyframes.ts
packages/styled-components/src/models/Keyframes.ts
import StyleSheet from '../sheet'; import { Keyframes as KeyframesType, Stringifier } from '../types'; import styledError from '../utils/error'; import { setToString } from '../utils/setToString'; import { mainStylis } from './StyleSheetManager'; export default class Keyframes implements KeyframesType { id: string; ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/test/Keyframes.test.ts
packages/styled-components/src/models/test/Keyframes.test.ts
import Keyframes from '../Keyframes'; describe('Keyframes', () => { it('should throw an error when converted to string', () => { const keyframes = new Keyframes('foo', 'bar'); expect(() => keyframes.toString()).toThrowErrorMatchingInlineSnapshot( `"It seems you are interpolating a keyframe declaration ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/test/StyleSheetManager.server.test.tsx
packages/styled-components/src/models/test/StyleSheetManager.server.test.tsx
/* @jest-environment node */ import React from 'react'; import { renderToString } from 'react-dom/server'; import styled from '../../constructors/styled'; import ServerStyleSheet from '../ServerStyleSheet'; import { StyleSheetManager } from '../StyleSheetManager'; describe('StyleSheetManager', () => { it('should us...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/test/StyleSheetManager.test.tsx
packages/styled-components/src/models/test/StyleSheetManager.test.tsx
import '@testing-library/jest-dom'; import { act, render } from '@testing-library/react'; import React from 'react'; import Frame, { FrameContextConsumer } from 'react-frame-component'; import stylisRTLPlugin from 'stylis-plugin-rtl'; import StyleSheet from '../../sheet'; import { resetStyled } from '../../test/utils';...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/models/test/ThemeProvider.test.tsx
packages/styled-components/src/models/test/ThemeProvider.test.tsx
import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; import withTheme from '../../hoc/withTheme'; import { resetStyled } from '../../test/utils'; import { DataAttributes } from '../../types'; import ThemeProvider, { useTheme } from '../ThemeProvider'; let styl...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/hash.ts
packages/styled-components/src/utils/hash.ts
export const SEED = 5381; // When we have separate strings it's useful to run a progressive // version of djb2 where we pretend that we're still looping over // the same string export const phash = (h: number, x: string) => { let i = x.length; while (i) { h = (h * 33) ^ x.charCodeAt(--i); } return h; }; ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/interleave.ts
packages/styled-components/src/utils/interleave.ts
import { Interpolation } from '../types'; export default function interleave<Props extends object>( strings: readonly string[], interpolations: Interpolation<Props>[] ): Interpolation<Props>[] { const result: Interpolation<Props>[] = [strings[0]]; for (let i = 0, len = interpolations.length; i < len; i += 1) ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/isFunction.ts
packages/styled-components/src/utils/isFunction.ts
export default function isFunction(test: any): test is Function { return typeof test === 'function'; }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/createWarnTooManyClasses.ts
packages/styled-components/src/utils/createWarnTooManyClasses.ts
import { Dict } from '../types'; export const LIMIT = 200; export default (displayName: string, componentId: string) => { let generatedClasses: Dict<any> = {}; let warningSeen = false; return (className: string) => { if (!warningSeen) { generatedClasses[className] = true; if (Object.keys(genera...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/getComponentName.ts
packages/styled-components/src/utils/getComponentName.ts
import { StyledTarget } from '../types'; export default function getComponentName(target: StyledTarget<any>) { return ( (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) || (target as Exclude<StyledTarget<any>, string>).displayName || (target as Function).name || ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/errors.ts
packages/styled-components/src/utils/errors.ts
export default { '1': 'Cannot create styled-component for component: %s.\n\n', '2': "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling co...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/domElements.ts
packages/styled-components/src/utils/domElements.ts
// Thanks to ReactDOMFactories for this handy list! const elements = [ 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'da...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/stylis.ts
packages/styled-components/src/utils/stylis.ts
import * as stylis from 'stylis'; import { Stringifier } from '../types'; import { EMPTY_ARRAY, EMPTY_OBJECT } from './empties'; import throwStyledError from './error'; import { SEED, phash } from './hash'; const AMP_REGEX = /&/g; const COMMENT_REGEX = /^\s*\/\/.*$/gm; export type ICreateStylisInstance = { options?...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/escape.ts
packages/styled-components/src/utils/escape.ts
// Source: https://www.w3.org/TR/cssom-1/#serialize-an-identifier // Control characters and non-letter first symbols are not supported const escapeRegex = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g; const dashesAtEnds = /(^-|-$)/g; /** * TODO: Explore using CSS.escape when it becomes more available * in evergreen brow...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/generateDisplayName.ts
packages/styled-components/src/utils/generateDisplayName.ts
import { StyledTarget } from '../types'; import getComponentName from './getComponentName'; import isTag from './isTag'; export default function generateDisplayName(target: StyledTarget<any>) { return isTag(target) ? `styled.${target}` : `Styled(${getComponentName(target)})`; }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/hoist.ts
packages/styled-components/src/utils/hoist.ts
import React from 'react'; import { AnyComponent } from '../types'; const hasSymbol = typeof Symbol === 'function' && Symbol.for; // copied from react-is const REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; const REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; /** * ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/addUnitIfNeeded.ts
packages/styled-components/src/utils/addUnitIfNeeded.ts
import unitless from '@emotion/unitless'; // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js export default function addUnitIfNeeded(name: string, value: any) { // https://github.com/amilajack/eslint-plugin-flowtype-error...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/determineTheme.ts
packages/styled-components/src/utils/determineTheme.ts
import { DefaultTheme, ExecutionProps } from '../types'; import { EMPTY_OBJECT } from './empties'; export default function determineTheme( props: ExecutionProps, providedTheme?: DefaultTheme | undefined, defaultProps: { theme?: DefaultTheme | undefined } = EMPTY_OBJECT ): DefaultTheme | undefined { return (pro...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/isStyledComponent.ts
packages/styled-components/src/utils/isStyledComponent.ts
import { StyledComponentBrand } from '../types'; export default function isStyledComponent(target: any): target is StyledComponentBrand { return typeof target === 'object' && 'styledComponentId' in target; }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/mixinDeep.ts
packages/styled-components/src/utils/mixinDeep.ts
import isPlainObject from './isPlainObject'; function mixinRecursively(target: any, source: any, forceMerge = false) { /* only merge into POJOs, Arrays, but for top level objects only * allow to merge into anything by passing forceMerge = true */ if (!forceMerge && !isPlainObject(target) && !Array.isArray(targe...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/empties.ts
packages/styled-components/src/utils/empties.ts
import { Dict } from '../types'; export const EMPTY_ARRAY = Object.freeze([]) as Readonly<any[]>; export const EMPTY_OBJECT = Object.freeze({}) as Readonly<Dict<any>>;
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/generateComponentId.ts
packages/styled-components/src/utils/generateComponentId.ts
import generateAlphabeticName from './generateAlphabeticName'; import { hash } from './hash'; export default function generateComponentId(str: string) { return generateAlphabeticName(hash(str) >>> 0); }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/flatten.ts
packages/styled-components/src/utils/flatten.ts
import Keyframes from '../models/Keyframes'; import StyleSheet from '../sheet'; import { AnyComponent, Dict, ExecutionContext, Interpolation, IStyledComponent, RuleSet, Stringifier, StyledObject, } from '../types'; import addUnitIfNeeded from './addUnitIfNeeded'; import { EMPTY_ARRAY } from './empties';...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/joinStrings.ts
packages/styled-components/src/utils/joinStrings.ts
/** * Convenience function for joining strings to form className chains */ export function joinStrings(a?: string | undefined, b?: string | undefined): string { return a && b ? `${a} ${b}` : a || b || ''; } export function joinStringArray(arr: string[], sep?: string | undefined): string { if (arr.length === 0) {...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/isStaticRules.ts
packages/styled-components/src/utils/isStaticRules.ts
import { RuleSet } from '../types'; import isFunction from './isFunction'; import isStyledComponent from './isStyledComponent'; export default function isStaticRules<Props extends object>(rules: RuleSet<Props>) { for (let i = 0; i < rules.length; i += 1) { const rule = rules[i]; if (isFunction(rule) && !isS...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/isStatelessFunction.ts
packages/styled-components/src/utils/isStatelessFunction.ts
import isFunction from './isFunction'; export default function isStatelessFunction(test: any): test is Function { return isFunction(test) && !(test.prototype && test.prototype.isReactComponent); }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/nonce.ts
packages/styled-components/src/utils/nonce.ts
declare let __webpack_nonce__: string; export default function getNonce() { return typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null; }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/isTag.ts
packages/styled-components/src/utils/isTag.ts
import { StyledTarget } from '../types'; export default function isTag(target: StyledTarget<'web'>): target is string { return ( typeof target === 'string' && (process.env.NODE_ENV !== 'production' ? target.charAt(0) === target.charAt(0).toLowerCase() : true) ); }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/generateAlphabeticName.ts
packages/styled-components/src/utils/generateAlphabeticName.ts
const AD_REPLACER_R = /(a)(d)/gi; /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised * counterparts */ const charsLength = 52; /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */ const getAlphabeticChar = (code: number) => String.fromCharCode(...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/isPlainObject.ts
packages/styled-components/src/utils/isPlainObject.ts
export default function isPlainObject(x: any): x is Record<any, any> { return ( x !== null && typeof x === 'object' && x.constructor.name === Object.name && /* check for reasonable markers that the object isn't an element for react & preact/compat */ !('props' in x && x.$$typeof) ); }
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/setToString.ts
packages/styled-components/src/utils/setToString.ts
/** * If the Object prototype is frozen, the "toString" property is non-writable. This means that any objects which inherit this property * cannot have the property changed using a "=" assignment operator. If using strict mode, attempting that will cause an error. If not using * strict mode, attempting that will be ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/checkDynamicCreation.ts
packages/styled-components/src/utils/checkDynamicCreation.ts
import { useRef } from 'react'; const invalidHookCallRe = /invalid hook call/i; const seen = new Set(); export const checkDynamicCreation = (displayName: string, componentId?: string | undefined) => { if (process.env.NODE_ENV !== 'production') { const parsedIdString = componentId ? ` with the id of "${component...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/error.ts
packages/styled-components/src/utils/error.ts
import { Dict } from '../types'; import errorMap from './errors'; const ERRORS: Dict<any> = process.env.NODE_ENV !== 'production' ? errorMap : {}; /** * super basic version of sprintf */ function format(...args: [string, ...any]) { let a = args[0]; const b = []; for (let c = 1, len = args.length; c < len; c ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/hyphenateStyleName.ts
packages/styled-components/src/utils/hyphenateStyleName.ts
const isUpper = (c: string) => c >= 'A' && c <= 'Z'; /** * Hyphenates a camelcased CSS property name, for example: * * > hyphenateStyleName('backgroundColor') * < "background-color" * > hyphenateStyleName('MozTransition') * < "-moz-transition" * > hyphenateStyleName('msTransition') * < "-ms-transit...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/escape.test.ts
packages/styled-components/src/utils/test/escape.test.ts
import escape from '../escape'; describe('escape', () => { it('replaces characters that could be part of CSS selectors', () => { expect(escape('foo(bar):#*$><+~=|^baz')).toEqual('foo-bar-baz'); }); it('replaces double hyphens with a single hyphen', () => { expect(escape('foo--bar')).toEqual('foo-bar'); ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/addUnitIfNeeded.test.ts
packages/styled-components/src/utils/test/addUnitIfNeeded.test.ts
import addUnitIfNeeded from '../addUnitIfNeeded'; it('adds a px prefix if needed for properties that require a unit', () => { const pairs: Array<[string, number]> = [ ['marginLeft', 1], ['top', -1], ['flexBasis', 100], ['gridTemplateColumns', 200], ['fontSize', 10], ]; pairs.forEach(([key, va...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/hyphenateStyleName.test.ts
packages/styled-components/src/utils/test/hyphenateStyleName.test.ts
import hyphenateStyleName from '../hyphenateStyleName'; test('hyphenateStyleName', () => { expect(hyphenateStyleName('backgroundColor')).toEqual('background-color'); expect(hyphenateStyleName('MozTransition')).toEqual('-moz-transition'); expect(hyphenateStyleName('msTransition')).toEqual('-ms-transition'); // ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/joinStrings.test.ts
packages/styled-components/src/utils/test/joinStrings.test.ts
import { joinStringArray, joinStrings } from '../joinStrings'; describe('joinStrings(string?, string?)', () => { it('joins the two strings with a space between', () => { expect(joinStrings('a', 'b')).toBe('a b'); expect(joinStrings('a ', 'b')).toBe('a b'); expect(joinStrings('a ', ' b')).toBe('a b'); ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/determineTheme.test.ts
packages/styled-components/src/utils/test/determineTheme.test.ts
import determineTheme from '../determineTheme'; const theme = { color: 'red' }; const fallback = { color: 'blue' }; const props = { theme }; const defaultProps = { theme: fallback }; describe('determineTheme', () => { it('should take precedence over ThemeProvider', () => { expect(determineTheme(props, fallback,...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/generateAlphabeticName.test.ts
packages/styled-components/src/utils/test/generateAlphabeticName.test.ts
import generateAlphabeticName from '../generateAlphabeticName'; describe('generateAlphabeticName', () => { it('should create alphabetic names for number input data', () => { expect(generateAlphabeticName(1000000000)).toEqual('cGNYzm'); expect(generateAlphabeticName(2000000000)).toEqual('fnBWYy'); }); it...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/getComponentName.test.tsx
packages/styled-components/src/utils/test/getComponentName.test.tsx
import React from 'react'; import getComponentName from '../getComponentName'; describe('getComponentName', () => { let Test: React.FC; beforeEach(() => { Test = () => <div />; }); it('defaults to reusing the component displayName', () => { Test.displayName = 'Foo'; expect(getComponentName(Test))...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/generateDisplayName.test.ts
packages/styled-components/src/utils/test/generateDisplayName.test.ts
import React from 'react'; import generateDisplayName from '../generateDisplayName'; it('handles a string type', () => { expect(generateDisplayName('div')).toBe('styled.div'); }); it('handles a React class type', () => { class Foo extends React.Component {} expect(generateDisplayName(Foo)).toBe('Styled(Foo)');...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/isStyledComponent.test.ts
packages/styled-components/src/utils/test/isStyledComponent.test.ts
import React from 'react'; import styled from '../../'; import isStyledComponent from '../isStyledComponent'; describe('isStyledComponent(something)', () => { it('returns true if using styled', () => { expect(isStyledComponent(styled.div``)).toBe(true); expect(isStyledComponent(styled(styled.div``)``)).toBe(...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/mixinDeep.test.ts
packages/styled-components/src/utils/test/mixinDeep.test.ts
/* ported from https://github.com/jonschlinkert/mixin-deep; thanks Jon! */ import mixinDeep from '../mixinDeep'; class MyObj { foo: any; bar: any; baz?: 5; constructor(foo: any, bar: any, baz: any = undefined) { this.foo = foo; this.bar = bar; if (baz) { this.baz = 5; } } } it('should ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/isStatelessFunction.test.tsx
packages/styled-components/src/utils/test/isStatelessFunction.test.tsx
import React, { Component } from 'react'; import styled from '../../'; import isStatelessFunction from '../isStatelessFunction'; class MockComponent extends Component { render() { return <div {...this.props} />; } } describe('isStatelessFunction(something)', () => { it('returns true if stateless', () => { ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/stylis.test.ts
packages/styled-components/src/utils/test/stylis.test.ts
import createStylisInstance, { ICreateStylisInstance } from '../stylis'; function stylisTest(css: string, options: ICreateStylisInstance = {}): string[] { const stylis = createStylisInstance(options); const componentId = 'a'; return stylis(css, `.${componentId}`, undefined, componentId); } describe('stylis', ()...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/error.test.ts
packages/styled-components/src/utils/test/error.test.ts
import styledError from '../error'; describe('development', () => { it('returns a rich error', () => { expect(() => { throw styledError(2); }).toThrowErrorMatchingInlineSnapshot(` "Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instanc...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/interleave.test.ts
packages/styled-components/src/utils/test/interleave.test.ts
import interleave from '../interleave'; describe('interleave', () => { it('blindly interleave', () => { expect(interleave([], [])).toEqual([undefined]); expect(interleave(['foo'], [])).toEqual(['foo']); expect(interleave(['foo'], [1])).toEqual(['foo', 1, undefined]); expect(interleave(['foo', 'bar'],...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/flatten.test.tsx
packages/styled-components/src/utils/test/flatten.test.tsx
import { render } from '@testing-library/react'; import React from 'react'; import styled from '../../constructors/styled'; import flatten from '../flatten'; describe('flatten', () => { it('doesnt merge strings', () => { expect(flatten(['foo', 'bar', 'baz'])).toEqual(['foo', 'bar', 'baz']); }); it('drops nu...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/utils/test/isPlainObject.test.ts
packages/styled-components/src/utils/test/isPlainObject.test.ts
import React from 'react'; import vm from 'vm'; import isPlainObject from '../isPlainObject'; it('returns true for an object literal', () => { expect(isPlainObject({})).toEqual(true); }); it('returns false for an instance of a class with its own toString method', () => { class SomeClass { toString() { r...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/constructWithOptions.ts
packages/styled-components/src/constructors/constructWithOptions.ts
import { Attrs, BaseObject, ExecutionProps, Interpolation, IStyledComponent, IStyledComponentFactory, KnownTarget, NoInfer, Runtime, StyledOptions, StyledTarget, Styles, Substitute, } from '../types'; import { EMPTY_OBJECT } from '../utils/empties'; import styledError from '../utils/error'; im...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/css.ts
packages/styled-components/src/constructors/css.ts
import { BaseObject, Interpolation, NoInfer, RuleSet, StyledObject, StyleFunction, Styles, } from '../types'; import { EMPTY_ARRAY } from '../utils/empties'; import flatten from '../utils/flatten'; import interleave from '../utils/interleave'; import isFunction from '../utils/isFunction'; import isPlainOb...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/createGlobalStyle.ts
packages/styled-components/src/constructors/createGlobalStyle.ts
import React from 'react'; import { STATIC_EXECUTION_CONTEXT } from '../constants'; import GlobalStyle from '../models/GlobalStyle'; import { useStyleSheetContext } from '../models/StyleSheetManager'; import { DefaultTheme, ThemeContext } from '../models/ThemeProvider'; import StyleSheet from '../sheet'; import { Execu...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/styled.tsx
packages/styled-components/src/constructors/styled.tsx
import * as React from 'react'; import createStyledComponent from '../models/StyledComponent'; import { BaseObject, KnownTarget, WebTarget } from '../types'; import domElements, { SupportedHTMLElements } from '../utils/domElements'; import constructWithOptions, { Styled as StyledInstance } from './constructWithOptions'...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/keyframes.ts
packages/styled-components/src/constructors/keyframes.ts
import Keyframes from '../models/Keyframes'; import { Interpolation, Styles } from '../types'; import generateComponentId from '../utils/generateComponentId'; import { joinStringArray } from '../utils/joinStrings'; import css from './css'; export default function keyframes<Props extends object = {}>( strings: Styles...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/test/createGlobalStyle.test.tsx
packages/styled-components/src/constructors/test/createGlobalStyle.test.tsx
import { act, render } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; import React from 'react'; import * as constants from '../../constants'; import { StyleSheetManager } from '../../models/StyleSheetManager'; import ThemeProvider from '../../models/ThemeProvider'; import Style...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/test/createGlobalStyle.ssr.test.tsx
packages/styled-components/src/constructors/test/createGlobalStyle.ssr.test.tsx
/** * @jest-environment node */ import React from 'react'; import ReactDOMServer from 'react-dom/server'; import ServerStyleSheet from '../../models/ServerStyleSheet'; import { stripComments, stripWhitespace } from '../../test/utils'; import createGlobalStyle from '../createGlobalStyle'; describe(`createGlobalStyle`...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/test/keyframes.test.tsx
packages/styled-components/src/constructors/test/keyframes.test.tsx
import { render } from '@testing-library/react'; import React from 'react'; import stylisRTLPlugin from 'stylis-plugin-rtl'; import Keyframes from '../../models/Keyframes'; import { StyleSheetManager } from '../../models/StyleSheetManager'; import { getRenderedCSS, resetStyled } from '../../test/utils'; import css from...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/constructors/test/styled.test.tsx
packages/styled-components/src/constructors/test/styled.test.tsx
import { render } from '@testing-library/react'; import React, { ComponentProps } from 'react'; import { getRenderedCSS, resetStyled } from '../../test/utils'; import domElements from '../../utils/domElements'; let styled: ReturnType<typeof resetStyled>; describe('styled', () => { beforeEach(() => { styled = re...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/hoc/withTheme.tsx
packages/styled-components/src/hoc/withTheme.tsx
import React from 'react'; import { ThemeContext } from '../models/ThemeProvider'; import { AnyComponent, ExecutionProps } from '../types'; import determineTheme from '../utils/determineTheme'; import getComponentName from '../utils/getComponentName'; import hoist, { NonReactStatics } from '../utils/hoist'; export def...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/src/hoc/withTheme.test.tsx
packages/styled-components/src/hoc/withTheme.test.tsx
import { render } from '@testing-library/react'; import React from 'react'; import ThemeProvider from '../models/ThemeProvider'; import { ExecutionProps } from '../types'; import withTheme from './withTheme'; describe('withTheme', () => { let warn: ReturnType<typeof jest.spyOn>; beforeEach(() => { warn = jest...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/test-utils/setupTestFramework.ts
packages/styled-components/test-utils/setupTestFramework.ts
const consoleError = console.error; const suppressedErrors = [ 'Error: Could not parse CSS stylesheet', 'Warning: Use the `defaultValue` or `value` props instead of setting children on <textarea>', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Warning: <%s /> is using incorrect casing.', 'Warning: The tag ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/styled-components/test-utils/index.ts
packages/styled-components/test-utils/index.ts
import { ReactWrapper } from 'enzyme'; import { IStyledComponent } from '../src/types'; function assertElement(element: any) { if (!(element instanceof HTMLElement)) { throw new Error('Must pass a DOM element to find/findAll(element, styledComponent)"'); } } function assertStyledComponent(styledComponent: any...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/sandbox/next-env.d.ts
packages/sandbox/next-env.d.ts
/// <reference types="next" /> /// <reference types="next/image-types/global" /> // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information.
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/sandbox/src/Button.example.tsx
packages/sandbox/src/Button.example.tsx
import styled, { css } from 'styled-components'; const Button = styled.button<{ $primary?: boolean }>` font-size: 16px; border-radius: 5px; padding: 0.25em 1em; margin: 1em 1em; background: transparent; color: palevioletred; border: 2px solid palevioletred; cursor: pointer; ${props => props.$pri...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/sandbox/pages/index.tsx
packages/sandbox/pages/index.tsx
import styled, { createGlobalStyle } from 'styled-components'; import ButtonExample from '../src/Button.example'; const GlobalStyle = createGlobalStyle` body { font-size: 16px; line-height: 1.2; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji",...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
styled-components/styled-components
https://github.com/styled-components/styled-components/blob/c3a599097a04ce681fd387e3d58c50e7c1fe3e76/packages/sandbox/pages/_document.tsx
packages/sandbox/pages/_document.tsx
import Document, { DocumentContext } from 'next/document'; import React from 'react'; import { ServerStyleSheet } from 'styled-components'; export default class MyDocument extends Document { static async getInitialProps(ctx: DocumentContext) { const sheet = new ServerStyleSheet(); const originalRenderPage = ...
typescript
MIT
c3a599097a04ce681fd387e3d58c50e7c1fe3e76
2026-01-04T15:51:04.970441Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/scripts/babel-plugin-bit-decorator/types.d.ts
scripts/babel-plugin-bit-decorator/types.d.ts
type BitDecoratorCall<T> = ( target: ClassAccessorDecoratorTarget<T, boolean>, context: ClassAccessorDecoratorContext<T, boolean> & { private: false; static: false; } ) => ClassAccessorDecoratorTarget<T, boolean>; /*{ const bitMask = (context.metadata.nextBitMask ??= 1); context.metadata.nextBitMask <...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/codemods/babel-plugin-codemod-optional-catch-binding/src/index.ts
codemods/babel-plugin-codemod-optional-catch-binding/src/index.ts
import type { PluginAPI, PluginObject } from "@babel/core"; export default function ({ types: t }: PluginAPI): PluginObject { return { manipulateOptions: undefined, visitor: { CatchClause(path) { if (path.node.param === null || !t.isIdentifier(path.node.param)) { return; } ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/codemods/babel-plugin-codemod-object-assign-to-object-spread/src/index.ts
codemods/babel-plugin-codemod-object-assign-to-object-spread/src/index.ts
import type { PluginAPI, PluginObject } from "@babel/core"; export default function ({ types: t }: PluginAPI): PluginObject { return { manipulateOptions: undefined, visitor: { CallExpression(path) { if (!path.get("callee").matchesPattern("Object.assign")) return; const args = path.get(...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/lib/babel-plugin-dynamic-import-node.d.ts
lib/babel-plugin-dynamic-import-node.d.ts
// https://github.com/airbnb/babel-plugin-dynamic-import-node/blob/master/src/utils.js declare module "babel-plugin-dynamic-import-node/utils" { import type { PluginAPI, PluginPass } from "@babel/core"; import type { NodePath } from "@babel/traverse"; import type * as t from "@babel/types"; function getImportSo...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/lib/globals.d.ts
lib/globals.d.ts
declare const IS_STANDALONE: boolean; declare const PACKAGE_JSON: { name: string; version: string }; declare function REQUIRED_VERSION(version: number): number | string; declare function REQUIRED_VERSION(version: string): string; declare namespace NodeJS { export interface ProcessEnv { BABEL_8_BREAKING: string; ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/lib/archived-libs.d.ts
lib/archived-libs.d.ts
/* This file is automatically generated by scripts/generators/archived-libs-typings.js */ declare module "@babel/plugin-transform-react-jsx-compat" { import { declare } from "@babel/helper-plugin-utils"; let exports: {default: ReturnType<typeof declare>}; export = exports; } declare module "@babel/plugin-transfo...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/lib/kexec.d.ts
lib/kexec.d.ts
declare module "kexec" { function execvp(cmd: string, args?: string[]): string; export = execvp; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/lib/third-party-libs.d.ts
lib/third-party-libs.d.ts
/* eslint-disable import/no-extraneous-dependencies */ declare module "@babel/preset-modules/lib/plugins/transform-async-arrows-in-class/index.js" { import type { declare } from "@babel/helper-plugin-utils"; let plugin: ReturnType<typeof declare>; let exports: { default: typeof plugin }; export = exports; } de...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/lib/libdom-minimal.d.ts
lib/libdom-minimal.d.ts
// Minimal version of lib.dom.d.ts. @babel/standalone needs these types // to be defined, but we don't want to load the full lib.dom.d.ts in // tsconfig.dts-bundles.json because we don't want other .d.ts files to // accidentally rely on DOM features. // eslint-disable-next-line @typescript-eslint/no-unused-vars, @type...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers-generated.ts
packages/babel-helpers/src/helpers-generated.ts
/* * This file is auto-generated! Do not modify it directly. * To re-generate run 'yarn gulp generate-runtime-helpers' */ import template from "@babel/template"; import type * as t from "@babel/types"; interface Helper { minVersion: string; ast: () => t.Program; metadata: HelperMetadata; } export interface ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
true
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/index.ts
packages/babel-helpers/src/index.ts
import { cloneNode, identifier } from "@babel/types"; import type * as t from "@babel/types"; import helpers from "./helpers-generated.ts"; import type { HelperMetadata } from "./helpers-generated.ts"; type GetDependency = (name: string) => t.Expression; function deep(obj: any, path: string, value?: unknown) { try ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/assertClassBrand.ts
packages/babel-helpers/src/helpers/assertClassBrand.ts
/* @minVersion 7.24.0 */ export default function _assertClassBrand( brand: Function | WeakMap<any, any> | WeakSet<any>, receiver: any, returnValue?: any, ) { if (typeof brand === "function" ? brand === receiver : brand.has(receiver)) { return arguments.length < 3 ? receiver : returnValue; } throw new T...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/writeOnlyError.ts
packages/babel-helpers/src/helpers/writeOnlyError.ts
/* @minVersion 7.12.13 */ export default function _writeOnlyError(name: string) { throw new TypeError('"' + name + '" is write-only'); }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/possibleConstructorReturn.ts
packages/babel-helpers/src/helpers/possibleConstructorReturn.ts
/* @minVersion 7.0.0-beta.0 */ import assertThisInitialized from "./assertThisInitialized.ts"; export default function _possibleConstructorReturn( self: object | undefined, value: unknown, ) { if (value && (typeof value === "object" || typeof value === "function")) { return value; } else if (value !== voi...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/objectDestructuringEmpty.ts
packages/babel-helpers/src/helpers/objectDestructuringEmpty.ts
/* @minVersion 7.0.0-beta.0 */ export default function _objectDestructuringEmpty<T>( obj: T | null | undefined, ): asserts obj is T { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/jsx.ts
packages/babel-helpers/src/helpers/jsx.ts
/* @minVersion 7.0.0-beta.0 */ var REACT_ELEMENT_TYPE: symbol | 0xeac7; interface Props { children?: any; [propName: string]: any; } interface ReactElement { $$typeof: typeof REACT_ELEMENT_TYPE; type: any; key: string | null; ref: null; props: Props; _owner: null; } type ReactElementType = any; type...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/toPrimitive.ts
packages/babel-helpers/src/helpers/toPrimitive.ts
/* @minVersion 7.1.5 */ // https://tc39.es/ecma262/#sec-toprimitive export default function toPrimitive( input: unknown, hint?: "default" | "string" | "number", ) { if (typeof input !== "object" || !input) return input; // @ts-expect-error Symbol.toPrimitive might not index {} var prim = input[Symbol.toPrimi...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/OverloadYield.ts
packages/babel-helpers/src/helpers/OverloadYield.ts
/* @minVersion 7.18.14 */ const enum Kind { // This yield was an await expression Await = 0, // This yield comes from yield* Delegate = 1, } // _OverloadYield is actually a class declare class _OverloadYield<T = any> { constructor(value: T, /** 0: await 1: delegate */ kind: 0 | 1); v: T; k: Kind; } //...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/classPrivateFieldLooseKey.ts
packages/babel-helpers/src/helpers/classPrivateFieldLooseKey.ts
/* @minVersion 7.0.0-beta.0 */ var id = 0; export default function _classPrivateFieldKey(name: string) { return "__private_" + id++ + "_" + name; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/regeneratorAsync.ts
packages/babel-helpers/src/helpers/regeneratorAsync.ts
/* @minVersion 7.27.0 */ import asyncGen from "./regeneratorAsyncGen.ts"; export default function _regeneratorAsync( innerFn: Function, outerFn: Function, self: any, tryLocsList: any[], PromiseImpl: PromiseConstructor | undefined, ) { var iter = asyncGen(innerFn, outerFn, self, tryLocsList, PromiseImpl); ...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/defineProperty.ts
packages/babel-helpers/src/helpers/defineProperty.ts
/* @minVersion 7.0.0-beta.0 */ import toPropertyKey from "./toPropertyKey.ts"; export default function _defineProperty<T extends object>( obj: T, key: PropertyKey, value: any, ) { key = toPropertyKey(key); // Shortcircuit the slow defineProperty path when possible. // We are trying to avoid issues where se...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/initializerDefineProperty.ts
packages/babel-helpers/src/helpers/initializerDefineProperty.ts
/* @minVersion 7.0.0-beta.0 */ interface DescriptorWithInitializer extends PropertyDescriptor { initializer?: () => any; } export default function _initializerDefineProperty<T>( target: T, property: PropertyKey, descriptor: DescriptorWithInitializer | undefined, context: DecoratorContext, ): void { if (!d...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/classPrivateFieldLooseBase.ts
packages/babel-helpers/src/helpers/classPrivateFieldLooseBase.ts
/* @minVersion 7.0.0-beta.0 */ export default function _classPrivateFieldBase<T extends object>( receiver: T, privateKey: PropertyKey, ) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/arrayLikeToArray.ts
packages/babel-helpers/src/helpers/arrayLikeToArray.ts
/* @minVersion 7.9.0 */ export default function _arrayLikeToArray<T>( arr: ArrayLike<T>, len?: number | null, ) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array<T>(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/wrapRegExp.ts
packages/babel-helpers/src/helpers/wrapRegExp.ts
/* @minVersion 7.19.0 */ import setPrototypeOf from "./setPrototypeOf.ts"; import inherits from "./inherits.ts"; // Define interfaces for clarity and type safety type GroupMap = Record<string, number | [number, number]>; declare class BabelRegExp extends RegExp { exec(str: string): RegExpExecArray | null; [Symbo...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false
babel/babel
https://github.com/babel/babel/blob/30af57a25649635268e0a9ecdfae99bdd5dda5b4/packages/babel-helpers/src/helpers/usingCtx.ts
packages/babel-helpers/src/helpers/usingCtx.ts
/* @minVersion 7.23.9 */ type Stack = | { v: Disposable | AsyncDisposable; d: null | undefined | DisposeLike; a: boolean; } | { d: null | undefined; a: true; }; type DisposeLike = () => void | PromiseLike<void>; interface UsingCtxReturn { e: object; u: (value: Disposable...
typescript
MIT
30af57a25649635268e0a9ecdfae99bdd5dda5b4
2026-01-04T15:46:08.418221Z
false