index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/create-next-app/README.md | # Next.js demo for Geist UI
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.... | 2,900 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/create-next-app/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.
| 2,901 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/create-next-app/next.config.js | module.exports = {
reactStrictMode: false,
}
| 2,902 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/create-next-app/package.json | {
"name": "geist-ui-nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@geist-ui/core": "latest",
"next": "^12.0.8",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": ... | 2,903 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/create-next-app/tsconfig.json | {
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolut... | 2,904 |
0 | petrpan-code/geist-org/geist-ui/examples/create-next-app | petrpan-code/geist-org/geist-ui/examples/create-next-app/pages/_app.tsx | import type { AppProps } from 'next/app'
import { GeistProvider, CssBaseline } from '@geist-ui/core'
function MyApp({ Component, pageProps }: AppProps) {
return (
<GeistProvider>
<CssBaseline />
<Component {...pageProps} />
</GeistProvider>
)
}
export default MyApp
| 2,905 |
0 | petrpan-code/geist-org/geist-ui/examples/create-next-app | petrpan-code/geist-org/geist-ui/examples/create-next-app/pages/_document.js | import Document, { Html, Head, Main, NextScript } from 'next/document'
import { CssBaseline } from '@geist-ui/core'
class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
const styles = CssBaseline.flush()
return {
...initia... | 2,906 |
0 | petrpan-code/geist-org/geist-ui/examples/create-next-app | petrpan-code/geist-org/geist-ui/examples/create-next-app/pages/index.tsx | import Head from 'next/head'
import { Page, Text, Image, Display, Button, Grid } from '@geist-ui/core'
const gh = 'https://github.com/geist-org/geist-ui'
const docs = 'https://geist-ui.dev'
export default function Home() {
const redirect = (url: string) => window.open(url)
return (
<div>
<Head>
... | 2,907 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/create-react-app/README.md | ## Create React App Example
This example have been moved here: [geist-ui/react-getting-started](https://github.com/geist-org/react-getting-started)
| 2,908 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/custom-styles/README.md | ## Custom styles
This is an example of **how to override styles in `geist-ui`**.
## Getting Started
First, run the development server:
```bash
npm i && npm run dev
# or
yarn && yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
| 2,909 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/custom-styles/package.json | {
"name": "custom-styles",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"dev": "react-scripts start",
"build": "react-scripts build"
},
"dependencies": {
"@geist-ui/core": "latest",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@types/react": "^16.... | 2,910 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-styles | petrpan-code/geist-org/geist-ui/examples/custom-styles/public/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Custom styles</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
| 2,911 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-styles | petrpan-code/geist-org/geist-ui/examples/custom-styles/src/home.jsx | import React from 'react'
import { Card, Text } from '@geist-ui/core'
import './style.css'
const Home = () => (
<div className="my-app">
<Card shadow style={{ width: '500px', margin: '100px auto' }}>
<Text className="my-text">Modern and minimalist React UI library.</Text>
<Text type={'success'} style... | 2,912 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-styles | petrpan-code/geist-org/geist-ui/examples/custom-styles/src/index.jsx | import React from 'react'
import ReactDom from 'react-dom'
import { GeistProvider, CssBaseline } from '@geist-ui/core'
import Home from './home'
const App = () => {
return (
<GeistProvider>
<CssBaseline />
<Home />
</GeistProvider>
)
}
ReactDom.render(
<React.StrictMode>
<App />
</Reac... | 2,913 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-styles | petrpan-code/geist-org/geist-ui/examples/custom-styles/src/style.css | .my-app .my-text {
font-size: 1rem;
color: #000;
text-transform: uppercase;
display: inline-flex;
width: 100%;
margin: 1rem auto !important;
align-items: center;
justify-content: center;
text-align: center;
}
| 2,914 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/custom-themes/README.md | ## Custom themes
This is an example of **how to custom Themes in `geist-ui`**.
## Getting Started
First, run the development server:
```bash
npm i && npm run dev
# or
yarn && yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
| 2,915 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/custom-themes/package.json | {
"name": "custom-themes",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"dev": "react-scripts start",
"build": "react-scripts build"
},
"dependencies": {
"@geist-ui/core": "latest",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@types/react": "^16.... | 2,916 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-themes | petrpan-code/geist-org/geist-ui/examples/custom-themes/public/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Custom themes</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
| 2,917 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-themes | petrpan-code/geist-org/geist-ui/examples/custom-themes/src/home.jsx | import React from 'react'
import { Text, Tag, useTheme, Select } from '@geist-ui/core'
const Home = ({ onThemeChange }) => {
const theme = useTheme()
const changeHandler = val => {
onThemeChange && onThemeChange(val)
}
return (
<div>
<Select size="small" value={theme.type} onChange={changeHandle... | 2,918 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-themes | petrpan-code/geist-org/geist-ui/examples/custom-themes/src/index.jsx | import React, { useState } from 'react'
import ReactDom from 'react-dom'
import { GeistProvider, CssBaseline, Page, Text } from '@geist-ui/core'
import { greenTheme, redTheme } from './theme'
import Home from './home'
const App = () => {
const [theme, setTheme] = useState('light')
return (
<GeistProvider theme... | 2,919 |
0 | petrpan-code/geist-org/geist-ui/examples/custom-themes | petrpan-code/geist-org/geist-ui/examples/custom-themes/src/theme.js | /**
* Just customize what you need, deep merge themes by default.
*
* If you are using TypeScript, please use the following type definition.
* If you are using JavaScript, refer to https://github.com/geist-org/geist-ui/blob/master/components/themes/presets/index.ts
*/
// import {
// GeistUIThemes,
// GeistUIT... | 2,920 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/extends-components/README.md | ## Extends Components
This is an example of **how to inherit components in `geist-ui`**.
## Getting Started
First, run the development server:
```bash
npm i && npm run dev
# or
yarn && yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
| 2,921 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/extends-components/package.json | {
"name": "geist-ui-react-extends-components",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"@geist-ui/core": "latest",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
"devDependencies": {
"@types/react": "16.9.19",
"@types/react-dom": "16.9.5",
"react-scripts": "^3.4.1"... | 2,922 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/extends-components/tsconfig.json | {
"include": [
"./src/*"
],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": [
"dom",
"es2015"
],
"jsx": "react",
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNa... | 2,923 |
0 | petrpan-code/geist-org/geist-ui/examples/extends-components | petrpan-code/geist-org/geist-ui/examples/extends-components/public/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Extends Components</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
| 2,924 |
0 | petrpan-code/geist-org/geist-ui/examples/extends-components | petrpan-code/geist-org/geist-ui/examples/extends-components/src/app.tsx | import * as React from 'react'
import MyInput from './my-input'
import { GeistProvider, CssBaseline, Page } from '@geist-ui/core'
export default function App() {
return (
<GeistProvider>
<CssBaseline />
<Page size="mini">
<MyInput error="this is required" placeholder="my input" />
</Pag... | 2,925 |
0 | petrpan-code/geist-org/geist-ui/examples/extends-components | petrpan-code/geist-org/geist-ui/examples/extends-components/src/index.tsx | import * as React from 'react'
import { render } from 'react-dom'
import App from './app'
const rootElement = document.getElementById('app')
render(<App />, rootElement)
| 2,926 |
0 | petrpan-code/geist-org/geist-ui/examples/extends-components | petrpan-code/geist-org/geist-ui/examples/extends-components/src/my-input.tsx | import React, { ReactElement } from 'react'
import { Input, Spacer, Text } from '@geist-ui/core'
type InputErrorType = {
error?: string
}
const MyInput: React.FC<InputErrorType & React.ComponentProps<typeof Input>> = ({
error = null,
...inputProps
}): ReactElement => {
const hasError = Boolean(error)
const ... | 2,927 |
0 | petrpan-code/geist-org/geist-ui/examples/extends-components | petrpan-code/geist-org/geist-ui/examples/extends-components/src/react-app-env.d.ts | /// <reference types="react-scripts" />
| 2,928 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/remix/README.md | # Remix demo for Geist UI
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/routes/index.tsx`. The page auto-updates as you edit the fi... | 2,929 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/remix/package.json | {
"name": "geist-remix",
"license": "MIT",
"scripts": {
"build": "remix build",
"dev": "remix dev",
"postinstall": "remix setup node"
},
"prettier": "@geist-ui/prettier-config",
"dependencies": {
"@geist-ui/core": "latest",
"@remix-run/react": "^1.1.3",
"@remix-run/serve": "^1.1.3",
... | 2,930 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/remix/remix.config.js | /**
* @type {import('@remix-run/dev/config').AppConfig}
*/
module.exports = {
appDirectory: 'app',
assetsBuildDirectory: 'public/build',
publicPath: '/build/',
serverBuildDirectory: 'api/_build',
ignoredRouteFiles: ['.*'],
}
| 2,931 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/remix/remix.env.d.ts | /// <reference types="@remix-run/dev" />
/// <reference types="@remix-run/node/globals" />
| 2,932 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/remix/tsconfig.json | {
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "node",
"resolveJsonModule": true,
"target": "ES2019",
"strict": true,
... | 2,933 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/remix/vercel.json | {
"build": {
"env": {
"ENABLE_FILE_SYSTEM_API": "1"
}
}
}
| 2,934 |
0 | petrpan-code/geist-org/geist-ui/examples/remix | petrpan-code/geist-org/geist-ui/examples/remix/api/index.js | const { createRequestHandler } = require('@remix-run/vercel')
module.exports = createRequestHandler({
build: require('./_build'),
})
| 2,935 |
0 | petrpan-code/geist-org/geist-ui/examples/remix | petrpan-code/geist-org/geist-ui/examples/remix/app/entry.client.tsx | import { hydrate } from 'react-dom'
import { RemixBrowser } from 'remix'
hydrate(<RemixBrowser />, document)
| 2,936 |
0 | petrpan-code/geist-org/geist-ui/examples/remix | petrpan-code/geist-org/geist-ui/examples/remix/app/entry.server.tsx | import { renderToString } from 'react-dom/server'
import { RemixServer } from 'remix'
import type { EntryContext } from 'remix'
import { CssBaseline } from '@geist-ui/core'
export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext,... | 2,937 |
0 | petrpan-code/geist-org/geist-ui/examples/remix | petrpan-code/geist-org/geist-ui/examples/remix/app/root.tsx | import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from 'remix'
import type { MetaFunction } from 'remix'
import { CssBaseline, GeistProvider } from '@geist-ui/core'
export const meta: MetaFunction = () => {
return { title: 'Geist with Remix' }
}
export default function App() {
return (
<h... | 2,938 |
0 | petrpan-code/geist-org/geist-ui/examples/remix/app | petrpan-code/geist-org/geist-ui/examples/remix/app/routes/index.tsx | import { Card, Page, Text } from '@geist-ui/core'
export default function Index() {
return (
<Page>
<Card>
<Text>Hello, Geist with Remix</Text>
</Card>
</Page>
)
}
| 2,939 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/README.md | ## Tree shaking for create react app
Full tree-shaking is automatically available without any configuration when using `react-scripts 5.0.0` or higher. (`webpack > 5.0`)
| 2,940 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/package.json | {
"name": "custom-styles",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "react-scripts start",
"build": "DISABLE_ESLINT_PLUGIN=true react-scripts build",
"analyze": "source-map-explorer 'build/static/js/*.js'"
},
"dependencies": {
"@geist-ui/core": "latest"... | 2,941 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/build/asset-manifest.json | {
"files": {
"main.js": "/static/js/main.c0df7028.js",
"index.html": "/index.html",
"main.c0df7028.js.map": "/static/js/main.c0df7028.js.map"
},
"entrypoints": [
"static/js/main.c0df7028.js"
]
} | 2,942 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/build/index.html | <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Tree Shaking</title><script defer="defer" src="/static/js/main.c0df7028.js"></script></head><body><div id="app"></div></body></html> | 2,943 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/build/static | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/build/static/js/main.c0df7028.js | /*! For license information please see main.c0df7028.js.LICENSE.txt */
!function(){"use strict";var e={725:function(e){var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called wi... | 2,944 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/build/static | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/build/static/js/main.c0df7028.js.LICENSE.txt | /*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v1... | 2,945 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/public/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tree Shaking</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
| 2,946 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/src/home.jsx | import React from 'react'
import { Page, Text, Button } from '@geist-ui/core'
const Home = () => (
<Page>
<Text>Hello world.</Text>
<Button>Action</Button>
</Page>
)
export default Home
| 2,947 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app | petrpan-code/geist-org/geist-ui/examples/tree-shaking-create-react-app/src/index.jsx | import React from 'react'
import ReactDom from 'react-dom'
import { GeistProvider, CssBaseline } from '@geist-ui/core'
import Home from './home'
const App = () => {
return (
<GeistProvider>
<CssBaseline />
<Home />
</GeistProvider>
)
}
ReactDom.render(
<React.StrictMode>
<App />
</Reac... | 2,948 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs/README.md | # Tree shaking with Next.js
## About
Full tree-shaking is automatically available without any configuration when using `next.js 11.0.0` or higher. (`webpack > 5.0`)
In this example, run `yarn analyze` to see the results of the build.
| 2,949 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs/next.config.js | const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
module.exports = withBundleAnalyzer({
eslint: {
ignoreDuringBuilds: true,
},
})
| 2,950 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs/package.json | {
"name": "tree-shaking-nextjs",
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"analyze": "ANALYZE=true yarn build"
},
"dependencies": {
"@geist-ui/core": "^2.3.3",
"next": "^12.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"... | 2,951 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs/pages/_app.js | import { GeistProvider, CssBaseline } from '@geist-ui/core'
function MyApp({ Component, pageProps }) {
return (
<GeistProvider>
<CssBaseline />
<Component {...pageProps} />
</GeistProvider>
)
}
export default MyApp
| 2,952 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs/pages/_document.js | import Document, { Html, Head, Main, NextScript } from 'next/document'
import { CssBaseline } from '@geist-ui/core'
class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
const styles = CssBaseline.flush()
return {
...initia... | 2,953 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs | petrpan-code/geist-org/geist-ui/examples/tree-shaking-nextjs/pages/index.js | import { Page, Text, Button } from '@geist-ui/core'
export default function Home() {
return (
<Page>
<Text h1>
Welcome to <a href="https://nextjs.org">Next.js!</a>
</Text>
<Button>hello</Button>
</Page>
)
}
| 2,954 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack/.babelrc | {
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
| 2,955 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack/README.md | ## Tree shaking for webpack
### About
Full tree-shaking is automatically available without any configuration when using `webpack 5.0` or higher.
### Previews
**Before:**

<br />
**After:**

| 2,956 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack/package.json | {
"name": "tree-shaking-webpack",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "webpack-dev-server --config ./webpack.config.js --mode development",
"build": "webpack --config ./webpack.config.js --mode production",
"analyze": "source-map-explorer 'dist/*.js' --g... | 2,957 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack/webpack.config.js | const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './src/index.js',
devtool: 'source-map',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
],
},
resolve: {... | 2,958 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack/src/index.html | <!DOCTYPE html>
<html>
<head>
<title>Tree Shaking</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
| 2,959 |
0 | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack | petrpan-code/geist-org/geist-ui/examples/tree-shaking-webpack/src/index.js | import React from 'react'
import ReactDOM from 'react-dom'
import { GeistProvider, CssBaseline, Page, Button } from '@geist-ui/core'
const App = () => {
return (
<Page>
<p>Hello, world.</p>
<Button>Action</Button>
</Page>
)
}
ReactDOM.render(
<React.StrictMode>
<GeistProvider>
<Css... | 2,960 |
0 | petrpan-code/geist-org/geist-ui/examples | petrpan-code/geist-org/geist-ui/examples/with-typescript/README.md | ## With TypeScript Example
This example have been moved here: [geist-ui/react-ts-getting-started](https://github.com/geist-org/react-ts-getting-started)
| 2,961 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/lib/config-context.ts | import React from 'react'
import type { DeepPartial } from 'components/utils/types'
import { GeistUIThemes } from 'components'
export interface Configs {
onThemeChange?: (themes: DeepPartial<GeistUIThemes>) => void
isChinese?: boolean
updateChineseState: (state: boolean) => void
sidebarScrollHeight: number
u... | 2,962 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/lib/config-provider.tsx | import React, { useMemo, useState } from 'react'
import { ConfigContext, Configs } from 'lib/config-context'
import { useRouter } from 'next/router'
import type { DeepPartial } from 'components/utils/types'
import { GeistUIThemes, Themes } from 'components'
import { useTheme } from 'components'
import { CHINESE_LANGUAG... | 2,963 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/lib/constants.ts | export const CUSTOM_THEME_TYPE = 'Custom'
export const CHINESE_LANGUAGE_IDENT = 'zh-cn'
export const ENGLISH_LANGUAGE_IDENT = 'en-us'
export const GITHUB_URL = 'https://github.com/geist-org/geist-ui'
export const CONTRIBUTORS_URL = 'https://contributors.geist-ui.dev/api/users'
| 2,964 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/lib/redirect.tsx | import { NextPage } from 'next'
import Head from 'next/head'
import Router from 'next/router'
export interface Props {
metaRedirect?: boolean
}
const redirect = (destination: string) => {
const Home: NextPage<Props> = ({ metaRedirect }) => {
if (!metaRedirect) return null
return (
<Head>
<me... | 2,965 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/lib/use-dom-clean.ts | import { useEffect } from 'react'
const useDomClean = (): void => {
useEffect(() => {
document.documentElement.removeAttribute('style')
document.body.removeAttribute('style')
}, [])
}
export default useDomClean
| 2,966 |
0 | petrpan-code/geist-org/geist-ui | petrpan-code/geist-org/geist-ui/lib/use-locale.ts | import { useRouter } from 'next/router'
import { useEffect } from 'react'
import useCurrentState from 'components/utils/use-current-state'
const DEFAULT_LOCALE = 'en-us'
const DEFAULT_TAB = ''
export type LocaleTypes = {
locale: string
tabbar: string
}
const useLocale = (): LocaleTypes => {
const { pathname } ... | 2,967 |
0 | petrpan-code/geist-org/geist-ui/lib | petrpan-code/geist-org/geist-ui/lib/components/index.ts | export { default as Layout } from './layout'
export { default as Playground } from './playground'
export { default as PlaygroundTitle } from './playground/title'
export { default as Attributes } from './attributes'
export { default as Search } from './search'
export * from './mdx-widgets'
| 2,968 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/attributes/attributes-table.tsx | import { Card, useTheme } from 'components'
import React from 'react'
const AttributesTable: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => {
const theme = useTheme()
return (
<Card className="attr">
{children}
<style jsx global>{`
.attr .pre {
margin-top: 12px !i... | 2,969 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/attributes/attributes-title.tsx | import React from 'react'
import { VirtualAnchor } from '../pures'
import { Code, useTheme } from 'components'
import { useConfigs } from 'lib/config-context'
export interface AttributesTitleProps {
alias?: string
}
const getAlias = (isChinese: boolean, alias?: string) => {
if (!alias) return null
return (
... | 2,970 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/attributes/attributes.tsx | import React, { useMemo } from 'react'
import { Spacer, Divider, Text } from 'components'
import { VirtualAnchor } from '../pures'
import { useConfigs } from '../../config-context'
import Contributors from './contributors'
import AttributesTitle from './attributes-title'
import AttributesTable from './attributes-table'... | 2,971 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/attributes/contributors.tsx | import React, { useEffect, useMemo, useState } from 'react'
import { Avatar, Link, Tooltip } from 'components'
import { useConfigs } from 'lib/config-context'
import { CONTRIBUTORS_URL, GITHUB_URL } from 'lib/constants'
const RepoMasterURL = `${GITHUB_URL}/blob/master`
export interface Contributor {
name: string
a... | 2,972 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/attributes/index.ts | import Attributes from './attributes'
import AttributesTitle from './attributes-title'
import AttributesTable from './attributes-table'
Attributes.Title = AttributesTitle
Attributes.Table = AttributesTable
export default Attributes
| 2,973 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/customization/codes.tsx | import React, { useMemo } from 'react'
import { isObject } from 'components/themes/themes'
import { LiveEditor, LiveProvider } from 'react-live'
import { useConfigs } from 'lib/config-context'
import { CUSTOM_THEME_TYPE } from 'lib/constants'
import CopyIcon from 'components/snippet/snippet-icon'
import makeCodeTheme f... | 2,974 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/customization/colors.tsx | import React from 'react'
import { Card, Grid, useTheme } from 'components'
import { CardTypes } from 'components/utils/prop-types'
const types = [
'secondary',
'success',
'warning',
'error',
'dark',
'alert',
'purple',
'violet',
'cyan',
'lite',
]
const Colors: React.FC<React.PropsWithChildren<unkn... | 2,975 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/customization/demo.tsx | import React from 'react'
import Colors from './colors'
import { useTheme, Button, Text, Code, Spacer, Link, Select, Grid } from 'components'
import { useConfigs } from 'lib/config-context'
const Demo: React.FC<React.PropsWithChildren<unknown>> = () => {
const theme = useTheme()
const { isChinese } = useConfigs()
... | 2,976 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/customization/editor-color-item.tsx | import React, { useMemo } from 'react'
import { useTheme, Popover, Themes } from 'components'
import { ColorResult, TwitterPicker } from 'react-color'
import { useConfigs } from 'lib/config-context'
import { GeistUIThemesPalette } from 'components/themes'
const DefaultTheme = Themes.getPresetStaticTheme()
interface Pr... | 2,977 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/customization/editor-input-item.tsx | import React, { useMemo } from 'react'
import { useTheme, Input, GeistUIThemes } from 'components'
import { useConfigs } from 'lib/config-context'
type Props = {
value?: string
groupName: keyof GeistUIThemes
keyName: string
}
const EditorInputItem: React.FC<React.PropsWithChildren<Props>> = ({
groupName,
ke... | 2,978 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/customization/editor.tsx | import React from 'react'
import { Text, Button, useTheme, Themes } from 'components'
import EditorColorItem from './editor-color-item'
import EditorInputItem from './editor-input-item'
import RotateCcwIcon from '@geist-ui/icons/rotateCcw'
import { useConfigs } from 'lib/config-context'
import { GeistUIThemesExpressive... | 2,979 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/customization/layout.tsx | import React from 'react'
import { useTheme, Grid } from 'components'
import CustomizationCodes from './codes'
import Demo from './demo'
const CustomizationLayout: React.FC<React.PropsWithChildren<unknown>> = ({
children,
}) => {
const theme = useTheme()
return (
<div className="layout">
<Grid.Contain... | 2,980 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/layout/header.tsx | import React, { useMemo } from 'react'
import Head from 'next/head'
export interface Meta {
title: string
}
const toCapitalize = (name: string) => {
const [first, ...rest] = name
return `${first.toUpperCase()}${rest.join('')}`
}
const PageHeader: React.FC<{ meta: Meta }> = ({ meta }) => {
const capitalizeTit... | 2,981 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/layout/index.tsx | import { Layout } from './layout'
export type LayoutComponentType = typeof Layout
export type { LayoutProps } from './layout'
export default Layout as LayoutComponentType
| 2,982 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/layout/layout.tsx | import React from 'react'
import PageHeader from './header'
import Sidebar from './sidebar'
import PoweredBy from './powered-by'
import useTheme from 'components/use-theme'
export interface Meta {
title: string
}
export interface LayoutProps {
meta: Meta
getStaticProps?: any
}
export const Layout: React.FC<Rea... | 2,983 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/menu/index.tsx | import dynamic from 'next/dynamic'
import MenuSkeleton from './menu-skeleton'
const Menu = dynamic(import('./menu'), {
ssr: false,
loading: () => <MenuSkeleton />,
})
export default Menu
| 2,984 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/menu/menu-mobile.tsx | import React, { useMemo } from 'react'
import NextLink from 'next/link'
import { useTheme } from 'components'
import Metadata from 'lib/data'
import useLocale from 'lib/use-locale'
import { useConfigs } from 'lib/config-context'
import { Sides } from '../sidebar/side-item'
import ChevronRightIcon from '@geist-ui/icons/... | 2,985 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/menu/menu-skeleton.tsx | import React from 'react'
import useTheme from 'components/use-theme'
const MenuSkeleton: React.FC<unknown> = () => {
const theme = useTheme()
return (
<div className="skeleton">
<style jsx>{`
.skeleton {
height: var(--geist-page-nav-height);
width: 100%;
margin: 0 a... | 2,986 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/menu/menu.tsx | import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { useRouter } from 'next/router'
import NextLink from 'next/link'
import { Controls } from 'lib/components/pures'
import { useConfigs } from 'lib/config-context'
import { useBodyScroll, useTheme, Button, Image, useMediaQuery, Tabs } from 'c... | 2,987 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/powered-by/index.ts | import dynamic from 'next/dynamic'
const PoweredBy = dynamic(import('./powered-by'), { ssr: false, loading: () => null })
export default PoweredBy
| 2,988 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/powered-by/powered-by.tsx | import React from 'react'
import { Text, Link } from 'components'
const PoweredBy: React.FC<unknown> = () => {
return (
<div className="powered-by">
<Text mb={0} font="14px" type="secondary">
Geist is an open source project from the community.
</Text>
<Text mt={0} font="14px" type="seco... | 2,989 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/sidebar/active-catalog.tsx | import React from 'react'
import { useRouter } from 'next/router'
import useTheme from 'components/use-theme'
export interface Props {
name: string
localeName?: string
}
const ActiveCatalog: React.FC<Props> = React.memo(({ name, localeName, ...props }) => {
const theme = useTheme()
const { pathname } = useRou... | 2,990 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/sidebar/active-link.tsx | import React, { useMemo } from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useTheme } from 'components'
export interface Props {
onAcitve?: () => void
href: string
text: string
}
const ActiveLink: React.FC<Props> = React.memo(({ href, text }) => {
const theme = useThe... | 2,991 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/sidebar/index.tsx | import dynamic from 'next/dynamic'
import SidebarSkeleton from './sidebar-skeleton'
const Sidebar = dynamic(import('./sidebar'), {
ssr: false,
loading: () => <SidebarSkeleton />,
})
export default Sidebar
| 2,992 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/sidebar/side-item.tsx | import React, { ReactElement } from 'react'
import ActiveLink from './active-link'
import ActiveCatalog from './active-catalog'
export type Sides = {
name: string
url?: string
localeName?: string
children?: Sides | Array<Sides>
}
export interface SideItemProps {
sides: Array<Sides>
}
const SideItem: React.... | 2,993 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/sidebar/sidebar-skeleton.tsx | import React, { useEffect, useState } from 'react'
import useTheme from 'components/use-theme'
const DEFAULT_OPACITY = 0.75
const LOADING_OPACITY = 0.45
const SidebarSkeleton: React.FC<unknown> = () => {
const theme = useTheme()
const [opacity, setOpacity] = useState(DEFAULT_OPACITY)
useEffect(() => {
const... | 2,994 |
0 | petrpan-code/geist-org/geist-ui/lib/components/layout | petrpan-code/geist-org/geist-ui/lib/components/layout/sidebar/sidebar.tsx | import React, { useEffect, useMemo, useRef } from 'react'
import Router from 'next/router'
import { useTheme, Spacer } from 'components'
import SideItem, { Sides } from './side-item'
import useLocale from 'lib/use-locale'
import { useConfigs } from 'lib/config-context'
import Metadata from 'lib/data'
export interface ... | 2,995 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/mdx-widgets/README.md | ## MDX Widgets
These components are used as examples for mdx files, please do not refer to this content for other components in the `lib` folder.
| 2,996 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/mdx-widgets/example-block.tsx | import React, { useMemo } from 'react'
import useTheme from 'components/use-theme'
import { GeistUIThemes } from 'components/themes/presets'
const defaultProps = {
plain: false,
}
export type ExampleBlockProps = {
plain?: number | boolean
}
const getBackground = (theme: GeistUIThemes, plain: number | boolean) =>... | 2,997 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/mdx-widgets/grid-demo.tsx | import React from 'react'
import { useTheme } from 'components'
import { addColorAlpha } from 'components/utils/color'
const GridDemo: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => {
const theme = useTheme()
const bgColor = addColorAlpha(theme.palette.accents_2, 0.5)
return (
<div className=... | 2,998 |
0 | petrpan-code/geist-org/geist-ui/lib/components | petrpan-code/geist-org/geist-ui/lib/components/mdx-widgets/home-cell.tsx | import React from 'react'
import { Card, Link, useTheme } from 'components'
import NextLink from 'next/link'
export type HomeCellProps = {
url: string
title: string
desc: string
icon: React.ReactNode
}
const HomeCell: React.FC<HomeCellProps> = ({ url, title, desc, icon }) => {
const theme = useTheme()
ret... | 2,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.