index int64 0 0 | repo_id stringclasses 14
values | file_path stringlengths 36 106 | content stringlengths 50 4.96M | __index_level_0__ int64 0 99 |
|---|---|---|---|---|
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.browserslistrc | [modern]
last 1 chrome version
last 1 edge version
last 1 firefox version
last 1 safari version
node 14
# Default/Fallback
# `npx browserslist --mobile-to-desktop "> 0.5%, last 2 versions, Firefox ESR, not dead, not IE 11"` when the last major is released.
# Manually downgrading to ios_saf 12.4 for iPhone 6 and webpac... | 0 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.editorconfig | # EditorConfig is awesome: https://editorconfig.org/
# top-most EditorConfig file
root = true
[*.md]
trim_trailing_whitespace = false
[*.js]
trim_trailing_whitespace = true
# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_n... | 1 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.eslintignore | /.git
/.yarn
/benchmark/**/dist
/coverage
/docs/export
/docs/pages/playground/
/examples/material-ui-cra*/src/serviceWorker.js
/examples/material-ui-gatsby/public/
/examples/material-ui-preact/config
/examples/material-ui-preact/scripts
/examples/material-ui-nextjs/src
/packages/mui-codemod/lib
/packages/mui-codemod/sr... | 2 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.eslintrc.js | const path = require('path');
const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style');
const forbidTopLevelMessage = [
'Prefer one level nested imports to avoid bundling everything in dev mode',
'See https://github.com/mui/material-ui/pull/24147 for the kind of win it can unlock.',
].joi... | 3 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.markdownlint-cli2.cjs | const straightQuotes = require('./packages/markdownlint-rule-mui/straight-quotes');
const gitDiff = require('./packages/markdownlint-rule-mui/git-diff');
const tableAlignment = require('./packages/markdownlint-rule-mui/table-alignment');
const terminalLanguage = require('./packages/markdownlint-rule-mui/terminal-langua... | 4 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.mocharc.js | module.exports = {
extension: ['js', 'mjs', 'ts', 'tsx'],
ignore: [
'**/build/**',
'**/node_modules/**',
// Mocha seems to ignore .next anyway (maybe because dotfiles?).
// We're leaving this to make sure.
'docs/.next/**',
],
recursive: true,
timeout: (process.env.CIRCLECI === 'true' ? 5 :... | 5 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.stylelintrc.js | module.exports = {
extends: 'stylelint-config-standard',
ignoreFiles: [
// TypeScript declaration files contain no styles.
// Stylelint is also reporting parseError on `docs/types/react-docgen.d.ts`.
'**/*.d.ts',
],
rules: {
'alpha-value-notation': null,
'custom-property-pattern': null,
... | 6 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.tidelift.yml | ci:
platform:
npm:
# Don't run unmainted test on nomnom, it's only used by build tools, not in MUI.
nomnom:
tests:
unmaintained: skip
# Don't run vulnerabity test on os-locale, it's only used by yargs in build tools, not in MUI.
os-locale:
tests:
vulnera... | 7 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.vale.ini | # Config vale. More information at https://docs.errata.ai/vale/config
StylesPath = .github/styles
MinAlertLevel = suggestion
Packages = Google
[*.md]
# Ignore code injection which start with {{...
BlockIgnores = {{.*
# Custom syle
# BasedOnStyles = Blog
Blog.ComposedWords = YES
Blog.NamingConventions = YES
Blog.Typ... | 8 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/.yarnrc | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
network-timeout 150000
yarn-path ".yarn/releases/yarn-1.22.19.js"
| 9 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/CHANGELOG.md | # [Versions](https://mui.com/versions/)
## 5.14.18
<!-- generated comparing v5.14.17..master -->
_Nov 14, 2023_
A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
- 💫 Introduced new [Stepper](https://mui.com/joy-ui/react-stepper/) component in Joy UI (#39688) @siriwatk... | 10 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/CHANGELOG.old.md | <!-- markdownlint-capture -->
<!-- markdownlint-disable -->
## 4.12.3
<!-- markdownlint-restore -->
<!-- generated comparing v4.12.2..master -->
_Jul 27, 2021_
### `@material-ui/core@4.12.3`
- <!-- 2 --> [AccordionSummary] Fix false-positive propType warning with `disableGeneration` (#27385) @eps1lon
- <!-- 7 --> ... | 11 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/CONTRIBUTING.md | # Contributing to MUI
If you're reading this, you're awesome!
Thank you for being a part of the MUI community and helping us make these projects great.
Here are a few guidelines that will help you along the way.
## Summary
- [Code of conduct](#code-of-conduct)
- [A large spectrum of contributions](#a-large-spectrum-... | 12 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/LICENSE | The MIT License (MIT)
Copyright (c) 2014 Call-Em-All
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publ... | 13 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/README.md | <!-- markdownlint-disable-next-line -->
<p align="center">
<a href="https://mui.com/core/" rel="noopener" target="_blank"><img width="150" height="133" src="https://mui.com/static/logo.svg" alt="MUI Core logo"></a>
</p>
<h1 align="center">MUI Core</h1>
**MUI Core** contains foundational React UI component libraries... | 14 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/SECURITY.md | # Security policy
## Supported versions
The versions of the project that are currently supported with security updates.
| Version | Supported |
| ------: | :----------------- |
| 5.x | :white_check_mark: |
| 4.x | :white_check_mark: |
| < 4.0 | :x: |
## Reporting a vulnerability
Y... | 15 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/TYPESCRIPT_CONVENTION.md | # TypeScript convention
## Component
> **Public components** are considered all components exported from `@mui/material` or `@mui/lab`.
>
> **Internal components** are considered all components that are not exported from the packages, but only used in some public component.
### `Props Interface`
- export interface ... | 16 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/babel.config.js | const path = require('path');
const errorCodesPath = path.resolve(__dirname, './docs/public/static/error-codes.json');
const missingError = process.env.MUI_EXTRACT_ERROR_CODES === 'true' ? 'write' : 'annotate';
function resolveAliasPath(relativeToBabelConf) {
const resolvedPath = path.relative(process.cwd(), path.r... | 17 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/codecov.yml | coverage:
status:
project:
default:
target: auto
threshold: 1%
patch: off
comment: false
| 18 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/crowdin.yml | commit_message: '[skip ci]'
pull_request_title: '[docs] Sync translations with Crowdin'
pull_request_labels: [l10n]
files:
- source: /docs/src/**/*.md
ignore:
- /**/%file_name%-%two_letters_code%.md
- /docs/src/pages/getting-started/templates/*/**/*
- /docs/src/pages/premium-themes/*/**/*
... | 19 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/dangerfile.ts | // inspire by reacts dangerfile
// danger has to be the first thing required!
import { danger, markdown } from 'danger';
import { exec } from 'child_process';
import { loadComparison } from './scripts/sizeSnapshot';
import replaceUrl from './packages/api-docs-builder/utils/replaceUrl';
const circleCIBuildNumber = proc... | 20 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/lerna.json | {
"npmClient": "yarn",
"version": "independent",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
| 21 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/netlify.toml | [build]
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
publish = "docs/export/"
# Default build command.
command = "yarn docs:build && yarn docs:ex... | 22 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/nx.json | {
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build"]
}
}
}
}
| 23 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/package.json | {
"name": "@mui/monorepo",
"version": "5.14.18",
"private": true,
"scripts": {
"proptypes": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./scripts/generateProptypes.ts",
"deduplicate": "node scripts/deduplicate.mjs",
"benchmark:browser": "yarn workspace benchmark browser... | 24 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/prettier.config.js | module.exports = {
printWidth: 100,
singleQuote: true,
trailingComma: 'all',
overrides: [
{
files: ['docs/**/*.md', 'docs/src/pages/**/*.{js,tsx}', 'docs/data/**/*.{js,tsx}'],
options: {
// otherwise code blocks overflow on the docs website
// The container is 751px
print... | 25 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/renovate.json | {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": false,
"commitMessageAction": "Bump",
"commitMessageExtra": "to {{newValue}}",
"commitMessageTopic": "{{depName}}",
"dependencyDashboard": true,
"rebaseWhen": "conflicted",
"ignoreDeps": [],
"labels": ["dependencies"],
"l... | 26 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/tsconfig.json | {
"compilerOptions": {
"module": "esnext",
"target": "es5",
"lib": ["es2020", "dom"],
"jsx": "preserve",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noEmit": true,
"experimentalDecorators": true,
"baseUrl": "./",
"allowSyntheticDef... | 27 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/tslint.json | {
"defaultSeverity": "error",
"extends": ["dtslint/dtslint.json"],
"jsRules": {},
"rules": {
// $ExpectError -> @ts-expect-error
// $ExpectType -> `expectType` from `@mui/types`
// Don't disable this rule unless you made sure `tsc` runs on the same files
// Otherwise some files won't be type-che... | 28 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/vercel.json | {
"github": {
"autoJobCancelation": false,
"silent": true
},
"public": true,
"trailingSlash": true
}
| 29 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/webpackBaseConfig.js | const path = require('path');
// WARNING: Use this module only as an inspiration.
// Cherry-pick the parts you need and inline them in the webpack.config you need.
// This module isn't used to build the documentation. We use Next.js for that.
// This module is used by the visual regression tests to run the demos and b... | 30 |
0 | petrpan-code/mui | petrpan-code/mui/material-ui/yarn.lock | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@aashutoshrathi/word-wrap@^1.2.3":
version "1.2.6"
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A... | 31 |
0 | petrpan-code/mui/material-ui | petrpan-code/mui/material-ui/.circleci/config.yml | version: 2.1
orbs:
aws-cli: circleci/aws-cli@4.1
aws-s3: circleci/aws-s3@4.0
parameters:
browserstack-force:
description: Whether to force browserstack usage. We have limited resources on browserstack so the pipeline might decide to skip browserstack if this parameter isn't set to true.
type: boolean
... | 32 |
0 | petrpan-code/mui/material-ui | petrpan-code/mui/material-ui/.codesandbox/ci.json | {
"buildCommand": "build:codesandbox",
"installCommand": "install:codesandbox",
"node": "18",
"packages": [
"packages/mui-material",
"packages/mui-codemod",
"packages/mui-icons-material",
"packages/mui-lab",
"packages/mui-styles",
"packages/mui-system",
"packages/mui-private-theming"... | 33 |
0 | petrpan-code/mui/material-ui | petrpan-code/mui/material-ui/.vscode/extensions.json | {
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode",
"yoavbls.pretty-ts-errors"
]
}
| 34 |
0 | petrpan-code/mui/material-ui | petrpan-code/mui/material-ui/.vscode/launch.json | {
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Test Current File",
"program": "test/cli.js",
"args": ["${relativeFile}", "--inspecting"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOpt... | 35 |
0 | petrpan-code/mui/material-ui/.yarn | petrpan-code/mui/material-ui/.yarn/releases/yarn-1.22.19.js | #!/usr/bin/env node
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(install... | 36 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/local-library/index.d.ts | export const bounceAnim: string;
export const Button: React.ComponentType<
JSX.IntrinsicElements['button'] & {
isRed?: boolean;
}
>;
| 37 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/local-library/index.js | import { keyframes, styled } from '@mui/zero-runtime';
export const bounceAnim = keyframes({
'from, 20%, 53%, 80%, to': {
transform: 'translate3d(0,0,0)',
},
'40%, 43%': {
transform: 'translate3d(0, -30px, 0)',
},
'70%': {
transform: 'translate3d(0, -15px, 0)',
},
'90%': {
transform: 'tra... | 38 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/local-library/package.json | {
"name": "local-ui-lib",
"version": "0.0.0",
"dependencies": {
"zero-runtime": "*"
}
}
| 39 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/.eslintrc.json | {
"rules": {
"react/react-in-jsx-scope": "off"
}
}
| 40 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/README.md | # Next App
A sample vite application to test the working of zero runtime library.
This project is not part of the workspace yet.
## How to run
You can either `yarn build` command to build all the packages, or you need to build, the the minimum -
1. `@mui/zero-runtime`
2. `@mui/zero-tag-processor`
3. `@mui/zero-next... | 41 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/next.config.js | const { createTheme } = require('@mui/material/styles');
const withZero = require('@mui/zero-next-plugin').default;
const theme = createTheme({
typography: {
fontFamilyCode: 'Menlo,Consolas,"Droid Sans Mono",monospace',
},
});
// @TODO - Make this part of the main package
theme.applyDarkStyles = function apply... | 42 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/package.json | {
"name": "@app/zero-runtime-next-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@mui/base": "file:../../packages/mui-base/build",
"@mui/material": "file:../../packages/mui... | 43 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/tsconfig.json | {
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules":... | 44 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/public/next.svg | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="... | 45 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/public/vercel.svg | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-1... | 46 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/extend-zero.d.ts | import type { Theme } from '@mui/material/styles';
declare module '@mui/zero-runtime/theme' {
interface ThemeArgs {
theme: Theme & {
applyDarkStyles<T>(obj: T): Record<string, T>;
vars?: Theme;
};
}
}
declare module '@mui/material' {
interface Palette {
Slider: Record<string, string>;
... | 47 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/app/globals.css | @import '~@mui/zero-runtime/styles.css';
:root {
--max-width: 1100px;
--border-radius: 12px;
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono',
'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono',
'Courier New', monospace;
--fore... | 48 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/app/layout.tsx | import './globals.css';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
const inter = Inter({ subsets: ['latin'] });
export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
};
export default function RootLayout({ children }: { chi... | 49 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/app/page.module.css | .logo {
position: relative;
}
@media (prefers-color-scheme: dark) {
.vercelLogo {
filter: invert(1);
}
.logo {
filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70);
}
}
@keyframes rotate {
from {
transform: rotate(360deg);
}
to {
transform: rotate(0deg);
}
}
| 50 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/app/page.tsx | import Image from 'next/image';
import { styled } from '@mui/zero-runtime';
import Link from 'next/link';
import styles from './page.module.css';
import Grid from '../components/Grid';
export const Main = styled('main')({
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
alignItems: 'c... | 51 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/app | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/app/slider/page.tsx | import { styled } from '@mui/zero-runtime';
import { Main as BaseMain } from '../page';
import SliderWrapper from '../../components/SliderWrapper';
const Main = styled(BaseMain)({
padding: '1rem',
});
export default function Slider() {
return (
<Main sx={{ padding: '2rem' }}>
<div style={{ width: '100%'... | 52 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/components/Grid.tsx | import { styled } from '@mui/zero-runtime';
const Grid = styled('div')(({ theme }) => ({
display: 'grid',
gridTemplateColumns: 'repeat(4, minmax(25%, auto))',
maxWidth: '100%',
width: 'var(--max-width)',
[theme.breakpoints.down(700.05)]: {
gridTemplateColumns: '1fr',
marginBottom: '120px',
maxWid... | 53 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/components/SliderWrapper.tsx | 'use client';
import * as React from 'react';
import { styled } from '@mui/zero-runtime';
import Slider from './Slider/ZeroSlider';
import { HalfWidth } from './Grid';
const Button = styled('button', {
name: 'MuiButton',
slot: 'Root',
})<{ isRed?: boolean }>(
({ theme }) => ({
fontFamily: 'sans-serif',
b... | 54 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/components | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/components/Slider/ZeroSlider.tsx | 'use-client';
import * as React from 'react';
import clsx from 'clsx';
import { unstable_composeClasses as composeClasses } from '@mui/utils';
import {
type SliderOwnerState,
type SliderProps,
sliderClasses,
getSliderUtilityClass,
} from '@mui/material/Slider';
import { isHostComponent, useSlotProps } from '@m... | 55 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/components | petrpan-code/mui/material-ui/apps/zero-runtime-next-app/src/components/utils/colorManipulator.js | /**
* Returns a number whose value is limited to the given range.
* @param {number} value The value to be clamped
* @param {number} min The lower boundary of the output range
* @param {number} max The upper boundary of the output range
* @returns {number} A number in the range [min, max]
*/
function clamp(value, ... | 56 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/.babelrc | {
"presets": [
"@babel/preset-react",
["@babel/preset-env", { "targets": { "node": "current" } }],
"@babel/preset-typescript"
]
}
| 57 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/.eslintrc | {
"env": {
"jest": true
},
"rules": {
"react/react-in-jsx-scope": "off"
}
}
| 58 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/README.md | # Vite App
A sample vite application to test the working of zero runtime library.
This project is not part of the workspace yet.
## How to run
You can either run `yarn release:build` command to build all the packages, or you need to build, the the minimum -
1. `@mui/zero-runtime`
2. `@mui/zero-tag-processor`
3. `@m... | 59 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/index.html | <div id="root"></div>
<script type="module" src="./src/main.tsx"></script>
| 60 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/jest.config.js | // Mandatory to map so that the imports translate to cjs files
// eslint-disable-next-line import/no-unresolved
const { createTheme } = require('@mui/material/node/styles');
const theme = createTheme();
// @TODO - Make this part of the main package
// @ts-ignore
theme.applyDarkStyles = function applyDarkStyles(obj) {
... | 61 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/package.json | {
"name": "@app/zero-runtime-vite-app",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"test": "vitest"
},
"dependencies": {
"@mui/zero-runtime": "file:../../packages/zero-runtime/build",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devD... | 62 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/tsconfig.json | {
"include": ["src", "vite.config.ts"],
"compilerOptions": {
"composite": true,
"isolatedModules": true,
"moduleResolution": "node",
"module": "ESNext",
/* files are emitted by babel */
"noEmit": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"esModuleInterop": true,
"ty... | 63 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/vite-env.d.ts | /// <reference types="vite/client" />
/// <reference types="vitest" />
| 64 |
0 | petrpan-code/mui/material-ui/apps | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/vite.config.ts | import { join, dirname, basename } from 'node:path';
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import { UserConfig as VitestConfig } from 'vitest';
import reactPlugin from '@vitejs/plugin-react';
import { zeroVitePlugin } from '@mui/zero-vite-plugin';
import { createTheme } from '@mui/material/styles... | 65 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src/App.tsx | import * as React from 'react';
import { styled } from '@mui/zero-runtime';
import { Button, bounceAnim } from 'local-library';
import Slider from './Slider/ZeroSlider';
const ShowCaseDiv = styled('div')({
[`.${Button}`]: {
color: '#f94564',
},
});
const HalfWidth = styled.div({
marginLeft: 20,
width: '50... | 66 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src/component.tsx | import { styled } from '@mui/zero-runtime';
export function Component() {
return null;
}
export const Component2 = styled('div')({
color: 'red',
});
| 67 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src/extend-zero.d.ts | import type { Theme } from '@mui/material/styles';
declare module '@mui/zero-runtime/theme' {
interface ThemeArgs {
theme: Theme & {
applyDarkStyles<T>(obj: T): Record<string, T>;
vars?: Theme;
};
}
}
declare module '@mui/material' {
interface Palette {
Slider: Record<string, string>;
... | 68 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src/main.tsx | import '@mui/zero-runtime/styles.css';
import * as ReactDOMClient from 'react-dom/client';
import App from './App';
const root = ReactDOMClient.createRoot(document.getElementById('root') as HTMLElement);
root.render(<App />);
| 69 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src/Slider/ZeroSlider.test.jsx | /* eslint-disable react/jsx-filename-extension */
import * as React from 'react';
import { render } from '@testing-library/react';
import Slider from './ZeroSlider';
describe('Slider', () => {
it('should render', () => {
const { rerender, container } = render(<Slider />);
const root = container.getElementsB... | 70 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src/Slider/ZeroSlider.tsx | import * as React from 'react';
import clsx from 'clsx';
import { unstable_composeClasses as composeClasses } from '@mui/utils';
import {
type SliderOwnerState,
type SliderProps,
sliderClasses,
getSliderUtilityClass,
} from '@mui/material/Slider';
import { isHostComponent, useSlotProps } from '@mui/base/utils';... | 71 |
0 | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src | petrpan-code/mui/material-ui/apps/zero-runtime-vite-app/src/utils/colorManipulator.js | /**
* Returns a number whose value is limited to the given range.
* @param {number} value The value to be clamped
* @param {number} min The lower boundary of the output range
* @param {number} max The upper boundary of the output range
* @returns {number} A number in the range [min, max]
*/
function clamp(value, ... | 72 |
0 | petrpan-code/mui/material-ui | petrpan-code/mui/material-ui/benchmark/package.json | {
"name": "benchmark",
"version": "5.0.0",
"private": true,
"scripts": {
"browser": "yarn webpack --config browser/webpack.config.js && node browser/scripts/benchmark.js",
"server:core": "cd ../ && cross-env NODE_ENV=production BABEL_ENV=benchmark babel-node benchmark/server/scenarios/core.js --inspect=... | 73 |
0 | petrpan-code/mui/material-ui/benchmark | petrpan-code/mui/material-ui/benchmark/browser/README.md | # Browser benchmark
This project is used when running the following command:
```bash
yarn benchmark:browser
```
It is suppose to give developers comparable values between running different scenarios inside the browser, that can be find the `./scenarios` folder.
You should use these numbers exclusively for comparing... | 74 |
0 | petrpan-code/mui/material-ui/benchmark | petrpan-code/mui/material-ui/benchmark/browser/index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Perf scenario</title>
<meta name="viewport" content="initial-scale=1, width=device-width" />
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<div id="root"></div>
<script src="/dist/inde... | 75 |
0 | petrpan-code/mui/material-ui/benchmark | petrpan-code/mui/material-ui/benchmark/browser/index.js | import * as React from 'react';
import * as ReactDOMClient from 'react-dom/client';
import PropTypes from 'prop-types';
import { logReactMetrics } from './utils';
// Get all the scenarios
const requirePerfScenarios = require.context('./scenarios', true, /(js|ts|tsx)$/);
const rootEl = document.getElementById('root');... | 76 |
0 | petrpan-code/mui/material-ui/benchmark | petrpan-code/mui/material-ui/benchmark/browser/webpack.config.js | const path = require('path');
const workspaceRoot = path.resolve(__dirname, '../..');
// for babel.config.js
// webpack `mode: 'production'` does not affect NODE_ENV nor BABEL_ENV in babel-loader
process.env.NODE_ENV = 'production';
module.exports = {
context: workspaceRoot,
entry: 'benchmark/browser/index.js',
... | 77 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/box-baseline/index.js | import * as React from 'react';
import emotionStyled from '@emotion/styled';
const Box = emotionStyled('div')(({ css }) => css);
export default function BoxBaseline() {
return (
<React.Fragment>
{new Array(1000).fill().map(() => (
<Box
css={{
width: 200,
height: 2... | 78 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/box-chakra-ui/index.js | import * as React from 'react';
import { chakra } from '@chakra-ui/system';
const customTheme = {
breakpoints: ['40em', '52em', '64em'],
colors: {
text: '#000',
background: '#fff',
primary: '#33e',
},
};
customTheme.breakpoints.base = customTheme.breakpoints[0];
customTheme.breakpoints.sm = customTh... | 79 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/box-material-ui/index.js | import * as React from 'react';
import Box from '@mui/material/Box';
export default function SxPropBoxMaterialUI() {
return (
<React.Fragment>
{new Array(1000).fill().map(() => (
<Box
sx={{
width: 200,
height: 200,
borderWidth: '3px',
border... | 80 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/box-theme-ui/index.js | import * as React from 'react';
import { Box, ThemeUIProvider } from 'theme-ui';
const theme = {
breakpoints: ['40em', '52em', '64em'],
fonts: {
body: 'system-ui, sans-serif',
heading: '"Avenir Next", sans-serif',
monospace: 'Menlo, monospace',
},
colors: {
text: '#000',
background: '#fff',... | 81 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/components/index.js | import * as React from 'react';
const Div = React.forwardRef(function Div(props, ref) {
return <div ref={ref} {...props} />;
});
export default function Components() {
return (
<React.Fragment>
{new Array(1000).fill().map(() => (
<Div>test case</Div>
))}
</React.Fragment>
);
}
| 82 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/grid-material-ui/index.js | import * as React from 'react';
import Grid from '@mui/material/Grid';
export default function GridMaterialUI() {
return (
<Grid container spacing={2}>
{new Array(1000).fill().map(() => (
<Grid item xs={12} sm={6} md={4}>
test case
</Grid>
))}
</Grid>
);
}
| 83 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/grid-simple/index.js | import * as React from 'react';
import { styled } from '@mui/material/styles';
const Container = styled('div')({ display: 'flex', flexWrap: 'wrap', gap: 2 });
const Item = styled('div')(({ theme }) => ({
width: '100%',
[theme.breakpoints.up('sm')]: {
width: '50%',
},
[theme.breakpoints.up('md')]: {
wi... | 84 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/grid-system/index.js | import * as React from 'react';
import Grid from '@mui/system/Unstable_Grid';
export default function GridSystem() {
return (
<Grid container spacing={2}>
{new Array(1000).fill().map(() => (
<Grid xs={12} sm={6} md={4}>
test case
</Grid>
))}
</Grid>
);
}
| 85 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/make-styles/index.js | import * as React from 'react';
import { createTheme } from '@mui/material/styles';
import { makeStyles } from '@mui/styles';
const defaultTheme = createTheme();
const useStyles = makeStyles(
(theme) => ({
root: {
width: 200,
height: 200,
borderWidth: 3,
borderColor: 'white',
'&:ho... | 86 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/noop/index.js | export default function Noop() {
return null;
}
| 87 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/primitives/index.js | import * as React from 'react';
export default function Primitives() {
return (
<React.Fragment>
{new Array(1000).fill().map(() => (
<div>test case</div>
))}
</React.Fragment>
);
}
| 88 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/styled-components-box-material-ui-system/index.js | import * as React from 'react';
import { createTheme } from '@mui/material/styles';
import styledComponents, {
ThemeProvider as StyledComponentsThemeProvider,
} from 'styled-components';
import { spacing, palette, typography, compose } from '@mui/system';
const materialSystem = compose(palette, spacing, typography);... | 89 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/styled-components-box-styled-system/index.js | import * as React from 'react';
import { createTheme } from '@mui/material/styles';
import styledComponents, {
ThemeProvider as StyledComponentsThemeProvider,
} from 'styled-components';
import { space, color, fontFamily, fontSize, compose } from 'styled-system';
const styledSystem = compose(color, space, fontFamily... | 90 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/styled-emotion/index.js | import * as React from 'react';
import { createTheme } from '@mui/material/styles';
import emotionStyled from '@emotion/styled';
const Div = emotionStyled('div')(
({ theme }) => `
width: 200px;
height: 200px;
border-width: 3px;
border-color: white;
:hover {
background-color: ${theme.palette.secondary.d... | 91 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/styled-material-ui/index.js | import * as React from 'react';
import { styled } from '@mui/material/styles';
const Div = styled('div')(
({ theme }) => `
width: 200px;
height: 200px;
border-width: 3px;
border-color: white;
:hover {
background-color: ${theme.palette.secondary.dark};
}
${[theme.breakpoints.up('sm')]} {
backgro... | 92 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/styled-sc/index.js | import * as React from 'react';
import { createTheme } from '@mui/material/styles';
import styledComponents, {
ThemeProvider as StyledComponentsThemeProvider,
} from 'styled-components';
const Div = styledComponents('div')(
({ theme }) => `
width: 200px;
height: 200px;
border-width: 3px;
border-color: whit... | 93 |
0 | petrpan-code/mui/material-ui/benchmark/browser/scenarios | petrpan-code/mui/material-ui/benchmark/browser/scenarios/table-cell/index.js | import * as React from 'react';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
const data = { name: 'Frozen yoghurt', calories: 159... | 94 |
0 | petrpan-code/mui/material-ui/benchmark/browser | petrpan-code/mui/material-ui/benchmark/browser/scripts/benchmark.js | /* eslint-disable no-console */
/* eslint-disable no-await-in-loop */
const path = require('path');
const http = require('http');
const fse = require('fs-extra');
const playwright = require('playwright');
const handler = require('serve-handler');
const PORT = 1122;
function createServer(options) {
const { port } = ... | 95 |
0 | petrpan-code/mui/material-ui/benchmark/browser | petrpan-code/mui/material-ui/benchmark/browser/utils/index.js | /* eslint-disable import/prefer-default-export */
export const logReactMetrics = (
id, // the "id" prop of the Profiler tree that has just committed
phase, // either "mount" (if the tree just mounted) or "update" (if it re-rendered)
actualDuration, // time spent rendering the committed update
baseDuration, // ... | 96 |
0 | petrpan-code/mui/material-ui/benchmark | petrpan-code/mui/material-ui/benchmark/server/README.md | # MUI benchmark
## `@mui/material`
_Synthetic benchmark_
```bash
yarn server:core
ButtonBase x 40,724 ops/sec ±1.58% (189 runs sampled)
HocButton x 166,229 ops/sec ±1.04% (191 runs sampled)
NakedButton x 228,473 ops/sec ±0.99% (187 runs sampled)
ButtonBase enable ripple x 56,019 ops/sec ±0.87% (189 runs sampled)
Bu... | 97 |
0 | petrpan-code/mui/material-ui/benchmark/server | petrpan-code/mui/material-ui/benchmark/server/scenarios/core.js | /* eslint-disable no-console */
import Benchmark from 'benchmark';
import * as React from 'react';
import * as ReactDOMServer from 'react-dom/server';
import { StylesProvider } from '@mui/styles';
import ButtonBase from '@mui/material/ButtonBase';
const suite = new Benchmark.Suite('core', {
onError: (event) => {
... | 98 |
0 | petrpan-code/mui/material-ui/benchmark/server | petrpan-code/mui/material-ui/benchmark/server/scenarios/docs.js | /* eslint-disable no-console */
import fs from 'fs';
import path from 'path';
import Benchmark from 'benchmark';
import * as React from 'react';
import * as ReactDOMServer from 'react-dom/server';
import MarkdownElement from 'docs/src/modules/components/MarkdownElement';
import Markdown from 'docs/data/material/getting... | 99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.