Replit.com Component libary source code
by replitLeaker - Thursday February 1, 2024 at 03:54 AM
#1
Source code to replit's React components

sample:
Rui.tsx
```typescript
import { ReactNode } from "react";
import { ThemeValuesGlobal } from "../../types";
import { globalTokens } from "../themes";
import { replitDarkTokens } from "../themes/replitDark";
import { Surface } from "./Surface";
import { View } from "./View";
/**
* Loads and injects the current theme into the Extension, providing theme tokens for all children of this component.
*
* If the prop `defaultElevation` is set to `false`, the default elevation of `default` will not be applied.
*
* If the prop `default` is set to `false`, the default CSS styles to `body, html` and `*` will not be applied.
*/
export function Rui({
  children,
  tokens,
  defaultElevation = true,
  defaultStyles = true,
}: {
  children: ReactNode;
  tokens?: ThemeValuesGlobal;
  defaultElevation?: boolean;
  defaultStyles?: boolean;
}) {
  const themeValues = replitDarkTokens;
  return (
    <>
      <style>{`
        :root,
        .replit-ui-theme-root {
          ${[
            ...Object.entries(tokens || themeValues || replitDarkTokens || {}),
            ...Object.entries(globalTokens || {}),
          ]
            .map(([key, val]) =>
              key === "__typename"
                ? ""
                : `  --${key
                    .replace(/[A-Z]/g, (c) => "-" + c.toLowerCase())
                    .replace(/[a-z][0-9]/g, (c) => `${c[0]}-${c[1]}`)}: ${val};`
            )
            .join("\n")}
        }
      `}</style>
      {defaultStyles ? (
        <style>{`
          @import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600");
          * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            outline: none;
          }
          html,
          body {
            padding: 0;
            margin: 0;
            font-family: var(--font-family-default);
            color: var(--foreground-default);
            font-family: var(--font-family-default);
          }
          .replit-ui-theme-root {
            overflow-x: hidden;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            height: 100vh;
            width: 100vw;
          }
        `}</style>
      ) : null}
      {defaultElevation ? (
        <Surface background="default" elevated className="replit-ui-theme-root">
          {children}
        </Surface>
      ) : (
        <View className="replit-ui-theme-root">{children}</View>
      )}
    </>
  );
}
```


Hidden Content
You must register or login to view this content.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SOURCE CODE Multiple UAE Websites Source code leak hexvior 11 98 03-28-2026, 05:40 PM
Last Post: xzin0vich
  SOURCE CODE Thailand Kohme Delivery Full source code leak + Github PAT hexvior 10 483 03-28-2026, 09:20 AM
Last Post: minhchinhkd88
  SOURCE CODE Full source code of Pluto Pakistan + Github PAT hexvior 14 522 03-27-2026, 10:05 PM
Last Post: houssamm
  SOURCE CODE enouvo.com Full source code and projects SleepMask 5 1,015 02-09-2026, 03:48 PM
Last Post: StormClaw
  COLLECTION [NEW] Source Code Pack Spearr 114 1,650 02-08-2026, 10:57 AM
Last Post: userliquid



 Users browsing this thread: 1 Guest(s)