REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.85 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@emotion/react/src/theming.tsx
Text
Base64
import * as React from 'react' import weakMemoize from '@emotion/weak-memoize' import isDevelopment from '#is-development' import hoistNonReactStatics from './_isolated-hnrs' import { DistributiveOmit, PropsOf } from './types' // tslint:disable-next-line: no-empty-interface export interface Theme {} export interface ThemeProviderProps { theme: Partial<Theme> | ((outerTheme: Theme) => Theme) children: React.ReactNode } export interface ThemeProvider { (props: ThemeProviderProps): React.ReactElement } export type WithTheme<P, T> = P extends { theme: infer Theme } ? P & { theme: Exclude<Theme, undefined> } : P & { theme: T } export const ThemeContext = /* #__PURE__ */ React.createContext({} as Theme) if (isDevelopment) { ThemeContext.displayName = 'EmotionThemeContext' } export const useTheme = () => React.useContext(ThemeContext) const getTheme = ( outerTheme: Theme, theme: Partial<Theme> | ((theme: Theme) => Theme) ): Theme => { if (typeof theme === 'function') { const mergedTheme = theme(outerTheme) if ( isDevelopment && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme)) ) { throw new Error( '[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!' ) } return mergedTheme } if ( isDevelopment && (theme == null || typeof theme !== 'object' || Array.isArray(theme)) ) { throw new Error( '[ThemeProvider] Please make your theme prop a plain object' ) } return { ...outerTheme, ...theme } } let createCacheWithTheme = /* #__PURE__ */ weakMemoize((outerTheme: Theme) => { return weakMemoize((theme: Partial<Theme> | ((theme: Theme) => Theme)) => { return getTheme(outerTheme, theme) }) }) export interface ThemeProviderProps { theme: Partial<Theme> | ((outerTheme: Theme) => Theme) children: React.ReactNode } export const ThemeProvider = (props: ThemeProviderProps) => { let theme = React.useContext(ThemeContext) if (props.theme !== theme) { theme = createCacheWithTheme(theme)(props.theme) } return ( <ThemeContext.Provider value={theme}> {props.children} </ThemeContext.Provider> ) } export function withTheme< C extends React.ComponentType<React.ComponentProps<C>> >( Component: C ): React.ForwardRefExoticComponent< DistributiveOmit<PropsOf<C>, 'theme'> & { theme?: Theme } > export function withTheme( Component: React.ComponentType<any> ): React.ForwardRefExoticComponent<any> { const componentName = Component.displayName || Component.name || 'Component' let WithTheme = React.forwardRef(function render(props, ref) { let theme = React.useContext(ThemeContext) return <Component theme={theme} ref={ref} {...props} /> }) WithTheme.displayName = `WithTheme(${componentName})` return hoistNonReactStatics(WithTheme, Component) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 16
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
conditions
DIR
-
drwxr-xr-x
2026-02-28 00:30:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
class-names.tsx
4.50 KB
lrw-r--r--
2026-02-28 00:30:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
context.tsx
2.49 KB
lrw-r--r--
2026-02-28 00:30:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
css.ts
423 B
lrw-r--r--
2026-02-28 00:30:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
emotion-element.tsx
4.99 KB
lrw-r--r--
2026-02-28 00:30:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get-label-from-stack-trace.ts
1.61 KB
lrw-r--r--
2026-02-28 00:30:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
global.tsx
4.49 KB
lrw-r--r--
2026-02-28 00:30:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
2.08 KB
lrw-r--r--
2026-02-28 00:30:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx-dev-runtime.ts
826 B
lrw-r--r--
2026-02-28 00:30:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx-namespace.ts
4.23 KB
lrw-r--r--
2026-02-28 00:30:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx-runtime.ts
924 B
lrw-r--r--
2026-02-28 00:30:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx.ts
1.55 KB
lrw-r--r--
2026-02-28 00:30:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
keyframes.ts
654 B
lrw-r--r--
2026-02-28 00:30:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
theming.tsx
2.85 KB
lrw-r--r--
2026-02-28 00:30:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
types.ts
544 B
lrw-r--r--
2026-02-28 00:30:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.ts
40 B
lrw-r--r--
2026-02-28 00:30:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_isolated-hnrs.ts
650 B
lrw-r--r--
2026-02-28 00:30:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).