neue Homepage auf react basis

This commit is contained in:
2026-08-07 21:39:30 +02:00
parent 164bdd19ad
commit ee89442c04
52191 changed files with 1230242 additions and 58 deletions
@@ -0,0 +1,32 @@
import type { OverridableStringUnion } from '@mui/types';
export interface BreakpointOverrides {}
export type Breakpoint = OverridableStringUnion<'xs' | 'sm' | 'md' | 'lg' | 'xl', BreakpointOverrides>;
export declare const breakpointKeys: Breakpoint[];
export interface Breakpoints {
keys: Breakpoint[];
values: { [key in Breakpoint]: number };
up: (key: Breakpoint | number) => string;
down: (key: Breakpoint | number) => string;
between: (start: Breakpoint | number, end: Breakpoint | number) => string;
only: (key: Breakpoint) => string;
not: (key: Breakpoint) => string;
unit?: string | undefined;
/**
* @ignore - Do not document.
*/
internal_mediaKeys: string[];
}
export interface BreakpointsOptions extends Partial<Breakpoints> {
/**
* The increment divided by 100 used to implement exclusive breakpoints.
* For example, `step: 5` means that `down(500)` will result in `'(max-width: 499.95px)'`.
* @default 5
*/
step?: number | undefined;
/**
* The unit used for the breakpoint's values.
* @default 'px'
*/
unit?: string | undefined;
}
export default function createBreakpoints(breakpoints: BreakpointsOptions): Breakpoints;
@@ -0,0 +1,32 @@
import type { OverridableStringUnion } from '@mui/types';
export interface BreakpointOverrides {}
export type Breakpoint = OverridableStringUnion<'xs' | 'sm' | 'md' | 'lg' | 'xl', BreakpointOverrides>;
export declare const breakpointKeys: Breakpoint[];
export interface Breakpoints {
keys: Breakpoint[];
values: { [key in Breakpoint]: number };
up: (key: Breakpoint | number) => string;
down: (key: Breakpoint | number) => string;
between: (start: Breakpoint | number, end: Breakpoint | number) => string;
only: (key: Breakpoint) => string;
not: (key: Breakpoint) => string;
unit?: string | undefined;
/**
* @ignore - Do not document.
*/
internal_mediaKeys: string[];
}
export interface BreakpointsOptions extends Partial<Breakpoints> {
/**
* The increment divided by 100 used to implement exclusive breakpoints.
* For example, `step: 5` means that `down(500)` will result in `'(max-width: 499.95px)'`.
* @default 5
*/
step?: number | undefined;
/**
* The unit used for the breakpoint's values.
* @default 'px'
*/
unit?: string | undefined;
}
export default function createBreakpoints(breakpoints: BreakpointsOptions): Breakpoints;
@@ -0,0 +1,91 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.breakpointKeys = void 0;
exports.default = createBreakpoints;
// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
const breakpointKeys = exports.breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];
// Keep in sync with docs/src/pages/customization/breakpoints/breakpoints.md
// #host-reference
const sortBreakpointsValues = values => {
const breakpointsAsArray = Object.keys(values).map(key => ({
key,
val: values[key]
})) || [];
// Sort in ascending order
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
return breakpointsAsArray.reduce((acc, obj) => {
return {
...acc,
[obj.key]: obj.val
};
}, {});
};
// Keep in mind that @media is inclusive by the CSS specification.
function createBreakpoints(breakpoints) {
const {
values = {
xs: 0,
sm: 600,
md: 900,
lg: 1200,
xl: 1536
},
unit = 'px',
step = 5,
...other
} = breakpoints;
const sortedValues = sortBreakpointsValues(values);
const keys = Object.keys(sortedValues);
function up(key) {
const value = typeof values[key] === 'number' ? values[key] : key;
return `@media (min-width:${value}${unit})`;
}
function down(key) {
const value = typeof values[key] === 'number' ? values[key] : key;
return `@media (max-width:${value - step / 100}${unit})`;
}
function between(start, end) {
const endIndex = keys.indexOf(end);
return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
}
function only(key) {
if (keys.indexOf(key) + 1 < keys.length) {
return between(key, keys[keys.indexOf(key) + 1]);
}
return up(key);
}
function not(key) {
// handle first and last key separately, for better readability
const keyIndex = keys.indexOf(key);
if (keyIndex === 0) {
return up(keys[1]);
}
if (keyIndex === keys.length - 1) {
return down(keys[keyIndex]);
}
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
}
const mediaKeys = [];
for (let i = 0; i < keys.length; i += 1) {
mediaKeys.push(up(keys[i]));
}
return {
keys: keys,
values: sortedValues,
up,
down,
between,
only,
not,
unit,
internal_mediaKeys: mediaKeys,
...other
};
}
@@ -0,0 +1,84 @@
// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
export const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];
// Keep in sync with docs/src/pages/customization/breakpoints/breakpoints.md
// #host-reference
const sortBreakpointsValues = values => {
const breakpointsAsArray = Object.keys(values).map(key => ({
key,
val: values[key]
})) || [];
// Sort in ascending order
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
return breakpointsAsArray.reduce((acc, obj) => {
return {
...acc,
[obj.key]: obj.val
};
}, {});
};
// Keep in mind that @media is inclusive by the CSS specification.
export default function createBreakpoints(breakpoints) {
const {
values = {
xs: 0,
sm: 600,
md: 900,
lg: 1200,
xl: 1536
},
unit = 'px',
step = 5,
...other
} = breakpoints;
const sortedValues = sortBreakpointsValues(values);
const keys = Object.keys(sortedValues);
function up(key) {
const value = typeof values[key] === 'number' ? values[key] : key;
return `@media (min-width:${value}${unit})`;
}
function down(key) {
const value = typeof values[key] === 'number' ? values[key] : key;
return `@media (max-width:${value - step / 100}${unit})`;
}
function between(start, end) {
const endIndex = keys.indexOf(end);
return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
}
function only(key) {
if (keys.indexOf(key) + 1 < keys.length) {
return between(key, keys[keys.indexOf(key) + 1]);
}
return up(key);
}
function not(key) {
// handle first and last key separately, for better readability
const keyIndex = keys.indexOf(key);
if (keyIndex === 0) {
return up(keys[1]);
}
if (keyIndex === keys.length - 1) {
return down(keys[keyIndex]);
}
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
}
const mediaKeys = [];
for (let i = 0; i < keys.length; i += 1) {
mediaKeys.push(up(keys[i]));
}
return {
keys: keys,
values: sortedValues,
up,
down,
between,
only,
not,
unit,
internal_mediaKeys: mediaKeys,
...other
};
}
+2
View File
@@ -0,0 +1,2 @@
/** This export is intended for internal integration with Pigment CSS */
export { default as unstable_createBreakpoints } from "./createBreakpoints.mjs";
+2
View File
@@ -0,0 +1,2 @@
/** This export is intended for internal integration with Pigment CSS */
export { default as unstable_createBreakpoints } from "./createBreakpoints.js";
+13
View File
@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "unstable_createBreakpoints", {
enumerable: true,
get: function () {
return _createBreakpoints.default;
}
});
var _createBreakpoints = _interopRequireDefault(require("./createBreakpoints"));
+3
View File
@@ -0,0 +1,3 @@
/** This export is intended for internal integration with Pigment CSS */
/* eslint-disable import/prefer-default-export */
export { default as unstable_createBreakpoints } from "./createBreakpoints.mjs";